@xpert-ai/chatkit-ui 0.3.5 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (338) hide show
  1. package/dist/app/assets/{_baseUniq-CAxobs9N.js → _baseUniq-DgbE-Zpp.js} +1 -1
  2. package/dist/app/assets/{abap-wdK8JaHa.js → abap-B0ywZp7w.js} +1 -1
  3. package/dist/app/assets/{abnf-B4QVrCDX.js → abnf-vKucRloH.js} +1 -1
  4. package/dist/app/assets/{actionscript-BbKSvJrq.js → actionscript-CvpjcrZC.js} +1 -1
  5. package/dist/app/assets/{ada-BkwiItKH.js → ada-DV5KTTo4.js} +1 -1
  6. package/dist/app/assets/{agda-BHGf_Fgl.js → agda-BTTYVnbo.js} +1 -1
  7. package/dist/app/assets/{al-CpdhQzD9.js → al-u-oZSiBm.js} +1 -1
  8. package/dist/app/assets/{antlr4-CLQ7xEno.js → antlr4-CY1PBdPM.js} +1 -1
  9. package/dist/app/assets/{apacheconf-6iBdrfFM.js → apacheconf-CIk6CfdC.js} +1 -1
  10. package/dist/app/assets/{apex-DBXBvaz5.js → apex-BdhgEWXC.js} +1 -1
  11. package/dist/app/assets/{apl-D8vc149P.js → apl-Mv4j7Tlu.js} +1 -1
  12. package/dist/app/assets/{applescript-BTZUYWS_.js → applescript-BnoQn48O.js} +1 -1
  13. package/dist/app/assets/{aql-BxB6KDJQ.js → aql-Do8Nhg8p.js} +1 -1
  14. package/dist/app/assets/{arc-CNi1G9DJ.js → arc-edZU_NW2.js} +1 -1
  15. package/dist/app/assets/{architectureDiagram-Q4EWVU46-BL0mPAR9.js → architectureDiagram-Q4EWVU46-Dtt89Y19.js} +1 -1
  16. package/dist/app/assets/{arduino-Cx04QCrp.js → arduino-C48-q0UX.js} +1 -1
  17. package/dist/app/assets/{arff-MqnrnEC8.js → arff-CvXAFvRm.js} +1 -1
  18. package/dist/app/assets/{asciidoc-sz7M5yXr.js → asciidoc-CA--68DS.js} +1 -1
  19. package/dist/app/assets/{asm6502-BZ8xfWko.js → asm6502-BcBLxpHN.js} +1 -1
  20. package/dist/app/assets/{asmatmel-D-cI_as7.js → asmatmel-CDMg3LIG.js} +1 -1
  21. package/dist/app/assets/{aspnet-wNdsZF1M.js → aspnet-BzZAtk5n.js} +1 -1
  22. package/dist/app/assets/{autohotkey-CERdGivs.js → autohotkey-C8WkQEjI.js} +1 -1
  23. package/dist/app/assets/{autoit-CQsoUza0.js → autoit-D5_mrv5m.js} +1 -1
  24. package/dist/app/assets/{avisynth-DMTk2nsi.js → avisynth-Dh_xask5.js} +1 -1
  25. package/dist/app/assets/{avro-idl-VdXZfwVL.js → avro-idl-AEaYO6yK.js} +1 -1
  26. package/dist/app/assets/{bash-BKoQnhB6.js → bash-RlP16Xm5.js} +1 -1
  27. package/dist/app/assets/{basic-BvRsQ9vo.js → basic-Xn_eY79M.js} +1 -1
  28. package/dist/app/assets/{batch-DkZb4POU.js → batch-B_zss_9m.js} +1 -1
  29. package/dist/app/assets/{bbcode-BkkYngk6.js → bbcode-D5qIIsoM.js} +1 -1
  30. package/dist/app/assets/{bicep-DY62eX6n.js → bicep-DFAY7lin.js} +1 -1
  31. package/dist/app/assets/{birb-Cf3Wn8DP.js → birb-DZZhpbmW.js} +1 -1
  32. package/dist/app/assets/{bison-CMVsgR8E.js → bison-B-dGF85b.js} +1 -1
  33. package/dist/app/assets/{blockDiagram-DXYQGD6D-DdgOXTCq.js → blockDiagram-DXYQGD6D-oXU3wiI6.js} +1 -1
  34. package/dist/app/assets/{bnf-C53AC5ba.js → bnf-6CRAamZR.js} +1 -1
  35. package/dist/app/assets/{brainfuck-DBcYtGip.js → brainfuck-CexdbLJh.js} +1 -1
  36. package/dist/app/assets/{brightscript-uWYyj7Le.js → brightscript-CaxTO5da.js} +1 -1
  37. package/dist/app/assets/{bro-Bnqn5jLn.js → bro-BRI4lLX7.js} +1 -1
  38. package/dist/app/assets/{bsl-eeHcx6I3.js → bsl-QOrG17u7.js} +1 -1
  39. package/dist/app/assets/{c-Y_E2ZZ8h.js → c-D3L-REE8.js} +1 -1
  40. package/dist/app/assets/{c4Diagram-AHTNJAMY-BAZeiIaA.js → c4Diagram-AHTNJAMY-zIBgyFbC.js} +1 -1
  41. package/dist/app/assets/{cfscript-swSriW5q.js → cfscript-CgDikVyK.js} +1 -1
  42. package/dist/app/assets/{chaiscript-BHR5pIfl.js → chaiscript-BPTekNbB.js} +1 -1
  43. package/dist/app/assets/channel-DJrI2Cpl.js +1 -0
  44. package/dist/app/assets/{chunk-4BX2VUAB-Deyo77pg.js → chunk-4BX2VUAB-C8q0nzRo.js} +1 -1
  45. package/dist/app/assets/{chunk-4TB4RGXK-BSgPz1Fn.js → chunk-4TB4RGXK-C8eclN6u.js} +1 -1
  46. package/dist/app/assets/{chunk-55IACEB6-DekOqO8-.js → chunk-55IACEB6-CC_AZKq2.js} +1 -1
  47. package/dist/app/assets/{chunk-EDXVE4YY-VI2aoR3H.js → chunk-EDXVE4YY-BKhbC1sp.js} +1 -1
  48. package/dist/app/assets/{chunk-FMBD7UC4-DVPMFZIh.js → chunk-FMBD7UC4-BuH_t_j-.js} +1 -1
  49. package/dist/app/assets/{chunk-OYMX7WX6-C_5OySCp.js → chunk-OYMX7WX6-DRM_T71-.js} +1 -1
  50. package/dist/app/assets/{chunk-QZHKN3VN-CQ4PJ94U.js → chunk-QZHKN3VN-BiziHb7K.js} +1 -1
  51. package/dist/app/assets/{chunk-YZCP3GAM-40VMFur6.js → chunk-YZCP3GAM-ns5Vk1f0.js} +1 -1
  52. package/dist/app/assets/{cil-BlB-Qnhz.js → cil-CQ1VUn3A.js} +1 -1
  53. package/dist/app/assets/classDiagram-6PBFFD2Q-DlrWIn_z.js +1 -0
  54. package/dist/app/assets/classDiagram-v2-HSJHXN6E-DlrWIn_z.js +1 -0
  55. package/dist/app/assets/{clike-cGW_OpAz.js → clike-Bk_7iChK.js} +1 -1
  56. package/dist/app/assets/{clojure-BwM8_y2w.js → clojure-oh6_RnlA.js} +1 -1
  57. package/dist/app/assets/clone-DypLoQyD.js +1 -0
  58. package/dist/app/assets/{cmake-B_tPIs0N.js → cmake-ySS0jC1Y.js} +1 -1
  59. package/dist/app/assets/{cobol-awMTn3SL.js → cobol-iXcezfTy.js} +1 -1
  60. package/dist/app/assets/{coffeescript-BdPUATdq.js → coffeescript-BUy0IOTJ.js} +1 -1
  61. package/dist/app/assets/{concurnas-DD4NroNG.js → concurnas-By_kYzwm.js} +1 -1
  62. package/dist/app/assets/{coq-WP9t6Mya.js → coq-DZiJnQYk.js} +1 -1
  63. package/dist/app/assets/{core-Dl1d1z_B.js → core-BjYqaHIK.js} +1 -1
  64. package/dist/app/assets/{cose-bilkent-S5V4N54A-CIsQWWLS.js → cose-bilkent-S5V4N54A-DRg86qAz.js} +1 -1
  65. package/dist/app/assets/{cpp-DRq2558J.js → cpp-fVJetTCh.js} +1 -1
  66. package/dist/app/assets/{crystal-CmMEvlYk.js → crystal-Dqa1FSjq.js} +1 -1
  67. package/dist/app/assets/{csharp-CmdWJQ_7.js → csharp-BEpd8Bfz.js} +1 -1
  68. package/dist/app/assets/{cshtml-D-PG0yKy.js → cshtml-cleS7x9a.js} +1 -1
  69. package/dist/app/assets/{csp-CoYEQK4_.js → csp-DJNuAuVo.js} +1 -1
  70. package/dist/app/assets/{css-extras-CvcfPwL5.js → css-extras-DqcDnxi2.js} +1 -1
  71. package/dist/app/assets/{css-qzCJaYzE.js → css-laKMA7ps.js} +1 -1
  72. package/dist/app/assets/{csv-BOSHHM-P.js → csv-CcsGtqB7.js} +1 -1
  73. package/dist/app/assets/{cypher-DF-LRYf2.js → cypher-tCYaF_sw.js} +1 -1
  74. package/dist/app/assets/{d-DT7HGItG.js → d-ZjP-D4jP.js} +1 -1
  75. package/dist/app/assets/{dagre-KV5264BT-BXDHR3FY.js → dagre-KV5264BT-BMg6cnfG.js} +1 -1
  76. package/dist/app/assets/{dart-C53tv9tc.js → dart-aEIC0xv8.js} +1 -1
  77. package/dist/app/assets/{dataweave-DfVl-B8U.js → dataweave-CM7DNyRc.js} +1 -1
  78. package/dist/app/assets/{dax-CtLDIvLu.js → dax-D-1tRMAS.js} +1 -1
  79. package/dist/app/assets/{dhall-B4vfpjKK.js → dhall-B4G6sh_3.js} +1 -1
  80. package/dist/app/assets/{diagram-5BDNPKRD-C2jQZSnh.js → diagram-5BDNPKRD-BGIhlwaI.js} +1 -1
  81. package/dist/app/assets/{diagram-G4DWMVQ6-DkBF8pst.js → diagram-G4DWMVQ6-CqKLelet.js} +1 -1
  82. package/dist/app/assets/{diagram-MMDJMWI5-DkBy1EJI.js → diagram-MMDJMWI5-2IpGHxI2.js} +1 -1
  83. package/dist/app/assets/{diagram-TYMM5635-BG7IFHFj.js → diagram-TYMM5635-_HRiSNgh.js} +1 -1
  84. package/dist/app/assets/{diff-CAGXr455.js → diff-CAWzHumm.js} +1 -1
  85. package/dist/app/assets/{django-Bt-Xandi.js → django-BLlxHysq.js} +1 -1
  86. package/dist/app/assets/{dns-zone-file-CUQqHN_u.js → dns-zone-file-Bu1BFi4x.js} +1 -1
  87. package/dist/app/assets/{docker-Cmx-jfGB.js → docker-DQtdSM6w.js} +1 -1
  88. package/dist/app/assets/{dot-CtNw9lX4.js → dot-M_8dtQ-J.js} +1 -1
  89. package/dist/app/assets/{ebnf-Dl_Q5Or1.js → ebnf-Bqjz4X_l.js} +1 -1
  90. package/dist/app/assets/{editorconfig-DZYXnV_C.js → editorconfig-H1gZsYaD.js} +1 -1
  91. package/dist/app/assets/{eiffel-CgccC4xz.js → eiffel-jToyfE3K.js} +1 -1
  92. package/dist/app/assets/{ejs-Cj1dQzfI.js → ejs-Xg8x_yq-.js} +1 -1
  93. package/dist/app/assets/{elixir-B3SWPivz.js → elixir-BG9SfjVk.js} +1 -1
  94. package/dist/app/assets/{elm-Bp_TQfaA.js → elm-7rvkjNwn.js} +1 -1
  95. package/dist/app/assets/{erDiagram-SMLLAGMA-Cby23XmU.js → erDiagram-SMLLAGMA-CwJ0JEfE.js} +1 -1
  96. package/dist/app/assets/{erb-Cb-K6pZE.js → erb-CipiWC9j.js} +1 -1
  97. package/dist/app/assets/{erlang-F72Fjwv2.js → erlang-DyGWgpYG.js} +1 -1
  98. package/dist/app/assets/{etlua-DFUJG9GZ.js → etlua-Ct6VkCC4.js} +1 -1
  99. package/dist/app/assets/{excel-formula-B8hn4WlO.js → excel-formula-CY9oxCkI.js} +1 -1
  100. package/dist/app/assets/{factor-BlEqbeI0.js → factor-DBGcEQMr.js} +1 -1
  101. package/dist/app/assets/{false-DMURsqlU.js → false-D7Yj-SPJ.js} +1 -1
  102. package/dist/app/assets/{firestore-security-rules-DswDVNNa.js → firestore-security-rules-BKeRzWep.js} +1 -1
  103. package/dist/app/assets/{flow-C4reo-gu.js → flow-BUWiIzEU.js} +1 -1
  104. package/dist/app/assets/{flowDiagram-DWJPFMVM-BxNNsar9.js → flowDiagram-DWJPFMVM-C3YhD-oq.js} +1 -1
  105. package/dist/app/assets/{fortran-BAmD5KHF.js → fortran-Bj52YXe0.js} +1 -1
  106. package/dist/app/assets/{fsharp-CPq2O12L.js → fsharp-DmCVgmnH.js} +1 -1
  107. package/dist/app/assets/{ftl-Cgbeq2-z.js → ftl-Cbmvxbh6.js} +1 -1
  108. package/dist/app/assets/{ganttDiagram-T4ZO3ILL-BLd3DH-5.js → ganttDiagram-T4ZO3ILL-D9xW5yhh.js} +1 -1
  109. package/dist/app/assets/{gap-Bge3tvcZ.js → gap-D23ZRtRz.js} +1 -1
  110. package/dist/app/assets/{gcode-CAVcsFdN.js → gcode-D5-N3nr_.js} +1 -1
  111. package/dist/app/assets/{gdscript-nkDP0xMM.js → gdscript-DWERnX-a.js} +1 -1
  112. package/dist/app/assets/{gedcom-BA8GnDnW.js → gedcom-Ck_Ym3Q2.js} +1 -1
  113. package/dist/app/assets/{gherkin-DvBWzm8E.js → gherkin-BksiIjs-.js} +1 -1
  114. package/dist/app/assets/{git-LJ9ums7L.js → git-CO1eb-gL.js} +1 -1
  115. package/dist/app/assets/{gitGraphDiagram-UUTBAWPF-JZEE6gBT.js → gitGraphDiagram-UUTBAWPF-DZLT8zDA.js} +1 -1
  116. package/dist/app/assets/{glsl-D4U4_9LH.js → glsl-CN-vqwC_.js} +1 -1
  117. package/dist/app/assets/{gml-CQtoiCZT.js → gml-J5W8Y4yz.js} +1 -1
  118. package/dist/app/assets/{gn-DxTb0Jqi.js → gn-D7Pv9idR.js} +1 -1
  119. package/dist/app/assets/{go-D7ELL60F.js → go-6Lw_nSyb.js} +1 -1
  120. package/dist/app/assets/{go-module-Ck8j-Kcm.js → go-module-BCe-jjCg.js} +1 -1
  121. package/dist/app/assets/{graph-pBSG-4mT.js → graph-BhsGz6M4.js} +1 -1
  122. package/dist/app/assets/{graphql-C-10AxQD.js → graphql-4_hbbnNw.js} +1 -1
  123. package/dist/app/assets/{groovy-SpWCEWzX.js → groovy-BZvyCoNS.js} +1 -1
  124. package/dist/app/assets/{haml-C2aM6_El.js → haml-MpET2CYX.js} +1 -1
  125. package/dist/app/assets/{handlebars-ChMYyLZl.js → handlebars-CMygNMyQ.js} +1 -1
  126. package/dist/app/assets/{haskell-DagwvSeE.js → haskell-H9hWCrb6.js} +1 -1
  127. package/dist/app/assets/{haxe-BG5B6d9K.js → haxe-DynXLs0c.js} +1 -1
  128. package/dist/app/assets/{hcl-B8Gd__02.js → hcl-DU8hXUXo.js} +1 -1
  129. package/dist/app/assets/{hlsl-CSu8CgjO.js → hlsl-BGurDJ01.js} +1 -1
  130. package/dist/app/assets/{hoon-BUjyY25K.js → hoon-Od_h6WWn.js} +1 -1
  131. package/dist/app/assets/{hpkp-C5yMlUDS.js → hpkp-CnNmkfHz.js} +1 -1
  132. package/dist/app/assets/{hsts-DzNiiTKI.js → hsts-DJA5z9FY.js} +1 -1
  133. package/dist/app/assets/{http-DYWI6rav.js → http-C2OpZukU.js} +1 -1
  134. package/dist/app/assets/{ichigojam-DrBDAbYO.js → ichigojam-CrG2EGSI.js} +1 -1
  135. package/dist/app/assets/{icon-BezsFCDL.js → icon-cOzaCn0m.js} +1 -1
  136. package/dist/app/assets/{icu-message-format-BCSOltos.js → icu-message-format-DDXTMDH-.js} +1 -1
  137. package/dist/app/assets/{idris-B8Tj6LSh.js → idris-CFY7Fru9.js} +1 -1
  138. package/dist/app/assets/{iecst-CfA7HSP8.js → iecst-DxqDXmAZ.js} +1 -1
  139. package/dist/app/assets/{ignore-E_v5CiMN.js → ignore-50gVavjI.js} +1 -1
  140. package/dist/app/assets/{index-CAv2vOlh.js → index-3vHiuCMV.js} +171 -171
  141. package/dist/app/assets/index-CY_xTM-7.css +1 -0
  142. package/dist/app/assets/{infoDiagram-42DDH7IO-eZsn31yB.js → infoDiagram-42DDH7IO-BhZutCsZ.js} +1 -1
  143. package/dist/app/assets/{inform7-Dj75C-lM.js → inform7-CwMWEErA.js} +1 -1
  144. package/dist/app/assets/{ini-DnYgp5_G.js → ini-Cj0QsVUh.js} +1 -1
  145. package/dist/app/assets/{io-D59cMlU5.js → io-CaTOfNpm.js} +1 -1
  146. package/dist/app/assets/{ishikawaDiagram-UXIWVN3A-Cb8G56a8.js → ishikawaDiagram-UXIWVN3A-JJt8O0hb.js} +1 -1
  147. package/dist/app/assets/{j-CuOplqKY.js → j-B9yG1_XZ.js} +1 -1
  148. package/dist/app/assets/{java-DiKpa4Y3.js → java-CcqZsJHc.js} +1 -1
  149. package/dist/app/assets/{javadoc-DshvkFVS.js → javadoc-BdkFH1qi.js} +1 -1
  150. package/dist/app/assets/{javadoclike-Dl0yZMbR.js → javadoclike-BBDtbsNc.js} +1 -1
  151. package/dist/app/assets/{javascript-C3lRkH0T.js → javascript-0ZJ71oW2.js} +1 -1
  152. package/dist/app/assets/{javastacktrace-BAZDNyis.js → javastacktrace-yNjh86GL.js} +1 -1
  153. package/dist/app/assets/{jexl-BvqPLTYh.js → jexl-BwLpMn8D.js} +1 -1
  154. package/dist/app/assets/{jolie-DXjsE0XX.js → jolie-BiDUXy8i.js} +1 -1
  155. package/dist/app/assets/{journeyDiagram-VCZTEJTY-9aLWSRay.js → journeyDiagram-VCZTEJTY-BkVWz3Vf.js} +1 -1
  156. package/dist/app/assets/{jq-CLFx4HBH.js → jq-CCJ3EBtV.js} +1 -1
  157. package/dist/app/assets/{js-extras-D33J2WNl.js → js-extras-Ck7OEXSL.js} +1 -1
  158. package/dist/app/assets/{js-templates-DlMN6fgo.js → js-templates-DjSt7lxm.js} +1 -1
  159. package/dist/app/assets/{jsdoc-CGVgLZ2j.js → jsdoc-BcTgtGoR.js} +1 -1
  160. package/dist/app/assets/{json-BTnVvJgU.js → json-tB4iX3yE.js} +1 -1
  161. package/dist/app/assets/{json5-BW8yCajk.js → json5-JIq4apAt.js} +1 -1
  162. package/dist/app/assets/{jsonp-iQTQx19C.js → jsonp-DKXtWLpG.js} +1 -1
  163. package/dist/app/assets/{jsstacktrace-DXxcFNfy.js → jsstacktrace-4bYPPqLT.js} +1 -1
  164. package/dist/app/assets/{jsx-D1npDekI.js → jsx-BgQQp2PC.js} +1 -1
  165. package/dist/app/assets/{julia-E711iN6A.js → julia-Dv7hfdzo.js} +1 -1
  166. package/dist/app/assets/{kanban-definition-6JOO6SKY-COnahS5T.js → kanban-definition-6JOO6SKY-CWuWLs3K.js} +1 -1
  167. package/dist/app/assets/{keepalived-Da5-tKqr.js → keepalived-C0mYwr0z.js} +1 -1
  168. package/dist/app/assets/{keyman-CR_is7Lf.js → keyman-BKpH4p1R.js} +1 -1
  169. package/dist/app/assets/{kotlin-6F8UihuI.js → kotlin-mOfhxbOx.js} +1 -1
  170. package/dist/app/assets/{kumir-BGVXhhZU.js → kumir-C6zx-0Ca.js} +1 -1
  171. package/dist/app/assets/{kusto-xzJ5QDBT.js → kusto-hO54CA70.js} +1 -1
  172. package/dist/app/assets/{latex-jsq1GqdL.js → latex-Dzk8WiHu.js} +1 -1
  173. package/dist/app/assets/{latte-CqObxNvY.js → latte-b3QfOSp4.js} +1 -1
  174. package/dist/app/assets/{layout-Od8azvI5.js → layout-DBe88OgK.js} +1 -1
  175. package/dist/app/assets/{less-vdQIwlhr.js → less-B4kl6C6H.js} +1 -1
  176. package/dist/app/assets/{lilypond-CYhZp9Do.js → lilypond-kwN07IjR.js} +1 -1
  177. package/dist/app/assets/{linear-BVmuh868.js → linear-DFqpmono.js} +1 -1
  178. package/dist/app/assets/{liquid-CF_8y_W1.js → liquid-CMRtVaic.js} +1 -1
  179. package/dist/app/assets/{lisp-DqmYhGox.js → lisp-D12Kpj2D.js} +1 -1
  180. package/dist/app/assets/{livescript-DEuoDOv7.js → livescript-CB8ITmGz.js} +1 -1
  181. package/dist/app/assets/{llvm-DlajzOZN.js → llvm-DBTCiFwL.js} +1 -1
  182. package/dist/app/assets/{log-CU2WH4Lm.js → log-BR6SSFh9.js} +1 -1
  183. package/dist/app/assets/{lolcode-CDbraZlO.js → lolcode-BuzAaCM6.js} +1 -1
  184. package/dist/app/assets/{lua-C7PRrDvP.js → lua-Ci_ub2Kx.js} +1 -1
  185. package/dist/app/assets/{magma-CEu2U_uQ.js → magma-DqKac23z.js} +1 -1
  186. package/dist/app/assets/{makefile-BpvnX-Nx.js → makefile-ClFyCfh0.js} +1 -1
  187. package/dist/app/assets/{markdown-BTkzQyNu.js → markdown-CJP4BvY0.js} +1 -1
  188. package/dist/app/assets/{markup-Dje0J_2C.js → markup-BqBuEoCj.js} +1 -1
  189. package/dist/app/assets/{markup-templating-cYyMwZ4b.js → markup-templating-gWox0fgS.js} +1 -1
  190. package/dist/app/assets/{matlab-RV1EEhcL.js → matlab-D8fITaV4.js} +1 -1
  191. package/dist/app/assets/{maxscript-Bo7lyT0p.js → maxscript-BONF8rMy.js} +1 -1
  192. package/dist/app/assets/{mel-kP-zTDHf.js → mel-C055oCEm.js} +1 -1
  193. package/dist/app/assets/{mermaid-D1yX-Bwv.js → mermaid-CJgXcURP.js} +1 -1
  194. package/dist/app/assets/{min-z4SxYbt2.js → min-C4k7eVH-.js} +1 -1
  195. package/dist/app/assets/{mindmap-definition-QFDTVHPH-Dm1nn9t1.js → mindmap-definition-QFDTVHPH-D5WLdtFz.js} +1 -1
  196. package/dist/app/assets/{mizar-DD-lNTs3.js → mizar-DfBcXuj4.js} +1 -1
  197. package/dist/app/assets/{mongodb-By_x69ne.js → mongodb-BBCH2cAI.js} +1 -1
  198. package/dist/app/assets/{monkey-CQneMnOq.js → monkey-5xytVR9c.js} +1 -1
  199. package/dist/app/assets/{moonscript-Cv1IiKWR.js → moonscript-DTD_dUoG.js} +1 -1
  200. package/dist/app/assets/{n1ql-BZ-dWxn_.js → n1ql-CKMBpvrf.js} +1 -1
  201. package/dist/app/assets/{n4js-aHhU-EQW.js → n4js-BLOx_BAB.js} +1 -1
  202. package/dist/app/assets/{nand2tetris-hdl-Ct9NqibY.js → nand2tetris-hdl-B-nkUk0U.js} +1 -1
  203. package/dist/app/assets/{naniscript-jrYYiXE3.js → naniscript-DFNNmSZZ.js} +1 -1
  204. package/dist/app/assets/{nasm-CR4fygO0.js → nasm-Bp0N-krf.js} +1 -1
  205. package/dist/app/assets/{neon-Bn9xaC-T.js → neon-CdOV9D5g.js} +1 -1
  206. package/dist/app/assets/{nevod-DwwkUQZl.js → nevod-BKMLRWeT.js} +1 -1
  207. package/dist/app/assets/{nginx-CxzxW55o.js → nginx-C53g3llS.js} +1 -1
  208. package/dist/app/assets/{nim-_ziHrYai.js → nim--ucdlwkH.js} +1 -1
  209. package/dist/app/assets/{nix-CnfynVyh.js → nix-2nB75Hnm.js} +1 -1
  210. package/dist/app/assets/{nsis-CTa60cBQ.js → nsis-Cg1me2qV.js} +1 -1
  211. package/dist/app/assets/{objectivec-CxzV-EqQ.js → objectivec-HgsJzBVJ.js} +1 -1
  212. package/dist/app/assets/{ocaml-CXQfo6wC.js → ocaml-B_DzHMGS.js} +1 -1
  213. package/dist/app/assets/{opencl-CdW2Jum5.js → opencl-DBy2C90-.js} +1 -1
  214. package/dist/app/assets/{openqasm-99txnqqb.js → openqasm-kR3M1YBJ.js} +1 -1
  215. package/dist/app/assets/{oz-CIEq0aNc.js → oz-CsEQzF2k.js} +1 -1
  216. package/dist/app/assets/{parigp-D9vfJxo4.js → parigp-C2gYP3BM.js} +1 -1
  217. package/dist/app/assets/{parser-DndpAxSG.js → parser-D7agmsnU.js} +1 -1
  218. package/dist/app/assets/{pascal-RZKxz-_c.js → pascal-Dk8h_JiR.js} +1 -1
  219. package/dist/app/assets/{pascaligo-B7sniYrp.js → pascaligo-DXayKpW1.js} +1 -1
  220. package/dist/app/assets/{pcaxis-B5p4fAPz.js → pcaxis-BbHDn4xw.js} +1 -1
  221. package/dist/app/assets/{peoplecode-fCeRfJQ5.js → peoplecode-DgWHb3qM.js} +1 -1
  222. package/dist/app/assets/{perl-CYh0437K.js → perl-BCQmJW3u.js} +1 -1
  223. package/dist/app/assets/{php-rTdvXKxw.js → php-Z7u6UBSf.js} +1 -1
  224. package/dist/app/assets/{php-extras-DCzP567Q.js → php-extras-Bbf1PJiM.js} +1 -1
  225. package/dist/app/assets/{phpdoc-BLbjAEWJ.js → phpdoc-BUdOOavZ.js} +1 -1
  226. package/dist/app/assets/{pieDiagram-DEJITSTG-BuH3UT8S.js → pieDiagram-DEJITSTG-Bk_gHD7q.js} +1 -1
  227. package/dist/app/assets/{plsql-B9JKIw1T.js → plsql-KN64tq9c.js} +1 -1
  228. package/dist/app/assets/{powerquery-Beeqnhtp.js → powerquery-DL49etLI.js} +1 -1
  229. package/dist/app/assets/{powershell-DofDkeyl.js → powershell-jryB4gBu.js} +1 -1
  230. package/dist/app/assets/{processing-C-Nru_27.js → processing-D-nRflir.js} +1 -1
  231. package/dist/app/assets/{prolog-Blc4S8Hs.js → prolog-J9p2Dtp3.js} +1 -1
  232. package/dist/app/assets/{promql-BsC9xRrD.js → promql-Bt3PTIs-.js} +1 -1
  233. package/dist/app/assets/{properties-BNFVcgDb.js → properties-DOzUf5m_.js} +1 -1
  234. package/dist/app/assets/{protobuf-BlpX_T1K.js → protobuf-CulfNgOj.js} +1 -1
  235. package/dist/app/assets/{psl-D2Hoa7_4.js → psl-UT93PnFk.js} +1 -1
  236. package/dist/app/assets/{pug-DBlY2nRe.js → pug-Ckrp6b5P.js} +1 -1
  237. package/dist/app/assets/{puppet-BfKwQiWD.js → puppet-wUZgXx_p.js} +1 -1
  238. package/dist/app/assets/{pure-CgWRG2Cz.js → pure-CNGrkBhJ.js} +1 -1
  239. package/dist/app/assets/{purebasic-C4IB7b6g.js → purebasic-CwWLgK7e.js} +1 -1
  240. package/dist/app/assets/{purescript-DpbOv2_5.js → purescript-BRm-R-3v.js} +1 -1
  241. package/dist/app/assets/{q-Bhw7S_Ff.js → q-wRiaQZTW.js} +1 -1
  242. package/dist/app/assets/{qml-BCy5slwb.js → qml-hZdBAFTK.js} +1 -1
  243. package/dist/app/assets/{qore-C00kyzGf.js → qore-Cye0wnFE.js} +1 -1
  244. package/dist/app/assets/{qsharp-CN2CDpkI.js → qsharp-DufTxaMQ.js} +1 -1
  245. package/dist/app/assets/{quadrantDiagram-34T5L4WZ-DF36QwGT.js → quadrantDiagram-34T5L4WZ-BSbm0wBP.js} +1 -1
  246. package/dist/app/assets/{r-B_BK6AZu.js → r-JhyQLVqm.js} +1 -1
  247. package/dist/app/assets/{racket-ByLawBwM.js → racket-CcEcl1lQ.js} +1 -1
  248. package/dist/app/assets/{reason-BDBRcGMx.js → reason-WFsaqaXn.js} +1 -1
  249. package/dist/app/assets/{regex-ChgfKyvR.js → regex-Cj5qFUZM.js} +1 -1
  250. package/dist/app/assets/{rego-D_XvU-HX.js → rego-CfoDWHPw.js} +1 -1
  251. package/dist/app/assets/{renpy-5nIbfjm_.js → renpy-D3lRim5H.js} +1 -1
  252. package/dist/app/assets/{requirementDiagram-MS252O5E-DoM__lrz.js → requirementDiagram-MS252O5E-BNs2nP8U.js} +1 -1
  253. package/dist/app/assets/{rest-D0kyBqSB.js → rest-DktyegXU.js} +1 -1
  254. package/dist/app/assets/{rip-CYiR9G3s.js → rip-D0VY5apf.js} +1 -1
  255. package/dist/app/assets/{roboconf-NbRqT12s.js → roboconf-y6-jDOpj.js} +1 -1
  256. package/dist/app/assets/{robotframework-DVLdugea.js → robotframework-CC00uJgj.js} +1 -1
  257. package/dist/app/assets/{ruby-CXYqjyLr.js → ruby-dAbspD_k.js} +1 -1
  258. package/dist/app/assets/{rust-DtiosDKR.js → rust-7wWC8B4O.js} +1 -1
  259. package/dist/app/assets/{sankeyDiagram-XADWPNL6-DAGXEQXz.js → sankeyDiagram-XADWPNL6-CvpH_gH5.js} +1 -1
  260. package/dist/app/assets/{sas-CBuO0A4r.js → sas-BMwqJCyV.js} +1 -1
  261. package/dist/app/assets/{sass-DAOC_JY6.js → sass-Deo2TBca.js} +1 -1
  262. package/dist/app/assets/{scala-DrjxfsaL.js → scala-CDQ_Q6w1.js} +1 -1
  263. package/dist/app/assets/{scheme-Dqq_pAgd.js → scheme-Dnvc5SgS.js} +1 -1
  264. package/dist/app/assets/{scss-Cs8enbPf.js → scss-CQnjZBSP.js} +1 -1
  265. package/dist/app/assets/{sequenceDiagram-FGHM5R23-D_580_d2.js → sequenceDiagram-FGHM5R23-CbfExnPM.js} +1 -1
  266. package/dist/app/assets/{shell-session-jQLXH-IX.js → shell-session-CUzpt9u_.js} +1 -1
  267. package/dist/app/assets/{smali-BjlQ2Fb8.js → smali-gUIPUNS_.js} +1 -1
  268. package/dist/app/assets/{smalltalk-CvvaQ-vE.js → smalltalk-BWqWeTOj.js} +1 -1
  269. package/dist/app/assets/{smarty-CuW15FKs.js → smarty-D_6NQwpr.js} +1 -1
  270. package/dist/app/assets/{sml-C2rZNwaS.js → sml-C6fu3ORs.js} +1 -1
  271. package/dist/app/assets/{solidity-Bz0UCY5q.js → solidity-aHCvIORR.js} +1 -1
  272. package/dist/app/assets/{solution-file-DY6Szhc0.js → solution-file-rfXcmDEi.js} +1 -1
  273. package/dist/app/assets/{soy-DupXqVr6.js → soy-CYlWSpIs.js} +1 -1
  274. package/dist/app/assets/{sparql-CKXEGfsk.js → sparql-BAW721Ow.js} +1 -1
  275. package/dist/app/assets/{splunk-spl-ylrNAn0q.js → splunk-spl-BTzYVj8d.js} +1 -1
  276. package/dist/app/assets/{sqf-lJvrZCtE.js → sqf-UIbNftU1.js} +1 -1
  277. package/dist/app/assets/{sql-B7hLAkUR.js → sql-CgGxned9.js} +1 -1
  278. package/dist/app/assets/{squirrel-BH1Y674s.js → squirrel-CIcV4Ny-.js} +1 -1
  279. package/dist/app/assets/{stan-fR7Qg8Ut.js → stan-DgfUhApV.js} +1 -1
  280. package/dist/app/assets/{stateDiagram-FHFEXIEX-B8jUR8FD.js → stateDiagram-FHFEXIEX-D1iTvQX_.js} +1 -1
  281. package/dist/app/assets/stateDiagram-v2-QKLJ7IA2-BCtIcdWI.js +1 -0
  282. package/dist/app/assets/{stylus-s7kCNuJK.js → stylus-sv3Ey9M5.js} +1 -1
  283. package/dist/app/assets/{swift-CCtYkHCf.js → swift-DS573qiY.js} +1 -1
  284. package/dist/app/assets/{systemd-BCElHahC.js → systemd-CzDCvoIg.js} +1 -1
  285. package/dist/app/assets/{t4-cs-H1_QKrKm.js → t4-cs-D4nbx6z2.js} +1 -1
  286. package/dist/app/assets/{t4-templating-6bPJc-Uq.js → t4-templating-BMZwZyOE.js} +1 -1
  287. package/dist/app/assets/{t4-vb-DJucVBb5.js → t4-vb-DIeP4ybv.js} +1 -1
  288. package/dist/app/assets/{tap-B_SCHNXn.js → tap-De3Jnd4S.js} +1 -1
  289. package/dist/app/assets/{tcl-BNEpqSgM.js → tcl-BjCUiiee.js} +1 -1
  290. package/dist/app/assets/{textile-uWVZjI0f.js → textile-DZ3GKhqr.js} +1 -1
  291. package/dist/app/assets/{timeline-definition-GMOUNBTQ-pCO1IuTh.js → timeline-definition-GMOUNBTQ-DNIfYJfl.js} +1 -1
  292. package/dist/app/assets/{toml-IfqaxX6C.js → toml-On6uzvVe.js} +1 -1
  293. package/dist/app/assets/{tremor-CXc27b0y.js → tremor-BU60aKH_.js} +1 -1
  294. package/dist/app/assets/{tt2-CSiBMY4w.js → tt2-BuKbFZt_.js} +1 -1
  295. package/dist/app/assets/{turtle-BG1NGns7.js → turtle-DXMNKdPK.js} +1 -1
  296. package/dist/app/assets/{twig-BApA7lBN.js → twig-Bo_MbBRd.js} +1 -1
  297. package/dist/app/assets/{typescript-CRhq3lVo.js → typescript-CR7wxlXD.js} +1 -1
  298. package/dist/app/assets/{typoscript-CbCyspbX.js → typoscript-CMw0wwok.js} +1 -1
  299. package/dist/app/assets/{unrealscript-C0oIJrK_.js → unrealscript-B776bLew.js} +1 -1
  300. package/dist/app/assets/{uorazor-CCeC8ukV.js → uorazor-BYELARrG.js} +1 -1
  301. package/dist/app/assets/{uri-BbJq2oKI.js → uri-CRKYpN9S.js} +1 -1
  302. package/dist/app/assets/{v-DWbZTbl1.js → v-YJo6805g.js} +1 -1
  303. package/dist/app/assets/{vala-cNE5mkqv.js → vala-gsYpVkOH.js} +1 -1
  304. package/dist/app/assets/{vbnet-C4ps1ulT.js → vbnet-CmBlYcGa.js} +1 -1
  305. package/dist/app/assets/{velocity-BqiV4VvP.js → velocity-Q2c3XfQY.js} +1 -1
  306. package/dist/app/assets/{vennDiagram-DHZGUBPP-DsozMeQe.js → vennDiagram-DHZGUBPP-BadpBWfC.js} +1 -1
  307. package/dist/app/assets/{verilog-uM22GI8M.js → verilog-5WEqrogK.js} +1 -1
  308. package/dist/app/assets/{vhdl-CjipXQit.js → vhdl-Co2ZNHLl.js} +1 -1
  309. package/dist/app/assets/{vim-DAu-IiFJ.js → vim-BWHpRDI0.js} +1 -1
  310. package/dist/app/assets/{visual-basic-CdGIHeQV.js → visual-basic-DdcJ6qp_.js} +1 -1
  311. package/dist/app/assets/{wardley-RL74JXVD-oEncjGLp.js → wardley-RL74JXVD-nnCu88t4.js} +1 -1
  312. package/dist/app/assets/{wardleyDiagram-NUSXRM2D-DNMPqgtw.js → wardleyDiagram-NUSXRM2D-DLRxHCOy.js} +1 -1
  313. package/dist/app/assets/{warpscript-ijeKRGom.js → warpscript-DQTWfQQI.js} +1 -1
  314. package/dist/app/assets/{wasm-CyK5pI_Y.js → wasm-P74bjf6T.js} +1 -1
  315. package/dist/app/assets/{web-idl-3RbxQwXD.js → web-idl-BwlVUL20.js} +1 -1
  316. package/dist/app/assets/{wiki-Vqqp-2xX.js → wiki-3koXxGGM.js} +1 -1
  317. package/dist/app/assets/{wolfram-Bsi7joP0.js → wolfram-GHXEYNh8.js} +1 -1
  318. package/dist/app/assets/{wren-WQYmqFb4.js → wren-DDEdbB41.js} +1 -1
  319. package/dist/app/assets/{xeora-D38FYsRy.js → xeora-C5eIogh-.js} +1 -1
  320. package/dist/app/assets/{xml-doc-wUzx0i81.js → xml-doc-Dxj1u1SJ.js} +1 -1
  321. package/dist/app/assets/{xojo-CGKogxG9.js → xojo-CeTBKDSR.js} +1 -1
  322. package/dist/app/assets/{xquery-Dv5QvWSQ.js → xquery-C4vwM7F2.js} +1 -1
  323. package/dist/app/assets/{xychartDiagram-5P7HB3ND-BsbjEvIN.js → xychartDiagram-5P7HB3ND-8doH-fTN.js} +1 -1
  324. package/dist/app/assets/{yaml-BGAxdcfl.js → yaml-Clzy20XF.js} +1 -1
  325. package/dist/app/assets/{yang-DbR14Qhe.js → yang-BTHiGiHX.js} +1 -1
  326. package/dist/app/assets/{zig-BZnMCGLn.js → zig-BkXx74nT.js} +1 -1
  327. package/dist/app/index.html +2 -2
  328. package/dist/index.cjs +1217 -671
  329. package/dist/index.d.cts +3 -0
  330. package/dist/index.d.ts +3 -0
  331. package/dist/index.js +1184 -637
  332. package/package.json +3 -3
  333. package/dist/app/assets/channel-C4IK_RZn.js +0 -1
  334. package/dist/app/assets/classDiagram-6PBFFD2Q-LicCc7Qv.js +0 -1
  335. package/dist/app/assets/classDiagram-v2-HSJHXN6E-LicCc7Qv.js +0 -1
  336. package/dist/app/assets/clone-BC1Apkgy.js +0 -1
  337. package/dist/app/assets/index-BojjVNpv.css +0 -1
  338. package/dist/app/assets/stateDiagram-v2-QKLJ7IA2-ByxORwfu.js +0 -1
