@xpert-ai/chatkit-ui 0.3.6 → 0.3.8
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.
- package/dist/app/assets/{_baseUniq-PQJUyd2p.js → _baseUniq-zJf1BKo2.js} +1 -1
- package/dist/app/assets/{abap-DBNQvwwq.js → abap-Cu1EkeUh.js} +1 -1
- package/dist/app/assets/{abnf-DAYjyqbD.js → abnf-CqAS5kWV.js} +1 -1
- package/dist/app/assets/{actionscript-CC6WSmTp.js → actionscript-Nbsf22Ov.js} +1 -1
- package/dist/app/assets/{ada-BKGodcKv.js → ada-C1imLgfX.js} +1 -1
- package/dist/app/assets/{agda-Btmo1dV2.js → agda-Hj3EJXKu.js} +1 -1
- package/dist/app/assets/{al-ZGIJe93k.js → al-s-V4qjCK.js} +1 -1
- package/dist/app/assets/{antlr4-5WGUtMyl.js → antlr4-BX7TjEsM.js} +1 -1
- package/dist/app/assets/{apacheconf-DUR_1QqW.js → apacheconf-BV4I00_T.js} +1 -1
- package/dist/app/assets/{apex-BintsQD-.js → apex-ENPSWKzR.js} +1 -1
- package/dist/app/assets/{apl-B7pUHOBS.js → apl-D-jUGzMj.js} +1 -1
- package/dist/app/assets/{applescript-CanCSogn.js → applescript-D-0dnXQK.js} +1 -1
- package/dist/app/assets/{aql-iDHrUFca.js → aql-BWNy8GP9.js} +1 -1
- package/dist/app/assets/{arc-VbTm84dM.js → arc-MRAhurHy.js} +1 -1
- package/dist/app/assets/{architectureDiagram-Q4EWVU46-BwbXOlsJ.js → architectureDiagram-Q4EWVU46-0FQ4f47B.js} +1 -1
- package/dist/app/assets/{arduino-CvuY6cDV.js → arduino-CNo6VmKi.js} +1 -1
- package/dist/app/assets/{arff-C7UK1Sqo.js → arff-DoHakQ8l.js} +1 -1
- package/dist/app/assets/{asciidoc-jaQgm_Ci.js → asciidoc-CID4pu1O.js} +1 -1
- package/dist/app/assets/{asm6502-Bec9iTSO.js → asm6502-DhP-yvtv.js} +1 -1
- package/dist/app/assets/{asmatmel-CWWLYM-f.js → asmatmel-08PvVU6w.js} +1 -1
- package/dist/app/assets/{aspnet-EICvaNos.js → aspnet-C3KzaEhl.js} +1 -1
- package/dist/app/assets/{autohotkey-CgvCc8dt.js → autohotkey-YMH9Ryj9.js} +1 -1
- package/dist/app/assets/{autoit-BbrdfXjj.js → autoit-Cu6bIE1N.js} +1 -1
- package/dist/app/assets/{avisynth-C7cOgG-q.js → avisynth-Qbs8YrYL.js} +1 -1
- package/dist/app/assets/{avro-idl-BsT9yVqS.js → avro-idl-CaKenPK5.js} +1 -1
- package/dist/app/assets/{bash-BF1ylQ6_.js → bash-vbYUf6n8.js} +1 -1
- package/dist/app/assets/{basic-DyO_cuAQ.js → basic-BfXRs4VW.js} +1 -1
- package/dist/app/assets/{batch-DdxmhDRT.js → batch-EE0zGUec.js} +1 -1
- package/dist/app/assets/{bbcode-Csh0dpf7.js → bbcode-oURfVSu_.js} +1 -1
- package/dist/app/assets/{bicep-CEnRCsw4.js → bicep-C_YEwqCC.js} +1 -1
- package/dist/app/assets/{birb-H4aZEyfE.js → birb-BMXrMSFJ.js} +1 -1
- package/dist/app/assets/{bison-B4NzJQL4.js → bison-B3ZshxCf.js} +1 -1
- package/dist/app/assets/{blockDiagram-DXYQGD6D-BQrs2vZp.js → blockDiagram-DXYQGD6D-C97eDLIt.js} +1 -1
- package/dist/app/assets/{bnf-BpnLOKBL.js → bnf-CGucWzUq.js} +1 -1
- package/dist/app/assets/{brainfuck-BcXFtTZS.js → brainfuck-CRashDtN.js} +1 -1
- package/dist/app/assets/{brightscript-C-G4maiE.js → brightscript-DRXXdYYA.js} +1 -1
- package/dist/app/assets/{bro-JcLlkXX7.js → bro-y2jQJy1k.js} +1 -1
- package/dist/app/assets/{bsl-C7EgrPBt.js → bsl-Bd7aNBvB.js} +1 -1
- package/dist/app/assets/{c-0vDIBgc3.js → c-GdiRPwSp.js} +1 -1
- package/dist/app/assets/{c4Diagram-AHTNJAMY-wtHHI5rn.js → c4Diagram-AHTNJAMY-B1vGfQnc.js} +1 -1
- package/dist/app/assets/{cfscript-B5a7v4dm.js → cfscript-Bk6ptVZ7.js} +1 -1
- package/dist/app/assets/{chaiscript-CC6j4sQE.js → chaiscript-DVbDikdY.js} +1 -1
- package/dist/app/assets/channel-B8rTNXaE.js +1 -0
- package/dist/app/assets/{chunk-4BX2VUAB-Dlz831RQ.js → chunk-4BX2VUAB-aOlX8Tsl.js} +1 -1
- package/dist/app/assets/{chunk-4TB4RGXK-D5P5dUqt.js → chunk-4TB4RGXK-Cct6HmQ2.js} +1 -1
- package/dist/app/assets/{chunk-55IACEB6-BqMvjwUA.js → chunk-55IACEB6--c2hOnxs.js} +1 -1
- package/dist/app/assets/{chunk-EDXVE4YY-DnPhlqJA.js → chunk-EDXVE4YY-BdLtGCVI.js} +1 -1
- package/dist/app/assets/{chunk-FMBD7UC4-DNRIZD8O.js → chunk-FMBD7UC4-yA5L8QIq.js} +1 -1
- package/dist/app/assets/{chunk-OYMX7WX6-JXHjhCxm.js → chunk-OYMX7WX6-CyCG-0_T.js} +1 -1
- package/dist/app/assets/{chunk-QZHKN3VN-BkxXCZY4.js → chunk-QZHKN3VN-tUWDkfpT.js} +1 -1
- package/dist/app/assets/{chunk-YZCP3GAM-EpFGzvxp.js → chunk-YZCP3GAM-JrANxk3g.js} +1 -1
- package/dist/app/assets/{cil-iQdhNO4Q.js → cil-CWcIBeyN.js} +1 -1
- package/dist/app/assets/classDiagram-6PBFFD2Q-Bzz5eezS.js +1 -0
- package/dist/app/assets/classDiagram-v2-HSJHXN6E-Bzz5eezS.js +1 -0
- package/dist/app/assets/{clike-CQAeHYPM.js → clike-BDDDUpjh.js} +1 -1
- package/dist/app/assets/{clojure-Cql6MpyZ.js → clojure-B18OSjNd.js} +1 -1
- package/dist/app/assets/clone-CebL2qD9.js +1 -0
- package/dist/app/assets/{cmake-BfKHjCsg.js → cmake-CE-5PhKC.js} +1 -1
- package/dist/app/assets/{cobol-CKkM0fVl.js → cobol-e4-CuEUG.js} +1 -1
- package/dist/app/assets/{coffeescript-CgyUEXhV.js → coffeescript-DMB3o73k.js} +1 -1
- package/dist/app/assets/{concurnas-CeEqG40V.js → concurnas-B-zQJRS2.js} +1 -1
- package/dist/app/assets/{coq-CkWZFRlP.js → coq-BYIXlV_y.js} +1 -1
- package/dist/app/assets/{core-CcAPm-aU.js → core-Ca6h4DfX.js} +1 -1
- package/dist/app/assets/{cose-bilkent-S5V4N54A-kULVHEg6.js → cose-bilkent-S5V4N54A-CxrdGCeV.js} +1 -1
- package/dist/app/assets/{cpp-Bwq_b1tA.js → cpp-BjZ4f5Y0.js} +1 -1
- package/dist/app/assets/{crystal-YNIUD3Bs.js → crystal-tS-wFJVJ.js} +1 -1
- package/dist/app/assets/{csharp-P6DguRUY.js → csharp-JABcNerk.js} +1 -1
- package/dist/app/assets/{cshtml-B5QmdkLH.js → cshtml-5eaazXZG.js} +1 -1
- package/dist/app/assets/{csp-DFeKy3lq.js → csp-iC5C2J_s.js} +1 -1
- package/dist/app/assets/{css-CRC3M3rp.js → css-SH10_CNe.js} +1 -1
- package/dist/app/assets/{css-extras-BFuChsao.js → css-extras-p80Zq4YI.js} +1 -1
- package/dist/app/assets/{csv-C4LMPB8f.js → csv-CpJu4Q0I.js} +1 -1
- package/dist/app/assets/{cypher-HIcVk2j0.js → cypher-DssxnB4c.js} +1 -1
- package/dist/app/assets/{d-BnjQOzu7.js → d-BMsuQGcX.js} +1 -1
- package/dist/app/assets/{dagre-KV5264BT-DYeQuZ_S.js → dagre-KV5264BT-CuyZNdL-.js} +1 -1
- package/dist/app/assets/{dart-BY_HEqIc.js → dart-DoGPpSU5.js} +1 -1
- package/dist/app/assets/{dataweave-IZkekg5J.js → dataweave-k7gDL0hD.js} +1 -1
- package/dist/app/assets/{dax-BDxI87qH.js → dax-N-vG7fJN.js} +1 -1
- package/dist/app/assets/{dhall-BI7me9By.js → dhall-BVC_l7R6.js} +1 -1
- package/dist/app/assets/{diagram-5BDNPKRD-DqUtPt3D.js → diagram-5BDNPKRD-TL2Nl6Pu.js} +1 -1
- package/dist/app/assets/{diagram-G4DWMVQ6-DUz5iheG.js → diagram-G4DWMVQ6-BMsfmMXA.js} +1 -1
- package/dist/app/assets/{diagram-MMDJMWI5-DqMZVdpe.js → diagram-MMDJMWI5-BfNwEPAz.js} +1 -1
- package/dist/app/assets/{diagram-TYMM5635-D4dMAYPV.js → diagram-TYMM5635-Bh65Up_l.js} +1 -1
- package/dist/app/assets/{diff-D1eveguk.js → diff-Dq-Wl_rl.js} +1 -1
- package/dist/app/assets/{django-n2RdeMZg.js → django-nqkF6SVu.js} +1 -1
- package/dist/app/assets/{dns-zone-file-C7ZVuM_8.js → dns-zone-file--EtUIqUz.js} +1 -1
- package/dist/app/assets/{docker-2dKv2uP8.js → docker-CWieq5E6.js} +1 -1
- package/dist/app/assets/{dot-CnM9kCZh.js → dot-BHVG56Qh.js} +1 -1
- package/dist/app/assets/{ebnf-DNNgDJ77.js → ebnf-BOYTxY8t.js} +1 -1
- package/dist/app/assets/{editorconfig-BOtWIdJu.js → editorconfig-DO8bfY96.js} +1 -1
- package/dist/app/assets/{eiffel-DZJsL-6U.js → eiffel-BDvcUlCo.js} +1 -1
- package/dist/app/assets/{ejs-DlY_5WK7.js → ejs-CRonzdyL.js} +1 -1
- package/dist/app/assets/{elixir-DnflWYYw.js → elixir-JLXxG3mm.js} +1 -1
- package/dist/app/assets/{elm-DiBtRJyK.js → elm-DdvIr0Kw.js} +1 -1
- package/dist/app/assets/{erDiagram-SMLLAGMA-s249XOhW.js → erDiagram-SMLLAGMA-DK9nnYy4.js} +1 -1
- package/dist/app/assets/{erb-Ctwnlnto.js → erb-BlWxg5di.js} +1 -1
- package/dist/app/assets/{erlang-BnrgWRyV.js → erlang-Dr8ifve2.js} +1 -1
- package/dist/app/assets/{etlua-B-b2a1aT.js → etlua-BOGzUF6g.js} +1 -1
- package/dist/app/assets/{excel-formula-BfwuYhTY.js → excel-formula-D8pzu8qZ.js} +1 -1
- package/dist/app/assets/{factor-2cFlXUFG.js → factor-CJlai45M.js} +1 -1
- package/dist/app/assets/{false-DVJW4Xbm.js → false-0MKeXzIN.js} +1 -1
- package/dist/app/assets/{firestore-security-rules-BDB3ruEY.js → firestore-security-rules-Chvt90vZ.js} +1 -1
- package/dist/app/assets/{flow-v_X8TsCx.js → flow-q16-31H5.js} +1 -1
- package/dist/app/assets/{flowDiagram-DWJPFMVM-Dz8lk_A8.js → flowDiagram-DWJPFMVM-COgy_gHI.js} +1 -1
- package/dist/app/assets/{fortran-VlXf9wYr.js → fortran-DH6vymC-.js} +1 -1
- package/dist/app/assets/{fsharp-BgmRbToz.js → fsharp-RoYDjp48.js} +1 -1
- package/dist/app/assets/{ftl-CX7l6a-K.js → ftl-D1gLmJ7k.js} +1 -1
- package/dist/app/assets/{ganttDiagram-T4ZO3ILL-C8JxZNAd.js → ganttDiagram-T4ZO3ILL-BtrKdHBv.js} +1 -1
- package/dist/app/assets/{gap-C3towync.js → gap-CoePkKFo.js} +1 -1
- package/dist/app/assets/{gcode-pPl8BHC6.js → gcode-BJFvmkRd.js} +1 -1
- package/dist/app/assets/{gdscript-CQ5KQpTU.js → gdscript-BLnH9xef.js} +1 -1
- package/dist/app/assets/{gedcom-UKqoiZ_B.js → gedcom-Cb1W1HPn.js} +1 -1
- package/dist/app/assets/{gherkin-oHLPyBSJ.js → gherkin-DR_tGOrT.js} +1 -1
- package/dist/app/assets/{git-QJvYrr1x.js → git-BVcDXb4a.js} +1 -1
- package/dist/app/assets/{gitGraphDiagram-UUTBAWPF-D8hAIW7o.js → gitGraphDiagram-UUTBAWPF-CAHcfSwl.js} +1 -1
- package/dist/app/assets/{glsl-D9mjvqGV.js → glsl-DnYRu7LE.js} +1 -1
- package/dist/app/assets/{gml-DyeDbLje.js → gml-B2_ego1R.js} +1 -1
- package/dist/app/assets/{gn-CQxx-3wR.js → gn-CRiBhhko.js} +1 -1
- package/dist/app/assets/{go-BlxfTxGG.js → go-B7dO2ylQ.js} +1 -1
- package/dist/app/assets/{go-module-aUBiuILx.js → go-module-CeZJSofs.js} +1 -1
- package/dist/app/assets/{graph-D-X2uhF1.js → graph-eZYVWD6P.js} +1 -1
- package/dist/app/assets/{graphql-Clt8HaZ7.js → graphql-Unukc8fz.js} +1 -1
- package/dist/app/assets/{groovy-CZSeQO36.js → groovy-B44blE34.js} +1 -1
- package/dist/app/assets/{haml-DMf7PiKp.js → haml-DdCY1uYA.js} +1 -1
- package/dist/app/assets/{handlebars-BphhMxT6.js → handlebars-JUEPhE3e.js} +1 -1
- package/dist/app/assets/{haskell-Ccj1mGN_.js → haskell-9PM4bYLP.js} +1 -1
- package/dist/app/assets/{haxe-CtvRdMmt.js → haxe-Df4FLr0i.js} +1 -1
- package/dist/app/assets/{hcl-HQGsM91R.js → hcl-BDlRjAUR.js} +1 -1
- package/dist/app/assets/{hlsl-U_2FN4GV.js → hlsl-D_po1e1Z.js} +1 -1
- package/dist/app/assets/{hoon-DSS3mQR5.js → hoon-BMh5gCjg.js} +1 -1
- package/dist/app/assets/{hpkp-BPnzFZ5n.js → hpkp-DoCB_sk7.js} +1 -1
- package/dist/app/assets/{hsts-BRaWTgmx.js → hsts-DESjcvH0.js} +1 -1
- package/dist/app/assets/{http-DgZif8XP.js → http-DFy_Xl8u.js} +1 -1
- package/dist/app/assets/{ichigojam-ypramSfH.js → ichigojam-CiZij_ux.js} +1 -1
- package/dist/app/assets/{icon-DsD0Czia.js → icon-BmVRXwZJ.js} +1 -1
- package/dist/app/assets/{icu-message-format-BVJiYPkB.js → icu-message-format-CwQPjmeS.js} +1 -1
- package/dist/app/assets/{idris-BvurrLkY.js → idris-COR7TtKH.js} +1 -1
- package/dist/app/assets/{iecst-Clwdf_8K.js → iecst-CssklREm.js} +1 -1
- package/dist/app/assets/{ignore-DkK-S7HP.js → ignore-DDGdM2i4.js} +1 -1
- package/dist/app/assets/index-CYldSx7G.css +1 -0
- package/dist/app/assets/{index-D-y0b7ri.js → index-Dyt4Ufb6.js} +188 -188
- package/dist/app/assets/{infoDiagram-42DDH7IO-BocjJZwC.js → infoDiagram-42DDH7IO-C-oJinvl.js} +1 -1
- package/dist/app/assets/{inform7-yFSTqWIe.js → inform7-BFRimPpU.js} +1 -1
- package/dist/app/assets/{ini-BcO8nYi7.js → ini-Dhu8SOFl.js} +1 -1
- package/dist/app/assets/{io-BBkn-xXo.js → io-DYIw1lw-.js} +1 -1
- package/dist/app/assets/{ishikawaDiagram-UXIWVN3A-Dlw93ArC.js → ishikawaDiagram-UXIWVN3A-Bb1xxiKo.js} +1 -1
- package/dist/app/assets/{j-M5UTfImQ.js → j-5lxhiNkU.js} +1 -1
- package/dist/app/assets/{java-Xjo5k22g.js → java-Cupob46S.js} +1 -1
- package/dist/app/assets/{javadoc-D6lpCK4S.js → javadoc-Coc5O5uw.js} +1 -1
- package/dist/app/assets/{javadoclike-DGBCsKaU.js → javadoclike-BxklgpQx.js} +1 -1
- package/dist/app/assets/{javascript-DkE8xAaV.js → javascript-spspNCkm.js} +1 -1
- package/dist/app/assets/{javastacktrace-Be5zC165.js → javastacktrace-BzQLrZi6.js} +1 -1
- package/dist/app/assets/{jexl-C1l-HPYI.js → jexl-DEKgdIyE.js} +1 -1
- package/dist/app/assets/{jolie-CRI76P3X.js → jolie-QTrQutYN.js} +1 -1
- package/dist/app/assets/{journeyDiagram-VCZTEJTY-BOongVs3.js → journeyDiagram-VCZTEJTY-DMIzXS62.js} +1 -1
- package/dist/app/assets/{jq-CrFpn7ql.js → jq-HVEhlQfN.js} +1 -1
- package/dist/app/assets/{js-extras-BvLZUIJ5.js → js-extras-NGcAmwqF.js} +1 -1
- package/dist/app/assets/{js-templates-fYKII4Os.js → js-templates-BdbvU5YD.js} +1 -1
- package/dist/app/assets/{jsdoc-DGONDzA5.js → jsdoc-D98n9NCT.js} +1 -1
- package/dist/app/assets/{json-BxIxewuG.js → json-1D-NO0VF.js} +1 -1
- package/dist/app/assets/{json5-BP9OBqRe.js → json5-Dh1CdNvD.js} +1 -1
- package/dist/app/assets/{jsonp-Br67zaRL.js → jsonp-BtDJZ2Mb.js} +1 -1
- package/dist/app/assets/{jsstacktrace-BB-1Bcpa.js → jsstacktrace-DkE3SZv7.js} +1 -1
- package/dist/app/assets/{jsx-BNfIlN8n.js → jsx-BT58cyQW.js} +1 -1
- package/dist/app/assets/{julia-DVIi4XSJ.js → julia-D3Js5Hgq.js} +1 -1
- package/dist/app/assets/{kanban-definition-6JOO6SKY-DD7E-Llo.js → kanban-definition-6JOO6SKY-BcNXZ6Vr.js} +1 -1
- package/dist/app/assets/{keepalived-DmPJ3LF8.js → keepalived-C6I_Mg7r.js} +1 -1
- package/dist/app/assets/{keyman-Cp-gCfcq.js → keyman-D79f0cKj.js} +1 -1
- package/dist/app/assets/{kotlin-DCptm4kq.js → kotlin-no80mpWM.js} +1 -1
- package/dist/app/assets/{kumir-Cohjvjog.js → kumir-CUsULg8c.js} +1 -1
- package/dist/app/assets/{kusto-C2dOIgK1.js → kusto-C89Mk7tC.js} +1 -1
- package/dist/app/assets/{latex-DaFCffTw.js → latex-B1GrtcXz.js} +1 -1
- package/dist/app/assets/{latte-D2mtlTen.js → latte-DKsxQqtd.js} +1 -1
- package/dist/app/assets/{layout-C7fpWjpB.js → layout-FP0BP6AJ.js} +1 -1
- package/dist/app/assets/{less-CycfawGH.js → less-Ck3CCze6.js} +1 -1
- package/dist/app/assets/{lilypond-DrvS8AAl.js → lilypond-Dvcoj5IH.js} +1 -1
- package/dist/app/assets/{linear-2np4qyjJ.js → linear-0F3ksWhc.js} +1 -1
- package/dist/app/assets/{liquid-BQH0bAHC.js → liquid-Dtelxs9T.js} +1 -1
- package/dist/app/assets/{lisp-BCWvn2A1.js → lisp-CN9bAHD6.js} +1 -1
- package/dist/app/assets/{livescript-DGRf3L1-.js → livescript-_a8eCHSn.js} +1 -1
- package/dist/app/assets/{llvm-C_6xvGBO.js → llvm-BcDhUOfQ.js} +1 -1
- package/dist/app/assets/{log-uCcZN8k2.js → log-DEmQzTVt.js} +1 -1
- package/dist/app/assets/{lolcode-XEyTNgnB.js → lolcode-Cbxd_Lat.js} +1 -1
- package/dist/app/assets/{lua-Dy0fpGeF.js → lua-C7PRqwyU.js} +1 -1
- package/dist/app/assets/{magma-D6d2r_W9.js → magma-DYhSc7gy.js} +1 -1
- package/dist/app/assets/{makefile-DOydYPAQ.js → makefile-CIYTyv-_.js} +1 -1
- package/dist/app/assets/{markdown-CPxRHFza.js → markdown-CUW8Bmu0.js} +1 -1
- package/dist/app/assets/{markup-jgYp2Lb8.js → markup-DqCt2Fw1.js} +1 -1
- package/dist/app/assets/{markup-templating-lT8EutTe.js → markup-templating-Dkhpub0K.js} +1 -1
- package/dist/app/assets/{matlab-y_OOgSc_.js → matlab-CLdOvMwl.js} +1 -1
- package/dist/app/assets/{maxscript-PMli6_xE.js → maxscript-C-ai6J5K.js} +1 -1
- package/dist/app/assets/{mel-CIopQCOU.js → mel-BkZHjRGV.js} +1 -1
- package/dist/app/assets/{mermaid-CN6aoo9D.js → mermaid-BvP_XD9I.js} +1 -1
- package/dist/app/assets/{min-DDl12nhy.js → min-DDsiHe4M.js} +1 -1
- package/dist/app/assets/{mindmap-definition-QFDTVHPH-Bosd0mf9.js → mindmap-definition-QFDTVHPH-DDcs253m.js} +1 -1
- package/dist/app/assets/{mizar-A9B8KORd.js → mizar-CqM7QHDl.js} +1 -1
- package/dist/app/assets/{mongodb-DV-yCsoK.js → mongodb-KIcxFPEF.js} +1 -1
- package/dist/app/assets/{monkey-HEFodtZa.js → monkey-BQRy0JSe.js} +1 -1
- package/dist/app/assets/{moonscript-Bj3xAxEV.js → moonscript-BuA2Ki-R.js} +1 -1
- package/dist/app/assets/{n1ql-DX2KWloB.js → n1ql-DKlLH4ON.js} +1 -1
- package/dist/app/assets/{n4js-DQoNqDS9.js → n4js-DeW0Oyxu.js} +1 -1
- package/dist/app/assets/{nand2tetris-hdl-BFqj7ePK.js → nand2tetris-hdl-Dvb6ZB4S.js} +1 -1
- package/dist/app/assets/{naniscript-Cz--o1by.js → naniscript-C7b7oIUs.js} +1 -1
- package/dist/app/assets/{nasm-Dcb8t8q6.js → nasm-D3L2SzF4.js} +1 -1
- package/dist/app/assets/{neon-CK7vx6_x.js → neon-Cezgf87Z.js} +1 -1
- package/dist/app/assets/{nevod-BePMNPK5.js → nevod-jWaksWLJ.js} +1 -1
- package/dist/app/assets/{nginx-BmbGx2v1.js → nginx-OtlcHMqB.js} +1 -1
- package/dist/app/assets/{nim-B8GUCE2H.js → nim-CK5ozk2o.js} +1 -1
- package/dist/app/assets/{nix-lGZ9zLZy.js → nix-kew2nHCz.js} +1 -1
- package/dist/app/assets/{nsis-kBAOh3Cs.js → nsis-nR7oX-gB.js} +1 -1
- package/dist/app/assets/{objectivec-Bngj8IHt.js → objectivec-BMNOr9Tr.js} +1 -1
- package/dist/app/assets/{ocaml-Bba8eOIn.js → ocaml-BSvaKj3e.js} +1 -1
- package/dist/app/assets/{opencl-DgfdBrQ_.js → opencl-BMEmGl0_.js} +1 -1
- package/dist/app/assets/{openqasm-CQV2wxlC.js → openqasm-B374tvk5.js} +1 -1
- package/dist/app/assets/{oz-CcMDAMF8.js → oz-C3lpNl9d.js} +1 -1
- package/dist/app/assets/{parigp-Cr7bHjhJ.js → parigp-CgXf8xa2.js} +1 -1
- package/dist/app/assets/{parser-DX-CvQ44.js → parser-CcPMowgW.js} +1 -1
- package/dist/app/assets/{pascal-CCpiRTqn.js → pascal-BByqQTlw.js} +1 -1
- package/dist/app/assets/{pascaligo-uYvOwN6J.js → pascaligo-BbXiOknW.js} +1 -1
- package/dist/app/assets/{pcaxis-dCoAlH4q.js → pcaxis-Be47C9OK.js} +1 -1
- package/dist/app/assets/{peoplecode-BZU0iRIF.js → peoplecode-CxvjBVSh.js} +1 -1
- package/dist/app/assets/{perl-Iesy2DKz.js → perl-CtpqiEjU.js} +1 -1
- package/dist/app/assets/{php-a3Z68PaM.js → php-Dyamm2pr.js} +1 -1
- package/dist/app/assets/{php-extras-CSgWIoUx.js → php-extras-7Nx5rVLl.js} +1 -1
- package/dist/app/assets/{phpdoc-ClEamK9m.js → phpdoc-Bsjg7VKs.js} +1 -1
- package/dist/app/assets/{pieDiagram-DEJITSTG-D3AaN8D3.js → pieDiagram-DEJITSTG-BiXtBqki.js} +1 -1
- package/dist/app/assets/{plsql-BUydR2je.js → plsql-eZypyTGh.js} +1 -1
- package/dist/app/assets/{powerquery-CbE5r1LK.js → powerquery-Buf8bIo-.js} +1 -1
- package/dist/app/assets/{powershell-DubIcaqQ.js → powershell-K3XGDztR.js} +1 -1
- package/dist/app/assets/{processing-CGZk9MFa.js → processing-BhQB59Bp.js} +1 -1
- package/dist/app/assets/{prolog-DWiKE05T.js → prolog-BIyNttGM.js} +1 -1
- package/dist/app/assets/{promql-ZM0X0cVe.js → promql-DDITNP3r.js} +1 -1
- package/dist/app/assets/{properties-C_MgCVL7.js → properties-DJl0ewQ_.js} +1 -1
- package/dist/app/assets/{protobuf-DTptx08I.js → protobuf-CYx2y8Fr.js} +1 -1
- package/dist/app/assets/{psl-AUkZATpo.js → psl-B2mJawCU.js} +1 -1
- package/dist/app/assets/{pug-CiJR0sLM.js → pug-CYZsdEU7.js} +1 -1
- package/dist/app/assets/{puppet-DRojzo7w.js → puppet-CWwXOX6e.js} +1 -1
- package/dist/app/assets/{pure-DAC784GG.js → pure-B-Fff_Aq.js} +1 -1
- package/dist/app/assets/{purebasic-VM4UEIrk.js → purebasic-PfUC-hAA.js} +1 -1
- package/dist/app/assets/{purescript-w5sMhquf.js → purescript-CqqQFpaW.js} +1 -1
- package/dist/app/assets/{q-CBWya0ez.js → q-DR4346wr.js} +1 -1
- package/dist/app/assets/{qml-BO1SKCTG.js → qml-VgW_Ugpd.js} +1 -1
- package/dist/app/assets/{qore-BLEy3V2Q.js → qore-CHsGRbXU.js} +1 -1
- package/dist/app/assets/{qsharp-DpGm5nXm.js → qsharp-Du544C4-.js} +1 -1
- package/dist/app/assets/{quadrantDiagram-34T5L4WZ-zqVJRfM0.js → quadrantDiagram-34T5L4WZ-DDIHe9Cb.js} +1 -1
- package/dist/app/assets/{r-DJwW4woE.js → r-B2KuBHD-.js} +1 -1
- package/dist/app/assets/{racket-tfAlhm9J.js → racket-CgObu2Yj.js} +1 -1
- package/dist/app/assets/{reason-CuQcs6Us.js → reason-BdXTE0Xv.js} +1 -1
- package/dist/app/assets/{regex-BjBaDCpX.js → regex-BFecarun.js} +1 -1
- package/dist/app/assets/{rego-DWENKceX.js → rego-NdYgWh_R.js} +1 -1
- package/dist/app/assets/{renpy-BgVqATTk.js → renpy-B0jJSpyT.js} +1 -1
- package/dist/app/assets/{requirementDiagram-MS252O5E-B8E8SJly.js → requirementDiagram-MS252O5E-Bel4OeHd.js} +1 -1
- package/dist/app/assets/{rest-B9oIUmDJ.js → rest-BHKz74x2.js} +1 -1
- package/dist/app/assets/{rip-kd5zQPVz.js → rip-D8-iQw5t.js} +1 -1
- package/dist/app/assets/{roboconf-B1kUkQdY.js → roboconf-CuDVEUns.js} +1 -1
- package/dist/app/assets/{robotframework-B8Cn6zw0.js → robotframework-DPvo9dvH.js} +1 -1
- package/dist/app/assets/{ruby-CnbgIhf_.js → ruby-ahKLYmR2.js} +1 -1
- package/dist/app/assets/{rust-C8OTkz5t.js → rust-w2HNKEVP.js} +1 -1
- package/dist/app/assets/{sankeyDiagram-XADWPNL6-BWdy5fPK.js → sankeyDiagram-XADWPNL6-CPOJWDoW.js} +1 -1
- package/dist/app/assets/{sas-Dw7vQpkk.js → sas-BckZnWwO.js} +1 -1
- package/dist/app/assets/{sass-b7SoCESY.js → sass-K9vXz_J2.js} +1 -1
- package/dist/app/assets/{scala-D-p3rZbv.js → scala-D8UBcMe3.js} +1 -1
- package/dist/app/assets/{scheme-BPbr0IV_.js → scheme-EVCCBHHE.js} +1 -1
- package/dist/app/assets/{scss-Cyjt-V6Q.js → scss-lgF12twN.js} +1 -1
- package/dist/app/assets/{sequenceDiagram-FGHM5R23-D-ACA62M.js → sequenceDiagram-FGHM5R23-BEigv2pO.js} +1 -1
- package/dist/app/assets/{shell-session-C7s1XZ_p.js → shell-session-CEXGpqDh.js} +1 -1
- package/dist/app/assets/{smali-C621-SJz.js → smali-BjfU85md.js} +1 -1
- package/dist/app/assets/{smalltalk-CuF0kpcz.js → smalltalk-DNNjBzDr.js} +1 -1
- package/dist/app/assets/{smarty-CHbvlN7a.js → smarty-CE1m6psz.js} +1 -1
- package/dist/app/assets/{sml-BGi33Pu0.js → sml-B-M0aYoL.js} +1 -1
- package/dist/app/assets/{solidity-CZYdcu6z.js → solidity-JFHLRhmS.js} +1 -1
- package/dist/app/assets/{solution-file-ChgVI9u6.js → solution-file-yTsqnfhG.js} +1 -1
- package/dist/app/assets/{soy-CWvn9QzG.js → soy-wfqd3xGN.js} +1 -1
- package/dist/app/assets/{sparql-7JjN18LQ.js → sparql-CB9ciiIG.js} +1 -1
- package/dist/app/assets/{splunk-spl-DOh97vYU.js → splunk-spl-Bwe0aY_-.js} +1 -1
- package/dist/app/assets/{sqf-x5ivlIR7.js → sqf-BUIm45P2.js} +1 -1
- package/dist/app/assets/{sql-BshsXXbk.js → sql-BeX4Dc62.js} +1 -1
- package/dist/app/assets/{squirrel-BtrGPSbs.js → squirrel-BRuFeHvN.js} +1 -1
- package/dist/app/assets/{stan-sDuPYbZs.js → stan-CV1v9dBF.js} +1 -1
- package/dist/app/assets/{stateDiagram-FHFEXIEX-C06KYdye.js → stateDiagram-FHFEXIEX-e7LfE1cT.js} +1 -1
- package/dist/app/assets/stateDiagram-v2-QKLJ7IA2-Bu-3LFWP.js +1 -0
- package/dist/app/assets/{stylus-9qu1XZ91.js → stylus-BRS2xQmR.js} +1 -1
- package/dist/app/assets/{swift-UgAKrg8O.js → swift-BudLZRRW.js} +1 -1
- package/dist/app/assets/{systemd-D1t2IK6h.js → systemd-xKdHekwX.js} +1 -1
- package/dist/app/assets/{t4-cs-D5pPXmrn.js → t4-cs-Bj5P6V5L.js} +1 -1
- package/dist/app/assets/{t4-templating-DGpA7dEe.js → t4-templating-0G4ZNaN0.js} +1 -1
- package/dist/app/assets/{t4-vb-DeaFY-L7.js → t4-vb-CosfkjgV.js} +1 -1
- package/dist/app/assets/{tap-B2Jlbmzn.js → tap-DGsfsadn.js} +1 -1
- package/dist/app/assets/{tcl-D3Cxl9RS.js → tcl-DXAoE4yI.js} +1 -1
- package/dist/app/assets/{textile-vleyTozU.js → textile-CpnmYvQR.js} +1 -1
- package/dist/app/assets/{timeline-definition-GMOUNBTQ-DSaRfuOY.js → timeline-definition-GMOUNBTQ-pQ0DO6vU.js} +1 -1
- package/dist/app/assets/{toml-Qo-F6Xf4.js → toml-B_JOO1XI.js} +1 -1
- package/dist/app/assets/{tremor-J5ixbTSm.js → tremor-CxXXb0rX.js} +1 -1
- package/dist/app/assets/{tt2-DOa_Af-o.js → tt2-D4lJ_d_g.js} +1 -1
- package/dist/app/assets/{turtle-D8Su1Ry0.js → turtle-iwyAJJ6w.js} +1 -1
- package/dist/app/assets/{twig-GBJoDW8g.js → twig-BZQTv9el.js} +1 -1
- package/dist/app/assets/{typescript-DimFy1wk.js → typescript-CPKefurw.js} +1 -1
- package/dist/app/assets/{typoscript-Corm9VPj.js → typoscript-0qIU0uLG.js} +1 -1
- package/dist/app/assets/{unrealscript-dSS5kIDz.js → unrealscript-BcB60Vbj.js} +1 -1
- package/dist/app/assets/{uorazor-BGl4DTbK.js → uorazor-Dckkbt15.js} +1 -1
- package/dist/app/assets/{uri-B403JigU.js → uri-DE-7oKOJ.js} +1 -1
- package/dist/app/assets/{v-D1nzy8SK.js → v-DeTq4j-B.js} +1 -1
- package/dist/app/assets/{vala-CbskSA-6.js → vala-BTZNOPyG.js} +1 -1
- package/dist/app/assets/{vbnet-BQwFvsFF.js → vbnet-BGU0v6_8.js} +1 -1
- package/dist/app/assets/{velocity-dmmAE00U.js → velocity-B4q0vyZW.js} +1 -1
- package/dist/app/assets/{vennDiagram-DHZGUBPP-BZ7Hb9Hn.js → vennDiagram-DHZGUBPP-kshURHY6.js} +1 -1
- package/dist/app/assets/{verilog-BMPc4qiW.js → verilog-DEDp0IPd.js} +1 -1
- package/dist/app/assets/{vhdl-BwLIiaQ3.js → vhdl-DRwrjPNO.js} +1 -1
- package/dist/app/assets/{vim-NxGSno01.js → vim-CHsYXV0-.js} +1 -1
- package/dist/app/assets/{visual-basic-DT3do2iL.js → visual-basic-Bfqr7fu6.js} +1 -1
- package/dist/app/assets/{wardley-RL74JXVD-BQuDsmFg.js → wardley-RL74JXVD-DYR_esY-.js} +1 -1
- package/dist/app/assets/{wardleyDiagram-NUSXRM2D-DwMCEfDA.js → wardleyDiagram-NUSXRM2D-BafKr6Ss.js} +1 -1
- package/dist/app/assets/{warpscript-natO4zPn.js → warpscript-Div1HCjK.js} +1 -1
- package/dist/app/assets/{wasm-BfugFzDn.js → wasm-SeqvoPgO.js} +1 -1
- package/dist/app/assets/{web-idl-Bics_ax6.js → web-idl-kANtAVZr.js} +1 -1
- package/dist/app/assets/{wiki-Blq646qq.js → wiki-7yk2Wrx1.js} +1 -1
- package/dist/app/assets/{wolfram-Ddn6uV9M.js → wolfram-DAbqNGxJ.js} +1 -1
- package/dist/app/assets/{wren-CZ9gfbdr.js → wren-BINDN5Zg.js} +1 -1
- package/dist/app/assets/{xeora-zVJDHWYP.js → xeora-KdqYnXxI.js} +1 -1
- package/dist/app/assets/{xml-doc-D9g-q5Fh.js → xml-doc-DCjDWqVy.js} +1 -1
- package/dist/app/assets/{xojo-WpdjfLKR.js → xojo-aK43PrGs.js} +1 -1
- package/dist/app/assets/{xquery-DFrusbUY.js → xquery-BFNumVvw.js} +1 -1
- package/dist/app/assets/{xychartDiagram-5P7HB3ND-BRMmacnH.js → xychartDiagram-5P7HB3ND-DxOv7_VL.js} +1 -1
- package/dist/app/assets/{yaml-DB6og7ei.js → yaml-oBSf8mGr.js} +1 -1
- package/dist/app/assets/{yang-CdFoUEPj.js → yang-CSWns_1Z.js} +1 -1
- package/dist/app/assets/{zig-C79X6U04.js → zig-Dplgcvhw.js} +1 -1
- package/dist/app/index.html +2 -2
- package/dist/index.cjs +1192 -770
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1161 -740
- package/package.json +2 -2
- package/dist/app/assets/channel-B6zrZ2OM.js +0 -1
- package/dist/app/assets/classDiagram-6PBFFD2Q-CrRCjWNC.js +0 -1
- package/dist/app/assets/classDiagram-v2-HSJHXN6E-CrRCjWNC.js +0 -1
- package/dist/app/assets/clone-DF9MaeHz.js +0 -1
- package/dist/app/assets/index-D4gddvdJ.css +0 -1
- package/dist/app/assets/stateDiagram-v2-QKLJ7IA2-sEMQqWl2.js +0 -1
package/dist/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
// src/components/chat.tsx
|
|
2
|
-
import * as
|
|
2
|
+
import * as React46 from "react";
|
|
3
3
|
import {
|
|
4
4
|
ArrowDown as ArrowDown2,
|
|
5
|
-
FileText as
|
|
5
|
+
FileText as FileText4,
|
|
6
6
|
ImageIcon,
|
|
7
|
-
Loader2 as
|
|
7
|
+
Loader2 as Loader27,
|
|
8
|
+
Minus,
|
|
8
9
|
Pencil as Pencil4,
|
|
9
10
|
Quote,
|
|
10
11
|
RefreshCw as RefreshCw2,
|
|
@@ -1285,6 +1286,7 @@ var en_US_default = {
|
|
|
1285
1286
|
loadingThread: "Loading thread...",
|
|
1286
1287
|
stop: "Stop",
|
|
1287
1288
|
send: "Send message",
|
|
1289
|
+
minimizeToPet: "Minimize to pet",
|
|
1288
1290
|
referencedContentOnly: "Referenced content",
|
|
1289
1291
|
youLabel: "You",
|
|
1290
1292
|
scrollToBottom: "Scroll to bottom",
|
|
@@ -1506,6 +1508,12 @@ var en_US_default = {
|
|
|
1506
1508
|
loading: "Loading",
|
|
1507
1509
|
thinking: "Thinking",
|
|
1508
1510
|
answering: "Answering",
|
|
1511
|
+
contextCompression: {
|
|
1512
|
+
running: "Automatically compressing context",
|
|
1513
|
+
success: "Context automatically compressed",
|
|
1514
|
+
skipped: "Context not compressed",
|
|
1515
|
+
fail: "Context compression failed"
|
|
1516
|
+
},
|
|
1509
1517
|
requestUserInputResult: {
|
|
1510
1518
|
title: "Selections confirmed",
|
|
1511
1519
|
option: "Option",
|
|
@@ -1566,6 +1574,14 @@ var en_US_default = {
|
|
|
1566
1574
|
copy: "Copy",
|
|
1567
1575
|
copied: "Copied",
|
|
1568
1576
|
separator: ", ",
|
|
1577
|
+
shell: {
|
|
1578
|
+
success: "Success",
|
|
1579
|
+
running: "Running",
|
|
1580
|
+
failed: "Failed",
|
|
1581
|
+
exitCode: "Exit code {{code}}",
|
|
1582
|
+
ranCommand: "Ran {{command}}",
|
|
1583
|
+
runningCommand: "Running {{command}}"
|
|
1584
|
+
},
|
|
1569
1585
|
categories: {
|
|
1570
1586
|
files: {
|
|
1571
1587
|
one: "{{count}} file",
|
|
@@ -1617,6 +1633,7 @@ var zh_CN_default = {
|
|
|
1617
1633
|
loadingThread: "\u6B63\u5728\u52A0\u8F7D\u7EBF\u7A0B...",
|
|
1618
1634
|
stop: "\u505C\u6B62",
|
|
1619
1635
|
send: "\u53D1\u9001\u6D88\u606F",
|
|
1636
|
+
minimizeToPet: "\u6700\u5C0F\u5316\u5230 Pet",
|
|
1620
1637
|
referencedContentOnly: "\u5DF2\u5F15\u7528\u5185\u5BB9",
|
|
1621
1638
|
youLabel: "\u4F60",
|
|
1622
1639
|
scrollToBottom: "\u56DE\u5230\u5E95\u90E8",
|
|
@@ -1838,6 +1855,12 @@ var zh_CN_default = {
|
|
|
1838
1855
|
loading: "\u6B63\u5728\u52A0\u8F7D",
|
|
1839
1856
|
thinking: "\u6B63\u5728\u601D\u8003",
|
|
1840
1857
|
answering: "\u6B63\u5728\u751F\u6210",
|
|
1858
|
+
contextCompression: {
|
|
1859
|
+
running: "\u6B63\u5728\u81EA\u52A8\u538B\u7F29\u4E0A\u4E0B\u6587",
|
|
1860
|
+
success: "\u4E0A\u4E0B\u6587\u5DF2\u81EA\u52A8\u538B\u7F29",
|
|
1861
|
+
skipped: "\u4E0A\u4E0B\u6587\u65E0\u9700\u538B\u7F29",
|
|
1862
|
+
fail: "\u4E0A\u4E0B\u6587\u538B\u7F29\u5931\u8D25"
|
|
1863
|
+
},
|
|
1841
1864
|
requestUserInputResult: {
|
|
1842
1865
|
title: "\u5DF2\u786E\u8BA4\u9009\u62E9",
|
|
1843
1866
|
option: "\u9009\u9879",
|
|
@@ -1898,6 +1921,14 @@ var zh_CN_default = {
|
|
|
1898
1921
|
copy: "\u590D\u5236",
|
|
1899
1922
|
copied: "\u5DF2\u590D\u5236",
|
|
1900
1923
|
separator: "\uFF0C",
|
|
1924
|
+
shell: {
|
|
1925
|
+
success: "\u6210\u529F",
|
|
1926
|
+
running: "\u8FD0\u884C\u4E2D",
|
|
1927
|
+
failed: "\u5931\u8D25",
|
|
1928
|
+
exitCode: "\u9000\u51FA\u7801 {{code}}",
|
|
1929
|
+
ranCommand: "\u5DF2\u8FD0\u884C {{command}}",
|
|
1930
|
+
runningCommand: "\u6B63\u5728\u8FD0\u884C {{command}}"
|
|
1931
|
+
},
|
|
1901
1932
|
categories: {
|
|
1902
1933
|
files: {
|
|
1903
1934
|
one: "{{count}} \u4E2A\u6587\u4EF6",
|
|
@@ -6820,12 +6851,8 @@ function useSlashCommands({
|
|
|
6820
6851
|
}
|
|
6821
6852
|
|
|
6822
6853
|
// src/components/thread/messages/ai.tsx
|
|
6823
|
-
import * as
|
|
6824
|
-
import {
|
|
6825
|
-
ChevronDown as ChevronDown4,
|
|
6826
|
-
Clock3 as Clock32,
|
|
6827
|
-
Loader2 as Loader25
|
|
6828
|
-
} from "lucide-react";
|
|
6854
|
+
import * as React33 from "react";
|
|
6855
|
+
import { ChevronDown as ChevronDown4, Clock3 as Clock32, Loader2 as Loader26 } from "lucide-react";
|
|
6829
6856
|
|
|
6830
6857
|
// src/lib/agent-run-render-tree.ts
|
|
6831
6858
|
function isTextContent(content) {
|
|
@@ -8598,57 +8625,116 @@ function AgentRunGroup({
|
|
|
8598
8625
|
] });
|
|
8599
8626
|
}
|
|
8600
8627
|
|
|
8601
|
-
// src/
|
|
8602
|
-
|
|
8603
|
-
|
|
8604
|
-
|
|
8605
|
-
|
|
8606
|
-
|
|
8607
|
-
|
|
8608
|
-
|
|
8609
|
-
|
|
8610
|
-
|
|
8611
|
-
|
|
8612
|
-
|
|
8613
|
-
|
|
8614
|
-
|
|
8615
|
-
|
|
8616
|
-
|
|
8617
|
-
|
|
8618
|
-
|
|
8619
|
-
|
|
8620
|
-
|
|
8621
|
-
|
|
8622
|
-
"
|
|
8623
|
-
|
|
8624
|
-
|
|
8625
|
-
|
|
8626
|
-
|
|
8627
|
-
"
|
|
8628
|
-
|
|
8629
|
-
|
|
8630
|
-
|
|
8631
|
-
"zh-Hans",
|
|
8632
|
-
"zh_CN",
|
|
8633
|
-
"zh-CN",
|
|
8634
|
-
"zh"
|
|
8635
|
-
];
|
|
8636
|
-
for (const key of preferredKeys) {
|
|
8637
|
-
const candidate = localized[key];
|
|
8638
|
-
if (typeof candidate === "string" && candidate.trim()) {
|
|
8639
|
-
return candidate.trim();
|
|
8640
|
-
}
|
|
8628
|
+
// src/components/thread/messages/context-compression-message.tsx
|
|
8629
|
+
import "react";
|
|
8630
|
+
import {
|
|
8631
|
+
resolveLocalizedText
|
|
8632
|
+
} from "@xpert-ai/chatkit-types";
|
|
8633
|
+
import { FileText as FileText2, Loader2 as Loader24, XCircle as XCircle2 } from "lucide-react";
|
|
8634
|
+
import { jsx as jsx32, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
8635
|
+
var CONTEXT_COMPRESSION_COMPONENT_TYPE = "context-compression";
|
|
8636
|
+
function isContextCompressionComponent(content) {
|
|
8637
|
+
return content.data.category === "Tool" && content.data.type === CONTEXT_COMPRESSION_COMPONENT_TYPE;
|
|
8638
|
+
}
|
|
8639
|
+
function isSkipped(reason) {
|
|
8640
|
+
return reason === "no_messages" || reason === "no_unprotected_history" || reason === "no_token_gain";
|
|
8641
|
+
}
|
|
8642
|
+
function ContextCompressionLabel({
|
|
8643
|
+
data
|
|
8644
|
+
}) {
|
|
8645
|
+
const { t } = useChatkitTranslation();
|
|
8646
|
+
const status = data.status ?? "running";
|
|
8647
|
+
const skipped = isSkipped(data.reason);
|
|
8648
|
+
if (skipped) {
|
|
8649
|
+
return t("message.contextCompression.skipped");
|
|
8650
|
+
}
|
|
8651
|
+
switch (status) {
|
|
8652
|
+
case "success":
|
|
8653
|
+
return t("message.contextCompression.success");
|
|
8654
|
+
case "fail":
|
|
8655
|
+
return t("message.contextCompression.fail");
|
|
8656
|
+
default:
|
|
8657
|
+
return t("message.contextCompression.running");
|
|
8641
8658
|
}
|
|
8642
|
-
|
|
8643
|
-
|
|
8644
|
-
|
|
8645
|
-
|
|
8659
|
+
}
|
|
8660
|
+
function ContextCompressionIcon({
|
|
8661
|
+
data
|
|
8662
|
+
}) {
|
|
8663
|
+
const status = data.status ?? "running";
|
|
8664
|
+
const skipped = isSkipped(data.reason);
|
|
8665
|
+
if (status === "running") {
|
|
8666
|
+
return /* @__PURE__ */ jsx32(Loader24, { "aria-hidden": "true", className: "h-4 w-4 shrink-0 animate-spin" });
|
|
8646
8667
|
}
|
|
8647
|
-
|
|
8668
|
+
if (status === "fail") {
|
|
8669
|
+
return /* @__PURE__ */ jsx32(XCircle2, { "aria-hidden": "true", className: "h-4 w-4 shrink-0" });
|
|
8670
|
+
}
|
|
8671
|
+
return /* @__PURE__ */ jsx32(
|
|
8672
|
+
FileText2,
|
|
8673
|
+
{
|
|
8674
|
+
"aria-hidden": "true",
|
|
8675
|
+
className: cn("h-4 w-4 shrink-0", skipped && "opacity-80")
|
|
8676
|
+
}
|
|
8677
|
+
);
|
|
8678
|
+
}
|
|
8679
|
+
function getTooltipText(data, language) {
|
|
8680
|
+
return resolveLocalizedText(
|
|
8681
|
+
data.summary || data.error || data.message,
|
|
8682
|
+
language
|
|
8683
|
+
);
|
|
8684
|
+
}
|
|
8685
|
+
function ContextCompressionMessage({
|
|
8686
|
+
content
|
|
8687
|
+
}) {
|
|
8688
|
+
const { i18n: i18n2 } = useChatkitTranslation();
|
|
8689
|
+
const data = content.data;
|
|
8690
|
+
const status = data.status ?? "running";
|
|
8691
|
+
const tooltipText = getTooltipText(data, i18n2.language);
|
|
8692
|
+
const label = /* @__PURE__ */ jsx32(ContextCompressionLabel, { data });
|
|
8693
|
+
const center = /* @__PURE__ */ jsxs20(
|
|
8694
|
+
"div",
|
|
8695
|
+
{
|
|
8696
|
+
className: cn(
|
|
8697
|
+
"inline-flex max-w-[80%] shrink-0 items-center gap-1.5 rounded-md px-2 py-1 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",
|
|
8698
|
+
tooltipText && "cursor-help",
|
|
8699
|
+
status === "fail" && "text-destructive hover:text-destructive"
|
|
8700
|
+
),
|
|
8701
|
+
children: [
|
|
8702
|
+
/* @__PURE__ */ jsx32(ContextCompressionIcon, { data }),
|
|
8703
|
+
/* @__PURE__ */ jsx32(
|
|
8704
|
+
"span",
|
|
8705
|
+
{
|
|
8706
|
+
className: cn(
|
|
8707
|
+
"truncate",
|
|
8708
|
+
status === "running" && "ck-tool-call-running-text"
|
|
8709
|
+
),
|
|
8710
|
+
children: label
|
|
8711
|
+
}
|
|
8712
|
+
)
|
|
8713
|
+
]
|
|
8714
|
+
}
|
|
8715
|
+
);
|
|
8716
|
+
return /* @__PURE__ */ jsxs20("div", { className: "flex w-full items-center justify-center gap-3 py-6", children: [
|
|
8717
|
+
/* @__PURE__ */ jsx32("div", { className: "h-px min-w-8 flex-1 bg-border" }),
|
|
8718
|
+
tooltipText ? /* @__PURE__ */ jsxs20(Tooltip, { children: [
|
|
8719
|
+
/* @__PURE__ */ jsx32(TooltipTrigger, { asChild: true, children: center }),
|
|
8720
|
+
/* @__PURE__ */ jsx32(
|
|
8721
|
+
TooltipContent,
|
|
8722
|
+
{
|
|
8723
|
+
side: "top",
|
|
8724
|
+
className: "max-h-80 max-w-xl overflow-auto whitespace-pre-wrap text-left text-xs leading-5",
|
|
8725
|
+
children: tooltipText
|
|
8726
|
+
}
|
|
8727
|
+
)
|
|
8728
|
+
] }) : center,
|
|
8729
|
+
/* @__PURE__ */ jsx32("div", { className: "h-px min-w-8 flex-1 bg-border" })
|
|
8730
|
+
] });
|
|
8648
8731
|
}
|
|
8649
8732
|
|
|
8733
|
+
// src/i18n/localized-text.ts
|
|
8734
|
+
import { resolveLocalizedText as resolveLocalizedText2 } from "@xpert-ai/chatkit-types";
|
|
8735
|
+
|
|
8650
8736
|
// src/components/thread/messages/knowledge-retriever-component-renderer.tsx
|
|
8651
|
-
import { jsx as
|
|
8737
|
+
import { jsx as jsx33, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
8652
8738
|
var KNOWLEDGE_RETRIEVER_TITLE = "Knowledge Retriever";
|
|
8653
8739
|
var KNOWLEDGE_METADATA_SKIP_KEYS = /* @__PURE__ */ new Set([
|
|
8654
8740
|
"assets",
|
|
@@ -8759,7 +8845,7 @@ function getRetrieverQuery(data, language) {
|
|
|
8759
8845
|
if (isRecord2(input)) {
|
|
8760
8846
|
return readString(input.query) ?? readString(input.input) ?? readString(input.question);
|
|
8761
8847
|
}
|
|
8762
|
-
return readString(
|
|
8848
|
+
return readString(resolveLocalizedText2(data.message, language)) ?? readString(input);
|
|
8763
8849
|
}
|
|
8764
8850
|
function hasKnowledgeRetrieverDetails(_content, data) {
|
|
8765
8851
|
return isKnowledgeRetrieverComponent(_content, data);
|
|
@@ -8771,23 +8857,23 @@ function KnowledgeRawDataBlock({ value }) {
|
|
|
8771
8857
|
const { t } = useChatkitTranslation();
|
|
8772
8858
|
const detected = detectJsonValue(value);
|
|
8773
8859
|
if (detected.kind === "text") {
|
|
8774
|
-
return /* @__PURE__ */
|
|
8860
|
+
return /* @__PURE__ */ jsx33(PlainTextBlock, { value: detected.text });
|
|
8775
8861
|
}
|
|
8776
|
-
return /* @__PURE__ */
|
|
8777
|
-
/* @__PURE__ */
|
|
8778
|
-
/* @__PURE__ */
|
|
8862
|
+
return /* @__PURE__ */ jsxs21(Tabs, { defaultValue: "tree", className: "min-w-0", children: [
|
|
8863
|
+
/* @__PURE__ */ jsxs21("div", { className: "mb-2 flex min-w-0 items-center justify-between gap-2", children: [
|
|
8864
|
+
/* @__PURE__ */ jsxs21("span", { className: "min-w-0 truncate text-[11px] text-muted-foreground", children: [
|
|
8779
8865
|
t("message.toolGroup.jsonTitle"),
|
|
8780
8866
|
" \xB7",
|
|
8781
8867
|
" ",
|
|
8782
8868
|
getJsonValueSummary(detected.value)
|
|
8783
8869
|
] }),
|
|
8784
|
-
/* @__PURE__ */
|
|
8785
|
-
/* @__PURE__ */
|
|
8786
|
-
/* @__PURE__ */
|
|
8870
|
+
/* @__PURE__ */ jsxs21(TabsList, { className: "rounded-md p-0.5", children: [
|
|
8871
|
+
/* @__PURE__ */ jsx33(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "tree", children: t("message.toolGroup.jsonTree") }),
|
|
8872
|
+
/* @__PURE__ */ jsx33(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "raw", children: t("message.toolGroup.jsonRaw") })
|
|
8787
8873
|
] })
|
|
8788
8874
|
] }),
|
|
8789
|
-
/* @__PURE__ */
|
|
8790
|
-
/* @__PURE__ */
|
|
8875
|
+
/* @__PURE__ */ jsx33(TabsContent, { value: "tree", className: "mt-0", children: /* @__PURE__ */ jsx33(JsonTreeView, { value: detected.value }) }),
|
|
8876
|
+
/* @__PURE__ */ jsx33(TabsContent, { value: "raw", className: "mt-0", children: /* @__PURE__ */ jsx33(RawJsonBlock, { raw: detected.raw }) })
|
|
8791
8877
|
] });
|
|
8792
8878
|
}
|
|
8793
8879
|
function KnowledgeRetrieverDetails({
|
|
@@ -8800,16 +8886,16 @@ function KnowledgeRetrieverDetails({
|
|
|
8800
8886
|
const hasArrayData = Array.isArray(data.data);
|
|
8801
8887
|
const hasRawFallback = rawData !== null && rawData !== void 0 && (!hasArrayData || Array.isArray(data.data) && data.data.length > 0 && results.length === 0);
|
|
8802
8888
|
const showEmptyState = results.length === 0 && !hasRawFallback && data.status !== "running";
|
|
8803
|
-
return /* @__PURE__ */
|
|
8804
|
-
query ? /* @__PURE__ */
|
|
8805
|
-
/* @__PURE__ */
|
|
8806
|
-
/* @__PURE__ */
|
|
8889
|
+
return /* @__PURE__ */ jsxs21("div", { className: "min-w-0 space-y-3 px-3 py-2", children: [
|
|
8890
|
+
query ? /* @__PURE__ */ jsxs21("div", { className: "min-w-0 space-y-1", children: [
|
|
8891
|
+
/* @__PURE__ */ jsx33("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.knowledgeRetriever.queryTitle") }),
|
|
8892
|
+
/* @__PURE__ */ jsx33("div", { className: "min-w-0 whitespace-pre-wrap wrap-break-word rounded-md bg-muted/40 px-3 py-2 font-mono text-[12px] leading-5 text-foreground/80", children: query })
|
|
8807
8893
|
] }) : null,
|
|
8808
|
-
results.length > 0 ? /* @__PURE__ */
|
|
8809
|
-
/* @__PURE__ */
|
|
8894
|
+
results.length > 0 ? /* @__PURE__ */ jsxs21("div", { className: "min-w-0 space-y-2", children: [
|
|
8895
|
+
/* @__PURE__ */ jsx33("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.knowledgeRetriever.resultsTitle", {
|
|
8810
8896
|
count: results.length
|
|
8811
8897
|
}) }),
|
|
8812
|
-
/* @__PURE__ */
|
|
8898
|
+
/* @__PURE__ */ jsx33("div", { className: "space-y-2", children: results.map((result, index) => /* @__PURE__ */ jsx33(
|
|
8813
8899
|
KnowledgeResultCard,
|
|
8814
8900
|
{
|
|
8815
8901
|
result,
|
|
@@ -8818,11 +8904,11 @@ function KnowledgeRetrieverDetails({
|
|
|
8818
8904
|
result.id ?? `${result.title}-${index}`
|
|
8819
8905
|
)) })
|
|
8820
8906
|
] }) : null,
|
|
8821
|
-
hasRawFallback ? /* @__PURE__ */
|
|
8822
|
-
/* @__PURE__ */
|
|
8823
|
-
/* @__PURE__ */
|
|
8907
|
+
hasRawFallback ? /* @__PURE__ */ jsxs21("div", { className: "min-w-0 space-y-1", children: [
|
|
8908
|
+
/* @__PURE__ */ jsx33("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.knowledgeRetriever.rawDataTitle") }),
|
|
8909
|
+
/* @__PURE__ */ jsx33(KnowledgeRawDataBlock, { value: rawData })
|
|
8824
8910
|
] }) : null,
|
|
8825
|
-
showEmptyState ? /* @__PURE__ */
|
|
8911
|
+
showEmptyState ? /* @__PURE__ */ jsx33("div", { className: "rounded-md border border-dashed border-border/70 px-3 py-4 text-center text-xs text-muted-foreground", children: t("message.knowledgeRetriever.noResults") }) : null
|
|
8826
8912
|
] });
|
|
8827
8913
|
}
|
|
8828
8914
|
function KnowledgeResultCard({
|
|
@@ -8841,10 +8927,10 @@ function KnowledgeResultCard({
|
|
|
8841
8927
|
...result.metadata
|
|
8842
8928
|
];
|
|
8843
8929
|
const titleClassName = "min-w-0 line-clamp-2 text-sm font-medium leading-5 text-foreground";
|
|
8844
|
-
return /* @__PURE__ */
|
|
8845
|
-
/* @__PURE__ */
|
|
8846
|
-
/* @__PURE__ */
|
|
8847
|
-
result.url ? /* @__PURE__ */
|
|
8930
|
+
return /* @__PURE__ */ jsx33("article", { className: "min-w-0 rounded-md border border-border/60 bg-background/80 px-3 py-2", children: /* @__PURE__ */ jsxs21("div", { className: "flex min-w-0 items-start gap-2", children: [
|
|
8931
|
+
/* @__PURE__ */ jsx33("span", { className: "mt-0.5 inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-muted text-[11px] font-medium text-muted-foreground", children: index + 1 }),
|
|
8932
|
+
/* @__PURE__ */ jsxs21("div", { className: "min-w-0 flex-1", children: [
|
|
8933
|
+
result.url ? /* @__PURE__ */ jsxs21(
|
|
8848
8934
|
"a",
|
|
8849
8935
|
{
|
|
8850
8936
|
id: titleId,
|
|
@@ -8854,37 +8940,37 @@ function KnowledgeResultCard({
|
|
|
8854
8940
|
className: cn(titleClassName, "hover:underline"),
|
|
8855
8941
|
children: [
|
|
8856
8942
|
result.title,
|
|
8857
|
-
result.lineRange ? /* @__PURE__ */
|
|
8943
|
+
result.lineRange ? /* @__PURE__ */ jsxs21("span", { className: "ml-1 text-muted-foreground", children: [
|
|
8858
8944
|
"[",
|
|
8859
8945
|
result.lineRange,
|
|
8860
8946
|
"]"
|
|
8861
8947
|
] }) : null
|
|
8862
8948
|
]
|
|
8863
8949
|
}
|
|
8864
|
-
) : /* @__PURE__ */
|
|
8950
|
+
) : /* @__PURE__ */ jsxs21("div", { id: titleId, className: titleClassName, children: [
|
|
8865
8951
|
result.title,
|
|
8866
|
-
result.lineRange ? /* @__PURE__ */
|
|
8952
|
+
result.lineRange ? /* @__PURE__ */ jsxs21("span", { className: "ml-1 text-muted-foreground", children: [
|
|
8867
8953
|
"[",
|
|
8868
8954
|
result.lineRange,
|
|
8869
8955
|
"]"
|
|
8870
8956
|
] }) : null
|
|
8871
8957
|
] }),
|
|
8872
|
-
result.content ? /* @__PURE__ */
|
|
8873
|
-
metadata.length > 0 ? /* @__PURE__ */
|
|
8958
|
+
result.content ? /* @__PURE__ */ jsx33("p", { className: "mt-1 line-clamp-3 whitespace-pre-wrap text-xs leading-5 text-muted-foreground", children: result.content }) : null,
|
|
8959
|
+
metadata.length > 0 ? /* @__PURE__ */ jsx33(
|
|
8874
8960
|
"div",
|
|
8875
8961
|
{
|
|
8876
8962
|
className: "mt-2 flex flex-wrap gap-1.5",
|
|
8877
8963
|
"aria-labelledby": titleId,
|
|
8878
|
-
children: metadata.slice(0, 10).map((item) => /* @__PURE__ */
|
|
8964
|
+
children: metadata.slice(0, 10).map((item) => /* @__PURE__ */ jsxs21(
|
|
8879
8965
|
"span",
|
|
8880
8966
|
{
|
|
8881
8967
|
className: "inline-flex min-w-0 max-w-full items-center gap-1 rounded-md bg-muted/50 px-1.5 py-0.5 text-[11px] leading-4 text-muted-foreground",
|
|
8882
8968
|
children: [
|
|
8883
|
-
/* @__PURE__ */
|
|
8969
|
+
/* @__PURE__ */ jsxs21("span", { className: "shrink-0 font-medium text-foreground/70", children: [
|
|
8884
8970
|
item.key,
|
|
8885
8971
|
":"
|
|
8886
8972
|
] }),
|
|
8887
|
-
/* @__PURE__ */
|
|
8973
|
+
/* @__PURE__ */ jsx33("span", { className: "min-w-0 truncate font-mono", children: item.value })
|
|
8888
8974
|
]
|
|
8889
8975
|
},
|
|
8890
8976
|
`${item.key}:${item.value}`
|
|
@@ -8896,7 +8982,7 @@ function KnowledgeResultCard({
|
|
|
8896
8982
|
}
|
|
8897
8983
|
|
|
8898
8984
|
// src/components/thread/messages/web-search-component-renderer.tsx
|
|
8899
|
-
import { jsx as
|
|
8985
|
+
import { jsx as jsx34, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
8900
8986
|
var webSearchComponentRenderer = {
|
|
8901
8987
|
id: "computer-web-search-sources",
|
|
8902
8988
|
presentation: "grouped-step",
|
|
@@ -8966,9 +9052,9 @@ function WebSearchToolCallOutput({
|
|
|
8966
9052
|
const { t } = useChatkitTranslation();
|
|
8967
9053
|
const sources = getWebSearchSources(data);
|
|
8968
9054
|
if (sources.length === 0 || data.error !== void 0) return null;
|
|
8969
|
-
return /* @__PURE__ */
|
|
8970
|
-
/* @__PURE__ */
|
|
8971
|
-
/* @__PURE__ */
|
|
9055
|
+
return /* @__PURE__ */ jsxs22("div", { className: "space-y-2", children: [
|
|
9056
|
+
/* @__PURE__ */ jsx34("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.toolGroup.sourcesTitle") }),
|
|
9057
|
+
/* @__PURE__ */ jsx34("div", { className: "space-y-2", children: sources.map((source, index) => {
|
|
8972
9058
|
const sourceHost = getSourceHost(source.url);
|
|
8973
9059
|
const snippet = source.content ?? source.description;
|
|
8974
9060
|
const metaParts = [
|
|
@@ -8976,13 +9062,13 @@ function WebSearchToolCallOutput({
|
|
|
8976
9062
|
source.publishedDate,
|
|
8977
9063
|
source.author
|
|
8978
9064
|
].filter((item) => Boolean(item));
|
|
8979
|
-
return /* @__PURE__ */
|
|
9065
|
+
return /* @__PURE__ */ jsxs22(
|
|
8980
9066
|
"div",
|
|
8981
9067
|
{
|
|
8982
9068
|
className: "min-w-0 rounded-md border border-border/60 bg-background/80 px-3 py-2",
|
|
8983
9069
|
children: [
|
|
8984
|
-
metaParts.length > 0 ? /* @__PURE__ */
|
|
8985
|
-
/* @__PURE__ */
|
|
9070
|
+
metaParts.length > 0 ? /* @__PURE__ */ jsx34("div", { className: "mb-1 truncate text-[11px] text-muted-foreground", children: metaParts.join(" / ") }) : null,
|
|
9071
|
+
/* @__PURE__ */ jsx34(
|
|
8986
9072
|
"a",
|
|
8987
9073
|
{
|
|
8988
9074
|
href: source.url,
|
|
@@ -8992,7 +9078,7 @@ function WebSearchToolCallOutput({
|
|
|
8992
9078
|
children: source.title
|
|
8993
9079
|
}
|
|
8994
9080
|
),
|
|
8995
|
-
snippet ? /* @__PURE__ */
|
|
9081
|
+
snippet ? /* @__PURE__ */ jsx34("p", { className: "mt-1 line-clamp-3 text-xs leading-5 text-muted-foreground", children: snippet }) : null
|
|
8996
9082
|
]
|
|
8997
9083
|
},
|
|
8998
9084
|
`${source.url}-${index}`
|
|
@@ -9003,6 +9089,12 @@ function WebSearchToolCallOutput({
|
|
|
9003
9089
|
|
|
9004
9090
|
// src/components/thread/messages/component-message-renderers.tsx
|
|
9005
9091
|
var COMPONENT_MESSAGE_RENDERERS = [
|
|
9092
|
+
{
|
|
9093
|
+
id: "context-compression",
|
|
9094
|
+
presentation: "standalone",
|
|
9095
|
+
match: (content) => isContextCompressionComponent(content),
|
|
9096
|
+
hasDetails: () => false
|
|
9097
|
+
},
|
|
9006
9098
|
knowledgeRetrieverComponentRenderer,
|
|
9007
9099
|
webSearchComponentRenderer
|
|
9008
9100
|
];
|
|
@@ -9020,28 +9112,269 @@ function hasComponentMessageRendererDetails(renderer, content, data) {
|
|
|
9020
9112
|
}
|
|
9021
9113
|
|
|
9022
9114
|
// src/components/thread/messages/tool-component-group.tsx
|
|
9023
|
-
import * as
|
|
9115
|
+
import * as React31 from "react";
|
|
9024
9116
|
import {
|
|
9025
9117
|
BookOpen,
|
|
9026
9118
|
Brain as Brain3,
|
|
9027
9119
|
Building2,
|
|
9028
|
-
Check as
|
|
9120
|
+
Check as Check4,
|
|
9029
9121
|
CheckCircle2 as CheckCircle23,
|
|
9030
9122
|
ChevronRight as ChevronRight7,
|
|
9031
9123
|
CircleHelp,
|
|
9032
|
-
Copy,
|
|
9033
|
-
FileText as
|
|
9124
|
+
Copy as Copy2,
|
|
9125
|
+
FileText as FileText3,
|
|
9034
9126
|
Files,
|
|
9035
|
-
Loader2 as
|
|
9127
|
+
Loader2 as Loader25,
|
|
9036
9128
|
ListTodo as ListTodo2,
|
|
9037
9129
|
Network,
|
|
9038
9130
|
Repeat2,
|
|
9039
9131
|
Search as Search2,
|
|
9040
9132
|
SquareTerminal,
|
|
9041
9133
|
Wrench as Wrench2,
|
|
9042
|
-
XCircle as
|
|
9134
|
+
XCircle as XCircle3
|
|
9043
9135
|
} from "lucide-react";
|
|
9044
|
-
|
|
9136
|
+
|
|
9137
|
+
// src/components/thread/messages/sandbox-shell-tool-call.tsx
|
|
9138
|
+
import * as React30 from "react";
|
|
9139
|
+
import { Check as Check3, Copy } from "lucide-react";
|
|
9140
|
+
import { jsx as jsx35, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
9141
|
+
var SANDBOX_SHELL_TEXT_CLASS = "text-[13px] leading-5 in-data-[density=compact]:text-xs in-data-[density=compact]:leading-4 in-data-[density=spacious]:text-sm in-data-[density=spacious]:leading-6";
|
|
9142
|
+
var SANDBOX_SHELL_SECTION_GAP_CLASS = "mt-2 in-data-[density=compact]:mt-1.5 in-data-[density=spacious]:mt-3";
|
|
9143
|
+
function normalizeShellToken(value) {
|
|
9144
|
+
if (typeof value !== "string") return null;
|
|
9145
|
+
const normalized = value.trim().toLowerCase().replace(/[\s-]+/g, "_");
|
|
9146
|
+
return normalized || null;
|
|
9147
|
+
}
|
|
9148
|
+
function isPlainObject(value) {
|
|
9149
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
9150
|
+
}
|
|
9151
|
+
function readShellString(value) {
|
|
9152
|
+
if (typeof value !== "string") return null;
|
|
9153
|
+
const trimmed = value.trim();
|
|
9154
|
+
return trimmed || null;
|
|
9155
|
+
}
|
|
9156
|
+
function stringifyShellText(value) {
|
|
9157
|
+
if (value === null || value === void 0) return null;
|
|
9158
|
+
if (typeof value === "string") return value;
|
|
9159
|
+
if (typeof value === "number" || typeof value === "boolean") {
|
|
9160
|
+
return String(value);
|
|
9161
|
+
}
|
|
9162
|
+
if (Array.isArray(value)) {
|
|
9163
|
+
const output = value.map((item) => stringifyShellText(item)).filter((item) => item !== null).join("");
|
|
9164
|
+
return output || null;
|
|
9165
|
+
}
|
|
9166
|
+
if (!isPlainObject(value)) return formatDisplayValue(value);
|
|
9167
|
+
const source = value;
|
|
9168
|
+
const textParts = [
|
|
9169
|
+
source.stdout,
|
|
9170
|
+
source.stderr,
|
|
9171
|
+
source.output,
|
|
9172
|
+
source.text,
|
|
9173
|
+
source.logs,
|
|
9174
|
+
source.content,
|
|
9175
|
+
source.chunk,
|
|
9176
|
+
source.delta
|
|
9177
|
+
].map((item) => stringifyShellText(item)).filter((item) => item !== null && item.length > 0);
|
|
9178
|
+
if (textParts.length > 0) return textParts.join("");
|
|
9179
|
+
return null;
|
|
9180
|
+
}
|
|
9181
|
+
function getSandboxShellCommand(data, language) {
|
|
9182
|
+
const input = data.input;
|
|
9183
|
+
if (typeof input === "string") return input;
|
|
9184
|
+
if (isPlainObject(input)) {
|
|
9185
|
+
const source = input;
|
|
9186
|
+
const command = readShellString(source.command) ?? readShellString(source.cmd) ?? readShellString(source.input);
|
|
9187
|
+
if (command) return command;
|
|
9188
|
+
}
|
|
9189
|
+
const payload = data.data;
|
|
9190
|
+
if (isPlainObject(payload)) {
|
|
9191
|
+
const source = payload;
|
|
9192
|
+
const command = readShellString(source.command) ?? readShellString(source.cmd) ?? readShellString(source.input);
|
|
9193
|
+
if (command) return command;
|
|
9194
|
+
}
|
|
9195
|
+
return readShellString(resolveLocalizedText2(data.message, language)) ?? readShellString(resolveLocalizedText2(data.title, language)) ?? "sandbox_shell";
|
|
9196
|
+
}
|
|
9197
|
+
function getSandboxShellOutput(data) {
|
|
9198
|
+
const output = stringifyShellText(data.output) ?? stringifyShellText(data.data) ?? stringifyShellText(data.error);
|
|
9199
|
+
return output ?? "";
|
|
9200
|
+
}
|
|
9201
|
+
function readExitCodeFrom(value) {
|
|
9202
|
+
if (!isPlainObject(value)) return null;
|
|
9203
|
+
const source = value;
|
|
9204
|
+
const candidate = source.exit_code ?? source.exitCode ?? source.return_code ?? source.returnCode ?? source.code;
|
|
9205
|
+
if (typeof candidate === "number" && Number.isFinite(candidate)) {
|
|
9206
|
+
return candidate;
|
|
9207
|
+
}
|
|
9208
|
+
if (typeof candidate === "string" && candidate.trim() !== "") {
|
|
9209
|
+
const parsed = Number(candidate);
|
|
9210
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
9211
|
+
}
|
|
9212
|
+
return null;
|
|
9213
|
+
}
|
|
9214
|
+
function getSandboxShellExitCode(data) {
|
|
9215
|
+
return readExitCodeFrom(data.output) ?? readExitCodeFrom(data.data) ?? readExitCodeFrom(data);
|
|
9216
|
+
}
|
|
9217
|
+
function isSandboxShellStep(data) {
|
|
9218
|
+
const namedData = data;
|
|
9219
|
+
return [data.tool, data.type, data.title, namedData.name].some(
|
|
9220
|
+
(value) => normalizeShellToken(value) === "sandbox_shell"
|
|
9221
|
+
);
|
|
9222
|
+
}
|
|
9223
|
+
function formatShellCommand(command) {
|
|
9224
|
+
const trimmed = command.trim();
|
|
9225
|
+
return trimmed.startsWith("$") ? trimmed : `$ ${trimmed}`;
|
|
9226
|
+
}
|
|
9227
|
+
function getSandboxShellActivityLabel(data, status, language, t) {
|
|
9228
|
+
const command = getSandboxShellCommand(data, language);
|
|
9229
|
+
const key = status === "running" ? "message.toolGroup.shell.runningCommand" : "message.toolGroup.shell.ranCommand";
|
|
9230
|
+
return t(key, { command });
|
|
9231
|
+
}
|
|
9232
|
+
function ShellCopyButton({
|
|
9233
|
+
value,
|
|
9234
|
+
className
|
|
9235
|
+
}) {
|
|
9236
|
+
const { t } = useChatkitTranslation();
|
|
9237
|
+
const [isCopied, setIsCopied] = React30.useState(false);
|
|
9238
|
+
const resetTimeoutRef = React30.useRef(null);
|
|
9239
|
+
const clearResetTimeout = React30.useCallback(() => {
|
|
9240
|
+
if (resetTimeoutRef.current === null) return;
|
|
9241
|
+
window.clearTimeout(resetTimeoutRef.current);
|
|
9242
|
+
resetTimeoutRef.current = null;
|
|
9243
|
+
}, []);
|
|
9244
|
+
React30.useEffect(() => clearResetTimeout, [clearResetTimeout]);
|
|
9245
|
+
const handleCopy = React30.useCallback(() => {
|
|
9246
|
+
if (typeof navigator === "undefined" || !navigator.clipboard) return;
|
|
9247
|
+
void navigator.clipboard.writeText(value).then(() => {
|
|
9248
|
+
setIsCopied(true);
|
|
9249
|
+
clearResetTimeout();
|
|
9250
|
+
resetTimeoutRef.current = window.setTimeout(() => {
|
|
9251
|
+
setIsCopied(false);
|
|
9252
|
+
resetTimeoutRef.current = null;
|
|
9253
|
+
}, 1500);
|
|
9254
|
+
}).catch(() => void 0);
|
|
9255
|
+
}, [clearResetTimeout, value]);
|
|
9256
|
+
const label = isCopied ? t("message.toolGroup.copied") : t("message.toolGroup.copy");
|
|
9257
|
+
return /* @__PURE__ */ jsx35(
|
|
9258
|
+
"button",
|
|
9259
|
+
{
|
|
9260
|
+
type: "button",
|
|
9261
|
+
className: cn(
|
|
9262
|
+
"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-background hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
|
|
9263
|
+
className
|
|
9264
|
+
),
|
|
9265
|
+
"aria-label": label,
|
|
9266
|
+
title: label,
|
|
9267
|
+
onClick: handleCopy,
|
|
9268
|
+
children: isCopied ? /* @__PURE__ */ jsx35(Check3, { className: "h-3.5 w-3.5", "aria-hidden": "true" }) : /* @__PURE__ */ jsx35(Copy, { className: "h-3.5 w-3.5", "aria-hidden": "true" })
|
|
9269
|
+
}
|
|
9270
|
+
);
|
|
9271
|
+
}
|
|
9272
|
+
function SandboxShellStatus({
|
|
9273
|
+
data,
|
|
9274
|
+
exitCode
|
|
9275
|
+
}) {
|
|
9276
|
+
const { t } = useChatkitTranslation();
|
|
9277
|
+
if (exitCode !== null) {
|
|
9278
|
+
return /* @__PURE__ */ jsx35("span", { className: "text-muted-foreground/90", children: t("message.toolGroup.shell.exitCode", { code: exitCode }) });
|
|
9279
|
+
}
|
|
9280
|
+
if (data.status === "running") {
|
|
9281
|
+
return /* @__PURE__ */ jsx35("span", { className: "text-muted-foreground/90", children: t("message.toolGroup.shell.running") });
|
|
9282
|
+
}
|
|
9283
|
+
if (data.status === "fail" || data.error) {
|
|
9284
|
+
return /* @__PURE__ */ jsx35("span", { className: "text-destructive/90", children: t("message.toolGroup.shell.failed") });
|
|
9285
|
+
}
|
|
9286
|
+
return /* @__PURE__ */ jsxs23("span", { className: "inline-flex items-center gap-1 text-muted-foreground/90", children: [
|
|
9287
|
+
/* @__PURE__ */ jsx35(Check3, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
|
|
9288
|
+
t("message.toolGroup.shell.success")
|
|
9289
|
+
] });
|
|
9290
|
+
}
|
|
9291
|
+
function SandboxShellToolCallCard({ data }) {
|
|
9292
|
+
const { i18n: i18n2 } = useChatkitTranslation();
|
|
9293
|
+
const command = getSandboxShellCommand(data, i18n2.language);
|
|
9294
|
+
const formattedCommand = formatShellCommand(command);
|
|
9295
|
+
const output = getSandboxShellOutput(data);
|
|
9296
|
+
const exitCode = getSandboxShellExitCode(data);
|
|
9297
|
+
const copyButtonClassName = "absolute right-1 top-1 h-6 w-6 opacity-0 transition-opacity group-hover/shell-copy:opacity-100 group-focus-within/shell-copy:opacity-100 in-data-[density=compact]:right-0.5 in-data-[density=compact]:top-0.5 in-data-[density=compact]:h-5 in-data-[density=compact]:w-5 in-data-[density=spacious]:right-1.5 in-data-[density=spacious]:top-1.5 in-data-[density=spacious]:h-7 in-data-[density=spacious]:w-7";
|
|
9298
|
+
return /* @__PURE__ */ jsxs23(
|
|
9299
|
+
"div",
|
|
9300
|
+
{
|
|
9301
|
+
className: "flex max-h-64 min-w-0 flex-col overflow-hidden rounded-md bg-muted/60 px-3 my-1 text-left shadow-sm ring-1 ring-border/30 in-data-[density=compact]:max-h-52 in-data-[density=compact]:px-2 in-data-[density=compact]:py-1.5 in-data-[density=spacious]:max-h-80 in-data-[density=spacious]:px-4 in-data-[density=spacious]:py-3",
|
|
9302
|
+
"data-slot": "sandbox-shell-tool-call",
|
|
9303
|
+
"aria-label": "Shell",
|
|
9304
|
+
children: [
|
|
9305
|
+
/* @__PURE__ */ jsx35(
|
|
9306
|
+
"div",
|
|
9307
|
+
{
|
|
9308
|
+
className: cn(
|
|
9309
|
+
"font-medium text-muted-foreground",
|
|
9310
|
+
SANDBOX_SHELL_TEXT_CLASS
|
|
9311
|
+
),
|
|
9312
|
+
children: "Shell"
|
|
9313
|
+
}
|
|
9314
|
+
),
|
|
9315
|
+
/* @__PURE__ */ jsxs23(
|
|
9316
|
+
"div",
|
|
9317
|
+
{
|
|
9318
|
+
className: cn(
|
|
9319
|
+
"group/shell-copy relative min-w-0",
|
|
9320
|
+
SANDBOX_SHELL_SECTION_GAP_CLASS
|
|
9321
|
+
),
|
|
9322
|
+
children: [
|
|
9323
|
+
/* @__PURE__ */ jsx35(
|
|
9324
|
+
"pre",
|
|
9325
|
+
{
|
|
9326
|
+
className: cn(
|
|
9327
|
+
"whitespace-pre-wrap break-words pr-8 font-mono text-foreground in-data-[density=compact]:pr-6 in-data-[density=spacious]:pr-10",
|
|
9328
|
+
SANDBOX_SHELL_TEXT_CLASS
|
|
9329
|
+
),
|
|
9330
|
+
"data-slot": "sandbox-shell-command",
|
|
9331
|
+
children: formattedCommand
|
|
9332
|
+
}
|
|
9333
|
+
),
|
|
9334
|
+
/* @__PURE__ */ jsx35(ShellCopyButton, { value: command, className: copyButtonClassName })
|
|
9335
|
+
]
|
|
9336
|
+
}
|
|
9337
|
+
),
|
|
9338
|
+
output ? /* @__PURE__ */ jsxs23(
|
|
9339
|
+
"div",
|
|
9340
|
+
{
|
|
9341
|
+
className: cn(
|
|
9342
|
+
"group/shell-copy relative min-h-0 flex-1",
|
|
9343
|
+
SANDBOX_SHELL_SECTION_GAP_CLASS
|
|
9344
|
+
),
|
|
9345
|
+
children: [
|
|
9346
|
+
/* @__PURE__ */ jsx35(
|
|
9347
|
+
"pre",
|
|
9348
|
+
{
|
|
9349
|
+
className: cn(
|
|
9350
|
+
"min-h-0 overflow-auto whitespace-pre pr-8 font-mono text-muted-foreground/85 in-data-[density=compact]:pr-6 in-data-[density=spacious]:pr-10",
|
|
9351
|
+
SANDBOX_SHELL_TEXT_CLASS
|
|
9352
|
+
),
|
|
9353
|
+
"data-slot": "sandbox-shell-output",
|
|
9354
|
+
children: output
|
|
9355
|
+
}
|
|
9356
|
+
),
|
|
9357
|
+
/* @__PURE__ */ jsx35(ShellCopyButton, { value: output, className: copyButtonClassName })
|
|
9358
|
+
]
|
|
9359
|
+
}
|
|
9360
|
+
) : null,
|
|
9361
|
+
/* @__PURE__ */ jsx35(
|
|
9362
|
+
"div",
|
|
9363
|
+
{
|
|
9364
|
+
className: cn(
|
|
9365
|
+
"mt-3 flex shrink-0 justify-end in-data-[density=compact]:mt-2 in-data-[density=spacious]:mt-4",
|
|
9366
|
+
SANDBOX_SHELL_TEXT_CLASS
|
|
9367
|
+
),
|
|
9368
|
+
children: /* @__PURE__ */ jsx35(SandboxShellStatus, { data, exitCode })
|
|
9369
|
+
}
|
|
9370
|
+
)
|
|
9371
|
+
]
|
|
9372
|
+
}
|
|
9373
|
+
);
|
|
9374
|
+
}
|
|
9375
|
+
|
|
9376
|
+
// src/components/thread/messages/tool-component-group.tsx
|
|
9377
|
+
import { jsx as jsx36, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
9045
9378
|
var toolStatusConfig = {
|
|
9046
9379
|
success: {
|
|
9047
9380
|
iconClass: "border-green-500 text-green-700",
|
|
@@ -9049,11 +9382,11 @@ var toolStatusConfig = {
|
|
|
9049
9382
|
},
|
|
9050
9383
|
fail: {
|
|
9051
9384
|
iconClass: "border-red-500 text-red-700",
|
|
9052
|
-
icon:
|
|
9385
|
+
icon: XCircle3
|
|
9053
9386
|
},
|
|
9054
9387
|
running: {
|
|
9055
9388
|
iconClass: "border-blue-500 text-blue-700",
|
|
9056
|
-
icon:
|
|
9389
|
+
icon: Loader25
|
|
9057
9390
|
}
|
|
9058
9391
|
};
|
|
9059
9392
|
var TOOL_GROUP_CATEGORY_ORDER = [
|
|
@@ -9147,10 +9480,10 @@ function formatStepDuration2(durationMs) {
|
|
|
9147
9480
|
return `${minutes}m ${seconds}s`;
|
|
9148
9481
|
}
|
|
9149
9482
|
function useFrozenTimestamp(shouldFreeze) {
|
|
9150
|
-
const [frozenAt, setFrozenAt] =
|
|
9483
|
+
const [frozenAt, setFrozenAt] = React31.useState(
|
|
9151
9484
|
() => shouldFreeze ? Date.now() : null
|
|
9152
9485
|
);
|
|
9153
|
-
|
|
9486
|
+
React31.useEffect(() => {
|
|
9154
9487
|
if (shouldFreeze) {
|
|
9155
9488
|
setFrozenAt((current) => current ?? Date.now());
|
|
9156
9489
|
return;
|
|
@@ -9160,12 +9493,12 @@ function useFrozenTimestamp(shouldFreeze) {
|
|
|
9160
9493
|
return frozenAt;
|
|
9161
9494
|
}
|
|
9162
9495
|
function useToolStepDurationLabel(data, options) {
|
|
9163
|
-
const [durationNow, setDurationNow] =
|
|
9496
|
+
const [durationNow, setDurationNow] = React31.useState(() => Date.now());
|
|
9164
9497
|
const createdAt = parseStepDate(data.created_date);
|
|
9165
9498
|
const explicitEndedAt = parseStepDate(data.end_date);
|
|
9166
9499
|
const status = options?.status ?? data.status;
|
|
9167
9500
|
const endedAt = explicitEndedAt ?? (status !== "running" ? options?.fallbackEndedAt ?? null : null);
|
|
9168
|
-
|
|
9501
|
+
React31.useEffect(() => {
|
|
9169
9502
|
if (status !== "running" || createdAt === null || endedAt !== null) {
|
|
9170
9503
|
return;
|
|
9171
9504
|
}
|
|
@@ -9220,14 +9553,14 @@ function normalizeToolToken3(value) {
|
|
|
9220
9553
|
}
|
|
9221
9554
|
function classifyToolToken(value) {
|
|
9222
9555
|
const normalized = normalizeToolToken3(
|
|
9223
|
-
typeof value === "string" ? value :
|
|
9556
|
+
typeof value === "string" ? value : resolveLocalizedText2(value, "en-US")
|
|
9224
9557
|
);
|
|
9225
9558
|
if (!normalized) return null;
|
|
9226
9559
|
const directMatch = TOOL_GROUP_TOKEN_CATEGORY[normalized];
|
|
9227
9560
|
if (directMatch) return directMatch;
|
|
9228
9561
|
if (normalized.includes("search")) return "searches";
|
|
9229
9562
|
if (normalized.includes("file")) return "files";
|
|
9230
|
-
if (normalized.includes("command") || normalized.includes("cmd") || normalized.includes("program") || normalized.includes("exec") || normalized.startsWith("run_") || normalized.includes("_run")) {
|
|
9563
|
+
if (normalized.includes("command") || normalized.includes("cmd") || normalized.includes("program") || normalized.includes("exec") || normalized.includes("shell") || normalized.includes("terminal") || normalized.startsWith("run_") || normalized.includes("_run")) {
|
|
9231
9564
|
return "commands";
|
|
9232
9565
|
}
|
|
9233
9566
|
if (normalized.includes("list")) return "lists";
|
|
@@ -9239,6 +9572,7 @@ function classifyToolToken(value) {
|
|
|
9239
9572
|
}
|
|
9240
9573
|
function getToolGroupCategory(content) {
|
|
9241
9574
|
const data = getToolStepData(content);
|
|
9575
|
+
if (isSandboxShellStep(data)) return "commands";
|
|
9242
9576
|
return classifyToolToken(data.type) ?? classifyToolToken(data.tool) ?? classifyToolToken(data.title) ?? classifyToolToken(data.message) ?? "tools";
|
|
9243
9577
|
}
|
|
9244
9578
|
function getToolGroupCategoryCounts(items) {
|
|
@@ -9251,10 +9585,10 @@ function getToolGroupCategoryCounts(items) {
|
|
|
9251
9585
|
function getToolActivityLabel(content, language, statusOverride) {
|
|
9252
9586
|
const data = getToolStepData(content);
|
|
9253
9587
|
const status = statusOverride ?? data.status;
|
|
9254
|
-
const message =
|
|
9255
|
-
const title =
|
|
9256
|
-
const tool =
|
|
9257
|
-
const type =
|
|
9588
|
+
const message = resolveLocalizedText2(data.message, language);
|
|
9589
|
+
const title = resolveLocalizedText2(data.title, language);
|
|
9590
|
+
const tool = resolveLocalizedText2(data.tool, language);
|
|
9591
|
+
const type = resolveLocalizedText2(data.type, language);
|
|
9258
9592
|
if (status === "running") {
|
|
9259
9593
|
return message ?? title ?? tool ?? type ?? "Tool";
|
|
9260
9594
|
}
|
|
@@ -9348,8 +9682,8 @@ function shouldUseToolsetAvatar(toolset) {
|
|
|
9348
9682
|
}
|
|
9349
9683
|
function useToolsetAvatar(toolsetId, enabled, apiUrl) {
|
|
9350
9684
|
const avatarUrl = enabled ? createToolsetAvatarUrl(toolsetId, apiUrl) : null;
|
|
9351
|
-
const [avatar, setAvatar] =
|
|
9352
|
-
|
|
9685
|
+
const [avatar, setAvatar] = React31.useState(null);
|
|
9686
|
+
React31.useEffect(() => {
|
|
9353
9687
|
if (!avatarUrl) {
|
|
9354
9688
|
setAvatar(null);
|
|
9355
9689
|
return;
|
|
@@ -9381,7 +9715,7 @@ function ToolAvatarIcon({
|
|
|
9381
9715
|
className
|
|
9382
9716
|
}) {
|
|
9383
9717
|
if (avatar.url) {
|
|
9384
|
-
return /* @__PURE__ */
|
|
9718
|
+
return /* @__PURE__ */ jsx36(
|
|
9385
9719
|
"img",
|
|
9386
9720
|
{
|
|
9387
9721
|
alt: "",
|
|
@@ -9394,7 +9728,7 @@ function ToolAvatarIcon({
|
|
|
9394
9728
|
}
|
|
9395
9729
|
const emoji = unicodeFromUnified2(avatar.emoji?.unified);
|
|
9396
9730
|
if (emoji) {
|
|
9397
|
-
return /* @__PURE__ */
|
|
9731
|
+
return /* @__PURE__ */ jsx36(
|
|
9398
9732
|
"span",
|
|
9399
9733
|
{
|
|
9400
9734
|
"aria-hidden": "true",
|
|
@@ -9409,7 +9743,7 @@ function ToolAvatarIcon({
|
|
|
9409
9743
|
}
|
|
9410
9744
|
);
|
|
9411
9745
|
}
|
|
9412
|
-
return /* @__PURE__ */
|
|
9746
|
+
return /* @__PURE__ */ jsx36(
|
|
9413
9747
|
CircleHelp,
|
|
9414
9748
|
{
|
|
9415
9749
|
className,
|
|
@@ -9446,7 +9780,7 @@ function getStepTypeIcon(type) {
|
|
|
9446
9780
|
if (!normalized) return null;
|
|
9447
9781
|
switch (normalized) {
|
|
9448
9782
|
case "file":
|
|
9449
|
-
return
|
|
9783
|
+
return FileText3;
|
|
9450
9784
|
case "files":
|
|
9451
9785
|
return Files;
|
|
9452
9786
|
case "program":
|
|
@@ -9472,12 +9806,12 @@ function ToolStepIcon({
|
|
|
9472
9806
|
apiUrl
|
|
9473
9807
|
);
|
|
9474
9808
|
const iconUrl = createToolsetIconUrl(data.toolset, organizationId, apiUrl);
|
|
9475
|
-
const [failedIconUrl, setFailedIconUrl] =
|
|
9476
|
-
|
|
9809
|
+
const [failedIconUrl, setFailedIconUrl] = React31.useState(null);
|
|
9810
|
+
React31.useEffect(() => {
|
|
9477
9811
|
setFailedIconUrl(null);
|
|
9478
9812
|
}, [iconUrl]);
|
|
9479
9813
|
if (avatar) {
|
|
9480
|
-
return /* @__PURE__ */
|
|
9814
|
+
return /* @__PURE__ */ jsx36(
|
|
9481
9815
|
ToolAvatarIcon,
|
|
9482
9816
|
{
|
|
9483
9817
|
avatar,
|
|
@@ -9487,7 +9821,7 @@ function ToolStepIcon({
|
|
|
9487
9821
|
);
|
|
9488
9822
|
}
|
|
9489
9823
|
if (iconUrl && failedIconUrl !== iconUrl) {
|
|
9490
|
-
return /* @__PURE__ */
|
|
9824
|
+
return /* @__PURE__ */ jsx36(
|
|
9491
9825
|
"img",
|
|
9492
9826
|
{
|
|
9493
9827
|
alt: "",
|
|
@@ -9501,7 +9835,7 @@ function ToolStepIcon({
|
|
|
9501
9835
|
}
|
|
9502
9836
|
const TypeIcon = getStepTypeIcon(data.type);
|
|
9503
9837
|
if (TypeIcon) {
|
|
9504
|
-
return /* @__PURE__ */
|
|
9838
|
+
return /* @__PURE__ */ jsx36(
|
|
9505
9839
|
TypeIcon,
|
|
9506
9840
|
{
|
|
9507
9841
|
className,
|
|
@@ -9512,7 +9846,7 @@ function ToolStepIcon({
|
|
|
9512
9846
|
}
|
|
9513
9847
|
const ToolsetIcon = getKnownToolsetIcon(data.toolset);
|
|
9514
9848
|
if (ToolsetIcon) {
|
|
9515
|
-
return /* @__PURE__ */
|
|
9849
|
+
return /* @__PURE__ */ jsx36(
|
|
9516
9850
|
ToolsetIcon,
|
|
9517
9851
|
{
|
|
9518
9852
|
className,
|
|
@@ -9522,7 +9856,7 @@ function ToolStepIcon({
|
|
|
9522
9856
|
);
|
|
9523
9857
|
}
|
|
9524
9858
|
if (usesToolsetAvatar) {
|
|
9525
|
-
return /* @__PURE__ */
|
|
9859
|
+
return /* @__PURE__ */ jsx36(
|
|
9526
9860
|
CircleHelp,
|
|
9527
9861
|
{
|
|
9528
9862
|
className,
|
|
@@ -9531,7 +9865,7 @@ function ToolStepIcon({
|
|
|
9531
9865
|
}
|
|
9532
9866
|
);
|
|
9533
9867
|
}
|
|
9534
|
-
return /* @__PURE__ */
|
|
9868
|
+
return /* @__PURE__ */ jsx36(
|
|
9535
9869
|
CircleHelp,
|
|
9536
9870
|
{
|
|
9537
9871
|
className,
|
|
@@ -9540,17 +9874,20 @@ function ToolStepIcon({
|
|
|
9540
9874
|
}
|
|
9541
9875
|
);
|
|
9542
9876
|
}
|
|
9543
|
-
function ToolCallCopyButton({
|
|
9877
|
+
function ToolCallCopyButton({
|
|
9878
|
+
value,
|
|
9879
|
+
className
|
|
9880
|
+
}) {
|
|
9544
9881
|
const { t } = useChatkitTranslation();
|
|
9545
|
-
const [isCopied, setIsCopied] =
|
|
9546
|
-
const resetTimeoutRef =
|
|
9547
|
-
const clearResetTimeout =
|
|
9882
|
+
const [isCopied, setIsCopied] = React31.useState(false);
|
|
9883
|
+
const resetTimeoutRef = React31.useRef(null);
|
|
9884
|
+
const clearResetTimeout = React31.useCallback(() => {
|
|
9548
9885
|
if (resetTimeoutRef.current === null) return;
|
|
9549
9886
|
window.clearTimeout(resetTimeoutRef.current);
|
|
9550
9887
|
resetTimeoutRef.current = null;
|
|
9551
9888
|
}, []);
|
|
9552
|
-
|
|
9553
|
-
const handleCopy =
|
|
9889
|
+
React31.useEffect(() => clearResetTimeout, [clearResetTimeout]);
|
|
9890
|
+
const handleCopy = React31.useCallback(() => {
|
|
9554
9891
|
if (typeof navigator === "undefined" || !navigator.clipboard) return;
|
|
9555
9892
|
void navigator.clipboard.writeText(value).then(() => {
|
|
9556
9893
|
setIsCopied(true);
|
|
@@ -9562,15 +9899,18 @@ function ToolCallCopyButton({ value }) {
|
|
|
9562
9899
|
}).catch(() => void 0);
|
|
9563
9900
|
}, [clearResetTimeout, value]);
|
|
9564
9901
|
const label = isCopied ? t("message.toolGroup.copied") : t("message.toolGroup.copy");
|
|
9565
|
-
return /* @__PURE__ */
|
|
9902
|
+
return /* @__PURE__ */ jsx36(
|
|
9566
9903
|
"button",
|
|
9567
9904
|
{
|
|
9568
9905
|
type: "button",
|
|
9569
|
-
className:
|
|
9906
|
+
className: cn(
|
|
9907
|
+
"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-background hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
|
|
9908
|
+
className
|
|
9909
|
+
),
|
|
9570
9910
|
"aria-label": label,
|
|
9571
9911
|
title: label,
|
|
9572
9912
|
onClick: handleCopy,
|
|
9573
|
-
children: isCopied ? /* @__PURE__ */
|
|
9913
|
+
children: isCopied ? /* @__PURE__ */ jsx36(Check4, { className: "h-3.5 w-3.5", "aria-hidden": "true" }) : /* @__PURE__ */ jsx36(Copy2, { className: "h-3.5 w-3.5", "aria-hidden": "true" })
|
|
9574
9914
|
}
|
|
9575
9915
|
);
|
|
9576
9916
|
}
|
|
@@ -9581,28 +9921,28 @@ function ToolCallValueBlock({
|
|
|
9581
9921
|
const { t } = useChatkitTranslation();
|
|
9582
9922
|
const detected = detectJsonValue(value);
|
|
9583
9923
|
if (detected.kind === "text") {
|
|
9584
|
-
return /* @__PURE__ */
|
|
9585
|
-
/* @__PURE__ */
|
|
9586
|
-
/* @__PURE__ */
|
|
9924
|
+
return /* @__PURE__ */ jsxs24("div", { className: "min-w-0 space-y-1", children: [
|
|
9925
|
+
/* @__PURE__ */ jsx36("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx36(ToolCallCopyButton, { value: detected.text }) }),
|
|
9926
|
+
/* @__PURE__ */ jsx36(PlainTextBlock, { value: detected.text, destructive })
|
|
9587
9927
|
] });
|
|
9588
9928
|
}
|
|
9589
|
-
return /* @__PURE__ */
|
|
9590
|
-
/* @__PURE__ */
|
|
9591
|
-
/* @__PURE__ */
|
|
9929
|
+
return /* @__PURE__ */ jsxs24(Tabs, { defaultValue: "tree", className: "min-w-0", children: [
|
|
9930
|
+
/* @__PURE__ */ jsxs24("div", { className: "mb-2 flex min-w-0 items-center justify-between gap-2", children: [
|
|
9931
|
+
/* @__PURE__ */ jsxs24("span", { className: "min-w-0 truncate text-[11px] text-muted-foreground", children: [
|
|
9592
9932
|
t("message.toolGroup.jsonTitle"),
|
|
9593
9933
|
" \xB7 ",
|
|
9594
9934
|
getJsonValueSummary(detected.value)
|
|
9595
9935
|
] }),
|
|
9596
|
-
/* @__PURE__ */
|
|
9597
|
-
/* @__PURE__ */
|
|
9598
|
-
/* @__PURE__ */
|
|
9599
|
-
/* @__PURE__ */
|
|
9600
|
-
/* @__PURE__ */
|
|
9936
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
9937
|
+
/* @__PURE__ */ jsx36(ToolCallCopyButton, { value: detected.raw }),
|
|
9938
|
+
/* @__PURE__ */ jsxs24(TabsList, { className: "rounded-md p-0.5", children: [
|
|
9939
|
+
/* @__PURE__ */ jsx36(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "tree", children: t("message.toolGroup.jsonTree") }),
|
|
9940
|
+
/* @__PURE__ */ jsx36(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "raw", children: t("message.toolGroup.jsonRaw") })
|
|
9601
9941
|
] })
|
|
9602
9942
|
] })
|
|
9603
9943
|
] }),
|
|
9604
|
-
/* @__PURE__ */
|
|
9605
|
-
/* @__PURE__ */
|
|
9944
|
+
/* @__PURE__ */ jsx36(TabsContent, { value: "tree", className: "mt-0", children: /* @__PURE__ */ jsx36(JsonTreeView, { value: detected.value }) }),
|
|
9945
|
+
/* @__PURE__ */ jsx36(TabsContent, { value: "raw", className: "mt-0", children: /* @__PURE__ */ jsx36(RawJsonBlock, { raw: detected.raw }) })
|
|
9606
9946
|
] });
|
|
9607
9947
|
}
|
|
9608
9948
|
function DefaultToolCallOutput({ data }) {
|
|
@@ -9610,37 +9950,40 @@ function DefaultToolCallOutput({ data }) {
|
|
|
9610
9950
|
const output = data.output ?? null;
|
|
9611
9951
|
const error = data.error ?? null;
|
|
9612
9952
|
if (error) {
|
|
9613
|
-
return /* @__PURE__ */
|
|
9614
|
-
/* @__PURE__ */
|
|
9615
|
-
/* @__PURE__ */
|
|
9953
|
+
return /* @__PURE__ */ jsxs24("div", { className: "space-y-1", children: [
|
|
9954
|
+
/* @__PURE__ */ jsx36("div", { className: "text-[11px] font-medium text-destructive", children: t("message.toolGroup.errorTitle") }),
|
|
9955
|
+
/* @__PURE__ */ jsx36(ToolCallValueBlock, { value: error, destructive: true })
|
|
9616
9956
|
] });
|
|
9617
9957
|
}
|
|
9618
9958
|
if (output === null) return null;
|
|
9619
|
-
return /* @__PURE__ */
|
|
9620
|
-
/* @__PURE__ */
|
|
9621
|
-
/* @__PURE__ */
|
|
9959
|
+
return /* @__PURE__ */ jsxs24("div", { className: "space-y-1", children: [
|
|
9960
|
+
/* @__PURE__ */ jsx36("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.toolGroup.outputTitle") }),
|
|
9961
|
+
/* @__PURE__ */ jsx36(ToolCallValueBlock, { value: output })
|
|
9622
9962
|
] });
|
|
9623
9963
|
}
|
|
9624
9964
|
function ToolCallDetails({ content }) {
|
|
9625
9965
|
const { t } = useChatkitTranslation();
|
|
9626
9966
|
const data = getToolStepData(content);
|
|
9967
|
+
if (isSandboxShellStep(data)) {
|
|
9968
|
+
return /* @__PURE__ */ jsx36("div", { className: "ml-2 mt-1", children: /* @__PURE__ */ jsx36(SandboxShellToolCallCard, { data }) });
|
|
9969
|
+
}
|
|
9627
9970
|
const renderer = getComponentMessageRenderer(content, data);
|
|
9628
9971
|
const hasCustomDetails = data.error === void 0 && hasComponentMessageRendererDetails(renderer, content, data);
|
|
9629
9972
|
const CustomDetailsRenderer = hasCustomDetails ? renderer?.renderDetails : void 0;
|
|
9630
9973
|
if (CustomDetailsRenderer) {
|
|
9631
|
-
return /* @__PURE__ */
|
|
9974
|
+
return /* @__PURE__ */ jsx36("div", { className: "ml-6 mt-1 max-h-60 overflow-auto rounded-md bg-muted/30 text-xs text-muted-foreground", children: /* @__PURE__ */ jsx36(CustomDetailsRenderer, { content, data }) });
|
|
9632
9975
|
}
|
|
9633
9976
|
const OutputRenderer = getToolCallOutputRenderer(data);
|
|
9634
9977
|
const hasInput = data.input !== void 0 && data.input !== null;
|
|
9635
9978
|
const hasOutput = data.error !== void 0 || data.output !== void 0;
|
|
9636
9979
|
if (!hasInput && !hasOutput) return null;
|
|
9637
|
-
return /* @__PURE__ */
|
|
9638
|
-
hasInput && /* @__PURE__ */
|
|
9639
|
-
/* @__PURE__ */
|
|
9640
|
-
/* @__PURE__ */
|
|
9980
|
+
return /* @__PURE__ */ jsxs24("div", { className: "ml-6 mt-1 max-h-60 overflow-auto rounded-md bg-muted/30 px-3 py-2 text-xs text-muted-foreground", children: [
|
|
9981
|
+
hasInput && /* @__PURE__ */ jsxs24("div", { className: "space-y-1", children: [
|
|
9982
|
+
/* @__PURE__ */ jsx36("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.toolGroup.inputTitle") }),
|
|
9983
|
+
/* @__PURE__ */ jsx36(ToolCallValueBlock, { value: data.input })
|
|
9641
9984
|
] }),
|
|
9642
|
-
hasInput && hasOutput ? /* @__PURE__ */
|
|
9643
|
-
hasOutput ? /* @__PURE__ */
|
|
9985
|
+
hasInput && hasOutput ? /* @__PURE__ */ jsx36("div", { className: "h-2" }) : null,
|
|
9986
|
+
hasOutput ? /* @__PURE__ */ jsx36(OutputRenderer, { content, data }) : null
|
|
9644
9987
|
] });
|
|
9645
9988
|
}
|
|
9646
9989
|
function areToolCallRowPropsEqual(previous, next) {
|
|
@@ -9652,15 +9995,16 @@ function ToolCallRowContent({
|
|
|
9652
9995
|
organizationId,
|
|
9653
9996
|
apiUrl
|
|
9654
9997
|
}) {
|
|
9655
|
-
const { i18n: i18n2 } = useChatkitTranslation();
|
|
9998
|
+
const { i18n: i18n2, t } = useChatkitTranslation();
|
|
9656
9999
|
const data = getToolStepData(content);
|
|
9657
10000
|
const status = getEffectiveToolStepStatus(data, isThreadRunning);
|
|
9658
10001
|
const hasError = status === "fail" || Boolean(data.error);
|
|
9659
|
-
const
|
|
10002
|
+
const isSandboxShell = isSandboxShellStep(data);
|
|
10003
|
+
const detailsId = React31.useId();
|
|
9660
10004
|
const renderer = getComponentMessageRenderer(content, data);
|
|
9661
|
-
const label = renderer?.getTitle?.(content, data, i18n2.language) ?? getToolActivityLabel(content, i18n2.language, status);
|
|
10005
|
+
const label = isSandboxShell ? getSandboxShellActivityLabel(data, status, i18n2.language, t) : renderer?.getTitle?.(content, data, i18n2.language) ?? getToolActivityLabel(content, i18n2.language, status);
|
|
9662
10006
|
const hasCustomDetails = data.error === void 0 && hasComponentMessageRendererDetails(renderer, content, data);
|
|
9663
|
-
const hasDetails = data.input !== void 0 || data.error !== void 0 || data.output !== void 0 || hasCustomDetails;
|
|
10007
|
+
const hasDetails = isSandboxShell || data.input !== void 0 || data.error !== void 0 || data.output !== void 0 || hasCustomDetails;
|
|
9664
10008
|
const fallbackEndedAt = useFrozenTimestamp(
|
|
9665
10009
|
data.status === "running" && status === "fail"
|
|
9666
10010
|
);
|
|
@@ -9668,14 +10012,14 @@ function ToolCallRowContent({
|
|
|
9668
10012
|
status,
|
|
9669
10013
|
fallbackEndedAt
|
|
9670
10014
|
});
|
|
9671
|
-
const [isExpanded, setIsExpanded] =
|
|
9672
|
-
|
|
10015
|
+
const [isExpanded, setIsExpanded] = React31.useState(false);
|
|
10016
|
+
React31.useEffect(() => {
|
|
9673
10017
|
if (status === "running" && data.output !== void 0) {
|
|
9674
10018
|
setIsExpanded(true);
|
|
9675
10019
|
}
|
|
9676
10020
|
}, [data.output, status]);
|
|
9677
|
-
return /* @__PURE__ */
|
|
9678
|
-
/* @__PURE__ */
|
|
10021
|
+
return /* @__PURE__ */ jsxs24("li", { className: "ck-tool-call-row-enter min-w-0", children: [
|
|
10022
|
+
/* @__PURE__ */ jsxs24(
|
|
9679
10023
|
"button",
|
|
9680
10024
|
{
|
|
9681
10025
|
type: "button",
|
|
@@ -9683,7 +10027,7 @@ function ToolCallRowContent({
|
|
|
9683
10027
|
"group/tool-call flex w-full min-w-0 items-center gap-2 text-left text-muted-foreground",
|
|
9684
10028
|
TOOL_CALL_ROW_TEXT_CLASS,
|
|
9685
10029
|
hasDetails && "cursor-pointer hover:text-foreground",
|
|
9686
|
-
hasError && "text-destructive hover:text-destructive"
|
|
10030
|
+
hasError && !isSandboxShell && "text-destructive hover:text-destructive"
|
|
9687
10031
|
),
|
|
9688
10032
|
"aria-expanded": hasDetails ? isExpanded : void 0,
|
|
9689
10033
|
"aria-controls": hasDetails ? detailsId : void 0,
|
|
@@ -9692,7 +10036,7 @@ function ToolCallRowContent({
|
|
|
9692
10036
|
if (hasDetails) setIsExpanded((prev) => !prev);
|
|
9693
10037
|
},
|
|
9694
10038
|
children: [
|
|
9695
|
-
status ? /* @__PURE__ */
|
|
10039
|
+
status ? /* @__PURE__ */ jsx36(
|
|
9696
10040
|
ToolStepIcon,
|
|
9697
10041
|
{
|
|
9698
10042
|
data,
|
|
@@ -9700,11 +10044,11 @@ function ToolCallRowContent({
|
|
|
9700
10044
|
apiUrl,
|
|
9701
10045
|
className: cn(
|
|
9702
10046
|
"h-3.5 w-3.5 shrink-0",
|
|
9703
|
-
hasError ? "text-destructive" : "text-muted-foreground"
|
|
10047
|
+
hasError && !isSandboxShell ? "text-destructive" : "text-muted-foreground"
|
|
9704
10048
|
)
|
|
9705
10049
|
}
|
|
9706
|
-
) : /* @__PURE__ */
|
|
9707
|
-
/* @__PURE__ */
|
|
10050
|
+
) : /* @__PURE__ */ jsx36("span", { className: "h-3.5 w-3.5 shrink-0", "aria-hidden": "true" }),
|
|
10051
|
+
/* @__PURE__ */ jsx36(
|
|
9708
10052
|
"span",
|
|
9709
10053
|
{
|
|
9710
10054
|
className: cn(
|
|
@@ -9715,8 +10059,8 @@ function ToolCallRowContent({
|
|
|
9715
10059
|
children: label
|
|
9716
10060
|
}
|
|
9717
10061
|
),
|
|
9718
|
-
durationLabel ? /* @__PURE__ */
|
|
9719
|
-
hasDetails ? /* @__PURE__ */
|
|
10062
|
+
durationLabel ? /* @__PURE__ */ jsx36("span", { className: "shrink-0 text-[11px] tabular-nums text-muted-foreground/80", children: durationLabel }) : null,
|
|
10063
|
+
hasDetails ? /* @__PURE__ */ jsx36(
|
|
9720
10064
|
ChevronRight7,
|
|
9721
10065
|
{
|
|
9722
10066
|
"aria-hidden": "true",
|
|
@@ -9729,10 +10073,10 @@ function ToolCallRowContent({
|
|
|
9729
10073
|
]
|
|
9730
10074
|
}
|
|
9731
10075
|
),
|
|
9732
|
-
hasDetails && isExpanded ? /* @__PURE__ */
|
|
10076
|
+
hasDetails && isExpanded ? /* @__PURE__ */ jsx36("div", { id: detailsId, children: /* @__PURE__ */ jsx36(ToolCallDetails, { content }) }) : null
|
|
9733
10077
|
] });
|
|
9734
10078
|
}
|
|
9735
|
-
var ToolCallRow =
|
|
10079
|
+
var ToolCallRow = React31.memo(ToolCallRowContent, areToolCallRowPropsEqual);
|
|
9736
10080
|
ToolCallRow.displayName = "ToolCallRow";
|
|
9737
10081
|
function ToolComponentGroup({
|
|
9738
10082
|
items,
|
|
@@ -9742,8 +10086,8 @@ function ToolComponentGroup({
|
|
|
9742
10086
|
apiUrl
|
|
9743
10087
|
}) {
|
|
9744
10088
|
const { t } = useChatkitTranslation();
|
|
9745
|
-
const contentId =
|
|
9746
|
-
const [isExpanded, setIsExpanded] =
|
|
10089
|
+
const contentId = React31.useId();
|
|
10090
|
+
const [isExpanded, setIsExpanded] = React31.useState(!hasFollowingItem);
|
|
9747
10091
|
const categoryCounts = getToolGroupCategoryCounts(items);
|
|
9748
10092
|
const categorySummary = TOOL_GROUP_CATEGORY_ORDER.flatMap((category) => {
|
|
9749
10093
|
const count = categoryCounts[category] ?? 0;
|
|
@@ -9758,11 +10102,11 @@ function ToolComponentGroup({
|
|
|
9758
10102
|
const summary = `${t("message.toolGroup.status.success")} ${categorySummary}`;
|
|
9759
10103
|
const config = toolStatusConfig.success;
|
|
9760
10104
|
const StatusIcon = config.icon;
|
|
9761
|
-
|
|
10105
|
+
React31.useEffect(() => {
|
|
9762
10106
|
setIsExpanded(!hasFollowingItem);
|
|
9763
10107
|
}, [hasFollowingItem]);
|
|
9764
|
-
return /* @__PURE__ */
|
|
9765
|
-
/* @__PURE__ */
|
|
10108
|
+
return /* @__PURE__ */ jsxs24("div", { className: "px-1 py-1", children: [
|
|
10109
|
+
/* @__PURE__ */ jsxs24(
|
|
9766
10110
|
"button",
|
|
9767
10111
|
{
|
|
9768
10112
|
type: "button",
|
|
@@ -9771,8 +10115,8 @@ function ToolComponentGroup({
|
|
|
9771
10115
|
"aria-controls": contentId,
|
|
9772
10116
|
onClick: () => setIsExpanded((prev) => !prev),
|
|
9773
10117
|
children: [
|
|
9774
|
-
/* @__PURE__ */
|
|
9775
|
-
/* @__PURE__ */
|
|
10118
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex min-w-0 items-center gap-2 text-sm font-medium text-muted-foreground", children: [
|
|
10119
|
+
/* @__PURE__ */ jsx36(
|
|
9776
10120
|
StatusIcon,
|
|
9777
10121
|
{
|
|
9778
10122
|
className: cn(
|
|
@@ -9781,9 +10125,9 @@ function ToolComponentGroup({
|
|
|
9781
10125
|
)
|
|
9782
10126
|
}
|
|
9783
10127
|
),
|
|
9784
|
-
/* @__PURE__ */
|
|
10128
|
+
/* @__PURE__ */ jsx36("span", { className: "truncate", children: summary })
|
|
9785
10129
|
] }),
|
|
9786
|
-
/* @__PURE__ */
|
|
10130
|
+
/* @__PURE__ */ jsx36(
|
|
9787
10131
|
ChevronRight7,
|
|
9788
10132
|
{
|
|
9789
10133
|
"aria-hidden": "true",
|
|
@@ -9796,7 +10140,7 @@ function ToolComponentGroup({
|
|
|
9796
10140
|
]
|
|
9797
10141
|
}
|
|
9798
10142
|
),
|
|
9799
|
-
isExpanded && /* @__PURE__ */
|
|
10143
|
+
isExpanded && /* @__PURE__ */ jsx36("ul", { id: contentId, className: "mt-2 space-y-1.5 overflow-y-auto pr-1", children: items.map((item, index) => /* @__PURE__ */ jsx36(
|
|
9800
10144
|
ToolCallRow,
|
|
9801
10145
|
{
|
|
9802
10146
|
content: item,
|
|
@@ -9816,7 +10160,7 @@ import {
|
|
|
9816
10160
|
REQUEST_USER_INPUT_TOOL_NAME as REQUEST_USER_INPUT_TOOL_NAME2
|
|
9817
10161
|
} from "@xpert-ai/chatkit-types";
|
|
9818
10162
|
import { CheckCircle2 as CheckCircle24 } from "lucide-react";
|
|
9819
|
-
import { jsx as
|
|
10163
|
+
import { jsx as jsx37, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
9820
10164
|
function isRecord3(value) {
|
|
9821
10165
|
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
9822
10166
|
}
|
|
@@ -9928,7 +10272,7 @@ function RequestUserInputResultCard({
|
|
|
9928
10272
|
className
|
|
9929
10273
|
}) {
|
|
9930
10274
|
const { t } = useChatkitTranslation();
|
|
9931
|
-
return /* @__PURE__ */
|
|
10275
|
+
return /* @__PURE__ */ jsxs25(
|
|
9932
10276
|
"section",
|
|
9933
10277
|
{
|
|
9934
10278
|
"aria-label": t("message.requestUserInputResult.title"),
|
|
@@ -9937,23 +10281,23 @@ function RequestUserInputResultCard({
|
|
|
9937
10281
|
className
|
|
9938
10282
|
),
|
|
9939
10283
|
children: [
|
|
9940
|
-
/* @__PURE__ */
|
|
9941
|
-
/* @__PURE__ */
|
|
9942
|
-
/* @__PURE__ */
|
|
10284
|
+
/* @__PURE__ */ jsxs25("div", { className: "mb-2 flex items-center gap-2 text-sm font-semibold text-foreground", children: [
|
|
10285
|
+
/* @__PURE__ */ jsx37(CheckCircle24, { className: "h-4 w-4 text-primary" }),
|
|
10286
|
+
/* @__PURE__ */ jsx37("span", { children: t("message.requestUserInputResult.title") })
|
|
9943
10287
|
] }),
|
|
9944
|
-
/* @__PURE__ */
|
|
10288
|
+
/* @__PURE__ */ jsx37("div", { className: "space-y-2", children: result.answers.map((answer, index) => /* @__PURE__ */ jsxs25(
|
|
9945
10289
|
"div",
|
|
9946
10290
|
{
|
|
9947
10291
|
className: "rounded-md bg-background/70 px-2.5 py-2",
|
|
9948
10292
|
children: [
|
|
9949
|
-
/* @__PURE__ */
|
|
9950
|
-
/* @__PURE__ */
|
|
9951
|
-
/* @__PURE__ */
|
|
9952
|
-
/* @__PURE__ */
|
|
10293
|
+
/* @__PURE__ */ jsx37("div", { className: "text-xs font-medium leading-5 text-muted-foreground", children: answer.question }),
|
|
10294
|
+
/* @__PURE__ */ jsxs25("div", { className: "mt-0.5 flex min-w-0 flex-wrap items-center gap-1.5", children: [
|
|
10295
|
+
/* @__PURE__ */ jsx37("span", { className: "min-w-0 wrap-break-word text-sm font-semibold text-foreground", children: answer.label ?? answer.value }),
|
|
10296
|
+
/* @__PURE__ */ jsx37("span", { className: "rounded-full bg-muted px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground", children: t(
|
|
9953
10297
|
answer.type === "other" ? "message.requestUserInputResult.other" : "message.requestUserInputResult.option"
|
|
9954
10298
|
) })
|
|
9955
10299
|
] }),
|
|
9956
|
-
answer.description ? /* @__PURE__ */
|
|
10300
|
+
answer.description ? /* @__PURE__ */ jsx37("div", { className: "mt-1 text-xs leading-5 text-muted-foreground", children: answer.description }) : null
|
|
9957
10301
|
]
|
|
9958
10302
|
},
|
|
9959
10303
|
`${answer.id}-${index}`
|
|
@@ -9965,18 +10309,18 @@ function RequestUserInputResultCard({
|
|
|
9965
10309
|
|
|
9966
10310
|
// src/components/thread/messages/widget.tsx
|
|
9967
10311
|
import { SurfaceRenderer } from "@xpert-ai/a2ui-react";
|
|
9968
|
-
import { jsx as
|
|
10312
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
9969
10313
|
function WidgetMessage({ messageId, data }) {
|
|
9970
10314
|
const widgets = Array.isArray(data.widgets) ? data.widgets : [];
|
|
9971
10315
|
if (widgets.length === 0) return null;
|
|
9972
10316
|
const baseSurfaceId = `widget-${messageId}`;
|
|
9973
|
-
return /* @__PURE__ */
|
|
10317
|
+
return /* @__PURE__ */ jsx38("div", { className: "space-y-3", children: widgets.map((widget, index) => {
|
|
9974
10318
|
const config = widget?.config;
|
|
9975
10319
|
if (!config || typeof config !== "object") {
|
|
9976
10320
|
return null;
|
|
9977
10321
|
}
|
|
9978
10322
|
const surfaceId = widgets.length > 1 ? `${baseSurfaceId}-${index}` : baseSurfaceId;
|
|
9979
|
-
return /* @__PURE__ */
|
|
10323
|
+
return /* @__PURE__ */ jsx38(
|
|
9980
10324
|
SurfaceRenderer,
|
|
9981
10325
|
{
|
|
9982
10326
|
surfaceId,
|
|
@@ -9988,7 +10332,7 @@ function WidgetMessage({ messageId, data }) {
|
|
|
9988
10332
|
}
|
|
9989
10333
|
|
|
9990
10334
|
// src/components/thread/messages/ai.tsx
|
|
9991
|
-
import { jsx as
|
|
10335
|
+
import { jsx as jsx39, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
9992
10336
|
var assistantMessageStackClassName = "space-y-3 in-data-[density=compact]:space-y-2 in-data-[density=spacious]:space-y-4";
|
|
9993
10337
|
function isTextContent3(content) {
|
|
9994
10338
|
return content.type === "text";
|
|
@@ -10019,14 +10363,16 @@ function safeJson3(value) {
|
|
|
10019
10363
|
function formatDisplayValue3(value) {
|
|
10020
10364
|
return typeof value === "string" ? value : safeJson3(value);
|
|
10021
10365
|
}
|
|
10022
|
-
function ReasoningBlock({
|
|
10366
|
+
function ReasoningBlock({
|
|
10367
|
+
reasoning
|
|
10368
|
+
}) {
|
|
10023
10369
|
const blocks = reasoning.filter((item) => item.text?.trim());
|
|
10024
10370
|
if (blocks.length === 0) return null;
|
|
10025
|
-
return /* @__PURE__ */
|
|
10371
|
+
return /* @__PURE__ */ jsx39("div", { className: "space-y-2", children: blocks.map((item, index) => /* @__PURE__ */ jsx39(
|
|
10026
10372
|
"div",
|
|
10027
10373
|
{
|
|
10028
10374
|
className: "rounded-lg border bg-muted/40 p-3 text-xs text-muted-foreground",
|
|
10029
|
-
children: /* @__PURE__ */
|
|
10375
|
+
children: /* @__PURE__ */ jsx39("p", { className: "whitespace-pre-wrap wrap-break-word leading-relaxed", children: item.text })
|
|
10030
10376
|
},
|
|
10031
10377
|
item.id ?? `reasoning-${index}`
|
|
10032
10378
|
)) });
|
|
@@ -10034,20 +10380,27 @@ function ReasoningBlock({ reasoning }) {
|
|
|
10034
10380
|
function ImageBlock({ content }) {
|
|
10035
10381
|
const imageUrl = typeof content.image_url === "string" ? content.image_url : typeof content.image_url?.url === "string" ? content.image_url.url : null;
|
|
10036
10382
|
if (!imageUrl) {
|
|
10037
|
-
return /* @__PURE__ */
|
|
10038
|
-
/* @__PURE__ */
|
|
10039
|
-
/* @__PURE__ */
|
|
10383
|
+
return /* @__PURE__ */ jsxs26(Card, { children: [
|
|
10384
|
+
/* @__PURE__ */ jsx39(CardHeader, { className: "space-y-1", children: /* @__PURE__ */ jsx39(CardTitle, { className: "text-sm", children: "Image" }) }),
|
|
10385
|
+
/* @__PURE__ */ jsx39(CardContent, { className: "text-xs text-muted-foreground", children: safeJson3(content) })
|
|
10040
10386
|
] });
|
|
10041
10387
|
}
|
|
10042
|
-
return /* @__PURE__ */
|
|
10388
|
+
return /* @__PURE__ */ jsx39("figure", { className: "overflow-hidden rounded-lg border bg-background", children: /* @__PURE__ */ jsx39(
|
|
10389
|
+
"img",
|
|
10390
|
+
{
|
|
10391
|
+
src: imageUrl,
|
|
10392
|
+
alt: "Assistant output",
|
|
10393
|
+
className: "h-auto w-full object-cover"
|
|
10394
|
+
}
|
|
10395
|
+
) });
|
|
10043
10396
|
}
|
|
10044
10397
|
function MemoryBlock({ content }) {
|
|
10045
|
-
return /* @__PURE__ */
|
|
10046
|
-
/* @__PURE__ */
|
|
10047
|
-
/* @__PURE__ */
|
|
10048
|
-
/* @__PURE__ */
|
|
10398
|
+
return /* @__PURE__ */ jsxs26(Card, { children: [
|
|
10399
|
+
/* @__PURE__ */ jsxs26(CardHeader, { className: "flex flex-row items-center justify-between gap-2", children: [
|
|
10400
|
+
/* @__PURE__ */ jsx39(CardTitle, { className: "text-sm", children: "Memory" }),
|
|
10401
|
+
/* @__PURE__ */ jsx39(Badge, { variant: "secondary", children: "Memory" })
|
|
10049
10402
|
] }),
|
|
10050
|
-
/* @__PURE__ */
|
|
10403
|
+
/* @__PURE__ */ jsx39(CardContent, { className: "text-xs text-muted-foreground", children: /* @__PURE__ */ jsx39("pre", { className: "whitespace-pre-wrap wrap-break-word", children: safeJson3(content.data ?? []) }) })
|
|
10051
10404
|
] });
|
|
10052
10405
|
}
|
|
10053
10406
|
function parseStepDate2(value) {
|
|
@@ -10081,11 +10434,11 @@ function formatStepDuration3(durationMs) {
|
|
|
10081
10434
|
}
|
|
10082
10435
|
function ComponentBlock({ content }) {
|
|
10083
10436
|
const { i18n: i18n2 } = useChatkitTranslation();
|
|
10084
|
-
const [isExpanded, setIsExpanded] =
|
|
10085
|
-
const contentRef =
|
|
10086
|
-
const shouldAutoScrollRef =
|
|
10087
|
-
const previousScrollTopRef =
|
|
10088
|
-
const [durationNow, setDurationNow] =
|
|
10437
|
+
const [isExpanded, setIsExpanded] = React33.useState(false);
|
|
10438
|
+
const contentRef = React33.useRef(null);
|
|
10439
|
+
const shouldAutoScrollRef = React33.useRef(true);
|
|
10440
|
+
const previousScrollTopRef = React33.useRef(0);
|
|
10441
|
+
const [durationNow, setDurationNow] = React33.useState(() => Date.now());
|
|
10089
10442
|
const data = getToolStepData(content);
|
|
10090
10443
|
const category = data.category ?? "Component";
|
|
10091
10444
|
const title = getToolActivityLabel(content, i18n2.language);
|
|
@@ -10099,10 +10452,10 @@ function ComponentBlock({ content }) {
|
|
|
10099
10452
|
const endedAt = parseStepDate2(data.end_date);
|
|
10100
10453
|
const durationMs = createdAt === null ? null : Math.max(0, (endedAt ?? durationNow) - createdAt);
|
|
10101
10454
|
const durationLabel = durationMs === null ? null : formatStepDuration3(durationMs);
|
|
10102
|
-
|
|
10455
|
+
React33.useEffect(() => {
|
|
10103
10456
|
if (status === "running" && output !== null) setIsExpanded(true);
|
|
10104
10457
|
}, [status, output]);
|
|
10105
|
-
|
|
10458
|
+
React33.useEffect(() => {
|
|
10106
10459
|
if (status !== "running" || createdAt === null || endedAt !== null) {
|
|
10107
10460
|
return;
|
|
10108
10461
|
}
|
|
@@ -10114,7 +10467,7 @@ function ComponentBlock({ content }) {
|
|
|
10114
10467
|
window.clearInterval(timer);
|
|
10115
10468
|
};
|
|
10116
10469
|
}, [createdAt, endedAt, status]);
|
|
10117
|
-
|
|
10470
|
+
React33.useEffect(() => {
|
|
10118
10471
|
const element = contentRef.current;
|
|
10119
10472
|
if (!element) return;
|
|
10120
10473
|
previousScrollTopRef.current = element.scrollTop;
|
|
@@ -10129,12 +10482,14 @@ function ComponentBlock({ content }) {
|
|
|
10129
10482
|
shouldAutoScrollRef.current = isNearBottom(element);
|
|
10130
10483
|
};
|
|
10131
10484
|
updateAutoScrollState();
|
|
10132
|
-
element.addEventListener("scroll", updateAutoScrollState, {
|
|
10485
|
+
element.addEventListener("scroll", updateAutoScrollState, {
|
|
10486
|
+
passive: true
|
|
10487
|
+
});
|
|
10133
10488
|
return () => {
|
|
10134
10489
|
element.removeEventListener("scroll", updateAutoScrollState);
|
|
10135
10490
|
};
|
|
10136
10491
|
}, [isExpanded]);
|
|
10137
|
-
|
|
10492
|
+
React33.useEffect(() => {
|
|
10138
10493
|
if (status !== "running") {
|
|
10139
10494
|
shouldAutoScrollRef.current = true;
|
|
10140
10495
|
return;
|
|
@@ -10147,76 +10502,112 @@ function ComponentBlock({ content }) {
|
|
|
10147
10502
|
}, [isExpanded, output, status]);
|
|
10148
10503
|
const config = status ? toolStatusConfig[status] : null;
|
|
10149
10504
|
const StatusIcon = config?.icon;
|
|
10150
|
-
return /* @__PURE__ */
|
|
10151
|
-
/* @__PURE__ */
|
|
10152
|
-
|
|
10153
|
-
|
|
10154
|
-
|
|
10155
|
-
|
|
10156
|
-
|
|
10157
|
-
|
|
10158
|
-
|
|
10159
|
-
|
|
10160
|
-
] }),
|
|
10161
|
-
/* @__PURE__ */ jsx37(Badge, { variant: "secondary", className: "rounded-lg px-1.5", children: category }),
|
|
10162
|
-
/* @__PURE__ */ jsx37(
|
|
10163
|
-
"button",
|
|
10164
|
-
{
|
|
10165
|
-
className: "text-muted-foreground hover:text-foreground transition-colors",
|
|
10166
|
-
"aria-label": isExpanded ? "Collapse" : "Expand",
|
|
10167
|
-
children: /* @__PURE__ */ jsx37(
|
|
10168
|
-
ChevronDown4,
|
|
10505
|
+
return /* @__PURE__ */ jsxs26(Card, { children: [
|
|
10506
|
+
/* @__PURE__ */ jsxs26(
|
|
10507
|
+
CardHeader,
|
|
10508
|
+
{
|
|
10509
|
+
className: "flex flex-row items-center justify-between gap-2 px-2 py-1 cursor-pointer",
|
|
10510
|
+
onClick: () => setIsExpanded(!isExpanded),
|
|
10511
|
+
children: [
|
|
10512
|
+
/* @__PURE__ */ jsxs26("div", { className: "flex items-center space-x-1 flex-1 min-w-0", children: [
|
|
10513
|
+
status && StatusIcon && /* @__PURE__ */ jsx39(
|
|
10514
|
+
StatusIcon,
|
|
10169
10515
|
{
|
|
10170
|
-
className: cn(
|
|
10516
|
+
className: cn(
|
|
10517
|
+
"h-4 w-4",
|
|
10518
|
+
config?.iconClass,
|
|
10519
|
+
status === "running" && "animate-spin"
|
|
10520
|
+
)
|
|
10521
|
+
}
|
|
10522
|
+
),
|
|
10523
|
+
/* @__PURE__ */ jsx39(CardTitle, { className: "text-sm truncate", children: title })
|
|
10524
|
+
] }),
|
|
10525
|
+
/* @__PURE__ */ jsxs26("div", { className: "flex flex-wrap items-center gap-2 shrink-0", children: [
|
|
10526
|
+
durationLabel && /* @__PURE__ */ jsxs26("div", { className: "inline-flex items-center gap-1 text-[11px] text-muted-foreground tabular-nums", children: [
|
|
10527
|
+
/* @__PURE__ */ jsx39(Clock32, { className: "h-3 w-3" }),
|
|
10528
|
+
/* @__PURE__ */ jsx39("span", { children: durationLabel })
|
|
10529
|
+
] }),
|
|
10530
|
+
/* @__PURE__ */ jsx39(Badge, { variant: "secondary", className: "rounded-lg px-1.5", children: category }),
|
|
10531
|
+
/* @__PURE__ */ jsx39(
|
|
10532
|
+
"button",
|
|
10533
|
+
{
|
|
10534
|
+
className: "text-muted-foreground hover:text-foreground transition-colors",
|
|
10535
|
+
"aria-label": isExpanded ? "Collapse" : "Expand",
|
|
10536
|
+
children: /* @__PURE__ */ jsx39(
|
|
10537
|
+
ChevronDown4,
|
|
10538
|
+
{
|
|
10539
|
+
className: cn(
|
|
10540
|
+
"h-4 w-4 transition-transform",
|
|
10541
|
+
isExpanded && "rotate-180"
|
|
10542
|
+
)
|
|
10543
|
+
}
|
|
10544
|
+
)
|
|
10171
10545
|
}
|
|
10172
10546
|
)
|
|
10173
|
-
}
|
|
10174
|
-
|
|
10175
|
-
|
|
10176
|
-
|
|
10177
|
-
isExpanded && /* @__PURE__ */
|
|
10178
|
-
|
|
10179
|
-
|
|
10180
|
-
|
|
10547
|
+
] })
|
|
10548
|
+
]
|
|
10549
|
+
}
|
|
10550
|
+
),
|
|
10551
|
+
isExpanded && /* @__PURE__ */ jsxs26(
|
|
10552
|
+
CardContent,
|
|
10553
|
+
{
|
|
10554
|
+
ref: contentRef,
|
|
10555
|
+
className: "text-xs text-muted-foreground max-h-60 overflow-auto",
|
|
10556
|
+
children: [
|
|
10557
|
+
data.input && /* @__PURE__ */ jsx39("pre", { className: "whitespace-pre-wrap wrap-break-word", children: formatDisplayValue3(data.input) }),
|
|
10558
|
+
error ? /* @__PURE__ */ jsx39("pre", { className: "whitespace-pre-wrap wrap-break-word text-destructive", children: formatDisplayValue3(error) }) : hasOutput && /* @__PURE__ */ jsx39("pre", { className: "whitespace-pre-wrap wrap-break-word", children: formatDisplayValue3(fallback) })
|
|
10559
|
+
]
|
|
10560
|
+
}
|
|
10561
|
+
)
|
|
10181
10562
|
] });
|
|
10182
10563
|
}
|
|
10183
10564
|
function UnknownBlock({ content }) {
|
|
10184
|
-
return /* @__PURE__ */
|
|
10185
|
-
/* @__PURE__ */
|
|
10186
|
-
/* @__PURE__ */
|
|
10187
|
-
/* @__PURE__ */
|
|
10565
|
+
return /* @__PURE__ */ jsxs26(Card, { children: [
|
|
10566
|
+
/* @__PURE__ */ jsxs26(CardHeader, { className: "flex flex-row items-center justify-between gap-2", children: [
|
|
10567
|
+
/* @__PURE__ */ jsx39(CardTitle, { className: "text-sm", children: "Assistant Content" }),
|
|
10568
|
+
/* @__PURE__ */ jsx39(Badge, { variant: "outline", children: content.type ?? "unknown" })
|
|
10188
10569
|
] }),
|
|
10189
|
-
/* @__PURE__ */
|
|
10570
|
+
/* @__PURE__ */ jsx39(CardContent, { className: "text-xs text-muted-foreground", children: /* @__PURE__ */ jsx39("pre", { className: "whitespace-pre-wrap break-words", children: safeJson3(content) }) })
|
|
10190
10571
|
] });
|
|
10191
10572
|
}
|
|
10192
10573
|
function renderContentItem(content, index, message, lookupMessages, options) {
|
|
10193
10574
|
const messageId = message.id;
|
|
10194
10575
|
const textClassName = options?.isAgentOutput ? "text-sm [&_.markdown-content_p]:!leading-6" : void 0;
|
|
10195
10576
|
if (typeof content === "string") {
|
|
10196
|
-
return /* @__PURE__ */
|
|
10577
|
+
return /* @__PURE__ */ jsx39("div", { className: textClassName, children: /* @__PURE__ */ jsx39(MarkdownText, { children: content }) }, `text-${index}`);
|
|
10197
10578
|
}
|
|
10198
10579
|
if (isTextContent3(content)) {
|
|
10199
|
-
return /* @__PURE__ */
|
|
10580
|
+
return /* @__PURE__ */ jsx39("div", { className: textClassName, children: /* @__PURE__ */ jsx39(MarkdownText, { children: content.text }) }, content.id ?? `text-${index}`);
|
|
10200
10581
|
}
|
|
10201
10582
|
if (isReasoningContent3(content)) {
|
|
10202
|
-
return /* @__PURE__ */
|
|
10583
|
+
return /* @__PURE__ */ jsx39("div", { children: /* @__PURE__ */ jsx39(ReasoningBlock, { reasoning: [content] }) }, content.id ?? `reasoning-${index}`);
|
|
10203
10584
|
}
|
|
10204
10585
|
if (isImageContent(content)) {
|
|
10205
|
-
return /* @__PURE__ */
|
|
10586
|
+
return /* @__PURE__ */ jsx39("div", { children: /* @__PURE__ */ jsx39(ImageBlock, { content }) }, content.id ?? `image-${index}`);
|
|
10206
10587
|
}
|
|
10207
10588
|
if (isComponentContent3(content)) {
|
|
10589
|
+
if (isContextCompressionComponent(content)) {
|
|
10590
|
+
return /* @__PURE__ */ jsx39(
|
|
10591
|
+
"div",
|
|
10592
|
+
{
|
|
10593
|
+
className: "w-full",
|
|
10594
|
+
children: /* @__PURE__ */ jsx39(ContextCompressionMessage, { content })
|
|
10595
|
+
},
|
|
10596
|
+
content.id ?? `context-compression-${index}`
|
|
10597
|
+
);
|
|
10598
|
+
}
|
|
10208
10599
|
const requestUserInputResult = getRequestUserInputResultCardData(
|
|
10209
10600
|
content,
|
|
10210
10601
|
lookupMessages
|
|
10211
10602
|
);
|
|
10212
10603
|
if (requestUserInputResult) {
|
|
10213
|
-
return /* @__PURE__ */
|
|
10604
|
+
return /* @__PURE__ */ jsx39("div", { children: /* @__PURE__ */ jsx39(RequestUserInputResultCard, { result: requestUserInputResult }) }, content.id ?? `request-user-input-result-${index}`);
|
|
10214
10605
|
}
|
|
10215
10606
|
if (isWidgetComponent2(content)) {
|
|
10216
|
-
return /* @__PURE__ */
|
|
10607
|
+
return /* @__PURE__ */ jsx39("div", { children: /* @__PURE__ */ jsx39(WidgetMessage, { messageId, data: content.data }) }, content.id ?? `widget-${index}`);
|
|
10217
10608
|
}
|
|
10218
10609
|
if (getComponentMessagePresentation(content, getToolStepData(content)) === "grouped-step") {
|
|
10219
|
-
return /* @__PURE__ */
|
|
10610
|
+
return /* @__PURE__ */ jsx39("div", { children: /* @__PURE__ */ jsx39(
|
|
10220
10611
|
ToolComponentGroup,
|
|
10221
10612
|
{
|
|
10222
10613
|
items: [content],
|
|
@@ -10227,15 +10618,15 @@ function renderContentItem(content, index, message, lookupMessages, options) {
|
|
|
10227
10618
|
}
|
|
10228
10619
|
) }, content.id ?? `component-group-${index}`);
|
|
10229
10620
|
}
|
|
10230
|
-
return /* @__PURE__ */
|
|
10621
|
+
return /* @__PURE__ */ jsx39("div", { children: /* @__PURE__ */ jsx39(ComponentBlock, { content }) }, content.id ?? `component-${index}`);
|
|
10231
10622
|
}
|
|
10232
10623
|
if (isMemoryContent(content)) {
|
|
10233
|
-
return /* @__PURE__ */
|
|
10624
|
+
return /* @__PURE__ */ jsx39("div", { children: /* @__PURE__ */ jsx39(MemoryBlock, { content }) }, content.id ?? `memory-${index}`);
|
|
10234
10625
|
}
|
|
10235
10626
|
if (isAgentEventContent(content)) {
|
|
10236
|
-
return /* @__PURE__ */
|
|
10627
|
+
return /* @__PURE__ */ jsx39("div", { children: /* @__PURE__ */ jsx39(AgentEventRow, { content }) }, content.id ?? `agent-event-${index}`);
|
|
10237
10628
|
}
|
|
10238
|
-
return /* @__PURE__ */
|
|
10629
|
+
return /* @__PURE__ */ jsx39("div", { children: /* @__PURE__ */ jsx39(UnknownBlock, { content }) }, content.id ?? `unknown-${index}`);
|
|
10239
10630
|
}
|
|
10240
10631
|
function renderContentUnit(unit, message, lookupMessages, hasFollowingItem, options) {
|
|
10241
10632
|
if (unit.type === "item") {
|
|
@@ -10246,7 +10637,7 @@ function renderContentUnit(unit, message, lookupMessages, hasFollowingItem, opti
|
|
|
10246
10637
|
isAgentOutput: options?.isAgentOutput
|
|
10247
10638
|
});
|
|
10248
10639
|
}
|
|
10249
|
-
return /* @__PURE__ */
|
|
10640
|
+
return /* @__PURE__ */ jsx39("div", { children: /* @__PURE__ */ jsx39(
|
|
10250
10641
|
ToolComponentGroup,
|
|
10251
10642
|
{
|
|
10252
10643
|
items: unit.items,
|
|
@@ -10283,7 +10674,7 @@ function renderAssistantRenderUnits(units, message, lookupMessages, options, dep
|
|
|
10283
10674
|
const batch = entryBatch;
|
|
10284
10675
|
entryBatch = [];
|
|
10285
10676
|
rendered.push(
|
|
10286
|
-
/* @__PURE__ */
|
|
10677
|
+
/* @__PURE__ */ jsx39(React33.Fragment, { children: renderEntryBatch(batch, message, lookupMessages, hasFollowingItem, {
|
|
10287
10678
|
...options,
|
|
10288
10679
|
isAgentOutput: depth > 0
|
|
10289
10680
|
}) }, `entries-${batch[0]?.order ?? rendered.length}`)
|
|
@@ -10300,7 +10691,7 @@ function renderAssistantRenderUnits(units, message, lookupMessages, options, dep
|
|
|
10300
10691
|
}
|
|
10301
10692
|
flushEntries(true);
|
|
10302
10693
|
rendered.push(
|
|
10303
|
-
/* @__PURE__ */
|
|
10694
|
+
/* @__PURE__ */ jsx39(
|
|
10304
10695
|
AgentRunGroup,
|
|
10305
10696
|
{
|
|
10306
10697
|
node: unit.node,
|
|
@@ -10325,7 +10716,7 @@ function renderContent(message, lookupMessages, options) {
|
|
|
10325
10716
|
message
|
|
10326
10717
|
);
|
|
10327
10718
|
if (renderTree.hasAgentRuns) {
|
|
10328
|
-
return /* @__PURE__ */
|
|
10719
|
+
return /* @__PURE__ */ jsx39("div", { className: assistantMessageStackClassName, children: renderAssistantRenderUnits(
|
|
10329
10720
|
renderTree.units,
|
|
10330
10721
|
message,
|
|
10331
10722
|
lookupMessages,
|
|
@@ -10335,13 +10726,13 @@ function renderContent(message, lookupMessages, options) {
|
|
|
10335
10726
|
const content = message.content;
|
|
10336
10727
|
if (typeof content === "string") {
|
|
10337
10728
|
if (!content.trim()) return null;
|
|
10338
|
-
return /* @__PURE__ */
|
|
10729
|
+
return /* @__PURE__ */ jsx39(MarkdownText, { children: content });
|
|
10339
10730
|
}
|
|
10340
10731
|
if (!Array.isArray(content) || content.length === 0) return null;
|
|
10341
10732
|
const renderUnits = buildToolComponentRenderUnits(content, {
|
|
10342
10733
|
shouldGroupComponent: (item) => getRequestUserInputResultCardData(item, lookupMessages) === null
|
|
10343
10734
|
});
|
|
10344
|
-
return /* @__PURE__ */
|
|
10735
|
+
return /* @__PURE__ */ jsx39("div", { className: "space-y-3", children: renderUnits.map(
|
|
10345
10736
|
(unit, index) => renderContentUnit(
|
|
10346
10737
|
unit,
|
|
10347
10738
|
message,
|
|
@@ -10361,7 +10752,7 @@ function AssistantStreamingIndicator({
|
|
|
10361
10752
|
thinking: t("message.thinking"),
|
|
10362
10753
|
answering: t("message.answering")
|
|
10363
10754
|
};
|
|
10364
|
-
return /* @__PURE__ */
|
|
10755
|
+
return /* @__PURE__ */ jsxs26(
|
|
10365
10756
|
"div",
|
|
10366
10757
|
{
|
|
10367
10758
|
className: cn(
|
|
@@ -10369,18 +10760,18 @@ function AssistantStreamingIndicator({
|
|
|
10369
10760
|
className
|
|
10370
10761
|
),
|
|
10371
10762
|
children: [
|
|
10372
|
-
status === "loading" && /* @__PURE__ */
|
|
10373
|
-
status === "thinking" && /* @__PURE__ */
|
|
10374
|
-
/* @__PURE__ */
|
|
10375
|
-
/* @__PURE__ */
|
|
10376
|
-
/* @__PURE__ */
|
|
10763
|
+
status === "loading" && /* @__PURE__ */ jsx39(Loader26, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
10764
|
+
status === "thinking" && /* @__PURE__ */ jsxs26("div", { className: "flex items-end gap-1", "aria-hidden": "true", children: [
|
|
10765
|
+
/* @__PURE__ */ jsx39("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:-0.3s]" }),
|
|
10766
|
+
/* @__PURE__ */ jsx39("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:-0.15s]" }),
|
|
10767
|
+
/* @__PURE__ */ jsx39("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce" })
|
|
10377
10768
|
] }),
|
|
10378
|
-
status === "answering" && /* @__PURE__ */
|
|
10379
|
-
/* @__PURE__ */
|
|
10380
|
-
/* @__PURE__ */
|
|
10381
|
-
/* @__PURE__ */
|
|
10769
|
+
status === "answering" && /* @__PURE__ */ jsxs26("div", { className: "flex items-end gap-1", "aria-hidden": "true", children: [
|
|
10770
|
+
/* @__PURE__ */ jsx39("span", { className: "h-2 w-0.5 rounded-full bg-current animate-pulse [animation-delay:-0.25s]" }),
|
|
10771
|
+
/* @__PURE__ */ jsx39("span", { className: "h-3 w-0.5 rounded-full bg-current animate-pulse [animation-delay:-0.1s]" }),
|
|
10772
|
+
/* @__PURE__ */ jsx39("span", { className: "h-2.5 w-0.5 rounded-full bg-current animate-pulse" })
|
|
10382
10773
|
] }),
|
|
10383
|
-
/* @__PURE__ */
|
|
10774
|
+
/* @__PURE__ */ jsx39("span", { children: labelMap[status] })
|
|
10384
10775
|
]
|
|
10385
10776
|
}
|
|
10386
10777
|
);
|
|
@@ -10409,42 +10800,42 @@ function AssistantMessage({
|
|
|
10409
10800
|
organizationId,
|
|
10410
10801
|
apiUrl
|
|
10411
10802
|
});
|
|
10412
|
-
const reasoningNode = hasReasoning ? /* @__PURE__ */
|
|
10803
|
+
const reasoningNode = hasReasoning ? /* @__PURE__ */ jsx39(ReasoningBlock, { reasoning: rootReasoning ?? [] }) : null;
|
|
10413
10804
|
if (!hasContent && !hasReasoning && !resolvedStreamingStatus) return null;
|
|
10414
10805
|
const streamingClass = isStreaming ? "streaming-active" : "";
|
|
10415
10806
|
if (!hasContent && !hasReasoning && resolvedStreamingStatus) {
|
|
10416
|
-
return /* @__PURE__ */
|
|
10807
|
+
return /* @__PURE__ */ jsx39("div", { className: cn("space-y-3", streamingClass, className), children: /* @__PURE__ */ jsx39(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) });
|
|
10417
10808
|
}
|
|
10418
10809
|
if (hasContent && hasReasoning) {
|
|
10419
|
-
return /* @__PURE__ */
|
|
10420
|
-
/* @__PURE__ */
|
|
10810
|
+
return /* @__PURE__ */ jsxs26("div", { className: cn("space-y-3", streamingClass, className), children: [
|
|
10811
|
+
/* @__PURE__ */ jsxs26(
|
|
10421
10812
|
Tabs,
|
|
10422
10813
|
{
|
|
10423
10814
|
defaultValue: message.status === "reasoning" ? "reasoning" : "answer",
|
|
10424
10815
|
className: "w-full",
|
|
10425
10816
|
children: [
|
|
10426
|
-
/* @__PURE__ */
|
|
10427
|
-
/* @__PURE__ */
|
|
10428
|
-
/* @__PURE__ */
|
|
10817
|
+
/* @__PURE__ */ jsxs26(TabsList, { className: "", children: [
|
|
10818
|
+
/* @__PURE__ */ jsx39(TabsTrigger, { value: "answer", children: t("message.answer") }),
|
|
10819
|
+
/* @__PURE__ */ jsx39(TabsTrigger, { value: "reasoning", children: t("message.reasoning") })
|
|
10429
10820
|
] }),
|
|
10430
|
-
/* @__PURE__ */
|
|
10431
|
-
/* @__PURE__ */
|
|
10821
|
+
/* @__PURE__ */ jsx39(TabsContent, { value: "answer", className: "space-y-3", children: answerNode }),
|
|
10822
|
+
/* @__PURE__ */ jsx39(TabsContent, { value: "reasoning", className: "space-y-3", children: reasoningNode })
|
|
10432
10823
|
]
|
|
10433
10824
|
}
|
|
10434
10825
|
),
|
|
10435
|
-
resolvedStreamingStatus ? /* @__PURE__ */
|
|
10826
|
+
resolvedStreamingStatus ? /* @__PURE__ */ jsx39(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) : null
|
|
10436
10827
|
] });
|
|
10437
10828
|
}
|
|
10438
|
-
return /* @__PURE__ */
|
|
10829
|
+
return /* @__PURE__ */ jsxs26("div", { className: cn("space-y-3", streamingClass, className), children: [
|
|
10439
10830
|
hasReasoning ? reasoningNode : answerNode,
|
|
10440
|
-
resolvedStreamingStatus ? /* @__PURE__ */
|
|
10831
|
+
resolvedStreamingStatus ? /* @__PURE__ */ jsx39(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) : null
|
|
10441
10832
|
] });
|
|
10442
10833
|
}
|
|
10443
10834
|
|
|
10444
10835
|
// src/components/thread/MessageActions.tsx
|
|
10445
|
-
import * as
|
|
10446
|
-
import { Check as
|
|
10447
|
-
import { jsx as
|
|
10836
|
+
import * as React34 from "react";
|
|
10837
|
+
import { Check as Check5, Copy as Copy3, RefreshCw } from "lucide-react";
|
|
10838
|
+
import { jsx as jsx40, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
10448
10839
|
function MessageActions({
|
|
10449
10840
|
content,
|
|
10450
10841
|
isAssistant = false,
|
|
@@ -10453,7 +10844,7 @@ function MessageActions({
|
|
|
10453
10844
|
className
|
|
10454
10845
|
}) {
|
|
10455
10846
|
const { t } = useChatkitTranslation();
|
|
10456
|
-
const [copied, setCopied] =
|
|
10847
|
+
const [copied, setCopied] = React34.useState(false);
|
|
10457
10848
|
const handleCopy = async () => {
|
|
10458
10849
|
try {
|
|
10459
10850
|
await navigator.clipboard.writeText(content);
|
|
@@ -10466,7 +10857,7 @@ function MessageActions({
|
|
|
10466
10857
|
if (isStreaming) {
|
|
10467
10858
|
return null;
|
|
10468
10859
|
}
|
|
10469
|
-
return /* @__PURE__ */
|
|
10860
|
+
return /* @__PURE__ */ jsxs27(
|
|
10470
10861
|
"div",
|
|
10471
10862
|
{
|
|
10472
10863
|
className: cn(
|
|
@@ -10474,7 +10865,7 @@ function MessageActions({
|
|
|
10474
10865
|
className
|
|
10475
10866
|
),
|
|
10476
10867
|
children: [
|
|
10477
|
-
/* @__PURE__ */
|
|
10868
|
+
/* @__PURE__ */ jsx40(
|
|
10478
10869
|
"button",
|
|
10479
10870
|
{
|
|
10480
10871
|
type: "button",
|
|
@@ -10484,17 +10875,17 @@ function MessageActions({
|
|
|
10484
10875
|
copied && "text-green-500"
|
|
10485
10876
|
),
|
|
10486
10877
|
title: copied ? t("messageActions.copied") : t("messageActions.copy"),
|
|
10487
|
-
children: copied ? /* @__PURE__ */
|
|
10878
|
+
children: copied ? /* @__PURE__ */ jsx40(Check5, { size: 14 }) : /* @__PURE__ */ jsx40(Copy3, { size: 14 })
|
|
10488
10879
|
}
|
|
10489
10880
|
),
|
|
10490
|
-
isAssistant && onRetry && /* @__PURE__ */
|
|
10881
|
+
isAssistant && onRetry && /* @__PURE__ */ jsx40(
|
|
10491
10882
|
"button",
|
|
10492
10883
|
{
|
|
10493
10884
|
type: "button",
|
|
10494
10885
|
onClick: onRetry,
|
|
10495
10886
|
className: "p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",
|
|
10496
10887
|
title: t("messageActions.regenerate"),
|
|
10497
|
-
children: /* @__PURE__ */
|
|
10888
|
+
children: /* @__PURE__ */ jsx40(RefreshCw, { size: 14 })
|
|
10498
10889
|
}
|
|
10499
10890
|
)
|
|
10500
10891
|
]
|
|
@@ -10515,18 +10906,18 @@ import {
|
|
|
10515
10906
|
Sparkles as Sparkles3,
|
|
10516
10907
|
Zap
|
|
10517
10908
|
} from "lucide-react";
|
|
10518
|
-
import { jsx as
|
|
10909
|
+
import { jsx as jsx41, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
10519
10910
|
function getIconComponent2(icon) {
|
|
10520
10911
|
const iconMap = {
|
|
10521
|
-
"circle-question": /* @__PURE__ */
|
|
10522
|
-
"lightbulb": /* @__PURE__ */
|
|
10523
|
-
"sparkle": /* @__PURE__ */
|
|
10524
|
-
"write": /* @__PURE__ */
|
|
10525
|
-
"search": /* @__PURE__ */
|
|
10526
|
-
"globe": /* @__PURE__ */
|
|
10527
|
-
"book-open": /* @__PURE__ */
|
|
10528
|
-
"compass": /* @__PURE__ */
|
|
10529
|
-
"bolt": /* @__PURE__ */
|
|
10912
|
+
"circle-question": /* @__PURE__ */ jsx41(HelpCircle, { size: 20 }),
|
|
10913
|
+
"lightbulb": /* @__PURE__ */ jsx41(Lightbulb2, { size: 20 }),
|
|
10914
|
+
"sparkle": /* @__PURE__ */ jsx41(Sparkles3, { size: 20 }),
|
|
10915
|
+
"write": /* @__PURE__ */ jsx41(Pencil3, { size: 20 }),
|
|
10916
|
+
"search": /* @__PURE__ */ jsx41(Search3, { size: 20 }),
|
|
10917
|
+
"globe": /* @__PURE__ */ jsx41(Globe2, { size: 20 }),
|
|
10918
|
+
"book-open": /* @__PURE__ */ jsx41(BookOpen2, { size: 20 }),
|
|
10919
|
+
"compass": /* @__PURE__ */ jsx41(Compass, { size: 20 }),
|
|
10920
|
+
"bolt": /* @__PURE__ */ jsx41(Zap, { size: 20 })
|
|
10530
10921
|
};
|
|
10531
10922
|
return icon ? iconMap[icon] || iconMap["sparkle"] : iconMap["sparkle"];
|
|
10532
10923
|
}
|
|
@@ -10534,9 +10925,9 @@ function StartScreen({ startScreen, onPromptClick, className }) {
|
|
|
10534
10925
|
const { t } = useChatkitTranslation();
|
|
10535
10926
|
const greeting = startScreen?.greeting ?? t("startScreen.greeting");
|
|
10536
10927
|
const prompts = startScreen?.prompts ?? [];
|
|
10537
|
-
return /* @__PURE__ */
|
|
10538
|
-
/* @__PURE__ */
|
|
10539
|
-
prompts.length > 0 && /* @__PURE__ */
|
|
10928
|
+
return /* @__PURE__ */ jsxs28("div", { className: cn("flex flex-col items-center justify-center py-12 px-4", className), children: [
|
|
10929
|
+
/* @__PURE__ */ jsx41("div", { className: "mb-8 text-center", children: /* @__PURE__ */ jsx41("h2", { className: "text-2xl font-semibold text-foreground mb-2", children: greeting }) }),
|
|
10930
|
+
prompts.length > 0 && /* @__PURE__ */ jsx41("div", { className: "w-full max-w-2xl", children: /* @__PURE__ */ jsx41("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: prompts.map((item, index) => /* @__PURE__ */ jsxs28(
|
|
10540
10931
|
"button",
|
|
10541
10932
|
{
|
|
10542
10933
|
type: "button",
|
|
@@ -10547,8 +10938,8 @@ function StartScreen({ startScreen, onPromptClick, className }) {
|
|
|
10547
10938
|
"focus:outline-none focus:ring-2 focus:ring-primary/20"
|
|
10548
10939
|
),
|
|
10549
10940
|
children: [
|
|
10550
|
-
/* @__PURE__ */
|
|
10551
|
-
/* @__PURE__ */
|
|
10941
|
+
/* @__PURE__ */ jsx41("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary", children: getIconComponent2(item.icon) }),
|
|
10942
|
+
/* @__PURE__ */ jsx41("span", { className: "text-sm font-medium text-foreground", children: item.label })
|
|
10552
10943
|
]
|
|
10553
10944
|
},
|
|
10554
10945
|
`prompt-${index}`
|
|
@@ -10557,7 +10948,7 @@ function StartScreen({ startScreen, onPromptClick, className }) {
|
|
|
10557
10948
|
}
|
|
10558
10949
|
|
|
10559
10950
|
// src/hooks/useThreads.ts
|
|
10560
|
-
import * as
|
|
10951
|
+
import * as React36 from "react";
|
|
10561
10952
|
var DEFAULT_LIMIT = 50;
|
|
10562
10953
|
var getThreadTitle = (threadRecord) => {
|
|
10563
10954
|
const title = threadRecord.title?.trim();
|
|
@@ -10610,16 +11001,16 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10610
11001
|
isLoading: isStreamLoading,
|
|
10611
11002
|
error: streamError
|
|
10612
11003
|
} = useStreamContext();
|
|
10613
|
-
const [threadRecords, setThreadRecords] =
|
|
10614
|
-
const [isLoading, setIsLoading] =
|
|
10615
|
-
const [error, setError] =
|
|
10616
|
-
const upsertThreadRecord =
|
|
11004
|
+
const [threadRecords, setThreadRecords] = React36.useState([]);
|
|
11005
|
+
const [isLoading, setIsLoading] = React36.useState(false);
|
|
11006
|
+
const [error, setError] = React36.useState(null);
|
|
11007
|
+
const upsertThreadRecord = React36.useCallback((threadRecord) => {
|
|
10617
11008
|
setThreadRecords((prev) => {
|
|
10618
11009
|
const next = prev.filter((item) => item.id !== threadRecord.id);
|
|
10619
11010
|
return sortThreadRecords([threadRecord, ...next]);
|
|
10620
11011
|
});
|
|
10621
11012
|
}, []);
|
|
10622
|
-
const refreshThreads =
|
|
11013
|
+
const refreshThreads = React36.useCallback(async () => {
|
|
10623
11014
|
setIsLoading(true);
|
|
10624
11015
|
setError(null);
|
|
10625
11016
|
try {
|
|
@@ -10635,7 +11026,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10635
11026
|
setIsLoading(false);
|
|
10636
11027
|
}
|
|
10637
11028
|
}, [client, limit, assistantId]);
|
|
10638
|
-
const createThread =
|
|
11029
|
+
const createThread = React36.useCallback(
|
|
10639
11030
|
async (input) => {
|
|
10640
11031
|
setError(null);
|
|
10641
11032
|
const payload = {};
|
|
@@ -10649,7 +11040,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10649
11040
|
},
|
|
10650
11041
|
[client, upsertThreadRecord]
|
|
10651
11042
|
);
|
|
10652
|
-
const updateThread =
|
|
11043
|
+
const updateThread = React36.useCallback(
|
|
10653
11044
|
async (recordId, payload) => {
|
|
10654
11045
|
setError(null);
|
|
10655
11046
|
const updated = await client.conversations.update(recordId, payload);
|
|
@@ -10658,7 +11049,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10658
11049
|
},
|
|
10659
11050
|
[client, upsertThreadRecord]
|
|
10660
11051
|
);
|
|
10661
|
-
const deleteThread =
|
|
11052
|
+
const deleteThread = React36.useCallback(
|
|
10662
11053
|
async (recordId) => {
|
|
10663
11054
|
setError(null);
|
|
10664
11055
|
await client.conversations.delete(recordId);
|
|
@@ -10666,11 +11057,11 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10666
11057
|
},
|
|
10667
11058
|
[client]
|
|
10668
11059
|
);
|
|
10669
|
-
|
|
11060
|
+
React36.useEffect(() => {
|
|
10670
11061
|
if (!isReady) return;
|
|
10671
11062
|
void refreshThreads();
|
|
10672
11063
|
}, [refreshThreads, isReady]);
|
|
10673
|
-
|
|
11064
|
+
React36.useEffect(() => {
|
|
10674
11065
|
if (!threadId || !isStreamLoading) return;
|
|
10675
11066
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
10676
11067
|
const busyStatus = "busy";
|
|
@@ -10691,7 +11082,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10691
11082
|
return changed ? sortThreadRecords(next) : prev;
|
|
10692
11083
|
});
|
|
10693
11084
|
}, [threadId, isStreamLoading]);
|
|
10694
|
-
|
|
11085
|
+
React36.useEffect(() => {
|
|
10695
11086
|
const message = getErrorMessage(streamError)?.trim();
|
|
10696
11087
|
if (!threadId || !message) return;
|
|
10697
11088
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -10713,7 +11104,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10713
11104
|
return changed ? sortThreadRecords(next) : prev;
|
|
10714
11105
|
});
|
|
10715
11106
|
}, [threadId, streamError]);
|
|
10716
|
-
|
|
11107
|
+
React36.useEffect(() => {
|
|
10717
11108
|
if (!isReady || !threadId || isStreamLoading) return;
|
|
10718
11109
|
let cancelled = false;
|
|
10719
11110
|
void client.conversations.search({ where: { threadId }, limit: 1 }).then((result) => {
|
|
@@ -10727,7 +11118,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10727
11118
|
cancelled = true;
|
|
10728
11119
|
};
|
|
10729
11120
|
}, [client, threadId, upsertThreadRecord, isReady, isStreamLoading]);
|
|
10730
|
-
const threads =
|
|
11121
|
+
const threads = React36.useMemo(
|
|
10731
11122
|
() => threadRecords.map((threadRecord) => toThreadItem(threadRecord)),
|
|
10732
11123
|
[threadRecords]
|
|
10733
11124
|
);
|
|
@@ -10744,10 +11135,10 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10744
11135
|
}
|
|
10745
11136
|
|
|
10746
11137
|
// src/components/thread/context-usage-indicator.tsx
|
|
10747
|
-
import * as
|
|
11138
|
+
import * as React37 from "react";
|
|
10748
11139
|
|
|
10749
11140
|
// src/components/ui/progress-circle.tsx
|
|
10750
|
-
import { jsx as
|
|
11141
|
+
import { jsx as jsx42, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
10751
11142
|
function clamp2(input, a, b) {
|
|
10752
11143
|
return Math.max(Math.min(input, Math.max(a, b)), Math.min(a, b));
|
|
10753
11144
|
}
|
|
@@ -10770,7 +11161,7 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
|
|
|
10770
11161
|
return (
|
|
10771
11162
|
// biome-ignore lint/a11y/useFocusableInteractive: false positive (progress + progressbar are not focusable interactives)
|
|
10772
11163
|
// biome-ignore lint/nursery/useAriaPropsSupportedByRole: biome rule at odds with mdn docs (presumed nursary bug with rule)
|
|
10773
|
-
/* @__PURE__ */
|
|
11164
|
+
/* @__PURE__ */ jsxs29(
|
|
10774
11165
|
"svg",
|
|
10775
11166
|
{
|
|
10776
11167
|
role: "progressbar",
|
|
@@ -10781,8 +11172,8 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
|
|
|
10781
11172
|
"aria-valuemax": 100,
|
|
10782
11173
|
...restSvgProps,
|
|
10783
11174
|
children: [
|
|
10784
|
-
/* @__PURE__ */
|
|
10785
|
-
/* @__PURE__ */
|
|
11175
|
+
/* @__PURE__ */ jsx42("circle", { ...commonParams, className: "stroke-current/25" }),
|
|
11176
|
+
/* @__PURE__ */ jsx42(
|
|
10786
11177
|
"circle",
|
|
10787
11178
|
{
|
|
10788
11179
|
...commonParams,
|
|
@@ -10801,7 +11192,7 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
|
|
|
10801
11192
|
};
|
|
10802
11193
|
|
|
10803
11194
|
// src/components/thread/context-usage-indicator.tsx
|
|
10804
|
-
import { jsx as
|
|
11195
|
+
import { jsx as jsx43, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
10805
11196
|
var kNumberFormatter = new Intl.NumberFormat("en-US", {
|
|
10806
11197
|
minimumFractionDigits: 0,
|
|
10807
11198
|
maximumFractionDigits: 1
|
|
@@ -10834,20 +11225,20 @@ function ContextUsageIndicator({
|
|
|
10834
11225
|
}) {
|
|
10835
11226
|
const { t } = useChatkitTranslation();
|
|
10836
11227
|
const stream = useStreamContext();
|
|
10837
|
-
const [maxContextSize, setMaxContextSize] =
|
|
10838
|
-
const [usedContextSize, setUsedContextSize] =
|
|
10839
|
-
const [assistantAgentKey, setAssistantAgentKey] =
|
|
10840
|
-
const latestRealtimeUsageRef =
|
|
11228
|
+
const [maxContextSize, setMaxContextSize] = React37.useState(null);
|
|
11229
|
+
const [usedContextSize, setUsedContextSize] = React37.useState(null);
|
|
11230
|
+
const [assistantAgentKey, setAssistantAgentKey] = React37.useState(null);
|
|
11231
|
+
const latestRealtimeUsageRef = React37.useRef({
|
|
10841
11232
|
threadId: null,
|
|
10842
11233
|
agentKey: null,
|
|
10843
11234
|
usedTokens: null
|
|
10844
11235
|
});
|
|
10845
|
-
const realtimeUsage =
|
|
11236
|
+
const realtimeUsage = React37.useMemo(
|
|
10846
11237
|
() => getThreadContextUsage(stream.contextUsageByAgentKey, assistantAgentKey),
|
|
10847
11238
|
[assistantAgentKey, stream.contextUsageByAgentKey]
|
|
10848
11239
|
);
|
|
10849
11240
|
const realtimeUsedContextSize = getThreadContextUsageTotalTokens(realtimeUsage);
|
|
10850
|
-
|
|
11241
|
+
React37.useEffect(() => {
|
|
10851
11242
|
if (!stream.client || !stream.assistantId) {
|
|
10852
11243
|
setMaxContextSize(null);
|
|
10853
11244
|
setAssistantAgentKey(null);
|
|
@@ -10867,18 +11258,18 @@ function ContextUsageIndicator({
|
|
|
10867
11258
|
cancelled = true;
|
|
10868
11259
|
};
|
|
10869
11260
|
}, [stream.client, stream.assistantId]);
|
|
10870
|
-
|
|
11261
|
+
React37.useEffect(() => {
|
|
10871
11262
|
latestRealtimeUsageRef.current = {
|
|
10872
11263
|
threadId: stream.threadId ?? null,
|
|
10873
11264
|
agentKey: assistantAgentKey,
|
|
10874
11265
|
usedTokens: realtimeUsedContextSize
|
|
10875
11266
|
};
|
|
10876
11267
|
}, [assistantAgentKey, realtimeUsedContextSize, stream.threadId]);
|
|
10877
|
-
|
|
11268
|
+
React37.useEffect(() => {
|
|
10878
11269
|
if (realtimeUsedContextSize == null) return;
|
|
10879
11270
|
setUsedContextSize(realtimeUsedContextSize);
|
|
10880
11271
|
}, [realtimeUsedContextSize]);
|
|
10881
|
-
|
|
11272
|
+
React37.useEffect(() => {
|
|
10882
11273
|
if (!stream.client) {
|
|
10883
11274
|
setUsedContextSize(null);
|
|
10884
11275
|
return;
|
|
@@ -10943,8 +11334,8 @@ function ContextUsageIndicator({
|
|
|
10943
11334
|
});
|
|
10944
11335
|
const usageLabelWithSuffix = usageLabel.endsWith(":") ? usageLabel : `${usageLabel}:`;
|
|
10945
11336
|
const progressClassName = percent >= 90 ? "text-destructive" : percent >= 75 ? "text-amber-500" : "text-primary dark:text-zinc-300";
|
|
10946
|
-
return /* @__PURE__ */
|
|
10947
|
-
/* @__PURE__ */
|
|
11337
|
+
return /* @__PURE__ */ jsxs30(Tooltip, { children: [
|
|
11338
|
+
/* @__PURE__ */ jsx43(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx43(
|
|
10948
11339
|
"button",
|
|
10949
11340
|
{
|
|
10950
11341
|
type: "button",
|
|
@@ -10953,31 +11344,31 @@ function ContextUsageIndicator({
|
|
|
10953
11344
|
className
|
|
10954
11345
|
),
|
|
10955
11346
|
"aria-label": `${usageLabelWithSuffix} ${usageFullLabel}. ${usageTokensLabel}`,
|
|
10956
|
-
children: /* @__PURE__ */
|
|
11347
|
+
children: /* @__PURE__ */ jsx43(ProgressCircle, { value: percent, className: cn("size-3.5", progressClassName) })
|
|
10957
11348
|
}
|
|
10958
11349
|
) }),
|
|
10959
|
-
/* @__PURE__ */
|
|
10960
|
-
/* @__PURE__ */
|
|
10961
|
-
/* @__PURE__ */
|
|
10962
|
-
/* @__PURE__ */
|
|
11350
|
+
/* @__PURE__ */ jsxs30(TooltipContent, { side: "top", sideOffset: 6, className: "space-y-0.5 px-3 py-2 text-center", children: [
|
|
11351
|
+
/* @__PURE__ */ jsx43("div", { className: "text-primary-foreground/70", children: usageLabelWithSuffix }),
|
|
11352
|
+
/* @__PURE__ */ jsx43("div", { className: "font-medium text-primary-foreground/80", children: usageFullLabel }),
|
|
11353
|
+
/* @__PURE__ */ jsx43("div", { className: "text-sm font-semibold", children: usageTokensLabel })
|
|
10963
11354
|
] })
|
|
10964
11355
|
] });
|
|
10965
11356
|
}
|
|
10966
11357
|
|
|
10967
11358
|
// src/components/pet/PetBridge.tsx
|
|
10968
|
-
import * as
|
|
11359
|
+
import * as React38 from "react";
|
|
10969
11360
|
import { normalizePetOptions } from "@xpert-ai/chatkit-types";
|
|
10970
11361
|
function PetBridge({ pet, state }) {
|
|
10971
11362
|
const parentMessenger = useParentMessenger();
|
|
10972
11363
|
const sendEvent = parentMessenger?.sendEvent;
|
|
10973
|
-
const options =
|
|
10974
|
-
|
|
11364
|
+
const options = React38.useMemo(() => normalizePetOptions(pet), [pet]);
|
|
11365
|
+
React38.useEffect(() => {
|
|
10975
11366
|
if (!sendEvent) {
|
|
10976
11367
|
return;
|
|
10977
11368
|
}
|
|
10978
11369
|
sendEvent("pet_options_change", { pet: pet ?? null });
|
|
10979
11370
|
}, [sendEvent, pet]);
|
|
10980
|
-
|
|
11371
|
+
React38.useEffect(() => {
|
|
10981
11372
|
if (!sendEvent || !options) {
|
|
10982
11373
|
return;
|
|
10983
11374
|
}
|
|
@@ -10987,15 +11378,15 @@ function PetBridge({ pet, state }) {
|
|
|
10987
11378
|
}
|
|
10988
11379
|
|
|
10989
11380
|
// src/components/settings/SettingsSheet.tsx
|
|
10990
|
-
import * as
|
|
11381
|
+
import * as React45 from "react";
|
|
10991
11382
|
import { PawPrint, Settings } from "lucide-react";
|
|
10992
11383
|
|
|
10993
11384
|
// src/components/ui/input.tsx
|
|
10994
|
-
import * as
|
|
10995
|
-
import { jsx as
|
|
10996
|
-
var Input =
|
|
11385
|
+
import * as React39 from "react";
|
|
11386
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
11387
|
+
var Input = React39.forwardRef(
|
|
10997
11388
|
({ className, type, ...props }, ref) => {
|
|
10998
|
-
return /* @__PURE__ */
|
|
11389
|
+
return /* @__PURE__ */ jsx44(
|
|
10999
11390
|
"input",
|
|
11000
11391
|
{
|
|
11001
11392
|
ref,
|
|
@@ -11015,17 +11406,17 @@ Input.displayName = "Input";
|
|
|
11015
11406
|
import "react";
|
|
11016
11407
|
import { Select as SelectPrimitive } from "radix-ui";
|
|
11017
11408
|
import { ChevronDownIcon as ChevronDownIcon2, CheckIcon as CheckIcon4, ChevronUpIcon } from "lucide-react";
|
|
11018
|
-
import { jsx as
|
|
11409
|
+
import { jsx as jsx45, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
11019
11410
|
function Select({
|
|
11020
11411
|
...props
|
|
11021
11412
|
}) {
|
|
11022
|
-
return /* @__PURE__ */
|
|
11413
|
+
return /* @__PURE__ */ jsx45(SelectPrimitive.Root, { "data-slot": "select", ...props });
|
|
11023
11414
|
}
|
|
11024
11415
|
function SelectGroup({
|
|
11025
11416
|
className,
|
|
11026
11417
|
...props
|
|
11027
11418
|
}) {
|
|
11028
|
-
return /* @__PURE__ */
|
|
11419
|
+
return /* @__PURE__ */ jsx45(
|
|
11029
11420
|
SelectPrimitive.Group,
|
|
11030
11421
|
{
|
|
11031
11422
|
"data-slot": "select-group",
|
|
@@ -11037,7 +11428,7 @@ function SelectGroup({
|
|
|
11037
11428
|
function SelectValue({
|
|
11038
11429
|
...props
|
|
11039
11430
|
}) {
|
|
11040
|
-
return /* @__PURE__ */
|
|
11431
|
+
return /* @__PURE__ */ jsx45(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
|
|
11041
11432
|
}
|
|
11042
11433
|
function SelectTrigger({
|
|
11043
11434
|
className,
|
|
@@ -11045,7 +11436,7 @@ function SelectTrigger({
|
|
|
11045
11436
|
children,
|
|
11046
11437
|
...props
|
|
11047
11438
|
}) {
|
|
11048
|
-
return /* @__PURE__ */
|
|
11439
|
+
return /* @__PURE__ */ jsxs31(
|
|
11049
11440
|
SelectPrimitive.Trigger,
|
|
11050
11441
|
{
|
|
11051
11442
|
"data-slot": "select-trigger",
|
|
@@ -11057,7 +11448,7 @@ function SelectTrigger({
|
|
|
11057
11448
|
...props,
|
|
11058
11449
|
children: [
|
|
11059
11450
|
children,
|
|
11060
|
-
/* @__PURE__ */
|
|
11451
|
+
/* @__PURE__ */ jsx45(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx45(ChevronDownIcon2, { className: "pointer-events-none size-4 text-muted-foreground" }) })
|
|
11061
11452
|
]
|
|
11062
11453
|
}
|
|
11063
11454
|
);
|
|
@@ -11069,7 +11460,7 @@ function SelectContent({
|
|
|
11069
11460
|
align = "center",
|
|
11070
11461
|
...props
|
|
11071
11462
|
}) {
|
|
11072
|
-
return /* @__PURE__ */
|
|
11463
|
+
return /* @__PURE__ */ jsx45(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs31(
|
|
11073
11464
|
SelectPrimitive.Content,
|
|
11074
11465
|
{
|
|
11075
11466
|
"data-slot": "select-content",
|
|
@@ -11079,8 +11470,8 @@ function SelectContent({
|
|
|
11079
11470
|
align,
|
|
11080
11471
|
...props,
|
|
11081
11472
|
children: [
|
|
11082
|
-
/* @__PURE__ */
|
|
11083
|
-
/* @__PURE__ */
|
|
11473
|
+
/* @__PURE__ */ jsx45(SelectScrollUpButton, {}),
|
|
11474
|
+
/* @__PURE__ */ jsx45(
|
|
11084
11475
|
SelectPrimitive.Viewport,
|
|
11085
11476
|
{
|
|
11086
11477
|
"data-position": position,
|
|
@@ -11091,7 +11482,7 @@ function SelectContent({
|
|
|
11091
11482
|
children
|
|
11092
11483
|
}
|
|
11093
11484
|
),
|
|
11094
|
-
/* @__PURE__ */
|
|
11485
|
+
/* @__PURE__ */ jsx45(SelectScrollDownButton, {})
|
|
11095
11486
|
]
|
|
11096
11487
|
}
|
|
11097
11488
|
) });
|
|
@@ -11101,7 +11492,7 @@ function SelectItem({
|
|
|
11101
11492
|
children,
|
|
11102
11493
|
...props
|
|
11103
11494
|
}) {
|
|
11104
|
-
return /* @__PURE__ */
|
|
11495
|
+
return /* @__PURE__ */ jsxs31(
|
|
11105
11496
|
SelectPrimitive.Item,
|
|
11106
11497
|
{
|
|
11107
11498
|
"data-slot": "select-item",
|
|
@@ -11111,8 +11502,8 @@ function SelectItem({
|
|
|
11111
11502
|
),
|
|
11112
11503
|
...props,
|
|
11113
11504
|
children: [
|
|
11114
|
-
/* @__PURE__ */
|
|
11115
|
-
/* @__PURE__ */
|
|
11505
|
+
/* @__PURE__ */ jsx45("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ jsx45(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx45(CheckIcon4, { className: "pointer-events-none" }) }) }),
|
|
11506
|
+
/* @__PURE__ */ jsx45(SelectPrimitive.ItemText, { children })
|
|
11116
11507
|
]
|
|
11117
11508
|
}
|
|
11118
11509
|
);
|
|
@@ -11121,7 +11512,7 @@ function SelectScrollUpButton({
|
|
|
11121
11512
|
className,
|
|
11122
11513
|
...props
|
|
11123
11514
|
}) {
|
|
11124
|
-
return /* @__PURE__ */
|
|
11515
|
+
return /* @__PURE__ */ jsx45(
|
|
11125
11516
|
SelectPrimitive.ScrollUpButton,
|
|
11126
11517
|
{
|
|
11127
11518
|
"data-slot": "select-scroll-up-button",
|
|
@@ -11130,7 +11521,7 @@ function SelectScrollUpButton({
|
|
|
11130
11521
|
className
|
|
11131
11522
|
),
|
|
11132
11523
|
...props,
|
|
11133
|
-
children: /* @__PURE__ */
|
|
11524
|
+
children: /* @__PURE__ */ jsx45(
|
|
11134
11525
|
ChevronUpIcon,
|
|
11135
11526
|
{}
|
|
11136
11527
|
)
|
|
@@ -11141,7 +11532,7 @@ function SelectScrollDownButton({
|
|
|
11141
11532
|
className,
|
|
11142
11533
|
...props
|
|
11143
11534
|
}) {
|
|
11144
|
-
return /* @__PURE__ */
|
|
11535
|
+
return /* @__PURE__ */ jsx45(
|
|
11145
11536
|
SelectPrimitive.ScrollDownButton,
|
|
11146
11537
|
{
|
|
11147
11538
|
"data-slot": "select-scroll-down-button",
|
|
@@ -11150,7 +11541,7 @@ function SelectScrollDownButton({
|
|
|
11150
11541
|
className
|
|
11151
11542
|
),
|
|
11152
11543
|
...props,
|
|
11153
|
-
children: /* @__PURE__ */
|
|
11544
|
+
children: /* @__PURE__ */ jsx45(
|
|
11154
11545
|
ChevronDownIcon2,
|
|
11155
11546
|
{}
|
|
11156
11547
|
)
|
|
@@ -11159,9 +11550,9 @@ function SelectScrollDownButton({
|
|
|
11159
11550
|
}
|
|
11160
11551
|
|
|
11161
11552
|
// src/components/ui/slider.tsx
|
|
11162
|
-
import * as
|
|
11553
|
+
import * as React41 from "react";
|
|
11163
11554
|
import { Slider as SliderPrimitive } from "radix-ui";
|
|
11164
|
-
import { jsx as
|
|
11555
|
+
import { jsx as jsx46, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
11165
11556
|
function Slider({
|
|
11166
11557
|
className,
|
|
11167
11558
|
defaultValue,
|
|
@@ -11170,11 +11561,11 @@ function Slider({
|
|
|
11170
11561
|
max = 100,
|
|
11171
11562
|
...props
|
|
11172
11563
|
}) {
|
|
11173
|
-
const _values =
|
|
11564
|
+
const _values = React41.useMemo(
|
|
11174
11565
|
() => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
|
|
11175
11566
|
[value, defaultValue, min, max]
|
|
11176
11567
|
);
|
|
11177
|
-
return /* @__PURE__ */
|
|
11568
|
+
return /* @__PURE__ */ jsxs32(
|
|
11178
11569
|
SliderPrimitive.Root,
|
|
11179
11570
|
{
|
|
11180
11571
|
"data-slot": "slider",
|
|
@@ -11188,12 +11579,12 @@ function Slider({
|
|
|
11188
11579
|
),
|
|
11189
11580
|
...props,
|
|
11190
11581
|
children: [
|
|
11191
|
-
/* @__PURE__ */
|
|
11582
|
+
/* @__PURE__ */ jsx46(
|
|
11192
11583
|
SliderPrimitive.Track,
|
|
11193
11584
|
{
|
|
11194
11585
|
"data-slot": "slider-track",
|
|
11195
11586
|
className: "relative grow overflow-hidden rounded-full bg-muted data-horizontal:h-1 data-horizontal:w-full data-vertical:h-full data-vertical:w-1",
|
|
11196
|
-
children: /* @__PURE__ */
|
|
11587
|
+
children: /* @__PURE__ */ jsx46(
|
|
11197
11588
|
SliderPrimitive.Range,
|
|
11198
11589
|
{
|
|
11199
11590
|
"data-slot": "slider-range",
|
|
@@ -11202,7 +11593,7 @@ function Slider({
|
|
|
11202
11593
|
)
|
|
11203
11594
|
}
|
|
11204
11595
|
),
|
|
11205
|
-
Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */
|
|
11596
|
+
Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */ jsx46(
|
|
11206
11597
|
SliderPrimitive.Thumb,
|
|
11207
11598
|
{
|
|
11208
11599
|
"data-slot": "slider-thumb",
|
|
@@ -11216,7 +11607,7 @@ function Slider({
|
|
|
11216
11607
|
}
|
|
11217
11608
|
|
|
11218
11609
|
// src/components/ui/toggle-group.tsx
|
|
11219
|
-
import * as
|
|
11610
|
+
import * as React43 from "react";
|
|
11220
11611
|
import "class-variance-authority";
|
|
11221
11612
|
import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui";
|
|
11222
11613
|
|
|
@@ -11224,7 +11615,7 @@ import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui";
|
|
|
11224
11615
|
import "react";
|
|
11225
11616
|
import { cva as cva2 } from "class-variance-authority";
|
|
11226
11617
|
import { Toggle as TogglePrimitive } from "radix-ui";
|
|
11227
|
-
import { jsx as
|
|
11618
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
11228
11619
|
var toggleVariants = cva2(
|
|
11229
11620
|
"group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
11230
11621
|
{
|
|
@@ -11247,8 +11638,8 @@ var toggleVariants = cva2(
|
|
|
11247
11638
|
);
|
|
11248
11639
|
|
|
11249
11640
|
// src/components/ui/toggle-group.tsx
|
|
11250
|
-
import { jsx as
|
|
11251
|
-
var ToggleGroupContext =
|
|
11641
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
11642
|
+
var ToggleGroupContext = React43.createContext({
|
|
11252
11643
|
size: "default",
|
|
11253
11644
|
variant: "default",
|
|
11254
11645
|
spacing: 0,
|
|
@@ -11263,7 +11654,7 @@ function ToggleGroup({
|
|
|
11263
11654
|
children,
|
|
11264
11655
|
...props
|
|
11265
11656
|
}) {
|
|
11266
|
-
return /* @__PURE__ */
|
|
11657
|
+
return /* @__PURE__ */ jsx48(
|
|
11267
11658
|
ToggleGroupPrimitive.Root,
|
|
11268
11659
|
{
|
|
11269
11660
|
"data-slot": "toggle-group",
|
|
@@ -11277,7 +11668,7 @@ function ToggleGroup({
|
|
|
11277
11668
|
className
|
|
11278
11669
|
),
|
|
11279
11670
|
...props,
|
|
11280
|
-
children: /* @__PURE__ */
|
|
11671
|
+
children: /* @__PURE__ */ jsx48(
|
|
11281
11672
|
ToggleGroupContext.Provider,
|
|
11282
11673
|
{
|
|
11283
11674
|
value: { variant, size: size2, spacing, orientation },
|
|
@@ -11294,8 +11685,8 @@ function ToggleGroupItem({
|
|
|
11294
11685
|
size: size2 = "default",
|
|
11295
11686
|
...props
|
|
11296
11687
|
}) {
|
|
11297
|
-
const context =
|
|
11298
|
-
return /* @__PURE__ */
|
|
11688
|
+
const context = React43.useContext(ToggleGroupContext);
|
|
11689
|
+
return /* @__PURE__ */ jsx48(
|
|
11299
11690
|
ToggleGroupPrimitive.Item,
|
|
11300
11691
|
{
|
|
11301
11692
|
"data-slot": "toggle-group-item",
|
|
@@ -11535,7 +11926,7 @@ import {
|
|
|
11535
11926
|
} from "@xpert-ai/chatkit-types";
|
|
11536
11927
|
|
|
11537
11928
|
// src/components/pet/PetPreview.tsx
|
|
11538
|
-
import { jsx as
|
|
11929
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
11539
11930
|
function escapeCssUrl(value) {
|
|
11540
11931
|
return value.replace(/["\\]/g, "\\$&");
|
|
11541
11932
|
}
|
|
@@ -11543,7 +11934,7 @@ function PetPreview({ src, label, className }) {
|
|
|
11543
11934
|
const scale = 0.13;
|
|
11544
11935
|
const width = petSpriteAtlas.cellWidth;
|
|
11545
11936
|
const height = petSpriteAtlas.cellHeight;
|
|
11546
|
-
return /* @__PURE__ */
|
|
11937
|
+
return /* @__PURE__ */ jsx49(
|
|
11547
11938
|
"span",
|
|
11548
11939
|
{
|
|
11549
11940
|
className: cn(
|
|
@@ -11552,7 +11943,7 @@ function PetPreview({ src, label, className }) {
|
|
|
11552
11943
|
),
|
|
11553
11944
|
"aria-hidden": "true",
|
|
11554
11945
|
title: label,
|
|
11555
|
-
children: /* @__PURE__ */
|
|
11946
|
+
children: /* @__PURE__ */ jsx49(
|
|
11556
11947
|
"span",
|
|
11557
11948
|
{
|
|
11558
11949
|
className: "absolute left-1/2 top-1/2 block",
|
|
@@ -11574,7 +11965,7 @@ function PetPreview({ src, label, className }) {
|
|
|
11574
11965
|
}
|
|
11575
11966
|
|
|
11576
11967
|
// src/components/settings/SettingsSheet.tsx
|
|
11577
|
-
import { jsx as
|
|
11968
|
+
import { jsx as jsx50, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
11578
11969
|
var CHARACTER_TYPES2 = [
|
|
11579
11970
|
"builtin",
|
|
11580
11971
|
"atlas"
|
|
@@ -11590,13 +11981,13 @@ function SettingsSheet({
|
|
|
11590
11981
|
onSave
|
|
11591
11982
|
}) {
|
|
11592
11983
|
const { t } = useChatkitTranslation();
|
|
11593
|
-
const [draft, setDraft] =
|
|
11594
|
-
|
|
11984
|
+
const [draft, setDraft] = React45.useState(settings);
|
|
11985
|
+
React45.useEffect(() => {
|
|
11595
11986
|
if (open) {
|
|
11596
11987
|
setDraft(petRequired ? { ...settings, enabled: true } : settings);
|
|
11597
11988
|
}
|
|
11598
11989
|
}, [open, petRequired, settings]);
|
|
11599
|
-
const updateDraft =
|
|
11990
|
+
const updateDraft = React45.useCallback(
|
|
11600
11991
|
(patch) => {
|
|
11601
11992
|
setDraft((previous) => ({ ...previous, ...patch }));
|
|
11602
11993
|
},
|
|
@@ -11614,23 +12005,23 @@ function SettingsSheet({
|
|
|
11614
12005
|
defaultValue: selectedBuiltinPet.label
|
|
11615
12006
|
}
|
|
11616
12007
|
);
|
|
11617
|
-
return /* @__PURE__ */
|
|
11618
|
-
/* @__PURE__ */
|
|
11619
|
-
/* @__PURE__ */
|
|
11620
|
-
/* @__PURE__ */
|
|
12008
|
+
return /* @__PURE__ */ jsx50(Sheet, { open, onOpenChange, children: /* @__PURE__ */ jsxs33(SheetContent, { side: "right", className: "w-[min(92vw,26rem)] overflow-y-auto", children: [
|
|
12009
|
+
/* @__PURE__ */ jsx50(SheetHeader, { children: /* @__PURE__ */ jsxs33("div", { className: "flex items-center gap-2", children: [
|
|
12010
|
+
/* @__PURE__ */ jsx50("span", { className: "flex h-8 w-8 items-center justify-center rounded-md bg-primary/10 text-primary", children: /* @__PURE__ */ jsx50(Settings, { size: 16 }) }),
|
|
12011
|
+
/* @__PURE__ */ jsx50(SheetTitle, { children: t("settings.title") })
|
|
11621
12012
|
] }) }),
|
|
11622
|
-
/* @__PURE__ */
|
|
11623
|
-
/* @__PURE__ */
|
|
11624
|
-
/* @__PURE__ */
|
|
11625
|
-
/* @__PURE__ */
|
|
11626
|
-
/* @__PURE__ */
|
|
12013
|
+
/* @__PURE__ */ jsxs33("form", { className: "mt-6 space-y-5", onSubmit: handleSubmit, children: [
|
|
12014
|
+
/* @__PURE__ */ jsxs33("section", { className: "space-y-5", children: [
|
|
12015
|
+
/* @__PURE__ */ jsxs33("div", { className: "flex items-center gap-2", children: [
|
|
12016
|
+
/* @__PURE__ */ jsx50("span", { className: "flex h-7 w-7 items-center justify-center rounded-md bg-muted text-muted-foreground", children: /* @__PURE__ */ jsx50(PawPrint, { size: 15 }) }),
|
|
12017
|
+
/* @__PURE__ */ jsx50("h3", { className: "text-sm font-semibold", children: t("pet.settings.title") })
|
|
11627
12018
|
] }),
|
|
11628
|
-
/* @__PURE__ */
|
|
11629
|
-
/* @__PURE__ */
|
|
11630
|
-
/* @__PURE__ */
|
|
11631
|
-
petRequired && /* @__PURE__ */
|
|
12019
|
+
/* @__PURE__ */ jsxs33("label", { className: "flex items-center justify-between gap-4 rounded-md border border-border px-3 py-2", children: [
|
|
12020
|
+
/* @__PURE__ */ jsxs33("span", { className: "min-w-0", children: [
|
|
12021
|
+
/* @__PURE__ */ jsx50("span", { className: "block text-sm font-medium", children: t("pet.settings.enabled") }),
|
|
12022
|
+
petRequired && /* @__PURE__ */ jsx50("span", { className: "mt-0.5 block text-xs text-muted-foreground", children: t("pet.settings.requiredHint") })
|
|
11632
12023
|
] }),
|
|
11633
|
-
/* @__PURE__ */
|
|
12024
|
+
/* @__PURE__ */ jsx50(
|
|
11634
12025
|
"button",
|
|
11635
12026
|
{
|
|
11636
12027
|
type: "button",
|
|
@@ -11643,7 +12034,7 @@ function SettingsSheet({
|
|
|
11643
12034
|
draft.enabled ? "bg-primary" : "bg-muted-foreground/20",
|
|
11644
12035
|
petRequired ? "cursor-not-allowed opacity-70" : ""
|
|
11645
12036
|
].join(" "),
|
|
11646
|
-
children: /* @__PURE__ */
|
|
12037
|
+
children: /* @__PURE__ */ jsx50(
|
|
11647
12038
|
"span",
|
|
11648
12039
|
{
|
|
11649
12040
|
className: [
|
|
@@ -11656,9 +12047,9 @@ function SettingsSheet({
|
|
|
11656
12047
|
)
|
|
11657
12048
|
] })
|
|
11658
12049
|
] }),
|
|
11659
|
-
/* @__PURE__ */
|
|
11660
|
-
/* @__PURE__ */
|
|
11661
|
-
/* @__PURE__ */
|
|
12050
|
+
/* @__PURE__ */ jsxs33("div", { className: "space-y-2", children: [
|
|
12051
|
+
/* @__PURE__ */ jsx50("span", { id: "chatkit-pet-type-label", className: "text-sm font-medium", children: t("pet.settings.characterType") }),
|
|
12052
|
+
/* @__PURE__ */ jsx50(
|
|
11662
12053
|
ToggleGroup,
|
|
11663
12054
|
{
|
|
11664
12055
|
id: "chatkit-pet-type",
|
|
@@ -11673,7 +12064,7 @@ function SettingsSheet({
|
|
|
11673
12064
|
variant: "outline",
|
|
11674
12065
|
spacing: 2,
|
|
11675
12066
|
className: "!w-full",
|
|
11676
|
-
children: CHARACTER_TYPES2.map((type) => /* @__PURE__ */
|
|
12067
|
+
children: CHARACTER_TYPES2.map((type) => /* @__PURE__ */ jsx50(
|
|
11677
12068
|
ToggleGroupItem,
|
|
11678
12069
|
{
|
|
11679
12070
|
value: type,
|
|
@@ -11685,8 +12076,8 @@ function SettingsSheet({
|
|
|
11685
12076
|
}
|
|
11686
12077
|
)
|
|
11687
12078
|
] }),
|
|
11688
|
-
draft.characterType === "builtin" && /* @__PURE__ */
|
|
11689
|
-
/* @__PURE__ */
|
|
12079
|
+
draft.characterType === "builtin" && /* @__PURE__ */ jsxs33("div", { className: "space-y-2", children: [
|
|
12080
|
+
/* @__PURE__ */ jsx50(
|
|
11690
12081
|
"label",
|
|
11691
12082
|
{
|
|
11692
12083
|
htmlFor: "chatkit-pet-builtin",
|
|
@@ -11694,7 +12085,7 @@ function SettingsSheet({
|
|
|
11694
12085
|
children: t("pet.settings.builtin")
|
|
11695
12086
|
}
|
|
11696
12087
|
),
|
|
11697
|
-
/* @__PURE__ */
|
|
12088
|
+
/* @__PURE__ */ jsxs33(
|
|
11698
12089
|
Select,
|
|
11699
12090
|
{
|
|
11700
12091
|
value: selectedBuiltinPet.id,
|
|
@@ -11705,26 +12096,26 @@ function SettingsSheet({
|
|
|
11705
12096
|
}
|
|
11706
12097
|
},
|
|
11707
12098
|
children: [
|
|
11708
|
-
/* @__PURE__ */
|
|
12099
|
+
/* @__PURE__ */ jsx50(
|
|
11709
12100
|
SelectTrigger,
|
|
11710
12101
|
{
|
|
11711
12102
|
id: "chatkit-pet-builtin",
|
|
11712
12103
|
className: "min-h-12 w-full px-3 py-2",
|
|
11713
|
-
children: /* @__PURE__ */
|
|
12104
|
+
children: /* @__PURE__ */ jsx50(SelectValue, { placeholder: selectedBuiltinPetLabel })
|
|
11714
12105
|
}
|
|
11715
12106
|
),
|
|
11716
|
-
/* @__PURE__ */
|
|
12107
|
+
/* @__PURE__ */ jsx50(SelectContent, { className: "w-[var(--radix-select-trigger-width)]", children: /* @__PURE__ */ jsx50(SelectGroup, { children: INCLUDED_PET_OPTIONS.map((pet) => {
|
|
11717
12108
|
const label = t(`pet.settings.builtins.${pet.id}`, {
|
|
11718
12109
|
defaultValue: pet.label
|
|
11719
12110
|
});
|
|
11720
|
-
return /* @__PURE__ */
|
|
12111
|
+
return /* @__PURE__ */ jsx50(
|
|
11721
12112
|
SelectItem,
|
|
11722
12113
|
{
|
|
11723
12114
|
value: pet.id,
|
|
11724
12115
|
className: "min-h-10 py-1.5 pl-2 pr-8",
|
|
11725
|
-
children: /* @__PURE__ */
|
|
11726
|
-
/* @__PURE__ */
|
|
11727
|
-
/* @__PURE__ */
|
|
12116
|
+
children: /* @__PURE__ */ jsxs33("span", { className: "flex min-w-0 items-center gap-2", children: [
|
|
12117
|
+
/* @__PURE__ */ jsx50(PetPreview, { src: pet.previewSrc, label }),
|
|
12118
|
+
/* @__PURE__ */ jsx50("span", { className: "min-w-0 truncate", children: label })
|
|
11728
12119
|
] })
|
|
11729
12120
|
},
|
|
11730
12121
|
pet.id
|
|
@@ -11734,8 +12125,8 @@ function SettingsSheet({
|
|
|
11734
12125
|
}
|
|
11735
12126
|
)
|
|
11736
12127
|
] }),
|
|
11737
|
-
draft.characterType === "atlas" && /* @__PURE__ */
|
|
11738
|
-
/* @__PURE__ */
|
|
12128
|
+
draft.characterType === "atlas" && /* @__PURE__ */ jsxs33("div", { className: "space-y-2", children: [
|
|
12129
|
+
/* @__PURE__ */ jsx50(
|
|
11739
12130
|
"label",
|
|
11740
12131
|
{
|
|
11741
12132
|
className: "text-sm font-medium",
|
|
@@ -11743,7 +12134,7 @@ function SettingsSheet({
|
|
|
11743
12134
|
children: t("pet.settings.atlasUrl")
|
|
11744
12135
|
}
|
|
11745
12136
|
),
|
|
11746
|
-
/* @__PURE__ */
|
|
12137
|
+
/* @__PURE__ */ jsx50(
|
|
11747
12138
|
Input,
|
|
11748
12139
|
{
|
|
11749
12140
|
id: "chatkit-pet-atlas",
|
|
@@ -11753,15 +12144,15 @@ function SettingsSheet({
|
|
|
11753
12144
|
}
|
|
11754
12145
|
)
|
|
11755
12146
|
] }),
|
|
11756
|
-
/* @__PURE__ */
|
|
11757
|
-
/* @__PURE__ */
|
|
11758
|
-
/* @__PURE__ */
|
|
11759
|
-
/* @__PURE__ */
|
|
12147
|
+
/* @__PURE__ */ jsxs33("div", { className: "space-y-2", children: [
|
|
12148
|
+
/* @__PURE__ */ jsxs33("div", { className: "flex items-center justify-between gap-4", children: [
|
|
12149
|
+
/* @__PURE__ */ jsx50("label", { className: "text-sm font-medium", htmlFor: "chatkit-pet-scale", children: t("pet.settings.scale") }),
|
|
12150
|
+
/* @__PURE__ */ jsxs33("span", { className: "text-xs tabular-nums text-muted-foreground", children: [
|
|
11760
12151
|
draft.scale.toFixed(2),
|
|
11761
12152
|
"x"
|
|
11762
12153
|
] })
|
|
11763
12154
|
] }),
|
|
11764
|
-
/* @__PURE__ */
|
|
12155
|
+
/* @__PURE__ */ jsx50(
|
|
11765
12156
|
Slider,
|
|
11766
12157
|
{
|
|
11767
12158
|
id: "chatkit-pet-scale",
|
|
@@ -11775,8 +12166,8 @@ function SettingsSheet({
|
|
|
11775
12166
|
}
|
|
11776
12167
|
)
|
|
11777
12168
|
] }),
|
|
11778
|
-
/* @__PURE__ */
|
|
11779
|
-
/* @__PURE__ */
|
|
12169
|
+
/* @__PURE__ */ jsxs33("label", { className: "flex items-center gap-2 text-sm", children: [
|
|
12170
|
+
/* @__PURE__ */ jsx50(
|
|
11780
12171
|
"input",
|
|
11781
12172
|
{
|
|
11782
12173
|
type: "checkbox",
|
|
@@ -11787,8 +12178,8 @@ function SettingsSheet({
|
|
|
11787
12178
|
),
|
|
11788
12179
|
t("pet.settings.draggable")
|
|
11789
12180
|
] }),
|
|
11790
|
-
/* @__PURE__ */
|
|
11791
|
-
/* @__PURE__ */
|
|
12181
|
+
/* @__PURE__ */ jsxs33("label", { className: "flex items-center gap-2 text-sm", children: [
|
|
12182
|
+
/* @__PURE__ */ jsx50(
|
|
11792
12183
|
"input",
|
|
11793
12184
|
{
|
|
11794
12185
|
type: "checkbox",
|
|
@@ -11799,8 +12190,8 @@ function SettingsSheet({
|
|
|
11799
12190
|
),
|
|
11800
12191
|
t("pet.settings.persistPosition")
|
|
11801
12192
|
] }),
|
|
11802
|
-
/* @__PURE__ */
|
|
11803
|
-
/* @__PURE__ */
|
|
12193
|
+
/* @__PURE__ */ jsxs33("div", { className: "flex justify-end gap-2 pt-2", children: [
|
|
12194
|
+
/* @__PURE__ */ jsx50(
|
|
11804
12195
|
Button,
|
|
11805
12196
|
{
|
|
11806
12197
|
type: "button",
|
|
@@ -11809,7 +12200,7 @@ function SettingsSheet({
|
|
|
11809
12200
|
children: t("pet.settings.cancel")
|
|
11810
12201
|
}
|
|
11811
12202
|
),
|
|
11812
|
-
/* @__PURE__ */
|
|
12203
|
+
/* @__PURE__ */ jsx50(Button, { type: "submit", children: t("pet.settings.save") })
|
|
11813
12204
|
] })
|
|
11814
12205
|
] })
|
|
11815
12206
|
] }) });
|
|
@@ -12315,7 +12706,7 @@ function findDomPointForComposerOffset(root, offset) {
|
|
|
12315
12706
|
}
|
|
12316
12707
|
|
|
12317
12708
|
// src/components/chat.tsx
|
|
12318
|
-
import { Fragment as Fragment7, jsx as
|
|
12709
|
+
import { Fragment as Fragment7, jsx as jsx51, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
12319
12710
|
var defaultApiUrl2 = import.meta.env.VITE_XPERTAI_API_URL;
|
|
12320
12711
|
var COMPOSER_INPUT_MAX_HEIGHT = 128;
|
|
12321
12712
|
var LONG_TEXT_REFERENCE_THRESHOLD = 5e3;
|
|
@@ -12447,8 +12838,8 @@ function ReferenceChip({
|
|
|
12447
12838
|
}) {
|
|
12448
12839
|
const metaLine = getReferenceMetaLine(reference);
|
|
12449
12840
|
const isComposer = variant === "composer";
|
|
12450
|
-
const Icon = reference.type === "quote" ? Quote : reference.type === "image" ? ImageIcon :
|
|
12451
|
-
return /* @__PURE__ */
|
|
12841
|
+
const Icon = reference.type === "quote" ? Quote : reference.type === "image" ? ImageIcon : FileText4;
|
|
12842
|
+
return /* @__PURE__ */ jsxs34(
|
|
12452
12843
|
"div",
|
|
12453
12844
|
{
|
|
12454
12845
|
className: cn(
|
|
@@ -12457,7 +12848,7 @@ function ReferenceChip({
|
|
|
12457
12848
|
),
|
|
12458
12849
|
title: getReferenceTitle(reference),
|
|
12459
12850
|
children: [
|
|
12460
|
-
/* @__PURE__ */
|
|
12851
|
+
/* @__PURE__ */ jsx51(
|
|
12461
12852
|
Icon,
|
|
12462
12853
|
{
|
|
12463
12854
|
size: isComposer ? 14 : 12,
|
|
@@ -12467,8 +12858,8 @@ function ReferenceChip({
|
|
|
12467
12858
|
)
|
|
12468
12859
|
}
|
|
12469
12860
|
),
|
|
12470
|
-
/* @__PURE__ */
|
|
12471
|
-
/* @__PURE__ */
|
|
12861
|
+
/* @__PURE__ */ jsxs34("div", { className: "min-w-0 flex-1", children: [
|
|
12862
|
+
/* @__PURE__ */ jsx51(
|
|
12472
12863
|
"div",
|
|
12473
12864
|
{
|
|
12474
12865
|
className: cn(
|
|
@@ -12478,7 +12869,7 @@ function ReferenceChip({
|
|
|
12478
12869
|
children: getReferenceLabel(reference)
|
|
12479
12870
|
}
|
|
12480
12871
|
),
|
|
12481
|
-
metaLine && /* @__PURE__ */
|
|
12872
|
+
metaLine && /* @__PURE__ */ jsx51(
|
|
12482
12873
|
"div",
|
|
12483
12874
|
{
|
|
12484
12875
|
className: cn(
|
|
@@ -12489,7 +12880,7 @@ function ReferenceChip({
|
|
|
12489
12880
|
}
|
|
12490
12881
|
)
|
|
12491
12882
|
] }),
|
|
12492
|
-
onRemove && removeLabel && /* @__PURE__ */
|
|
12883
|
+
onRemove && removeLabel && /* @__PURE__ */ jsx51(
|
|
12493
12884
|
"button",
|
|
12494
12885
|
{
|
|
12495
12886
|
type: "button",
|
|
@@ -12500,7 +12891,7 @@ function ReferenceChip({
|
|
|
12500
12891
|
),
|
|
12501
12892
|
title: removeLabel,
|
|
12502
12893
|
"aria-label": removeLabel,
|
|
12503
|
-
children: /* @__PURE__ */
|
|
12894
|
+
children: /* @__PURE__ */ jsx51(X5, { size: 12 })
|
|
12504
12895
|
}
|
|
12505
12896
|
)
|
|
12506
12897
|
]
|
|
@@ -12524,20 +12915,20 @@ function Chat({
|
|
|
12524
12915
|
const { setStream } = useStreamManager();
|
|
12525
12916
|
const stream = useStreamContext();
|
|
12526
12917
|
const { theme } = useTheme();
|
|
12527
|
-
const [isHistoryLoading, setIsHistoryLoading] =
|
|
12528
|
-
const [historyError, setHistoryError] =
|
|
12529
|
-
const [assistantName, setAssistantName] =
|
|
12530
|
-
const [assistantAvatar, setAssistantAvatar] =
|
|
12918
|
+
const [isHistoryLoading, setIsHistoryLoading] = React46.useState(false);
|
|
12919
|
+
const [historyError, setHistoryError] = React46.useState(null);
|
|
12920
|
+
const [assistantName, setAssistantName] = React46.useState(null);
|
|
12921
|
+
const [assistantAvatar, setAssistantAvatar] = React46.useState(null);
|
|
12531
12922
|
const LOADING_DOTS_MIN_DURATION = 800;
|
|
12532
12923
|
const STREAMING_STATUS_REFRESH_MS = 250;
|
|
12533
|
-
const [showLoadingDots, setShowLoadingDots] =
|
|
12534
|
-
const [streamingNow, setStreamingNow] =
|
|
12535
|
-
const loadingStartTimeRef =
|
|
12536
|
-
const lastStreamOutputAtRef =
|
|
12537
|
-
|
|
12924
|
+
const [showLoadingDots, setShowLoadingDots] = React46.useState(false);
|
|
12925
|
+
const [streamingNow, setStreamingNow] = React46.useState(() => Date.now());
|
|
12926
|
+
const loadingStartTimeRef = React46.useRef(null);
|
|
12927
|
+
const lastStreamOutputAtRef = React46.useRef(null);
|
|
12928
|
+
React46.useEffect(() => {
|
|
12538
12929
|
setStream(stream);
|
|
12539
12930
|
}, [setStream, stream]);
|
|
12540
|
-
|
|
12931
|
+
React46.useEffect(() => {
|
|
12541
12932
|
if (stream.isLoading) {
|
|
12542
12933
|
if (!loadingStartTimeRef.current) {
|
|
12543
12934
|
loadingStartTimeRef.current = Date.now();
|
|
@@ -12560,7 +12951,7 @@ function Chat({
|
|
|
12560
12951
|
}
|
|
12561
12952
|
}
|
|
12562
12953
|
}, [stream.isLoading]);
|
|
12563
|
-
|
|
12954
|
+
React46.useEffect(() => {
|
|
12564
12955
|
if (!stream.isLoading) {
|
|
12565
12956
|
lastStreamOutputAtRef.current = null;
|
|
12566
12957
|
setStreamingNow(Date.now());
|
|
@@ -12570,7 +12961,7 @@ function Chat({
|
|
|
12570
12961
|
lastStreamOutputAtRef.current = now;
|
|
12571
12962
|
setStreamingNow(now);
|
|
12572
12963
|
}, [stream.messages, stream.isLoading]);
|
|
12573
|
-
|
|
12964
|
+
React46.useEffect(() => {
|
|
12574
12965
|
if (!stream.isLoading) {
|
|
12575
12966
|
return;
|
|
12576
12967
|
}
|
|
@@ -12579,74 +12970,74 @@ function Chat({
|
|
|
12579
12970
|
}, STREAMING_STATUS_REFRESH_MS);
|
|
12580
12971
|
return () => window.clearInterval(timer);
|
|
12581
12972
|
}, [stream.isLoading]);
|
|
12582
|
-
const [composerParts, setComposerParts] =
|
|
12583
|
-
const [renderedComposerParts, setRenderedComposerParts] =
|
|
12584
|
-
const [composerDomVersion, setComposerDomVersion] =
|
|
12585
|
-
const [selectedTool, setSelectedTool] =
|
|
12973
|
+
const [composerParts, setComposerParts] = React46.useState([]);
|
|
12974
|
+
const [renderedComposerParts, setRenderedComposerParts] = React46.useState([]);
|
|
12975
|
+
const [composerDomVersion, setComposerDomVersion] = React46.useState(0);
|
|
12976
|
+
const [selectedTool, setSelectedTool] = React46.useState(
|
|
12586
12977
|
null
|
|
12587
12978
|
);
|
|
12588
|
-
const [planModeEnabled, setPlanModeEnabled] =
|
|
12589
|
-
const [petSettingsOpen, setPetSettingsOpen] =
|
|
12590
|
-
const [petLocalSettings, setPetLocalSettings] =
|
|
12591
|
-
const [runtimeCapabilities, setRuntimeCapabilities] =
|
|
12592
|
-
const [runtimeCapabilitiesReady, setRuntimeCapabilitiesReady] =
|
|
12593
|
-
const [sessionRuntimeCapabilities, setSessionRuntimeCapabilities] =
|
|
12979
|
+
const [planModeEnabled, setPlanModeEnabled] = React46.useState(false);
|
|
12980
|
+
const [petSettingsOpen, setPetSettingsOpen] = React46.useState(false);
|
|
12981
|
+
const [petLocalSettings, setPetLocalSettings] = React46.useState(() => readPetLocalSettings());
|
|
12982
|
+
const [runtimeCapabilities, setRuntimeCapabilities] = React46.useState(null);
|
|
12983
|
+
const [runtimeCapabilitiesReady, setRuntimeCapabilitiesReady] = React46.useState(false);
|
|
12984
|
+
const [sessionRuntimeCapabilities, setSessionRuntimeCapabilities] = React46.useState(
|
|
12594
12985
|
() => createEmptyRuntimeCapabilitiesSelection()
|
|
12595
12986
|
);
|
|
12596
|
-
const [runRuntimeCapabilities, setRunRuntimeCapabilities] =
|
|
12987
|
+
const [runRuntimeCapabilities, setRunRuntimeCapabilities] = React46.useState(
|
|
12597
12988
|
() => createEmptyRuntimeCapabilitiesSelection()
|
|
12598
12989
|
);
|
|
12599
|
-
const [runtimeCapabilityPalette, setRuntimeCapabilityPalette] =
|
|
12600
|
-
const [attachments, setAttachments] =
|
|
12601
|
-
const [references, setReferences] =
|
|
12602
|
-
const [isUploadingReferenceImages, setIsUploadingReferenceImages] =
|
|
12603
|
-
const [quoteSelection, setQuoteSelection] =
|
|
12604
|
-
const [isAtBottom, setIsAtBottom] =
|
|
12605
|
-
const [hasUpdatesBelow, setHasUpdatesBelow] =
|
|
12990
|
+
const [runtimeCapabilityPalette, setRuntimeCapabilityPalette] = React46.useState(null);
|
|
12991
|
+
const [attachments, setAttachments] = React46.useState([]);
|
|
12992
|
+
const [references, setReferences] = React46.useState([]);
|
|
12993
|
+
const [isUploadingReferenceImages, setIsUploadingReferenceImages] = React46.useState(false);
|
|
12994
|
+
const [quoteSelection, setQuoteSelection] = React46.useState(null);
|
|
12995
|
+
const [isAtBottom, setIsAtBottom] = React46.useState(true);
|
|
12996
|
+
const [hasUpdatesBelow, setHasUpdatesBelow] = React46.useState(false);
|
|
12606
12997
|
const {
|
|
12607
12998
|
threads,
|
|
12608
12999
|
deleteThread,
|
|
12609
13000
|
refreshThreads,
|
|
12610
13001
|
isLoading: isThreadsLoading
|
|
12611
13002
|
} = useThreads();
|
|
12612
|
-
const viewportRef =
|
|
12613
|
-
const fileInputRef =
|
|
12614
|
-
const composerInputRef =
|
|
12615
|
-
const slashPaletteRef =
|
|
12616
|
-
const slashPaletteOptionRefs =
|
|
13003
|
+
const viewportRef = React46.useRef(null);
|
|
13004
|
+
const fileInputRef = React46.useRef(null);
|
|
13005
|
+
const composerInputRef = React46.useRef(null);
|
|
13006
|
+
const slashPaletteRef = React46.useRef(null);
|
|
13007
|
+
const slashPaletteOptionRefs = React46.useRef(
|
|
12617
13008
|
[]
|
|
12618
13009
|
);
|
|
12619
|
-
const composerPartsRef =
|
|
12620
|
-
const pendingComposerCaretOffsetRef =
|
|
12621
|
-
const shouldAutoScrollRef =
|
|
12622
|
-
const forceFollowRef =
|
|
12623
|
-
const previousMessageCountRef =
|
|
12624
|
-
const previousScrollTopRef =
|
|
12625
|
-
const autoScrollFrameRef =
|
|
12626
|
-
const isPointerDownRef =
|
|
12627
|
-
const lastTouchYRef =
|
|
12628
|
-
const runtimeCapabilityPreferenceLoadRef =
|
|
13010
|
+
const composerPartsRef = React46.useRef([]);
|
|
13011
|
+
const pendingComposerCaretOffsetRef = React46.useRef(null);
|
|
13012
|
+
const shouldAutoScrollRef = React46.useRef(true);
|
|
13013
|
+
const forceFollowRef = React46.useRef(false);
|
|
13014
|
+
const previousMessageCountRef = React46.useRef(0);
|
|
13015
|
+
const previousScrollTopRef = React46.useRef(0);
|
|
13016
|
+
const autoScrollFrameRef = React46.useRef(null);
|
|
13017
|
+
const isPointerDownRef = React46.useRef(false);
|
|
13018
|
+
const lastTouchYRef = React46.useRef(null);
|
|
13019
|
+
const runtimeCapabilityPreferenceLoadRef = React46.useRef(0);
|
|
12629
13020
|
const resolvedTitle = title ?? t("chat.title");
|
|
12630
13021
|
const resolvedPlaceholder = placeholder ?? t("chat.placeholder");
|
|
12631
13022
|
const petRequired = options?.displayMode === "pet";
|
|
12632
|
-
const basePetSettings =
|
|
13023
|
+
const basePetSettings = React46.useMemo(
|
|
12633
13024
|
() => derivePetLocalSettings(options?.pet),
|
|
12634
13025
|
[options?.pet]
|
|
12635
13026
|
);
|
|
12636
|
-
const displayedPetSettings =
|
|
13027
|
+
const displayedPetSettings = React46.useMemo(
|
|
12637
13028
|
() => ({
|
|
12638
13029
|
...petLocalSettings ?? basePetSettings,
|
|
12639
13030
|
...petRequired ? { enabled: true } : {}
|
|
12640
13031
|
}),
|
|
12641
13032
|
[basePetSettings, petLocalSettings, petRequired]
|
|
12642
13033
|
);
|
|
12643
|
-
const effectivePet =
|
|
13034
|
+
const effectivePet = React46.useMemo(() => {
|
|
12644
13035
|
if (petRequired || petLocalSettings) {
|
|
12645
13036
|
return buildPetOptionsFromLocalSettings(displayedPetSettings);
|
|
12646
13037
|
}
|
|
12647
13038
|
return options?.pet ?? null;
|
|
12648
13039
|
}, [displayedPetSettings, options?.pet, petLocalSettings, petRequired]);
|
|
12649
|
-
const savePetLocalSettings =
|
|
13040
|
+
const savePetLocalSettings = React46.useCallback(
|
|
12650
13041
|
(settings) => {
|
|
12651
13042
|
const nextSettings = petRequired ? { ...settings, enabled: true } : settings;
|
|
12652
13043
|
setPetLocalSettings(nextSettings);
|
|
@@ -12654,7 +13045,7 @@ function Chat({
|
|
|
12654
13045
|
},
|
|
12655
13046
|
[petRequired]
|
|
12656
13047
|
);
|
|
12657
|
-
const handlePetCommand =
|
|
13048
|
+
const handlePetCommand = React46.useCallback(
|
|
12658
13049
|
(mode) => {
|
|
12659
13050
|
if (mode === "settings") {
|
|
12660
13051
|
setPetSettingsOpen(true);
|
|
@@ -12676,11 +13067,11 @@ function Chat({
|
|
|
12676
13067
|
[displayedPetSettings, effectivePet, petRequired, savePetLocalSettings]
|
|
12677
13068
|
);
|
|
12678
13069
|
const inputPlaceholder = selectedTool?.placeholderOverride ?? composer?.placeholder ?? resolvedPlaceholder;
|
|
12679
|
-
const messages =
|
|
13070
|
+
const messages = React46.useMemo(
|
|
12680
13071
|
() => stream.messages ?? [],
|
|
12681
13072
|
[stream.messages]
|
|
12682
13073
|
);
|
|
12683
|
-
const draft =
|
|
13074
|
+
const draft = React46.useMemo(
|
|
12684
13075
|
() => getComposerPlainText(composerParts),
|
|
12685
13076
|
[composerParts]
|
|
12686
13077
|
);
|
|
@@ -12692,7 +13083,7 @@ function Chat({
|
|
|
12692
13083
|
isEmpty: isComposerInputEmpty,
|
|
12693
13084
|
isStacked: isComposerStacked
|
|
12694
13085
|
});
|
|
12695
|
-
const pendingFollowUps =
|
|
13086
|
+
const pendingFollowUps = React46.useMemo(
|
|
12696
13087
|
() => [...stream.pendingFollowUps ?? []].sort(
|
|
12697
13088
|
(a, b) => a.createdAt - b.createdAt
|
|
12698
13089
|
),
|
|
@@ -12703,18 +13094,18 @@ function Chat({
|
|
|
12703
13094
|
const hasPendingHITLRequest = Boolean(stream.pendingHITLRequest);
|
|
12704
13095
|
const hasPendingInteractiveRequest = hasPendingRequestUserInput || hasPendingHITLRequest;
|
|
12705
13096
|
const hasPendingTodos = Boolean(stream.todos?.items.length);
|
|
12706
|
-
const runtimeCapabilityOptions =
|
|
13097
|
+
const runtimeCapabilityOptions = React46.useMemo(
|
|
12707
13098
|
() => getRuntimeCapabilityOptions(runtimeCapabilities),
|
|
12708
13099
|
[runtimeCapabilities]
|
|
12709
13100
|
);
|
|
12710
|
-
const effectiveSessionRuntimeCapabilities =
|
|
13101
|
+
const effectiveSessionRuntimeCapabilities = React46.useMemo(
|
|
12711
13102
|
() => runtimeCapabilitiesReady && runtimeCapabilities ? mergeRuntimeCapabilitiesSelections(
|
|
12712
13103
|
runtimeCapabilities,
|
|
12713
13104
|
sessionRuntimeCapabilities
|
|
12714
13105
|
) : null,
|
|
12715
13106
|
[runtimeCapabilities, runtimeCapabilitiesReady, sessionRuntimeCapabilities]
|
|
12716
13107
|
);
|
|
12717
|
-
const runRuntimeCapabilityOptions =
|
|
13108
|
+
const runRuntimeCapabilityOptions = React46.useMemo(
|
|
12718
13109
|
() => runtimeCapabilityOptions.filter(
|
|
12719
13110
|
(option) => isRuntimeCapabilitySelected(
|
|
12720
13111
|
runRuntimeCapabilities,
|
|
@@ -12724,11 +13115,11 @@ function Chat({
|
|
|
12724
13115
|
),
|
|
12725
13116
|
[runRuntimeCapabilities, runtimeCapabilityOptions]
|
|
12726
13117
|
);
|
|
12727
|
-
const composerRuntimeCapabilitySelectionKeys =
|
|
13118
|
+
const composerRuntimeCapabilitySelectionKeys = React46.useMemo(
|
|
12728
13119
|
() => getComposerCapabilitySelectionKeys(composerParts),
|
|
12729
13120
|
[composerParts]
|
|
12730
13121
|
);
|
|
12731
|
-
const detachedRunRuntimeCapabilityOptions =
|
|
13122
|
+
const detachedRunRuntimeCapabilityOptions = React46.useMemo(
|
|
12732
13123
|
() => runRuntimeCapabilityOptions.filter(
|
|
12733
13124
|
(option) => !composerRuntimeCapabilitySelectionKeys.has(
|
|
12734
13125
|
getRuntimeCapabilityOptionKey(option)
|
|
@@ -12736,7 +13127,7 @@ function Chat({
|
|
|
12736
13127
|
),
|
|
12737
13128
|
[composerRuntimeCapabilitySelectionKeys, runRuntimeCapabilityOptions]
|
|
12738
13129
|
);
|
|
12739
|
-
const persistSessionRuntimeCapabilities =
|
|
13130
|
+
const persistSessionRuntimeCapabilities = React46.useCallback(
|
|
12740
13131
|
async (threadId, selection) => {
|
|
12741
13132
|
if (!runtimeCapabilities || !selection) {
|
|
12742
13133
|
return;
|
|
@@ -12761,10 +13152,10 @@ function Chat({
|
|
|
12761
13152
|
},
|
|
12762
13153
|
[runtimeCapabilities, stream.client]
|
|
12763
13154
|
);
|
|
12764
|
-
const clearQuoteSelection =
|
|
13155
|
+
const clearQuoteSelection = React46.useCallback(() => {
|
|
12765
13156
|
setQuoteSelection(null);
|
|
12766
13157
|
}, []);
|
|
12767
|
-
const commitComposerParts =
|
|
13158
|
+
const commitComposerParts = React46.useCallback(
|
|
12768
13159
|
(nextParts, options2) => {
|
|
12769
13160
|
const normalized = normalizeComposerParts(nextParts);
|
|
12770
13161
|
const previous = composerPartsRef.current;
|
|
@@ -12800,7 +13191,7 @@ function Chat({
|
|
|
12800
13191
|
},
|
|
12801
13192
|
[]
|
|
12802
13193
|
);
|
|
12803
|
-
const setComposerText =
|
|
13194
|
+
const setComposerText = React46.useCallback(
|
|
12804
13195
|
(text, caretOffset = text.length) => {
|
|
12805
13196
|
commitComposerParts(createComposerTextParts(text), {
|
|
12806
13197
|
caretOffset,
|
|
@@ -12810,7 +13201,7 @@ function Chat({
|
|
|
12810
13201
|
},
|
|
12811
13202
|
[commitComposerParts]
|
|
12812
13203
|
);
|
|
12813
|
-
const focusComposerAt =
|
|
13204
|
+
const focusComposerAt = React46.useCallback((position) => {
|
|
12814
13205
|
const nextPosition = position ?? getComposerEditingLength(composerPartsRef.current);
|
|
12815
13206
|
pendingComposerCaretOffsetRef.current = nextPosition;
|
|
12816
13207
|
requestAnimationFrame(() => {
|
|
@@ -12822,7 +13213,7 @@ function Chat({
|
|
|
12822
13213
|
});
|
|
12823
13214
|
}, []);
|
|
12824
13215
|
const parentMessenger = useParentMessenger({
|
|
12825
|
-
onSetComposerValue:
|
|
13216
|
+
onSetComposerValue: React46.useCallback(
|
|
12826
13217
|
(payload) => {
|
|
12827
13218
|
if (!payload) {
|
|
12828
13219
|
return;
|
|
@@ -12845,10 +13236,10 @@ function Chat({
|
|
|
12845
13236
|
},
|
|
12846
13237
|
[composer?.tools, setComposerText]
|
|
12847
13238
|
),
|
|
12848
|
-
onFocusComposer:
|
|
13239
|
+
onFocusComposer: React46.useCallback(() => {
|
|
12849
13240
|
composerInputRef.current?.focus();
|
|
12850
13241
|
}, []),
|
|
12851
|
-
onSetPetEnabled:
|
|
13242
|
+
onSetPetEnabled: React46.useCallback(
|
|
12852
13243
|
(enabled) => {
|
|
12853
13244
|
if (petRequired) {
|
|
12854
13245
|
return;
|
|
@@ -12861,7 +13252,11 @@ function Chat({
|
|
|
12861
13252
|
[displayedPetSettings, petRequired, savePetLocalSettings]
|
|
12862
13253
|
)
|
|
12863
13254
|
});
|
|
12864
|
-
const
|
|
13255
|
+
const canMinimizeToPet = parentMessenger?.isParentAvailable === true && isPetEnabled(effectivePet);
|
|
13256
|
+
const handleMinimizeToPet = React46.useCallback(() => {
|
|
13257
|
+
parentMessenger?.sendEvent("chat_minimize_change", { minimized: true });
|
|
13258
|
+
}, [parentMessenger]);
|
|
13259
|
+
const syncQuoteSelection = React46.useCallback(() => {
|
|
12865
13260
|
if (typeof window === "undefined") {
|
|
12866
13261
|
clearQuoteSelection();
|
|
12867
13262
|
return;
|
|
@@ -12906,23 +13301,23 @@ function Chat({
|
|
|
12906
13301
|
left
|
|
12907
13302
|
});
|
|
12908
13303
|
}, [clearQuoteSelection]);
|
|
12909
|
-
const cancelPendingAutoScroll =
|
|
13304
|
+
const cancelPendingAutoScroll = React46.useCallback(() => {
|
|
12910
13305
|
if (autoScrollFrameRef.current !== null) {
|
|
12911
13306
|
cancelAnimationFrame(autoScrollFrameRef.current);
|
|
12912
13307
|
autoScrollFrameRef.current = null;
|
|
12913
13308
|
}
|
|
12914
13309
|
}, []);
|
|
12915
|
-
const disableAutoFollow =
|
|
13310
|
+
const disableAutoFollow = React46.useCallback(() => {
|
|
12916
13311
|
forceFollowRef.current = false;
|
|
12917
13312
|
shouldAutoScrollRef.current = false;
|
|
12918
13313
|
cancelPendingAutoScroll();
|
|
12919
13314
|
}, [cancelPendingAutoScroll]);
|
|
12920
|
-
const enableAutoFollow =
|
|
13315
|
+
const enableAutoFollow = React46.useCallback(() => {
|
|
12921
13316
|
forceFollowRef.current = true;
|
|
12922
13317
|
shouldAutoScrollRef.current = true;
|
|
12923
13318
|
setHasUpdatesBelow(false);
|
|
12924
13319
|
}, []);
|
|
12925
|
-
const scrollToBottom =
|
|
13320
|
+
const scrollToBottom = React46.useCallback(
|
|
12926
13321
|
(smooth = false, force = false) => {
|
|
12927
13322
|
if (force) {
|
|
12928
13323
|
enableAutoFollow();
|
|
@@ -12949,7 +13344,7 @@ function Chat({
|
|
|
12949
13344
|
},
|
|
12950
13345
|
[cancelPendingAutoScroll, enableAutoFollow]
|
|
12951
13346
|
);
|
|
12952
|
-
|
|
13347
|
+
React46.useEffect(() => {
|
|
12953
13348
|
const viewport = viewportRef.current;
|
|
12954
13349
|
if (!viewport) return;
|
|
12955
13350
|
previousScrollTopRef.current = viewport.scrollTop;
|
|
@@ -13030,14 +13425,14 @@ function Chat({
|
|
|
13030
13425
|
window.removeEventListener("pointercancel", stopPointerTracking);
|
|
13031
13426
|
};
|
|
13032
13427
|
}, [cancelPendingAutoScroll, disableAutoFollow]);
|
|
13033
|
-
|
|
13428
|
+
React46.useEffect(() => {
|
|
13034
13429
|
shouldAutoScrollRef.current = true;
|
|
13035
13430
|
forceFollowRef.current = false;
|
|
13036
13431
|
previousScrollTopRef.current = 0;
|
|
13037
13432
|
setIsAtBottom(true);
|
|
13038
13433
|
setHasUpdatesBelow(false);
|
|
13039
13434
|
}, [stream.threadId]);
|
|
13040
|
-
|
|
13435
|
+
React46.useEffect(() => {
|
|
13041
13436
|
const messageCountChanged = messages.length !== previousMessageCountRef.current;
|
|
13042
13437
|
previousMessageCountRef.current = messages.length;
|
|
13043
13438
|
if (!shouldAutoScrollRef.current) {
|
|
@@ -13056,7 +13451,7 @@ function Chat({
|
|
|
13056
13451
|
clientSecret: effectiveClientSecret
|
|
13057
13452
|
});
|
|
13058
13453
|
const missingConfig = Boolean(missingConfigKind);
|
|
13059
|
-
const missingConfigShortMessage =
|
|
13454
|
+
const missingConfigShortMessage = React46.useMemo(() => {
|
|
13060
13455
|
switch (missingConfigKind) {
|
|
13061
13456
|
case "apiUrl":
|
|
13062
13457
|
return t("chat.missingApiUrlShort");
|
|
@@ -13068,7 +13463,7 @@ function Chat({
|
|
|
13068
13463
|
return t("chat.missingConfigShort");
|
|
13069
13464
|
}
|
|
13070
13465
|
}, [missingConfigKind, t]);
|
|
13071
|
-
const missingConfigDetailMessage =
|
|
13466
|
+
const missingConfigDetailMessage = React46.useMemo(() => {
|
|
13072
13467
|
switch (missingConfigKind) {
|
|
13073
13468
|
case "apiUrl":
|
|
13074
13469
|
return t("chat.missingApiUrlDetail");
|
|
@@ -13083,7 +13478,7 @@ function Chat({
|
|
|
13083
13478
|
const showMissingConfig = !isClientSecretInitializing && missingConfig;
|
|
13084
13479
|
const hasUploadingFiles = attachments.some((a) => a.status === "uploading");
|
|
13085
13480
|
const isSendDisabled = !trimmedDraft && !hasReferences || hasPendingInteractiveRequest || missingConfig || isHistoryLoading || hasUploadingFiles || isUploadingReferenceImages;
|
|
13086
|
-
const resizeComposerInput =
|
|
13481
|
+
const resizeComposerInput = React46.useCallback(() => {
|
|
13087
13482
|
const input = composerInputRef.current;
|
|
13088
13483
|
if (!input) {
|
|
13089
13484
|
return;
|
|
@@ -13091,7 +13486,7 @@ function Chat({
|
|
|
13091
13486
|
input.style.maxHeight = `${COMPOSER_INPUT_MAX_HEIGHT}px`;
|
|
13092
13487
|
input.style.overflowY = input.scrollHeight > COMPOSER_INPUT_MAX_HEIGHT ? "auto" : "hidden";
|
|
13093
13488
|
}, []);
|
|
13094
|
-
|
|
13489
|
+
React46.useLayoutEffect(() => {
|
|
13095
13490
|
composerPartsRef.current = composerParts;
|
|
13096
13491
|
resizeComposerInput();
|
|
13097
13492
|
const caretOffset = pendingComposerCaretOffsetRef.current;
|
|
@@ -13103,13 +13498,13 @@ function Chat({
|
|
|
13103
13498
|
}
|
|
13104
13499
|
}
|
|
13105
13500
|
}, [composerDomVersion, composerParts, resizeComposerInput]);
|
|
13106
|
-
|
|
13501
|
+
React46.useEffect(() => {
|
|
13107
13502
|
document.addEventListener("selectionchange", syncQuoteSelection);
|
|
13108
13503
|
return () => {
|
|
13109
13504
|
document.removeEventListener("selectionchange", syncQuoteSelection);
|
|
13110
13505
|
};
|
|
13111
13506
|
}, [syncQuoteSelection]);
|
|
13112
|
-
|
|
13507
|
+
React46.useEffect(() => {
|
|
13113
13508
|
const viewport = viewportRef.current;
|
|
13114
13509
|
if (!viewport) {
|
|
13115
13510
|
return;
|
|
@@ -13126,14 +13521,14 @@ function Chat({
|
|
|
13126
13521
|
window.removeEventListener("resize", handleViewportScroll);
|
|
13127
13522
|
};
|
|
13128
13523
|
}, [clearQuoteSelection]);
|
|
13129
|
-
|
|
13524
|
+
React46.useEffect(() => {
|
|
13130
13525
|
clearQuoteSelection();
|
|
13131
13526
|
}, [messages.length, stream.threadId, clearQuoteSelection]);
|
|
13132
|
-
|
|
13527
|
+
React46.useEffect(() => {
|
|
13133
13528
|
if (missingConfig) return;
|
|
13134
13529
|
void refreshThreads();
|
|
13135
13530
|
}, [missingConfig, refreshThreads]);
|
|
13136
|
-
|
|
13531
|
+
React46.useEffect(() => {
|
|
13137
13532
|
if (missingConfig || !stream.client || !stream.assistantId) {
|
|
13138
13533
|
setAssistantName(null);
|
|
13139
13534
|
setAssistantAvatar(null);
|
|
@@ -13156,7 +13551,7 @@ function Chat({
|
|
|
13156
13551
|
cancelled = true;
|
|
13157
13552
|
};
|
|
13158
13553
|
}, [missingConfig, stream.client, stream.assistantId]);
|
|
13159
|
-
|
|
13554
|
+
React46.useEffect(() => {
|
|
13160
13555
|
if (missingConfig || !stream.client || !stream.assistantId) {
|
|
13161
13556
|
setRuntimeCapabilities(null);
|
|
13162
13557
|
setRuntimeCapabilitiesReady(false);
|
|
@@ -13203,7 +13598,7 @@ function Chat({
|
|
|
13203
13598
|
});
|
|
13204
13599
|
return () => controller.abort();
|
|
13205
13600
|
}, [missingConfig, stream.client, stream.assistantId]);
|
|
13206
|
-
|
|
13601
|
+
React46.useEffect(() => {
|
|
13207
13602
|
setRunRuntimeCapabilities(
|
|
13208
13603
|
createEmptyRuntimeCapabilitiesSelection(runtimeCapabilities)
|
|
13209
13604
|
);
|
|
@@ -13260,7 +13655,7 @@ function Chat({
|
|
|
13260
13655
|
mimetype: a.storageFile?.mimetype ?? a.file.type,
|
|
13261
13656
|
size: a.storageFile?.size ?? a.file.size
|
|
13262
13657
|
}));
|
|
13263
|
-
const handleSessionRuntimeCapabilityToggle =
|
|
13658
|
+
const handleSessionRuntimeCapabilityToggle = React46.useCallback(
|
|
13264
13659
|
(type, id, selected) => {
|
|
13265
13660
|
setSessionRuntimeCapabilities((previous) => {
|
|
13266
13661
|
const nextSelection = toggleRuntimeCapabilitySelection(
|
|
@@ -13278,7 +13673,7 @@ function Chat({
|
|
|
13278
13673
|
},
|
|
13279
13674
|
[persistSessionRuntimeCapabilities, stream.threadId]
|
|
13280
13675
|
);
|
|
13281
|
-
const updateRuntimeCapabilityPalette =
|
|
13676
|
+
const updateRuntimeCapabilityPalette = React46.useCallback(
|
|
13282
13677
|
(parts, selectionStart) => {
|
|
13283
13678
|
const input = composerInputRef.current;
|
|
13284
13679
|
const editingText = getComposerEditingText(parts);
|
|
@@ -13290,7 +13685,7 @@ function Chat({
|
|
|
13290
13685
|
},
|
|
13291
13686
|
[]
|
|
13292
13687
|
);
|
|
13293
|
-
const syncComposerInputFromElement =
|
|
13688
|
+
const syncComposerInputFromElement = React46.useCallback(
|
|
13294
13689
|
(input) => {
|
|
13295
13690
|
const previousCapabilities = getComposerCapabilityPartMap(
|
|
13296
13691
|
composerPartsRef.current
|
|
@@ -13308,25 +13703,25 @@ function Chat({
|
|
|
13308
13703
|
},
|
|
13309
13704
|
[commitComposerParts, updateRuntimeCapabilityPalette]
|
|
13310
13705
|
);
|
|
13311
|
-
const handleComposerInput =
|
|
13706
|
+
const handleComposerInput = React46.useCallback(
|
|
13312
13707
|
(event) => {
|
|
13313
13708
|
syncComposerInputFromElement(event.currentTarget);
|
|
13314
13709
|
},
|
|
13315
13710
|
[syncComposerInputFromElement]
|
|
13316
13711
|
);
|
|
13317
|
-
const handleComposerCompositionEnd =
|
|
13712
|
+
const handleComposerCompositionEnd = React46.useCallback(
|
|
13318
13713
|
(event) => {
|
|
13319
13714
|
syncComposerInputFromElement(event.currentTarget);
|
|
13320
13715
|
},
|
|
13321
13716
|
[syncComposerInputFromElement]
|
|
13322
13717
|
);
|
|
13323
|
-
const handleComposerSelect =
|
|
13718
|
+
const handleComposerSelect = React46.useCallback(() => {
|
|
13324
13719
|
updateRuntimeCapabilityPalette(
|
|
13325
13720
|
composerPartsRef.current,
|
|
13326
13721
|
composerInputRef.current ? getComposerSelectionOffset(composerInputRef.current) : void 0
|
|
13327
13722
|
);
|
|
13328
13723
|
}, [updateRuntimeCapabilityPalette]);
|
|
13329
|
-
const removeRunRuntimeCapability =
|
|
13724
|
+
const removeRunRuntimeCapability = React46.useCallback(
|
|
13330
13725
|
(option) => {
|
|
13331
13726
|
setRunRuntimeCapabilities(
|
|
13332
13727
|
(previous) => toggleRuntimeCapabilitySelection(
|
|
@@ -13346,7 +13741,7 @@ function Chat({
|
|
|
13346
13741
|
},
|
|
13347
13742
|
[commitComposerParts]
|
|
13348
13743
|
);
|
|
13349
|
-
const submitDraft =
|
|
13744
|
+
const submitDraft = React46.useCallback(
|
|
13350
13745
|
(optionsOrFollowUp) => {
|
|
13351
13746
|
if (isSendDisabled) return;
|
|
13352
13747
|
const submitOptions = typeof optionsOrFollowUp === "string" ? { followUpOverride: optionsOrFollowUp } : optionsOrFollowUp ?? {};
|
|
@@ -13470,7 +13865,7 @@ function Chat({
|
|
|
13470
13865
|
t
|
|
13471
13866
|
]
|
|
13472
13867
|
);
|
|
13473
|
-
const addRunRuntimeCapabilities =
|
|
13868
|
+
const addRunRuntimeCapabilities = React46.useCallback(
|
|
13474
13869
|
(selection) => {
|
|
13475
13870
|
setRunRuntimeCapabilities(
|
|
13476
13871
|
(previous) => runtimeCapabilities ? mergeRuntimeCapabilitiesSelections(
|
|
@@ -13482,7 +13877,7 @@ function Chat({
|
|
|
13482
13877
|
},
|
|
13483
13878
|
[runtimeCapabilities]
|
|
13484
13879
|
);
|
|
13485
|
-
const insertComposerCapabilityToken =
|
|
13880
|
+
const insertComposerCapabilityToken = React46.useCallback(
|
|
13486
13881
|
(capability, range) => {
|
|
13487
13882
|
const token = createComposerCapabilityPart(capability, createMessageId());
|
|
13488
13883
|
const currentParts = composerPartsRef.current;
|
|
@@ -13553,7 +13948,7 @@ function Chat({
|
|
|
13553
13948
|
plugin: t("composer.slashCommands.empty.loadingCapabilities"),
|
|
13554
13949
|
subAgent: t("composer.slashCommands.empty.loadingCapabilities")
|
|
13555
13950
|
};
|
|
13556
|
-
|
|
13951
|
+
React46.useEffect(() => {
|
|
13557
13952
|
if (!runtimeCapabilityPalette) {
|
|
13558
13953
|
return;
|
|
13559
13954
|
}
|
|
@@ -13572,7 +13967,7 @@ function Chat({
|
|
|
13572
13967
|
);
|
|
13573
13968
|
}
|
|
13574
13969
|
}, [slashPaletteOptions.length, runtimeCapabilityPalette]);
|
|
13575
|
-
|
|
13970
|
+
React46.useLayoutEffect(() => {
|
|
13576
13971
|
if (!runtimeCapabilityPalette) {
|
|
13577
13972
|
return;
|
|
13578
13973
|
}
|
|
@@ -13596,7 +13991,7 @@ function Chat({
|
|
|
13596
13991
|
}
|
|
13597
13992
|
submitDraft();
|
|
13598
13993
|
};
|
|
13599
|
-
const handleEditPendingFollowUp =
|
|
13994
|
+
const handleEditPendingFollowUp = React46.useCallback(
|
|
13600
13995
|
(id) => {
|
|
13601
13996
|
const item = pendingFollowUps.find(
|
|
13602
13997
|
(entry) => entry.id === id && entry.mode === "queue"
|
|
@@ -13623,7 +14018,7 @@ function Chat({
|
|
|
13623
14018
|
},
|
|
13624
14019
|
[pendingFollowUps, setComposerText, stream]
|
|
13625
14020
|
);
|
|
13626
|
-
const handleQuoteSelection =
|
|
14021
|
+
const handleQuoteSelection = React46.useCallback(() => {
|
|
13627
14022
|
if (!quoteSelection) {
|
|
13628
14023
|
return;
|
|
13629
14024
|
}
|
|
@@ -13639,7 +14034,7 @@ function Chat({
|
|
|
13639
14034
|
const handleAttachmentClick = () => {
|
|
13640
14035
|
fileInputRef.current?.click();
|
|
13641
14036
|
};
|
|
13642
|
-
const uploadContextFile =
|
|
14037
|
+
const uploadContextFile = React46.useCallback(
|
|
13643
14038
|
(file) => stream.client.contexts.uploadFile(file),
|
|
13644
14039
|
[stream.client]
|
|
13645
14040
|
);
|
|
@@ -13743,7 +14138,7 @@ function Chat({
|
|
|
13743
14138
|
}
|
|
13744
14139
|
submitDraft();
|
|
13745
14140
|
};
|
|
13746
|
-
const handleComposerPaste =
|
|
14141
|
+
const handleComposerPaste = React46.useCallback(
|
|
13747
14142
|
(event) => {
|
|
13748
14143
|
const clipboardData = event.clipboardData;
|
|
13749
14144
|
if (!clipboardData) {
|
|
@@ -13842,18 +14237,18 @@ function Chat({
|
|
|
13842
14237
|
uploadContextFile
|
|
13843
14238
|
]
|
|
13844
14239
|
);
|
|
13845
|
-
const alternateFollowUpShortcutLabel =
|
|
14240
|
+
const alternateFollowUpShortcutLabel = React46.useMemo(() => {
|
|
13846
14241
|
if (typeof navigator === "undefined") {
|
|
13847
14242
|
return "\u2318Enter";
|
|
13848
14243
|
}
|
|
13849
14244
|
const platform = navigator.platform || navigator.userAgent;
|
|
13850
14245
|
return /Mac|iPhone|iPad|iPod/i.test(platform) ? "\u2318Enter" : "Ctrl+Enter";
|
|
13851
14246
|
}, []);
|
|
13852
|
-
const followUpShortcutLabels =
|
|
14247
|
+
const followUpShortcutLabels = React46.useMemo(
|
|
13853
14248
|
() => getComposerFollowUpShortcutLabels(alternateFollowUpShortcutLabel),
|
|
13854
14249
|
[alternateFollowUpShortcutLabel]
|
|
13855
14250
|
);
|
|
13856
|
-
const uploadFile =
|
|
14251
|
+
const uploadFile = React46.useCallback(
|
|
13857
14252
|
async (localId, file) => {
|
|
13858
14253
|
try {
|
|
13859
14254
|
const result = await uploadContextFile(file);
|
|
@@ -13876,7 +14271,7 @@ function Chat({
|
|
|
13876
14271
|
},
|
|
13877
14272
|
[uploadContextFile]
|
|
13878
14273
|
);
|
|
13879
|
-
const handleRetryUpload =
|
|
14274
|
+
const handleRetryUpload = React46.useCallback(
|
|
13880
14275
|
(localId) => {
|
|
13881
14276
|
const attachment = attachments.find((a) => a.localId === localId);
|
|
13882
14277
|
if (!attachment || attachment.status !== "error") return;
|
|
@@ -13975,7 +14370,7 @@ function Chat({
|
|
|
13975
14370
|
);
|
|
13976
14371
|
scrollToBottom(true, true);
|
|
13977
14372
|
};
|
|
13978
|
-
const loadConversationMessages =
|
|
14373
|
+
const loadConversationMessages = React46.useCallback(
|
|
13979
14374
|
async (recordId) => {
|
|
13980
14375
|
if (missingConfig) {
|
|
13981
14376
|
setHistoryError(missingConfigShortMessage);
|
|
@@ -14070,12 +14465,12 @@ function Chat({
|
|
|
14070
14465
|
}
|
|
14071
14466
|
};
|
|
14072
14467
|
const acceptMimes = composer?.attachments?.accept ? Object.entries(composer.attachments.accept).map(([mime, exts]) => [mime, ...exts.map((e) => `.${e}`)].join(",")).join(",") : void 0;
|
|
14073
|
-
const currentThread =
|
|
14468
|
+
const currentThread = React46.useMemo(
|
|
14074
14469
|
() => threads.find((item) => item.id === stream.threadId),
|
|
14075
14470
|
[threads, stream.threadId]
|
|
14076
14471
|
);
|
|
14077
14472
|
const streamErrorMessage = stream.error instanceof Error ? stream.error.message : void 0;
|
|
14078
|
-
const threadErrorMessage =
|
|
14473
|
+
const threadErrorMessage = React46.useMemo(() => {
|
|
14079
14474
|
if (streamErrorMessage?.trim()) return streamErrorMessage.trim();
|
|
14080
14475
|
if (currentThread?.status !== "error") return void 0;
|
|
14081
14476
|
const message = currentThread.error?.trim();
|
|
@@ -14106,7 +14501,7 @@ function Chat({
|
|
|
14106
14501
|
fallbackTitle: t("history.threadFallback")
|
|
14107
14502
|
});
|
|
14108
14503
|
const assistantTitle = assistantName || resolvedTitle;
|
|
14109
|
-
return /* @__PURE__ */
|
|
14504
|
+
return /* @__PURE__ */ jsxs34(
|
|
14110
14505
|
"div",
|
|
14111
14506
|
{
|
|
14112
14507
|
ref: viewportRef,
|
|
@@ -14116,10 +14511,10 @@ function Chat({
|
|
|
14116
14511
|
className
|
|
14117
14512
|
),
|
|
14118
14513
|
children: [
|
|
14119
|
-
/* @__PURE__ */
|
|
14120
|
-
/* @__PURE__ */
|
|
14121
|
-
/* @__PURE__ */
|
|
14122
|
-
/* @__PURE__ */
|
|
14514
|
+
/* @__PURE__ */ jsxs34("div", { className: "flex items-center justify-between border-b p-2 sticky top-0 z-10 bg-background", children: [
|
|
14515
|
+
/* @__PURE__ */ jsxs34("div", { className: "flex items-center gap-3 overflow-hidden", children: [
|
|
14516
|
+
/* @__PURE__ */ jsxs34("div", { className: "relative shrink-0", children: [
|
|
14517
|
+
/* @__PURE__ */ jsx51(
|
|
14123
14518
|
ChatkitAvatar,
|
|
14124
14519
|
{
|
|
14125
14520
|
avatar: assistantAvatar,
|
|
@@ -14127,10 +14522,10 @@ function Chat({
|
|
|
14127
14522
|
label: assistantTitle
|
|
14128
14523
|
}
|
|
14129
14524
|
),
|
|
14130
|
-
/* @__PURE__ */
|
|
14525
|
+
/* @__PURE__ */ jsx51("span", { className: "absolute bottom-0 right-0 h-2.5 w-2.5 rounded-full border-2 border-background bg-green-500" })
|
|
14131
14526
|
] }),
|
|
14132
|
-
/* @__PURE__ */
|
|
14133
|
-
/* @__PURE__ */
|
|
14527
|
+
/* @__PURE__ */ jsxs34("div", { className: "truncate", children: [
|
|
14528
|
+
/* @__PURE__ */ jsx51(
|
|
14134
14529
|
"h2",
|
|
14135
14530
|
{
|
|
14136
14531
|
className: "text-lg font-semibold truncate",
|
|
@@ -14138,12 +14533,29 @@ function Chat({
|
|
|
14138
14533
|
children: assistantTitle
|
|
14139
14534
|
}
|
|
14140
14535
|
),
|
|
14141
|
-
/* @__PURE__ */
|
|
14536
|
+
/* @__PURE__ */ jsx51("p", { className: "text-xs text-muted-foreground", children: t("chat.statusOnline") })
|
|
14142
14537
|
] })
|
|
14143
14538
|
] }),
|
|
14144
|
-
/* @__PURE__ */
|
|
14145
|
-
/* @__PURE__ */
|
|
14146
|
-
/* @__PURE__ */
|
|
14539
|
+
/* @__PURE__ */ jsxs34("div", { className: "flex items-center gap-1", children: [
|
|
14540
|
+
canMinimizeToPet && /* @__PURE__ */ jsxs34(Tooltip, { children: [
|
|
14541
|
+
/* @__PURE__ */ jsx51(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx51("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ jsx51(
|
|
14542
|
+
"button",
|
|
14543
|
+
{
|
|
14544
|
+
type: "button",
|
|
14545
|
+
onClick: handleMinimizeToPet,
|
|
14546
|
+
className: cn(
|
|
14547
|
+
"flex h-8 w-8 cursor-pointer items-center justify-center rounded-md",
|
|
14548
|
+
"text-muted-foreground hover:text-foreground hover:bg-muted",
|
|
14549
|
+
"transition-colors duration-150"
|
|
14550
|
+
),
|
|
14551
|
+
"aria-label": t("chat.minimizeToPet"),
|
|
14552
|
+
children: /* @__PURE__ */ jsx51(Minus, { size: 16 })
|
|
14553
|
+
}
|
|
14554
|
+
) }) }),
|
|
14555
|
+
/* @__PURE__ */ jsx51(TooltipContent, { side: "bottom", children: t("chat.minimizeToPet") })
|
|
14556
|
+
] }),
|
|
14557
|
+
/* @__PURE__ */ jsxs34(Tooltip, { children: [
|
|
14558
|
+
/* @__PURE__ */ jsx51(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx51("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ jsx51(
|
|
14147
14559
|
"button",
|
|
14148
14560
|
{
|
|
14149
14561
|
type: "button",
|
|
@@ -14154,14 +14566,14 @@ function Chat({
|
|
|
14154
14566
|
"transition-colors duration-150"
|
|
14155
14567
|
),
|
|
14156
14568
|
"aria-label": t("settings.open"),
|
|
14157
|
-
children: /* @__PURE__ */
|
|
14569
|
+
children: /* @__PURE__ */ jsx51(Settings2, { size: 16 })
|
|
14158
14570
|
}
|
|
14159
14571
|
) }) }),
|
|
14160
|
-
/* @__PURE__ */
|
|
14572
|
+
/* @__PURE__ */ jsx51(TooltipContent, { side: "bottom", children: t("settings.open") })
|
|
14161
14573
|
] }),
|
|
14162
|
-
history?.enabled !== false && /* @__PURE__ */
|
|
14163
|
-
/* @__PURE__ */
|
|
14164
|
-
/* @__PURE__ */
|
|
14574
|
+
history?.enabled !== false && /* @__PURE__ */ jsxs34(Fragment7, { children: [
|
|
14575
|
+
/* @__PURE__ */ jsxs34(Tooltip, { children: [
|
|
14576
|
+
/* @__PURE__ */ jsx51(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx51("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ jsx51(
|
|
14165
14577
|
"button",
|
|
14166
14578
|
{
|
|
14167
14579
|
type: "button",
|
|
@@ -14174,12 +14586,12 @@ function Chat({
|
|
|
14174
14586
|
"disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed"
|
|
14175
14587
|
),
|
|
14176
14588
|
"aria-label": t("history.newThread"),
|
|
14177
|
-
children: /* @__PURE__ */
|
|
14589
|
+
children: /* @__PURE__ */ jsx51(Pencil4, { size: 16 })
|
|
14178
14590
|
}
|
|
14179
14591
|
) }) }),
|
|
14180
|
-
/* @__PURE__ */
|
|
14592
|
+
/* @__PURE__ */ jsx51(TooltipContent, { side: "bottom", children: t("history.newThread") })
|
|
14181
14593
|
] }),
|
|
14182
|
-
/* @__PURE__ */
|
|
14594
|
+
/* @__PURE__ */ jsx51(
|
|
14183
14595
|
HistorySidebar,
|
|
14184
14596
|
{
|
|
14185
14597
|
threads,
|
|
@@ -14194,18 +14606,18 @@ function Chat({
|
|
|
14194
14606
|
] })
|
|
14195
14607
|
] })
|
|
14196
14608
|
] }),
|
|
14197
|
-
/* @__PURE__ */
|
|
14198
|
-
errorMessage && /* @__PURE__ */
|
|
14199
|
-
historyError && /* @__PURE__ */
|
|
14200
|
-
showMissingConfig && /* @__PURE__ */
|
|
14201
|
-
isHistoryLoading && /* @__PURE__ */
|
|
14202
|
-
messages.length === 0 ? /* @__PURE__ */
|
|
14609
|
+
/* @__PURE__ */ jsxs34("div", { className: "flex-1 p-4", children: [
|
|
14610
|
+
errorMessage && /* @__PURE__ */ jsx51("div", { className: "mb-4 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive", children: errorMessage }),
|
|
14611
|
+
historyError && /* @__PURE__ */ jsx51("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: historyError }),
|
|
14612
|
+
showMissingConfig && /* @__PURE__ */ jsx51("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: missingConfigDetailMessage }),
|
|
14613
|
+
isHistoryLoading && /* @__PURE__ */ jsx51("div", { className: "mb-4 rounded-lg border border-muted px-3 py-2 text-sm text-muted-foreground", children: t("chat.loadingThread") }),
|
|
14614
|
+
messages.length === 0 ? /* @__PURE__ */ jsx51(
|
|
14203
14615
|
StartScreen,
|
|
14204
14616
|
{
|
|
14205
14617
|
startScreen,
|
|
14206
14618
|
onPromptClick: handlePromptClick
|
|
14207
14619
|
}
|
|
14208
|
-
) : /* @__PURE__ */
|
|
14620
|
+
) : /* @__PURE__ */ jsxs34("div", { className: "space-y-4", children: [
|
|
14209
14621
|
messages.map((message, index) => {
|
|
14210
14622
|
const messageType = String(message.type);
|
|
14211
14623
|
const isAssistantMessage = messageType === "assistant" || messageType === "ai";
|
|
@@ -14238,7 +14650,7 @@ function Chat({
|
|
|
14238
14650
|
if (!isAssistantMessage && !hasPlainRenderableContent && !hasHumanAttachments && humanRuntimeCapabilityOptions.length === 0 && humanReferences.length === 0) {
|
|
14239
14651
|
return null;
|
|
14240
14652
|
}
|
|
14241
|
-
return /* @__PURE__ */
|
|
14653
|
+
return /* @__PURE__ */ jsx51(
|
|
14242
14654
|
"div",
|
|
14243
14655
|
{
|
|
14244
14656
|
className: cn(
|
|
@@ -14246,96 +14658,105 @@ function Chat({
|
|
|
14246
14658
|
message.type === "human" ? "justify-end" : "justify-start -ml-1"
|
|
14247
14659
|
// AI messages: slightly closer to left
|
|
14248
14660
|
),
|
|
14249
|
-
children: /* @__PURE__ */
|
|
14250
|
-
|
|
14251
|
-
|
|
14252
|
-
|
|
14253
|
-
|
|
14254
|
-
|
|
14255
|
-
|
|
14256
|
-
|
|
14257
|
-
|
|
14258
|
-
"
|
|
14259
|
-
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"
|
|
14260
|
-
// AI messages: use chat-specific foreground color
|
|
14261
|
-
),
|
|
14262
|
-
children: isAssistantMessage ? /* @__PURE__ */ jsx49(
|
|
14263
|
-
AssistantMessage,
|
|
14661
|
+
children: /* @__PURE__ */ jsxs34(
|
|
14662
|
+
"div",
|
|
14663
|
+
{
|
|
14664
|
+
className: cn(
|
|
14665
|
+
"flex flex-col px-3 overflow-hidden",
|
|
14666
|
+
isAssistantMessage && "min-w-0 flex-1"
|
|
14667
|
+
),
|
|
14668
|
+
children: [
|
|
14669
|
+
/* @__PURE__ */ jsx51(
|
|
14670
|
+
"div",
|
|
14264
14671
|
{
|
|
14265
|
-
|
|
14266
|
-
|
|
14267
|
-
|
|
14268
|
-
},
|
|
14269
|
-
|
|
14270
|
-
|
|
14271
|
-
|
|
14272
|
-
|
|
14273
|
-
})
|
|
14672
|
+
...canQuoteMessage ? {
|
|
14673
|
+
"data-quote-message-id": message.id,
|
|
14674
|
+
"data-quote-source": quoteSource
|
|
14675
|
+
} : {},
|
|
14676
|
+
className: cn(
|
|
14677
|
+
"max-w-full rounded-2xl",
|
|
14678
|
+
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"
|
|
14679
|
+
// AI messages: use chat-specific foreground color
|
|
14274
14680
|
),
|
|
14681
|
+
children: isAssistantMessage ? /* @__PURE__ */ jsx51(
|
|
14682
|
+
AssistantMessage,
|
|
14683
|
+
{
|
|
14684
|
+
message: {
|
|
14685
|
+
...message,
|
|
14686
|
+
type: "assistant"
|
|
14687
|
+
},
|
|
14688
|
+
messages: messages.slice(0, index + 1).map(
|
|
14689
|
+
(item) => ({
|
|
14690
|
+
...item,
|
|
14691
|
+
type: String(item.type) === "ai" ? "assistant" : item.type
|
|
14692
|
+
})
|
|
14693
|
+
),
|
|
14694
|
+
isStreaming: isStreamingMessage,
|
|
14695
|
+
streamingStatus,
|
|
14696
|
+
isThreadRunning: currentThreadIsRunning,
|
|
14697
|
+
organizationId: stream.organizationId,
|
|
14698
|
+
apiUrl: stream.apiUrl
|
|
14699
|
+
}
|
|
14700
|
+
) : /* @__PURE__ */ jsxs34(Fragment7, { children: [
|
|
14701
|
+
message.type === "human" && humanRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ jsx51("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanRuntimeCapabilityOptions.map((option) => /* @__PURE__ */ jsxs34(
|
|
14702
|
+
"span",
|
|
14703
|
+
{
|
|
14704
|
+
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",
|
|
14705
|
+
children: [
|
|
14706
|
+
/* @__PURE__ */ jsx51(
|
|
14707
|
+
RuntimeCapabilityIcon,
|
|
14708
|
+
{
|
|
14709
|
+
option,
|
|
14710
|
+
variant: "chip"
|
|
14711
|
+
}
|
|
14712
|
+
),
|
|
14713
|
+
/* @__PURE__ */ jsx51("span", { className: "max-w-[9rem] truncate", children: option.label })
|
|
14714
|
+
]
|
|
14715
|
+
},
|
|
14716
|
+
`${option.type}:${option.id}`
|
|
14717
|
+
)) }),
|
|
14718
|
+
message.type === "human" && humanReferences.length > 0 && /* @__PURE__ */ jsx51("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanReferences.map((reference) => /* @__PURE__ */ jsx51(
|
|
14719
|
+
ReferenceChip,
|
|
14720
|
+
{
|
|
14721
|
+
reference,
|
|
14722
|
+
variant: "message"
|
|
14723
|
+
},
|
|
14724
|
+
getReferenceKey(reference)
|
|
14725
|
+
)) }),
|
|
14726
|
+
message.type === "human" && humanAttachments.length > 0 && /* @__PURE__ */ jsx51("div", { className: "flex flex-wrap gap-1.5 mb-2", children: humanAttachments.map((file, fileIndex) => /* @__PURE__ */ jsxs34(
|
|
14727
|
+
"div",
|
|
14728
|
+
{
|
|
14729
|
+
className: "flex items-center gap-1.5 rounded-md bg-primary-foreground/20 px-2 py-1 text-xs",
|
|
14730
|
+
children: [
|
|
14731
|
+
/* @__PURE__ */ jsx51(FileText4, { size: 12 }),
|
|
14732
|
+
/* @__PURE__ */ jsx51("span", { className: "max-w-[100px] truncate", children: file.originalName })
|
|
14733
|
+
]
|
|
14734
|
+
},
|
|
14735
|
+
fileIndex
|
|
14736
|
+
)) }),
|
|
14737
|
+
Array.isArray(message.content) ? message.content.map((part, partIndex) => /* @__PURE__ */ jsx51(
|
|
14738
|
+
"p",
|
|
14739
|
+
{
|
|
14740
|
+
className: "wrap-break-word text-sm leading-relaxed",
|
|
14741
|
+
children: formatMessageContent(part)
|
|
14742
|
+
},
|
|
14743
|
+
`${part.type}-${partIndex}`
|
|
14744
|
+
)) : /* @__PURE__ */ jsx51("span", { className: "wrap-break-word text-sm leading-relaxed", children: formatMessageContent(message.content) })
|
|
14745
|
+
] })
|
|
14746
|
+
}
|
|
14747
|
+
),
|
|
14748
|
+
/* @__PURE__ */ jsx51(
|
|
14749
|
+
MessageActions,
|
|
14750
|
+
{
|
|
14751
|
+
content: messageContent,
|
|
14752
|
+
isAssistant: isAssistantMessage,
|
|
14275
14753
|
isStreaming: isStreamingMessage,
|
|
14276
|
-
|
|
14277
|
-
isThreadRunning: currentThreadIsRunning,
|
|
14278
|
-
organizationId: stream.organizationId,
|
|
14279
|
-
apiUrl: stream.apiUrl
|
|
14754
|
+
onRetry: isAssistantMessage && !stream.isLoading && index === messages.length - 1 ? () => handleRetry(index) : void 0
|
|
14280
14755
|
}
|
|
14281
|
-
)
|
|
14282
|
-
|
|
14283
|
-
|
|
14284
|
-
|
|
14285
|
-
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",
|
|
14286
|
-
children: [
|
|
14287
|
-
/* @__PURE__ */ jsx49(
|
|
14288
|
-
RuntimeCapabilityIcon,
|
|
14289
|
-
{
|
|
14290
|
-
option,
|
|
14291
|
-
variant: "chip"
|
|
14292
|
-
}
|
|
14293
|
-
),
|
|
14294
|
-
/* @__PURE__ */ jsx49("span", { className: "max-w-[9rem] truncate", children: option.label })
|
|
14295
|
-
]
|
|
14296
|
-
},
|
|
14297
|
-
`${option.type}:${option.id}`
|
|
14298
|
-
)) }),
|
|
14299
|
-
message.type === "human" && humanReferences.length > 0 && /* @__PURE__ */ jsx49("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanReferences.map((reference) => /* @__PURE__ */ jsx49(
|
|
14300
|
-
ReferenceChip,
|
|
14301
|
-
{
|
|
14302
|
-
reference,
|
|
14303
|
-
variant: "message"
|
|
14304
|
-
},
|
|
14305
|
-
getReferenceKey(reference)
|
|
14306
|
-
)) }),
|
|
14307
|
-
message.type === "human" && humanAttachments.length > 0 && /* @__PURE__ */ jsx49("div", { className: "flex flex-wrap gap-1.5 mb-2", children: humanAttachments.map((file, fileIndex) => /* @__PURE__ */ jsxs32(
|
|
14308
|
-
"div",
|
|
14309
|
-
{
|
|
14310
|
-
className: "flex items-center gap-1.5 rounded-md bg-primary-foreground/20 px-2 py-1 text-xs",
|
|
14311
|
-
children: [
|
|
14312
|
-
/* @__PURE__ */ jsx49(FileText3, { size: 12 }),
|
|
14313
|
-
/* @__PURE__ */ jsx49("span", { className: "max-w-[100px] truncate", children: file.originalName })
|
|
14314
|
-
]
|
|
14315
|
-
},
|
|
14316
|
-
fileIndex
|
|
14317
|
-
)) }),
|
|
14318
|
-
Array.isArray(message.content) ? message.content.map((part, partIndex) => /* @__PURE__ */ jsx49(
|
|
14319
|
-
"p",
|
|
14320
|
-
{
|
|
14321
|
-
className: "wrap-break-word text-sm leading-relaxed",
|
|
14322
|
-
children: formatMessageContent(part)
|
|
14323
|
-
},
|
|
14324
|
-
`${part.type}-${partIndex}`
|
|
14325
|
-
)) : /* @__PURE__ */ jsx49("span", { className: "wrap-break-word text-sm leading-relaxed", children: formatMessageContent(message.content) })
|
|
14326
|
-
] })
|
|
14327
|
-
}
|
|
14328
|
-
),
|
|
14329
|
-
/* @__PURE__ */ jsx49(
|
|
14330
|
-
MessageActions,
|
|
14331
|
-
{
|
|
14332
|
-
content: messageContent,
|
|
14333
|
-
isAssistant: isAssistantMessage,
|
|
14334
|
-
isStreaming: isStreamingMessage,
|
|
14335
|
-
onRetry: isAssistantMessage && !stream.isLoading && index === messages.length - 1 ? () => handleRetry(index) : void 0
|
|
14336
|
-
}
|
|
14337
|
-
)
|
|
14338
|
-
] })
|
|
14756
|
+
)
|
|
14757
|
+
]
|
|
14758
|
+
}
|
|
14759
|
+
)
|
|
14339
14760
|
},
|
|
14340
14761
|
message.id ?? `${message.type}-${index}`
|
|
14341
14762
|
);
|
|
@@ -14362,7 +14783,7 @@ function Chat({
|
|
|
14362
14783
|
stream.isLoading,
|
|
14363
14784
|
{ now: streamingNow }
|
|
14364
14785
|
);
|
|
14365
|
-
return /* @__PURE__ */
|
|
14786
|
+
return /* @__PURE__ */ jsx51("div", { className: "flex justify-start gap-3 -ml-2", children: /* @__PURE__ */ jsx51("div", { className: "max-w-full rounded-2xl py-2.5", children: /* @__PURE__ */ jsx51(
|
|
14366
14787
|
AssistantStreamingIndicator,
|
|
14367
14788
|
{
|
|
14368
14789
|
status: fallbackStreamingStatus ?? "loading"
|
|
@@ -14371,7 +14792,7 @@ function Chat({
|
|
|
14371
14792
|
})()
|
|
14372
14793
|
] })
|
|
14373
14794
|
] }),
|
|
14374
|
-
!isAtBottom && messages.length > 0 && /* @__PURE__ */
|
|
14795
|
+
!isAtBottom && messages.length > 0 && /* @__PURE__ */ jsx51("div", { className: "sticky bottom-20 z-20 flex justify-center px-4 pointer-events-none", children: /* @__PURE__ */ jsx51(
|
|
14375
14796
|
Button,
|
|
14376
14797
|
{
|
|
14377
14798
|
type: "button",
|
|
@@ -14384,10 +14805,10 @@ function Chat({
|
|
|
14384
14805
|
onClick: () => scrollToBottom(true, true),
|
|
14385
14806
|
"aria-label": t("chat.scrollToBottom"),
|
|
14386
14807
|
title: t("chat.scrollToBottom"),
|
|
14387
|
-
children: /* @__PURE__ */
|
|
14808
|
+
children: /* @__PURE__ */ jsx51(ArrowDown2, { size: 16 })
|
|
14388
14809
|
}
|
|
14389
14810
|
) }),
|
|
14390
|
-
quoteSelection && /* @__PURE__ */
|
|
14811
|
+
quoteSelection && /* @__PURE__ */ jsx51(
|
|
14391
14812
|
"div",
|
|
14392
14813
|
{
|
|
14393
14814
|
className: "pointer-events-none fixed z-50",
|
|
@@ -14396,7 +14817,7 @@ function Chat({
|
|
|
14396
14817
|
left: `${quoteSelection.left}px`,
|
|
14397
14818
|
transform: "translateX(-50%)"
|
|
14398
14819
|
},
|
|
14399
|
-
children: /* @__PURE__ */
|
|
14820
|
+
children: /* @__PURE__ */ jsxs34(
|
|
14400
14821
|
Button,
|
|
14401
14822
|
{
|
|
14402
14823
|
type: "button",
|
|
@@ -14408,16 +14829,16 @@ function Chat({
|
|
|
14408
14829
|
"aria-label": t("composer.quoteSelection"),
|
|
14409
14830
|
title: t("composer.quoteSelection"),
|
|
14410
14831
|
children: [
|
|
14411
|
-
/* @__PURE__ */
|
|
14832
|
+
/* @__PURE__ */ jsx51(Quote, { size: 14 }),
|
|
14412
14833
|
t("composer.quoteSelection")
|
|
14413
14834
|
]
|
|
14414
14835
|
}
|
|
14415
14836
|
)
|
|
14416
14837
|
}
|
|
14417
14838
|
),
|
|
14418
|
-
/* @__PURE__ */
|
|
14419
|
-
threadErrorMessage && /* @__PURE__ */
|
|
14420
|
-
/* @__PURE__ */
|
|
14839
|
+
/* @__PURE__ */ jsxs34("div", { className: "p-2 sticky bottom-0 z-10 bg-background", children: [
|
|
14840
|
+
threadErrorMessage && /* @__PURE__ */ jsx51("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 }),
|
|
14841
|
+
/* @__PURE__ */ jsx51(
|
|
14421
14842
|
"input",
|
|
14422
14843
|
{
|
|
14423
14844
|
ref: fileInputRef,
|
|
@@ -14428,7 +14849,7 @@ function Chat({
|
|
|
14428
14849
|
className: "hidden"
|
|
14429
14850
|
}
|
|
14430
14851
|
),
|
|
14431
|
-
attachments.length > 0 && /* @__PURE__ */
|
|
14852
|
+
attachments.length > 0 && /* @__PURE__ */ jsx51("div", { className: "mb-3 flex flex-wrap gap-2", children: attachments.map((item) => /* @__PURE__ */ jsxs34(
|
|
14432
14853
|
"div",
|
|
14433
14854
|
{
|
|
14434
14855
|
className: cn(
|
|
@@ -14436,16 +14857,16 @@ function Chat({
|
|
|
14436
14857
|
item.status === "error" ? "bg-destructive/10 border border-destructive/30" : "bg-muted"
|
|
14437
14858
|
),
|
|
14438
14859
|
children: [
|
|
14439
|
-
item.status === "uploading" && /* @__PURE__ */
|
|
14440
|
-
|
|
14860
|
+
item.status === "uploading" && /* @__PURE__ */ jsx51(
|
|
14861
|
+
Loader27,
|
|
14441
14862
|
{
|
|
14442
14863
|
size: 14,
|
|
14443
14864
|
className: "animate-spin text-muted-foreground"
|
|
14444
14865
|
}
|
|
14445
14866
|
),
|
|
14446
|
-
item.status === "success" && /* @__PURE__ */
|
|
14447
|
-
item.status === "error" && /* @__PURE__ */
|
|
14448
|
-
/* @__PURE__ */
|
|
14867
|
+
item.status === "success" && /* @__PURE__ */ jsx51(FileText4, { size: 14, className: "text-muted-foreground" }),
|
|
14868
|
+
item.status === "error" && /* @__PURE__ */ jsx51(FileText4, { size: 14, className: "text-destructive" }),
|
|
14869
|
+
/* @__PURE__ */ jsx51(
|
|
14449
14870
|
"span",
|
|
14450
14871
|
{
|
|
14451
14872
|
className: cn(
|
|
@@ -14455,17 +14876,17 @@ function Chat({
|
|
|
14455
14876
|
children: item.file.name
|
|
14456
14877
|
}
|
|
14457
14878
|
),
|
|
14458
|
-
item.status === "error" && /* @__PURE__ */
|
|
14879
|
+
item.status === "error" && /* @__PURE__ */ jsx51(
|
|
14459
14880
|
"button",
|
|
14460
14881
|
{
|
|
14461
14882
|
type: "button",
|
|
14462
14883
|
onClick: () => handleRetryUpload(item.localId),
|
|
14463
14884
|
className: "ml-1 rounded-full p-0.5 text-destructive hover:bg-destructive/20",
|
|
14464
14885
|
title: t("chat.retryUpload"),
|
|
14465
|
-
children: /* @__PURE__ */
|
|
14886
|
+
children: /* @__PURE__ */ jsx51(RefreshCw2, { size: 12 })
|
|
14466
14887
|
}
|
|
14467
14888
|
),
|
|
14468
|
-
/* @__PURE__ */
|
|
14889
|
+
/* @__PURE__ */ jsx51(
|
|
14469
14890
|
"button",
|
|
14470
14891
|
{
|
|
14471
14892
|
type: "button",
|
|
@@ -14474,14 +14895,14 @@ function Chat({
|
|
|
14474
14895
|
"ml-1 rounded-full p-0.5",
|
|
14475
14896
|
item.status === "error" ? "text-destructive hover:bg-destructive/20" : "hover:bg-muted-foreground/20"
|
|
14476
14897
|
),
|
|
14477
|
-
children: /* @__PURE__ */
|
|
14898
|
+
children: /* @__PURE__ */ jsx51(X5, { size: 12 })
|
|
14478
14899
|
}
|
|
14479
14900
|
)
|
|
14480
14901
|
]
|
|
14481
14902
|
},
|
|
14482
14903
|
item.localId
|
|
14483
14904
|
)) }),
|
|
14484
|
-
references.length > 0 && /* @__PURE__ */
|
|
14905
|
+
references.length > 0 && /* @__PURE__ */ jsx51("div", { className: "mb-3 flex flex-wrap gap-2", children: references.map((reference) => /* @__PURE__ */ jsx51(
|
|
14485
14906
|
ReferenceChip,
|
|
14486
14907
|
{
|
|
14487
14908
|
reference,
|
|
@@ -14495,16 +14916,16 @@ function Chat({
|
|
|
14495
14916
|
},
|
|
14496
14917
|
getReferenceKey(reference)
|
|
14497
14918
|
)) }),
|
|
14498
|
-
detachedRunRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */
|
|
14499
|
-
/* @__PURE__ */
|
|
14500
|
-
detachedRunRuntimeCapabilityOptions.map((option) => /* @__PURE__ */
|
|
14919
|
+
detachedRunRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ jsxs34("div", { className: "mb-2 flex flex-wrap items-center gap-2", children: [
|
|
14920
|
+
/* @__PURE__ */ jsx51("span", { className: "text-xs text-muted-foreground", children: t("composer.capabilities.runOnly") }),
|
|
14921
|
+
detachedRunRuntimeCapabilityOptions.map((option) => /* @__PURE__ */ jsxs34(
|
|
14501
14922
|
"span",
|
|
14502
14923
|
{
|
|
14503
14924
|
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",
|
|
14504
14925
|
children: [
|
|
14505
|
-
/* @__PURE__ */
|
|
14506
|
-
/* @__PURE__ */
|
|
14507
|
-
/* @__PURE__ */
|
|
14926
|
+
/* @__PURE__ */ jsx51(RuntimeCapabilityIcon, { option, variant: "chip" }),
|
|
14927
|
+
/* @__PURE__ */ jsx51("span", { className: "max-w-40 truncate", children: option.label }),
|
|
14928
|
+
/* @__PURE__ */ jsx51(
|
|
14508
14929
|
"button",
|
|
14509
14930
|
{
|
|
14510
14931
|
type: "button",
|
|
@@ -14512,7 +14933,7 @@ function Chat({
|
|
|
14512
14933
|
className: "rounded-full p-0.5 hover:bg-primary/15",
|
|
14513
14934
|
title: t("composer.capabilities.removeRunCapability"),
|
|
14514
14935
|
"aria-label": t("composer.capabilities.removeRunCapability"),
|
|
14515
|
-
children: /* @__PURE__ */
|
|
14936
|
+
children: /* @__PURE__ */ jsx51(X5, { size: 11 })
|
|
14516
14937
|
}
|
|
14517
14938
|
)
|
|
14518
14939
|
]
|
|
@@ -14520,7 +14941,7 @@ function Chat({
|
|
|
14520
14941
|
`${option.type}:${option.id}`
|
|
14521
14942
|
))
|
|
14522
14943
|
] }),
|
|
14523
|
-
/* @__PURE__ */
|
|
14944
|
+
/* @__PURE__ */ jsx51(
|
|
14524
14945
|
PendingRuntimeServices,
|
|
14525
14946
|
{
|
|
14526
14947
|
state: stream.runtimeActivities.sandboxServices,
|
|
@@ -14529,7 +14950,7 @@ function Chat({
|
|
|
14529
14950
|
className: hasPendingTodos || hasPendingFollowUps ? "mb-2" : void 0
|
|
14530
14951
|
}
|
|
14531
14952
|
),
|
|
14532
|
-
/* @__PURE__ */
|
|
14953
|
+
/* @__PURE__ */ jsx51(
|
|
14533
14954
|
PendingTodos,
|
|
14534
14955
|
{
|
|
14535
14956
|
snapshot: stream.todos,
|
|
@@ -14537,7 +14958,7 @@ function Chat({
|
|
|
14537
14958
|
className: hasPendingFollowUps ? "mb-2" : void 0
|
|
14538
14959
|
}
|
|
14539
14960
|
),
|
|
14540
|
-
/* @__PURE__ */
|
|
14961
|
+
/* @__PURE__ */ jsx51(
|
|
14541
14962
|
PendingFollowUps,
|
|
14542
14963
|
{
|
|
14543
14964
|
items: pendingFollowUps,
|
|
@@ -14552,7 +14973,7 @@ function Chat({
|
|
|
14552
14973
|
attachToComposer: true
|
|
14553
14974
|
}
|
|
14554
14975
|
),
|
|
14555
|
-
/* @__PURE__ */
|
|
14976
|
+
/* @__PURE__ */ jsx51(
|
|
14556
14977
|
RequestUserInputPanel,
|
|
14557
14978
|
{
|
|
14558
14979
|
request: stream.pendingRequestUserInput,
|
|
@@ -14561,7 +14982,7 @@ function Chat({
|
|
|
14561
14982
|
attachToComposer: true
|
|
14562
14983
|
}
|
|
14563
14984
|
),
|
|
14564
|
-
/* @__PURE__ */
|
|
14985
|
+
/* @__PURE__ */ jsx51(
|
|
14565
14986
|
HITLApprovalPanel,
|
|
14566
14987
|
{
|
|
14567
14988
|
request: stream.pendingHITLRequest,
|
|
@@ -14570,7 +14991,7 @@ function Chat({
|
|
|
14570
14991
|
attachToComposer: true
|
|
14571
14992
|
}
|
|
14572
14993
|
),
|
|
14573
|
-
runtimeCapabilityPalette && /* @__PURE__ */
|
|
14994
|
+
runtimeCapabilityPalette && /* @__PURE__ */ jsx51(
|
|
14574
14995
|
SlashPalette,
|
|
14575
14996
|
{
|
|
14576
14997
|
palette: runtimeCapabilityPalette,
|
|
@@ -14584,7 +15005,7 @@ function Chat({
|
|
|
14584
15005
|
onSelect: selectSlashPaletteOption
|
|
14585
15006
|
}
|
|
14586
15007
|
),
|
|
14587
|
-
/* @__PURE__ */
|
|
15008
|
+
/* @__PURE__ */ jsx51("form", { className: "flex items-end", onSubmit: handleSubmit, children: /* @__PURE__ */ jsxs34(
|
|
14588
15009
|
"div",
|
|
14589
15010
|
{
|
|
14590
15011
|
"data-slot": "composer-input-shell",
|
|
@@ -14598,7 +15019,7 @@ function Chat({
|
|
|
14598
15019
|
composerInputRoundedClass
|
|
14599
15020
|
),
|
|
14600
15021
|
children: [
|
|
14601
|
-
/* @__PURE__ */
|
|
15022
|
+
/* @__PURE__ */ jsx51(
|
|
14602
15023
|
"div",
|
|
14603
15024
|
{
|
|
14604
15025
|
ref: composerInputRef,
|
|
@@ -14620,7 +15041,7 @@ function Chat({
|
|
|
14620
15041
|
(missingConfig || isHistoryLoading || hasPendingInteractiveRequest) && "cursor-not-allowed opacity-50"
|
|
14621
15042
|
),
|
|
14622
15043
|
children: renderedComposerParts.map(
|
|
14623
|
-
(part, index) => part.type === "text" ? /* @__PURE__ */
|
|
15044
|
+
(part, index) => part.type === "text" ? /* @__PURE__ */ jsx51(React46.Fragment, { children: part.text }, `text-${index}`) : /* @__PURE__ */ jsxs34(
|
|
14624
15045
|
"span",
|
|
14625
15046
|
{
|
|
14626
15047
|
"data-composer-capability-key": part.key,
|
|
@@ -14629,14 +15050,14 @@ function Chat({
|
|
|
14629
15050
|
contentEditable: false,
|
|
14630
15051
|
className: "mx-0.5 inline-flex max-w-[14rem] select-none items-center gap-1 text-sm font-semibold text-primary align-baseline",
|
|
14631
15052
|
children: [
|
|
14632
|
-
/* @__PURE__ */
|
|
15053
|
+
/* @__PURE__ */ jsx51(
|
|
14633
15054
|
RuntimeCapabilityIcon,
|
|
14634
15055
|
{
|
|
14635
15056
|
option: part.capability,
|
|
14636
15057
|
variant: "chip"
|
|
14637
15058
|
}
|
|
14638
15059
|
),
|
|
14639
|
-
/* @__PURE__ */
|
|
15060
|
+
/* @__PURE__ */ jsx51("span", { className: "truncate", children: part.capability.label })
|
|
14640
15061
|
]
|
|
14641
15062
|
},
|
|
14642
15063
|
part.key
|
|
@@ -14645,14 +15066,14 @@ function Chat({
|
|
|
14645
15066
|
},
|
|
14646
15067
|
composerDomVersion
|
|
14647
15068
|
),
|
|
14648
|
-
/* @__PURE__ */
|
|
15069
|
+
/* @__PURE__ */ jsxs34(
|
|
14649
15070
|
"div",
|
|
14650
15071
|
{
|
|
14651
15072
|
"data-slot": "composer-action-bar",
|
|
14652
15073
|
className: "pointer-events-none absolute inset-x-1.5 bottom-1 flex min-h-10 items-center justify-between gap-2",
|
|
14653
15074
|
children: [
|
|
14654
|
-
/* @__PURE__ */
|
|
14655
|
-
/* @__PURE__ */
|
|
15075
|
+
/* @__PURE__ */ jsxs34("div", { className: "pointer-events-none flex min-w-0 flex-1 items-center gap-1.5", children: [
|
|
15076
|
+
/* @__PURE__ */ jsx51("div", { className: "pointer-events-auto flex shrink-0 items-center gap-1.5", children: /* @__PURE__ */ jsx51(
|
|
14656
15077
|
ComposerMenu,
|
|
14657
15078
|
{
|
|
14658
15079
|
composer,
|
|
@@ -14667,20 +15088,20 @@ function Chat({
|
|
|
14667
15088
|
disabled: missingConfig || isHistoryLoading || hasPendingInteractiveRequest
|
|
14668
15089
|
}
|
|
14669
15090
|
) }),
|
|
14670
|
-
selectedTool && /* @__PURE__ */
|
|
14671
|
-
/* @__PURE__ */
|
|
14672
|
-
/* @__PURE__ */
|
|
15091
|
+
selectedTool && /* @__PURE__ */ jsxs34("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: [
|
|
15092
|
+
/* @__PURE__ */ jsx51("span", { className: "truncate", children: selectedTool.shortLabel ?? selectedTool.label }),
|
|
15093
|
+
/* @__PURE__ */ jsx51(
|
|
14673
15094
|
"button",
|
|
14674
15095
|
{
|
|
14675
15096
|
type: "button",
|
|
14676
15097
|
onClick: () => setSelectedTool(null),
|
|
14677
15098
|
className: "shrink-0 rounded-full p-0.5 text-primary/70 hover:bg-primary/10 hover:text-primary",
|
|
14678
|
-
children: /* @__PURE__ */
|
|
15099
|
+
children: /* @__PURE__ */ jsx51(X5, { size: 12 })
|
|
14679
15100
|
}
|
|
14680
15101
|
)
|
|
14681
15102
|
] })
|
|
14682
15103
|
] }),
|
|
14683
|
-
/* @__PURE__ */
|
|
15104
|
+
/* @__PURE__ */ jsx51("div", { className: "pointer-events-auto shrink-0", children: /* @__PURE__ */ jsx51(
|
|
14684
15105
|
SendButton,
|
|
14685
15106
|
{
|
|
14686
15107
|
disabled: isSendDisabled,
|
|
@@ -14707,7 +15128,7 @@ function Chat({
|
|
|
14707
15128
|
]
|
|
14708
15129
|
}
|
|
14709
15130
|
) }),
|
|
14710
|
-
disclaimer?.text && /* @__PURE__ */
|
|
15131
|
+
disclaimer?.text && /* @__PURE__ */ jsx51(
|
|
14711
15132
|
"p",
|
|
14712
15133
|
{
|
|
14713
15134
|
className: cn(
|
|
@@ -14717,12 +15138,12 @@ function Chat({
|
|
|
14717
15138
|
children: disclaimer.text
|
|
14718
15139
|
}
|
|
14719
15140
|
),
|
|
14720
|
-
/* @__PURE__ */
|
|
14721
|
-
/* @__PURE__ */
|
|
14722
|
-
/* @__PURE__ */
|
|
15141
|
+
/* @__PURE__ */ jsxs34("div", { className: "mt-2 flex items-center justify-center gap-2 text-xs text-muted-foreground", children: [
|
|
15142
|
+
/* @__PURE__ */ jsx51("span", { children: t("chat.poweredBy") }),
|
|
15143
|
+
/* @__PURE__ */ jsx51(ContextUsageIndicator, { className: "absolute right-4" })
|
|
14723
15144
|
] })
|
|
14724
15145
|
] }),
|
|
14725
|
-
/* @__PURE__ */
|
|
15146
|
+
/* @__PURE__ */ jsx51(
|
|
14726
15147
|
SettingsSheet,
|
|
14727
15148
|
{
|
|
14728
15149
|
open: petSettingsOpen,
|
|
@@ -14732,17 +15153,17 @@ function Chat({
|
|
|
14732
15153
|
onSave: savePetLocalSettings
|
|
14733
15154
|
}
|
|
14734
15155
|
),
|
|
14735
|
-
/* @__PURE__ */
|
|
15156
|
+
/* @__PURE__ */ jsx51(PetBridge, { pet: effectivePet, state: petAutoState })
|
|
14736
15157
|
]
|
|
14737
15158
|
}
|
|
14738
15159
|
);
|
|
14739
15160
|
}
|
|
14740
15161
|
|
|
14741
15162
|
// src/components/ui/separator.tsx
|
|
14742
|
-
import * as
|
|
14743
|
-
import { jsx as
|
|
14744
|
-
var Separator =
|
|
14745
|
-
({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */
|
|
15163
|
+
import * as React47 from "react";
|
|
15164
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
15165
|
+
var Separator = React47.forwardRef(
|
|
15166
|
+
({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */ jsx52(
|
|
14746
15167
|
"div",
|
|
14747
15168
|
{
|
|
14748
15169
|
ref,
|