@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.cjs
CHANGED
|
@@ -67,8 +67,8 @@ __export(index_exports, {
|
|
|
67
67
|
module.exports = __toCommonJS(index_exports);
|
|
68
68
|
|
|
69
69
|
// src/components/chat.tsx
|
|
70
|
-
var
|
|
71
|
-
var
|
|
70
|
+
var React46 = __toESM(require("react"), 1);
|
|
71
|
+
var import_lucide_react26 = require("lucide-react");
|
|
72
72
|
|
|
73
73
|
// src/lib/utils.ts
|
|
74
74
|
var import_clsx = require("clsx");
|
|
@@ -1292,6 +1292,7 @@ var en_US_default = {
|
|
|
1292
1292
|
loadingThread: "Loading thread...",
|
|
1293
1293
|
stop: "Stop",
|
|
1294
1294
|
send: "Send message",
|
|
1295
|
+
minimizeToPet: "Minimize to pet",
|
|
1295
1296
|
referencedContentOnly: "Referenced content",
|
|
1296
1297
|
youLabel: "You",
|
|
1297
1298
|
scrollToBottom: "Scroll to bottom",
|
|
@@ -1513,6 +1514,12 @@ var en_US_default = {
|
|
|
1513
1514
|
loading: "Loading",
|
|
1514
1515
|
thinking: "Thinking",
|
|
1515
1516
|
answering: "Answering",
|
|
1517
|
+
contextCompression: {
|
|
1518
|
+
running: "Automatically compressing context",
|
|
1519
|
+
success: "Context automatically compressed",
|
|
1520
|
+
skipped: "Context not compressed",
|
|
1521
|
+
fail: "Context compression failed"
|
|
1522
|
+
},
|
|
1516
1523
|
requestUserInputResult: {
|
|
1517
1524
|
title: "Selections confirmed",
|
|
1518
1525
|
option: "Option",
|
|
@@ -1573,6 +1580,14 @@ var en_US_default = {
|
|
|
1573
1580
|
copy: "Copy",
|
|
1574
1581
|
copied: "Copied",
|
|
1575
1582
|
separator: ", ",
|
|
1583
|
+
shell: {
|
|
1584
|
+
success: "Success",
|
|
1585
|
+
running: "Running",
|
|
1586
|
+
failed: "Failed",
|
|
1587
|
+
exitCode: "Exit code {{code}}",
|
|
1588
|
+
ranCommand: "Ran {{command}}",
|
|
1589
|
+
runningCommand: "Running {{command}}"
|
|
1590
|
+
},
|
|
1576
1591
|
categories: {
|
|
1577
1592
|
files: {
|
|
1578
1593
|
one: "{{count}} file",
|
|
@@ -1624,6 +1639,7 @@ var zh_CN_default = {
|
|
|
1624
1639
|
loadingThread: "\u6B63\u5728\u52A0\u8F7D\u7EBF\u7A0B...",
|
|
1625
1640
|
stop: "\u505C\u6B62",
|
|
1626
1641
|
send: "\u53D1\u9001\u6D88\u606F",
|
|
1642
|
+
minimizeToPet: "\u6700\u5C0F\u5316\u5230 Pet",
|
|
1627
1643
|
referencedContentOnly: "\u5DF2\u5F15\u7528\u5185\u5BB9",
|
|
1628
1644
|
youLabel: "\u4F60",
|
|
1629
1645
|
scrollToBottom: "\u56DE\u5230\u5E95\u90E8",
|
|
@@ -1845,6 +1861,12 @@ var zh_CN_default = {
|
|
|
1845
1861
|
loading: "\u6B63\u5728\u52A0\u8F7D",
|
|
1846
1862
|
thinking: "\u6B63\u5728\u601D\u8003",
|
|
1847
1863
|
answering: "\u6B63\u5728\u751F\u6210",
|
|
1864
|
+
contextCompression: {
|
|
1865
|
+
running: "\u6B63\u5728\u81EA\u52A8\u538B\u7F29\u4E0A\u4E0B\u6587",
|
|
1866
|
+
success: "\u4E0A\u4E0B\u6587\u5DF2\u81EA\u52A8\u538B\u7F29",
|
|
1867
|
+
skipped: "\u4E0A\u4E0B\u6587\u65E0\u9700\u538B\u7F29",
|
|
1868
|
+
fail: "\u4E0A\u4E0B\u6587\u538B\u7F29\u5931\u8D25"
|
|
1869
|
+
},
|
|
1848
1870
|
requestUserInputResult: {
|
|
1849
1871
|
title: "\u5DF2\u786E\u8BA4\u9009\u62E9",
|
|
1850
1872
|
option: "\u9009\u9879",
|
|
@@ -1905,6 +1927,14 @@ var zh_CN_default = {
|
|
|
1905
1927
|
copy: "\u590D\u5236",
|
|
1906
1928
|
copied: "\u5DF2\u590D\u5236",
|
|
1907
1929
|
separator: "\uFF0C",
|
|
1930
|
+
shell: {
|
|
1931
|
+
success: "\u6210\u529F",
|
|
1932
|
+
running: "\u8FD0\u884C\u4E2D",
|
|
1933
|
+
failed: "\u5931\u8D25",
|
|
1934
|
+
exitCode: "\u9000\u51FA\u7801 {{code}}",
|
|
1935
|
+
ranCommand: "\u5DF2\u8FD0\u884C {{command}}",
|
|
1936
|
+
runningCommand: "\u6B63\u5728\u8FD0\u884C {{command}}"
|
|
1937
|
+
},
|
|
1908
1938
|
categories: {
|
|
1909
1939
|
files: {
|
|
1910
1940
|
one: "{{count}} \u4E2A\u6587\u4EF6",
|
|
@@ -6783,8 +6813,8 @@ function useSlashCommands({
|
|
|
6783
6813
|
}
|
|
6784
6814
|
|
|
6785
6815
|
// src/components/thread/messages/ai.tsx
|
|
6786
|
-
var
|
|
6787
|
-
var
|
|
6816
|
+
var React33 = __toESM(require("react"), 1);
|
|
6817
|
+
var import_lucide_react21 = require("lucide-react");
|
|
6788
6818
|
|
|
6789
6819
|
// src/lib/agent-run-render-tree.ts
|
|
6790
6820
|
function isTextContent(content) {
|
|
@@ -8530,57 +8560,114 @@ function AgentRunGroup({
|
|
|
8530
8560
|
] });
|
|
8531
8561
|
}
|
|
8532
8562
|
|
|
8533
|
-
// src/
|
|
8534
|
-
|
|
8535
|
-
|
|
8536
|
-
|
|
8537
|
-
|
|
8538
|
-
|
|
8539
|
-
|
|
8540
|
-
|
|
8541
|
-
|
|
8542
|
-
|
|
8543
|
-
|
|
8544
|
-
|
|
8545
|
-
|
|
8546
|
-
|
|
8547
|
-
|
|
8548
|
-
|
|
8549
|
-
|
|
8550
|
-
|
|
8551
|
-
|
|
8552
|
-
"
|
|
8553
|
-
|
|
8554
|
-
|
|
8555
|
-
|
|
8556
|
-
|
|
8557
|
-
|
|
8558
|
-
|
|
8559
|
-
|
|
8560
|
-
|
|
8561
|
-
languagePrefix,
|
|
8562
|
-
"zh_Hans",
|
|
8563
|
-
"zh-Hans",
|
|
8564
|
-
"zh_CN",
|
|
8565
|
-
"zh-CN",
|
|
8566
|
-
"zh"
|
|
8567
|
-
];
|
|
8568
|
-
for (const key of preferredKeys) {
|
|
8569
|
-
const candidate = localized[key];
|
|
8570
|
-
if (typeof candidate === "string" && candidate.trim()) {
|
|
8571
|
-
return candidate.trim();
|
|
8572
|
-
}
|
|
8563
|
+
// src/components/thread/messages/context-compression-message.tsx
|
|
8564
|
+
var React29 = require("react");
|
|
8565
|
+
var import_chatkit_types6 = require("@xpert-ai/chatkit-types");
|
|
8566
|
+
var import_lucide_react17 = require("lucide-react");
|
|
8567
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
8568
|
+
var CONTEXT_COMPRESSION_COMPONENT_TYPE = "context-compression";
|
|
8569
|
+
function isContextCompressionComponent(content) {
|
|
8570
|
+
return content.data.category === "Tool" && content.data.type === CONTEXT_COMPRESSION_COMPONENT_TYPE;
|
|
8571
|
+
}
|
|
8572
|
+
function isSkipped(reason) {
|
|
8573
|
+
return reason === "no_messages" || reason === "no_unprotected_history" || reason === "no_token_gain";
|
|
8574
|
+
}
|
|
8575
|
+
function ContextCompressionLabel({
|
|
8576
|
+
data
|
|
8577
|
+
}) {
|
|
8578
|
+
const { t } = useChatkitTranslation();
|
|
8579
|
+
const status = data.status ?? "running";
|
|
8580
|
+
const skipped = isSkipped(data.reason);
|
|
8581
|
+
if (skipped) {
|
|
8582
|
+
return t("message.contextCompression.skipped");
|
|
8583
|
+
}
|
|
8584
|
+
switch (status) {
|
|
8585
|
+
case "success":
|
|
8586
|
+
return t("message.contextCompression.success");
|
|
8587
|
+
case "fail":
|
|
8588
|
+
return t("message.contextCompression.fail");
|
|
8589
|
+
default:
|
|
8590
|
+
return t("message.contextCompression.running");
|
|
8573
8591
|
}
|
|
8574
|
-
|
|
8575
|
-
|
|
8576
|
-
|
|
8577
|
-
|
|
8592
|
+
}
|
|
8593
|
+
function ContextCompressionIcon({
|
|
8594
|
+
data
|
|
8595
|
+
}) {
|
|
8596
|
+
const status = data.status ?? "running";
|
|
8597
|
+
const skipped = isSkipped(data.reason);
|
|
8598
|
+
if (status === "running") {
|
|
8599
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react17.Loader2, { "aria-hidden": "true", className: "h-4 w-4 shrink-0 animate-spin" });
|
|
8578
8600
|
}
|
|
8579
|
-
|
|
8601
|
+
if (status === "fail") {
|
|
8602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react17.XCircle, { "aria-hidden": "true", className: "h-4 w-4 shrink-0" });
|
|
8603
|
+
}
|
|
8604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
8605
|
+
import_lucide_react17.FileText,
|
|
8606
|
+
{
|
|
8607
|
+
"aria-hidden": "true",
|
|
8608
|
+
className: cn("h-4 w-4 shrink-0", skipped && "opacity-80")
|
|
8609
|
+
}
|
|
8610
|
+
);
|
|
8611
|
+
}
|
|
8612
|
+
function getTooltipText(data, language) {
|
|
8613
|
+
return (0, import_chatkit_types6.resolveLocalizedText)(
|
|
8614
|
+
data.summary || data.error || data.message,
|
|
8615
|
+
language
|
|
8616
|
+
);
|
|
8617
|
+
}
|
|
8618
|
+
function ContextCompressionMessage({
|
|
8619
|
+
content
|
|
8620
|
+
}) {
|
|
8621
|
+
const { i18n: i18n2 } = useChatkitTranslation();
|
|
8622
|
+
const data = content.data;
|
|
8623
|
+
const status = data.status ?? "running";
|
|
8624
|
+
const tooltipText = getTooltipText(data, i18n2.language);
|
|
8625
|
+
const label = /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ContextCompressionLabel, { data });
|
|
8626
|
+
const center = /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
8627
|
+
"div",
|
|
8628
|
+
{
|
|
8629
|
+
className: cn(
|
|
8630
|
+
"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",
|
|
8631
|
+
tooltipText && "cursor-help",
|
|
8632
|
+
status === "fail" && "text-destructive hover:text-destructive"
|
|
8633
|
+
),
|
|
8634
|
+
children: [
|
|
8635
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ContextCompressionIcon, { data }),
|
|
8636
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
8637
|
+
"span",
|
|
8638
|
+
{
|
|
8639
|
+
className: cn(
|
|
8640
|
+
"truncate",
|
|
8641
|
+
status === "running" && "ck-tool-call-running-text"
|
|
8642
|
+
),
|
|
8643
|
+
children: label
|
|
8644
|
+
}
|
|
8645
|
+
)
|
|
8646
|
+
]
|
|
8647
|
+
}
|
|
8648
|
+
);
|
|
8649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex w-full items-center justify-center gap-3 py-6", children: [
|
|
8650
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "h-px min-w-8 flex-1 bg-border" }),
|
|
8651
|
+
tooltipText ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Tooltip, { children: [
|
|
8652
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TooltipTrigger, { asChild: true, children: center }),
|
|
8653
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
8654
|
+
TooltipContent,
|
|
8655
|
+
{
|
|
8656
|
+
side: "top",
|
|
8657
|
+
className: "max-h-80 max-w-xl overflow-auto whitespace-pre-wrap text-left text-xs leading-5",
|
|
8658
|
+
children: tooltipText
|
|
8659
|
+
}
|
|
8660
|
+
)
|
|
8661
|
+
] }) : center,
|
|
8662
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "h-px min-w-8 flex-1 bg-border" })
|
|
8663
|
+
] });
|
|
8580
8664
|
}
|
|
8581
8665
|
|
|
8666
|
+
// src/i18n/localized-text.ts
|
|
8667
|
+
var import_chatkit_types7 = require("@xpert-ai/chatkit-types");
|
|
8668
|
+
|
|
8582
8669
|
// src/components/thread/messages/knowledge-retriever-component-renderer.tsx
|
|
8583
|
-
var
|
|
8670
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
8584
8671
|
var KNOWLEDGE_RETRIEVER_TITLE = "Knowledge Retriever";
|
|
8585
8672
|
var KNOWLEDGE_METADATA_SKIP_KEYS = /* @__PURE__ */ new Set([
|
|
8586
8673
|
"assets",
|
|
@@ -8691,7 +8778,7 @@ function getRetrieverQuery(data, language) {
|
|
|
8691
8778
|
if (isRecord2(input)) {
|
|
8692
8779
|
return readString(input.query) ?? readString(input.input) ?? readString(input.question);
|
|
8693
8780
|
}
|
|
8694
|
-
return readString(resolveLocalizedText(data.message, language)) ?? readString(input);
|
|
8781
|
+
return readString((0, import_chatkit_types7.resolveLocalizedText)(data.message, language)) ?? readString(input);
|
|
8695
8782
|
}
|
|
8696
8783
|
function hasKnowledgeRetrieverDetails(_content, data) {
|
|
8697
8784
|
return isKnowledgeRetrieverComponent(_content, data);
|
|
@@ -8703,23 +8790,23 @@ function KnowledgeRawDataBlock({ value }) {
|
|
|
8703
8790
|
const { t } = useChatkitTranslation();
|
|
8704
8791
|
const detected = detectJsonValue(value);
|
|
8705
8792
|
if (detected.kind === "text") {
|
|
8706
|
-
return /* @__PURE__ */ (0,
|
|
8793
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(PlainTextBlock, { value: detected.text });
|
|
8707
8794
|
}
|
|
8708
|
-
return /* @__PURE__ */ (0,
|
|
8709
|
-
/* @__PURE__ */ (0,
|
|
8710
|
-
/* @__PURE__ */ (0,
|
|
8795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Tabs, { defaultValue: "tree", className: "min-w-0", children: [
|
|
8796
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "mb-2 flex min-w-0 items-center justify-between gap-2", children: [
|
|
8797
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "min-w-0 truncate text-[11px] text-muted-foreground", children: [
|
|
8711
8798
|
t("message.toolGroup.jsonTitle"),
|
|
8712
8799
|
" \xB7",
|
|
8713
8800
|
" ",
|
|
8714
8801
|
getJsonValueSummary(detected.value)
|
|
8715
8802
|
] }),
|
|
8716
|
-
/* @__PURE__ */ (0,
|
|
8717
|
-
/* @__PURE__ */ (0,
|
|
8718
|
-
/* @__PURE__ */ (0,
|
|
8803
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(TabsList, { className: "rounded-md p-0.5", children: [
|
|
8804
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "tree", children: t("message.toolGroup.jsonTree") }),
|
|
8805
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "raw", children: t("message.toolGroup.jsonRaw") })
|
|
8719
8806
|
] })
|
|
8720
8807
|
] }),
|
|
8721
|
-
/* @__PURE__ */ (0,
|
|
8722
|
-
/* @__PURE__ */ (0,
|
|
8808
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TabsContent, { value: "tree", className: "mt-0", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(JsonTreeView, { value: detected.value }) }),
|
|
8809
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TabsContent, { value: "raw", className: "mt-0", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(RawJsonBlock, { raw: detected.raw }) })
|
|
8723
8810
|
] });
|
|
8724
8811
|
}
|
|
8725
8812
|
function KnowledgeRetrieverDetails({
|
|
@@ -8732,16 +8819,16 @@ function KnowledgeRetrieverDetails({
|
|
|
8732
8819
|
const hasArrayData = Array.isArray(data.data);
|
|
8733
8820
|
const hasRawFallback = rawData !== null && rawData !== void 0 && (!hasArrayData || Array.isArray(data.data) && data.data.length > 0 && results.length === 0);
|
|
8734
8821
|
const showEmptyState = results.length === 0 && !hasRawFallback && data.status !== "running";
|
|
8735
|
-
return /* @__PURE__ */ (0,
|
|
8736
|
-
query ? /* @__PURE__ */ (0,
|
|
8737
|
-
/* @__PURE__ */ (0,
|
|
8738
|
-
/* @__PURE__ */ (0,
|
|
8822
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "min-w-0 space-y-3 px-3 py-2", children: [
|
|
8823
|
+
query ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "min-w-0 space-y-1", children: [
|
|
8824
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.knowledgeRetriever.queryTitle") }),
|
|
8825
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "min-w-0 whitespace-pre-wrap wrap-break-word rounded-md bg-muted/40 px-3 py-2 font-mono text-[12px] leading-5 text-foreground/80", children: query })
|
|
8739
8826
|
] }) : null,
|
|
8740
|
-
results.length > 0 ? /* @__PURE__ */ (0,
|
|
8741
|
-
/* @__PURE__ */ (0,
|
|
8827
|
+
results.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "min-w-0 space-y-2", children: [
|
|
8828
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.knowledgeRetriever.resultsTitle", {
|
|
8742
8829
|
count: results.length
|
|
8743
8830
|
}) }),
|
|
8744
|
-
/* @__PURE__ */ (0,
|
|
8831
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "space-y-2", children: results.map((result, index) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
8745
8832
|
KnowledgeResultCard,
|
|
8746
8833
|
{
|
|
8747
8834
|
result,
|
|
@@ -8750,11 +8837,11 @@ function KnowledgeRetrieverDetails({
|
|
|
8750
8837
|
result.id ?? `${result.title}-${index}`
|
|
8751
8838
|
)) })
|
|
8752
8839
|
] }) : null,
|
|
8753
|
-
hasRawFallback ? /* @__PURE__ */ (0,
|
|
8754
|
-
/* @__PURE__ */ (0,
|
|
8755
|
-
/* @__PURE__ */ (0,
|
|
8840
|
+
hasRawFallback ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "min-w-0 space-y-1", children: [
|
|
8841
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.knowledgeRetriever.rawDataTitle") }),
|
|
8842
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(KnowledgeRawDataBlock, { value: rawData })
|
|
8756
8843
|
] }) : null,
|
|
8757
|
-
showEmptyState ? /* @__PURE__ */ (0,
|
|
8844
|
+
showEmptyState ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "rounded-md border border-dashed border-border/70 px-3 py-4 text-center text-xs text-muted-foreground", children: t("message.knowledgeRetriever.noResults") }) : null
|
|
8758
8845
|
] });
|
|
8759
8846
|
}
|
|
8760
8847
|
function KnowledgeResultCard({
|
|
@@ -8773,10 +8860,10 @@ function KnowledgeResultCard({
|
|
|
8773
8860
|
...result.metadata
|
|
8774
8861
|
];
|
|
8775
8862
|
const titleClassName = "min-w-0 line-clamp-2 text-sm font-medium leading-5 text-foreground";
|
|
8776
|
-
return /* @__PURE__ */ (0,
|
|
8777
|
-
/* @__PURE__ */ (0,
|
|
8778
|
-
/* @__PURE__ */ (0,
|
|
8779
|
-
result.url ? /* @__PURE__ */ (0,
|
|
8863
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("article", { className: "min-w-0 rounded-md border border-border/60 bg-background/80 px-3 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex min-w-0 items-start gap-2", children: [
|
|
8864
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "mt-0.5 inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-muted text-[11px] font-medium text-muted-foreground", children: index + 1 }),
|
|
8865
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
8866
|
+
result.url ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
8780
8867
|
"a",
|
|
8781
8868
|
{
|
|
8782
8869
|
id: titleId,
|
|
@@ -8786,37 +8873,37 @@ function KnowledgeResultCard({
|
|
|
8786
8873
|
className: cn(titleClassName, "hover:underline"),
|
|
8787
8874
|
children: [
|
|
8788
8875
|
result.title,
|
|
8789
|
-
result.lineRange ? /* @__PURE__ */ (0,
|
|
8876
|
+
result.lineRange ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "ml-1 text-muted-foreground", children: [
|
|
8790
8877
|
"[",
|
|
8791
8878
|
result.lineRange,
|
|
8792
8879
|
"]"
|
|
8793
8880
|
] }) : null
|
|
8794
8881
|
]
|
|
8795
8882
|
}
|
|
8796
|
-
) : /* @__PURE__ */ (0,
|
|
8883
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { id: titleId, className: titleClassName, children: [
|
|
8797
8884
|
result.title,
|
|
8798
|
-
result.lineRange ? /* @__PURE__ */ (0,
|
|
8885
|
+
result.lineRange ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "ml-1 text-muted-foreground", children: [
|
|
8799
8886
|
"[",
|
|
8800
8887
|
result.lineRange,
|
|
8801
8888
|
"]"
|
|
8802
8889
|
] }) : null
|
|
8803
8890
|
] }),
|
|
8804
|
-
result.content ? /* @__PURE__ */ (0,
|
|
8805
|
-
metadata.length > 0 ? /* @__PURE__ */ (0,
|
|
8891
|
+
result.content ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "mt-1 line-clamp-3 whitespace-pre-wrap text-xs leading-5 text-muted-foreground", children: result.content }) : null,
|
|
8892
|
+
metadata.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
8806
8893
|
"div",
|
|
8807
8894
|
{
|
|
8808
8895
|
className: "mt-2 flex flex-wrap gap-1.5",
|
|
8809
8896
|
"aria-labelledby": titleId,
|
|
8810
|
-
children: metadata.slice(0, 10).map((item) => /* @__PURE__ */ (0,
|
|
8897
|
+
children: metadata.slice(0, 10).map((item) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
8811
8898
|
"span",
|
|
8812
8899
|
{
|
|
8813
8900
|
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",
|
|
8814
8901
|
children: [
|
|
8815
|
-
/* @__PURE__ */ (0,
|
|
8902
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "shrink-0 font-medium text-foreground/70", children: [
|
|
8816
8903
|
item.key,
|
|
8817
8904
|
":"
|
|
8818
8905
|
] }),
|
|
8819
|
-
/* @__PURE__ */ (0,
|
|
8906
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "min-w-0 truncate font-mono", children: item.value })
|
|
8820
8907
|
]
|
|
8821
8908
|
},
|
|
8822
8909
|
`${item.key}:${item.value}`
|
|
@@ -8828,7 +8915,7 @@ function KnowledgeResultCard({
|
|
|
8828
8915
|
}
|
|
8829
8916
|
|
|
8830
8917
|
// src/components/thread/messages/web-search-component-renderer.tsx
|
|
8831
|
-
var
|
|
8918
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
8832
8919
|
var webSearchComponentRenderer = {
|
|
8833
8920
|
id: "computer-web-search-sources",
|
|
8834
8921
|
presentation: "grouped-step",
|
|
@@ -8898,9 +8985,9 @@ function WebSearchToolCallOutput({
|
|
|
8898
8985
|
const { t } = useChatkitTranslation();
|
|
8899
8986
|
const sources = getWebSearchSources(data);
|
|
8900
8987
|
if (sources.length === 0 || data.error !== void 0) return null;
|
|
8901
|
-
return /* @__PURE__ */ (0,
|
|
8902
|
-
/* @__PURE__ */ (0,
|
|
8903
|
-
/* @__PURE__ */ (0,
|
|
8988
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "space-y-2", children: [
|
|
8989
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.toolGroup.sourcesTitle") }),
|
|
8990
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "space-y-2", children: sources.map((source, index) => {
|
|
8904
8991
|
const sourceHost = getSourceHost(source.url);
|
|
8905
8992
|
const snippet = source.content ?? source.description;
|
|
8906
8993
|
const metaParts = [
|
|
@@ -8908,13 +8995,13 @@ function WebSearchToolCallOutput({
|
|
|
8908
8995
|
source.publishedDate,
|
|
8909
8996
|
source.author
|
|
8910
8997
|
].filter((item) => Boolean(item));
|
|
8911
|
-
return /* @__PURE__ */ (0,
|
|
8998
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
8912
8999
|
"div",
|
|
8913
9000
|
{
|
|
8914
9001
|
className: "min-w-0 rounded-md border border-border/60 bg-background/80 px-3 py-2",
|
|
8915
9002
|
children: [
|
|
8916
|
-
metaParts.length > 0 ? /* @__PURE__ */ (0,
|
|
8917
|
-
/* @__PURE__ */ (0,
|
|
9003
|
+
metaParts.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "mb-1 truncate text-[11px] text-muted-foreground", children: metaParts.join(" / ") }) : null,
|
|
9004
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
8918
9005
|
"a",
|
|
8919
9006
|
{
|
|
8920
9007
|
href: source.url,
|
|
@@ -8924,7 +9011,7 @@ function WebSearchToolCallOutput({
|
|
|
8924
9011
|
children: source.title
|
|
8925
9012
|
}
|
|
8926
9013
|
),
|
|
8927
|
-
snippet ? /* @__PURE__ */ (0,
|
|
9014
|
+
snippet ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "mt-1 line-clamp-3 text-xs leading-5 text-muted-foreground", children: snippet }) : null
|
|
8928
9015
|
]
|
|
8929
9016
|
},
|
|
8930
9017
|
`${source.url}-${index}`
|
|
@@ -8935,6 +9022,12 @@ function WebSearchToolCallOutput({
|
|
|
8935
9022
|
|
|
8936
9023
|
// src/components/thread/messages/component-message-renderers.tsx
|
|
8937
9024
|
var COMPONENT_MESSAGE_RENDERERS = [
|
|
9025
|
+
{
|
|
9026
|
+
id: "context-compression",
|
|
9027
|
+
presentation: "standalone",
|
|
9028
|
+
match: (content) => isContextCompressionComponent(content),
|
|
9029
|
+
hasDetails: () => false
|
|
9030
|
+
},
|
|
8938
9031
|
knowledgeRetrieverComponentRenderer,
|
|
8939
9032
|
webSearchComponentRenderer
|
|
8940
9033
|
];
|
|
@@ -8952,21 +9045,262 @@ function hasComponentMessageRendererDetails(renderer, content, data) {
|
|
|
8952
9045
|
}
|
|
8953
9046
|
|
|
8954
9047
|
// src/components/thread/messages/tool-component-group.tsx
|
|
8955
|
-
var
|
|
8956
|
-
var
|
|
8957
|
-
|
|
9048
|
+
var React31 = __toESM(require("react"), 1);
|
|
9049
|
+
var import_lucide_react19 = require("lucide-react");
|
|
9050
|
+
|
|
9051
|
+
// src/components/thread/messages/sandbox-shell-tool-call.tsx
|
|
9052
|
+
var React30 = __toESM(require("react"), 1);
|
|
9053
|
+
var import_lucide_react18 = require("lucide-react");
|
|
9054
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
9055
|
+
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";
|
|
9056
|
+
var SANDBOX_SHELL_SECTION_GAP_CLASS = "mt-2 in-data-[density=compact]:mt-1.5 in-data-[density=spacious]:mt-3";
|
|
9057
|
+
function normalizeShellToken(value) {
|
|
9058
|
+
if (typeof value !== "string") return null;
|
|
9059
|
+
const normalized = value.trim().toLowerCase().replace(/[\s-]+/g, "_");
|
|
9060
|
+
return normalized || null;
|
|
9061
|
+
}
|
|
9062
|
+
function isPlainObject(value) {
|
|
9063
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
9064
|
+
}
|
|
9065
|
+
function readShellString(value) {
|
|
9066
|
+
if (typeof value !== "string") return null;
|
|
9067
|
+
const trimmed = value.trim();
|
|
9068
|
+
return trimmed || null;
|
|
9069
|
+
}
|
|
9070
|
+
function stringifyShellText(value) {
|
|
9071
|
+
if (value === null || value === void 0) return null;
|
|
9072
|
+
if (typeof value === "string") return value;
|
|
9073
|
+
if (typeof value === "number" || typeof value === "boolean") {
|
|
9074
|
+
return String(value);
|
|
9075
|
+
}
|
|
9076
|
+
if (Array.isArray(value)) {
|
|
9077
|
+
const output = value.map((item) => stringifyShellText(item)).filter((item) => item !== null).join("");
|
|
9078
|
+
return output || null;
|
|
9079
|
+
}
|
|
9080
|
+
if (!isPlainObject(value)) return formatDisplayValue(value);
|
|
9081
|
+
const source = value;
|
|
9082
|
+
const textParts = [
|
|
9083
|
+
source.stdout,
|
|
9084
|
+
source.stderr,
|
|
9085
|
+
source.output,
|
|
9086
|
+
source.text,
|
|
9087
|
+
source.logs,
|
|
9088
|
+
source.content,
|
|
9089
|
+
source.chunk,
|
|
9090
|
+
source.delta
|
|
9091
|
+
].map((item) => stringifyShellText(item)).filter((item) => item !== null && item.length > 0);
|
|
9092
|
+
if (textParts.length > 0) return textParts.join("");
|
|
9093
|
+
return null;
|
|
9094
|
+
}
|
|
9095
|
+
function getSandboxShellCommand(data, language) {
|
|
9096
|
+
const input = data.input;
|
|
9097
|
+
if (typeof input === "string") return input;
|
|
9098
|
+
if (isPlainObject(input)) {
|
|
9099
|
+
const source = input;
|
|
9100
|
+
const command = readShellString(source.command) ?? readShellString(source.cmd) ?? readShellString(source.input);
|
|
9101
|
+
if (command) return command;
|
|
9102
|
+
}
|
|
9103
|
+
const payload = data.data;
|
|
9104
|
+
if (isPlainObject(payload)) {
|
|
9105
|
+
const source = payload;
|
|
9106
|
+
const command = readShellString(source.command) ?? readShellString(source.cmd) ?? readShellString(source.input);
|
|
9107
|
+
if (command) return command;
|
|
9108
|
+
}
|
|
9109
|
+
return readShellString((0, import_chatkit_types7.resolveLocalizedText)(data.message, language)) ?? readShellString((0, import_chatkit_types7.resolveLocalizedText)(data.title, language)) ?? "sandbox_shell";
|
|
9110
|
+
}
|
|
9111
|
+
function getSandboxShellOutput(data) {
|
|
9112
|
+
const output = stringifyShellText(data.output) ?? stringifyShellText(data.data) ?? stringifyShellText(data.error);
|
|
9113
|
+
return output ?? "";
|
|
9114
|
+
}
|
|
9115
|
+
function readExitCodeFrom(value) {
|
|
9116
|
+
if (!isPlainObject(value)) return null;
|
|
9117
|
+
const source = value;
|
|
9118
|
+
const candidate = source.exit_code ?? source.exitCode ?? source.return_code ?? source.returnCode ?? source.code;
|
|
9119
|
+
if (typeof candidate === "number" && Number.isFinite(candidate)) {
|
|
9120
|
+
return candidate;
|
|
9121
|
+
}
|
|
9122
|
+
if (typeof candidate === "string" && candidate.trim() !== "") {
|
|
9123
|
+
const parsed = Number(candidate);
|
|
9124
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
9125
|
+
}
|
|
9126
|
+
return null;
|
|
9127
|
+
}
|
|
9128
|
+
function getSandboxShellExitCode(data) {
|
|
9129
|
+
return readExitCodeFrom(data.output) ?? readExitCodeFrom(data.data) ?? readExitCodeFrom(data);
|
|
9130
|
+
}
|
|
9131
|
+
function isSandboxShellStep(data) {
|
|
9132
|
+
const namedData = data;
|
|
9133
|
+
return [data.tool, data.type, data.title, namedData.name].some(
|
|
9134
|
+
(value) => normalizeShellToken(value) === "sandbox_shell"
|
|
9135
|
+
);
|
|
9136
|
+
}
|
|
9137
|
+
function formatShellCommand(command) {
|
|
9138
|
+
const trimmed = command.trim();
|
|
9139
|
+
return trimmed.startsWith("$") ? trimmed : `$ ${trimmed}`;
|
|
9140
|
+
}
|
|
9141
|
+
function getSandboxShellActivityLabel(data, status, language, t) {
|
|
9142
|
+
const command = getSandboxShellCommand(data, language);
|
|
9143
|
+
const key = status === "running" ? "message.toolGroup.shell.runningCommand" : "message.toolGroup.shell.ranCommand";
|
|
9144
|
+
return t(key, { command });
|
|
9145
|
+
}
|
|
9146
|
+
function ShellCopyButton({
|
|
9147
|
+
value,
|
|
9148
|
+
className
|
|
9149
|
+
}) {
|
|
9150
|
+
const { t } = useChatkitTranslation();
|
|
9151
|
+
const [isCopied, setIsCopied] = React30.useState(false);
|
|
9152
|
+
const resetTimeoutRef = React30.useRef(null);
|
|
9153
|
+
const clearResetTimeout = React30.useCallback(() => {
|
|
9154
|
+
if (resetTimeoutRef.current === null) return;
|
|
9155
|
+
window.clearTimeout(resetTimeoutRef.current);
|
|
9156
|
+
resetTimeoutRef.current = null;
|
|
9157
|
+
}, []);
|
|
9158
|
+
React30.useEffect(() => clearResetTimeout, [clearResetTimeout]);
|
|
9159
|
+
const handleCopy = React30.useCallback(() => {
|
|
9160
|
+
if (typeof navigator === "undefined" || !navigator.clipboard) return;
|
|
9161
|
+
void navigator.clipboard.writeText(value).then(() => {
|
|
9162
|
+
setIsCopied(true);
|
|
9163
|
+
clearResetTimeout();
|
|
9164
|
+
resetTimeoutRef.current = window.setTimeout(() => {
|
|
9165
|
+
setIsCopied(false);
|
|
9166
|
+
resetTimeoutRef.current = null;
|
|
9167
|
+
}, 1500);
|
|
9168
|
+
}).catch(() => void 0);
|
|
9169
|
+
}, [clearResetTimeout, value]);
|
|
9170
|
+
const label = isCopied ? t("message.toolGroup.copied") : t("message.toolGroup.copy");
|
|
9171
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
9172
|
+
"button",
|
|
9173
|
+
{
|
|
9174
|
+
type: "button",
|
|
9175
|
+
className: cn(
|
|
9176
|
+
"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",
|
|
9177
|
+
className
|
|
9178
|
+
),
|
|
9179
|
+
"aria-label": label,
|
|
9180
|
+
title: label,
|
|
9181
|
+
onClick: handleCopy,
|
|
9182
|
+
children: isCopied ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react18.Check, { className: "h-3.5 w-3.5", "aria-hidden": "true" }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react18.Copy, { className: "h-3.5 w-3.5", "aria-hidden": "true" })
|
|
9183
|
+
}
|
|
9184
|
+
);
|
|
9185
|
+
}
|
|
9186
|
+
function SandboxShellStatus({
|
|
9187
|
+
data,
|
|
9188
|
+
exitCode
|
|
9189
|
+
}) {
|
|
9190
|
+
const { t } = useChatkitTranslation();
|
|
9191
|
+
if (exitCode !== null) {
|
|
9192
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-muted-foreground/90", children: t("message.toolGroup.shell.exitCode", { code: exitCode }) });
|
|
9193
|
+
}
|
|
9194
|
+
if (data.status === "running") {
|
|
9195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-muted-foreground/90", children: t("message.toolGroup.shell.running") });
|
|
9196
|
+
}
|
|
9197
|
+
if (data.status === "fail" || data.error) {
|
|
9198
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-destructive/90", children: t("message.toolGroup.shell.failed") });
|
|
9199
|
+
}
|
|
9200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "inline-flex items-center gap-1 text-muted-foreground/90", children: [
|
|
9201
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react18.Check, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
|
|
9202
|
+
t("message.toolGroup.shell.success")
|
|
9203
|
+
] });
|
|
9204
|
+
}
|
|
9205
|
+
function SandboxShellToolCallCard({ data }) {
|
|
9206
|
+
const { i18n: i18n2 } = useChatkitTranslation();
|
|
9207
|
+
const command = getSandboxShellCommand(data, i18n2.language);
|
|
9208
|
+
const formattedCommand = formatShellCommand(command);
|
|
9209
|
+
const output = getSandboxShellOutput(data);
|
|
9210
|
+
const exitCode = getSandboxShellExitCode(data);
|
|
9211
|
+
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";
|
|
9212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
9213
|
+
"div",
|
|
9214
|
+
{
|
|
9215
|
+
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",
|
|
9216
|
+
"data-slot": "sandbox-shell-tool-call",
|
|
9217
|
+
"aria-label": "Shell",
|
|
9218
|
+
children: [
|
|
9219
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
9220
|
+
"div",
|
|
9221
|
+
{
|
|
9222
|
+
className: cn(
|
|
9223
|
+
"font-medium text-muted-foreground",
|
|
9224
|
+
SANDBOX_SHELL_TEXT_CLASS
|
|
9225
|
+
),
|
|
9226
|
+
children: "Shell"
|
|
9227
|
+
}
|
|
9228
|
+
),
|
|
9229
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
9230
|
+
"div",
|
|
9231
|
+
{
|
|
9232
|
+
className: cn(
|
|
9233
|
+
"group/shell-copy relative min-w-0",
|
|
9234
|
+
SANDBOX_SHELL_SECTION_GAP_CLASS
|
|
9235
|
+
),
|
|
9236
|
+
children: [
|
|
9237
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
9238
|
+
"pre",
|
|
9239
|
+
{
|
|
9240
|
+
className: cn(
|
|
9241
|
+
"whitespace-pre-wrap break-words pr-8 font-mono text-foreground in-data-[density=compact]:pr-6 in-data-[density=spacious]:pr-10",
|
|
9242
|
+
SANDBOX_SHELL_TEXT_CLASS
|
|
9243
|
+
),
|
|
9244
|
+
"data-slot": "sandbox-shell-command",
|
|
9245
|
+
children: formattedCommand
|
|
9246
|
+
}
|
|
9247
|
+
),
|
|
9248
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ShellCopyButton, { value: command, className: copyButtonClassName })
|
|
9249
|
+
]
|
|
9250
|
+
}
|
|
9251
|
+
),
|
|
9252
|
+
output ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
9253
|
+
"div",
|
|
9254
|
+
{
|
|
9255
|
+
className: cn(
|
|
9256
|
+
"group/shell-copy relative min-h-0 flex-1",
|
|
9257
|
+
SANDBOX_SHELL_SECTION_GAP_CLASS
|
|
9258
|
+
),
|
|
9259
|
+
children: [
|
|
9260
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
9261
|
+
"pre",
|
|
9262
|
+
{
|
|
9263
|
+
className: cn(
|
|
9264
|
+
"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",
|
|
9265
|
+
SANDBOX_SHELL_TEXT_CLASS
|
|
9266
|
+
),
|
|
9267
|
+
"data-slot": "sandbox-shell-output",
|
|
9268
|
+
children: output
|
|
9269
|
+
}
|
|
9270
|
+
),
|
|
9271
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ShellCopyButton, { value: output, className: copyButtonClassName })
|
|
9272
|
+
]
|
|
9273
|
+
}
|
|
9274
|
+
) : null,
|
|
9275
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
9276
|
+
"div",
|
|
9277
|
+
{
|
|
9278
|
+
className: cn(
|
|
9279
|
+
"mt-3 flex shrink-0 justify-end in-data-[density=compact]:mt-2 in-data-[density=spacious]:mt-4",
|
|
9280
|
+
SANDBOX_SHELL_TEXT_CLASS
|
|
9281
|
+
),
|
|
9282
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SandboxShellStatus, { data, exitCode })
|
|
9283
|
+
}
|
|
9284
|
+
)
|
|
9285
|
+
]
|
|
9286
|
+
}
|
|
9287
|
+
);
|
|
9288
|
+
}
|
|
9289
|
+
|
|
9290
|
+
// src/components/thread/messages/tool-component-group.tsx
|
|
9291
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
8958
9292
|
var toolStatusConfig = {
|
|
8959
9293
|
success: {
|
|
8960
9294
|
iconClass: "border-green-500 text-green-700",
|
|
8961
|
-
icon:
|
|
9295
|
+
icon: import_lucide_react19.CheckCircle2
|
|
8962
9296
|
},
|
|
8963
9297
|
fail: {
|
|
8964
9298
|
iconClass: "border-red-500 text-red-700",
|
|
8965
|
-
icon:
|
|
9299
|
+
icon: import_lucide_react19.XCircle
|
|
8966
9300
|
},
|
|
8967
9301
|
running: {
|
|
8968
9302
|
iconClass: "border-blue-500 text-blue-700",
|
|
8969
|
-
icon:
|
|
9303
|
+
icon: import_lucide_react19.Loader2
|
|
8970
9304
|
}
|
|
8971
9305
|
};
|
|
8972
9306
|
var TOOL_GROUP_CATEGORY_ORDER = [
|
|
@@ -9060,10 +9394,10 @@ function formatStepDuration2(durationMs) {
|
|
|
9060
9394
|
return `${minutes}m ${seconds}s`;
|
|
9061
9395
|
}
|
|
9062
9396
|
function useFrozenTimestamp(shouldFreeze) {
|
|
9063
|
-
const [frozenAt, setFrozenAt] =
|
|
9397
|
+
const [frozenAt, setFrozenAt] = React31.useState(
|
|
9064
9398
|
() => shouldFreeze ? Date.now() : null
|
|
9065
9399
|
);
|
|
9066
|
-
|
|
9400
|
+
React31.useEffect(() => {
|
|
9067
9401
|
if (shouldFreeze) {
|
|
9068
9402
|
setFrozenAt((current) => current ?? Date.now());
|
|
9069
9403
|
return;
|
|
@@ -9073,12 +9407,12 @@ function useFrozenTimestamp(shouldFreeze) {
|
|
|
9073
9407
|
return frozenAt;
|
|
9074
9408
|
}
|
|
9075
9409
|
function useToolStepDurationLabel(data, options) {
|
|
9076
|
-
const [durationNow, setDurationNow] =
|
|
9410
|
+
const [durationNow, setDurationNow] = React31.useState(() => Date.now());
|
|
9077
9411
|
const createdAt = parseStepDate(data.created_date);
|
|
9078
9412
|
const explicitEndedAt = parseStepDate(data.end_date);
|
|
9079
9413
|
const status = options?.status ?? data.status;
|
|
9080
9414
|
const endedAt = explicitEndedAt ?? (status !== "running" ? options?.fallbackEndedAt ?? null : null);
|
|
9081
|
-
|
|
9415
|
+
React31.useEffect(() => {
|
|
9082
9416
|
if (status !== "running" || createdAt === null || endedAt !== null) {
|
|
9083
9417
|
return;
|
|
9084
9418
|
}
|
|
@@ -9133,14 +9467,14 @@ function normalizeToolToken3(value) {
|
|
|
9133
9467
|
}
|
|
9134
9468
|
function classifyToolToken(value) {
|
|
9135
9469
|
const normalized = normalizeToolToken3(
|
|
9136
|
-
typeof value === "string" ? value : resolveLocalizedText(value, "en-US")
|
|
9470
|
+
typeof value === "string" ? value : (0, import_chatkit_types7.resolveLocalizedText)(value, "en-US")
|
|
9137
9471
|
);
|
|
9138
9472
|
if (!normalized) return null;
|
|
9139
9473
|
const directMatch = TOOL_GROUP_TOKEN_CATEGORY[normalized];
|
|
9140
9474
|
if (directMatch) return directMatch;
|
|
9141
9475
|
if (normalized.includes("search")) return "searches";
|
|
9142
9476
|
if (normalized.includes("file")) return "files";
|
|
9143
|
-
if (normalized.includes("command") || normalized.includes("cmd") || normalized.includes("program") || normalized.includes("exec") || normalized.startsWith("run_") || normalized.includes("_run")) {
|
|
9477
|
+
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")) {
|
|
9144
9478
|
return "commands";
|
|
9145
9479
|
}
|
|
9146
9480
|
if (normalized.includes("list")) return "lists";
|
|
@@ -9152,6 +9486,7 @@ function classifyToolToken(value) {
|
|
|
9152
9486
|
}
|
|
9153
9487
|
function getToolGroupCategory(content) {
|
|
9154
9488
|
const data = getToolStepData(content);
|
|
9489
|
+
if (isSandboxShellStep(data)) return "commands";
|
|
9155
9490
|
return classifyToolToken(data.type) ?? classifyToolToken(data.tool) ?? classifyToolToken(data.title) ?? classifyToolToken(data.message) ?? "tools";
|
|
9156
9491
|
}
|
|
9157
9492
|
function getToolGroupCategoryCounts(items) {
|
|
@@ -9164,10 +9499,10 @@ function getToolGroupCategoryCounts(items) {
|
|
|
9164
9499
|
function getToolActivityLabel(content, language, statusOverride) {
|
|
9165
9500
|
const data = getToolStepData(content);
|
|
9166
9501
|
const status = statusOverride ?? data.status;
|
|
9167
|
-
const message = resolveLocalizedText(data.message, language);
|
|
9168
|
-
const title = resolveLocalizedText(data.title, language);
|
|
9169
|
-
const tool = resolveLocalizedText(data.tool, language);
|
|
9170
|
-
const type = resolveLocalizedText(data.type, language);
|
|
9502
|
+
const message = (0, import_chatkit_types7.resolveLocalizedText)(data.message, language);
|
|
9503
|
+
const title = (0, import_chatkit_types7.resolveLocalizedText)(data.title, language);
|
|
9504
|
+
const tool = (0, import_chatkit_types7.resolveLocalizedText)(data.tool, language);
|
|
9505
|
+
const type = (0, import_chatkit_types7.resolveLocalizedText)(data.type, language);
|
|
9171
9506
|
if (status === "running") {
|
|
9172
9507
|
return message ?? title ?? tool ?? type ?? "Tool";
|
|
9173
9508
|
}
|
|
@@ -9261,8 +9596,8 @@ function shouldUseToolsetAvatar(toolset) {
|
|
|
9261
9596
|
}
|
|
9262
9597
|
function useToolsetAvatar(toolsetId, enabled, apiUrl) {
|
|
9263
9598
|
const avatarUrl = enabled ? createToolsetAvatarUrl(toolsetId, apiUrl) : null;
|
|
9264
|
-
const [avatar, setAvatar] =
|
|
9265
|
-
|
|
9599
|
+
const [avatar, setAvatar] = React31.useState(null);
|
|
9600
|
+
React31.useEffect(() => {
|
|
9266
9601
|
if (!avatarUrl) {
|
|
9267
9602
|
setAvatar(null);
|
|
9268
9603
|
return;
|
|
@@ -9294,7 +9629,7 @@ function ToolAvatarIcon({
|
|
|
9294
9629
|
className
|
|
9295
9630
|
}) {
|
|
9296
9631
|
if (avatar.url) {
|
|
9297
|
-
return /* @__PURE__ */ (0,
|
|
9632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9298
9633
|
"img",
|
|
9299
9634
|
{
|
|
9300
9635
|
alt: "",
|
|
@@ -9307,7 +9642,7 @@ function ToolAvatarIcon({
|
|
|
9307
9642
|
}
|
|
9308
9643
|
const emoji = unicodeFromUnified2(avatar.emoji?.unified);
|
|
9309
9644
|
if (emoji) {
|
|
9310
|
-
return /* @__PURE__ */ (0,
|
|
9645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9311
9646
|
"span",
|
|
9312
9647
|
{
|
|
9313
9648
|
"aria-hidden": "true",
|
|
@@ -9322,8 +9657,8 @@ function ToolAvatarIcon({
|
|
|
9322
9657
|
}
|
|
9323
9658
|
);
|
|
9324
9659
|
}
|
|
9325
|
-
return /* @__PURE__ */ (0,
|
|
9326
|
-
|
|
9660
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9661
|
+
import_lucide_react19.CircleHelp,
|
|
9327
9662
|
{
|
|
9328
9663
|
className,
|
|
9329
9664
|
"aria-hidden": "true",
|
|
@@ -9336,20 +9671,20 @@ function getKnownToolsetIcon(toolset) {
|
|
|
9336
9671
|
if (!normalized) return null;
|
|
9337
9672
|
switch (normalized) {
|
|
9338
9673
|
case "project":
|
|
9339
|
-
return
|
|
9674
|
+
return import_lucide_react19.Building2;
|
|
9340
9675
|
case "transfer_to":
|
|
9341
|
-
return
|
|
9676
|
+
return import_lucide_react19.Repeat2;
|
|
9342
9677
|
case "knowledge":
|
|
9343
9678
|
case "knowledgebase":
|
|
9344
|
-
return
|
|
9679
|
+
return import_lucide_react19.BookOpen;
|
|
9345
9680
|
case "project_tasks":
|
|
9346
|
-
return
|
|
9681
|
+
return import_lucide_react19.ListTodo;
|
|
9347
9682
|
case "memories":
|
|
9348
|
-
return
|
|
9683
|
+
return import_lucide_react19.Brain;
|
|
9349
9684
|
case "workflow_agent_tool":
|
|
9350
|
-
return
|
|
9685
|
+
return import_lucide_react19.Wrench;
|
|
9351
9686
|
case "workflow_task":
|
|
9352
|
-
return
|
|
9687
|
+
return import_lucide_react19.Network;
|
|
9353
9688
|
default:
|
|
9354
9689
|
return null;
|
|
9355
9690
|
}
|
|
@@ -9359,15 +9694,15 @@ function getStepTypeIcon(type) {
|
|
|
9359
9694
|
if (!normalized) return null;
|
|
9360
9695
|
switch (normalized) {
|
|
9361
9696
|
case "file":
|
|
9362
|
-
return
|
|
9697
|
+
return import_lucide_react19.FileText;
|
|
9363
9698
|
case "files":
|
|
9364
|
-
return
|
|
9699
|
+
return import_lucide_react19.Files;
|
|
9365
9700
|
case "program":
|
|
9366
|
-
return
|
|
9701
|
+
return import_lucide_react19.SquareTerminal;
|
|
9367
9702
|
case "web_search":
|
|
9368
|
-
return
|
|
9703
|
+
return import_lucide_react19.Search;
|
|
9369
9704
|
case "knowledges":
|
|
9370
|
-
return
|
|
9705
|
+
return import_lucide_react19.BookOpen;
|
|
9371
9706
|
default:
|
|
9372
9707
|
return null;
|
|
9373
9708
|
}
|
|
@@ -9385,12 +9720,12 @@ function ToolStepIcon({
|
|
|
9385
9720
|
apiUrl
|
|
9386
9721
|
);
|
|
9387
9722
|
const iconUrl = createToolsetIconUrl(data.toolset, organizationId, apiUrl);
|
|
9388
|
-
const [failedIconUrl, setFailedIconUrl] =
|
|
9389
|
-
|
|
9723
|
+
const [failedIconUrl, setFailedIconUrl] = React31.useState(null);
|
|
9724
|
+
React31.useEffect(() => {
|
|
9390
9725
|
setFailedIconUrl(null);
|
|
9391
9726
|
}, [iconUrl]);
|
|
9392
9727
|
if (avatar) {
|
|
9393
|
-
return /* @__PURE__ */ (0,
|
|
9728
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9394
9729
|
ToolAvatarIcon,
|
|
9395
9730
|
{
|
|
9396
9731
|
avatar,
|
|
@@ -9400,7 +9735,7 @@ function ToolStepIcon({
|
|
|
9400
9735
|
);
|
|
9401
9736
|
}
|
|
9402
9737
|
if (iconUrl && failedIconUrl !== iconUrl) {
|
|
9403
|
-
return /* @__PURE__ */ (0,
|
|
9738
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9404
9739
|
"img",
|
|
9405
9740
|
{
|
|
9406
9741
|
alt: "",
|
|
@@ -9414,7 +9749,7 @@ function ToolStepIcon({
|
|
|
9414
9749
|
}
|
|
9415
9750
|
const TypeIcon = getStepTypeIcon(data.type);
|
|
9416
9751
|
if (TypeIcon) {
|
|
9417
|
-
return /* @__PURE__ */ (0,
|
|
9752
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9418
9753
|
TypeIcon,
|
|
9419
9754
|
{
|
|
9420
9755
|
className,
|
|
@@ -9425,7 +9760,7 @@ function ToolStepIcon({
|
|
|
9425
9760
|
}
|
|
9426
9761
|
const ToolsetIcon = getKnownToolsetIcon(data.toolset);
|
|
9427
9762
|
if (ToolsetIcon) {
|
|
9428
|
-
return /* @__PURE__ */ (0,
|
|
9763
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9429
9764
|
ToolsetIcon,
|
|
9430
9765
|
{
|
|
9431
9766
|
className,
|
|
@@ -9435,8 +9770,8 @@ function ToolStepIcon({
|
|
|
9435
9770
|
);
|
|
9436
9771
|
}
|
|
9437
9772
|
if (usesToolsetAvatar) {
|
|
9438
|
-
return /* @__PURE__ */ (0,
|
|
9439
|
-
|
|
9773
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9774
|
+
import_lucide_react19.CircleHelp,
|
|
9440
9775
|
{
|
|
9441
9776
|
className,
|
|
9442
9777
|
"aria-hidden": "true",
|
|
@@ -9444,8 +9779,8 @@ function ToolStepIcon({
|
|
|
9444
9779
|
}
|
|
9445
9780
|
);
|
|
9446
9781
|
}
|
|
9447
|
-
return /* @__PURE__ */ (0,
|
|
9448
|
-
|
|
9782
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9783
|
+
import_lucide_react19.CircleHelp,
|
|
9449
9784
|
{
|
|
9450
9785
|
className,
|
|
9451
9786
|
"aria-hidden": "true",
|
|
@@ -9453,17 +9788,20 @@ function ToolStepIcon({
|
|
|
9453
9788
|
}
|
|
9454
9789
|
);
|
|
9455
9790
|
}
|
|
9456
|
-
function ToolCallCopyButton({
|
|
9791
|
+
function ToolCallCopyButton({
|
|
9792
|
+
value,
|
|
9793
|
+
className
|
|
9794
|
+
}) {
|
|
9457
9795
|
const { t } = useChatkitTranslation();
|
|
9458
|
-
const [isCopied, setIsCopied] =
|
|
9459
|
-
const resetTimeoutRef =
|
|
9460
|
-
const clearResetTimeout =
|
|
9796
|
+
const [isCopied, setIsCopied] = React31.useState(false);
|
|
9797
|
+
const resetTimeoutRef = React31.useRef(null);
|
|
9798
|
+
const clearResetTimeout = React31.useCallback(() => {
|
|
9461
9799
|
if (resetTimeoutRef.current === null) return;
|
|
9462
9800
|
window.clearTimeout(resetTimeoutRef.current);
|
|
9463
9801
|
resetTimeoutRef.current = null;
|
|
9464
9802
|
}, []);
|
|
9465
|
-
|
|
9466
|
-
const handleCopy =
|
|
9803
|
+
React31.useEffect(() => clearResetTimeout, [clearResetTimeout]);
|
|
9804
|
+
const handleCopy = React31.useCallback(() => {
|
|
9467
9805
|
if (typeof navigator === "undefined" || !navigator.clipboard) return;
|
|
9468
9806
|
void navigator.clipboard.writeText(value).then(() => {
|
|
9469
9807
|
setIsCopied(true);
|
|
@@ -9475,15 +9813,18 @@ function ToolCallCopyButton({ value }) {
|
|
|
9475
9813
|
}).catch(() => void 0);
|
|
9476
9814
|
}, [clearResetTimeout, value]);
|
|
9477
9815
|
const label = isCopied ? t("message.toolGroup.copied") : t("message.toolGroup.copy");
|
|
9478
|
-
return /* @__PURE__ */ (0,
|
|
9816
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9479
9817
|
"button",
|
|
9480
9818
|
{
|
|
9481
9819
|
type: "button",
|
|
9482
|
-
className:
|
|
9820
|
+
className: cn(
|
|
9821
|
+
"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",
|
|
9822
|
+
className
|
|
9823
|
+
),
|
|
9483
9824
|
"aria-label": label,
|
|
9484
9825
|
title: label,
|
|
9485
9826
|
onClick: handleCopy,
|
|
9486
|
-
children: isCopied ? /* @__PURE__ */ (0,
|
|
9827
|
+
children: isCopied ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react19.Check, { className: "h-3.5 w-3.5", "aria-hidden": "true" }) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react19.Copy, { className: "h-3.5 w-3.5", "aria-hidden": "true" })
|
|
9487
9828
|
}
|
|
9488
9829
|
);
|
|
9489
9830
|
}
|
|
@@ -9494,28 +9835,28 @@ function ToolCallValueBlock({
|
|
|
9494
9835
|
const { t } = useChatkitTranslation();
|
|
9495
9836
|
const detected = detectJsonValue(value);
|
|
9496
9837
|
if (detected.kind === "text") {
|
|
9497
|
-
return /* @__PURE__ */ (0,
|
|
9498
|
-
/* @__PURE__ */ (0,
|
|
9499
|
-
/* @__PURE__ */ (0,
|
|
9838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "min-w-0 space-y-1", children: [
|
|
9839
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ToolCallCopyButton, { value: detected.text }) }),
|
|
9840
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(PlainTextBlock, { value: detected.text, destructive })
|
|
9500
9841
|
] });
|
|
9501
9842
|
}
|
|
9502
|
-
return /* @__PURE__ */ (0,
|
|
9503
|
-
/* @__PURE__ */ (0,
|
|
9504
|
-
/* @__PURE__ */ (0,
|
|
9843
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Tabs, { defaultValue: "tree", className: "min-w-0", children: [
|
|
9844
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "mb-2 flex min-w-0 items-center justify-between gap-2", children: [
|
|
9845
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "min-w-0 truncate text-[11px] text-muted-foreground", children: [
|
|
9505
9846
|
t("message.toolGroup.jsonTitle"),
|
|
9506
9847
|
" \xB7 ",
|
|
9507
9848
|
getJsonValueSummary(detected.value)
|
|
9508
9849
|
] }),
|
|
9509
|
-
/* @__PURE__ */ (0,
|
|
9510
|
-
/* @__PURE__ */ (0,
|
|
9511
|
-
/* @__PURE__ */ (0,
|
|
9512
|
-
/* @__PURE__ */ (0,
|
|
9513
|
-
/* @__PURE__ */ (0,
|
|
9850
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
9851
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ToolCallCopyButton, { value: detected.raw }),
|
|
9852
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(TabsList, { className: "rounded-md p-0.5", children: [
|
|
9853
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "tree", children: t("message.toolGroup.jsonTree") }),
|
|
9854
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "raw", children: t("message.toolGroup.jsonRaw") })
|
|
9514
9855
|
] })
|
|
9515
9856
|
] })
|
|
9516
9857
|
] }),
|
|
9517
|
-
/* @__PURE__ */ (0,
|
|
9518
|
-
/* @__PURE__ */ (0,
|
|
9858
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TabsContent, { value: "tree", className: "mt-0", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(JsonTreeView, { value: detected.value }) }),
|
|
9859
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TabsContent, { value: "raw", className: "mt-0", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(RawJsonBlock, { raw: detected.raw }) })
|
|
9519
9860
|
] });
|
|
9520
9861
|
}
|
|
9521
9862
|
function DefaultToolCallOutput({ data }) {
|
|
@@ -9523,37 +9864,40 @@ function DefaultToolCallOutput({ data }) {
|
|
|
9523
9864
|
const output = data.output ?? null;
|
|
9524
9865
|
const error = data.error ?? null;
|
|
9525
9866
|
if (error) {
|
|
9526
|
-
return /* @__PURE__ */ (0,
|
|
9527
|
-
/* @__PURE__ */ (0,
|
|
9528
|
-
/* @__PURE__ */ (0,
|
|
9867
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "space-y-1", children: [
|
|
9868
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "text-[11px] font-medium text-destructive", children: t("message.toolGroup.errorTitle") }),
|
|
9869
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ToolCallValueBlock, { value: error, destructive: true })
|
|
9529
9870
|
] });
|
|
9530
9871
|
}
|
|
9531
9872
|
if (output === null) return null;
|
|
9532
|
-
return /* @__PURE__ */ (0,
|
|
9533
|
-
/* @__PURE__ */ (0,
|
|
9534
|
-
/* @__PURE__ */ (0,
|
|
9873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "space-y-1", children: [
|
|
9874
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.toolGroup.outputTitle") }),
|
|
9875
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ToolCallValueBlock, { value: output })
|
|
9535
9876
|
] });
|
|
9536
9877
|
}
|
|
9537
9878
|
function ToolCallDetails({ content }) {
|
|
9538
9879
|
const { t } = useChatkitTranslation();
|
|
9539
9880
|
const data = getToolStepData(content);
|
|
9881
|
+
if (isSandboxShellStep(data)) {
|
|
9882
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "ml-2 mt-1", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(SandboxShellToolCallCard, { data }) });
|
|
9883
|
+
}
|
|
9540
9884
|
const renderer = getComponentMessageRenderer(content, data);
|
|
9541
9885
|
const hasCustomDetails = data.error === void 0 && hasComponentMessageRendererDetails(renderer, content, data);
|
|
9542
9886
|
const CustomDetailsRenderer = hasCustomDetails ? renderer?.renderDetails : void 0;
|
|
9543
9887
|
if (CustomDetailsRenderer) {
|
|
9544
|
-
return /* @__PURE__ */ (0,
|
|
9888
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "ml-6 mt-1 max-h-60 overflow-auto rounded-md bg-muted/30 text-xs text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CustomDetailsRenderer, { content, data }) });
|
|
9545
9889
|
}
|
|
9546
9890
|
const OutputRenderer = getToolCallOutputRenderer(data);
|
|
9547
9891
|
const hasInput = data.input !== void 0 && data.input !== null;
|
|
9548
9892
|
const hasOutput = data.error !== void 0 || data.output !== void 0;
|
|
9549
9893
|
if (!hasInput && !hasOutput) return null;
|
|
9550
|
-
return /* @__PURE__ */ (0,
|
|
9551
|
-
hasInput && /* @__PURE__ */ (0,
|
|
9552
|
-
/* @__PURE__ */ (0,
|
|
9553
|
-
/* @__PURE__ */ (0,
|
|
9894
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "ml-6 mt-1 max-h-60 overflow-auto rounded-md bg-muted/30 px-3 py-2 text-xs text-muted-foreground", children: [
|
|
9895
|
+
hasInput && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "space-y-1", children: [
|
|
9896
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.toolGroup.inputTitle") }),
|
|
9897
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ToolCallValueBlock, { value: data.input })
|
|
9554
9898
|
] }),
|
|
9555
|
-
hasInput && hasOutput ? /* @__PURE__ */ (0,
|
|
9556
|
-
hasOutput ? /* @__PURE__ */ (0,
|
|
9899
|
+
hasInput && hasOutput ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "h-2" }) : null,
|
|
9900
|
+
hasOutput ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(OutputRenderer, { content, data }) : null
|
|
9557
9901
|
] });
|
|
9558
9902
|
}
|
|
9559
9903
|
function areToolCallRowPropsEqual(previous, next) {
|
|
@@ -9565,15 +9909,16 @@ function ToolCallRowContent({
|
|
|
9565
9909
|
organizationId,
|
|
9566
9910
|
apiUrl
|
|
9567
9911
|
}) {
|
|
9568
|
-
const { i18n: i18n2 } = useChatkitTranslation();
|
|
9912
|
+
const { i18n: i18n2, t } = useChatkitTranslation();
|
|
9569
9913
|
const data = getToolStepData(content);
|
|
9570
9914
|
const status = getEffectiveToolStepStatus(data, isThreadRunning);
|
|
9571
9915
|
const hasError = status === "fail" || Boolean(data.error);
|
|
9572
|
-
const
|
|
9916
|
+
const isSandboxShell = isSandboxShellStep(data);
|
|
9917
|
+
const detailsId = React31.useId();
|
|
9573
9918
|
const renderer = getComponentMessageRenderer(content, data);
|
|
9574
|
-
const label = renderer?.getTitle?.(content, data, i18n2.language) ?? getToolActivityLabel(content, i18n2.language, status);
|
|
9919
|
+
const label = isSandboxShell ? getSandboxShellActivityLabel(data, status, i18n2.language, t) : renderer?.getTitle?.(content, data, i18n2.language) ?? getToolActivityLabel(content, i18n2.language, status);
|
|
9575
9920
|
const hasCustomDetails = data.error === void 0 && hasComponentMessageRendererDetails(renderer, content, data);
|
|
9576
|
-
const hasDetails = data.input !== void 0 || data.error !== void 0 || data.output !== void 0 || hasCustomDetails;
|
|
9921
|
+
const hasDetails = isSandboxShell || data.input !== void 0 || data.error !== void 0 || data.output !== void 0 || hasCustomDetails;
|
|
9577
9922
|
const fallbackEndedAt = useFrozenTimestamp(
|
|
9578
9923
|
data.status === "running" && status === "fail"
|
|
9579
9924
|
);
|
|
@@ -9581,14 +9926,14 @@ function ToolCallRowContent({
|
|
|
9581
9926
|
status,
|
|
9582
9927
|
fallbackEndedAt
|
|
9583
9928
|
});
|
|
9584
|
-
const [isExpanded, setIsExpanded] =
|
|
9585
|
-
|
|
9929
|
+
const [isExpanded, setIsExpanded] = React31.useState(false);
|
|
9930
|
+
React31.useEffect(() => {
|
|
9586
9931
|
if (status === "running" && data.output !== void 0) {
|
|
9587
9932
|
setIsExpanded(true);
|
|
9588
9933
|
}
|
|
9589
9934
|
}, [data.output, status]);
|
|
9590
|
-
return /* @__PURE__ */ (0,
|
|
9591
|
-
/* @__PURE__ */ (0,
|
|
9935
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("li", { className: "ck-tool-call-row-enter min-w-0", children: [
|
|
9936
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
9592
9937
|
"button",
|
|
9593
9938
|
{
|
|
9594
9939
|
type: "button",
|
|
@@ -9596,7 +9941,7 @@ function ToolCallRowContent({
|
|
|
9596
9941
|
"group/tool-call flex w-full min-w-0 items-center gap-2 text-left text-muted-foreground",
|
|
9597
9942
|
TOOL_CALL_ROW_TEXT_CLASS,
|
|
9598
9943
|
hasDetails && "cursor-pointer hover:text-foreground",
|
|
9599
|
-
hasError && "text-destructive hover:text-destructive"
|
|
9944
|
+
hasError && !isSandboxShell && "text-destructive hover:text-destructive"
|
|
9600
9945
|
),
|
|
9601
9946
|
"aria-expanded": hasDetails ? isExpanded : void 0,
|
|
9602
9947
|
"aria-controls": hasDetails ? detailsId : void 0,
|
|
@@ -9605,7 +9950,7 @@ function ToolCallRowContent({
|
|
|
9605
9950
|
if (hasDetails) setIsExpanded((prev) => !prev);
|
|
9606
9951
|
},
|
|
9607
9952
|
children: [
|
|
9608
|
-
status ? /* @__PURE__ */ (0,
|
|
9953
|
+
status ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9609
9954
|
ToolStepIcon,
|
|
9610
9955
|
{
|
|
9611
9956
|
data,
|
|
@@ -9613,11 +9958,11 @@ function ToolCallRowContent({
|
|
|
9613
9958
|
apiUrl,
|
|
9614
9959
|
className: cn(
|
|
9615
9960
|
"h-3.5 w-3.5 shrink-0",
|
|
9616
|
-
hasError ? "text-destructive" : "text-muted-foreground"
|
|
9961
|
+
hasError && !isSandboxShell ? "text-destructive" : "text-muted-foreground"
|
|
9617
9962
|
)
|
|
9618
9963
|
}
|
|
9619
|
-
) : /* @__PURE__ */ (0,
|
|
9620
|
-
/* @__PURE__ */ (0,
|
|
9964
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "h-3.5 w-3.5 shrink-0", "aria-hidden": "true" }),
|
|
9965
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9621
9966
|
"span",
|
|
9622
9967
|
{
|
|
9623
9968
|
className: cn(
|
|
@@ -9628,9 +9973,9 @@ function ToolCallRowContent({
|
|
|
9628
9973
|
children: label
|
|
9629
9974
|
}
|
|
9630
9975
|
),
|
|
9631
|
-
durationLabel ? /* @__PURE__ */ (0,
|
|
9632
|
-
hasDetails ? /* @__PURE__ */ (0,
|
|
9633
|
-
|
|
9976
|
+
durationLabel ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "shrink-0 text-[11px] tabular-nums text-muted-foreground/80", children: durationLabel }) : null,
|
|
9977
|
+
hasDetails ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9978
|
+
import_lucide_react19.ChevronRight,
|
|
9634
9979
|
{
|
|
9635
9980
|
"aria-hidden": "true",
|
|
9636
9981
|
className: cn(
|
|
@@ -9642,10 +9987,10 @@ function ToolCallRowContent({
|
|
|
9642
9987
|
]
|
|
9643
9988
|
}
|
|
9644
9989
|
),
|
|
9645
|
-
hasDetails && isExpanded ? /* @__PURE__ */ (0,
|
|
9990
|
+
hasDetails && isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { id: detailsId, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ToolCallDetails, { content }) }) : null
|
|
9646
9991
|
] });
|
|
9647
9992
|
}
|
|
9648
|
-
var ToolCallRow =
|
|
9993
|
+
var ToolCallRow = React31.memo(ToolCallRowContent, areToolCallRowPropsEqual);
|
|
9649
9994
|
ToolCallRow.displayName = "ToolCallRow";
|
|
9650
9995
|
function ToolComponentGroup({
|
|
9651
9996
|
items,
|
|
@@ -9655,8 +10000,8 @@ function ToolComponentGroup({
|
|
|
9655
10000
|
apiUrl
|
|
9656
10001
|
}) {
|
|
9657
10002
|
const { t } = useChatkitTranslation();
|
|
9658
|
-
const contentId =
|
|
9659
|
-
const [isExpanded, setIsExpanded] =
|
|
10003
|
+
const contentId = React31.useId();
|
|
10004
|
+
const [isExpanded, setIsExpanded] = React31.useState(!hasFollowingItem);
|
|
9660
10005
|
const categoryCounts = getToolGroupCategoryCounts(items);
|
|
9661
10006
|
const categorySummary = TOOL_GROUP_CATEGORY_ORDER.flatMap((category) => {
|
|
9662
10007
|
const count = categoryCounts[category] ?? 0;
|
|
@@ -9671,11 +10016,11 @@ function ToolComponentGroup({
|
|
|
9671
10016
|
const summary = `${t("message.toolGroup.status.success")} ${categorySummary}`;
|
|
9672
10017
|
const config = toolStatusConfig.success;
|
|
9673
10018
|
const StatusIcon = config.icon;
|
|
9674
|
-
|
|
10019
|
+
React31.useEffect(() => {
|
|
9675
10020
|
setIsExpanded(!hasFollowingItem);
|
|
9676
10021
|
}, [hasFollowingItem]);
|
|
9677
|
-
return /* @__PURE__ */ (0,
|
|
9678
|
-
/* @__PURE__ */ (0,
|
|
10022
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "px-1 py-1", children: [
|
|
10023
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
9679
10024
|
"button",
|
|
9680
10025
|
{
|
|
9681
10026
|
type: "button",
|
|
@@ -9684,8 +10029,8 @@ function ToolComponentGroup({
|
|
|
9684
10029
|
"aria-controls": contentId,
|
|
9685
10030
|
onClick: () => setIsExpanded((prev) => !prev),
|
|
9686
10031
|
children: [
|
|
9687
|
-
/* @__PURE__ */ (0,
|
|
9688
|
-
/* @__PURE__ */ (0,
|
|
10032
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex min-w-0 items-center gap-2 text-sm font-medium text-muted-foreground", children: [
|
|
10033
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9689
10034
|
StatusIcon,
|
|
9690
10035
|
{
|
|
9691
10036
|
className: cn(
|
|
@@ -9694,10 +10039,10 @@ function ToolComponentGroup({
|
|
|
9694
10039
|
)
|
|
9695
10040
|
}
|
|
9696
10041
|
),
|
|
9697
|
-
/* @__PURE__ */ (0,
|
|
10042
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "truncate", children: summary })
|
|
9698
10043
|
] }),
|
|
9699
|
-
/* @__PURE__ */ (0,
|
|
9700
|
-
|
|
10044
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
10045
|
+
import_lucide_react19.ChevronRight,
|
|
9701
10046
|
{
|
|
9702
10047
|
"aria-hidden": "true",
|
|
9703
10048
|
className: cn(
|
|
@@ -9709,7 +10054,7 @@ function ToolComponentGroup({
|
|
|
9709
10054
|
]
|
|
9710
10055
|
}
|
|
9711
10056
|
),
|
|
9712
|
-
isExpanded && /* @__PURE__ */ (0,
|
|
10057
|
+
isExpanded && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("ul", { id: contentId, className: "mt-2 space-y-1.5 overflow-y-auto pr-1", children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9713
10058
|
ToolCallRow,
|
|
9714
10059
|
{
|
|
9715
10060
|
content: item,
|
|
@@ -9723,10 +10068,10 @@ function ToolComponentGroup({
|
|
|
9723
10068
|
}
|
|
9724
10069
|
|
|
9725
10070
|
// src/components/thread/messages/request-user-input-result-card.tsx
|
|
9726
|
-
var
|
|
9727
|
-
var
|
|
9728
|
-
var
|
|
9729
|
-
var
|
|
10071
|
+
var React32 = require("react");
|
|
10072
|
+
var import_chatkit_types8 = require("@xpert-ai/chatkit-types");
|
|
10073
|
+
var import_lucide_react20 = require("lucide-react");
|
|
10074
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
9730
10075
|
function isRecord3(value) {
|
|
9731
10076
|
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
9732
10077
|
}
|
|
@@ -9765,7 +10110,7 @@ function collectPotentialToolCalls(messages) {
|
|
|
9765
10110
|
function findRequestUserInputClientToolCallById(messages, id) {
|
|
9766
10111
|
if (!id) return null;
|
|
9767
10112
|
return collectPotentialToolCalls(messages).find(
|
|
9768
|
-
(call) => getToolCallId(call) === id && getToolCallName(call) ===
|
|
10113
|
+
(call) => getToolCallId(call) === id && getToolCallName(call) === import_chatkit_types8.REQUEST_USER_INPUT_TOOL_NAME
|
|
9769
10114
|
) ?? null;
|
|
9770
10115
|
}
|
|
9771
10116
|
function normalizeAnswer(value) {
|
|
@@ -9800,7 +10145,7 @@ function parseResultOutput(output) {
|
|
|
9800
10145
|
if (!isRecord3(result) || !Array.isArray(result.answers)) {
|
|
9801
10146
|
return null;
|
|
9802
10147
|
}
|
|
9803
|
-
const hasExplicitType = result.type ===
|
|
10148
|
+
const hasExplicitType = result.type === import_chatkit_types8.REQUEST_USER_INPUT_RESULT_TYPE;
|
|
9804
10149
|
const answers = result.answers.map(normalizeAnswer);
|
|
9805
10150
|
if (answers.some((answer) => answer === null)) {
|
|
9806
10151
|
return null;
|
|
@@ -9838,7 +10183,7 @@ function RequestUserInputResultCard({
|
|
|
9838
10183
|
className
|
|
9839
10184
|
}) {
|
|
9840
10185
|
const { t } = useChatkitTranslation();
|
|
9841
|
-
return /* @__PURE__ */ (0,
|
|
10186
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
9842
10187
|
"section",
|
|
9843
10188
|
{
|
|
9844
10189
|
"aria-label": t("message.requestUserInputResult.title"),
|
|
@@ -9847,23 +10192,23 @@ function RequestUserInputResultCard({
|
|
|
9847
10192
|
className
|
|
9848
10193
|
),
|
|
9849
10194
|
children: [
|
|
9850
|
-
/* @__PURE__ */ (0,
|
|
9851
|
-
/* @__PURE__ */ (0,
|
|
9852
|
-
/* @__PURE__ */ (0,
|
|
10195
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "mb-2 flex items-center gap-2 text-sm font-semibold text-foreground", children: [
|
|
10196
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react20.CheckCircle2, { className: "h-4 w-4 text-primary" }),
|
|
10197
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { children: t("message.requestUserInputResult.title") })
|
|
9853
10198
|
] }),
|
|
9854
|
-
/* @__PURE__ */ (0,
|
|
10199
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "space-y-2", children: result.answers.map((answer, index) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
9855
10200
|
"div",
|
|
9856
10201
|
{
|
|
9857
10202
|
className: "rounded-md bg-background/70 px-2.5 py-2",
|
|
9858
10203
|
children: [
|
|
9859
|
-
/* @__PURE__ */ (0,
|
|
9860
|
-
/* @__PURE__ */ (0,
|
|
9861
|
-
/* @__PURE__ */ (0,
|
|
9862
|
-
/* @__PURE__ */ (0,
|
|
10204
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "text-xs font-medium leading-5 text-muted-foreground", children: answer.question }),
|
|
10205
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "mt-0.5 flex min-w-0 flex-wrap items-center gap-1.5", children: [
|
|
10206
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "min-w-0 wrap-break-word text-sm font-semibold text-foreground", children: answer.label ?? answer.value }),
|
|
10207
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "rounded-full bg-muted px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground", children: t(
|
|
9863
10208
|
answer.type === "other" ? "message.requestUserInputResult.other" : "message.requestUserInputResult.option"
|
|
9864
10209
|
) })
|
|
9865
10210
|
] }),
|
|
9866
|
-
answer.description ? /* @__PURE__ */ (0,
|
|
10211
|
+
answer.description ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "mt-1 text-xs leading-5 text-muted-foreground", children: answer.description }) : null
|
|
9867
10212
|
]
|
|
9868
10213
|
},
|
|
9869
10214
|
`${answer.id}-${index}`
|
|
@@ -9875,18 +10220,18 @@ function RequestUserInputResultCard({
|
|
|
9875
10220
|
|
|
9876
10221
|
// src/components/thread/messages/widget.tsx
|
|
9877
10222
|
var import_a2ui_react = require("@xpert-ai/a2ui-react");
|
|
9878
|
-
var
|
|
10223
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
9879
10224
|
function WidgetMessage({ messageId, data }) {
|
|
9880
10225
|
const widgets = Array.isArray(data.widgets) ? data.widgets : [];
|
|
9881
10226
|
if (widgets.length === 0) return null;
|
|
9882
10227
|
const baseSurfaceId = `widget-${messageId}`;
|
|
9883
|
-
return /* @__PURE__ */ (0,
|
|
10228
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "space-y-3", children: widgets.map((widget, index) => {
|
|
9884
10229
|
const config = widget?.config;
|
|
9885
10230
|
if (!config || typeof config !== "object") {
|
|
9886
10231
|
return null;
|
|
9887
10232
|
}
|
|
9888
10233
|
const surfaceId = widgets.length > 1 ? `${baseSurfaceId}-${index}` : baseSurfaceId;
|
|
9889
|
-
return /* @__PURE__ */ (0,
|
|
10234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
9890
10235
|
import_a2ui_react.SurfaceRenderer,
|
|
9891
10236
|
{
|
|
9892
10237
|
surfaceId,
|
|
@@ -9898,7 +10243,7 @@ function WidgetMessage({ messageId, data }) {
|
|
|
9898
10243
|
}
|
|
9899
10244
|
|
|
9900
10245
|
// src/components/thread/messages/ai.tsx
|
|
9901
|
-
var
|
|
10246
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
9902
10247
|
var assistantMessageStackClassName = "space-y-3 in-data-[density=compact]:space-y-2 in-data-[density=spacious]:space-y-4";
|
|
9903
10248
|
function isTextContent3(content) {
|
|
9904
10249
|
return content.type === "text";
|
|
@@ -9929,14 +10274,16 @@ function safeJson3(value) {
|
|
|
9929
10274
|
function formatDisplayValue3(value) {
|
|
9930
10275
|
return typeof value === "string" ? value : safeJson3(value);
|
|
9931
10276
|
}
|
|
9932
|
-
function ReasoningBlock({
|
|
10277
|
+
function ReasoningBlock({
|
|
10278
|
+
reasoning
|
|
10279
|
+
}) {
|
|
9933
10280
|
const blocks = reasoning.filter((item) => item.text?.trim());
|
|
9934
10281
|
if (blocks.length === 0) return null;
|
|
9935
|
-
return /* @__PURE__ */ (0,
|
|
10282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "space-y-2", children: blocks.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
9936
10283
|
"div",
|
|
9937
10284
|
{
|
|
9938
10285
|
className: "rounded-lg border bg-muted/40 p-3 text-xs text-muted-foreground",
|
|
9939
|
-
children: /* @__PURE__ */ (0,
|
|
10286
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "whitespace-pre-wrap wrap-break-word leading-relaxed", children: item.text })
|
|
9940
10287
|
},
|
|
9941
10288
|
item.id ?? `reasoning-${index}`
|
|
9942
10289
|
)) });
|
|
@@ -9944,20 +10291,27 @@ function ReasoningBlock({ reasoning }) {
|
|
|
9944
10291
|
function ImageBlock({ content }) {
|
|
9945
10292
|
const imageUrl = typeof content.image_url === "string" ? content.image_url : typeof content.image_url?.url === "string" ? content.image_url.url : null;
|
|
9946
10293
|
if (!imageUrl) {
|
|
9947
|
-
return /* @__PURE__ */ (0,
|
|
9948
|
-
/* @__PURE__ */ (0,
|
|
9949
|
-
/* @__PURE__ */ (0,
|
|
10294
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Card, { children: [
|
|
10295
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CardHeader, { className: "space-y-1", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CardTitle, { className: "text-sm", children: "Image" }) }),
|
|
10296
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CardContent, { className: "text-xs text-muted-foreground", children: safeJson3(content) })
|
|
9950
10297
|
] });
|
|
9951
10298
|
}
|
|
9952
|
-
return /* @__PURE__ */ (0,
|
|
10299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("figure", { className: "overflow-hidden rounded-lg border bg-background", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
10300
|
+
"img",
|
|
10301
|
+
{
|
|
10302
|
+
src: imageUrl,
|
|
10303
|
+
alt: "Assistant output",
|
|
10304
|
+
className: "h-auto w-full object-cover"
|
|
10305
|
+
}
|
|
10306
|
+
) });
|
|
9953
10307
|
}
|
|
9954
10308
|
function MemoryBlock({ content }) {
|
|
9955
|
-
return /* @__PURE__ */ (0,
|
|
9956
|
-
/* @__PURE__ */ (0,
|
|
9957
|
-
/* @__PURE__ */ (0,
|
|
9958
|
-
/* @__PURE__ */ (0,
|
|
10309
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Card, { children: [
|
|
10310
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(CardHeader, { className: "flex flex-row items-center justify-between gap-2", children: [
|
|
10311
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CardTitle, { className: "text-sm", children: "Memory" }),
|
|
10312
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Badge, { variant: "secondary", children: "Memory" })
|
|
9959
10313
|
] }),
|
|
9960
|
-
/* @__PURE__ */ (0,
|
|
10314
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CardContent, { className: "text-xs text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("pre", { className: "whitespace-pre-wrap wrap-break-word", children: safeJson3(content.data ?? []) }) })
|
|
9961
10315
|
] });
|
|
9962
10316
|
}
|
|
9963
10317
|
function parseStepDate2(value) {
|
|
@@ -9991,11 +10345,11 @@ function formatStepDuration3(durationMs) {
|
|
|
9991
10345
|
}
|
|
9992
10346
|
function ComponentBlock({ content }) {
|
|
9993
10347
|
const { i18n: i18n2 } = useChatkitTranslation();
|
|
9994
|
-
const [isExpanded, setIsExpanded] =
|
|
9995
|
-
const contentRef =
|
|
9996
|
-
const shouldAutoScrollRef =
|
|
9997
|
-
const previousScrollTopRef =
|
|
9998
|
-
const [durationNow, setDurationNow] =
|
|
10348
|
+
const [isExpanded, setIsExpanded] = React33.useState(false);
|
|
10349
|
+
const contentRef = React33.useRef(null);
|
|
10350
|
+
const shouldAutoScrollRef = React33.useRef(true);
|
|
10351
|
+
const previousScrollTopRef = React33.useRef(0);
|
|
10352
|
+
const [durationNow, setDurationNow] = React33.useState(() => Date.now());
|
|
9999
10353
|
const data = getToolStepData(content);
|
|
10000
10354
|
const category = data.category ?? "Component";
|
|
10001
10355
|
const title = getToolActivityLabel(content, i18n2.language);
|
|
@@ -10009,10 +10363,10 @@ function ComponentBlock({ content }) {
|
|
|
10009
10363
|
const endedAt = parseStepDate2(data.end_date);
|
|
10010
10364
|
const durationMs = createdAt === null ? null : Math.max(0, (endedAt ?? durationNow) - createdAt);
|
|
10011
10365
|
const durationLabel = durationMs === null ? null : formatStepDuration3(durationMs);
|
|
10012
|
-
|
|
10366
|
+
React33.useEffect(() => {
|
|
10013
10367
|
if (status === "running" && output !== null) setIsExpanded(true);
|
|
10014
10368
|
}, [status, output]);
|
|
10015
|
-
|
|
10369
|
+
React33.useEffect(() => {
|
|
10016
10370
|
if (status !== "running" || createdAt === null || endedAt !== null) {
|
|
10017
10371
|
return;
|
|
10018
10372
|
}
|
|
@@ -10024,7 +10378,7 @@ function ComponentBlock({ content }) {
|
|
|
10024
10378
|
window.clearInterval(timer);
|
|
10025
10379
|
};
|
|
10026
10380
|
}, [createdAt, endedAt, status]);
|
|
10027
|
-
|
|
10381
|
+
React33.useEffect(() => {
|
|
10028
10382
|
const element = contentRef.current;
|
|
10029
10383
|
if (!element) return;
|
|
10030
10384
|
previousScrollTopRef.current = element.scrollTop;
|
|
@@ -10039,12 +10393,14 @@ function ComponentBlock({ content }) {
|
|
|
10039
10393
|
shouldAutoScrollRef.current = isNearBottom(element);
|
|
10040
10394
|
};
|
|
10041
10395
|
updateAutoScrollState();
|
|
10042
|
-
element.addEventListener("scroll", updateAutoScrollState, {
|
|
10396
|
+
element.addEventListener("scroll", updateAutoScrollState, {
|
|
10397
|
+
passive: true
|
|
10398
|
+
});
|
|
10043
10399
|
return () => {
|
|
10044
10400
|
element.removeEventListener("scroll", updateAutoScrollState);
|
|
10045
10401
|
};
|
|
10046
10402
|
}, [isExpanded]);
|
|
10047
|
-
|
|
10403
|
+
React33.useEffect(() => {
|
|
10048
10404
|
if (status !== "running") {
|
|
10049
10405
|
shouldAutoScrollRef.current = true;
|
|
10050
10406
|
return;
|
|
@@ -10057,76 +10413,112 @@ function ComponentBlock({ content }) {
|
|
|
10057
10413
|
}, [isExpanded, output, status]);
|
|
10058
10414
|
const config = status ? toolStatusConfig[status] : null;
|
|
10059
10415
|
const StatusIcon = config?.icon;
|
|
10060
|
-
return /* @__PURE__ */ (0,
|
|
10061
|
-
/* @__PURE__ */ (0,
|
|
10062
|
-
|
|
10063
|
-
|
|
10064
|
-
|
|
10065
|
-
|
|
10066
|
-
|
|
10067
|
-
|
|
10068
|
-
|
|
10069
|
-
|
|
10070
|
-
|
|
10071
|
-
|
|
10072
|
-
|
|
10073
|
-
|
|
10074
|
-
|
|
10075
|
-
|
|
10076
|
-
|
|
10077
|
-
|
|
10078
|
-
|
|
10416
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Card, { children: [
|
|
10417
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
10418
|
+
CardHeader,
|
|
10419
|
+
{
|
|
10420
|
+
className: "flex flex-row items-center justify-between gap-2 px-2 py-1 cursor-pointer",
|
|
10421
|
+
onClick: () => setIsExpanded(!isExpanded),
|
|
10422
|
+
children: [
|
|
10423
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-center space-x-1 flex-1 min-w-0", children: [
|
|
10424
|
+
status && StatusIcon && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
10425
|
+
StatusIcon,
|
|
10426
|
+
{
|
|
10427
|
+
className: cn(
|
|
10428
|
+
"h-4 w-4",
|
|
10429
|
+
config?.iconClass,
|
|
10430
|
+
status === "running" && "animate-spin"
|
|
10431
|
+
)
|
|
10432
|
+
}
|
|
10433
|
+
),
|
|
10434
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CardTitle, { className: "text-sm truncate", children: title })
|
|
10435
|
+
] }),
|
|
10436
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex flex-wrap items-center gap-2 shrink-0", children: [
|
|
10437
|
+
durationLabel && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "inline-flex items-center gap-1 text-[11px] text-muted-foreground tabular-nums", children: [
|
|
10438
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react21.Clock3, { className: "h-3 w-3" }),
|
|
10439
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: durationLabel })
|
|
10440
|
+
] }),
|
|
10441
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Badge, { variant: "secondary", className: "rounded-lg px-1.5", children: category }),
|
|
10442
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
10443
|
+
"button",
|
|
10079
10444
|
{
|
|
10080
|
-
className:
|
|
10445
|
+
className: "text-muted-foreground hover:text-foreground transition-colors",
|
|
10446
|
+
"aria-label": isExpanded ? "Collapse" : "Expand",
|
|
10447
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
10448
|
+
import_lucide_react21.ChevronDown,
|
|
10449
|
+
{
|
|
10450
|
+
className: cn(
|
|
10451
|
+
"h-4 w-4 transition-transform",
|
|
10452
|
+
isExpanded && "rotate-180"
|
|
10453
|
+
)
|
|
10454
|
+
}
|
|
10455
|
+
)
|
|
10081
10456
|
}
|
|
10082
10457
|
)
|
|
10083
|
-
}
|
|
10084
|
-
|
|
10085
|
-
|
|
10086
|
-
|
|
10087
|
-
isExpanded && /* @__PURE__ */ (0,
|
|
10088
|
-
|
|
10089
|
-
|
|
10090
|
-
|
|
10458
|
+
] })
|
|
10459
|
+
]
|
|
10460
|
+
}
|
|
10461
|
+
),
|
|
10462
|
+
isExpanded && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
10463
|
+
CardContent,
|
|
10464
|
+
{
|
|
10465
|
+
ref: contentRef,
|
|
10466
|
+
className: "text-xs text-muted-foreground max-h-60 overflow-auto",
|
|
10467
|
+
children: [
|
|
10468
|
+
data.input && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("pre", { className: "whitespace-pre-wrap wrap-break-word", children: formatDisplayValue3(data.input) }),
|
|
10469
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("pre", { className: "whitespace-pre-wrap wrap-break-word text-destructive", children: formatDisplayValue3(error) }) : hasOutput && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("pre", { className: "whitespace-pre-wrap wrap-break-word", children: formatDisplayValue3(fallback) })
|
|
10470
|
+
]
|
|
10471
|
+
}
|
|
10472
|
+
)
|
|
10091
10473
|
] });
|
|
10092
10474
|
}
|
|
10093
10475
|
function UnknownBlock({ content }) {
|
|
10094
|
-
return /* @__PURE__ */ (0,
|
|
10095
|
-
/* @__PURE__ */ (0,
|
|
10096
|
-
/* @__PURE__ */ (0,
|
|
10097
|
-
/* @__PURE__ */ (0,
|
|
10476
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Card, { children: [
|
|
10477
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(CardHeader, { className: "flex flex-row items-center justify-between gap-2", children: [
|
|
10478
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CardTitle, { className: "text-sm", children: "Assistant Content" }),
|
|
10479
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Badge, { variant: "outline", children: content.type ?? "unknown" })
|
|
10098
10480
|
] }),
|
|
10099
|
-
/* @__PURE__ */ (0,
|
|
10481
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CardContent, { className: "text-xs text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("pre", { className: "whitespace-pre-wrap break-words", children: safeJson3(content) }) })
|
|
10100
10482
|
] });
|
|
10101
10483
|
}
|
|
10102
10484
|
function renderContentItem(content, index, message, lookupMessages, options) {
|
|
10103
10485
|
const messageId = message.id;
|
|
10104
10486
|
const textClassName = options?.isAgentOutput ? "text-sm [&_.markdown-content_p]:!leading-6" : void 0;
|
|
10105
10487
|
if (typeof content === "string") {
|
|
10106
|
-
return /* @__PURE__ */ (0,
|
|
10488
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: textClassName, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MarkdownText, { children: content }) }, `text-${index}`);
|
|
10107
10489
|
}
|
|
10108
10490
|
if (isTextContent3(content)) {
|
|
10109
|
-
return /* @__PURE__ */ (0,
|
|
10491
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: textClassName, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MarkdownText, { children: content.text }) }, content.id ?? `text-${index}`);
|
|
10110
10492
|
}
|
|
10111
10493
|
if (isReasoningContent3(content)) {
|
|
10112
|
-
return /* @__PURE__ */ (0,
|
|
10494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ReasoningBlock, { reasoning: [content] }) }, content.id ?? `reasoning-${index}`);
|
|
10113
10495
|
}
|
|
10114
10496
|
if (isImageContent(content)) {
|
|
10115
|
-
return /* @__PURE__ */ (0,
|
|
10497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ImageBlock, { content }) }, content.id ?? `image-${index}`);
|
|
10116
10498
|
}
|
|
10117
10499
|
if (isComponentContent3(content)) {
|
|
10500
|
+
if (isContextCompressionComponent(content)) {
|
|
10501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
10502
|
+
"div",
|
|
10503
|
+
{
|
|
10504
|
+
className: "w-full",
|
|
10505
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ContextCompressionMessage, { content })
|
|
10506
|
+
},
|
|
10507
|
+
content.id ?? `context-compression-${index}`
|
|
10508
|
+
);
|
|
10509
|
+
}
|
|
10118
10510
|
const requestUserInputResult = getRequestUserInputResultCardData(
|
|
10119
10511
|
content,
|
|
10120
10512
|
lookupMessages
|
|
10121
10513
|
);
|
|
10122
10514
|
if (requestUserInputResult) {
|
|
10123
|
-
return /* @__PURE__ */ (0,
|
|
10515
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(RequestUserInputResultCard, { result: requestUserInputResult }) }, content.id ?? `request-user-input-result-${index}`);
|
|
10124
10516
|
}
|
|
10125
10517
|
if (isWidgetComponent2(content)) {
|
|
10126
|
-
return /* @__PURE__ */ (0,
|
|
10518
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(WidgetMessage, { messageId, data: content.data }) }, content.id ?? `widget-${index}`);
|
|
10127
10519
|
}
|
|
10128
10520
|
if (getComponentMessagePresentation(content, getToolStepData(content)) === "grouped-step") {
|
|
10129
|
-
return /* @__PURE__ */ (0,
|
|
10521
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
10130
10522
|
ToolComponentGroup,
|
|
10131
10523
|
{
|
|
10132
10524
|
items: [content],
|
|
@@ -10137,15 +10529,15 @@ function renderContentItem(content, index, message, lookupMessages, options) {
|
|
|
10137
10529
|
}
|
|
10138
10530
|
) }, content.id ?? `component-group-${index}`);
|
|
10139
10531
|
}
|
|
10140
|
-
return /* @__PURE__ */ (0,
|
|
10532
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ComponentBlock, { content }) }, content.id ?? `component-${index}`);
|
|
10141
10533
|
}
|
|
10142
10534
|
if (isMemoryContent(content)) {
|
|
10143
|
-
return /* @__PURE__ */ (0,
|
|
10535
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MemoryBlock, { content }) }, content.id ?? `memory-${index}`);
|
|
10144
10536
|
}
|
|
10145
10537
|
if (isAgentEventContent(content)) {
|
|
10146
|
-
return /* @__PURE__ */ (0,
|
|
10538
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(AgentEventRow, { content }) }, content.id ?? `agent-event-${index}`);
|
|
10147
10539
|
}
|
|
10148
|
-
return /* @__PURE__ */ (0,
|
|
10540
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(UnknownBlock, { content }) }, content.id ?? `unknown-${index}`);
|
|
10149
10541
|
}
|
|
10150
10542
|
function renderContentUnit(unit, message, lookupMessages, hasFollowingItem, options) {
|
|
10151
10543
|
if (unit.type === "item") {
|
|
@@ -10156,7 +10548,7 @@ function renderContentUnit(unit, message, lookupMessages, hasFollowingItem, opti
|
|
|
10156
10548
|
isAgentOutput: options?.isAgentOutput
|
|
10157
10549
|
});
|
|
10158
10550
|
}
|
|
10159
|
-
return /* @__PURE__ */ (0,
|
|
10551
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
10160
10552
|
ToolComponentGroup,
|
|
10161
10553
|
{
|
|
10162
10554
|
items: unit.items,
|
|
@@ -10193,7 +10585,7 @@ function renderAssistantRenderUnits(units, message, lookupMessages, options, dep
|
|
|
10193
10585
|
const batch = entryBatch;
|
|
10194
10586
|
entryBatch = [];
|
|
10195
10587
|
rendered.push(
|
|
10196
|
-
/* @__PURE__ */ (0,
|
|
10588
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(React33.Fragment, { children: renderEntryBatch(batch, message, lookupMessages, hasFollowingItem, {
|
|
10197
10589
|
...options,
|
|
10198
10590
|
isAgentOutput: depth > 0
|
|
10199
10591
|
}) }, `entries-${batch[0]?.order ?? rendered.length}`)
|
|
@@ -10210,7 +10602,7 @@ function renderAssistantRenderUnits(units, message, lookupMessages, options, dep
|
|
|
10210
10602
|
}
|
|
10211
10603
|
flushEntries(true);
|
|
10212
10604
|
rendered.push(
|
|
10213
|
-
/* @__PURE__ */ (0,
|
|
10605
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
10214
10606
|
AgentRunGroup,
|
|
10215
10607
|
{
|
|
10216
10608
|
node: unit.node,
|
|
@@ -10235,7 +10627,7 @@ function renderContent(message, lookupMessages, options) {
|
|
|
10235
10627
|
message
|
|
10236
10628
|
);
|
|
10237
10629
|
if (renderTree.hasAgentRuns) {
|
|
10238
|
-
return /* @__PURE__ */ (0,
|
|
10630
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: assistantMessageStackClassName, children: renderAssistantRenderUnits(
|
|
10239
10631
|
renderTree.units,
|
|
10240
10632
|
message,
|
|
10241
10633
|
lookupMessages,
|
|
@@ -10245,13 +10637,13 @@ function renderContent(message, lookupMessages, options) {
|
|
|
10245
10637
|
const content = message.content;
|
|
10246
10638
|
if (typeof content === "string") {
|
|
10247
10639
|
if (!content.trim()) return null;
|
|
10248
|
-
return /* @__PURE__ */ (0,
|
|
10640
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MarkdownText, { children: content });
|
|
10249
10641
|
}
|
|
10250
10642
|
if (!Array.isArray(content) || content.length === 0) return null;
|
|
10251
10643
|
const renderUnits = buildToolComponentRenderUnits(content, {
|
|
10252
10644
|
shouldGroupComponent: (item) => getRequestUserInputResultCardData(item, lookupMessages) === null
|
|
10253
10645
|
});
|
|
10254
|
-
return /* @__PURE__ */ (0,
|
|
10646
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "space-y-3", children: renderUnits.map(
|
|
10255
10647
|
(unit, index) => renderContentUnit(
|
|
10256
10648
|
unit,
|
|
10257
10649
|
message,
|
|
@@ -10271,7 +10663,7 @@ function AssistantStreamingIndicator({
|
|
|
10271
10663
|
thinking: t("message.thinking"),
|
|
10272
10664
|
answering: t("message.answering")
|
|
10273
10665
|
};
|
|
10274
|
-
return /* @__PURE__ */ (0,
|
|
10666
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
10275
10667
|
"div",
|
|
10276
10668
|
{
|
|
10277
10669
|
className: cn(
|
|
@@ -10279,18 +10671,18 @@ function AssistantStreamingIndicator({
|
|
|
10279
10671
|
className
|
|
10280
10672
|
),
|
|
10281
10673
|
children: [
|
|
10282
|
-
status === "loading" && /* @__PURE__ */ (0,
|
|
10283
|
-
status === "thinking" && /* @__PURE__ */ (0,
|
|
10284
|
-
/* @__PURE__ */ (0,
|
|
10285
|
-
/* @__PURE__ */ (0,
|
|
10286
|
-
/* @__PURE__ */ (0,
|
|
10674
|
+
status === "loading" && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react21.Loader2, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
10675
|
+
status === "thinking" && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-end gap-1", "aria-hidden": "true", children: [
|
|
10676
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:-0.3s]" }),
|
|
10677
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:-0.15s]" }),
|
|
10678
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce" })
|
|
10287
10679
|
] }),
|
|
10288
|
-
status === "answering" && /* @__PURE__ */ (0,
|
|
10289
|
-
/* @__PURE__ */ (0,
|
|
10290
|
-
/* @__PURE__ */ (0,
|
|
10291
|
-
/* @__PURE__ */ (0,
|
|
10680
|
+
status === "answering" && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-end gap-1", "aria-hidden": "true", children: [
|
|
10681
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "h-2 w-0.5 rounded-full bg-current animate-pulse [animation-delay:-0.25s]" }),
|
|
10682
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "h-3 w-0.5 rounded-full bg-current animate-pulse [animation-delay:-0.1s]" }),
|
|
10683
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "h-2.5 w-0.5 rounded-full bg-current animate-pulse" })
|
|
10292
10684
|
] }),
|
|
10293
|
-
/* @__PURE__ */ (0,
|
|
10685
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: labelMap[status] })
|
|
10294
10686
|
]
|
|
10295
10687
|
}
|
|
10296
10688
|
);
|
|
@@ -10319,42 +10711,42 @@ function AssistantMessage({
|
|
|
10319
10711
|
organizationId,
|
|
10320
10712
|
apiUrl
|
|
10321
10713
|
});
|
|
10322
|
-
const reasoningNode = hasReasoning ? /* @__PURE__ */ (0,
|
|
10714
|
+
const reasoningNode = hasReasoning ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ReasoningBlock, { reasoning: rootReasoning ?? [] }) : null;
|
|
10323
10715
|
if (!hasContent && !hasReasoning && !resolvedStreamingStatus) return null;
|
|
10324
10716
|
const streamingClass = isStreaming ? "streaming-active" : "";
|
|
10325
10717
|
if (!hasContent && !hasReasoning && resolvedStreamingStatus) {
|
|
10326
|
-
return /* @__PURE__ */ (0,
|
|
10718
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: cn("space-y-3", streamingClass, className), children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) });
|
|
10327
10719
|
}
|
|
10328
10720
|
if (hasContent && hasReasoning) {
|
|
10329
|
-
return /* @__PURE__ */ (0,
|
|
10330
|
-
/* @__PURE__ */ (0,
|
|
10721
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: cn("space-y-3", streamingClass, className), children: [
|
|
10722
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
10331
10723
|
Tabs,
|
|
10332
10724
|
{
|
|
10333
10725
|
defaultValue: message.status === "reasoning" ? "reasoning" : "answer",
|
|
10334
10726
|
className: "w-full",
|
|
10335
10727
|
children: [
|
|
10336
|
-
/* @__PURE__ */ (0,
|
|
10337
|
-
/* @__PURE__ */ (0,
|
|
10338
|
-
/* @__PURE__ */ (0,
|
|
10728
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(TabsList, { className: "", children: [
|
|
10729
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TabsTrigger, { value: "answer", children: t("message.answer") }),
|
|
10730
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TabsTrigger, { value: "reasoning", children: t("message.reasoning") })
|
|
10339
10731
|
] }),
|
|
10340
|
-
/* @__PURE__ */ (0,
|
|
10341
|
-
/* @__PURE__ */ (0,
|
|
10732
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TabsContent, { value: "answer", className: "space-y-3", children: answerNode }),
|
|
10733
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TabsContent, { value: "reasoning", className: "space-y-3", children: reasoningNode })
|
|
10342
10734
|
]
|
|
10343
10735
|
}
|
|
10344
10736
|
),
|
|
10345
|
-
resolvedStreamingStatus ? /* @__PURE__ */ (0,
|
|
10737
|
+
resolvedStreamingStatus ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) : null
|
|
10346
10738
|
] });
|
|
10347
10739
|
}
|
|
10348
|
-
return /* @__PURE__ */ (0,
|
|
10740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: cn("space-y-3", streamingClass, className), children: [
|
|
10349
10741
|
hasReasoning ? reasoningNode : answerNode,
|
|
10350
|
-
resolvedStreamingStatus ? /* @__PURE__ */ (0,
|
|
10742
|
+
resolvedStreamingStatus ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) : null
|
|
10351
10743
|
] });
|
|
10352
10744
|
}
|
|
10353
10745
|
|
|
10354
10746
|
// src/components/thread/MessageActions.tsx
|
|
10355
|
-
var
|
|
10356
|
-
var
|
|
10357
|
-
var
|
|
10747
|
+
var React34 = __toESM(require("react"), 1);
|
|
10748
|
+
var import_lucide_react22 = require("lucide-react");
|
|
10749
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
10358
10750
|
function MessageActions({
|
|
10359
10751
|
content,
|
|
10360
10752
|
isAssistant = false,
|
|
@@ -10363,7 +10755,7 @@ function MessageActions({
|
|
|
10363
10755
|
className
|
|
10364
10756
|
}) {
|
|
10365
10757
|
const { t } = useChatkitTranslation();
|
|
10366
|
-
const [copied, setCopied] =
|
|
10758
|
+
const [copied, setCopied] = React34.useState(false);
|
|
10367
10759
|
const handleCopy = async () => {
|
|
10368
10760
|
try {
|
|
10369
10761
|
await navigator.clipboard.writeText(content);
|
|
@@ -10376,7 +10768,7 @@ function MessageActions({
|
|
|
10376
10768
|
if (isStreaming) {
|
|
10377
10769
|
return null;
|
|
10378
10770
|
}
|
|
10379
|
-
return /* @__PURE__ */ (0,
|
|
10771
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
10380
10772
|
"div",
|
|
10381
10773
|
{
|
|
10382
10774
|
className: cn(
|
|
@@ -10384,7 +10776,7 @@ function MessageActions({
|
|
|
10384
10776
|
className
|
|
10385
10777
|
),
|
|
10386
10778
|
children: [
|
|
10387
|
-
/* @__PURE__ */ (0,
|
|
10779
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
10388
10780
|
"button",
|
|
10389
10781
|
{
|
|
10390
10782
|
type: "button",
|
|
@@ -10394,17 +10786,17 @@ function MessageActions({
|
|
|
10394
10786
|
copied && "text-green-500"
|
|
10395
10787
|
),
|
|
10396
10788
|
title: copied ? t("messageActions.copied") : t("messageActions.copy"),
|
|
10397
|
-
children: copied ? /* @__PURE__ */ (0,
|
|
10789
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react22.Check, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react22.Copy, { size: 14 })
|
|
10398
10790
|
}
|
|
10399
10791
|
),
|
|
10400
|
-
isAssistant && onRetry && /* @__PURE__ */ (0,
|
|
10792
|
+
isAssistant && onRetry && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
10401
10793
|
"button",
|
|
10402
10794
|
{
|
|
10403
10795
|
type: "button",
|
|
10404
10796
|
onClick: onRetry,
|
|
10405
10797
|
className: "p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",
|
|
10406
10798
|
title: t("messageActions.regenerate"),
|
|
10407
|
-
children: /* @__PURE__ */ (0,
|
|
10799
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react22.RefreshCw, { size: 14 })
|
|
10408
10800
|
}
|
|
10409
10801
|
)
|
|
10410
10802
|
]
|
|
@@ -10413,20 +10805,20 @@ function MessageActions({
|
|
|
10413
10805
|
}
|
|
10414
10806
|
|
|
10415
10807
|
// src/components/thread/StartScreen.tsx
|
|
10416
|
-
var
|
|
10417
|
-
var
|
|
10418
|
-
var
|
|
10808
|
+
var React35 = require("react");
|
|
10809
|
+
var import_lucide_react23 = require("lucide-react");
|
|
10810
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
10419
10811
|
function getIconComponent2(icon) {
|
|
10420
10812
|
const iconMap = {
|
|
10421
|
-
"circle-question": /* @__PURE__ */ (0,
|
|
10422
|
-
"lightbulb": /* @__PURE__ */ (0,
|
|
10423
|
-
"sparkle": /* @__PURE__ */ (0,
|
|
10424
|
-
"write": /* @__PURE__ */ (0,
|
|
10425
|
-
"search": /* @__PURE__ */ (0,
|
|
10426
|
-
"globe": /* @__PURE__ */ (0,
|
|
10427
|
-
"book-open": /* @__PURE__ */ (0,
|
|
10428
|
-
"compass": /* @__PURE__ */ (0,
|
|
10429
|
-
"bolt": /* @__PURE__ */ (0,
|
|
10813
|
+
"circle-question": /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react23.HelpCircle, { size: 20 }),
|
|
10814
|
+
"lightbulb": /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react23.Lightbulb, { size: 20 }),
|
|
10815
|
+
"sparkle": /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react23.Sparkles, { size: 20 }),
|
|
10816
|
+
"write": /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react23.Pencil, { size: 20 }),
|
|
10817
|
+
"search": /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react23.Search, { size: 20 }),
|
|
10818
|
+
"globe": /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react23.Globe, { size: 20 }),
|
|
10819
|
+
"book-open": /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react23.BookOpen, { size: 20 }),
|
|
10820
|
+
"compass": /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react23.Compass, { size: 20 }),
|
|
10821
|
+
"bolt": /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react23.Zap, { size: 20 })
|
|
10430
10822
|
};
|
|
10431
10823
|
return icon ? iconMap[icon] || iconMap["sparkle"] : iconMap["sparkle"];
|
|
10432
10824
|
}
|
|
@@ -10434,9 +10826,9 @@ function StartScreen({ startScreen, onPromptClick, className }) {
|
|
|
10434
10826
|
const { t } = useChatkitTranslation();
|
|
10435
10827
|
const greeting = startScreen?.greeting ?? t("startScreen.greeting");
|
|
10436
10828
|
const prompts = startScreen?.prompts ?? [];
|
|
10437
|
-
return /* @__PURE__ */ (0,
|
|
10438
|
-
/* @__PURE__ */ (0,
|
|
10439
|
-
prompts.length > 0 && /* @__PURE__ */ (0,
|
|
10829
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: cn("flex flex-col items-center justify-center py-12 px-4", className), children: [
|
|
10830
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "mb-8 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("h2", { className: "text-2xl font-semibold text-foreground mb-2", children: greeting }) }),
|
|
10831
|
+
prompts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "w-full max-w-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: prompts.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
10440
10832
|
"button",
|
|
10441
10833
|
{
|
|
10442
10834
|
type: "button",
|
|
@@ -10447,8 +10839,8 @@ function StartScreen({ startScreen, onPromptClick, className }) {
|
|
|
10447
10839
|
"focus:outline-none focus:ring-2 focus:ring-primary/20"
|
|
10448
10840
|
),
|
|
10449
10841
|
children: [
|
|
10450
|
-
/* @__PURE__ */ (0,
|
|
10451
|
-
/* @__PURE__ */ (0,
|
|
10842
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary", children: getIconComponent2(item.icon) }),
|
|
10843
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-sm font-medium text-foreground", children: item.label })
|
|
10452
10844
|
]
|
|
10453
10845
|
},
|
|
10454
10846
|
`prompt-${index}`
|
|
@@ -10457,7 +10849,7 @@ function StartScreen({ startScreen, onPromptClick, className }) {
|
|
|
10457
10849
|
}
|
|
10458
10850
|
|
|
10459
10851
|
// src/hooks/useThreads.ts
|
|
10460
|
-
var
|
|
10852
|
+
var React36 = __toESM(require("react"), 1);
|
|
10461
10853
|
var DEFAULT_LIMIT = 50;
|
|
10462
10854
|
var getThreadTitle = (threadRecord) => {
|
|
10463
10855
|
const title = threadRecord.title?.trim();
|
|
@@ -10510,16 +10902,16 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10510
10902
|
isLoading: isStreamLoading,
|
|
10511
10903
|
error: streamError
|
|
10512
10904
|
} = useStreamContext();
|
|
10513
|
-
const [threadRecords, setThreadRecords] =
|
|
10514
|
-
const [isLoading, setIsLoading] =
|
|
10515
|
-
const [error, setError] =
|
|
10516
|
-
const upsertThreadRecord =
|
|
10905
|
+
const [threadRecords, setThreadRecords] = React36.useState([]);
|
|
10906
|
+
const [isLoading, setIsLoading] = React36.useState(false);
|
|
10907
|
+
const [error, setError] = React36.useState(null);
|
|
10908
|
+
const upsertThreadRecord = React36.useCallback((threadRecord) => {
|
|
10517
10909
|
setThreadRecords((prev) => {
|
|
10518
10910
|
const next = prev.filter((item) => item.id !== threadRecord.id);
|
|
10519
10911
|
return sortThreadRecords([threadRecord, ...next]);
|
|
10520
10912
|
});
|
|
10521
10913
|
}, []);
|
|
10522
|
-
const refreshThreads =
|
|
10914
|
+
const refreshThreads = React36.useCallback(async () => {
|
|
10523
10915
|
setIsLoading(true);
|
|
10524
10916
|
setError(null);
|
|
10525
10917
|
try {
|
|
@@ -10535,7 +10927,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10535
10927
|
setIsLoading(false);
|
|
10536
10928
|
}
|
|
10537
10929
|
}, [client, limit, assistantId]);
|
|
10538
|
-
const createThread =
|
|
10930
|
+
const createThread = React36.useCallback(
|
|
10539
10931
|
async (input) => {
|
|
10540
10932
|
setError(null);
|
|
10541
10933
|
const payload = {};
|
|
@@ -10549,7 +10941,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10549
10941
|
},
|
|
10550
10942
|
[client, upsertThreadRecord]
|
|
10551
10943
|
);
|
|
10552
|
-
const updateThread =
|
|
10944
|
+
const updateThread = React36.useCallback(
|
|
10553
10945
|
async (recordId, payload) => {
|
|
10554
10946
|
setError(null);
|
|
10555
10947
|
const updated = await client.conversations.update(recordId, payload);
|
|
@@ -10558,7 +10950,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10558
10950
|
},
|
|
10559
10951
|
[client, upsertThreadRecord]
|
|
10560
10952
|
);
|
|
10561
|
-
const deleteThread =
|
|
10953
|
+
const deleteThread = React36.useCallback(
|
|
10562
10954
|
async (recordId) => {
|
|
10563
10955
|
setError(null);
|
|
10564
10956
|
await client.conversations.delete(recordId);
|
|
@@ -10566,11 +10958,11 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10566
10958
|
},
|
|
10567
10959
|
[client]
|
|
10568
10960
|
);
|
|
10569
|
-
|
|
10961
|
+
React36.useEffect(() => {
|
|
10570
10962
|
if (!isReady) return;
|
|
10571
10963
|
void refreshThreads();
|
|
10572
10964
|
}, [refreshThreads, isReady]);
|
|
10573
|
-
|
|
10965
|
+
React36.useEffect(() => {
|
|
10574
10966
|
if (!threadId || !isStreamLoading) return;
|
|
10575
10967
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
10576
10968
|
const busyStatus = "busy";
|
|
@@ -10591,7 +10983,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10591
10983
|
return changed ? sortThreadRecords(next) : prev;
|
|
10592
10984
|
});
|
|
10593
10985
|
}, [threadId, isStreamLoading]);
|
|
10594
|
-
|
|
10986
|
+
React36.useEffect(() => {
|
|
10595
10987
|
const message = getErrorMessage(streamError)?.trim();
|
|
10596
10988
|
if (!threadId || !message) return;
|
|
10597
10989
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -10613,7 +11005,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10613
11005
|
return changed ? sortThreadRecords(next) : prev;
|
|
10614
11006
|
});
|
|
10615
11007
|
}, [threadId, streamError]);
|
|
10616
|
-
|
|
11008
|
+
React36.useEffect(() => {
|
|
10617
11009
|
if (!isReady || !threadId || isStreamLoading) return;
|
|
10618
11010
|
let cancelled = false;
|
|
10619
11011
|
void client.conversations.search({ where: { threadId }, limit: 1 }).then((result) => {
|
|
@@ -10627,7 +11019,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10627
11019
|
cancelled = true;
|
|
10628
11020
|
};
|
|
10629
11021
|
}, [client, threadId, upsertThreadRecord, isReady, isStreamLoading]);
|
|
10630
|
-
const threads =
|
|
11022
|
+
const threads = React36.useMemo(
|
|
10631
11023
|
() => threadRecords.map((threadRecord) => toThreadItem(threadRecord)),
|
|
10632
11024
|
[threadRecords]
|
|
10633
11025
|
);
|
|
@@ -10644,10 +11036,10 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10644
11036
|
}
|
|
10645
11037
|
|
|
10646
11038
|
// src/components/thread/context-usage-indicator.tsx
|
|
10647
|
-
var
|
|
11039
|
+
var React37 = __toESM(require("react"), 1);
|
|
10648
11040
|
|
|
10649
11041
|
// src/components/ui/progress-circle.tsx
|
|
10650
|
-
var
|
|
11042
|
+
var import_jsx_runtime42 = (
|
|
10651
11043
|
// biome-ignore lint/a11y/useFocusableInteractive: false positive (progress + progressbar are not focusable interactives)
|
|
10652
11044
|
// biome-ignore lint/nursery/useAriaPropsSupportedByRole: biome rule at odds with mdn docs (presumed nursary bug with rule)
|
|
10653
11045
|
require("react/jsx-runtime")
|
|
@@ -10671,7 +11063,7 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
|
|
|
10671
11063
|
fill: "none",
|
|
10672
11064
|
strokeWidth
|
|
10673
11065
|
};
|
|
10674
|
-
return /* @__PURE__ */ (0,
|
|
11066
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
10675
11067
|
"svg",
|
|
10676
11068
|
{
|
|
10677
11069
|
role: "progressbar",
|
|
@@ -10682,8 +11074,8 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
|
|
|
10682
11074
|
"aria-valuemax": 100,
|
|
10683
11075
|
...restSvgProps,
|
|
10684
11076
|
children: [
|
|
10685
|
-
/* @__PURE__ */ (0,
|
|
10686
|
-
/* @__PURE__ */ (0,
|
|
11077
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("circle", { ...commonParams, className: "stroke-current/25" }),
|
|
11078
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
10687
11079
|
"circle",
|
|
10688
11080
|
{
|
|
10689
11081
|
...commonParams,
|
|
@@ -10701,7 +11093,7 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
|
|
|
10701
11093
|
};
|
|
10702
11094
|
|
|
10703
11095
|
// src/components/thread/context-usage-indicator.tsx
|
|
10704
|
-
var
|
|
11096
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
10705
11097
|
var kNumberFormatter = new Intl.NumberFormat("en-US", {
|
|
10706
11098
|
minimumFractionDigits: 0,
|
|
10707
11099
|
maximumFractionDigits: 1
|
|
@@ -10734,20 +11126,20 @@ function ContextUsageIndicator({
|
|
|
10734
11126
|
}) {
|
|
10735
11127
|
const { t } = useChatkitTranslation();
|
|
10736
11128
|
const stream = useStreamContext();
|
|
10737
|
-
const [maxContextSize, setMaxContextSize] =
|
|
10738
|
-
const [usedContextSize, setUsedContextSize] =
|
|
10739
|
-
const [assistantAgentKey, setAssistantAgentKey] =
|
|
10740
|
-
const latestRealtimeUsageRef =
|
|
11129
|
+
const [maxContextSize, setMaxContextSize] = React37.useState(null);
|
|
11130
|
+
const [usedContextSize, setUsedContextSize] = React37.useState(null);
|
|
11131
|
+
const [assistantAgentKey, setAssistantAgentKey] = React37.useState(null);
|
|
11132
|
+
const latestRealtimeUsageRef = React37.useRef({
|
|
10741
11133
|
threadId: null,
|
|
10742
11134
|
agentKey: null,
|
|
10743
11135
|
usedTokens: null
|
|
10744
11136
|
});
|
|
10745
|
-
const realtimeUsage =
|
|
11137
|
+
const realtimeUsage = React37.useMemo(
|
|
10746
11138
|
() => getThreadContextUsage(stream.contextUsageByAgentKey, assistantAgentKey),
|
|
10747
11139
|
[assistantAgentKey, stream.contextUsageByAgentKey]
|
|
10748
11140
|
);
|
|
10749
11141
|
const realtimeUsedContextSize = getThreadContextUsageTotalTokens(realtimeUsage);
|
|
10750
|
-
|
|
11142
|
+
React37.useEffect(() => {
|
|
10751
11143
|
if (!stream.client || !stream.assistantId) {
|
|
10752
11144
|
setMaxContextSize(null);
|
|
10753
11145
|
setAssistantAgentKey(null);
|
|
@@ -10767,18 +11159,18 @@ function ContextUsageIndicator({
|
|
|
10767
11159
|
cancelled = true;
|
|
10768
11160
|
};
|
|
10769
11161
|
}, [stream.client, stream.assistantId]);
|
|
10770
|
-
|
|
11162
|
+
React37.useEffect(() => {
|
|
10771
11163
|
latestRealtimeUsageRef.current = {
|
|
10772
11164
|
threadId: stream.threadId ?? null,
|
|
10773
11165
|
agentKey: assistantAgentKey,
|
|
10774
11166
|
usedTokens: realtimeUsedContextSize
|
|
10775
11167
|
};
|
|
10776
11168
|
}, [assistantAgentKey, realtimeUsedContextSize, stream.threadId]);
|
|
10777
|
-
|
|
11169
|
+
React37.useEffect(() => {
|
|
10778
11170
|
if (realtimeUsedContextSize == null) return;
|
|
10779
11171
|
setUsedContextSize(realtimeUsedContextSize);
|
|
10780
11172
|
}, [realtimeUsedContextSize]);
|
|
10781
|
-
|
|
11173
|
+
React37.useEffect(() => {
|
|
10782
11174
|
if (!stream.client) {
|
|
10783
11175
|
setUsedContextSize(null);
|
|
10784
11176
|
return;
|
|
@@ -10843,8 +11235,8 @@ function ContextUsageIndicator({
|
|
|
10843
11235
|
});
|
|
10844
11236
|
const usageLabelWithSuffix = usageLabel.endsWith(":") ? usageLabel : `${usageLabel}:`;
|
|
10845
11237
|
const progressClassName = percent >= 90 ? "text-destructive" : percent >= 75 ? "text-amber-500" : "text-primary dark:text-zinc-300";
|
|
10846
|
-
return /* @__PURE__ */ (0,
|
|
10847
|
-
/* @__PURE__ */ (0,
|
|
11238
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(Tooltip, { children: [
|
|
11239
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
10848
11240
|
"button",
|
|
10849
11241
|
{
|
|
10850
11242
|
type: "button",
|
|
@@ -10853,31 +11245,31 @@ function ContextUsageIndicator({
|
|
|
10853
11245
|
className
|
|
10854
11246
|
),
|
|
10855
11247
|
"aria-label": `${usageLabelWithSuffix} ${usageFullLabel}. ${usageTokensLabel}`,
|
|
10856
|
-
children: /* @__PURE__ */ (0,
|
|
11248
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ProgressCircle, { value: percent, className: cn("size-3.5", progressClassName) })
|
|
10857
11249
|
}
|
|
10858
11250
|
) }),
|
|
10859
|
-
/* @__PURE__ */ (0,
|
|
10860
|
-
/* @__PURE__ */ (0,
|
|
10861
|
-
/* @__PURE__ */ (0,
|
|
10862
|
-
/* @__PURE__ */ (0,
|
|
11251
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(TooltipContent, { side: "top", sideOffset: 6, className: "space-y-0.5 px-3 py-2 text-center", children: [
|
|
11252
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "text-primary-foreground/70", children: usageLabelWithSuffix }),
|
|
11253
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "font-medium text-primary-foreground/80", children: usageFullLabel }),
|
|
11254
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "text-sm font-semibold", children: usageTokensLabel })
|
|
10863
11255
|
] })
|
|
10864
11256
|
] });
|
|
10865
11257
|
}
|
|
10866
11258
|
|
|
10867
11259
|
// src/components/pet/PetBridge.tsx
|
|
10868
|
-
var
|
|
10869
|
-
var
|
|
11260
|
+
var React38 = __toESM(require("react"), 1);
|
|
11261
|
+
var import_chatkit_types9 = require("@xpert-ai/chatkit-types");
|
|
10870
11262
|
function PetBridge({ pet, state }) {
|
|
10871
11263
|
const parentMessenger = useParentMessenger();
|
|
10872
11264
|
const sendEvent = parentMessenger?.sendEvent;
|
|
10873
|
-
const options =
|
|
10874
|
-
|
|
11265
|
+
const options = React38.useMemo(() => (0, import_chatkit_types9.normalizePetOptions)(pet), [pet]);
|
|
11266
|
+
React38.useEffect(() => {
|
|
10875
11267
|
if (!sendEvent) {
|
|
10876
11268
|
return;
|
|
10877
11269
|
}
|
|
10878
11270
|
sendEvent("pet_options_change", { pet: pet ?? null });
|
|
10879
11271
|
}, [sendEvent, pet]);
|
|
10880
|
-
|
|
11272
|
+
React38.useEffect(() => {
|
|
10881
11273
|
if (!sendEvent || !options) {
|
|
10882
11274
|
return;
|
|
10883
11275
|
}
|
|
@@ -10887,15 +11279,15 @@ function PetBridge({ pet, state }) {
|
|
|
10887
11279
|
}
|
|
10888
11280
|
|
|
10889
11281
|
// src/components/settings/SettingsSheet.tsx
|
|
10890
|
-
var
|
|
10891
|
-
var
|
|
11282
|
+
var React45 = __toESM(require("react"), 1);
|
|
11283
|
+
var import_lucide_react25 = require("lucide-react");
|
|
10892
11284
|
|
|
10893
11285
|
// src/components/ui/input.tsx
|
|
10894
|
-
var
|
|
10895
|
-
var
|
|
10896
|
-
var Input =
|
|
11286
|
+
var React39 = __toESM(require("react"), 1);
|
|
11287
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
11288
|
+
var Input = React39.forwardRef(
|
|
10897
11289
|
({ className, type, ...props }, ref) => {
|
|
10898
|
-
return /* @__PURE__ */ (0,
|
|
11290
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
10899
11291
|
"input",
|
|
10900
11292
|
{
|
|
10901
11293
|
ref,
|
|
@@ -10912,20 +11304,20 @@ var Input = React37.forwardRef(
|
|
|
10912
11304
|
Input.displayName = "Input";
|
|
10913
11305
|
|
|
10914
11306
|
// src/components/ui/select.tsx
|
|
10915
|
-
var
|
|
11307
|
+
var React40 = require("react");
|
|
10916
11308
|
var import_radix_ui2 = require("radix-ui");
|
|
10917
|
-
var
|
|
10918
|
-
var
|
|
11309
|
+
var import_lucide_react24 = require("lucide-react");
|
|
11310
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
10919
11311
|
function Select({
|
|
10920
11312
|
...props
|
|
10921
11313
|
}) {
|
|
10922
|
-
return /* @__PURE__ */ (0,
|
|
11314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_radix_ui2.Select.Root, { "data-slot": "select", ...props });
|
|
10923
11315
|
}
|
|
10924
11316
|
function SelectGroup({
|
|
10925
11317
|
className,
|
|
10926
11318
|
...props
|
|
10927
11319
|
}) {
|
|
10928
|
-
return /* @__PURE__ */ (0,
|
|
11320
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
10929
11321
|
import_radix_ui2.Select.Group,
|
|
10930
11322
|
{
|
|
10931
11323
|
"data-slot": "select-group",
|
|
@@ -10937,7 +11329,7 @@ function SelectGroup({
|
|
|
10937
11329
|
function SelectValue({
|
|
10938
11330
|
...props
|
|
10939
11331
|
}) {
|
|
10940
|
-
return /* @__PURE__ */ (0,
|
|
11332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_radix_ui2.Select.Value, { "data-slot": "select-value", ...props });
|
|
10941
11333
|
}
|
|
10942
11334
|
function SelectTrigger({
|
|
10943
11335
|
className,
|
|
@@ -10945,7 +11337,7 @@ function SelectTrigger({
|
|
|
10945
11337
|
children,
|
|
10946
11338
|
...props
|
|
10947
11339
|
}) {
|
|
10948
|
-
return /* @__PURE__ */ (0,
|
|
11340
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
10949
11341
|
import_radix_ui2.Select.Trigger,
|
|
10950
11342
|
{
|
|
10951
11343
|
"data-slot": "select-trigger",
|
|
@@ -10957,7 +11349,7 @@ function SelectTrigger({
|
|
|
10957
11349
|
...props,
|
|
10958
11350
|
children: [
|
|
10959
11351
|
children,
|
|
10960
|
-
/* @__PURE__ */ (0,
|
|
11352
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_radix_ui2.Select.Icon, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react24.ChevronDownIcon, { className: "pointer-events-none size-4 text-muted-foreground" }) })
|
|
10961
11353
|
]
|
|
10962
11354
|
}
|
|
10963
11355
|
);
|
|
@@ -10969,7 +11361,7 @@ function SelectContent({
|
|
|
10969
11361
|
align = "center",
|
|
10970
11362
|
...props
|
|
10971
11363
|
}) {
|
|
10972
|
-
return /* @__PURE__ */ (0,
|
|
11364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_radix_ui2.Select.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
10973
11365
|
import_radix_ui2.Select.Content,
|
|
10974
11366
|
{
|
|
10975
11367
|
"data-slot": "select-content",
|
|
@@ -10979,8 +11371,8 @@ function SelectContent({
|
|
|
10979
11371
|
align,
|
|
10980
11372
|
...props,
|
|
10981
11373
|
children: [
|
|
10982
|
-
/* @__PURE__ */ (0,
|
|
10983
|
-
/* @__PURE__ */ (0,
|
|
11374
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SelectScrollUpButton, {}),
|
|
11375
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
10984
11376
|
import_radix_ui2.Select.Viewport,
|
|
10985
11377
|
{
|
|
10986
11378
|
"data-position": position,
|
|
@@ -10991,7 +11383,7 @@ function SelectContent({
|
|
|
10991
11383
|
children
|
|
10992
11384
|
}
|
|
10993
11385
|
),
|
|
10994
|
-
/* @__PURE__ */ (0,
|
|
11386
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SelectScrollDownButton, {})
|
|
10995
11387
|
]
|
|
10996
11388
|
}
|
|
10997
11389
|
) });
|
|
@@ -11001,7 +11393,7 @@ function SelectItem({
|
|
|
11001
11393
|
children,
|
|
11002
11394
|
...props
|
|
11003
11395
|
}) {
|
|
11004
|
-
return /* @__PURE__ */ (0,
|
|
11396
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
11005
11397
|
import_radix_ui2.Select.Item,
|
|
11006
11398
|
{
|
|
11007
11399
|
"data-slot": "select-item",
|
|
@@ -11011,8 +11403,8 @@ function SelectItem({
|
|
|
11011
11403
|
),
|
|
11012
11404
|
...props,
|
|
11013
11405
|
children: [
|
|
11014
|
-
/* @__PURE__ */ (0,
|
|
11015
|
-
/* @__PURE__ */ (0,
|
|
11406
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_radix_ui2.Select.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react24.CheckIcon, { className: "pointer-events-none" }) }) }),
|
|
11407
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_radix_ui2.Select.ItemText, { children })
|
|
11016
11408
|
]
|
|
11017
11409
|
}
|
|
11018
11410
|
);
|
|
@@ -11021,7 +11413,7 @@ function SelectScrollUpButton({
|
|
|
11021
11413
|
className,
|
|
11022
11414
|
...props
|
|
11023
11415
|
}) {
|
|
11024
|
-
return /* @__PURE__ */ (0,
|
|
11416
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
11025
11417
|
import_radix_ui2.Select.ScrollUpButton,
|
|
11026
11418
|
{
|
|
11027
11419
|
"data-slot": "select-scroll-up-button",
|
|
@@ -11030,8 +11422,8 @@ function SelectScrollUpButton({
|
|
|
11030
11422
|
className
|
|
11031
11423
|
),
|
|
11032
11424
|
...props,
|
|
11033
|
-
children: /* @__PURE__ */ (0,
|
|
11034
|
-
|
|
11425
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
11426
|
+
import_lucide_react24.ChevronUpIcon,
|
|
11035
11427
|
{}
|
|
11036
11428
|
)
|
|
11037
11429
|
}
|
|
@@ -11041,7 +11433,7 @@ function SelectScrollDownButton({
|
|
|
11041
11433
|
className,
|
|
11042
11434
|
...props
|
|
11043
11435
|
}) {
|
|
11044
|
-
return /* @__PURE__ */ (0,
|
|
11436
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
11045
11437
|
import_radix_ui2.Select.ScrollDownButton,
|
|
11046
11438
|
{
|
|
11047
11439
|
"data-slot": "select-scroll-down-button",
|
|
@@ -11050,8 +11442,8 @@ function SelectScrollDownButton({
|
|
|
11050
11442
|
className
|
|
11051
11443
|
),
|
|
11052
11444
|
...props,
|
|
11053
|
-
children: /* @__PURE__ */ (0,
|
|
11054
|
-
|
|
11445
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
11446
|
+
import_lucide_react24.ChevronDownIcon,
|
|
11055
11447
|
{}
|
|
11056
11448
|
)
|
|
11057
11449
|
}
|
|
@@ -11059,9 +11451,9 @@ function SelectScrollDownButton({
|
|
|
11059
11451
|
}
|
|
11060
11452
|
|
|
11061
11453
|
// src/components/ui/slider.tsx
|
|
11062
|
-
var
|
|
11454
|
+
var React41 = __toESM(require("react"), 1);
|
|
11063
11455
|
var import_radix_ui3 = require("radix-ui");
|
|
11064
|
-
var
|
|
11456
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
11065
11457
|
function Slider({
|
|
11066
11458
|
className,
|
|
11067
11459
|
defaultValue,
|
|
@@ -11070,11 +11462,11 @@ function Slider({
|
|
|
11070
11462
|
max = 100,
|
|
11071
11463
|
...props
|
|
11072
11464
|
}) {
|
|
11073
|
-
const _values =
|
|
11465
|
+
const _values = React41.useMemo(
|
|
11074
11466
|
() => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
|
|
11075
11467
|
[value, defaultValue, min, max]
|
|
11076
11468
|
);
|
|
11077
|
-
return /* @__PURE__ */ (0,
|
|
11469
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
11078
11470
|
import_radix_ui3.Slider.Root,
|
|
11079
11471
|
{
|
|
11080
11472
|
"data-slot": "slider",
|
|
@@ -11088,12 +11480,12 @@ function Slider({
|
|
|
11088
11480
|
),
|
|
11089
11481
|
...props,
|
|
11090
11482
|
children: [
|
|
11091
|
-
/* @__PURE__ */ (0,
|
|
11483
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
11092
11484
|
import_radix_ui3.Slider.Track,
|
|
11093
11485
|
{
|
|
11094
11486
|
"data-slot": "slider-track",
|
|
11095
11487
|
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",
|
|
11096
|
-
children: /* @__PURE__ */ (0,
|
|
11488
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
11097
11489
|
import_radix_ui3.Slider.Range,
|
|
11098
11490
|
{
|
|
11099
11491
|
"data-slot": "slider-range",
|
|
@@ -11102,7 +11494,7 @@ function Slider({
|
|
|
11102
11494
|
)
|
|
11103
11495
|
}
|
|
11104
11496
|
),
|
|
11105
|
-
Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */ (0,
|
|
11497
|
+
Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
11106
11498
|
import_radix_ui3.Slider.Thumb,
|
|
11107
11499
|
{
|
|
11108
11500
|
"data-slot": "slider-thumb",
|
|
@@ -11116,15 +11508,15 @@ function Slider({
|
|
|
11116
11508
|
}
|
|
11117
11509
|
|
|
11118
11510
|
// src/components/ui/toggle-group.tsx
|
|
11119
|
-
var
|
|
11511
|
+
var React43 = __toESM(require("react"), 1);
|
|
11120
11512
|
var import_class_variance_authority3 = require("class-variance-authority");
|
|
11121
11513
|
var import_radix_ui5 = require("radix-ui");
|
|
11122
11514
|
|
|
11123
11515
|
// src/components/ui/toggle.tsx
|
|
11124
|
-
var
|
|
11516
|
+
var React42 = require("react");
|
|
11125
11517
|
var import_class_variance_authority2 = require("class-variance-authority");
|
|
11126
11518
|
var import_radix_ui4 = require("radix-ui");
|
|
11127
|
-
var
|
|
11519
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
11128
11520
|
var toggleVariants = (0, import_class_variance_authority2.cva)(
|
|
11129
11521
|
"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",
|
|
11130
11522
|
{
|
|
@@ -11147,8 +11539,8 @@ var toggleVariants = (0, import_class_variance_authority2.cva)(
|
|
|
11147
11539
|
);
|
|
11148
11540
|
|
|
11149
11541
|
// src/components/ui/toggle-group.tsx
|
|
11150
|
-
var
|
|
11151
|
-
var ToggleGroupContext =
|
|
11542
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
11543
|
+
var ToggleGroupContext = React43.createContext({
|
|
11152
11544
|
size: "default",
|
|
11153
11545
|
variant: "default",
|
|
11154
11546
|
spacing: 0,
|
|
@@ -11163,7 +11555,7 @@ function ToggleGroup({
|
|
|
11163
11555
|
children,
|
|
11164
11556
|
...props
|
|
11165
11557
|
}) {
|
|
11166
|
-
return /* @__PURE__ */ (0,
|
|
11558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
11167
11559
|
import_radix_ui5.ToggleGroup.Root,
|
|
11168
11560
|
{
|
|
11169
11561
|
"data-slot": "toggle-group",
|
|
@@ -11177,7 +11569,7 @@ function ToggleGroup({
|
|
|
11177
11569
|
className
|
|
11178
11570
|
),
|
|
11179
11571
|
...props,
|
|
11180
|
-
children: /* @__PURE__ */ (0,
|
|
11572
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
11181
11573
|
ToggleGroupContext.Provider,
|
|
11182
11574
|
{
|
|
11183
11575
|
value: { variant, size: size2, spacing, orientation },
|
|
@@ -11194,8 +11586,8 @@ function ToggleGroupItem({
|
|
|
11194
11586
|
size: size2 = "default",
|
|
11195
11587
|
...props
|
|
11196
11588
|
}) {
|
|
11197
|
-
const context =
|
|
11198
|
-
return /* @__PURE__ */ (0,
|
|
11589
|
+
const context = React43.useContext(ToggleGroupContext);
|
|
11590
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
11199
11591
|
import_radix_ui5.ToggleGroup.Item,
|
|
11200
11592
|
{
|
|
11201
11593
|
"data-slot": "toggle-group-item",
|
|
@@ -11217,7 +11609,7 @@ function ToggleGroupItem({
|
|
|
11217
11609
|
}
|
|
11218
11610
|
|
|
11219
11611
|
// src/components/pet/pet-local-settings.ts
|
|
11220
|
-
var
|
|
11612
|
+
var import_chatkit_types10 = require("@xpert-ai/chatkit-types");
|
|
11221
11613
|
|
|
11222
11614
|
// src/components/pet/builtinPets.ts
|
|
11223
11615
|
var PUBLIC_PETS = [
|
|
@@ -11391,7 +11783,7 @@ function derivePetLocalSettings(pet) {
|
|
|
11391
11783
|
if (!pet) {
|
|
11392
11784
|
return { ...DEFAULT_PET_LOCAL_SETTINGS };
|
|
11393
11785
|
}
|
|
11394
|
-
const normalized = (0,
|
|
11786
|
+
const normalized = (0, import_chatkit_types10.normalizePetOptions)(pet ?? null);
|
|
11395
11787
|
if (!normalized) {
|
|
11396
11788
|
return { ...DEFAULT_PET_LOCAL_SETTINGS };
|
|
11397
11789
|
}
|
|
@@ -11421,25 +11813,25 @@ function derivePetLocalSettings(pet) {
|
|
|
11421
11813
|
return base2;
|
|
11422
11814
|
}
|
|
11423
11815
|
function isPetEnabled(pet) {
|
|
11424
|
-
return Boolean((0,
|
|
11816
|
+
return Boolean((0, import_chatkit_types10.normalizePetOptions)(pet ?? null));
|
|
11425
11817
|
}
|
|
11426
11818
|
|
|
11427
11819
|
// src/components/pet/PetPreview.tsx
|
|
11428
|
-
var
|
|
11820
|
+
var React44 = require("react");
|
|
11429
11821
|
|
|
11430
11822
|
// src/components/pet/petSpriteAtlas.ts
|
|
11431
|
-
var
|
|
11823
|
+
var import_chatkit_types11 = require("@xpert-ai/chatkit-types");
|
|
11432
11824
|
|
|
11433
11825
|
// src/components/pet/PetPreview.tsx
|
|
11434
|
-
var
|
|
11826
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
11435
11827
|
function escapeCssUrl(value) {
|
|
11436
11828
|
return value.replace(/["\\]/g, "\\$&");
|
|
11437
11829
|
}
|
|
11438
11830
|
function PetPreview({ src, label, className }) {
|
|
11439
11831
|
const scale = 0.13;
|
|
11440
|
-
const width =
|
|
11441
|
-
const height =
|
|
11442
|
-
return /* @__PURE__ */ (0,
|
|
11832
|
+
const width = import_chatkit_types11.petSpriteAtlas.cellWidth;
|
|
11833
|
+
const height = import_chatkit_types11.petSpriteAtlas.cellHeight;
|
|
11834
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
11443
11835
|
"span",
|
|
11444
11836
|
{
|
|
11445
11837
|
className: cn(
|
|
@@ -11448,7 +11840,7 @@ function PetPreview({ src, label, className }) {
|
|
|
11448
11840
|
),
|
|
11449
11841
|
"aria-hidden": "true",
|
|
11450
11842
|
title: label,
|
|
11451
|
-
children: /* @__PURE__ */ (0,
|
|
11843
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
11452
11844
|
"span",
|
|
11453
11845
|
{
|
|
11454
11846
|
className: "absolute left-1/2 top-1/2 block",
|
|
@@ -11459,7 +11851,7 @@ function PetPreview({ src, label, className }) {
|
|
|
11459
11851
|
transformOrigin: "center",
|
|
11460
11852
|
backgroundImage: `url("${escapeCssUrl(src)}")`,
|
|
11461
11853
|
backgroundRepeat: "no-repeat",
|
|
11462
|
-
backgroundSize: `${
|
|
11854
|
+
backgroundSize: `${import_chatkit_types11.petSpriteAtlas.columns * width}px ${import_chatkit_types11.petSpriteAtlas.rows * height}px`,
|
|
11463
11855
|
backgroundPosition: "0px 0px",
|
|
11464
11856
|
imageRendering: "auto"
|
|
11465
11857
|
}
|
|
@@ -11470,7 +11862,7 @@ function PetPreview({ src, label, className }) {
|
|
|
11470
11862
|
}
|
|
11471
11863
|
|
|
11472
11864
|
// src/components/settings/SettingsSheet.tsx
|
|
11473
|
-
var
|
|
11865
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
11474
11866
|
var CHARACTER_TYPES2 = [
|
|
11475
11867
|
"builtin",
|
|
11476
11868
|
"atlas"
|
|
@@ -11486,13 +11878,13 @@ function SettingsSheet({
|
|
|
11486
11878
|
onSave
|
|
11487
11879
|
}) {
|
|
11488
11880
|
const { t } = useChatkitTranslation();
|
|
11489
|
-
const [draft, setDraft] =
|
|
11490
|
-
|
|
11881
|
+
const [draft, setDraft] = React45.useState(settings);
|
|
11882
|
+
React45.useEffect(() => {
|
|
11491
11883
|
if (open) {
|
|
11492
11884
|
setDraft(petRequired ? { ...settings, enabled: true } : settings);
|
|
11493
11885
|
}
|
|
11494
11886
|
}, [open, petRequired, settings]);
|
|
11495
|
-
const updateDraft =
|
|
11887
|
+
const updateDraft = React45.useCallback(
|
|
11496
11888
|
(patch) => {
|
|
11497
11889
|
setDraft((previous) => ({ ...previous, ...patch }));
|
|
11498
11890
|
},
|
|
@@ -11510,23 +11902,23 @@ function SettingsSheet({
|
|
|
11510
11902
|
defaultValue: selectedBuiltinPet.label
|
|
11511
11903
|
}
|
|
11512
11904
|
);
|
|
11513
|
-
return /* @__PURE__ */ (0,
|
|
11514
|
-
/* @__PURE__ */ (0,
|
|
11515
|
-
/* @__PURE__ */ (0,
|
|
11516
|
-
/* @__PURE__ */ (0,
|
|
11905
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Sheet, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(SheetContent, { side: "right", className: "w-[min(92vw,26rem)] overflow-y-auto", children: [
|
|
11906
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SheetHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
11907
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "flex h-8 w-8 items-center justify-center rounded-md bg-primary/10 text-primary", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react25.Settings, { size: 16 }) }),
|
|
11908
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SheetTitle, { children: t("settings.title") })
|
|
11517
11909
|
] }) }),
|
|
11518
|
-
/* @__PURE__ */ (0,
|
|
11519
|
-
/* @__PURE__ */ (0,
|
|
11520
|
-
/* @__PURE__ */ (0,
|
|
11521
|
-
/* @__PURE__ */ (0,
|
|
11522
|
-
/* @__PURE__ */ (0,
|
|
11910
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("form", { className: "mt-6 space-y-5", onSubmit: handleSubmit, children: [
|
|
11911
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("section", { className: "space-y-5", children: [
|
|
11912
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
11913
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "flex h-7 w-7 items-center justify-center rounded-md bg-muted text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react25.PawPrint, { size: 15 }) }),
|
|
11914
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("h3", { className: "text-sm font-semibold", children: t("pet.settings.title") })
|
|
11523
11915
|
] }),
|
|
11524
|
-
/* @__PURE__ */ (0,
|
|
11525
|
-
/* @__PURE__ */ (0,
|
|
11526
|
-
/* @__PURE__ */ (0,
|
|
11527
|
-
petRequired && /* @__PURE__ */ (0,
|
|
11916
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("label", { className: "flex items-center justify-between gap-4 rounded-md border border-border px-3 py-2", children: [
|
|
11917
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("span", { className: "min-w-0", children: [
|
|
11918
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "block text-sm font-medium", children: t("pet.settings.enabled") }),
|
|
11919
|
+
petRequired && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "mt-0.5 block text-xs text-muted-foreground", children: t("pet.settings.requiredHint") })
|
|
11528
11920
|
] }),
|
|
11529
|
-
/* @__PURE__ */ (0,
|
|
11921
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
11530
11922
|
"button",
|
|
11531
11923
|
{
|
|
11532
11924
|
type: "button",
|
|
@@ -11539,7 +11931,7 @@ function SettingsSheet({
|
|
|
11539
11931
|
draft.enabled ? "bg-primary" : "bg-muted-foreground/20",
|
|
11540
11932
|
petRequired ? "cursor-not-allowed opacity-70" : ""
|
|
11541
11933
|
].join(" "),
|
|
11542
|
-
children: /* @__PURE__ */ (0,
|
|
11934
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
11543
11935
|
"span",
|
|
11544
11936
|
{
|
|
11545
11937
|
className: [
|
|
@@ -11552,9 +11944,9 @@ function SettingsSheet({
|
|
|
11552
11944
|
)
|
|
11553
11945
|
] })
|
|
11554
11946
|
] }),
|
|
11555
|
-
/* @__PURE__ */ (0,
|
|
11556
|
-
/* @__PURE__ */ (0,
|
|
11557
|
-
/* @__PURE__ */ (0,
|
|
11947
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "space-y-2", children: [
|
|
11948
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { id: "chatkit-pet-type-label", className: "text-sm font-medium", children: t("pet.settings.characterType") }),
|
|
11949
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
11558
11950
|
ToggleGroup,
|
|
11559
11951
|
{
|
|
11560
11952
|
id: "chatkit-pet-type",
|
|
@@ -11569,7 +11961,7 @@ function SettingsSheet({
|
|
|
11569
11961
|
variant: "outline",
|
|
11570
11962
|
spacing: 2,
|
|
11571
11963
|
className: "!w-full",
|
|
11572
|
-
children: CHARACTER_TYPES2.map((type) => /* @__PURE__ */ (0,
|
|
11964
|
+
children: CHARACTER_TYPES2.map((type) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
11573
11965
|
ToggleGroupItem,
|
|
11574
11966
|
{
|
|
11575
11967
|
value: type,
|
|
@@ -11581,8 +11973,8 @@ function SettingsSheet({
|
|
|
11581
11973
|
}
|
|
11582
11974
|
)
|
|
11583
11975
|
] }),
|
|
11584
|
-
draft.characterType === "builtin" && /* @__PURE__ */ (0,
|
|
11585
|
-
/* @__PURE__ */ (0,
|
|
11976
|
+
draft.characterType === "builtin" && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "space-y-2", children: [
|
|
11977
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
11586
11978
|
"label",
|
|
11587
11979
|
{
|
|
11588
11980
|
htmlFor: "chatkit-pet-builtin",
|
|
@@ -11590,7 +11982,7 @@ function SettingsSheet({
|
|
|
11590
11982
|
children: t("pet.settings.builtin")
|
|
11591
11983
|
}
|
|
11592
11984
|
),
|
|
11593
|
-
/* @__PURE__ */ (0,
|
|
11985
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
11594
11986
|
Select,
|
|
11595
11987
|
{
|
|
11596
11988
|
value: selectedBuiltinPet.id,
|
|
@@ -11601,26 +11993,26 @@ function SettingsSheet({
|
|
|
11601
11993
|
}
|
|
11602
11994
|
},
|
|
11603
11995
|
children: [
|
|
11604
|
-
/* @__PURE__ */ (0,
|
|
11996
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
11605
11997
|
SelectTrigger,
|
|
11606
11998
|
{
|
|
11607
11999
|
id: "chatkit-pet-builtin",
|
|
11608
12000
|
className: "min-h-12 w-full px-3 py-2",
|
|
11609
|
-
children: /* @__PURE__ */ (0,
|
|
12001
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SelectValue, { placeholder: selectedBuiltinPetLabel })
|
|
11610
12002
|
}
|
|
11611
12003
|
),
|
|
11612
|
-
/* @__PURE__ */ (0,
|
|
12004
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SelectContent, { className: "w-[var(--radix-select-trigger-width)]", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SelectGroup, { children: INCLUDED_PET_OPTIONS.map((pet) => {
|
|
11613
12005
|
const label = t(`pet.settings.builtins.${pet.id}`, {
|
|
11614
12006
|
defaultValue: pet.label
|
|
11615
12007
|
});
|
|
11616
|
-
return /* @__PURE__ */ (0,
|
|
12008
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
11617
12009
|
SelectItem,
|
|
11618
12010
|
{
|
|
11619
12011
|
value: pet.id,
|
|
11620
12012
|
className: "min-h-10 py-1.5 pl-2 pr-8",
|
|
11621
|
-
children: /* @__PURE__ */ (0,
|
|
11622
|
-
/* @__PURE__ */ (0,
|
|
11623
|
-
/* @__PURE__ */ (0,
|
|
12013
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("span", { className: "flex min-w-0 items-center gap-2", children: [
|
|
12014
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(PetPreview, { src: pet.previewSrc, label }),
|
|
12015
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "min-w-0 truncate", children: label })
|
|
11624
12016
|
] })
|
|
11625
12017
|
},
|
|
11626
12018
|
pet.id
|
|
@@ -11630,8 +12022,8 @@ function SettingsSheet({
|
|
|
11630
12022
|
}
|
|
11631
12023
|
)
|
|
11632
12024
|
] }),
|
|
11633
|
-
draft.characterType === "atlas" && /* @__PURE__ */ (0,
|
|
11634
|
-
/* @__PURE__ */ (0,
|
|
12025
|
+
draft.characterType === "atlas" && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "space-y-2", children: [
|
|
12026
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
11635
12027
|
"label",
|
|
11636
12028
|
{
|
|
11637
12029
|
className: "text-sm font-medium",
|
|
@@ -11639,7 +12031,7 @@ function SettingsSheet({
|
|
|
11639
12031
|
children: t("pet.settings.atlasUrl")
|
|
11640
12032
|
}
|
|
11641
12033
|
),
|
|
11642
|
-
/* @__PURE__ */ (0,
|
|
12034
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
11643
12035
|
Input,
|
|
11644
12036
|
{
|
|
11645
12037
|
id: "chatkit-pet-atlas",
|
|
@@ -11649,15 +12041,15 @@ function SettingsSheet({
|
|
|
11649
12041
|
}
|
|
11650
12042
|
)
|
|
11651
12043
|
] }),
|
|
11652
|
-
/* @__PURE__ */ (0,
|
|
11653
|
-
/* @__PURE__ */ (0,
|
|
11654
|
-
/* @__PURE__ */ (0,
|
|
11655
|
-
/* @__PURE__ */ (0,
|
|
12044
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "space-y-2", children: [
|
|
12045
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
12046
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("label", { className: "text-sm font-medium", htmlFor: "chatkit-pet-scale", children: t("pet.settings.scale") }),
|
|
12047
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("span", { className: "text-xs tabular-nums text-muted-foreground", children: [
|
|
11656
12048
|
draft.scale.toFixed(2),
|
|
11657
12049
|
"x"
|
|
11658
12050
|
] })
|
|
11659
12051
|
] }),
|
|
11660
|
-
/* @__PURE__ */ (0,
|
|
12052
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
11661
12053
|
Slider,
|
|
11662
12054
|
{
|
|
11663
12055
|
id: "chatkit-pet-scale",
|
|
@@ -11671,8 +12063,8 @@ function SettingsSheet({
|
|
|
11671
12063
|
}
|
|
11672
12064
|
)
|
|
11673
12065
|
] }),
|
|
11674
|
-
/* @__PURE__ */ (0,
|
|
11675
|
-
/* @__PURE__ */ (0,
|
|
12066
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("label", { className: "flex items-center gap-2 text-sm", children: [
|
|
12067
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
11676
12068
|
"input",
|
|
11677
12069
|
{
|
|
11678
12070
|
type: "checkbox",
|
|
@@ -11683,8 +12075,8 @@ function SettingsSheet({
|
|
|
11683
12075
|
),
|
|
11684
12076
|
t("pet.settings.draggable")
|
|
11685
12077
|
] }),
|
|
11686
|
-
/* @__PURE__ */ (0,
|
|
11687
|
-
/* @__PURE__ */ (0,
|
|
12078
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("label", { className: "flex items-center gap-2 text-sm", children: [
|
|
12079
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
11688
12080
|
"input",
|
|
11689
12081
|
{
|
|
11690
12082
|
type: "checkbox",
|
|
@@ -11695,8 +12087,8 @@ function SettingsSheet({
|
|
|
11695
12087
|
),
|
|
11696
12088
|
t("pet.settings.persistPosition")
|
|
11697
12089
|
] }),
|
|
11698
|
-
/* @__PURE__ */ (0,
|
|
11699
|
-
/* @__PURE__ */ (0,
|
|
12090
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex justify-end gap-2 pt-2", children: [
|
|
12091
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
11700
12092
|
Button,
|
|
11701
12093
|
{
|
|
11702
12094
|
type: "button",
|
|
@@ -11705,7 +12097,7 @@ function SettingsSheet({
|
|
|
11705
12097
|
children: t("pet.settings.cancel")
|
|
11706
12098
|
}
|
|
11707
12099
|
),
|
|
11708
|
-
/* @__PURE__ */ (0,
|
|
12100
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Button, { type: "submit", children: t("pet.settings.save") })
|
|
11709
12101
|
] })
|
|
11710
12102
|
] })
|
|
11711
12103
|
] }) });
|
|
@@ -12211,7 +12603,7 @@ function findDomPointForComposerOffset(root, offset) {
|
|
|
12211
12603
|
}
|
|
12212
12604
|
|
|
12213
12605
|
// src/components/chat.tsx
|
|
12214
|
-
var
|
|
12606
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
12215
12607
|
var import_meta2 = {};
|
|
12216
12608
|
var defaultApiUrl2 = import_meta2.env.VITE_XPERTAI_API_URL;
|
|
12217
12609
|
var COMPOSER_INPUT_MAX_HEIGHT = 128;
|
|
@@ -12344,8 +12736,8 @@ function ReferenceChip({
|
|
|
12344
12736
|
}) {
|
|
12345
12737
|
const metaLine = getReferenceMetaLine(reference);
|
|
12346
12738
|
const isComposer = variant === "composer";
|
|
12347
|
-
const Icon = reference.type === "quote" ?
|
|
12348
|
-
return /* @__PURE__ */ (0,
|
|
12739
|
+
const Icon = reference.type === "quote" ? import_lucide_react26.Quote : reference.type === "image" ? import_lucide_react26.ImageIcon : import_lucide_react26.FileText;
|
|
12740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
12349
12741
|
"div",
|
|
12350
12742
|
{
|
|
12351
12743
|
className: cn(
|
|
@@ -12354,7 +12746,7 @@ function ReferenceChip({
|
|
|
12354
12746
|
),
|
|
12355
12747
|
title: getReferenceTitle(reference),
|
|
12356
12748
|
children: [
|
|
12357
|
-
/* @__PURE__ */ (0,
|
|
12749
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
12358
12750
|
Icon,
|
|
12359
12751
|
{
|
|
12360
12752
|
size: isComposer ? 14 : 12,
|
|
@@ -12364,8 +12756,8 @@ function ReferenceChip({
|
|
|
12364
12756
|
)
|
|
12365
12757
|
}
|
|
12366
12758
|
),
|
|
12367
|
-
/* @__PURE__ */ (0,
|
|
12368
|
-
/* @__PURE__ */ (0,
|
|
12759
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
12760
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
12369
12761
|
"div",
|
|
12370
12762
|
{
|
|
12371
12763
|
className: cn(
|
|
@@ -12375,7 +12767,7 @@ function ReferenceChip({
|
|
|
12375
12767
|
children: getReferenceLabel(reference)
|
|
12376
12768
|
}
|
|
12377
12769
|
),
|
|
12378
|
-
metaLine && /* @__PURE__ */ (0,
|
|
12770
|
+
metaLine && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
12379
12771
|
"div",
|
|
12380
12772
|
{
|
|
12381
12773
|
className: cn(
|
|
@@ -12386,7 +12778,7 @@ function ReferenceChip({
|
|
|
12386
12778
|
}
|
|
12387
12779
|
)
|
|
12388
12780
|
] }),
|
|
12389
|
-
onRemove && removeLabel && /* @__PURE__ */ (0,
|
|
12781
|
+
onRemove && removeLabel && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
12390
12782
|
"button",
|
|
12391
12783
|
{
|
|
12392
12784
|
type: "button",
|
|
@@ -12397,7 +12789,7 @@ function ReferenceChip({
|
|
|
12397
12789
|
),
|
|
12398
12790
|
title: removeLabel,
|
|
12399
12791
|
"aria-label": removeLabel,
|
|
12400
|
-
children: /* @__PURE__ */ (0,
|
|
12792
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react26.X, { size: 12 })
|
|
12401
12793
|
}
|
|
12402
12794
|
)
|
|
12403
12795
|
]
|
|
@@ -12421,20 +12813,20 @@ function Chat({
|
|
|
12421
12813
|
const { setStream } = useStreamManager();
|
|
12422
12814
|
const stream = useStreamContext();
|
|
12423
12815
|
const { theme } = useTheme();
|
|
12424
|
-
const [isHistoryLoading, setIsHistoryLoading] =
|
|
12425
|
-
const [historyError, setHistoryError] =
|
|
12426
|
-
const [assistantName, setAssistantName] =
|
|
12427
|
-
const [assistantAvatar, setAssistantAvatar] =
|
|
12816
|
+
const [isHistoryLoading, setIsHistoryLoading] = React46.useState(false);
|
|
12817
|
+
const [historyError, setHistoryError] = React46.useState(null);
|
|
12818
|
+
const [assistantName, setAssistantName] = React46.useState(null);
|
|
12819
|
+
const [assistantAvatar, setAssistantAvatar] = React46.useState(null);
|
|
12428
12820
|
const LOADING_DOTS_MIN_DURATION = 800;
|
|
12429
12821
|
const STREAMING_STATUS_REFRESH_MS = 250;
|
|
12430
|
-
const [showLoadingDots, setShowLoadingDots] =
|
|
12431
|
-
const [streamingNow, setStreamingNow] =
|
|
12432
|
-
const loadingStartTimeRef =
|
|
12433
|
-
const lastStreamOutputAtRef =
|
|
12434
|
-
|
|
12822
|
+
const [showLoadingDots, setShowLoadingDots] = React46.useState(false);
|
|
12823
|
+
const [streamingNow, setStreamingNow] = React46.useState(() => Date.now());
|
|
12824
|
+
const loadingStartTimeRef = React46.useRef(null);
|
|
12825
|
+
const lastStreamOutputAtRef = React46.useRef(null);
|
|
12826
|
+
React46.useEffect(() => {
|
|
12435
12827
|
setStream(stream);
|
|
12436
12828
|
}, [setStream, stream]);
|
|
12437
|
-
|
|
12829
|
+
React46.useEffect(() => {
|
|
12438
12830
|
if (stream.isLoading) {
|
|
12439
12831
|
if (!loadingStartTimeRef.current) {
|
|
12440
12832
|
loadingStartTimeRef.current = Date.now();
|
|
@@ -12457,7 +12849,7 @@ function Chat({
|
|
|
12457
12849
|
}
|
|
12458
12850
|
}
|
|
12459
12851
|
}, [stream.isLoading]);
|
|
12460
|
-
|
|
12852
|
+
React46.useEffect(() => {
|
|
12461
12853
|
if (!stream.isLoading) {
|
|
12462
12854
|
lastStreamOutputAtRef.current = null;
|
|
12463
12855
|
setStreamingNow(Date.now());
|
|
@@ -12467,7 +12859,7 @@ function Chat({
|
|
|
12467
12859
|
lastStreamOutputAtRef.current = now;
|
|
12468
12860
|
setStreamingNow(now);
|
|
12469
12861
|
}, [stream.messages, stream.isLoading]);
|
|
12470
|
-
|
|
12862
|
+
React46.useEffect(() => {
|
|
12471
12863
|
if (!stream.isLoading) {
|
|
12472
12864
|
return;
|
|
12473
12865
|
}
|
|
@@ -12476,74 +12868,74 @@ function Chat({
|
|
|
12476
12868
|
}, STREAMING_STATUS_REFRESH_MS);
|
|
12477
12869
|
return () => window.clearInterval(timer);
|
|
12478
12870
|
}, [stream.isLoading]);
|
|
12479
|
-
const [composerParts, setComposerParts] =
|
|
12480
|
-
const [renderedComposerParts, setRenderedComposerParts] =
|
|
12481
|
-
const [composerDomVersion, setComposerDomVersion] =
|
|
12482
|
-
const [selectedTool, setSelectedTool] =
|
|
12871
|
+
const [composerParts, setComposerParts] = React46.useState([]);
|
|
12872
|
+
const [renderedComposerParts, setRenderedComposerParts] = React46.useState([]);
|
|
12873
|
+
const [composerDomVersion, setComposerDomVersion] = React46.useState(0);
|
|
12874
|
+
const [selectedTool, setSelectedTool] = React46.useState(
|
|
12483
12875
|
null
|
|
12484
12876
|
);
|
|
12485
|
-
const [planModeEnabled, setPlanModeEnabled] =
|
|
12486
|
-
const [petSettingsOpen, setPetSettingsOpen] =
|
|
12487
|
-
const [petLocalSettings, setPetLocalSettings] =
|
|
12488
|
-
const [runtimeCapabilities, setRuntimeCapabilities] =
|
|
12489
|
-
const [runtimeCapabilitiesReady, setRuntimeCapabilitiesReady] =
|
|
12490
|
-
const [sessionRuntimeCapabilities, setSessionRuntimeCapabilities] =
|
|
12877
|
+
const [planModeEnabled, setPlanModeEnabled] = React46.useState(false);
|
|
12878
|
+
const [petSettingsOpen, setPetSettingsOpen] = React46.useState(false);
|
|
12879
|
+
const [petLocalSettings, setPetLocalSettings] = React46.useState(() => readPetLocalSettings());
|
|
12880
|
+
const [runtimeCapabilities, setRuntimeCapabilities] = React46.useState(null);
|
|
12881
|
+
const [runtimeCapabilitiesReady, setRuntimeCapabilitiesReady] = React46.useState(false);
|
|
12882
|
+
const [sessionRuntimeCapabilities, setSessionRuntimeCapabilities] = React46.useState(
|
|
12491
12883
|
() => createEmptyRuntimeCapabilitiesSelection()
|
|
12492
12884
|
);
|
|
12493
|
-
const [runRuntimeCapabilities, setRunRuntimeCapabilities] =
|
|
12885
|
+
const [runRuntimeCapabilities, setRunRuntimeCapabilities] = React46.useState(
|
|
12494
12886
|
() => createEmptyRuntimeCapabilitiesSelection()
|
|
12495
12887
|
);
|
|
12496
|
-
const [runtimeCapabilityPalette, setRuntimeCapabilityPalette] =
|
|
12497
|
-
const [attachments, setAttachments] =
|
|
12498
|
-
const [references, setReferences] =
|
|
12499
|
-
const [isUploadingReferenceImages, setIsUploadingReferenceImages] =
|
|
12500
|
-
const [quoteSelection, setQuoteSelection] =
|
|
12501
|
-
const [isAtBottom, setIsAtBottom] =
|
|
12502
|
-
const [hasUpdatesBelow, setHasUpdatesBelow] =
|
|
12888
|
+
const [runtimeCapabilityPalette, setRuntimeCapabilityPalette] = React46.useState(null);
|
|
12889
|
+
const [attachments, setAttachments] = React46.useState([]);
|
|
12890
|
+
const [references, setReferences] = React46.useState([]);
|
|
12891
|
+
const [isUploadingReferenceImages, setIsUploadingReferenceImages] = React46.useState(false);
|
|
12892
|
+
const [quoteSelection, setQuoteSelection] = React46.useState(null);
|
|
12893
|
+
const [isAtBottom, setIsAtBottom] = React46.useState(true);
|
|
12894
|
+
const [hasUpdatesBelow, setHasUpdatesBelow] = React46.useState(false);
|
|
12503
12895
|
const {
|
|
12504
12896
|
threads,
|
|
12505
12897
|
deleteThread,
|
|
12506
12898
|
refreshThreads,
|
|
12507
12899
|
isLoading: isThreadsLoading
|
|
12508
12900
|
} = useThreads();
|
|
12509
|
-
const viewportRef =
|
|
12510
|
-
const fileInputRef =
|
|
12511
|
-
const composerInputRef =
|
|
12512
|
-
const slashPaletteRef =
|
|
12513
|
-
const slashPaletteOptionRefs =
|
|
12901
|
+
const viewportRef = React46.useRef(null);
|
|
12902
|
+
const fileInputRef = React46.useRef(null);
|
|
12903
|
+
const composerInputRef = React46.useRef(null);
|
|
12904
|
+
const slashPaletteRef = React46.useRef(null);
|
|
12905
|
+
const slashPaletteOptionRefs = React46.useRef(
|
|
12514
12906
|
[]
|
|
12515
12907
|
);
|
|
12516
|
-
const composerPartsRef =
|
|
12517
|
-
const pendingComposerCaretOffsetRef =
|
|
12518
|
-
const shouldAutoScrollRef =
|
|
12519
|
-
const forceFollowRef =
|
|
12520
|
-
const previousMessageCountRef =
|
|
12521
|
-
const previousScrollTopRef =
|
|
12522
|
-
const autoScrollFrameRef =
|
|
12523
|
-
const isPointerDownRef =
|
|
12524
|
-
const lastTouchYRef =
|
|
12525
|
-
const runtimeCapabilityPreferenceLoadRef =
|
|
12908
|
+
const composerPartsRef = React46.useRef([]);
|
|
12909
|
+
const pendingComposerCaretOffsetRef = React46.useRef(null);
|
|
12910
|
+
const shouldAutoScrollRef = React46.useRef(true);
|
|
12911
|
+
const forceFollowRef = React46.useRef(false);
|
|
12912
|
+
const previousMessageCountRef = React46.useRef(0);
|
|
12913
|
+
const previousScrollTopRef = React46.useRef(0);
|
|
12914
|
+
const autoScrollFrameRef = React46.useRef(null);
|
|
12915
|
+
const isPointerDownRef = React46.useRef(false);
|
|
12916
|
+
const lastTouchYRef = React46.useRef(null);
|
|
12917
|
+
const runtimeCapabilityPreferenceLoadRef = React46.useRef(0);
|
|
12526
12918
|
const resolvedTitle = title ?? t("chat.title");
|
|
12527
12919
|
const resolvedPlaceholder = placeholder ?? t("chat.placeholder");
|
|
12528
12920
|
const petRequired = options?.displayMode === "pet";
|
|
12529
|
-
const basePetSettings =
|
|
12921
|
+
const basePetSettings = React46.useMemo(
|
|
12530
12922
|
() => derivePetLocalSettings(options?.pet),
|
|
12531
12923
|
[options?.pet]
|
|
12532
12924
|
);
|
|
12533
|
-
const displayedPetSettings =
|
|
12925
|
+
const displayedPetSettings = React46.useMemo(
|
|
12534
12926
|
() => ({
|
|
12535
12927
|
...petLocalSettings ?? basePetSettings,
|
|
12536
12928
|
...petRequired ? { enabled: true } : {}
|
|
12537
12929
|
}),
|
|
12538
12930
|
[basePetSettings, petLocalSettings, petRequired]
|
|
12539
12931
|
);
|
|
12540
|
-
const effectivePet =
|
|
12932
|
+
const effectivePet = React46.useMemo(() => {
|
|
12541
12933
|
if (petRequired || petLocalSettings) {
|
|
12542
12934
|
return buildPetOptionsFromLocalSettings(displayedPetSettings);
|
|
12543
12935
|
}
|
|
12544
12936
|
return options?.pet ?? null;
|
|
12545
12937
|
}, [displayedPetSettings, options?.pet, petLocalSettings, petRequired]);
|
|
12546
|
-
const savePetLocalSettings =
|
|
12938
|
+
const savePetLocalSettings = React46.useCallback(
|
|
12547
12939
|
(settings) => {
|
|
12548
12940
|
const nextSettings = petRequired ? { ...settings, enabled: true } : settings;
|
|
12549
12941
|
setPetLocalSettings(nextSettings);
|
|
@@ -12551,7 +12943,7 @@ function Chat({
|
|
|
12551
12943
|
},
|
|
12552
12944
|
[petRequired]
|
|
12553
12945
|
);
|
|
12554
|
-
const handlePetCommand =
|
|
12946
|
+
const handlePetCommand = React46.useCallback(
|
|
12555
12947
|
(mode) => {
|
|
12556
12948
|
if (mode === "settings") {
|
|
12557
12949
|
setPetSettingsOpen(true);
|
|
@@ -12573,11 +12965,11 @@ function Chat({
|
|
|
12573
12965
|
[displayedPetSettings, effectivePet, petRequired, savePetLocalSettings]
|
|
12574
12966
|
);
|
|
12575
12967
|
const inputPlaceholder = selectedTool?.placeholderOverride ?? composer?.placeholder ?? resolvedPlaceholder;
|
|
12576
|
-
const messages =
|
|
12968
|
+
const messages = React46.useMemo(
|
|
12577
12969
|
() => stream.messages ?? [],
|
|
12578
12970
|
[stream.messages]
|
|
12579
12971
|
);
|
|
12580
|
-
const draft =
|
|
12972
|
+
const draft = React46.useMemo(
|
|
12581
12973
|
() => getComposerPlainText(composerParts),
|
|
12582
12974
|
[composerParts]
|
|
12583
12975
|
);
|
|
@@ -12589,7 +12981,7 @@ function Chat({
|
|
|
12589
12981
|
isEmpty: isComposerInputEmpty,
|
|
12590
12982
|
isStacked: isComposerStacked
|
|
12591
12983
|
});
|
|
12592
|
-
const pendingFollowUps =
|
|
12984
|
+
const pendingFollowUps = React46.useMemo(
|
|
12593
12985
|
() => [...stream.pendingFollowUps ?? []].sort(
|
|
12594
12986
|
(a, b) => a.createdAt - b.createdAt
|
|
12595
12987
|
),
|
|
@@ -12600,18 +12992,18 @@ function Chat({
|
|
|
12600
12992
|
const hasPendingHITLRequest = Boolean(stream.pendingHITLRequest);
|
|
12601
12993
|
const hasPendingInteractiveRequest = hasPendingRequestUserInput || hasPendingHITLRequest;
|
|
12602
12994
|
const hasPendingTodos = Boolean(stream.todos?.items.length);
|
|
12603
|
-
const runtimeCapabilityOptions =
|
|
12995
|
+
const runtimeCapabilityOptions = React46.useMemo(
|
|
12604
12996
|
() => getRuntimeCapabilityOptions(runtimeCapabilities),
|
|
12605
12997
|
[runtimeCapabilities]
|
|
12606
12998
|
);
|
|
12607
|
-
const effectiveSessionRuntimeCapabilities =
|
|
12999
|
+
const effectiveSessionRuntimeCapabilities = React46.useMemo(
|
|
12608
13000
|
() => runtimeCapabilitiesReady && runtimeCapabilities ? mergeRuntimeCapabilitiesSelections(
|
|
12609
13001
|
runtimeCapabilities,
|
|
12610
13002
|
sessionRuntimeCapabilities
|
|
12611
13003
|
) : null,
|
|
12612
13004
|
[runtimeCapabilities, runtimeCapabilitiesReady, sessionRuntimeCapabilities]
|
|
12613
13005
|
);
|
|
12614
|
-
const runRuntimeCapabilityOptions =
|
|
13006
|
+
const runRuntimeCapabilityOptions = React46.useMemo(
|
|
12615
13007
|
() => runtimeCapabilityOptions.filter(
|
|
12616
13008
|
(option) => isRuntimeCapabilitySelected(
|
|
12617
13009
|
runRuntimeCapabilities,
|
|
@@ -12621,11 +13013,11 @@ function Chat({
|
|
|
12621
13013
|
),
|
|
12622
13014
|
[runRuntimeCapabilities, runtimeCapabilityOptions]
|
|
12623
13015
|
);
|
|
12624
|
-
const composerRuntimeCapabilitySelectionKeys =
|
|
13016
|
+
const composerRuntimeCapabilitySelectionKeys = React46.useMemo(
|
|
12625
13017
|
() => getComposerCapabilitySelectionKeys(composerParts),
|
|
12626
13018
|
[composerParts]
|
|
12627
13019
|
);
|
|
12628
|
-
const detachedRunRuntimeCapabilityOptions =
|
|
13020
|
+
const detachedRunRuntimeCapabilityOptions = React46.useMemo(
|
|
12629
13021
|
() => runRuntimeCapabilityOptions.filter(
|
|
12630
13022
|
(option) => !composerRuntimeCapabilitySelectionKeys.has(
|
|
12631
13023
|
getRuntimeCapabilityOptionKey(option)
|
|
@@ -12633,7 +13025,7 @@ function Chat({
|
|
|
12633
13025
|
),
|
|
12634
13026
|
[composerRuntimeCapabilitySelectionKeys, runRuntimeCapabilityOptions]
|
|
12635
13027
|
);
|
|
12636
|
-
const persistSessionRuntimeCapabilities =
|
|
13028
|
+
const persistSessionRuntimeCapabilities = React46.useCallback(
|
|
12637
13029
|
async (threadId, selection) => {
|
|
12638
13030
|
if (!runtimeCapabilities || !selection) {
|
|
12639
13031
|
return;
|
|
@@ -12658,10 +13050,10 @@ function Chat({
|
|
|
12658
13050
|
},
|
|
12659
13051
|
[runtimeCapabilities, stream.client]
|
|
12660
13052
|
);
|
|
12661
|
-
const clearQuoteSelection =
|
|
13053
|
+
const clearQuoteSelection = React46.useCallback(() => {
|
|
12662
13054
|
setQuoteSelection(null);
|
|
12663
13055
|
}, []);
|
|
12664
|
-
const commitComposerParts =
|
|
13056
|
+
const commitComposerParts = React46.useCallback(
|
|
12665
13057
|
(nextParts, options2) => {
|
|
12666
13058
|
const normalized = normalizeComposerParts(nextParts);
|
|
12667
13059
|
const previous = composerPartsRef.current;
|
|
@@ -12697,7 +13089,7 @@ function Chat({
|
|
|
12697
13089
|
},
|
|
12698
13090
|
[]
|
|
12699
13091
|
);
|
|
12700
|
-
const setComposerText =
|
|
13092
|
+
const setComposerText = React46.useCallback(
|
|
12701
13093
|
(text, caretOffset = text.length) => {
|
|
12702
13094
|
commitComposerParts(createComposerTextParts(text), {
|
|
12703
13095
|
caretOffset,
|
|
@@ -12707,7 +13099,7 @@ function Chat({
|
|
|
12707
13099
|
},
|
|
12708
13100
|
[commitComposerParts]
|
|
12709
13101
|
);
|
|
12710
|
-
const focusComposerAt =
|
|
13102
|
+
const focusComposerAt = React46.useCallback((position) => {
|
|
12711
13103
|
const nextPosition = position ?? getComposerEditingLength(composerPartsRef.current);
|
|
12712
13104
|
pendingComposerCaretOffsetRef.current = nextPosition;
|
|
12713
13105
|
requestAnimationFrame(() => {
|
|
@@ -12719,7 +13111,7 @@ function Chat({
|
|
|
12719
13111
|
});
|
|
12720
13112
|
}, []);
|
|
12721
13113
|
const parentMessenger = useParentMessenger({
|
|
12722
|
-
onSetComposerValue:
|
|
13114
|
+
onSetComposerValue: React46.useCallback(
|
|
12723
13115
|
(payload) => {
|
|
12724
13116
|
if (!payload) {
|
|
12725
13117
|
return;
|
|
@@ -12742,10 +13134,10 @@ function Chat({
|
|
|
12742
13134
|
},
|
|
12743
13135
|
[composer?.tools, setComposerText]
|
|
12744
13136
|
),
|
|
12745
|
-
onFocusComposer:
|
|
13137
|
+
onFocusComposer: React46.useCallback(() => {
|
|
12746
13138
|
composerInputRef.current?.focus();
|
|
12747
13139
|
}, []),
|
|
12748
|
-
onSetPetEnabled:
|
|
13140
|
+
onSetPetEnabled: React46.useCallback(
|
|
12749
13141
|
(enabled) => {
|
|
12750
13142
|
if (petRequired) {
|
|
12751
13143
|
return;
|
|
@@ -12758,7 +13150,11 @@ function Chat({
|
|
|
12758
13150
|
[displayedPetSettings, petRequired, savePetLocalSettings]
|
|
12759
13151
|
)
|
|
12760
13152
|
});
|
|
12761
|
-
const
|
|
13153
|
+
const canMinimizeToPet = parentMessenger?.isParentAvailable === true && isPetEnabled(effectivePet);
|
|
13154
|
+
const handleMinimizeToPet = React46.useCallback(() => {
|
|
13155
|
+
parentMessenger?.sendEvent("chat_minimize_change", { minimized: true });
|
|
13156
|
+
}, [parentMessenger]);
|
|
13157
|
+
const syncQuoteSelection = React46.useCallback(() => {
|
|
12762
13158
|
if (typeof window === "undefined") {
|
|
12763
13159
|
clearQuoteSelection();
|
|
12764
13160
|
return;
|
|
@@ -12803,23 +13199,23 @@ function Chat({
|
|
|
12803
13199
|
left
|
|
12804
13200
|
});
|
|
12805
13201
|
}, [clearQuoteSelection]);
|
|
12806
|
-
const cancelPendingAutoScroll =
|
|
13202
|
+
const cancelPendingAutoScroll = React46.useCallback(() => {
|
|
12807
13203
|
if (autoScrollFrameRef.current !== null) {
|
|
12808
13204
|
cancelAnimationFrame(autoScrollFrameRef.current);
|
|
12809
13205
|
autoScrollFrameRef.current = null;
|
|
12810
13206
|
}
|
|
12811
13207
|
}, []);
|
|
12812
|
-
const disableAutoFollow =
|
|
13208
|
+
const disableAutoFollow = React46.useCallback(() => {
|
|
12813
13209
|
forceFollowRef.current = false;
|
|
12814
13210
|
shouldAutoScrollRef.current = false;
|
|
12815
13211
|
cancelPendingAutoScroll();
|
|
12816
13212
|
}, [cancelPendingAutoScroll]);
|
|
12817
|
-
const enableAutoFollow =
|
|
13213
|
+
const enableAutoFollow = React46.useCallback(() => {
|
|
12818
13214
|
forceFollowRef.current = true;
|
|
12819
13215
|
shouldAutoScrollRef.current = true;
|
|
12820
13216
|
setHasUpdatesBelow(false);
|
|
12821
13217
|
}, []);
|
|
12822
|
-
const scrollToBottom =
|
|
13218
|
+
const scrollToBottom = React46.useCallback(
|
|
12823
13219
|
(smooth = false, force = false) => {
|
|
12824
13220
|
if (force) {
|
|
12825
13221
|
enableAutoFollow();
|
|
@@ -12846,7 +13242,7 @@ function Chat({
|
|
|
12846
13242
|
},
|
|
12847
13243
|
[cancelPendingAutoScroll, enableAutoFollow]
|
|
12848
13244
|
);
|
|
12849
|
-
|
|
13245
|
+
React46.useEffect(() => {
|
|
12850
13246
|
const viewport = viewportRef.current;
|
|
12851
13247
|
if (!viewport) return;
|
|
12852
13248
|
previousScrollTopRef.current = viewport.scrollTop;
|
|
@@ -12927,14 +13323,14 @@ function Chat({
|
|
|
12927
13323
|
window.removeEventListener("pointercancel", stopPointerTracking);
|
|
12928
13324
|
};
|
|
12929
13325
|
}, [cancelPendingAutoScroll, disableAutoFollow]);
|
|
12930
|
-
|
|
13326
|
+
React46.useEffect(() => {
|
|
12931
13327
|
shouldAutoScrollRef.current = true;
|
|
12932
13328
|
forceFollowRef.current = false;
|
|
12933
13329
|
previousScrollTopRef.current = 0;
|
|
12934
13330
|
setIsAtBottom(true);
|
|
12935
13331
|
setHasUpdatesBelow(false);
|
|
12936
13332
|
}, [stream.threadId]);
|
|
12937
|
-
|
|
13333
|
+
React46.useEffect(() => {
|
|
12938
13334
|
const messageCountChanged = messages.length !== previousMessageCountRef.current;
|
|
12939
13335
|
previousMessageCountRef.current = messages.length;
|
|
12940
13336
|
if (!shouldAutoScrollRef.current) {
|
|
@@ -12953,7 +13349,7 @@ function Chat({
|
|
|
12953
13349
|
clientSecret: effectiveClientSecret
|
|
12954
13350
|
});
|
|
12955
13351
|
const missingConfig = Boolean(missingConfigKind);
|
|
12956
|
-
const missingConfigShortMessage =
|
|
13352
|
+
const missingConfigShortMessage = React46.useMemo(() => {
|
|
12957
13353
|
switch (missingConfigKind) {
|
|
12958
13354
|
case "apiUrl":
|
|
12959
13355
|
return t("chat.missingApiUrlShort");
|
|
@@ -12965,7 +13361,7 @@ function Chat({
|
|
|
12965
13361
|
return t("chat.missingConfigShort");
|
|
12966
13362
|
}
|
|
12967
13363
|
}, [missingConfigKind, t]);
|
|
12968
|
-
const missingConfigDetailMessage =
|
|
13364
|
+
const missingConfigDetailMessage = React46.useMemo(() => {
|
|
12969
13365
|
switch (missingConfigKind) {
|
|
12970
13366
|
case "apiUrl":
|
|
12971
13367
|
return t("chat.missingApiUrlDetail");
|
|
@@ -12980,7 +13376,7 @@ function Chat({
|
|
|
12980
13376
|
const showMissingConfig = !isClientSecretInitializing && missingConfig;
|
|
12981
13377
|
const hasUploadingFiles = attachments.some((a) => a.status === "uploading");
|
|
12982
13378
|
const isSendDisabled = !trimmedDraft && !hasReferences || hasPendingInteractiveRequest || missingConfig || isHistoryLoading || hasUploadingFiles || isUploadingReferenceImages;
|
|
12983
|
-
const resizeComposerInput =
|
|
13379
|
+
const resizeComposerInput = React46.useCallback(() => {
|
|
12984
13380
|
const input = composerInputRef.current;
|
|
12985
13381
|
if (!input) {
|
|
12986
13382
|
return;
|
|
@@ -12988,7 +13384,7 @@ function Chat({
|
|
|
12988
13384
|
input.style.maxHeight = `${COMPOSER_INPUT_MAX_HEIGHT}px`;
|
|
12989
13385
|
input.style.overflowY = input.scrollHeight > COMPOSER_INPUT_MAX_HEIGHT ? "auto" : "hidden";
|
|
12990
13386
|
}, []);
|
|
12991
|
-
|
|
13387
|
+
React46.useLayoutEffect(() => {
|
|
12992
13388
|
composerPartsRef.current = composerParts;
|
|
12993
13389
|
resizeComposerInput();
|
|
12994
13390
|
const caretOffset = pendingComposerCaretOffsetRef.current;
|
|
@@ -13000,13 +13396,13 @@ function Chat({
|
|
|
13000
13396
|
}
|
|
13001
13397
|
}
|
|
13002
13398
|
}, [composerDomVersion, composerParts, resizeComposerInput]);
|
|
13003
|
-
|
|
13399
|
+
React46.useEffect(() => {
|
|
13004
13400
|
document.addEventListener("selectionchange", syncQuoteSelection);
|
|
13005
13401
|
return () => {
|
|
13006
13402
|
document.removeEventListener("selectionchange", syncQuoteSelection);
|
|
13007
13403
|
};
|
|
13008
13404
|
}, [syncQuoteSelection]);
|
|
13009
|
-
|
|
13405
|
+
React46.useEffect(() => {
|
|
13010
13406
|
const viewport = viewportRef.current;
|
|
13011
13407
|
if (!viewport) {
|
|
13012
13408
|
return;
|
|
@@ -13023,14 +13419,14 @@ function Chat({
|
|
|
13023
13419
|
window.removeEventListener("resize", handleViewportScroll);
|
|
13024
13420
|
};
|
|
13025
13421
|
}, [clearQuoteSelection]);
|
|
13026
|
-
|
|
13422
|
+
React46.useEffect(() => {
|
|
13027
13423
|
clearQuoteSelection();
|
|
13028
13424
|
}, [messages.length, stream.threadId, clearQuoteSelection]);
|
|
13029
|
-
|
|
13425
|
+
React46.useEffect(() => {
|
|
13030
13426
|
if (missingConfig) return;
|
|
13031
13427
|
void refreshThreads();
|
|
13032
13428
|
}, [missingConfig, refreshThreads]);
|
|
13033
|
-
|
|
13429
|
+
React46.useEffect(() => {
|
|
13034
13430
|
if (missingConfig || !stream.client || !stream.assistantId) {
|
|
13035
13431
|
setAssistantName(null);
|
|
13036
13432
|
setAssistantAvatar(null);
|
|
@@ -13053,7 +13449,7 @@ function Chat({
|
|
|
13053
13449
|
cancelled = true;
|
|
13054
13450
|
};
|
|
13055
13451
|
}, [missingConfig, stream.client, stream.assistantId]);
|
|
13056
|
-
|
|
13452
|
+
React46.useEffect(() => {
|
|
13057
13453
|
if (missingConfig || !stream.client || !stream.assistantId) {
|
|
13058
13454
|
setRuntimeCapabilities(null);
|
|
13059
13455
|
setRuntimeCapabilitiesReady(false);
|
|
@@ -13100,7 +13496,7 @@ function Chat({
|
|
|
13100
13496
|
});
|
|
13101
13497
|
return () => controller.abort();
|
|
13102
13498
|
}, [missingConfig, stream.client, stream.assistantId]);
|
|
13103
|
-
|
|
13499
|
+
React46.useEffect(() => {
|
|
13104
13500
|
setRunRuntimeCapabilities(
|
|
13105
13501
|
createEmptyRuntimeCapabilitiesSelection(runtimeCapabilities)
|
|
13106
13502
|
);
|
|
@@ -13157,7 +13553,7 @@ function Chat({
|
|
|
13157
13553
|
mimetype: a.storageFile?.mimetype ?? a.file.type,
|
|
13158
13554
|
size: a.storageFile?.size ?? a.file.size
|
|
13159
13555
|
}));
|
|
13160
|
-
const handleSessionRuntimeCapabilityToggle =
|
|
13556
|
+
const handleSessionRuntimeCapabilityToggle = React46.useCallback(
|
|
13161
13557
|
(type, id, selected) => {
|
|
13162
13558
|
setSessionRuntimeCapabilities((previous) => {
|
|
13163
13559
|
const nextSelection = toggleRuntimeCapabilitySelection(
|
|
@@ -13175,7 +13571,7 @@ function Chat({
|
|
|
13175
13571
|
},
|
|
13176
13572
|
[persistSessionRuntimeCapabilities, stream.threadId]
|
|
13177
13573
|
);
|
|
13178
|
-
const updateRuntimeCapabilityPalette =
|
|
13574
|
+
const updateRuntimeCapabilityPalette = React46.useCallback(
|
|
13179
13575
|
(parts, selectionStart) => {
|
|
13180
13576
|
const input = composerInputRef.current;
|
|
13181
13577
|
const editingText = getComposerEditingText(parts);
|
|
@@ -13187,7 +13583,7 @@ function Chat({
|
|
|
13187
13583
|
},
|
|
13188
13584
|
[]
|
|
13189
13585
|
);
|
|
13190
|
-
const syncComposerInputFromElement =
|
|
13586
|
+
const syncComposerInputFromElement = React46.useCallback(
|
|
13191
13587
|
(input) => {
|
|
13192
13588
|
const previousCapabilities = getComposerCapabilityPartMap(
|
|
13193
13589
|
composerPartsRef.current
|
|
@@ -13205,25 +13601,25 @@ function Chat({
|
|
|
13205
13601
|
},
|
|
13206
13602
|
[commitComposerParts, updateRuntimeCapabilityPalette]
|
|
13207
13603
|
);
|
|
13208
|
-
const handleComposerInput =
|
|
13604
|
+
const handleComposerInput = React46.useCallback(
|
|
13209
13605
|
(event) => {
|
|
13210
13606
|
syncComposerInputFromElement(event.currentTarget);
|
|
13211
13607
|
},
|
|
13212
13608
|
[syncComposerInputFromElement]
|
|
13213
13609
|
);
|
|
13214
|
-
const handleComposerCompositionEnd =
|
|
13610
|
+
const handleComposerCompositionEnd = React46.useCallback(
|
|
13215
13611
|
(event) => {
|
|
13216
13612
|
syncComposerInputFromElement(event.currentTarget);
|
|
13217
13613
|
},
|
|
13218
13614
|
[syncComposerInputFromElement]
|
|
13219
13615
|
);
|
|
13220
|
-
const handleComposerSelect =
|
|
13616
|
+
const handleComposerSelect = React46.useCallback(() => {
|
|
13221
13617
|
updateRuntimeCapabilityPalette(
|
|
13222
13618
|
composerPartsRef.current,
|
|
13223
13619
|
composerInputRef.current ? getComposerSelectionOffset(composerInputRef.current) : void 0
|
|
13224
13620
|
);
|
|
13225
13621
|
}, [updateRuntimeCapabilityPalette]);
|
|
13226
|
-
const removeRunRuntimeCapability =
|
|
13622
|
+
const removeRunRuntimeCapability = React46.useCallback(
|
|
13227
13623
|
(option) => {
|
|
13228
13624
|
setRunRuntimeCapabilities(
|
|
13229
13625
|
(previous) => toggleRuntimeCapabilitySelection(
|
|
@@ -13243,7 +13639,7 @@ function Chat({
|
|
|
13243
13639
|
},
|
|
13244
13640
|
[commitComposerParts]
|
|
13245
13641
|
);
|
|
13246
|
-
const submitDraft =
|
|
13642
|
+
const submitDraft = React46.useCallback(
|
|
13247
13643
|
(optionsOrFollowUp) => {
|
|
13248
13644
|
if (isSendDisabled) return;
|
|
13249
13645
|
const submitOptions = typeof optionsOrFollowUp === "string" ? { followUpOverride: optionsOrFollowUp } : optionsOrFollowUp ?? {};
|
|
@@ -13367,7 +13763,7 @@ function Chat({
|
|
|
13367
13763
|
t
|
|
13368
13764
|
]
|
|
13369
13765
|
);
|
|
13370
|
-
const addRunRuntimeCapabilities =
|
|
13766
|
+
const addRunRuntimeCapabilities = React46.useCallback(
|
|
13371
13767
|
(selection) => {
|
|
13372
13768
|
setRunRuntimeCapabilities(
|
|
13373
13769
|
(previous) => runtimeCapabilities ? mergeRuntimeCapabilitiesSelections(
|
|
@@ -13379,7 +13775,7 @@ function Chat({
|
|
|
13379
13775
|
},
|
|
13380
13776
|
[runtimeCapabilities]
|
|
13381
13777
|
);
|
|
13382
|
-
const insertComposerCapabilityToken =
|
|
13778
|
+
const insertComposerCapabilityToken = React46.useCallback(
|
|
13383
13779
|
(capability, range) => {
|
|
13384
13780
|
const token = createComposerCapabilityPart(capability, createMessageId());
|
|
13385
13781
|
const currentParts = composerPartsRef.current;
|
|
@@ -13450,7 +13846,7 @@ function Chat({
|
|
|
13450
13846
|
plugin: t("composer.slashCommands.empty.loadingCapabilities"),
|
|
13451
13847
|
subAgent: t("composer.slashCommands.empty.loadingCapabilities")
|
|
13452
13848
|
};
|
|
13453
|
-
|
|
13849
|
+
React46.useEffect(() => {
|
|
13454
13850
|
if (!runtimeCapabilityPalette) {
|
|
13455
13851
|
return;
|
|
13456
13852
|
}
|
|
@@ -13469,7 +13865,7 @@ function Chat({
|
|
|
13469
13865
|
);
|
|
13470
13866
|
}
|
|
13471
13867
|
}, [slashPaletteOptions.length, runtimeCapabilityPalette]);
|
|
13472
|
-
|
|
13868
|
+
React46.useLayoutEffect(() => {
|
|
13473
13869
|
if (!runtimeCapabilityPalette) {
|
|
13474
13870
|
return;
|
|
13475
13871
|
}
|
|
@@ -13493,7 +13889,7 @@ function Chat({
|
|
|
13493
13889
|
}
|
|
13494
13890
|
submitDraft();
|
|
13495
13891
|
};
|
|
13496
|
-
const handleEditPendingFollowUp =
|
|
13892
|
+
const handleEditPendingFollowUp = React46.useCallback(
|
|
13497
13893
|
(id) => {
|
|
13498
13894
|
const item = pendingFollowUps.find(
|
|
13499
13895
|
(entry) => entry.id === id && entry.mode === "queue"
|
|
@@ -13520,7 +13916,7 @@ function Chat({
|
|
|
13520
13916
|
},
|
|
13521
13917
|
[pendingFollowUps, setComposerText, stream]
|
|
13522
13918
|
);
|
|
13523
|
-
const handleQuoteSelection =
|
|
13919
|
+
const handleQuoteSelection = React46.useCallback(() => {
|
|
13524
13920
|
if (!quoteSelection) {
|
|
13525
13921
|
return;
|
|
13526
13922
|
}
|
|
@@ -13536,7 +13932,7 @@ function Chat({
|
|
|
13536
13932
|
const handleAttachmentClick = () => {
|
|
13537
13933
|
fileInputRef.current?.click();
|
|
13538
13934
|
};
|
|
13539
|
-
const uploadContextFile =
|
|
13935
|
+
const uploadContextFile = React46.useCallback(
|
|
13540
13936
|
(file) => stream.client.contexts.uploadFile(file),
|
|
13541
13937
|
[stream.client]
|
|
13542
13938
|
);
|
|
@@ -13640,7 +14036,7 @@ function Chat({
|
|
|
13640
14036
|
}
|
|
13641
14037
|
submitDraft();
|
|
13642
14038
|
};
|
|
13643
|
-
const handleComposerPaste =
|
|
14039
|
+
const handleComposerPaste = React46.useCallback(
|
|
13644
14040
|
(event) => {
|
|
13645
14041
|
const clipboardData = event.clipboardData;
|
|
13646
14042
|
if (!clipboardData) {
|
|
@@ -13739,18 +14135,18 @@ function Chat({
|
|
|
13739
14135
|
uploadContextFile
|
|
13740
14136
|
]
|
|
13741
14137
|
);
|
|
13742
|
-
const alternateFollowUpShortcutLabel =
|
|
14138
|
+
const alternateFollowUpShortcutLabel = React46.useMemo(() => {
|
|
13743
14139
|
if (typeof navigator === "undefined") {
|
|
13744
14140
|
return "\u2318Enter";
|
|
13745
14141
|
}
|
|
13746
14142
|
const platform = navigator.platform || navigator.userAgent;
|
|
13747
14143
|
return /Mac|iPhone|iPad|iPod/i.test(platform) ? "\u2318Enter" : "Ctrl+Enter";
|
|
13748
14144
|
}, []);
|
|
13749
|
-
const followUpShortcutLabels =
|
|
14145
|
+
const followUpShortcutLabels = React46.useMemo(
|
|
13750
14146
|
() => getComposerFollowUpShortcutLabels(alternateFollowUpShortcutLabel),
|
|
13751
14147
|
[alternateFollowUpShortcutLabel]
|
|
13752
14148
|
);
|
|
13753
|
-
const uploadFile =
|
|
14149
|
+
const uploadFile = React46.useCallback(
|
|
13754
14150
|
async (localId, file) => {
|
|
13755
14151
|
try {
|
|
13756
14152
|
const result = await uploadContextFile(file);
|
|
@@ -13773,7 +14169,7 @@ function Chat({
|
|
|
13773
14169
|
},
|
|
13774
14170
|
[uploadContextFile]
|
|
13775
14171
|
);
|
|
13776
|
-
const handleRetryUpload =
|
|
14172
|
+
const handleRetryUpload = React46.useCallback(
|
|
13777
14173
|
(localId) => {
|
|
13778
14174
|
const attachment = attachments.find((a) => a.localId === localId);
|
|
13779
14175
|
if (!attachment || attachment.status !== "error") return;
|
|
@@ -13872,7 +14268,7 @@ function Chat({
|
|
|
13872
14268
|
);
|
|
13873
14269
|
scrollToBottom(true, true);
|
|
13874
14270
|
};
|
|
13875
|
-
const loadConversationMessages =
|
|
14271
|
+
const loadConversationMessages = React46.useCallback(
|
|
13876
14272
|
async (recordId) => {
|
|
13877
14273
|
if (missingConfig) {
|
|
13878
14274
|
setHistoryError(missingConfigShortMessage);
|
|
@@ -13967,12 +14363,12 @@ function Chat({
|
|
|
13967
14363
|
}
|
|
13968
14364
|
};
|
|
13969
14365
|
const acceptMimes = composer?.attachments?.accept ? Object.entries(composer.attachments.accept).map(([mime, exts]) => [mime, ...exts.map((e) => `.${e}`)].join(",")).join(",") : void 0;
|
|
13970
|
-
const currentThread =
|
|
14366
|
+
const currentThread = React46.useMemo(
|
|
13971
14367
|
() => threads.find((item) => item.id === stream.threadId),
|
|
13972
14368
|
[threads, stream.threadId]
|
|
13973
14369
|
);
|
|
13974
14370
|
const streamErrorMessage = stream.error instanceof Error ? stream.error.message : void 0;
|
|
13975
|
-
const threadErrorMessage =
|
|
14371
|
+
const threadErrorMessage = React46.useMemo(() => {
|
|
13976
14372
|
if (streamErrorMessage?.trim()) return streamErrorMessage.trim();
|
|
13977
14373
|
if (currentThread?.status !== "error") return void 0;
|
|
13978
14374
|
const message = currentThread.error?.trim();
|
|
@@ -14003,7 +14399,7 @@ function Chat({
|
|
|
14003
14399
|
fallbackTitle: t("history.threadFallback")
|
|
14004
14400
|
});
|
|
14005
14401
|
const assistantTitle = assistantName || resolvedTitle;
|
|
14006
|
-
return /* @__PURE__ */ (0,
|
|
14402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
14007
14403
|
"div",
|
|
14008
14404
|
{
|
|
14009
14405
|
ref: viewportRef,
|
|
@@ -14013,10 +14409,10 @@ function Chat({
|
|
|
14013
14409
|
className
|
|
14014
14410
|
),
|
|
14015
14411
|
children: [
|
|
14016
|
-
/* @__PURE__ */ (0,
|
|
14017
|
-
/* @__PURE__ */ (0,
|
|
14018
|
-
/* @__PURE__ */ (0,
|
|
14019
|
-
/* @__PURE__ */ (0,
|
|
14412
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center justify-between border-b p-2 sticky top-0 z-10 bg-background", children: [
|
|
14413
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center gap-3 overflow-hidden", children: [
|
|
14414
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "relative shrink-0", children: [
|
|
14415
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14020
14416
|
ChatkitAvatar,
|
|
14021
14417
|
{
|
|
14022
14418
|
avatar: assistantAvatar,
|
|
@@ -14024,10 +14420,10 @@ function Chat({
|
|
|
14024
14420
|
label: assistantTitle
|
|
14025
14421
|
}
|
|
14026
14422
|
),
|
|
14027
|
-
/* @__PURE__ */ (0,
|
|
14423
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "absolute bottom-0 right-0 h-2.5 w-2.5 rounded-full border-2 border-background bg-green-500" })
|
|
14028
14424
|
] }),
|
|
14029
|
-
/* @__PURE__ */ (0,
|
|
14030
|
-
/* @__PURE__ */ (0,
|
|
14425
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "truncate", children: [
|
|
14426
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14031
14427
|
"h2",
|
|
14032
14428
|
{
|
|
14033
14429
|
className: "text-lg font-semibold truncate",
|
|
@@ -14035,12 +14431,29 @@ function Chat({
|
|
|
14035
14431
|
children: assistantTitle
|
|
14036
14432
|
}
|
|
14037
14433
|
),
|
|
14038
|
-
/* @__PURE__ */ (0,
|
|
14434
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("p", { className: "text-xs text-muted-foreground", children: t("chat.statusOnline") })
|
|
14039
14435
|
] })
|
|
14040
14436
|
] }),
|
|
14041
|
-
/* @__PURE__ */ (0,
|
|
14042
|
-
/* @__PURE__ */ (0,
|
|
14043
|
-
/* @__PURE__ */ (0,
|
|
14437
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
14438
|
+
canMinimizeToPet && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Tooltip, { children: [
|
|
14439
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14440
|
+
"button",
|
|
14441
|
+
{
|
|
14442
|
+
type: "button",
|
|
14443
|
+
onClick: handleMinimizeToPet,
|
|
14444
|
+
className: cn(
|
|
14445
|
+
"flex h-8 w-8 cursor-pointer items-center justify-center rounded-md",
|
|
14446
|
+
"text-muted-foreground hover:text-foreground hover:bg-muted",
|
|
14447
|
+
"transition-colors duration-150"
|
|
14448
|
+
),
|
|
14449
|
+
"aria-label": t("chat.minimizeToPet"),
|
|
14450
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react26.Minus, { size: 16 })
|
|
14451
|
+
}
|
|
14452
|
+
) }) }),
|
|
14453
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TooltipContent, { side: "bottom", children: t("chat.minimizeToPet") })
|
|
14454
|
+
] }),
|
|
14455
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Tooltip, { children: [
|
|
14456
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14044
14457
|
"button",
|
|
14045
14458
|
{
|
|
14046
14459
|
type: "button",
|
|
@@ -14051,14 +14464,14 @@ function Chat({
|
|
|
14051
14464
|
"transition-colors duration-150"
|
|
14052
14465
|
),
|
|
14053
14466
|
"aria-label": t("settings.open"),
|
|
14054
|
-
children: /* @__PURE__ */ (0,
|
|
14467
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react26.Settings, { size: 16 })
|
|
14055
14468
|
}
|
|
14056
14469
|
) }) }),
|
|
14057
|
-
/* @__PURE__ */ (0,
|
|
14470
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TooltipContent, { side: "bottom", children: t("settings.open") })
|
|
14058
14471
|
] }),
|
|
14059
|
-
history?.enabled !== false && /* @__PURE__ */ (0,
|
|
14060
|
-
/* @__PURE__ */ (0,
|
|
14061
|
-
/* @__PURE__ */ (0,
|
|
14472
|
+
history?.enabled !== false && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
14473
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Tooltip, { children: [
|
|
14474
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14062
14475
|
"button",
|
|
14063
14476
|
{
|
|
14064
14477
|
type: "button",
|
|
@@ -14071,12 +14484,12 @@ function Chat({
|
|
|
14071
14484
|
"disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed"
|
|
14072
14485
|
),
|
|
14073
14486
|
"aria-label": t("history.newThread"),
|
|
14074
|
-
children: /* @__PURE__ */ (0,
|
|
14487
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react26.Pencil, { size: 16 })
|
|
14075
14488
|
}
|
|
14076
14489
|
) }) }),
|
|
14077
|
-
/* @__PURE__ */ (0,
|
|
14490
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TooltipContent, { side: "bottom", children: t("history.newThread") })
|
|
14078
14491
|
] }),
|
|
14079
|
-
/* @__PURE__ */ (0,
|
|
14492
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14080
14493
|
HistorySidebar,
|
|
14081
14494
|
{
|
|
14082
14495
|
threads,
|
|
@@ -14091,18 +14504,18 @@ function Chat({
|
|
|
14091
14504
|
] })
|
|
14092
14505
|
] })
|
|
14093
14506
|
] }),
|
|
14094
|
-
/* @__PURE__ */ (0,
|
|
14095
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
14096
|
-
historyError && /* @__PURE__ */ (0,
|
|
14097
|
-
showMissingConfig && /* @__PURE__ */ (0,
|
|
14098
|
-
isHistoryLoading && /* @__PURE__ */ (0,
|
|
14099
|
-
messages.length === 0 ? /* @__PURE__ */ (0,
|
|
14507
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex-1 p-4", children: [
|
|
14508
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "mb-4 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive", children: errorMessage }),
|
|
14509
|
+
historyError && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: historyError }),
|
|
14510
|
+
showMissingConfig && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: missingConfigDetailMessage }),
|
|
14511
|
+
isHistoryLoading && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "mb-4 rounded-lg border border-muted px-3 py-2 text-sm text-muted-foreground", children: t("chat.loadingThread") }),
|
|
14512
|
+
messages.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14100
14513
|
StartScreen,
|
|
14101
14514
|
{
|
|
14102
14515
|
startScreen,
|
|
14103
14516
|
onPromptClick: handlePromptClick
|
|
14104
14517
|
}
|
|
14105
|
-
) : /* @__PURE__ */ (0,
|
|
14518
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "space-y-4", children: [
|
|
14106
14519
|
messages.map((message, index) => {
|
|
14107
14520
|
const messageType = String(message.type);
|
|
14108
14521
|
const isAssistantMessage = messageType === "assistant" || messageType === "ai";
|
|
@@ -14135,7 +14548,7 @@ function Chat({
|
|
|
14135
14548
|
if (!isAssistantMessage && !hasPlainRenderableContent && !hasHumanAttachments && humanRuntimeCapabilityOptions.length === 0 && humanReferences.length === 0) {
|
|
14136
14549
|
return null;
|
|
14137
14550
|
}
|
|
14138
|
-
return /* @__PURE__ */ (0,
|
|
14551
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14139
14552
|
"div",
|
|
14140
14553
|
{
|
|
14141
14554
|
className: cn(
|
|
@@ -14143,96 +14556,105 @@ function Chat({
|
|
|
14143
14556
|
message.type === "human" ? "justify-end" : "justify-start -ml-1"
|
|
14144
14557
|
// AI messages: slightly closer to left
|
|
14145
14558
|
),
|
|
14146
|
-
children: /* @__PURE__ */ (0,
|
|
14147
|
-
|
|
14148
|
-
|
|
14149
|
-
|
|
14150
|
-
|
|
14151
|
-
|
|
14152
|
-
|
|
14153
|
-
|
|
14154
|
-
|
|
14155
|
-
"
|
|
14156
|
-
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"
|
|
14157
|
-
// AI messages: use chat-specific foreground color
|
|
14158
|
-
),
|
|
14159
|
-
children: isAssistantMessage ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
14160
|
-
AssistantMessage,
|
|
14559
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
14560
|
+
"div",
|
|
14561
|
+
{
|
|
14562
|
+
className: cn(
|
|
14563
|
+
"flex flex-col px-3 overflow-hidden",
|
|
14564
|
+
isAssistantMessage && "min-w-0 flex-1"
|
|
14565
|
+
),
|
|
14566
|
+
children: [
|
|
14567
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14568
|
+
"div",
|
|
14161
14569
|
{
|
|
14162
|
-
|
|
14163
|
-
|
|
14164
|
-
|
|
14165
|
-
},
|
|
14166
|
-
|
|
14167
|
-
|
|
14168
|
-
|
|
14169
|
-
|
|
14170
|
-
})
|
|
14570
|
+
...canQuoteMessage ? {
|
|
14571
|
+
"data-quote-message-id": message.id,
|
|
14572
|
+
"data-quote-source": quoteSource
|
|
14573
|
+
} : {},
|
|
14574
|
+
className: cn(
|
|
14575
|
+
"max-w-full rounded-2xl",
|
|
14576
|
+
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"
|
|
14577
|
+
// AI messages: use chat-specific foreground color
|
|
14171
14578
|
),
|
|
14579
|
+
children: isAssistantMessage ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14580
|
+
AssistantMessage,
|
|
14581
|
+
{
|
|
14582
|
+
message: {
|
|
14583
|
+
...message,
|
|
14584
|
+
type: "assistant"
|
|
14585
|
+
},
|
|
14586
|
+
messages: messages.slice(0, index + 1).map(
|
|
14587
|
+
(item) => ({
|
|
14588
|
+
...item,
|
|
14589
|
+
type: String(item.type) === "ai" ? "assistant" : item.type
|
|
14590
|
+
})
|
|
14591
|
+
),
|
|
14592
|
+
isStreaming: isStreamingMessage,
|
|
14593
|
+
streamingStatus,
|
|
14594
|
+
isThreadRunning: currentThreadIsRunning,
|
|
14595
|
+
organizationId: stream.organizationId,
|
|
14596
|
+
apiUrl: stream.apiUrl
|
|
14597
|
+
}
|
|
14598
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
14599
|
+
message.type === "human" && humanRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanRuntimeCapabilityOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
14600
|
+
"span",
|
|
14601
|
+
{
|
|
14602
|
+
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",
|
|
14603
|
+
children: [
|
|
14604
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14605
|
+
RuntimeCapabilityIcon,
|
|
14606
|
+
{
|
|
14607
|
+
option,
|
|
14608
|
+
variant: "chip"
|
|
14609
|
+
}
|
|
14610
|
+
),
|
|
14611
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "max-w-[9rem] truncate", children: option.label })
|
|
14612
|
+
]
|
|
14613
|
+
},
|
|
14614
|
+
`${option.type}:${option.id}`
|
|
14615
|
+
)) }),
|
|
14616
|
+
message.type === "human" && humanReferences.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanReferences.map((reference) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14617
|
+
ReferenceChip,
|
|
14618
|
+
{
|
|
14619
|
+
reference,
|
|
14620
|
+
variant: "message"
|
|
14621
|
+
},
|
|
14622
|
+
getReferenceKey(reference)
|
|
14623
|
+
)) }),
|
|
14624
|
+
message.type === "human" && humanAttachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-2", children: humanAttachments.map((file, fileIndex) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
14625
|
+
"div",
|
|
14626
|
+
{
|
|
14627
|
+
className: "flex items-center gap-1.5 rounded-md bg-primary-foreground/20 px-2 py-1 text-xs",
|
|
14628
|
+
children: [
|
|
14629
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react26.FileText, { size: 12 }),
|
|
14630
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "max-w-[100px] truncate", children: file.originalName })
|
|
14631
|
+
]
|
|
14632
|
+
},
|
|
14633
|
+
fileIndex
|
|
14634
|
+
)) }),
|
|
14635
|
+
Array.isArray(message.content) ? message.content.map((part, partIndex) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14636
|
+
"p",
|
|
14637
|
+
{
|
|
14638
|
+
className: "wrap-break-word text-sm leading-relaxed",
|
|
14639
|
+
children: formatMessageContent(part)
|
|
14640
|
+
},
|
|
14641
|
+
`${part.type}-${partIndex}`
|
|
14642
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "wrap-break-word text-sm leading-relaxed", children: formatMessageContent(message.content) })
|
|
14643
|
+
] })
|
|
14644
|
+
}
|
|
14645
|
+
),
|
|
14646
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14647
|
+
MessageActions,
|
|
14648
|
+
{
|
|
14649
|
+
content: messageContent,
|
|
14650
|
+
isAssistant: isAssistantMessage,
|
|
14172
14651
|
isStreaming: isStreamingMessage,
|
|
14173
|
-
|
|
14174
|
-
isThreadRunning: currentThreadIsRunning,
|
|
14175
|
-
organizationId: stream.organizationId,
|
|
14176
|
-
apiUrl: stream.apiUrl
|
|
14652
|
+
onRetry: isAssistantMessage && !stream.isLoading && index === messages.length - 1 ? () => handleRetry(index) : void 0
|
|
14177
14653
|
}
|
|
14178
|
-
)
|
|
14179
|
-
|
|
14180
|
-
|
|
14181
|
-
|
|
14182
|
-
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",
|
|
14183
|
-
children: [
|
|
14184
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
14185
|
-
RuntimeCapabilityIcon,
|
|
14186
|
-
{
|
|
14187
|
-
option,
|
|
14188
|
-
variant: "chip"
|
|
14189
|
-
}
|
|
14190
|
-
),
|
|
14191
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "max-w-[9rem] truncate", children: option.label })
|
|
14192
|
-
]
|
|
14193
|
-
},
|
|
14194
|
-
`${option.type}:${option.id}`
|
|
14195
|
-
)) }),
|
|
14196
|
-
message.type === "human" && humanReferences.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanReferences.map((reference) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
14197
|
-
ReferenceChip,
|
|
14198
|
-
{
|
|
14199
|
-
reference,
|
|
14200
|
-
variant: "message"
|
|
14201
|
-
},
|
|
14202
|
-
getReferenceKey(reference)
|
|
14203
|
-
)) }),
|
|
14204
|
-
message.type === "human" && humanAttachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-2", children: humanAttachments.map((file, fileIndex) => /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
14205
|
-
"div",
|
|
14206
|
-
{
|
|
14207
|
-
className: "flex items-center gap-1.5 rounded-md bg-primary-foreground/20 px-2 py-1 text-xs",
|
|
14208
|
-
children: [
|
|
14209
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react24.FileText, { size: 12 }),
|
|
14210
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "max-w-[100px] truncate", children: file.originalName })
|
|
14211
|
-
]
|
|
14212
|
-
},
|
|
14213
|
-
fileIndex
|
|
14214
|
-
)) }),
|
|
14215
|
-
Array.isArray(message.content) ? message.content.map((part, partIndex) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
14216
|
-
"p",
|
|
14217
|
-
{
|
|
14218
|
-
className: "wrap-break-word text-sm leading-relaxed",
|
|
14219
|
-
children: formatMessageContent(part)
|
|
14220
|
-
},
|
|
14221
|
-
`${part.type}-${partIndex}`
|
|
14222
|
-
)) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "wrap-break-word text-sm leading-relaxed", children: formatMessageContent(message.content) })
|
|
14223
|
-
] })
|
|
14224
|
-
}
|
|
14225
|
-
),
|
|
14226
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
14227
|
-
MessageActions,
|
|
14228
|
-
{
|
|
14229
|
-
content: messageContent,
|
|
14230
|
-
isAssistant: isAssistantMessage,
|
|
14231
|
-
isStreaming: isStreamingMessage,
|
|
14232
|
-
onRetry: isAssistantMessage && !stream.isLoading && index === messages.length - 1 ? () => handleRetry(index) : void 0
|
|
14233
|
-
}
|
|
14234
|
-
)
|
|
14235
|
-
] })
|
|
14654
|
+
)
|
|
14655
|
+
]
|
|
14656
|
+
}
|
|
14657
|
+
)
|
|
14236
14658
|
},
|
|
14237
14659
|
message.id ?? `${message.type}-${index}`
|
|
14238
14660
|
);
|
|
@@ -14259,7 +14681,7 @@ function Chat({
|
|
|
14259
14681
|
stream.isLoading,
|
|
14260
14682
|
{ now: streamingNow }
|
|
14261
14683
|
);
|
|
14262
|
-
return /* @__PURE__ */ (0,
|
|
14684
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "flex justify-start gap-3 -ml-2", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "max-w-full rounded-2xl py-2.5", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14263
14685
|
AssistantStreamingIndicator,
|
|
14264
14686
|
{
|
|
14265
14687
|
status: fallbackStreamingStatus ?? "loading"
|
|
@@ -14268,7 +14690,7 @@ function Chat({
|
|
|
14268
14690
|
})()
|
|
14269
14691
|
] })
|
|
14270
14692
|
] }),
|
|
14271
|
-
!isAtBottom && messages.length > 0 && /* @__PURE__ */ (0,
|
|
14693
|
+
!isAtBottom && messages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "sticky bottom-20 z-20 flex justify-center px-4 pointer-events-none", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14272
14694
|
Button,
|
|
14273
14695
|
{
|
|
14274
14696
|
type: "button",
|
|
@@ -14281,10 +14703,10 @@ function Chat({
|
|
|
14281
14703
|
onClick: () => scrollToBottom(true, true),
|
|
14282
14704
|
"aria-label": t("chat.scrollToBottom"),
|
|
14283
14705
|
title: t("chat.scrollToBottom"),
|
|
14284
|
-
children: /* @__PURE__ */ (0,
|
|
14706
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react26.ArrowDown, { size: 16 })
|
|
14285
14707
|
}
|
|
14286
14708
|
) }),
|
|
14287
|
-
quoteSelection && /* @__PURE__ */ (0,
|
|
14709
|
+
quoteSelection && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14288
14710
|
"div",
|
|
14289
14711
|
{
|
|
14290
14712
|
className: "pointer-events-none fixed z-50",
|
|
@@ -14293,7 +14715,7 @@ function Chat({
|
|
|
14293
14715
|
left: `${quoteSelection.left}px`,
|
|
14294
14716
|
transform: "translateX(-50%)"
|
|
14295
14717
|
},
|
|
14296
|
-
children: /* @__PURE__ */ (0,
|
|
14718
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
14297
14719
|
Button,
|
|
14298
14720
|
{
|
|
14299
14721
|
type: "button",
|
|
@@ -14305,16 +14727,16 @@ function Chat({
|
|
|
14305
14727
|
"aria-label": t("composer.quoteSelection"),
|
|
14306
14728
|
title: t("composer.quoteSelection"),
|
|
14307
14729
|
children: [
|
|
14308
|
-
/* @__PURE__ */ (0,
|
|
14730
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react26.Quote, { size: 14 }),
|
|
14309
14731
|
t("composer.quoteSelection")
|
|
14310
14732
|
]
|
|
14311
14733
|
}
|
|
14312
14734
|
)
|
|
14313
14735
|
}
|
|
14314
14736
|
),
|
|
14315
|
-
/* @__PURE__ */ (0,
|
|
14316
|
-
threadErrorMessage && /* @__PURE__ */ (0,
|
|
14317
|
-
/* @__PURE__ */ (0,
|
|
14737
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "p-2 sticky bottom-0 z-10 bg-background", children: [
|
|
14738
|
+
threadErrorMessage && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "mb-3 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive overflow-auto", children: threadErrorMessage }),
|
|
14739
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14318
14740
|
"input",
|
|
14319
14741
|
{
|
|
14320
14742
|
ref: fileInputRef,
|
|
@@ -14325,7 +14747,7 @@ function Chat({
|
|
|
14325
14747
|
className: "hidden"
|
|
14326
14748
|
}
|
|
14327
14749
|
),
|
|
14328
|
-
attachments.length > 0 && /* @__PURE__ */ (0,
|
|
14750
|
+
attachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "mb-3 flex flex-wrap gap-2", children: attachments.map((item) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
14329
14751
|
"div",
|
|
14330
14752
|
{
|
|
14331
14753
|
className: cn(
|
|
@@ -14333,16 +14755,16 @@ function Chat({
|
|
|
14333
14755
|
item.status === "error" ? "bg-destructive/10 border border-destructive/30" : "bg-muted"
|
|
14334
14756
|
),
|
|
14335
14757
|
children: [
|
|
14336
|
-
item.status === "uploading" && /* @__PURE__ */ (0,
|
|
14337
|
-
|
|
14758
|
+
item.status === "uploading" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14759
|
+
import_lucide_react26.Loader2,
|
|
14338
14760
|
{
|
|
14339
14761
|
size: 14,
|
|
14340
14762
|
className: "animate-spin text-muted-foreground"
|
|
14341
14763
|
}
|
|
14342
14764
|
),
|
|
14343
|
-
item.status === "success" && /* @__PURE__ */ (0,
|
|
14344
|
-
item.status === "error" && /* @__PURE__ */ (0,
|
|
14345
|
-
/* @__PURE__ */ (0,
|
|
14765
|
+
item.status === "success" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react26.FileText, { size: 14, className: "text-muted-foreground" }),
|
|
14766
|
+
item.status === "error" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react26.FileText, { size: 14, className: "text-destructive" }),
|
|
14767
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14346
14768
|
"span",
|
|
14347
14769
|
{
|
|
14348
14770
|
className: cn(
|
|
@@ -14352,17 +14774,17 @@ function Chat({
|
|
|
14352
14774
|
children: item.file.name
|
|
14353
14775
|
}
|
|
14354
14776
|
),
|
|
14355
|
-
item.status === "error" && /* @__PURE__ */ (0,
|
|
14777
|
+
item.status === "error" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14356
14778
|
"button",
|
|
14357
14779
|
{
|
|
14358
14780
|
type: "button",
|
|
14359
14781
|
onClick: () => handleRetryUpload(item.localId),
|
|
14360
14782
|
className: "ml-1 rounded-full p-0.5 text-destructive hover:bg-destructive/20",
|
|
14361
14783
|
title: t("chat.retryUpload"),
|
|
14362
|
-
children: /* @__PURE__ */ (0,
|
|
14784
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react26.RefreshCw, { size: 12 })
|
|
14363
14785
|
}
|
|
14364
14786
|
),
|
|
14365
|
-
/* @__PURE__ */ (0,
|
|
14787
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14366
14788
|
"button",
|
|
14367
14789
|
{
|
|
14368
14790
|
type: "button",
|
|
@@ -14371,14 +14793,14 @@ function Chat({
|
|
|
14371
14793
|
"ml-1 rounded-full p-0.5",
|
|
14372
14794
|
item.status === "error" ? "text-destructive hover:bg-destructive/20" : "hover:bg-muted-foreground/20"
|
|
14373
14795
|
),
|
|
14374
|
-
children: /* @__PURE__ */ (0,
|
|
14796
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react26.X, { size: 12 })
|
|
14375
14797
|
}
|
|
14376
14798
|
)
|
|
14377
14799
|
]
|
|
14378
14800
|
},
|
|
14379
14801
|
item.localId
|
|
14380
14802
|
)) }),
|
|
14381
|
-
references.length > 0 && /* @__PURE__ */ (0,
|
|
14803
|
+
references.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "mb-3 flex flex-wrap gap-2", children: references.map((reference) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14382
14804
|
ReferenceChip,
|
|
14383
14805
|
{
|
|
14384
14806
|
reference,
|
|
@@ -14392,16 +14814,16 @@ function Chat({
|
|
|
14392
14814
|
},
|
|
14393
14815
|
getReferenceKey(reference)
|
|
14394
14816
|
)) }),
|
|
14395
|
-
detachedRunRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ (0,
|
|
14396
|
-
/* @__PURE__ */ (0,
|
|
14397
|
-
detachedRunRuntimeCapabilityOptions.map((option) => /* @__PURE__ */ (0,
|
|
14817
|
+
detachedRunRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "mb-2 flex flex-wrap items-center gap-2", children: [
|
|
14818
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "text-xs text-muted-foreground", children: t("composer.capabilities.runOnly") }),
|
|
14819
|
+
detachedRunRuntimeCapabilityOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
14398
14820
|
"span",
|
|
14399
14821
|
{
|
|
14400
14822
|
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",
|
|
14401
14823
|
children: [
|
|
14402
|
-
/* @__PURE__ */ (0,
|
|
14403
|
-
/* @__PURE__ */ (0,
|
|
14404
|
-
/* @__PURE__ */ (0,
|
|
14824
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(RuntimeCapabilityIcon, { option, variant: "chip" }),
|
|
14825
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "max-w-40 truncate", children: option.label }),
|
|
14826
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14405
14827
|
"button",
|
|
14406
14828
|
{
|
|
14407
14829
|
type: "button",
|
|
@@ -14409,7 +14831,7 @@ function Chat({
|
|
|
14409
14831
|
className: "rounded-full p-0.5 hover:bg-primary/15",
|
|
14410
14832
|
title: t("composer.capabilities.removeRunCapability"),
|
|
14411
14833
|
"aria-label": t("composer.capabilities.removeRunCapability"),
|
|
14412
|
-
children: /* @__PURE__ */ (0,
|
|
14834
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react26.X, { size: 11 })
|
|
14413
14835
|
}
|
|
14414
14836
|
)
|
|
14415
14837
|
]
|
|
@@ -14417,7 +14839,7 @@ function Chat({
|
|
|
14417
14839
|
`${option.type}:${option.id}`
|
|
14418
14840
|
))
|
|
14419
14841
|
] }),
|
|
14420
|
-
/* @__PURE__ */ (0,
|
|
14842
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14421
14843
|
PendingRuntimeServices,
|
|
14422
14844
|
{
|
|
14423
14845
|
state: stream.runtimeActivities.sandboxServices,
|
|
@@ -14426,7 +14848,7 @@ function Chat({
|
|
|
14426
14848
|
className: hasPendingTodos || hasPendingFollowUps ? "mb-2" : void 0
|
|
14427
14849
|
}
|
|
14428
14850
|
),
|
|
14429
|
-
/* @__PURE__ */ (0,
|
|
14851
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14430
14852
|
PendingTodos,
|
|
14431
14853
|
{
|
|
14432
14854
|
snapshot: stream.todos,
|
|
@@ -14434,7 +14856,7 @@ function Chat({
|
|
|
14434
14856
|
className: hasPendingFollowUps ? "mb-2" : void 0
|
|
14435
14857
|
}
|
|
14436
14858
|
),
|
|
14437
|
-
/* @__PURE__ */ (0,
|
|
14859
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14438
14860
|
PendingFollowUps,
|
|
14439
14861
|
{
|
|
14440
14862
|
items: pendingFollowUps,
|
|
@@ -14449,7 +14871,7 @@ function Chat({
|
|
|
14449
14871
|
attachToComposer: true
|
|
14450
14872
|
}
|
|
14451
14873
|
),
|
|
14452
|
-
/* @__PURE__ */ (0,
|
|
14874
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14453
14875
|
RequestUserInputPanel,
|
|
14454
14876
|
{
|
|
14455
14877
|
request: stream.pendingRequestUserInput,
|
|
@@ -14458,7 +14880,7 @@ function Chat({
|
|
|
14458
14880
|
attachToComposer: true
|
|
14459
14881
|
}
|
|
14460
14882
|
),
|
|
14461
|
-
/* @__PURE__ */ (0,
|
|
14883
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14462
14884
|
HITLApprovalPanel,
|
|
14463
14885
|
{
|
|
14464
14886
|
request: stream.pendingHITLRequest,
|
|
@@ -14467,7 +14889,7 @@ function Chat({
|
|
|
14467
14889
|
attachToComposer: true
|
|
14468
14890
|
}
|
|
14469
14891
|
),
|
|
14470
|
-
runtimeCapabilityPalette && /* @__PURE__ */ (0,
|
|
14892
|
+
runtimeCapabilityPalette && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14471
14893
|
SlashPalette,
|
|
14472
14894
|
{
|
|
14473
14895
|
palette: runtimeCapabilityPalette,
|
|
@@ -14481,7 +14903,7 @@ function Chat({
|
|
|
14481
14903
|
onSelect: selectSlashPaletteOption
|
|
14482
14904
|
}
|
|
14483
14905
|
),
|
|
14484
|
-
/* @__PURE__ */ (0,
|
|
14906
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("form", { className: "flex items-end", onSubmit: handleSubmit, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
14485
14907
|
"div",
|
|
14486
14908
|
{
|
|
14487
14909
|
"data-slot": "composer-input-shell",
|
|
@@ -14495,7 +14917,7 @@ function Chat({
|
|
|
14495
14917
|
composerInputRoundedClass
|
|
14496
14918
|
),
|
|
14497
14919
|
children: [
|
|
14498
|
-
/* @__PURE__ */ (0,
|
|
14920
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14499
14921
|
"div",
|
|
14500
14922
|
{
|
|
14501
14923
|
ref: composerInputRef,
|
|
@@ -14517,7 +14939,7 @@ function Chat({
|
|
|
14517
14939
|
(missingConfig || isHistoryLoading || hasPendingInteractiveRequest) && "cursor-not-allowed opacity-50"
|
|
14518
14940
|
),
|
|
14519
14941
|
children: renderedComposerParts.map(
|
|
14520
|
-
(part, index) => part.type === "text" ? /* @__PURE__ */ (0,
|
|
14942
|
+
(part, index) => part.type === "text" ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(React46.Fragment, { children: part.text }, `text-${index}`) : /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
14521
14943
|
"span",
|
|
14522
14944
|
{
|
|
14523
14945
|
"data-composer-capability-key": part.key,
|
|
@@ -14526,14 +14948,14 @@ function Chat({
|
|
|
14526
14948
|
contentEditable: false,
|
|
14527
14949
|
className: "mx-0.5 inline-flex max-w-[14rem] select-none items-center gap-1 text-sm font-semibold text-primary align-baseline",
|
|
14528
14950
|
children: [
|
|
14529
|
-
/* @__PURE__ */ (0,
|
|
14951
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14530
14952
|
RuntimeCapabilityIcon,
|
|
14531
14953
|
{
|
|
14532
14954
|
option: part.capability,
|
|
14533
14955
|
variant: "chip"
|
|
14534
14956
|
}
|
|
14535
14957
|
),
|
|
14536
|
-
/* @__PURE__ */ (0,
|
|
14958
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "truncate", children: part.capability.label })
|
|
14537
14959
|
]
|
|
14538
14960
|
},
|
|
14539
14961
|
part.key
|
|
@@ -14542,14 +14964,14 @@ function Chat({
|
|
|
14542
14964
|
},
|
|
14543
14965
|
composerDomVersion
|
|
14544
14966
|
),
|
|
14545
|
-
/* @__PURE__ */ (0,
|
|
14967
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
14546
14968
|
"div",
|
|
14547
14969
|
{
|
|
14548
14970
|
"data-slot": "composer-action-bar",
|
|
14549
14971
|
className: "pointer-events-none absolute inset-x-1.5 bottom-1 flex min-h-10 items-center justify-between gap-2",
|
|
14550
14972
|
children: [
|
|
14551
|
-
/* @__PURE__ */ (0,
|
|
14552
|
-
/* @__PURE__ */ (0,
|
|
14973
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "pointer-events-none flex min-w-0 flex-1 items-center gap-1.5", children: [
|
|
14974
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "pointer-events-auto flex shrink-0 items-center gap-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14553
14975
|
ComposerMenu,
|
|
14554
14976
|
{
|
|
14555
14977
|
composer,
|
|
@@ -14564,20 +14986,20 @@ function Chat({
|
|
|
14564
14986
|
disabled: missingConfig || isHistoryLoading || hasPendingInteractiveRequest
|
|
14565
14987
|
}
|
|
14566
14988
|
) }),
|
|
14567
|
-
selectedTool && /* @__PURE__ */ (0,
|
|
14568
|
-
/* @__PURE__ */ (0,
|
|
14569
|
-
/* @__PURE__ */ (0,
|
|
14989
|
+
selectedTool && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("span", { className: "pointer-events-auto inline-flex h-8 min-w-0 max-w-[14rem] shrink items-center gap-1.5 rounded-full bg-primary/10 px-2 text-xs font-medium text-primary transition-all duration-200", children: [
|
|
14990
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "truncate", children: selectedTool.shortLabel ?? selectedTool.label }),
|
|
14991
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14570
14992
|
"button",
|
|
14571
14993
|
{
|
|
14572
14994
|
type: "button",
|
|
14573
14995
|
onClick: () => setSelectedTool(null),
|
|
14574
14996
|
className: "shrink-0 rounded-full p-0.5 text-primary/70 hover:bg-primary/10 hover:text-primary",
|
|
14575
|
-
children: /* @__PURE__ */ (0,
|
|
14997
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react26.X, { size: 12 })
|
|
14576
14998
|
}
|
|
14577
14999
|
)
|
|
14578
15000
|
] })
|
|
14579
15001
|
] }),
|
|
14580
|
-
/* @__PURE__ */ (0,
|
|
15002
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "pointer-events-auto shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14581
15003
|
SendButton,
|
|
14582
15004
|
{
|
|
14583
15005
|
disabled: isSendDisabled,
|
|
@@ -14604,7 +15026,7 @@ function Chat({
|
|
|
14604
15026
|
]
|
|
14605
15027
|
}
|
|
14606
15028
|
) }),
|
|
14607
|
-
disclaimer?.text && /* @__PURE__ */ (0,
|
|
15029
|
+
disclaimer?.text && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14608
15030
|
"p",
|
|
14609
15031
|
{
|
|
14610
15032
|
className: cn(
|
|
@@ -14614,12 +15036,12 @@ function Chat({
|
|
|
14614
15036
|
children: disclaimer.text
|
|
14615
15037
|
}
|
|
14616
15038
|
),
|
|
14617
|
-
/* @__PURE__ */ (0,
|
|
14618
|
-
/* @__PURE__ */ (0,
|
|
14619
|
-
/* @__PURE__ */ (0,
|
|
15039
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "mt-2 flex items-center justify-center gap-2 text-xs text-muted-foreground", children: [
|
|
15040
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { children: t("chat.poweredBy") }),
|
|
15041
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ContextUsageIndicator, { className: "absolute right-4" })
|
|
14620
15042
|
] })
|
|
14621
15043
|
] }),
|
|
14622
|
-
/* @__PURE__ */ (0,
|
|
15044
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14623
15045
|
SettingsSheet,
|
|
14624
15046
|
{
|
|
14625
15047
|
open: petSettingsOpen,
|
|
@@ -14629,17 +15051,17 @@ function Chat({
|
|
|
14629
15051
|
onSave: savePetLocalSettings
|
|
14630
15052
|
}
|
|
14631
15053
|
),
|
|
14632
|
-
/* @__PURE__ */ (0,
|
|
15054
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(PetBridge, { pet: effectivePet, state: petAutoState })
|
|
14633
15055
|
]
|
|
14634
15056
|
}
|
|
14635
15057
|
);
|
|
14636
15058
|
}
|
|
14637
15059
|
|
|
14638
15060
|
// src/components/ui/separator.tsx
|
|
14639
|
-
var
|
|
14640
|
-
var
|
|
14641
|
-
var Separator =
|
|
14642
|
-
({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */ (0,
|
|
15061
|
+
var React47 = __toESM(require("react"), 1);
|
|
15062
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
15063
|
+
var Separator = React47.forwardRef(
|
|
15064
|
+
({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
14643
15065
|
"div",
|
|
14644
15066
|
{
|
|
14645
15067
|
ref,
|