@xpert-ai/chatkit-ui 0.4.4 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (336) hide show
  1. package/dist/app/assets/{_baseUniq-TMxiHmEt.js → _baseUniq-Co-XCsnp.js} +1 -1
  2. package/dist/app/assets/{abap-Ck-A--kS.js → abap--D_Kn6xP.js} +1 -1
  3. package/dist/app/assets/{abnf-ETC1zUJ3.js → abnf-D5WYHs_l.js} +1 -1
  4. package/dist/app/assets/{actionscript-D--OP--K.js → actionscript-DsVXzf-F.js} +1 -1
  5. package/dist/app/assets/{ada-CDetVdj6.js → ada-Cvy4GD3X.js} +1 -1
  6. package/dist/app/assets/{agda-BMJYMk52.js → agda-DsLk_pDK.js} +1 -1
  7. package/dist/app/assets/{al-Db9ENOd3.js → al-BeEwAGNu.js} +1 -1
  8. package/dist/app/assets/{antlr4-BW8d6D2N.js → antlr4-BPDPs4mt.js} +1 -1
  9. package/dist/app/assets/{apacheconf-BQPffoZs.js → apacheconf-DDa4MsSo.js} +1 -1
  10. package/dist/app/assets/{apex-BDhwAKiF.js → apex-IXxIiz3T.js} +1 -1
  11. package/dist/app/assets/{apl-BS9tU3lX.js → apl-_Xuh93xL.js} +1 -1
  12. package/dist/app/assets/{applescript-CAuteGTO.js → applescript-zF-7HGIh.js} +1 -1
  13. package/dist/app/assets/{aql-DlV09MnJ.js → aql-qapLE7vo.js} +1 -1
  14. package/dist/app/assets/{arc-D3dvEiRa.js → arc-R6XS2pBf.js} +1 -1
  15. package/dist/app/assets/{architectureDiagram-Q4EWVU46-BJNOb03u.js → architectureDiagram-Q4EWVU46-6z2emAH2.js} +1 -1
  16. package/dist/app/assets/{arduino-Fwp0Gqjn.js → arduino-2NlbDC0E.js} +1 -1
  17. package/dist/app/assets/{arff-D1ze2M6G.js → arff-15Fx0kni.js} +1 -1
  18. package/dist/app/assets/{asciidoc-DuSG0rE-.js → asciidoc-IGRk8vb3.js} +1 -1
  19. package/dist/app/assets/{asm6502-DiyS793s.js → asm6502-lyM25DlO.js} +1 -1
  20. package/dist/app/assets/{asmatmel-BgPjOvKk.js → asmatmel-DGRiY6RP.js} +1 -1
  21. package/dist/app/assets/{aspnet-DS6cVlO8.js → aspnet-DRHt5RUL.js} +1 -1
  22. package/dist/app/assets/{autohotkey-BhOfSyb7.js → autohotkey-DNI_3d2u.js} +1 -1
  23. package/dist/app/assets/{autoit-qharvHka.js → autoit-Tn0WXTkZ.js} +1 -1
  24. package/dist/app/assets/{avisynth-DuYY8hq9.js → avisynth-DZrXIifS.js} +1 -1
  25. package/dist/app/assets/{avro-idl-CVlpaCRn.js → avro-idl-DvnfR4q7.js} +1 -1
  26. package/dist/app/assets/{bash-CRdlMYvM.js → bash-bqRZI_pO.js} +1 -1
  27. package/dist/app/assets/{basic-DupsYiAg.js → basic-BaebTlRT.js} +1 -1
  28. package/dist/app/assets/{batch-SuJmV6In.js → batch-PcmijW6C.js} +1 -1
  29. package/dist/app/assets/{bbcode-BS6lj-GP.js → bbcode-6XIsStWc.js} +1 -1
  30. package/dist/app/assets/{bicep-rkAfEJ7t.js → bicep-CtazMCUu.js} +1 -1
  31. package/dist/app/assets/{birb-iXd4GkHj.js → birb-Bb-Z2Uoh.js} +1 -1
  32. package/dist/app/assets/{bison-DXF-YZke.js → bison-DMpTitx0.js} +1 -1
  33. package/dist/app/assets/{blockDiagram-DXYQGD6D-FJZrsqQ2.js → blockDiagram-DXYQGD6D-4zGz8PX5.js} +1 -1
  34. package/dist/app/assets/{bnf-H9nHTWOC.js → bnf-BgCmtG9K.js} +1 -1
  35. package/dist/app/assets/{brainfuck-6HhEdVzI.js → brainfuck-ZV2E8Tsx.js} +1 -1
  36. package/dist/app/assets/{brightscript-B00Ory-q.js → brightscript-BcUAceb3.js} +1 -1
  37. package/dist/app/assets/{bro-BguB8PwR.js → bro-CJMO1xO5.js} +1 -1
  38. package/dist/app/assets/{bsl-CnoKMnh1.js → bsl-BUH4KORj.js} +1 -1
  39. package/dist/app/assets/{c-BLZaQSul.js → c-jtWYEsXA.js} +1 -1
  40. package/dist/app/assets/{c4Diagram-AHTNJAMY-aFMpHsr7.js → c4Diagram-AHTNJAMY-BWtNBZjf.js} +1 -1
  41. package/dist/app/assets/{cfscript-Dj3sn5qb.js → cfscript-BRsXWjhc.js} +1 -1
  42. package/dist/app/assets/{chaiscript-B2Li8_Xi.js → chaiscript-Cyvk1xer.js} +1 -1
  43. package/dist/app/assets/channel-e2pCq0KM.js +1 -0
  44. package/dist/app/assets/{chunk-4BX2VUAB-mNkmACgc.js → chunk-4BX2VUAB-Cci3cX0w.js} +1 -1
  45. package/dist/app/assets/{chunk-4TB4RGXK-UImL1Qph.js → chunk-4TB4RGXK-Cc2Mhdt_.js} +1 -1
  46. package/dist/app/assets/{chunk-55IACEB6-BrbuP7ej.js → chunk-55IACEB6-BCuokoIJ.js} +1 -1
  47. package/dist/app/assets/{chunk-EDXVE4YY-nIuwelfS.js → chunk-EDXVE4YY-BniMDhnr.js} +1 -1
  48. package/dist/app/assets/{chunk-FMBD7UC4-BcWvK3ua.js → chunk-FMBD7UC4-BZgeDsZW.js} +1 -1
  49. package/dist/app/assets/{chunk-OYMX7WX6-NFSrvN2K.js → chunk-OYMX7WX6-DNtQg1UI.js} +1 -1
  50. package/dist/app/assets/{chunk-QZHKN3VN-A-S7sUFp.js → chunk-QZHKN3VN-CYOkyP3f.js} +1 -1
  51. package/dist/app/assets/{chunk-YZCP3GAM-NsOgLJm6.js → chunk-YZCP3GAM-DrNq3DSp.js} +1 -1
  52. package/dist/app/assets/{cil-BSYlNEvs.js → cil-xB1Wcx8v.js} +1 -1
  53. package/dist/app/assets/classDiagram-6PBFFD2Q-DHVJ7GQ2.js +1 -0
  54. package/dist/app/assets/classDiagram-v2-HSJHXN6E-DHVJ7GQ2.js +1 -0
  55. package/dist/app/assets/{clike-DaoHXpYs.js → clike-Bys-F0y3.js} +1 -1
  56. package/dist/app/assets/{clojure-CtOotL0u.js → clojure-X2Ur1GCR.js} +1 -1
  57. package/dist/app/assets/clone-CepWRlEk.js +1 -0
  58. package/dist/app/assets/{cmake-BSiUfJHf.js → cmake-BV05wnad.js} +1 -1
  59. package/dist/app/assets/{cobol-Blq62nOS.js → cobol-DmbS5Ovj.js} +1 -1
  60. package/dist/app/assets/{coffeescript-wfCQi2dy.js → coffeescript-NB44yUqU.js} +1 -1
  61. package/dist/app/assets/{concurnas-BptxXLM6.js → concurnas-DRly0Ymz.js} +1 -1
  62. package/dist/app/assets/{coq-m0xx6QVk.js → coq-5BMX0a02.js} +1 -1
  63. package/dist/app/assets/{core-BlK5liku.js → core-BDQ00Bae.js} +1 -1
  64. package/dist/app/assets/{cose-bilkent-S5V4N54A-BVlJJjjG.js → cose-bilkent-S5V4N54A-C5sw6sBK.js} +1 -1
  65. package/dist/app/assets/{cpp-DrIwjXt4.js → cpp-DGTd--nV.js} +1 -1
  66. package/dist/app/assets/{crystal-B2OownN0.js → crystal-04-7jCUz.js} +1 -1
  67. package/dist/app/assets/{csharp-C8hT9u31.js → csharp-BekrIY2o.js} +1 -1
  68. package/dist/app/assets/{cshtml-Bqk4UcKH.js → cshtml-DRaoghIv.js} +1 -1
  69. package/dist/app/assets/{csp-B23dqIVk.js → csp-9-yRddNx.js} +1 -1
  70. package/dist/app/assets/{css-C7bAsgCD.js → css-CAtlVqs0.js} +1 -1
  71. package/dist/app/assets/{css-extras-BxAj6HIM.js → css-extras-CWVDDT-t.js} +1 -1
  72. package/dist/app/assets/{csv-CITuvdZl.js → csv-Dg-zB1qs.js} +1 -1
  73. package/dist/app/assets/{cypher-BdWaNEPh.js → cypher-4IbDZc8Y.js} +1 -1
  74. package/dist/app/assets/{d-DWzNEoy_.js → d-B7r6CIW_.js} +1 -1
  75. package/dist/app/assets/{dagre-KV5264BT-Cwq32s4A.js → dagre-KV5264BT-Aa6ga6Tg.js} +1 -1
  76. package/dist/app/assets/{dart-Cct8-2Yi.js → dart-33q2tN5Y.js} +1 -1
  77. package/dist/app/assets/{dataweave-sykaGSqb.js → dataweave-_KZXrqme.js} +1 -1
  78. package/dist/app/assets/{dax-CZ69LQsy.js → dax-bZvO9T2D.js} +1 -1
  79. package/dist/app/assets/{dhall-DThgzXZx.js → dhall-CMmS_d1I.js} +1 -1
  80. package/dist/app/assets/{diagram-5BDNPKRD-BfciTHMz.js → diagram-5BDNPKRD-CWOgCaWs.js} +1 -1
  81. package/dist/app/assets/{diagram-G4DWMVQ6-Q37x31io.js → diagram-G4DWMVQ6-pXmi3PKB.js} +1 -1
  82. package/dist/app/assets/{diagram-MMDJMWI5-Cyyx6ZUw.js → diagram-MMDJMWI5-D6L1aAmr.js} +1 -1
  83. package/dist/app/assets/{diagram-TYMM5635-BUh40K6u.js → diagram-TYMM5635-Bnbk8hJL.js} +1 -1
  84. package/dist/app/assets/{diff-UDoi3FBV.js → diff-BMnhXRfO.js} +1 -1
  85. package/dist/app/assets/{django-CUQxRbf9.js → django-CwyRKLji.js} +1 -1
  86. package/dist/app/assets/{dns-zone-file-9UmAuR-l.js → dns-zone-file-CH2YmErm.js} +1 -1
  87. package/dist/app/assets/{docker-vhZ6HugE.js → docker-CMu6fCBm.js} +1 -1
  88. package/dist/app/assets/{dot-Dlao8ZwH.js → dot-DbQdbB35.js} +1 -1
  89. package/dist/app/assets/{ebnf-BfWJycwn.js → ebnf-Dv8o3Xd5.js} +1 -1
  90. package/dist/app/assets/{editorconfig-DsrBDVtJ.js → editorconfig-DGpNYUTF.js} +1 -1
  91. package/dist/app/assets/{eiffel-ZZ7Z0b2_.js → eiffel-DlwnHLpb.js} +1 -1
  92. package/dist/app/assets/{ejs-SLmpmzms.js → ejs-CnitBaIQ.js} +1 -1
  93. package/dist/app/assets/{elixir-BdkxsFt4.js → elixir-BwncS48q.js} +1 -1
  94. package/dist/app/assets/{elm-DSgkBbD-.js → elm-DIeTEpXB.js} +1 -1
  95. package/dist/app/assets/{erDiagram-SMLLAGMA-CKj18meA.js → erDiagram-SMLLAGMA-DCVTOQcd.js} +1 -1
  96. package/dist/app/assets/{erb-AX38416h.js → erb-DLShoXNV.js} +1 -1
  97. package/dist/app/assets/{erlang-DY2BVWMP.js → erlang-CymPR6rz.js} +1 -1
  98. package/dist/app/assets/{etlua-BSaUvZH7.js → etlua-DnGxLY3M.js} +1 -1
  99. package/dist/app/assets/{excel-formula-CGTOeZhB.js → excel-formula-BH7DFVmw.js} +1 -1
  100. package/dist/app/assets/{factor-CtvOHq60.js → factor-Bh-cxy91.js} +1 -1
  101. package/dist/app/assets/{false-C4FtFKhi.js → false-Bbvyie5f.js} +1 -1
  102. package/dist/app/assets/{firestore-security-rules-Z8TPJQpU.js → firestore-security-rules-C1Z4GDy7.js} +1 -1
  103. package/dist/app/assets/{flow-0LSCeVxZ.js → flow-CEb_LmQm.js} +1 -1
  104. package/dist/app/assets/{flowDiagram-DWJPFMVM-CmW1pCPp.js → flowDiagram-DWJPFMVM-t4rWU0cl.js} +1 -1
  105. package/dist/app/assets/{fortran-DR7--sEx.js → fortran-BNasWrrZ.js} +1 -1
  106. package/dist/app/assets/{fsharp-CoiFf2ek.js → fsharp-BsCVJk6E.js} +1 -1
  107. package/dist/app/assets/{ftl-BsfZdglK.js → ftl-jRCUJODD.js} +1 -1
  108. package/dist/app/assets/{ganttDiagram-T4ZO3ILL-C1vWI0vT.js → ganttDiagram-T4ZO3ILL-CIt95e25.js} +1 -1
  109. package/dist/app/assets/{gap-D5rs685K.js → gap-BNZC8mW7.js} +1 -1
  110. package/dist/app/assets/{gcode-ioide_II.js → gcode-Dm32zQCL.js} +1 -1
  111. package/dist/app/assets/{gdscript-C1ZWRkkr.js → gdscript-nnhWLrN6.js} +1 -1
  112. package/dist/app/assets/{gedcom-DS1yKzLz.js → gedcom-CK-ySXEa.js} +1 -1
  113. package/dist/app/assets/{gherkin-uIhE-MbH.js → gherkin--zbB3aYH.js} +1 -1
  114. package/dist/app/assets/{git-B5BRNNT7.js → git-DiWVe3eJ.js} +1 -1
  115. package/dist/app/assets/{gitGraphDiagram-UUTBAWPF-DEg-duQZ.js → gitGraphDiagram-UUTBAWPF-SzhkWrKD.js} +1 -1
  116. package/dist/app/assets/{glsl-B9fhkctz.js → glsl-D1fReIPw.js} +1 -1
  117. package/dist/app/assets/{gml-offEglBU.js → gml-BDyUxEuB.js} +1 -1
  118. package/dist/app/assets/{gn-FZ0bWEld.js → gn-y9O1wUj9.js} +1 -1
  119. package/dist/app/assets/{go-BIRlaT1a.js → go-BluFqfDq.js} +1 -1
  120. package/dist/app/assets/{go-module-SjD6zijS.js → go-module-DZRzQTXf.js} +1 -1
  121. package/dist/app/assets/{graph-sBvKxujm.js → graph-CqvHVXoE.js} +1 -1
  122. package/dist/app/assets/{graphql-Be74WDAY.js → graphql-W2OnfZNH.js} +1 -1
  123. package/dist/app/assets/{groovy-ChbEq3v0.js → groovy-CJ1kbbBa.js} +1 -1
  124. package/dist/app/assets/{haml-C6FObrUo.js → haml-CrhrA9XY.js} +1 -1
  125. package/dist/app/assets/{handlebars-36OFp0YX.js → handlebars-EgGfXI7t.js} +1 -1
  126. package/dist/app/assets/{haskell-DuohgBoX.js → haskell-Bj5MfGGI.js} +1 -1
  127. package/dist/app/assets/{haxe-CNMh78ZV.js → haxe-BdDpk8xR.js} +1 -1
  128. package/dist/app/assets/{hcl-BpxVSY5Z.js → hcl-D9OwvylQ.js} +1 -1
  129. package/dist/app/assets/{hlsl-DnxGKW3m.js → hlsl-562nbzk6.js} +1 -1
  130. package/dist/app/assets/{hoon-XUklDmVn.js → hoon-BqdgVrcr.js} +1 -1
  131. package/dist/app/assets/{hpkp-Did6vsrG.js → hpkp-EH8H3Hom.js} +1 -1
  132. package/dist/app/assets/{hsts-DS9blmxt.js → hsts-QIGmRf78.js} +1 -1
  133. package/dist/app/assets/{http-DA2WLFiQ.js → http-CzfjEVlY.js} +1 -1
  134. package/dist/app/assets/{ichigojam-DdOMt5rE.js → ichigojam-D98a8BcA.js} +1 -1
  135. package/dist/app/assets/{icon-PVJAVx5C.js → icon-DBD-5k6c.js} +1 -1
  136. package/dist/app/assets/{icu-message-format-6jii1RVV.js → icu-message-format-BYT71AMs.js} +1 -1
  137. package/dist/app/assets/{idris-UxX24g1J.js → idris-B7zJwyc1.js} +1 -1
  138. package/dist/app/assets/{iecst-BynNGYT2.js → iecst-SesII_E4.js} +1 -1
  139. package/dist/app/assets/{ignore-4EVq7-cE.js → ignore-B6Rk10df.js} +1 -1
  140. package/dist/app/assets/index-CmKBuFcH.css +1 -0
  141. package/dist/app/assets/{index-CAfb2sup.js → index-DH__JuG8.js} +196 -196
  142. package/dist/app/assets/{infoDiagram-42DDH7IO-BfATVLk8.js → infoDiagram-42DDH7IO-B_FQWO4F.js} +1 -1
  143. package/dist/app/assets/{inform7-BXb820VQ.js → inform7-h2cFjWGx.js} +1 -1
  144. package/dist/app/assets/{ini-Cmr0cBrX.js → ini-BS51ySt6.js} +1 -1
  145. package/dist/app/assets/{io-BdLksOc2.js → io-B4AFlnDh.js} +1 -1
  146. package/dist/app/assets/{ishikawaDiagram-UXIWVN3A-B6I8Yqfq.js → ishikawaDiagram-UXIWVN3A-1rRuzx1s.js} +1 -1
  147. package/dist/app/assets/{j-CAftgdTa.js → j-Drz8g_1M.js} +1 -1
  148. package/dist/app/assets/{java-fwAzePp5.js → java-DCpfLevZ.js} +1 -1
  149. package/dist/app/assets/{javadoc-BcYkNCK0.js → javadoc-DXIzKQcq.js} +1 -1
  150. package/dist/app/assets/{javadoclike-B57hwpBc.js → javadoclike-C8SmsTQv.js} +1 -1
  151. package/dist/app/assets/{javascript-u1gm812-.js → javascript-uumTubEW.js} +1 -1
  152. package/dist/app/assets/{javastacktrace-cj9BHFXH.js → javastacktrace-B-eU9XLD.js} +1 -1
  153. package/dist/app/assets/{jexl-DrO8YpRi.js → jexl-D4977EKW.js} +1 -1
  154. package/dist/app/assets/{jolie-C5CF-EiA.js → jolie-DLawqTad.js} +1 -1
  155. package/dist/app/assets/{journeyDiagram-VCZTEJTY-62Da_9fB.js → journeyDiagram-VCZTEJTY-DrQg892C.js} +1 -1
  156. package/dist/app/assets/{jq-BQS35fYF.js → jq-Cm1vS58Z.js} +1 -1
  157. package/dist/app/assets/{js-extras-Dc8Ge9lP.js → js-extras-RCYpP2to.js} +1 -1
  158. package/dist/app/assets/{js-templates-BChMs7zu.js → js-templates-767pf_M_.js} +1 -1
  159. package/dist/app/assets/{jsdoc-Dsh0OaeE.js → jsdoc-DTvTCxfG.js} +1 -1
  160. package/dist/app/assets/{json-DSLB2HLl.js → json-Dy-V79-1.js} +1 -1
  161. package/dist/app/assets/{json5-cRfUF1uJ.js → json5-BEmUoI2s.js} +1 -1
  162. package/dist/app/assets/{jsonp-DXOWbjE0.js → jsonp-Box0_wdw.js} +1 -1
  163. package/dist/app/assets/{jsstacktrace-DlgtDbr8.js → jsstacktrace-D4k7LJFI.js} +1 -1
  164. package/dist/app/assets/{jsx-CyFeFIQM.js → jsx-UHXI_vWR.js} +1 -1
  165. package/dist/app/assets/{julia-vGoL8D9z.js → julia-DNluswh2.js} +1 -1
  166. package/dist/app/assets/{kanban-definition-6JOO6SKY-JAtH1H2c.js → kanban-definition-6JOO6SKY-DCoBgIKn.js} +1 -1
  167. package/dist/app/assets/{keepalived-u6JnaMHj.js → keepalived-cL1_TOGJ.js} +1 -1
  168. package/dist/app/assets/{keyman-C2x0si7Y.js → keyman-CgmsT3ZD.js} +1 -1
  169. package/dist/app/assets/{kotlin-l8__XfWl.js → kotlin-B-7C62fR.js} +1 -1
  170. package/dist/app/assets/{kumir-CaQaIRBf.js → kumir-BmZSzZs3.js} +1 -1
  171. package/dist/app/assets/{kusto-DYDxqji-.js → kusto-Bd4bditr.js} +1 -1
  172. package/dist/app/assets/{latex-D2qjbQmB.js → latex-B6Yn44p1.js} +1 -1
  173. package/dist/app/assets/{latte-CmbmgbPe.js → latte-D_VkuuMY.js} +1 -1
  174. package/dist/app/assets/{layout-BMTuSUP-.js → layout-CuQBqeJF.js} +1 -1
  175. package/dist/app/assets/{less-DpljErLD.js → less-CNL3ODIy.js} +1 -1
  176. package/dist/app/assets/{lilypond-DAeqUsI_.js → lilypond-Bvambxk4.js} +1 -1
  177. package/dist/app/assets/{linear-CqSIeBnp.js → linear-BFLcIrl3.js} +1 -1
  178. package/dist/app/assets/{liquid-Bo11FNrj.js → liquid-B-rCvqgj.js} +1 -1
  179. package/dist/app/assets/{lisp-BNBGpNSq.js → lisp-DAPeLOCL.js} +1 -1
  180. package/dist/app/assets/{livescript-CNBuUGwr.js → livescript-DhdAKU5C.js} +1 -1
  181. package/dist/app/assets/{llvm-BCQgrmMc.js → llvm-CZUCpwhn.js} +1 -1
  182. package/dist/app/assets/{log-7C67ffIH.js → log-DWq76M48.js} +1 -1
  183. package/dist/app/assets/{lolcode-tyVOf0-i.js → lolcode-Cpeb2C7M.js} +1 -1
  184. package/dist/app/assets/{lua-D1tjiZGJ.js → lua-VuQhfB0e.js} +1 -1
  185. package/dist/app/assets/{magma-DvpErL5E.js → magma-C6-R8Pis.js} +1 -1
  186. package/dist/app/assets/{makefile-DVopM6_I.js → makefile-C8sXNjev.js} +1 -1
  187. package/dist/app/assets/{markdown-zDaJjBqz.js → markdown-Dr_2eVkJ.js} +1 -1
  188. package/dist/app/assets/{markup-Dn7T0Xgl.js → markup-DYRaVR0L.js} +1 -1
  189. package/dist/app/assets/{markup-templating-jmwD3Mv5.js → markup-templating-Clq2Wdtu.js} +1 -1
  190. package/dist/app/assets/{matlab-Dmd8VzKM.js → matlab-N7ULHzkN.js} +1 -1
  191. package/dist/app/assets/{maxscript-FjCyY0j5.js → maxscript-C_UH_c0Y.js} +1 -1
  192. package/dist/app/assets/{mel-BDzXY19C.js → mel-biAclKO6.js} +1 -1
  193. package/dist/app/assets/{mermaid-lu-_cgAH.js → mermaid-cA3X8ng1.js} +1 -1
  194. package/dist/app/assets/{min-DYtuudAi.js → min-DNXX2fdQ.js} +1 -1
  195. package/dist/app/assets/{mindmap-definition-QFDTVHPH-C0LlKYnG.js → mindmap-definition-QFDTVHPH-B3hDdQGV.js} +1 -1
  196. package/dist/app/assets/{mizar-BDWlOEMd.js → mizar-DkeIuoWx.js} +1 -1
  197. package/dist/app/assets/{mongodb-BqhqCTUF.js → mongodb-CZtDL2oy.js} +1 -1
  198. package/dist/app/assets/{monkey-DD_wkxjO.js → monkey-B7rkJ-YN.js} +1 -1
  199. package/dist/app/assets/{moonscript-5BliHqu8.js → moonscript-BrAkE7P-.js} +1 -1
  200. package/dist/app/assets/{n1ql-BI9d8-dk.js → n1ql-CAwurqwa.js} +1 -1
  201. package/dist/app/assets/{n4js-CiGP0jcT.js → n4js-CQMx2F8M.js} +1 -1
  202. package/dist/app/assets/{nand2tetris-hdl-h4B9YPVX.js → nand2tetris-hdl-C_WH3v-f.js} +1 -1
  203. package/dist/app/assets/{naniscript-0FP5ZgNv.js → naniscript-BIg6AoSC.js} +1 -1
  204. package/dist/app/assets/{nasm-CfsxN3sz.js → nasm-JWQkVK3O.js} +1 -1
  205. package/dist/app/assets/{neon-Ds1qWnTS.js → neon-CCu-JZXF.js} +1 -1
  206. package/dist/app/assets/{nevod-CpogMq0t.js → nevod-DQ_tL5xo.js} +1 -1
  207. package/dist/app/assets/{nginx-CBAywKyc.js → nginx-CE0GIB_t.js} +1 -1
  208. package/dist/app/assets/{nim-CKndoR7P.js → nim-BQkGgHx1.js} +1 -1
  209. package/dist/app/assets/{nix-C2aGN04i.js → nix-DjPqNtXA.js} +1 -1
  210. package/dist/app/assets/{nsis-BS2FD5Ui.js → nsis-B0wDo6fc.js} +1 -1
  211. package/dist/app/assets/{objectivec-BV3I8zfq.js → objectivec-BOWTft_L.js} +1 -1
  212. package/dist/app/assets/{ocaml-CumNTZrg.js → ocaml-rGGzL-J8.js} +1 -1
  213. package/dist/app/assets/{opencl-BA7HxeS1.js → opencl-7DwawK0u.js} +1 -1
  214. package/dist/app/assets/{openqasm-CVlYcfEb.js → openqasm-BoZmVcpe.js} +1 -1
  215. package/dist/app/assets/{oz-BgNzyTQm.js → oz-k8zQh74U.js} +1 -1
  216. package/dist/app/assets/{parigp-HAeKHx70.js → parigp-DOF_5XSw.js} +1 -1
  217. package/dist/app/assets/{parser-DBm9W7gH.js → parser-Bn3oD8Fj.js} +1 -1
  218. package/dist/app/assets/{pascal-DVVWX7c3.js → pascal-BMod2MBu.js} +1 -1
  219. package/dist/app/assets/{pascaligo-9sC0JINE.js → pascaligo-VMBK85nU.js} +1 -1
  220. package/dist/app/assets/{pcaxis-BExTG1b5.js → pcaxis-DtO95BO9.js} +1 -1
  221. package/dist/app/assets/{peoplecode-BYMaBssU.js → peoplecode-B6669Uht.js} +1 -1
  222. package/dist/app/assets/{perl-BnEaJyRt.js → perl-BWa2t7hE.js} +1 -1
  223. package/dist/app/assets/{php-DTvaAe6L.js → php-D1EHwdfc.js} +1 -1
  224. package/dist/app/assets/{php-extras-BryvmqOr.js → php-extras-BkzLJdMh.js} +1 -1
  225. package/dist/app/assets/{phpdoc-DNQcJB7n.js → phpdoc-Cjl8GbI3.js} +1 -1
  226. package/dist/app/assets/{pieDiagram-DEJITSTG-CNyUzOEA.js → pieDiagram-DEJITSTG-BOQDZEsp.js} +1 -1
  227. package/dist/app/assets/{plsql-C53Rqwl3.js → plsql-C9d_4ASZ.js} +1 -1
  228. package/dist/app/assets/{powerquery-CBDVLr0E.js → powerquery-B8dvsoEG.js} +1 -1
  229. package/dist/app/assets/{powershell-BTjXHGcn.js → powershell-B_E5Ls3m.js} +1 -1
  230. package/dist/app/assets/{processing-LU1Q4Xrp.js → processing-JtrZ9RaV.js} +1 -1
  231. package/dist/app/assets/{prolog-CAkqp_8e.js → prolog-CqFUVRIw.js} +1 -1
  232. package/dist/app/assets/{promql-qm_oe_qq.js → promql-CAbgJv1n.js} +1 -1
  233. package/dist/app/assets/{properties-CkopXTtp.js → properties-BngV24FT.js} +1 -1
  234. package/dist/app/assets/{protobuf-Y8NjvM3i.js → protobuf-Bi9iRUiu.js} +1 -1
  235. package/dist/app/assets/{psl-C6tOp1_K.js → psl-pDjrt0B9.js} +1 -1
  236. package/dist/app/assets/{pug-CS_9WzOj.js → pug-DioknANs.js} +1 -1
  237. package/dist/app/assets/{puppet-CUp_EgdL.js → puppet-ML2ON0Nh.js} +1 -1
  238. package/dist/app/assets/{pure-Blo1Mo0B.js → pure-DhCM2LcO.js} +1 -1
  239. package/dist/app/assets/{purebasic-Ca8-6hSG.js → purebasic-BBRpNPNK.js} +1 -1
  240. package/dist/app/assets/{purescript-NTJk_TqU.js → purescript-BCyPbnZA.js} +1 -1
  241. package/dist/app/assets/{q-B6Zcp4zx.js → q-AswilSny.js} +1 -1
  242. package/dist/app/assets/{qml-BWFD-5NF.js → qml-CmAUtWqC.js} +1 -1
  243. package/dist/app/assets/{qore-CDatToXb.js → qore-Bv9pFdiR.js} +1 -1
  244. package/dist/app/assets/{qsharp-D7nj5IOf.js → qsharp-48tPx5Mz.js} +1 -1
  245. package/dist/app/assets/{quadrantDiagram-34T5L4WZ-DhG4JpPn.js → quadrantDiagram-34T5L4WZ-xfjbVVZu.js} +1 -1
  246. package/dist/app/assets/{r-B1QI-AqR.js → r-D7-cDDS_.js} +1 -1
  247. package/dist/app/assets/{racket-B4nDtIWF.js → racket-rfJjsp9a.js} +1 -1
  248. package/dist/app/assets/{reason-JWfMNNZ5.js → reason-DBC0zi5i.js} +1 -1
  249. package/dist/app/assets/{regex-CJNXHeEg.js → regex-DnBFBfKd.js} +1 -1
  250. package/dist/app/assets/{rego-LQxbhCWr.js → rego-B4yEjn-8.js} +1 -1
  251. package/dist/app/assets/{renpy-BDFd6l-h.js → renpy-D_4quYLX.js} +1 -1
  252. package/dist/app/assets/{requirementDiagram-MS252O5E-VIZnTHe_.js → requirementDiagram-MS252O5E-ykcp6OKq.js} +1 -1
  253. package/dist/app/assets/{rest-CGwOWaqn.js → rest-DE5aTQbn.js} +1 -1
  254. package/dist/app/assets/{rip-BIv3Yp6n.js → rip-nLkeQy-_.js} +1 -1
  255. package/dist/app/assets/{roboconf-DGg8AzxQ.js → roboconf-fk8WiTzj.js} +1 -1
  256. package/dist/app/assets/{robotframework-Cu4U-LJt.js → robotframework-CT4iaIxT.js} +1 -1
  257. package/dist/app/assets/{ruby-jJNeRq1e.js → ruby-cQyytj4i.js} +1 -1
  258. package/dist/app/assets/{rust-DBMO8o-k.js → rust-CWJm_bSY.js} +1 -1
  259. package/dist/app/assets/{sankeyDiagram-XADWPNL6-D109kLbO.js → sankeyDiagram-XADWPNL6-Bhogh-O-.js} +1 -1
  260. package/dist/app/assets/{sas-BXMgxJ5D.js → sas-DoRGa1wg.js} +1 -1
  261. package/dist/app/assets/{sass-BXkCPsxr.js → sass-LYaBIZKs.js} +1 -1
  262. package/dist/app/assets/{scala-A2dbBlRv.js → scala-BZjhJr8S.js} +1 -1
  263. package/dist/app/assets/{scheme-5YfcUkz6.js → scheme-D01CiDze.js} +1 -1
  264. package/dist/app/assets/{scss-CKQrod7s.js → scss-Da6GwvfN.js} +1 -1
  265. package/dist/app/assets/{sequenceDiagram-FGHM5R23-BWFRA3S4.js → sequenceDiagram-FGHM5R23-ecYbruEX.js} +1 -1
  266. package/dist/app/assets/{shell-session-7xRIeziW.js → shell-session-g6FrqTiP.js} +1 -1
  267. package/dist/app/assets/{smali-Dp3s5TDa.js → smali-BSpX36tk.js} +1 -1
  268. package/dist/app/assets/{smalltalk-Cn6dJ_DR.js → smalltalk-Bq_Gsc0F.js} +1 -1
  269. package/dist/app/assets/{smarty-B62Phcz3.js → smarty-D3fU2RbY.js} +1 -1
  270. package/dist/app/assets/{sml-CRGJcRiK.js → sml-TZkjEgtP.js} +1 -1
  271. package/dist/app/assets/{solidity-CmijFrY5.js → solidity-DLkuvBc2.js} +1 -1
  272. package/dist/app/assets/{solution-file-CMlGbfWf.js → solution-file-BqI5xPXQ.js} +1 -1
  273. package/dist/app/assets/{soy-DfV0L1AX.js → soy-BCG5CQr6.js} +1 -1
  274. package/dist/app/assets/{sparql-UU0JEsJN.js → sparql-DQQsm_l4.js} +1 -1
  275. package/dist/app/assets/{splunk-spl-CoMa2odZ.js → splunk-spl-bY7_uYjh.js} +1 -1
  276. package/dist/app/assets/{sqf-BK0u4w1w.js → sqf-BZo7hu6i.js} +1 -1
  277. package/dist/app/assets/{sql-DNyh2fmD.js → sql-DqFLgmXx.js} +1 -1
  278. package/dist/app/assets/{squirrel-inCt7JHG.js → squirrel-CiX2EfEw.js} +1 -1
  279. package/dist/app/assets/{stan-Doi4GinI.js → stan-CMhpMP7k.js} +1 -1
  280. package/dist/app/assets/{stateDiagram-FHFEXIEX-BrDgd0rD.js → stateDiagram-FHFEXIEX-v9Gsby_c.js} +1 -1
  281. package/dist/app/assets/stateDiagram-v2-QKLJ7IA2-2pX5wx_N.js +1 -0
  282. package/dist/app/assets/{stylus-B--PyNIy.js → stylus-CenUxfuN.js} +1 -1
  283. package/dist/app/assets/{swift-CzynVDjb.js → swift-BVjGHQuG.js} +1 -1
  284. package/dist/app/assets/{systemd-BzRtQaxY.js → systemd-CpOXAdLf.js} +1 -1
  285. package/dist/app/assets/{t4-cs-DRmWJZc9.js → t4-cs-CS9lJ-K0.js} +1 -1
  286. package/dist/app/assets/{t4-templating-DPZ7hNhf.js → t4-templating-hj-TNDsq.js} +1 -1
  287. package/dist/app/assets/{t4-vb-DJ-j33dQ.js → t4-vb-Ck7mu1gJ.js} +1 -1
  288. package/dist/app/assets/{tap-Cxx_PgyE.js → tap-DaH9gaoq.js} +1 -1
  289. package/dist/app/assets/{tcl-Bs4a0Dfs.js → tcl-DNIWr75O.js} +1 -1
  290. package/dist/app/assets/{textile-BoRmwUMy.js → textile-Bv4nPa6s.js} +1 -1
  291. package/dist/app/assets/{timeline-definition-GMOUNBTQ-CzfKhXYm.js → timeline-definition-GMOUNBTQ-D6n0S-ku.js} +1 -1
  292. package/dist/app/assets/{toml-Dt03eQXy.js → toml-DF3HfhqH.js} +1 -1
  293. package/dist/app/assets/{tremor-DAjHRWBi.js → tremor-Bvh1Y6zY.js} +1 -1
  294. package/dist/app/assets/{tt2-BeNFgyN2.js → tt2-Dv5tLBlM.js} +1 -1
  295. package/dist/app/assets/{turtle-BzI8BWIV.js → turtle-DkLAfnik.js} +1 -1
  296. package/dist/app/assets/{twig-Df--35lw.js → twig-S_GHUqZa.js} +1 -1
  297. package/dist/app/assets/{typescript-BAKA2fdq.js → typescript-Cu71LnVi.js} +1 -1
  298. package/dist/app/assets/{typoscript-r0z-RS5y.js → typoscript-CtN4Jy8Z.js} +1 -1
  299. package/dist/app/assets/{unrealscript-dT1dIQam.js → unrealscript-BRjPcrs6.js} +1 -1
  300. package/dist/app/assets/{uorazor-C4wimjxD.js → uorazor-D4ckTG59.js} +1 -1
  301. package/dist/app/assets/{uri-D7oE-PoJ.js → uri-DQCryf4S.js} +1 -1
  302. package/dist/app/assets/{v-DwJtB8Vm.js → v-Bx-_iyUf.js} +1 -1
  303. package/dist/app/assets/{vala-D0mTgP2k.js → vala-C-8psoRf.js} +1 -1
  304. package/dist/app/assets/{vbnet-BJfu6o8X.js → vbnet-Do4mtB7R.js} +1 -1
  305. package/dist/app/assets/{velocity-BJB5m8fQ.js → velocity-Drww5v_3.js} +1 -1
  306. package/dist/app/assets/{vennDiagram-DHZGUBPP-Cgb8-zyn.js → vennDiagram-DHZGUBPP-tW8wVSRe.js} +1 -1
  307. package/dist/app/assets/{verilog-Ci2D8dFC.js → verilog-B8pepi-H.js} +1 -1
  308. package/dist/app/assets/{vhdl-DcEoROdo.js → vhdl-CuO3hi8I.js} +1 -1
  309. package/dist/app/assets/{vim-BzWQ6rL0.js → vim-DSsNung_.js} +1 -1
  310. package/dist/app/assets/{visual-basic-C9jUzYfG.js → visual-basic-CZIqY5t6.js} +1 -1
  311. package/dist/app/assets/{wardley-RL74JXVD-Btw_ODEd.js → wardley-RL74JXVD-D7c8EbFm.js} +1 -1
  312. package/dist/app/assets/{wardleyDiagram-NUSXRM2D-B84YCqkj.js → wardleyDiagram-NUSXRM2D-Br8nJ8eB.js} +1 -1
  313. package/dist/app/assets/{warpscript-BVhze8vt.js → warpscript-DxQu8-1N.js} +1 -1
  314. package/dist/app/assets/{wasm-zAS-bEPo.js → wasm-TvYG9PxF.js} +1 -1
  315. package/dist/app/assets/{web-idl-G3r7q-fK.js → web-idl-Cz41qHgE.js} +1 -1
  316. package/dist/app/assets/{wiki-exG7pUTP.js → wiki-Dpvt1md3.js} +1 -1
  317. package/dist/app/assets/{wolfram-C_Mj1MJG.js → wolfram-Bg7HPXEQ.js} +1 -1
  318. package/dist/app/assets/{wren-CdV44Tnx.js → wren-D5Yecsqj.js} +1 -1
  319. package/dist/app/assets/{xeora-2KKn4X5q.js → xeora-Cg-n24u9.js} +1 -1
  320. package/dist/app/assets/{xml-doc-DLPYHfMi.js → xml-doc-Eti4SXoM.js} +1 -1
  321. package/dist/app/assets/{xojo-B6ggSUBg.js → xojo-DhQBW3jL.js} +1 -1
  322. package/dist/app/assets/{xquery-B2tHFdf8.js → xquery-DrnMYyrL.js} +1 -1
  323. package/dist/app/assets/{xychartDiagram-5P7HB3ND-CWuLJaAz.js → xychartDiagram-5P7HB3ND-D0kV7MNO.js} +1 -1
  324. package/dist/app/assets/{yaml-BkS8H31d.js → yaml-DiOrjhia.js} +1 -1
  325. package/dist/app/assets/{yang-DT_nuuZI.js → yang-B38xE-H2.js} +1 -1
  326. package/dist/app/assets/{zig-B0zYSJvR.js → zig-C7oerdaD.js} +1 -1
  327. package/dist/app/index.html +2 -2
  328. package/dist/index.cjs +952 -431
  329. package/dist/index.js +948 -427
  330. package/package.json +3 -3
  331. package/dist/app/assets/channel-DYgM_zKD.js +0 -1
  332. package/dist/app/assets/classDiagram-6PBFFD2Q-G-7-i5lY.js +0 -1
  333. package/dist/app/assets/classDiagram-v2-HSJHXN6E-G-7-i5lY.js +0 -1
  334. package/dist/app/assets/clone-4Dzzc8I_.js +0 -1
  335. package/dist/app/assets/index-E0F-_Dk8.css +0 -1
  336. package/dist/app/assets/stateDiagram-v2-QKLJ7IA2-DrNQuVcu.js +0 -1