package/dist/index.cjs CHANGED
@@ -67,8 +67,8 @@ __export(index_exports, {
67
67
  module.exports = __toCommonJS(index_exports);
68
68
 
69
69
  // src/components/chat.tsx
70
- var React44 = __toESM(require("react"), 1);
71
- var import_lucide_react24 = require("lucide-react");
70
+ var React45 = __toESM(require("react"), 1);
71
+ var import_lucide_react25 = require("lucide-react");
72
72
 
73
73
  // src/lib/utils.ts
74
74
  var import_clsx = require("clsx");
@@ -1292,6 +1292,7 @@ var en_US_default = {
1292
1292
  loadingThread: "Loading thread...",
1293
1293
  stop: "Stop",
1294
1294
  send: "Send message",
1295
+ minimizeToPet: "Minimize to pet",
1295
1296
  referencedContentOnly: "Referenced content",
1296
1297
  youLabel: "You",
1297
1298
  scrollToBottom: "Scroll to bottom",
@@ -1518,6 +1519,13 @@ var en_US_default = {
1518
1519
  option: "Option",
1519
1520
  other: "Other"
1520
1521
  },
1522
+ knowledgeRetriever: {
1523
+ queryTitle: "Query",
1524
+ resultsTitle: "Retrieved results ({{count}})",
1525
+ rawDataTitle: "Raw data",
1526
+ noResults: "No knowledge results found",
1527
+ scoreLabel: "Score"
1528
+ },
1521
1529
  agentRun: {
1522
1530
  defaultTitle: "Sub-agent",
1523
1531
  inputLabel: "Input",
@@ -1566,6 +1574,14 @@ var en_US_default = {
1566
1574
  copy: "Copy",
1567
1575
  copied: "Copied",
1568
1576
  separator: ", ",
1577
+ shell: {
1578
+ success: "Success",
1579
+ running: "Running",
1580
+ failed: "Failed",
1581
+ exitCode: "Exit code {{code}}",
1582
+ ranCommand: "Ran {{command}}",
1583
+ runningCommand: "Running {{command}}"
1584
+ },
1569
1585
  categories: {
1570
1586
  files: {
1571
1587
  one: "{{count}} file",
@@ -1617,6 +1633,7 @@ var zh_CN_default = {
1617
1633
  loadingThread: "\u6B63\u5728\u52A0\u8F7D\u7EBF\u7A0B...",
1618
1634
  stop: "\u505C\u6B62",
1619
1635
  send: "\u53D1\u9001\u6D88\u606F",
1636
+ minimizeToPet: "\u6700\u5C0F\u5316\u5230 Pet",
1620
1637
  referencedContentOnly: "\u5DF2\u5F15\u7528\u5185\u5BB9",
1621
1638
  youLabel: "\u4F60",
1622
1639
  scrollToBottom: "\u56DE\u5230\u5E95\u90E8",
@@ -1843,6 +1860,13 @@ var zh_CN_default = {
1843
1860
  option: "\u9009\u9879",
1844
1861
  other: "\u5176\u4ED6"
1845
1862
  },
1863
+ knowledgeRetriever: {
1864
+ queryTitle: "\u67E5\u8BE2",
1865
+ resultsTitle: "\u68C0\u7D22\u7ED3\u679C\uFF08{{count}}\uFF09",
1866
+ rawDataTitle: "\u539F\u59CB\u6570\u636E",
1867
+ noResults: "\u672A\u627E\u5230\u77E5\u8BC6\u7ED3\u679C",
1868
+ scoreLabel: "\u5206\u6570"
1869
+ },
1846
1870
  agentRun: {
1847
1871
  defaultTitle: "\u5B50\u667A\u80FD\u4F53",
1848
1872
  inputLabel: "\u8F93\u5165",
@@ -1891,6 +1915,14 @@ var zh_CN_default = {
1891
1915
  copy: "\u590D\u5236",
1892
1916
  copied: "\u5DF2\u590D\u5236",
1893
1917
  separator: "\uFF0C",
1918
+ shell: {
1919
+ success: "\u6210\u529F",
1920
+ running: "\u8FD0\u884C\u4E2D",
1921
+ failed: "\u5931\u8D25",
1922
+ exitCode: "\u9000\u51FA\u7801 {{code}}",
1923
+ ranCommand: "\u5DF2\u8FD0\u884C {{command}}",
1924
+ runningCommand: "\u6B63\u5728\u8FD0\u884C {{command}}"
1925
+ },
1894
1926
  categories: {
1895
1927
  files: {
1896
1928
  one: "{{count}} \u4E2A\u6587\u4EF6",
@@ -6769,8 +6801,8 @@ function useSlashCommands({
6769
6801
  }
6770
6802
 
6771
6803
  // src/components/thread/messages/ai.tsx
6772
- var React31 = __toESM(require("react"), 1);
6773
- var import_lucide_react19 = require("lucide-react");
6804
+ var React32 = __toESM(require("react"), 1);
6805
+ var import_lucide_react20 = require("lucide-react");
6774
6806
 
6775
6807
  // src/lib/agent-run-render-tree.ts
6776
6808
  function isTextContent(content) {
@@ -8516,8 +8548,305 @@ function AgentRunGroup({
8516
8548
  ] });
8517
8549
  }
8518
8550
 
8519
- // src/components/thread/messages/web-search-component-renderer.tsx
8551
+ // src/i18n/localized-text.ts
8552
+ function resolveLocalizedText(value, language) {
8553
+ if (typeof value === "string") {
8554
+ const trimmed = value.trim();
8555
+ return trimmed || null;
8556
+ }
8557
+ if (!value || typeof value !== "object") return null;
8558
+ const localized = value;
8559
+ const normalizedLanguage = language.trim();
8560
+ const underscoredLanguage = normalizedLanguage.replace(/-/g, "_");
8561
+ const languagePrefix = normalizedLanguage.split("-")[0];
8562
+ const preferredKeys = normalizedLanguage.startsWith("zh") ? [
8563
+ normalizedLanguage,
8564
+ underscoredLanguage,
8565
+ "zh_Hans",
8566
+ "zh-Hans",
8567
+ "zh_CN",
8568
+ "zh-CN",
8569
+ "zh",
8570
+ "en_US",
8571
+ "en-US",
8572
+ "en"
8573
+ ] : [
8574
+ normalizedLanguage,
8575
+ underscoredLanguage,
8576
+ "en_US",
8577
+ "en-US",
8578
+ "en",
8579
+ languagePrefix,
8580
+ "zh_Hans",
8581
+ "zh-Hans",
8582
+ "zh_CN",
8583
+ "zh-CN",
8584
+ "zh"
8585
+ ];
8586
+ for (const key of preferredKeys) {
8587
+ const candidate = localized[key];
8588
+ if (typeof candidate === "string" && candidate.trim()) {
8589
+ return candidate.trim();
8590
+ }
8591
+ }
8592
+ for (const candidate of Object.values(localized)) {
8593
+ if (typeof candidate === "string" && candidate.trim()) {
8594
+ return candidate.trim();
8595
+ }
8596
+ }
8597
+ return null;
8598
+ }
8599
+
8600
+ // src/components/thread/messages/knowledge-retriever-component-renderer.tsx
8520
8601
  var import_jsx_runtime32 = require("react/jsx-runtime");
8602
+ var KNOWLEDGE_RETRIEVER_TITLE = "Knowledge Retriever";
8603
+ var KNOWLEDGE_METADATA_SKIP_KEYS = /* @__PURE__ */ new Set([
8604
+ "assets",
8605
+ "children",
8606
+ "loc",
8607
+ "relevanceScore",
8608
+ "score"
8609
+ ]);
8610
+ var knowledgeRetrieverComponentRenderer = {
8611
+ id: "knowledge-retriever",
8612
+ presentation: "grouped-step",
8613
+ match: isKnowledgeRetrieverComponent,
8614
+ getTitle: () => KNOWLEDGE_RETRIEVER_TITLE,
8615
+ hasDetails: hasKnowledgeRetrieverDetails,
8616
+ renderDetails: KnowledgeRetrieverDetails
8617
+ };
8618
+ function normalizeToolToken(value) {
8619
+ if (typeof value !== "string") return null;
8620
+ const normalized = value.trim().toLowerCase().replace(/[\s-]+/g, "_");
8621
+ return normalized || null;
8622
+ }
8623
+ function isRecord2(value) {
8624
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
8625
+ }
8626
+ function readString(value) {
8627
+ if (typeof value !== "string") return void 0;
8628
+ const trimmed = value.trim();
8629
+ return trimmed || void 0;
8630
+ }
8631
+ function stringifyValue(value) {
8632
+ if (value === null || value === void 0) return void 0;
8633
+ if (typeof value === "string") return readString(value);
8634
+ if (typeof value === "number" || typeof value === "boolean") {
8635
+ return String(value);
8636
+ }
8637
+ try {
8638
+ const serialized = JSON.stringify(value);
8639
+ return serialized && serialized !== "{}" ? serialized : void 0;
8640
+ } catch {
8641
+ return String(value);
8642
+ }
8643
+ }
8644
+ function truncateMetadataValue(value) {
8645
+ return value.length > 90 ? `${value.slice(0, 87)}...` : value;
8646
+ }
8647
+ function formatScore(value) {
8648
+ if (typeof value === "number") {
8649
+ return Number.isFinite(value) ? value.toFixed(value < 1 ? 3 : 2) : void 0;
8650
+ }
8651
+ return readString(value);
8652
+ }
8653
+ function getLineRange(metadata) {
8654
+ const loc = metadata.loc;
8655
+ if (!isRecord2(loc)) return void 0;
8656
+ const lines = loc.lines;
8657
+ if (!isRecord2(lines)) return void 0;
8658
+ const from = stringifyValue(lines.from);
8659
+ const to = stringifyValue(lines.to);
8660
+ if (from && to) return `${from}-${to}`;
8661
+ return from ?? to;
8662
+ }
8663
+ function normalizeMetadataEntries(metadata) {
8664
+ return Object.entries(metadata).flatMap(([key, value]) => {
8665
+ if (KNOWLEDGE_METADATA_SKIP_KEYS.has(key)) return [];
8666
+ const formatted = stringifyValue(value);
8667
+ if (!formatted) return [];
8668
+ return [
8669
+ {
8670
+ key,
8671
+ value: truncateMetadataValue(formatted)
8672
+ }
8673
+ ];
8674
+ });
8675
+ }
8676
+ function normalizeKnowledgeResult(value, fallbackTitle) {
8677
+ if (!isRecord2(value)) return null;
8678
+ const metadata = isRecord2(value.metadata) ? value.metadata : {};
8679
+ const document2 = isRecord2(value.document) ? value.document : {};
8680
+ const content = readString(value.pageContent);
8681
+ const title = readString(document2.name) ?? readString(metadata.originalFileName) ?? readString(metadata.source) ?? readString(value.id) ?? readString(metadata.chunkId) ?? fallbackTitle;
8682
+ if (!content && Object.keys(metadata).length === 0 && Object.keys(document2).length === 0) {
8683
+ return null;
8684
+ }
8685
+ return {
8686
+ id: readString(value.id) ?? readString(metadata.chunkId),
8687
+ title,
8688
+ url: readString(document2.fileUrl),
8689
+ content,
8690
+ lineRange: getLineRange(metadata),
8691
+ score: formatScore(
8692
+ metadata.relevanceScore ?? metadata.score ?? value.score
8693
+ ),
8694
+ metadata: normalizeMetadataEntries(metadata)
8695
+ };
8696
+ }
8697
+ function getKnowledgeResults(data) {
8698
+ if (!Array.isArray(data.data)) return [];
8699
+ return data.data.flatMap((item, index) => {
8700
+ const result = normalizeKnowledgeResult(item, `Result ${index + 1}`);
8701
+ return result ? [result] : [];
8702
+ });
8703
+ }
8704
+ function getRawKnowledgeData(data) {
8705
+ return data.data ?? data.output ?? null;
8706
+ }
8707
+ function getRetrieverQuery(data, language) {
8708
+ const input = data.input;
8709
+ if (isRecord2(input)) {
8710
+ return readString(input.query) ?? readString(input.input) ?? readString(input.question);
8711
+ }
8712
+ return readString(resolveLocalizedText(data.message, language)) ?? readString(input);
8713
+ }
8714
+ function hasKnowledgeRetrieverDetails(_content, data) {
8715
+ return isKnowledgeRetrieverComponent(_content, data);
8716
+ }
8717
+ function isKnowledgeRetrieverComponent(_content, data) {
8718
+ return normalizeToolToken(data.type) === "knowledges";
8719
+ }
8720
+ function KnowledgeRawDataBlock({ value }) {
8721
+ const { t } = useChatkitTranslation();
8722
+ const detected = detectJsonValue(value);
8723
+ if (detected.kind === "text") {
8724
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(PlainTextBlock, { value: detected.text });
8725
+ }
8726
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Tabs, { defaultValue: "tree", className: "min-w-0", children: [
8727
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "mb-2 flex min-w-0 items-center justify-between gap-2", children: [
8728
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "min-w-0 truncate text-[11px] text-muted-foreground", children: [
8729
+ t("message.toolGroup.jsonTitle"),
8730
+ " \xB7",
8731
+ " ",
8732
+ getJsonValueSummary(detected.value)
8733
+ ] }),
8734
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(TabsList, { className: "rounded-md p-0.5", children: [
8735
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "tree", children: t("message.toolGroup.jsonTree") }),
8736
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "raw", children: t("message.toolGroup.jsonRaw") })
8737
+ ] })
8738
+ ] }),
8739
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TabsContent, { value: "tree", className: "mt-0", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(JsonTreeView, { value: detected.value }) }),
8740
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TabsContent, { value: "raw", className: "mt-0", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(RawJsonBlock, { raw: detected.raw }) })
8741
+ ] });
8742
+ }
8743
+ function KnowledgeRetrieverDetails({
8744
+ data
8745
+ }) {
8746
+ const { i18n: i18n2, t } = useChatkitTranslation();
8747
+ const query = getRetrieverQuery(data, i18n2.language);
8748
+ const results = getKnowledgeResults(data);
8749
+ const rawData = getRawKnowledgeData(data);
8750
+ const hasArrayData = Array.isArray(data.data);
8751
+ const hasRawFallback = rawData !== null && rawData !== void 0 && (!hasArrayData || Array.isArray(data.data) && data.data.length > 0 && results.length === 0);
8752
+ const showEmptyState = results.length === 0 && !hasRawFallback && data.status !== "running";
8753
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "min-w-0 space-y-3 px-3 py-2", children: [
8754
+ query ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "min-w-0 space-y-1", children: [
8755
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.knowledgeRetriever.queryTitle") }),
8756
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "min-w-0 whitespace-pre-wrap wrap-break-word rounded-md bg-muted/40 px-3 py-2 font-mono text-[12px] leading-5 text-foreground/80", children: query })
8757
+ ] }) : null,
8758
+ results.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "min-w-0 space-y-2", children: [
8759
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.knowledgeRetriever.resultsTitle", {
8760
+ count: results.length
8761
+ }) }),
8762
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "space-y-2", children: results.map((result, index) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
8763
+ KnowledgeResultCard,
8764
+ {
8765
+ result,
8766
+ index
8767
+ },
8768
+ result.id ?? `${result.title}-${index}`
8769
+ )) })
8770
+ ] }) : null,
8771
+ hasRawFallback ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "min-w-0 space-y-1", children: [
8772
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.knowledgeRetriever.rawDataTitle") }),
8773
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(KnowledgeRawDataBlock, { value: rawData })
8774
+ ] }) : null,
8775
+ showEmptyState ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "rounded-md border border-dashed border-border/70 px-3 py-4 text-center text-xs text-muted-foreground", children: t("message.knowledgeRetriever.noResults") }) : null
8776
+ ] });
8777
+ }
8778
+ function KnowledgeResultCard({
8779
+ result,
8780
+ index
8781
+ }) {
8782
+ const { t } = useChatkitTranslation();
8783
+ const titleId = `knowledge-result-${index + 1}`;
8784
+ const metadata = [
8785
+ ...result.score ? [
8786
+ {
8787
+ key: t("message.knowledgeRetriever.scoreLabel"),
8788
+ value: result.score
8789
+ }
8790
+ ] : [],
8791
+ ...result.metadata
8792
+ ];
8793
+ const titleClassName = "min-w-0 line-clamp-2 text-sm font-medium leading-5 text-foreground";
8794
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("article", { className: "min-w-0 rounded-md border border-border/60 bg-background/80 px-3 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex min-w-0 items-start gap-2", children: [
8795
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "mt-0.5 inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-muted text-[11px] font-medium text-muted-foreground", children: index + 1 }),
8796
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "min-w-0 flex-1", children: [
8797
+ result.url ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
8798
+ "a",
8799
+ {
8800
+ id: titleId,
8801
+ href: result.url,
8802
+ target: "_blank",
8803
+ rel: "noreferrer",
8804
+ className: cn(titleClassName, "hover:underline"),
8805
+ children: [
8806
+ result.title,
8807
+ result.lineRange ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "ml-1 text-muted-foreground", children: [
8808
+ "[",
8809
+ result.lineRange,
8810
+ "]"
8811
+ ] }) : null
8812
+ ]
8813
+ }
8814
+ ) : /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { id: titleId, className: titleClassName, children: [
8815
+ result.title,
8816
+ result.lineRange ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "ml-1 text-muted-foreground", children: [
8817
+ "[",
8818
+ result.lineRange,
8819
+ "]"
8820
+ ] }) : null
8821
+ ] }),
8822
+ result.content ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "mt-1 line-clamp-3 whitespace-pre-wrap text-xs leading-5 text-muted-foreground", children: result.content }) : null,
8823
+ metadata.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
8824
+ "div",
8825
+ {
8826
+ className: "mt-2 flex flex-wrap gap-1.5",
8827
+ "aria-labelledby": titleId,
8828
+ children: metadata.slice(0, 10).map((item) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
8829
+ "span",
8830
+ {
8831
+ className: "inline-flex min-w-0 max-w-full items-center gap-1 rounded-md bg-muted/50 px-1.5 py-0.5 text-[11px] leading-4 text-muted-foreground",
8832
+ children: [
8833
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "shrink-0 font-medium text-foreground/70", children: [
8834
+ item.key,
8835
+ ":"
8836
+ ] }),
8837
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "min-w-0 truncate font-mono", children: item.value })
8838
+ ]
8839
+ },
8840
+ `${item.key}:${item.value}`
8841
+ ))
8842
+ }
8843
+ ) : null
8844
+ ] })
8845
+ ] }) });
8846
+ }
8847
+
8848
+ // src/components/thread/messages/web-search-component-renderer.tsx
8849
+ var import_jsx_runtime33 = require("react/jsx-runtime");
8521
8850
  var webSearchComponentRenderer = {
8522
8851
  id: "computer-web-search-sources",
8523
8852
  presentation: "grouped-step",
@@ -8525,7 +8854,7 @@ var webSearchComponentRenderer = {
8525
8854
  hasDetails: hasWebSearchSources,
8526
8855
  renderDetails: WebSearchToolCallOutput
8527
8856
  };
8528
- function normalizeToolToken(value) {
8857
+ function normalizeToolToken2(value) {
8529
8858
  if (typeof value !== "string") return null;
8530
8859
  const normalized = value.trim().toLowerCase().replace(/[\s-]+/g, "_");
8531
8860
  return normalized || null;
@@ -8570,9 +8899,9 @@ function hasWebSearchSources(_content, data) {
8570
8899
  }
8571
8900
  function isComputerWebSearchComponent(_content, data) {
8572
8901
  const isComputer = data.category === "Computer";
8573
- const isWebSearch = normalizeToolToken(data.type) === "web_search";
8902
+ const isWebSearch = normalizeToolToken2(data.type) === "web_search";
8574
8903
  if (!isComputer || !isWebSearch) return false;
8575
- return normalizeToolToken(data.tool) === "web_search" || getWebSearchSources(data).length > 0;
8904
+ return normalizeToolToken2(data.tool) === "web_search" || getWebSearchSources(data).length > 0;
8576
8905
  }
8577
8906
  function getSourceHost(url) {
8578
8907
  try {
@@ -8587,9 +8916,9 @@ function WebSearchToolCallOutput({
8587
8916
  const { t } = useChatkitTranslation();
8588
8917
  const sources = getWebSearchSources(data);
8589
8918
  if (sources.length === 0 || data.error !== void 0) return null;
8590
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "space-y-2", children: [
8591
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.toolGroup.sourcesTitle") }),
8592
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "space-y-2", children: sources.map((source, index) => {
8919
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "space-y-2", children: [
8920
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.toolGroup.sourcesTitle") }),
8921
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "space-y-2", children: sources.map((source, index) => {
8593
8922
  const sourceHost = getSourceHost(source.url);
8594
8923
  const snippet = source.content ?? source.description;
8595
8924
  const metaParts = [
@@ -8597,13 +8926,13 @@ function WebSearchToolCallOutput({
8597
8926
  source.publishedDate,
8598
8927
  source.author
8599
8928
  ].filter((item) => Boolean(item));
8600
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
8929
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
8601
8930
  "div",
8602
8931
  {
8603
8932
  className: "min-w-0 rounded-md border border-border/60 bg-background/80 px-3 py-2",
8604
8933
  children: [
8605
- metaParts.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "mb-1 truncate text-[11px] text-muted-foreground", children: metaParts.join(" / ") }) : null,
8606
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
8934
+ metaParts.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "mb-1 truncate text-[11px] text-muted-foreground", children: metaParts.join(" / ") }) : null,
8935
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
8607
8936
  "a",
8608
8937
  {
8609
8938
  href: source.url,
@@ -8613,7 +8942,7 @@ function WebSearchToolCallOutput({
8613
8942
  children: source.title
8614
8943
  }
8615
8944
  ),
8616
- snippet ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "mt-1 line-clamp-3 text-xs leading-5 text-muted-foreground", children: snippet }) : null
8945
+ snippet ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "mt-1 line-clamp-3 text-xs leading-5 text-muted-foreground", children: snippet }) : null
8617
8946
  ]
8618
8947
  },
8619
8948
  `${source.url}-${index}`
@@ -8624,6 +8953,7 @@ function WebSearchToolCallOutput({
8624
8953
 
8625
8954
  // src/components/thread/messages/component-message-renderers.tsx
8626
8955
  var COMPONENT_MESSAGE_RENDERERS = [
8956
+ knowledgeRetrieverComponentRenderer,
8627
8957
  webSearchComponentRenderer
8628
8958
  ];
8629
8959
  function getComponentMessageRenderer(content, data) {
@@ -8640,72 +8970,262 @@ function hasComponentMessageRendererDetails(renderer, content, data) {
8640
8970
  }
8641
8971
 
8642
8972
  // src/components/thread/messages/tool-component-group.tsx
8973
+ var React30 = __toESM(require("react"), 1);
8974
+ var import_lucide_react18 = require("lucide-react");
8975
+
8976
+ // src/components/thread/messages/sandbox-shell-tool-call.tsx
8643
8977
  var React29 = __toESM(require("react"), 1);
8644
8978
  var import_lucide_react17 = require("lucide-react");
8645
-
8646
- // src/i18n/localized-text.ts
8647
- function resolveLocalizedText(value, language) {
8648
- if (typeof value === "string") {
8649
- const trimmed = value.trim();
8650
- return trimmed || null;
8979
+ var import_jsx_runtime34 = require("react/jsx-runtime");
8980
+ var SANDBOX_SHELL_TEXT_CLASS = "text-[13px] leading-5 in-data-[density=compact]:text-xs in-data-[density=compact]:leading-4 in-data-[density=spacious]:text-sm in-data-[density=spacious]:leading-6";
8981
+ var SANDBOX_SHELL_SECTION_GAP_CLASS = "mt-2 in-data-[density=compact]:mt-1.5 in-data-[density=spacious]:mt-3";
8982
+ function normalizeShellToken(value) {
8983
+ if (typeof value !== "string") return null;
8984
+ const normalized = value.trim().toLowerCase().replace(/[\s-]+/g, "_");
8985
+ return normalized || null;
8986
+ }
8987
+ function isPlainObject(value) {
8988
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
8989
+ }
8990
+ function readShellString(value) {
8991
+ if (typeof value !== "string") return null;
8992
+ const trimmed = value.trim();
8993
+ return trimmed || null;
8994
+ }
8995
+ function stringifyShellText(value) {
8996
+ if (value === null || value === void 0) return null;
8997
+ if (typeof value === "string") return value;
8998
+ if (typeof value === "number" || typeof value === "boolean") {
8999
+ return String(value);
8651
9000
  }
8652
- if (!value || typeof value !== "object") return null;
8653
- const localized = value;
8654
- const normalizedLanguage = language.trim();
8655
- const underscoredLanguage = normalizedLanguage.replace(/-/g, "_");
8656
- const languagePrefix = normalizedLanguage.split("-")[0];
8657
- const preferredKeys = normalizedLanguage.startsWith("zh") ? [
8658
- normalizedLanguage,
8659
- underscoredLanguage,
8660
- "zh_Hans",
8661
- "zh-Hans",
8662
- "zh_CN",
8663
- "zh-CN",
8664
- "zh",
8665
- "en_US",
8666
- "en-US",
8667
- "en"
8668
- ] : [
8669
- normalizedLanguage,
8670
- underscoredLanguage,
8671
- "en_US",
8672
- "en-US",
8673
- "en",
8674
- languagePrefix,
8675
- "zh_Hans",
8676
- "zh-Hans",
8677
- "zh_CN",
8678
- "zh-CN",
8679
- "zh"
8680
- ];
8681
- for (const key of preferredKeys) {
8682
- const candidate = localized[key];
8683
- if (typeof candidate === "string" && candidate.trim()) {
8684
- return candidate.trim();
8685
- }
9001
+ if (Array.isArray(value)) {
9002
+ const output = value.map((item) => stringifyShellText(item)).filter((item) => item !== null).join("");
9003
+ return output || null;
9004
+ }
9005
+ if (!isPlainObject(value)) return formatDisplayValue(value);
9006
+ const source = value;
9007
+ const textParts = [
9008
+ source.stdout,
9009
+ source.stderr,
9010
+ source.output,
9011
+ source.text,
9012
+ source.logs,
9013
+ source.content,
9014
+ source.chunk,
9015
+ source.delta
9016
+ ].map((item) => stringifyShellText(item)).filter((item) => item !== null && item.length > 0);
9017
+ if (textParts.length > 0) return textParts.join("");
9018
+ return null;
9019
+ }
9020
+ function getSandboxShellCommand(data, language) {
9021
+ const input = data.input;
9022
+ if (typeof input === "string") return input;
9023
+ if (isPlainObject(input)) {
9024
+ const source = input;
9025
+ const command = readShellString(source.command) ?? readShellString(source.cmd) ?? readShellString(source.input);
9026
+ if (command) return command;
9027
+ }
9028
+ const payload = data.data;
9029
+ if (isPlainObject(payload)) {
9030
+ const source = payload;
9031
+ const command = readShellString(source.command) ?? readShellString(source.cmd) ?? readShellString(source.input);
9032
+ if (command) return command;
9033
+ }
9034
+ return readShellString(resolveLocalizedText(data.message, language)) ?? readShellString(resolveLocalizedText(data.title, language)) ?? "sandbox_shell";
9035
+ }
9036
+ function getSandboxShellOutput(data) {
9037
+ const output = stringifyShellText(data.output) ?? stringifyShellText(data.data) ?? stringifyShellText(data.error);
9038
+ return output ?? "";
9039
+ }
9040
+ function readExitCodeFrom(value) {
9041
+ if (!isPlainObject(value)) return null;
9042
+ const source = value;
9043
+ const candidate = source.exit_code ?? source.exitCode ?? source.return_code ?? source.returnCode ?? source.code;
9044
+ if (typeof candidate === "number" && Number.isFinite(candidate)) {
9045
+ return candidate;
9046
+ }
9047
+ if (typeof candidate === "string" && candidate.trim() !== "") {
9048
+ const parsed = Number(candidate);
9049
+ return Number.isFinite(parsed) ? parsed : null;
8686
9050
  }
8687
- for (const candidate of Object.values(localized)) {
8688
- if (typeof candidate === "string" && candidate.trim()) {
8689
- return candidate.trim();
9051
+ return null;
9052
+ }
9053
+ function getSandboxShellExitCode(data) {
9054
+ return readExitCodeFrom(data.output) ?? readExitCodeFrom(data.data) ?? readExitCodeFrom(data);
9055
+ }
9056
+ function isSandboxShellStep(data) {
9057
+ const namedData = data;
9058
+ return [data.tool, data.type, data.title, namedData.name].some(
9059
+ (value) => normalizeShellToken(value) === "sandbox_shell"
9060
+ );
9061
+ }
9062
+ function formatShellCommand(command) {
9063
+ const trimmed = command.trim();
9064
+ return trimmed.startsWith("$") ? trimmed : `$ ${trimmed}`;
9065
+ }
9066
+ function getSandboxShellActivityLabel(data, status, language, t) {
9067
+ const command = getSandboxShellCommand(data, language);
9068
+ const key = status === "running" ? "message.toolGroup.shell.runningCommand" : "message.toolGroup.shell.ranCommand";
9069
+ return t(key, { command });
9070
+ }
9071
+ function ShellCopyButton({
9072
+ value,
9073
+ className
9074
+ }) {
9075
+ const { t } = useChatkitTranslation();
9076
+ const [isCopied, setIsCopied] = React29.useState(false);
9077
+ const resetTimeoutRef = React29.useRef(null);
9078
+ const clearResetTimeout = React29.useCallback(() => {
9079
+ if (resetTimeoutRef.current === null) return;
9080
+ window.clearTimeout(resetTimeoutRef.current);
9081
+ resetTimeoutRef.current = null;
9082
+ }, []);
9083
+ React29.useEffect(() => clearResetTimeout, [clearResetTimeout]);
9084
+ const handleCopy = React29.useCallback(() => {
9085
+ if (typeof navigator === "undefined" || !navigator.clipboard) return;
9086
+ void navigator.clipboard.writeText(value).then(() => {
9087
+ setIsCopied(true);
9088
+ clearResetTimeout();
9089
+ resetTimeoutRef.current = window.setTimeout(() => {
9090
+ setIsCopied(false);
9091
+ resetTimeoutRef.current = null;
9092
+ }, 1500);
9093
+ }).catch(() => void 0);
9094
+ }, [clearResetTimeout, value]);
9095
+ const label = isCopied ? t("message.toolGroup.copied") : t("message.toolGroup.copy");
9096
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
9097
+ "button",
9098
+ {
9099
+ type: "button",
9100
+ className: cn(
9101
+ "inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-background hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
9102
+ className
9103
+ ),
9104
+ "aria-label": label,
9105
+ title: label,
9106
+ onClick: handleCopy,
9107
+ children: isCopied ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react17.Check, { className: "h-3.5 w-3.5", "aria-hidden": "true" }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react17.Copy, { className: "h-3.5 w-3.5", "aria-hidden": "true" })
8690
9108
  }
9109
+ );
9110
+ }
9111
+ function SandboxShellStatus({
9112
+ data,
9113
+ exitCode
9114
+ }) {
9115
+ const { t } = useChatkitTranslation();
9116
+ if (exitCode !== null) {
9117
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-muted-foreground/90", children: t("message.toolGroup.shell.exitCode", { code: exitCode }) });
8691
9118
  }
8692
- return null;
9119
+ if (data.status === "running") {
9120
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-muted-foreground/90", children: t("message.toolGroup.shell.running") });
9121
+ }
9122
+ if (data.status === "fail" || data.error) {
9123
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-destructive/90", children: t("message.toolGroup.shell.failed") });
9124
+ }
9125
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "inline-flex items-center gap-1 text-muted-foreground/90", children: [
9126
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react17.Check, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
9127
+ t("message.toolGroup.shell.success")
9128
+ ] });
9129
+ }
9130
+ function SandboxShellToolCallCard({ data }) {
9131
+ const { i18n: i18n2 } = useChatkitTranslation();
9132
+ const command = getSandboxShellCommand(data, i18n2.language);
9133
+ const formattedCommand = formatShellCommand(command);
9134
+ const output = getSandboxShellOutput(data);
9135
+ const exitCode = getSandboxShellExitCode(data);
9136
+ const copyButtonClassName = "absolute right-1 top-1 h-6 w-6 opacity-0 transition-opacity group-hover/shell-copy:opacity-100 group-focus-within/shell-copy:opacity-100 in-data-[density=compact]:right-0.5 in-data-[density=compact]:top-0.5 in-data-[density=compact]:h-5 in-data-[density=compact]:w-5 in-data-[density=spacious]:right-1.5 in-data-[density=spacious]:top-1.5 in-data-[density=spacious]:h-7 in-data-[density=spacious]:w-7";
9137
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
9138
+ "div",
9139
+ {
9140
+ className: "flex max-h-64 min-w-0 flex-col overflow-hidden rounded-md bg-muted/60 px-3 py-2 text-left shadow-sm ring-1 ring-border/30 in-data-[density=compact]:max-h-52 in-data-[density=compact]:px-2 in-data-[density=compact]:py-1.5 in-data-[density=spacious]:max-h-80 in-data-[density=spacious]:px-4 in-data-[density=spacious]:py-3",
9141
+ "data-slot": "sandbox-shell-tool-call",
9142
+ "aria-label": "Shell",
9143
+ children: [
9144
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
9145
+ "div",
9146
+ {
9147
+ className: cn(
9148
+ "font-medium text-muted-foreground",
9149
+ SANDBOX_SHELL_TEXT_CLASS
9150
+ ),
9151
+ children: "Shell"
9152
+ }
9153
+ ),
9154
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
9155
+ "div",
9156
+ {
9157
+ className: cn(
9158
+ "group/shell-copy relative min-w-0",
9159
+ SANDBOX_SHELL_SECTION_GAP_CLASS
9160
+ ),
9161
+ children: [
9162
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
9163
+ "pre",
9164
+ {
9165
+ className: cn(
9166
+ "whitespace-pre-wrap break-words pr-8 font-mono text-foreground in-data-[density=compact]:pr-6 in-data-[density=spacious]:pr-10",
9167
+ SANDBOX_SHELL_TEXT_CLASS
9168
+ ),
9169
+ "data-slot": "sandbox-shell-command",
9170
+ children: formattedCommand
9171
+ }
9172
+ ),
9173
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ShellCopyButton, { value: command, className: copyButtonClassName })
9174
+ ]
9175
+ }
9176
+ ),
9177
+ output ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
9178
+ "div",
9179
+ {
9180
+ className: cn(
9181
+ "group/shell-copy relative min-h-0 flex-1",
9182
+ SANDBOX_SHELL_SECTION_GAP_CLASS
9183
+ ),
9184
+ children: [
9185
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
9186
+ "pre",
9187
+ {
9188
+ className: cn(
9189
+ "min-h-0 overflow-auto whitespace-pre pr-8 font-mono text-muted-foreground/85 in-data-[density=compact]:pr-6 in-data-[density=spacious]:pr-10",
9190
+ SANDBOX_SHELL_TEXT_CLASS
9191
+ ),
9192
+ "data-slot": "sandbox-shell-output",
9193
+ children: output
9194
+ }
9195
+ ),
9196
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ShellCopyButton, { value: output, className: copyButtonClassName })
9197
+ ]
9198
+ }
9199
+ ) : null,
9200
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
9201
+ "div",
9202
+ {
9203
+ className: cn(
9204
+ "mt-3 flex shrink-0 justify-end in-data-[density=compact]:mt-2 in-data-[density=spacious]:mt-4",
9205
+ SANDBOX_SHELL_TEXT_CLASS
9206
+ ),
9207
+ children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SandboxShellStatus, { data, exitCode })
9208
+ }
9209
+ )
9210
+ ]
9211
+ }
9212
+ );
8693
9213
  }
8694
9214
 
8695
9215
  // src/components/thread/messages/tool-component-group.tsx
8696
- var import_jsx_runtime33 = require("react/jsx-runtime");
9216
+ var import_jsx_runtime35 = require("react/jsx-runtime");
8697
9217
  var toolStatusConfig = {
8698
9218
  success: {
8699
9219
  iconClass: "border-green-500 text-green-700",
8700
- icon: import_lucide_react17.CheckCircle2
9220
+ icon: import_lucide_react18.CheckCircle2
8701
9221
  },
8702
9222
  fail: {
8703
9223
  iconClass: "border-red-500 text-red-700",
8704
- icon: import_lucide_react17.XCircle
9224
+ icon: import_lucide_react18.XCircle
8705
9225
  },
8706
9226
  running: {
8707
9227
  iconClass: "border-blue-500 text-blue-700",
8708
- icon: import_lucide_react17.Loader2
9228
+ icon: import_lucide_react18.Loader2
8709
9229
  }
8710
9230
  };
8711
9231
  var TOOL_GROUP_CATEGORY_ORDER = [
@@ -8799,10 +9319,10 @@ function formatStepDuration2(durationMs) {
8799
9319
  return `${minutes}m ${seconds}s`;
8800
9320
  }
8801
9321
  function useFrozenTimestamp(shouldFreeze) {
8802
- const [frozenAt, setFrozenAt] = React29.useState(
9322
+ const [frozenAt, setFrozenAt] = React30.useState(
8803
9323
  () => shouldFreeze ? Date.now() : null
8804
9324
  );
8805
- React29.useEffect(() => {
9325
+ React30.useEffect(() => {
8806
9326
  if (shouldFreeze) {
8807
9327
  setFrozenAt((current) => current ?? Date.now());
8808
9328
  return;
@@ -8812,12 +9332,12 @@ function useFrozenTimestamp(shouldFreeze) {
8812
9332
  return frozenAt;
8813
9333
  }
8814
9334
  function useToolStepDurationLabel(data, options) {
8815
- const [durationNow, setDurationNow] = React29.useState(() => Date.now());
9335
+ const [durationNow, setDurationNow] = React30.useState(() => Date.now());
8816
9336
  const createdAt = parseStepDate(data.created_date);
8817
9337
  const explicitEndedAt = parseStepDate(data.end_date);
8818
9338
  const status = options?.status ?? data.status;
8819
9339
  const endedAt = explicitEndedAt ?? (status !== "running" ? options?.fallbackEndedAt ?? null : null);
8820
- React29.useEffect(() => {
9340
+ React30.useEffect(() => {
8821
9341
  if (status !== "running" || createdAt === null || endedAt !== null) {
8822
9342
  return;
8823
9343
  }
@@ -8865,13 +9385,13 @@ function isSkippableToolGroupSeparator(content) {
8865
9385
  }
8866
9386
  return false;
8867
9387
  }
8868
- function normalizeToolToken2(value) {
9388
+ function normalizeToolToken3(value) {
8869
9389
  if (typeof value !== "string") return null;
8870
9390
  const normalized = value.trim().toLowerCase().replace(/[\s-]+/g, "_");
8871
9391
  return normalized || null;
8872
9392
  }
8873
9393
  function classifyToolToken(value) {
8874
- const normalized = normalizeToolToken2(
9394
+ const normalized = normalizeToolToken3(
8875
9395
  typeof value === "string" ? value : resolveLocalizedText(value, "en-US")
8876
9396
  );
8877
9397
  if (!normalized) return null;
@@ -8879,7 +9399,7 @@ function classifyToolToken(value) {
8879
9399
  if (directMatch) return directMatch;
8880
9400
  if (normalized.includes("search")) return "searches";
8881
9401
  if (normalized.includes("file")) return "files";
8882
- if (normalized.includes("command") || normalized.includes("cmd") || normalized.includes("program") || normalized.includes("exec") || normalized.startsWith("run_") || normalized.includes("_run")) {
9402
+ if (normalized.includes("command") || normalized.includes("cmd") || normalized.includes("program") || normalized.includes("exec") || normalized.includes("shell") || normalized.includes("terminal") || normalized.startsWith("run_") || normalized.includes("_run")) {
8883
9403
  return "commands";
8884
9404
  }
8885
9405
  if (normalized.includes("list")) return "lists";
@@ -8891,6 +9411,7 @@ function classifyToolToken(value) {
8891
9411
  }
8892
9412
  function getToolGroupCategory(content) {
8893
9413
  const data = getToolStepData(content);
9414
+ if (isSandboxShellStep(data)) return "commands";
8894
9415
  return classifyToolToken(data.type) ?? classifyToolToken(data.tool) ?? classifyToolToken(data.title) ?? classifyToolToken(data.message) ?? "tools";
8895
9416
  }
8896
9417
  function getToolGroupCategoryCounts(items) {
@@ -8910,8 +9431,8 @@ function getToolActivityLabel(content, language, statusOverride) {
8910
9431
  if (status === "running") {
8911
9432
  return message ?? title ?? tool ?? type ?? "Tool";
8912
9433
  }
8913
- const titleToken = normalizeToolToken2(title);
8914
- const genericTitle = titleToken !== null && [tool, type].map((candidate) => normalizeToolToken2(candidate)).some((candidate) => candidate === titleToken);
9434
+ const titleToken = normalizeToolToken3(title);
9435
+ const genericTitle = titleToken !== null && [tool, type].map((candidate) => normalizeToolToken3(candidate)).some((candidate) => candidate === titleToken);
8915
9436
  if (message && (!title || genericTitle)) {
8916
9437
  return message;
8917
9438
  }
@@ -8995,13 +9516,13 @@ function createToolsetAvatarUrl(toolsetId, apiUrl) {
8995
9516
  }
8996
9517
  }
8997
9518
  function shouldUseToolsetAvatar(toolset) {
8998
- const normalized = normalizeToolToken2(toolset);
9519
+ const normalized = normalizeToolToken3(toolset);
8999
9520
  return normalized === "mcp" || normalized === "openapi";
9000
9521
  }
9001
9522
  function useToolsetAvatar(toolsetId, enabled, apiUrl) {
9002
9523
  const avatarUrl = enabled ? createToolsetAvatarUrl(toolsetId, apiUrl) : null;
9003
- const [avatar, setAvatar] = React29.useState(null);
9004
- React29.useEffect(() => {
9524
+ const [avatar, setAvatar] = React30.useState(null);
9525
+ React30.useEffect(() => {
9005
9526
  if (!avatarUrl) {
9006
9527
  setAvatar(null);
9007
9528
  return;
@@ -9033,7 +9554,7 @@ function ToolAvatarIcon({
9033
9554
  className
9034
9555
  }) {
9035
9556
  if (avatar.url) {
9036
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
9557
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
9037
9558
  "img",
9038
9559
  {
9039
9560
  alt: "",
@@ -9046,7 +9567,7 @@ function ToolAvatarIcon({
9046
9567
  }
9047
9568
  const emoji = unicodeFromUnified2(avatar.emoji?.unified);
9048
9569
  if (emoji) {
9049
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
9570
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
9050
9571
  "span",
9051
9572
  {
9052
9573
  "aria-hidden": "true",
@@ -9061,8 +9582,8 @@ function ToolAvatarIcon({
9061
9582
  }
9062
9583
  );
9063
9584
  }
9064
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
9065
- import_lucide_react17.CircleHelp,
9585
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
9586
+ import_lucide_react18.CircleHelp,
9066
9587
  {
9067
9588
  className,
9068
9589
  "aria-hidden": "true",
@@ -9071,42 +9592,42 @@ function ToolAvatarIcon({
9071
9592
  );
9072
9593
  }
9073
9594
  function getKnownToolsetIcon(toolset) {
9074
- const normalized = normalizeToolToken2(toolset);
9595
+ const normalized = normalizeToolToken3(toolset);
9075
9596
  if (!normalized) return null;
9076
9597
  switch (normalized) {
9077
9598
  case "project":
9078
- return import_lucide_react17.Building2;
9599
+ return import_lucide_react18.Building2;
9079
9600
  case "transfer_to":
9080
- return import_lucide_react17.Repeat2;
9601
+ return import_lucide_react18.Repeat2;
9081
9602
  case "knowledge":
9082
9603
  case "knowledgebase":
9083
- return import_lucide_react17.BookOpen;
9604
+ return import_lucide_react18.BookOpen;
9084
9605
  case "project_tasks":
9085
- return import_lucide_react17.ListTodo;
9606
+ return import_lucide_react18.ListTodo;
9086
9607
  case "memories":
9087
- return import_lucide_react17.Brain;
9608
+ return import_lucide_react18.Brain;
9088
9609
  case "workflow_agent_tool":
9089
- return import_lucide_react17.Wrench;
9610
+ return import_lucide_react18.Wrench;
9090
9611
  case "workflow_task":
9091
- return import_lucide_react17.Network;
9612
+ return import_lucide_react18.Network;
9092
9613
  default:
9093
9614
  return null;
9094
9615
  }
9095
9616
  }
9096
9617
  function getStepTypeIcon(type) {
9097
- const normalized = normalizeToolToken2(type);
9618
+ const normalized = normalizeToolToken3(type);
9098
9619
  if (!normalized) return null;
9099
9620
  switch (normalized) {
9100
9621
  case "file":
9101
- return import_lucide_react17.FileText;
9622
+ return import_lucide_react18.FileText;
9102
9623
  case "files":
9103
- return import_lucide_react17.Files;
9624
+ return import_lucide_react18.Files;
9104
9625
  case "program":
9105
- return import_lucide_react17.SquareTerminal;
9626
+ return import_lucide_react18.SquareTerminal;
9106
9627
  case "web_search":
9107
- return import_lucide_react17.Search;
9628
+ return import_lucide_react18.Search;
9108
9629
  case "knowledges":
9109
- return import_lucide_react17.BookOpen;
9630
+ return import_lucide_react18.BookOpen;
9110
9631
  default:
9111
9632
  return null;
9112
9633
  }
@@ -9124,12 +9645,12 @@ function ToolStepIcon({
9124
9645
  apiUrl
9125
9646
  );
9126
9647
  const iconUrl = createToolsetIconUrl(data.toolset, organizationId, apiUrl);
9127
- const [failedIconUrl, setFailedIconUrl] = React29.useState(null);
9128
- React29.useEffect(() => {
9648
+ const [failedIconUrl, setFailedIconUrl] = React30.useState(null);
9649
+ React30.useEffect(() => {
9129
9650
  setFailedIconUrl(null);
9130
9651
  }, [iconUrl]);
9131
9652
  if (avatar) {
9132
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
9653
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
9133
9654
  ToolAvatarIcon,
9134
9655
  {
9135
9656
  avatar,
@@ -9139,7 +9660,7 @@ function ToolStepIcon({
9139
9660
  );
9140
9661
  }
9141
9662
  if (iconUrl && failedIconUrl !== iconUrl) {
9142
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
9663
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
9143
9664
  "img",
9144
9665
  {
9145
9666
  alt: "",
@@ -9153,7 +9674,7 @@ function ToolStepIcon({
9153
9674
  }
9154
9675
  const TypeIcon = getStepTypeIcon(data.type);
9155
9676
  if (TypeIcon) {
9156
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
9677
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
9157
9678
  TypeIcon,
9158
9679
  {
9159
9680
  className,
@@ -9164,7 +9685,7 @@ function ToolStepIcon({
9164
9685
  }
9165
9686
  const ToolsetIcon = getKnownToolsetIcon(data.toolset);
9166
9687
  if (ToolsetIcon) {
9167
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
9688
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
9168
9689
  ToolsetIcon,
9169
9690
  {
9170
9691
  className,
@@ -9174,8 +9695,8 @@ function ToolStepIcon({
9174
9695
  );
9175
9696
  }
9176
9697
  if (usesToolsetAvatar) {
9177
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
9178
- import_lucide_react17.CircleHelp,
9698
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
9699
+ import_lucide_react18.CircleHelp,
9179
9700
  {
9180
9701
  className,
9181
9702
  "aria-hidden": "true",
@@ -9183,8 +9704,8 @@ function ToolStepIcon({
9183
9704
  }
9184
9705
  );
9185
9706
  }
9186
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
9187
- import_lucide_react17.CircleHelp,
9707
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
9708
+ import_lucide_react18.CircleHelp,
9188
9709
  {
9189
9710
  className,
9190
9711
  "aria-hidden": "true",
@@ -9192,17 +9713,20 @@ function ToolStepIcon({
9192
9713
  }
9193
9714
  );
9194
9715
  }
9195
- function ToolCallCopyButton({ value }) {
9716
+ function ToolCallCopyButton({
9717
+ value,
9718
+ className
9719
+ }) {
9196
9720
  const { t } = useChatkitTranslation();
9197
- const [isCopied, setIsCopied] = React29.useState(false);
9198
- const resetTimeoutRef = React29.useRef(null);
9199
- const clearResetTimeout = React29.useCallback(() => {
9721
+ const [isCopied, setIsCopied] = React30.useState(false);
9722
+ const resetTimeoutRef = React30.useRef(null);
9723
+ const clearResetTimeout = React30.useCallback(() => {
9200
9724
  if (resetTimeoutRef.current === null) return;
9201
9725
  window.clearTimeout(resetTimeoutRef.current);
9202
9726
  resetTimeoutRef.current = null;
9203
9727
  }, []);
9204
- React29.useEffect(() => clearResetTimeout, [clearResetTimeout]);
9205
- const handleCopy = React29.useCallback(() => {
9728
+ React30.useEffect(() => clearResetTimeout, [clearResetTimeout]);
9729
+ const handleCopy = React30.useCallback(() => {
9206
9730
  if (typeof navigator === "undefined" || !navigator.clipboard) return;
9207
9731
  void navigator.clipboard.writeText(value).then(() => {
9208
9732
  setIsCopied(true);
@@ -9214,15 +9738,18 @@ function ToolCallCopyButton({ value }) {
9214
9738
  }).catch(() => void 0);
9215
9739
  }, [clearResetTimeout, value]);
9216
9740
  const label = isCopied ? t("message.toolGroup.copied") : t("message.toolGroup.copy");
9217
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
9741
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
9218
9742
  "button",
9219
9743
  {
9220
9744
  type: "button",
9221
- className: "inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-background hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
9745
+ className: cn(
9746
+ "inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-background hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
9747
+ className
9748
+ ),
9222
9749
  "aria-label": label,
9223
9750
  title: label,
9224
9751
  onClick: handleCopy,
9225
- children: isCopied ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Check, { className: "h-3.5 w-3.5", "aria-hidden": "true" }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Copy, { className: "h-3.5 w-3.5", "aria-hidden": "true" })
9752
+ children: isCopied ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react18.Check, { className: "h-3.5 w-3.5", "aria-hidden": "true" }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react18.Copy, { className: "h-3.5 w-3.5", "aria-hidden": "true" })
9226
9753
  }
9227
9754
  );
9228
9755
  }
@@ -9233,28 +9760,28 @@ function ToolCallValueBlock({
9233
9760
  const { t } = useChatkitTranslation();
9234
9761
  const detected = detectJsonValue(value);
9235
9762
  if (detected.kind === "text") {
9236
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "min-w-0 space-y-1", children: [
9237
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ToolCallCopyButton, { value: detected.text }) }),
9238
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(PlainTextBlock, { value: detected.text, destructive })
9763
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "min-w-0 space-y-1", children: [
9764
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ToolCallCopyButton, { value: detected.text }) }),
9765
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(PlainTextBlock, { value: detected.text, destructive })
9239
9766
  ] });
9240
9767
  }
9241
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Tabs, { defaultValue: "tree", className: "min-w-0", children: [
9242
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "mb-2 flex min-w-0 items-center justify-between gap-2", children: [
9243
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "min-w-0 truncate text-[11px] text-muted-foreground", children: [
9768
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Tabs, { defaultValue: "tree", className: "min-w-0", children: [
9769
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "mb-2 flex min-w-0 items-center justify-between gap-2", children: [
9770
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "min-w-0 truncate text-[11px] text-muted-foreground", children: [
9244
9771
  t("message.toolGroup.jsonTitle"),
9245
9772
  " \xB7 ",
9246
9773
  getJsonValueSummary(detected.value)
9247
9774
  ] }),
9248
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex shrink-0 items-center gap-1", children: [
9249
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ToolCallCopyButton, { value: detected.raw }),
9250
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(TabsList, { className: "rounded-md p-0.5", children: [
9251
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "tree", children: t("message.toolGroup.jsonTree") }),
9252
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "raw", children: t("message.toolGroup.jsonRaw") })
9775
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex shrink-0 items-center gap-1", children: [
9776
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ToolCallCopyButton, { value: detected.raw }),
9777
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(TabsList, { className: "rounded-md p-0.5", children: [
9778
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "tree", children: t("message.toolGroup.jsonTree") }),
9779
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "raw", children: t("message.toolGroup.jsonRaw") })
9253
9780
  ] })
9254
9781
  ] })
9255
9782
  ] }),
9256
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TabsContent, { value: "tree", className: "mt-0", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(JsonTreeView, { value: detected.value }) }),
9257
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TabsContent, { value: "raw", className: "mt-0", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(RawJsonBlock, { raw: detected.raw }) })
9783
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TabsContent, { value: "tree", className: "mt-0", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(JsonTreeView, { value: detected.value }) }),
9784
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TabsContent, { value: "raw", className: "mt-0", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(RawJsonBlock, { raw: detected.raw }) })
9258
9785
  ] });
9259
9786
  }
9260
9787
  function DefaultToolCallOutput({ data }) {
@@ -9262,37 +9789,40 @@ function DefaultToolCallOutput({ data }) {
9262
9789
  const output = data.output ?? null;
9263
9790
  const error = data.error ?? null;
9264
9791
  if (error) {
9265
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "space-y-1", children: [
9266
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "text-[11px] font-medium text-destructive", children: t("message.toolGroup.errorTitle") }),
9267
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ToolCallValueBlock, { value: error, destructive: true })
9792
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "space-y-1", children: [
9793
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "text-[11px] font-medium text-destructive", children: t("message.toolGroup.errorTitle") }),
9794
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ToolCallValueBlock, { value: error, destructive: true })
9268
9795
  ] });
9269
9796
  }
9270
9797
  if (output === null) return null;
9271
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "space-y-1", children: [
9272
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.toolGroup.outputTitle") }),
9273
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ToolCallValueBlock, { value: output })
9798
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "space-y-1", children: [
9799
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.toolGroup.outputTitle") }),
9800
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ToolCallValueBlock, { value: output })
9274
9801
  ] });
9275
9802
  }
9276
9803
  function ToolCallDetails({ content }) {
9277
9804
  const { t } = useChatkitTranslation();
9278
9805
  const data = getToolStepData(content);
9806
+ if (isSandboxShellStep(data)) {
9807
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "ml-6 mt-1", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SandboxShellToolCallCard, { data }) });
9808
+ }
9279
9809
  const renderer = getComponentMessageRenderer(content, data);
9280
9810
  const hasCustomDetails = data.error === void 0 && hasComponentMessageRendererDetails(renderer, content, data);
9281
9811
  const CustomDetailsRenderer = hasCustomDetails ? renderer?.renderDetails : void 0;
9282
9812
  if (CustomDetailsRenderer) {
9283
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "ml-6 mt-1 max-h-60 overflow-auto rounded-md bg-muted/30 text-xs text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CustomDetailsRenderer, { content, data }) });
9813
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "ml-6 mt-1 max-h-60 overflow-auto rounded-md bg-muted/30 text-xs text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CustomDetailsRenderer, { content, data }) });
9284
9814
  }
9285
9815
  const OutputRenderer = getToolCallOutputRenderer(data);
9286
9816
  const hasInput = data.input !== void 0 && data.input !== null;
9287
9817
  const hasOutput = data.error !== void 0 || data.output !== void 0;
9288
9818
  if (!hasInput && !hasOutput) return null;
9289
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("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: [
9290
- hasInput && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "space-y-1", children: [
9291
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.toolGroup.inputTitle") }),
9292
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ToolCallValueBlock, { value: data.input })
9819
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("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: [
9820
+ hasInput && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "space-y-1", children: [
9821
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.toolGroup.inputTitle") }),
9822
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ToolCallValueBlock, { value: data.input })
9293
9823
  ] }),
9294
- hasInput && hasOutput ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "h-2" }) : null,
9295
- hasOutput ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(OutputRenderer, { content, data }) : null
9824
+ hasInput && hasOutput ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "h-2" }) : null,
9825
+ hasOutput ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(OutputRenderer, { content, data }) : null
9296
9826
  ] });
9297
9827
  }
9298
9828
  function areToolCallRowPropsEqual(previous, next) {
@@ -9304,15 +9834,16 @@ function ToolCallRowContent({
9304
9834
  organizationId,
9305
9835
  apiUrl
9306
9836
  }) {
9307
- const { i18n: i18n2 } = useChatkitTranslation();
9837
+ const { i18n: i18n2, t } = useChatkitTranslation();
9308
9838
  const data = getToolStepData(content);
9309
9839
  const status = getEffectiveToolStepStatus(data, isThreadRunning);
9310
9840
  const hasError = status === "fail" || Boolean(data.error);
9311
- const label = getToolActivityLabel(content, i18n2.language, status);
9312
- const detailsId = React29.useId();
9841
+ const isSandboxShell = isSandboxShellStep(data);
9842
+ const detailsId = React30.useId();
9313
9843
  const renderer = getComponentMessageRenderer(content, data);
9844
+ const label = isSandboxShell ? getSandboxShellActivityLabel(data, status, i18n2.language, t) : renderer?.getTitle?.(content, data, i18n2.language) ?? getToolActivityLabel(content, i18n2.language, status);
9314
9845
  const hasCustomDetails = data.error === void 0 && hasComponentMessageRendererDetails(renderer, content, data);
9315
- const hasDetails = data.input !== void 0 || data.error !== void 0 || data.output !== void 0 || hasCustomDetails;
9846
+ const hasDetails = isSandboxShell || data.input !== void 0 || data.error !== void 0 || data.output !== void 0 || hasCustomDetails;
9316
9847
  const fallbackEndedAt = useFrozenTimestamp(
9317
9848
  data.status === "running" && status === "fail"
9318
9849
  );
@@ -9320,14 +9851,14 @@ function ToolCallRowContent({
9320
9851
  status,
9321
9852
  fallbackEndedAt
9322
9853
  });
9323
- const [isExpanded, setIsExpanded] = React29.useState(false);
9324
- React29.useEffect(() => {
9854
+ const [isExpanded, setIsExpanded] = React30.useState(false);
9855
+ React30.useEffect(() => {
9325
9856
  if (status === "running" && data.output !== void 0) {
9326
9857
  setIsExpanded(true);
9327
9858
  }
9328
9859
  }, [data.output, status]);
9329
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("li", { className: "min-w-0", children: [
9330
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
9860
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("li", { className: "ck-tool-call-row-enter min-w-0", children: [
9861
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
9331
9862
  "button",
9332
9863
  {
9333
9864
  type: "button",
@@ -9335,7 +9866,7 @@ function ToolCallRowContent({
9335
9866
  "group/tool-call flex w-full min-w-0 items-center gap-2 text-left text-muted-foreground",
9336
9867
  TOOL_CALL_ROW_TEXT_CLASS,
9337
9868
  hasDetails && "cursor-pointer hover:text-foreground",
9338
- hasError && "text-destructive hover:text-destructive"
9869
+ hasError && !isSandboxShell && "text-destructive hover:text-destructive"
9339
9870
  ),
9340
9871
  "aria-expanded": hasDetails ? isExpanded : void 0,
9341
9872
  "aria-controls": hasDetails ? detailsId : void 0,
@@ -9344,7 +9875,7 @@ function ToolCallRowContent({
9344
9875
  if (hasDetails) setIsExpanded((prev) => !prev);
9345
9876
  },
9346
9877
  children: [
9347
- status ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
9878
+ status ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
9348
9879
  ToolStepIcon,
9349
9880
  {
9350
9881
  data,
@@ -9352,11 +9883,11 @@ function ToolCallRowContent({
9352
9883
  apiUrl,
9353
9884
  className: cn(
9354
9885
  "h-3.5 w-3.5 shrink-0",
9355
- hasError ? "text-destructive" : "text-muted-foreground"
9886
+ hasError && !isSandboxShell ? "text-destructive" : "text-muted-foreground"
9356
9887
  )
9357
9888
  }
9358
- ) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "h-3.5 w-3.5 shrink-0", "aria-hidden": "true" }),
9359
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
9889
+ ) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "h-3.5 w-3.5 shrink-0", "aria-hidden": "true" }),
9890
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
9360
9891
  "span",
9361
9892
  {
9362
9893
  className: cn(
@@ -9367,9 +9898,9 @@ function ToolCallRowContent({
9367
9898
  children: label
9368
9899
  }
9369
9900
  ),
9370
- durationLabel ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "shrink-0 text-[11px] tabular-nums text-muted-foreground/80", children: durationLabel }) : null,
9371
- hasDetails ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
9372
- import_lucide_react17.ChevronRight,
9901
+ durationLabel ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "shrink-0 text-[11px] tabular-nums text-muted-foreground/80", children: durationLabel }) : null,
9902
+ hasDetails ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
9903
+ import_lucide_react18.ChevronRight,
9373
9904
  {
9374
9905
  "aria-hidden": "true",
9375
9906
  className: cn(
@@ -9381,10 +9912,10 @@ function ToolCallRowContent({
9381
9912
  ]
9382
9913
  }
9383
9914
  ),
9384
- hasDetails && isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { id: detailsId, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ToolCallDetails, { content }) }) : null
9915
+ hasDetails && isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { id: detailsId, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ToolCallDetails, { content }) }) : null
9385
9916
  ] });
9386
9917
  }
9387
- var ToolCallRow = React29.memo(ToolCallRowContent, areToolCallRowPropsEqual);
9918
+ var ToolCallRow = React30.memo(ToolCallRowContent, areToolCallRowPropsEqual);
9388
9919
  ToolCallRow.displayName = "ToolCallRow";
9389
9920
  function ToolComponentGroup({
9390
9921
  items,
@@ -9394,8 +9925,8 @@ function ToolComponentGroup({
9394
9925
  apiUrl
9395
9926
  }) {
9396
9927
  const { t } = useChatkitTranslation();
9397
- const contentId = React29.useId();
9398
- const [isExpanded, setIsExpanded] = React29.useState(!hasFollowingItem);
9928
+ const contentId = React30.useId();
9929
+ const [isExpanded, setIsExpanded] = React30.useState(!hasFollowingItem);
9399
9930
  const categoryCounts = getToolGroupCategoryCounts(items);
9400
9931
  const categorySummary = TOOL_GROUP_CATEGORY_ORDER.flatMap((category) => {
9401
9932
  const count = categoryCounts[category] ?? 0;
@@ -9410,11 +9941,11 @@ function ToolComponentGroup({
9410
9941
  const summary = `${t("message.toolGroup.status.success")} ${categorySummary}`;
9411
9942
  const config = toolStatusConfig.success;
9412
9943
  const StatusIcon = config.icon;
9413
- React29.useEffect(() => {
9944
+ React30.useEffect(() => {
9414
9945
  setIsExpanded(!hasFollowingItem);
9415
- }, [hasFollowingItem, items.length]);
9416
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "px-1 py-1", children: [
9417
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
9946
+ }, [hasFollowingItem]);
9947
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "px-1 py-1", children: [
9948
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
9418
9949
  "button",
9419
9950
  {
9420
9951
  type: "button",
@@ -9423,8 +9954,8 @@ function ToolComponentGroup({
9423
9954
  "aria-controls": contentId,
9424
9955
  onClick: () => setIsExpanded((prev) => !prev),
9425
9956
  children: [
9426
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex min-w-0 items-center gap-2 text-sm font-medium text-muted-foreground", children: [
9427
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
9957
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex min-w-0 items-center gap-2 text-sm font-medium text-muted-foreground", children: [
9958
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
9428
9959
  StatusIcon,
9429
9960
  {
9430
9961
  className: cn(
@@ -9433,10 +9964,10 @@ function ToolComponentGroup({
9433
9964
  )
9434
9965
  }
9435
9966
  ),
9436
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "truncate", children: summary })
9967
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "truncate", children: summary })
9437
9968
  ] }),
9438
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
9439
- import_lucide_react17.ChevronRight,
9969
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
9970
+ import_lucide_react18.ChevronRight,
9440
9971
  {
9441
9972
  "aria-hidden": "true",
9442
9973
  className: cn(
@@ -9448,7 +9979,7 @@ function ToolComponentGroup({
9448
9979
  ]
9449
9980
  }
9450
9981
  ),
9451
- isExpanded && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("ul", { id: contentId, className: "mt-2 space-y-1.5 overflow-y-auto pr-1", children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
9982
+ isExpanded && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("ul", { id: contentId, className: "mt-2 space-y-1.5 overflow-y-auto pr-1", children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
9452
9983
  ToolCallRow,
9453
9984
  {
9454
9985
  content: item,
@@ -9462,14 +9993,14 @@ function ToolComponentGroup({
9462
9993
  }
9463
9994
 
9464
9995
  // src/components/thread/messages/request-user-input-result-card.tsx
9465
- var React30 = require("react");
9996
+ var React31 = require("react");
9466
9997
  var import_chatkit_types6 = require("@xpert-ai/chatkit-types");
9467
- var import_lucide_react18 = require("lucide-react");
9468
- var import_jsx_runtime34 = require("react/jsx-runtime");
9469
- function isRecord2(value) {
9998
+ var import_lucide_react19 = require("lucide-react");
9999
+ var import_jsx_runtime36 = require("react/jsx-runtime");
10000
+ function isRecord3(value) {
9470
10001
  return !!value && typeof value === "object" && !Array.isArray(value);
9471
10002
  }
9472
- function readString(record, keys) {
10003
+ function readString2(record, keys) {
9473
10004
  for (const key of keys) {
9474
10005
  const value = record[key];
9475
10006
  if (typeof value === "string" && value.trim()) {
@@ -9479,12 +10010,12 @@ function readString(record, keys) {
9479
10010
  return null;
9480
10011
  }
9481
10012
  function getToolCallId(value) {
9482
- if (!isRecord2(value)) return null;
9483
- return readString(value, ["id"]);
10013
+ if (!isRecord3(value)) return null;
10014
+ return readString2(value, ["id"]);
9484
10015
  }
9485
10016
  function getToolCallName(value) {
9486
- if (!isRecord2(value)) return null;
9487
- return readString(value, ["name"]);
10017
+ if (!isRecord3(value)) return null;
10018
+ return readString2(value, ["name"]);
9488
10019
  }
9489
10020
  function pushClientToolCallsFromRecord(record, calls) {
9490
10021
  const clientToolCalls = record.clientToolCalls;
@@ -9508,16 +10039,16 @@ function findRequestUserInputClientToolCallById(messages, id) {
9508
10039
  ) ?? null;
9509
10040
  }
9510
10041
  function normalizeAnswer(value) {
9511
- if (!isRecord2(value)) return null;
9512
- const id = readString(value, ["id"]);
9513
- const question = readString(value, ["question"]);
9514
- const answerValue = readString(value, ["value"]);
9515
- const type = readString(value, ["type"]);
10042
+ if (!isRecord3(value)) return null;
10043
+ const id = readString2(value, ["id"]);
10044
+ const question = readString2(value, ["question"]);
10045
+ const answerValue = readString2(value, ["value"]);
10046
+ const type = readString2(value, ["type"]);
9516
10047
  if (!id || !question || !answerValue || type !== "option" && type !== "other") {
9517
10048
  return null;
9518
10049
  }
9519
- const label = readString(value, ["label"]);
9520
- const description = readString(value, ["description"]);
10050
+ const label = readString2(value, ["label"]);
10051
+ const description = readString2(value, ["description"]);
9521
10052
  return {
9522
10053
  id,
9523
10054
  question,
@@ -9536,7 +10067,7 @@ function parseResultOutput(output) {
9536
10067
  return null;
9537
10068
  }
9538
10069
  }
9539
- if (!isRecord2(result) || !Array.isArray(result.answers)) {
10070
+ if (!isRecord3(result) || !Array.isArray(result.answers)) {
9540
10071
  return null;
9541
10072
  }
9542
10073
  const hasExplicitType = result.type === import_chatkit_types6.REQUEST_USER_INPUT_RESULT_TYPE;
@@ -9550,7 +10081,7 @@ function parseResultOutput(output) {
9550
10081
  };
9551
10082
  }
9552
10083
  function getRequestUserInputResultCardData(content, messages) {
9553
- const data = isRecord2(content.data) ? content.data : null;
10084
+ const data = isRecord3(content.data) ? content.data : null;
9554
10085
  if (data?.status !== "success") {
9555
10086
  return null;
9556
10087
  }
@@ -9577,7 +10108,7 @@ function RequestUserInputResultCard({
9577
10108
  className
9578
10109
  }) {
9579
10110
  const { t } = useChatkitTranslation();
9580
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
10111
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
9581
10112
  "section",
9582
10113
  {
9583
10114
  "aria-label": t("message.requestUserInputResult.title"),
@@ -9586,23 +10117,23 @@ function RequestUserInputResultCard({
9586
10117
  className
9587
10118
  ),
9588
10119
  children: [
9589
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "mb-2 flex items-center gap-2 text-sm font-semibold text-foreground", children: [
9590
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react18.CheckCircle2, { className: "h-4 w-4 text-primary" }),
9591
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { children: t("message.requestUserInputResult.title") })
10120
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "mb-2 flex items-center gap-2 text-sm font-semibold text-foreground", children: [
10121
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react19.CheckCircle2, { className: "h-4 w-4 text-primary" }),
10122
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { children: t("message.requestUserInputResult.title") })
9592
10123
  ] }),
9593
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "space-y-2", children: result.answers.map((answer, index) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
10124
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "space-y-2", children: result.answers.map((answer, index) => /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
9594
10125
  "div",
9595
10126
  {
9596
10127
  className: "rounded-md bg-background/70 px-2.5 py-2",
9597
10128
  children: [
9598
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "text-xs font-medium leading-5 text-muted-foreground", children: answer.question }),
9599
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "mt-0.5 flex min-w-0 flex-wrap items-center gap-1.5", children: [
9600
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "min-w-0 wrap-break-word text-sm font-semibold text-foreground", children: answer.label ?? answer.value }),
9601
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "rounded-full bg-muted px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground", children: t(
10129
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "text-xs font-medium leading-5 text-muted-foreground", children: answer.question }),
10130
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "mt-0.5 flex min-w-0 flex-wrap items-center gap-1.5", children: [
10131
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "min-w-0 wrap-break-word text-sm font-semibold text-foreground", children: answer.label ?? answer.value }),
10132
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "rounded-full bg-muted px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground", children: t(
9602
10133
  answer.type === "other" ? "message.requestUserInputResult.other" : "message.requestUserInputResult.option"
9603
10134
  ) })
9604
10135
  ] }),
9605
- answer.description ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "mt-1 text-xs leading-5 text-muted-foreground", children: answer.description }) : null
10136
+ answer.description ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "mt-1 text-xs leading-5 text-muted-foreground", children: answer.description }) : null
9606
10137
  ]
9607
10138
  },
9608
10139
  `${answer.id}-${index}`
@@ -9614,18 +10145,18 @@ function RequestUserInputResultCard({
9614
10145
 
9615
10146
  // src/components/thread/messages/widget.tsx
9616
10147
  var import_a2ui_react = require("@xpert-ai/a2ui-react");
9617
- var import_jsx_runtime35 = require("react/jsx-runtime");
10148
+ var import_jsx_runtime37 = require("react/jsx-runtime");
9618
10149
  function WidgetMessage({ messageId, data }) {
9619
10150
  const widgets = Array.isArray(data.widgets) ? data.widgets : [];
9620
10151
  if (widgets.length === 0) return null;
9621
10152
  const baseSurfaceId = `widget-${messageId}`;
9622
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "space-y-3", children: widgets.map((widget, index) => {
10153
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "space-y-3", children: widgets.map((widget, index) => {
9623
10154
  const config = widget?.config;
9624
10155
  if (!config || typeof config !== "object") {
9625
10156
  return null;
9626
10157
  }
9627
10158
  const surfaceId = widgets.length > 1 ? `${baseSurfaceId}-${index}` : baseSurfaceId;
9628
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
10159
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
9629
10160
  import_a2ui_react.SurfaceRenderer,
9630
10161
  {
9631
10162
  surfaceId,
@@ -9637,7 +10168,7 @@ function WidgetMessage({ messageId, data }) {
9637
10168
  }
9638
10169
 
9639
10170
  // src/components/thread/messages/ai.tsx
9640
- var import_jsx_runtime36 = require("react/jsx-runtime");
10171
+ var import_jsx_runtime38 = require("react/jsx-runtime");
9641
10172
  var assistantMessageStackClassName = "space-y-3 in-data-[density=compact]:space-y-2 in-data-[density=spacious]:space-y-4";
9642
10173
  function isTextContent3(content) {
9643
10174
  return content.type === "text";
@@ -9671,11 +10202,11 @@ function formatDisplayValue3(value) {
9671
10202
  function ReasoningBlock({ reasoning }) {
9672
10203
  const blocks = reasoning.filter((item) => item.text?.trim());
9673
10204
  if (blocks.length === 0) return null;
9674
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "space-y-2", children: blocks.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
10205
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "space-y-2", children: blocks.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
9675
10206
  "div",
9676
10207
  {
9677
10208
  className: "rounded-lg border bg-muted/40 p-3 text-xs text-muted-foreground",
9678
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "whitespace-pre-wrap wrap-break-word leading-relaxed", children: item.text })
10209
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "whitespace-pre-wrap wrap-break-word leading-relaxed", children: item.text })
9679
10210
  },
9680
10211
  item.id ?? `reasoning-${index}`
9681
10212
  )) });
@@ -9683,20 +10214,20 @@ function ReasoningBlock({ reasoning }) {
9683
10214
  function ImageBlock({ content }) {
9684
10215
  const imageUrl = typeof content.image_url === "string" ? content.image_url : typeof content.image_url?.url === "string" ? content.image_url.url : null;
9685
10216
  if (!imageUrl) {
9686
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Card, { children: [
9687
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CardHeader, { className: "space-y-1", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CardTitle, { className: "text-sm", children: "Image" }) }),
9688
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CardContent, { className: "text-xs text-muted-foreground", children: safeJson3(content) })
10217
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Card, { children: [
10218
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CardHeader, { className: "space-y-1", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CardTitle, { className: "text-sm", children: "Image" }) }),
10219
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CardContent, { className: "text-xs text-muted-foreground", children: safeJson3(content) })
9689
10220
  ] });
9690
10221
  }
9691
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("figure", { className: "overflow-hidden rounded-lg border bg-background", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("img", { src: imageUrl, alt: "Assistant output", className: "h-auto w-full object-cover" }) });
10222
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("figure", { className: "overflow-hidden rounded-lg border bg-background", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("img", { src: imageUrl, alt: "Assistant output", className: "h-auto w-full object-cover" }) });
9692
10223
  }
9693
10224
  function MemoryBlock({ content }) {
9694
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Card, { children: [
9695
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(CardHeader, { className: "flex flex-row items-center justify-between gap-2", children: [
9696
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CardTitle, { className: "text-sm", children: "Memory" }),
9697
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Badge, { variant: "secondary", children: "Memory" })
10225
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Card, { children: [
10226
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(CardHeader, { className: "flex flex-row items-center justify-between gap-2", children: [
10227
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CardTitle, { className: "text-sm", children: "Memory" }),
10228
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Badge, { variant: "secondary", children: "Memory" })
9698
10229
  ] }),
9699
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CardContent, { className: "text-xs text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("pre", { className: "whitespace-pre-wrap wrap-break-word", children: safeJson3(content.data ?? []) }) })
10230
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CardContent, { className: "text-xs text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("pre", { className: "whitespace-pre-wrap wrap-break-word", children: safeJson3(content.data ?? []) }) })
9700
10231
  ] });
9701
10232
  }
9702
10233
  function parseStepDate2(value) {
@@ -9730,11 +10261,11 @@ function formatStepDuration3(durationMs) {
9730
10261
  }
9731
10262
  function ComponentBlock({ content }) {
9732
10263
  const { i18n: i18n2 } = useChatkitTranslation();
9733
- const [isExpanded, setIsExpanded] = React31.useState(false);
9734
- const contentRef = React31.useRef(null);
9735
- const shouldAutoScrollRef = React31.useRef(true);
9736
- const previousScrollTopRef = React31.useRef(0);
9737
- const [durationNow, setDurationNow] = React31.useState(() => Date.now());
10264
+ const [isExpanded, setIsExpanded] = React32.useState(false);
10265
+ const contentRef = React32.useRef(null);
10266
+ const shouldAutoScrollRef = React32.useRef(true);
10267
+ const previousScrollTopRef = React32.useRef(0);
10268
+ const [durationNow, setDurationNow] = React32.useState(() => Date.now());
9738
10269
  const data = getToolStepData(content);
9739
10270
  const category = data.category ?? "Component";
9740
10271
  const title = getToolActivityLabel(content, i18n2.language);
@@ -9748,10 +10279,10 @@ function ComponentBlock({ content }) {
9748
10279
  const endedAt = parseStepDate2(data.end_date);
9749
10280
  const durationMs = createdAt === null ? null : Math.max(0, (endedAt ?? durationNow) - createdAt);
9750
10281
  const durationLabel = durationMs === null ? null : formatStepDuration3(durationMs);
9751
- React31.useEffect(() => {
10282
+ React32.useEffect(() => {
9752
10283
  if (status === "running" && output !== null) setIsExpanded(true);
9753
10284
  }, [status, output]);
9754
- React31.useEffect(() => {
10285
+ React32.useEffect(() => {
9755
10286
  if (status !== "running" || createdAt === null || endedAt !== null) {
9756
10287
  return;
9757
10288
  }
@@ -9763,7 +10294,7 @@ function ComponentBlock({ content }) {
9763
10294
  window.clearInterval(timer);
9764
10295
  };
9765
10296
  }, [createdAt, endedAt, status]);
9766
- React31.useEffect(() => {
10297
+ React32.useEffect(() => {
9767
10298
  const element = contentRef.current;
9768
10299
  if (!element) return;
9769
10300
  previousScrollTopRef.current = element.scrollTop;
@@ -9783,7 +10314,7 @@ function ComponentBlock({ content }) {
9783
10314
  element.removeEventListener("scroll", updateAutoScrollState);
9784
10315
  };
9785
10316
  }, [isExpanded]);
9786
- React31.useEffect(() => {
10317
+ React32.useEffect(() => {
9787
10318
  if (status !== "running") {
9788
10319
  shouldAutoScrollRef.current = true;
9789
10320
  return;
@@ -9796,25 +10327,25 @@ function ComponentBlock({ content }) {
9796
10327
  }, [isExpanded, output, status]);
9797
10328
  const config = status ? toolStatusConfig[status] : null;
9798
10329
  const StatusIcon = config?.icon;
9799
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Card, { children: [
9800
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(CardHeader, { className: "flex flex-row items-center justify-between gap-2 px-2 py-1 cursor-pointer", onClick: () => setIsExpanded(!isExpanded), children: [
9801
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center space-x-1 flex-1 min-w-0", children: [
9802
- status && StatusIcon && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(StatusIcon, { className: cn("h-4 w-4", config?.iconClass, status === "running" && "animate-spin") }),
9803
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CardTitle, { className: "text-sm truncate", children: title })
10330
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Card, { children: [
10331
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(CardHeader, { className: "flex flex-row items-center justify-between gap-2 px-2 py-1 cursor-pointer", onClick: () => setIsExpanded(!isExpanded), children: [
10332
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center space-x-1 flex-1 min-w-0", children: [
10333
+ status && StatusIcon && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(StatusIcon, { className: cn("h-4 w-4", config?.iconClass, status === "running" && "animate-spin") }),
10334
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CardTitle, { className: "text-sm truncate", children: title })
9804
10335
  ] }),
9805
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex flex-wrap items-center gap-2 shrink-0", children: [
9806
- durationLabel && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "inline-flex items-center gap-1 text-[11px] text-muted-foreground tabular-nums", children: [
9807
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react19.Clock3, { className: "h-3 w-3" }),
9808
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { children: durationLabel })
10336
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex flex-wrap items-center gap-2 shrink-0", children: [
10337
+ durationLabel && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "inline-flex items-center gap-1 text-[11px] text-muted-foreground tabular-nums", children: [
10338
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react20.Clock3, { className: "h-3 w-3" }),
10339
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: durationLabel })
9809
10340
  ] }),
9810
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Badge, { variant: "secondary", className: "rounded-lg px-1.5", children: category }),
9811
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
10341
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Badge, { variant: "secondary", className: "rounded-lg px-1.5", children: category }),
10342
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
9812
10343
  "button",
9813
10344
  {
9814
10345
  className: "text-muted-foreground hover:text-foreground transition-colors",
9815
10346
  "aria-label": isExpanded ? "Collapse" : "Expand",
9816
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
9817
- import_lucide_react19.ChevronDown,
10347
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
10348
+ import_lucide_react20.ChevronDown,
9818
10349
  {
9819
10350
  className: cn("h-4 w-4 transition-transform", isExpanded && "rotate-180")
9820
10351
  }
@@ -9823,35 +10354,35 @@ function ComponentBlock({ content }) {
9823
10354
  )
9824
10355
  ] })
9825
10356
  ] }),
9826
- isExpanded && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(CardContent, { ref: contentRef, className: "text-xs text-muted-foreground max-h-60 overflow-auto", children: [
9827
- data.input && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("pre", { className: "whitespace-pre-wrap wrap-break-word", children: formatDisplayValue3(data.input) }),
9828
- error ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("pre", { className: "whitespace-pre-wrap wrap-break-word text-destructive", children: formatDisplayValue3(error) }) : hasOutput && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("pre", { className: "whitespace-pre-wrap wrap-break-word", children: formatDisplayValue3(fallback) })
10357
+ isExpanded && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(CardContent, { ref: contentRef, className: "text-xs text-muted-foreground max-h-60 overflow-auto", children: [
10358
+ data.input && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("pre", { className: "whitespace-pre-wrap wrap-break-word", children: formatDisplayValue3(data.input) }),
10359
+ error ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("pre", { className: "whitespace-pre-wrap wrap-break-word text-destructive", children: formatDisplayValue3(error) }) : hasOutput && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("pre", { className: "whitespace-pre-wrap wrap-break-word", children: formatDisplayValue3(fallback) })
9829
10360
  ] })
9830
10361
  ] });
9831
10362
  }
9832
10363
  function UnknownBlock({ content }) {
9833
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Card, { children: [
9834
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(CardHeader, { className: "flex flex-row items-center justify-between gap-2", children: [
9835
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CardTitle, { className: "text-sm", children: "Assistant Content" }),
9836
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Badge, { variant: "outline", children: content.type ?? "unknown" })
10364
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Card, { children: [
10365
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(CardHeader, { className: "flex flex-row items-center justify-between gap-2", children: [
10366
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CardTitle, { className: "text-sm", children: "Assistant Content" }),
10367
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Badge, { variant: "outline", children: content.type ?? "unknown" })
9837
10368
  ] }),
9838
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CardContent, { className: "text-xs text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("pre", { className: "whitespace-pre-wrap break-words", children: safeJson3(content) }) })
10369
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CardContent, { className: "text-xs text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("pre", { className: "whitespace-pre-wrap break-words", children: safeJson3(content) }) })
9839
10370
  ] });
9840
10371
  }
9841
10372
  function renderContentItem(content, index, message, lookupMessages, options) {
9842
10373
  const messageId = message.id;
9843
10374
  const textClassName = options?.isAgentOutput ? "text-sm [&_.markdown-content_p]:!leading-6" : void 0;
9844
10375
  if (typeof content === "string") {
9845
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: textClassName, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(MarkdownText, { children: content }) }, `text-${index}`);
10376
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: textClassName, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MarkdownText, { children: content }) }, `text-${index}`);
9846
10377
  }
9847
10378
  if (isTextContent3(content)) {
9848
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: textClassName, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(MarkdownText, { children: content.text }) }, content.id ?? `text-${index}`);
10379
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: textClassName, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MarkdownText, { children: content.text }) }, content.id ?? `text-${index}`);
9849
10380
  }
9850
10381
  if (isReasoningContent3(content)) {
9851
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ReasoningBlock, { reasoning: [content] }) }, content.id ?? `reasoning-${index}`);
10382
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ReasoningBlock, { reasoning: [content] }) }, content.id ?? `reasoning-${index}`);
9852
10383
  }
9853
10384
  if (isImageContent(content)) {
9854
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ImageBlock, { content }) }, content.id ?? `image-${index}`);
10385
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ImageBlock, { content }) }, content.id ?? `image-${index}`);
9855
10386
  }
9856
10387
  if (isComponentContent3(content)) {
9857
10388
  const requestUserInputResult = getRequestUserInputResultCardData(
@@ -9859,13 +10390,13 @@ function renderContentItem(content, index, message, lookupMessages, options) {
9859
10390
  lookupMessages
9860
10391
  );
9861
10392
  if (requestUserInputResult) {
9862
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(RequestUserInputResultCard, { result: requestUserInputResult }) }, content.id ?? `request-user-input-result-${index}`);
10393
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(RequestUserInputResultCard, { result: requestUserInputResult }) }, content.id ?? `request-user-input-result-${index}`);
9863
10394
  }
9864
10395
  if (isWidgetComponent2(content)) {
9865
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(WidgetMessage, { messageId, data: content.data }) }, content.id ?? `widget-${index}`);
10396
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(WidgetMessage, { messageId, data: content.data }) }, content.id ?? `widget-${index}`);
9866
10397
  }
