@xpert-ai/chatkit-ui 0.4.3 → 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-DUmeJXMF.js → _baseUniq-Co-XCsnp.js} +1 -1
  2. package/dist/app/assets/{abap-CAHc26jT.js → abap--D_Kn6xP.js} +1 -1
  3. package/dist/app/assets/{abnf-CVkfvAG7.js → abnf-D5WYHs_l.js} +1 -1
  4. package/dist/app/assets/{actionscript-BEzJB7WT.js → actionscript-DsVXzf-F.js} +1 -1
  5. package/dist/app/assets/{ada-DFt4d8s0.js → ada-Cvy4GD3X.js} +1 -1
  6. package/dist/app/assets/{agda-Dgk-d8Ej.js → agda-DsLk_pDK.js} +1 -1
  7. package/dist/app/assets/{al-CgIwrIi7.js → al-BeEwAGNu.js} +1 -1
  8. package/dist/app/assets/{antlr4-v8CVE7fu.js → antlr4-BPDPs4mt.js} +1 -1
  9. package/dist/app/assets/{apacheconf-DJRGF6BS.js → apacheconf-DDa4MsSo.js} +1 -1
  10. package/dist/app/assets/{apex-uUgU4D2N.js → apex-IXxIiz3T.js} +1 -1
  11. package/dist/app/assets/{apl-QLgjdSly.js → apl-_Xuh93xL.js} +1 -1
  12. package/dist/app/assets/{applescript-BFVeekYt.js → applescript-zF-7HGIh.js} +1 -1
  13. package/dist/app/assets/{aql-mHS01Klr.js → aql-qapLE7vo.js} +1 -1
  14. package/dist/app/assets/{arc-CuZh5y_d.js → arc-R6XS2pBf.js} +1 -1
  15. package/dist/app/assets/{architectureDiagram-Q4EWVU46-Cp-oqFuq.js → architectureDiagram-Q4EWVU46-6z2emAH2.js} +1 -1
  16. package/dist/app/assets/{arduino-D3yikoHI.js → arduino-2NlbDC0E.js} +1 -1
  17. package/dist/app/assets/{arff-Bzp22yLm.js → arff-15Fx0kni.js} +1 -1
  18. package/dist/app/assets/{asciidoc-DyMmgwzJ.js → asciidoc-IGRk8vb3.js} +1 -1
  19. package/dist/app/assets/{asm6502-B80D95Jm.js → asm6502-lyM25DlO.js} +1 -1
  20. package/dist/app/assets/{asmatmel-D7eDDNLW.js → asmatmel-DGRiY6RP.js} +1 -1
  21. package/dist/app/assets/{aspnet-DP6URAXF.js → aspnet-DRHt5RUL.js} +1 -1
  22. package/dist/app/assets/{autohotkey-CkErJpFg.js → autohotkey-DNI_3d2u.js} +1 -1
  23. package/dist/app/assets/{autoit-BdpOTPpv.js → autoit-Tn0WXTkZ.js} +1 -1
  24. package/dist/app/assets/{avisynth-Dmhp2heE.js → avisynth-DZrXIifS.js} +1 -1
  25. package/dist/app/assets/{avro-idl-DUhKaWgN.js → avro-idl-DvnfR4q7.js} +1 -1
  26. package/dist/app/assets/{bash-BivYb6BT.js → bash-bqRZI_pO.js} +1 -1
  27. package/dist/app/assets/{basic-D-8b5r6a.js → basic-BaebTlRT.js} +1 -1
  28. package/dist/app/assets/{batch-BgMIK1_X.js → batch-PcmijW6C.js} +1 -1
  29. package/dist/app/assets/{bbcode-DVoSXbR6.js → bbcode-6XIsStWc.js} +1 -1
  30. package/dist/app/assets/{bicep-DAyvfnBb.js → bicep-CtazMCUu.js} +1 -1
  31. package/dist/app/assets/{birb-MciDoImB.js → birb-Bb-Z2Uoh.js} +1 -1
  32. package/dist/app/assets/{bison-MfDz2wSW.js → bison-DMpTitx0.js} +1 -1
  33. package/dist/app/assets/{blockDiagram-DXYQGD6D-D6fzklHs.js → blockDiagram-DXYQGD6D-4zGz8PX5.js} +1 -1
  34. package/dist/app/assets/{bnf-NfFrR8D5.js → bnf-BgCmtG9K.js} +1 -1
  35. package/dist/app/assets/{brainfuck-ClI8X4SF.js → brainfuck-ZV2E8Tsx.js} +1 -1
  36. package/dist/app/assets/{brightscript-zS1iu4vq.js → brightscript-BcUAceb3.js} +1 -1
  37. package/dist/app/assets/{bro-DljtPq2D.js → bro-CJMO1xO5.js} +1 -1
  38. package/dist/app/assets/{bsl-hhgsw8vw.js → bsl-BUH4KORj.js} +1 -1
  39. package/dist/app/assets/{c-DrpFfWnr.js → c-jtWYEsXA.js} +1 -1
  40. package/dist/app/assets/{c4Diagram-AHTNJAMY-DFqBpiK8.js → c4Diagram-AHTNJAMY-BWtNBZjf.js} +1 -1
  41. package/dist/app/assets/{cfscript-DDb6Lyf6.js → cfscript-BRsXWjhc.js} +1 -1
  42. package/dist/app/assets/{chaiscript-DF48gGB2.js → chaiscript-Cyvk1xer.js} +1 -1
  43. package/dist/app/assets/channel-e2pCq0KM.js +1 -0
  44. package/dist/app/assets/{chunk-4BX2VUAB-B12wPqT-.js → chunk-4BX2VUAB-Cci3cX0w.js} +1 -1
  45. package/dist/app/assets/{chunk-4TB4RGXK-DvBRV7Wa.js → chunk-4TB4RGXK-Cc2Mhdt_.js} +1 -1
  46. package/dist/app/assets/{chunk-55IACEB6-DYYpJnIt.js → chunk-55IACEB6-BCuokoIJ.js} +1 -1
  47. package/dist/app/assets/{chunk-EDXVE4YY-C_cgU5oo.js → chunk-EDXVE4YY-BniMDhnr.js} +1 -1
  48. package/dist/app/assets/{chunk-FMBD7UC4-B3gAIARW.js → chunk-FMBD7UC4-BZgeDsZW.js} +1 -1
  49. package/dist/app/assets/{chunk-OYMX7WX6-DfeuAq49.js → chunk-OYMX7WX6-DNtQg1UI.js} +1 -1
  50. package/dist/app/assets/{chunk-QZHKN3VN-B_q1wkHk.js → chunk-QZHKN3VN-CYOkyP3f.js} +1 -1
  51. package/dist/app/assets/{chunk-YZCP3GAM-BI51-5Xl.js → chunk-YZCP3GAM-DrNq3DSp.js} +1 -1
  52. package/dist/app/assets/{cil-5e3EFNQ-.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-CGm019RU.js → clike-Bys-F0y3.js} +1 -1
  56. package/dist/app/assets/{clojure-EUxmeflx.js → clojure-X2Ur1GCR.js} +1 -1
  57. package/dist/app/assets/clone-CepWRlEk.js +1 -0
  58. package/dist/app/assets/{cmake-Cx_TgZnP.js → cmake-BV05wnad.js} +1 -1
  59. package/dist/app/assets/{cobol-BthqexLq.js → cobol-DmbS5Ovj.js} +1 -1
  60. package/dist/app/assets/{coffeescript-Gvi0WUl9.js → coffeescript-NB44yUqU.js} +1 -1
  61. package/dist/app/assets/{concurnas-DIsKiUcY.js → concurnas-DRly0Ymz.js} +1 -1
  62. package/dist/app/assets/{coq-Cbm4LAk7.js → coq-5BMX0a02.js} +1 -1
  63. package/dist/app/assets/{core-DbOl2YVH.js → core-BDQ00Bae.js} +1 -1
  64. package/dist/app/assets/{cose-bilkent-S5V4N54A-tDz06OBa.js → cose-bilkent-S5V4N54A-C5sw6sBK.js} +1 -1
  65. package/dist/app/assets/{cpp-DvM1W1M3.js → cpp-DGTd--nV.js} +1 -1
  66. package/dist/app/assets/{crystal-Cgeclk0-.js → crystal-04-7jCUz.js} +1 -1
  67. package/dist/app/assets/{csharp-DLajxlCH.js → csharp-BekrIY2o.js} +1 -1
  68. package/dist/app/assets/{cshtml-D4WJuQ28.js → cshtml-DRaoghIv.js} +1 -1
  69. package/dist/app/assets/{csp-DlOt0mll.js → csp-9-yRddNx.js} +1 -1
  70. package/dist/app/assets/{css-BzsDxt7h.js → css-CAtlVqs0.js} +1 -1
  71. package/dist/app/assets/{css-extras-yKv4-OYr.js → css-extras-CWVDDT-t.js} +1 -1
  72. package/dist/app/assets/{csv-Bv1CB32G.js → csv-Dg-zB1qs.js} +1 -1
  73. package/dist/app/assets/{cypher-p1eqx6Jt.js → cypher-4IbDZc8Y.js} +1 -1
  74. package/dist/app/assets/{d-Beqwk42F.js → d-B7r6CIW_.js} +1 -1
  75. package/dist/app/assets/{dagre-KV5264BT-Bva9KEQ3.js → dagre-KV5264BT-Aa6ga6Tg.js} +1 -1
  76. package/dist/app/assets/{dart-DGUIre7b.js → dart-33q2tN5Y.js} +1 -1
  77. package/dist/app/assets/{dataweave-BKEvzZhX.js → dataweave-_KZXrqme.js} +1 -1
  78. package/dist/app/assets/{dax-7DSfOdOt.js → dax-bZvO9T2D.js} +1 -1
  79. package/dist/app/assets/{dhall-D96qT6GR.js → dhall-CMmS_d1I.js} +1 -1
  80. package/dist/app/assets/{diagram-5BDNPKRD-BLdVEgIg.js → diagram-5BDNPKRD-CWOgCaWs.js} +1 -1
  81. package/dist/app/assets/{diagram-G4DWMVQ6-B1mGc4DZ.js → diagram-G4DWMVQ6-pXmi3PKB.js} +1 -1
  82. package/dist/app/assets/{diagram-MMDJMWI5-BCbX9vwv.js → diagram-MMDJMWI5-D6L1aAmr.js} +1 -1
  83. package/dist/app/assets/{diagram-TYMM5635-BbiM5rwX.js → diagram-TYMM5635-Bnbk8hJL.js} +1 -1
  84. package/dist/app/assets/{diff-BJy0ijGD.js → diff-BMnhXRfO.js} +1 -1
  85. package/dist/app/assets/{django-CA3Li7Xc.js → django-CwyRKLji.js} +1 -1
  86. package/dist/app/assets/{dns-zone-file-CQ5FJ0e2.js → dns-zone-file-CH2YmErm.js} +1 -1
  87. package/dist/app/assets/{docker-C_jKEoBB.js → docker-CMu6fCBm.js} +1 -1
  88. package/dist/app/assets/{dot-UuhFwEC4.js → dot-DbQdbB35.js} +1 -1
  89. package/dist/app/assets/{ebnf-v-JYoSll.js → ebnf-Dv8o3Xd5.js} +1 -1
  90. package/dist/app/assets/{editorconfig-Be3ygJWd.js → editorconfig-DGpNYUTF.js} +1 -1
  91. package/dist/app/assets/{eiffel-wc_Ly8vK.js → eiffel-DlwnHLpb.js} +1 -1
  92. package/dist/app/assets/{ejs-DkUkLWO_.js → ejs-CnitBaIQ.js} +1 -1
  93. package/dist/app/assets/{elixir-D4YWMnOb.js → elixir-BwncS48q.js} +1 -1
  94. package/dist/app/assets/{elm-DvpgkmZw.js → elm-DIeTEpXB.js} +1 -1
  95. package/dist/app/assets/{erDiagram-SMLLAGMA-DeYRxjbM.js → erDiagram-SMLLAGMA-DCVTOQcd.js} +1 -1
  96. package/dist/app/assets/{erb-BrK-PMgA.js → erb-DLShoXNV.js} +1 -1
  97. package/dist/app/assets/{erlang-BYb5M5Pb.js → erlang-CymPR6rz.js} +1 -1
  98. package/dist/app/assets/{etlua-Bhe3IDc-.js → etlua-DnGxLY3M.js} +1 -1
  99. package/dist/app/assets/{excel-formula-jODZlBfX.js → excel-formula-BH7DFVmw.js} +1 -1
  100. package/dist/app/assets/{factor-BKsD6d0K.js → factor-Bh-cxy91.js} +1 -1
  101. package/dist/app/assets/{false-CcGNJYns.js → false-Bbvyie5f.js} +1 -1
  102. package/dist/app/assets/{firestore-security-rules-5vyxJaeJ.js → firestore-security-rules-C1Z4GDy7.js} +1 -1
  103. package/dist/app/assets/{flow-NU1izkCa.js → flow-CEb_LmQm.js} +1 -1
  104. package/dist/app/assets/{flowDiagram-DWJPFMVM-Bj0SYU-k.js → flowDiagram-DWJPFMVM-t4rWU0cl.js} +1 -1
  105. package/dist/app/assets/{fortran-DCGTQjju.js → fortran-BNasWrrZ.js} +1 -1
  106. package/dist/app/assets/{fsharp-DNhO6FM-.js → fsharp-BsCVJk6E.js} +1 -1
  107. package/dist/app/assets/{ftl-P_p2wyPG.js → ftl-jRCUJODD.js} +1 -1
  108. package/dist/app/assets/{ganttDiagram-T4ZO3ILL-Dv-WNsgb.js → ganttDiagram-T4ZO3ILL-CIt95e25.js} +1 -1
  109. package/dist/app/assets/{gap-DgF9ZGYZ.js → gap-BNZC8mW7.js} +1 -1
  110. package/dist/app/assets/{gcode-CMhuYhvh.js → gcode-Dm32zQCL.js} +1 -1
  111. package/dist/app/assets/{gdscript-BaNvmSXL.js → gdscript-nnhWLrN6.js} +1 -1
  112. package/dist/app/assets/{gedcom-BLjWW8zc.js → gedcom-CK-ySXEa.js} +1 -1
  113. package/dist/app/assets/{gherkin-BxsMbJgE.js → gherkin--zbB3aYH.js} +1 -1
  114. package/dist/app/assets/{git-C3JKKGbu.js → git-DiWVe3eJ.js} +1 -1
  115. package/dist/app/assets/{gitGraphDiagram-UUTBAWPF-antOmae7.js → gitGraphDiagram-UUTBAWPF-SzhkWrKD.js} +1 -1
  116. package/dist/app/assets/{glsl-Dy963NrS.js → glsl-D1fReIPw.js} +1 -1
  117. package/dist/app/assets/{gml-RHKUDQYR.js → gml-BDyUxEuB.js} +1 -1
  118. package/dist/app/assets/{gn-B5wX0kjQ.js → gn-y9O1wUj9.js} +1 -1
  119. package/dist/app/assets/{go-BO0hAT1N.js → go-BluFqfDq.js} +1 -1
  120. package/dist/app/assets/{go-module-C2Fr-9ms.js → go-module-DZRzQTXf.js} +1 -1
  121. package/dist/app/assets/{graph-DLqezY1N.js → graph-CqvHVXoE.js} +1 -1
  122. package/dist/app/assets/{graphql-D58aRI9g.js → graphql-W2OnfZNH.js} +1 -1
  123. package/dist/app/assets/{groovy-IGpaqhY4.js → groovy-CJ1kbbBa.js} +1 -1
  124. package/dist/app/assets/{haml-C2z2yhSa.js → haml-CrhrA9XY.js} +1 -1
  125. package/dist/app/assets/{handlebars-BobMlUhh.js → handlebars-EgGfXI7t.js} +1 -1
  126. package/dist/app/assets/{haskell-nIuVVanU.js → haskell-Bj5MfGGI.js} +1 -1
  127. package/dist/app/assets/{haxe-D5efufya.js → haxe-BdDpk8xR.js} +1 -1
  128. package/dist/app/assets/{hcl-D9KAZKAO.js → hcl-D9OwvylQ.js} +1 -1
  129. package/dist/app/assets/{hlsl-BFWBj6lA.js → hlsl-562nbzk6.js} +1 -1
  130. package/dist/app/assets/{hoon-B5vc2PPa.js → hoon-BqdgVrcr.js} +1 -1
  131. package/dist/app/assets/{hpkp-X9Vy-aP4.js → hpkp-EH8H3Hom.js} +1 -1
  132. package/dist/app/assets/{hsts-BTHtjxYA.js → hsts-QIGmRf78.js} +1 -1
  133. package/dist/app/assets/{http-D93SJiT9.js → http-CzfjEVlY.js} +1 -1
  134. package/dist/app/assets/{ichigojam-DFGOLrmf.js → ichigojam-D98a8BcA.js} +1 -1
  135. package/dist/app/assets/{icon-BsJxVaoC.js → icon-DBD-5k6c.js} +1 -1
  136. package/dist/app/assets/{icu-message-format-C0hqHQFf.js → icu-message-format-BYT71AMs.js} +1 -1
  137. package/dist/app/assets/{idris-D_XFEa4Y.js → idris-B7zJwyc1.js} +1 -1
  138. package/dist/app/assets/{iecst-BBDx_Apd.js → iecst-SesII_E4.js} +1 -1
  139. package/dist/app/assets/{ignore-5mrYyBCy.js → ignore-B6Rk10df.js} +1 -1
  140. package/dist/app/assets/index-CmKBuFcH.css +1 -0
  141. package/dist/app/assets/{index-OJL54NcI.js → index-DH__JuG8.js} +196 -196
  142. package/dist/app/assets/{infoDiagram-42DDH7IO-DHNCTrQo.js → infoDiagram-42DDH7IO-B_FQWO4F.js} +1 -1
  143. package/dist/app/assets/{inform7-D_BK4Whb.js → inform7-h2cFjWGx.js} +1 -1
  144. package/dist/app/assets/{ini-DHL1U3zm.js → ini-BS51ySt6.js} +1 -1
  145. package/dist/app/assets/{io-Bw7TS_7w.js → io-B4AFlnDh.js} +1 -1
  146. package/dist/app/assets/{ishikawaDiagram-UXIWVN3A-CjewUobx.js → ishikawaDiagram-UXIWVN3A-1rRuzx1s.js} +1 -1
  147. package/dist/app/assets/{j-DfX-jMbV.js → j-Drz8g_1M.js} +1 -1
  148. package/dist/app/assets/{java-BldkMImw.js → java-DCpfLevZ.js} +1 -1
  149. package/dist/app/assets/{javadoc-6dOM24mQ.js → javadoc-DXIzKQcq.js} +1 -1
  150. package/dist/app/assets/{javadoclike-BHmZlS5e.js → javadoclike-C8SmsTQv.js} +1 -1
  151. package/dist/app/assets/{javascript-FvrzCcvc.js → javascript-uumTubEW.js} +1 -1
  152. package/dist/app/assets/{javastacktrace-Byn0DB0K.js → javastacktrace-B-eU9XLD.js} +1 -1
  153. package/dist/app/assets/{jexl-CB5kP-Am.js → jexl-D4977EKW.js} +1 -1
  154. package/dist/app/assets/{jolie-C7Q5mImX.js → jolie-DLawqTad.js} +1 -1
  155. package/dist/app/assets/{journeyDiagram-VCZTEJTY-DD8qNzmh.js → journeyDiagram-VCZTEJTY-DrQg892C.js} +1 -1
  156. package/dist/app/assets/{jq-C9deMLmZ.js → jq-Cm1vS58Z.js} +1 -1
  157. package/dist/app/assets/{js-extras-Brhyk9ef.js → js-extras-RCYpP2to.js} +1 -1
  158. package/dist/app/assets/{js-templates-DhpXMSuF.js → js-templates-767pf_M_.js} +1 -1
  159. package/dist/app/assets/{jsdoc-BEesq6va.js → jsdoc-DTvTCxfG.js} +1 -1
  160. package/dist/app/assets/{json-CRGHFhSS.js → json-Dy-V79-1.js} +1 -1
  161. package/dist/app/assets/{json5-CbPQgQz7.js → json5-BEmUoI2s.js} +1 -1
  162. package/dist/app/assets/{jsonp-BBjDy5AO.js → jsonp-Box0_wdw.js} +1 -1
  163. package/dist/app/assets/{jsstacktrace-CcOPcdH3.js → jsstacktrace-D4k7LJFI.js} +1 -1
  164. package/dist/app/assets/{jsx-DRgBFrjX.js → jsx-UHXI_vWR.js} +1 -1
  165. package/dist/app/assets/{julia-DAe7WbG-.js → julia-DNluswh2.js} +1 -1
  166. package/dist/app/assets/{kanban-definition-6JOO6SKY-DgTSO2X8.js → kanban-definition-6JOO6SKY-DCoBgIKn.js} +1 -1
  167. package/dist/app/assets/{keepalived-COsmSeDV.js → keepalived-cL1_TOGJ.js} +1 -1
  168. package/dist/app/assets/{keyman-Biz_0q7B.js → keyman-CgmsT3ZD.js} +1 -1
  169. package/dist/app/assets/{kotlin-C3V8Z8W0.js → kotlin-B-7C62fR.js} +1 -1
  170. package/dist/app/assets/{kumir-clIi7e8-.js → kumir-BmZSzZs3.js} +1 -1
  171. package/dist/app/assets/{kusto-BhEtzjY8.js → kusto-Bd4bditr.js} +1 -1
  172. package/dist/app/assets/{latex-kWox6R5Q.js → latex-B6Yn44p1.js} +1 -1
  173. package/dist/app/assets/{latte-C8Xd4YKa.js → latte-D_VkuuMY.js} +1 -1
  174. package/dist/app/assets/{layout-CD5_V8sq.js → layout-CuQBqeJF.js} +1 -1
  175. package/dist/app/assets/{less-8ceLguvR.js → less-CNL3ODIy.js} +1 -1
  176. package/dist/app/assets/{lilypond-CfYHEM-K.js → lilypond-Bvambxk4.js} +1 -1
  177. package/dist/app/assets/{linear-B5jHFagM.js → linear-BFLcIrl3.js} +1 -1
  178. package/dist/app/assets/{liquid-BJ6eYcfk.js → liquid-B-rCvqgj.js} +1 -1
  179. package/dist/app/assets/{lisp--smLUoul.js → lisp-DAPeLOCL.js} +1 -1
  180. package/dist/app/assets/{livescript-BBflhyer.js → livescript-DhdAKU5C.js} +1 -1
  181. package/dist/app/assets/{llvm-Stc38VbV.js → llvm-CZUCpwhn.js} +1 -1
  182. package/dist/app/assets/{log-Dl9NGCxx.js → log-DWq76M48.js} +1 -1
  183. package/dist/app/assets/{lolcode-7yqzBped.js → lolcode-Cpeb2C7M.js} +1 -1
  184. package/dist/app/assets/{lua-BEWp6yVC.js → lua-VuQhfB0e.js} +1 -1
  185. package/dist/app/assets/{magma-a1ZYdqHu.js → magma-C6-R8Pis.js} +1 -1
  186. package/dist/app/assets/{makefile-QpxduTfi.js → makefile-C8sXNjev.js} +1 -1
  187. package/dist/app/assets/{markdown-Dr9rg3gd.js → markdown-Dr_2eVkJ.js} +1 -1
  188. package/dist/app/assets/{markup-DWdbcYGh.js → markup-DYRaVR0L.js} +1 -1
  189. package/dist/app/assets/{markup-templating-BduvWqLe.js → markup-templating-Clq2Wdtu.js} +1 -1
  190. package/dist/app/assets/{matlab-C9LyN81W.js → matlab-N7ULHzkN.js} +1 -1
  191. package/dist/app/assets/{maxscript-BMf24IEz.js → maxscript-C_UH_c0Y.js} +1 -1
  192. package/dist/app/assets/{mel-C_j2S2hb.js → mel-biAclKO6.js} +1 -1
  193. package/dist/app/assets/{mermaid-G8stp4Fu.js → mermaid-cA3X8ng1.js} +1 -1
  194. package/dist/app/assets/{min-BGvlJ2dI.js → min-DNXX2fdQ.js} +1 -1
  195. package/dist/app/assets/{mindmap-definition-QFDTVHPH-Dxkf-h1G.js → mindmap-definition-QFDTVHPH-B3hDdQGV.js} +1 -1
  196. package/dist/app/assets/{mizar-J5U-ieUu.js → mizar-DkeIuoWx.js} +1 -1
  197. package/dist/app/assets/{mongodb-DsLKEq_k.js → mongodb-CZtDL2oy.js} +1 -1
  198. package/dist/app/assets/{monkey-lZP0TIai.js → monkey-B7rkJ-YN.js} +1 -1
  199. package/dist/app/assets/{moonscript-OiCHzZ6_.js → moonscript-BrAkE7P-.js} +1 -1
  200. package/dist/app/assets/{n1ql-C6sbE8_e.js → n1ql-CAwurqwa.js} +1 -1
  201. package/dist/app/assets/{n4js-BpPLTwi3.js → n4js-CQMx2F8M.js} +1 -1
  202. package/dist/app/assets/{nand2tetris-hdl-BONzgEmL.js → nand2tetris-hdl-C_WH3v-f.js} +1 -1
  203. package/dist/app/assets/{naniscript-DmYZ1vD6.js → naniscript-BIg6AoSC.js} +1 -1
  204. package/dist/app/assets/{nasm-BfiJTfj8.js → nasm-JWQkVK3O.js} +1 -1
  205. package/dist/app/assets/{neon-CM742PO-.js → neon-CCu-JZXF.js} +1 -1
  206. package/dist/app/assets/{nevod-Dlk8fgIJ.js → nevod-DQ_tL5xo.js} +1 -1
  207. package/dist/app/assets/{nginx-BZ-0DFHd.js → nginx-CE0GIB_t.js} +1 -1
  208. package/dist/app/assets/{nim-CU13w-pb.js → nim-BQkGgHx1.js} +1 -1
  209. package/dist/app/assets/{nix-DKrd4S8j.js → nix-DjPqNtXA.js} +1 -1
  210. package/dist/app/assets/{nsis-B6Grq7ob.js → nsis-B0wDo6fc.js} +1 -1
  211. package/dist/app/assets/{objectivec-Dbl3oSVf.js → objectivec-BOWTft_L.js} +1 -1
  212. package/dist/app/assets/{ocaml-Dp6vkH1l.js → ocaml-rGGzL-J8.js} +1 -1
  213. package/dist/app/assets/{opencl-BGEl-B5f.js → opencl-7DwawK0u.js} +1 -1
  214. package/dist/app/assets/{openqasm-CBrpfqoP.js → openqasm-BoZmVcpe.js} +1 -1
  215. package/dist/app/assets/{oz-Bcy_Q3m9.js → oz-k8zQh74U.js} +1 -1
  216. package/dist/app/assets/{parigp-C8xRJQCD.js → parigp-DOF_5XSw.js} +1 -1
  217. package/dist/app/assets/{parser-Cey9DM6y.js → parser-Bn3oD8Fj.js} +1 -1
  218. package/dist/app/assets/{pascal-l6HUvzh7.js → pascal-BMod2MBu.js} +1 -1
  219. package/dist/app/assets/{pascaligo-B0R2oVyK.js → pascaligo-VMBK85nU.js} +1 -1
  220. package/dist/app/assets/{pcaxis-B7gTfCp3.js → pcaxis-DtO95BO9.js} +1 -1
  221. package/dist/app/assets/{peoplecode-BrynhEhk.js → peoplecode-B6669Uht.js} +1 -1
  222. package/dist/app/assets/{perl-DGnem1ta.js → perl-BWa2t7hE.js} +1 -1
  223. package/dist/app/assets/{php-ymrnn-Sa.js → php-D1EHwdfc.js} +1 -1
  224. package/dist/app/assets/{php-extras-UxJ7EW_B.js → php-extras-BkzLJdMh.js} +1 -1
  225. package/dist/app/assets/{phpdoc-D9_wAKK9.js → phpdoc-Cjl8GbI3.js} +1 -1
  226. package/dist/app/assets/{pieDiagram-DEJITSTG-DQU88qux.js → pieDiagram-DEJITSTG-BOQDZEsp.js} +1 -1
  227. package/dist/app/assets/{plsql-DAA7FuKL.js → plsql-C9d_4ASZ.js} +1 -1
  228. package/dist/app/assets/{powerquery-iAxKW4DJ.js → powerquery-B8dvsoEG.js} +1 -1
  229. package/dist/app/assets/{powershell-CWnnAMh5.js → powershell-B_E5Ls3m.js} +1 -1
  230. package/dist/app/assets/{processing-Fx5vM2Rk.js → processing-JtrZ9RaV.js} +1 -1
  231. package/dist/app/assets/{prolog-MDMz_07H.js → prolog-CqFUVRIw.js} +1 -1
  232. package/dist/app/assets/{promql-pDapTiOR.js → promql-CAbgJv1n.js} +1 -1
  233. package/dist/app/assets/{properties-Cq5vAXr4.js → properties-BngV24FT.js} +1 -1
  234. package/dist/app/assets/{protobuf-BSKn03IB.js → protobuf-Bi9iRUiu.js} +1 -1
  235. package/dist/app/assets/{psl-DJWnJ0aZ.js → psl-pDjrt0B9.js} +1 -1
  236. package/dist/app/assets/{pug-6thMZc-l.js → pug-DioknANs.js} +1 -1
  237. package/dist/app/assets/{puppet-DcBfOA0r.js → puppet-ML2ON0Nh.js} +1 -1
  238. package/dist/app/assets/{pure-BMCCjO23.js → pure-DhCM2LcO.js} +1 -1
  239. package/dist/app/assets/{purebasic-DUfq0bVz.js → purebasic-BBRpNPNK.js} +1 -1
  240. package/dist/app/assets/{purescript-Bmj-jbV7.js → purescript-BCyPbnZA.js} +1 -1
  241. package/dist/app/assets/{q-o6FC2Oci.js → q-AswilSny.js} +1 -1
  242. package/dist/app/assets/{qml-CaBbPt0f.js → qml-CmAUtWqC.js} +1 -1
  243. package/dist/app/assets/{qore-C0fJNj2s.js → qore-Bv9pFdiR.js} +1 -1
  244. package/dist/app/assets/{qsharp-nrwk7Iu2.js → qsharp-48tPx5Mz.js} +1 -1
  245. package/dist/app/assets/{quadrantDiagram-34T5L4WZ-DQQGChO4.js → quadrantDiagram-34T5L4WZ-xfjbVVZu.js} +1 -1
  246. package/dist/app/assets/{r-s3d67ipT.js → r-D7-cDDS_.js} +1 -1
  247. package/dist/app/assets/{racket-CvnxUTxS.js → racket-rfJjsp9a.js} +1 -1
  248. package/dist/app/assets/{reason-abnvbDHw.js → reason-DBC0zi5i.js} +1 -1
  249. package/dist/app/assets/{regex-Dyp7nyFE.js → regex-DnBFBfKd.js} +1 -1
  250. package/dist/app/assets/{rego-D9o_M1Kt.js → rego-B4yEjn-8.js} +1 -1
  251. package/dist/app/assets/{renpy-P-s55mrw.js → renpy-D_4quYLX.js} +1 -1
  252. package/dist/app/assets/{requirementDiagram-MS252O5E-CQyaMifY.js → requirementDiagram-MS252O5E-ykcp6OKq.js} +1 -1
  253. package/dist/app/assets/{rest-CJGNsPIO.js → rest-DE5aTQbn.js} +1 -1
  254. package/dist/app/assets/{rip--_Kjyshk.js → rip-nLkeQy-_.js} +1 -1
  255. package/dist/app/assets/{roboconf-CzO4IdEr.js → roboconf-fk8WiTzj.js} +1 -1
  256. package/dist/app/assets/{robotframework-CqMBjau5.js → robotframework-CT4iaIxT.js} +1 -1
  257. package/dist/app/assets/{ruby-CcbP52GS.js → ruby-cQyytj4i.js} +1 -1
  258. package/dist/app/assets/{rust-BDcJmAdg.js → rust-CWJm_bSY.js} +1 -1
  259. package/dist/app/assets/{sankeyDiagram-XADWPNL6-BR5ykQyP.js → sankeyDiagram-XADWPNL6-Bhogh-O-.js} +1 -1
  260. package/dist/app/assets/{sas-6ZRrxGY4.js → sas-DoRGa1wg.js} +1 -1
  261. package/dist/app/assets/{sass-LQWASCzx.js → sass-LYaBIZKs.js} +1 -1
  262. package/dist/app/assets/{scala-dLVC34jC.js → scala-BZjhJr8S.js} +1 -1
  263. package/dist/app/assets/{scheme-ljjM-kw4.js → scheme-D01CiDze.js} +1 -1
  264. package/dist/app/assets/{scss-BjZr9V6H.js → scss-Da6GwvfN.js} +1 -1
  265. package/dist/app/assets/{sequenceDiagram-FGHM5R23-C_CfyMdO.js → sequenceDiagram-FGHM5R23-ecYbruEX.js} +1 -1
  266. package/dist/app/assets/{shell-session-DN7Q5cOF.js → shell-session-g6FrqTiP.js} +1 -1
  267. package/dist/app/assets/{smali-BSUZr7sT.js → smali-BSpX36tk.js} +1 -1
  268. package/dist/app/assets/{smalltalk-DNUcII1j.js → smalltalk-Bq_Gsc0F.js} +1 -1
  269. package/dist/app/assets/{smarty-w3V8wJ8q.js → smarty-D3fU2RbY.js} +1 -1
  270. package/dist/app/assets/{sml-DSoVmt8E.js → sml-TZkjEgtP.js} +1 -1
  271. package/dist/app/assets/{solidity-r-lFr53c.js → solidity-DLkuvBc2.js} +1 -1
  272. package/dist/app/assets/{solution-file-BE-32cJO.js → solution-file-BqI5xPXQ.js} +1 -1
  273. package/dist/app/assets/{soy-BH05VIly.js → soy-BCG5CQr6.js} +1 -1
  274. package/dist/app/assets/{sparql-BmZSbo8m.js → sparql-DQQsm_l4.js} +1 -1
  275. package/dist/app/assets/{splunk-spl-BBtbm42X.js → splunk-spl-bY7_uYjh.js} +1 -1
  276. package/dist/app/assets/{sqf-2G5YaT6f.js → sqf-BZo7hu6i.js} +1 -1
  277. package/dist/app/assets/{sql-BhZO3kQ8.js → sql-DqFLgmXx.js} +1 -1
  278. package/dist/app/assets/{squirrel-6NG1h2a_.js → squirrel-CiX2EfEw.js} +1 -1
  279. package/dist/app/assets/{stan-DlLgeY1f.js → stan-CMhpMP7k.js} +1 -1
  280. package/dist/app/assets/{stateDiagram-FHFEXIEX-BK6LRJ_J.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-9MANoABX.js → stylus-CenUxfuN.js} +1 -1
  283. package/dist/app/assets/{swift-rgVRgAqK.js → swift-BVjGHQuG.js} +1 -1
  284. package/dist/app/assets/{systemd-DH306ton.js → systemd-CpOXAdLf.js} +1 -1
  285. package/dist/app/assets/{t4-cs-CqAUhraT.js → t4-cs-CS9lJ-K0.js} +1 -1
  286. package/dist/app/assets/{t4-templating-CdnkPXAS.js → t4-templating-hj-TNDsq.js} +1 -1
  287. package/dist/app/assets/{t4-vb-BGXI99pE.js → t4-vb-Ck7mu1gJ.js} +1 -1
  288. package/dist/app/assets/{tap-BAZJNbLK.js → tap-DaH9gaoq.js} +1 -1
  289. package/dist/app/assets/{tcl-BOEKRtOp.js → tcl-DNIWr75O.js} +1 -1
  290. package/dist/app/assets/{textile-D7X0Sgyn.js → textile-Bv4nPa6s.js} +1 -1
  291. package/dist/app/assets/{timeline-definition-GMOUNBTQ-B_LU5nDM.js → timeline-definition-GMOUNBTQ-D6n0S-ku.js} +1 -1
  292. package/dist/app/assets/{toml-CfzGw53h.js → toml-DF3HfhqH.js} +1 -1
  293. package/dist/app/assets/{tremor-DYByk7ar.js → tremor-Bvh1Y6zY.js} +1 -1
  294. package/dist/app/assets/{tt2-CNCaPxhQ.js → tt2-Dv5tLBlM.js} +1 -1
  295. package/dist/app/assets/{turtle-Bzs_at2N.js → turtle-DkLAfnik.js} +1 -1
  296. package/dist/app/assets/{twig-o2S4KNvE.js → twig-S_GHUqZa.js} +1 -1
  297. package/dist/app/assets/{typescript-OnTd0yu3.js → typescript-Cu71LnVi.js} +1 -1
  298. package/dist/app/assets/{typoscript-CSmcWd5z.js → typoscript-CtN4Jy8Z.js} +1 -1
  299. package/dist/app/assets/{unrealscript-cdAqsg1H.js → unrealscript-BRjPcrs6.js} +1 -1
  300. package/dist/app/assets/{uorazor-It80EI2m.js → uorazor-D4ckTG59.js} +1 -1
  301. package/dist/app/assets/{uri-DsMi8rd7.js → uri-DQCryf4S.js} +1 -1
  302. package/dist/app/assets/{v-B_-3T97Y.js → v-Bx-_iyUf.js} +1 -1
  303. package/dist/app/assets/{vala-Bege32x4.js → vala-C-8psoRf.js} +1 -1
  304. package/dist/app/assets/{vbnet-DxWsZHmf.js → vbnet-Do4mtB7R.js} +1 -1
  305. package/dist/app/assets/{velocity-D8j2-t5T.js → velocity-Drww5v_3.js} +1 -1
  306. package/dist/app/assets/{vennDiagram-DHZGUBPP-DfQHyCke.js → vennDiagram-DHZGUBPP-tW8wVSRe.js} +1 -1
  307. package/dist/app/assets/{verilog-BOdg-tSC.js → verilog-B8pepi-H.js} +1 -1
  308. package/dist/app/assets/{vhdl-Ce-nebP4.js → vhdl-CuO3hi8I.js} +1 -1
  309. package/dist/app/assets/{vim-Xv1PHa_E.js → vim-DSsNung_.js} +1 -1
  310. package/dist/app/assets/{visual-basic-Dxm3bTj4.js → visual-basic-CZIqY5t6.js} +1 -1
  311. package/dist/app/assets/{wardley-RL74JXVD-B6u0ieiH.js → wardley-RL74JXVD-D7c8EbFm.js} +1 -1
  312. package/dist/app/assets/{wardleyDiagram-NUSXRM2D-DFue6QoQ.js → wardleyDiagram-NUSXRM2D-Br8nJ8eB.js} +1 -1
  313. package/dist/app/assets/{warpscript-CXGTE5kB.js → warpscript-DxQu8-1N.js} +1 -1
  314. package/dist/app/assets/{wasm-DkO34hDs.js → wasm-TvYG9PxF.js} +1 -1
  315. package/dist/app/assets/{web-idl-BPq5ywx_.js → web-idl-Cz41qHgE.js} +1 -1
  316. package/dist/app/assets/{wiki-DPqgO5Yt.js → wiki-Dpvt1md3.js} +1 -1
  317. package/dist/app/assets/{wolfram-BUOqMX2F.js → wolfram-Bg7HPXEQ.js} +1 -1
  318. package/dist/app/assets/{wren-KDTDLR_P.js → wren-D5Yecsqj.js} +1 -1
  319. package/dist/app/assets/{xeora-tlwdZtLE.js → xeora-Cg-n24u9.js} +1 -1
  320. package/dist/app/assets/{xml-doc-mP74j5_p.js → xml-doc-Eti4SXoM.js} +1 -1
  321. package/dist/app/assets/{xojo-C9Z4cCIr.js → xojo-DhQBW3jL.js} +1 -1
  322. package/dist/app/assets/{xquery-CNxehrYO.js → xquery-DrnMYyrL.js} +1 -1
  323. package/dist/app/assets/{xychartDiagram-5P7HB3ND-B_zEnzIh.js → xychartDiagram-5P7HB3ND-D0kV7MNO.js} +1 -1
  324. package/dist/app/assets/{yaml-CYOcRzsc.js → yaml-DiOrjhia.js} +1 -1
  325. package/dist/app/assets/{yang-CdXyvG4d.js → yang-B38xE-H2.js} +1 -1
  326. package/dist/app/assets/{zig-DisfpEah.js → zig-C7oerdaD.js} +1 -1
  327. package/dist/app/index.html +2 -2
  328. package/dist/index.cjs +1021 -443
  329. package/dist/index.js +1019 -440
  330. package/package.json +3 -3
  331. package/dist/app/assets/channel-DFkA7Odq.js +0 -1
  332. package/dist/app/assets/classDiagram-6PBFFD2Q-BhcMxOX3.js +0 -1
  333. package/dist/app/assets/classDiagram-v2-HSJHXN6E-BhcMxOX3.js +0 -1
  334. package/dist/app/assets/clone-D0zp_cmi.js +0 -1
  335. package/dist/app/assets/index-s5_akYUB.css +0 -1
  336. package/dist/app/assets/stateDiagram-v2-QKLJ7IA2-kcyyVi9f.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
  },