package/dist/index.cjs CHANGED
@@ -67,7 +67,7 @@ __export(index_exports, {
67
67
  module.exports = __toCommonJS(index_exports);
68
68
 
69
69
  // src/components/chat.tsx
70
- var React49 = __toESM(require("react"), 1);
70
+ var React50 = __toESM(require("react"), 1);
71
71
  var import_lucide_react29 = require("lucide-react");
72
72
 
73
73
  // src/lib/utils.ts
@@ -1680,6 +1680,21 @@ var en_US_default = {
1680
1680
  loading: "Loading",
1681
1681
  thinking: "Thinking",
1682
1682
  answering: "Answering",
1683
+ navigation: {
1684
+ label: "Message navigation",
1685
+ system: "System",
1686
+ tool: "Tool",
1687
+ event: "Event",
1688
+ message: "Message",
1689
+ image: "Image",
1690
+ memory: "Memory",
1691
+ widget: "Widget",
1692
+ mcpApp: "MCP App",
1693
+ attachment: "Attachment",
1694
+ reference: "Reference",
1695
+ capability: "Capability",
1696
+ moreTags: "+{{count}}"
1697
+ },
1683
1698
  mcpApp: {
1684
1699
  loading: "Loading MCP App"
1685
1700
  },
@@ -2073,6 +2088,21 @@ var zh_CN_default = {
2073
2088
  loading: "\u6B63\u5728\u52A0\u8F7D",
2074
2089
  thinking: "\u6B63\u5728\u601D\u8003",
2075
2090
  answering: "\u6B63\u5728\u751F\u6210",
2091
+ navigation: {
2092
+ label: "\u6D88\u606F\u5BFC\u822A",
2093
+ system: "\u7CFB\u7EDF",
2094
+ tool: "\u5DE5\u5177",
2095
+ event: "\u4E8B\u4EF6",
2096
+ message: "\u6D88\u606F",
2097
+ image: "\u56FE\u7247",
2098
+ memory: "\u8BB0\u5FC6",
2099
+ widget: "\u7EC4\u4EF6",
2100
+ mcpApp: "MCP App",
2101
+ attachment: "\u9644\u4EF6",
2102
+ reference: "\u5F15\u7528",
2103
+ capability: "\u80FD\u529B",
2104
+ moreTags: "+{{count}}"
2105
+ },
2076
2106
  mcpApp: {
2077
2107
  loading: "\u6B63\u5728\u52A0\u8F7D MCP App"
2078
2108
  },
@@ -13125,10 +13155,179 @@ function AssistantMessage({
13125
13155
  ] });
13126
13156
  }
13127
13157
 
13128
- // src/components/thread/MessageActions.tsx
13158
+ // src/components/thread/MessageNavigator.tsx
13129
13159
  var React37 = __toESM(require("react"), 1);
13130
- var import_lucide_react25 = require("lucide-react");
13131
13160
  var import_jsx_runtime43 = require("react/jsx-runtime");
13161
+ var ACTIVE_OFFSET_PX = 12;
13162
+ function getMarkerWidthClass(index, active, interactionIndex) {
13163
+ if (interactionIndex >= 0) {
13164
+ const distance = Math.abs(index - interactionIndex);
13165
+ if (distance === 0) return "w-7";
13166
+ if (distance === 1) return "w-5";
13167
+ if (distance === 2) return "w-3.5";
13168
+ return "w-2";
13169
+ }
13170
+ return active ? "w-5" : "w-2";
13171
+ }
13172
+ function getAnchorTop(viewport, anchor) {
13173
+ return anchor.offsetTop - viewport.offsetTop;
13174
+ }
13175
+ function resolveActiveItemId(items, viewport, getAnchor) {
13176
+ if (!viewport || items.length === 0) return null;
13177
+ const targetTop = viewport.scrollTop + ACTIVE_OFFSET_PX;
13178
+ let activeId = items[0]?.id ?? null;
13179
+ for (const item of items) {
13180
+ const anchor = getAnchor(item);
13181
+ if (!anchor) continue;
13182
+ if (getAnchorTop(viewport, anchor) <= targetTop) {
13183
+ activeId = item.id;
13184
+ continue;
13185
+ }
13186
+ break;
13187
+ }
13188
+ return activeId;
13189
+ }
13190
+ function scrollToAnchor(viewport, anchor) {
13191
+ const top = Math.max(0, getAnchorTop(viewport, anchor) - ACTIVE_OFFSET_PX);
13192
+ if (typeof viewport.scrollTo === "function") {
13193
+ viewport.scrollTo({ top, behavior: "smooth" });
13194
+ return;
13195
+ }
13196
+ viewport.scrollTop = top;
13197
+ }
13198
+ function MessageNavigator({
13199
+ items,
13200
+ viewportRef,
13201
+ getAnchor,
13202
+ onNavigate,
13203
+ className,
13204
+ label,
13205
+ tagsOverflowLabel
13206
+ }) {
13207
+ const [hoveredId, setHoveredId] = React37.useState(null);
13208
+ const [focusedId, setFocusedId] = React37.useState(null);
13209
+ const [activeId, setActiveId] = React37.useState(null);
13210
+ const updateActiveItem = React37.useCallback(() => {
13211
+ const viewport = viewportRef.current;
13212
+ setActiveId(resolveActiveItemId(items, viewport, getAnchor));
13213
+ }, [getAnchor, items, viewportRef]);
13214
+ React37.useLayoutEffect(() => {
13215
+ updateActiveItem();
13216
+ }, [updateActiveItem]);
13217
+ React37.useEffect(() => {
13218
+ const viewport = viewportRef.current;
13219
+ if (!viewport) return;
13220
+ let frame = null;
13221
+ const scheduleUpdate = () => {
13222
+ if (frame !== null) return;
13223
+ frame = requestAnimationFrame(() => {
13224
+ frame = null;
13225
+ updateActiveItem();
13226
+ });
13227
+ };
13228
+ viewport.addEventListener("scroll", scheduleUpdate, { passive: true });
13229
+ window.addEventListener("resize", scheduleUpdate, { passive: true });
13230
+ const resizeObserver = typeof ResizeObserver !== "undefined" ? new ResizeObserver(scheduleUpdate) : null;
13231
+ resizeObserver?.observe(viewport);
13232
+ return () => {
13233
+ if (frame !== null) {
13234
+ cancelAnimationFrame(frame);
13235
+ }
13236
+ viewport.removeEventListener("scroll", scheduleUpdate);
13237
+ window.removeEventListener("resize", scheduleUpdate);
13238
+ resizeObserver?.disconnect();
13239
+ };
13240
+ }, [updateActiveItem, viewportRef]);
13241
+ const handleNavigate = React37.useCallback(
13242
+ (item) => {
13243
+ const viewport = viewportRef.current;
13244
+ const anchor = getAnchor(item);
13245
+ if (!viewport || !anchor) return;
13246
+ onNavigate?.();
13247
+ scrollToAnchor(viewport, anchor);
13248
+ setActiveId(item.id);
13249
+ },
13250
+ [getAnchor, onNavigate, viewportRef]
13251
+ );
13252
+ if (items.length === 0) return null;
13253
+ const interactionId = focusedId ?? hoveredId;
13254
+ const interactionIndex = interactionId ? items.findIndex((item) => item.id === interactionId) : -1;
13255
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
13256
+ "nav",
13257
+ {
13258
+ "aria-label": label,
13259
+ className: cn(
13260
+ "pointer-events-none sticky top-16 z-20 hidden h-0 w-0 shrink-0 self-start md:block",
13261
+ className
13262
+ ),
13263
+ "data-slot": "chatkit-message-navigator",
13264
+ children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "group/nav relative h-[calc(100vh-9rem)] w-12", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "absolute left-2 top-1/2 flex max-h-full w-10 -translate-y-1/2 flex-col gap-0.5 py-1", children: items.map((item, index) => {
13265
+ const isActive = item.id === activeId;
13266
+ const isPreviewed = item.id === hoveredId || item.id === focusedId;
13267
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "relative h-3.5 w-10 shrink-0", children: [
13268
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
13269
+ "button",
13270
+ {
13271
+ type: "button",
13272
+ "aria-label": `${item.title}: ${item.preview}`,
13273
+ "aria-current": isActive ? "location" : void 0,
13274
+ className: cn(
13275
+ "pointer-events-auto flex h-3.5 w-10 items-center justify-start rounded-sm outline-none",
13276
+ "focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"
13277
+ ),
13278
+ onClick: () => handleNavigate(item),
13279
+ onMouseEnter: () => setHoveredId(item.id),
13280
+ onMouseLeave: () => setHoveredId((id) => id === item.id ? null : id),
13281
+ onFocus: () => setFocusedId(item.id),
13282
+ onBlur: () => setFocusedId((id) => id === item.id ? null : id),
13283
+ children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
13284
+ "span",
13285
+ {
13286
+ className: cn(
13287
+ "block h-0.5 rounded-full bg-muted-foreground/25 transition-all duration-150",
13288
+ getMarkerWidthClass(index, isActive, interactionIndex),
13289
+ isActive && "bg-foreground",
13290
+ isPreviewed && "bg-foreground",
13291
+ interactionIndex >= 0 && !isActive && !isPreviewed && "bg-muted-foreground/35"
13292
+ )
13293
+ }
13294
+ )
13295
+ }
13296
+ ),
13297
+ isPreviewed && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
13298
+ "div",
13299
+ {
13300
+ className: cn(
13301
+ "pointer-events-none absolute left-9 top-1/2 z-30 w-80 max-w-[min(20rem,calc(100vw-6rem))] -translate-y-1/2",
13302
+ "rounded-lg border border-border bg-background/95 p-3 text-left shadow-xl backdrop-blur"
13303
+ ),
13304
+ children: [
13305
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "mb-1 truncate text-sm font-medium text-foreground", children: item.title }),
13306
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "line-clamp-2 text-sm leading-5 text-muted-foreground", children: item.preview }),
13307
+ item.tags.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "mt-2 flex flex-wrap gap-1.5", children: [
13308
+ item.tags.slice(0, 3).map((tag) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
13309
+ "span",
13310
+ {
13311
+ className: "max-w-[8rem] truncate rounded-md bg-muted px-1.5 py-0.5 text-[11px] leading-4 text-muted-foreground",
13312
+ children: tag
13313
+ },
13314
+ tag
13315
+ )),
13316
+ item.tags.length > 3 && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "rounded-md bg-muted px-1.5 py-0.5 text-[11px] leading-4 text-muted-foreground", children: tagsOverflowLabel(item.tags.length - 3) })
13317
+ ] })
13318
+ ]
13319
+ }
13320
+ )
13321
+ ] }, item.id);
13322
+ }) }) })
13323
+ }
13324
+ );
13325
+ }
13326
+
13327
+ // src/components/thread/MessageActions.tsx
13328
+ var React38 = __toESM(require("react"), 1);
13329
+ var import_lucide_react25 = require("lucide-react");
13330
+ var import_jsx_runtime44 = require("react/jsx-runtime");
13132
13331
  function MessageActions({
13133
13332
  content,
13134
13333
  isAssistant = false,
@@ -13137,7 +13336,7 @@ function MessageActions({
13137
13336
  className
13138
13337
  }) {
13139
13338
  const { t } = useChatkitTranslation();
13140
- const [copied, setCopied] = React37.useState(false);
13339
+ const [copied, setCopied] = React38.useState(false);
13141
13340
  const handleCopy = async () => {
13142
13341
  try {
13143
13342
  await navigator.clipboard.writeText(content);
@@ -13150,7 +13349,7 @@ function MessageActions({
13150
13349
  if (isStreaming) {
13151
13350
  return null;
13152
13351
  }
13153
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
13352
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
13154
13353
  "div",
13155
13354
  {
13156
13355
  className: cn(
@@ -13158,7 +13357,7 @@ function MessageActions({
13158
13357
  className
13159
13358
  ),
13160
13359
  children: [
13161
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
13360
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
13162
13361
  "button",
13163
13362
  {
13164
13363
  type: "button",
@@ -13168,17 +13367,17 @@ function MessageActions({
13168
13367
  copied && "text-green-500"
13169
13368
  ),
13170
13369
  title: copied ? t("messageActions.copied") : t("messageActions.copy"),
13171
- children: copied ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react25.Check, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react25.Copy, { size: 14 })
13370
+ children: copied ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react25.Check, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react25.Copy, { size: 14 })
13172
13371
  }
13173
13372
  ),
13174
- isAssistant && onRetry && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
13373
+ isAssistant && onRetry && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
13175
13374
  "button",
13176
13375
  {
13177
13376
  type: "button",
13178
13377
  onClick: onRetry,
13179
13378
  className: "p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",
13180
13379
  title: t("messageActions.regenerate"),
13181
- children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react25.RefreshCw, { size: 14 })
13380
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react25.RefreshCw, { size: 14 })
13182
13381
  }
13183
13382
  )
13184
13383
  ]
@@ -13187,20 +13386,20 @@ function MessageActions({
13187
13386
  }
13188
13387
 
13189
13388
  // src/components/thread/StartScreen.tsx
13190
- var React38 = require("react");
13389
+ var React39 = require("react");
13191
13390
  var import_lucide_react26 = require("lucide-react");
13192
- var import_jsx_runtime44 = require("react/jsx-runtime");
13391
+ var import_jsx_runtime45 = require("react/jsx-runtime");
13193
13392
  function getIconComponent2(icon) {
13194
13393
  const iconMap = {
13195
- "circle-question": /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react26.HelpCircle, { size: 20 }),
13196
- "lightbulb": /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react26.Lightbulb, { size: 20 }),
13197
- "sparkle": /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react26.Sparkles, { size: 20 }),
13198
- "write": /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react26.Pencil, { size: 20 }),
13199
- "search": /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react26.Search, { size: 20 }),
13200
- "globe": /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react26.Globe, { size: 20 }),
13201
- "book-open": /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react26.BookOpen, { size: 20 }),
13202
- "compass": /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react26.Compass, { size: 20 }),
13203
- "bolt": /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react26.Zap, { size: 20 })
13394
+ "circle-question": /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react26.HelpCircle, { size: 20 }),
13395
+ "lightbulb": /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react26.Lightbulb, { size: 20 }),
13396
+ "sparkle": /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react26.Sparkles, { size: 20 }),
13397
+ "write": /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react26.Pencil, { size: 20 }),
13398
+ "search": /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react26.Search, { size: 20 }),
13399
+ "globe": /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react26.Globe, { size: 20 }),
13400
+ "book-open": /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react26.BookOpen, { size: 20 }),
13401
+ "compass": /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react26.Compass, { size: 20 }),
13402
+ "bolt": /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react26.Zap, { size: 20 })
13204
13403
  };