9867
10398
  if (getComponentMessagePresentation(content, getToolStepData(content)) === "grouped-step") {
9868
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
10399
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
9869
10400
  ToolComponentGroup,
9870
10401
  {
9871
10402
  items: [content],
@@ -9876,15 +10407,15 @@ function renderContentItem(content, index, message, lookupMessages, options) {
9876
10407
  }
9877
10408
  ) }, content.id ?? `component-group-${index}`);
9878
10409
  }
9879
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ComponentBlock, { content }) }, content.id ?? `component-${index}`);
10410
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ComponentBlock, { content }) }, content.id ?? `component-${index}`);
9880
10411
  }
9881
10412
  if (isMemoryContent(content)) {
9882
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(MemoryBlock, { content }) }, content.id ?? `memory-${index}`);
10413
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MemoryBlock, { content }) }, content.id ?? `memory-${index}`);
9883
10414
  }
9884
10415
  if (isAgentEventContent(content)) {
9885
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(AgentEventRow, { content }) }, content.id ?? `agent-event-${index}`);
10416
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(AgentEventRow, { content }) }, content.id ?? `agent-event-${index}`);
9886
10417
  }
9887
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(UnknownBlock, { content }) }, content.id ?? `unknown-${index}`);
10418
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(UnknownBlock, { content }) }, content.id ?? `unknown-${index}`);
9888
10419
  }