@@ -8708,11 +8738,78 @@ var proposedPlanOpenPattern = /^\s*<proposed_plan>\s*$/;
8708
8738
  var proposedPlanClosePattern = /^\s*<\/proposed_plan>\s*$/;
8709
8739
  var markdownFencePattern = /^ {0,3}(`{3,}|~{3,})/;
8710
8740
  var planMarkdownFencePattern = /^\s*(`{3,}|~{3,})[ \t]*(?:markdown|md)[^\n]*\r?\n([\s\S]*?)\r?\n\1[ \t]*\s*$/i;
8741
+ var knowledgebaseCitationEffectName = "knowledgebase.open_citation";
8711
8742
  var stripMarkdownNode = (props) => {
8712
8743
  const elementProps = { ...props };
8713
8744
  delete elementProps.node;
8714
8745
  return elementProps;
8715
8746
  };
8747
+ var parseKnowledgebaseCitationHref = (href) => {
8748
+ if (typeof href !== "string" || !href.trim()) {
8749
+ return null;
8750
+ }
8751
+ try {
8752
+ const url = new URL(href);
8753
+ if (url.protocol !== "xpert:" || url.hostname !== "knowledgebase" || url.pathname !== "/chunk") {
8754
+ return null;
8755
+ }
8756
+ const documentId = url.searchParams.get("documentId")?.trim();
8757
+ if (!documentId) {
8758
+ return null;
8759
+ }
8760
+ const knowledgebaseId = url.searchParams.get("knowledgebaseId")?.trim();
8761
+ const chunkId = url.searchParams.get("chunkId")?.trim();
8762
+ const documentName = url.searchParams.get("documentName")?.trim();
8763
+ return {
8764
+ documentId,
8765
+ citationUrl: href,
8766
+ ...knowledgebaseId ? { knowledgebaseId } : {},
8767
+ ...chunkId ? { chunkId } : {},
8768
+ ...documentName ? { documentName } : {}
8769
+ };
8770
+ } catch {
8771
+ return null;
8772
+ }
8773
+ };
8774
+ var markdownUrlTransform = (value) => parseKnowledgebaseCitationHref(value) ? value : (0, import_react_markdown.defaultUrlTransform)(value);
8775
+ function MarkdownAnchor({
8776
+ className,
8777
+ href,
8778
+ onClick,
8779
+ ...props
8780
+ }) {
8781
+ const parentMessenger = (0, import_react6.useContext)(ParentMessengerContext);
8782
+ const citationTarget = parseKnowledgebaseCitationHref(href);
8783
+ const anchorProps = stripMarkdownNode(props);
8784
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
8785
+ "a",
8786
+ {
8787
+ className: cn(
8788
+ citationTarget ? "text-muted-foreground text-[0.85em] underline decoration-dotted underline-offset-4 transition-colors hover:text-primary" : "text-primary font-medium underline underline-offset-4",
8789
+ className
8790
+ ),
8791
+ href,
8792
+ target: citationTarget ? void 0 : "_blank",
8793
+ rel: citationTarget ? void 0 : "noopener noreferrer",
8794
+ "data-knowledgebase-citation": citationTarget ? "true" : void 0,
8795
+ onClick: (event) => {
8796
+ onClick?.(event);
8797
+ if (!citationTarget || event.defaultPrevented) {
8798
+ return;
8799
+ }
8800
+ event.preventDefault();
8801
+ parentMessenger?.sendEvent("public_event", [
8802
+ "effect",
8803
+ {
8804
+ name: knowledgebaseCitationEffectName,
8805
+ data: citationTarget
8806
+ }
8807
+ ]);
8808
+ },
8809
+ ...anchorProps
8810
+ }
8811
+ );
8812
+ }
8716
8813
  var getTextContent = (children) => import_react6.Children.toArray(children).map((child) => {
8717
8814
  if (typeof child === "string" || typeof child === "number") {
8718
8815
  return String(child);
@@ -8807,6 +8904,7 @@ function MarkdownContent({ children }) {
8807
8904
  {
8808
8905
  remarkPlugins: [import_remark_gfm.default, import_remark_math.default],
8809
8906
  rehypePlugins: [import_rehype_katex.default],
8907
+ urlTransform: markdownUrlTransform,
8810
8908
  components: defaultComponents,
8811
8909
  children
8812
8910
  }
@@ -9012,18 +9110,7 @@ var defaultComponents = {
9012
9110
  ...stripMarkdownNode(props)
9013
9111
  }
9014
9112
  ),
9015
- a: ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
9016
- "a",
9017
- {
9018
- className: cn(
9019
- "text-primary font-medium underline underline-offset-4",
9020
- className
9021
- ),
9022
- target: "_blank",
9023
- rel: "noopener noreferrer",
9024
- ...stripMarkdownNode(props)
9025
- }
9026
- ),
9113
+ a: MarkdownAnchor,
9027
9114
  blockquote: ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
9028
9115
  "blockquote",
9029
9116
  {
@@ -13068,10 +13155,179 @@ function AssistantMessage({
13068
13155
  ] });
13069
13156
  }
13070
13157
 
13071
- // src/components/thread/MessageActions.tsx
13158
+ // src/components/thread/MessageNavigator.tsx
13072
13159
  var React37 = __toESM(require("react"), 1);
13073
- var import_lucide_react25 = require("lucide-react");
13074
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");
13075
13331
  function MessageActions({
13076
13332
  content,
13077
13333
  isAssistant = false,
@@ -13080,7 +13336,7 @@ function MessageActions({
13080
13336
  className
13081
13337
  }) {
13082
13338
  const { t } = useChatkitTranslation();
13083
- const [copied, setCopied] = React37.useState(false);
13339
+ const [copied, setCopied] = React38.useState(false);
13084
13340
  const handleCopy = async () => {
13085
13341
  try {
13086
13342
  await navigator.clipboard.writeText(content);
@@ -13093,7 +13349,7 @@ function MessageActions({
13093
13349
  if (isStreaming) {
13094
13350
  return null;
13095
13351
  }
13096
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
13352
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
13097
13353
  "div",
13098
13354
  {
13099
13355
  className: cn(
@@ -13101,7 +13357,7 @@ function MessageActions({
13101
13357
  className
13102
13358
  ),
13103
13359
  children: [
13104
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
13360
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
13105
13361
  "button",
13106
13362
  {
13107
13363
  type: "button",
@@ -13111,17 +13367,17 @@ function MessageActions({
13111
13367
  copied && "text-green-500"
13112
13368
  ),
13113
13369
  title: copied ? t("messageActions.copied") : t("messageActions.copy"),
13114
- 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 })
13115
13371
  }
13116
13372
  ),
13117
- isAssistant && onRetry && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
13373
+ isAssistant && onRetry && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
13118
13374
  "button",
13119
13375
  {
13120
13376
  type: "button",
13121
13377
  onClick: onRetry,
13122
13378
  className: "p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",
13123
13379
  title: t("messageActions.regenerate"),
13124
- 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 })
13125
13381
  }
13126
13382
  )
13127
13383
  ]
@@ -13130,20 +13386,20 @@ function MessageActions({
13130
13386
  }
13131
13387
 
13132
13388
  // src/components/thread/StartScreen.tsx
13133
- var React38 = require("react");
13389
+ var React39 = require("react");
13134
13390
  var import_lucide_react26 = require("lucide-react");
13135
- var import_jsx_runtime44 = require("react/jsx-runtime");
13391
+ var import_jsx_runtime45 = require("react/jsx-runtime");
13136
13392
  function getIconComponent2(icon) {
13137
13393
  const iconMap = {
13138
- "circle-question": /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react26.HelpCircle, { size: 20 }),
13139
- "lightbulb": /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react26.Lightbulb, { size: 20 }),
13140
- "sparkle": /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react26.Sparkles, { size: 20 }),
13141
- "write": /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react26.Pencil, { size: 20 }),
13142
- "search": /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react26.Search, { size: 20 }),
13143
- "globe": /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react26.Globe, { size: 20 }),
13144
- "book-open": /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react26.BookOpen, { size: 20 }),
13145
- "compass": /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react26.Compass, { size: 20 }),
13146
- "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 })
13147
13403
  };