13205
13404
  return icon ? iconMap[icon] || iconMap["sparkle"] : iconMap["sparkle"];
13206
13405
  }
@@ -13216,7 +13415,7 @@ function StartScreen({
13216
13415
  const greeting = startScreen?.greeting ?? t("startScreen.greeting");
13217
13416
  const prompts = startScreen?.prompts ?? [];
13218
13417
  const editPromptLabel = t("startScreen.editPrompt");
13219
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
13418
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
13220
13419
  "div",
13221
13420
  {
13222
13421
  className: cn(
@@ -13224,8 +13423,8 @@ function StartScreen({
13224
13423
  className
13225
13424
  ),
13226
13425
  children: [
13227
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "mb-8 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("h2", { className: "text-2xl font-semibold text-foreground mb-2", children: greeting }) }),
13228
- prompts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "w-full max-w-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: prompts.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
13426
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "mb-8 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("h2", { className: "text-2xl font-semibold text-foreground mb-2", children: greeting }) }),
13427
+ prompts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "w-full max-w-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: prompts.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
13229
13428
  "div",
13230
13429
  {
13231
13430
  className: cn(
@@ -13234,7 +13433,7 @@ function StartScreen({
13234
13433
  "focus-within:ring-2 focus-within:ring-primary/20"
13235
13434
  ),
13236
13435
  children: [
13237
- /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
13436
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
13238
13437
  "button",
13239
13438
  {
13240
13439
  type: "button",
@@ -13245,12 +13444,12 @@ function StartScreen({
13245
13444
  "focus:outline-none disabled:cursor-not-allowed disabled:opacity-50"
13246
13445
  ),
13247
13446
  children: [
13248
- /* @__PURE__ */ (0, import_jsx_runtime44.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) }),
13249
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "text-sm font-medium text-foreground", children: item.label })
13447
+ /* @__PURE__ */ (0, import_jsx_runtime45.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) }),
13448
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "text-sm font-medium text-foreground", children: item.label })
13250
13449
  ]
13251
13450
  }
13252
13451
  ),
13253
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
13452
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
13254
13453
  "button",
13255
13454
  {
13256
13455
  type: "button",
@@ -13263,7 +13462,7 @@ function StartScreen({
13263
13462
  "rounded-r-xl transition-colors hover:bg-muted hover:text-foreground",
13264
13463
  "focus:outline-none disabled:cursor-not-allowed disabled:opacity-50"
13265
13464
  ),
13266
- children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react26.Pencil, { size: 16 })
13465
+ children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react26.Pencil, { size: 16 })
13267
13466
  }
13268
13467
  )
13269
13468
  ]