9889
10420
  function renderContentUnit(unit, message, lookupMessages, hasFollowingItem, options) {
9890
10421
  if (unit.type === "item") {
@@ -9895,22 +10426,16 @@ function renderContentUnit(unit, message, lookupMessages, hasFollowingItem, opti
9895
10426
  isAgentOutput: options?.isAgentOutput
9896
10427
  });
9897
10428
  }
9898
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
9899
- "div",
10429
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
10430
+ ToolComponentGroup,
9900
10431
  {
9901
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
9902
- ToolComponentGroup,
9903
- {
9904
- items: unit.items,
9905
- hasFollowingItem,
9906
- isThreadRunning: options?.isThreadRunning,
9907
- organizationId: options?.organizationId,
9908
- apiUrl: options?.apiUrl
9909
- }
9910
- )
9911
- },
9912
- `tool-group-${unit.startIndex}-${unit.items[0]?.id ?? "tool"}-${unit.items.length}`
9913
- );
10432
+ items: unit.items,
10433
+ hasFollowingItem,
10434
+ isThreadRunning: options?.isThreadRunning,
10435
+ organizationId: options?.organizationId,
10436
+ apiUrl: options?.apiUrl
10437
+ }
10438
+ ) }, `tool-group-${unit.startIndex}-${unit.items[0]?.id ?? "tool"}`);
9914
10439
  }