13148
13404
  return icon ? iconMap[icon] || iconMap["sparkle"] : iconMap["sparkle"];
13149
13405
  }
@@ -13159,7 +13415,7 @@ function StartScreen({
13159
13415
  const greeting = startScreen?.greeting ?? t("startScreen.greeting");
13160
13416
  const prompts = startScreen?.prompts ?? [];
13161
13417
  const editPromptLabel = t("startScreen.editPrompt");
13162
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
13418
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
13163
13419
  "div",
13164
13420
  {
13165
13421
  className: cn(
@@ -13167,8 +13423,8 @@ function StartScreen({
13167
13423
  className
13168
13424
  ),
13169
13425
  children: [
13170
- /* @__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 }) }),
13171
- 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)(
13172
13428
  "div",
13173
13429
  {
13174
13430
  className: cn(
@@ -13177,7 +13433,7 @@ function StartScreen({
13177
13433
  "focus-within:ring-2 focus-within:ring-primary/20"
13178
13434
  ),
13179
13435
  children: [
13180
- /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
13436
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
13181
13437
  "button",
13182
13438
  {
13183
13439
  type: "button",
@@ -13188,12 +13444,12 @@ function StartScreen({
13188
13444
  "focus:outline-none disabled:cursor-not-allowed disabled:opacity-50"
13189
13445
  ),
13190
13446
  children: [
13191
- /* @__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) }),
13192
- /* @__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 })
13193
13449
  ]
13194
13450
  }
13195
13451
  ),
13196
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
13452
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
13197
13453
  "button",
13198
13454
  {
13199
13455
  type: "button",
@@ -13206,7 +13462,7 @@ function StartScreen({
13206
13462
  "rounded-r-xl transition-colors hover:bg-muted hover:text-foreground",
13207
13463
  "focus:outline-none disabled:cursor-not-allowed disabled:opacity-50"
13208
13464
  ),
13209
- 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 })
13210
13466
  }
13211
13467
  )
13212
13468
  ]
@@ -13219,7 +13475,7 @@ function StartScreen({
13219
13475
  }
13220
13476
 
13221
13477
  // src/hooks/useThreads.ts
13222
- var React39 = __toESM(require("react"), 1);
13478
+ var React40 = __toESM(require("react"), 1);
13223
13479
  var DEFAULT_LIMIT = 50;
13224
13480
  var getThreadTitle = (threadRecord) => {
13225
13481
  const title = threadRecord.title?.trim();
@@ -13272,16 +13528,16 @@ function useThreads(limit = DEFAULT_LIMIT) {
13272
13528
  isLoading: isStreamLoading,
13273
13529
  error: streamError
13274
13530
  } = useStreamContext();
13275
- const [threadRecords, setThreadRecords] = React39.useState([]);
13276
- const [isLoading, setIsLoading] = React39.useState(false);
13277
- const [error, setError] = React39.useState(null);
13278
- 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) => {
13279
13535
  setThreadRecords((prev) => {
13280
13536
  const next = prev.filter((item) => item.id !== threadRecord.id);
13281
13537
  return sortThreadRecords([threadRecord, ...next]);
13282
13538
  });
13283
13539
  }, []);
13284
- const refreshThreads = React39.useCallback(async () => {
13540
+ const refreshThreads = React40.useCallback(async () => {
13285
13541
  setIsLoading(true);
13286
13542
  setError(null);
13287
13543
  try {
@@ -13297,7 +13553,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
13297
13553
  setIsLoading(false);
13298
13554
  }
13299
13555
  }, [client, limit, assistantId]);
13300
- const createThread = React39.useCallback(
13556
+ const createThread = React40.useCallback(
13301
13557
  async (input) => {
13302
13558
  setError(null);
13303
13559
  const payload = {};
@@ -13311,7 +13567,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
13311
13567
  },
13312
13568
  [client, upsertThreadRecord]
13313
13569
  );
13314
- const updateThread = React39.useCallback(
13570
+ const updateThread = React40.useCallback(
13315
13571
  async (recordId, payload) => {
13316
13572
  setError(null);
13317
13573
  const updated = await client.conversations.update(recordId, payload);
@@ -13320,7 +13576,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
13320
13576
  },
13321
13577
  [client, upsertThreadRecord]
13322
13578
  );
13323
- const deleteThread = React39.useCallback(
13579
+ const deleteThread = React40.useCallback(
13324
13580
  async (recordId) => {
13325
13581
  setError(null);
13326
13582
  await client.conversations.delete(recordId);
@@ -13328,11 +13584,11 @@ function useThreads(limit = DEFAULT_LIMIT) {
13328
13584
  },
13329
13585
  [client]
13330
13586
  );
13331
- React39.useEffect(() => {
13587
+ React40.useEffect(() => {
13332
13588
  if (!isReady) return;
13333
13589
  void refreshThreads();
13334
13590
  }, [refreshThreads, isReady]);
13335
- React39.useEffect(() => {
13591
+ React40.useEffect(() => {
13336
13592
  if (!threadId || !isStreamLoading) return;
13337
13593
  const now = (/* @__PURE__ */ new Date()).toISOString();
13338
13594
  const busyStatus = "busy";
@@ -13353,7 +13609,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
13353
13609
  return changed ? sortThreadRecords(next) : prev;
13354
13610
  });
13355
13611
  }, [threadId, isStreamLoading]);
13356
- React39.useEffect(() => {
13612
+ React40.useEffect(() => {
13357
13613
  const message = getErrorMessage2(streamError)?.trim();
13358
13614
  if (!threadId || !message) return;
13359
13615
  const now = (/* @__PURE__ */ new Date()).toISOString();
@@ -13375,7 +13631,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
13375
13631
  return changed ? sortThreadRecords(next) : prev;
13376
13632
  });
13377
13633
  }, [threadId, streamError]);
13378
- React39.useEffect(() => {
13634
+ React40.useEffect(() => {
13379
13635
  if (!isReady || !threadId || isStreamLoading) return;
13380
13636
  let cancelled = false;
13381
13637
  void client.conversations.search({ where: { threadId }, limit: 1 }).then((result) => {
@@ -13389,7 +13645,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
13389
13645
  cancelled = true;
13390
13646
  };
13391
13647
  }, [client, threadId, upsertThreadRecord, isReady, isStreamLoading]);
13392
- const threads = React39.useMemo(
13648
+ const threads = React40.useMemo(
13393
13649
  () => threadRecords.map((threadRecord) => toThreadItem(threadRecord)),
13394
13650
  [threadRecords]
13395
13651
  );
@@ -13406,10 +13662,10 @@ function useThreads(limit = DEFAULT_LIMIT) {
13406
13662
  }
13407
13663
 
13408
13664
  // src/components/thread/context-usage-indicator.tsx
13409
- var React40 = __toESM(require("react"), 1);
13665
+ var React41 = __toESM(require("react"), 1);
13410
13666
 
13411
13667
  // src/components/ui/progress-circle.tsx
13412
- var import_jsx_runtime45 = (
13668
+ var import_jsx_runtime46 = (
13413
13669
  // biome-ignore lint/a11y/useFocusableInteractive: false positive (progress + progressbar are not focusable interactives)
13414
13670
  // biome-ignore lint/nursery/useAriaPropsSupportedByRole: biome rule at odds with mdn docs (presumed nursary bug with rule)
13415
13671
  require("react/jsx-runtime")
@@ -13433,7 +13689,7 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
13433
13689
  fill: "none",
13434
13690
  strokeWidth
13435
13691
  };
13436
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
13692
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
13437
13693
  "svg",
13438
13694
  {
13439
13695
  role: "progressbar",
@@ -13444,8 +13700,8 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
13444
13700
  "aria-valuemax": 100,
13445
13701
  ...restSvgProps,
13446
13702
  children: [
13447
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("circle", { ...commonParams, className: "stroke-current/25" }),
13448
- /* @__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)(
13449
13705
  "circle",
13450
13706
  {
13451
13707
  ...commonParams,
@@ -13463,7 +13719,7 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
13463
13719
  };
13464
13720
 
13465
13721
  // src/components/thread/context-usage-indicator.tsx
13466
- var import_jsx_runtime46 = require("react/jsx-runtime");
13722
+ var import_jsx_runtime47 = require("react/jsx-runtime");
13467
13723
  var kNumberFormatter = new Intl.NumberFormat("en-US", {
13468
13724
  minimumFractionDigits: 0,
13469
13725
  maximumFractionDigits: 1
@@ -13496,21 +13752,21 @@ function ContextUsageIndicator({
13496
13752
  }) {
13497
13753
  const { t } = useChatkitTranslation();
13498
13754
  const stream = useStreamContext();
13499
- const [maxContextSize, setMaxContextSize] = React40.useState(null);
13500
- const [usedContextSize, setUsedContextSize] = React40.useState(null);
13501
- const [assistantAgentKey, setAssistantAgentKey] = React40.useState(null);
13502
- 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({
13503
13759
  threadId: null,
13504
13760
  agentKey: null,
13505
13761
  usedTokens: null
13506
13762
  });
13507
- const realtimeUsage = React40.useMemo(
13763
+ const realtimeUsage = React41.useMemo(
13508
13764
  () => getThreadContextUsage(stream.contextUsageByAgentKey, assistantAgentKey),
13509
13765
  [assistantAgentKey, stream.contextUsageByAgentKey]
13510
13766
  );
13511
13767
  const realtimeUsedContextSize = getThreadContextUsageTotalTokens(realtimeUsage);
13512
13768
  const hasApiConfiguration = Boolean(stream.apiUrl?.trim() && stream.apiKey?.trim());
13513
- React40.useEffect(() => {
13769
+ React41.useEffect(() => {
13514
13770
  if (!hasApiConfiguration || !stream.client || !stream.assistantId) {
13515
13771
  setMaxContextSize(null);
13516
13772
  setAssistantAgentKey(null);
@@ -13530,18 +13786,18 @@ function ContextUsageIndicator({
13530
13786
  cancelled = true;
13531
13787
  };
13532
13788
  }, [hasApiConfiguration, stream.client, stream.assistantId]);
13533
- React40.useEffect(() => {
13789
+ React41.useEffect(() => {
13534
13790
  latestRealtimeUsageRef.current = {
13535
13791
  threadId: stream.threadId ?? null,
13536
13792
  agentKey: assistantAgentKey,
13537
13793
  usedTokens: realtimeUsedContextSize
13538
13794
  };
13539
13795
  }, [assistantAgentKey, realtimeUsedContextSize, stream.threadId]);
13540
- React40.useEffect(() => {
13796
+ React41.useEffect(() => {
13541
13797
  if (realtimeUsedContextSize == null) return;
13542
13798
  setUsedContextSize(realtimeUsedContextSize);
13543
13799
  }, [realtimeUsedContextSize]);
13544
- React40.useEffect(() => {
13800
+ React41.useEffect(() => {
13545
13801
  if (!hasApiConfiguration || !stream.client) {
13546
13802
  setUsedContextSize(null);
13547
13803
  return;
@@ -13607,8 +13863,8 @@ function ContextUsageIndicator({
13607
13863
  });
13608
13864
  const usageLabelWithSuffix = usageLabel.endsWith(":") ? usageLabel : `${usageLabel}:`;
13609
13865
  const progressClassName = percent >= 90 ? "text-destructive" : percent >= 75 ? "text-amber-500" : "text-primary dark:text-zinc-300";
13610
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Tooltip, { children: [
13611
- /* @__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)(
13612
13868
  "button",
13613
13869
  {
13614
13870
  type: "button",
@@ -13617,31 +13873,31 @@ function ContextUsageIndicator({
13617
13873
  className
13618
13874
  ),
13619
13875
  "aria-label": `${usageLabelWithSuffix} ${usageFullLabel}. ${usageTokensLabel}`,
13620
- 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) })
13621
13877
  }
13622
13878
  ) }),
13623
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(TooltipContent, { side: "top", sideOffset: 6, className: "space-y-0.5 px-3 py-2 text-center", children: [
13624
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "text-primary-foreground/70", children: usageLabelWithSuffix }),
13625
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "font-medium text-primary-foreground/80", children: usageFullLabel }),
13626
- /* @__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 })
13627
13883
  ] })
13628
13884
  ] });
13629
13885
  }
13630
13886
 
13631
13887
  // src/components/pet/PetBridge.tsx
13632
- var React41 = __toESM(require("react"), 1);
13888
+ var React42 = __toESM(require("react"), 1);
13633
13889
  var import_chatkit_types10 = require("@xpert-ai/chatkit-types");
13634
13890
  function PetBridge({ pet, state }) {
13635
13891
  const parentMessenger = useParentMessenger();
13636
13892
  const sendEvent = parentMessenger?.sendEvent;
13637
- const options = React41.useMemo(() => (0, import_chatkit_types10.normalizePetOptions)(pet), [pet]);
13638
- React41.useEffect(() => {
13893
+ const options = React42.useMemo(() => (0, import_chatkit_types10.normalizePetOptions)(pet), [pet]);
13894
+ React42.useEffect(() => {
13639
13895
  if (!sendEvent) {
13640
13896
  return;
13641
13897
  }
13642
13898
  sendEvent("pet_options_change", { pet: pet ?? null });
13643
13899
  }, [sendEvent, pet]);
13644
- React41.useEffect(() => {
13900
+ React42.useEffect(() => {
13645
13901
  if (!sendEvent || !options) {
13646
13902
  return;
13647
13903
  }
@@ -13651,15 +13907,15 @@ function PetBridge({ pet, state }) {
13651
13907
  }
13652
13908
 
13653
13909
  // src/components/settings/SettingsSheet.tsx
13654
- var React48 = __toESM(require("react"), 1);
13910
+ var React49 = __toESM(require("react"), 1);
13655
13911
  var import_lucide_react28 = require("lucide-react");
13656
13912
 
13657
13913
  // src/components/ui/input.tsx
13658
- var React42 = __toESM(require("react"), 1);
13659
- var import_jsx_runtime47 = require("react/jsx-runtime");
13660
- 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(
13661
13917
  ({ className, type, ...props }, ref) => {
13662
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
13918
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
13663
13919
  "input",
13664
13920
  {
13665
13921
  ref,
@@ -13676,20 +13932,20 @@ var Input = React42.forwardRef(
13676
13932
  Input.displayName = "Input";
13677
13933
 
13678
13934
  // src/components/ui/select.tsx
13679
- var React43 = require("react");
13935
+ var React44 = require("react");
13680
13936
  var import_radix_ui2 = require("radix-ui");
13681
13937
  var import_lucide_react27 = require("lucide-react");
13682
- var import_jsx_runtime48 = require("react/jsx-runtime");
13938
+ var import_jsx_runtime49 = require("react/jsx-runtime");
13683
13939
  function Select({
13684
13940
  ...props
13685
13941
  }) {
13686
- 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 });
13687
13943
  }
13688
13944
  function SelectGroup({
13689
13945
  className,
13690
13946
  ...props
13691
13947
  }) {
13692
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
13948
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
13693
13949
  import_radix_ui2.Select.Group,
13694
13950
  {
13695
13951
  "data-slot": "select-group",
@@ -13701,7 +13957,7 @@ function SelectGroup({
13701
13957
  function SelectValue({
13702
13958
  ...props
13703
13959
  }) {
13704
- 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 });
13705
13961
  }
13706
13962
  function SelectTrigger({
13707
13963
  className,
@@ -13709,7 +13965,7 @@ function SelectTrigger({
13709
13965
  children,
13710
13966
  ...props
13711
13967
  }) {
13712
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
13968
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
13713
13969
  import_radix_ui2.Select.Trigger,
13714
13970
  {
13715
13971
  "data-slot": "select-trigger",
@@ -13721,7 +13977,7 @@ function SelectTrigger({
13721
13977
  ...props,
13722
13978
  children: [
13723
13979
  children,
13724
- /* @__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" }) })
13725
13981
  ]
13726
13982
  }
13727
13983
  );
@@ -13733,7 +13989,7 @@ function SelectContent({
13733
13989
  align = "center",
13734
13990
  ...props
13735
13991
  }) {
13736
- 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)(
13737
13993
  import_radix_ui2.Select.Content,
13738
13994
  {
13739
13995
  "data-slot": "select-content",
@@ -13743,8 +13999,8 @@ function SelectContent({
13743
13999
  align,
13744
14000
  ...props,
13745
14001
  children: [
13746
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SelectScrollUpButton, {}),
13747
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14002
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SelectScrollUpButton, {}),
14003
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
13748
14004
  import_radix_ui2.Select.Viewport,
13749
14005
  {
13750
14006
  "data-position": position,
@@ -13755,7 +14011,7 @@ function SelectContent({
13755
14011
  children
13756
14012
  }
13757
14013
  ),
13758
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SelectScrollDownButton, {})
14014
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SelectScrollDownButton, {})
13759
14015
  ]
13760
14016
  }
13761
14017
  ) });
@@ -13765,7 +14021,7 @@ function SelectItem({
13765
14021
  children,
13766
14022
  ...props
13767
14023
  }) {
13768
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
14024
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
13769
14025
  import_radix_ui2.Select.Item,
13770
14026
  {
13771
14027
  "data-slot": "select-item",
@@ -13775,8 +14031,8 @@ function SelectItem({
13775
14031
  ),
13776
14032
  ...props,
13777
14033
  children: [
13778
- /* @__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" }) }) }),
13779
- /* @__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 })
13780
14036
  ]
13781
14037
  }
13782
14038
  );
@@ -13785,7 +14041,7 @@ function SelectScrollUpButton({
13785
14041
  className,
13786
14042
  ...props
13787
14043
  }) {
13788
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14044
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
13789
14045
  import_radix_ui2.Select.ScrollUpButton,
13790
14046
  {
13791
14047
  "data-slot": "select-scroll-up-button",
@@ -13794,7 +14050,7 @@ function SelectScrollUpButton({
13794
14050
  className
13795
14051
  ),
13796
14052
  ...props,
13797
- children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14053
+ children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
13798
14054
  import_lucide_react27.ChevronUpIcon,
13799
14055
  {}
13800
14056
  )
@@ -13805,7 +14061,7 @@ function SelectScrollDownButton({
13805
14061
  className,
13806
14062
  ...props
13807
14063
  }) {
13808
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14064
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
13809
14065
  import_radix_ui2.Select.ScrollDownButton,
13810
14066
  {
13811
14067
  "data-slot": "select-scroll-down-button",
@@ -13814,7 +14070,7 @@ function SelectScrollDownButton({
13814
14070
  className
13815
14071
  ),
13816
14072
  ...props,
13817
- children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
14073
+ children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
13818
14074
  import_lucide_react27.ChevronDownIcon,
13819
14075
  {}
13820
14076
  )
@@ -13823,9 +14079,9 @@ function SelectScrollDownButton({
13823
14079
  }
13824
14080
 
13825
14081
  // src/components/ui/slider.tsx
13826
- var React44 = __toESM(require("react"), 1);
14082
+ var React45 = __toESM(require("react"), 1);
13827
14083
  var import_radix_ui3 = require("radix-ui");
13828
- var import_jsx_runtime49 = require("react/jsx-runtime");
14084
+ var import_jsx_runtime50 = require("react/jsx-runtime");
13829
14085
  function Slider({
13830
14086
  className,
13831
14087
  defaultValue,
@@ -13834,11 +14090,11 @@ function Slider({
13834
14090
  max = 100,
13835
14091
  ...props
13836
14092
  }) {
13837
- const _values = React44.useMemo(
14093
+ const _values = React45.useMemo(
13838
14094
  () => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
13839
14095
  [value, defaultValue, min, max]
13840
14096
  );
13841
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
14097
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
13842
14098
  import_radix_ui3.Slider.Root,
13843
14099
  {
13844
14100
  "data-slot": "slider",
@@ -13852,12 +14108,12 @@ function Slider({
13852
14108
  ),
13853
14109
  ...props,
13854
14110
  children: [
13855
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
14111
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
13856
14112
  import_radix_ui3.Slider.Track,
13857
14113
  {
13858
14114
  "data-slot": "slider-track",
13859
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",
13860
- children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
14116
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
13861
14117
  import_radix_ui3.Slider.Range,
13862
14118
  {
13863
14119
  "data-slot": "slider-range",
@@ -13866,7 +14122,7 @@ function Slider({
13866
14122
  )
13867
14123
  }
13868
14124
  ),
13869
- 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)(
13870
14126
  import_radix_ui3.Slider.Thumb,
13871
14127
  {
13872
14128
  "data-slot": "slider-thumb",
@@ -13880,15 +14136,15 @@ function Slider({
13880
14136
  }
13881
14137
 
13882
14138
  // src/components/ui/toggle-group.tsx
13883
- var React46 = __toESM(require("react"), 1);
14139
+ var React47 = __toESM(require("react"), 1);
13884
14140
  var import_class_variance_authority3 = require("class-variance-authority");
13885
14141
  var import_radix_ui5 = require("radix-ui");
13886
14142
 
13887
14143
  // src/components/ui/toggle.tsx
13888
- var React45 = require("react");
14144
+ var React46 = require("react");
13889
14145
  var import_class_variance_authority2 = require("class-variance-authority");
13890
14146
  var import_radix_ui4 = require("radix-ui");
13891
- var import_jsx_runtime50 = require("react/jsx-runtime");
14147
+ var import_jsx_runtime51 = require("react/jsx-runtime");
13892
14148
  var toggleVariants = (0, import_class_variance_authority2.cva)(
13893
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",
13894
14150
  {
@@ -13911,8 +14167,8 @@ var toggleVariants = (0, import_class_variance_authority2.cva)(
13911
14167
  );
13912
14168
 
13913
14169
  // src/components/ui/toggle-group.tsx
13914
- var import_jsx_runtime51 = require("react/jsx-runtime");
13915
- var ToggleGroupContext = React46.createContext({
14170
+ var import_jsx_runtime52 = require("react/jsx-runtime");
14171
+ var ToggleGroupContext = React47.createContext({
13916
14172
  size: "default",
13917
14173
  variant: "default",
13918
14174
  spacing: 0,
@@ -13927,7 +14183,7 @@ function ToggleGroup({
13927
14183
  children,
13928
14184
  ...props
13929
14185
  }) {
13930
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
14186
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
13931
14187
  import_radix_ui5.ToggleGroup.Root,
13932
14188
  {
13933
14189
  "data-slot": "toggle-group",
@@ -13941,7 +14197,7 @@ function ToggleGroup({
13941
14197
  className
13942
14198
  ),
13943
14199
  ...props,
13944
- children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
14200
+ children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
13945
14201
  ToggleGroupContext.Provider,
13946
14202
  {
13947
14203
  value: { variant, size: size2, spacing, orientation },
@@ -13958,8 +14214,8 @@ function ToggleGroupItem({
13958
14214
  size: size2 = "default",
13959
14215
  ...props
13960
14216
  }) {
13961
- const context = React46.useContext(ToggleGroupContext);
13962
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
14217
+ const context = React47.useContext(ToggleGroupContext);
14218
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
13963
14219
  import_radix_ui5.ToggleGroup.Item,
13964
14220
  {
13965
14221
  "data-slot": "toggle-group-item",
@@ -14189,13 +14445,13 @@ function isPetEnabled(pet) {
14189
14445
  }
14190
14446
 
14191
14447
  // src/components/pet/PetPreview.tsx
14192
- var React47 = require("react");
14448
+ var React48 = require("react");
14193
14449
 
14194
14450
  // src/components/pet/petSpriteAtlas.ts
14195
14451
  var import_chatkit_types12 = require("@xpert-ai/chatkit-types");
14196
14452
 
14197
14453
  // src/components/pet/PetPreview.tsx
14198
- var import_jsx_runtime52 = require("react/jsx-runtime");
14454
+ var import_jsx_runtime53 = require("react/jsx-runtime");
14199
14455
  function escapeCssUrl(value) {
14200
14456
  return value.replace(/["\\]/g, "\\$&");
14201
14457
  }
@@ -14203,7 +14459,7 @@ function PetPreview({ src, label, className }) {
14203
14459
  const scale = 0.13;
14204
14460
  const width = import_chatkit_types12.petSpriteAtlas.cellWidth;
14205
14461
  const height = import_chatkit_types12.petSpriteAtlas.cellHeight;
14206
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
14462
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
14207
14463
  "span",
14208
14464
  {
14209
14465
  className: cn(
@@ -14212,7 +14468,7 @@ function PetPreview({ src, label, className }) {
14212
14468
  ),
14213
14469
  "aria-hidden": "true",
14214
14470
  title: label,
14215
- children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
14471
+ children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
14216
14472
  "span",
14217
14473
  {
14218
14474
  className: "absolute left-1/2 top-1/2 block",
@@ -14234,7 +14490,7 @@ function PetPreview({ src, label, className }) {
14234
14490
  }
14235
14491
 
14236
14492
  // src/components/settings/SettingsSheet.tsx
14237
- var import_jsx_runtime53 = require("react/jsx-runtime");
14493
+ var import_jsx_runtime54 = require("react/jsx-runtime");
14238
14494
  var CHARACTER_TYPES2 = [
14239
14495
  "builtin",
14240
14496
  "atlas"
@@ -14250,13 +14506,13 @@ function SettingsSheet({
14250
14506
  onSave
14251
14507
  }) {
14252
14508
  const { t } = useChatkitTranslation();
14253
- const [draft, setDraft] = React48.useState(settings);
14254
- React48.useEffect(() => {
14509
+ const [draft, setDraft] = React49.useState(settings);
14510
+ React49.useEffect(() => {
14255
14511
  if (open) {
14256
14512
  setDraft(petRequired ? { ...settings, enabled: true } : settings);
14257
14513
  }
14258
14514
  }, [open, petRequired, settings]);
14259
- const updateDraft = React48.useCallback(
14515
+ const updateDraft = React49.useCallback(
14260
14516
  (patch) => {
14261
14517
  setDraft((previous) => ({ ...previous, ...patch }));
14262
14518
  },
@@ -14274,23 +14530,23 @@ function SettingsSheet({
14274
14530
  defaultValue: selectedBuiltinPet.label
14275
14531
  }
14276
14532
  );
14277
- 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: [
14278
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SheetHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex items-center gap-2", children: [
14279
- /* @__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 }) }),
14280
- /* @__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") })
14281
14537
  ] }) }),
14282
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("form", { className: "mt-6 space-y-5", onSubmit: handleSubmit, children: [
14283
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("section", { className: "space-y-5", children: [
14284
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex items-center gap-2", children: [
14285
- /* @__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 }) }),
14286
- /* @__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") })
14287
14543
  ] }),
14288
- /* @__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: [
14289
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("span", { className: "min-w-0", children: [
14290
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "block text-sm font-medium", children: t("pet.settings.enabled") }),
14291
- 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") })
14292
14548
  ] }),
14293
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
14549
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
14294
14550
  "button",
14295
14551
  {
14296
14552
  type: "button",
@@ -14303,7 +14559,7 @@ function SettingsSheet({
14303
14559
  draft.enabled ? "bg-primary" : "bg-muted-foreground/20",
14304
14560
  petRequired ? "cursor-not-allowed opacity-70" : ""
14305
14561
  ].join(" "),
14306
- children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
14562
+ children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
14307
14563
  "span",
14308
14564
  {
14309
14565
  className: [
@@ -14316,9 +14572,9 @@ function SettingsSheet({
14316
14572
  )
14317
14573
  ] })
14318
14574
  ] }),
14319
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "space-y-2", children: [
14320
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { id: "chatkit-pet-type-label", className: "text-sm font-medium", children: t("pet.settings.characterType") }),
14321
- /* @__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)(
14322
14578
  ToggleGroup,
14323
14579
  {
14324
14580
  id: "chatkit-pet-type",
@@ -14333,7 +14589,7 @@ function SettingsSheet({
14333
14589
  variant: "outline",
14334
14590
  spacing: 2,
14335
14591
  className: "!w-full",
14336
- children: CHARACTER_TYPES2.map((type) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
14592
+ children: CHARACTER_TYPES2.map((type) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
14337
14593
  ToggleGroupItem,
14338
14594
  {
14339
14595
  value: type,
@@ -14345,8 +14601,8 @@ function SettingsSheet({
14345
14601
  }
14346
14602
  )
14347
14603
  ] }),
14348
- draft.characterType === "builtin" && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "space-y-2", children: [
14349
- /* @__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)(
14350
14606
  "label",
14351
14607
  {
14352
14608
  htmlFor: "chatkit-pet-builtin",
@@ -14354,7 +14610,7 @@ function SettingsSheet({
14354
14610
  children: t("pet.settings.builtin")
14355
14611
  }
14356
14612
  ),
14357
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
14613
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
14358
14614
  Select,
14359
14615
  {
14360
14616
  value: selectedBuiltinPet.id,
@@ -14365,26 +14621,26 @@ function SettingsSheet({
14365
14621
  }
14366
14622
  },
14367
14623
  children: [
14368
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
14624
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
14369
14625
  SelectTrigger,
14370
14626
  {
14371
14627
  id: "chatkit-pet-builtin",
14372
14628
  className: "min-h-12 w-full px-3 py-2",
14373
- children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SelectValue, { placeholder: selectedBuiltinPetLabel })
14629
+ children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectValue, { placeholder: selectedBuiltinPetLabel })
14374
14630
  }
14375
14631
  ),
14376
- /* @__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) => {
14377
14633
  const label = t(`pet.settings.builtins.${pet.id}`, {
14378
14634
  defaultValue: pet.label
14379
14635
  });
14380
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
14636
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
14381
14637
  SelectItem,
14382
14638
  {
14383
14639
  value: pet.id,
14384
14640
  className: "min-h-10 py-1.5 pl-2 pr-8",
14385
- children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("span", { className: "flex min-w-0 items-center gap-2", children: [
14386
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(PetPreview, { src: pet.previewSrc, label }),
14387
- /* @__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 })
14388
14644
  ] })
14389
14645
  },
14390
14646
  pet.id
@@ -14394,8 +14650,8 @@ function SettingsSheet({
14394
14650
  }
14395
14651
  )
14396
14652
  ] }),
14397
- draft.characterType === "atlas" && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "space-y-2", children: [
14398
- /* @__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)(
14399
14655
  "label",
14400
14656
  {
14401
14657
  className: "text-sm font-medium",
@@ -14403,7 +14659,7 @@ function SettingsSheet({
14403
14659
  children: t("pet.settings.atlasUrl")
14404
14660
  }
14405
14661
  ),
14406
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
14662
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
14407
14663
  Input,
14408
14664
  {
14409
14665
  id: "chatkit-pet-atlas",
@@ -14413,15 +14669,15 @@ function SettingsSheet({
14413
14669
  }
14414
14670
  )
14415
14671
  ] }),
14416
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "space-y-2", children: [
14417
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
14418
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("label", { className: "text-sm font-medium", htmlFor: "chatkit-pet-scale", children: t("pet.settings.scale") }),
14419
- /* @__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: [
14420
14676
  draft.scale.toFixed(2),
14421
14677
  "x"
14422
14678
  ] })
14423
14679
  ] }),
14424
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
14680
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
14425
14681
  Slider,
14426
14682
  {
14427
14683
  id: "chatkit-pet-scale",
@@ -14435,8 +14691,8 @@ function SettingsSheet({
14435
14691
  }
14436
14692
  )
14437
14693
  ] }),
14438
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("label", { className: "flex items-center gap-2 text-sm", children: [
14439
- /* @__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)(
14440
14696
  "input",
14441
14697
  {
14442
14698
  type: "checkbox",
@@ -14447,8 +14703,8 @@ function SettingsSheet({
14447
14703
  ),
14448
14704
  t("pet.settings.draggable")
14449
14705
  ] }),
14450
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("label", { className: "flex items-center gap-2 text-sm", children: [
14451
- /* @__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)(
14452
14708
  "input",
14453
14709
  {
14454
14710
  type: "checkbox",
@@ -14459,8 +14715,8 @@ function SettingsSheet({
14459
14715
  ),
14460
14716
  t("pet.settings.persistPosition")
14461
14717
  ] }),
14462
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex justify-end gap-2 pt-2", children: [
14463
- /* @__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)(
14464
14720
  Button,
14465
14721
  {
14466
14722
  type: "button",
@@ -14469,7 +14725,7 @@ function SettingsSheet({
14469
14725
  children: t("pet.settings.cancel")
14470
14726
  }
14471
14727
  ),
14472
- /* @__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") })
14473
14729
  ] })
14474
14730
  ] })
14475
14731
  ] }) });
@@ -15095,8 +15351,260 @@ function findDomPointForComposerOffset(root, offset) {
15095
15351
  return result ?? { node: lastNode, offset: lastOffset };
15096
15352
  }
15097
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
+
15098
15606
  // src/components/chat.tsx
15099
- var import_jsx_runtime54 = require("react/jsx-runtime");
15607
+ var import_jsx_runtime55 = require("react/jsx-runtime");
15100
15608
  var import_meta2 = {};
15101
15609
  var defaultApiUrl2 = import_meta2.env.VITE_XPERTAI_API_URL;
15102
15610
  var COMPOSER_INPUT_MAX_HEIGHT = 128;
@@ -15242,7 +15750,7 @@ function ReferenceChip({
15242
15750
  const metaLine = getReferenceMetaLine(reference);
15243
15751
  const isComposer = variant === "composer";
15244
15752
  const Icon = reference.type === "quote" ? import_lucide_react29.Quote : reference.type === "image" ? import_lucide_react29.ImageIcon : import_lucide_react29.FileText;
15245
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
15753
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
15246
15754
  "div",
15247
15755
  {
15248
15756
  className: cn(
@@ -15251,7 +15759,7 @@ function ReferenceChip({
15251
15759
  ),
15252
15760
  title: getReferenceTitle(reference),
15253
15761
  children: [
15254
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
15762
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
15255
15763
  Icon,
15256
15764
  {
15257
15765
  size: isComposer ? 14 : 12,
@@ -15261,8 +15769,8 @@ function ReferenceChip({
15261
15769
  )
15262
15770
  }
15263
15771
  ),
15264
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "min-w-0 flex-1", children: [
15265
- /* @__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)(
15266
15774
  "div",
15267
15775
  {
15268
15776
  className: cn(
@@ -15272,7 +15780,7 @@ function ReferenceChip({
15272
15780
  children: getReferenceLabel(reference)
15273
15781
  }
15274
15782
  ),
15275
- metaLine && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
15783
+ metaLine && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
15276
15784
  "div",
15277
15785
  {
15278
15786
  className: cn(
@@ -15283,7 +15791,7 @@ function ReferenceChip({
15283
15791
  }
15284
15792
  )
15285
15793
  ] }),
15286
- onRemove && removeLabel && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
15794
+ onRemove && removeLabel && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
15287
15795
  "button",
15288
15796
  {
15289
15797
  type: "button",
@@ -15294,7 +15802,7 @@ function ReferenceChip({
15294
15802
  ),
15295
15803
  title: removeLabel,
15296
15804
  "aria-label": removeLabel,
15297
- 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 })
15298
15806
  }
15299
15807
  )
15300
15808
  ]
@@ -15309,35 +15817,36 @@ function Chat({
15309
15817
  clientSecret = "",
15310
15818
  isClientSecretInitializing = false
15311
15819
  }) {
15312
- const { t } = useChatkitTranslation();
15820
+ const { t, i18n: i18n2 } = useChatkitTranslation();
15313
15821
  const composer = options?.composer;
15314
15822
  const startScreen = options?.startScreen;
15315
15823
  const history = options?.history;
15316
15824
  const disclaimer = options?.disclaimer;
15317
15825
  const apiUrl = options?.api?.apiUrl || defaultApiUrl2;
15826
+ const messageNavigationEnabled = options?.messageNavigation?.enabled !== false;
15318
15827
  const { setStream } = useStreamManager();
15319
15828
  const stream = useStreamContext();
15320
15829
  const { theme } = useTheme();
15321
- const [isHistoryLoading, setIsHistoryLoading] = React49.useState(false);
15322
- const [historyError, setHistoryError] = React49.useState(null);
15323
- const [assistantName, setAssistantName] = React49.useState(null);
15324
- const [assistantAvatar, setAssistantAvatar] = React49.useState(null);
15325
- const [threadGoal, setThreadGoal] = React49.useState(null);
15326
- const [goalError, setGoalError] = React49.useState(null);
15327
- const [isGoalLoading, setIsGoalLoading] = React49.useState(false);
15328
- const [isGoalPanelOpen, setIsGoalPanelOpen] = React49.useState(false);
15329
- const [isGoalObjectiveExpanded, setIsGoalObjectiveExpanded] = React49.useState(false);
15330
- 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);
15331
15840
  const LOADING_DOTS_MIN_DURATION = 800;
15332
15841
  const STREAMING_STATUS_REFRESH_MS = 250;
15333
- const [showLoadingDots, setShowLoadingDots] = React49.useState(false);
15334
- const [streamingNow, setStreamingNow] = React49.useState(() => Date.now());
15335
- const loadingStartTimeRef = React49.useRef(null);
15336
- const lastStreamOutputAtRef = React49.useRef(null);
15337
- 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(() => {
15338
15847
  setStream(stream);
15339
15848
  }, [setStream, stream]);
15340
- React49.useEffect(() => {
15849
+ React50.useEffect(() => {
15341
15850
  if (stream.isLoading) {
15342
15851
  if (!loadingStartTimeRef.current) {
15343
15852
  loadingStartTimeRef.current = Date.now();
@@ -15360,7 +15869,7 @@ function Chat({
15360
15869
  }
15361
15870
  }
15362
15871
  }, [stream.isLoading]);
15363
- React49.useEffect(() => {
15872
+ React50.useEffect(() => {
15364
15873
  if (!stream.isLoading) {
15365
15874
  lastStreamOutputAtRef.current = null;
15366
15875
  setStreamingNow(Date.now());
@@ -15370,7 +15879,7 @@ function Chat({
15370
15879
  lastStreamOutputAtRef.current = now;
15371
15880
  setStreamingNow(now);
15372
15881
  }, [stream.messages, stream.isLoading]);
15373
- React49.useEffect(() => {
15882
+ React50.useEffect(() => {
15374
15883
  if (!stream.isLoading) {
15375
15884
  return;
15376
15885
  }
@@ -15379,7 +15888,7 @@ function Chat({
15379
15888
  }, STREAMING_STATUS_REFRESH_MS);
15380
15889
  return () => window.clearInterval(timer);
15381
15890
  }, [stream.isLoading]);
15382
- React49.useEffect(() => {
15891
+ React50.useEffect(() => {
15383
15892
  if (threadGoal?.status === "active" && stream.isLoading) {
15384
15893
  setGoalElapsedStartedAt(Date.now());
15385
15894
  return;
@@ -15391,82 +15900,86 @@ function Chat({
15391
15900
  threadGoal?.id,
15392
15901
  threadGoal?.status
15393
15902
  ]);
15394
- React49.useEffect(() => {
15903
+ React50.useEffect(() => {
15395
15904
  setIsGoalObjectiveExpanded(false);
15396
15905
  }, [threadGoal?.id]);
15397
- const [composerParts, setComposerParts] = React49.useState([]);
15398
- const [renderedComposerParts, setRenderedComposerParts] = React49.useState([]);
15399
- const [composerDomVersion, setComposerDomVersion] = React49.useState(0);
15400
- 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(
15401
15910
  null
15402
15911
  );
15403
- const [planModeEnabled, setPlanModeEnabled] = React49.useState(false);
15404
- const [petSettingsOpen, setPetSettingsOpen] = React49.useState(false);
15405
- const [petLocalSettings, setPetLocalSettings] = React49.useState(() => readPetLocalSettings());
15406
- const [runtimeCapabilities, setRuntimeCapabilities] = React49.useState(null);
15407
- const [runtimeCapabilitiesReady, setRuntimeCapabilitiesReady] = React49.useState(false);
15408
- 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(
15409
15918
  () => createEmptyRuntimeCapabilitiesSelection()
15410
15919
  );
15411
- const [runRuntimeCapabilities, setRunRuntimeCapabilities] = React49.useState(
15920
+ const [runRuntimeCapabilities, setRunRuntimeCapabilities] = React50.useState(
15412
15921
  () => createEmptyRuntimeCapabilitiesSelection()
15413
15922
  );
15414
- const [runtimeCapabilityPalette, setRuntimeCapabilityPalette] = React49.useState(null);
15415
- const [attachmentState, setAttachmentState] = React49.useState({
15923
+ const [runtimeCapabilityPalette, setRuntimeCapabilityPalette] = React50.useState(null);
15924
+ const [attachmentState, setAttachmentState] = React50.useState({
15416
15925
  uploadedFiles: [],
15417
15926
  hasUploadingFiles: false,
15418
15927
  hasParsingFiles: false
15419
15928
  });
15420
- const [references, setReferences] = React49.useState([]);
15421
- const [isUploadingReferenceImages, setIsUploadingReferenceImages] = React49.useState(false);
15422
- const [quoteSelection, setQuoteSelection] = React49.useState(null);
15423
- const [isAtBottom, setIsAtBottom] = React49.useState(true);
15424
- 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);
15425
15934
  const {
15426
15935
  threads,
15427
15936
  deleteThread,
15428
15937
  refreshThreads,
15429
15938
  isLoading: isThreadsLoading
15430
15939
  } = useThreads();
15431
- const viewportRef = React49.useRef(null);
15432
- const attachmentsRef = React49.useRef(null);
15433
- const composerInputRef = React49.useRef(null);
15434
- const slashPaletteRef = React49.useRef(null);
15435
- 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(
15436
15948
  []
15437
15949
  );
15438
- const composerPartsRef = React49.useRef([]);
15439
- const pendingComposerCaretOffsetRef = React49.useRef(null);
15440
- const shouldAutoScrollRef = React49.useRef(true);
15441
- const forceFollowRef = React49.useRef(false);
15442
- const previousMessageCountRef = React49.useRef(0);
15443
- const previousScrollTopRef = React49.useRef(0);
15444
- const isPrependingHistoryMessagesRef = React49.useRef(false);
15445
- const autoScrollFrameRef = React49.useRef(null);
15446
- const isPointerDownRef = React49.useRef(false);
15447
- const lastTouchYRef = React49.useRef(null);
15448
- 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);
15449
15961
  const resolvedTitle = title ?? t("chat.title");
15450
15962
  const resolvedPlaceholder = placeholder ?? t("chat.placeholder");
15963
+ const assistantTitle = assistantName || resolvedTitle;
15451
15964
  const petRequired = options?.displayMode === "pet";
15452
- const basePetSettings = React49.useMemo(
15965
+ const basePetSettings = React50.useMemo(
15453
15966
  () => derivePetLocalSettings(options?.pet),
15454
15967
  [options?.pet]
15455
15968
  );
15456
- const displayedPetSettings = React49.useMemo(
15969
+ const displayedPetSettings = React50.useMemo(
15457
15970
  () => ({
15458
15971
  ...petLocalSettings ?? basePetSettings,
15459
15972
  ...petRequired ? { enabled: true } : {}
15460
15973
  }),
15461
15974
  [basePetSettings, petLocalSettings, petRequired]
15462
15975
  );
15463
- const effectivePet = React49.useMemo(() => {
15976
+ const effectivePet = React50.useMemo(() => {
15464
15977
  if (petRequired || petLocalSettings) {
15465
15978
  return buildPetOptionsFromLocalSettings(displayedPetSettings);
15466
15979
  }
15467
15980
  return options?.pet ?? null;
15468
15981
  }, [displayedPetSettings, options?.pet, petLocalSettings, petRequired]);
15469
- const savePetLocalSettings = React49.useCallback(
15982
+ const savePetLocalSettings = React50.useCallback(
15470
15983
  (settings) => {
15471
15984
  const nextSettings = petRequired ? { ...settings, enabled: true } : settings;
15472
15985
  setPetLocalSettings(nextSettings);
@@ -15474,7 +15987,7 @@ function Chat({
15474
15987
  },
15475
15988
  [petRequired]
15476
15989
  );
15477
- const handlePetCommand = React49.useCallback(
15990
+ const handlePetCommand = React50.useCallback(
15478
15991
  (mode) => {
15479
15992
  if (mode === "settings") {
15480
15993
  setPetSettingsOpen(true);
@@ -15496,16 +16009,53 @@ function Chat({
15496
16009
  [displayedPetSettings, effectivePet, petRequired, savePetLocalSettings]
15497
16010
  );
15498
16011
  const inputPlaceholder = selectedTool?.placeholderOverride ?? composer?.placeholder ?? resolvedPlaceholder;
15499
- const messages = React49.useMemo(
16012
+ const messages = React50.useMemo(
15500
16013
  () => stream.messages ?? [],
15501
16014
  [stream.messages]
15502
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;
15503
16053
  const historyMessagePagination = stream.historyMessagePagination;
15504
16054
  const isLoadingMoreMessages = Boolean(
15505
16055
  historyMessagePagination?.isLoadingMore
15506
16056
  );
15507
16057
  const canLoadMoreMessages = Boolean(historyMessagePagination?.hasMore);
15508
- const draft = React49.useMemo(
16058
+ const draft = React50.useMemo(
15509
16059
  () => getComposerPlainText(composerParts),
15510
16060
  [composerParts]
15511
16061
  );
@@ -15519,7 +16069,7 @@ function Chat({
15519
16069
  isEmpty: isComposerInputEmpty,
15520
16070
  isStacked: isComposerStacked
15521
16071
  });
15522
- const pendingFollowUps = React49.useMemo(
16072
+ const pendingFollowUps = React50.useMemo(
15523
16073
  () => sortVisiblePendingFollowUps(stream.pendingFollowUps ?? []),
15524
16074
  [stream.pendingFollowUps]
15525
16075
  );
@@ -15528,21 +16078,18 @@ function Chat({
15528
16078
  const hasPendingHITLRequest = Boolean(stream.pendingHITLRequest);
15529
16079
  const hasPendingInteractiveRequest = hasPendingRequestUserInput || hasPendingHITLRequest;
15530
16080
  const hasPendingTodos = Boolean(stream.todos?.items.length);
15531
- const runtimeCapabilityOptions = React49.useMemo(
16081
+ const runtimeCapabilityOptions = React50.useMemo(
15532
16082
  () => getRuntimeCapabilityOptions(runtimeCapabilities),
15533
16083
  [runtimeCapabilities]
15534
16084
  );
15535
- const goalAdapter = React49.useMemo(
15536
- () => {
15537
- if (isGoalAdapter(options?.goal)) {
15538
- return options.goal;
15539
- }
15540
- return supportsXpertThreadGoalAdapter(stream.client) ? createXpertThreadGoalAdapter(stream.client) : null;
15541
- },
15542
- [options?.goal, stream.client]
15543
- );
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]);
15544
16091
  const displayedGoalElapsedSeconds = threadGoal ? (threadGoal.elapsedSeconds ?? 0) + (goalElapsedStartedAt ? Math.max(0, Math.floor((streamingNow - goalElapsedStartedAt) / 1e3)) : 0) : 0;
15545
- const effectiveSessionRuntimeCapabilities = React49.useMemo(
16092
+ const effectiveSessionRuntimeCapabilities = React50.useMemo(
15546
16093
  () => runtimeCapabilitiesReady && runtimeCapabilities ? mergeRuntimeCapabilitiesSelections(
15547
16094
  runtimeCapabilities,
15548
16095
  sessionRuntimeCapabilities
@@ -15555,7 +16102,7 @@ function Chat({
15555
16102
  "goal"
15556
16103
  );
15557
16104
  const showGoalStatus = goalCommandAvailable && !hasCompletedGoal && (Boolean(goalError) || threadGoal?.status === "active" && stream.isLoading);
15558
- const runRuntimeCapabilityOptions = React49.useMemo(
16105
+ const runRuntimeCapabilityOptions = React50.useMemo(
15559
16106
  () => runtimeCapabilityOptions.filter(
15560
16107
  (option) => isRuntimeCapabilitySelected(
15561
16108
  runRuntimeCapabilities,
@@ -15565,11 +16112,11 @@ function Chat({
15565
16112
  ),
15566
16113
  [runRuntimeCapabilities, runtimeCapabilityOptions]
15567
16114
  );
15568
- const composerRuntimeCapabilitySelectionKeys = React49.useMemo(
16115
+ const composerRuntimeCapabilitySelectionKeys = React50.useMemo(
15569
16116
  () => getComposerCapabilitySelectionKeys(composerParts),
15570
16117
  [composerParts]
15571
16118
  );
15572
- const detachedRunRuntimeCapabilityOptions = React49.useMemo(
16119
+ const detachedRunRuntimeCapabilityOptions = React50.useMemo(
15573
16120
  () => runRuntimeCapabilityOptions.filter(
15574
16121
  (option) => !composerRuntimeCapabilitySelectionKeys.has(
15575
16122
  getRuntimeCapabilityOptionKey(option)
@@ -15577,7 +16124,7 @@ function Chat({
15577
16124
  ),
15578
16125
  [composerRuntimeCapabilitySelectionKeys, runRuntimeCapabilityOptions]
15579
16126
  );
15580
- const persistSessionRuntimeCapabilities = React49.useCallback(
16127
+ const persistSessionRuntimeCapabilities = React50.useCallback(
15581
16128
  async (threadId, selection) => {
15582
16129
  if (!runtimeCapabilities || !selection) {
15583
16130
  return;
@@ -15602,10 +16149,10 @@ function Chat({
15602
16149
  },
15603
16150
  [runtimeCapabilities, stream.client]
15604
16151
  );
15605
- const clearQuoteSelection = React49.useCallback(() => {
16152
+ const clearQuoteSelection = React50.useCallback(() => {
15606
16153
  setQuoteSelection(null);
15607
16154
  }, []);
15608
- const commitComposerParts = React49.useCallback(
16155
+ const commitComposerParts = React50.useCallback(
15609
16156
  (nextParts, options2) => {
15610
16157
  const normalized = normalizeComposerParts(nextParts);
15611
16158
  const previous = composerPartsRef.current;
@@ -15641,7 +16188,7 @@ function Chat({
15641
16188
  },
15642
16189
  []
15643
16190
  );
15644
- const setComposerText = React49.useCallback(
16191
+ const setComposerText = React50.useCallback(
15645
16192
  (text, caretOffset = text.length) => {
15646
16193
  commitComposerParts(createComposerTextParts(text), {
15647
16194
  caretOffset,
@@ -15651,7 +16198,7 @@ function Chat({
15651
16198
  },
15652
16199
  [commitComposerParts]
15653
16200
  );
15654
- const focusComposerAt = React49.useCallback((position) => {
16201
+ const focusComposerAt = React50.useCallback((position) => {
15655
16202
  const nextPosition = position ?? getComposerEditingLength(composerPartsRef.current);
15656
16203
  pendingComposerCaretOffsetRef.current = nextPosition;
15657
16204
  requestAnimationFrame(() => {
@@ -15663,7 +16210,7 @@ function Chat({
15663
16210
  });
15664
16211
  }, []);
15665
16212
  const parentMessenger = useParentMessenger({
15666
- onSetComposerValue: React49.useCallback(
16213
+ onSetComposerValue: React50.useCallback(
15667
16214
  (payload) => {
15668
16215
  if (!payload) {
15669
16216
  return;
@@ -15686,10 +16233,10 @@ function Chat({
15686
16233
  },
15687
16234
  [composer?.tools, setComposerText]
15688
16235
  ),
15689
- onFocusComposer: React49.useCallback(() => {
16236
+ onFocusComposer: React50.useCallback(() => {
15690
16237
  composerInputRef.current?.focus();
15691
16238
  }, []),
15692
- onSetPetEnabled: React49.useCallback(
16239
+ onSetPetEnabled: React50.useCallback(
15693
16240
  (enabled) => {
15694
16241
  if (petRequired) {
15695
16242
  return;
@@ -15703,10 +16250,10 @@ function Chat({
15703
16250
  )
15704
16251
  });
15705
16252
  const canMinimizeToPet = parentMessenger?.isParentAvailable === true && isPetEnabled(effectivePet);
15706
- const handleMinimizeToPet = React49.useCallback(() => {
16253
+ const handleMinimizeToPet = React50.useCallback(() => {
15707
16254
  parentMessenger?.sendEvent("chat_minimize_change", { minimized: true });
15708
16255
  }, [parentMessenger]);
15709
- const syncQuoteSelection = React49.useCallback(() => {
16256
+ const syncQuoteSelection = React50.useCallback(() => {
15710
16257
  if (typeof window === "undefined") {
15711
16258
  clearQuoteSelection();
15712
16259
  return;
@@ -15751,23 +16298,23 @@ function Chat({
15751
16298
  left
15752
16299
  });
15753
16300
  }, [clearQuoteSelection]);
15754
- const cancelPendingAutoScroll = React49.useCallback(() => {
16301
+ const cancelPendingAutoScroll = React50.useCallback(() => {
15755
16302
  if (autoScrollFrameRef.current !== null) {
15756
16303
  cancelAnimationFrame(autoScrollFrameRef.current);
15757
16304
  autoScrollFrameRef.current = null;
15758
16305
  }
15759
16306
  }, []);
15760
- const disableAutoFollow = React49.useCallback(() => {
16307
+ const disableAutoFollow = React50.useCallback(() => {
15761
16308
  forceFollowRef.current = false;
15762
16309
  shouldAutoScrollRef.current = false;
15763
16310
  cancelPendingAutoScroll();
15764
16311
  }, [cancelPendingAutoScroll]);
15765
- const enableAutoFollow = React49.useCallback(() => {
16312
+ const enableAutoFollow = React50.useCallback(() => {
15766
16313
  forceFollowRef.current = true;
15767
16314
  shouldAutoScrollRef.current = true;
15768
16315
  setHasUpdatesBelow(false);
15769
16316
  }, []);
15770
- const scrollToBottom = React49.useCallback(
16317
+ const scrollToBottom = React50.useCallback(
15771
16318
  (smooth = false, force = false) => {
15772
16319
  if (force) {
15773
16320
  enableAutoFollow();
@@ -15794,7 +16341,25 @@ function Chat({
15794
16341
  },
15795
16342
  [cancelPendingAutoScroll, enableAutoFollow]
15796
16343
  );
15797
- 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(() => {
15798
16363
  const viewport = viewportRef.current;
15799
16364
  if (!viewport) return;
15800
16365
  previousScrollTopRef.current = viewport.scrollTop;
@@ -15875,14 +16440,14 @@ function Chat({
15875
16440
  window.removeEventListener("pointercancel", stopPointerTracking);
15876
16441
  };
15877
16442
  }, [cancelPendingAutoScroll, disableAutoFollow]);
15878
- React49.useEffect(() => {
16443
+ React50.useEffect(() => {
15879
16444
  shouldAutoScrollRef.current = true;
15880
16445
  forceFollowRef.current = false;
15881
16446
  previousScrollTopRef.current = 0;
15882
16447
  setIsAtBottom(true);
15883
16448
  setHasUpdatesBelow(false);
15884
16449
  }, [stream.threadId]);
15885
- React49.useEffect(() => {
16450
+ React50.useEffect(() => {
15886
16451
  const messageCountChanged = messages.length !== previousMessageCountRef.current;
15887
16452
  previousMessageCountRef.current = messages.length;
15888
16453
  if (isPrependingHistoryMessagesRef.current) {
@@ -15905,7 +16470,7 @@ function Chat({
15905
16470
  clientSecret: effectiveClientSecret
15906
16471
  });
15907
16472
  const missingConfig = Boolean(missingConfigKind);
15908
- const missingConfigShortMessage = React49.useMemo(() => {
16473
+ const missingConfigShortMessage = React50.useMemo(() => {
15909
16474
  switch (missingConfigKind) {
15910
16475
  case "apiUrl":
15911
16476
  return t("chat.missingApiUrlShort");
@@ -15917,7 +16482,7 @@ function Chat({
15917
16482
  return t("chat.missingConfigShort");
15918
16483
  }
15919
16484
  }, [missingConfigKind, t]);
15920
- const missingConfigDetailMessage = React49.useMemo(() => {
16485
+ const missingConfigDetailMessage = React50.useMemo(() => {
15921
16486
  switch (missingConfigKind) {
15922
16487
  case "apiUrl":
15923
16488
  return t("chat.missingApiUrlDetail");
@@ -15934,7 +16499,7 @@ function Chat({
15934
16499
  const isSubmissionBlocked = hasPendingInteractiveRequest || missingConfig || isHistoryLoading || hasUploadingFiles || isUploadingReferenceImages;
15935
16500
  const isSendDisabled = !trimmedDraft && !hasReferences || isSubmissionBlocked;
15936
16501
  const isPromptEditDisabled = hasPendingInteractiveRequest || missingConfig || isHistoryLoading;
15937
- const resizeComposerInput = React49.useCallback(() => {
16502
+ const resizeComposerInput = React50.useCallback(() => {
15938
16503
  const input = composerInputRef.current;
15939
16504
  if (!input) {
15940
16505
  return;
@@ -15942,7 +16507,7 @@ function Chat({
15942
16507
  input.style.maxHeight = `${COMPOSER_INPUT_MAX_HEIGHT}px`;
15943
16508
  input.style.overflowY = input.scrollHeight > COMPOSER_INPUT_MAX_HEIGHT ? "auto" : "hidden";
15944
16509
  }, []);
15945
- React49.useLayoutEffect(() => {
16510
+ React50.useLayoutEffect(() => {
15946
16511
  composerPartsRef.current = composerParts;
15947
16512
  resizeComposerInput();
15948
16513
  const caretOffset = pendingComposerCaretOffsetRef.current;
@@ -15954,13 +16519,13 @@ function Chat({
15954
16519
  }
15955
16520
  }
15956
16521
  }, [composerDomVersion, composerParts, resizeComposerInput]);
15957
- React49.useEffect(() => {
16522
+ React50.useEffect(() => {
15958
16523
  document.addEventListener("selectionchange", syncQuoteSelection);
15959
16524
  return () => {
15960
16525
  document.removeEventListener("selectionchange", syncQuoteSelection);
15961
16526
  };
15962
16527
  }, [syncQuoteSelection]);
15963
- React49.useEffect(() => {
16528
+ React50.useEffect(() => {
15964
16529
  const viewport = viewportRef.current;
15965
16530
  if (!viewport) {
15966
16531
  return;
@@ -15977,14 +16542,14 @@ function Chat({
15977
16542
  window.removeEventListener("resize", handleViewportScroll);
15978
16543
  };
15979
16544
  }, [clearQuoteSelection]);
15980
- React49.useEffect(() => {
16545
+ React50.useEffect(() => {
15981
16546
  clearQuoteSelection();
15982
16547
  }, [messages.length, stream.threadId, clearQuoteSelection]);
15983
- React49.useEffect(() => {
16548
+ React50.useEffect(() => {
15984
16549
  if (missingConfig) return;
15985
16550
  void refreshThreads();
15986
16551
  }, [missingConfig, refreshThreads]);
15987
- React49.useEffect(() => {
16552
+ React50.useEffect(() => {
15988
16553
  if (missingConfig || !stream.client || !stream.assistantId) {
15989
16554
  setAssistantName(null);
15990
16555
  setAssistantAvatar(null);
@@ -16007,7 +16572,7 @@ function Chat({
16007
16572
  cancelled = true;
16008
16573
  };
16009
16574
  }, [missingConfig, stream.client, stream.assistantId]);
16010
- React49.useEffect(() => {
16575
+ React50.useEffect(() => {
16011
16576
  if (missingConfig || !stream.client || !stream.assistantId) {
16012
16577
  setRuntimeCapabilities(null);
16013
16578
  setRuntimeCapabilitiesReady(false);
@@ -16054,7 +16619,7 @@ function Chat({
16054
16619
  });
16055
16620
  return () => controller.abort();
16056
16621
  }, [missingConfig, stream.client, stream.assistantId]);
16057
- React49.useEffect(() => {
16622
+ React50.useEffect(() => {
16058
16623
  setRunRuntimeCapabilities(
16059
16624
  createEmptyRuntimeCapabilitiesSelection(runtimeCapabilities)
16060
16625
  );
@@ -16103,10 +16668,10 @@ function Chat({
16103
16668
  stream.client,
16104
16669
  stream.threadId
16105
16670
  ]);
16106
- React49.useEffect(() => {
16671
+ React50.useEffect(() => {
16107
16672
  setThreadGoal(stream.threadGoal);
16108
16673
  }, [stream.threadGoal]);
16109
- React49.useEffect(() => {
16674
+ React50.useEffect(() => {
16110
16675
  const threadId = stream.threadId?.trim();
16111
16676
  if (!threadId || !goalCommandAvailable) {
16112
16677
  setThreadGoal(null);
@@ -16147,7 +16712,7 @@ function Chat({
16147
16712
  return () => controller.abort();
16148
16713
  }, [goalAdapter, goalCommandAvailable, stream.threadId]);
16149
16714
  const uploadedFiles = attachmentState.uploadedFiles;
16150
- const handleSessionRuntimeCapabilityToggle = React49.useCallback(
16715
+ const handleSessionRuntimeCapabilityToggle = React50.useCallback(
16151
16716
  (type, id, selected) => {
16152
16717
  setSessionRuntimeCapabilities((previous) => {
16153
16718
  const nextSelection = toggleRuntimeCapabilitySelection(
@@ -16165,7 +16730,7 @@ function Chat({
16165
16730
  },
16166
16731
  [persistSessionRuntimeCapabilities, stream.threadId]
16167
16732
  );
16168
- const updateRuntimeCapabilityPalette = React49.useCallback(
16733
+ const updateRuntimeCapabilityPalette = React50.useCallback(
16169
16734
  (parts, selectionStart) => {
16170
16735
  const input = composerInputRef.current;
16171
16736
  const editingText = getComposerEditingText(parts);
@@ -16177,7 +16742,7 @@ function Chat({
16177
16742
  },
16178
16743
  []
16179
16744
  );
16180
- const syncComposerInputFromElement = React49.useCallback(
16745
+ const syncComposerInputFromElement = React50.useCallback(
16181
16746
  (input) => {
16182
16747
  const previousCapabilities = getComposerCapabilityPartMap(
16183
16748
  composerPartsRef.current
@@ -16195,25 +16760,25 @@ function Chat({
16195
16760
  },
16196
16761
  [commitComposerParts, updateRuntimeCapabilityPalette]
16197
16762
  );
16198
- const handleComposerInput = React49.useCallback(
16763
+ const handleComposerInput = React50.useCallback(
16199
16764
  (event) => {
16200
16765
  syncComposerInputFromElement(event.currentTarget);
16201
16766
  },
16202
16767
  [syncComposerInputFromElement]
16203
16768
  );
16204
- const handleComposerCompositionEnd = React49.useCallback(
16769
+ const handleComposerCompositionEnd = React50.useCallback(
16205
16770
  (event) => {
16206
16771
  syncComposerInputFromElement(event.currentTarget);
16207
16772
  },
16208
16773
  [syncComposerInputFromElement]
16209
16774
  );
16210
- const handleComposerSelect = React49.useCallback(() => {
16775
+ const handleComposerSelect = React50.useCallback(() => {
16211
16776
  updateRuntimeCapabilityPalette(
16212
16777
  composerPartsRef.current,
16213
16778
  composerInputRef.current ? getComposerSelectionOffset(composerInputRef.current) : void 0
16214
16779
  );
16215
16780
  }, [updateRuntimeCapabilityPalette]);
16216
- const removeRunRuntimeCapability = React49.useCallback(
16781
+ const removeRunRuntimeCapability = React50.useCallback(
16217
16782
  (option) => {
16218
16783
  setRunRuntimeCapabilities(
16219
16784
  (previous) => toggleRuntimeCapabilitySelection(
@@ -16233,7 +16798,7 @@ function Chat({
16233
16798
  },
16234
16799
  [commitComposerParts]
16235
16800
  );
16236
- const submitDraft = React49.useCallback(
16801
+ const submitDraft = React50.useCallback(
16237
16802
  (submitOptions = {}) => {
16238
16803
  if (isSubmissionBlocked) return;
16239
16804
  const contentToSubmit = (submitOptions.inputText ?? trimmedDraft).trim();
@@ -16356,7 +16921,7 @@ function Chat({
16356
16921
  t
16357
16922
  ]
16358
16923
  );
16359
- const handleGoalCommand = React49.useCallback(
16924
+ const handleGoalCommand = React50.useCallback(
16360
16925
  async ({
16361
16926
  args,
16362
16927
  commandSource,
@@ -16468,13 +17033,10 @@ function Chat({
16468
17033
  t
16469
17034
  ]
16470
17035
  );
16471
- const handleGoalPanelOpenChange = React49.useCallback(
16472
- (open) => {
16473
- setIsGoalPanelOpen(open);
16474
- },
16475
- []
16476
- );
16477
- const addRunRuntimeCapabilities = React49.useCallback(
17036
+ const handleGoalPanelOpenChange = React50.useCallback((open) => {
17037
+ setIsGoalPanelOpen(open);
17038
+ }, []);
17039
+ const addRunRuntimeCapabilities = React50.useCallback(
16478
17040
  (selection) => {
16479
17041
  setRunRuntimeCapabilities(
16480
17042
  (previous) => runtimeCapabilities ? mergeRuntimeCapabilitiesSelections(
@@ -16486,7 +17048,7 @@ function Chat({
16486
17048
  },
16487
17049
  [runtimeCapabilities]
16488
17050
  );
16489
- const insertComposerCapabilityToken = React49.useCallback(
17051
+ const insertComposerCapabilityToken = React50.useCallback(
16490
17052
  (capability, range) => {
16491
17053
  const token = createComposerCapabilityPart(capability, createMessageId());
16492
17054
  const currentParts = composerPartsRef.current;
@@ -16559,7 +17121,7 @@ function Chat({
16559
17121
  plugin: t("composer.slashCommands.empty.loadingCapabilities"),
16560
17122
  subAgent: t("composer.slashCommands.empty.loadingCapabilities")
16561
17123
  };
16562
- React49.useEffect(() => {
17124
+ React50.useEffect(() => {
16563
17125
  if (!runtimeCapabilityPalette) {
16564
17126
  return;
16565
17127
  }
@@ -16578,7 +17140,7 @@ function Chat({
16578
17140
  );
16579
17141
  }
16580
17142
  }, [slashPaletteOptions.length, runtimeCapabilityPalette]);
16581
- React49.useLayoutEffect(() => {
17143
+ React50.useLayoutEffect(() => {
16582
17144
  if (!runtimeCapabilityPalette) {
16583
17145
  return;
16584
17146
  }
@@ -16595,7 +17157,7 @@ function Chat({
16595
17157
  container.scrollTop += optionRect.bottom - containerRect.bottom;
16596
17158
  }
16597
17159
  }, [runtimeCapabilityPalette, slashPaletteOptions.length]);
16598
- const submitGoalModeDraft = React49.useCallback(() => {
17160
+ const submitGoalModeDraft = React50.useCallback(() => {
16599
17161
  const objective = getComposerPlainText(composerPartsRef.current).trim();
16600
17162
  if (!isGoalModeOpen || !goalCommandAvailable || !objective) {
16601
17163
  return false;
@@ -16633,7 +17195,7 @@ function Chat({
16633
17195
  }
16634
17196
  submitDraft();
16635
17197
  };
16636
- const handleEditPendingFollowUp = React49.useCallback(
17198
+ const handleEditPendingFollowUp = React50.useCallback(
16637
17199
  (id) => {
16638
17200
  const item = pendingFollowUps.find(
16639
17201
  (entry) => entry.id === id && entry.mode === "queue"
@@ -16660,7 +17222,7 @@ function Chat({
16660
17222
  },
16661
17223
  [pendingFollowUps, setComposerText, stream]
16662
17224
  );
16663
- const handleQuoteSelection = React49.useCallback(() => {
17225
+ const handleQuoteSelection = React50.useCallback(() => {
16664
17226
  if (!quoteSelection) {
16665
17227
  return;
16666
17228
  }
@@ -16676,7 +17238,7 @@ function Chat({
16676
17238
  const handleAttachmentClick = () => {
16677
17239
  attachmentsRef.current?.openFilePicker();
16678
17240
  };
16679
- const uploadContextFile = React49.useCallback(
17241
+ const uploadContextFile = React50.useCallback(
16680
17242
  (file) => {
16681
17243
  const formData = new FormData();
16682
17244
  formData.append("file", file, file.name || "upload");
@@ -16695,13 +17257,13 @@ function Chat({
16695
17257
  },
16696
17258
  [stream.assistantId, stream.client, stream.threadId]
16697
17259
  );
16698
- const getContextFileStatus = React49.useCallback(
17260
+ const getContextFileStatus = React50.useCallback(
16699
17261
  (fileId) => stream.client.contexts.fetch(`/files/${fileId}/status`, {
16700
17262
  method: "GET"
16701
17263
  }),
16702
17264
  [stream.client]
16703
17265
  );
16704
- const deleteContextFile = React49.useCallback(
17266
+ const deleteContextFile = React50.useCallback(
16705
17267
  (storageFileId) => stream.client.contexts.deleteFile(storageFileId),
16706
17268
  [stream.client]
16707
17269
  );
@@ -16809,7 +17371,7 @@ function Chat({
16809
17371
  }
16810
17372
  submitDraft();
16811
17373
  };
16812
- const handleComposerPaste = React49.useCallback(
17374
+ const handleComposerPaste = React50.useCallback(
16813
17375
  (event) => {
16814
17376
  const clipboardData = event.clipboardData;
16815
17377
  if (!clipboardData) {
@@ -16911,13 +17473,13 @@ function Chat({
16911
17473
  const handleToolSelect = (tool) => {
16912
17474
  setSelectedTool((prev) => prev?.id === tool.id ? null : tool);
16913
17475
  };
16914
- const handlePromptClick = React49.useCallback(
17476
+ const handlePromptClick = React50.useCallback(
16915
17477
  (prompt) => {
16916
17478
  submitDraft({ inputText: prompt, displayText: prompt });
16917
17479
  },
16918
17480
  [submitDraft]
16919
17481
  );
16920
- const handlePromptEdit = React49.useCallback(
17482
+ const handlePromptEdit = React50.useCallback(
16921
17483
  (prompt) => {
16922
17484
  if (isPromptEditDisabled) return;
16923
17485
  setComposerText(prompt, prompt.length);
@@ -16926,7 +17488,7 @@ function Chat({
16926
17488
  },
16927
17489
  [focusComposerAt, isPromptEditDisabled, setComposerText]
16928
17490
  );
16929
- const loadConversationMessages = React49.useCallback(
17491
+ const loadConversationMessages = React50.useCallback(
16930
17492
  async (recordId) => {
16931
17493
  if (missingConfig) {
16932
17494
  setHistoryError(missingConfigShortMessage);
@@ -16947,7 +17509,7 @@ function Chat({
16947
17509
  },
16948
17510
  [missingConfig, missingConfigShortMessage, stream, t]
16949
17511
  );
16950
- const handleLoadMoreMessages = React49.useCallback(async () => {
17512
+ const handleLoadMoreMessages = React50.useCallback(async () => {
16951
17513
  if (!canLoadMoreMessages || isLoadingMoreMessages) {
16952
17514
  return;
16953
17515
  }
@@ -17056,15 +17618,15 @@ function Chat({
17056
17618
  };
17057
17619
  const acceptMimes = composer?.attachments?.accept ? Object.entries(composer.attachments.accept).map(([mime, exts]) => [mime, ...exts.map((e) => `.${e}`)].join(",")).join(",") : void 0;
17058
17620
  const canUploadDroppedFiles = composer?.attachments?.enabled === true && !missingConfig && !isHistoryLoading && !hasPendingInteractiveRequest;
17059
- const handleDroppedFiles = React49.useCallback((files) => {
17621
+ const handleDroppedFiles = React50.useCallback((files) => {
17060
17622
  return attachmentsRef.current?.queueFiles(files) ?? false;
17061
17623
  }, []);
17062
- const currentThread = React49.useMemo(
17624
+ const currentThread = React50.useMemo(
17063
17625
  () => threads.find((item) => item.id === stream.threadId),
17064
17626
  [threads, stream.threadId]
17065
17627
  );
17066
17628
  const streamErrorMessage = stream.error instanceof Error ? stream.error.message : void 0;
17067
- const threadErrorMessage = React49.useMemo(() => {
17629
+ const threadErrorMessage = React50.useMemo(() => {
17068
17630
  if (streamErrorMessage?.trim()) return streamErrorMessage.trim();
17069
17631
  if (currentThread?.status !== "error") return void 0;
17070
17632
  const message = currentThread.error?.trim();
@@ -17094,15 +17656,14 @@ function Chat({
17094
17656
  historyMessageLoadVersion: stream.historyMessageLoadVersion ?? 0,
17095
17657
  fallbackTitle: t("history.threadFallback")
17096
17658
  });
17097
- const assistantTitle = assistantName || resolvedTitle;
17098
17659
  const layoutMaxWidth = options?.layout?.maxWidth;
17099
- const chatColumnStyle = React49.useMemo(() => {
17660
+ const chatColumnStyle = React50.useMemo(() => {
17100
17661
  if (layoutMaxWidth === void 0 || layoutMaxWidth === null || layoutMaxWidth === "") {
17101
17662
  return void 0;
17102
17663
  }
17103
17664
  return { maxWidth: layoutMaxWidth };
17104
17665
  }, [layoutMaxWidth]);
17105
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
17666
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
17106
17667
  UploadDroppedFiles,
17107
17668
  {
17108
17669
  ref: viewportRef,
@@ -17117,16 +17678,16 @@ function Chat({
17117
17678
  className
17118
17679
  ),
17119
17680
  children: [
17120
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
17681
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
17121
17682
  "div",
17122
17683
  {
17123
17684
  "data-slot": "chatkit-chat-header",
17124
17685
  className: "mx-auto flex w-full items-center justify-between border-b p-2 sticky top-0 z-10 bg-background",
17125
17686
  style: chatColumnStyle,
17126
17687
  children: [
17127
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center gap-3 overflow-hidden", children: [
17128
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "relative shrink-0", children: [
17129
- /* @__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)(
17130
17691
  ChatkitAvatar,
17131
17692
  {
17132
17693
  avatar: assistantAvatar,
@@ -17134,10 +17695,10 @@ function Chat({
17134
17695
  label: assistantTitle
17135
17696
  }
17136
17697
  ),
17137
- /* @__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" })
17138
17699
  ] }),
17139
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "truncate", children: [
17140
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
17700
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "truncate", children: [
17701
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17141
17702
  "h2",
17142
17703
  {
17143
17704
  className: "text-lg font-semibold truncate",
@@ -17145,12 +17706,12 @@ function Chat({
17145
17706
  children: assistantTitle
17146
17707
  }
17147
17708
  ),
17148
- /* @__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") })
17149
17710
  ] })
17150
17711
  ] }),
17151
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center gap-1", children: [
17152
- canMinimizeToPet && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Tooltip, { children: [
17153
- /* @__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)(
17154
17715
  "button",
17155
17716
  {
17156
17717
  type: "button",
@@ -17161,13 +17722,13 @@ function Chat({
17161
17722
  "transition-colors duration-150"
17162
17723
  ),
17163
17724
  "aria-label": t("chat.minimizeToPet"),
17164
- 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 })
17165
17726
  }
17166
17727
  ) }) }),
17167
- /* @__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") })
17168
17729
  ] }),
17169
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Tooltip, { children: [
17170
- /* @__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)(
17171
17732
  "button",
17172
17733
  {
17173
17734
  type: "button",
@@ -17178,14 +17739,14 @@ function Chat({
17178
17739
  "transition-colors duration-150"
17179
17740
  ),
17180
17741
  "aria-label": t("settings.open"),
17181
- 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 })
17182
17743
  }
17183
17744
  ) }) }),
17184
- /* @__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") })
17185
17746
  ] }),
17186
- history?.enabled !== false && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_jsx_runtime54.Fragment, { children: [
17187
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Tooltip, { children: [
17188
- /* @__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)(
17189
17750
  "button",
17190
17751
  {
17191
17752
  type: "button",
@@ -17198,12 +17759,12 @@ function Chat({
17198
17759
  "disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed"
17199
17760
  ),
17200
17761
  "aria-label": t("history.newThread"),
17201
- 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 })
17202
17763
  }
17203
17764
  ) }) }),
17204
- /* @__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") })
17205
17766
  ] }),
17206
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
17767
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17207
17768
  HistorySidebar,
17208
17769
  {
17209
17770
  threads,
@@ -17220,18 +17781,29 @@ function Chat({
17220
17781
  ]
17221
17782
  }
17222
17783
  ),
17223
- /* @__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)(
17224
17796
  "div",
17225
17797
  {
17226
17798
  "data-slot": "chatkit-chat-content",
17227
17799
  className: "mx-auto w-full flex-1 p-4",
17228
17800
  style: chatColumnStyle,
17229
17801
  children: [
17230
- 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 }),
17231
- 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 }),
17232
- 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 }),
17233
- 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") }),
17234
- 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)(
17235
17807
  StartScreen,
17236
17808
  {
17237
17809
  startScreen,
@@ -17240,10 +17812,10 @@ function Chat({
17240
17812
  promptSendDisabled: isSubmissionBlocked,
17241
17813
  promptEditDisabled: isPromptEditDisabled
17242
17814
  }
17243
- ) : /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "space-y-4", children: [
17244
- canLoadMoreMessages && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center gap-3 py-1", children: [
17245
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "h-px min-w-8 flex-1 bg-border" }),
17246
- /* @__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)(
17247
17819
  Button,
17248
17820
  {
17249
17821
  type: "button",
@@ -17255,7 +17827,7 @@ function Chat({
17255
17827
  children: isLoadingMoreMessages ? t("chat.loadingMoreMessages") : t("chat.loadMoreMessages")
17256
17828
  }
17257
17829
  ),
17258
- /* @__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" })
17259
17831
  ] }),
17260
17832
  messages.map((message, index) => {
17261
17833
  const messageType = String(message.type);
@@ -17289,18 +17861,24 @@ function Chat({
17289
17861
  const hasHumanAttachments = message.type === "human" && humanAttachments.length > 0;
17290
17862
  const canQuoteMessage = message.type === "human" || isAssistantMessage;
17291
17863
  const quoteSource = message.type === "human" ? t("chat.youLabel") : assistantTitle;
17864
+ const messageNavigationId = getMessageNavigationItemId(
17865
+ message,
17866
+ index
17867
+ );
17292
17868
  if (!isAssistantMessage && !hasPlainRenderableContent && !hasHumanAttachments && humanRuntimeCapabilityOptions.length === 0 && humanReferences.length === 0) {
17293
17869
  return null;
17294
17870
  }
17295
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
17871
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17296
17872
  "div",
17297
17873
  {
17874
+ ref: (node) => setMessageNavigationAnchor(messageNavigationId, node),
17875
+ "data-message-navigation-id": messageNavigationId,
17298
17876
  className: cn(
17299
17877
  "group flex gap-3",
17300
17878
  message.type === "human" ? "justify-end" : "justify-start -ml-1"
17301
17879
  // AI messages: slightly closer to left
17302
17880
  ),
17303
- children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
17881
+ children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
17304
17882
  "div",
17305
17883
  {
17306
17884
  className: cn(
@@ -17308,7 +17886,7 @@ function Chat({
17308
17886
  isAssistantMessage && "min-w-0 flex-1"
17309
17887
  ),
17310
17888
  children: [
17311
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
17889
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17312
17890
  "div",
17313
17891
  {
17314
17892
  ...canQuoteMessage ? {
@@ -17320,7 +17898,7 @@ function Chat({
17320
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"
17321
17899
  // AI messages: use chat-specific foreground color
17322
17900
  ),
17323
- children: isAssistantMessage ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
17901
+ children: isAssistantMessage ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17324
17902
  AssistantMessage,
17325
17903
  {
17326
17904
  message: {
@@ -17339,25 +17917,25 @@ function Chat({
17339
17917
  organizationId: stream.organizationId,
17340
17918
  apiUrl: stream.apiUrl
17341
17919
  }
17342
- ) : /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_jsx_runtime54.Fragment, { children: [
17343
- 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)(
17344
17922
  "span",
17345
17923
  {
17346
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",
17347
17925
  children: [
17348
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
17926
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17349
17927
  RuntimeCapabilityIcon,
17350
17928
  {
17351
17929
  option,
17352
17930
  variant: "chip"
17353
17931
  }
17354
17932
  ),
17355
- /* @__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 })
17356
17934
  ]
17357
17935
  },
17358
17936
  `${option.type}:${option.id}`
17359
17937
  )) }),
17360
- 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)(
17361
17939
  ReferenceChip,
17362
17940
  {
17363
17941
  reference,
@@ -17365,29 +17943,29 @@ function Chat({
17365
17943
  },
17366
17944
  getReferenceKey(reference)
17367
17945
  )) }),
17368
- 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)(
17369
17947
  "div",
17370
17948
  {
17371
17949
  className: "flex items-center gap-1.5 rounded-md bg-primary-foreground/20 px-2 py-1 text-xs",
17372
17950
  children: [
17373
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react29.FileText, { size: 12 }),
17374
- /* @__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 })
17375
17953
  ]
17376
17954
  },
17377
17955
  fileIndex
17378
17956
  )) }),
17379
- 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)(
17380
17958
  "p",
17381
17959
  {
17382
17960
  className: "wrap-break-word text-sm leading-relaxed",
17383
17961
  children: formatMessageContent(part)
17384
17962
  },
17385
17963
  `${part.type}-${partIndex}`
17386
- )) : /* @__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) })
17387
17965
  ] })
17388
17966
  }
17389
17967
  ),
17390
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
17968
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17391
17969
  MessageActions,
17392
17970
  {
17393
17971
  content: messageContent,
@@ -17425,7 +18003,7 @@ function Chat({
17425
18003
  stream.isLoading,
17426
18004
  { now: streamingNow }
17427
18005
  );
17428
- 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)(
17429
18007
  AssistantStreamingIndicator,
17430
18008
  {
17431
18009
  status: fallbackStreamingStatus ?? "loading"
@@ -17436,7 +18014,7 @@ function Chat({
17436
18014
  ]
17437
18015
  }
17438
18016
  ),
17439
- !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)(
17440
18018
  Button,
17441
18019
  {
17442
18020
  type: "button",
@@ -17449,10 +18027,10 @@ function Chat({
17449
18027
  onClick: () => scrollToBottom(true, true),
17450
18028
  "aria-label": t("chat.scrollToBottom"),
17451
18029
  title: t("chat.scrollToBottom"),
17452
- 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 })
17453
18031
  }
17454
18032
  ) }),
17455
- quoteSelection && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18033
+ quoteSelection && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17456
18034
  "div",
17457
18035
  {
17458
18036
  className: "pointer-events-none fixed z-50",
@@ -17461,7 +18039,7 @@ function Chat({
17461
18039
  left: `${quoteSelection.left}px`,
17462
18040
  transform: "translateX(-50%)"
17463
18041
  },
17464
- children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
18042
+ children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
17465
18043
  Button,
17466
18044
  {
17467
18045
  type: "button",
@@ -17473,22 +18051,22 @@ function Chat({
17473
18051
  "aria-label": t("composer.quoteSelection"),
17474
18052
  title: t("composer.quoteSelection"),
17475
18053
  children: [
17476
- /* @__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 }),
17477
18055
  t("composer.quoteSelection")
17478
18056
  ]
17479
18057
  }
17480
18058
  )
17481
18059
  }
17482
18060
  ),
17483
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
18061
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
17484
18062
  "div",
17485
18063
  {
17486
18064
  "data-slot": "chatkit-chat-composer",
17487
18065
  className: "mx-auto w-full p-2 sticky bottom-0 z-10 bg-background",
17488
18066
  style: chatColumnStyle,
17489
18067
  children: [
17490
- 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 }),
17491
- /* @__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)(
17492
18070
  ChatAttachments,
17493
18071
  {
17494
18072
  ref: attachmentsRef,
@@ -17502,7 +18080,7 @@ function Chat({
17502
18080
  onStateChange: setAttachmentState
17503
18081
  }
17504
18082
  ),
17505
- 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)(
17506
18084
  ReferenceChip,
17507
18085
  {
17508
18086
  reference,
@@ -17516,16 +18094,16 @@ function Chat({
17516
18094
  },
17517
18095
  getReferenceKey(reference)
17518
18096
  )) }),
17519
- detachedRunRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "mb-2 flex flex-wrap items-center gap-2", children: [
17520
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "text-xs text-muted-foreground", children: t("composer.capabilities.runOnly") }),
17521
- 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)(
17522
18100
  "span",
17523
18101
  {
17524
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",
17525
18103
  children: [
17526
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(RuntimeCapabilityIcon, { option, variant: "chip" }),
17527
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "max-w-40 truncate", children: option.label }),
17528
- /* @__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)(
17529
18107
  "button",
17530
18108
  {
17531
18109
  type: "button",
@@ -17533,7 +18111,7 @@ function Chat({
17533
18111
  className: "rounded-full p-0.5 hover:bg-primary/15",
17534
18112
  title: t("composer.capabilities.removeRunCapability"),
17535
18113
  "aria-label": t("composer.capabilities.removeRunCapability"),
17536
- 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 })
17537
18115
  }
17538
18116
  )
17539
18117
  ]
@@ -17541,7 +18119,7 @@ function Chat({
17541
18119
  `${option.type}:${option.id}`
17542
18120
  ))
17543
18121
  ] }),
17544
- showGoalStatus && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
18122
+ showGoalStatus && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
17545
18123
  "div",
17546
18124
  {
17547
18125
  className: cn(
@@ -17549,7 +18127,7 @@ function Chat({
17549
18127
  isGoalObjectiveExpanded ? "items-start" : "items-center"
17550
18128
  ),
17551
18129
  children: [
17552
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18130
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17553
18131
  import_lucide_react29.Target,
17554
18132
  {
17555
18133
  className: cn(
@@ -17558,13 +18136,13 @@ function Chat({
17558
18136
  )
17559
18137
  }
17560
18138
  ),
17561
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "min-w-0 flex-1", children: [
17562
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex min-w-0 items-center gap-2", children: [
17563
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "font-medium", children: t("chat.goal.label") }),
17564
- 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}`) }),
17565
- 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" })
17566
18144
  ] }),
17567
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18145
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17568
18146
  "div",
17569
18147
  {
17570
18148
  className: cn(
@@ -17574,13 +18152,13 @@ function Chat({
17574
18152
  children: goalError || threadGoal?.objective
17575
18153
  }
17576
18154
  ),
17577
- 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", {
17578
18156
  elapsed: formatGoalElapsed(displayedGoalElapsedSeconds)
17579
18157
  }) }) })
17580
18158
  ] }),
17581
- threadGoal && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex shrink-0 items-center gap-1", children: [
17582
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Tooltip, { children: [
17583
- /* @__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)(
17584
18162
  Button,
17585
18163
  {
17586
18164
  type: "button",
@@ -17591,13 +18169,13 @@ function Chat({
17591
18169
  const prefix = "/goal edit ";
17592
18170
  setComposerText(`${prefix}${threadGoal.objective}`);
17593
18171
  },
17594
- 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" })
17595
18173
  }
17596
18174
  ) }),
17597
- /* @__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") })
17598
18176
  ] }),
17599
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Tooltip, { children: [
17600
- /* @__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)(
17601
18179
  Button,
17602
18180
  {
17603
18181
  type: "button",
@@ -17613,13 +18191,13 @@ function Chat({
17613
18191
  executionType: "insert_invocation"
17614
18192
  }
17615
18193
  }),
17616
- 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" })
17617
18195
  }
17618
18196
  ) }),
17619
- /* @__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") })
17620
18198
  ] }),
17621
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Tooltip, { children: [
17622
- /* @__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)(
17623
18201
  Button,
17624
18202
  {
17625
18203
  type: "button",
@@ -17635,13 +18213,13 @@ function Chat({
17635
18213
  executionType: "insert_invocation"
17636
18214
  }
17637
18215
  }),
17638
- 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" })
17639
18217
  }
17640
18218
  ) }),
17641
- /* @__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") })
17642
18220
  ] }),
17643
- threadGoal.objective && !goalError && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Tooltip, { children: [
17644
- /* @__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)(
17645
18223
  Button,
17646
18224
  {
17647
18225
  type: "button",
@@ -17650,7 +18228,7 @@ function Chat({
17650
18228
  "aria-expanded": isGoalObjectiveExpanded,
17651
18229
  "aria-label": isGoalObjectiveExpanded ? t("chat.goal.collapseObjective") : t("chat.goal.expandObjective"),
17652
18230
  onClick: () => setIsGoalObjectiveExpanded((expanded) => !expanded),
17653
- children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18231
+ children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17654
18232
  import_lucide_react29.ChevronDown,
17655
18233
  {
17656
18234
  className: cn(
@@ -17661,13 +18239,13 @@ function Chat({
17661
18239
  )
17662
18240
  }
17663
18241
  ) }),
17664
- /* @__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") })
17665
18243
  ] })
17666
18244
  ] })
17667
18245
  ]
17668
18246
  }
17669
18247
  ),
17670
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18248
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17671
18249
  PendingRuntimeServices,
17672
18250
  {
17673
18251
  state: stream.runtimeActivities.sandboxServices,
@@ -17676,7 +18254,7 @@ function Chat({
17676
18254
  className: hasPendingTodos || hasPendingFollowUps ? "mb-2" : void 0
17677
18255
  }
17678
18256
  ),
17679
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18257
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17680
18258
  PendingTodos,
17681
18259
  {
17682
18260
  snapshot: stream.todos,
@@ -17684,7 +18262,7 @@ function Chat({
17684
18262
  className: hasPendingFollowUps ? "mb-2" : void 0
17685
18263
  }
17686
18264
  ),
17687
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18265
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17688
18266
  PendingFollowUps,
17689
18267
  {
17690
18268
  items: pendingFollowUps,
@@ -17697,7 +18275,7 @@ function Chat({
17697
18275
  attachToComposer: true
17698
18276
  }
17699
18277
  ),
17700
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18278
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17701
18279
  RequestUserInputPanel,
17702
18280
  {
17703
18281
  request: stream.pendingRequestUserInput,
@@ -17706,7 +18284,7 @@ function Chat({
17706
18284
  attachToComposer: true
17707
18285
  }
17708
18286
  ),
17709
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18287
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17710
18288
  HITLApprovalPanel,
17711
18289
  {
17712
18290
  request: stream.pendingHITLRequest,
@@ -17715,7 +18293,7 @@ function Chat({
17715
18293
  attachToComposer: true
17716
18294
  }
17717
18295
  ),
17718
- runtimeCapabilityPalette && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18296
+ runtimeCapabilityPalette && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17719
18297
  SlashPalette,
17720
18298
  {
17721
18299
  palette: runtimeCapabilityPalette,
@@ -17729,7 +18307,7 @@ function Chat({
17729
18307
  onSelect: selectSlashPaletteOption
17730
18308
  }
17731
18309
  ),
17732
- /* @__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)(
17733
18311
  "div",
17734
18312
  {
17735
18313
  "data-slot": "composer-input-shell",
@@ -17743,7 +18321,7 @@ function Chat({
17743
18321
  composerInputRoundedClass
17744
18322
  ),
17745
18323
  children: [
17746
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18324
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17747
18325
  "div",
17748
18326
  {
17749
18327
  ref: composerInputRef,
@@ -17765,7 +18343,7 @@ function Chat({
17765
18343
  (missingConfig || isHistoryLoading || hasPendingInteractiveRequest) && "cursor-not-allowed opacity-50"
17766
18344
  ),
17767
18345
  children: renderedComposerParts.map(
17768
- (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)(
17769
18347
  "span",
17770
18348
  {
17771
18349
  "data-composer-capability-key": part.key,
@@ -17774,14 +18352,14 @@ function Chat({
17774
18352
  contentEditable: false,
17775
18353
  className: "mx-0.5 inline-flex max-w-[14rem] select-none items-center gap-1 text-sm font-semibold text-primary align-baseline",
17776
18354
  children: [
17777
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18355
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17778
18356
  RuntimeCapabilityIcon,
17779
18357
  {
17780
18358
  option: part.capability,
17781
18359
  variant: "chip"
17782
18360
  }
17783
18361
  ),
17784
- /* @__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 })
17785
18363
  ]
17786
18364
  },
17787
18365
  part.key
@@ -17790,14 +18368,14 @@ function Chat({
17790
18368
  },
17791
18369
  composerDomVersion
17792
18370
  ),
17793
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
18371
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
17794
18372
  "div",
17795
18373
  {
17796
18374
  "data-slot": "composer-action-bar",
17797
18375
  className: "pointer-events-none absolute inset-x-1.5 bottom-1 flex min-h-10 items-center justify-between gap-2",
17798
18376
  children: [
17799
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "pointer-events-none flex min-w-0 flex-1 items-center gap-1.5", children: [
17800
- /* @__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)(
17801
18379
  ComposerMenu,
17802
18380
  {
17803
18381
  composer,
@@ -17815,20 +18393,20 @@ function Chat({
17815
18393
  disabled: missingConfig || isHistoryLoading || hasPendingInteractiveRequest
17816
18394
  }
17817
18395
  ) }),
17818
- 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: [
17819
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "truncate", children: selectedTool.shortLabel ?? selectedTool.label }),
17820
- /* @__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)(
17821
18399
  "button",
17822
18400
  {
17823
18401
  type: "button",
17824
18402
  onClick: () => setSelectedTool(null),
17825
18403
  className: "shrink-0 rounded-full p-0.5 text-primary/70 hover:bg-primary/10 hover:text-primary",
17826
- 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 })
17827
18405
  }
17828
18406
  )
17829
18407
  ] })
17830
18408
  ] }),
17831
- /* @__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)(
17832
18410
  SendButton,
17833
18411
  {
17834
18412
  disabled: isSendDisabled,
@@ -17851,7 +18429,7 @@ function Chat({
17851
18429
  ]
17852
18430
  }
17853
18431
  ) }),
17854
- disclaimer?.text && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18432
+ disclaimer?.text && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17855
18433
  "p",
17856
18434
  {
17857
18435
  className: cn(
@@ -17861,14 +18439,14 @@ function Chat({
17861
18439
  children: disclaimer.text
17862
18440
  }
17863
18441
  ),
17864
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "mt-2 flex items-center justify-center gap-2 text-xs text-muted-foreground", children: [
17865
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { children: t("chat.poweredBy") }),
17866
- /* @__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" })
17867
18445
  ] })
17868
18446
  ]
17869
18447
  }
17870
18448
  ),
17871
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
18449
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17872
18450
  SettingsSheet,
17873
18451
  {
17874
18452
  open: petSettingsOpen,
@@ -17878,17 +18456,17 @@ function Chat({
17878
18456
  onSave: savePetLocalSettings
17879
18457
  }
17880
18458
  ),
17881
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(PetBridge, { pet: effectivePet, state: petAutoState })
18459
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(PetBridge, { pet: effectivePet, state: petAutoState })
17882
18460
  ]
17883
18461
  }
17884
18462
  );
17885
18463
  }
17886
18464
 
17887
18465
  // src/components/ui/separator.tsx
17888
- var React50 = __toESM(require("react"), 1);
17889
- var import_jsx_runtime55 = require("react/jsx-runtime");
17890
- var Separator = React50.forwardRef(
17891
- ({ 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)(
17892
18470
  "div",
17893
18471
  {
17894
18472
  ref,