@xpert-ai/chatkit-ui 0.4.5 → 0.4.6

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-Co-XCsnp.js → _baseUniq-e0n3oxgY.js} +1 -1
  2. package/dist/app/assets/{abap--D_Kn6xP.js → abap-C2m1gMh_.js} +1 -1
  3. package/dist/app/assets/{abnf-D5WYHs_l.js → abnf-DFzlHNVB.js} +1 -1
  4. package/dist/app/assets/{actionscript-DsVXzf-F.js → actionscript-Dxmvc3AF.js} +1 -1
  5. package/dist/app/assets/{ada-Cvy4GD3X.js → ada-CVO_O52N.js} +1 -1
  6. package/dist/app/assets/{agda-DsLk_pDK.js → agda-CGEI8apm.js} +1 -1
  7. package/dist/app/assets/{al-BeEwAGNu.js → al-CXBctxHE.js} +1 -1
  8. package/dist/app/assets/{antlr4-BPDPs4mt.js → antlr4-BzGyc1GG.js} +1 -1
  9. package/dist/app/assets/{apacheconf-DDa4MsSo.js → apacheconf-DhdeJg1U.js} +1 -1
  10. package/dist/app/assets/{apex-IXxIiz3T.js → apex-Dfprst0f.js} +1 -1
  11. package/dist/app/assets/{apl-_Xuh93xL.js → apl-D3zvQCsG.js} +1 -1
  12. package/dist/app/assets/{applescript-zF-7HGIh.js → applescript-DWkUa8Ap.js} +1 -1
  13. package/dist/app/assets/{aql-qapLE7vo.js → aql-DrfLox7L.js} +1 -1
  14. package/dist/app/assets/{arc-R6XS2pBf.js → arc-25X_4Lt9.js} +1 -1
  15. package/dist/app/assets/{architectureDiagram-Q4EWVU46-6z2emAH2.js → architectureDiagram-Q4EWVU46-CyF28k-b.js} +1 -1
  16. package/dist/app/assets/{arduino-2NlbDC0E.js → arduino-Qd3e6Ok1.js} +1 -1
  17. package/dist/app/assets/{arff-15Fx0kni.js → arff-CRZ9puZK.js} +1 -1
  18. package/dist/app/assets/{asciidoc-IGRk8vb3.js → asciidoc-DUiwgtuK.js} +1 -1
  19. package/dist/app/assets/{asm6502-lyM25DlO.js → asm6502-zG1dqL1m.js} +1 -1
  20. package/dist/app/assets/{asmatmel-DGRiY6RP.js → asmatmel-Cm9zpYMv.js} +1 -1
  21. package/dist/app/assets/{aspnet-DRHt5RUL.js → aspnet-CX5-L7Ct.js} +1 -1
  22. package/dist/app/assets/{autohotkey-DNI_3d2u.js → autohotkey-C4JfPrSd.js} +1 -1
  23. package/dist/app/assets/{autoit-Tn0WXTkZ.js → autoit-g5o6EGhy.js} +1 -1
  24. package/dist/app/assets/{avisynth-DZrXIifS.js → avisynth-BzCOBA3x.js} +1 -1
  25. package/dist/app/assets/{avro-idl-DvnfR4q7.js → avro-idl-e0tKOc6E.js} +1 -1
  26. package/dist/app/assets/{bash-bqRZI_pO.js → bash-CHd7M7ii.js} +1 -1
  27. package/dist/app/assets/{basic-BaebTlRT.js → basic-DvEnfVvI.js} +1 -1
  28. package/dist/app/assets/{batch-PcmijW6C.js → batch-CT5xgq8J.js} +1 -1
  29. package/dist/app/assets/{bbcode-6XIsStWc.js → bbcode-DJ7OKysr.js} +1 -1
  30. package/dist/app/assets/{bicep-CtazMCUu.js → bicep-BXw_45Yz.js} +1 -1
  31. package/dist/app/assets/{birb-Bb-Z2Uoh.js → birb-XpBgzzS8.js} +1 -1
  32. package/dist/app/assets/{bison-DMpTitx0.js → bison-D-7QCu9c.js} +1 -1
  33. package/dist/app/assets/{blockDiagram-DXYQGD6D-4zGz8PX5.js → blockDiagram-DXYQGD6D-6aWNcctV.js} +1 -1
  34. package/dist/app/assets/{bnf-BgCmtG9K.js → bnf-98JsAWJD.js} +1 -1
  35. package/dist/app/assets/{brainfuck-ZV2E8Tsx.js → brainfuck-DtvgC7Uz.js} +1 -1
  36. package/dist/app/assets/{brightscript-BcUAceb3.js → brightscript-CiZLD50k.js} +1 -1
  37. package/dist/app/assets/{bro-CJMO1xO5.js → bro-rbJDq64_.js} +1 -1
  38. package/dist/app/assets/{bsl-BUH4KORj.js → bsl-BS-cDrod.js} +1 -1
  39. package/dist/app/assets/{c-jtWYEsXA.js → c-DQDTErL9.js} +1 -1
  40. package/dist/app/assets/{c4Diagram-AHTNJAMY-BWtNBZjf.js → c4Diagram-AHTNJAMY-aTcQy0xE.js} +1 -1
  41. package/dist/app/assets/{cfscript-BRsXWjhc.js → cfscript-CkR3O7sU.js} +1 -1
  42. package/dist/app/assets/{chaiscript-Cyvk1xer.js → chaiscript-DvxvIu7v.js} +1 -1
  43. package/dist/app/assets/channel-CVWoJuYf.js +1 -0
  44. package/dist/app/assets/{chunk-4BX2VUAB-Cci3cX0w.js → chunk-4BX2VUAB-qfDhreDf.js} +1 -1
  45. package/dist/app/assets/{chunk-4TB4RGXK-Cc2Mhdt_.js → chunk-4TB4RGXK-BBVzKpce.js} +1 -1
  46. package/dist/app/assets/{chunk-55IACEB6-BCuokoIJ.js → chunk-55IACEB6-CcY9LJAj.js} +1 -1
  47. package/dist/app/assets/{chunk-EDXVE4YY-BniMDhnr.js → chunk-EDXVE4YY-B-Dzr-Dh.js} +1 -1
  48. package/dist/app/assets/{chunk-FMBD7UC4-BZgeDsZW.js → chunk-FMBD7UC4-8CUKOSAc.js} +1 -1
  49. package/dist/app/assets/{chunk-OYMX7WX6-DNtQg1UI.js → chunk-OYMX7WX6-D9Cq7hwT.js} +1 -1
  50. package/dist/app/assets/{chunk-QZHKN3VN-CYOkyP3f.js → chunk-QZHKN3VN-C2tBz9o2.js} +1 -1
  51. package/dist/app/assets/{chunk-YZCP3GAM-DrNq3DSp.js → chunk-YZCP3GAM-C4jyodPd.js} +1 -1
  52. package/dist/app/assets/{cil-xB1Wcx8v.js → cil-C5ON7F53.js} +1 -1
  53. package/dist/app/assets/classDiagram-6PBFFD2Q-CgDPDKKT.js +1 -0
  54. package/dist/app/assets/classDiagram-v2-HSJHXN6E-CgDPDKKT.js +1 -0
  55. package/dist/app/assets/{clike-Bys-F0y3.js → clike-DLdxAZKH.js} +1 -1
  56. package/dist/app/assets/{clojure-X2Ur1GCR.js → clojure-DvSYmO9X.js} +1 -1
  57. package/dist/app/assets/clone-DyTJ9PSE.js +1 -0
  58. package/dist/app/assets/{cmake-BV05wnad.js → cmake-DO0txDE3.js} +1 -1
  59. package/dist/app/assets/{cobol-DmbS5Ovj.js → cobol-BTJpVfTH.js} +1 -1
  60. package/dist/app/assets/{coffeescript-NB44yUqU.js → coffeescript-BtIXNHF3.js} +1 -1
  61. package/dist/app/assets/{concurnas-DRly0Ymz.js → concurnas-B531692C.js} +1 -1
  62. package/dist/app/assets/{coq-5BMX0a02.js → coq-Cp47Wwsa.js} +1 -1
  63. package/dist/app/assets/{core-BDQ00Bae.js → core-BoWyhl5n.js} +1 -1
  64. package/dist/app/assets/{cose-bilkent-S5V4N54A-C5sw6sBK.js → cose-bilkent-S5V4N54A-BjosQjhT.js} +1 -1
  65. package/dist/app/assets/{cpp-DGTd--nV.js → cpp-B6wt8k5c.js} +1 -1
  66. package/dist/app/assets/{crystal-04-7jCUz.js → crystal-B3XldzUm.js} +1 -1
  67. package/dist/app/assets/{csharp-BekrIY2o.js → csharp-BKQFTidP.js} +1 -1
  68. package/dist/app/assets/{cshtml-DRaoghIv.js → cshtml-BH26d1cx.js} +1 -1
  69. package/dist/app/assets/{csp-9-yRddNx.js → csp-DSghTOt2.js} +1 -1
  70. package/dist/app/assets/{css-CAtlVqs0.js → css-B5pRG057.js} +1 -1
  71. package/dist/app/assets/{css-extras-CWVDDT-t.js → css-extras-DD0ErmT4.js} +1 -1
  72. package/dist/app/assets/{csv-Dg-zB1qs.js → csv-C8WNOOiS.js} +1 -1
  73. package/dist/app/assets/{cypher-4IbDZc8Y.js → cypher-C72ppWfI.js} +1 -1
  74. package/dist/app/assets/{d-B7r6CIW_.js → d-DCkT0MnL.js} +1 -1
  75. package/dist/app/assets/{dagre-KV5264BT-Aa6ga6Tg.js → dagre-KV5264BT-Dz0XIZ_d.js} +1 -1
  76. package/dist/app/assets/{dart-33q2tN5Y.js → dart-ov_L9JbZ.js} +1 -1
  77. package/dist/app/assets/{dataweave-_KZXrqme.js → dataweave-ER8iZYvy.js} +1 -1
  78. package/dist/app/assets/{dax-bZvO9T2D.js → dax-DftfdAbZ.js} +1 -1
  79. package/dist/app/assets/{dhall-CMmS_d1I.js → dhall-B_Ag7Ugu.js} +1 -1
  80. package/dist/app/assets/{diagram-5BDNPKRD-CWOgCaWs.js → diagram-5BDNPKRD-LXVUQ6at.js} +1 -1
  81. package/dist/app/assets/{diagram-G4DWMVQ6-pXmi3PKB.js → diagram-G4DWMVQ6-DFJO-kg5.js} +1 -1
  82. package/dist/app/assets/{diagram-MMDJMWI5-D6L1aAmr.js → diagram-MMDJMWI5-BKfZyNwr.js} +1 -1
  83. package/dist/app/assets/{diagram-TYMM5635-Bnbk8hJL.js → diagram-TYMM5635-B0QF8FRs.js} +1 -1
  84. package/dist/app/assets/{diff-BMnhXRfO.js → diff-ByjoU1do.js} +1 -1
  85. package/dist/app/assets/{django-CwyRKLji.js → django-D8OuMIol.js} +1 -1
  86. package/dist/app/assets/{dns-zone-file-CH2YmErm.js → dns-zone-file-NMG4vugk.js} +1 -1
  87. package/dist/app/assets/{docker-CMu6fCBm.js → docker-D6vmqJmV.js} +1 -1
  88. package/dist/app/assets/{dot-DbQdbB35.js → dot-QLisXVDc.js} +1 -1
  89. package/dist/app/assets/{ebnf-Dv8o3Xd5.js → ebnf-BmUuiQBV.js} +1 -1
  90. package/dist/app/assets/{editorconfig-DGpNYUTF.js → editorconfig-RZmDBUFH.js} +1 -1
  91. package/dist/app/assets/{eiffel-DlwnHLpb.js → eiffel-rnFzeEWt.js} +1 -1
  92. package/dist/app/assets/{ejs-CnitBaIQ.js → ejs-DN7eCZMZ.js} +1 -1
  93. package/dist/app/assets/{elixir-BwncS48q.js → elixir-DQP09Ude.js} +1 -1
  94. package/dist/app/assets/{elm-DIeTEpXB.js → elm-DoxD8V5-.js} +1 -1
  95. package/dist/app/assets/{erDiagram-SMLLAGMA-DCVTOQcd.js → erDiagram-SMLLAGMA-PLYN-yt7.js} +1 -1
  96. package/dist/app/assets/{erb-DLShoXNV.js → erb-D7QWryDV.js} +1 -1
  97. package/dist/app/assets/{erlang-CymPR6rz.js → erlang-6MIAP3z1.js} +1 -1
  98. package/dist/app/assets/{etlua-DnGxLY3M.js → etlua-CXOpuEX0.js} +1 -1
  99. package/dist/app/assets/{excel-formula-BH7DFVmw.js → excel-formula-Bvelfqoq.js} +1 -1
  100. package/dist/app/assets/{factor-Bh-cxy91.js → factor-B_LwIu1T.js} +1 -1
  101. package/dist/app/assets/{false-Bbvyie5f.js → false-DaXIsDj9.js} +1 -1
  102. package/dist/app/assets/{firestore-security-rules-C1Z4GDy7.js → firestore-security-rules-vhtcxmz8.js} +1 -1
  103. package/dist/app/assets/{flow-CEb_LmQm.js → flow-CbnzGhcW.js} +1 -1
  104. package/dist/app/assets/{flowDiagram-DWJPFMVM-t4rWU0cl.js → flowDiagram-DWJPFMVM-D46jZeCj.js} +1 -1
  105. package/dist/app/assets/{fortran-BNasWrrZ.js → fortran-D21zPhTt.js} +1 -1
  106. package/dist/app/assets/{fsharp-BsCVJk6E.js → fsharp-CaguYUvm.js} +1 -1
  107. package/dist/app/assets/{ftl-jRCUJODD.js → ftl-DpFi23p_.js} +1 -1
  108. package/dist/app/assets/{ganttDiagram-T4ZO3ILL-CIt95e25.js → ganttDiagram-T4ZO3ILL-DiFD8eiM.js} +1 -1
  109. package/dist/app/assets/{gap-BNZC8mW7.js → gap-DTH0dhv0.js} +1 -1
  110. package/dist/app/assets/{gcode-Dm32zQCL.js → gcode-Ti0MqAbc.js} +1 -1
  111. package/dist/app/assets/{gdscript-nnhWLrN6.js → gdscript-B4c1zB7G.js} +1 -1
  112. package/dist/app/assets/{gedcom-CK-ySXEa.js → gedcom-Bm-gxba2.js} +1 -1
  113. package/dist/app/assets/{gherkin--zbB3aYH.js → gherkin-CRUiP4ua.js} +1 -1
  114. package/dist/app/assets/{git-DiWVe3eJ.js → git-DDSxUgmV.js} +1 -1
  115. package/dist/app/assets/{gitGraphDiagram-UUTBAWPF-SzhkWrKD.js → gitGraphDiagram-UUTBAWPF-BkD66s-m.js} +1 -1
  116. package/dist/app/assets/{glsl-D1fReIPw.js → glsl-BWGO0hEu.js} +1 -1
  117. package/dist/app/assets/{gml-BDyUxEuB.js → gml-OfBxxn4Y.js} +1 -1
  118. package/dist/app/assets/{gn-y9O1wUj9.js → gn-D1i8XGRO.js} +1 -1
  119. package/dist/app/assets/{go-BluFqfDq.js → go-CQxEjXj6.js} +1 -1
  120. package/dist/app/assets/{go-module-DZRzQTXf.js → go-module-DJVIXWOE.js} +1 -1
  121. package/dist/app/assets/{graph-CqvHVXoE.js → graph-xy46XkDv.js} +1 -1
  122. package/dist/app/assets/{graphql-W2OnfZNH.js → graphql-DOWBew5y.js} +1 -1
  123. package/dist/app/assets/{groovy-CJ1kbbBa.js → groovy-D4SOqf4f.js} +1 -1
  124. package/dist/app/assets/{haml-CrhrA9XY.js → haml-Cs-NR_00.js} +1 -1
  125. package/dist/app/assets/{handlebars-EgGfXI7t.js → handlebars-L33c899L.js} +1 -1
  126. package/dist/app/assets/{haskell-Bj5MfGGI.js → haskell-jnyZSPIm.js} +1 -1
  127. package/dist/app/assets/{haxe-BdDpk8xR.js → haxe-CEcS1fRW.js} +1 -1
  128. package/dist/app/assets/{hcl-D9OwvylQ.js → hcl-CFVBh1rZ.js} +1 -1
  129. package/dist/app/assets/{hlsl-562nbzk6.js → hlsl-BGDcbOGU.js} +1 -1
  130. package/dist/app/assets/{hoon-BqdgVrcr.js → hoon-DbE0jHD1.js} +1 -1
  131. package/dist/app/assets/{hpkp-EH8H3Hom.js → hpkp-FsJh7gNB.js} +1 -1
  132. package/dist/app/assets/{hsts-QIGmRf78.js → hsts-q26NxKTf.js} +1 -1
  133. package/dist/app/assets/{http-CzfjEVlY.js → http-DG-5h-eO.js} +1 -1
  134. package/dist/app/assets/{ichigojam-D98a8BcA.js → ichigojam-CuYDdsGF.js} +1 -1
  135. package/dist/app/assets/{icon-DBD-5k6c.js → icon-B3Om0MSf.js} +1 -1
  136. package/dist/app/assets/{icu-message-format-BYT71AMs.js → icu-message-format-DN2g3klg.js} +1 -1
  137. package/dist/app/assets/{idris-B7zJwyc1.js → idris-BOt2MkOk.js} +1 -1
  138. package/dist/app/assets/{iecst-SesII_E4.js → iecst-CuBx11EN.js} +1 -1
  139. package/dist/app/assets/{ignore-B6Rk10df.js → ignore-cviNNAUS.js} +1 -1
  140. package/dist/app/assets/{index-DH__JuG8.js → index-B0wzBY_g.js} +197 -197
  141. package/dist/app/assets/{infoDiagram-42DDH7IO-B_FQWO4F.js → infoDiagram-42DDH7IO-D20xP3z-.js} +1 -1
  142. package/dist/app/assets/{inform7-h2cFjWGx.js → inform7-Ba3iGRkz.js} +1 -1
  143. package/dist/app/assets/{ini-BS51ySt6.js → ini-D1qPbzhi.js} +1 -1
  144. package/dist/app/assets/{io-B4AFlnDh.js → io-DxDg_PHG.js} +1 -1
  145. package/dist/app/assets/{ishikawaDiagram-UXIWVN3A-1rRuzx1s.js → ishikawaDiagram-UXIWVN3A-cYl8p5Z1.js} +1 -1
  146. package/dist/app/assets/{j-Drz8g_1M.js → j-LY0FoFmS.js} +1 -1
  147. package/dist/app/assets/{java-DCpfLevZ.js → java-BqooSNxs.js} +1 -1
  148. package/dist/app/assets/{javadoc-DXIzKQcq.js → javadoc-BqcBR3v0.js} +1 -1
  149. package/dist/app/assets/{javadoclike-C8SmsTQv.js → javadoclike-C4mjzqku.js} +1 -1
  150. package/dist/app/assets/{javascript-uumTubEW.js → javascript-N5ua9HdK.js} +1 -1
  151. package/dist/app/assets/{javastacktrace-B-eU9XLD.js → javastacktrace-v7dElDBR.js} +1 -1
  152. package/dist/app/assets/{jexl-D4977EKW.js → jexl-QnOdFFuN.js} +1 -1
  153. package/dist/app/assets/{jolie-DLawqTad.js → jolie-CJ-3s01g.js} +1 -1
  154. package/dist/app/assets/{journeyDiagram-VCZTEJTY-DrQg892C.js → journeyDiagram-VCZTEJTY-BYX8q3Vt.js} +1 -1
  155. package/dist/app/assets/{jq-Cm1vS58Z.js → jq-CWSEYqle.js} +1 -1
  156. package/dist/app/assets/{js-extras-RCYpP2to.js → js-extras-BAnnOfzU.js} +1 -1
  157. package/dist/app/assets/{js-templates-767pf_M_.js → js-templates-C4pUn2It.js} +1 -1
  158. package/dist/app/assets/{jsdoc-DTvTCxfG.js → jsdoc-KAXMzacX.js} +1 -1
  159. package/dist/app/assets/{json-Dy-V79-1.js → json-D82-G59c.js} +1 -1
  160. package/dist/app/assets/{json5-BEmUoI2s.js → json5-6tkCkwy4.js} +1 -1
  161. package/dist/app/assets/{jsonp-Box0_wdw.js → jsonp-CJLh9FtV.js} +1 -1
  162. package/dist/app/assets/{jsstacktrace-D4k7LJFI.js → jsstacktrace-DtzF790j.js} +1 -1
  163. package/dist/app/assets/{jsx-UHXI_vWR.js → jsx-HBfJ0kvY.js} +1 -1
  164. package/dist/app/assets/{julia-DNluswh2.js → julia-qgsTf-aE.js} +1 -1
  165. package/dist/app/assets/{kanban-definition-6JOO6SKY-DCoBgIKn.js → kanban-definition-6JOO6SKY-lNjZrvli.js} +1 -1
  166. package/dist/app/assets/{keepalived-cL1_TOGJ.js → keepalived-CxQ8kQHh.js} +1 -1
  167. package/dist/app/assets/{keyman-CgmsT3ZD.js → keyman-QQ5F7jKU.js} +1 -1
  168. package/dist/app/assets/{kotlin-B-7C62fR.js → kotlin-CHGD50lP.js} +1 -1
  169. package/dist/app/assets/{kumir-BmZSzZs3.js → kumir-Bu9SM23C.js} +1 -1
  170. package/dist/app/assets/{kusto-Bd4bditr.js → kusto-mt_hZCSq.js} +1 -1
  171. package/dist/app/assets/{latex-B6Yn44p1.js → latex-CICDtHjj.js} +1 -1
  172. package/dist/app/assets/{latte-D_VkuuMY.js → latte-BAR0mT7a.js} +1 -1
  173. package/dist/app/assets/{layout-CuQBqeJF.js → layout-DEyJKhDK.js} +1 -1
  174. package/dist/app/assets/{less-CNL3ODIy.js → less-CHNPhcod.js} +1 -1
  175. package/dist/app/assets/{lilypond-Bvambxk4.js → lilypond-CSUOMwf6.js} +1 -1
  176. package/dist/app/assets/{linear-BFLcIrl3.js → linear-D9VvUwfa.js} +1 -1
  177. package/dist/app/assets/{liquid-B-rCvqgj.js → liquid-Cz7TW2oY.js} +1 -1
  178. package/dist/app/assets/{lisp-DAPeLOCL.js → lisp-Du6y1304.js} +1 -1
  179. package/dist/app/assets/{livescript-DhdAKU5C.js → livescript-BtG5DGcF.js} +1 -1
  180. package/dist/app/assets/{llvm-CZUCpwhn.js → llvm-BDPUo2hX.js} +1 -1
  181. package/dist/app/assets/{log-DWq76M48.js → log--N5sUe_u.js} +1 -1
  182. package/dist/app/assets/{lolcode-Cpeb2C7M.js → lolcode-ClqwJSko.js} +1 -1
  183. package/dist/app/assets/{lua-VuQhfB0e.js → lua-DbeZ1IVc.js} +1 -1
  184. package/dist/app/assets/{magma-C6-R8Pis.js → magma-Whq-4iou.js} +1 -1
  185. package/dist/app/assets/{makefile-C8sXNjev.js → makefile-pSKDqMc6.js} +1 -1
  186. package/dist/app/assets/{markdown-Dr_2eVkJ.js → markdown-B1xgmDWp.js} +1 -1
  187. package/dist/app/assets/{markup-DYRaVR0L.js → markup-DzLXw8Rh.js} +1 -1
  188. package/dist/app/assets/{markup-templating-Clq2Wdtu.js → markup-templating-DPDS9QM5.js} +1 -1
  189. package/dist/app/assets/{matlab-N7ULHzkN.js → matlab-DJRo_vuN.js} +1 -1
  190. package/dist/app/assets/{maxscript-C_UH_c0Y.js → maxscript-BvZXFCmD.js} +1 -1
  191. package/dist/app/assets/{mel-biAclKO6.js → mel-CyILQ25B.js} +1 -1
  192. package/dist/app/assets/{mermaid-cA3X8ng1.js → mermaid-CwNV2n0M.js} +1 -1
  193. package/dist/app/assets/{min-DNXX2fdQ.js → min-W152sZHe.js} +1 -1
  194. package/dist/app/assets/{mindmap-definition-QFDTVHPH-B3hDdQGV.js → mindmap-definition-QFDTVHPH-C-UOvSVV.js} +1 -1
  195. package/dist/app/assets/{mizar-DkeIuoWx.js → mizar-C0hSTRmd.js} +1 -1
  196. package/dist/app/assets/{mongodb-CZtDL2oy.js → mongodb-D_b-CoC-.js} +1 -1
  197. package/dist/app/assets/{monkey-B7rkJ-YN.js → monkey-PvQu5Vd6.js} +1 -1
  198. package/dist/app/assets/{moonscript-BrAkE7P-.js → moonscript-CoP1dq0Z.js} +1 -1
  199. package/dist/app/assets/{n1ql-CAwurqwa.js → n1ql-3QuCoAIN.js} +1 -1
  200. package/dist/app/assets/{n4js-CQMx2F8M.js → n4js-DZHeRyua.js} +1 -1
  201. package/dist/app/assets/{nand2tetris-hdl-C_WH3v-f.js → nand2tetris-hdl-dS8crO2g.js} +1 -1
  202. package/dist/app/assets/{naniscript-BIg6AoSC.js → naniscript-DwYGbK5q.js} +1 -1
  203. package/dist/app/assets/{nasm-JWQkVK3O.js → nasm-CM1zvD-3.js} +1 -1
  204. package/dist/app/assets/{neon-CCu-JZXF.js → neon-DFFyEzDC.js} +1 -1
  205. package/dist/app/assets/{nevod-DQ_tL5xo.js → nevod-D2FYTpnK.js} +1 -1
  206. package/dist/app/assets/{nginx-CE0GIB_t.js → nginx-CdY-14q6.js} +1 -1
  207. package/dist/app/assets/{nim-BQkGgHx1.js → nim-CG1iSWGV.js} +1 -1
  208. package/dist/app/assets/{nix-DjPqNtXA.js → nix-D0-Pu9rL.js} +1 -1
  209. package/dist/app/assets/{nsis-B0wDo6fc.js → nsis-dtDOvjH7.js} +1 -1
  210. package/dist/app/assets/{objectivec-BOWTft_L.js → objectivec-CptpH-1d.js} +1 -1
  211. package/dist/app/assets/{ocaml-rGGzL-J8.js → ocaml-Dv1ea-ld.js} +1 -1
  212. package/dist/app/assets/{opencl-7DwawK0u.js → opencl-BvMmG6YR.js} +1 -1
  213. package/dist/app/assets/{openqasm-BoZmVcpe.js → openqasm-CwSFop47.js} +1 -1
  214. package/dist/app/assets/{oz-k8zQh74U.js → oz-CEJrdpA7.js} +1 -1
  215. package/dist/app/assets/{parigp-DOF_5XSw.js → parigp-DViKd8pj.js} +1 -1
  216. package/dist/app/assets/{parser-Bn3oD8Fj.js → parser-DgiwG_pC.js} +1 -1
  217. package/dist/app/assets/{pascal-BMod2MBu.js → pascal-j68rLfD9.js} +1 -1
  218. package/dist/app/assets/{pascaligo-VMBK85nU.js → pascaligo-DUem4H6l.js} +1 -1
  219. package/dist/app/assets/{pcaxis-DtO95BO9.js → pcaxis-DvgzQxqD.js} +1 -1
  220. package/dist/app/assets/{peoplecode-B6669Uht.js → peoplecode-C3Bxx6ZR.js} +1 -1
  221. package/dist/app/assets/{perl-BWa2t7hE.js → perl-FujE7XeE.js} +1 -1
  222. package/dist/app/assets/{php-D1EHwdfc.js → php-CNsXpF9V.js} +1 -1
  223. package/dist/app/assets/{php-extras-BkzLJdMh.js → php-extras-C32YwHEb.js} +1 -1
  224. package/dist/app/assets/{phpdoc-Cjl8GbI3.js → phpdoc-DGWozCi2.js} +1 -1
  225. package/dist/app/assets/{pieDiagram-DEJITSTG-BOQDZEsp.js → pieDiagram-DEJITSTG-Dqtbtugf.js} +1 -1
  226. package/dist/app/assets/{plsql-C9d_4ASZ.js → plsql-C2VV-t97.js} +1 -1
  227. package/dist/app/assets/{powerquery-B8dvsoEG.js → powerquery-PRRUJzFT.js} +1 -1
  228. package/dist/app/assets/{powershell-B_E5Ls3m.js → powershell-bb1HIydt.js} +1 -1
  229. package/dist/app/assets/{processing-JtrZ9RaV.js → processing-DjcO4gZ4.js} +1 -1
  230. package/dist/app/assets/{prolog-CqFUVRIw.js → prolog-BYubkdm0.js} +1 -1
  231. package/dist/app/assets/{promql-CAbgJv1n.js → promql-C1R9989z.js} +1 -1
  232. package/dist/app/assets/{properties-BngV24FT.js → properties-6E8geRjW.js} +1 -1
  233. package/dist/app/assets/{protobuf-Bi9iRUiu.js → protobuf-NbKEUq-0.js} +1 -1
  234. package/dist/app/assets/{psl-pDjrt0B9.js → psl-CCIboIeA.js} +1 -1
  235. package/dist/app/assets/{pug-DioknANs.js → pug-B6XaxAxB.js} +1 -1
  236. package/dist/app/assets/{puppet-ML2ON0Nh.js → puppet-sYeWToAm.js} +1 -1
  237. package/dist/app/assets/{pure-DhCM2LcO.js → pure-MigBUlto.js} +1 -1
  238. package/dist/app/assets/{purebasic-BBRpNPNK.js → purebasic-CbK5sM8J.js} +1 -1
  239. package/dist/app/assets/{purescript-BCyPbnZA.js → purescript-D4syOBjO.js} +1 -1
  240. package/dist/app/assets/{q-AswilSny.js → q-BQLn2JzW.js} +1 -1
  241. package/dist/app/assets/{qml-CmAUtWqC.js → qml-Be1u_eEw.js} +1 -1
  242. package/dist/app/assets/{qore-Bv9pFdiR.js → qore-B1z7c7Yg.js} +1 -1
  243. package/dist/app/assets/{qsharp-48tPx5Mz.js → qsharp-BWsfMLkJ.js} +1 -1
  244. package/dist/app/assets/{quadrantDiagram-34T5L4WZ-xfjbVVZu.js → quadrantDiagram-34T5L4WZ-DdFjuBtK.js} +1 -1
  245. package/dist/app/assets/{r-D7-cDDS_.js → r-BER2AggK.js} +1 -1
  246. package/dist/app/assets/{racket-rfJjsp9a.js → racket-DOZRNhck.js} +1 -1
  247. package/dist/app/assets/{reason-DBC0zi5i.js → reason-1KJbYmkA.js} +1 -1
  248. package/dist/app/assets/{regex-DnBFBfKd.js → regex-SdGLwvq5.js} +1 -1
  249. package/dist/app/assets/{rego-B4yEjn-8.js → rego-D-mLsW7j.js} +1 -1
  250. package/dist/app/assets/{renpy-D_4quYLX.js → renpy-CYj4XzkD.js} +1 -1
  251. package/dist/app/assets/{requirementDiagram-MS252O5E-ykcp6OKq.js → requirementDiagram-MS252O5E-B5KgDzYF.js} +1 -1
  252. package/dist/app/assets/{rest-DE5aTQbn.js → rest-Do-kum26.js} +1 -1
  253. package/dist/app/assets/{rip-nLkeQy-_.js → rip-CZ7hy7Rc.js} +1 -1
  254. package/dist/app/assets/{roboconf-fk8WiTzj.js → roboconf-CrOlOF2e.js} +1 -1
  255. package/dist/app/assets/{robotframework-CT4iaIxT.js → robotframework-SFMU6Wwy.js} +1 -1
  256. package/dist/app/assets/{ruby-cQyytj4i.js → ruby-DSiktnDP.js} +1 -1
  257. package/dist/app/assets/{rust-CWJm_bSY.js → rust-BEq861Tj.js} +1 -1
  258. package/dist/app/assets/{sankeyDiagram-XADWPNL6-Bhogh-O-.js → sankeyDiagram-XADWPNL6-B_ju-fsT.js} +1 -1
  259. package/dist/app/assets/{sas-DoRGa1wg.js → sas-Cxt3LAYG.js} +1 -1
  260. package/dist/app/assets/{sass-LYaBIZKs.js → sass-C0QOivil.js} +1 -1
  261. package/dist/app/assets/{scala-BZjhJr8S.js → scala-CBIhwVR7.js} +1 -1
  262. package/dist/app/assets/{scheme-D01CiDze.js → scheme-BQ8vJpEk.js} +1 -1
  263. package/dist/app/assets/{scss-Da6GwvfN.js → scss-9ZztaO09.js} +1 -1
  264. package/dist/app/assets/{sequenceDiagram-FGHM5R23-ecYbruEX.js → sequenceDiagram-FGHM5R23-BNRlgM_o.js} +1 -1
  265. package/dist/app/assets/{shell-session-g6FrqTiP.js → shell-session-CEjfbC-4.js} +1 -1
  266. package/dist/app/assets/{smali-BSpX36tk.js → smali-wTZoo5Ck.js} +1 -1
  267. package/dist/app/assets/{smalltalk-Bq_Gsc0F.js → smalltalk-CtdEepu4.js} +1 -1
  268. package/dist/app/assets/{smarty-D3fU2RbY.js → smarty-DCOaiyVN.js} +1 -1
  269. package/dist/app/assets/{sml-TZkjEgtP.js → sml-CRIi_5FN.js} +1 -1
  270. package/dist/app/assets/{solidity-DLkuvBc2.js → solidity-C-sunTbM.js} +1 -1
  271. package/dist/app/assets/{solution-file-BqI5xPXQ.js → solution-file-BMcD_yBD.js} +1 -1
  272. package/dist/app/assets/{soy-BCG5CQr6.js → soy-CrHujpjx.js} +1 -1
  273. package/dist/app/assets/{sparql-DQQsm_l4.js → sparql-_nkh51Oo.js} +1 -1
  274. package/dist/app/assets/{splunk-spl-bY7_uYjh.js → splunk-spl-BV0yJuZ3.js} +1 -1
  275. package/dist/app/assets/{sqf-BZo7hu6i.js → sqf-CTR3G-sn.js} +1 -1
  276. package/dist/app/assets/{sql-DqFLgmXx.js → sql-CK8LhvZf.js} +1 -1
  277. package/dist/app/assets/{squirrel-CiX2EfEw.js → squirrel-BrWr7Sn4.js} +1 -1
  278. package/dist/app/assets/{stan-CMhpMP7k.js → stan-CEC_j0Vp.js} +1 -1
  279. package/dist/app/assets/{stateDiagram-FHFEXIEX-v9Gsby_c.js → stateDiagram-FHFEXIEX-CD5PsxTo.js} +1 -1
  280. package/dist/app/assets/stateDiagram-v2-QKLJ7IA2-CZ_oJSeJ.js +1 -0
  281. package/dist/app/assets/{stylus-CenUxfuN.js → stylus-DAsiIRIp.js} +1 -1
  282. package/dist/app/assets/{swift-BVjGHQuG.js → swift-BAaG4GYN.js} +1 -1
  283. package/dist/app/assets/{systemd-CpOXAdLf.js → systemd-DzS1CHBe.js} +1 -1
  284. package/dist/app/assets/{t4-cs-CS9lJ-K0.js → t4-cs-ggnb3aeJ.js} +1 -1
  285. package/dist/app/assets/{t4-templating-hj-TNDsq.js → t4-templating-Bu_GLHIZ.js} +1 -1
  286. package/dist/app/assets/{t4-vb-Ck7mu1gJ.js → t4-vb-C9FmkhvR.js} +1 -1
  287. package/dist/app/assets/{tap-DaH9gaoq.js → tap-CoKAR-fO.js} +1 -1
  288. package/dist/app/assets/{tcl-DNIWr75O.js → tcl-C2ZkJvLb.js} +1 -1
  289. package/dist/app/assets/{textile-Bv4nPa6s.js → textile-DZALIJzT.js} +1 -1
  290. package/dist/app/assets/{timeline-definition-GMOUNBTQ-D6n0S-ku.js → timeline-definition-GMOUNBTQ-CDhxUnOk.js} +1 -1
  291. package/dist/app/assets/{toml-DF3HfhqH.js → toml-C2smfO8e.js} +1 -1
  292. package/dist/app/assets/{tremor-Bvh1Y6zY.js → tremor-BjkZp6il.js} +1 -1
  293. package/dist/app/assets/{tt2-Dv5tLBlM.js → tt2-CHuxOCBz.js} +1 -1
  294. package/dist/app/assets/{turtle-DkLAfnik.js → turtle-BRML1nbK.js} +1 -1
  295. package/dist/app/assets/{twig-S_GHUqZa.js → twig-BXTsXQgH.js} +1 -1
  296. package/dist/app/assets/{typescript-Cu71LnVi.js → typescript-D97Flp8j.js} +1 -1
  297. package/dist/app/assets/{typoscript-CtN4Jy8Z.js → typoscript-DSeb0eJ9.js} +1 -1
  298. package/dist/app/assets/{unrealscript-BRjPcrs6.js → unrealscript-DlHhyJiH.js} +1 -1
  299. package/dist/app/assets/{uorazor-D4ckTG59.js → uorazor-DAgFaaw5.js} +1 -1
  300. package/dist/app/assets/{uri-DQCryf4S.js → uri-DAISB2-y.js} +1 -1
  301. package/dist/app/assets/{v-Bx-_iyUf.js → v-BI1fSl4s.js} +1 -1
  302. package/dist/app/assets/{vala-C-8psoRf.js → vala-B0O9FrwQ.js} +1 -1
  303. package/dist/app/assets/{vbnet-Do4mtB7R.js → vbnet-C8BBfsv6.js} +1 -1
  304. package/dist/app/assets/{velocity-Drww5v_3.js → velocity-DxEPgCJp.js} +1 -1
  305. package/dist/app/assets/{vennDiagram-DHZGUBPP-tW8wVSRe.js → vennDiagram-DHZGUBPP-ByTJSjE_.js} +1 -1
  306. package/dist/app/assets/{verilog-B8pepi-H.js → verilog-thVOd-Xa.js} +1 -1
  307. package/dist/app/assets/{vhdl-CuO3hi8I.js → vhdl-92ZsOrFg.js} +1 -1
  308. package/dist/app/assets/{vim-DSsNung_.js → vim-WSNLk7dA.js} +1 -1
  309. package/dist/app/assets/{visual-basic-CZIqY5t6.js → visual-basic-C47_Fl8T.js} +1 -1
  310. package/dist/app/assets/{wardley-RL74JXVD-D7c8EbFm.js → wardley-RL74JXVD-wQHV1kk0.js} +1 -1
  311. package/dist/app/assets/{wardleyDiagram-NUSXRM2D-Br8nJ8eB.js → wardleyDiagram-NUSXRM2D-DDdoQZLn.js} +1 -1
  312. package/dist/app/assets/{warpscript-DxQu8-1N.js → warpscript-CauvLjrk.js} +1 -1
  313. package/dist/app/assets/{wasm-TvYG9PxF.js → wasm-DieX6uKz.js} +1 -1
  314. package/dist/app/assets/{web-idl-Cz41qHgE.js → web-idl-GqldvVwc.js} +1 -1
  315. package/dist/app/assets/{wiki-Dpvt1md3.js → wiki-D070zFKu.js} +1 -1
  316. package/dist/app/assets/{wolfram-Bg7HPXEQ.js → wolfram-COSn3nGG.js} +1 -1
  317. package/dist/app/assets/{wren-D5Yecsqj.js → wren-Cs5-Z4d-.js} +1 -1
  318. package/dist/app/assets/{xeora-Cg-n24u9.js → xeora-Dblnaflg.js} +1 -1
  319. package/dist/app/assets/{xml-doc-Eti4SXoM.js → xml-doc-Cw5SW8IO.js} +1 -1
  320. package/dist/app/assets/{xojo-DhQBW3jL.js → xojo-BOGyzB1N.js} +1 -1
  321. package/dist/app/assets/{xquery-DrnMYyrL.js → xquery-Dss_lg3A.js} +1 -1
  322. package/dist/app/assets/{xychartDiagram-5P7HB3ND-D0kV7MNO.js → xychartDiagram-5P7HB3ND-B6sz9HXS.js} +1 -1
  323. package/dist/app/assets/{yaml-DiOrjhia.js → yaml-BX2rP5GJ.js} +1 -1
  324. package/dist/app/assets/{yang-B38xE-H2.js → yang-CIW2FsLC.js} +1 -1
  325. package/dist/app/assets/{zig-C7oerdaD.js → zig-DqhZPLNT.js} +1 -1
  326. package/dist/app/index.html +1 -1
  327. package/dist/index.cjs +1218 -882
  328. package/dist/index.d.cts +22 -2
  329. package/dist/index.d.ts +22 -2
  330. package/dist/index.js +1219 -883
  331. package/package.json +3 -3
  332. package/dist/app/assets/channel-e2pCq0KM.js +0 -1
  333. package/dist/app/assets/classDiagram-6PBFFD2Q-DHVJ7GQ2.js +0 -1
  334. package/dist/app/assets/classDiagram-v2-HSJHXN6E-DHVJ7GQ2.js +0 -1
  335. package/dist/app/assets/clone-CepWRlEk.js +0 -1
  336. package/dist/app/assets/stateDiagram-v2-QKLJ7IA2-2pX5wx_N.js +0 -1
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/components/chat.tsx
2
- import * as React50 from "react";
2
+ import * as React51 from "react";
3
3
  import {
4
4
  ArrowDown as ArrowDown2,
5
5
  ChevronDown as ChevronDown5,
@@ -14,7 +14,7 @@ import {
14
14
  Settings as Settings2,
15
15
  Target as Target2,
16
16
  Trash2 as Trash23,
17
- X as X6
17
+ X as X7
18
18
  } from "lucide-react";
19
19
 
20
20
  // src/lib/utils.ts
@@ -723,6 +723,9 @@ function ParentMessengerProvider({
723
723
  const onSetComposerValueHandlersRef = useRef(
724
724
  /* @__PURE__ */ new Set()
725
725
  );
726
+ const onSetRuntimeCapabilitiesHandlersRef = useRef(
727
+ /* @__PURE__ */ new Set()
728
+ );
726
729
  const onFocusComposerHandlersRef = useRef(/* @__PURE__ */ new Set());
727
730
  const latestOptionsRef = useRef(null);
728
731
  const isParentAvailable = useMemo(() => {
@@ -755,6 +758,15 @@ function ParentMessengerProvider({
755
758
  },
756
759
  []
757
760
  );
761
+ const registerOnSetRuntimeCapabilities = useCallback(
762
+ (handler) => {
763
+ onSetRuntimeCapabilitiesHandlersRef.current.add(handler);
764
+ return () => {
765
+ onSetRuntimeCapabilitiesHandlersRef.current.delete(handler);
766
+ };
767
+ },
768
+ []
769
+ );
758
770
  const registerOnFocusComposer = useCallback(
759
771
  (handler) => {
760
772
  onFocusComposerHandlersRef.current.add(handler);
@@ -879,6 +891,23 @@ function ParentMessengerProvider({
879
891
  });
880
892
  return;
881
893
  }
894
+ if (payload.type === "command" && payload.command === "onSetRuntimeCapabilities") {
895
+ const selection = isRuntimeCapabilitiesSelection(payload.data) ? payload.data : null;
896
+ void Promise.all(
897
+ [...onSetRuntimeCapabilitiesHandlersRef.current].map(
898
+ (handler2) => Promise.resolve(handler2(selection))
899
+ )
900
+ ).then(() => {
901
+ if (payload.nonce) {
902
+ sendResponse(payload.nonce, { ok: true });
903
+ }
904
+ }).catch((error) => {
905
+ if (payload.nonce) {
906
+ sendResponse(payload.nonce, void 0, error);
907
+ }
908
+ });
909
+ return;
910
+ }
882
911
  if (payload.type === "command" && payload.command === "onSetOptions") {
883
912
  latestOptionsRef.current = payload.data ?? null;
884
913
  if (onSetOptionsHandlersRef.current.size > 0) {
@@ -1000,6 +1029,7 @@ function ParentMessengerProvider({
1000
1029
  registerOnSetOptions,
1001
1030
  registerOnSetPetEnabled,
1002
1031
  registerOnSetComposerValue,
1032
+ registerOnSetRuntimeCapabilities,
1003
1033
  registerOnFocusComposer
1004
1034
  }),
1005
1035
  [
@@ -1009,6 +1039,7 @@ function ParentMessengerProvider({
1009
1039
  registerOnSetOptions,
1010
1040
  registerOnSetPetEnabled,
1011
1041
  registerOnSetComposerValue,
1042
+ registerOnSetRuntimeCapabilities,
1012
1043
  registerOnFocusComposer
1013
1044
  ]
1014
1045
  );
@@ -1020,6 +1051,7 @@ function useParentMessenger({
1020
1051
  onSetOptions,
1021
1052
  onSetPetEnabled,
1022
1053
  onSetComposerValue,
1054
+ onSetRuntimeCapabilities,
1023
1055
  onFocusComposer
1024
1056
  } = {}) {
1025
1057
  const context = useContext(ParentMessengerContext);
@@ -1032,12 +1064,14 @@ function useParentMessenger({
1032
1064
  registerOnSetOptions,
1033
1065
  registerOnSetPetEnabled,
1034
1066
  registerOnSetComposerValue,
1067
+ registerOnSetRuntimeCapabilities,
1035
1068
  registerOnFocusComposer,
1036
1069
  ...messenger
1037
1070
  } = context;
1038
1071
  const onSetOptionsRef = useRef2(onSetOptions);
1039
1072
  const onSetPetEnabledRef = useRef2(onSetPetEnabled);
1040
1073
  const onSetComposerValueRef = useRef2(onSetComposerValue);
1074
+ const onSetRuntimeCapabilitiesRef = useRef2(onSetRuntimeCapabilities);
1041
1075
  const onFocusComposerRef = useRef2(onFocusComposer);
1042
1076
  useEffect2(() => {
1043
1077
  onSetOptionsRef.current = onSetOptions;
@@ -1048,12 +1082,16 @@ function useParentMessenger({
1048
1082
  useEffect2(() => {
1049
1083
  onSetComposerValueRef.current = onSetComposerValue;
1050
1084
  }, [onSetComposerValue]);
1085
+ useEffect2(() => {
1086
+ onSetRuntimeCapabilitiesRef.current = onSetRuntimeCapabilities;
1087
+ }, [onSetRuntimeCapabilities]);
1051
1088
  useEffect2(() => {
1052
1089
  onFocusComposerRef.current = onFocusComposer;
1053
1090
  }, [onFocusComposer]);
1054
1091
  const hasOnSetOptions = Boolean(onSetOptions);
1055
1092
  const hasOnSetPetEnabled = Boolean(onSetPetEnabled);
1056
1093
  const hasOnSetComposerValue = Boolean(onSetComposerValue);
1094
+ const hasOnSetRuntimeCapabilities = Boolean(onSetRuntimeCapabilities);
1057
1095
  const hasOnFocusComposer = Boolean(onFocusComposer);
1058
1096
  useEffect2(() => {
1059
1097
  if (!hasOnSetOptions) return;
@@ -1076,6 +1114,13 @@ function useParentMessenger({
1076
1114
  };
1077
1115
  return registerOnSetComposerValue(handler);
1078
1116
  }, [hasOnSetComposerValue, registerOnSetComposerValue]);
1117
+ useEffect2(() => {
1118
+ if (!hasOnSetRuntimeCapabilities) return;
1119
+ const handler = (selection) => {
1120
+ onSetRuntimeCapabilitiesRef.current?.(selection);
1121
+ };
1122
+ return registerOnSetRuntimeCapabilities(handler);
1123
+ }, [hasOnSetRuntimeCapabilities, registerOnSetRuntimeCapabilities]);
1079
1124
  useEffect2(() => {
1080
1125
  if (!hasOnFocusComposer) return;
1081
1126
  const handler = () => {
@@ -15466,225 +15511,839 @@ function findDomPointForComposerOffset(root, offset) {
15466
15511
  return result ?? { node: lastNode, offset: lastOffset };
15467
15512
  }
15468
15513
 
15469
- // src/lib/message-navigation.ts
15470
- var MESSAGE_NAVIGATION_MIN_ITEMS = 3;
15471
- var MAX_PREVIEW_LENGTH = 180;
15472
- var MAX_TAG_LENGTH = 40;
15473
- function isRecord6(value) {
15474
- return Boolean(value) && typeof value === "object" && !Array.isArray(value);
15475
- }
15476
- function readString4(value) {
15477
- return typeof value === "string" && value.trim() ? value.trim() : null;
15478
- }
15479
- function normalizeWhitespace(value) {
15480
- return value.replace(/\s+/g, " ").trim();
15481
- }
15482
- function truncate(value, maxLength) {
15483
- const normalized = normalizeWhitespace(value);
15484
- if (normalized.length <= maxLength) return normalized;
15485
- return `${normalized.slice(0, Math.max(0, maxLength - 1)).trimEnd()}...`;
15486
- }
15487
- function pushText(draft, value) {
15488
- const text = readString4(value);
15489
- if (text) draft.text.push(text);
15490
- }
15491
- function pushTag(draft, value) {
15492
- const tag = readString4(value);
15493
- if (!tag) return;
15494
- const normalized = truncate(tag, MAX_TAG_LENGTH);
15495
- if (!draft.tags.includes(normalized)) {
15496
- draft.tags.push(normalized);
15497
- }
15498
- }
15499
- function mergeTags(...tagGroups) {
15500
- const tags = [];
15501
- for (const group of tagGroups) {
15502
- for (const tag of group) {
15503
- if (!tags.includes(tag)) tags.push(tag);
15504
- }
15505
- }
15506
- return tags;
15507
- }
15508
- function getMessageNavigationItemId(message, index) {
15509
- const messageId = readString4(message.id);
15510
- if (messageId) return messageId;
15511
- const type = readString4(message.type) ?? "message";
15512
- return `${type}-${index}`;
15513
- }
15514
- function getMessageNavigationRole(type) {
15515
- const normalized = readString4(type)?.toLowerCase();
15516
- if (normalized === "human" || normalized === "user") return "user";
15517
- if (normalized === "ai" || normalized === "assistant") return "assistant";
15518
- if (normalized === "system") return "system";
15519
- if (normalized === "tool") return "tool";
15520
- if (normalized === "event") return "event";
15521
- return "message";
15522
- }
15523
- function isTextContent4(content) {
15524
- return content.type === "text";
15525
- }
15526
- function isReasoningContent4(content) {
15527
- return content.type === "reasoning";
15528
- }
15529
- function isComponentContent4(content) {
15530
- return content.type === "component";
15531
- }
15532
- function isMemoryContent2(content) {
15533
- return content.type === "memory";
15534
- }
15535
- function isWidgetComponent3(content) {
15536
- const data = content.data;
15537
- return data?.type === "Widget" && Array.isArray(data.widgets);
15538
- }
15539
- function isMcpAppComponent2(content) {
15540
- const data = content.data;
15541
- return data?.type === "McpApp" && typeof data.appInstanceId === "string";
15542
- }
15543
- function collectWidgetContent(draft, content, labels) {
15544
- const names = content.data.widgets.map((widget) => readString4(widget.name)).filter((name) => Boolean(name));
15545
- if (names.length === 0) {
15546
- pushTag(draft, labels.widget);
15547
- return;
15548
- }
15549
- for (const name of names) {
15550
- pushTag(draft, name);
15514
+ // src/components/chat/runtime-capabilities.tsx
15515
+ import * as React50 from "react";
15516
+ import { X as X6 } from "lucide-react";
15517
+ import { jsx as jsx55, jsxs as jsxs38 } from "react/jsx-runtime";
15518
+ function getHttpStatus(error) {
15519
+ if (!error || typeof error !== "object" || !("status" in error)) {
15520
+ return null;
15551
15521
  }
15522
+ const status = error.status;
15523
+ return typeof status === "number" ? status : null;
15552
15524
  }
15553
- function collectMcpAppContent(draft, content, labels, language) {
15554
- const title = readString4(resolveLocalizedText(content.data.title, language)) ?? readString4(content.data.toolName) ?? labels.mcpApp;
15555
- pushTag(draft, title);
15556
- pushText(draft, resolveLocalizedText(content.data.description, language));
15557
- }
15558
- function collectComponentContent(draft, content, labels, language, options) {
15559
- if (isWidgetComponent3(content)) {
15560
- collectWidgetContent(draft, content, labels);
15561
- return;
15562
- }
15563
- if (isMcpAppComponent2(content)) {
15564
- collectMcpAppContent(draft, content, labels, language);
15525
+ function warnMissingRuntimeCapabilityReferences(action, missing) {
15526
+ if (!hasMissingRuntimeCapabilityReferences(missing)) {
15565
15527
  return;
15566
15528
  }
15567
- const data = getToolStepData(content);
15568
- pushTag(
15569
- draft,
15570
- resolveLocalizedText(data.message, language) ?? getToolActivityLabel(content, language)
15529
+ console.warn(
15530
+ `[Chat] Runtime capabilities ${action} include unavailable references:`,
15531
+ missing
15571
15532
  );
15572
- if (options.includeComponentText !== false) {
15573
- pushText(draft, resolveLocalizedText(data.message, language));
15574
- pushText(draft, resolveLocalizedText(data.title, language));
15575
- pushText(draft, resolveLocalizedText(data.tool, language));
15576
- pushText(draft, resolveLocalizedText(data.type, language));
15577
- }
15578
15533
  }
15579
- function collectContentItem(draft, item, labels, language, options) {
15580
- if (item === void 0 || isThreadContextUsageRenderArtifact(item)) return;
15581
- if (typeof item === "string") {
15582
- pushText(draft, item);
15583
- return;
15584
- }
15585
- if (isTextContent4(item) || isReasoningContent4(item)) {
15586
- pushText(draft, item.text);
15587
- if (isReasoningContent4(item)) pushTag(draft, labels.reasoning);
15588
- return;
15589
- }
15590
- if (item.type === "image_url") {
15591
- pushTag(draft, labels.image);
15592
- return;
15593
- }
15594
- if (isComponentContent4(item)) {
15595
- collectComponentContent(draft, item, labels, language, options);
15596
- return;
15597
- }
15598
- if (isMemoryContent2(item)) {
15599
- pushTag(draft, labels.memory);
15534
+ function getRuntimeCapabilityPaletteEmptyLabelKey(palette, runtimeCapabilitiesReady) {
15535
+ if (!palette.capabilityTypes || palette.capabilityTypes.length !== 1) {
15536
+ return "composer.capabilities.emptySearch";
15600
15537
  }
15601
- }
15602
- function collectContent(draft, content, labels, language, options = {}) {
15603
- if (typeof content === "string") {
15604
- pushText(draft, content);
15605
- return;
15538
+ if (!runtimeCapabilitiesReady) {
15539
+ return "composer.slashCommands.empty.loadingCapabilities";
15606
15540
  }
15607
- if (!Array.isArray(content)) {
15608
- return;
15541
+ const hasQuery = palette.query.trim().length > 0;
15542
+ const capabilityType = palette.capabilityTypes[0];
15543
+ if (capabilityType === "skill") {
15544
+ return hasQuery ? "composer.slashCommands.empty.matchingSkills" : "composer.slashCommands.empty.skills";
15609
15545
  }
15610
- for (const item of content) {
15611
- collectContentItem(
15612
- draft,
15613
- item,
15614
- labels,
15615
- language,
15616
- options
15617
- );
15546
+ if (capabilityType === "plugin") {
15547
+ return hasQuery ? "composer.slashCommands.empty.matchingPlugins" : "composer.slashCommands.empty.plugins";
15618
15548
  }
15549
+ return hasQuery ? "composer.slashCommands.empty.matchingSubAgents" : "composer.slashCommands.empty.subAgents";
15619
15550
  }
15620
- function collectReasoning(draft, reasoning, labels) {
15621
- if (!Array.isArray(reasoning)) return;
15622
- for (const item of reasoning) {
15623
- if (!isRecord6(item)) continue;
15624
- pushText(draft, item.text);
15625
- if (readString4(item.text)) pushTag(draft, labels.reasoning);
15551
+ function getRuntimeCapabilityOptionsForSelection(selection, options) {
15552
+ if (!selection) {
15553
+ return [];
15626
15554
  }
15555
+ return options.filter(
15556
+ (option) => isRuntimeCapabilitySelected(selection, option.type, option.id)
15557
+ );
15627
15558
  }
15628
- function collectFiles(draft, value, fallbackLabel) {
15629
- if (!Array.isArray(value)) return;
15630
- for (const file of value) {
15631
- if (!isRecord6(file)) continue;
15632
- pushTag(
15633
- draft,
15634
- file.originalName ?? file.name ?? file.fileName ?? file.id ?? fallbackLabel
15559
+ function removeComposerCapabilityPartsFromSelection(selection, removedCapabilities) {
15560
+ let nextSelection = selection;
15561
+ for (const part of removedCapabilities) {
15562
+ nextSelection = toggleRuntimeCapabilitySelection(
15563
+ nextSelection,
15564
+ part.capability.type,
15565
+ part.capability.id,
15566
+ false
15635
15567
  );
15636
15568
  }
15569
+ return nextSelection;
15637
15570
  }
15638
- function collectReferences(draft, value) {
15639
- for (const reference of normalizeReferences(value)) {
15640
- pushTag(draft, getReferenceLabel(reference));
15641
- }
15642
- }
15643
- function collectRuntimeCapabilities(draft, value) {
15644
- if (!Array.isArray(value)) return;
15645
- for (const option of value) {
15646
- if (!isRecord6(option)) continue;
15647
- pushTag(draft, option.label ?? option.id ?? option.type);
15648
- }
15649
- }
15650
- function getTitle(role, labels, assistantTitle) {
15651
- if (role === "assistant" && assistantTitle?.trim()) {
15652
- return assistantTitle.trim();
15653
- }
15654
- return labels[role];
15571
+ function getRemovedComposerCapabilityParts(previousParts, nextParts) {
15572
+ const nextKeys = getComposerCapabilityKeys(nextParts);
15573
+ return previousParts.filter(
15574
+ (part) => part.type === "capability" && !nextKeys.has(part.key)
15575
+ );
15655
15576
  }
15656
- function buildMessageNavigationItemSummary(message, index, options, collectOptions = {}) {
15657
- const role = getMessageNavigationRole(message.type);
15658
- const draft = {
15659
- text: [],
15660
- tags: []
15661
- };
15662
- const language = options.language ?? "en-US";
15663
- const labels = options.labels;
15664
- if (role === "user") {
15665
- pushText(draft, message.submittedInput);
15666
- }
15667
- collectContent(draft, message.content, labels, language, collectOptions);
15668
- collectReasoning(draft, message.reasoning, labels);
15669
- collectFiles(draft, message.fileAssets, labels.attachment);
15670
- collectFiles(draft, message.attachments, labels.attachment);
15671
- collectReferences(draft, message.references);
15672
- collectRuntimeCapabilities(draft, message.runtimeCapabilityOptions);
15673
- const text = draft.text.map(normalizeWhitespace).filter(Boolean).join(" ");
15674
- const preview = truncate(text, MAX_PREVIEW_LENGTH) || draft.tags.slice(0, 2).join(" \xB7 ");
15675
- if (!preview && draft.tags.length === 0) {
15676
- return null;
15677
- }
15678
- const messageId = readString4(message.id) ?? void 0;
15679
- return {
15680
- id: getMessageNavigationItemId(message, index),
15681
- ...messageId ? { messageId } : {},
15682
- index,
15683
- role,
15684
- title: getTitle(role, labels, options.assistantTitle),
15685
- preview,
15686
- tags: draft.tags
15687
- };
15577
+ function useRuntimeCapabilitiesState({
15578
+ client,
15579
+ assistantId,
15580
+ threadId,
15581
+ disabled,
15582
+ composerParts
15583
+ }) {
15584
+ const [runtimeCapabilities, setRuntimeCapabilities] = React50.useState(null);
15585
+ const [runtimeCapabilitiesReady, setRuntimeCapabilitiesReady] = React50.useState(false);
15586
+ const [sessionRuntimeCapabilities, setSessionRuntimeCapabilities] = React50.useState(
15587
+ () => createEmptyRuntimeCapabilitiesSelection()
15588
+ );
15589
+ const [runRuntimeCapabilities, setRunRuntimeCapabilities] = React50.useState(
15590
+ () => createEmptyRuntimeCapabilitiesSelection()
15591
+ );
15592
+ const [runtimeCapabilityPalette, setRuntimeCapabilityPalette] = React50.useState(null);
15593
+ const runtimeCapabilityPreferenceLoadRef = React50.useRef(0);
15594
+ const pendingExternalRuntimeCapabilitiesRef = React50.useRef(null);
15595
+ const runtimeCapabilityOptions = React50.useMemo(
15596
+ () => getRuntimeCapabilityOptions(runtimeCapabilities),
15597
+ [runtimeCapabilities]
15598
+ );
15599
+ const effectiveSessionRuntimeCapabilities = React50.useMemo(
15600
+ () => runtimeCapabilitiesReady && runtimeCapabilities ? mergeRuntimeCapabilitiesSelections(
15601
+ runtimeCapabilities,
15602
+ sessionRuntimeCapabilities
15603
+ ) : null,
15604
+ [runtimeCapabilities, runtimeCapabilitiesReady, sessionRuntimeCapabilities]
15605
+ );
15606
+ const runRuntimeCapabilityOptions = React50.useMemo(
15607
+ () => runtimeCapabilityOptions.filter(
15608
+ (option) => isRuntimeCapabilitySelected(
15609
+ runRuntimeCapabilities,
15610
+ option.type,
15611
+ option.id
15612
+ )
15613
+ ),
15614
+ [runRuntimeCapabilities, runtimeCapabilityOptions]
15615
+ );
15616
+ const composerRuntimeCapabilitySelectionKeys = React50.useMemo(
15617
+ () => getComposerCapabilitySelectionKeys(composerParts),
15618
+ [composerParts]
15619
+ );
15620
+ const detachedRunRuntimeCapabilityOptions = React50.useMemo(
15621
+ () => runRuntimeCapabilityOptions.filter(
15622
+ (option) => !composerRuntimeCapabilitySelectionKeys.has(
15623
+ getRuntimeCapabilityOptionKey(option)
15624
+ )
15625
+ ),
15626
+ [composerRuntimeCapabilitySelectionKeys, runRuntimeCapabilityOptions]
15627
+ );
15628
+ const persistSessionRuntimeCapabilities = React50.useCallback(
15629
+ async (nextThreadId, selection) => {
15630
+ if (!runtimeCapabilities || !selection || !client) {
15631
+ return;
15632
+ }
15633
+ try {
15634
+ const result = await persistConversationRuntimeCapabilities({
15635
+ client,
15636
+ threadId: nextThreadId,
15637
+ capabilities: runtimeCapabilities,
15638
+ selection
15639
+ });
15640
+ warnMissingRuntimeCapabilityReferences(
15641
+ "persisted selection",
15642
+ result.missing
15643
+ );
15644
+ } catch (error) {
15645
+ console.warn(
15646
+ "[Chat] Failed to persist runtime capabilities selection:",
15647
+ error
15648
+ );
15649
+ }
15650
+ },
15651
+ [client, runtimeCapabilities]
15652
+ );
15653
+ const applyExternalRuntimeCapabilities = React50.useCallback(
15654
+ (selection) => {
15655
+ pendingExternalRuntimeCapabilitiesRef.current = selection;
15656
+ setRunRuntimeCapabilities(() => {
15657
+ const emptySelection = createEmptyRuntimeCapabilitiesSelection(runtimeCapabilities);
15658
+ if (!selection) {
15659
+ return emptySelection;
15660
+ }
15661
+ if (!runtimeCapabilities) {
15662
+ return selection;
15663
+ }
15664
+ pendingExternalRuntimeCapabilitiesRef.current = null;
15665
+ return mergeRuntimeCapabilitiesSelections(
15666
+ runtimeCapabilities,
15667
+ emptySelection,
15668
+ selection
15669
+ );
15670
+ });
15671
+ },
15672
+ [runtimeCapabilities]
15673
+ );
15674
+ const handleSessionRuntimeCapabilityToggle = React50.useCallback(
15675
+ (type, id, selected) => {
15676
+ setSessionRuntimeCapabilities((previous) => {
15677
+ const nextSelection = toggleRuntimeCapabilitySelection(
15678
+ previous,
15679
+ type,
15680
+ id,
15681
+ selected
15682
+ );
15683
+ const normalizedThreadId = threadId?.trim();
15684
+ if (normalizedThreadId) {
15685
+ void persistSessionRuntimeCapabilities(
15686
+ normalizedThreadId,
15687
+ nextSelection
15688
+ );
15689
+ }
15690
+ return nextSelection;
15691
+ });
15692
+ },
15693
+ [persistSessionRuntimeCapabilities, threadId]
15694
+ );
15695
+ const addRunRuntimeCapabilities = React50.useCallback(
15696
+ (selection) => {
15697
+ setRunRuntimeCapabilities(
15698
+ (previous) => runtimeCapabilities ? mergeRuntimeCapabilitiesSelections(
15699
+ runtimeCapabilities,
15700
+ previous,
15701
+ selection
15702
+ ) : previous
15703
+ );
15704
+ },
15705
+ [runtimeCapabilities]
15706
+ );
15707
+ const resetRunRuntimeCapabilities = React50.useCallback(() => {
15708
+ setRunRuntimeCapabilities(
15709
+ createEmptyRuntimeCapabilitiesSelection(runtimeCapabilities)
15710
+ );
15711
+ setRuntimeCapabilityPalette(null);
15712
+ }, [runtimeCapabilities]);
15713
+ const getRuntimeCapabilitiesForSubmit = React50.useCallback(
15714
+ (recommended) => {
15715
+ const recommendedRuntimeCapabilitiesForSubmit = recommended && runtimeCapabilities && runtimeCapabilitiesReady ? mergeRuntimeCapabilitiesSelections(
15716
+ runtimeCapabilities,
15717
+ runRuntimeCapabilities,
15718
+ recommended
15719
+ ) : runRuntimeCapabilities;
15720
+ const runtimeCapabilitiesForSubmit = runtimeCapabilities && runtimeCapabilitiesReady ? createRuntimeCapabilitiesForSubmit({
15721
+ capabilities: runtimeCapabilities,
15722
+ available: effectiveSessionRuntimeCapabilities,
15723
+ recommended: recommendedRuntimeCapabilitiesForSubmit
15724
+ }) : null;
15725
+ const runtimeCapabilityOptionsForMessage = getRuntimeCapabilityOptionsForSelection(
15726
+ getRecommendedRuntimeCapabilitiesSelection(
15727
+ runtimeCapabilitiesForSubmit
15728
+ ),
15729
+ runtimeCapabilityOptions
15730
+ );
15731
+ return {
15732
+ runtimeCapabilitiesForSubmit,
15733
+ runtimeCapabilityOptionsForMessage
15734
+ };
15735
+ },
15736
+ [
15737
+ effectiveSessionRuntimeCapabilities,
15738
+ runRuntimeCapabilities,
15739
+ runtimeCapabilities,
15740
+ runtimeCapabilitiesReady,
15741
+ runtimeCapabilityOptions
15742
+ ]
15743
+ );
15744
+ const getRuntimeCapabilitiesForCommand = React50.useCallback(
15745
+ (recommended) => runtimeCapabilities && runtimeCapabilitiesReady ? createRuntimeCapabilitiesForSubmit({
15746
+ capabilities: runtimeCapabilities,
15747
+ available: effectiveSessionRuntimeCapabilities,
15748
+ recommended
15749
+ }) : recommended ?? null,
15750
+ [
15751
+ effectiveSessionRuntimeCapabilities,
15752
+ runtimeCapabilities,
15753
+ runtimeCapabilitiesReady
15754
+ ]
15755
+ );
15756
+ React50.useEffect(() => {
15757
+ if (disabled || !client || !assistantId) {
15758
+ pendingExternalRuntimeCapabilitiesRef.current = null;
15759
+ setRuntimeCapabilities(null);
15760
+ setRuntimeCapabilitiesReady(false);
15761
+ setSessionRuntimeCapabilities(createEmptyRuntimeCapabilitiesSelection());
15762
+ setRunRuntimeCapabilities(createEmptyRuntimeCapabilitiesSelection());
15763
+ setRuntimeCapabilityPalette(null);
15764
+ return;
15765
+ }
15766
+ const controller = new AbortController();
15767
+ setRuntimeCapabilitiesReady(false);
15768
+ setRuntimeCapabilities(null);
15769
+ setRuntimeCapabilityPalette(null);
15770
+ void client.assistants.getRuntimeCapabilities(assistantId, {
15771
+ signal: controller.signal
15772
+ }).then((payload) => {
15773
+ setRuntimeCapabilities(payload);
15774
+ setRuntimeCapabilitiesReady(true);
15775
+ setSessionRuntimeCapabilities(
15776
+ createDefaultRuntimeCapabilitiesSelection(payload)
15777
+ );
15778
+ setRunRuntimeCapabilities(
15779
+ createEmptyRuntimeCapabilitiesSelection(payload)
15780
+ );
15781
+ }).catch((error) => {
15782
+ if (controller.signal.aborted) {
15783
+ return;
15784
+ }
15785
+ if (getHttpStatus(error) === 404) {
15786
+ setRuntimeCapabilities(null);
15787
+ setRuntimeCapabilitiesReady(false);
15788
+ setSessionRuntimeCapabilities(
15789
+ createEmptyRuntimeCapabilitiesSelection()
15790
+ );
15791
+ setRunRuntimeCapabilities(createEmptyRuntimeCapabilitiesSelection());
15792
+ return;
15793
+ }
15794
+ console.warn("[Chat] Failed to load runtime capabilities:", error);
15795
+ setRuntimeCapabilities(null);
15796
+ setRuntimeCapabilitiesReady(false);
15797
+ setSessionRuntimeCapabilities(
15798
+ createEmptyRuntimeCapabilitiesSelection()
15799
+ );
15800
+ setRunRuntimeCapabilities(createEmptyRuntimeCapabilitiesSelection());
15801
+ });
15802
+ return () => controller.abort();
15803
+ }, [assistantId, client, disabled]);
15804
+ React50.useEffect(() => {
15805
+ const emptyRunSelection = createEmptyRuntimeCapabilitiesSelection(runtimeCapabilities);
15806
+ const pendingExternalSelection = pendingExternalRuntimeCapabilitiesRef.current;
15807
+ if (pendingExternalSelection && runtimeCapabilities) {
15808
+ setRunRuntimeCapabilities(
15809
+ mergeRuntimeCapabilitiesSelections(
15810
+ runtimeCapabilities,
15811
+ emptyRunSelection,
15812
+ pendingExternalSelection
15813
+ )
15814
+ );
15815
+ pendingExternalRuntimeCapabilitiesRef.current = null;
15816
+ } else {
15817
+ setRunRuntimeCapabilities(pendingExternalSelection ?? emptyRunSelection);
15818
+ }
15819
+ if (!runtimeCapabilitiesReady || !runtimeCapabilities || !client) {
15820
+ setSessionRuntimeCapabilities(
15821
+ createEmptyRuntimeCapabilitiesSelection(runtimeCapabilities)
15822
+ );
15823
+ return;
15824
+ }
15825
+ const defaultSelection = createDefaultRuntimeCapabilitiesSelection(runtimeCapabilities);
15826
+ const normalizedThreadId = threadId?.trim();
15827
+ if (!normalizedThreadId) {
15828
+ setSessionRuntimeCapabilities(defaultSelection);
15829
+ return;
15830
+ }
15831
+ let cancelled = false;
15832
+ const requestId = runtimeCapabilityPreferenceLoadRef.current + 1;
15833
+ runtimeCapabilityPreferenceLoadRef.current = requestId;
15834
+ setSessionRuntimeCapabilities(defaultSelection);
15835
+ void loadConversationRuntimeCapabilities({
15836
+ client,
15837
+ threadId: normalizedThreadId,
15838
+ capabilities: runtimeCapabilities
15839
+ }).then(({ selection, missing }) => {
15840
+ if (cancelled || runtimeCapabilityPreferenceLoadRef.current !== requestId) {
15841
+ return;
15842
+ }
15843
+ warnMissingRuntimeCapabilityReferences("loaded selection", missing);
15844
+ setSessionRuntimeCapabilities(selection ?? defaultSelection);
15845
+ }).catch((error) => {
15846
+ if (cancelled || runtimeCapabilityPreferenceLoadRef.current !== requestId) {
15847
+ return;
15848
+ }
15849
+ console.warn(
15850
+ "[Chat] Failed to load persisted runtime capabilities selection:",
15851
+ error
15852
+ );
15853
+ setSessionRuntimeCapabilities(defaultSelection);
15854
+ });
15855
+ return () => {
15856
+ cancelled = true;
15857
+ };
15858
+ }, [
15859
+ client,
15860
+ runtimeCapabilities,
15861
+ runtimeCapabilitiesReady,
15862
+ threadId
15863
+ ]);
15864
+ return {
15865
+ runtimeCapabilities,
15866
+ runtimeCapabilitiesReady,
15867
+ runtimeCapabilityOptions,
15868
+ effectiveSessionRuntimeCapabilities,
15869
+ runRuntimeCapabilities,
15870
+ runRuntimeCapabilityOptions,
15871
+ detachedRunRuntimeCapabilityOptions,
15872
+ runtimeCapabilityPalette,
15873
+ setRunRuntimeCapabilities,
15874
+ setRuntimeCapabilityPalette,
15875
+ applyExternalRuntimeCapabilities,
15876
+ handleSessionRuntimeCapabilityToggle,
15877
+ addRunRuntimeCapabilities,
15878
+ resetRunRuntimeCapabilities,
15879
+ getRuntimeCapabilitiesForSubmit,
15880
+ getRuntimeCapabilitiesForCommand,
15881
+ persistSessionRuntimeCapabilities
15882
+ };
15883
+ }
15884
+ function useRuntimeCapabilityComposerActions({
15885
+ runtimeCapabilities,
15886
+ runtimeCapabilitiesReady,
15887
+ runtimeCapabilityOptions,
15888
+ setRunRuntimeCapabilities,
15889
+ setRuntimeCapabilityPalette,
15890
+ applyExternalRuntimeCapabilities,
15891
+ composerInputRef,
15892
+ composerPartsRef,
15893
+ commitComposerParts,
15894
+ focusComposerAt
15895
+ }) {
15896
+ const pendingExternalRuntimeCapabilityInsertRef = React50.useRef(null);
15897
+ const insertExternalRuntimeCapabilities = React50.useCallback(
15898
+ (selection) => {
15899
+ applyExternalRuntimeCapabilities(selection);
15900
+ if (!selection) {
15901
+ pendingExternalRuntimeCapabilityInsertRef.current = null;
15902
+ return;
15903
+ }
15904
+ if (!runtimeCapabilitiesReady || !runtimeCapabilities) {
15905
+ pendingExternalRuntimeCapabilityInsertRef.current = selection;
15906
+ return;
15907
+ }
15908
+ pendingExternalRuntimeCapabilityInsertRef.current = null;
15909
+ const existingKeys = getComposerCapabilitySelectionKeys(
15910
+ composerPartsRef.current
15911
+ );
15912
+ const selectedOptions = runtimeCapabilityOptions.filter(
15913
+ (option) => isRuntimeCapabilitySelected(selection, option.type, option.id) && !existingKeys.has(getRuntimeCapabilityOptionKey(option))
15914
+ );
15915
+ if (selectedOptions.length === 0) {
15916
+ focusComposerAt();
15917
+ return;
15918
+ }
15919
+ const currentParts = composerPartsRef.current;
15920
+ const insertAt = getComposerEditingLength(currentParts);
15921
+ const nextParts = replaceComposerRange(
15922
+ currentParts,
15923
+ insertAt,
15924
+ insertAt,
15925
+ selectedOptions.map(
15926
+ (option) => createComposerCapabilityPart(option, createMessageId())
15927
+ )
15928
+ );
15929
+ const nextCaretOffset = insertAt + selectedOptions.length;
15930
+ commitComposerParts(nextParts, {
15931
+ caretOffset: nextCaretOffset,
15932
+ resetDom: true,
15933
+ syncRemovedCapabilityTokens: true
15934
+ });
15935
+ setRuntimeCapabilityPalette(null);
15936
+ focusComposerAt(nextCaretOffset);
15937
+ },
15938
+ [
15939
+ applyExternalRuntimeCapabilities,
15940
+ commitComposerParts,
15941
+ composerPartsRef,
15942
+ focusComposerAt,
15943
+ runtimeCapabilities,
15944
+ runtimeCapabilitiesReady,
15945
+ runtimeCapabilityOptions,
15946
+ setRuntimeCapabilityPalette
15947
+ ]
15948
+ );
15949
+ const applyComposerValueRuntimeCapabilities = React50.useCallback(
15950
+ (payload) => {
15951
+ const runtimeCapabilitiesPayload = isRuntimeCapabilitiesSelection(payload.runtimeCapabilities) ? payload.runtimeCapabilities : payload.runtimeCapabilities === null ? null : void 0;
15952
+ if (runtimeCapabilitiesPayload === void 0) {
15953
+ return;
15954
+ }
15955
+ if (payload.insertRuntimeCapabilities === true) {
15956
+ insertExternalRuntimeCapabilities(runtimeCapabilitiesPayload);
15957
+ } else {
15958
+ applyExternalRuntimeCapabilities(runtimeCapabilitiesPayload);
15959
+ }
15960
+ },
15961
+ [applyExternalRuntimeCapabilities, insertExternalRuntimeCapabilities]
15962
+ );
15963
+ const updateRuntimeCapabilityPalette = React50.useCallback(
15964
+ (parts, selectionStart) => {
15965
+ const input = composerInputRef.current;
15966
+ const editingText = getComposerEditingText(parts);
15967
+ const nextPalette = resolveRuntimeCapabilityPalette(
15968
+ editingText,
15969
+ typeof selectionStart === "number" ? selectionStart : input ? getComposerSelectionOffset(input) : getComposerEditingLength(parts)
15970
+ );
15971
+ setRuntimeCapabilityPalette(nextPalette);
15972
+ },
15973
+ [composerInputRef, setRuntimeCapabilityPalette]
15974
+ );
15975
+ const removeRunRuntimeCapability = React50.useCallback(
15976
+ (option) => {
15977
+ setRunRuntimeCapabilities(
15978
+ (previous) => toggleRuntimeCapabilitySelection(
15979
+ previous,
15980
+ option.type,
15981
+ option.id,
15982
+ false
15983
+ )
15984
+ );
15985
+ commitComposerParts(
15986
+ removeComposerCapabilityTokens(composerPartsRef.current, option),
15987
+ {
15988
+ resetDom: true,
15989
+ syncRemovedCapabilityTokens: false
15990
+ }
15991
+ );
15992
+ },
15993
+ [commitComposerParts, composerPartsRef, setRunRuntimeCapabilities]
15994
+ );
15995
+ const insertComposerCapabilityToken = React50.useCallback(
15996
+ (capability, range) => {
15997
+ const token = createComposerCapabilityPart(capability, createMessageId());
15998
+ const currentParts = composerPartsRef.current;
15999
+ const replaceRange = range ?? {
16000
+ start: getComposerEditingLength(currentParts),
16001
+ end: getComposerEditingLength(currentParts)
16002
+ };
16003
+ const nextParts = replaceComposerRange(
16004
+ currentParts,
16005
+ replaceRange.start,
16006
+ replaceRange.end,
16007
+ [token]
16008
+ );
16009
+ commitComposerParts(nextParts, {
16010
+ caretOffset: replaceRange.start + 1,
16011
+ resetDom: true,
16012
+ syncRemovedCapabilityTokens: true
16013
+ });
16014
+ setRunRuntimeCapabilities(
16015
+ (previous) => toggleRuntimeCapabilitySelection(
16016
+ previous,
16017
+ capability.type,
16018
+ capability.id,
16019
+ true
16020
+ )
16021
+ );
16022
+ setRuntimeCapabilityPalette(null);
16023
+ focusComposerAt(replaceRange.start + 1);
16024
+ },
16025
+ [
16026
+ commitComposerParts,
16027
+ composerPartsRef,
16028
+ focusComposerAt,
16029
+ setRunRuntimeCapabilities,
16030
+ setRuntimeCapabilityPalette
16031
+ ]
16032
+ );
16033
+ React50.useEffect(() => {
16034
+ if (!runtimeCapabilitiesReady || !runtimeCapabilities) {
16035
+ return;
16036
+ }
16037
+ const pendingSelection = pendingExternalRuntimeCapabilityInsertRef.current;
16038
+ if (!pendingSelection) {
16039
+ return;
16040
+ }
16041
+ insertExternalRuntimeCapabilities(pendingSelection);
16042
+ }, [
16043
+ insertExternalRuntimeCapabilities,
16044
+ runtimeCapabilities,
16045
+ runtimeCapabilitiesReady
16046
+ ]);
16047
+ return {
16048
+ applyComposerValueRuntimeCapabilities,
16049
+ insertExternalRuntimeCapabilities,
16050
+ updateRuntimeCapabilityPalette,
16051
+ removeRunRuntimeCapability,
16052
+ insertComposerCapabilityToken
16053
+ };
16054
+ }
16055
+ function HumanRuntimeCapabilityChips({
16056
+ options
16057
+ }) {
16058
+ if (options.length === 0) {
16059
+ return null;
16060
+ }
16061
+ return /* @__PURE__ */ jsx55("div", { className: "mb-2 flex flex-wrap gap-1.5", children: options.map((option) => /* @__PURE__ */ jsxs38(
16062
+ "span",
16063
+ {
16064
+ 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",
16065
+ children: [
16066
+ /* @__PURE__ */ jsx55(RuntimeCapabilityIcon, { option, variant: "chip" }),
16067
+ /* @__PURE__ */ jsx55("span", { className: "max-w-[9rem] truncate", children: option.label })
16068
+ ]
16069
+ },
16070
+ `${option.type}:${option.id}`
16071
+ )) });
16072
+ }
16073
+ function DetachedRunRuntimeCapabilities({
16074
+ options,
16075
+ runOnlyLabel,
16076
+ removeLabel,
16077
+ onRemove
16078
+ }) {
16079
+ if (options.length === 0) {
16080
+ return null;
16081
+ }
16082
+ return /* @__PURE__ */ jsxs38("div", { className: "mb-2 flex flex-wrap items-center gap-2", children: [
16083
+ /* @__PURE__ */ jsx55("span", { className: "text-xs text-muted-foreground", children: runOnlyLabel }),
16084
+ options.map((option) => /* @__PURE__ */ jsxs38(
16085
+ "span",
16086
+ {
16087
+ 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",
16088
+ children: [
16089
+ /* @__PURE__ */ jsx55(RuntimeCapabilityIcon, { option, variant: "chip" }),
16090
+ /* @__PURE__ */ jsx55("span", { className: "max-w-40 truncate", children: option.label }),
16091
+ /* @__PURE__ */ jsx55(
16092
+ "button",
16093
+ {
16094
+ type: "button",
16095
+ onClick: () => onRemove(option),
16096
+ className: "rounded-full p-0.5 hover:bg-primary/15",
16097
+ title: removeLabel,
16098
+ "aria-label": removeLabel,
16099
+ children: /* @__PURE__ */ jsx55(X6, { size: 11 })
16100
+ }
16101
+ )
16102
+ ]
16103
+ },
16104
+ `${option.type}:${option.id}`
16105
+ ))
16106
+ ] });
16107
+ }
16108
+ function ComposerCapabilityToken({
16109
+ part
16110
+ }) {
16111
+ return /* @__PURE__ */ jsxs38(
16112
+ "span",
16113
+ {
16114
+ "data-composer-capability-key": part.key,
16115
+ "data-capability-type": part.capability.type,
16116
+ "data-capability-id": part.capability.id,
16117
+ contentEditable: false,
16118
+ className: "mx-0.5 inline-flex max-w-[14rem] select-none items-center gap-1 text-sm font-semibold text-primary align-baseline",
16119
+ children: [
16120
+ /* @__PURE__ */ jsx55(RuntimeCapabilityIcon, { option: part.capability, variant: "chip" }),
16121
+ /* @__PURE__ */ jsx55("span", { className: "truncate", children: part.capability.label })
16122
+ ]
16123
+ },
16124
+ part.key
16125
+ );
16126
+ }
16127
+
16128
+ // src/lib/message-navigation.ts
16129
+ var MESSAGE_NAVIGATION_MIN_ITEMS = 3;
16130
+ var MAX_PREVIEW_LENGTH = 180;
16131
+ var MAX_TAG_LENGTH = 40;
16132
+ function isRecord6(value) {
16133
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
16134
+ }
16135
+ function readString4(value) {
16136
+ return typeof value === "string" && value.trim() ? value.trim() : null;
16137
+ }
16138
+ function normalizeWhitespace(value) {
16139
+ return value.replace(/\s+/g, " ").trim();
16140
+ }
16141
+ function truncate(value, maxLength) {
16142
+ const normalized = normalizeWhitespace(value);
16143
+ if (normalized.length <= maxLength) return normalized;
16144
+ return `${normalized.slice(0, Math.max(0, maxLength - 1)).trimEnd()}...`;
16145
+ }
16146
+ function pushText(draft, value) {
16147
+ const text = readString4(value);
16148
+ if (text) draft.text.push(text);
16149
+ }
16150
+ function pushTag(draft, value) {
16151
+ const tag = readString4(value);
16152
+ if (!tag) return;
16153
+ const normalized = truncate(tag, MAX_TAG_LENGTH);
16154
+ if (!draft.tags.includes(normalized)) {
16155
+ draft.tags.push(normalized);
16156
+ }
16157
+ }
16158
+ function mergeTags(...tagGroups) {
16159
+ const tags = [];
16160
+ for (const group of tagGroups) {
16161
+ for (const tag of group) {
16162
+ if (!tags.includes(tag)) tags.push(tag);
16163
+ }
16164
+ }
16165
+ return tags;
16166
+ }
16167
+ function getMessageNavigationItemId(message, index) {
16168
+ const messageId = readString4(message.id);
16169
+ if (messageId) return messageId;
16170
+ const type = readString4(message.type) ?? "message";
16171
+ return `${type}-${index}`;
16172
+ }
16173
+ function getMessageNavigationRole(type) {
16174
+ const normalized = readString4(type)?.toLowerCase();
16175
+ if (normalized === "human" || normalized === "user") return "user";
16176
+ if (normalized === "ai" || normalized === "assistant") return "assistant";
16177
+ if (normalized === "system") return "system";
16178
+ if (normalized === "tool") return "tool";
16179
+ if (normalized === "event") return "event";
16180
+ return "message";
16181
+ }
16182
+ function isTextContent4(content) {
16183
+ return content.type === "text";
16184
+ }
16185
+ function isReasoningContent4(content) {
16186
+ return content.type === "reasoning";
16187
+ }
16188
+ function isComponentContent4(content) {
16189
+ return content.type === "component";
16190
+ }
16191
+ function isMemoryContent2(content) {
16192
+ return content.type === "memory";
16193
+ }
16194
+ function isWidgetComponent3(content) {
16195
+ const data = content.data;
16196
+ return data?.type === "Widget" && Array.isArray(data.widgets);
16197
+ }
16198
+ function isMcpAppComponent2(content) {
16199
+ const data = content.data;
16200
+ return data?.type === "McpApp" && typeof data.appInstanceId === "string";
16201
+ }
16202
+ function collectWidgetContent(draft, content, labels) {
16203
+ const names = content.data.widgets.map((widget) => readString4(widget.name)).filter((name) => Boolean(name));
16204
+ if (names.length === 0) {
16205
+ pushTag(draft, labels.widget);
16206
+ return;
16207
+ }
16208
+ for (const name of names) {
16209
+ pushTag(draft, name);
16210
+ }
16211
+ }
16212
+ function collectMcpAppContent(draft, content, labels, language) {
16213
+ const title = readString4(resolveLocalizedText(content.data.title, language)) ?? readString4(content.data.toolName) ?? labels.mcpApp;
16214
+ pushTag(draft, title);
16215
+ pushText(draft, resolveLocalizedText(content.data.description, language));
16216
+ }
16217
+ function collectComponentContent(draft, content, labels, language, options) {
16218
+ if (isWidgetComponent3(content)) {
16219
+ collectWidgetContent(draft, content, labels);
16220
+ return;
16221
+ }
16222
+ if (isMcpAppComponent2(content)) {
16223
+ collectMcpAppContent(draft, content, labels, language);
16224
+ return;
16225
+ }
16226
+ const data = getToolStepData(content);
16227
+ pushTag(
16228
+ draft,
16229
+ resolveLocalizedText(data.message, language) ?? getToolActivityLabel(content, language)
16230
+ );
16231
+ if (options.includeComponentText !== false) {
16232
+ pushText(draft, resolveLocalizedText(data.message, language));
16233
+ pushText(draft, resolveLocalizedText(data.title, language));
16234
+ pushText(draft, resolveLocalizedText(data.tool, language));
16235
+ pushText(draft, resolveLocalizedText(data.type, language));
16236
+ }
16237
+ }
16238
+ function collectContentItem(draft, item, labels, language, options) {
16239
+ if (item === void 0 || isThreadContextUsageRenderArtifact(item)) return;
16240
+ if (typeof item === "string") {
16241
+ pushText(draft, item);
16242
+ return;
16243
+ }
16244
+ if (isTextContent4(item) || isReasoningContent4(item)) {
16245
+ pushText(draft, item.text);
16246
+ if (isReasoningContent4(item)) pushTag(draft, labels.reasoning);
16247
+ return;
16248
+ }
16249
+ if (item.type === "image_url") {
16250
+ pushTag(draft, labels.image);
16251
+ return;
16252
+ }
16253
+ if (isComponentContent4(item)) {
16254
+ collectComponentContent(draft, item, labels, language, options);
16255
+ return;
16256
+ }
16257
+ if (isMemoryContent2(item)) {
16258
+ pushTag(draft, labels.memory);
16259
+ }
16260
+ }
16261
+ function collectContent(draft, content, labels, language, options = {}) {
16262
+ if (typeof content === "string") {
16263
+ pushText(draft, content);
16264
+ return;
16265
+ }
16266
+ if (!Array.isArray(content)) {
16267
+ return;
16268
+ }
16269
+ for (const item of content) {
16270
+ collectContentItem(
16271
+ draft,
16272
+ item,
16273
+ labels,
16274
+ language,
16275
+ options
16276
+ );
16277
+ }
16278
+ }
16279
+ function collectReasoning(draft, reasoning, labels) {
16280
+ if (!Array.isArray(reasoning)) return;
16281
+ for (const item of reasoning) {
16282
+ if (!isRecord6(item)) continue;
16283
+ pushText(draft, item.text);
16284
+ if (readString4(item.text)) pushTag(draft, labels.reasoning);
16285
+ }
16286
+ }
16287
+ function collectFiles(draft, value, fallbackLabel) {
16288
+ if (!Array.isArray(value)) return;
16289
+ for (const file of value) {
16290
+ if (!isRecord6(file)) continue;
16291
+ pushTag(
16292
+ draft,
16293
+ file.originalName ?? file.name ?? file.fileName ?? file.id ?? fallbackLabel
16294
+ );
16295
+ }
16296
+ }
16297
+ function collectReferences(draft, value) {
16298
+ for (const reference of normalizeReferences(value)) {
16299
+ pushTag(draft, getReferenceLabel(reference));
16300
+ }
16301
+ }
16302
+ function collectRuntimeCapabilities(draft, value) {
16303
+ if (!Array.isArray(value)) return;
16304
+ for (const option of value) {
16305
+ if (!isRecord6(option)) continue;
16306
+ pushTag(draft, option.label ?? option.id ?? option.type);
16307
+ }
16308
+ }
16309
+ function getTitle(role, labels, assistantTitle) {
16310
+ if (role === "assistant" && assistantTitle?.trim()) {
16311
+ return assistantTitle.trim();
16312
+ }
16313
+ return labels[role];
16314
+ }
16315
+ function buildMessageNavigationItemSummary(message, index, options, collectOptions = {}) {
16316
+ const role = getMessageNavigationRole(message.type);
16317
+ const draft = {
16318
+ text: [],
16319
+ tags: []
16320
+ };
16321
+ const language = options.language ?? "en-US";
16322
+ const labels = options.labels;
16323
+ if (role === "user") {
16324
+ pushText(draft, message.submittedInput);
16325
+ }
16326
+ collectContent(draft, message.content, labels, language, collectOptions);
16327
+ collectReasoning(draft, message.reasoning, labels);
16328
+ collectFiles(draft, message.fileAssets, labels.attachment);
16329
+ collectFiles(draft, message.attachments, labels.attachment);
16330
+ collectReferences(draft, message.references);
16331
+ collectRuntimeCapabilities(draft, message.runtimeCapabilityOptions);
16332
+ const text = draft.text.map(normalizeWhitespace).filter(Boolean).join(" ");
16333
+ const preview = truncate(text, MAX_PREVIEW_LENGTH) || draft.tags.slice(0, 2).join(" \xB7 ");
16334
+ if (!preview && draft.tags.length === 0) {
16335
+ return null;
16336
+ }
16337
+ const messageId = readString4(message.id) ?? void 0;
16338
+ return {
16339
+ id: getMessageNavigationItemId(message, index),
16340
+ ...messageId ? { messageId } : {},
16341
+ index,
16342
+ role,
16343
+ title: getTitle(role, labels, options.assistantTitle),
16344
+ preview,
16345
+ tags: draft.tags
16346
+ };
15688
16347
  }
15689
16348
  function buildMessageNavigationItems(messages, options) {
15690
16349
  const items = [];
@@ -15719,7 +16378,7 @@ function buildMessageNavigationItems(messages, options) {
15719
16378
  }
15720
16379
 
15721
16380
  // src/components/chat.tsx
15722
- import { Fragment as Fragment9, jsx as jsx55, jsxs as jsxs38 } from "react/jsx-runtime";
16381
+ import { Fragment as Fragment9, jsx as jsx56, jsxs as jsxs39 } from "react/jsx-runtime";
15723
16382
  var defaultApiUrl2 = import.meta.env.VITE_XPERTAI_API_URL;
15724
16383
  var COMPOSER_INPUT_MAX_HEIGHT = 128;
15725
16384
  var LONG_TEXT_REFERENCE_THRESHOLD = 5e3;
@@ -15735,47 +16394,6 @@ function formatGoalElapsed(seconds) {
15735
16394
  const remainingSeconds = seconds % 60;
15736
16395
  return remainingSeconds ? `${minutes}m ${remainingSeconds}s` : `${minutes}m`;
15737
16396
  }
15738
- function getSlashPaletteEmptyLabelKey(palette, runtimeCapabilitiesReady) {
15739
- if (!palette.capabilityTypes || palette.capabilityTypes.length !== 1) {
15740
- return "composer.capabilities.emptySearch";
15741
- }
15742
- if (!runtimeCapabilitiesReady) {
15743
- return "composer.slashCommands.empty.loadingCapabilities";
15744
- }
15745
- const hasQuery = palette.query.trim().length > 0;
15746
- const capabilityType = palette.capabilityTypes[0];
15747
- if (capabilityType === "skill") {
15748
- return hasQuery ? "composer.slashCommands.empty.matchingSkills" : "composer.slashCommands.empty.skills";
15749
- }
15750
- if (capabilityType === "plugin") {
15751
- return hasQuery ? "composer.slashCommands.empty.matchingPlugins" : "composer.slashCommands.empty.plugins";
15752
- }
15753
- return hasQuery ? "composer.slashCommands.empty.matchingSubAgents" : "composer.slashCommands.empty.subAgents";
15754
- }
15755
- function getHttpStatus(error) {
15756
- if (!error || typeof error !== "object" || !("status" in error)) {
15757
- return null;
15758
- }
15759
- const status = error.status;
15760
- return typeof status === "number" ? status : null;
15761
- }
15762
- function warnMissingRuntimeCapabilityReferences(action, missing) {
15763
- if (!hasMissingRuntimeCapabilityReferences(missing)) {
15764
- return;
15765
- }
15766
- console.warn(
15767
- `[Chat] Runtime capabilities ${action} include unavailable references:`,
15768
- missing
15769
- );
15770
- }
15771
- function getSelectedRuntimeCapabilityOptions(selection, options) {
15772
- if (!selection) {
15773
- return [];
15774
- }
15775
- return options.filter(
15776
- (option) => isRuntimeCapabilitySelected(selection, option.type, option.id)
15777
- );
15778
- }
15779
16397
  async function readImageDimensions(file) {
15780
16398
  if (typeof window === "undefined" || typeof URL === "undefined") {
15781
16399
  return {};
@@ -15864,7 +16482,7 @@ function ReferenceChip({
15864
16482
  const metaLine = getReferenceMetaLine(reference);
15865
16483
  const isComposer = variant === "composer";
15866
16484
  const Icon = reference.type === "quote" ? Quote : reference.type === "image" ? ImageIcon : FileText5;
15867
- return /* @__PURE__ */ jsxs38(
16485
+ return /* @__PURE__ */ jsxs39(
15868
16486
  "div",
15869
16487
  {
15870
16488
  className: cn(
@@ -15873,7 +16491,7 @@ function ReferenceChip({
15873
16491
  ),
15874
16492
  title: getReferenceTitle(reference),
15875
16493
  children: [
15876
- /* @__PURE__ */ jsx55(
16494
+ /* @__PURE__ */ jsx56(
15877
16495
  Icon,
15878
16496
  {
15879
16497
  size: isComposer ? 14 : 12,
@@ -15883,8 +16501,8 @@ function ReferenceChip({
15883
16501
  )
15884
16502
  }
15885
16503
  ),
15886
- /* @__PURE__ */ jsxs38("div", { className: "min-w-0 flex-1", children: [
15887
- /* @__PURE__ */ jsx55(
16504
+ /* @__PURE__ */ jsxs39("div", { className: "min-w-0 flex-1", children: [
16505
+ /* @__PURE__ */ jsx56(
15888
16506
  "div",
15889
16507
  {
15890
16508
  className: cn(
@@ -15894,7 +16512,7 @@ function ReferenceChip({
15894
16512
  children: getReferenceLabel(reference)
15895
16513
  }
15896
16514
  ),
15897
- metaLine && /* @__PURE__ */ jsx55(
16515
+ metaLine && /* @__PURE__ */ jsx56(
15898
16516
  "div",
15899
16517
  {
15900
16518
  className: cn(
@@ -15905,7 +16523,7 @@ function ReferenceChip({
15905
16523
  }
15906
16524
  )
15907
16525
  ] }),
15908
- onRemove && removeLabel && /* @__PURE__ */ jsx55(
16526
+ onRemove && removeLabel && /* @__PURE__ */ jsx56(
15909
16527
  "button",
15910
16528
  {
15911
16529
  type: "button",
@@ -15916,7 +16534,7 @@ function ReferenceChip({
15916
16534
  ),
15917
16535
  title: removeLabel,
15918
16536
  "aria-label": removeLabel,
15919
- children: /* @__PURE__ */ jsx55(X6, { size: 12 })
16537
+ children: /* @__PURE__ */ jsx56(X7, { size: 12 })
15920
16538
  }
15921
16539
  )
15922
16540
  ]
@@ -15941,26 +16559,56 @@ function Chat({
15941
16559
  const { setStream } = useStreamManager();
15942
16560
  const stream = useStreamContext();
15943
16561
  const { theme } = useTheme();
15944
- const [isHistoryLoading, setIsHistoryLoading] = React50.useState(false);
15945
- const [historyError, setHistoryError] = React50.useState(null);
15946
- const [assistantName, setAssistantName] = React50.useState(null);
15947
- const [assistantAvatar, setAssistantAvatar] = React50.useState(null);
15948
- const [threadGoal, setThreadGoal] = React50.useState(null);
15949
- const [goalError, setGoalError] = React50.useState(null);
15950
- const [isGoalLoading, setIsGoalLoading] = React50.useState(false);
15951
- const [isGoalPanelOpen, setIsGoalPanelOpen] = React50.useState(false);
15952
- const [isGoalObjectiveExpanded, setIsGoalObjectiveExpanded] = React50.useState(false);
15953
- const [goalElapsedStartedAt, setGoalElapsedStartedAt] = React50.useState(null);
16562
+ const effectiveClientSecret = stream.apiKey?.trim() ? stream.apiKey : clientSecret;
16563
+ const missingConfigKind = getMissingApiConfigurationKind({
16564
+ apiUrl,
16565
+ clientSecret: effectiveClientSecret
16566
+ });
16567
+ const missingConfig = Boolean(missingConfigKind);
16568
+ const missingConfigShortMessage = React51.useMemo(() => {
16569
+ switch (missingConfigKind) {
16570
+ case "apiUrl":
16571
+ return t("chat.missingApiUrlShort");
16572
+ case "clientSecret":
16573
+ return t("chat.missingClientSecretShort");
16574
+ case "apiUrlAndClientSecret":
16575
+ return t("chat.missingApiUrlAndClientSecretShort");
16576
+ default:
16577
+ return t("chat.missingConfigShort");
16578
+ }
16579
+ }, [missingConfigKind, t]);
16580
+ const missingConfigDetailMessage = React51.useMemo(() => {
16581
+ switch (missingConfigKind) {
16582
+ case "apiUrl":
16583
+ return t("chat.missingApiUrlDetail");
16584
+ case "clientSecret":
16585
+ return t("chat.missingClientSecretDetail");
16586
+ case "apiUrlAndClientSecret":
16587
+ return t("chat.missingApiUrlAndClientSecretDetail");
16588
+ default:
16589
+ return t("chat.missingConfigDetail");
16590
+ }
16591
+ }, [missingConfigKind, t]);
16592
+ const [isHistoryLoading, setIsHistoryLoading] = React51.useState(false);
16593
+ const [historyError, setHistoryError] = React51.useState(null);
16594
+ const [assistantName, setAssistantName] = React51.useState(null);
16595
+ const [assistantAvatar, setAssistantAvatar] = React51.useState(null);
16596
+ const [threadGoal, setThreadGoal] = React51.useState(null);
16597
+ const [goalError, setGoalError] = React51.useState(null);
16598
+ const [isGoalLoading, setIsGoalLoading] = React51.useState(false);
16599
+ const [isGoalPanelOpen, setIsGoalPanelOpen] = React51.useState(false);
16600
+ const [isGoalObjectiveExpanded, setIsGoalObjectiveExpanded] = React51.useState(false);
16601
+ const [goalElapsedStartedAt, setGoalElapsedStartedAt] = React51.useState(null);
15954
16602
  const LOADING_DOTS_MIN_DURATION = 800;
15955
16603
  const STREAMING_STATUS_REFRESH_MS = 250;
15956
- const [showLoadingDots, setShowLoadingDots] = React50.useState(false);
15957
- const [streamingNow, setStreamingNow] = React50.useState(() => Date.now());
15958
- const loadingStartTimeRef = React50.useRef(null);
15959
- const lastStreamOutputAtRef = React50.useRef(null);
15960
- React50.useEffect(() => {
16604
+ const [showLoadingDots, setShowLoadingDots] = React51.useState(false);
16605
+ const [streamingNow, setStreamingNow] = React51.useState(() => Date.now());
16606
+ const loadingStartTimeRef = React51.useRef(null);
16607
+ const lastStreamOutputAtRef = React51.useRef(null);
16608
+ React51.useEffect(() => {
15961
16609
  setStream(stream);
15962
16610
  }, [setStream, stream]);
15963
- React50.useEffect(() => {
16611
+ React51.useEffect(() => {
15964
16612
  if (stream.isLoading) {
15965
16613
  if (!loadingStartTimeRef.current) {
15966
16614
  loadingStartTimeRef.current = Date.now();
@@ -15983,7 +16631,7 @@ function Chat({
15983
16631
  }
15984
16632
  }
15985
16633
  }, [stream.isLoading]);
15986
- React50.useEffect(() => {
16634
+ React51.useEffect(() => {
15987
16635
  if (!stream.isLoading) {
15988
16636
  lastStreamOutputAtRef.current = null;
15989
16637
  setStreamingNow(Date.now());
@@ -15993,7 +16641,7 @@ function Chat({
15993
16641
  lastStreamOutputAtRef.current = now;
15994
16642
  setStreamingNow(now);
15995
16643
  }, [stream.messages, stream.isLoading]);
15996
- React50.useEffect(() => {
16644
+ React51.useEffect(() => {
15997
16645
  if (!stream.isLoading) {
15998
16646
  return;
15999
16647
  }
@@ -16002,7 +16650,7 @@ function Chat({
16002
16650
  }, STREAMING_STATUS_REFRESH_MS);
16003
16651
  return () => window.clearInterval(timer);
16004
16652
  }, [stream.isLoading]);
16005
- React50.useEffect(() => {
16653
+ React51.useEffect(() => {
16006
16654
  if (threadGoal?.status === "active" && stream.isLoading) {
16007
16655
  setGoalElapsedStartedAt(Date.now());
16008
16656
  return;
@@ -16014,86 +16662,100 @@ function Chat({
16014
16662
  threadGoal?.id,
16015
16663
  threadGoal?.status
16016
16664
  ]);
16017
- React50.useEffect(() => {
16665
+ React51.useEffect(() => {
16018
16666
  setIsGoalObjectiveExpanded(false);
16019
16667
  }, [threadGoal?.id]);
16020
- const [composerParts, setComposerParts] = React50.useState([]);
16021
- const [renderedComposerParts, setRenderedComposerParts] = React50.useState([]);
16022
- const [composerDomVersion, setComposerDomVersion] = React50.useState(0);
16023
- const [selectedTool, setSelectedTool] = React50.useState(
16668
+ const [composerParts, setComposerParts] = React51.useState([]);
16669
+ const [renderedComposerParts, setRenderedComposerParts] = React51.useState([]);
16670
+ const [composerDomVersion, setComposerDomVersion] = React51.useState(0);
16671
+ const [selectedTool, setSelectedTool] = React51.useState(
16024
16672
  null
16025
16673
  );
16026
- const [planModeEnabled, setPlanModeEnabled] = React50.useState(false);
16027
- const [petSettingsOpen, setPetSettingsOpen] = React50.useState(false);
16028
- const [petLocalSettings, setPetLocalSettings] = React50.useState(() => readPetLocalSettings());
16029
- const [runtimeCapabilities, setRuntimeCapabilities] = React50.useState(null);
16030
- const [runtimeCapabilitiesReady, setRuntimeCapabilitiesReady] = React50.useState(false);
16031
- const [sessionRuntimeCapabilities, setSessionRuntimeCapabilities] = React50.useState(
16032
- () => createEmptyRuntimeCapabilitiesSelection()
16033
- );
16034
- const [runRuntimeCapabilities, setRunRuntimeCapabilities] = React50.useState(
16035
- () => createEmptyRuntimeCapabilitiesSelection()
16036
- );
16037
- const [runtimeCapabilityPalette, setRuntimeCapabilityPalette] = React50.useState(null);
16038
- const [attachmentState, setAttachmentState] = React50.useState({
16674
+ const [planModeEnabled, setPlanModeEnabled] = React51.useState(false);
16675
+ const [petSettingsOpen, setPetSettingsOpen] = React51.useState(false);
16676
+ const [petLocalSettings, setPetLocalSettings] = React51.useState(() => readPetLocalSettings());
16677
+ const [attachmentState, setAttachmentState] = React51.useState({
16039
16678
  uploadedFiles: [],
16040
16679
  hasUploadingFiles: false,
16041
16680
  hasParsingFiles: false
16042
16681
  });
16043
- const [references, setReferences] = React50.useState([]);
16044
- const [isUploadingReferenceImages, setIsUploadingReferenceImages] = React50.useState(false);
16045
- const [quoteSelection, setQuoteSelection] = React50.useState(null);
16046
- const [isAtBottom, setIsAtBottom] = React50.useState(true);
16047
- const [hasUpdatesBelow, setHasUpdatesBelow] = React50.useState(false);
16682
+ const [references, setReferences] = React51.useState([]);
16683
+ const [isUploadingReferenceImages, setIsUploadingReferenceImages] = React51.useState(false);
16684
+ const [quoteSelection, setQuoteSelection] = React51.useState(null);
16685
+ const [isAtBottom, setIsAtBottom] = React51.useState(true);
16686
+ const [hasUpdatesBelow, setHasUpdatesBelow] = React51.useState(false);
16048
16687
  const {
16049
16688
  threads,
16050
16689
  deleteThread,
16051
16690
  refreshThreads,
16052
16691
  isLoading: isThreadsLoading
16053
16692
  } = useThreads();
16054
- const viewportRef = React50.useRef(null);
16055
- const messageNavigationAnchorsRef = React50.useRef(
16693
+ const viewportRef = React51.useRef(null);
16694
+ const messageNavigationAnchorsRef = React51.useRef(
16056
16695
  /* @__PURE__ */ new Map()
16057
16696
  );
16058
- const attachmentsRef = React50.useRef(null);
16059
- const composerInputRef = React50.useRef(null);
16060
- const slashPaletteRef = React50.useRef(null);
16061
- const slashPaletteOptionRefs = React50.useRef(
16697
+ const attachmentsRef = React51.useRef(null);
16698
+ const composerInputRef = React51.useRef(null);
16699
+ const slashPaletteRef = React51.useRef(null);
16700
+ const slashPaletteOptionRefs = React51.useRef(
16062
16701
  []
16063
16702
  );
16064
- const composerPartsRef = React50.useRef([]);
16065
- const pendingComposerCaretOffsetRef = React50.useRef(null);
16066
- const shouldAutoScrollRef = React50.useRef(true);
16067
- const forceFollowRef = React50.useRef(false);
16068
- const previousMessageCountRef = React50.useRef(0);
16069
- const previousScrollTopRef = React50.useRef(0);
16070
- const isPrependingHistoryMessagesRef = React50.useRef(false);
16071
- const autoScrollFrameRef = React50.useRef(null);
16072
- const isPointerDownRef = React50.useRef(false);
16073
- const lastTouchYRef = React50.useRef(null);
16074
- const runtimeCapabilityPreferenceLoadRef = React50.useRef(0);
16703
+ const composerPartsRef = React51.useRef([]);
16704
+ const pendingComposerCaretOffsetRef = React51.useRef(null);
16705
+ const shouldAutoScrollRef = React51.useRef(true);
16706
+ const forceFollowRef = React51.useRef(false);
16707
+ const previousMessageCountRef = React51.useRef(0);
16708
+ const previousScrollTopRef = React51.useRef(0);
16709
+ const isPrependingHistoryMessagesRef = React51.useRef(false);
16710
+ const autoScrollFrameRef = React51.useRef(null);
16711
+ const isPointerDownRef = React51.useRef(false);
16712
+ const lastTouchYRef = React51.useRef(null);
16713
+ const {
16714
+ runtimeCapabilities,
16715
+ runtimeCapabilitiesReady,
16716
+ runtimeCapabilityOptions,
16717
+ effectiveSessionRuntimeCapabilities,
16718
+ runRuntimeCapabilities,
16719
+ detachedRunRuntimeCapabilityOptions,
16720
+ runtimeCapabilityPalette,
16721
+ setRunRuntimeCapabilities,
16722
+ setRuntimeCapabilityPalette,
16723
+ applyExternalRuntimeCapabilities,
16724
+ handleSessionRuntimeCapabilityToggle,
16725
+ addRunRuntimeCapabilities,
16726
+ resetRunRuntimeCapabilities,
16727
+ getRuntimeCapabilitiesForSubmit,
16728
+ getRuntimeCapabilitiesForCommand,
16729
+ persistSessionRuntimeCapabilities
16730
+ } = useRuntimeCapabilitiesState({
16731
+ client: stream.client,
16732
+ assistantId: stream.assistantId,
16733
+ threadId: stream.threadId,
16734
+ disabled: missingConfig || !stream.client || !stream.assistantId,
16735
+ composerParts
16736
+ });
16075
16737
  const resolvedTitle = title ?? t("chat.title");
16076
16738
  const resolvedPlaceholder = placeholder ?? t("chat.placeholder");
16077
16739
  const assistantTitle = assistantName || resolvedTitle;
16078
16740
  const petRequired = options?.displayMode === "pet";
16079
- const basePetSettings = React50.useMemo(
16741
+ const basePetSettings = React51.useMemo(
16080
16742
  () => derivePetLocalSettings(options?.pet),
16081
16743
  [options?.pet]
16082
16744
  );
16083
- const displayedPetSettings = React50.useMemo(
16745
+ const displayedPetSettings = React51.useMemo(
16084
16746
  () => ({
16085
16747
  ...petLocalSettings ?? basePetSettings,
16086
16748
  ...petRequired ? { enabled: true } : {}
16087
16749
  }),
16088
16750
  [basePetSettings, petLocalSettings, petRequired]
16089
16751
  );
16090
- const effectivePet = React50.useMemo(() => {
16752
+ const effectivePet = React51.useMemo(() => {
16091
16753
  if (petRequired || petLocalSettings) {
16092
16754
  return buildPetOptionsFromLocalSettings(displayedPetSettings);
16093
16755
  }
16094
16756
  return options?.pet ?? null;
16095
16757
  }, [displayedPetSettings, options?.pet, petLocalSettings, petRequired]);
16096
- const savePetLocalSettings = React50.useCallback(
16758
+ const savePetLocalSettings = React51.useCallback(
16097
16759
  (settings) => {
16098
16760
  const nextSettings = petRequired ? { ...settings, enabled: true } : settings;
16099
16761
  setPetLocalSettings(nextSettings);
@@ -16101,7 +16763,7 @@ function Chat({
16101
16763
  },
16102
16764
  [petRequired]
16103
16765
  );
16104
- const handlePetCommand = React50.useCallback(
16766
+ const handlePetCommand = React51.useCallback(
16105
16767
  (mode) => {
16106
16768
  if (mode === "settings") {
16107
16769
  setPetSettingsOpen(true);
@@ -16123,11 +16785,11 @@ function Chat({
16123
16785
  [displayedPetSettings, effectivePet, petRequired, savePetLocalSettings]
16124
16786
  );
16125
16787
  const inputPlaceholder = selectedTool?.placeholderOverride ?? composer?.placeholder ?? resolvedPlaceholder;
16126
- const messages = React50.useMemo(
16788
+ const messages = React51.useMemo(
16127
16789
  () => stream.messages ?? [],
16128
16790
  [stream.messages]
16129
16791
  );
16130
- const messageNavigationLabels = React50.useMemo(
16792
+ const messageNavigationLabels = React51.useMemo(
16131
16793
  () => ({
16132
16794
  user: t("chat.youLabel"),
16133
16795
  assistant: assistantTitle,
@@ -16146,7 +16808,7 @@ function Chat({
16146
16808
  }),
16147
16809
  [assistantTitle, t]
16148
16810
  );
16149
- const messageNavigationItems = React50.useMemo(
16811
+ const messageNavigationItems = React51.useMemo(
16150
16812
  () => messageNavigationEnabled ? buildMessageNavigationItems(
16151
16813
  messages,
16152
16814
  {
@@ -16169,7 +16831,7 @@ function Chat({
16169
16831
  historyMessagePagination?.isLoadingMore
16170
16832
  );
16171
16833
  const canLoadMoreMessages = Boolean(historyMessagePagination?.hasMore);
16172
- const draft = React50.useMemo(
16834
+ const draft = React51.useMemo(
16173
16835
  () => getComposerPlainText(composerParts),
16174
16836
  [composerParts]
16175
16837
  );
@@ -16183,7 +16845,7 @@ function Chat({
16183
16845
  isEmpty: isComposerInputEmpty,
16184
16846
  isStacked: isComposerStacked
16185
16847
  });
16186
- const pendingFollowUps = React50.useMemo(
16848
+ const pendingFollowUps = React51.useMemo(
16187
16849
  () => sortVisiblePendingFollowUps(stream.pendingFollowUps ?? []),
16188
16850
  [stream.pendingFollowUps]
16189
16851
  );
@@ -16192,81 +16854,23 @@ function Chat({
16192
16854
  const hasPendingHITLRequest = Boolean(stream.pendingHITLRequest);
16193
16855
  const hasPendingInteractiveRequest = hasPendingRequestUserInput || hasPendingHITLRequest;
16194
16856
  const hasPendingTodos = Boolean(stream.todos?.items.length);
16195
- const runtimeCapabilityOptions = React50.useMemo(
16196
- () => getRuntimeCapabilityOptions(runtimeCapabilities),
16197
- [runtimeCapabilities]
16198
- );
16199
- const goalAdapter = React50.useMemo(() => {
16857
+ const goalAdapter = React51.useMemo(() => {
16200
16858
  if (isGoalAdapter(options?.goal)) {
16201
16859
  return options.goal;
16202
16860
  }
16203
16861
  return supportsXpertThreadGoalAdapter(stream.client) ? createXpertThreadGoalAdapter(stream.client) : null;
16204
16862
  }, [options?.goal, stream.client]);
16205
16863
  const displayedGoalElapsedSeconds = threadGoal ? (threadGoal.elapsedSeconds ?? 0) + (goalElapsedStartedAt ? Math.max(0, Math.floor((streamingNow - goalElapsedStartedAt) / 1e3)) : 0) : 0;
16206
- const effectiveSessionRuntimeCapabilities = React50.useMemo(
16207
- () => runtimeCapabilitiesReady && runtimeCapabilities ? mergeRuntimeCapabilitiesSelections(
16208
- runtimeCapabilities,
16209
- sessionRuntimeCapabilities
16210
- ) : null,
16211
- [runtimeCapabilities, runtimeCapabilitiesReady, sessionRuntimeCapabilities]
16212
- );
16213
16864
  const goalCommandAvailable = hasSelectedRuntimeSlashCommand(
16214
16865
  runtimeCapabilities,
16215
16866
  effectiveSessionRuntimeCapabilities,
16216
16867
  "goal"
16217
16868
  );
16218
16869
  const showGoalStatus = goalCommandAvailable && !hasCompletedGoal && (Boolean(goalError) || threadGoal?.status === "active" && stream.isLoading);
16219
- const runRuntimeCapabilityOptions = React50.useMemo(
16220
- () => runtimeCapabilityOptions.filter(
16221
- (option) => isRuntimeCapabilitySelected(
16222
- runRuntimeCapabilities,
16223
- option.type,
16224
- option.id
16225
- )
16226
- ),
16227
- [runRuntimeCapabilities, runtimeCapabilityOptions]
16228
- );
16229
- const composerRuntimeCapabilitySelectionKeys = React50.useMemo(
16230
- () => getComposerCapabilitySelectionKeys(composerParts),
16231
- [composerParts]
16232
- );
16233
- const detachedRunRuntimeCapabilityOptions = React50.useMemo(
16234
- () => runRuntimeCapabilityOptions.filter(
16235
- (option) => !composerRuntimeCapabilitySelectionKeys.has(
16236
- getRuntimeCapabilityOptionKey(option)
16237
- )
16238
- ),
16239
- [composerRuntimeCapabilitySelectionKeys, runRuntimeCapabilityOptions]
16240
- );
16241
- const persistSessionRuntimeCapabilities = React50.useCallback(
16242
- async (threadId, selection) => {
16243
- if (!runtimeCapabilities || !selection) {
16244
- return;
16245
- }
16246
- try {
16247
- const result = await persistConversationRuntimeCapabilities({
16248
- client: stream.client,
16249
- threadId,
16250
- capabilities: runtimeCapabilities,
16251
- selection
16252
- });
16253
- warnMissingRuntimeCapabilityReferences(
16254
- "persisted selection",
16255
- result.missing
16256
- );
16257
- } catch (error) {
16258
- console.warn(
16259
- "[Chat] Failed to persist runtime capabilities selection:",
16260
- error
16261
- );
16262
- }
16263
- },
16264
- [runtimeCapabilities, stream.client]
16265
- );
16266
- const clearQuoteSelection = React50.useCallback(() => {
16870
+ const clearQuoteSelection = React51.useCallback(() => {
16267
16871
  setQuoteSelection(null);
16268
16872
  }, []);
16269
- const commitComposerParts = React50.useCallback(
16873
+ const commitComposerParts = React51.useCallback(
16270
16874
  (nextParts, options2) => {
16271
16875
  const normalized = normalizeComposerParts(nextParts);
16272
16876
  const previous = composerPartsRef.current;
@@ -16275,23 +16879,17 @@ function Chat({
16275
16879
  pendingComposerCaretOffsetRef.current = options2.caretOffset;
16276
16880
  }
16277
16881
  if (options2?.syncRemovedCapabilityTokens ?? true) {
16278
- const nextKeys = getComposerCapabilityKeys(normalized);
16279
- const removedCapabilities = previous.filter(
16280
- (part) => part.type === "capability" && !nextKeys.has(part.key)
16882
+ const removedCapabilities = getRemovedComposerCapabilityParts(
16883
+ previous,
16884
+ normalized
16281
16885
  );
16282
16886
  if (removedCapabilities.length > 0) {
16283
- setRunRuntimeCapabilities((selection) => {
16284
- let nextSelection = selection;
16285
- for (const part of removedCapabilities) {
16286
- nextSelection = toggleRuntimeCapabilitySelection(
16287
- nextSelection,
16288
- part.capability.type,
16289
- part.capability.id,
16290
- false
16291
- );
16292
- }
16293
- return nextSelection;
16294
- });
16887
+ setRunRuntimeCapabilities(
16888
+ (selection) => removeComposerCapabilityPartsFromSelection(
16889
+ selection,
16890
+ removedCapabilities
16891
+ )
16892
+ );
16295
16893
  }
16296
16894
  }
16297
16895
  setComposerParts(normalized);
@@ -16300,9 +16898,9 @@ function Chat({
16300
16898
  setComposerDomVersion((version) => version + 1);
16301
16899
  }
16302
16900
  },
16303
- []
16901
+ [setRunRuntimeCapabilities]
16304
16902
  );
16305
- const setComposerText = React50.useCallback(
16903
+ const setComposerText = React51.useCallback(
16306
16904
  (text, caretOffset = text.length) => {
16307
16905
  commitComposerParts(createComposerTextParts(text), {
16308
16906
  caretOffset,
@@ -16312,7 +16910,7 @@ function Chat({
16312
16910
  },
16313
16911
  [commitComposerParts]
16314
16912
  );
16315
- const focusComposerAt = React50.useCallback((position) => {
16913
+ const focusComposerAt = React51.useCallback((position) => {
16316
16914
  const nextPosition = position ?? getComposerEditingLength(composerPartsRef.current);
16317
16915
  pendingComposerCaretOffsetRef.current = nextPosition;
16318
16916
  requestAnimationFrame(() => {
@@ -16323,8 +16921,25 @@ function Chat({
16323
16921
  setComposerSelectionOffset(input, nextPosition);
16324
16922
  });
16325
16923
  }, []);
16924
+ const {
16925
+ applyComposerValueRuntimeCapabilities,
16926
+ updateRuntimeCapabilityPalette,
16927
+ removeRunRuntimeCapability,
16928
+ insertComposerCapabilityToken
16929
+ } = useRuntimeCapabilityComposerActions({
16930
+ runtimeCapabilities,
16931
+ runtimeCapabilitiesReady,
16932
+ runtimeCapabilityOptions,
16933
+ setRunRuntimeCapabilities,
16934
+ setRuntimeCapabilityPalette,
16935
+ applyExternalRuntimeCapabilities,
16936
+ composerInputRef,
16937
+ composerPartsRef,
16938
+ commitComposerParts,
16939
+ focusComposerAt
16940
+ });
16326
16941
  const parentMessenger = useParentMessenger({
16327
- onSetComposerValue: React50.useCallback(
16942
+ onSetComposerValue: React51.useCallback(
16328
16943
  (payload) => {
16329
16944
  if (!payload) {
16330
16945
  return;
@@ -16344,13 +16959,24 @@ function Chat({
16344
16959
  ) ?? null;
16345
16960
  setSelectedTool(nextTool);
16346
16961
  }
16962
+ applyComposerValueRuntimeCapabilities(payload);
16963
+ },
16964
+ [
16965
+ applyComposerValueRuntimeCapabilities,
16966
+ composer?.tools,
16967
+ setComposerText
16968
+ ]
16969
+ ),
16970
+ onSetRuntimeCapabilities: React51.useCallback(
16971
+ (selection) => {
16972
+ applyExternalRuntimeCapabilities(selection);
16347
16973
  },
16348
- [composer?.tools, setComposerText]
16974
+ [applyExternalRuntimeCapabilities]
16349
16975
  ),
16350
- onFocusComposer: React50.useCallback(() => {
16976
+ onFocusComposer: React51.useCallback(() => {
16351
16977
  composerInputRef.current?.focus();
16352
16978
  }, []),
16353
- onSetPetEnabled: React50.useCallback(
16979
+ onSetPetEnabled: React51.useCallback(
16354
16980
  (enabled) => {
16355
16981
  if (petRequired) {
16356
16982
  return;
@@ -16364,10 +16990,10 @@ function Chat({
16364
16990
  )
16365
16991
  });
16366
16992
  const canMinimizeToPet = parentMessenger?.isParentAvailable === true && isPetEnabled(effectivePet);
16367
- const handleMinimizeToPet = React50.useCallback(() => {
16993
+ const handleMinimizeToPet = React51.useCallback(() => {
16368
16994
  parentMessenger?.sendEvent("chat_minimize_change", { minimized: true });
16369
16995
  }, [parentMessenger]);
16370
- const syncQuoteSelection = React50.useCallback(() => {
16996
+ const syncQuoteSelection = React51.useCallback(() => {
16371
16997
  if (typeof window === "undefined") {
16372
16998
  clearQuoteSelection();
16373
16999
  return;
@@ -16412,23 +17038,23 @@ function Chat({
16412
17038
  left
16413
17039
  });
16414
17040
  }, [clearQuoteSelection]);
16415
- const cancelPendingAutoScroll = React50.useCallback(() => {
17041
+ const cancelPendingAutoScroll = React51.useCallback(() => {
16416
17042
  if (autoScrollFrameRef.current !== null) {
16417
17043
  cancelAnimationFrame(autoScrollFrameRef.current);
16418
17044
  autoScrollFrameRef.current = null;
16419
17045
  }
16420
17046
  }, []);
16421
- const disableAutoFollow = React50.useCallback(() => {
17047
+ const disableAutoFollow = React51.useCallback(() => {
16422
17048
  forceFollowRef.current = false;
16423
17049
  shouldAutoScrollRef.current = false;
16424
17050
  cancelPendingAutoScroll();
16425
17051
  }, [cancelPendingAutoScroll]);
16426
- const enableAutoFollow = React50.useCallback(() => {
17052
+ const enableAutoFollow = React51.useCallback(() => {
16427
17053
  forceFollowRef.current = true;
16428
17054
  shouldAutoScrollRef.current = true;
16429
17055
  setHasUpdatesBelow(false);
16430
17056
  }, []);
16431
- const scrollToBottom = React50.useCallback(
17057
+ const scrollToBottom = React51.useCallback(
16432
17058
  (smooth = false, force = false) => {
16433
17059
  if (force) {
16434
17060
  enableAutoFollow();
@@ -16455,7 +17081,7 @@ function Chat({
16455
17081
  },
16456
17082
  [cancelPendingAutoScroll, enableAutoFollow]
16457
17083
  );
16458
- const setMessageNavigationAnchor = React50.useCallback(
17084
+ const setMessageNavigationAnchor = React51.useCallback(
16459
17085
  (id, node) => {
16460
17086
  if (node) {
16461
17087
  messageNavigationAnchorsRef.current.set(id, node);
@@ -16465,15 +17091,15 @@ function Chat({
16465
17091
  },
16466
17092
  []
16467
17093
  );
16468
- const getMessageNavigationAnchor = React50.useCallback(
17094
+ const getMessageNavigationAnchor = React51.useCallback(
16469
17095
  (item) => messageNavigationAnchorsRef.current.get(item.id) ?? null,
16470
17096
  []
16471
17097
  );
16472
- const handleMessageNavigationNavigate = React50.useCallback(() => {
17098
+ const handleMessageNavigationNavigate = React51.useCallback(() => {
16473
17099
  disableAutoFollow();
16474
17100
  clearQuoteSelection();
16475
17101
  }, [clearQuoteSelection, disableAutoFollow]);
16476
- React50.useEffect(() => {
17102
+ React51.useEffect(() => {
16477
17103
  const viewport = viewportRef.current;
16478
17104
  if (!viewport) return;
16479
17105
  previousScrollTopRef.current = viewport.scrollTop;
@@ -16554,14 +17180,14 @@ function Chat({
16554
17180
  window.removeEventListener("pointercancel", stopPointerTracking);
16555
17181
  };
16556
17182
  }, [cancelPendingAutoScroll, disableAutoFollow]);
16557
- React50.useEffect(() => {
17183
+ React51.useEffect(() => {
16558
17184
  shouldAutoScrollRef.current = true;
16559
17185
  forceFollowRef.current = false;
16560
17186
  previousScrollTopRef.current = 0;
16561
17187
  setIsAtBottom(true);
16562
17188
  setHasUpdatesBelow(false);
16563
17189
  }, [stream.threadId]);
16564
- React50.useEffect(() => {
17190
+ React51.useEffect(() => {
16565
17191
  const messageCountChanged = messages.length !== previousMessageCountRef.current;
16566
17192
  previousMessageCountRef.current = messages.length;
16567
17193
  if (isPrependingHistoryMessagesRef.current) {
@@ -16569,51 +17195,21 @@ function Chat({
16569
17195
  return;
16570
17196
  }
16571
17197
  if (!shouldAutoScrollRef.current) {
16572
- if (messageCountChanged || stream.isLoading) {
16573
- setHasUpdatesBelow(true);
16574
- }
16575
- return;
16576
- }
16577
- if (messageCountChanged || stream.isLoading) {
16578
- scrollToBottom();
16579
- }
16580
- }, [stream.isLoading, messages, scrollToBottom]);
16581
- const effectiveClientSecret = stream.apiKey?.trim() ? stream.apiKey : clientSecret;
16582
- const missingConfigKind = getMissingApiConfigurationKind({
16583
- apiUrl,
16584
- clientSecret: effectiveClientSecret
16585
- });
16586
- const missingConfig = Boolean(missingConfigKind);
16587
- const missingConfigShortMessage = React50.useMemo(() => {
16588
- switch (missingConfigKind) {
16589
- case "apiUrl":
16590
- return t("chat.missingApiUrlShort");
16591
- case "clientSecret":
16592
- return t("chat.missingClientSecretShort");
16593
- case "apiUrlAndClientSecret":
16594
- return t("chat.missingApiUrlAndClientSecretShort");
16595
- default:
16596
- return t("chat.missingConfigShort");
17198
+ if (messageCountChanged || stream.isLoading) {
17199
+ setHasUpdatesBelow(true);
17200
+ }
17201
+ return;
16597
17202
  }
16598
- }, [missingConfigKind, t]);
16599
- const missingConfigDetailMessage = React50.useMemo(() => {
16600
- switch (missingConfigKind) {
16601
- case "apiUrl":
16602
- return t("chat.missingApiUrlDetail");
16603
- case "clientSecret":
16604
- return t("chat.missingClientSecretDetail");
16605
- case "apiUrlAndClientSecret":
16606
- return t("chat.missingApiUrlAndClientSecretDetail");
16607
- default:
16608
- return t("chat.missingConfigDetail");
17203
+ if (messageCountChanged || stream.isLoading) {
17204
+ scrollToBottom();
16609
17205
  }
16610
- }, [missingConfigKind, t]);
17206
+ }, [stream.isLoading, messages, scrollToBottom]);
16611
17207
  const showMissingConfig = !isClientSecretInitializing && missingConfig;
16612
17208
  const hasUploadingFiles = attachmentState.hasUploadingFiles;
16613
17209
  const isSubmissionBlocked = hasPendingInteractiveRequest || missingConfig || isHistoryLoading || hasUploadingFiles || isUploadingReferenceImages;
16614
17210
  const isSendDisabled = !trimmedDraft && !hasReferences || isSubmissionBlocked;
16615
17211
  const isPromptEditDisabled = hasPendingInteractiveRequest || missingConfig || isHistoryLoading;
16616
- const resizeComposerInput = React50.useCallback(() => {
17212
+ const resizeComposerInput = React51.useCallback(() => {
16617
17213
  const input = composerInputRef.current;
16618
17214
  if (!input) {
16619
17215
  return;
@@ -16621,7 +17217,7 @@ function Chat({
16621
17217
  input.style.maxHeight = `${COMPOSER_INPUT_MAX_HEIGHT}px`;
16622
17218
  input.style.overflowY = input.scrollHeight > COMPOSER_INPUT_MAX_HEIGHT ? "auto" : "hidden";
16623
17219
  }, []);
16624
- React50.useLayoutEffect(() => {
17220
+ React51.useLayoutEffect(() => {
16625
17221
  composerPartsRef.current = composerParts;
16626
17222
  resizeComposerInput();
16627
17223
  const caretOffset = pendingComposerCaretOffsetRef.current;
@@ -16633,13 +17229,13 @@ function Chat({
16633
17229
  }
16634
17230
  }
16635
17231
  }, [composerDomVersion, composerParts, resizeComposerInput]);
16636
- React50.useEffect(() => {
17232
+ React51.useEffect(() => {
16637
17233
  document.addEventListener("selectionchange", syncQuoteSelection);
16638
17234
  return () => {
16639
17235
  document.removeEventListener("selectionchange", syncQuoteSelection);
16640
17236
  };
16641
17237
  }, [syncQuoteSelection]);
16642
- React50.useEffect(() => {
17238
+ React51.useEffect(() => {
16643
17239
  const viewport = viewportRef.current;
16644
17240
  if (!viewport) {
16645
17241
  return;
@@ -16656,14 +17252,14 @@ function Chat({
16656
17252
  window.removeEventListener("resize", handleViewportScroll);
16657
17253
  };
16658
17254
  }, [clearQuoteSelection]);
16659
- React50.useEffect(() => {
17255
+ React51.useEffect(() => {
16660
17256
  clearQuoteSelection();
16661
17257
  }, [messages.length, stream.threadId, clearQuoteSelection]);
16662
- React50.useEffect(() => {
17258
+ React51.useEffect(() => {
16663
17259
  if (missingConfig) return;
16664
17260
  void refreshThreads();
16665
17261
  }, [missingConfig, refreshThreads]);
16666
- React50.useEffect(() => {
17262
+ React51.useEffect(() => {
16667
17263
  if (missingConfig || !stream.client || !stream.assistantId) {
16668
17264
  setAssistantName(null);
16669
17265
  setAssistantAvatar(null);
@@ -16686,106 +17282,10 @@ function Chat({
16686
17282
  cancelled = true;
16687
17283
  };
16688
17284
  }, [missingConfig, stream.client, stream.assistantId]);
16689
- React50.useEffect(() => {
16690
- if (missingConfig || !stream.client || !stream.assistantId) {
16691
- setRuntimeCapabilities(null);
16692
- setRuntimeCapabilitiesReady(false);
16693
- setSessionRuntimeCapabilities(createEmptyRuntimeCapabilitiesSelection());
16694
- setRunRuntimeCapabilities(createEmptyRuntimeCapabilitiesSelection());
16695
- setRuntimeCapabilityPalette(null);
16696
- return;
16697
- }
16698
- const controller = new AbortController();
16699
- setRuntimeCapabilitiesReady(false);
16700
- setRuntimeCapabilities(null);
16701
- setRuntimeCapabilityPalette(null);
16702
- void stream.client.assistants.getRuntimeCapabilities(stream.assistantId, {
16703
- signal: controller.signal
16704
- }).then((payload) => {
16705
- setRuntimeCapabilities(payload);
16706
- setRuntimeCapabilitiesReady(true);
16707
- setSessionRuntimeCapabilities(
16708
- createDefaultRuntimeCapabilitiesSelection(payload)
16709
- );
16710
- setRunRuntimeCapabilities(
16711
- createEmptyRuntimeCapabilitiesSelection(payload)
16712
- );
16713
- }).catch((error) => {
16714
- if (controller.signal.aborted) {
16715
- return;
16716
- }
16717
- if (getHttpStatus(error) === 404) {
16718
- setRuntimeCapabilities(null);
16719
- setRuntimeCapabilitiesReady(false);
16720
- setSessionRuntimeCapabilities(
16721
- createEmptyRuntimeCapabilitiesSelection()
16722
- );
16723
- setRunRuntimeCapabilities(createEmptyRuntimeCapabilitiesSelection());
16724
- return;
16725
- }
16726
- console.warn("[Chat] Failed to load runtime capabilities:", error);
16727
- setRuntimeCapabilities(null);
16728
- setRuntimeCapabilitiesReady(false);
16729
- setSessionRuntimeCapabilities(
16730
- createEmptyRuntimeCapabilitiesSelection()
16731
- );
16732
- setRunRuntimeCapabilities(createEmptyRuntimeCapabilitiesSelection());
16733
- });
16734
- return () => controller.abort();
16735
- }, [missingConfig, stream.client, stream.assistantId]);
16736
- React50.useEffect(() => {
16737
- setRunRuntimeCapabilities(
16738
- createEmptyRuntimeCapabilitiesSelection(runtimeCapabilities)
16739
- );
16740
- if (!runtimeCapabilitiesReady || !runtimeCapabilities) {
16741
- setSessionRuntimeCapabilities(
16742
- createEmptyRuntimeCapabilitiesSelection(runtimeCapabilities)
16743
- );
16744
- return;
16745
- }
16746
- const defaultSelection = createDefaultRuntimeCapabilitiesSelection(runtimeCapabilities);
16747
- const threadId = stream.threadId?.trim();
16748
- if (!threadId) {
16749
- setSessionRuntimeCapabilities(defaultSelection);
16750
- return;
16751
- }
16752
- let cancelled = false;
16753
- const requestId = runtimeCapabilityPreferenceLoadRef.current + 1;
16754
- runtimeCapabilityPreferenceLoadRef.current = requestId;
16755
- setSessionRuntimeCapabilities(defaultSelection);
16756
- void loadConversationRuntimeCapabilities({
16757
- client: stream.client,
16758
- threadId,
16759
- capabilities: runtimeCapabilities
16760
- }).then(({ selection, missing }) => {
16761
- if (cancelled || runtimeCapabilityPreferenceLoadRef.current !== requestId) {
16762
- return;
16763
- }
16764
- warnMissingRuntimeCapabilityReferences("loaded selection", missing);
16765
- setSessionRuntimeCapabilities(selection ?? defaultSelection);
16766
- }).catch((error) => {
16767
- if (cancelled || runtimeCapabilityPreferenceLoadRef.current !== requestId) {
16768
- return;
16769
- }
16770
- console.warn(
16771
- "[Chat] Failed to load persisted runtime capabilities selection:",
16772
- error
16773
- );
16774
- setSessionRuntimeCapabilities(defaultSelection);
16775
- });
16776
- return () => {
16777
- cancelled = true;
16778
- };
16779
- }, [
16780
- runtimeCapabilities,
16781
- runtimeCapabilitiesReady,
16782
- stream.client,
16783
- stream.threadId
16784
- ]);
16785
- React50.useEffect(() => {
17285
+ React51.useEffect(() => {
16786
17286
  setThreadGoal(stream.threadGoal);
16787
17287
  }, [stream.threadGoal]);
16788
- React50.useEffect(() => {
17288
+ React51.useEffect(() => {
16789
17289
  const threadId = stream.threadId?.trim();
16790
17290
  if (!threadId || !goalCommandAvailable) {
16791
17291
  setThreadGoal(null);
@@ -16826,37 +17326,7 @@ function Chat({
16826
17326
  return () => controller.abort();
16827
17327
  }, [goalAdapter, goalCommandAvailable, stream.threadId]);
16828
17328
  const uploadedFiles = attachmentState.uploadedFiles;
16829
- const handleSessionRuntimeCapabilityToggle = React50.useCallback(
16830
- (type, id, selected) => {
16831
- setSessionRuntimeCapabilities((previous) => {
16832
- const nextSelection = toggleRuntimeCapabilitySelection(
16833
- previous,
16834
- type,
16835
- id,
16836
- selected
16837
- );
16838
- const threadId = stream.threadId?.trim();
16839
- if (threadId) {
16840
- void persistSessionRuntimeCapabilities(threadId, nextSelection);
16841
- }
16842
- return nextSelection;
16843
- });
16844
- },
16845
- [persistSessionRuntimeCapabilities, stream.threadId]
16846
- );
16847
- const updateRuntimeCapabilityPalette = React50.useCallback(
16848
- (parts, selectionStart) => {
16849
- const input = composerInputRef.current;
16850
- const editingText = getComposerEditingText(parts);
16851
- const nextPalette = resolveRuntimeCapabilityPalette(
16852
- editingText,
16853
- typeof selectionStart === "number" ? selectionStart : input ? getComposerSelectionOffset(input) : getComposerEditingLength(parts)
16854
- );
16855
- setRuntimeCapabilityPalette(nextPalette);
16856
- },
16857
- []
16858
- );
16859
- const syncComposerInputFromElement = React50.useCallback(
17329
+ const syncComposerInputFromElement = React51.useCallback(
16860
17330
  (input) => {
16861
17331
  const previousCapabilities = getComposerCapabilityPartMap(
16862
17332
  composerPartsRef.current
@@ -16874,45 +17344,25 @@ function Chat({
16874
17344
  },
16875
17345
  [commitComposerParts, updateRuntimeCapabilityPalette]
16876
17346
  );
16877
- const handleComposerInput = React50.useCallback(
17347
+ const handleComposerInput = React51.useCallback(
16878
17348
  (event) => {
16879
17349
  syncComposerInputFromElement(event.currentTarget);
16880
17350
  },
16881
17351
  [syncComposerInputFromElement]
16882
17352
  );
16883
- const handleComposerCompositionEnd = React50.useCallback(
17353
+ const handleComposerCompositionEnd = React51.useCallback(
16884
17354
  (event) => {
16885
17355
  syncComposerInputFromElement(event.currentTarget);
16886
17356
  },
16887
17357
  [syncComposerInputFromElement]
16888
17358
  );
16889
- const handleComposerSelect = React50.useCallback(() => {
17359
+ const handleComposerSelect = React51.useCallback(() => {
16890
17360
  updateRuntimeCapabilityPalette(
16891
17361
  composerPartsRef.current,
16892
17362
  composerInputRef.current ? getComposerSelectionOffset(composerInputRef.current) : void 0
16893
17363
  );
16894
17364
  }, [updateRuntimeCapabilityPalette]);
16895
- const removeRunRuntimeCapability = React50.useCallback(
16896
- (option) => {
16897
- setRunRuntimeCapabilities(
16898
- (previous) => toggleRuntimeCapabilitySelection(
16899
- previous,
16900
- option.type,
16901
- option.id,
16902
- false
16903
- )
16904
- );
16905
- commitComposerParts(
16906
- removeComposerCapabilityTokens(composerPartsRef.current, option),
16907
- {
16908
- resetDom: true,
16909
- syncRemovedCapabilityTokens: false
16910
- }
16911
- );
16912
- },
16913
- [commitComposerParts]
16914
- );
16915
- const submitDraft = React50.useCallback(
17365
+ const submitDraft = React51.useCallback(
16916
17366
  (submitOptions = {}) => {
16917
17367
  if (isSubmissionBlocked) return;
16918
17368
  const contentToSubmit = (submitOptions.inputText ?? trimmedDraft).trim();
@@ -16927,22 +17377,10 @@ function Chat({
16927
17377
  if (!humanInput) {
16928
17378
  return;
16929
17379
  }
16930
- const recommendedRuntimeCapabilitiesForSubmit = submitOptions.runtimeCapabilities && runtimeCapabilities && runtimeCapabilitiesReady ? mergeRuntimeCapabilitiesSelections(
16931
- runtimeCapabilities,
16932
- runRuntimeCapabilities,
16933
- submitOptions.runtimeCapabilities
16934
- ) : runRuntimeCapabilities;
16935
- const runtimeCapabilitiesForSubmit = runtimeCapabilities && runtimeCapabilitiesReady ? createRuntimeCapabilitiesForSubmit({
16936
- capabilities: runtimeCapabilities,
16937
- available: effectiveSessionRuntimeCapabilities,
16938
- recommended: recommendedRuntimeCapabilitiesForSubmit
16939
- }) : null;
16940
- const runtimeCapabilityOptionsForMessage = getSelectedRuntimeCapabilityOptions(
16941
- getRecommendedRuntimeCapabilitiesSelection(
16942
- runtimeCapabilitiesForSubmit
16943
- ),
16944
- runtimeCapabilityOptions
16945
- );
17380
+ const {
17381
+ runtimeCapabilitiesForSubmit,
17382
+ runtimeCapabilityOptionsForMessage
17383
+ } = getRuntimeCapabilitiesForSubmit(submitOptions.runtimeCapabilities);
16946
17384
  const displayContent = submitOptions.displayText || contentToSubmit || (referencesToSend ? t("chat.referencedContentOnly") : "");
16947
17385
  const newMessage = {
16948
17386
  id: createMessageId(),
@@ -17010,21 +17448,16 @@ function Chat({
17010
17448
  }
17011
17449
  attachmentsRef.current?.clear();
17012
17450
  setReferences([]);
17013
- setRunRuntimeCapabilities(
17014
- createEmptyRuntimeCapabilitiesSelection(runtimeCapabilities)
17015
- );
17016
- setRuntimeCapabilityPalette(null);
17451
+ resetRunRuntimeCapabilities();
17017
17452
  },
17018
17453
  [
17019
17454
  effectiveSessionRuntimeCapabilities,
17455
+ getRuntimeCapabilitiesForSubmit,
17020
17456
  isSubmissionBlocked,
17021
17457
  options?.request,
17022
17458
  persistSessionRuntimeCapabilities,
17023
17459
  references,
17024
- runtimeCapabilities,
17025
- runtimeCapabilitiesReady,
17026
- runtimeCapabilityOptions,
17027
- runRuntimeCapabilities,
17460
+ resetRunRuntimeCapabilities,
17028
17461
  scrollToBottom,
17029
17462
  selectedTool,
17030
17463
  commitComposerParts,
@@ -17035,7 +17468,7 @@ function Chat({
17035
17468
  t
17036
17469
  ]
17037
17470
  );
17038
- const handleGoalCommand = React50.useCallback(
17471
+ const handleGoalCommand = React51.useCallback(
17039
17472
  async ({
17040
17473
  args,
17041
17474
  commandSource,
@@ -17080,11 +17513,7 @@ function Chat({
17080
17513
  }
17081
17514
  if (startsGoalRun) {
17082
17515
  const goalRunThreadId = result.threadId ?? threadId;
17083
- const runtimeCapabilitiesForGoalRun = runtimeCapabilities && runtimeCapabilitiesReady ? createRuntimeCapabilitiesForSubmit({
17084
- capabilities: runtimeCapabilities,
17085
- available: effectiveSessionRuntimeCapabilities,
17086
- recommended: commandRuntimeCapabilities
17087
- }) : commandRuntimeCapabilities ?? null;
17516
+ const runtimeCapabilitiesForGoalRun = getRuntimeCapabilitiesForCommand(commandRuntimeCapabilities);
17088
17517
  const inputPayload = {
17089
17518
  input: GOAL_RUN_INPUT,
17090
17519
  commandSource,
@@ -17137,63 +17566,17 @@ function Chat({
17137
17566
  }
17138
17567
  },
17139
17568
  [
17140
- effectiveSessionRuntimeCapabilities,
17569
+ getRuntimeCapabilitiesForCommand,
17141
17570
  goalAdapter,
17142
17571
  options?.request,
17143
17572
  refreshThreads,
17144
- runtimeCapabilities,
17145
- runtimeCapabilitiesReady,
17146
17573
  stream,
17147
17574
  t
17148
17575
  ]
17149
17576
  );
17150
- const handleGoalPanelOpenChange = React50.useCallback((open) => {
17577
+ const handleGoalPanelOpenChange = React51.useCallback((open) => {
17151
17578
  setIsGoalPanelOpen(open);
17152
17579
  }, []);
17153
- const addRunRuntimeCapabilities = React50.useCallback(
17154
- (selection) => {
17155
- setRunRuntimeCapabilities(
17156
- (previous) => runtimeCapabilities ? mergeRuntimeCapabilitiesSelections(
17157
- runtimeCapabilities,
17158
- previous,
17159
- selection
17160
- ) : previous
17161
- );
17162
- },
17163
- [runtimeCapabilities]
17164
- );
17165
- const insertComposerCapabilityToken = React50.useCallback(
17166
- (capability, range) => {
17167
- const token = createComposerCapabilityPart(capability, createMessageId());
17168
- const currentParts = composerPartsRef.current;
17169
- const replaceRange = range ?? {
17170
- start: getComposerEditingLength(currentParts),
17171
- end: getComposerEditingLength(currentParts)
17172
- };
17173
- const nextParts = replaceComposerRange(
17174
- currentParts,
17175
- replaceRange.start,
17176
- replaceRange.end,
17177
- [token]
17178
- );
17179
- commitComposerParts(nextParts, {
17180
- caretOffset: replaceRange.start + 1,
17181
- resetDom: true,
17182
- syncRemovedCapabilityTokens: true
17183
- });
17184
- setRunRuntimeCapabilities(
17185
- (previous) => toggleRuntimeCapabilitySelection(
17186
- previous,
17187
- capability.type,
17188
- capability.id,
17189
- true
17190
- )
17191
- );
17192
- setRuntimeCapabilityPalette(null);
17193
- focusComposerAt(replaceRange.start + 1);
17194
- },
17195
- [commitComposerParts, focusComposerAt]
17196
- );
17197
17580
  const {
17198
17581
  slashPaletteOptions,
17199
17582
  executeSlashCommandFromDraft,
@@ -17221,7 +17604,7 @@ function Chat({
17221
17604
  submitPrompt: submitDraft
17222
17605
  });
17223
17606
  const slashPaletteEmptyLabel = runtimeCapabilityPalette ? t(
17224
- getSlashPaletteEmptyLabelKey(
17607
+ getRuntimeCapabilityPaletteEmptyLabelKey(
17225
17608
  runtimeCapabilityPalette,
17226
17609
  runtimeCapabilitiesReady
17227
17610
  )
@@ -17235,7 +17618,7 @@ function Chat({
17235
17618
  plugin: t("composer.slashCommands.empty.loadingCapabilities"),
17236
17619
  subAgent: t("composer.slashCommands.empty.loadingCapabilities")
17237
17620
  };
17238
- React50.useEffect(() => {
17621
+ React51.useEffect(() => {
17239
17622
  if (!runtimeCapabilityPalette) {
17240
17623
  return;
17241
17624
  }
@@ -17254,7 +17637,7 @@ function Chat({
17254
17637
  );
17255
17638
  }
17256
17639
  }, [slashPaletteOptions.length, runtimeCapabilityPalette]);
17257
- React50.useLayoutEffect(() => {
17640
+ React51.useLayoutEffect(() => {
17258
17641
  if (!runtimeCapabilityPalette) {
17259
17642
  return;
17260
17643
  }
@@ -17271,7 +17654,7 @@ function Chat({
17271
17654
  container.scrollTop += optionRect.bottom - containerRect.bottom;
17272
17655
  }
17273
17656
  }, [runtimeCapabilityPalette, slashPaletteOptions.length]);
17274
- const submitGoalModeDraft = React50.useCallback(() => {
17657
+ const submitGoalModeDraft = React51.useCallback(() => {
17275
17658
  const objective = getComposerPlainText(composerPartsRef.current).trim();
17276
17659
  if (!isGoalModeOpen || !goalCommandAvailable || !objective) {
17277
17660
  return false;
@@ -17309,7 +17692,7 @@ function Chat({
17309
17692
  }
17310
17693
  submitDraft();
17311
17694
  };
17312
- const handleEditPendingFollowUp = React50.useCallback(
17695
+ const handleEditPendingFollowUp = React51.useCallback(
17313
17696
  (id) => {
17314
17697
  const item = pendingFollowUps.find(
17315
17698
  (entry) => entry.id === id && entry.mode === "queue"
@@ -17336,7 +17719,7 @@ function Chat({
17336
17719
  },
17337
17720
  [pendingFollowUps, setComposerText, stream]
17338
17721
  );
17339
- const handleQuoteSelection = React50.useCallback(() => {
17722
+ const handleQuoteSelection = React51.useCallback(() => {
17340
17723
  if (!quoteSelection) {
17341
17724
  return;
17342
17725
  }
@@ -17352,7 +17735,7 @@ function Chat({
17352
17735
  const handleAttachmentClick = () => {
17353
17736
  attachmentsRef.current?.openFilePicker();
17354
17737
  };
17355
- const uploadContextFile = React50.useCallback(
17738
+ const uploadContextFile = React51.useCallback(
17356
17739
  (file) => {
17357
17740
  const formData = new FormData();
17358
17741
  formData.append("file", file, file.name || "upload");
@@ -17371,13 +17754,13 @@ function Chat({
17371
17754
  },
17372
17755
  [stream.assistantId, stream.client, stream.threadId]
17373
17756
  );
17374
- const getContextFileStatus = React50.useCallback(
17757
+ const getContextFileStatus = React51.useCallback(
17375
17758
  (fileId) => stream.client.contexts.fetch(`/files/${fileId}/status`, {
17376
17759
  method: "GET"
17377
17760
  }),
17378
17761
  [stream.client]
17379
17762
  );
17380
- const deleteContextFile = React50.useCallback(
17763
+ const deleteContextFile = React51.useCallback(
17381
17764
  (storageFileId) => stream.client.contexts.deleteFile(storageFileId),
17382
17765
  [stream.client]
17383
17766
  );
@@ -17485,7 +17868,7 @@ function Chat({
17485
17868
  }
17486
17869
  submitDraft();
17487
17870
  };
17488
- const handleComposerPaste = React50.useCallback(
17871
+ const handleComposerPaste = React51.useCallback(
17489
17872
  (event) => {
17490
17873
  const clipboardData = event.clipboardData;
17491
17874
  if (!clipboardData) {
@@ -17587,13 +17970,13 @@ function Chat({
17587
17970
  const handleToolSelect = (tool) => {
17588
17971
  setSelectedTool((prev) => prev?.id === tool.id ? null : tool);
17589
17972
  };
17590
- const handlePromptClick = React50.useCallback(
17973
+ const handlePromptClick = React51.useCallback(
17591
17974
  (prompt) => {
17592
17975
  submitDraft({ inputText: prompt, displayText: prompt });
17593
17976
  },
17594
17977
  [submitDraft]
17595
17978
  );
17596
- const handlePromptEdit = React50.useCallback(
17979
+ const handlePromptEdit = React51.useCallback(
17597
17980
  (prompt) => {
17598
17981
  if (isPromptEditDisabled) return;
17599
17982
  setComposerText(prompt, prompt.length);
@@ -17602,7 +17985,7 @@ function Chat({
17602
17985
  },
17603
17986
  [focusComposerAt, isPromptEditDisabled, setComposerText]
17604
17987
  );
17605
- const loadConversationMessages = React50.useCallback(
17988
+ const loadConversationMessages = React51.useCallback(
17606
17989
  async (recordId) => {
17607
17990
  if (missingConfig) {
17608
17991
  setHistoryError(missingConfigShortMessage);
@@ -17623,7 +18006,7 @@ function Chat({
17623
18006
  },
17624
18007
  [missingConfig, missingConfigShortMessage, stream, t]
17625
18008
  );
17626
- const handleLoadMoreMessages = React50.useCallback(async () => {
18009
+ const handleLoadMoreMessages = React51.useCallback(async () => {
17627
18010
  if (!canLoadMoreMessages || isLoadingMoreMessages) {
17628
18011
  return;
17629
18012
  }
@@ -17732,15 +18115,15 @@ function Chat({
17732
18115
  };
17733
18116
  const acceptMimes = composer?.attachments?.accept ? Object.entries(composer.attachments.accept).map(([mime, exts]) => [mime, ...exts.map((e) => `.${e}`)].join(",")).join(",") : void 0;
17734
18117
  const canUploadDroppedFiles = composer?.attachments?.enabled === true && !missingConfig && !isHistoryLoading && !hasPendingInteractiveRequest;
17735
- const handleDroppedFiles = React50.useCallback((files) => {
18118
+ const handleDroppedFiles = React51.useCallback((files) => {
17736
18119
  return attachmentsRef.current?.queueFiles(files) ?? false;
17737
18120
  }, []);
17738
- const currentThread = React50.useMemo(
18121
+ const currentThread = React51.useMemo(
17739
18122
  () => threads.find((item) => item.id === stream.threadId),
17740
18123
  [threads, stream.threadId]
17741
18124
  );
17742
18125
  const streamErrorMessage = stream.error instanceof Error ? stream.error.message : void 0;
17743
- const threadErrorMessage = React50.useMemo(() => {
18126
+ const threadErrorMessage = React51.useMemo(() => {
17744
18127
  if (streamErrorMessage?.trim()) return streamErrorMessage.trim();
17745
18128
  if (currentThread?.status !== "error") return void 0;
17746
18129
  const message = currentThread.error?.trim();
@@ -17771,13 +18154,13 @@ function Chat({
17771
18154
  fallbackTitle: t("history.threadFallback")
17772
18155
  });
17773
18156
  const layoutMaxWidth = options?.layout?.maxWidth;
17774
- const chatColumnStyle = React50.useMemo(() => {
18157
+ const chatColumnStyle = React51.useMemo(() => {
17775
18158
  if (layoutMaxWidth === void 0 || layoutMaxWidth === null || layoutMaxWidth === "") {
17776
18159
  return void 0;
17777
18160
  }
17778
18161
  return { maxWidth: layoutMaxWidth };
17779
18162
  }, [layoutMaxWidth]);
17780
- return /* @__PURE__ */ jsxs38(
18163
+ return /* @__PURE__ */ jsxs39(
17781
18164
  UploadDroppedFiles,
17782
18165
  {
17783
18166
  ref: viewportRef,
@@ -17792,16 +18175,16 @@ function Chat({
17792
18175
  className
17793
18176
  ),
17794
18177
  children: [
17795
- /* @__PURE__ */ jsxs38(
18178
+ /* @__PURE__ */ jsxs39(
17796
18179
  "div",
17797
18180
  {
17798
18181
  "data-slot": "chatkit-chat-header",
17799
18182
  className: "mx-auto flex w-full items-center justify-between border-b p-2 sticky top-0 z-10 bg-background",
17800
18183
  style: chatColumnStyle,
17801
18184
  children: [
17802
- /* @__PURE__ */ jsxs38("div", { className: "flex items-center gap-3 overflow-hidden", children: [
17803
- /* @__PURE__ */ jsxs38("div", { className: "relative shrink-0", children: [
17804
- /* @__PURE__ */ jsx55(
18185
+ /* @__PURE__ */ jsxs39("div", { className: "flex items-center gap-3 overflow-hidden", children: [
18186
+ /* @__PURE__ */ jsxs39("div", { className: "relative shrink-0", children: [
18187
+ /* @__PURE__ */ jsx56(
17805
18188
  ChatkitAvatar,
17806
18189
  {
17807
18190
  avatar: assistantAvatar,
@@ -17809,10 +18192,10 @@ function Chat({
17809
18192
  label: assistantTitle
17810
18193
  }
17811
18194
  ),
17812
- /* @__PURE__ */ jsx55("span", { className: "absolute bottom-0 right-0 h-2.5 w-2.5 rounded-full border-2 border-background bg-green-500" })
18195
+ /* @__PURE__ */ jsx56("span", { className: "absolute bottom-0 right-0 h-2.5 w-2.5 rounded-full border-2 border-background bg-green-500" })
17813
18196
  ] }),
17814
- /* @__PURE__ */ jsxs38("div", { className: "truncate", children: [
17815
- /* @__PURE__ */ jsx55(
18197
+ /* @__PURE__ */ jsxs39("div", { className: "truncate", children: [
18198
+ /* @__PURE__ */ jsx56(
17816
18199
  "h2",
17817
18200
  {
17818
18201
  className: "text-lg font-semibold truncate",
@@ -17820,12 +18203,12 @@ function Chat({
17820
18203
  children: assistantTitle
17821
18204
  }
17822
18205
  ),
17823
- /* @__PURE__ */ jsx55("p", { className: "text-xs text-muted-foreground", children: t("chat.statusOnline") })
18206
+ /* @__PURE__ */ jsx56("p", { className: "text-xs text-muted-foreground", children: t("chat.statusOnline") })
17824
18207
  ] })
17825
18208
  ] }),
17826
- /* @__PURE__ */ jsxs38("div", { className: "flex items-center gap-1", children: [
17827
- canMinimizeToPet && /* @__PURE__ */ jsxs38(Tooltip, { children: [
17828
- /* @__PURE__ */ jsx55(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx55("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ jsx55(
18209
+ /* @__PURE__ */ jsxs39("div", { className: "flex items-center gap-1", children: [
18210
+ canMinimizeToPet && /* @__PURE__ */ jsxs39(Tooltip, { children: [
18211
+ /* @__PURE__ */ jsx56(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx56("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ jsx56(
17829
18212
  "button",
17830
18213
  {
17831
18214
  type: "button",
@@ -17836,13 +18219,13 @@ function Chat({
17836
18219
  "transition-colors duration-150"
17837
18220
  ),
17838
18221
  "aria-label": t("chat.minimizeToPet"),
17839
- children: /* @__PURE__ */ jsx55(Minus, { size: 16 })
18222
+ children: /* @__PURE__ */ jsx56(Minus, { size: 16 })
17840
18223
  }
17841
18224
  ) }) }),
17842
- /* @__PURE__ */ jsx55(TooltipContent, { side: "bottom", children: t("chat.minimizeToPet") })
18225
+ /* @__PURE__ */ jsx56(TooltipContent, { side: "bottom", children: t("chat.minimizeToPet") })
17843
18226
  ] }),
17844
- /* @__PURE__ */ jsxs38(Tooltip, { children: [
17845
- /* @__PURE__ */ jsx55(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx55("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ jsx55(
18227
+ /* @__PURE__ */ jsxs39(Tooltip, { children: [
18228
+ /* @__PURE__ */ jsx56(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx56("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ jsx56(
17846
18229
  "button",
17847
18230
  {
17848
18231
  type: "button",
@@ -17853,14 +18236,14 @@ function Chat({
17853
18236
  "transition-colors duration-150"
17854
18237
  ),
17855
18238
  "aria-label": t("settings.open"),
17856
- children: /* @__PURE__ */ jsx55(Settings2, { size: 16 })
18239
+ children: /* @__PURE__ */ jsx56(Settings2, { size: 16 })
17857
18240
  }
17858
18241
  ) }) }),
17859
- /* @__PURE__ */ jsx55(TooltipContent, { side: "bottom", children: t("settings.open") })
18242
+ /* @__PURE__ */ jsx56(TooltipContent, { side: "bottom", children: t("settings.open") })
17860
18243
  ] }),
17861
- history?.enabled !== false && /* @__PURE__ */ jsxs38(Fragment9, { children: [
17862
- /* @__PURE__ */ jsxs38(Tooltip, { children: [
17863
- /* @__PURE__ */ jsx55(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx55("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ jsx55(
18244
+ history?.enabled !== false && /* @__PURE__ */ jsxs39(Fragment9, { children: [
18245
+ /* @__PURE__ */ jsxs39(Tooltip, { children: [
18246
+ /* @__PURE__ */ jsx56(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx56("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ jsx56(
17864
18247
  "button",
17865
18248
  {
17866
18249
  type: "button",
@@ -17873,12 +18256,12 @@ function Chat({
17873
18256
  "disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed"
17874
18257
  ),
17875
18258
  "aria-label": t("history.newThread"),
17876
- children: /* @__PURE__ */ jsx55(Pencil4, { size: 16 })
18259
+ children: /* @__PURE__ */ jsx56(Pencil4, { size: 16 })
17877
18260
  }
17878
18261
  ) }) }),
17879
- /* @__PURE__ */ jsx55(TooltipContent, { side: "bottom", children: t("history.newThread") })
18262
+ /* @__PURE__ */ jsx56(TooltipContent, { side: "bottom", children: t("history.newThread") })
17880
18263
  ] }),
17881
- /* @__PURE__ */ jsx55(
18264
+ /* @__PURE__ */ jsx56(
17882
18265
  HistorySidebar,
17883
18266
  {
17884
18267
  threads,
@@ -17895,7 +18278,7 @@ function Chat({
17895
18278
  ]
17896
18279
  }
17897
18280
  ),
17898
- showMessageNavigation && /* @__PURE__ */ jsx55(
18281
+ showMessageNavigation && /* @__PURE__ */ jsx56(
17899
18282
  MessageNavigator,
17900
18283
  {
17901
18284
  items: messageNavigationItems,
@@ -17906,18 +18289,18 @@ function Chat({
17906
18289
  tagsOverflowLabel: (count) => t("message.navigation.moreTags", { count })
17907
18290
  }
17908
18291
  ),
17909
- /* @__PURE__ */ jsxs38(
18292
+ /* @__PURE__ */ jsxs39(
17910
18293
  "div",
17911
18294
  {
17912
18295
  "data-slot": "chatkit-chat-content",
17913
18296
  className: "mx-auto w-full flex-1 p-4",
17914
18297
  style: chatColumnStyle,
17915
18298
  children: [
17916
- errorMessage && /* @__PURE__ */ jsx55("div", { className: "mb-4 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive", children: errorMessage }),
17917
- historyError && /* @__PURE__ */ jsx55("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: historyError }),
17918
- showMissingConfig && /* @__PURE__ */ jsx55("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: missingConfigDetailMessage }),
17919
- isHistoryLoading && /* @__PURE__ */ jsx55("div", { className: "mb-4 rounded-lg border border-muted px-3 py-2 text-sm text-muted-foreground", children: t("chat.loadingThread") }),
17920
- messages.length === 0 && !canLoadMoreMessages ? /* @__PURE__ */ jsx55(
18299
+ errorMessage && /* @__PURE__ */ jsx56("div", { className: "mb-4 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive", children: errorMessage }),
18300
+ historyError && /* @__PURE__ */ jsx56("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: historyError }),
18301
+ showMissingConfig && /* @__PURE__ */ jsx56("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: missingConfigDetailMessage }),
18302
+ isHistoryLoading && /* @__PURE__ */ jsx56("div", { className: "mb-4 rounded-lg border border-muted px-3 py-2 text-sm text-muted-foreground", children: t("chat.loadingThread") }),
18303
+ messages.length === 0 && !canLoadMoreMessages ? /* @__PURE__ */ jsx56(
17921
18304
  StartScreen,
17922
18305
  {
17923
18306
  startScreen,
@@ -17926,10 +18309,10 @@ function Chat({
17926
18309
  promptSendDisabled: isSubmissionBlocked,
17927
18310
  promptEditDisabled: isPromptEditDisabled
17928
18311
  }
17929
- ) : /* @__PURE__ */ jsxs38("div", { className: "space-y-4", children: [
17930
- canLoadMoreMessages && /* @__PURE__ */ jsxs38("div", { className: "flex items-center gap-3 py-1", children: [
17931
- /* @__PURE__ */ jsx55("div", { className: "h-px min-w-8 flex-1 bg-border" }),
17932
- /* @__PURE__ */ jsx55(
18312
+ ) : /* @__PURE__ */ jsxs39("div", { className: "space-y-4", children: [
18313
+ canLoadMoreMessages && /* @__PURE__ */ jsxs39("div", { className: "flex items-center gap-3 py-1", children: [
18314
+ /* @__PURE__ */ jsx56("div", { className: "h-px min-w-8 flex-1 bg-border" }),
18315
+ /* @__PURE__ */ jsx56(
17933
18316
  Button,
17934
18317
  {
17935
18318
  type: "button",
@@ -17941,7 +18324,7 @@ function Chat({
17941
18324
  children: isLoadingMoreMessages ? t("chat.loadingMoreMessages") : t("chat.loadMoreMessages")
17942
18325
  }
17943
18326
  ),
17944
- /* @__PURE__ */ jsx55("div", { className: "h-px min-w-8 flex-1 bg-border" })
18327
+ /* @__PURE__ */ jsx56("div", { className: "h-px min-w-8 flex-1 bg-border" })
17945
18328
  ] }),
17946
18329
  messages.map((message, index) => {
17947
18330
  const messageType = String(message.type);
@@ -17966,7 +18349,7 @@ function Chat({
17966
18349
  ...humanMessage.fileAssets ?? [],
17967
18350
  ...humanMessage.attachments ?? []
17968
18351
  ];
17969
- const humanRuntimeCapabilityOptions = message.type === "human" ? humanMessage.runtimeCapabilityOptions ?? getSelectedRuntimeCapabilityOptions(
18352
+ const humanRuntimeCapabilityOptions = message.type === "human" ? humanMessage.runtimeCapabilityOptions ?? getRuntimeCapabilityOptionsForSelection(
17970
18353
  getRecommendedRuntimeCapabilitiesSelection(
17971
18354
  humanMessage.runtimeCapabilities
17972
18355
  ),
@@ -17982,7 +18365,7 @@ function Chat({
17982
18365
  if (!isAssistantMessage && !hasPlainRenderableContent && !hasHumanAttachments && humanRuntimeCapabilityOptions.length === 0 && humanReferences.length === 0) {
17983
18366
  return null;
17984
18367
  }
17985
- return /* @__PURE__ */ jsx55(
18368
+ return /* @__PURE__ */ jsx56(
17986
18369
  "div",
17987
18370
  {
17988
18371
  ref: (node) => setMessageNavigationAnchor(messageNavigationId, node),
@@ -17992,7 +18375,7 @@ function Chat({
17992
18375
  message.type === "human" ? "justify-end" : "justify-start -ml-1"
17993
18376
  // AI messages: slightly closer to left
17994
18377
  ),
17995
- children: /* @__PURE__ */ jsxs38(
18378
+ children: /* @__PURE__ */ jsxs39(
17996
18379
  "div",
17997
18380
  {
17998
18381
  className: cn(
@@ -18000,7 +18383,7 @@ function Chat({
18000
18383
  isAssistantMessage && "min-w-0 flex-1"
18001
18384
  ),
18002
18385
  children: [
18003
- /* @__PURE__ */ jsx55(
18386
+ /* @__PURE__ */ jsx56(
18004
18387
  "div",
18005
18388
  {
18006
18389
  ...canQuoteMessage ? {
@@ -18012,7 +18395,7 @@ function Chat({
18012
18395
  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"
18013
18396
  // AI messages: use chat-specific foreground color
18014
18397
  ),
18015
- children: isAssistantMessage ? /* @__PURE__ */ jsx55(
18398
+ children: isAssistantMessage ? /* @__PURE__ */ jsx56(
18016
18399
  AssistantMessage,
18017
18400
  {
18018
18401
  message: {
@@ -18031,25 +18414,14 @@ function Chat({
18031
18414
  organizationId: stream.organizationId,
18032
18415
  apiUrl: stream.apiUrl
18033
18416
  }
18034
- ) : /* @__PURE__ */ jsxs38(Fragment9, { children: [
18035
- message.type === "human" && humanRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ jsx55("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanRuntimeCapabilityOptions.map((option) => /* @__PURE__ */ jsxs38(
18036
- "span",
18417
+ ) : /* @__PURE__ */ jsxs39(Fragment9, { children: [
18418
+ message.type === "human" && humanRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ jsx56(
18419
+ HumanRuntimeCapabilityChips,
18037
18420
  {
18038
- 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",
18039
- children: [
18040
- /* @__PURE__ */ jsx55(
18041
- RuntimeCapabilityIcon,
18042
- {
18043
- option,
18044
- variant: "chip"
18045
- }
18046
- ),
18047
- /* @__PURE__ */ jsx55("span", { className: "max-w-[9rem] truncate", children: option.label })
18048
- ]
18049
- },
18050
- `${option.type}:${option.id}`
18051
- )) }),
18052
- message.type === "human" && humanReferences.length > 0 && /* @__PURE__ */ jsx55("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanReferences.map((reference) => /* @__PURE__ */ jsx55(
18421
+ options: humanRuntimeCapabilityOptions
18422
+ }
18423
+ ),
18424
+ message.type === "human" && humanReferences.length > 0 && /* @__PURE__ */ jsx56("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanReferences.map((reference) => /* @__PURE__ */ jsx56(
18053
18425
  ReferenceChip,
18054
18426
  {
18055
18427
  reference,
@@ -18057,29 +18429,29 @@ function Chat({
18057
18429
  },
18058
18430
  getReferenceKey(reference)
18059
18431
  )) }),
18060
- message.type === "human" && humanAttachments.length > 0 && /* @__PURE__ */ jsx55("div", { className: "flex flex-wrap gap-1.5 mb-2", children: humanAttachments.map((file, fileIndex) => /* @__PURE__ */ jsxs38(
18432
+ message.type === "human" && humanAttachments.length > 0 && /* @__PURE__ */ jsx56("div", { className: "flex flex-wrap gap-1.5 mb-2", children: humanAttachments.map((file, fileIndex) => /* @__PURE__ */ jsxs39(
18061
18433
  "div",
18062
18434
  {
18063
18435
  className: "flex items-center gap-1.5 rounded-md bg-primary-foreground/20 px-2 py-1 text-xs",
18064
18436
  children: [
18065
- /* @__PURE__ */ jsx55(FileText5, { size: 12 }),
18066
- /* @__PURE__ */ jsx55("span", { className: "max-w-[100px] truncate", children: file.originalName ?? file.id })
18437
+ /* @__PURE__ */ jsx56(FileText5, { size: 12 }),
18438
+ /* @__PURE__ */ jsx56("span", { className: "max-w-[100px] truncate", children: file.originalName ?? file.id })
18067
18439
  ]
18068
18440
  },
18069
18441
  fileIndex
18070
18442
  )) }),
18071
- Array.isArray(message.content) ? message.content.map((part, partIndex) => /* @__PURE__ */ jsx55(
18443
+ Array.isArray(message.content) ? message.content.map((part, partIndex) => /* @__PURE__ */ jsx56(
18072
18444
  "p",
18073
18445
  {
18074
18446
  className: "wrap-break-word text-sm leading-relaxed",
18075
18447
  children: formatMessageContent(part)
18076
18448
  },
18077
18449
  `${part.type}-${partIndex}`
18078
- )) : /* @__PURE__ */ jsx55("span", { className: "wrap-break-word text-sm leading-relaxed", children: formatMessageContent(message.content) })
18450
+ )) : /* @__PURE__ */ jsx56("span", { className: "wrap-break-word text-sm leading-relaxed", children: formatMessageContent(message.content) })
18079
18451
  ] })
18080
18452
  }
18081
18453
  ),
18082
- /* @__PURE__ */ jsx55(
18454
+ /* @__PURE__ */ jsx56(
18083
18455
  MessageActions,
18084
18456
  {
18085
18457
  content: messageContent,
@@ -18117,7 +18489,7 @@ function Chat({
18117
18489
  stream.isLoading,
18118
18490
  { now: streamingNow }
18119
18491
  );
18120
- return /* @__PURE__ */ jsx55("div", { className: "flex justify-start gap-3 -ml-2", children: /* @__PURE__ */ jsx55("div", { className: "max-w-full rounded-2xl py-2.5", children: /* @__PURE__ */ jsx55(
18492
+ return /* @__PURE__ */ jsx56("div", { className: "flex justify-start gap-3 -ml-2", children: /* @__PURE__ */ jsx56("div", { className: "max-w-full rounded-2xl py-2.5", children: /* @__PURE__ */ jsx56(
18121
18493
  AssistantStreamingIndicator,
18122
18494
  {
18123
18495
  status: fallbackStreamingStatus ?? "loading"
@@ -18128,7 +18500,7 @@ function Chat({
18128
18500
  ]
18129
18501
  }
18130
18502
  ),
18131
- !isAtBottom && messages.length > 0 && /* @__PURE__ */ jsx55("div", { className: "sticky bottom-20 z-20 flex justify-center px-4 pointer-events-none", children: /* @__PURE__ */ jsx55(
18503
+ !isAtBottom && messages.length > 0 && /* @__PURE__ */ jsx56("div", { className: "sticky bottom-20 z-20 flex justify-center px-4 pointer-events-none", children: /* @__PURE__ */ jsx56(
18132
18504
  Button,
18133
18505
  {
18134
18506
  type: "button",
@@ -18141,10 +18513,10 @@ function Chat({
18141
18513
  onClick: () => scrollToBottom(true, true),
18142
18514
  "aria-label": t("chat.scrollToBottom"),
18143
18515
  title: t("chat.scrollToBottom"),
18144
- children: /* @__PURE__ */ jsx55(ArrowDown2, { size: 16 })
18516
+ children: /* @__PURE__ */ jsx56(ArrowDown2, { size: 16 })
18145
18517
  }
18146
18518
  ) }),
18147
- quoteSelection && /* @__PURE__ */ jsx55(
18519
+ quoteSelection && /* @__PURE__ */ jsx56(
18148
18520
  "div",
18149
18521
  {
18150
18522
  className: "pointer-events-none fixed z-50",
@@ -18153,7 +18525,7 @@ function Chat({
18153
18525
  left: `${quoteSelection.left}px`,
18154
18526
  transform: "translateX(-50%)"
18155
18527
  },
18156
- children: /* @__PURE__ */ jsxs38(
18528
+ children: /* @__PURE__ */ jsxs39(
18157
18529
  Button,
18158
18530
  {
18159
18531
  type: "button",
@@ -18165,22 +18537,22 @@ function Chat({
18165
18537
  "aria-label": t("composer.quoteSelection"),
18166
18538
  title: t("composer.quoteSelection"),
18167
18539
  children: [
18168
- /* @__PURE__ */ jsx55(Quote, { size: 14 }),
18540
+ /* @__PURE__ */ jsx56(Quote, { size: 14 }),
18169
18541
  t("composer.quoteSelection")
18170
18542
  ]
18171
18543
  }
18172
18544
  )
18173
18545
  }
18174
18546
  ),
18175
- /* @__PURE__ */ jsxs38(
18547
+ /* @__PURE__ */ jsxs39(
18176
18548
  "div",
18177
18549
  {
18178
18550
  "data-slot": "chatkit-chat-composer",
18179
18551
  className: "mx-auto w-full p-2 sticky bottom-0 z-10 bg-background",
18180
18552
  style: chatColumnStyle,
18181
18553
  children: [
18182
- threadErrorMessage && /* @__PURE__ */ jsx55("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 }),
18183
- /* @__PURE__ */ jsx55(
18554
+ threadErrorMessage && /* @__PURE__ */ jsx56("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 }),
18555
+ /* @__PURE__ */ jsx56(
18184
18556
  ChatAttachments,
18185
18557
  {
18186
18558
  ref: attachmentsRef,
@@ -18194,7 +18566,7 @@ function Chat({
18194
18566
  onStateChange: setAttachmentState
18195
18567
  }
18196
18568
  ),
18197
- references.length > 0 && /* @__PURE__ */ jsx55("div", { className: "mb-3 flex flex-wrap gap-2", children: references.map((reference) => /* @__PURE__ */ jsx55(
18569
+ references.length > 0 && /* @__PURE__ */ jsx56("div", { className: "mb-3 flex flex-wrap gap-2", children: references.map((reference) => /* @__PURE__ */ jsx56(
18198
18570
  ReferenceChip,
18199
18571
  {
18200
18572
  reference,
@@ -18208,32 +18580,16 @@ function Chat({
18208
18580
  },
18209
18581
  getReferenceKey(reference)
18210
18582
  )) }),
18211
- detachedRunRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ jsxs38("div", { className: "mb-2 flex flex-wrap items-center gap-2", children: [
18212
- /* @__PURE__ */ jsx55("span", { className: "text-xs text-muted-foreground", children: t("composer.capabilities.runOnly") }),
18213
- detachedRunRuntimeCapabilityOptions.map((option) => /* @__PURE__ */ jsxs38(
18214
- "span",
18215
- {
18216
- 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",
18217
- children: [
18218
- /* @__PURE__ */ jsx55(RuntimeCapabilityIcon, { option, variant: "chip" }),
18219
- /* @__PURE__ */ jsx55("span", { className: "max-w-40 truncate", children: option.label }),
18220
- /* @__PURE__ */ jsx55(
18221
- "button",
18222
- {
18223
- type: "button",
18224
- onClick: () => removeRunRuntimeCapability(option),
18225
- className: "rounded-full p-0.5 hover:bg-primary/15",
18226
- title: t("composer.capabilities.removeRunCapability"),
18227
- "aria-label": t("composer.capabilities.removeRunCapability"),
18228
- children: /* @__PURE__ */ jsx55(X6, { size: 11 })
18229
- }
18230
- )
18231
- ]
18232
- },
18233
- `${option.type}:${option.id}`
18234
- ))
18235
- ] }),
18236
- showGoalStatus && /* @__PURE__ */ jsxs38(
18583
+ /* @__PURE__ */ jsx56(
18584
+ DetachedRunRuntimeCapabilities,
18585
+ {
18586
+ options: detachedRunRuntimeCapabilityOptions,
18587
+ runOnlyLabel: t("composer.capabilities.runOnly"),
18588
+ removeLabel: t("composer.capabilities.removeRunCapability"),
18589
+ onRemove: removeRunRuntimeCapability
18590
+ }
18591
+ ),
18592
+ showGoalStatus && /* @__PURE__ */ jsxs39(
18237
18593
  "div",
18238
18594
  {
18239
18595
  className: cn(
@@ -18241,7 +18597,7 @@ function Chat({
18241
18597
  isGoalObjectiveExpanded ? "items-start" : "items-center"
18242
18598
  ),
18243
18599
  children: [
18244
- /* @__PURE__ */ jsx55(
18600
+ /* @__PURE__ */ jsx56(
18245
18601
  Target2,
18246
18602
  {
18247
18603
  className: cn(
@@ -18250,13 +18606,13 @@ function Chat({
18250
18606
  )
18251
18607
  }
18252
18608
  ),
18253
- /* @__PURE__ */ jsxs38("div", { className: "min-w-0 flex-1", children: [
18254
- /* @__PURE__ */ jsxs38("div", { className: "flex min-w-0 items-center gap-2", children: [
18255
- /* @__PURE__ */ jsx55("span", { className: "font-medium", children: t("chat.goal.label") }),
18256
- threadGoal && /* @__PURE__ */ jsx55("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}`) }),
18257
- isGoalLoading && /* @__PURE__ */ jsx55(Loader29, { className: "size-3 animate-spin text-muted-foreground" })
18609
+ /* @__PURE__ */ jsxs39("div", { className: "min-w-0 flex-1", children: [
18610
+ /* @__PURE__ */ jsxs39("div", { className: "flex min-w-0 items-center gap-2", children: [
18611
+ /* @__PURE__ */ jsx56("span", { className: "font-medium", children: t("chat.goal.label") }),
18612
+ threadGoal && /* @__PURE__ */ jsx56("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}`) }),
18613
+ isGoalLoading && /* @__PURE__ */ jsx56(Loader29, { className: "size-3 animate-spin text-muted-foreground" })
18258
18614
  ] }),
18259
- /* @__PURE__ */ jsx55(
18615
+ /* @__PURE__ */ jsx56(
18260
18616
  "div",
18261
18617
  {
18262
18618
  className: cn(
@@ -18266,13 +18622,13 @@ function Chat({
18266
18622
  children: goalError || threadGoal?.objective
18267
18623
  }
18268
18624
  ),
18269
- threadGoal && /* @__PURE__ */ jsx55("div", { className: "mt-1 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-muted-foreground", children: /* @__PURE__ */ jsx55("span", { children: t("chat.goal.elapsed", {
18625
+ threadGoal && /* @__PURE__ */ jsx56("div", { className: "mt-1 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-muted-foreground", children: /* @__PURE__ */ jsx56("span", { children: t("chat.goal.elapsed", {
18270
18626
  elapsed: formatGoalElapsed(displayedGoalElapsedSeconds)
18271
18627
  }) }) })
18272
18628
  ] }),
18273
- threadGoal && /* @__PURE__ */ jsxs38("div", { className: "flex shrink-0 items-center gap-1", children: [
18274
- /* @__PURE__ */ jsxs38(Tooltip, { children: [
18275
- /* @__PURE__ */ jsx55(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx55(
18629
+ threadGoal && /* @__PURE__ */ jsxs39("div", { className: "flex shrink-0 items-center gap-1", children: [
18630
+ /* @__PURE__ */ jsxs39(Tooltip, { children: [
18631
+ /* @__PURE__ */ jsx56(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx56(
18276
18632
  Button,
18277
18633
  {
18278
18634
  type: "button",
@@ -18283,13 +18639,13 @@ function Chat({
18283
18639
  const prefix = "/goal edit ";
18284
18640
  setComposerText(`${prefix}${threadGoal.objective}`);
18285
18641
  },
18286
- children: /* @__PURE__ */ jsx55(Pencil4, { className: "size-3" })
18642
+ children: /* @__PURE__ */ jsx56(Pencil4, { className: "size-3" })
18287
18643
  }
18288
18644
  ) }),
18289
- /* @__PURE__ */ jsx55(TooltipContent, { children: t("chat.goal.edit") })
18645
+ /* @__PURE__ */ jsx56(TooltipContent, { children: t("chat.goal.edit") })
18290
18646
  ] }),
18291
- /* @__PURE__ */ jsxs38(Tooltip, { children: [
18292
- /* @__PURE__ */ jsx55(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx55(
18647
+ /* @__PURE__ */ jsxs39(Tooltip, { children: [
18648
+ /* @__PURE__ */ jsx56(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx56(
18293
18649
  Button,
18294
18650
  {
18295
18651
  type: "button",
@@ -18305,13 +18661,13 @@ function Chat({
18305
18661
  executionType: "insert_invocation"
18306
18662
  }
18307
18663
  }),
18308
- children: threadGoal.status === "paused" ? /* @__PURE__ */ jsx55(Play, { className: "size-3" }) : /* @__PURE__ */ jsx55(Pause, { className: "size-3" })
18664
+ children: threadGoal.status === "paused" ? /* @__PURE__ */ jsx56(Play, { className: "size-3" }) : /* @__PURE__ */ jsx56(Pause, { className: "size-3" })
18309
18665
  }
18310
18666
  ) }),
18311
- /* @__PURE__ */ jsx55(TooltipContent, { children: threadGoal.status === "paused" ? t("chat.goal.resume") : t("chat.goal.pause") })
18667
+ /* @__PURE__ */ jsx56(TooltipContent, { children: threadGoal.status === "paused" ? t("chat.goal.resume") : t("chat.goal.pause") })
18312
18668
  ] }),
18313
- /* @__PURE__ */ jsxs38(Tooltip, { children: [
18314
- /* @__PURE__ */ jsx55(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx55(
18669
+ /* @__PURE__ */ jsxs39(Tooltip, { children: [
18670
+ /* @__PURE__ */ jsx56(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx56(
18315
18671
  Button,
18316
18672
  {
18317
18673
  type: "button",
@@ -18327,13 +18683,13 @@ function Chat({
18327
18683
  executionType: "insert_invocation"
18328
18684
  }
18329
18685
  }),
18330
- children: /* @__PURE__ */ jsx55(Trash23, { className: "size-3" })
18686
+ children: /* @__PURE__ */ jsx56(Trash23, { className: "size-3" })
18331
18687
  }
18332
18688
  ) }),
18333
- /* @__PURE__ */ jsx55(TooltipContent, { children: t("chat.goal.clear") })
18689
+ /* @__PURE__ */ jsx56(TooltipContent, { children: t("chat.goal.clear") })
18334
18690
  ] }),
18335
- threadGoal.objective && !goalError && /* @__PURE__ */ jsxs38(Tooltip, { children: [
18336
- /* @__PURE__ */ jsx55(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx55(
18691
+ threadGoal.objective && !goalError && /* @__PURE__ */ jsxs39(Tooltip, { children: [
18692
+ /* @__PURE__ */ jsx56(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx56(
18337
18693
  Button,
18338
18694
  {
18339
18695
  type: "button",
@@ -18342,7 +18698,7 @@ function Chat({
18342
18698
  "aria-expanded": isGoalObjectiveExpanded,
18343
18699
  "aria-label": isGoalObjectiveExpanded ? t("chat.goal.collapseObjective") : t("chat.goal.expandObjective"),
18344
18700
  onClick: () => setIsGoalObjectiveExpanded((expanded) => !expanded),
18345
- children: /* @__PURE__ */ jsx55(
18701
+ children: /* @__PURE__ */ jsx56(
18346
18702
  ChevronDown5,
18347
18703
  {
18348
18704
  className: cn(
@@ -18353,13 +18709,13 @@ function Chat({
18353
18709
  )
18354
18710
  }
18355
18711
  ) }),
18356
- /* @__PURE__ */ jsx55(TooltipContent, { children: isGoalObjectiveExpanded ? t("chat.goal.collapseObjective") : t("chat.goal.expandObjective") })
18712
+ /* @__PURE__ */ jsx56(TooltipContent, { children: isGoalObjectiveExpanded ? t("chat.goal.collapseObjective") : t("chat.goal.expandObjective") })
18357
18713
  ] })
18358
18714
  ] })
18359
18715
  ]
18360
18716
  }
18361
18717
  ),
18362
- /* @__PURE__ */ jsx55(
18718
+ /* @__PURE__ */ jsx56(
18363
18719
  PendingRuntimeServices,
18364
18720
  {
18365
18721
  state: stream.runtimeActivities.sandboxServices,
@@ -18368,7 +18724,7 @@ function Chat({
18368
18724
  className: hasPendingTodos || hasPendingFollowUps ? "mb-2" : void 0
18369
18725
  }
18370
18726
  ),
18371
- /* @__PURE__ */ jsx55(
18727
+ /* @__PURE__ */ jsx56(
18372
18728
  PendingTodos,
18373
18729
  {
18374
18730
  snapshot: stream.todos,
@@ -18376,7 +18732,7 @@ function Chat({
18376
18732
  className: hasPendingFollowUps ? "mb-2" : void 0
18377
18733
  }
18378
18734
  ),
18379
- /* @__PURE__ */ jsx55(
18735
+ /* @__PURE__ */ jsx56(
18380
18736
  PendingFollowUps,
18381
18737
  {
18382
18738
  items: pendingFollowUps,
@@ -18389,7 +18745,7 @@ function Chat({
18389
18745
  attachToComposer: true
18390
18746
  }
18391
18747
  ),
18392
- /* @__PURE__ */ jsx55(
18748
+ /* @__PURE__ */ jsx56(
18393
18749
  RequestUserInputPanel,
18394
18750
  {
18395
18751
  request: stream.pendingRequestUserInput,
@@ -18398,7 +18754,7 @@ function Chat({
18398
18754
  attachToComposer: true
18399
18755
  }
18400
18756
  ),
18401
- /* @__PURE__ */ jsx55(
18757
+ /* @__PURE__ */ jsx56(
18402
18758
  HITLApprovalPanel,
18403
18759
  {
18404
18760
  request: stream.pendingHITLRequest,
@@ -18407,7 +18763,7 @@ function Chat({
18407
18763
  attachToComposer: true
18408
18764
  }
18409
18765
  ),
18410
- runtimeCapabilityPalette && /* @__PURE__ */ jsx55(
18766
+ runtimeCapabilityPalette && /* @__PURE__ */ jsx56(
18411
18767
  SlashPalette,
18412
18768
  {
18413
18769
  palette: runtimeCapabilityPalette,
@@ -18421,7 +18777,7 @@ function Chat({
18421
18777
  onSelect: selectSlashPaletteOption
18422
18778
  }
18423
18779
  ),
18424
- /* @__PURE__ */ jsx55("form", { className: "flex items-end", onSubmit: handleSubmit, children: /* @__PURE__ */ jsxs38(
18780
+ /* @__PURE__ */ jsx56("form", { className: "flex items-end", onSubmit: handleSubmit, children: /* @__PURE__ */ jsxs39(
18425
18781
  "div",
18426
18782
  {
18427
18783
  "data-slot": "composer-input-shell",
@@ -18435,7 +18791,7 @@ function Chat({
18435
18791
  composerInputRoundedClass
18436
18792
  ),
18437
18793
  children: [
18438
- /* @__PURE__ */ jsx55(
18794
+ /* @__PURE__ */ jsx56(
18439
18795
  "div",
18440
18796
  {
18441
18797
  ref: composerInputRef,
@@ -18457,39 +18813,19 @@ function Chat({
18457
18813
  (missingConfig || isHistoryLoading || hasPendingInteractiveRequest) && "cursor-not-allowed opacity-50"
18458
18814
  ),
18459
18815
  children: renderedComposerParts.map(
18460
- (part, index) => part.type === "text" ? /* @__PURE__ */ jsx55(React50.Fragment, { children: part.text }, `text-${index}`) : /* @__PURE__ */ jsxs38(
18461
- "span",
18462
- {
18463
- "data-composer-capability-key": part.key,
18464
- "data-capability-type": part.capability.type,
18465
- "data-capability-id": part.capability.id,
18466
- contentEditable: false,
18467
- className: "mx-0.5 inline-flex max-w-[14rem] select-none items-center gap-1 text-sm font-semibold text-primary align-baseline",
18468
- children: [
18469
- /* @__PURE__ */ jsx55(
18470
- RuntimeCapabilityIcon,
18471
- {
18472
- option: part.capability,
18473
- variant: "chip"
18474
- }
18475
- ),
18476
- /* @__PURE__ */ jsx55("span", { className: "truncate", children: part.capability.label })
18477
- ]
18478
- },
18479
- part.key
18480
- )
18816
+ (part, index) => part.type === "text" ? /* @__PURE__ */ jsx56(React51.Fragment, { children: part.text }, `text-${index}`) : /* @__PURE__ */ jsx56(ComposerCapabilityToken, { part }, part.key)
18481
18817
  )
18482
18818
  },
18483
18819
  composerDomVersion
18484
18820
  ),
18485
- /* @__PURE__ */ jsxs38(
18821
+ /* @__PURE__ */ jsxs39(
18486
18822
  "div",
18487
18823
  {
18488
18824
  "data-slot": "composer-action-bar",
18489
18825
  className: "pointer-events-none absolute inset-x-1.5 bottom-1 flex min-h-10 items-center justify-between gap-2",
18490
18826
  children: [
18491
- /* @__PURE__ */ jsxs38("div", { className: "pointer-events-none flex min-w-0 flex-1 items-center gap-1.5", children: [
18492
- /* @__PURE__ */ jsx55("div", { className: "pointer-events-auto flex shrink-0 items-center gap-1.5", children: /* @__PURE__ */ jsx55(
18827
+ /* @__PURE__ */ jsxs39("div", { className: "pointer-events-none flex min-w-0 flex-1 items-center gap-1.5", children: [
18828
+ /* @__PURE__ */ jsx56("div", { className: "pointer-events-auto flex shrink-0 items-center gap-1.5", children: /* @__PURE__ */ jsx56(
18493
18829
  ComposerMenu,
18494
18830
  {
18495
18831
  composer,
@@ -18507,20 +18843,20 @@ function Chat({
18507
18843
  disabled: missingConfig || isHistoryLoading || hasPendingInteractiveRequest
18508
18844
  }
18509
18845
  ) }),
18510
- selectedTool && /* @__PURE__ */ jsxs38("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: [
18511
- /* @__PURE__ */ jsx55("span", { className: "truncate", children: selectedTool.shortLabel ?? selectedTool.label }),
18512
- /* @__PURE__ */ jsx55(
18846
+ selectedTool && /* @__PURE__ */ jsxs39("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: [
18847
+ /* @__PURE__ */ jsx56("span", { className: "truncate", children: selectedTool.shortLabel ?? selectedTool.label }),
18848
+ /* @__PURE__ */ jsx56(
18513
18849
  "button",
18514
18850
  {
18515
18851
  type: "button",
18516
18852
  onClick: () => setSelectedTool(null),
18517
18853
  className: "shrink-0 rounded-full p-0.5 text-primary/70 hover:bg-primary/10 hover:text-primary",
18518
- children: /* @__PURE__ */ jsx55(X6, { size: 12 })
18854
+ children: /* @__PURE__ */ jsx56(X7, { size: 12 })
18519
18855
  }
18520
18856
  )
18521
18857
  ] })
18522
18858
  ] }),
18523
- /* @__PURE__ */ jsx55("div", { className: "pointer-events-auto shrink-0", children: /* @__PURE__ */ jsx55(
18859
+ /* @__PURE__ */ jsx56("div", { className: "pointer-events-auto shrink-0", children: /* @__PURE__ */ jsx56(
18524
18860
  SendButton,
18525
18861
  {
18526
18862
  disabled: isSendDisabled,
@@ -18543,7 +18879,7 @@ function Chat({
18543
18879
  ]
18544
18880
  }
18545
18881
  ) }),
18546
- disclaimer?.text && /* @__PURE__ */ jsx55(
18882
+ disclaimer?.text && /* @__PURE__ */ jsx56(
18547
18883
  "p",
18548
18884
  {
18549
18885
  className: cn(
@@ -18553,14 +18889,14 @@ function Chat({
18553
18889
  children: disclaimer.text
18554
18890
  }
18555
18891
  ),
18556
- /* @__PURE__ */ jsxs38("div", { className: "mt-2 flex items-center justify-center gap-2 text-xs text-muted-foreground", children: [
18557
- /* @__PURE__ */ jsx55("span", { children: t("chat.poweredBy") }),
18558
- /* @__PURE__ */ jsx55(ContextUsageIndicator, { className: "absolute right-4" })
18892
+ /* @__PURE__ */ jsxs39("div", { className: "mt-2 flex items-center justify-center gap-2 text-xs text-muted-foreground", children: [
18893
+ /* @__PURE__ */ jsx56("span", { children: t("chat.poweredBy") }),
18894
+ /* @__PURE__ */ jsx56(ContextUsageIndicator, { className: "absolute right-4" })
18559
18895
  ] })
18560
18896
  ]
18561
18897
  }
18562
18898
  ),
18563
- /* @__PURE__ */ jsx55(
18899
+ /* @__PURE__ */ jsx56(
18564
18900
  SettingsSheet,
18565
18901
  {
18566
18902
  open: petSettingsOpen,
@@ -18570,17 +18906,17 @@ function Chat({
18570
18906
  onSave: savePetLocalSettings
18571
18907
  }
18572
18908
  ),
18573
- /* @__PURE__ */ jsx55(PetBridge, { pet: effectivePet, state: petAutoState })
18909
+ /* @__PURE__ */ jsx56(PetBridge, { pet: effectivePet, state: petAutoState })
18574
18910
  ]
18575
18911
  }
18576
18912
  );
18577
18913
  }
18578
18914
 
18579
18915
  // src/components/ui/separator.tsx
18580
- import * as React51 from "react";
18581
- import { jsx as jsx56 } from "react/jsx-runtime";
18582
- var Separator = React51.forwardRef(
18583
- ({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */ jsx56(
18916
+ import * as React52 from "react";
18917
+ import { jsx as jsx57 } from "react/jsx-runtime";
18918
+ var Separator = React52.forwardRef(
18919
+ ({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */ jsx57(
18584
18920
  "div",
18585
18921
  {
18586
18922
  ref,