9915
10440
  function renderEntryBatch(entries, message, lookupMessages, hasFollowingItem, options) {
9916
10441
  if (entries.length === 0) return null;
@@ -9938,7 +10463,7 @@ function renderAssistantRenderUnits(units, message, lookupMessages, options, dep
9938
10463
  const batch = entryBatch;
9939
10464
  entryBatch = [];
9940
10465
  rendered.push(
9941
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(React31.Fragment, { children: renderEntryBatch(batch, message, lookupMessages, hasFollowingItem, {
10466
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(React32.Fragment, { children: renderEntryBatch(batch, message, lookupMessages, hasFollowingItem, {
9942
10467
  ...options,
9943
10468
  isAgentOutput: depth > 0
9944
10469
  }) }, `entries-${batch[0]?.order ?? rendered.length}`)
@@ -9955,7 +10480,7 @@ function renderAssistantRenderUnits(units, message, lookupMessages, options, dep
9955
10480
  }
9956
10481
  flushEntries(true);
9957
10482
  rendered.push(
9958
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
10483
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
9959
10484
  AgentRunGroup,
9960
10485
  {
9961
10486
  node: unit.node,
@@ -9980,7 +10505,7 @@ function renderContent(message, lookupMessages, options) {
9980
10505
  message
9981
10506
  );
9982
10507
  if (renderTree.hasAgentRuns) {
9983
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: assistantMessageStackClassName, children: renderAssistantRenderUnits(
10508
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: assistantMessageStackClassName, children: renderAssistantRenderUnits(
9984
10509
  renderTree.units,
9985
10510
  message,
9986
10511
  lookupMessages,
@@ -9990,13 +10515,13 @@ function renderContent(message, lookupMessages, options) {
9990
10515
  const content = message.content;
9991
10516
  if (typeof content === "string") {
9992
10517
  if (!content.trim()) return null;
9993
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(MarkdownText, { children: content });
10518
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MarkdownText, { children: content });
9994
10519
  }
9995
10520
  if (!Array.isArray(content) || content.length === 0) return null;
9996
10521
  const renderUnits = buildToolComponentRenderUnits(content, {
9997
10522
  shouldGroupComponent: (item) => getRequestUserInputResultCardData(item, lookupMessages) === null
9998
10523
  });
9999
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "space-y-3", children: renderUnits.map(
10524
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "space-y-3", children: renderUnits.map(
10000
10525
  (unit, index) => renderContentUnit(
10001
10526
  unit,
10002
10527
  message,
@@ -10016,7 +10541,7 @@ function AssistantStreamingIndicator({
10016
10541
  thinking: t("message.thinking"),
10017
10542
  answering: t("message.answering")
10018
10543
  };
10019
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
10544
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
10020
10545
  "div",
10021
10546
  {
10022
10547
  className: cn(
@@ -10024,18 +10549,18 @@ function AssistantStreamingIndicator({
10024
10549
  className
10025
10550
  ),
10026
10551
  children: [
10027
- status === "loading" && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react19.Loader2, { className: "h-3.5 w-3.5 animate-spin" }),
10028
- status === "thinking" && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-end gap-1", "aria-hidden": "true", children: [
10029
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:-0.3s]" }),
10030
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:-0.15s]" }),
10031
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce" })
10552
+ status === "loading" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react20.Loader2, { className: "h-3.5 w-3.5 animate-spin" }),
10553
+ status === "thinking" && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-end gap-1", "aria-hidden": "true", children: [
10554
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:-0.3s]" }),
10555
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:-0.15s]" }),
10556
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce" })
10032
10557
  ] }),
10033
- status === "answering" && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-end gap-1", "aria-hidden": "true", children: [
10034
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "h-2 w-0.5 rounded-full bg-current animate-pulse [animation-delay:-0.25s]" }),
10035
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "h-3 w-0.5 rounded-full bg-current animate-pulse [animation-delay:-0.1s]" }),
10036
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "h-2.5 w-0.5 rounded-full bg-current animate-pulse" })
10558
+ status === "answering" && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-end gap-1", "aria-hidden": "true", children: [
10559
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "h-2 w-0.5 rounded-full bg-current animate-pulse [animation-delay:-0.25s]" }),
10560
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "h-3 w-0.5 rounded-full bg-current animate-pulse [animation-delay:-0.1s]" }),
10561
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "h-2.5 w-0.5 rounded-full bg-current animate-pulse" })
10037
10562
  ] }),
10038
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { children: labelMap[status] })
10563
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: labelMap[status] })
10039
10564
  ]
10040
10565
  }
10041
10566
  );
@@ -10064,42 +10589,42 @@ function AssistantMessage({
10064
10589
  organizationId,
10065
10590
  apiUrl
10066
10591
  });
10067
- const reasoningNode = hasReasoning ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ReasoningBlock, { reasoning: rootReasoning ?? [] }) : null;
10592
+ const reasoningNode = hasReasoning ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ReasoningBlock, { reasoning: rootReasoning ?? [] }) : null;
10068
10593
  if (!hasContent && !hasReasoning && !resolvedStreamingStatus) return null;
10069
10594
  const streamingClass = isStreaming ? "streaming-active" : "";
10070
10595
  if (!hasContent && !hasReasoning && resolvedStreamingStatus) {
10071
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: cn("space-y-3", streamingClass, className), children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) });
10596
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: cn("space-y-3", streamingClass, className), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) });
10072
10597
  }
10073
10598
  if (hasContent && hasReasoning) {
10074
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: cn("space-y-3", streamingClass, className), children: [
10075
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
10599
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: cn("space-y-3", streamingClass, className), children: [
10600
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
10076
10601
  Tabs,
10077
10602
  {
10078
10603
  defaultValue: message.status === "reasoning" ? "reasoning" : "answer",
10079
10604
  className: "w-full",
10080
10605
  children: [
10081
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(TabsList, { className: "", children: [
10082
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TabsTrigger, { value: "answer", children: t("message.answer") }),
10083
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TabsTrigger, { value: "reasoning", children: t("message.reasoning") })
10606
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(TabsList, { className: "", children: [
10607
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TabsTrigger, { value: "answer", children: t("message.answer") }),
10608
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TabsTrigger, { value: "reasoning", children: t("message.reasoning") })
10084
10609
  ] }),
10085
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TabsContent, { value: "answer", className: "space-y-3", children: answerNode }),
10086
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TabsContent, { value: "reasoning", className: "space-y-3", children: reasoningNode })
10610
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TabsContent, { value: "answer", className: "space-y-3", children: answerNode }),
10611
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TabsContent, { value: "reasoning", className: "space-y-3", children: reasoningNode })
10087
10612
  ]
10088
10613
  }
10089
10614
  ),
10090
- resolvedStreamingStatus ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) : null
10615
+ resolvedStreamingStatus ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) : null
10091
10616
  ] });
10092
10617
  }
10093
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: cn("space-y-3", streamingClass, className), children: [
10618
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: cn("space-y-3", streamingClass, className), children: [
10094
10619
  hasReasoning ? reasoningNode : answerNode,
10095
- resolvedStreamingStatus ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) : null
10620
+ resolvedStreamingStatus ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) : null
10096
10621
  ] });
10097
10622
  }
10098
10623
 
10099
10624
  // src/components/thread/MessageActions.tsx
10100
- var React32 = __toESM(require("react"), 1);
10101
- var import_lucide_react20 = require("lucide-react");
10102
- var import_jsx_runtime37 = require("react/jsx-runtime");
10625
+ var React33 = __toESM(require("react"), 1);
10626
+ var import_lucide_react21 = require("lucide-react");
10627
+ var import_jsx_runtime39 = require("react/jsx-runtime");
10103
10628
  function MessageActions({
10104
10629
  content,
10105
10630
  isAssistant = false,
@@ -10108,7 +10633,7 @@ function MessageActions({
10108
10633
  className
10109
10634
  }) {
10110
10635
  const { t } = useChatkitTranslation();
10111
- const [copied, setCopied] = React32.useState(false);
10636
+ const [copied, setCopied] = React33.useState(false);
10112
10637
  const handleCopy = async () => {
10113
10638
  try {
10114
10639
  await navigator.clipboard.writeText(content);
@@ -10121,7 +10646,7 @@ function MessageActions({
10121
10646
  if (isStreaming) {
10122
10647
  return null;
10123
10648
  }
10124
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
10649
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
10125
10650
  "div",
10126
10651
  {
10127
10652
  className: cn(
@@ -10129,7 +10654,7 @@ function MessageActions({
10129
10654
  className
10130
10655
  ),
10131
10656
  children: [
10132
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
10657
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
10133
10658
  "button",
10134
10659
  {
10135
10660
  type: "button",
@@ -10139,17 +10664,17 @@ function MessageActions({
10139
10664
  copied && "text-green-500"
10140
10665
  ),
10141
10666
  title: copied ? t("messageActions.copied") : t("messageActions.copy"),
10142
- children: copied ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react20.Check, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react20.Copy, { size: 14 })
10667
+ children: copied ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react21.Check, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react21.Copy, { size: 14 })
10143
10668
  }
10144
10669
  ),
10145
- isAssistant && onRetry && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
10670
+ isAssistant && onRetry && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
10146
10671
  "button",
10147
10672
  {
10148
10673
  type: "button",
10149
10674
  onClick: onRetry,
10150
10675
  className: "p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",
10151
10676
  title: t("messageActions.regenerate"),
10152
- children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react20.RefreshCw, { size: 14 })
10677
+ children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react21.RefreshCw, { size: 14 })
10153
10678
  }
10154
10679
  )
10155
10680
  ]
@@ -10158,20 +10683,20 @@ function MessageActions({
10158
10683
  }
10159
10684
 
10160
10685
  // src/components/thread/StartScreen.tsx
10161
- var React33 = require("react");
10162
- var import_lucide_react21 = require("lucide-react");
10163
- var import_jsx_runtime38 = require("react/jsx-runtime");
10686
+ var React34 = require("react");
10687
+ var import_lucide_react22 = require("lucide-react");
10688
+ var import_jsx_runtime40 = require("react/jsx-runtime");
10164
10689
  function getIconComponent2(icon) {
10165
10690
  const iconMap = {
10166
- "circle-question": /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react21.HelpCircle, { size: 20 }),
10167
- "lightbulb": /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react21.Lightbulb, { size: 20 }),
10168
- "sparkle": /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react21.Sparkles, { size: 20 }),
10169
- "write": /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react21.Pencil, { size: 20 }),
10170
- "search": /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react21.Search, { size: 20 }),
10171
- "globe": /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react21.Globe, { size: 20 }),
10172
- "book-open": /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react21.BookOpen, { size: 20 }),
10173
- "compass": /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react21.Compass, { size: 20 }),
10174
- "bolt": /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react21.Zap, { size: 20 })
10691
+ "circle-question": /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react22.HelpCircle, { size: 20 }),
10692
+ "lightbulb": /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react22.Lightbulb, { size: 20 }),
10693
+ "sparkle": /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react22.Sparkles, { size: 20 }),
10694
+ "write": /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react22.Pencil, { size: 20 }),
10695
+ "search": /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react22.Search, { size: 20 }),
10696
+ "globe": /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react22.Globe, { size: 20 }),
10697
+ "book-open": /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react22.BookOpen, { size: 20 }),
10698
+ "compass": /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react22.Compass, { size: 20 }),
10699
+ "bolt": /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react22.Zap, { size: 20 })
10175
10700
  };
10176
10701
  return icon ? iconMap[icon] || iconMap["sparkle"] : iconMap["sparkle"];
10177
10702
  }
@@ -10179,9 +10704,9 @@ function StartScreen({ startScreen, onPromptClick, className }) {
10179
10704
  const { t } = useChatkitTranslation();
10180
10705
  const greeting = startScreen?.greeting ?? t("startScreen.greeting");
10181
10706
  const prompts = startScreen?.prompts ?? [];
10182
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: cn("flex flex-col items-center justify-center py-12 px-4", className), children: [
10183
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "mb-8 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h2", { className: "text-2xl font-semibold text-foreground mb-2", children: greeting }) }),
10184
- prompts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "w-full max-w-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: prompts.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
10707
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: cn("flex flex-col items-center justify-center py-12 px-4", className), children: [
10708
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "mb-8 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("h2", { className: "text-2xl font-semibold text-foreground mb-2", children: greeting }) }),
10709
+ prompts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "w-full max-w-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: prompts.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
10185
10710
  "button",
10186
10711
  {
10187
10712
  type: "button",
@@ -10192,8 +10717,8 @@ function StartScreen({ startScreen, onPromptClick, className }) {
10192
10717
  "focus:outline-none focus:ring-2 focus:ring-primary/20"
10193
10718
  ),
10194
10719
  children: [
10195
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary", children: getIconComponent2(item.icon) }),
10196
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "text-sm font-medium text-foreground", children: item.label })
10720
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary", children: getIconComponent2(item.icon) }),
10721
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-sm font-medium text-foreground", children: item.label })
10197
10722
  ]
10198
10723
  },
10199
10724
  `prompt-${index}`
@@ -10202,7 +10727,7 @@ function StartScreen({ startScreen, onPromptClick, className }) {
10202
10727
  }
10203
10728
 
10204
10729
  // src/hooks/useThreads.ts
10205
- var React34 = __toESM(require("react"), 1);
10730
+ var React35 = __toESM(require("react"), 1);
10206
10731
  var DEFAULT_LIMIT = 50;