@@ -13276,7 +13475,7 @@ function StartScreen({
13276
13475
  }
13277
13476
 
13278
13477
  // src/hooks/useThreads.ts
13279
- var React39 = __toESM(require("react"), 1);
13478
+ var React40 = __toESM(require("react"), 1);
13280
13479
  var DEFAULT_LIMIT = 50;
13281
13480
  var getThreadTitle = (threadRecord) => {
13282
13481
  const title = threadRecord.title?.trim();
@@ -13329,16 +13528,16 @@ function useThreads(limit = DEFAULT_LIMIT) {
13329
13528
  isLoading: isStreamLoading,
13330
13529
  error: streamError
13331
13530
  } = useStreamContext();
13332
- const [threadRecords, setThreadRecords] = React39.useState([]);
13333
- const [isLoading, setIsLoading] = React39.useState(false);
13334
- const [error, setError] = React39.useState(null);
13335
- const upsertThreadRecord = React39.useCallback((threadRecord) => {
13531
+ const [threadRecords, setThreadRecords] = React40.useState([]);
13532
+ const [isLoading, setIsLoading] = React40.useState(false);
13533
+ const [error, setError] = React40.useState(null);
13534
+ const upsertThreadRecord = React40.useCallback((threadRecord) => {
13336
13535
  setThreadRecords((prev) => {
13337
13536
  const next = prev.filter((item) => item.id !== threadRecord.id);
13338
13537
  return sortThreadRecords([threadRecord, ...next]);
13339
13538
  });
13340
13539
  }, []);
13341
- const refreshThreads = React39.useCallback(async () => {
13540
+ const refreshThreads = React40.useCallback(async () => {
13342
13541
  setIsLoading(true);
13343
13542
  setError(null);
13344
13543
  try {
@@ -13354,7 +13553,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
13354
13553
  setIsLoading(false);
13355
13554
  }
13356
13555
  }, [client, limit, assistantId]);
13357
- const createThread = React39.useCallback(
13556
+ const createThread = React40.useCallback(
13358
13557
  async (input) => {
13359
13558
  setError(null);
13360
13559
  const payload = {};
@@ -13368,7 +13567,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
13368
13567
  },
13369
13568
  [client, upsertThreadRecord]
13370
13569
  );
13371
- const updateThread = React39.useCallback(
13570
+ const updateThread = React40.useCallback(
13372
13571
  async (recordId, payload) => {
13373
13572
  setError(null);
13374
13573
  const updated = await client.conversations.update(recordId, payload);
@@ -13377,7 +13576,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
13377
13576
  },
13378
13577
  [client, upsertThreadRecord]
13379
13578
  );
13380
- const deleteThread = React39.useCallback(
13579
+ const deleteThread = React40.useCallback(
13381
13580
  async (recordId) => {
13382
13581
  setError(null);
13383
13582
  await client.conversations.delete(recordId);
@@ -13385,11 +13584,11 @@ function useThreads(limit = DEFAULT_LIMIT) {
13385
13584
  },
13386
13585
  [client]
13387
13586
  );
13388
- React39.useEffect(() => {
13587
+ React40.useEffect(() => {
13389
13588
  if (!isReady) return;
13390
13589
  void refreshThreads();
13391
13590
  }, [refreshThreads, isReady]);
13392
- React39.useEffect(() => {
13591
+ React40.useEffect(() => {
13393
13592
  if (!threadId || !isStreamLoading) return;
13394
13593
  const now = (/* @__PURE__ */ new Date()).toISOString();
13395
13594
  const busyStatus = "busy";
@@ -13410,7 +13609,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
13410
13609
  return changed ? sortThreadRecords(next) : prev;
13411
13610
  });
13412
13611
  }, [threadId, isStreamLoading]);
13413
- React39.useEffect(() => {
13612
+ React40.useEffect(() => {
13414
13613
  const message = getErrorMessage2(streamError)?.trim();
13415
13614
  if (!threadId || !message) return;
13416
13615
  const now = (/* @__PURE__ */ new Date()).toISOString();
@@ -13432,7 +13631,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
13432
13631
  return changed ? sortThreadRecords(next) : prev;
13433
13632
  });
13434
13633
  }, [threadId, streamError]);
13435
- React39.useEffect(() => {
13634
+ React40.useEffect(() => {
13436
13635
  if (!isReady || !threadId || isStreamLoading) return;
13437
13636
  let cancelled = false;
13438
13637
  void client.conversations.search({ where: { threadId }, limit: 1 }).then((result) => {
@@ -13446,7 +13645,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
13446
13645
  cancelled = true;
13447
13646
  };
13448
13647
  }, [client, threadId, upsertThreadRecord, isReady, isStreamLoading]);
13449
- const threads = React39.useMemo(
13648
+ const threads = React40.useMemo(
13450
13649
  () => threadRecords.map((threadRecord) => toThreadItem(threadRecord)),
13451
13650
  [threadRecords]
13452
13651
  );
@@ -13463,10 +13662,10 @@ function useThreads(limit = DEFAULT_LIMIT) {
13463
13662
  }
13464
13663
 
13465
13664
  // src/components/thread/context-usage-indicator.tsx
13466
- var React40 = __toESM(require("react"), 1);
13665
+ var React41 = __toESM(require("react"), 1);
13467
13666
 
13468
13667
  // src/components/ui/progress-circle.tsx
13469
- var import_jsx_runtime45 = (
13668
+ var import_jsx_runtime46 = (
13470
13669
  // biome-ignore lint/a11y/useFocusableInteractive: false positive (progress + progressbar are not focusable interactives)
13471
13670
  // biome-ignore lint/nursery/useAriaPropsSupportedByRole: biome rule at odds with mdn docs (presumed nursary bug with rule)
13472
13671
  require("react/jsx-runtime")
@@ -13490,7 +13689,7 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
13490
13689
  fill: "none",
13491
13690
  strokeWidth
13492
13691
  };
13493
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
13692
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
13494
13693
  "svg",
13495
13694
  {
13496
13695
  role: "progressbar",
@@ -13501,8 +13700,8 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
13501
13700
  "aria-valuemax": 100,
13502
13701
  ...restSvgProps,
13503
13702
  children: [
13504
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("circle", { ...commonParams, className: "stroke-current/25" }),
13505
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
13703
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("circle", { ...commonParams, className: "stroke-current/25" }),
13704
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
13506
13705
  "circle",
13507
13706
  {
13508
13707
  ...commonParams,
@@ -13520,7 +13719,7 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
13520
13719
  };
13521
13720
 
13522
13721
  // src/components/thread/context-usage-indicator.tsx
13523
- var import_jsx_runtime46 = require("react/jsx-runtime");
13722
+ var import_jsx_runtime47 = require("react/jsx-runtime");
13524
13723
  var kNumberFormatter = new Intl.NumberFormat("en-US", {
13525
13724
  minimumFractionDigits: 0,
13526
13725
  maximumFractionDigits: 1
@@ -13553,21 +13752,21 @@ function ContextUsageIndicator({
13553
13752
  }) {
13554
13753
  const { t } = useChatkitTranslation();
13555
13754
  const stream = useStreamContext();
13556
- const [maxContextSize, setMaxContextSize] = React40.useState(null);
13557
- const [usedContextSize, setUsedContextSize] = React40.useState(null);
13558
- const [assistantAgentKey, setAssistantAgentKey] = React40.useState(null);
13559
- const latestRealtimeUsageRef = React40.useRef({
13755
+ const [maxContextSize, setMaxContextSize] = React41.useState(null);
13756
+ const [usedContextSize, setUsedContextSize] = React41.useState(null);
13757
+ const [assistantAgentKey, setAssistantAgentKey] = React41.useState(null);
13758
+ const latestRealtimeUsageRef = React41.useRef({
13560
13759
  threadId: null,
13561
13760
  agentKey: null,
13562
13761
  usedTokens: null
13563
13762
  });
13564
- const realtimeUsage = React40.useMemo(
13763
+ const realtimeUsage = React41.useMemo(
13565
13764
  () => getThreadContextUsage(stream.contextUsageByAgentKey, assistantAgentKey),
13566
13765
  [assistantAgentKey, stream.contextUsageByAgentKey]
13567
13766
  );
13568
13767
  const realtimeUsedContextSize = getThreadContextUsageTotalTokens(realtimeUsage);
13569
13768
  const hasApiConfiguration = Boolean(stream.apiUrl?.trim() && stream.apiKey?.trim());
13570
- React40.useEffect(() => {
13769
+ React41.useEffect(() => {
13571
13770
  if (!hasApiConfiguration || !stream.client || !stream.assistantId) {
13572
13771
  setMaxContextSize(null);
13573
13772
  setAssistantAgentKey(null);
@@ -13587,18 +13786,18 @@ function ContextUsageIndicator({
13587
13786
  cancelled = true;
13588
13787
  };
13589
13788
  }, [hasApiConfiguration, stream.client, stream.assistantId]);
13590
- React40.useEffect(() => {
13789
+ React41.useEffect(() => {
13591
13790
  latestRealtimeUsageRef.current = {
13592
13791
  threadId: stream.threadId ?? null,
13593
13792
  agentKey: assistantAgentKey,
13594
13793
  usedTokens: realtimeUsedContextSize
13595
13794
  };
13596
13795
  }, [assistantAgentKey, realtimeUsedContextSize, stream.threadId]);
13597
- React40.useEffect(() => {
13796
+ React41.useEffect(() => {
13598
13797
  if (realtimeUsedContextSize == null) return;
13599
13798
  setUsedContextSize(realtimeUsedContextSize);
13600
13799
  }, [realtimeUsedContextSize]);
13601
- React40.useEffect(() => {
13800
+ React41.useEffect(() => {
13602
13801
  if (!hasApiConfiguration || !stream.client) {
13603
13802
  setUsedContextSize(null);
13604
13803
  return;
@@ -13664,8 +13863,8 @@ function ContextUsageIndicator({
13664
13863
  });
13665
13864
  const usageLabelWithSuffix = usageLabel.endsWith(":") ? usageLabel : `${usageLabel}:`;
13666
13865
  const progressClassName = percent >= 90 ? "text-destructive" : percent >= 75 ? "text-amber-500" : "text-primary dark:text-zinc-300";
13667
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Tooltip, { children: [
13668
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
13866
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Tooltip, { children: [
13867
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
13669
13868
  "button",
13670
13869
  {
13671
13870
  type: "button",
@@ -13674,31 +13873,31 @@ function ContextUsageIndicator({
13674
13873
  className
13675
13874
  ),
13676
13875
  "aria-label": `${usageLabelWithSuffix} ${usageFullLabel}. ${usageTokensLabel}`,
13677
- children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ProgressCircle, { value: percent, className: cn("size-3.5", progressClassName) })
13876
+ children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ProgressCircle, { value: percent, className: cn("size-3.5", progressClassName) })
13678
13877
  }
13679
13878
  ) }),
13680
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(TooltipContent, { side: "top", sideOffset: 6, className: "space-y-0.5 px-3 py-2 text-center", children: [
13681
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "text-primary-foreground/70", children: usageLabelWithSuffix }),
13682
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "font-medium text-primary-foreground/80", children: usageFullLabel }),
13683
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "text-sm font-semibold", children: usageTokensLabel })
13879
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(TooltipContent, { side: "top", sideOffset: 6, className: "space-y-0.5 px-3 py-2 text-center", children: [
13880
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "text-primary-foreground/70", children: usageLabelWithSuffix }),
13881
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "font-medium text-primary-foreground/80", children: usageFullLabel }),
13882
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "text-sm font-semibold", children: usageTokensLabel })
13684
13883
  ] })
13685
13884
  ] });
13686
13885
  }
13687
13886
 
13688
13887
  // src/components/pet/PetBridge.tsx
13689
- var React41 = __toESM(require("react"), 1);
13888
+ var React42 = __toESM(require("react"), 1);
13690
13889
  var import_chatkit_types10 = require("@xpert-ai/chatkit-types");
13691
13890
  function PetBridge({ pet, state }) {
13692
13891
  const parentMessenger = useParentMessenger();
13693
13892
  const sendEvent = parentMessenger?.sendEvent;
13694
- const options = React41.useMemo(() => (0, import_chatkit_types10.normalizePetOptions)(pet), [pet]);
13695
- React41.useEffect(() => {
13893
+ const options = React42.useMemo(() => (0, import_chatkit_types10.normalizePetOptions)(pet), [pet]);
13894
+ React42.useEffect(() => {
13696
13895
  if (!sendEvent) {
13697
13896
  return;
13698
13897
  }
13699
13898
  sendEvent("pet_options_change", { pet: pet ?? null });
13700
13899
  }, [sendEvent, pet]);
13701
- React41.useEffect(() => {
13900
+ React42.useEffect(() => {
13702
13901
  if (!sendEvent || !options) {
13703
13902
  return;
13704
13903
  }
@@ -13708,15 +13907,15 @@ function PetBridge({ pet, state }) {
13708
13907
  }
13709
13908
 
13710
13909
  // src/components/settings/SettingsSheet.tsx
13711
- var React48 = __toESM(require("react"), 1);
13910
+ var React49 = __toESM(require("react"), 1);
13712
13911
  var import_lucide_react28 = require("lucide-react");
13713
13912
 
13714
13913
  // src/components/ui/input.tsx
13715
- var React42 = __toESM(require("react"), 1);
13716
- var import_jsx_runtime47 = require("react/jsx-runtime");
13717
- var Input = React42.forwardRef(
13914
+ var React43 = __toESM(require("react"), 1);
13915
+ var import_jsx_runtime48 = require("react/jsx-runtime");
13916
+ var Input = React43.forwardRef(
13718
13917
  ({ className, type, ...props }, ref) => {
13719
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
13918
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
13720
13919
  "input",
13721
13920
  {
13722
13921
  ref,
@@ -13733,20 +13932,20 @@ var Input = React42.forwardRef(
13733
13932
  Input.displayName = "Input";
13734
13933
 
13735
13934
  // src/components/ui/select.tsx
13736
- var React43 = require("react");
13935
+ var React44 = require("react");
13737
13936
  var import_radix_ui2 = require("radix-ui");
13738
13937
  var import_lucide_react27 = require("lucide-react");
13739
- var import_jsx_runtime48 = require("react/jsx-runtime");
13938
+ var import_jsx_runtime49 = require("react/jsx-runtime");
13740
13939
  function Select({
13741
13940
  ...props
13742
13941
  }) {
13743
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_radix_ui2.Select.Root, { "data-slot": "select", ...props });
13942
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_radix_ui2.Select.Root, { "data-slot": "select", ...props });
13744
13943
  }
13745
13944
  function SelectGroup({
13746
13945
  className,
13747
13946
  ...props
13748
13947
  }) {
13749
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
13948
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
13750
13949
  import_radix_ui2.Select.Group,
13751
13950
  {
13752
13951
  "data-slot": "select-group",
@@ -13758,7 +13957,7 @@ function SelectGroup({
13758
13957
  function SelectValue({
13759
13958
  ...props
13760
13959
  }) {
13761
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_radix_ui2.Select.Value, { "data-slot": "select-value", ...props });
13960
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_radix_ui2.Select.Value, { "data-slot": "select-value", ...props });
13762
13961
  }
13763
13962
  function SelectTrigger({
13764
13963
  className,
@@ -13766,7 +13965,7 @@ function SelectTrigger({
13766
13965
  children,
13767
13966
  ...props
13768
13967
  }) {
13769
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
13968
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
13770
13969
  import_radix_ui2.Select.Trigger,
13771
13970
  {
13772
13971
  "data-slot": "select-trigger",
@@ -13778,7 +13977,7 @@ function SelectTrigger({
13778
13977
  ...props,
13779
13978
  children: [
13780
13979
  children,
13781
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_radix_ui2.Select.Icon, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react27.ChevronDownIcon, { className: "pointer-events-none size-4 text-muted-foreground" }) })
13980
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_radix_ui2.Select.Icon, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react27.ChevronDownIcon, { className: "pointer-events-none size-4 text-muted-foreground" }) })
13782
13981
  ]
13783
13982
  }
13784
13983
  );
@@ -13790,7 +13989,7 @@ function SelectContent({
13790
13989
  align = "center",
13791
13990
  ...props
13792
13991
  }) {
13793
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_radix_ui2.Select.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
13992
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_radix_ui2.Select.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
13794
13993
  import_radix_ui2.Select.Content,
13795
13994
  {
13796
13995
  "data-slot": "select-content",
@@ -13800,8 +13999,8 @@ function SelectContent({
13800
13999
  align,
13801
14000
  ...props,
13802
14001
  children: [
13803
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SelectScrollUpButton, {}),
13804
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14002
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SelectScrollUpButton, {}),
14003
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
13805
14004
  import_radix_ui2.Select.Viewport,
13806
14005
  {
13807
14006
  "data-position": position,
@@ -13812,7 +14011,7 @@ function SelectContent({
13812
14011
  children
13813
14012
  }
13814
14013
  ),
13815
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SelectScrollDownButton, {})
14014
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SelectScrollDownButton, {})
13816
14015
  ]
13817
14016
  }
13818
14017
  ) });
@@ -13822,7 +14021,7 @@ function SelectItem({
13822
14021
  children,
13823
14022
  ...props
13824
14023
  }) {
13825
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
14024
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
13826
14025
  import_radix_ui2.Select.Item,
13827
14026
  {
13828
14027
  "data-slot": "select-item",
@@ -13832,8 +14031,8 @@ function SelectItem({
13832
14031
  ),
13833
14032
  ...props,
13834
14033
  children: [
13835
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_radix_ui2.Select.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react27.CheckIcon, { className: "pointer-events-none" }) }) }),
13836
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_radix_ui2.Select.ItemText, { children })
14034
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_radix_ui2.Select.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react27.CheckIcon, { className: "pointer-events-none" }) }) }),
14035
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_radix_ui2.Select.ItemText, { children })
13837
14036
  ]
13838
14037
  }
13839
14038
  );
@@ -13842,7 +14041,7 @@ function SelectScrollUpButton({
13842
14041
  className,
13843
14042
  ...props
13844
14043
  }) {
13845
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14044
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
13846
14045
  import_radix_ui2.Select.ScrollUpButton,
13847
14046
  {
13848
14047
  "data-slot": "select-scroll-up-button",
@@ -13851,7 +14050,7 @@ function SelectScrollUpButton({
13851
14050
  className
13852
14051
  ),
13853
14052
  ...props,
13854
- children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14053
+ children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
13855
14054
  import_lucide_react27.ChevronUpIcon,
13856
14055
  {}
13857
14056
  )
@@ -13862,7 +14061,7 @@ function SelectScrollDownButton({
13862
14061
  className,
13863
14062
  ...props
13864
14063
  }) {
13865
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14064
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
13866
14065
  import_radix_ui2.Select.ScrollDownButton,
13867
14066
  {
13868
14067
  "data-slot": "select-scroll-down-button",
@@ -13871,7 +14070,7 @@ function SelectScrollDownButton({
13871
14070
  className
13872
14071
  ),
13873
14072
  ...props,
13874
- children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14073
+ children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
13875
14074
  import_lucide_react27.ChevronDownIcon,
13876
14075
  {}
13877
14076
  )
@@ -13880,9 +14079,9 @@ function SelectScrollDownButton({
13880
14079
  }
13881
14080
 
13882
14081
  // src/components/ui/slider.tsx
13883
- var React44 = __toESM(require("react"), 1);
14082
+ var React45 = __toESM(require("react"), 1);
13884
14083
  var import_radix_ui3 = require("radix-ui");
13885
- var import_jsx_runtime49 = require("react/jsx-runtime");
14084
+ var import_jsx_runtime50 = require("react/jsx-runtime");
13886
14085
  function Slider({
13887
14086
  className,
13888
14087
  defaultValue,
@@ -13891,11 +14090,11 @@ function Slider({
13891
14090
  max = 100,
13892
14091
  ...props
13893
14092
  }) {
13894
- const _values = React44.useMemo(
14093
+ const _values = React45.useMemo(
13895
14094
  () => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
13896
14095
  [value, defaultValue, min, max]
13897
14096
  );
13898
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
14097
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
13899
14098
  import_radix_ui3.Slider.Root,
13900
14099
  {
13901
14100
  "data-slot": "slider",
@@ -13909,12 +14108,12 @@ function Slider({
13909
14108
  ),
13910
14109
  ...props,
13911
14110
  children: [
13912
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
14111
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
13913
14112
  import_radix_ui3.Slider.Track,
13914
14113
  {
13915
14114
  "data-slot": "slider-track",
13916
14115
  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",
13917
- children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
14116
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
13918
14117
  import_radix_ui3.Slider.Range,
13919
14118
  {
13920
14119
  "data-slot": "slider-range",
@@ -13923,7 +14122,7 @@ function Slider({
13923
14122
  )
13924
14123
  }
13925
14124
  ),
13926
- Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
14125
+ Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
13927
14126
  import_radix_ui3.Slider.Thumb,
13928
14127
  {
13929
14128
  "data-slot": "slider-thumb",
@@ -13937,15 +14136,15 @@ function Slider({
13937
14136
  }
13938
14137
 
13939
14138
  // src/components/ui/toggle-group.tsx
13940
- var React46 = __toESM(require("react"), 1);
14139
+ var React47 = __toESM(require("react"), 1);
13941
14140
  var import_class_variance_authority3 = require("class-variance-authority");
13942
14141
  var import_radix_ui5 = require("radix-ui");
13943
14142
 
13944
14143
  // src/components/ui/toggle.tsx
13945
- var React45 = require("react");
14144
+ var React46 = require("react");
13946
14145
  var import_class_variance_authority2 = require("class-variance-authority");
13947
14146
  var import_radix_ui4 = require("radix-ui");
13948
- var import_jsx_runtime50 = require("react/jsx-runtime");
14147
+ var import_jsx_runtime51 = require("react/jsx-runtime");
13949
14148
  var toggleVariants = (0, import_class_variance_authority2.cva)(
13950
14149
  "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",
13951
14150
  {
@@ -13968,8 +14167,8 @@ var toggleVariants = (0, import_class_variance_authority2.cva)(
13968
14167
  );
13969
14168
 
13970
14169
  // src/components/ui/toggle-group.tsx
13971
- var import_jsx_runtime51 = require("react/jsx-runtime");
13972
- var ToggleGroupContext = React46.createContext({
14170
+ var import_jsx_runtime52 = require("react/jsx-runtime");
14171
+ var ToggleGroupContext = React47.createContext({
13973
14172
  size: "default",
13974
14173
  variant: "default",
13975
14174
  spacing: 0,
@@ -13984,7 +14183,7 @@ function ToggleGroup({
13984
14183
  children,
13985
14184
  ...props
13986
14185
  }) {
13987
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
14186
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
13988
14187
  import_radix_ui5.ToggleGroup.Root,
13989
14188
  {
13990
14189
  "data-slot": "toggle-group",
@@ -13998,7 +14197,7 @@ function ToggleGroup({
13998
14197
  className
13999
14198
  ),
14000
14199
  ...props,
14001
- children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
14200
+ children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
14002
14201
  ToggleGroupContext.Provider,
14003
14202
  {
14004
14203
  value: { variant, size: size2, spacing, orientation },
@@ -14015,8 +14214,8 @@ function ToggleGroupItem({
14015
14214
  size: size2 = "default",
14016
14215
  ...props
14017
14216
  }) {
14018
- const context = React46.useContext(ToggleGroupContext);
14019
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
14217
+ const context = React47.useContext(ToggleGroupContext);
14218
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
14020
14219
  import_radix_ui5.ToggleGroup.Item,
14021
14220
  {
14022
14221
  "data-slot": "toggle-group-item",
@@ -14246,13 +14445,13 @@ function isPetEnabled(pet) {
14246
14445
  }
14247
14446
 
14248
14447
  // src/components/pet/PetPreview.tsx
14249
- var React47 = require("react");
14448
+ var React48 = require("react");
14250
14449
 
14251
14450
  // src/components/pet/petSpriteAtlas.ts
14252
14451
  var import_chatkit_types12 = require("@xpert-ai/chatkit-types");
14253
14452
 
14254
14453
  // src/components/pet/PetPreview.tsx
14255
- var import_jsx_runtime52 = require("react/jsx-runtime");
14454
+ var import_jsx_runtime53 = require("react/jsx-runtime");
14256
14455
  function escapeCssUrl(value) {
14257
14456
  return value.replace(/["\\]/g, "\\$&");
14258
14457
  }
@@ -14260,7 +14459,7 @@ function PetPreview({ src, label, className }) {
14260
14459
  const scale = 0.13;
14261
14460
  const width = import_chatkit_types12.petSpriteAtlas.cellWidth;
14262
14461
  const height = import_chatkit_types12.petSpriteAtlas.cellHeight;
14263
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
14462
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
14264
14463
  "span",
14265
14464
  {
14266
14465
  className: cn(
@@ -14269,7 +14468,7 @@ function PetPreview({ src, label, className }) {
14269
14468
  ),
14270
14469
  "aria-hidden": "true",
14271
14470
  title: label,
14272
- children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
14471
+ children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
14273
14472
  "span",
14274
14473
  {
14275
14474
  className: "absolute left-1/2 top-1/2 block",
@@ -14291,7 +14490,7 @@ function PetPreview({ src, label, className }) {
14291
14490
  }
14292
14491
 
14293
14492
  // src/components/settings/SettingsSheet.tsx
14294
- var import_jsx_runtime53 = require("react/jsx-runtime");
14493
+ var import_jsx_runtime54 = require("react/jsx-runtime");
14295
14494
  var CHARACTER_TYPES2 = [
14296
14495
  "builtin",
14297
14496
  "atlas"
@@ -14307,13 +14506,13 @@ function SettingsSheet({
14307
14506
  onSave
14308
14507
  }) {
14309
14508
  const { t } = useChatkitTranslation();
14310
- const [draft, setDraft] = React48.useState(settings);
14311
- React48.useEffect(() => {
14509
+ const [draft, setDraft] = React49.useState(settings);
14510
+ React49.useEffect(() => {
14312
14511
  if (open) {
14313
14512
  setDraft(petRequired ? { ...settings, enabled: true } : settings);
14314
14513
  }
14315
14514
  }, [open, petRequired, settings]);
14316
- const updateDraft = React48.useCallback(
14515
+ const updateDraft = React49.useCallback(
14317
14516
  (patch) => {
14318
14517
  setDraft((previous) => ({ ...previous, ...patch }));
14319
14518
  },
@@ -14331,23 +14530,23 @@ function SettingsSheet({
14331
14530
  defaultValue: selectedBuiltinPet.label
14332
14531
  }
14333
14532
  );
14334
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Sheet, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(SheetContent, { side: "right", className: "w-[min(92vw,26rem)] overflow-y-auto", children: [
14335
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SheetHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex items-center gap-2", children: [
14336
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "flex h-8 w-8 items-center justify-center rounded-md bg-primary/10 text-primary", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react28.Settings, { size: 16 }) }),
14337
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SheetTitle, { children: t("settings.title") })
14533
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Sheet, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(SheetContent, { side: "right", className: "w-[min(92vw,26rem)] overflow-y-auto", children: [
14534
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SheetHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center gap-2", children: [
14535
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "flex h-8 w-8 items-center justify-center rounded-md bg-primary/10 text-primary", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react28.Settings, { size: 16 }) }),
14536
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SheetTitle, { children: t("settings.title") })
14338
14537
  ] }) }),
14339
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("form", { className: "mt-6 space-y-5", onSubmit: handleSubmit, children: [
14340
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("section", { className: "space-y-5", children: [
14341
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex items-center gap-2", children: [
14342
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "flex h-7 w-7 items-center justify-center rounded-md bg-muted text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react28.PawPrint, { size: 15 }) }),
14343
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("h3", { className: "text-sm font-semibold", children: t("pet.settings.title") })
14538
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("form", { className: "mt-6 space-y-5", onSubmit: handleSubmit, children: [
14539
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("section", { className: "space-y-5", children: [
14540
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center gap-2", children: [
14541
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "flex h-7 w-7 items-center justify-center rounded-md bg-muted text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react28.PawPrint, { size: 15 }) }),
14542
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("h3", { className: "text-sm font-semibold", children: t("pet.settings.title") })
14344
14543
  ] }),
14345
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("label", { className: "flex items-center justify-between gap-4 rounded-md border border-border px-3 py-2", children: [
14346
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("span", { className: "min-w-0", children: [
14347
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "block text-sm font-medium", children: t("pet.settings.enabled") }),
14348
- petRequired && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "mt-0.5 block text-xs text-muted-foreground", children: t("pet.settings.requiredHint") })
14544
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("label", { className: "flex items-center justify-between gap-4 rounded-md border border-border px-3 py-2", children: [
14545
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { className: "min-w-0", children: [
14546
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "block text-sm font-medium", children: t("pet.settings.enabled") }),
14547
+ petRequired && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "mt-0.5 block text-xs text-muted-foreground", children: t("pet.settings.requiredHint") })
14349
14548
  ] }),
14350
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
14549
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
14351
14550
  "button",
14352
14551
  {
14353
14552
  type: "button",
@@ -14360,7 +14559,7 @@ function SettingsSheet({
14360
14559
  draft.enabled ? "bg-primary" : "bg-muted-foreground/20",
14361
14560
  petRequired ? "cursor-not-allowed opacity-70" : ""
14362
14561
  ].join(" "),
14363
- children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
14562
+ children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
14364
14563
  "span",
14365
14564
  {
14366
14565
  className: [
@@ -14373,9 +14572,9 @@ function SettingsSheet({
14373
14572
  )
14374
14573
  ] })
14375
14574
  ] }),
14376
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "space-y-2", children: [
14377
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { id: "chatkit-pet-type-label", className: "text-sm font-medium", children: t("pet.settings.characterType") }),
14378
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
14575
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "space-y-2", children: [
14576
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { id: "chatkit-pet-type-label", className: "text-sm font-medium", children: t("pet.settings.characterType") }),
14577
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
14379
14578
  ToggleGroup,
14380
14579
  {
14381
14580
  id: "chatkit-pet-type",
@@ -14390,7 +14589,7 @@ function SettingsSheet({
14390
14589
  variant: "outline",
14391
14590
  spacing: 2,
14392
14591
  className: "!w-full",
14393
- children: CHARACTER_TYPES2.map((type) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
14592
+ children: CHARACTER_TYPES2.map((type) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
14394
14593
  ToggleGroupItem,
14395
14594
  {
14396
14595
  value: type,
@@ -14402,8 +14601,8 @@ function SettingsSheet({
14402
14601
  }
14403
14602
  )
14404
14603
  ] }),
14405
- draft.characterType === "builtin" && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "space-y-2", children: [
14406
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
14604
+ draft.characterType === "builtin" && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "space-y-2", children: [
14605
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
14407
14606
  "label",
14408
14607
  {
14409
14608
  htmlFor: "chatkit-pet-builtin",
@@ -14411,7 +14610,7 @@ function SettingsSheet({
14411
14610
  children: t("pet.settings.builtin")
14412
14611
  }
14413
14612
  ),
14414
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
14613
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
14415
14614
  Select,
14416
14615
  {
14417
14616
  value: selectedBuiltinPet.id,
@@ -14422,26 +14621,26 @@ function SettingsSheet({
14422
14621
  }
14423
14622
  },
14424
14623
  children: [
14425
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
14624
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
14426
14625
  SelectTrigger,
14427
14626
  {
14428
14627
  id: "chatkit-pet-builtin",
14429
14628
  className: "min-h-12 w-full px-3 py-2",
14430
- children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SelectValue, { placeholder: selectedBuiltinPetLabel })
14629
+ children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectValue, { placeholder: selectedBuiltinPetLabel })
14431
14630
  }
14432
14631
  ),
14433
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SelectContent, { className: "w-[var(--radix-select-trigger-width)]", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SelectGroup, { children: INCLUDED_PET_OPTIONS.map((pet) => {
14632
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectContent, { className: "w-[var(--radix-select-trigger-width)]", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectGroup, { children: INCLUDED_PET_OPTIONS.map((pet) => {
14434
14633
  const label = t(`pet.settings.builtins.${pet.id}`, {
14435
14634
  defaultValue: pet.label
14436
14635
  });
14437
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
14636
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
14438
14637
  SelectItem,
14439
14638
  {
14440
14639
  value: pet.id,
14441
14640
  className: "min-h-10 py-1.5 pl-2 pr-8",
14442
- children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("span", { className: "flex min-w-0 items-center gap-2", children: [
14443
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(PetPreview, { src: pet.previewSrc, label }),
14444
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "min-w-0 truncate", children: label })
14641
+ children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { className: "flex min-w-0 items-center gap-2", children: [
14642
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(PetPreview, { src: pet.previewSrc, label }),
14643
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "min-w-0 truncate", children: label })
14445
14644
  ] })
14446
14645
  },
14447
14646
  pet.id
@@ -14451,8 +14650,8 @@ function SettingsSheet({
14451
14650
  }
14452
14651
  )
14453
14652
  ] }),
14454
- draft.characterType === "atlas" && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "space-y-2", children: [
14455
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
14653
+ draft.characterType === "atlas" && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "space-y-2", children: [
14654
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
14456
14655
  "label",
14457
14656
  {
14458
14657
  className: "text-sm font-medium",
@@ -14460,7 +14659,7 @@ function SettingsSheet({
14460
14659
  children: t("pet.settings.atlasUrl")
14461
14660
  }
14462
14661
  ),
14463
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
14662
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
14464
14663
  Input,
14465
14664
  {
14466
14665
  id: "chatkit-pet-atlas",
@@ -14470,15 +14669,15 @@ function SettingsSheet({
14470
14669
  }
14471
14670
  )
14472
14671
  ] }),
14473
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "space-y-2", children: [
14474
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
14475
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("label", { className: "text-sm font-medium", htmlFor: "chatkit-pet-scale", children: t("pet.settings.scale") }),
14476
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("span", { className: "text-xs tabular-nums text-muted-foreground", children: [
14672
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "space-y-2", children: [
14673
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
14674
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("label", { className: "text-sm font-medium", htmlFor: "chatkit-pet-scale", children: t("pet.settings.scale") }),
14675
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { className: "text-xs tabular-nums text-muted-foreground", children: [
14477
14676
  draft.scale.toFixed(2),
14478
14677
  "x"
14479
14678
  ] })
14480
14679
  ] }),
14481
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
14680
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
14482
14681
  Slider,
14483
14682
  {
14484
14683
  id: "chatkit-pet-scale",
@@ -14492,8 +14691,8 @@ function SettingsSheet({
14492
14691
  }
14493
14692
  )
14494
14693
  ] }),
14495
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("label", { className: "flex items-center gap-2 text-sm", children: [
14496
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
14694
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("label", { className: "flex items-center gap-2 text-sm", children: [
14695
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
14497
14696
  "input",
14498
14697
  {
14499
14698
  type: "checkbox",
@@ -14504,8 +14703,8 @@ function SettingsSheet({
14504
14703
  ),
14505
14704
  t("pet.settings.draggable")
14506
14705
  ] }),
14507
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("label", { className: "flex items-center gap-2 text-sm", children: [
14508
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
14706
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("label", { className: "flex items-center gap-2 text-sm", children: [
14707
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
14509
14708
  "input",
14510
14709
  {
14511
14710
  type: "checkbox",
@@ -14516,8 +14715,8 @@ function SettingsSheet({
14516
14715
  ),
14517
14716
  t("pet.settings.persistPosition")
14518
14717
  ] }),
14519
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex justify-end gap-2 pt-2", children: [
14520
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
14718
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex justify-end gap-2 pt-2", children: [
14719
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
14521
14720
  Button,
14522
14721
  {
14523
14722
  type: "button",
@@ -14526,7 +14725,7 @@ function SettingsSheet({
14526
14725
  children: t("pet.settings.cancel")
14527
14726
  }
14528
14727
  ),
14529
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Button, { type: "submit", children: t("pet.settings.save") })
14728
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Button, { type: "submit", children: t("pet.settings.save") })
14530
14729
  ] })
14531
14730
  ] })
14532
14731
  ] }) });
@@ -15152,8 +15351,260 @@ function findDomPointForComposerOffset(root, offset) {
15152
15351
  return result ?? { node: lastNode, offset: lastOffset };
15153
15352
  }
15154
15353
 
15354
+ // src/lib/message-navigation.ts
15355
+ var MESSAGE_NAVIGATION_MIN_ITEMS = 3;
15356
+ var MAX_PREVIEW_LENGTH = 180;
15357
+ var MAX_TAG_LENGTH = 40;
15358
+ function isRecord6(value) {
15359
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
15360
+ }
15361
+ function readString4(value) {
15362
+ return typeof value === "string" && value.trim() ? value.trim() : null;
15363
+ }
15364
+ function normalizeWhitespace(value) {
15365
+ return value.replace(/\s+/g, " ").trim();
15366
+ }
15367
+ function truncate(value, maxLength) {
15368
+ const normalized = normalizeWhitespace(value);
15369
+ if (normalized.length <= maxLength) return normalized;
15370
+ return `${normalized.slice(0, Math.max(0, maxLength - 1)).trimEnd()}...`;
15371
+ }
15372
+ function pushText(draft, value) {
15373
+ const text = readString4(value);
15374
+ if (text) draft.text.push(text);
15375
+ }
15376
+ function pushTag(draft, value) {
15377
+ const tag = readString4(value);
15378
+ if (!tag) return;
15379
+ const normalized = truncate(tag, MAX_TAG_LENGTH);
15380
+ if (!draft.tags.includes(normalized)) {
15381
+ draft.tags.push(normalized);
15382
+ }
15383
+ }
15384
+ function mergeTags(...tagGroups) {
15385
+ const tags = [];
15386
+ for (const group of tagGroups) {
15387
+ for (const tag of group) {
15388
+ if (!tags.includes(tag)) tags.push(tag);
15389
+ }
15390
+ }
15391
+ return tags;
15392
+ }
15393
+ function getMessageNavigationItemId(message, index) {
15394
+ const messageId = readString4(message.id);
15395
+ if (messageId) return messageId;
15396
+ const type = readString4(message.type) ?? "message";
15397
+ return `${type}-${index}`;
15398
+ }
15399
+ function getMessageNavigationRole(type) {
15400
+ const normalized = readString4(type)?.toLowerCase();
15401
+ if (normalized === "human" || normalized === "user") return "user";
15402
+ if (normalized === "ai" || normalized === "assistant") return "assistant";
15403
+ if (normalized === "system") return "system";
15404
+ if (normalized === "tool") return "tool";
15405
+ if (normalized === "event") return "event";
15406
+ return "message";
15407
+ }
15408
+ function isTextContent4(content) {
15409
+ return content.type === "text";
15410
+ }
15411
+ function isReasoningContent4(content) {
15412
+ return content.type === "reasoning";
15413
+ }
15414
+ function isComponentContent4(content) {
15415
+ return content.type === "component";
15416
+ }
15417
+ function isMemoryContent2(content) {
15418
+ return content.type === "memory";
15419
+ }
15420
+ function isWidgetComponent3(content) {
15421
+ const data = content.data;
15422
+ return data?.type === "Widget" && Array.isArray(data.widgets);
15423
+ }
15424
+ function isMcpAppComponent2(content) {
15425
+ const data = content.data;
15426
+ return data?.type === "McpApp" && typeof data.appInstanceId === "string";
15427
+ }
15428
+ function collectWidgetContent(draft, content, labels) {
15429
+ const names = content.data.widgets.map((widget) => readString4(widget.name)).filter((name) => Boolean(name));
15430
+ if (names.length === 0) {
15431
+ pushTag(draft, labels.widget);
15432
+ return;
15433
+ }
15434
+ for (const name of names) {
15435
+ pushTag(draft, name);
15436
+ }
15437
+ }
15438
+ function collectMcpAppContent(draft, content, labels, language) {
15439
+ const title = readString4((0, import_chatkit_types6.resolveLocalizedText)(content.data.title, language)) ?? readString4(content.data.toolName) ?? labels.mcpApp;
15440
+ pushTag(draft, title);
15441
+ pushText(draft, (0, import_chatkit_types6.resolveLocalizedText)(content.data.description, language));
15442
+ }
15443
+ function collectComponentContent(draft, content, labels, language, options) {
15444
+ if (isWidgetComponent3(content)) {
15445
+ collectWidgetContent(draft, content, labels);
15446
+ return;
15447
+ }
15448
+ if (isMcpAppComponent2(content)) {
15449
+ collectMcpAppContent(draft, content, labels, language);
15450
+ return;
15451
+ }
15452
+ const data = getToolStepData(content);
15453
+ pushTag(
15454
+ draft,
15455
+ (0, import_chatkit_types6.resolveLocalizedText)(data.message, language) ?? getToolActivityLabel(content, language)
15456
+ );
15457
+ if (options.includeComponentText !== false) {
15458
+ pushText(draft, (0, import_chatkit_types6.resolveLocalizedText)(data.message, language));
15459
+ pushText(draft, (0, import_chatkit_types6.resolveLocalizedText)(data.title, language));
15460
+ pushText(draft, (0, import_chatkit_types6.resolveLocalizedText)(data.tool, language));
15461
+ pushText(draft, (0, import_chatkit_types6.resolveLocalizedText)(data.type, language));
15462
+ }
15463
+ }
15464
+ function collectContentItem(draft, item, labels, language, options) {
15465
+ if (item === void 0 || isThreadContextUsageRenderArtifact(item)) return;
15466
+ if (typeof item === "string") {
15467
+ pushText(draft, item);
15468
+ return;
15469
+ }
15470
+ if (isTextContent4(item) || isReasoningContent4(item)) {
15471
+ pushText(draft, item.text);
15472
+ if (isReasoningContent4(item)) pushTag(draft, labels.reasoning);
15473
+ return;
15474
+ }
15475
+ if (item.type === "image_url") {
15476
+ pushTag(draft, labels.image);
15477
+ return;
15478
+ }
15479
+ if (isComponentContent4(item)) {
15480
+ collectComponentContent(draft, item, labels, language, options);
15481
+ return;
15482
+ }
15483
+ if (isMemoryContent2(item)) {
15484
+ pushTag(draft, labels.memory);
15485
+ }
15486
+ }
15487
+ function collectContent(draft, content, labels, language, options = {}) {
15488
+ if (typeof content === "string") {
15489
+ pushText(draft, content);
15490
+ return;
15491
+ }
15492
+ if (!Array.isArray(content)) {
15493
+ return;
15494
+ }
15495
+ for (const item of content) {
15496
+ collectContentItem(
15497
+ draft,
15498
+ item,
15499
+ labels,
15500
+ language,
15501
+ options
15502
+ );
15503
+ }
15504
+ }
15505
+ function collectReasoning(draft, reasoning, labels) {
15506
+ if (!Array.isArray(reasoning)) return;
15507
+ for (const item of reasoning) {
15508
+ if (!isRecord6(item)) continue;
15509
+ pushText(draft, item.text);
15510
+ if (readString4(item.text)) pushTag(draft, labels.reasoning);
15511
+ }
15512
+ }
15513
+ function collectFiles(draft, value, fallbackLabel) {
15514
+ if (!Array.isArray(value)) return;
15515
+ for (const file of value) {
15516
+ if (!isRecord6(file)) continue;
15517
+ pushTag(
15518
+ draft,
15519
+ file.originalName ?? file.name ?? file.fileName ?? file.id ?? fallbackLabel
15520
+ );
15521
+ }
15522
+ }
15523
+ function collectReferences(draft, value) {
15524
+ for (const reference of normalizeReferences(value)) {
15525
+ pushTag(draft, getReferenceLabel(reference));
15526
+ }
15527
+ }
15528
+ function collectRuntimeCapabilities(draft, value) {
15529
+ if (!Array.isArray(value)) return;
15530
+ for (const option of value) {
15531
+ if (!isRecord6(option)) continue;
15532
+ pushTag(draft, option.label ?? option.id ?? option.type);
15533
+ }
15534
+ }
15535
+ function getTitle(role, labels, assistantTitle) {
15536
+ if (role === "assistant" && assistantTitle?.trim()) {
15537
+ return assistantTitle.trim();
15538
+ }
15539
+ return labels[role];
15540
+ }
15541
+ function buildMessageNavigationItemSummary(message, index, options, collectOptions = {}) {
15542
+ const role = getMessageNavigationRole(message.type);
15543
+ const draft = {
15544
+ text: [],
15545
+ tags: []
15546
+ };
15547
+ const language = options.language ?? "en-US";
15548
+ const labels = options.labels;
15549
+ if (role === "user") {
15550
+ pushText(draft, message.submittedInput);
15551
+ }
15552
+ collectContent(draft, message.content, labels, language, collectOptions);
15553
+ collectReasoning(draft, message.reasoning, labels);
15554
+ collectFiles(draft, message.fileAssets, labels.attachment);
15555
+ collectFiles(draft, message.attachments, labels.attachment);
15556
+ collectReferences(draft, message.references);
15557
+ collectRuntimeCapabilities(draft, message.runtimeCapabilityOptions);
15558
+ const text = draft.text.map(normalizeWhitespace).filter(Boolean).join(" ");
15559
+ const preview = truncate(text, MAX_PREVIEW_LENGTH) || draft.tags.slice(0, 2).join(" \xB7 ");
15560
+ if (!preview && draft.tags.length === 0) {
15561
+ return null;
15562
+ }
15563
+ const messageId = readString4(message.id) ?? void 0;
15564
+ return {
15565
+ id: getMessageNavigationItemId(message, index),
15566
+ ...messageId ? { messageId } : {},
15567
+ index,
15568
+ role,
15569
+ title: getTitle(role, labels, options.assistantTitle),
15570
+ preview,
15571
+ tags: draft.tags
15572
+ };
15573
+ }
15574
+ function buildMessageNavigationItems(messages, options) {
15575
+ const items = [];
15576
+ let pendingUser = null;
15577
+ messages.forEach((message, messageIndex) => {
15578
+ const item = buildMessageNavigationItemSummary(
15579
+ message,
15580
+ messageIndex,
15581
+ options,
15582
+ { includeComponentText: false }
15583
+ );
15584
+ if (!item) return;
15585
+ if (item.role === "user") {
15586
+ pendingUser = { item };
15587
+ return;
15588
+ }
15589
+ if (item.role !== "assistant" || !pendingUser) {
15590
+ return;
15591
+ }
15592
+ items.push({
15593
+ id: pendingUser.item.id,
15594
+ ...pendingUser.item.messageId ? { messageId: pendingUser.item.messageId } : {},
15595
+ index: items.length,
15596
+ role: "user",
15597
+ title: pendingUser.item.preview,
15598
+ preview: item.preview,
15599
+ tags: mergeTags(item.tags, pendingUser.item.tags)
15600
+ });
15601
+ pendingUser = null;
15602
+ });
15603
+ return items;
15604
+ }
15605
+
15155
15606
  // src/components/chat.tsx
15156
- var import_jsx_runtime54 = require("react/jsx-runtime");
15607
+ var import_jsx_runtime55 = require("react/jsx-runtime");
15157
15608
  var import_meta2 = {};
15158
15609
  var defaultApiUrl2 = import_meta2.env.VITE_XPERTAI_API_URL;
15159
15610
  var COMPOSER_INPUT_MAX_HEIGHT = 128;
@@ -15299,7 +15750,7 @@ function ReferenceChip({
15299
15750
  const metaLine = getReferenceMetaLine(reference);
15300
15751
  const isComposer = variant === "composer";
15301
15752
  const Icon = reference.type === "quote" ? import_lucide_react29.Quote : reference.type === "image" ? import_lucide_react29.ImageIcon : import_lucide_react29.FileText;
15302
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
15753
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
15303
15754
  "div",
15304
15755
  {
15305
15756
  className: cn(
@@ -15308,7 +15759,7 @@ function ReferenceChip({
15308
15759
  ),
15309
15760
  title: getReferenceTitle(reference),
15310
15761
  children: [
15311
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
15762
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
15312
15763
  Icon,
15313
15764
  {
15314
15765
  size: isComposer ? 14 : 12,
@@ -15318,8 +15769,8 @@ function ReferenceChip({
15318
15769
  )
15319
15770
  }
15320
15771
  ),
15321
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "min-w-0 flex-1", children: [
15322
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
15772
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "min-w-0 flex-1", children: [
15773
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
15323
15774
  "div",
15324
15775
  {
15325
15776
  className: cn(
@@ -15329,7 +15780,7 @@ function ReferenceChip({
15329
15780
  children: getReferenceLabel(reference)
15330
15781
  }
15331
15782
  ),
15332
- metaLine && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
15783
+ metaLine && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
15333
15784
  "div",
15334
15785
  {
15335
15786
  className: cn(
@@ -15340,7 +15791,7 @@ function ReferenceChip({
15340
15791
  }
15341
15792
  )
15342
15793
  ] }),
15343
- onRemove && removeLabel && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
15794
+ onRemove && removeLabel && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
15344
15795
  "button",
15345
15796
  {
15346
15797
  type: "button",
@@ -15351,7 +15802,7 @@ function ReferenceChip({
15351
15802
  ),
15352
15803
  title: removeLabel,
15353
15804
  "aria-label": removeLabel,
15354
- children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react29.X, { size: 12 })
15805
+ children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react29.X, { size: 12 })
15355
15806
  }
15356
15807
  )
15357
15808
  ]
@@ -15366,35 +15817,36 @@ function Chat({
15366
15817
  clientSecret = "",
15367
15818
  isClientSecretInitializing = false
15368
15819
  }) {
15369
- const { t } = useChatkitTranslation();
15820
+ const { t, i18n: i18n2 } = useChatkitTranslation();
15370
15821
  const composer = options?.composer;
15371
15822
  const startScreen = options?.startScreen;
15372
15823
  const history = options?.history;
15373
15824
  const disclaimer = options?.disclaimer;
15374
15825
  const apiUrl = options?.api?.apiUrl || defaultApiUrl2;
15826
+ const messageNavigationEnabled = options?.messageNavigation?.enabled !== false;
15375
15827
  const { setStream } = useStreamManager();
15376
15828
  const stream = useStreamContext();
15377
15829
  const { theme } = useTheme();
15378
- const [isHistoryLoading, setIsHistoryLoading] = React49.useState(false);
15379
- const [historyError, setHistoryError] = React49.useState(null);
15380
- const [assistantName, setAssistantName] = React49.useState(null);
15381
- const [assistantAvatar, setAssistantAvatar] = React49.useState(null);
15382
- const [threadGoal, setThreadGoal] = React49.useState(null);
15383
- const [goalError, setGoalError] = React49.useState(null);
15384
- const [isGoalLoading, setIsGoalLoading] = React49.useState(false);
15385
- const [isGoalPanelOpen, setIsGoalPanelOpen] = React49.useState(false);
15386
- const [isGoalObjectiveExpanded, setIsGoalObjectiveExpanded] = React49.useState(false);
15387
- const [goalElapsedStartedAt, setGoalElapsedStartedAt] = React49.useState(null);
15830
+ const [isHistoryLoading, setIsHistoryLoading] = React50.useState(false);
15831
+ const [historyError, setHistoryError] = React50.useState(null);
15832
+ const [assistantName, setAssistantName] = React50.useState(null);
15833
+ const [assistantAvatar, setAssistantAvatar] = React50.useState(null);
15834
+ const [threadGoal, setThreadGoal] = React50.useState(null);
15835
+ const [goalError, setGoalError] = React50.useState(null);
15836
+ const [isGoalLoading, setIsGoalLoading] = React50.useState(false);
15837
+ const [isGoalPanelOpen, setIsGoalPanelOpen] = React50.useState(false);
15838
+ const [isGoalObjectiveExpanded, setIsGoalObjectiveExpanded] = React50.useState(false);
15839
+ const [goalElapsedStartedAt, setGoalElapsedStartedAt] = React50.useState(null);
15388
15840
  const LOADING_DOTS_MIN_DURATION = 800;
15389
15841
  const STREAMING_STATUS_REFRESH_MS = 250;
15390
- const [showLoadingDots, setShowLoadingDots] = React49.useState(false);
15391
- const [streamingNow, setStreamingNow] = React49.useState(() => Date.now());
15392
- const loadingStartTimeRef = React49.useRef(null);
15393
- const lastStreamOutputAtRef = React49.useRef(null);
15394
- React49.useEffect(() => {
15842
+ const [showLoadingDots, setShowLoadingDots] = React50.useState(false);
15843
+ const [streamingNow, setStreamingNow] = React50.useState(() => Date.now());
15844
+ const loadingStartTimeRef = React50.useRef(null);
15845
+ const lastStreamOutputAtRef = React50.useRef(null);
15846
+ React50.useEffect(() => {
15395
15847
  setStream(stream);
15396
15848
  }, [setStream, stream]);
15397
- React49.useEffect(() => {
15849
+ React50.useEffect(() => {
15398
15850
  if (stream.isLoading) {
15399
15851
  if (!loadingStartTimeRef.current) {
15400
15852
  loadingStartTimeRef.current = Date.now();
@@ -15417,7 +15869,7 @@ function Chat({
15417
15869
  }
15418
15870
  }
15419
15871
  }, [stream.isLoading]);
15420
- React49.useEffect(() => {
15872
+ React50.useEffect(() => {
15421
15873
  if (!stream.isLoading) {
15422
15874
  lastStreamOutputAtRef.current = null;
15423
15875
  setStreamingNow(Date.now());
@@ -15427,7 +15879,7 @@ function Chat({
15427
15879
  lastStreamOutputAtRef.current = now;
15428
15880
  setStreamingNow(now);
15429
15881
  }, [stream.messages, stream.isLoading]);
15430
- React49.useEffect(() => {
15882
+ React50.useEffect(() => {
15431
15883
  if (!stream.isLoading) {
15432
15884
  return;
15433
15885
  }
@@ -15436,7 +15888,7 @@ function Chat({
15436
15888
  }, STREAMING_STATUS_REFRESH_MS);
15437
15889
  return () => window.clearInterval(timer);
15438
15890
  }, [stream.isLoading]);
15439
- React49.useEffect(() => {
15891
+ React50.useEffect(() => {
15440
15892
  if (threadGoal?.status === "active" && stream.isLoading) {
15441
15893
  setGoalElapsedStartedAt(Date.now());
15442
15894
  return;
@@ -15448,82 +15900,86 @@ function Chat({
15448
15900
  threadGoal?.id,
15449
15901
  threadGoal?.status
15450
15902
  ]);
15451
- React49.useEffect(() => {
15903
+ React50.useEffect(() => {
15452
15904
  setIsGoalObjectiveExpanded(false);
15453
15905
  }, [threadGoal?.id]);
15454
- const [composerParts, setComposerParts] = React49.useState([]);
15455
- const [renderedComposerParts, setRenderedComposerParts] = React49.useState([]);
15456
- const [composerDomVersion, setComposerDomVersion] = React49.useState(0);
15457
- const [selectedTool, setSelectedTool] = React49.useState(
15906
+ const [composerParts, setComposerParts] = React50.useState([]);
15907
+ const [renderedComposerParts, setRenderedComposerParts] = React50.useState([]);
15908
+ const [composerDomVersion, setComposerDomVersion] = React50.useState(0);
15909
+ const [selectedTool, setSelectedTool] = React50.useState(
15458
15910
  null
15459
15911
  );
15460
- const [planModeEnabled, setPlanModeEnabled] = React49.useState(false);
15461
- const [petSettingsOpen, setPetSettingsOpen] = React49.useState(false);
15462
- const [petLocalSettings, setPetLocalSettings] = React49.useState(() => readPetLocalSettings());
15463
- const [runtimeCapabilities, setRuntimeCapabilities] = React49.useState(null);
15464
- const [runtimeCapabilitiesReady, setRuntimeCapabilitiesReady] = React49.useState(false);
15465
- const [sessionRuntimeCapabilities, setSessionRuntimeCapabilities] = React49.useState(
15912
+ const [planModeEnabled, setPlanModeEnabled] = React50.useState(false);
15913
+ const [petSettingsOpen, setPetSettingsOpen] = React50.useState(false);
15914
+ const [petLocalSettings, setPetLocalSettings] = React50.useState(() => readPetLocalSettings());
15915
+ const [runtimeCapabilities, setRuntimeCapabilities] = React50.useState(null);
15916
+ const [runtimeCapabilitiesReady, setRuntimeCapabilitiesReady] = React50.useState(false);
15917
+ const [sessionRuntimeCapabilities, setSessionRuntimeCapabilities] = React50.useState(
15466
15918
  () => createEmptyRuntimeCapabilitiesSelection()
15467
15919
  );
15468
- const [runRuntimeCapabilities, setRunRuntimeCapabilities] = React49.useState(
15920
+ const [runRuntimeCapabilities, setRunRuntimeCapabilities] = React50.useState(
15469
15921
  () => createEmptyRuntimeCapabilitiesSelection()
15470
15922
  );
15471
- const [runtimeCapabilityPalette, setRuntimeCapabilityPalette] = React49.useState(null);
15472
- const [attachmentState, setAttachmentState] = React49.useState({
15923
+ const [runtimeCapabilityPalette, setRuntimeCapabilityPalette] = React50.useState(null);
15924
+ const [attachmentState, setAttachmentState] = React50.useState({
15473
15925
  uploadedFiles: [],
15474
15926
  hasUploadingFiles: false,
15475
15927
  hasParsingFiles: false
15476
15928
  });
15477
- const [references, setReferences] = React49.useState([]);
15478
- const [isUploadingReferenceImages, setIsUploadingReferenceImages] = React49.useState(false);
15479
- const [quoteSelection, setQuoteSelection] = React49.useState(null);
15480
- const [isAtBottom, setIsAtBottom] = React49.useState(true);
15481
- const [hasUpdatesBelow, setHasUpdatesBelow] = React49.useState(false);
15929
+ const [references, setReferences] = React50.useState([]);
15930
+ const [isUploadingReferenceImages, setIsUploadingReferenceImages] = React50.useState(false);
15931
+ const [quoteSelection, setQuoteSelection] = React50.useState(null);
15932
+ const [isAtBottom, setIsAtBottom] = React50.useState(true);
15933
+ const [hasUpdatesBelow, setHasUpdatesBelow] = React50.useState(false);
15482
15934
  const {
15483
15935
  threads,
15484
15936
  deleteThread,
15485
15937
  refreshThreads,
15486
15938
  isLoading: isThreadsLoading
15487
15939
  } = useThreads();
15488
- const viewportRef = React49.useRef(null);
15489
- const attachmentsRef = React49.useRef(null);
15490
- const composerInputRef = React49.useRef(null);
15491
- const slashPaletteRef = React49.useRef(null);
15492
- const slashPaletteOptionRefs = React49.useRef(
15940
+ const viewportRef = React50.useRef(null);
15941
+ const messageNavigationAnchorsRef = React50.useRef(
15942
+ /* @__PURE__ */ new Map()
15943
+ );
15944
+ const attachmentsRef = React50.useRef(null);
15945
+ const composerInputRef = React50.useRef(null);
15946
+ const slashPaletteRef = React50.useRef(null);
15947
+ const slashPaletteOptionRefs = React50.useRef(
15493
15948
  []
15494
15949
  );
15495
- const composerPartsRef = React49.useRef([]);
15496
- const pendingComposerCaretOffsetRef = React49.useRef(null);
15497
- const shouldAutoScrollRef = React49.useRef(true);
15498
- const forceFollowRef = React49.useRef(false);
15499
- const previousMessageCountRef = React49.useRef(0);
15500
- const previousScrollTopRef = React49.useRef(0);
15501
- const isPrependingHistoryMessagesRef = React49.useRef(false);
15502
- const autoScrollFrameRef = React49.useRef(null);
15503
- const isPointerDownRef = React49.useRef(false);
15504
- const lastTouchYRef = React49.useRef(null);
15505
- const runtimeCapabilityPreferenceLoadRef = React49.useRef(0);
15950
+ const composerPartsRef = React50.useRef([]);
15951
+ const pendingComposerCaretOffsetRef = React50.useRef(null);
15952
+ const shouldAutoScrollRef = React50.useRef(true);
15953
+ const forceFollowRef = React50.useRef(false);
15954
+ const previousMessageCountRef = React50.useRef(0);
15955
+ const previousScrollTopRef = React50.useRef(0);
15956
+ const isPrependingHistoryMessagesRef = React50.useRef(false);
15957
+ const autoScrollFrameRef = React50.useRef(null);
15958
+ const isPointerDownRef = React50.useRef(false);
15959
+ const lastTouchYRef = React50.useRef(null);
15960
+ const runtimeCapabilityPreferenceLoadRef = React50.useRef(0);
15506
15961
  const resolvedTitle = title ?? t("chat.title");
15507
15962
  const resolvedPlaceholder = placeholder ?? t("chat.placeholder");
15963
+ const assistantTitle = assistantName || resolvedTitle;
15508
15964
  const petRequired = options?.displayMode === "pet";
15509
- const basePetSettings = React49.useMemo(
15965
+ const basePetSettings = React50.useMemo(
15510
15966
  () => derivePetLocalSettings(options?.pet),
15511
15967
  [options?.pet]
15512
15968
  );
15513
- const displayedPetSettings = React49.useMemo(
15969
+ const displayedPetSettings = React50.useMemo(
15514
15970
  () => ({
15515
15971
  ...petLocalSettings ?? basePetSettings,
15516
15972
  ...petRequired ? { enabled: true } : {}
15517
15973
  }),
15518
15974
  [basePetSettings, petLocalSettings, petRequired]
15519
15975
  );
15520
- const effectivePet = React49.useMemo(() => {
15976
+ const effectivePet = React50.useMemo(() => {
15521
15977
  if (petRequired || petLocalSettings) {
15522
15978
  return buildPetOptionsFromLocalSettings(displayedPetSettings);
15523
15979
  }
15524
15980
  return options?.pet ?? null;
15525
15981
  }, [displayedPetSettings, options?.pet, petLocalSettings, petRequired]);
15526
- const savePetLocalSettings = React49.useCallback(
15982
+ const savePetLocalSettings = React50.useCallback(
15527
15983
  (settings) => {
15528
15984
  const nextSettings = petRequired ? { ...settings, enabled: true } : settings;
15529
15985
  setPetLocalSettings(nextSettings);
@@ -15531,7 +15987,7 @@ function Chat({
15531
15987
  },
15532
15988
  [petRequired]
15533
15989
  );
15534
- const handlePetCommand = React49.useCallback(
15990
+ const handlePetCommand = React50.useCallback(
15535
15991
  (mode) => {
15536
15992
  if (mode === "settings") {
15537
15993
  setPetSettingsOpen(true);
@@ -15553,16 +16009,53 @@ function Chat({
15553
16009
  [displayedPetSettings, effectivePet, petRequired, savePetLocalSettings]
15554
16010
  );
15555
16011
  const inputPlaceholder = selectedTool?.placeholderOverride ?? composer?.placeholder ?? resolvedPlaceholder;
15556
- const messages = React49.useMemo(
16012
+ const messages = React50.useMemo(
15557
16013
  () => stream.messages ?? [],
15558
16014
  [stream.messages]
15559
16015
  );
16016
+ const messageNavigationLabels = React50.useMemo(
16017
+ () => ({
16018
+ user: t("chat.youLabel"),
16019
+ assistant: assistantTitle,
16020
+ system: t("message.navigation.system"),
16021
+ tool: t("message.navigation.tool"),
16022
+ event: t("message.navigation.event"),
16023
+ message: t("message.navigation.message"),
16024
+ image: t("message.navigation.image"),
16025
+ memory: t("message.navigation.memory"),
16026
+ widget: t("message.navigation.widget"),
16027
+ mcpApp: t("message.navigation.mcpApp"),
16028
+ attachment: t("message.navigation.attachment"),
16029
+ reference: t("message.navigation.reference"),
16030
+ capability: t("message.navigation.capability"),
16031
+ reasoning: t("message.reasoning")
16032
+ }),
16033
+ [assistantTitle, t]
16034
+ );
16035
+ const messageNavigationItems = React50.useMemo(
16036
+ () => messageNavigationEnabled ? buildMessageNavigationItems(
16037
+ messages,
16038
+ {
16039
+ labels: messageNavigationLabels,
16040
+ language: i18n2.language,
16041
+ assistantTitle
16042
+ }
16043
+ ) : [],
16044
+ [
16045
+ assistantTitle,
16046
+ i18n2.language,
16047
+ messageNavigationEnabled,
16048
+ messageNavigationLabels,
16049
+ messages
16050
+ ]
16051
+ );
16052
+ const showMessageNavigation = messageNavigationItems.length >= MESSAGE_NAVIGATION_MIN_ITEMS;
15560
16053
  const historyMessagePagination = stream.historyMessagePagination;
15561
16054
  const isLoadingMoreMessages = Boolean(
15562
16055
  historyMessagePagination?.isLoadingMore
15563
16056
  );
15564
16057
  const canLoadMoreMessages = Boolean(historyMessagePagination?.hasMore);
15565
- const draft = React49.useMemo(
16058
+ const draft = React50.useMemo(
15566
16059
  () => getComposerPlainText(composerParts),
15567
16060
  [composerParts]
15568
16061
  );
@@ -15576,7 +16069,7 @@ function Chat({
15576
16069
  isEmpty: isComposerInputEmpty,
15577
16070
  isStacked: isComposerStacked
15578
16071
  });
15579
- const pendingFollowUps = React49.useMemo(
16072
+ const pendingFollowUps = React50.useMemo(
15580
16073
  () => sortVisiblePendingFollowUps(stream.pendingFollowUps ?? []),
15581
16074
  [stream.pendingFollowUps]
15582
16075
  );
@@ -15585,21 +16078,18 @@ function Chat({
15585
16078
  const hasPendingHITLRequest = Boolean(stream.pendingHITLRequest);
15586
16079
  const hasPendingInteractiveRequest = hasPendingRequestUserInput || hasPendingHITLRequest;
15587
16080
  const hasPendingTodos = Boolean(stream.todos?.items.length);
15588
- const runtimeCapabilityOptions = React49.useMemo(
16081
+ const runtimeCapabilityOptions = React50.useMemo(
15589
16082
  () => getRuntimeCapabilityOptions(runtimeCapabilities),
15590
16083
  [runtimeCapabilities]
15591
16084
  );
15592
- const goalAdapter = React49.useMemo(
15593
- () => {
15594
- if (isGoalAdapter(options?.goal)) {
15595
- return options.goal;
15596
- }
15597
- return supportsXpertThreadGoalAdapter(stream.client) ? createXpertThreadGoalAdapter(stream.client) : null;
15598
- },
15599
- [options?.goal, stream.client]
15600
- );
16085
+ const goalAdapter = React50.useMemo(() => {
16086
+ if (isGoalAdapter(options?.goal)) {
16087
+ return options.goal;
16088
+ }
16089
+ return supportsXpertThreadGoalAdapter(stream.client) ? createXpertThreadGoalAdapter(stream.client) : null;
16090
+ }, [options?.goal, stream.client]);
15601
16091
  const displayedGoalElapsedSeconds = threadGoal ? (threadGoal.elapsedSeconds ?? 0) + (goalElapsedStartedAt ? Math.max(0, Math.floor((streamingNow - goalElapsedStartedAt) / 1e3)) : 0) : 0;
15602
- const effectiveSessionRuntimeCapabilities = React49.useMemo(
16092
+ const effectiveSessionRuntimeCapabilities = React50.useMemo(
15603
16093
  () => runtimeCapabilitiesReady && runtimeCapabilities ? mergeRuntimeCapabilitiesSelections(
15604
16094
  runtimeCapabilities,
15605
16095
  sessionRuntimeCapabilities
@@ -15612,7 +16102,7 @@ function Chat({
15612
16102
  "goal"
15613
16103
  );
15614
16104
  const showGoalStatus = goalCommandAvailable && !hasCompletedGoal && (Boolean(goalError) || threadGoal?.status === "active" && stream.isLoading);
15615
- const runRuntimeCapabilityOptions = React49.useMemo(
16105
+ const runRuntimeCapabilityOptions = React50.useMemo(
15616
16106
  () => runtimeCapabilityOptions.filter(
15617
16107
  (option) => isRuntimeCapabilitySelected(
15618
16108
  runRuntimeCapabilities,
@@ -15622,11 +16112,11 @@ function Chat({
15622
16112
  ),
15623
16113
  [runRuntimeCapabilities, runtimeCapabilityOptions]
15624
16114
  );
15625
- const composerRuntimeCapabilitySelectionKeys = React49.useMemo(
16115
+ const composerRuntimeCapabilitySelectionKeys = React50.useMemo(
15626
16116
  () => getComposerCapabilitySelectionKeys(composerParts),
15627
16117
  [composerParts]
15628
16118
  );
15629
- const detachedRunRuntimeCapabilityOptions = React49.useMemo(
16119
+ const detachedRunRuntimeCapabilityOptions = React50.useMemo(
15630
16120
  () => runRuntimeCapabilityOptions.filter(
15631
16121
  (option) => !composerRuntimeCapabilitySelectionKeys.has(
15632
16122
  getRuntimeCapabilityOptionKey(option)
@@ -15634,7 +16124,7 @@ function Chat({
15634
16124
  ),
15635
16125
  [composerRuntimeCapabilitySelectionKeys, runRuntimeCapabilityOptions]
15636
16126
  );
15637
- const persistSessionRuntimeCapabilities = React49.useCallback(
16127
+ const persistSessionRuntimeCapabilities = React50.useCallback(
15638
16128
  async (threadId, selection) => {
15639
16129
  if (!runtimeCapabilities || !selection) {
15640
16130
  return;
@@ -15659,10 +16149,10 @@ function Chat({
15659
16149
  },
15660
16150
  [runtimeCapabilities, stream.client]
15661
16151
  );
15662
- const clearQuoteSelection = React49.useCallback(() => {
16152
+ const clearQuoteSelection = React50.useCallback(() => {
15663
16153
  setQuoteSelection(null);
15664
16154
  }, []);
15665
- const commitComposerParts = React49.useCallback(
16155
+ const commitComposerParts = React50.useCallback(
15666
16156
  (nextParts, options2) => {
15667
16157
  const normalized = normalizeComposerParts(nextParts);
15668
16158
  const previous = composerPartsRef.current;
@@ -15698,7 +16188,7 @@ function Chat({
15698
16188
  },
15699
16189
  []
15700
16190
  );
15701
- const setComposerText = React49.useCallback(
16191
+ const setComposerText = React50.useCallback(
15702
16192
  (text, caretOffset = text.length) => {
15703
16193
  commitComposerParts(createComposerTextParts(text), {
15704
16194
  caretOffset,
@@ -15708,7 +16198,7 @@ function Chat({
15708
16198
  },
15709
16199
  [commitComposerParts]
15710
16200
  );
15711
- const focusComposerAt = React49.useCallback((position) => {
16201
+ const focusComposerAt = React50.useCallback((position) => {
15712
16202
  const nextPosition = position ?? getComposerEditingLength(composerPartsRef.current);
15713
16203
  pendingComposerCaretOffsetRef.current = nextPosition;
15714
16204
  requestAnimationFrame(() => {
@@ -15720,7 +16210,7 @@ function Chat({
15720
16210
  });
15721
16211
  }, []);
15722
16212
  const parentMessenger = useParentMessenger({
15723
- onSetComposerValue: React49.useCallback(
16213
+ onSetComposerValue: React50.useCallback(
15724
16214
  (payload) => {
15725
16215
  if (!payload) {
15726
16216
  return;
@@ -15743,10 +16233,10 @@ function Chat({
15743
16233
  },
15744
16234
  [composer?.tools, setComposerText]
15745
16235
  ),
15746
- onFocusComposer: React49.useCallback(() => {
16236
+ onFocusComposer: React50.useCallback(() => {
15747
16237
  composerInputRef.current?.focus();
15748
16238
  }, []),
15749
- onSetPetEnabled: React49.useCallback(
16239
+ onSetPetEnabled: React50.useCallback(
15750
16240
  (enabled) => {
15751
16241
  if (petRequired) {
15752
16242
  return;
@@ -15760,10 +16250,10 @@ function Chat({
15760
16250
  )
15761
16251
  });
15762
16252
  const canMinimizeToPet = parentMessenger?.isParentAvailable === true && isPetEnabled(effectivePet);
15763
- const handleMinimizeToPet = React49.useCallback(() => {
16253
+ const handleMinimizeToPet = React50.useCallback(() => {
15764
16254
  parentMessenger?.sendEvent("chat_minimize_change", { minimized: true });
15765
16255
  }, [parentMessenger]);
15766
- const syncQuoteSelection = React49.useCallback(() => {
16256
+ const syncQuoteSelection = React50.useCallback(() => {
15767
16257
  if (typeof window === "undefined") {
15768
16258
  clearQuoteSelection();
15769
16259
  return;
@@ -15808,23 +16298,23 @@ function Chat({
15808
16298
  left
15809
16299
  });
15810
16300
  }, [clearQuoteSelection]);
15811
- const cancelPendingAutoScroll = React49.useCallback(() => {
16301
+ const cancelPendingAutoScroll = React50.useCallback(() => {
15812
16302
  if (autoScrollFrameRef.current !== null) {
15813
16303
  cancelAnimationFrame(autoScrollFrameRef.current);
15814
16304
  autoScrollFrameRef.current = null;
15815
16305
  }
15816
16306
  }, []);
15817
- const disableAutoFollow = React49.useCallback(() => {
16307
+ const disableAutoFollow = React50.useCallback(() => {
15818
16308
  forceFollowRef.current = false;
15819
16309
  shouldAutoScrollRef.current = false;
15820
16310
  cancelPendingAutoScroll();
15821
16311
  }, [cancelPendingAutoScroll]);
15822
- const enableAutoFollow = React49.useCallback(() => {
16312
+ const enableAutoFollow = React50.useCallback(() => {
15823
16313
  forceFollowRef.current = true;
15824
16314
  shouldAutoScrollRef.current = true;
15825
16315
  setHasUpdatesBelow(false);
15826
16316
  }, []);
15827
- const scrollToBottom = React49.useCallback(
16317
+ const scrollToBottom = React50.useCallback(
15828
16318
  (smooth = false, force = false) => {
15829
16319
  if (force) {
15830
16320
  enableAutoFollow();
@@ -15851,7 +16341,25 @@ function Chat({
15851
16341
  },
15852
16342
  [cancelPendingAutoScroll, enableAutoFollow]
15853
16343
  );
15854
- React49.useEffect(() => {
16344
+ const setMessageNavigationAnchor = React50.useCallback(
16345
+ (id, node) => {
16346
+ if (node) {
16347
+ messageNavigationAnchorsRef.current.set(id, node);
16348
+ return;
16349
+ }
16350
+ messageNavigationAnchorsRef.current.delete(id);
16351
+ },
16352
+ []
16353
+ );
16354
+ const getMessageNavigationAnchor = React50.useCallback(
16355
+ (item) => messageNavigationAnchorsRef.current.get(item.id) ?? null,
16356
+ []
16357
+ );
16358
+ const handleMessageNavigationNavigate = React50.useCallback(() => {
16359
+ disableAutoFollow();
16360
+ clearQuoteSelection();
16361
+ }, [clearQuoteSelection, disableAutoFollow]);
16362
+ React50.useEffect(() => {
15855
16363
  const viewport = viewportRef.current;
15856
16364
  if (!viewport) return;
15857
16365
  previousScrollTopRef.current = viewport.scrollTop;
@@ -15932,14 +16440,14 @@ function Chat({
15932
16440
  window.removeEventListener("pointercancel", stopPointerTracking);
15933
16441
  };
15934
16442
  }, [cancelPendingAutoScroll, disableAutoFollow]);
15935
- React49.useEffect(() => {
16443
+ React50.useEffect(() => {
15936
16444
  shouldAutoScrollRef.current = true;
15937
16445
  forceFollowRef.current = false;
15938
16446
  previousScrollTopRef.current = 0;
15939
16447
  setIsAtBottom(true);
15940
16448
  setHasUpdatesBelow(false);
15941
16449
  }, [stream.threadId]);
15942
- React49.useEffect(() => {
16450
+ React50.useEffect(() => {
15943
16451
  const messageCountChanged = messages.length !== previousMessageCountRef.current;
15944
16452
  previousMessageCountRef.current = messages.length;
15945
16453
  if (isPrependingHistoryMessagesRef.current) {
@@ -15962,7 +16470,7 @@ function Chat({
15962
16470
  clientSecret: effectiveClientSecret
15963
16471
  });
15964
16472
  const missingConfig = Boolean(missingConfigKind);
15965
- const missingConfigShortMessage = React49.useMemo(() => {
16473
+ const missingConfigShortMessage = React50.useMemo(() => {
15966
16474
  switch (missingConfigKind) {
15967
16475
  case "apiUrl":
15968
16476
  return t("chat.missingApiUrlShort");
@@ -15974,7 +16482,7 @@ function Chat({
15974
16482
  return t("chat.missingConfigShort");
15975
16483
  }
15976
16484
  }, [missingConfigKind, t]);
15977
- const missingConfigDetailMessage = React49.useMemo(() => {
16485
+ const missingConfigDetailMessage = React50.useMemo(() => {
15978
16486
  switch (missingConfigKind) {
15979
16487
  case "apiUrl":
15980
16488
  return t("chat.missingApiUrlDetail");
@@ -15991,7 +16499,7 @@ function Chat({
15991
16499
  const isSubmissionBlocked = hasPendingInteractiveRequest || missingConfig || isHistoryLoading || hasUploadingFiles || isUploadingReferenceImages;
15992
16500
  const isSendDisabled = !trimmedDraft && !hasReferences || isSubmissionBlocked;
15993
16501
  const isPromptEditDisabled = hasPendingInteractiveRequest || missingConfig || isHistoryLoading;
15994
- const resizeComposerInput = React49.useCallback(() => {
16502
+ const resizeComposerInput = React50.useCallback(() => {
15995
16503
  const input = composerInputRef.current;
15996
16504
  if (!input) {
15997
16505
  return;
@@ -15999,7 +16507,7 @@ function Chat({
15999
16507
  input.style.maxHeight = `${COMPOSER_INPUT_MAX_HEIGHT}px`;
16000
16508
  input.style.overflowY = input.scrollHeight > COMPOSER_INPUT_MAX_HEIGHT ? "auto" : "hidden";
16001
16509
  }, []);
16002
- React49.useLayoutEffect(() => {
16510
+ React50.useLayoutEffect(() => {
16003
16511
  composerPartsRef.current = composerParts;
16004
16512
  resizeComposerInput();
16005
16513
  const caretOffset = pendingComposerCaretOffsetRef.current;
@@ -16011,13 +16519,13 @@ function Chat({
16011
16519
  }
16012
16520
  }
16013
16521
  }, [composerDomVersion, composerParts, resizeComposerInput]);
16014
- React49.useEffect(() => {
16522
+ React50.useEffect(() => {
16015
16523
  document.addEventListener("selectionchange", syncQuoteSelection);
16016
16524
  return () => {
16017
16525
  document.removeEventListener("selectionchange", syncQuoteSelection);
16018
16526
  };
16019
16527
  }, [syncQuoteSelection]);
16020
- React49.useEffect(() => {
16528
+ React50.useEffect(() => {
16021
16529
  const viewport = viewportRef.current;
16022
16530
  if (!viewport) {
16023
16531
  return;
@@ -16034,14 +16542,14 @@ function Chat({
16034
16542
  window.removeEventListener("resize", handleViewportScroll);
16035
16543
  };
16036
16544
  }, [clearQuoteSelection]);
16037
- React49.useEffect(() => {
16545
+ React50.useEffect(() => {
16038
16546
  clearQuoteSelection();
16039
16547
  }, [messages.length, stream.threadId, clearQuoteSelection]);
16040
- React49.useEffect(() => {
16548
+ React50.useEffect(() => {
16041
16549
  if (missingConfig) return;
16042
16550
  void refreshThreads();
16043
16551
  }, [missingConfig, refreshThreads]);
16044
- React49.useEffect(() => {
16552
+ React50.useEffect(() => {
16045
16553
  if (missingConfig || !stream.client || !stream.assistantId) {
16046
16554
  setAssistantName(null);
16047
16555
  setAssistantAvatar(null);
@@ -16064,7 +16572,7 @@ function Chat({
16064
16572
  cancelled = true;
16065
16573
  };
16066
16574
  }, [missingConfig, stream.client, stream.assistantId]);
16067
- React49.useEffect(() => {
16575
+ React50.useEffect(() => {
16068
16576
  if (missingConfig || !stream.client || !stream.assistantId) {
16069
16577
  setRuntimeCapabilities(null);
16070
16578
  setRuntimeCapabilitiesReady(false);
@@ -16111,7 +16619,7 @@ function Chat({
16111
16619
  });
16112
16620
  return () => controller.abort();
16113
16621
  }, [missingConfig, stream.client, stream.assistantId]);
16114
- React49.useEffect(() => {
16622
+ React50.useEffect(() => {
16115
16623
  setRunRuntimeCapabilities(
16116
16624
  createEmptyRuntimeCapabilitiesSelection(runtimeCapabilities)
16117
16625
  );
@@ -16160,10 +16668,10 @@ function Chat({
16160
16668
  stream.client,
16161
16669
  stream.threadId
16162
16670
  ]);
16163
- React49.useEffect(() => {
16671
+ React50.useEffect(() => {
16164
16672
  setThreadGoal(stream.threadGoal);
16165
16673
  }, [stream.threadGoal]);
16166
- React49.useEffect(() => {
16674
+ React50.useEffect(() => {
16167
16675
  const threadId = stream.threadId?.trim();
16168
16676
  if (!threadId || !goalCommandAvailable) {
16169
16677
  setThreadGoal(null);
@@ -16204,7 +16712,7 @@ function Chat({
16204
16712
  return () => controller.abort();
16205
16713
  }, [goalAdapter, goalCommandAvailable, stream.threadId]);
16206
16714
  const uploadedFiles = attachmentState.uploadedFiles;
16207
- const handleSessionRuntimeCapabilityToggle = React49.useCallback(
16715
+ const handleSessionRuntimeCapabilityToggle = React50.useCallback(
16208
16716
  (type, id, selected) => {
16209
16717
  setSessionRuntimeCapabilities((previous) => {
16210
16718
  const nextSelection = toggleRuntimeCapabilitySelection(
@@ -16222,7 +16730,7 @@ function Chat({
16222
16730
  },
16223
16731
  [persistSessionRuntimeCapabilities, stream.threadId]
16224
16732
  );
16225
- const updateRuntimeCapabilityPalette = React49.useCallback(
16733
+ const updateRuntimeCapabilityPalette = React50.useCallback(
16226
16734
  (parts, selectionStart) => {
16227
16735
  const input = composerInputRef.current;
16228
16736
  const editingText = getComposerEditingText(parts);
@@ -16234,7 +16742,7 @@ function Chat({
16234
16742
  },
16235
16743
  []
16236
16744
  );
16237
- const syncComposerInputFromElement = React49.useCallback(
16745
+ const syncComposerInputFromElement = React50.useCallback(
16238
16746
  (input) => {
16239
16747
  const previousCapabilities = getComposerCapabilityPartMap(
16240
16748
  composerPartsRef.current
@@ -16252,25 +16760,25 @@ function Chat({
16252
16760
  },
16253
16761
  [commitComposerParts, updateRuntimeCapabilityPalette]
16254
16762
  );
16255
- const handleComposerInput = React49.useCallback(
16763
+ const handleComposerInput = React50.useCallback(
16256
16764
  (event) => {
16257
16765
  syncComposerInputFromElement(event.currentTarget);
16258
16766
  },
16259
16767
  [syncComposerInputFromElement]
16260
16768
  );
16261
- const handleComposerCompositionEnd = React49.useCallback(
16769
+ const handleComposerCompositionEnd = React50.useCallback(
16262
16770
  (event) => {
16263
16771
  syncComposerInputFromElement(event.currentTarget);
16264
16772
  },
16265
16773
  [syncComposerInputFromElement]
16266
16774
  );
16267
- const handleComposerSelect = React49.useCallback(() => {
16775
+ const handleComposerSelect = React50.useCallback(() => {
16268
16776
  updateRuntimeCapabilityPalette(
16269
16777
  composerPartsRef.current,
16270
16778
  composerInputRef.current ? getComposerSelectionOffset(composerInputRef.current) : void 0
16271
16779
  );
16272
16780
  }, [updateRuntimeCapabilityPalette]);
16273
- const removeRunRuntimeCapability = React49.useCallback(
16781
+ const removeRunRuntimeCapability = React50.useCallback(
16274
16782
  (option) => {
16275
16783
  setRunRuntimeCapabilities(
16276
16784
  (previous) => toggleRuntimeCapabilitySelection(
@@ -16290,7 +16798,7 @@ function Chat({
16290
16798
  },
16291
16799
  [commitComposerParts]
16292
16800
  );
16293
- const submitDraft = React49.useCallback(
16801
+ const submitDraft = React50.useCallback(
16294
16802
  (submitOptions = {}) => {
16295
16803
  if (isSubmissionBlocked) return;
16296
16804
  const contentToSubmit = (submitOptions.inputText ?? trimmedDraft).trim();
@@ -16413,7 +16921,7 @@ function Chat({
16413
16921
  t
16414
16922
  ]
16415
16923
  );
16416
- const handleGoalCommand = React49.useCallback(
16924
+ const handleGoalCommand = React50.useCallback(
16417
16925
  async ({
16418
16926
  args,
16419
16927
  commandSource,
@@ -16525,13 +17033,10 @@ function Chat({
16525
17033
  t
16526
17034
  ]
16527
17035
  );
16528
- const handleGoalPanelOpenChange = React49.useCallback(
16529
- (open) => {
16530
- setIsGoalPanelOpen(open);
16531
- },
16532
- []
16533
- );
16534
- const addRunRuntimeCapabilities = React49.useCallback(
17036
+ const handleGoalPanelOpenChange = React50.useCallback((open) => {
17037
+ setIsGoalPanelOpen(open);
17038
+ }, []);
17039
+ const addRunRuntimeCapabilities = React50.useCallback(
16535
17040
  (selection) => {
16536
17041
  setRunRuntimeCapabilities(
16537
17042
  (previous) => runtimeCapabilities ? mergeRuntimeCapabilitiesSelections(
@@ -16543,7 +17048,7 @@ function Chat({
16543
17048
  },
16544
17049
  [runtimeCapabilities]
16545
17050
  );
16546
- const insertComposerCapabilityToken = React49.useCallback(
17051
+ const insertComposerCapabilityToken = React50.useCallback(
16547
17052
  (capability, range) => {
16548
17053
  const token = createComposerCapabilityPart(capability, createMessageId());
16549
17054
  const currentParts = composerPartsRef.current;
@@ -16616,7 +17121,7 @@ function Chat({
16616
17121
  plugin: t("composer.slashCommands.empty.loadingCapabilities"),
16617
17122
  subAgent: t("composer.slashCommands.empty.loadingCapabilities")
16618
17123
  };
16619
- React49.useEffect(() => {
17124
+ React50.useEffect(() => {
16620
17125
  if (!runtimeCapabilityPalette) {
16621
17126
  return;
16622
17127
  }
@@ -16635,7 +17140,7 @@ function Chat({
16635
17140
  );
16636
17141
  }
16637
17142
  }, [slashPaletteOptions.length, runtimeCapabilityPalette]);
16638
- React49.useLayoutEffect(() => {
17143
+ React50.useLayoutEffect(() => {
16639
17144
  if (!runtimeCapabilityPalette) {
16640
17145
  return;
16641
17146
  }
@@ -16652,7 +17157,7 @@ function Chat({
16652
17157
  container.scrollTop += optionRect.bottom - containerRect.bottom;
16653
17158
  }
16654
17159
  }, [runtimeCapabilityPalette, slashPaletteOptions.length]);
16655
- const submitGoalModeDraft = React49.useCallback(() => {
17160
+ const submitGoalModeDraft = React50.useCallback(() => {
16656
17161
  const objective = getComposerPlainText(composerPartsRef.current).trim();
16657
17162
  if (!isGoalModeOpen || !goalCommandAvailable || !objective) {
16658
17163
  return false;
@@ -16690,7 +17195,7 @@ function Chat({
16690
17195
  }
16691
17196
  submitDraft();
16692
17197
  };
16693
- const handleEditPendingFollowUp = React49.useCallback(
17198
+ const handleEditPendingFollowUp = React50.useCallback(
16694
17199
  (id) => {
16695
17200
  const item = pendingFollowUps.find(
16696
17201
  (entry) => entry.id === id && entry.mode === "queue"
@@ -16717,7 +17222,7 @@ function Chat({
16717
17222
  },
16718
17223
  [pendingFollowUps, setComposerText, stream]
16719
17224
  );
16720
- const handleQuoteSelection = React49.useCallback(() => {
17225
+ const handleQuoteSelection = React50.useCallback(() => {
16721
17226
  if (!quoteSelection) {
16722
17227
  return;
16723
17228
  }
@@ -16733,7 +17238,7 @@ function Chat({
16733
17238
  const handleAttachmentClick = () => {
16734
17239
  attachmentsRef.current?.openFilePicker();
16735
17240
  };
16736
- const uploadContextFile = React49.useCallback(
17241
+ const uploadContextFile = React50.useCallback(
16737
17242
  (file) => {
16738
17243
  const formData = new FormData();
16739
17244
  formData.append("file", file, file.name || "upload");
@@ -16752,13 +17257,13 @@ function Chat({
16752
17257
  },
16753
17258
  [stream.assistantId, stream.client, stream.threadId]
16754
17259
  );
16755
- const getContextFileStatus = React49.useCallback(
17260
+ const getContextFileStatus = React50.useCallback(
16756
17261
  (fileId) => stream.client.contexts.fetch(`/files/${fileId}/status`, {
16757
17262
  method: "GET"
16758
17263
  }),
16759
17264
  [stream.client]
16760
17265
  );
16761
- const deleteContextFile = React49.useCallback(
17266
+ const deleteContextFile = React50.useCallback(
16762
17267
  (storageFileId) => stream.client.contexts.deleteFile(storageFileId),
16763
17268
  [stream.client]
16764
17269
  );
@@ -16866,7 +17371,7 @@ function Chat({
16866
17371
  }
16867
17372
  submitDraft();
16868
17373
  };
16869
- const handleComposerPaste = React49.useCallback(
17374
+ const handleComposerPaste = React50.useCallback(
16870
17375
  (event) => {
16871
17376
  const clipboardData = event.clipboardData;
16872
17377
  if (!clipboardData) {
@@ -16968,13 +17473,13 @@ function Chat({
16968
17473
  const handleToolSelect = (tool) => {
16969
17474
  setSelectedTool((prev) => prev?.id === tool.id ? null : tool);
16970
17475
  };
16971
- const handlePromptClick = React49.useCallback(
17476
+ const handlePromptClick = React50.useCallback(
16972
17477
  (prompt) => {
16973
17478
  submitDraft({ inputText: prompt, displayText: prompt });
16974
17479
  },
16975
17480
  [submitDraft]
16976
17481
  );
16977
- const handlePromptEdit = React49.useCallback(
17482
+ const handlePromptEdit = React50.useCallback(
16978
17483
  (prompt) => {
16979
17484
  if (isPromptEditDisabled) return;
16980
17485
  setComposerText(prompt, prompt.length);
@@ -16983,7 +17488,7 @@ function Chat({
16983
17488
  },
16984
17489
  [focusComposerAt, isPromptEditDisabled, setComposerText]
16985
17490
  );
16986
- const loadConversationMessages = React49.useCallback(
17491
+ const loadConversationMessages = React50.useCallback(
16987
17492
  async (recordId) => {
16988
17493
  if (missingConfig) {
16989
17494
  setHistoryError(missingConfigShortMessage);
@@ -17004,7 +17509,7 @@ function Chat({
17004
17509
  },
17005
17510
  [missingConfig, missingConfigShortMessage, stream, t]
17006
17511
  );
17007
- const handleLoadMoreMessages = React49.useCallback(async () => {
17512
+ const handleLoadMoreMessages = React50.useCallback(async () => {
17008
17513
  if (!canLoadMoreMessages || isLoadingMoreMessages) {
17009
17514
  return;
17010
17515
  }
@@ -17113,15 +17618,15 @@ function Chat({
17113
17618
  };
17114
17619
  const acceptMimes = composer?.attachments?.accept ? Object.entries(composer.attachments.accept).map(([mime, exts]) => [mime, ...exts.map((e) => `.${e}`)].join(",")).join(",") : void 0;
17115
17620
  const canUploadDroppedFiles = composer?.attachments?.enabled === true && !missingConfig && !isHistoryLoading && !hasPendingInteractiveRequest;
17116
- const handleDroppedFiles = React49.useCallback((files) => {
17621
+ const handleDroppedFiles = React50.useCallback((files) => {
17117
17622
  return attachmentsRef.current?.queueFiles(files) ?? false;
17118
17623
  }, []);
17119
- const currentThread = React49.useMemo(
17624
+ const currentThread = React50.useMemo(
17120
17625
  () => threads.find((item) => item.id === stream.threadId),
17121
17626
  [threads, stream.threadId]
17122
17627
  );
17123
17628
  const streamErrorMessage = stream.error instanceof Error ? stream.error.message : void 0;
17124
- const threadErrorMessage = React49.useMemo(() => {
17629
+ const threadErrorMessage = React50.useMemo(() => {
17125
17630
  if (streamErrorMessage?.trim()) return streamErrorMessage.trim();
17126
17631
  if (currentThread?.status !== "error") return void 0;
17127
17632
  const message = currentThread.error?.trim();
@@ -17151,15 +17656,14 @@ function Chat({
17151
17656
  historyMessageLoadVersion: stream.historyMessageLoadVersion ?? 0,
17152
17657
  fallbackTitle: t("history.threadFallback")
17153
17658
  });
17154
- const assistantTitle = assistantName || resolvedTitle;
17155
17659
  const layoutMaxWidth = options?.layout?.maxWidth;
17156
- const chatColumnStyle = React49.useMemo(() => {
17660
+ const chatColumnStyle = React50.useMemo(() => {
17157
17661
  if (layoutMaxWidth === void 0 || layoutMaxWidth === null || layoutMaxWidth === "") {
17158
17662
  return void 0;
17159
17663
  }
17160
17664
  return { maxWidth: layoutMaxWidth };
17161
17665
  }, [layoutMaxWidth]);
17162
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
17666
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
17163
17667
  UploadDroppedFiles,
17164
17668
  {
17165
17669
  ref: viewportRef,
@@ -17174,16 +17678,16 @@ function Chat({
17174
17678
  className
17175
17679
  ),
17176
17680
  children: [
17177
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
17681
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
17178
17682
  "div",
17179
17683
  {
17180
17684
  "data-slot": "chatkit-chat-header",
17181
17685
  className: "mx-auto flex w-full items-center justify-between border-b p-2 sticky top-0 z-10 bg-background",
17182
17686
  style: chatColumnStyle,
17183
17687
  children: [
17184
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center gap-3 overflow-hidden", children: [
17185
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "relative shrink-0", children: [
17186
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
17688
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex items-center gap-3 overflow-hidden", children: [
17689
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "relative shrink-0", children: [
17690
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17187
17691
  ChatkitAvatar,
17188
17692
  {
17189
17693
  avatar: assistantAvatar,
@@ -17191,10 +17695,10 @@ function Chat({
17191
17695
  label: assistantTitle
17192
17696
  }
17193
17697
  ),
17194
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "absolute bottom-0 right-0 h-2.5 w-2.5 rounded-full border-2 border-background bg-green-500" })
17698
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "absolute bottom-0 right-0 h-2.5 w-2.5 rounded-full border-2 border-background bg-green-500" })
17195
17699
  ] }),
17196
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "truncate", children: [
17197
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
17700
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "truncate", children: [
17701
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17198
17702
  "h2",
17199
17703
  {
17200
17704
  className: "text-lg font-semibold truncate",
@@ -17202,12 +17706,12 @@ function Chat({
17202
17706
  children: assistantTitle
17203
17707
  }
17204
17708
  ),
17205
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: "text-xs text-muted-foreground", children: t("chat.statusOnline") })
17709
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { className: "text-xs text-muted-foreground", children: t("chat.statusOnline") })
17206
17710
  ] })
17207
17711
  ] }),
17208
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center gap-1", children: [
17209
- canMinimizeToPet && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Tooltip, { children: [
17210
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
17712
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex items-center gap-1", children: [
17713
+ canMinimizeToPet && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Tooltip, { children: [
17714
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17211
17715
  "button",
17212
17716
  {
17213
17717
  type: "button",
@@ -17218,13 +17722,13 @@ function Chat({
17218
17722
  "transition-colors duration-150"
17219
17723
  ),
17220
17724
  "aria-label": t("chat.minimizeToPet"),
17221
- children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react29.Minus, { size: 16 })
17725
+ children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react29.Minus, { size: 16 })
17222
17726
  }
17223
17727
  ) }) }),
17224
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(TooltipContent, { side: "bottom", children: t("chat.minimizeToPet") })
17728
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(TooltipContent, { side: "bottom", children: t("chat.minimizeToPet") })
17225
17729
  ] }),
17226
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Tooltip, { children: [
17227
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
17730
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Tooltip, { children: [
17731
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17228
17732
  "button",
17229
17733
  {
17230
17734
  type: "button",
@@ -17235,14 +17739,14 @@ function Chat({
17235
17739
  "transition-colors duration-150"
17236
17740
  ),
17237
17741
  "aria-label": t("settings.open"),
17238
- children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react29.Settings, { size: 16 })
17742
+ children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react29.Settings, { size: 16 })
17239
17743
  }
17240
17744
  ) }) }),
17241
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(TooltipContent, { side: "bottom", children: t("settings.open") })
17745
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(TooltipContent, { side: "bottom", children: t("settings.open") })
17242
17746
  ] }),
17243
- history?.enabled !== false && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_jsx_runtime54.Fragment, { children: [
17244
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Tooltip, { children: [
17245
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
17747
+ history?.enabled !== false && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
17748
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Tooltip, { children: [
17749
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17246
17750
  "button",
17247
17751
  {
17248
17752
  type: "button",
@@ -17255,12 +17759,12 @@ function Chat({
17255
17759
  "disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed"
17256
17760
  ),
17257
17761
  "aria-label": t("history.newThread"),
17258
- children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react29.Pencil, { size: 16 })
17762
+ children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react29.Pencil, { size: 16 })
17259
17763
  }
17260
17764
  ) }) }),
17261
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(TooltipContent, { side: "bottom", children: t("history.newThread") })
17765
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(TooltipContent, { side: "bottom", children: t("history.newThread") })
17262
17766
  ] }),
17263
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
17767
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17264
17768
  HistorySidebar,
17265
17769
  {
17266
17770
  threads,
@@ -17277,18 +17781,29 @@ function Chat({
17277
17781
  ]
17278
17782
  }
17279
17783
  ),
17280
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
17784
+ showMessageNavigation && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17785
+ MessageNavigator,
17786
+ {
17787
+ items: messageNavigationItems,
17788
+ viewportRef,
17789
+ getAnchor: getMessageNavigationAnchor,
17790
+ onNavigate: handleMessageNavigationNavigate,
17791
+ label: t("message.navigation.label"),
17792
+ tagsOverflowLabel: (count) => t("message.navigation.moreTags", { count })
17793
+ }
17794
+ ),
17795
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
17281
17796
  "div",
17282
17797
  {
17283
17798
  "data-slot": "chatkit-chat-content",
17284
17799
  className: "mx-auto w-full flex-1 p-4",
17285
17800
  style: chatColumnStyle,
17286
17801
  children: [
17287
- errorMessage && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "mb-4 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive", children: errorMessage }),
17288
- historyError && /* @__PURE__ */ (0, import_jsx_runtime54.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 }),
17289
- showMissingConfig && /* @__PURE__ */ (0, import_jsx_runtime54.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 }),
17290
- isHistoryLoading && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "mb-4 rounded-lg border border-muted px-3 py-2 text-sm text-muted-foreground", children: t("chat.loadingThread") }),
17291
- messages.length === 0 && !canLoadMoreMessages ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
17802
+ errorMessage && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "mb-4 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive", children: errorMessage }),
17803
+ historyError && /* @__PURE__ */ (0, import_jsx_runtime55.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 }),
17804
+ showMissingConfig && /* @__PURE__ */ (0, import_jsx_runtime55.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 }),
17805
+ isHistoryLoading && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "mb-4 rounded-lg border border-muted px-3 py-2 text-sm text-muted-foreground", children: t("chat.loadingThread") }),
17806
+ messages.length === 0 && !canLoadMoreMessages ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17292
17807
  StartScreen,
17293
17808
  {
17294
17809
  startScreen,
@@ -17297,10 +17812,10 @@ function Chat({
17297
17812
  promptSendDisabled: isSubmissionBlocked,
17298
17813
  promptEditDisabled: isPromptEditDisabled
17299
17814
  }
17300
- ) : /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "space-y-4", children: [
17301
- canLoadMoreMessages && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center gap-3 py-1", children: [
17302
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "h-px min-w-8 flex-1 bg-border" }),
17303
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
17815
+ ) : /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "space-y-4", children: [
17816
+ canLoadMoreMessages && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex items-center gap-3 py-1", children: [
17817
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "h-px min-w-8 flex-1 bg-border" }),
17818
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17304
17819
  Button,
17305
17820
  {
17306
17821
  type: "button",
@@ -17312,7 +17827,7 @@ function Chat({
17312
17827
  children: isLoadingMoreMessages ? t("chat.loadingMoreMessages") : t("chat.loadMoreMessages")
17313
17828
  }
17314
17829
  ),
17315
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "h-px min-w-8 flex-1 bg-border" })
17830
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "h-px min-w-8 flex-1 bg-border" })
17316
17831
  ] }),
17317
17832
  messages.map((message, index) => {
17318
17833
  const messageType = String(message.type);
@@ -17346,18 +17861,24 @@ function Chat({
17346
17861
  const hasHumanAttachments = message.type === "human" && humanAttachments.length > 0;
17347
17862
  const canQuoteMessage = message.type === "human" || isAssistantMessage;
17348
17863
  const quoteSource = message.type === "human" ? t("chat.youLabel") : assistantTitle;
17864
+ const messageNavigationId = getMessageNavigationItemId(
17865
+ message,
17866
+ index
17867
+ );
17349
17868
  if (!isAssistantMessage && !hasPlainRenderableContent && !hasHumanAttachments && humanRuntimeCapabilityOptions.length === 0 && humanReferences.length === 0) {
17350
17869
  return null;
17351
17870
  }
17352
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
17871
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17353
17872
  "div",
17354
17873
  {
17874
+ ref: (node) => setMessageNavigationAnchor(messageNavigationId, node),
17875
+ "data-message-navigation-id": messageNavigationId,
17355
17876
  className: cn(
17356
17877
  "group flex gap-3",
17357
17878
  message.type === "human" ? "justify-end" : "justify-start -ml-1"
17358
17879
  // AI messages: slightly closer to left
17359
17880
  ),
17360
- children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
17881
+ children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
17361
17882
  "div",
17362
17883
  {
17363
17884
  className: cn(
@@ -17365,7 +17886,7 @@ function Chat({
17365
17886
  isAssistantMessage && "min-w-0 flex-1"
17366
17887
  ),
17367
17888
  children: [
17368
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
17889
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17369
17890
  "div",
17370
17891
  {
17371
17892
  ...canQuoteMessage ? {
@@ -17377,7 +17898,7 @@ function Chat({
17377
17898
  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"
17378
17899
  // AI messages: use chat-specific foreground color
17379
17900
  ),
17380
- children: isAssistantMessage ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
17901
+ children: isAssistantMessage ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17381
17902
  AssistantMessage,
17382
17903
  {
17383
17904
  message: {
@@ -17396,25 +17917,25 @@ function Chat({
17396
17917
  organizationId: stream.organizationId,
17397
17918
  apiUrl: stream.apiUrl
17398
17919
  }
17399
- ) : /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_jsx_runtime54.Fragment, { children: [
17400
- message.type === "human" && humanRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanRuntimeCapabilityOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
17920
+ ) : /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
17921
+ message.type === "human" && humanRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanRuntimeCapabilityOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
17401
17922
  "span",
17402
17923
  {
17403
17924
  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",
17404
17925
  children: [
17405
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
17926
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17406
17927
  RuntimeCapabilityIcon,
17407
17928
  {
17408
17929
  option,
17409
17930
  variant: "chip"
17410
17931
  }
17411
17932
  ),
17412
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "max-w-[9rem] truncate", children: option.label })
17933
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "max-w-[9rem] truncate", children: option.label })
17413
17934
  ]
17414
17935
  },
17415
17936
  `${option.type}:${option.id}`
17416
17937
  )) }),
17417
- message.type === "human" && humanReferences.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanReferences.map((reference) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
17938
+ message.type === "human" && humanReferences.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanReferences.map((reference) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17418
17939
  ReferenceChip,
17419
17940
  {
17420
17941
  reference,
@@ -17422,29 +17943,29 @@ function Chat({
17422
17943
  },
17423
17944
  getReferenceKey(reference)
17424
17945
  )) }),
17425
- message.type === "human" && humanAttachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-2", children: humanAttachments.map((file, fileIndex) => /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
17946
+ message.type === "human" && humanAttachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-2", children: humanAttachments.map((file, fileIndex) => /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
17426
17947
  "div",
17427
17948
  {
17428
17949
  className: "flex items-center gap-1.5 rounded-md bg-primary-foreground/20 px-2 py-1 text-xs",
17429
17950
  children: [
17430
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react29.FileText, { size: 12 }),
17431
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "max-w-[100px] truncate", children: file.originalName ?? file.id })
17951
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react29.FileText, { size: 12 }),
17952
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "max-w-[100px] truncate", children: file.originalName ?? file.id })
17432
17953
  ]
17433
17954
  },
17434
17955
  fileIndex
17435
17956
  )) }),
17436
- Array.isArray(message.content) ? message.content.map((part, partIndex) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
17957
+ Array.isArray(message.content) ? message.content.map((part, partIndex) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17437
17958
  "p",
17438
17959
  {
17439
17960
  className: "wrap-break-word text-sm leading-relaxed",
17440
17961
  children: formatMessageContent(part)
17441
17962
  },
17442
17963
  `${part.type}-${partIndex}`
17443
- )) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "wrap-break-word text-sm leading-relaxed", children: formatMessageContent(message.content) })
17964
+ )) : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "wrap-break-word text-sm leading-relaxed", children: formatMessageContent(message.content) })
17444
17965
  ] })
17445
17966
  }
17446
17967
  ),
17447
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
17968
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17448
17969
  MessageActions,
17449
17970
  {
17450
17971
  content: messageContent,
@@ -17482,7 +18003,7 @@ function Chat({
17482
18003
  stream.isLoading,
17483
18004
  { now: streamingNow }
17484
18005
  );
17485
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "flex justify-start gap-3 -ml-2", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "max-w-full rounded-2xl py-2.5", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18006
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "flex justify-start gap-3 -ml-2", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "max-w-full rounded-2xl py-2.5", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17486
18007
  AssistantStreamingIndicator,
17487
18008
  {
17488
18009
  status: fallbackStreamingStatus ?? "loading"
@@ -17493,7 +18014,7 @@ function Chat({
17493
18014
  ]
17494
18015
  }
17495
18016
  ),
17496
- !isAtBottom && messages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "sticky bottom-20 z-20 flex justify-center px-4 pointer-events-none", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18017
+ !isAtBottom && messages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "sticky bottom-20 z-20 flex justify-center px-4 pointer-events-none", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17497
18018
  Button,
17498
18019
  {
17499
18020
  type: "button",
@@ -17506,10 +18027,10 @@ function Chat({
17506
18027
  onClick: () => scrollToBottom(true, true),
17507
18028
  "aria-label": t("chat.scrollToBottom"),
17508
18029
  title: t("chat.scrollToBottom"),
17509
- children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react29.ArrowDown, { size: 16 })
18030
+ children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react29.ArrowDown, { size: 16 })
17510
18031
  }
17511
18032
  ) }),
17512
- quoteSelection && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18033
+ quoteSelection && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17513
18034
  "div",
17514
18035
  {
17515
18036
  className: "pointer-events-none fixed z-50",
@@ -17518,7 +18039,7 @@ function Chat({
17518
18039
  left: `${quoteSelection.left}px`,
17519
18040
  transform: "translateX(-50%)"
17520
18041
  },
17521
- children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
18042
+ children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
17522
18043
  Button,
17523
18044
  {
17524
18045
  type: "button",
@@ -17530,22 +18051,22 @@ function Chat({
17530
18051
  "aria-label": t("composer.quoteSelection"),
17531
18052
  title: t("composer.quoteSelection"),
17532
18053
  children: [
17533
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react29.Quote, { size: 14 }),
18054
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react29.Quote, { size: 14 }),
17534
18055
  t("composer.quoteSelection")
17535
18056
  ]
17536
18057
  }
17537
18058
  )
17538
18059
  }
17539
18060
  ),
17540
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
18061
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
17541
18062
  "div",
17542
18063
  {
17543
18064
  "data-slot": "chatkit-chat-composer",
17544
18065
  className: "mx-auto w-full p-2 sticky bottom-0 z-10 bg-background",
17545
18066
  style: chatColumnStyle,
17546
18067
  children: [
17547
- threadErrorMessage && /* @__PURE__ */ (0, import_jsx_runtime54.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 }),
17548
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18068
+ threadErrorMessage && /* @__PURE__ */ (0, import_jsx_runtime55.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 }),
18069
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17549
18070
  ChatAttachments,
17550
18071
  {
17551
18072
  ref: attachmentsRef,
@@ -17559,7 +18080,7 @@ function Chat({
17559
18080
  onStateChange: setAttachmentState
17560
18081
  }
17561
18082
  ),
17562
- references.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "mb-3 flex flex-wrap gap-2", children: references.map((reference) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18083
+ references.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "mb-3 flex flex-wrap gap-2", children: references.map((reference) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17563
18084
  ReferenceChip,
17564
18085
  {
17565
18086
  reference,
@@ -17573,16 +18094,16 @@ function Chat({
17573
18094
  },
17574
18095
  getReferenceKey(reference)
17575
18096
  )) }),
17576
- detachedRunRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "mb-2 flex flex-wrap items-center gap-2", children: [
17577
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "text-xs text-muted-foreground", children: t("composer.capabilities.runOnly") }),
17578
- detachedRunRuntimeCapabilityOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
18097
+ detachedRunRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "mb-2 flex flex-wrap items-center gap-2", children: [
18098
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "text-xs text-muted-foreground", children: t("composer.capabilities.runOnly") }),
18099
+ detachedRunRuntimeCapabilityOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
17579
18100
  "span",
17580
18101
  {
17581
18102
  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",
17582
18103
  children: [
17583
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(RuntimeCapabilityIcon, { option, variant: "chip" }),
17584
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "max-w-40 truncate", children: option.label }),
17585
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18104
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(RuntimeCapabilityIcon, { option, variant: "chip" }),
18105
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "max-w-40 truncate", children: option.label }),
18106
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17586
18107
  "button",
17587
18108
  {
17588
18109
  type: "button",
@@ -17590,7 +18111,7 @@ function Chat({
17590
18111
  className: "rounded-full p-0.5 hover:bg-primary/15",
17591
18112
  title: t("composer.capabilities.removeRunCapability"),
17592
18113
  "aria-label": t("composer.capabilities.removeRunCapability"),
17593
- children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react29.X, { size: 11 })
18114
+ children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react29.X, { size: 11 })
17594
18115
  }
17595
18116
  )
17596
18117
  ]
@@ -17598,7 +18119,7 @@ function Chat({
17598
18119
  `${option.type}:${option.id}`
17599
18120
  ))
17600
18121
  ] }),
17601
- showGoalStatus && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
18122
+ showGoalStatus && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
17602
18123
  "div",
17603
18124
  {
17604
18125
  className: cn(
@@ -17606,7 +18127,7 @@ function Chat({
17606
18127
  isGoalObjectiveExpanded ? "items-start" : "items-center"
17607
18128
  ),
17608
18129
  children: [
17609
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18130
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17610
18131
  import_lucide_react29.Target,
17611
18132
  {
17612
18133
  className: cn(
@@ -17615,13 +18136,13 @@ function Chat({
17615
18136
  )
17616
18137
  }
17617
18138
  ),
17618
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "min-w-0 flex-1", children: [
17619
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex min-w-0 items-center gap-2", children: [
17620
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "font-medium", children: t("chat.goal.label") }),
17621
- threadGoal && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "shrink-0 rounded-md bg-muted px-1.5 py-0.5 text-[11px] text-muted-foreground", children: t(`chat.goal.status.${threadGoal.status}`) }),
17622
- isGoalLoading && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react29.Loader2, { className: "size-3 animate-spin text-muted-foreground" })
18139
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "min-w-0 flex-1", children: [
18140
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex min-w-0 items-center gap-2", children: [
18141
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "font-medium", children: t("chat.goal.label") }),
18142
+ threadGoal && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "shrink-0 rounded-md bg-muted px-1.5 py-0.5 text-[11px] text-muted-foreground", children: t(`chat.goal.status.${threadGoal.status}`) }),
18143
+ isGoalLoading && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react29.Loader2, { className: "size-3 animate-spin text-muted-foreground" })
17623
18144
  ] }),
17624
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18145
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17625
18146
  "div",
17626
18147
  {
17627
18148
  className: cn(
@@ -17631,13 +18152,13 @@ function Chat({
17631
18152
  children: goalError || threadGoal?.objective
17632
18153
  }
17633
18154
  ),
17634
- threadGoal && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "mt-1 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { children: t("chat.goal.elapsed", {
18155
+ threadGoal && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "mt-1 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { children: t("chat.goal.elapsed", {
17635
18156
  elapsed: formatGoalElapsed(displayedGoalElapsedSeconds)
17636
18157
  }) }) })
17637
18158
  ] }),
17638
- threadGoal && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex shrink-0 items-center gap-1", children: [
17639
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Tooltip, { children: [
17640
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18159
+ threadGoal && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex shrink-0 items-center gap-1", children: [
18160
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Tooltip, { children: [
18161
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17641
18162
  Button,
17642
18163
  {
17643
18164
  type: "button",
@@ -17648,13 +18169,13 @@ function Chat({
17648
18169
  const prefix = "/goal edit ";
17649
18170
  setComposerText(`${prefix}${threadGoal.objective}`);
17650
18171
  },
17651
- children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react29.Pencil, { className: "size-3" })
18172
+ children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react29.Pencil, { className: "size-3" })
17652
18173
  }
17653
18174
  ) }),
17654
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(TooltipContent, { children: t("chat.goal.edit") })
18175
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(TooltipContent, { children: t("chat.goal.edit") })
17655
18176
  ] }),
17656
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Tooltip, { children: [
17657
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18177
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Tooltip, { children: [
18178
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17658
18179
  Button,
17659
18180
  {
17660
18181
  type: "button",
@@ -17670,13 +18191,13 @@ function Chat({
17670
18191
  executionType: "insert_invocation"
17671
18192
  }
17672
18193
  }),
17673
- children: threadGoal.status === "paused" ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react29.Play, { className: "size-3" }) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react29.Pause, { className: "size-3" })
18194
+ children: threadGoal.status === "paused" ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react29.Play, { className: "size-3" }) : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react29.Pause, { className: "size-3" })
17674
18195
  }
17675
18196
  ) }),
17676
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(TooltipContent, { children: threadGoal.status === "paused" ? t("chat.goal.resume") : t("chat.goal.pause") })
18197
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(TooltipContent, { children: threadGoal.status === "paused" ? t("chat.goal.resume") : t("chat.goal.pause") })
17677
18198
  ] }),
17678
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Tooltip, { children: [
17679
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18199
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Tooltip, { children: [
18200
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17680
18201
  Button,
17681
18202
  {
17682
18203
  type: "button",
@@ -17692,13 +18213,13 @@ function Chat({
17692
18213
  executionType: "insert_invocation"
17693
18214
  }
17694
18215
  }),
17695
- children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react29.Trash2, { className: "size-3" })
18216
+ children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react29.Trash2, { className: "size-3" })
17696
18217
  }
17697
18218
  ) }),
17698
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(TooltipContent, { children: t("chat.goal.clear") })
18219
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(TooltipContent, { children: t("chat.goal.clear") })
17699
18220
  ] }),
17700
- threadGoal.objective && !goalError && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Tooltip, { children: [
17701
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18221
+ threadGoal.objective && !goalError && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Tooltip, { children: [
18222
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17702
18223
  Button,
17703
18224
  {
17704
18225
  type: "button",
@@ -17707,7 +18228,7 @@ function Chat({
17707
18228
  "aria-expanded": isGoalObjectiveExpanded,
17708
18229
  "aria-label": isGoalObjectiveExpanded ? t("chat.goal.collapseObjective") : t("chat.goal.expandObjective"),
17709
18230
  onClick: () => setIsGoalObjectiveExpanded((expanded) => !expanded),
17710
- children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18231
+ children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17711
18232
  import_lucide_react29.ChevronDown,
17712
18233
  {
17713
18234
  className: cn(
@@ -17718,13 +18239,13 @@ function Chat({
17718
18239
  )
17719
18240
  }
17720
18241
  ) }),
17721
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(TooltipContent, { children: isGoalObjectiveExpanded ? t("chat.goal.collapseObjective") : t("chat.goal.expandObjective") })
18242
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(TooltipContent, { children: isGoalObjectiveExpanded ? t("chat.goal.collapseObjective") : t("chat.goal.expandObjective") })
17722
18243
  ] })
17723
18244
  ] })
17724
18245
  ]
17725
18246
  }
17726
18247
  ),
17727
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18248
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17728
18249
  PendingRuntimeServices,
17729
18250
  {
17730
18251
  state: stream.runtimeActivities.sandboxServices,
@@ -17733,7 +18254,7 @@ function Chat({
17733
18254
  className: hasPendingTodos || hasPendingFollowUps ? "mb-2" : void 0
17734
18255
  }
17735
18256
  ),
17736
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18257
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17737
18258
  PendingTodos,
17738
18259
  {
17739
18260
  snapshot: stream.todos,
@@ -17741,7 +18262,7 @@ function Chat({
17741
18262
  className: hasPendingFollowUps ? "mb-2" : void 0
17742
18263
  }
17743
18264
  ),
17744
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18265
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17745
18266
  PendingFollowUps,
17746
18267
  {
17747
18268
  items: pendingFollowUps,
@@ -17754,7 +18275,7 @@ function Chat({
17754
18275
  attachToComposer: true
17755
18276
  }
17756
18277
  ),
17757
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18278
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17758
18279
  RequestUserInputPanel,
17759
18280
  {
17760
18281
  request: stream.pendingRequestUserInput,
@@ -17763,7 +18284,7 @@ function Chat({
17763
18284
  attachToComposer: true
17764
18285
  }
17765
18286
  ),
17766
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18287
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17767
18288
  HITLApprovalPanel,
17768
18289
  {
17769
18290
  request: stream.pendingHITLRequest,
@@ -17772,7 +18293,7 @@ function Chat({
17772
18293
  attachToComposer: true
17773
18294
  }
17774
18295
  ),
17775
- runtimeCapabilityPalette && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18296
+ runtimeCapabilityPalette && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17776
18297
  SlashPalette,
17777
18298
  {
17778
18299
  palette: runtimeCapabilityPalette,
@@ -17786,7 +18307,7 @@ function Chat({
17786
18307
  onSelect: selectSlashPaletteOption
17787
18308
  }
17788
18309
  ),
17789
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("form", { className: "flex items-end", onSubmit: handleSubmit, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
18310
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("form", { className: "flex items-end", onSubmit: handleSubmit, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
17790
18311
  "div",
17791
18312
  {
17792
18313
  "data-slot": "composer-input-shell",
@@ -17800,7 +18321,7 @@ function Chat({
17800
18321
  composerInputRoundedClass
17801
18322
  ),
17802
18323
  children: [
17803
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18324
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17804
18325
  "div",
17805
18326
  {
17806
18327
  ref: composerInputRef,
@@ -17822,7 +18343,7 @@ function Chat({
17822
18343
  (missingConfig || isHistoryLoading || hasPendingInteractiveRequest) && "cursor-not-allowed opacity-50"
17823
18344
  ),
17824
18345
  children: renderedComposerParts.map(
17825
- (part, index) => part.type === "text" ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(React49.Fragment, { children: part.text }, `text-${index}`) : /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
18346
+ (part, index) => part.type === "text" ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(React50.Fragment, { children: part.text }, `text-${index}`) : /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
17826
18347
  "span",
17827
18348
  {
17828
18349
  "data-composer-capability-key": part.key,
@@ -17831,14 +18352,14 @@ function Chat({
17831
18352
  contentEditable: false,
17832
18353
  className: "mx-0.5 inline-flex max-w-[14rem] select-none items-center gap-1 text-sm font-semibold text-primary align-baseline",
17833
18354
  children: [
17834
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18355
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17835
18356
  RuntimeCapabilityIcon,
17836
18357
  {
17837
18358
  option: part.capability,
17838
18359
  variant: "chip"
17839
18360
  }
17840
18361
  ),
17841
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "truncate", children: part.capability.label })
18362
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "truncate", children: part.capability.label })
17842
18363
  ]
17843
18364
  },
17844
18365
  part.key
@@ -17847,14 +18368,14 @@ function Chat({
17847
18368
  },
17848
18369
  composerDomVersion
17849
18370
  ),
17850
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
18371
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
17851
18372
  "div",
17852
18373
  {
17853
18374
  "data-slot": "composer-action-bar",
17854
18375
  className: "pointer-events-none absolute inset-x-1.5 bottom-1 flex min-h-10 items-center justify-between gap-2",
17855
18376
  children: [
17856
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "pointer-events-none flex min-w-0 flex-1 items-center gap-1.5", children: [
17857
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "pointer-events-auto flex shrink-0 items-center gap-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18377
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "pointer-events-none flex min-w-0 flex-1 items-center gap-1.5", children: [
18378
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "pointer-events-auto flex shrink-0 items-center gap-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17858
18379
  ComposerMenu,
17859
18380
  {
17860
18381
  composer,
@@ -17872,20 +18393,20 @@ function Chat({
17872
18393
  disabled: missingConfig || isHistoryLoading || hasPendingInteractiveRequest
17873
18394
  }
17874
18395
  ) }),
17875
- selectedTool && /* @__PURE__ */ (0, import_jsx_runtime54.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: [
17876
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "truncate", children: selectedTool.shortLabel ?? selectedTool.label }),
17877
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18396
+ selectedTool && /* @__PURE__ */ (0, import_jsx_runtime55.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: [
18397
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "truncate", children: selectedTool.shortLabel ?? selectedTool.label }),
18398
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17878
18399
  "button",
17879
18400
  {
17880
18401
  type: "button",
17881
18402
  onClick: () => setSelectedTool(null),
17882
18403
  className: "shrink-0 rounded-full p-0.5 text-primary/70 hover:bg-primary/10 hover:text-primary",
17883
- children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react29.X, { size: 12 })
18404
+ children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react29.X, { size: 12 })
17884
18405
  }
17885
18406
  )
17886
18407
  ] })
17887
18408
  ] }),
17888
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "pointer-events-auto shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18409
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "pointer-events-auto shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17889
18410
  SendButton,
17890
18411
  {
17891
18412
  disabled: isSendDisabled,
@@ -17908,7 +18429,7 @@ function Chat({
17908
18429
  ]
17909
18430
  }
17910
18431
  ) }),
17911
- disclaimer?.text && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18432
+ disclaimer?.text && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17912
18433
  "p",
17913
18434
  {
17914
18435
  className: cn(
@@ -17918,14 +18439,14 @@ function Chat({
17918
18439
  children: disclaimer.text
17919
18440
  }
17920
18441
  ),
17921
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "mt-2 flex items-center justify-center gap-2 text-xs text-muted-foreground", children: [
17922
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { children: t("chat.poweredBy") }),
17923
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ContextUsageIndicator, { className: "absolute right-4" })
18442
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "mt-2 flex items-center justify-center gap-2 text-xs text-muted-foreground", children: [
18443
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { children: t("chat.poweredBy") }),
18444
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ContextUsageIndicator, { className: "absolute right-4" })
17924
18445
  ] })
17925
18446
  ]
17926
18447
  }
17927
18448
  ),
17928
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18449
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17929
18450
  SettingsSheet,
17930
18451
  {
17931
18452
  open: petSettingsOpen,
@@ -17935,17 +18456,17 @@ function Chat({
17935
18456
  onSave: savePetLocalSettings
17936
18457
  }
17937
18458
  ),
17938
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(PetBridge, { pet: effectivePet, state: petAutoState })
18459
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(PetBridge, { pet: effectivePet, state: petAutoState })
17939
18460
  ]
17940
18461
  }
17941
18462
  );
17942
18463
  }
17943
18464
 
17944
18465
  // src/components/ui/separator.tsx
17945
- var React50 = __toESM(require("react"), 1);
17946
- var import_jsx_runtime55 = require("react/jsx-runtime");
17947
- var Separator = React50.forwardRef(
17948
- ({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
18466
+ var React51 = __toESM(require("react"), 1);
18467
+ var import_jsx_runtime56 = require("react/jsx-runtime");
18468
+ var Separator = React51.forwardRef(
18469
+ ({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
17949
18470
  "div",
17950
18471
  {
17951
18472
  ref,