10207
10732
  var getThreadTitle = (threadRecord) => {
10208
10733
  const title = threadRecord.title?.trim();
@@ -10255,16 +10780,16 @@ function useThreads(limit = DEFAULT_LIMIT) {
10255
10780
  isLoading: isStreamLoading,
10256
10781
  error: streamError
10257
10782
  } = useStreamContext();
10258
- const [threadRecords, setThreadRecords] = React34.useState([]);
10259
- const [isLoading, setIsLoading] = React34.useState(false);
10260
- const [error, setError] = React34.useState(null);
10261
- const upsertThreadRecord = React34.useCallback((threadRecord) => {
10783
+ const [threadRecords, setThreadRecords] = React35.useState([]);
10784
+ const [isLoading, setIsLoading] = React35.useState(false);
10785
+ const [error, setError] = React35.useState(null);
10786
+ const upsertThreadRecord = React35.useCallback((threadRecord) => {
10262
10787
  setThreadRecords((prev) => {
10263
10788
  const next = prev.filter((item) => item.id !== threadRecord.id);
10264
10789
  return sortThreadRecords([threadRecord, ...next]);
10265
10790
  });
10266
10791
  }, []);
10267
- const refreshThreads = React34.useCallback(async () => {
10792
+ const refreshThreads = React35.useCallback(async () => {
10268
10793
  setIsLoading(true);
10269
10794
  setError(null);
10270
10795
  try {
@@ -10280,7 +10805,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
10280
10805
  setIsLoading(false);
10281
10806
  }
10282
10807
  }, [client, limit, assistantId]);
10283
- const createThread = React34.useCallback(
10808
+ const createThread = React35.useCallback(
10284
10809
  async (input) => {
10285
10810
  setError(null);
10286
10811
  const payload = {};
@@ -10294,7 +10819,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
10294
10819
  },
10295
10820
  [client, upsertThreadRecord]
10296
10821
  );
10297
- const updateThread = React34.useCallback(
10822
+ const updateThread = React35.useCallback(
10298
10823
  async (recordId, payload) => {
10299
10824
  setError(null);
10300
10825
  const updated = await client.conversations.update(recordId, payload);
@@ -10303,7 +10828,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
10303
10828
  },
10304
10829
  [client, upsertThreadRecord]
10305
10830
  );
10306
- const deleteThread = React34.useCallback(
10831
+ const deleteThread = React35.useCallback(
10307
10832
  async (recordId) => {
10308
10833
  setError(null);
10309
10834
  await client.conversations.delete(recordId);
@@ -10311,11 +10836,11 @@ function useThreads(limit = DEFAULT_LIMIT) {
10311
10836
  },
10312
10837
  [client]
10313
10838
  );
10314
- React34.useEffect(() => {
10839
+ React35.useEffect(() => {
10315
10840
  if (!isReady) return;
10316
10841
  void refreshThreads();
10317
10842
  }, [refreshThreads, isReady]);
10318
- React34.useEffect(() => {
10843
+ React35.useEffect(() => {
10319
10844
  if (!threadId || !isStreamLoading) return;
10320
10845
  const now = (/* @__PURE__ */ new Date()).toISOString();
10321
10846
  const busyStatus = "busy";
@@ -10336,7 +10861,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
10336
10861
  return changed ? sortThreadRecords(next) : prev;
10337
10862
  });
10338
10863
  }, [threadId, isStreamLoading]);
10339
- React34.useEffect(() => {
10864
+ React35.useEffect(() => {
10340
10865
  const message = getErrorMessage(streamError)?.trim();
10341
10866
  if (!threadId || !message) return;
10342
10867
  const now = (/* @__PURE__ */ new Date()).toISOString();
@@ -10358,7 +10883,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
10358
10883
  return changed ? sortThreadRecords(next) : prev;
10359
10884
  });
10360
10885
  }, [threadId, streamError]);
10361
- React34.useEffect(() => {
10886
+ React35.useEffect(() => {
10362
10887
  if (!isReady || !threadId || isStreamLoading) return;
10363
10888
  let cancelled = false;
10364
10889
  void client.conversations.search({ where: { threadId }, limit: 1 }).then((result) => {
@@ -10372,7 +10897,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
10372
10897
  cancelled = true;
10373
10898
  };
10374
10899
  }, [client, threadId, upsertThreadRecord, isReady, isStreamLoading]);
10375
- const threads = React34.useMemo(
10900
+ const threads = React35.useMemo(
10376
10901
  () => threadRecords.map((threadRecord) => toThreadItem(threadRecord)),
10377
10902
  [threadRecords]
10378
10903
  );
@@ -10389,10 +10914,10 @@ function useThreads(limit = DEFAULT_LIMIT) {
10389
10914
  }
10390
10915
 
10391
10916
  // src/components/thread/context-usage-indicator.tsx
10392
- var React35 = __toESM(require("react"), 1);
10917
+ var React36 = __toESM(require("react"), 1);
10393
10918
 
10394
10919
  // src/components/ui/progress-circle.tsx
10395
- var import_jsx_runtime39 = (
10920
+ var import_jsx_runtime41 = (
10396
10921
  // biome-ignore lint/a11y/useFocusableInteractive: false positive (progress + progressbar are not focusable interactives)
10397
10922
  // biome-ignore lint/nursery/useAriaPropsSupportedByRole: biome rule at odds with mdn docs (presumed nursary bug with rule)
10398
10923
  require("react/jsx-runtime")
@@ -10416,7 +10941,7 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
10416
10941
  fill: "none",
10417
10942
  strokeWidth
10418
10943
  };
10419
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
10944
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
10420
10945
  "svg",
10421
10946
  {
10422
10947
  role: "progressbar",
@@ -10427,8 +10952,8 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
10427
10952
  "aria-valuemax": 100,
10428
10953
  ...restSvgProps,
10429
10954
  children: [
10430
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("circle", { ...commonParams, className: "stroke-current/25" }),
10431
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
10955
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("circle", { ...commonParams, className: "stroke-current/25" }),
10956
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
10432
10957
  "circle",
10433
10958
  {
10434
10959
  ...commonParams,
@@ -10446,7 +10971,7 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
10446
10971
  };
10447
10972
 
10448
10973
  // src/components/thread/context-usage-indicator.tsx
10449
- var import_jsx_runtime40 = require("react/jsx-runtime");
10974
+ var import_jsx_runtime42 = require("react/jsx-runtime");
10450
10975
  var kNumberFormatter = new Intl.NumberFormat("en-US", {
10451
10976
  minimumFractionDigits: 0,
10452
10977
  maximumFractionDigits: 1
@@ -10479,20 +11004,20 @@ function ContextUsageIndicator({
10479
11004
  }) {
10480
11005
  const { t } = useChatkitTranslation();
10481
11006
  const stream = useStreamContext();
10482
- const [maxContextSize, setMaxContextSize] = React35.useState(null);
10483
- const [usedContextSize, setUsedContextSize] = React35.useState(null);
10484
- const [assistantAgentKey, setAssistantAgentKey] = React35.useState(null);
10485
- const latestRealtimeUsageRef = React35.useRef({
11007
+ const [maxContextSize, setMaxContextSize] = React36.useState(null);
11008
+ const [usedContextSize, setUsedContextSize] = React36.useState(null);
11009
+ const [assistantAgentKey, setAssistantAgentKey] = React36.useState(null);
11010
+ const latestRealtimeUsageRef = React36.useRef({
10486
11011
  threadId: null,
10487
11012
  agentKey: null,
10488
11013
  usedTokens: null
10489
11014
  });
10490
- const realtimeUsage = React35.useMemo(
11015
+ const realtimeUsage = React36.useMemo(
10491
11016
  () => getThreadContextUsage(stream.contextUsageByAgentKey, assistantAgentKey),
10492
11017
  [assistantAgentKey, stream.contextUsageByAgentKey]
10493
11018
  );
10494
11019
  const realtimeUsedContextSize = getThreadContextUsageTotalTokens(realtimeUsage);
10495
- React35.useEffect(() => {
11020
+ React36.useEffect(() => {
10496
11021
  if (!stream.client || !stream.assistantId) {
10497
11022
  setMaxContextSize(null);
10498
11023
  setAssistantAgentKey(null);
@@ -10512,18 +11037,18 @@ function ContextUsageIndicator({
10512
11037
  cancelled = true;
10513
11038
  };
10514
11039
  }, [stream.client, stream.assistantId]);
10515
- React35.useEffect(() => {
11040
+ React36.useEffect(() => {
10516
11041
  latestRealtimeUsageRef.current = {
10517
11042
  threadId: stream.threadId ?? null,
10518
11043
  agentKey: assistantAgentKey,
10519
11044
  usedTokens: realtimeUsedContextSize
10520
11045
  };
10521
11046
  }, [assistantAgentKey, realtimeUsedContextSize, stream.threadId]);
10522
- React35.useEffect(() => {
11047
+ React36.useEffect(() => {
10523
11048
  if (realtimeUsedContextSize == null) return;
10524
11049
  setUsedContextSize(realtimeUsedContextSize);
10525
11050
  }, [realtimeUsedContextSize]);
10526
- React35.useEffect(() => {
11051
+ React36.useEffect(() => {
10527
11052
  if (!stream.client) {
10528
11053
  setUsedContextSize(null);
10529
11054
  return;
@@ -10588,8 +11113,8 @@ function ContextUsageIndicator({
10588
11113
  });
10589
11114
  const usageLabelWithSuffix = usageLabel.endsWith(":") ? usageLabel : `${usageLabel}:`;
10590
11115
  const progressClassName = percent >= 90 ? "text-destructive" : percent >= 75 ? "text-amber-500" : "text-primary dark:text-zinc-300";
10591
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Tooltip, { children: [
10592
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
11116
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Tooltip, { children: [
11117
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
10593
11118
  "button",
10594
11119
  {
10595
11120
  type: "button",
@@ -10598,31 +11123,31 @@ function ContextUsageIndicator({
10598
11123
  className
10599
11124
  ),
10600
11125
  "aria-label": `${usageLabelWithSuffix} ${usageFullLabel}. ${usageTokensLabel}`,
10601
- children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ProgressCircle, { value: percent, className: cn("size-3.5", progressClassName) })
11126
+ children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ProgressCircle, { value: percent, className: cn("size-3.5", progressClassName) })
10602
11127
  }
10603
11128
  ) }),
10604
- /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(TooltipContent, { side: "top", sideOffset: 6, className: "space-y-0.5 px-3 py-2 text-center", children: [
10605
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "text-primary-foreground/70", children: usageLabelWithSuffix }),
10606
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "font-medium text-primary-foreground/80", children: usageFullLabel }),
10607
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "text-sm font-semibold", children: usageTokensLabel })
11129
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(TooltipContent, { side: "top", sideOffset: 6, className: "space-y-0.5 px-3 py-2 text-center", children: [
11130
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "text-primary-foreground/70", children: usageLabelWithSuffix }),
11131
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "font-medium text-primary-foreground/80", children: usageFullLabel }),
11132
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "text-sm font-semibold", children: usageTokensLabel })
10608
11133
  ] })
10609
11134
  ] });
10610
11135
  }
10611
11136
 
10612
11137
  // src/components/pet/PetBridge.tsx
10613
- var React36 = __toESM(require("react"), 1);
11138
+ var React37 = __toESM(require("react"), 1);
10614
11139
  var import_chatkit_types7 = require("@xpert-ai/chatkit-types");
10615
11140
  function PetBridge({ pet, state }) {
10616
11141
  const parentMessenger = useParentMessenger();
10617
11142
  const sendEvent = parentMessenger?.sendEvent;
10618
- const options = React36.useMemo(() => (0, import_chatkit_types7.normalizePetOptions)(pet), [pet]);
10619
- React36.useEffect(() => {
11143
+ const options = React37.useMemo(() => (0, import_chatkit_types7.normalizePetOptions)(pet), [pet]);
11144
+ React37.useEffect(() => {
10620
11145
  if (!sendEvent) {
10621
11146
  return;
10622
11147
  }
10623
11148
  sendEvent("pet_options_change", { pet: pet ?? null });
10624
11149
  }, [sendEvent, pet]);
10625
- React36.useEffect(() => {
11150
+ React37.useEffect(() => {
10626
11151
  if (!sendEvent || !options) {
10627
11152
  return;
10628
11153
  }
@@ -10632,15 +11157,15 @@ function PetBridge({ pet, state }) {
10632
11157
  }
10633
11158
 
10634
11159
  // src/components/settings/SettingsSheet.tsx
10635
- var React43 = __toESM(require("react"), 1);
10636
- var import_lucide_react23 = require("lucide-react");
11160
+ var React44 = __toESM(require("react"), 1);
11161
+ var import_lucide_react24 = require("lucide-react");
10637
11162
 
10638
11163
  // src/components/ui/input.tsx
10639
- var React37 = __toESM(require("react"), 1);
10640
- var import_jsx_runtime41 = require("react/jsx-runtime");
10641
- var Input = React37.forwardRef(
11164
+ var React38 = __toESM(require("react"), 1);
11165
+ var import_jsx_runtime43 = require("react/jsx-runtime");
11166
+ var Input = React38.forwardRef(
10642
11167
  ({ className, type, ...props }, ref) => {
10643
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
11168
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
10644
11169
  "input",
10645
11170
  {
10646
11171
  ref,
@@ -10657,20 +11182,20 @@ var Input = React37.forwardRef(
10657
11182
  Input.displayName = "Input";
10658
11183
 
10659
11184
  // src/components/ui/select.tsx
10660
- var React38 = require("react");
11185
+ var React39 = require("react");
10661
11186
  var import_radix_ui2 = require("radix-ui");
10662
- var import_lucide_react22 = require("lucide-react");
10663
- var import_jsx_runtime42 = require("react/jsx-runtime");
11187
+ var import_lucide_react23 = require("lucide-react");
11188
+ var import_jsx_runtime44 = require("react/jsx-runtime");
10664
11189
  function Select({
10665
11190
  ...props
10666
11191
  }) {
10667
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_radix_ui2.Select.Root, { "data-slot": "select", ...props });
11192
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_radix_ui2.Select.Root, { "data-slot": "select", ...props });
10668
11193
  }
10669
11194
  function SelectGroup({
10670
11195
  className,
10671
11196
  ...props
10672
11197
  }) {
10673
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
11198
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
10674
11199
  import_radix_ui2.Select.Group,
10675
11200
  {
10676
11201
  "data-slot": "select-group",
@@ -10682,7 +11207,7 @@ function SelectGroup({
10682
11207
  function SelectValue({
10683
11208
  ...props
10684
11209
  }) {
10685
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_radix_ui2.Select.Value, { "data-slot": "select-value", ...props });
11210
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_radix_ui2.Select.Value, { "data-slot": "select-value", ...props });
10686
11211
  }
10687
11212
  function SelectTrigger({
10688
11213
  className,
@@ -10690,7 +11215,7 @@ function SelectTrigger({
10690
11215
  children,
10691
11216
  ...props
10692
11217
  }) {
10693
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
11218
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
10694
11219
  import_radix_ui2.Select.Trigger,
10695
11220
  {
10696
11221
  "data-slot": "select-trigger",
@@ -10702,7 +11227,7 @@ function SelectTrigger({
10702
11227
  ...props,
10703
11228
  children: [
10704
11229
  children,
10705
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_radix_ui2.Select.Icon, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react22.ChevronDownIcon, { className: "pointer-events-none size-4 text-muted-foreground" }) })
11230
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_radix_ui2.Select.Icon, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react23.ChevronDownIcon, { className: "pointer-events-none size-4 text-muted-foreground" }) })
10706
11231
  ]
10707
11232
  }
10708
11233
  );
@@ -10714,7 +11239,7 @@ function SelectContent({
10714
11239
  align = "center",
10715
11240
  ...props
10716
11241
  }) {
10717
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_radix_ui2.Select.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
11242
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_radix_ui2.Select.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
10718
11243
  import_radix_ui2.Select.Content,
10719
11244
  {
10720
11245
  "data-slot": "select-content",
@@ -10724,8 +11249,8 @@ function SelectContent({
10724
11249
  align,
10725
11250
  ...props,
10726
11251
  children: [
10727
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(SelectScrollUpButton, {}),
10728
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
11252
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(SelectScrollUpButton, {}),
11253
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
10729
11254
  import_radix_ui2.Select.Viewport,
10730
11255
  {
10731
11256
  "data-position": position,
@@ -10736,7 +11261,7 @@ function SelectContent({
10736
11261
  children
10737
11262
  }
10738
11263
  ),
10739
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(SelectScrollDownButton, {})
11264
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(SelectScrollDownButton, {})
10740
11265
  ]
10741
11266
  }
10742
11267
  ) });
@@ -10746,7 +11271,7 @@ function SelectItem({
10746
11271
  children,
10747
11272
  ...props
10748
11273
  }) {
10749
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
11274
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
10750
11275
  import_radix_ui2.Select.Item,
10751
11276
  {
10752
11277
  "data-slot": "select-item",
@@ -10756,8 +11281,8 @@ function SelectItem({
10756
11281
  ),
10757
11282
  ...props,
10758
11283
  children: [
10759
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_radix_ui2.Select.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react22.CheckIcon, { className: "pointer-events-none" }) }) }),
10760
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_radix_ui2.Select.ItemText, { children })
11284
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_radix_ui2.Select.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react23.CheckIcon, { className: "pointer-events-none" }) }) }),
11285
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_radix_ui2.Select.ItemText, { children })
10761
11286
  ]
10762
11287
  }
10763
11288
  );
@@ -10766,7 +11291,7 @@ function SelectScrollUpButton({
10766
11291
  className,
10767
11292
  ...props
10768
11293
  }) {
10769
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
11294
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
10770
11295
  import_radix_ui2.Select.ScrollUpButton,
10771
11296
  {
10772
11297
  "data-slot": "select-scroll-up-button",
@@ -10775,8 +11300,8 @@ function SelectScrollUpButton({
10775
11300
  className
10776
11301
  ),
10777
11302
  ...props,
10778
- children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
10779
- import_lucide_react22.ChevronUpIcon,
11303
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
11304
+ import_lucide_react23.ChevronUpIcon,
10780
11305
  {}
10781
11306
  )
10782
11307
  }
@@ -10786,7 +11311,7 @@ function SelectScrollDownButton({
10786
11311
  className,
10787
11312
  ...props
10788
11313
  }) {
10789
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
11314
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
10790
11315
  import_radix_ui2.Select.ScrollDownButton,
10791
11316
  {
10792
11317
  "data-slot": "select-scroll-down-button",
@@ -10795,8 +11320,8 @@ function SelectScrollDownButton({
10795
11320
  className
10796
11321
  ),
10797
11322
  ...props,
10798
- children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
10799
- import_lucide_react22.ChevronDownIcon,
11323
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
11324
+ import_lucide_react23.ChevronDownIcon,
10800
11325
  {}
10801
11326
  )
10802
11327
  }
@@ -10804,9 +11329,9 @@ function SelectScrollDownButton({
10804
11329
  }
10805
11330
 
10806
11331
  // src/components/ui/slider.tsx
10807
- var React39 = __toESM(require("react"), 1);
11332
+ var React40 = __toESM(require("react"), 1);
10808
11333
  var import_radix_ui3 = require("radix-ui");
10809
- var import_jsx_runtime43 = require("react/jsx-runtime");
11334
+ var import_jsx_runtime45 = require("react/jsx-runtime");
10810
11335
  function Slider({
10811
11336
  className,
10812
11337
  defaultValue,
@@ -10815,11 +11340,11 @@ function Slider({
10815
11340
  max = 100,
10816
11341
  ...props
10817
11342
  }) {
10818
- const _values = React39.useMemo(
11343
+ const _values = React40.useMemo(
10819
11344
  () => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
10820
11345
  [value, defaultValue, min, max]
10821
11346
  );
10822
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
11347
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
10823
11348
  import_radix_ui3.Slider.Root,
10824
11349
  {
10825
11350
  "data-slot": "slider",
@@ -10833,12 +11358,12 @@ function Slider({
10833
11358
  ),
10834
11359
  ...props,
10835
11360
  children: [
10836
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
11361
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
10837
11362
  import_radix_ui3.Slider.Track,
10838
11363
  {
10839
11364
  "data-slot": "slider-track",
10840
11365
  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",
10841
- children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
11366
+ children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
10842
11367
  import_radix_ui3.Slider.Range,
10843
11368
  {
10844
11369
  "data-slot": "slider-range",
@@ -10847,7 +11372,7 @@ function Slider({
10847
11372
  )
10848
11373
  }
10849
11374
  ),
10850
- Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
11375
+ Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
10851
11376
  import_radix_ui3.Slider.Thumb,
10852
11377
  {
10853
11378
  "data-slot": "slider-thumb",
@@ -10861,15 +11386,15 @@ function Slider({
10861
11386
  }
10862
11387
 
10863
11388
  // src/components/ui/toggle-group.tsx
10864
- var React41 = __toESM(require("react"), 1);
11389
+ var React42 = __toESM(require("react"), 1);
10865
11390
  var import_class_variance_authority3 = require("class-variance-authority");
10866
11391
  var import_radix_ui5 = require("radix-ui");
10867
11392
 
10868
11393
  // src/components/ui/toggle.tsx
10869
- var React40 = require("react");
11394
+ var React41 = require("react");
10870
11395
  var import_class_variance_authority2 = require("class-variance-authority");
10871
11396
  var import_radix_ui4 = require("radix-ui");
10872
- var import_jsx_runtime44 = require("react/jsx-runtime");
11397
+ var import_jsx_runtime46 = require("react/jsx-runtime");
10873
11398
  var toggleVariants = (0, import_class_variance_authority2.cva)(
10874
11399
  "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",
10875
11400
  {
@@ -10892,8 +11417,8 @@ var toggleVariants = (0, import_class_variance_authority2.cva)(
10892
11417
  );
10893
11418
 
10894
11419
  // src/components/ui/toggle-group.tsx
10895
- var import_jsx_runtime45 = require("react/jsx-runtime");
10896
- var ToggleGroupContext = React41.createContext({
11420
+ var import_jsx_runtime47 = require("react/jsx-runtime");
11421
+ var ToggleGroupContext = React42.createContext({
10897
11422
  size: "default",
10898
11423
  variant: "default",
10899
11424
  spacing: 0,
@@ -10908,7 +11433,7 @@ function ToggleGroup({
10908
11433
  children,
10909
11434
  ...props
10910
11435
  }) {
10911
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
11436
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
10912
11437
  import_radix_ui5.ToggleGroup.Root,
10913
11438
  {
10914
11439
  "data-slot": "toggle-group",
@@ -10922,7 +11447,7 @@ function ToggleGroup({
10922
11447
  className
10923
11448
  ),
10924
11449
  ...props,
10925
- children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
11450
+ children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
10926
11451
  ToggleGroupContext.Provider,
10927
11452
  {
10928
11453
  value: { variant, size: size2, spacing, orientation },
@@ -10939,8 +11464,8 @@ function ToggleGroupItem({
10939
11464
  size: size2 = "default",
10940
11465
  ...props
10941
11466
  }) {
10942
- const context = React41.useContext(ToggleGroupContext);
10943
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
11467
+ const context = React42.useContext(ToggleGroupContext);
11468
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
10944
11469
  import_radix_ui5.ToggleGroup.Item,
10945
11470
  {
10946
11471
  "data-slot": "toggle-group-item",
@@ -11170,13 +11695,13 @@ function isPetEnabled(pet) {
11170
11695
  }
11171
11696
 
11172
11697
  // src/components/pet/PetPreview.tsx
11173
- var React42 = require("react");
11698
+ var React43 = require("react");
11174
11699
 
11175
11700
  // src/components/pet/petSpriteAtlas.ts
11176
11701
  var import_chatkit_types9 = require("@xpert-ai/chatkit-types");
11177
11702
 
11178
11703
  // src/components/pet/PetPreview.tsx
11179
- var import_jsx_runtime46 = require("react/jsx-runtime");
11704
+ var import_jsx_runtime48 = require("react/jsx-runtime");
11180
11705
  function escapeCssUrl(value) {
11181
11706
  return value.replace(/["\\]/g, "\\$&");
11182
11707
  }
@@ -11184,7 +11709,7 @@ function PetPreview({ src, label, className }) {
11184
11709
  const scale = 0.13;
11185
11710
  const width = import_chatkit_types9.petSpriteAtlas.cellWidth;
11186
11711
  const height = import_chatkit_types9.petSpriteAtlas.cellHeight;
11187
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
11712
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
11188
11713
  "span",
11189
11714
  {
11190
11715
  className: cn(
@@ -11193,7 +11718,7 @@ function PetPreview({ src, label, className }) {
11193
11718
  ),
11194
11719
  "aria-hidden": "true",
11195
11720
  title: label,
11196
- children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
11721
+ children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
11197
11722
  "span",
11198
11723
  {
11199
11724
  className: "absolute left-1/2 top-1/2 block",
@@ -11215,7 +11740,7 @@ function PetPreview({ src, label, className }) {
11215
11740
  }
11216
11741
 
11217
11742
  // src/components/settings/SettingsSheet.tsx
11218
- var import_jsx_runtime47 = require("react/jsx-runtime");
11743
+ var import_jsx_runtime49 = require("react/jsx-runtime");
11219
11744
  var CHARACTER_TYPES2 = [
11220
11745
  "builtin",
11221
11746
  "atlas"
@@ -11231,13 +11756,13 @@ function SettingsSheet({
11231
11756
  onSave
11232
11757
  }) {
11233
11758
  const { t } = useChatkitTranslation();
11234
- const [draft, setDraft] = React43.useState(settings);
11235
- React43.useEffect(() => {
11759
+ const [draft, setDraft] = React44.useState(settings);
11760
+ React44.useEffect(() => {
11236
11761
  if (open) {
11237
11762
  setDraft(petRequired ? { ...settings, enabled: true } : settings);
11238
11763
  }
11239
11764
  }, [open, petRequired, settings]);
11240
- const updateDraft = React43.useCallback(
11765
+ const updateDraft = React44.useCallback(
11241
11766
  (patch) => {
11242
11767
  setDraft((previous) => ({ ...previous, ...patch }));
11243
11768
  },
@@ -11255,23 +11780,23 @@ function SettingsSheet({
11255
11780
  defaultValue: selectedBuiltinPet.label
11256
11781
  }
11257
11782
  );
11258
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Sheet, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(SheetContent, { side: "right", className: "w-[min(92vw,26rem)] overflow-y-auto", children: [
11259
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SheetHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex items-center gap-2", children: [
11260
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "flex h-8 w-8 items-center justify-center rounded-md bg-primary/10 text-primary", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react23.Settings, { size: 16 }) }),
11261
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SheetTitle, { children: t("settings.title") })
11783
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Sheet, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(SheetContent, { side: "right", className: "w-[min(92vw,26rem)] overflow-y-auto", children: [
11784
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SheetHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex items-center gap-2", children: [
11785
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "flex h-8 w-8 items-center justify-center rounded-md bg-primary/10 text-primary", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react24.Settings, { size: 16 }) }),
11786
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SheetTitle, { children: t("settings.title") })
11262
11787
  ] }) }),
11263
- /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("form", { className: "mt-6 space-y-5", onSubmit: handleSubmit, children: [
11264
- /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("section", { className: "space-y-5", children: [
11265
- /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex items-center gap-2", children: [
11266
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "flex h-7 w-7 items-center justify-center rounded-md bg-muted text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react23.PawPrint, { size: 15 }) }),
11267
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("h3", { className: "text-sm font-semibold", children: t("pet.settings.title") })
11788
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("form", { className: "mt-6 space-y-5", onSubmit: handleSubmit, children: [
11789
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("section", { className: "space-y-5", children: [
11790
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex items-center gap-2", children: [
11791
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "flex h-7 w-7 items-center justify-center rounded-md bg-muted text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react24.PawPrint, { size: 15 }) }),
11792
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("h3", { className: "text-sm font-semibold", children: t("pet.settings.title") })
11268
11793
  ] }),
11269
- /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("label", { className: "flex items-center justify-between gap-4 rounded-md border border-border px-3 py-2", children: [
11270
- /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { className: "min-w-0", children: [
11271
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "block text-sm font-medium", children: t("pet.settings.enabled") }),
11272
- petRequired && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "mt-0.5 block text-xs text-muted-foreground", children: t("pet.settings.requiredHint") })
11794
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("label", { className: "flex items-center justify-between gap-4 rounded-md border border-border px-3 py-2", children: [
11795
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("span", { className: "min-w-0", children: [
11796
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "block text-sm font-medium", children: t("pet.settings.enabled") }),
11797
+ petRequired && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "mt-0.5 block text-xs text-muted-foreground", children: t("pet.settings.requiredHint") })
11273
11798
  ] }),
11274
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
11799
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
11275
11800
  "button",
11276
11801
  {
11277
11802
  type: "button",
@@ -11284,7 +11809,7 @@ function SettingsSheet({
11284
11809
  draft.enabled ? "bg-primary" : "bg-muted-foreground/20",
11285
11810
  petRequired ? "cursor-not-allowed opacity-70" : ""
11286
11811
  ].join(" "),
11287
- children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
11812
+ children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
11288
11813
  "span",
11289
11814
  {
11290
11815
  className: [
@@ -11297,9 +11822,9 @@ function SettingsSheet({
11297
11822
  )
11298
11823
  ] })
11299
11824
  ] }),
11300
- /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "space-y-2", children: [
11301
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { id: "chatkit-pet-type-label", className: "text-sm font-medium", children: t("pet.settings.characterType") }),
11302
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
11825
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "space-y-2", children: [
11826
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { id: "chatkit-pet-type-label", className: "text-sm font-medium", children: t("pet.settings.characterType") }),
11827
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
11303
11828
  ToggleGroup,
11304
11829
  {
11305
11830
  id: "chatkit-pet-type",
@@ -11314,7 +11839,7 @@ function SettingsSheet({
11314
11839
  variant: "outline",
11315
11840
  spacing: 2,
11316
11841
  className: "!w-full",
11317
- children: CHARACTER_TYPES2.map((type) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
11842
+ children: CHARACTER_TYPES2.map((type) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
11318
11843
  ToggleGroupItem,
11319
11844
  {
11320
11845
  value: type,
@@ -11326,8 +11851,8 @@ function SettingsSheet({
11326
11851
  }
11327
11852
  )
11328
11853
  ] }),
11329
- draft.characterType === "builtin" && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "space-y-2", children: [
11330
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
11854
+ draft.characterType === "builtin" && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "space-y-2", children: [
11855
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
11331
11856
  "label",
11332
11857
  {
11333
11858
  htmlFor: "chatkit-pet-builtin",
@@ -11335,7 +11860,7 @@ function SettingsSheet({
11335
11860
  children: t("pet.settings.builtin")
11336
11861
  }
11337
11862
  ),
11338
- /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
11863
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
11339
11864
  Select,
11340
11865
  {
11341
11866
  value: selectedBuiltinPet.id,
@@ -11346,26 +11871,26 @@ function SettingsSheet({
11346
11871
  }
11347
11872
  },
11348
11873
  children: [
11349
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
11874
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
11350
11875
  SelectTrigger,
11351
11876
  {
11352
11877
  id: "chatkit-pet-builtin",
11353
11878
  className: "min-h-12 w-full px-3 py-2",
11354
- children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SelectValue, { placeholder: selectedBuiltinPetLabel })
11879
+ children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SelectValue, { placeholder: selectedBuiltinPetLabel })
11355
11880
  }
11356
11881
  ),
11357
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SelectContent, { className: "w-[var(--radix-select-trigger-width)]", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SelectGroup, { children: INCLUDED_PET_OPTIONS.map((pet) => {
11882
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SelectContent, { className: "w-[var(--radix-select-trigger-width)]", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SelectGroup, { children: INCLUDED_PET_OPTIONS.map((pet) => {
11358
11883
  const label = t(`pet.settings.builtins.${pet.id}`, {
11359
11884
  defaultValue: pet.label
11360
11885
  });
11361
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
11886
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
11362
11887
  SelectItem,
11363
11888
  {
11364
11889
  value: pet.id,
11365
11890
  className: "min-h-10 py-1.5 pl-2 pr-8",
11366
- children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { className: "flex min-w-0 items-center gap-2", children: [
11367
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(PetPreview, { src: pet.previewSrc, label }),
11368
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "min-w-0 truncate", children: label })
11891
+ children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("span", { className: "flex min-w-0 items-center gap-2", children: [
11892
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(PetPreview, { src: pet.previewSrc, label }),
11893
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "min-w-0 truncate", children: label })
11369
11894
  ] })
11370
11895
  },
11371
11896
  pet.id
@@ -11375,8 +11900,8 @@ function SettingsSheet({
11375
11900
  }
11376
11901
  )
11377
11902
  ] }),
11378
- draft.characterType === "atlas" && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "space-y-2", children: [
11379
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
11903
+ draft.characterType === "atlas" && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "space-y-2", children: [
11904
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
11380
11905
  "label",
11381
11906
  {
11382
11907
  className: "text-sm font-medium",
@@ -11384,7 +11909,7 @@ function SettingsSheet({
11384
11909
  children: t("pet.settings.atlasUrl")
11385
11910
  }
11386
11911
  ),
11387
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
11912
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
11388
11913
  Input,
11389
11914
  {
11390
11915
  id: "chatkit-pet-atlas",
@@ -11394,15 +11919,15 @@ function SettingsSheet({
11394
11919
  }
11395
11920
  )
11396
11921
  ] }),
11397
- /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "space-y-2", children: [
11398
- /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
11399
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("label", { className: "text-sm font-medium", htmlFor: "chatkit-pet-scale", children: t("pet.settings.scale") }),
11400
- /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { className: "text-xs tabular-nums text-muted-foreground", children: [
11922
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "space-y-2", children: [
11923
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
11924
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("label", { className: "text-sm font-medium", htmlFor: "chatkit-pet-scale", children: t("pet.settings.scale") }),
11925
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("span", { className: "text-xs tabular-nums text-muted-foreground", children: [
11401
11926
  draft.scale.toFixed(2),
11402
11927
  "x"
11403
11928
  ] })
11404
11929
  ] }),
11405
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
11930
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
11406
11931
  Slider,
11407
11932
  {
11408
11933
  id: "chatkit-pet-scale",
@@ -11416,8 +11941,8 @@ function SettingsSheet({
11416
11941
  }
11417
11942
  )
11418
11943
  ] }),
11419
- /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("label", { className: "flex items-center gap-2 text-sm", children: [
11420
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
11944
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("label", { className: "flex items-center gap-2 text-sm", children: [
11945
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
11421
11946
  "input",
11422
11947
  {
11423
11948
  type: "checkbox",
@@ -11428,8 +11953,8 @@ function SettingsSheet({
11428
11953
  ),
11429
11954
  t("pet.settings.draggable")
11430
11955
  ] }),
11431
- /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("label", { className: "flex items-center gap-2 text-sm", children: [
11432
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
11956
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("label", { className: "flex items-center gap-2 text-sm", children: [
11957
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
11433
11958
  "input",
11434
11959
  {
11435
11960
  type: "checkbox",
@@ -11440,8 +11965,8 @@ function SettingsSheet({
11440
11965
  ),
11441
11966
  t("pet.settings.persistPosition")
11442
11967
  ] }),
11443
- /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex justify-end gap-2 pt-2", children: [
11444
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
11968
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex justify-end gap-2 pt-2", children: [
11969
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
11445
11970
  Button,
11446
11971
  {
11447
11972
  type: "button",
@@ -11450,7 +11975,7 @@ function SettingsSheet({
11450
11975
  children: t("pet.settings.cancel")
11451
11976
  }
11452
11977
  ),
11453
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Button, { type: "submit", children: t("pet.settings.save") })
11978
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Button, { type: "submit", children: t("pet.settings.save") })
11454
11979
  ] })
11455
11980
  ] })
11456
11981
  ] }) });
@@ -11956,7 +12481,7 @@ function findDomPointForComposerOffset(root, offset) {
11956
12481
  }
11957
12482
 
11958
12483
  // src/components/chat.tsx
11959
- var import_jsx_runtime48 = require("react/jsx-runtime");
12484
+ var import_jsx_runtime50 = require("react/jsx-runtime");
11960
12485
  var import_meta2 = {};
11961
12486
  var defaultApiUrl2 = import_meta2.env.VITE_XPERTAI_API_URL;
11962
12487
  var COMPOSER_INPUT_MAX_HEIGHT = 128;
@@ -12089,8 +12614,8 @@ function ReferenceChip({
12089
12614
  }) {
12090
12615
  const metaLine = getReferenceMetaLine(reference);
12091
12616
  const isComposer = variant === "composer";
12092
- const Icon = reference.type === "quote" ? import_lucide_react24.Quote : reference.type === "image" ? import_lucide_react24.ImageIcon : import_lucide_react24.FileText;
12093
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
12617
+ const Icon = reference.type === "quote" ? import_lucide_react25.Quote : reference.type === "image" ? import_lucide_react25.ImageIcon : import_lucide_react25.FileText;
12618
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
12094
12619
  "div",
12095
12620
  {
12096
12621
  className: cn(
@@ -12099,7 +12624,7 @@ function ReferenceChip({
12099
12624
  ),
12100
12625
  title: getReferenceTitle(reference),
12101
12626
  children: [
12102
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
12627
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
12103
12628
  Icon,
12104
12629
  {
12105
12630
  size: isComposer ? 14 : 12,
@@ -12109,8 +12634,8 @@ function ReferenceChip({
12109
12634
  )
12110
12635
  }
12111
12636
  ),
12112
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "min-w-0 flex-1", children: [
12113
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
12637
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "min-w-0 flex-1", children: [
12638
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
12114
12639
  "div",
12115
12640
  {
12116
12641
  className: cn(
@@ -12120,7 +12645,7 @@ function ReferenceChip({
12120
12645
  children: getReferenceLabel(reference)
12121
12646
  }
12122
12647
  ),
12123
- metaLine && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
12648
+ metaLine && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
12124
12649
  "div",
12125
12650
  {
12126
12651
  className: cn(
@@ -12131,7 +12656,7 @@ function ReferenceChip({
12131
12656
  }
12132
12657
  )
12133
12658
  ] }),
12134
- onRemove && removeLabel && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
12659
+ onRemove && removeLabel && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
12135
12660
  "button",
12136
12661
  {
12137
12662
  type: "button",
@@ -12142,7 +12667,7 @@ function ReferenceChip({
12142
12667
  ),
12143
12668
  title: removeLabel,
12144
12669
  "aria-label": removeLabel,
12145
- children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react24.X, { size: 12 })
12670
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react25.X, { size: 12 })
12146
12671
  }
12147
12672
  )
12148
12673
  ]
@@ -12166,20 +12691,20 @@ function Chat({
12166
12691
  const { setStream } = useStreamManager();
12167
12692
  const stream = useStreamContext();
12168
12693
  const { theme } = useTheme();
12169
- const [isHistoryLoading, setIsHistoryLoading] = React44.useState(false);
12170
- const [historyError, setHistoryError] = React44.useState(null);
12171
- const [assistantName, setAssistantName] = React44.useState(null);
12172
- const [assistantAvatar, setAssistantAvatar] = React44.useState(null);
12694
+ const [isHistoryLoading, setIsHistoryLoading] = React45.useState(false);
12695
+ const [historyError, setHistoryError] = React45.useState(null);
12696
+ const [assistantName, setAssistantName] = React45.useState(null);
12697
+ const [assistantAvatar, setAssistantAvatar] = React45.useState(null);
12173
12698
  const LOADING_DOTS_MIN_DURATION = 800;
12174
12699
  const STREAMING_STATUS_REFRESH_MS = 250;
12175
- const [showLoadingDots, setShowLoadingDots] = React44.useState(false);
12176
- const [streamingNow, setStreamingNow] = React44.useState(() => Date.now());
12177
- const loadingStartTimeRef = React44.useRef(null);
12178
- const lastStreamOutputAtRef = React44.useRef(null);
12179
- React44.useEffect(() => {
12700
+ const [showLoadingDots, setShowLoadingDots] = React45.useState(false);
12701
+ const [streamingNow, setStreamingNow] = React45.useState(() => Date.now());
12702
+ const loadingStartTimeRef = React45.useRef(null);
12703
+ const lastStreamOutputAtRef = React45.useRef(null);
12704
+ React45.useEffect(() => {
12180
12705
  setStream(stream);
12181
12706
  }, [setStream, stream]);
12182
- React44.useEffect(() => {
12707
+ React45.useEffect(() => {
12183
12708
  if (stream.isLoading) {
12184
12709
  if (!loadingStartTimeRef.current) {
12185
12710
  loadingStartTimeRef.current = Date.now();
@@ -12202,7 +12727,7 @@ function Chat({
12202
12727
  }
12203
12728
  }
12204
12729
  }, [stream.isLoading]);
12205
- React44.useEffect(() => {
12730
+ React45.useEffect(() => {
12206
12731
  if (!stream.isLoading) {
12207
12732
  lastStreamOutputAtRef.current = null;
12208
12733
  setStreamingNow(Date.now());
@@ -12212,7 +12737,7 @@ function Chat({
12212
12737
  lastStreamOutputAtRef.current = now;
12213
12738
  setStreamingNow(now);
12214
12739
  }, [stream.messages, stream.isLoading]);
12215
- React44.useEffect(() => {
12740
+ React45.useEffect(() => {
12216
12741
  if (!stream.isLoading) {
12217
12742
  return;
12218
12743
  }
@@ -12221,74 +12746,74 @@ function Chat({
12221
12746
  }, STREAMING_STATUS_REFRESH_MS);
12222
12747
  return () => window.clearInterval(timer);
12223
12748
  }, [stream.isLoading]);
12224
- const [composerParts, setComposerParts] = React44.useState([]);
12225
- const [renderedComposerParts, setRenderedComposerParts] = React44.useState([]);
12226
- const [composerDomVersion, setComposerDomVersion] = React44.useState(0);
12227
- const [selectedTool, setSelectedTool] = React44.useState(
12749
+ const [composerParts, setComposerParts] = React45.useState([]);
12750
+ const [renderedComposerParts, setRenderedComposerParts] = React45.useState([]);
12751
+ const [composerDomVersion, setComposerDomVersion] = React45.useState(0);
12752
+ const [selectedTool, setSelectedTool] = React45.useState(
12228
12753
  null
12229
12754
  );
12230
- const [planModeEnabled, setPlanModeEnabled] = React44.useState(false);
12231
- const [petSettingsOpen, setPetSettingsOpen] = React44.useState(false);
12232
- const [petLocalSettings, setPetLocalSettings] = React44.useState(() => readPetLocalSettings());
12233
- const [runtimeCapabilities, setRuntimeCapabilities] = React44.useState(null);
12234
- const [runtimeCapabilitiesReady, setRuntimeCapabilitiesReady] = React44.useState(false);
12235
- const [sessionRuntimeCapabilities, setSessionRuntimeCapabilities] = React44.useState(
12755
+ const [planModeEnabled, setPlanModeEnabled] = React45.useState(false);
12756
+ const [petSettingsOpen, setPetSettingsOpen] = React45.useState(false);
12757
+ const [petLocalSettings, setPetLocalSettings] = React45.useState(() => readPetLocalSettings());
12758
+ const [runtimeCapabilities, setRuntimeCapabilities] = React45.useState(null);
12759
+ const [runtimeCapabilitiesReady, setRuntimeCapabilitiesReady] = React45.useState(false);
12760
+ const [sessionRuntimeCapabilities, setSessionRuntimeCapabilities] = React45.useState(
12236
12761
  () => createEmptyRuntimeCapabilitiesSelection()
12237
12762
  );
12238
- const [runRuntimeCapabilities, setRunRuntimeCapabilities] = React44.useState(
12763
+ const [runRuntimeCapabilities, setRunRuntimeCapabilities] = React45.useState(
12239
12764
  () => createEmptyRuntimeCapabilitiesSelection()
12240
12765
  );
12241
- const [runtimeCapabilityPalette, setRuntimeCapabilityPalette] = React44.useState(null);
12242
- const [attachments, setAttachments] = React44.useState([]);
12243
- const [references, setReferences] = React44.useState([]);
12244
- const [isUploadingReferenceImages, setIsUploadingReferenceImages] = React44.useState(false);
12245
- const [quoteSelection, setQuoteSelection] = React44.useState(null);
12246
- const [isAtBottom, setIsAtBottom] = React44.useState(true);
12247
- const [hasUpdatesBelow, setHasUpdatesBelow] = React44.useState(false);
12766
+ const [runtimeCapabilityPalette, setRuntimeCapabilityPalette] = React45.useState(null);
12767
+ const [attachments, setAttachments] = React45.useState([]);
12768
+ const [references, setReferences] = React45.useState([]);
12769
+ const [isUploadingReferenceImages, setIsUploadingReferenceImages] = React45.useState(false);
12770
+ const [quoteSelection, setQuoteSelection] = React45.useState(null);
12771
+ const [isAtBottom, setIsAtBottom] = React45.useState(true);
12772
+ const [hasUpdatesBelow, setHasUpdatesBelow] = React45.useState(false);
12248
12773
  const {
12249
12774
  threads,
12250
12775
  deleteThread,
12251
12776
  refreshThreads,
12252
12777
  isLoading: isThreadsLoading
12253
12778
  } = useThreads();
12254
- const viewportRef = React44.useRef(null);
12255
- const fileInputRef = React44.useRef(null);
12256
- const composerInputRef = React44.useRef(null);
12257
- const slashPaletteRef = React44.useRef(null);
12258
- const slashPaletteOptionRefs = React44.useRef(
12779
+ const viewportRef = React45.useRef(null);
12780
+ const fileInputRef = React45.useRef(null);
12781
+ const composerInputRef = React45.useRef(null);
12782
+ const slashPaletteRef = React45.useRef(null);
12783
+ const slashPaletteOptionRefs = React45.useRef(
12259
12784
  []
12260
12785
  );
12261
- const composerPartsRef = React44.useRef([]);
12262
- const pendingComposerCaretOffsetRef = React44.useRef(null);
12263
- const shouldAutoScrollRef = React44.useRef(true);
12264
- const forceFollowRef = React44.useRef(false);
12265
- const previousMessageCountRef = React44.useRef(0);
12266
- const previousScrollTopRef = React44.useRef(0);
12267
- const autoScrollFrameRef = React44.useRef(null);
12268
- const isPointerDownRef = React44.useRef(false);
12269
- const lastTouchYRef = React44.useRef(null);
12270
- const runtimeCapabilityPreferenceLoadRef = React44.useRef(0);
12786
+ const composerPartsRef = React45.useRef([]);
12787
+ const pendingComposerCaretOffsetRef = React45.useRef(null);
12788
+ const shouldAutoScrollRef = React45.useRef(true);
12789
+ const forceFollowRef = React45.useRef(false);
12790
+ const previousMessageCountRef = React45.useRef(0);
12791
+ const previousScrollTopRef = React45.useRef(0);
12792
+ const autoScrollFrameRef = React45.useRef(null);
12793
+ const isPointerDownRef = React45.useRef(false);
12794
+ const lastTouchYRef = React45.useRef(null);
12795
+ const runtimeCapabilityPreferenceLoadRef = React45.useRef(0);
12271
12796
  const resolvedTitle = title ?? t("chat.title");
12272
12797
  const resolvedPlaceholder = placeholder ?? t("chat.placeholder");
12273
12798
  const petRequired = options?.displayMode === "pet";
12274
- const basePetSettings = React44.useMemo(
12799
+ const basePetSettings = React45.useMemo(
12275
12800
  () => derivePetLocalSettings(options?.pet),
12276
12801
  [options?.pet]
12277
12802
  );
12278
- const displayedPetSettings = React44.useMemo(
12803
+ const displayedPetSettings = React45.useMemo(
12279
12804
  () => ({
12280
12805
  ...petLocalSettings ?? basePetSettings,
12281
12806
  ...petRequired ? { enabled: true } : {}
12282
12807
  }),
12283
12808
  [basePetSettings, petLocalSettings, petRequired]
12284
12809
  );
12285
- const effectivePet = React44.useMemo(() => {
12810
+ const effectivePet = React45.useMemo(() => {
12286
12811
  if (petRequired || petLocalSettings) {
12287
12812
  return buildPetOptionsFromLocalSettings(displayedPetSettings);
12288
12813
  }
12289
12814
  return options?.pet ?? null;
12290
12815
  }, [displayedPetSettings, options?.pet, petLocalSettings, petRequired]);
12291
- const savePetLocalSettings = React44.useCallback(
12816
+ const savePetLocalSettings = React45.useCallback(
12292
12817
  (settings) => {
12293
12818
  const nextSettings = petRequired ? { ...settings, enabled: true } : settings;
12294
12819
  setPetLocalSettings(nextSettings);
@@ -12296,7 +12821,7 @@ function Chat({
12296
12821
  },
12297
12822
  [petRequired]
12298
12823
  );
12299
- const handlePetCommand = React44.useCallback(
12824
+ const handlePetCommand = React45.useCallback(
12300
12825
  (mode) => {
12301
12826
  if (mode === "settings") {
12302
12827
  setPetSettingsOpen(true);
@@ -12318,11 +12843,11 @@ function Chat({
12318
12843
  [displayedPetSettings, effectivePet, petRequired, savePetLocalSettings]
12319
12844
  );
12320
12845
  const inputPlaceholder = selectedTool?.placeholderOverride ?? composer?.placeholder ?? resolvedPlaceholder;
12321
- const messages = React44.useMemo(
12846
+ const messages = React45.useMemo(
12322
12847
  () => stream.messages ?? [],
12323
12848
  [stream.messages]
12324
12849
  );
12325
- const draft = React44.useMemo(
12850
+ const draft = React45.useMemo(
12326
12851
  () => getComposerPlainText(composerParts),
12327
12852
  [composerParts]
12328
12853
  );
@@ -12334,7 +12859,7 @@ function Chat({
12334
12859
  isEmpty: isComposerInputEmpty,
12335
12860
  isStacked: isComposerStacked
12336
12861
  });
12337
- const pendingFollowUps = React44.useMemo(
12862
+ const pendingFollowUps = React45.useMemo(
12338
12863
  () => [...stream.pendingFollowUps ?? []].sort(
12339
12864
  (a, b) => a.createdAt - b.createdAt
12340
12865
  ),
@@ -12345,18 +12870,18 @@ function Chat({
12345
12870
  const hasPendingHITLRequest = Boolean(stream.pendingHITLRequest);
12346
12871
  const hasPendingInteractiveRequest = hasPendingRequestUserInput || hasPendingHITLRequest;
12347
12872
  const hasPendingTodos = Boolean(stream.todos?.items.length);
12348
- const runtimeCapabilityOptions = React44.useMemo(
12873
+ const runtimeCapabilityOptions = React45.useMemo(
12349
12874
  () => getRuntimeCapabilityOptions(runtimeCapabilities),
12350
12875
  [runtimeCapabilities]
12351
12876
  );
12352
- const effectiveSessionRuntimeCapabilities = React44.useMemo(
12877
+ const effectiveSessionRuntimeCapabilities = React45.useMemo(
12353
12878
  () => runtimeCapabilitiesReady && runtimeCapabilities ? mergeRuntimeCapabilitiesSelections(
12354
12879
  runtimeCapabilities,
12355
12880
  sessionRuntimeCapabilities
12356
12881
  ) : null,
12357
12882
  [runtimeCapabilities, runtimeCapabilitiesReady, sessionRuntimeCapabilities]
12358
12883
  );
12359
- const runRuntimeCapabilityOptions = React44.useMemo(
12884
+ const runRuntimeCapabilityOptions = React45.useMemo(
12360
12885
  () => runtimeCapabilityOptions.filter(
12361
12886
  (option) => isRuntimeCapabilitySelected(
12362
12887
  runRuntimeCapabilities,
@@ -12366,11 +12891,11 @@ function Chat({
12366
12891
  ),
12367
12892
  [runRuntimeCapabilities, runtimeCapabilityOptions]
12368
12893
  );
12369
- const composerRuntimeCapabilitySelectionKeys = React44.useMemo(
12894
+ const composerRuntimeCapabilitySelectionKeys = React45.useMemo(
12370
12895
  () => getComposerCapabilitySelectionKeys(composerParts),
12371
12896
  [composerParts]
12372
12897
  );
12373
- const detachedRunRuntimeCapabilityOptions = React44.useMemo(
12898
+ const detachedRunRuntimeCapabilityOptions = React45.useMemo(
12374
12899
  () => runRuntimeCapabilityOptions.filter(
12375
12900
  (option) => !composerRuntimeCapabilitySelectionKeys.has(
12376
12901
  getRuntimeCapabilityOptionKey(option)
@@ -12378,7 +12903,7 @@ function Chat({
12378
12903
  ),
12379
12904
  [composerRuntimeCapabilitySelectionKeys, runRuntimeCapabilityOptions]
12380
12905
  );
12381
- const persistSessionRuntimeCapabilities = React44.useCallback(
12906
+ const persistSessionRuntimeCapabilities = React45.useCallback(
12382
12907
  async (threadId, selection) => {
12383
12908
  if (!runtimeCapabilities || !selection) {
12384
12909
  return;
@@ -12403,10 +12928,10 @@ function Chat({
12403
12928
  },
12404
12929
  [runtimeCapabilities, stream.client]
12405
12930
  );
12406
- const clearQuoteSelection = React44.useCallback(() => {
12931
+ const clearQuoteSelection = React45.useCallback(() => {
12407
12932
  setQuoteSelection(null);
12408
12933
  }, []);
12409
- const commitComposerParts = React44.useCallback(
12934
+ const commitComposerParts = React45.useCallback(
12410
12935
  (nextParts, options2) => {
12411
12936
  const normalized = normalizeComposerParts(nextParts);
12412
12937
  const previous = composerPartsRef.current;
@@ -12442,7 +12967,7 @@ function Chat({
12442
12967
  },
12443
12968
  []
12444
12969
  );
12445
- const setComposerText = React44.useCallback(
12970
+ const setComposerText = React45.useCallback(
12446
12971
  (text, caretOffset = text.length) => {
12447
12972
  commitComposerParts(createComposerTextParts(text), {
12448
12973
  caretOffset,
@@ -12452,7 +12977,7 @@ function Chat({
12452
12977
  },
12453
12978
  [commitComposerParts]
12454
12979
  );
12455
- const focusComposerAt = React44.useCallback((position) => {
12980
+ const focusComposerAt = React45.useCallback((position) => {
12456
12981
  const nextPosition = position ?? getComposerEditingLength(composerPartsRef.current);
12457
12982
  pendingComposerCaretOffsetRef.current = nextPosition;
12458
12983
  requestAnimationFrame(() => {
@@ -12464,7 +12989,7 @@ function Chat({
12464
12989
  });
12465
12990
  }, []);
12466
12991
  const parentMessenger = useParentMessenger({
12467
- onSetComposerValue: React44.useCallback(
12992
+ onSetComposerValue: React45.useCallback(
12468
12993
  (payload) => {
12469
12994
  if (!payload) {
12470
12995
  return;
@@ -12487,10 +13012,10 @@ function Chat({
12487
13012
  },
12488
13013
  [composer?.tools, setComposerText]
12489
13014
  ),
12490
- onFocusComposer: React44.useCallback(() => {
13015
+ onFocusComposer: React45.useCallback(() => {
12491
13016
  composerInputRef.current?.focus();
12492
13017
  }, []),
12493
- onSetPetEnabled: React44.useCallback(
13018
+ onSetPetEnabled: React45.useCallback(
12494
13019
  (enabled) => {
12495
13020
  if (petRequired) {
12496
13021
  return;
@@ -12503,7 +13028,11 @@ function Chat({
12503
13028
  [displayedPetSettings, petRequired, savePetLocalSettings]
12504
13029
  )
12505
13030
  });
12506
- const syncQuoteSelection = React44.useCallback(() => {
13031
+ const canMinimizeToPet = parentMessenger?.isParentAvailable === true && isPetEnabled(effectivePet);
13032
+ const handleMinimizeToPet = React45.useCallback(() => {
13033
+ parentMessenger?.sendEvent("chat_minimize_change", { minimized: true });
13034
+ }, [parentMessenger]);
13035
+ const syncQuoteSelection = React45.useCallback(() => {
12507
13036
  if (typeof window === "undefined") {
12508
13037
  clearQuoteSelection();
12509
13038
  return;
@@ -12548,23 +13077,23 @@ function Chat({
12548
13077
  left
12549
13078
  });
12550
13079
  }, [clearQuoteSelection]);
12551
- const cancelPendingAutoScroll = React44.useCallback(() => {
13080
+ const cancelPendingAutoScroll = React45.useCallback(() => {
12552
13081
  if (autoScrollFrameRef.current !== null) {
12553
13082
  cancelAnimationFrame(autoScrollFrameRef.current);
12554
13083
  autoScrollFrameRef.current = null;
12555
13084
  }
12556
13085
  }, []);
12557
- const disableAutoFollow = React44.useCallback(() => {
13086
+ const disableAutoFollow = React45.useCallback(() => {
12558
13087
  forceFollowRef.current = false;
12559
13088
  shouldAutoScrollRef.current = false;
12560
13089
  cancelPendingAutoScroll();
12561
13090
  }, [cancelPendingAutoScroll]);
12562
- const enableAutoFollow = React44.useCallback(() => {
13091
+ const enableAutoFollow = React45.useCallback(() => {
12563
13092
  forceFollowRef.current = true;
12564
13093
  shouldAutoScrollRef.current = true;
12565
13094
  setHasUpdatesBelow(false);
12566
13095
  }, []);
12567
- const scrollToBottom = React44.useCallback(
13096
+ const scrollToBottom = React45.useCallback(
12568
13097
  (smooth = false, force = false) => {
12569
13098
  if (force) {
12570
13099
  enableAutoFollow();
@@ -12591,7 +13120,7 @@ function Chat({
12591
13120
  },
12592
13121
  [cancelPendingAutoScroll, enableAutoFollow]
12593
13122
  );
12594
- React44.useEffect(() => {
13123
+ React45.useEffect(() => {
12595
13124
  const viewport = viewportRef.current;
12596
13125
  if (!viewport) return;
12597
13126
  previousScrollTopRef.current = viewport.scrollTop;
@@ -12672,14 +13201,14 @@ function Chat({
12672
13201
  window.removeEventListener("pointercancel", stopPointerTracking);
12673
13202
  };
12674
13203
  }, [cancelPendingAutoScroll, disableAutoFollow]);
12675
- React44.useEffect(() => {
13204
+ React45.useEffect(() => {
12676
13205
  shouldAutoScrollRef.current = true;
12677
13206
  forceFollowRef.current = false;
12678
13207
  previousScrollTopRef.current = 0;
12679
13208
  setIsAtBottom(true);
12680
13209
  setHasUpdatesBelow(false);
12681
13210
  }, [stream.threadId]);
12682
- React44.useEffect(() => {
13211
+ React45.useEffect(() => {
12683
13212
  const messageCountChanged = messages.length !== previousMessageCountRef.current;
12684
13213
  previousMessageCountRef.current = messages.length;
12685
13214
  if (!shouldAutoScrollRef.current) {
@@ -12698,7 +13227,7 @@ function Chat({
12698
13227
  clientSecret: effectiveClientSecret
12699
13228
  });
12700
13229
  const missingConfig = Boolean(missingConfigKind);
12701
- const missingConfigShortMessage = React44.useMemo(() => {
13230
+ const missingConfigShortMessage = React45.useMemo(() => {
12702
13231
  switch (missingConfigKind) {
12703
13232
  case "apiUrl":
12704
13233
  return t("chat.missingApiUrlShort");
@@ -12710,7 +13239,7 @@ function Chat({
12710
13239
  return t("chat.missingConfigShort");
12711
13240
  }
12712
13241
  }, [missingConfigKind, t]);
12713
- const missingConfigDetailMessage = React44.useMemo(() => {
13242
+ const missingConfigDetailMessage = React45.useMemo(() => {
12714
13243
  switch (missingConfigKind) {
12715
13244
  case "apiUrl":
12716
13245
  return t("chat.missingApiUrlDetail");
@@ -12725,7 +13254,7 @@ function Chat({
12725
13254
  const showMissingConfig = !isClientSecretInitializing && missingConfig;
12726
13255
  const hasUploadingFiles = attachments.some((a) => a.status === "uploading");
12727
13256
  const isSendDisabled = !trimmedDraft && !hasReferences || hasPendingInteractiveRequest || missingConfig || isHistoryLoading || hasUploadingFiles || isUploadingReferenceImages;
12728
- const resizeComposerInput = React44.useCallback(() => {
13257
+ const resizeComposerInput = React45.useCallback(() => {
12729
13258
  const input = composerInputRef.current;
12730
13259
  if (!input) {
12731
13260
  return;
@@ -12733,7 +13262,7 @@ function Chat({
12733
13262
  input.style.maxHeight = `${COMPOSER_INPUT_MAX_HEIGHT}px`;
12734
13263
  input.style.overflowY = input.scrollHeight > COMPOSER_INPUT_MAX_HEIGHT ? "auto" : "hidden";
12735
13264
  }, []);
12736
- React44.useLayoutEffect(() => {
13265
+ React45.useLayoutEffect(() => {
12737
13266
  composerPartsRef.current = composerParts;
12738
13267
  resizeComposerInput();
12739
13268
  const caretOffset = pendingComposerCaretOffsetRef.current;
@@ -12745,13 +13274,13 @@ function Chat({
12745
13274
  }
12746
13275
  }
12747
13276
  }, [composerDomVersion, composerParts, resizeComposerInput]);
12748
- React44.useEffect(() => {
13277
+ React45.useEffect(() => {
12749
13278
  document.addEventListener("selectionchange", syncQuoteSelection);
12750
13279
  return () => {
12751
13280
  document.removeEventListener("selectionchange", syncQuoteSelection);
12752
13281
  };
12753
13282
  }, [syncQuoteSelection]);
12754
- React44.useEffect(() => {
13283
+ React45.useEffect(() => {
12755
13284
  const viewport = viewportRef.current;
12756
13285
  if (!viewport) {
12757
13286
  return;
@@ -12768,14 +13297,14 @@ function Chat({
12768
13297
  window.removeEventListener("resize", handleViewportScroll);
12769
13298
  };
12770
13299
  }, [clearQuoteSelection]);
12771
- React44.useEffect(() => {
13300
+ React45.useEffect(() => {
12772
13301
  clearQuoteSelection();
12773
13302
  }, [messages.length, stream.threadId, clearQuoteSelection]);
12774
- React44.useEffect(() => {
13303
+ React45.useEffect(() => {
12775
13304
  if (missingConfig) return;
12776
13305
  void refreshThreads();
12777
13306
  }, [missingConfig, refreshThreads]);
12778
- React44.useEffect(() => {
13307
+ React45.useEffect(() => {
12779
13308
  if (missingConfig || !stream.client || !stream.assistantId) {
12780
13309
  setAssistantName(null);
12781
13310
  setAssistantAvatar(null);
@@ -12798,7 +13327,7 @@ function Chat({
12798
13327
  cancelled = true;
12799
13328
  };
12800
13329
  }, [missingConfig, stream.client, stream.assistantId]);
12801
- React44.useEffect(() => {
13330
+ React45.useEffect(() => {
12802
13331
  if (missingConfig || !stream.client || !stream.assistantId) {
12803
13332
  setRuntimeCapabilities(null);
12804
13333
  setRuntimeCapabilitiesReady(false);
@@ -12845,7 +13374,7 @@ function Chat({
12845
13374
  });
12846
13375
  return () => controller.abort();
12847
13376
  }, [missingConfig, stream.client, stream.assistantId]);
12848
- React44.useEffect(() => {
13377
+ React45.useEffect(() => {
12849
13378
  setRunRuntimeCapabilities(
12850
13379
  createEmptyRuntimeCapabilitiesSelection(runtimeCapabilities)
12851
13380
  );
@@ -12902,7 +13431,7 @@ function Chat({
12902
13431
  mimetype: a.storageFile?.mimetype ?? a.file.type,
12903
13432
  size: a.storageFile?.size ?? a.file.size
12904
13433
  }));
12905
- const handleSessionRuntimeCapabilityToggle = React44.useCallback(
13434
+ const handleSessionRuntimeCapabilityToggle = React45.useCallback(
12906
13435
  (type, id, selected) => {
12907
13436
  setSessionRuntimeCapabilities((previous) => {
12908
13437
  const nextSelection = toggleRuntimeCapabilitySelection(
@@ -12920,7 +13449,7 @@ function Chat({
12920
13449
  },
12921
13450
  [persistSessionRuntimeCapabilities, stream.threadId]
12922
13451
  );
12923
- const updateRuntimeCapabilityPalette = React44.useCallback(
13452
+ const updateRuntimeCapabilityPalette = React45.useCallback(
12924
13453
  (parts, selectionStart) => {
12925
13454
  const input = composerInputRef.current;
12926
13455
  const editingText = getComposerEditingText(parts);
@@ -12932,7 +13461,7 @@ function Chat({
12932
13461
  },
12933
13462
  []
12934
13463
  );
12935
- const syncComposerInputFromElement = React44.useCallback(
13464
+ const syncComposerInputFromElement = React45.useCallback(
12936
13465
  (input) => {
12937
13466
  const previousCapabilities = getComposerCapabilityPartMap(
12938
13467
  composerPartsRef.current
@@ -12950,25 +13479,25 @@ function Chat({
12950
13479
  },
12951
13480
  [commitComposerParts, updateRuntimeCapabilityPalette]
12952
13481
  );
12953
- const handleComposerInput = React44.useCallback(
13482
+ const handleComposerInput = React45.useCallback(
12954
13483
  (event) => {
12955
13484
  syncComposerInputFromElement(event.currentTarget);
12956
13485
  },
12957
13486
  [syncComposerInputFromElement]
12958
13487
  );
12959
- const handleComposerCompositionEnd = React44.useCallback(
13488
+ const handleComposerCompositionEnd = React45.useCallback(
12960
13489
  (event) => {
12961
13490
  syncComposerInputFromElement(event.currentTarget);
12962
13491
  },
12963
13492
  [syncComposerInputFromElement]
12964
13493
  );
12965
- const handleComposerSelect = React44.useCallback(() => {
13494
+ const handleComposerSelect = React45.useCallback(() => {
12966
13495
  updateRuntimeCapabilityPalette(
12967
13496
  composerPartsRef.current,
12968
13497
  composerInputRef.current ? getComposerSelectionOffset(composerInputRef.current) : void 0
12969
13498
  );
12970
13499
  }, [updateRuntimeCapabilityPalette]);
12971
- const removeRunRuntimeCapability = React44.useCallback(
13500
+ const removeRunRuntimeCapability = React45.useCallback(
12972
13501
  (option) => {
12973
13502
  setRunRuntimeCapabilities(
12974
13503
  (previous) => toggleRuntimeCapabilitySelection(
@@ -12988,7 +13517,7 @@ function Chat({
12988
13517
  },
12989
13518
  [commitComposerParts]
12990
13519
  );
12991
- const submitDraft = React44.useCallback(
13520
+ const submitDraft = React45.useCallback(
12992
13521
  (optionsOrFollowUp) => {
12993
13522
  if (isSendDisabled) return;
12994
13523
  const submitOptions = typeof optionsOrFollowUp === "string" ? { followUpOverride: optionsOrFollowUp } : optionsOrFollowUp ?? {};
@@ -13112,7 +13641,7 @@ function Chat({
13112
13641
  t
13113
13642
  ]
13114
13643
  );
13115
- const addRunRuntimeCapabilities = React44.useCallback(
13644
+ const addRunRuntimeCapabilities = React45.useCallback(
13116
13645
  (selection) => {
13117
13646
  setRunRuntimeCapabilities(
13118
13647
  (previous) => runtimeCapabilities ? mergeRuntimeCapabilitiesSelections(
@@ -13124,7 +13653,7 @@ function Chat({
13124
13653
  },
13125
13654
  [runtimeCapabilities]
13126
13655
  );
13127
- const insertComposerCapabilityToken = React44.useCallback(
13656
+ const insertComposerCapabilityToken = React45.useCallback(
13128
13657
  (capability, range) => {
13129
13658
  const token = createComposerCapabilityPart(capability, createMessageId());
13130
13659
  const currentParts = composerPartsRef.current;
@@ -13195,7 +13724,7 @@ function Chat({
13195
13724
  plugin: t("composer.slashCommands.empty.loadingCapabilities"),
13196
13725
  subAgent: t("composer.slashCommands.empty.loadingCapabilities")
13197
13726
  };
13198
- React44.useEffect(() => {
13727
+ React45.useEffect(() => {
13199
13728
  if (!runtimeCapabilityPalette) {
13200
13729
  return;
13201
13730
  }
@@ -13214,7 +13743,7 @@ function Chat({
13214
13743
  );
13215
13744
  }
13216
13745
  }, [slashPaletteOptions.length, runtimeCapabilityPalette]);
13217
- React44.useLayoutEffect(() => {
13746
+ React45.useLayoutEffect(() => {
13218
13747
  if (!runtimeCapabilityPalette) {
13219
13748
  return;
13220
13749
  }
@@ -13238,7 +13767,7 @@ function Chat({
13238
13767
  }
13239
13768
  submitDraft();
13240
13769
  };
13241
- const handleEditPendingFollowUp = React44.useCallback(
13770
+ const handleEditPendingFollowUp = React45.useCallback(
13242
13771
  (id) => {
13243
13772
  const item = pendingFollowUps.find(
13244
13773
  (entry) => entry.id === id && entry.mode === "queue"
@@ -13265,7 +13794,7 @@ function Chat({
13265
13794
  },
13266
13795
  [pendingFollowUps, setComposerText, stream]
13267
13796
  );
13268
- const handleQuoteSelection = React44.useCallback(() => {
13797
+ const handleQuoteSelection = React45.useCallback(() => {
13269
13798
  if (!quoteSelection) {
13270
13799
  return;
13271
13800
  }
@@ -13281,7 +13810,7 @@ function Chat({
13281
13810
  const handleAttachmentClick = () => {
13282
13811
  fileInputRef.current?.click();
13283
13812
  };
13284
- const uploadContextFile = React44.useCallback(
13813
+ const uploadContextFile = React45.useCallback(
13285
13814
  (file) => stream.client.contexts.uploadFile(file),
13286
13815
  [stream.client]
13287
13816
  );
@@ -13385,7 +13914,7 @@ function Chat({
13385
13914
  }
13386
13915
  submitDraft();
13387
13916
  };
13388
- const handleComposerPaste = React44.useCallback(
13917
+ const handleComposerPaste = React45.useCallback(
13389
13918
  (event) => {
13390
13919
  const clipboardData = event.clipboardData;
13391
13920
  if (!clipboardData) {
@@ -13484,18 +14013,18 @@ function Chat({
13484
14013
  uploadContextFile
13485
14014
  ]
13486
14015
  );
13487
- const alternateFollowUpShortcutLabel = React44.useMemo(() => {
14016
+ const alternateFollowUpShortcutLabel = React45.useMemo(() => {
13488
14017
  if (typeof navigator === "undefined") {
13489
14018
  return "\u2318Enter";
13490
14019
  }
13491
14020
  const platform = navigator.platform || navigator.userAgent;
13492
14021
  return /Mac|iPhone|iPad|iPod/i.test(platform) ? "\u2318Enter" : "Ctrl+Enter";
13493
14022
  }, []);
13494
- const followUpShortcutLabels = React44.useMemo(
14023
+ const followUpShortcutLabels = React45.useMemo(
13495
14024
  () => getComposerFollowUpShortcutLabels(alternateFollowUpShortcutLabel),
13496
14025
  [alternateFollowUpShortcutLabel]
13497
14026
  );
13498
- const uploadFile = React44.useCallback(
14027
+ const uploadFile = React45.useCallback(
13499
14028
  async (localId, file) => {
13500
14029
  try {
13501
14030
  const result = await uploadContextFile(file);
@@ -13518,7 +14047,7 @@ function Chat({
13518
14047
  },
13519
14048
  [uploadContextFile]
13520
14049
  );
13521
- const handleRetryUpload = React44.useCallback(
14050
+ const handleRetryUpload = React45.useCallback(
13522
14051
  (localId) => {
13523
14052
  const attachment = attachments.find((a) => a.localId === localId);
13524
14053
  if (!attachment || attachment.status !== "error") return;
@@ -13617,7 +14146,7 @@ function Chat({
13617
14146
  );
13618
14147
  scrollToBottom(true, true);
13619
14148
  };
13620
- const loadConversationMessages = React44.useCallback(
14149
+ const loadConversationMessages = React45.useCallback(
13621
14150
  async (recordId) => {
13622
14151
  if (missingConfig) {
13623
14152
  setHistoryError(missingConfigShortMessage);
@@ -13712,12 +14241,12 @@ function Chat({
13712
14241
  }
13713
14242
  };
13714
14243
  const acceptMimes = composer?.attachments?.accept ? Object.entries(composer.attachments.accept).map(([mime, exts]) => [mime, ...exts.map((e) => `.${e}`)].join(",")).join(",") : void 0;
13715
- const currentThread = React44.useMemo(
14244
+ const currentThread = React45.useMemo(
13716
14245
  () => threads.find((item) => item.id === stream.threadId),
13717
14246
  [threads, stream.threadId]
13718
14247
  );
13719
14248
  const streamErrorMessage = stream.error instanceof Error ? stream.error.message : void 0;
13720
- const threadErrorMessage = React44.useMemo(() => {
14249
+ const threadErrorMessage = React45.useMemo(() => {
13721
14250
  if (streamErrorMessage?.trim()) return streamErrorMessage.trim();
13722
14251
  if (currentThread?.status !== "error") return void 0;
13723
14252
  const message = currentThread.error?.trim();
@@ -13748,7 +14277,7 @@ function Chat({
13748
14277
  fallbackTitle: t("history.threadFallback")
13749
14278
  });
13750
14279
  const assistantTitle = assistantName || resolvedTitle;
13751
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
14280
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
13752
14281
  "div",
13753
14282
  {
13754
14283
  ref: viewportRef,
@@ -13758,10 +14287,10 @@ function Chat({
13758
14287
  className
13759
14288
  ),
13760
14289
  children: [
13761
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex items-center justify-between border-b p-2 sticky top-0 z-10 bg-background", children: [
13762
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex items-center gap-3 overflow-hidden", children: [
13763
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "relative shrink-0", children: [
13764
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14290
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-center justify-between border-b p-2 sticky top-0 z-10 bg-background", children: [
14291
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-center gap-3 overflow-hidden", children: [
14292
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "relative shrink-0", children: [
14293
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
13765
14294
  ChatkitAvatar,
13766
14295
  {
13767
14296
  avatar: assistantAvatar,
@@ -13769,10 +14298,10 @@ function Chat({
13769
14298
  label: assistantTitle
13770
14299
  }
13771
14300
  ),
13772
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "absolute bottom-0 right-0 h-2.5 w-2.5 rounded-full border-2 border-background bg-green-500" })
14301
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "absolute bottom-0 right-0 h-2.5 w-2.5 rounded-full border-2 border-background bg-green-500" })
13773
14302
  ] }),
13774
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "truncate", children: [
13775
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14303
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "truncate", children: [
14304
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
13776
14305
  "h2",
13777
14306
  {
13778
14307
  className: "text-lg font-semibold truncate",
@@ -13780,12 +14309,29 @@ function Chat({
13780
14309
  children: assistantTitle
13781
14310
  }
13782
14311
  ),
13783
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "text-xs text-muted-foreground", children: t("chat.statusOnline") })
14312
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { className: "text-xs text-muted-foreground", children: t("chat.statusOnline") })
13784
14313
  ] })
13785
14314
  ] }),
13786
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex items-center gap-1", children: [
13787
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Tooltip, { children: [
13788
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14315
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-center gap-1", children: [
14316
+ canMinimizeToPet && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Tooltip, { children: [
14317
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14318
+ "button",
14319
+ {
14320
+ type: "button",
14321
+ onClick: handleMinimizeToPet,
14322
+ className: cn(
14323
+ "flex h-8 w-8 cursor-pointer items-center justify-center rounded-md",
14324
+ "text-muted-foreground hover:text-foreground hover:bg-muted",
14325
+ "transition-colors duration-150"
14326
+ ),
14327
+ "aria-label": t("chat.minimizeToPet"),
14328
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react25.Minus, { size: 16 })
14329
+ }
14330
+ ) }) }),
14331
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(TooltipContent, { side: "bottom", children: t("chat.minimizeToPet") })
14332
+ ] }),
14333
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Tooltip, { children: [
14334
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
13789
14335
  "button",
13790
14336
  {
13791
14337
  type: "button",
@@ -13796,14 +14342,14 @@ function Chat({
13796
14342
  "transition-colors duration-150"
13797
14343
  ),
13798
14344
  "aria-label": t("settings.open"),
13799
- children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react24.Settings, { size: 16 })
14345
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react25.Settings, { size: 16 })
13800
14346
  }
13801
14347
  ) }) }),
13802
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TooltipContent, { side: "bottom", children: t("settings.open") })
14348
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(TooltipContent, { side: "bottom", children: t("settings.open") })
13803
14349
  ] }),
13804
- history?.enabled !== false && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
13805
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Tooltip, { children: [
13806
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14350
+ history?.enabled !== false && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
14351
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Tooltip, { children: [
14352
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
13807
14353
  "button",
13808
14354
  {
13809
14355
  type: "button",
@@ -13816,12 +14362,12 @@ function Chat({
13816
14362
  "disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed"
13817
14363
  ),
13818
14364
  "aria-label": t("history.newThread"),
13819
- children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react24.Pencil, { size: 16 })
14365
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react25.Pencil, { size: 16 })
13820
14366
  }
13821
14367
  ) }) }),
13822
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TooltipContent, { side: "bottom", children: t("history.newThread") })
14368
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(TooltipContent, { side: "bottom", children: t("history.newThread") })
13823
14369
  ] }),
13824
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14370
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
13825
14371
  HistorySidebar,
13826
14372
  {
13827
14373
  threads,
@@ -13836,18 +14382,18 @@ function Chat({
13836
14382
  ] })
13837
14383
  ] })
13838
14384
  ] }),
13839
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex-1 p-4", children: [
13840
- errorMessage && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "mb-4 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive", children: errorMessage }),
13841
- historyError && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: historyError }),
13842
- showMissingConfig && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: missingConfigDetailMessage }),
13843
- isHistoryLoading && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "mb-4 rounded-lg border border-muted px-3 py-2 text-sm text-muted-foreground", children: t("chat.loadingThread") }),
13844
- messages.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14385
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex-1 p-4", children: [
14386
+ errorMessage && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "mb-4 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive", children: errorMessage }),
14387
+ historyError && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: historyError }),
14388
+ showMissingConfig && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: missingConfigDetailMessage }),
14389
+ isHistoryLoading && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "mb-4 rounded-lg border border-muted px-3 py-2 text-sm text-muted-foreground", children: t("chat.loadingThread") }),
14390
+ messages.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
13845
14391
  StartScreen,
13846
14392
  {
13847
14393
  startScreen,
13848
14394
  onPromptClick: handlePromptClick
13849
14395
  }
13850
- ) : /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "space-y-4", children: [
14396
+ ) : /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "space-y-4", children: [
13851
14397
  messages.map((message, index) => {
13852
14398
  const messageType = String(message.type);
13853
14399
  const isAssistantMessage = messageType === "assistant" || messageType === "ai";
@@ -13880,7 +14426,7 @@ function Chat({
13880
14426
  if (!isAssistantMessage && !hasPlainRenderableContent && !hasHumanAttachments && humanRuntimeCapabilityOptions.length === 0 && humanReferences.length === 0) {
13881
14427
  return null;
13882
14428
  }
13883
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14429
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
13884
14430
  "div",
13885
14431
  {
13886
14432
  className: cn(
@@ -13888,8 +14434,8 @@ function Chat({
13888
14434
  message.type === "human" ? "justify-end" : "justify-start -ml-1"
13889
14435
  // AI messages: slightly closer to left
13890
14436
  ),
13891
- children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex flex-col px-3 overflow-hidden", children: [
13892
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14437
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex flex-col px-3 overflow-hidden", children: [
14438
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
13893
14439
  "div",
13894
14440
  {
13895
14441
  ...canQuoteMessage ? {
@@ -13901,7 +14447,7 @@ function Chat({
13901
14447
  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"
13902
14448
  // AI messages: use chat-specific foreground color
13903
14449
  ),
13904
- children: isAssistantMessage ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14450
+ children: isAssistantMessage ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
13905
14451
  AssistantMessage,
13906
14452
  {
13907
14453
  message: {
@@ -13920,25 +14466,25 @@ function Chat({
13920
14466
  organizationId: stream.organizationId,
13921
14467
  apiUrl: stream.apiUrl
13922
14468
  }
13923
- ) : /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
13924
- message.type === "human" && humanRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanRuntimeCapabilityOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
14469
+ ) : /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
14470
+ message.type === "human" && humanRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanRuntimeCapabilityOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
13925
14471
  "span",
13926
14472
  {
13927
14473
  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",
13928
14474
  children: [
13929
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14475
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
13930
14476
  RuntimeCapabilityIcon,
13931
14477
  {
13932
14478
  option,
13933
14479
  variant: "chip"
13934
14480
  }
13935
14481
  ),
13936
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "max-w-[9rem] truncate", children: option.label })
14482
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "max-w-[9rem] truncate", children: option.label })
13937
14483
  ]
13938
14484
  },
13939
14485
  `${option.type}:${option.id}`
13940
14486
  )) }),
13941
- message.type === "human" && humanReferences.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanReferences.map((reference) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14487
+ message.type === "human" && humanReferences.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanReferences.map((reference) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
13942
14488
  ReferenceChip,
13943
14489
  {
13944
14490
  reference,
@@ -13946,29 +14492,29 @@ function Chat({
13946
14492
  },
13947
14493
  getReferenceKey(reference)
13948
14494
  )) }),
13949
- message.type === "human" && humanAttachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-2", children: humanAttachments.map((file, fileIndex) => /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
14495
+ message.type === "human" && humanAttachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-2", children: humanAttachments.map((file, fileIndex) => /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
13950
14496
  "div",
13951
14497
  {
13952
14498
  className: "flex items-center gap-1.5 rounded-md bg-primary-foreground/20 px-2 py-1 text-xs",
13953
14499
  children: [
13954
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react24.FileText, { size: 12 }),
13955
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "max-w-[100px] truncate", children: file.originalName })
14500
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react25.FileText, { size: 12 }),
14501
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "max-w-[100px] truncate", children: file.originalName })
13956
14502
  ]
13957
14503
  },
13958
14504
  fileIndex
13959
14505
  )) }),
13960
- Array.isArray(message.content) ? message.content.map((part, partIndex) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14506
+ Array.isArray(message.content) ? message.content.map((part, partIndex) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
13961
14507
  "p",
13962
14508
  {
13963
14509
  className: "wrap-break-word text-sm leading-relaxed",
13964
14510
  children: formatMessageContent(part)
13965
14511
  },
13966
14512
  `${part.type}-${partIndex}`
13967
- )) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "wrap-break-word text-sm leading-relaxed", children: formatMessageContent(message.content) })
14513
+ )) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "wrap-break-word text-sm leading-relaxed", children: formatMessageContent(message.content) })
13968
14514
  ] })
13969
14515
  }
13970
14516
  ),
13971
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14517
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
13972
14518
  MessageActions,
13973
14519
  {
13974
14520
  content: messageContent,
@@ -14004,7 +14550,7 @@ function Chat({
14004
14550
  stream.isLoading,
14005
14551
  { now: streamingNow }
14006
14552
  );
14007
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "flex justify-start gap-3 -ml-2", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "max-w-full rounded-2xl py-2.5", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14553
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "flex justify-start gap-3 -ml-2", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "max-w-full rounded-2xl py-2.5", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14008
14554
  AssistantStreamingIndicator,
14009
14555
  {
14010
14556
  status: fallbackStreamingStatus ?? "loading"
@@ -14013,7 +14559,7 @@ function Chat({
14013
14559
  })()
14014
14560
  ] })
14015
14561
  ] }),
14016
- !isAtBottom && messages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "sticky bottom-20 z-20 flex justify-center px-4 pointer-events-none", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14562
+ !isAtBottom && messages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "sticky bottom-20 z-20 flex justify-center px-4 pointer-events-none", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14017
14563
  Button,
14018
14564
  {
14019
14565
  type: "button",
@@ -14026,10 +14572,10 @@ function Chat({
14026
14572
  onClick: () => scrollToBottom(true, true),
14027
14573
  "aria-label": t("chat.scrollToBottom"),
14028
14574
  title: t("chat.scrollToBottom"),
14029
- children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react24.ArrowDown, { size: 16 })
14575
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react25.ArrowDown, { size: 16 })
14030
14576
  }
14031
14577
  ) }),
14032
- quoteSelection && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14578
+ quoteSelection && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14033
14579
  "div",
14034
14580
  {
14035
14581
  className: "pointer-events-none fixed z-50",
@@ -14038,7 +14584,7 @@ function Chat({
14038
14584
  left: `${quoteSelection.left}px`,
14039
14585
  transform: "translateX(-50%)"
14040
14586
  },
14041
- children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
14587
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
14042
14588
  Button,
14043
14589
  {
14044
14590
  type: "button",
@@ -14050,16 +14596,16 @@ function Chat({
14050
14596
  "aria-label": t("composer.quoteSelection"),
14051
14597
  title: t("composer.quoteSelection"),
14052
14598
  children: [
14053
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react24.Quote, { size: 14 }),
14599
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react25.Quote, { size: 14 }),
14054
14600
  t("composer.quoteSelection")
14055
14601
  ]
14056
14602
  }
14057
14603
  )
14058
14604
  }
14059
14605
  ),
14060
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "p-2 sticky bottom-0 z-10 bg-background", children: [
14061
- threadErrorMessage && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "mb-3 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive overflow-auto", children: threadErrorMessage }),
14062
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14606
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "p-2 sticky bottom-0 z-10 bg-background", children: [
14607
+ threadErrorMessage && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "mb-3 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive overflow-auto", children: threadErrorMessage }),
14608
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14063
14609
  "input",
14064
14610
  {
14065
14611
  ref: fileInputRef,
@@ -14070,7 +14616,7 @@ function Chat({
14070
14616
  className: "hidden"
14071
14617
  }
14072
14618
  ),
14073
- attachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "mb-3 flex flex-wrap gap-2", children: attachments.map((item) => /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
14619
+ attachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "mb-3 flex flex-wrap gap-2", children: attachments.map((item) => /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
14074
14620
  "div",
14075
14621
  {
14076
14622
  className: cn(
@@ -14078,16 +14624,16 @@ function Chat({
14078
14624
  item.status === "error" ? "bg-destructive/10 border border-destructive/30" : "bg-muted"
14079
14625
  ),
14080
14626
  children: [
14081
- item.status === "uploading" && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14082
- import_lucide_react24.Loader2,
14627
+ item.status === "uploading" && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14628
+ import_lucide_react25.Loader2,
14083
14629
  {
14084
14630
  size: 14,
14085
14631
  className: "animate-spin text-muted-foreground"
14086
14632
  }
14087
14633
  ),
14088
- item.status === "success" && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react24.FileText, { size: 14, className: "text-muted-foreground" }),
14089
- item.status === "error" && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react24.FileText, { size: 14, className: "text-destructive" }),
14090
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14634
+ item.status === "success" && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react25.FileText, { size: 14, className: "text-muted-foreground" }),
14635
+ item.status === "error" && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react25.FileText, { size: 14, className: "text-destructive" }),
14636
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14091
14637
  "span",
14092
14638
  {
14093
14639
  className: cn(
@@ -14097,17 +14643,17 @@ function Chat({
14097
14643
  children: item.file.name
14098
14644
  }
14099
14645
  ),
14100
- item.status === "error" && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14646
+ item.status === "error" && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14101
14647
  "button",
14102
14648
  {
14103
14649
  type: "button",
14104
14650
  onClick: () => handleRetryUpload(item.localId),
14105
14651
  className: "ml-1 rounded-full p-0.5 text-destructive hover:bg-destructive/20",
14106
14652
  title: t("chat.retryUpload"),
14107
- children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react24.RefreshCw, { size: 12 })
14653
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react25.RefreshCw, { size: 12 })
14108
14654
  }
14109
14655
  ),
14110
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14656
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14111
14657
  "button",
14112
14658
  {
14113
14659
  type: "button",
@@ -14116,14 +14662,14 @@ function Chat({
14116
14662
  "ml-1 rounded-full p-0.5",
14117
14663
  item.status === "error" ? "text-destructive hover:bg-destructive/20" : "hover:bg-muted-foreground/20"
14118
14664
  ),
14119
- children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react24.X, { size: 12 })
14665
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react25.X, { size: 12 })
14120
14666
  }
14121
14667
  )
14122
14668
  ]
14123
14669
  },
14124
14670
  item.localId
14125
14671
  )) }),
14126
- references.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "mb-3 flex flex-wrap gap-2", children: references.map((reference) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14672
+ references.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "mb-3 flex flex-wrap gap-2", children: references.map((reference) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14127
14673
  ReferenceChip,
14128
14674
  {
14129
14675
  reference,
@@ -14137,16 +14683,16 @@ function Chat({
14137
14683
  },
14138
14684
  getReferenceKey(reference)
14139
14685
  )) }),
14140
- detachedRunRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "mb-2 flex flex-wrap items-center gap-2", children: [
14141
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "text-xs text-muted-foreground", children: t("composer.capabilities.runOnly") }),
14142
- detachedRunRuntimeCapabilityOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
14686
+ detachedRunRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "mb-2 flex flex-wrap items-center gap-2", children: [
14687
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "text-xs text-muted-foreground", children: t("composer.capabilities.runOnly") }),
14688
+ detachedRunRuntimeCapabilityOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
14143
14689
  "span",
14144
14690
  {
14145
14691
  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",
14146
14692
  children: [
14147
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(RuntimeCapabilityIcon, { option, variant: "chip" }),
14148
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "max-w-40 truncate", children: option.label }),
14149
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14693
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(RuntimeCapabilityIcon, { option, variant: "chip" }),
14694
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "max-w-40 truncate", children: option.label }),
14695
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14150
14696
  "button",
14151
14697
  {
14152
14698
  type: "button",
@@ -14154,7 +14700,7 @@ function Chat({
14154
14700
  className: "rounded-full p-0.5 hover:bg-primary/15",
14155
14701
  title: t("composer.capabilities.removeRunCapability"),
14156
14702
  "aria-label": t("composer.capabilities.removeRunCapability"),
14157
- children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react24.X, { size: 11 })
14703
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react25.X, { size: 11 })
14158
14704
  }
14159
14705
  )
14160
14706
  ]
@@ -14162,7 +14708,7 @@ function Chat({
14162
14708
  `${option.type}:${option.id}`
14163
14709
  ))
14164
14710
  ] }),
14165
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14711
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14166
14712
  PendingRuntimeServices,
14167
14713
  {
14168
14714
  state: stream.runtimeActivities.sandboxServices,
@@ -14171,7 +14717,7 @@ function Chat({
14171
14717
  className: hasPendingTodos || hasPendingFollowUps ? "mb-2" : void 0
14172
14718
  }
14173
14719
  ),
14174
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14720
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14175
14721
  PendingTodos,
14176
14722
  {
14177
14723
  snapshot: stream.todos,
@@ -14179,7 +14725,7 @@ function Chat({
14179
14725
  className: hasPendingFollowUps ? "mb-2" : void 0
14180
14726
  }
14181
14727
  ),
14182
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14728
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14183
14729
  PendingFollowUps,
14184
14730
  {
14185
14731
  items: pendingFollowUps,
@@ -14194,7 +14740,7 @@ function Chat({
14194
14740
  attachToComposer: true
14195
14741
  }
14196
14742
  ),
14197
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14743
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14198
14744
  RequestUserInputPanel,
14199
14745
  {
14200
14746
  request: stream.pendingRequestUserInput,
@@ -14203,7 +14749,7 @@ function Chat({
14203
14749
  attachToComposer: true
14204
14750
  }
14205
14751
  ),
14206
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14752
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14207
14753
  HITLApprovalPanel,
14208
14754
  {
14209
14755
  request: stream.pendingHITLRequest,
@@ -14212,7 +14758,7 @@ function Chat({
14212
14758
  attachToComposer: true
14213
14759
  }
14214
14760
  ),
14215
- runtimeCapabilityPalette && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14761
+ runtimeCapabilityPalette && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14216
14762
  SlashPalette,
14217
14763
  {
14218
14764
  palette: runtimeCapabilityPalette,
@@ -14226,7 +14772,7 @@ function Chat({
14226
14772
  onSelect: selectSlashPaletteOption
14227
14773
  }
14228
14774
  ),
14229
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("form", { className: "flex items-end", onSubmit: handleSubmit, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
14775
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("form", { className: "flex items-end", onSubmit: handleSubmit, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
14230
14776
  "div",
14231
14777
  {
14232
14778
  "data-slot": "composer-input-shell",
@@ -14240,7 +14786,7 @@ function Chat({
14240
14786
  composerInputRoundedClass
14241
14787
  ),
14242
14788
  children: [
14243
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14789
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14244
14790
  "div",
14245
14791
  {
14246
14792
  ref: composerInputRef,
@@ -14262,7 +14808,7 @@ function Chat({
14262
14808
  (missingConfig || isHistoryLoading || hasPendingInteractiveRequest) && "cursor-not-allowed opacity-50"
14263
14809
  ),
14264
14810
  children: renderedComposerParts.map(
14265
- (part, index) => part.type === "text" ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(React44.Fragment, { children: part.text }, `text-${index}`) : /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
14811
+ (part, index) => part.type === "text" ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(React45.Fragment, { children: part.text }, `text-${index}`) : /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
14266
14812
  "span",
14267
14813
  {
14268
14814
  "data-composer-capability-key": part.key,
@@ -14271,14 +14817,14 @@ function Chat({
14271
14817
  contentEditable: false,
14272
14818
  className: "mx-0.5 inline-flex max-w-[14rem] select-none items-center gap-1 text-sm font-semibold text-primary align-baseline",
14273
14819
  children: [
14274
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14820
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14275
14821
  RuntimeCapabilityIcon,
14276
14822
  {
14277
14823
  option: part.capability,
14278
14824
  variant: "chip"
14279
14825
  }
14280
14826
  ),
14281
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "truncate", children: part.capability.label })
14827
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "truncate", children: part.capability.label })
14282
14828
  ]
14283
14829
  },
14284
14830
  part.key
@@ -14287,14 +14833,14 @@ function Chat({
14287
14833
  },
14288
14834
  composerDomVersion
14289
14835
  ),
14290
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
14836
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
14291
14837
  "div",
14292
14838
  {
14293
14839
  "data-slot": "composer-action-bar",
14294
14840
  className: "pointer-events-none absolute inset-x-1.5 bottom-1 flex min-h-10 items-center justify-between gap-2",
14295
14841
  children: [
14296
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "pointer-events-none flex min-w-0 flex-1 items-center gap-1.5", children: [
14297
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "pointer-events-auto flex shrink-0 items-center gap-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14842
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "pointer-events-none flex min-w-0 flex-1 items-center gap-1.5", children: [
14843
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "pointer-events-auto flex shrink-0 items-center gap-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14298
14844
  ComposerMenu,
14299
14845
  {
14300
14846
  composer,
@@ -14309,20 +14855,20 @@ function Chat({
14309
14855
  disabled: missingConfig || isHistoryLoading || hasPendingInteractiveRequest
14310
14856
  }
14311
14857
  ) }),
14312
- selectedTool && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("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: [
14313
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "truncate", children: selectedTool.shortLabel ?? selectedTool.label }),
14314
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14858
+ selectedTool && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("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: [
14859
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "truncate", children: selectedTool.shortLabel ?? selectedTool.label }),
14860
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14315
14861
  "button",
14316
14862
  {
14317
14863
  type: "button",
14318
14864
  onClick: () => setSelectedTool(null),
14319
14865
  className: "shrink-0 rounded-full p-0.5 text-primary/70 hover:bg-primary/10 hover:text-primary",
14320
- children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react24.X, { size: 12 })
14866
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react25.X, { size: 12 })
14321
14867
  }
14322
14868
  )
14323
14869
  ] })
14324
14870
  ] }),
14325
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "pointer-events-auto shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14871
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "pointer-events-auto shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14326
14872
  SendButton,
14327
14873
  {
14328
14874
  disabled: isSendDisabled,
@@ -14349,7 +14895,7 @@ function Chat({
14349
14895
  ]
14350
14896
  }
14351
14897
  ) }),
14352
- disclaimer?.text && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14898
+ disclaimer?.text && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14353
14899
  "p",
14354
14900
  {
14355
14901
  className: cn(
@@ -14359,12 +14905,12 @@ function Chat({
14359
14905
  children: disclaimer.text
14360
14906
  }
14361
14907
  ),
14362
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "mt-2 flex items-center justify-center gap-2 text-xs text-muted-foreground", children: [
14363
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { children: t("chat.poweredBy") }),
14364
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ContextUsageIndicator, { className: "absolute right-4" })
14908
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "mt-2 flex items-center justify-center gap-2 text-xs text-muted-foreground", children: [
14909
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { children: t("chat.poweredBy") }),
14910
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ContextUsageIndicator, { className: "absolute right-4" })
14365
14911
  ] })
14366
14912
  ] }),
14367
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14913
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14368
14914
  SettingsSheet,
14369
14915
  {
14370
14916
  open: petSettingsOpen,
@@ -14374,17 +14920,17 @@ function Chat({
14374
14920
  onSave: savePetLocalSettings
14375
14921
  }
14376
14922
  ),
14377
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(PetBridge, { pet: effectivePet, state: petAutoState })
14923
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(PetBridge, { pet: effectivePet, state: petAutoState })
14378
14924
  ]
14379
14925
  }
14380
14926
  );
14381
14927
  }
14382
14928
 
14383
14929
  // src/components/ui/separator.tsx
14384
- var React45 = __toESM(require("react"), 1);
14385
- var import_jsx_runtime49 = require("react/jsx-runtime");
14386
- var Separator = React45.forwardRef(
14387
- ({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
14930
+ var React46 = __toESM(require("react"), 1);
14931
+ var import_jsx_runtime51 = require("react/jsx-runtime");
14932
+ var Separator = React46.forwardRef(
14933
+ ({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
14388
14934
  "div",
14389
14935
  {
14390
14936
  ref,