@xpert-ai/chatkit-ui 0.0.15 → 0.0.17
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/{abap-BWs0QYPi.js → abap-Bwwc_1gv.js} +1 -1
- package/dist/app/assets/{abnf-D836Ekee.js → abnf-B2dNcP9G.js} +1 -1
- package/dist/app/assets/{actionscript-DwxVdnYd.js → actionscript-CXHQ00sX.js} +1 -1
- package/dist/app/assets/{ada-DuqPZP7y.js → ada-CqG-JVlv.js} +1 -1
- package/dist/app/assets/{agda--lKV47zi.js → agda-B17H_65R.js} +1 -1
- package/dist/app/assets/{al-DmWukAFp.js → al-DZ1np1rt.js} +1 -1
- package/dist/app/assets/{antlr4-Cui9A7Z6.js → antlr4-C8q5KPBn.js} +1 -1
- package/dist/app/assets/{apacheconf-p7Nhi2d3.js → apacheconf-ChkcfFbQ.js} +1 -1
- package/dist/app/assets/{apex-wwNmkUuv.js → apex-BH4E_dsM.js} +1 -1
- package/dist/app/assets/{apl-CQGwfDry.js → apl-CrQcdvRs.js} +1 -1
- package/dist/app/assets/{applescript-CxRglPCi.js → applescript-cM7xSTOK.js} +1 -1
- package/dist/app/assets/{aql-DzrzGLDh.js → aql-CUr96LHI.js} +1 -1
- package/dist/app/assets/{arduino-Bl4m690J.js → arduino-Cxfmugkq.js} +1 -1
- package/dist/app/assets/{arff-Bi4yNRUp.js → arff-BUd5n8om.js} +1 -1
- package/dist/app/assets/{asciidoc-CPTTRBXf.js → asciidoc-DXG-Il5x.js} +1 -1
- package/dist/app/assets/{asm6502-CBolQ2s3.js → asm6502-CGctLvPd.js} +1 -1
- package/dist/app/assets/{asmatmel-DwyOAW8C.js → asmatmel-D079kq0M.js} +1 -1
- package/dist/app/assets/{aspnet-K1n3IryN.js → aspnet-8ExSjxvo.js} +1 -1
- package/dist/app/assets/{autohotkey-DKr5NeGL.js → autohotkey-Dl4oXtIk.js} +1 -1
- package/dist/app/assets/{autoit-BmaRQ3eS.js → autoit-C3CwtOjR.js} +1 -1
- package/dist/app/assets/{avisynth-B5jllq4s.js → avisynth-Bx99tLxs.js} +1 -1
- package/dist/app/assets/{avro-idl-D79eqXPk.js → avro-idl-C31XGLPW.js} +1 -1
- package/dist/app/assets/{bash-DWI44uVu.js → bash-Bbt-WPbn.js} +1 -1
- package/dist/app/assets/{basic-DX5tJRab.js → basic-C61Emcak.js} +1 -1
- package/dist/app/assets/{batch-BZon0dQf.js → batch-Djn-x2uB.js} +1 -1
- package/dist/app/assets/{bbcode-CCzrmpJu.js → bbcode-CNJrjhuJ.js} +1 -1
- package/dist/app/assets/{bicep-BhU89M6Z.js → bicep-CI5LT2Ae.js} +1 -1
- package/dist/app/assets/{birb-CpbVfpC3.js → birb-DbXUGjzd.js} +1 -1
- package/dist/app/assets/{bison-C7eKJdUK.js → bison-DrTn1ufs.js} +1 -1
- package/dist/app/assets/{bnf-C41JeurH.js → bnf-IYAsThC7.js} +1 -1
- package/dist/app/assets/{brainfuck-DL3BN1lC.js → brainfuck-BP2_pLcy.js} +1 -1
- package/dist/app/assets/{brightscript-C1ciaxot.js → brightscript-DAQk2Wd6.js} +1 -1
- package/dist/app/assets/{bro-DeUBCRiY.js → bro-DLuKh1Ny.js} +1 -1
- package/dist/app/assets/{bsl-BVdoLWrt.js → bsl-kl73aWRB.js} +1 -1
- package/dist/app/assets/{c-D-NlgPSm.js → c-CIhTtviR.js} +1 -1
- package/dist/app/assets/{cfscript-CI77gY57.js → cfscript-CbFVl9I3.js} +1 -1
- package/dist/app/assets/{chaiscript-D92IIXjK.js → chaiscript-D-0nW1Dm.js} +1 -1
- package/dist/app/assets/{cil-Vi00szx4.js → cil-BDy_lgSO.js} +1 -1
- package/dist/app/assets/{clike-K_AYaoxN.js → clike-CpJMZ32o.js} +1 -1
- package/dist/app/assets/{clojure-IjprIaXK.js → clojure-DGR-MOcf.js} +1 -1
- package/dist/app/assets/{cmake-CiZsn6Cd.js → cmake-DN0Hfx1z.js} +1 -1
- package/dist/app/assets/{cobol-BsMCYJOB.js → cobol-CizJYTKX.js} +1 -1
- package/dist/app/assets/{coffeescript-Tn0NVIMO.js → coffeescript-R-3uLIaS.js} +1 -1
- package/dist/app/assets/{concurnas-Qkduv-yR.js → concurnas-CQkxgZj4.js} +1 -1
- package/dist/app/assets/{coq-CkiZ3gEL.js → coq-DQgbmzEf.js} +1 -1
- package/dist/app/assets/{core-BIe9U2bi.js → core-DycsgPCm.js} +1 -1
- package/dist/app/assets/{cpp-DUkuUOiy.js → cpp-CWEafQ-5.js} +1 -1
- package/dist/app/assets/{crystal-DzDaEh84.js → crystal-B99VfLZA.js} +1 -1
- package/dist/app/assets/{csharp-Ds4tzl1h.js → csharp-BpTiSprW.js} +1 -1
- package/dist/app/assets/{cshtml-XSfeicox.js → cshtml-Vijio5v4.js} +1 -1
- package/dist/app/assets/{csp-BnuytBc2.js → csp-tvYUeGBl.js} +1 -1
- package/dist/app/assets/{css-uvHkMV3H.js → css-DKouri6h.js} +1 -1
- package/dist/app/assets/{css-extras-BYbzAK7f.js → css-extras-CBuI96HF.js} +1 -1
- package/dist/app/assets/{csv-ZTBDHIMG.js → csv-CwTWJ9fy.js} +1 -1
- package/dist/app/assets/{cypher-8jmGfbdR.js → cypher-D88tClXE.js} +1 -1
- package/dist/app/assets/{d-DFbflmjx.js → d-BWG0iTE-.js} +1 -1
- package/dist/app/assets/{dart-xe2OJ0zL.js → dart-CuUeEfkB.js} +1 -1
- package/dist/app/assets/{dataweave-cyUIz_PL.js → dataweave-Y5qfzSJO.js} +1 -1
- package/dist/app/assets/{dax-BnxULnvb.js → dax-z1vJoJqt.js} +1 -1
- package/dist/app/assets/{dhall-DkVQZ3C3.js → dhall-fDEBchRN.js} +1 -1
- package/dist/app/assets/{diff-u2elSjyY.js → diff-DWMZ6ihZ.js} +1 -1
- package/dist/app/assets/{django-DWfaa1BH.js → django-DCaIOARB.js} +1 -1
- package/dist/app/assets/{dns-zone-file-BxxD9YiY.js → dns-zone-file-BDhluMwF.js} +1 -1
- package/dist/app/assets/{docker-agJ_fYVN.js → docker-ADTABOD7.js} +1 -1
- package/dist/app/assets/{dot-DfK48nzU.js → dot-dm0hRI_d.js} +1 -1
- package/dist/app/assets/{ebnf-D2_uN5ZR.js → ebnf-qFQ8NGRa.js} +1 -1
- package/dist/app/assets/{editorconfig-Bkm8bu86.js → editorconfig-M1PNmDB7.js} +1 -1
- package/dist/app/assets/{eiffel-KNdMI65Y.js → eiffel-Bk5GVHNc.js} +1 -1
- package/dist/app/assets/{ejs-CscaSYIN.js → ejs-BXbi7DMO.js} +1 -1
- package/dist/app/assets/{elixir-BNlWI1r7.js → elixir-nt7_rP4L.js} +1 -1
- package/dist/app/assets/{elm-CNwbF3_9.js → elm-CDcRzvrq.js} +1 -1
- package/dist/app/assets/{erb-DtFL1xmZ.js → erb-D3tcO__0.js} +1 -1
- package/dist/app/assets/{erlang-C0jBeitv.js → erlang-B4u--80w.js} +1 -1
- package/dist/app/assets/{etlua-B_FYDHoo.js → etlua-BnbSsaIV.js} +1 -1
- package/dist/app/assets/{excel-formula-Ddk-Nf9I.js → excel-formula-DLztFxwy.js} +1 -1
- package/dist/app/assets/{factor-CmwX-7Jh.js → factor-k_q8DU3n.js} +1 -1
- package/dist/app/assets/{false-DyBWE4qx.js → false-EqgS-Tkv.js} +1 -1
- package/dist/app/assets/{firestore-security-rules-BnA9yQQx.js → firestore-security-rules-BNeM0zmk.js} +1 -1
- package/dist/app/assets/{flow-DN7IgZst.js → flow-C6rIqrD4.js} +1 -1
- package/dist/app/assets/{fortran-CWBI75l9.js → fortran-CtcKyblB.js} +1 -1
- package/dist/app/assets/{fsharp-Be4_1ptQ.js → fsharp-DvC6evnC.js} +1 -1
- package/dist/app/assets/{ftl-CGRdQf4s.js → ftl-B_JlxDIr.js} +1 -1
- package/dist/app/assets/{gap-BKioDcPC.js → gap-gLflRQGF.js} +1 -1
- package/dist/app/assets/{gcode-Dn2cLzkC.js → gcode-CnfAyvEE.js} +1 -1
- package/dist/app/assets/{gdscript-CJOS-gjk.js → gdscript-EKerpVNS.js} +1 -1
- package/dist/app/assets/{gedcom-CplceX5G.js → gedcom-Ad0m6Zc2.js} +1 -1
- package/dist/app/assets/{gherkin-DMSysr5I.js → gherkin-uCNN1ATX.js} +1 -1
- package/dist/app/assets/{git-CPW7sXGf.js → git-Bjayw6ss.js} +1 -1
- package/dist/app/assets/{glsl-k-facHOT.js → glsl-bHhLBW8P.js} +1 -1
- package/dist/app/assets/{gml-CV--3uCc.js → gml-BQNjMX9m.js} +1 -1
- package/dist/app/assets/{gn-jkosEbNS.js → gn-AZpH8rMM.js} +1 -1
- package/dist/app/assets/{go-BNQLRlmA.js → go-B04a4gPD.js} +1 -1
- package/dist/app/assets/{go-module-DbWOj2H0.js → go-module-B-KN1Mlr.js} +1 -1
- package/dist/app/assets/{graphql-usPW3Fl7.js → graphql-DHjSGdnz.js} +1 -1
- package/dist/app/assets/{groovy-MKE1O2R9.js → groovy-DEug64iA.js} +1 -1
- package/dist/app/assets/{haml-_mDStvsq.js → haml-Bz8MK1Hn.js} +1 -1
- package/dist/app/assets/{handlebars-CIl8TmZq.js → handlebars-r_hDn-yj.js} +1 -1
- package/dist/app/assets/{haskell-Cm4BzUdQ.js → haskell-DhRqgzP_.js} +1 -1
- package/dist/app/assets/{haxe-COKxOzXV.js → haxe-DQFQxvE_.js} +1 -1
- package/dist/app/assets/{hcl-DUZa-9cr.js → hcl-BKp5VAPU.js} +1 -1
- package/dist/app/assets/{hlsl-Dxo1rrBG.js → hlsl-CghIWoQj.js} +1 -1
- package/dist/app/assets/{hoon-DZk8Paai.js → hoon-Dm-fnZxk.js} +1 -1
- package/dist/app/assets/{hpkp-Bf9ZU2kJ.js → hpkp-lkuwmSbZ.js} +1 -1
- package/dist/app/assets/{hsts-CMX9dH_c.js → hsts-Wd4KhVht.js} +1 -1
- package/dist/app/assets/{http-BdPDUUlX.js → http-CmfhFPEg.js} +1 -1
- package/dist/app/assets/{ichigojam-DZWqQfTk.js → ichigojam-Dc2L55jh.js} +1 -1
- package/dist/app/assets/{icon-CSC5VGP_.js → icon-DdCxyxIH.js} +1 -1
- package/dist/app/assets/{icu-message-format-CtRFWyFe.js → icu-message-format-BQYI0sFj.js} +1 -1
- package/dist/app/assets/{idris-D2LDs3co.js → idris-C5tNclWm.js} +1 -1
- package/dist/app/assets/{iecst-kpaa10GT.js → iecst-BKVUYIbF.js} +1 -1
- package/dist/app/assets/{ignore-B6TeQ2cq.js → ignore-CfwJhNgR.js} +1 -1
- package/dist/app/assets/index-3k-bKyOc.js +439 -0
- package/dist/app/assets/index-Ki_i49D-.css +1 -0
- package/dist/app/assets/{inform7-B2DiX5z0.js → inform7-Cdcod1ei.js} +1 -1
- package/dist/app/assets/{ini-CJgz2CJx.js → ini-C2cDeXd9.js} +1 -1
- package/dist/app/assets/{io-C4PjllHD.js → io-DuXAvwXa.js} +1 -1
- package/dist/app/assets/{j-BKSoIQwQ.js → j-BYVASY6X.js} +1 -1
- package/dist/app/assets/{java-CHbVZ6UP.js → java-4VrDHvxX.js} +1 -1
- package/dist/app/assets/{javadoc-CPqAjHoM.js → javadoc-CuF60fip.js} +1 -1
- package/dist/app/assets/{javadoclike-Bs-8xh3H.js → javadoclike-C44_Y4pE.js} +1 -1
- package/dist/app/assets/{javascript-BT_NpjyP.js → javascript-DWYY3Hmb.js} +1 -1
- package/dist/app/assets/{javastacktrace-Drjxr-oB.js → javastacktrace-C1VDqTgi.js} +1 -1
- package/dist/app/assets/{jexl-BxjDgVx9.js → jexl-DeQ9RUDn.js} +1 -1
- package/dist/app/assets/{jolie-BqMpKk0G.js → jolie-BRudN8eg.js} +1 -1
- package/dist/app/assets/{jq-BHUHr0op.js → jq-CtXc1LOh.js} +1 -1
- package/dist/app/assets/{js-extras-D4wvqur3.js → js-extras-CvvdpdSS.js} +1 -1
- package/dist/app/assets/{js-templates-Yv-O3_U6.js → js-templates-M2G0Wqhr.js} +1 -1
- package/dist/app/assets/{jsdoc-OgQO3nf9.js → jsdoc-Bu2t9JLm.js} +1 -1
- package/dist/app/assets/{json-DVZtz_Zz.js → json-Cq-mABJ1.js} +1 -1
- package/dist/app/assets/{json5--f2Givq3.js → json5-4HqEH5T5.js} +1 -1
- package/dist/app/assets/{jsonp-DVGUcHMz.js → jsonp-BEtlh398.js} +1 -1
- package/dist/app/assets/{jsstacktrace-D-yoMr1R.js → jsstacktrace-Dx0Y7B74.js} +1 -1
- package/dist/app/assets/{jsx-C05X4U8h.js → jsx-DsbRpy7E.js} +1 -1
- package/dist/app/assets/{julia-DgnoOAdD.js → julia-DcsLQWYM.js} +1 -1
- package/dist/app/assets/{keepalived-JD08MytA.js → keepalived-Dv8pDJFo.js} +1 -1
- package/dist/app/assets/{keyman-azrDuGNy.js → keyman-Ci2jdsqC.js} +1 -1
- package/dist/app/assets/{kotlin-Bq9qLl8S.js → kotlin-SayKmA5u.js} +1 -1
- package/dist/app/assets/{kumir-BaIa8IWz.js → kumir-DMWOjK8x.js} +1 -1
- package/dist/app/assets/{kusto-DQhcCWAA.js → kusto-aI0GRJrT.js} +1 -1
- package/dist/app/assets/{latex-qLbFVwxL.js → latex-DTp_-VF9.js} +1 -1
- package/dist/app/assets/{latte-BIpeH7ye.js → latte-LZMPGx1E.js} +1 -1
- package/dist/app/assets/{less-DCAm2XKc.js → less-gB0H6bSD.js} +1 -1
- package/dist/app/assets/{lilypond-URqh-pba.js → lilypond-F37QUedl.js} +1 -1
- package/dist/app/assets/{liquid-BdNjEMRj.js → liquid-D--Wm3ha.js} +1 -1
- package/dist/app/assets/{lisp-DdMDpbFO.js → lisp-DIM2rPYE.js} +1 -1
- package/dist/app/assets/{livescript-YUBYodrC.js → livescript-BXTz0GVS.js} +1 -1
- package/dist/app/assets/{llvm-BdNAFhzC.js → llvm-ao5q-dod.js} +1 -1
- package/dist/app/assets/{log-BdA3w0be.js → log-DSdp1PUj.js} +1 -1
- package/dist/app/assets/{lolcode-BqnlYMBu.js → lolcode-DTgLBwjE.js} +1 -1
- package/dist/app/assets/{lua-Z_Qxo3dR.js → lua-D1IySTDW.js} +1 -1
- package/dist/app/assets/{magma-rsT2u-lT.js → magma-By0NJTpR.js} +1 -1
- package/dist/app/assets/{makefile-CrrMmdVS.js → makefile-CGoRDnpf.js} +1 -1
- package/dist/app/assets/{markdown-B5hh6ods.js → markdown-D1L-HQf5.js} +1 -1
- package/dist/app/assets/{markup-BiaBQ4Go.js → markup-raYrASfk.js} +1 -1
- package/dist/app/assets/{markup-templating-CbtO_SGF.js → markup-templating-CssRUGmY.js} +1 -1
- package/dist/app/assets/{matlab-BXD-ZhVV.js → matlab-Bkpr6UVS.js} +1 -1
- package/dist/app/assets/{maxscript-NZobaPB9.js → maxscript-BqOK2v7p.js} +1 -1
- package/dist/app/assets/{mel-BsjN8CzC.js → mel-CH03lWHq.js} +1 -1
- package/dist/app/assets/{mermaid-B5UiXAS_.js → mermaid-BN5SfVaW.js} +1 -1
- package/dist/app/assets/{mizar-CuUsPtTq.js → mizar-B5EFFzYR.js} +1 -1
- package/dist/app/assets/{mongodb-D3GB0bU8.js → mongodb-6kvQytJm.js} +1 -1
- package/dist/app/assets/{monkey-CK-Syk83.js → monkey-CrULcDcp.js} +1 -1
- package/dist/app/assets/{moonscript-CxgNQMDf.js → moonscript-BUk4hr1Y.js} +1 -1
- package/dist/app/assets/{n1ql-B0gvukgr.js → n1ql-BD0zH2HW.js} +1 -1
- package/dist/app/assets/{n4js-CSiVWG8j.js → n4js-BmHkGn_8.js} +1 -1
- package/dist/app/assets/{nand2tetris-hdl-BvvEGqNK.js → nand2tetris-hdl-B8Jd5FCr.js} +1 -1
- package/dist/app/assets/{naniscript-45A_ER_d.js → naniscript-B6Iuqu44.js} +1 -1
- package/dist/app/assets/{nasm-CyYsQrbV.js → nasm-CenqrlGz.js} +1 -1
- package/dist/app/assets/{neon-BiKXlKLm.js → neon-BlyFo4oH.js} +1 -1
- package/dist/app/assets/{nevod-8Kv8aVJh.js → nevod-FI2_D4MV.js} +1 -1
- package/dist/app/assets/{nginx-Cqo-dGUO.js → nginx-vOnlcjjK.js} +1 -1
- package/dist/app/assets/{nim-Cy_EjBaO.js → nim-BTBcND8I.js} +1 -1
- package/dist/app/assets/{nix-BmTy7l9S.js → nix-CxWC3x_A.js} +1 -1
- package/dist/app/assets/{nsis-XTneXqGR.js → nsis-DWRIAzZl.js} +1 -1
- package/dist/app/assets/{objectivec-Dmg9RHOg.js → objectivec-DnNYqiEV.js} +1 -1
- package/dist/app/assets/{ocaml-CWRJM2tE.js → ocaml-MWcE4wPG.js} +1 -1
- package/dist/app/assets/{opencl-D8_U7ZHs.js → opencl-CEoyfv1f.js} +1 -1
- package/dist/app/assets/{openqasm--Tw4PlEa.js → openqasm-B9J2Sj4l.js} +1 -1
- package/dist/app/assets/{oz-D-aUSxpN.js → oz-Q6fkizOZ.js} +1 -1
- package/dist/app/assets/{parigp-MtrGmHWf.js → parigp-qViHuHAI.js} +1 -1
- package/dist/app/assets/{parser-h_-AW9-T.js → parser-D1TDrUDK.js} +1 -1
- package/dist/app/assets/{pascal-DAMDGrIq.js → pascal-C_GcAzVz.js} +1 -1
- package/dist/app/assets/{pascaligo-TT68AZ0R.js → pascaligo-BGECHz22.js} +1 -1
- package/dist/app/assets/{pcaxis-BZabfhMp.js → pcaxis-5_0lQ0o8.js} +1 -1
- package/dist/app/assets/{peoplecode-8Z4ArX58.js → peoplecode-C-_cyguZ.js} +1 -1
- package/dist/app/assets/{perl-Tf2L_iWK.js → perl-Bhu_9hey.js} +1 -1
- package/dist/app/assets/{php-Citv4wvI.js → php-CUhDCFAS.js} +1 -1
- package/dist/app/assets/{php-extras-CXdnzF7N.js → php-extras-DSKZN6SK.js} +1 -1
- package/dist/app/assets/{phpdoc-D6tsAiH4.js → phpdoc-C1FLn7tF.js} +1 -1
- package/dist/app/assets/{plsql-DJtQNxFM.js → plsql-DMfpGYGl.js} +1 -1
- package/dist/app/assets/{powerquery-CP9sQCLl.js → powerquery-BRhf1hs3.js} +1 -1
- package/dist/app/assets/{powershell-CKCDLWVv.js → powershell-CRaHW94B.js} +1 -1
- package/dist/app/assets/{processing-D4muvaDA.js → processing-I8nRKQlO.js} +1 -1
- package/dist/app/assets/{prolog-DqCpmAF7.js → prolog-FrUePJiK.js} +1 -1
- package/dist/app/assets/{promql-DNdbBZJb.js → promql-BvAq16Ge.js} +1 -1
- package/dist/app/assets/{properties-DQUwwb8x.js → properties-DbxGMSRW.js} +1 -1
- package/dist/app/assets/{protobuf-BNe-4-Ln.js → protobuf-DrIGvjWL.js} +1 -1
- package/dist/app/assets/{psl-DHT7D5Zu.js → psl-0HKrjoj1.js} +1 -1
- package/dist/app/assets/{pug-BYrNe-ek.js → pug-CxH9bsi7.js} +1 -1
- package/dist/app/assets/{puppet-IzXU2QnL.js → puppet-DHgc1gZg.js} +1 -1
- package/dist/app/assets/{pure-C8utNRFH.js → pure-B0kLfpMx.js} +1 -1
- package/dist/app/assets/{purebasic-BLFLiyfl.js → purebasic-Ca1sSC6z.js} +1 -1
- package/dist/app/assets/{purescript-CGkGiDmC.js → purescript-BQK7br_N.js} +1 -1
- package/dist/app/assets/{q-Ch-_c3XY.js → q-DwDhLegJ.js} +1 -1
- package/dist/app/assets/{qml-BCtzfHKg.js → qml-CtbldBP6.js} +1 -1
- package/dist/app/assets/{qore-6XNyhUtr.js → qore-D3LZb6ma.js} +1 -1
- package/dist/app/assets/{qsharp-KFIiBs-v.js → qsharp-CiLCdqjv.js} +1 -1
- package/dist/app/assets/{r-VHCTkPpx.js → r-Dilam18q.js} +1 -1
- package/dist/app/assets/{racket-1qTUuxaw.js → racket-BBckdZP5.js} +1 -1
- package/dist/app/assets/{reason-c3DD7ovu.js → reason-C20wa4Ng.js} +1 -1
- package/dist/app/assets/{regex-CKlhWzhL.js → regex-COQGBYpa.js} +1 -1
- package/dist/app/assets/{rego-B6Roc-f_.js → rego-pKEk3RLD.js} +1 -1
- package/dist/app/assets/{renpy-B8vDLdIS.js → renpy-CDmk4rPI.js} +1 -1
- package/dist/app/assets/{rest-CbuvO7de.js → rest-Dl5zGTqN.js} +1 -1
- package/dist/app/assets/{rip-sVuuKWbv.js → rip-Dn6GOHWS.js} +1 -1
- package/dist/app/assets/{roboconf-BidW62eI.js → roboconf-BBJnM0BC.js} +1 -1
- package/dist/app/assets/{robotframework-Cd11Dy3l.js → robotframework-B3glKH4d.js} +1 -1
- package/dist/app/assets/{ruby-BMwY3KVp.js → ruby-BQGh_6Rr.js} +1 -1
- package/dist/app/assets/{rust-DglFfUim.js → rust-QlUGh2de.js} +1 -1
- package/dist/app/assets/{sas-BCWGGNZo.js → sas-BDC68F8y.js} +1 -1
- package/dist/app/assets/{sass-Chbcrpqb.js → sass-DieDF6XQ.js} +1 -1
- package/dist/app/assets/{scala-ClwErATt.js → scala-D3MUhHYj.js} +1 -1
- package/dist/app/assets/{scheme-mqaymmTS.js → scheme-BGgE-kqm.js} +1 -1
- package/dist/app/assets/{scss-BBhxumOr.js → scss--_H8DdDE.js} +1 -1
- package/dist/app/assets/{shell-session-CuI4Rdf4.js → shell-session-LGnbrToj.js} +1 -1
- package/dist/app/assets/{smali-BoavhNXE.js → smali-CBlokkez.js} +1 -1
- package/dist/app/assets/{smalltalk-WiUFOepn.js → smalltalk-BbGkP-W2.js} +1 -1
- package/dist/app/assets/{smarty-BP4mWIwR.js → smarty-HZnEokqM.js} +1 -1
- package/dist/app/assets/{sml-AFqGvMHc.js → sml-D3kN5fHv.js} +1 -1
- package/dist/app/assets/{solidity-D5h9njh8.js → solidity-COzqk2SX.js} +1 -1
- package/dist/app/assets/{solution-file-BLK1IrUz.js → solution-file-B_WMCfok.js} +1 -1
- package/dist/app/assets/{soy-Cf8u5dko.js → soy-BnjJHZA_.js} +1 -1
- package/dist/app/assets/{sparql-C9KxnH23.js → sparql-B5TBM1ys.js} +1 -1
- package/dist/app/assets/{splunk-spl-BxUXtsOD.js → splunk-spl-B2w0z96G.js} +1 -1
- package/dist/app/assets/{sqf-qlV7g48i.js → sqf-XPpbNZWG.js} +1 -1
- package/dist/app/assets/{sql-C-p1pos9.js → sql-BdoHQUvu.js} +1 -1
- package/dist/app/assets/{squirrel-PX1Grtap.js → squirrel-C7PSbqa8.js} +1 -1
- package/dist/app/assets/{stan-zV2a82m3.js → stan-j2SrNXay.js} +1 -1
- package/dist/app/assets/{stylus-BrnUo9zO.js → stylus-B4ESB7LK.js} +1 -1
- package/dist/app/assets/{swift-Byy18r0p.js → swift-0REuIxse.js} +1 -1
- package/dist/app/assets/{systemd-BtqJkXRf.js → systemd-C-jON-S5.js} +1 -1
- package/dist/app/assets/{t4-cs-C5jp0bkn.js → t4-cs-73fI4ZnY.js} +1 -1
- package/dist/app/assets/{t4-templating-Bmu7FZgm.js → t4-templating-B7K5zZjl.js} +1 -1
- package/dist/app/assets/{t4-vb-CczRCjMn.js → t4-vb-nmeCn59t.js} +1 -1
- package/dist/app/assets/{tap-DUhOrRiK.js → tap-CC3qoO-h.js} +1 -1
- package/dist/app/assets/{tcl-BGDNQuGV.js → tcl-CXW6dWdJ.js} +1 -1
- package/dist/app/assets/{textile-BGym3KVm.js → textile-CcZgymJI.js} +1 -1
- package/dist/app/assets/{toml-h2DQ44P0.js → toml-Bt-KwXSX.js} +1 -1
- package/dist/app/assets/{tremor-CwHv-OnP.js → tremor-CfkeSZOn.js} +1 -1
- package/dist/app/assets/{tt2-qgYZXJPR.js → tt2-VjO-nd3t.js} +1 -1
- package/dist/app/assets/{turtle-Czr_CW8r.js → turtle-C7lex_1P.js} +1 -1
- package/dist/app/assets/{twig-Bq_oAHcm.js → twig-ydMCwYBK.js} +1 -1
- package/dist/app/assets/{typescript-mXKzIg0y.js → typescript-BgbE9enz.js} +1 -1
- package/dist/app/assets/{typoscript-CLdCbPty.js → typoscript-mPjPihGb.js} +1 -1
- package/dist/app/assets/{unrealscript-CdYUVWsh.js → unrealscript-B1h3FIp7.js} +1 -1
- package/dist/app/assets/{uorazor-DxNXLQYo.js → uorazor-BixEY3TF.js} +1 -1
- package/dist/app/assets/{uri-DYk5U2Tx.js → uri-a9CNoVTl.js} +1 -1
- package/dist/app/assets/{v-ZpnMXAp_.js → v-Bun8Oo4V.js} +1 -1
- package/dist/app/assets/{vala-hVJU5BfN.js → vala-Yh7IL00A.js} +1 -1
- package/dist/app/assets/{vbnet-CmY51d5G.js → vbnet-D1bws4TN.js} +1 -1
- package/dist/app/assets/{velocity-CsvRt2hb.js → velocity-BTBe_YdS.js} +1 -1
- package/dist/app/assets/{verilog-CPo8f42m.js → verilog-CZb0BmwQ.js} +1 -1
- package/dist/app/assets/{vhdl-WKsKMPi0.js → vhdl-GveK8MNv.js} +1 -1
- package/dist/app/assets/{vim-BgsS8AXO.js → vim-BFnGQW9p.js} +1 -1
- package/dist/app/assets/{visual-basic-CufJPq0T.js → visual-basic-C6IoFdCy.js} +1 -1
- package/dist/app/assets/{warpscript-BMGdLyX8.js → warpscript-BhRK7JpJ.js} +1 -1
- package/dist/app/assets/{wasm-BwoGQtY0.js → wasm-BPlRsQZE.js} +1 -1
- package/dist/app/assets/{web-idl-CQh6nLUF.js → web-idl-DsR59OqK.js} +1 -1
- package/dist/app/assets/{wiki-BBUQmhnv.js → wiki-CqKbsRaB.js} +1 -1
- package/dist/app/assets/{wolfram-TAz_4SnR.js → wolfram-DBwl_BKC.js} +1 -1
- package/dist/app/assets/{wren-CVPXcwur.js → wren-BiiMWCe5.js} +1 -1
- package/dist/app/assets/{xeora-DFQOGccv.js → xeora-BAHjHPpy.js} +1 -1
- package/dist/app/assets/{xml-doc-DU62FPEw.js → xml-doc-C7XMC-Tu.js} +1 -1
- package/dist/app/assets/{xojo-CRo0kja2.js → xojo-B8_jJVJy.js} +1 -1
- package/dist/app/assets/{xquery-lrNjl9FO.js → xquery-C4b31bTA.js} +1 -1
- package/dist/app/assets/{yaml-PqToDf_Q.js → yaml-BZKzmGBJ.js} +1 -1
- package/dist/app/assets/{yang-BQDTSngB.js → yang-Bbsnlksx.js} +1 -1
- package/dist/app/assets/{zig-D_9EoT5C.js → zig-BnOm7PBz.js} +1 -1
- package/dist/app/index.html +2 -2
- package/dist/index.cjs +387 -71
- package/dist/index.css +0 -36
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +394 -72
- package/package.json +2 -2
- package/dist/app/assets/index-C9w4yW8p.js +0 -438
- package/dist/app/assets/index-DcB156i0.css +0 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/components/chat.tsx
|
|
2
2
|
import * as React18 from "react";
|
|
3
|
-
import { FileText as FileText2, Loader2 as Loader22, Pencil as Pencil3, RefreshCw as RefreshCw2, X as X2 } from "lucide-react";
|
|
3
|
+
import { ArrowDown, FileText as FileText2, Loader2 as Loader22, Pencil as Pencil3, RefreshCw as RefreshCw2, X as X2 } from "lucide-react";
|
|
4
4
|
|
|
5
5
|
// src/lib/utils.ts
|
|
6
6
|
import { clsx } from "clsx";
|
|
@@ -26,6 +26,15 @@ function createMessageId() {
|
|
|
26
26
|
return globalThis.crypto?.randomUUID?.() ?? `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
// src/lib/scroll.ts
|
|
30
|
+
var BOTTOM_FOLLOW_THRESHOLD_PX = 48;
|
|
31
|
+
function getDistanceFromBottom(element) {
|
|
32
|
+
return Math.max(0, element.scrollHeight - element.clientHeight - element.scrollTop);
|
|
33
|
+
}
|
|
34
|
+
function isNearBottom(element, threshold = BOTTOM_FOLLOW_THRESHOLD_PX) {
|
|
35
|
+
return getDistanceFromBottom(element) <= threshold;
|
|
36
|
+
}
|
|
37
|
+
|
|
29
38
|
// src/providers/Stream.tsx
|
|
30
39
|
import {
|
|
31
40
|
createContext as createContext2,
|
|
@@ -48,7 +57,7 @@ import { useContext, useEffect as useEffect2, useRef as useRef2 } from "react";
|
|
|
48
57
|
|
|
49
58
|
// src/providers/ParentMessenger.tsx
|
|
50
59
|
import { createContext, useCallback, useEffect, useMemo, useRef } from "react";
|
|
51
|
-
import { STATE_VARIABLE_HUMAN } from "@xpert-ai/chatkit-types";
|
|
60
|
+
import { STATE_VARIABLE_HUMAN as STATE_VARIABLE_HUMAN2 } from "@xpert-ai/chatkit-types";
|
|
52
61
|
|
|
53
62
|
// src/hooks/useStream.ts
|
|
54
63
|
var streamRef = { current: null };
|
|
@@ -62,6 +71,46 @@ function useStreamManager() {
|
|
|
62
71
|
};
|
|
63
72
|
}
|
|
64
73
|
|
|
74
|
+
// src/lib/request-options.ts
|
|
75
|
+
import {
|
|
76
|
+
STATE_VARIABLE_HUMAN
|
|
77
|
+
} from "@xpert-ai/chatkit-types";
|
|
78
|
+
function isRecord(value) {
|
|
79
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
80
|
+
}
|
|
81
|
+
function resolveHumanStateValue(value) {
|
|
82
|
+
const human = value?.[STATE_VARIABLE_HUMAN];
|
|
83
|
+
return isRecord(human) ? human : {};
|
|
84
|
+
}
|
|
85
|
+
function buildInjectedRequestOptions(input) {
|
|
86
|
+
const defaultState = input.defaults?.state;
|
|
87
|
+
const explicitState = input.state;
|
|
88
|
+
const defaultContext = input.defaults?.context;
|
|
89
|
+
const explicitContext = input.context;
|
|
90
|
+
const mergedContext = {
|
|
91
|
+
...defaultContext ?? {},
|
|
92
|
+
...explicitContext ?? {}
|
|
93
|
+
};
|
|
94
|
+
const hasContext = Object.keys(mergedContext).length > 0;
|
|
95
|
+
const mergedState = {
|
|
96
|
+
...defaultState ?? {},
|
|
97
|
+
...explicitState ?? {}
|
|
98
|
+
};
|
|
99
|
+
const mergedHumanState = {
|
|
100
|
+
...resolveHumanStateValue(defaultState),
|
|
101
|
+
...resolveHumanStateValue(explicitState),
|
|
102
|
+
...input.humanInput ?? {}
|
|
103
|
+
};
|
|
104
|
+
if (Object.keys(mergedHumanState).length > 0) {
|
|
105
|
+
mergedState[STATE_VARIABLE_HUMAN] = mergedHumanState;
|
|
106
|
+
}
|
|
107
|
+
const hasState = Object.keys(mergedState).length > 0;
|
|
108
|
+
return {
|
|
109
|
+
...hasState ? { state: mergedState } : {},
|
|
110
|
+
...hasContext ? { context: mergedContext } : {}
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
65
114
|
// src/providers/ParentMessenger.tsx
|
|
66
115
|
import { jsx } from "react/jsx-runtime";
|
|
67
116
|
var handledSendUserMessageNonces = /* @__PURE__ */ new Set();
|
|
@@ -90,6 +139,7 @@ function ParentMessengerProvider({
|
|
|
90
139
|
/* @__PURE__ */ new Map()
|
|
91
140
|
);
|
|
92
141
|
const onSetOptionsHandlersRef = useRef(/* @__PURE__ */ new Set());
|
|
142
|
+
const latestOptionsRef = useRef(null);
|
|
93
143
|
const isParentAvailable = useMemo(() => {
|
|
94
144
|
return typeof window !== "undefined" && window.parent !== window;
|
|
95
145
|
}, []);
|
|
@@ -132,27 +182,29 @@ function ParentMessengerProvider({
|
|
|
132
182
|
handledSendUserMessageEvents.add(event);
|
|
133
183
|
}
|
|
134
184
|
const params = payload.data;
|
|
135
|
-
const prompt = (params.text ?? params.state?.[
|
|
185
|
+
const prompt = (params.text ?? params.state?.[STATE_VARIABLE_HUMAN2]?.input ?? "").trim();
|
|
136
186
|
const newMessage = {
|
|
137
187
|
id: createMessageId(),
|
|
138
188
|
type: "human",
|
|
139
189
|
content: prompt
|
|
140
190
|
};
|
|
191
|
+
const requestOptions = buildInjectedRequestOptions({
|
|
192
|
+
defaults: latestOptionsRef.current?.request,
|
|
193
|
+
state: params.state,
|
|
194
|
+
humanInput: {
|
|
195
|
+
input: prompt
|
|
196
|
+
}
|
|
197
|
+
});
|
|
141
198
|
streamRef2.current?.submit(
|
|
142
199
|
{
|
|
143
200
|
input: {
|
|
144
201
|
input: prompt
|
|
145
202
|
},
|
|
146
|
-
state: {
|
|
147
|
-
...params.state || {},
|
|
148
|
-
[STATE_VARIABLE_HUMAN]: {
|
|
149
|
-
...params.state?.[STATE_VARIABLE_HUMAN] || {},
|
|
150
|
-
input: prompt
|
|
151
|
-
}
|
|
152
|
-
}
|
|
203
|
+
...requestOptions.state ? { state: requestOptions.state } : {}
|
|
153
204
|
},
|
|
154
205
|
{
|
|
155
206
|
newThread: params.newThread,
|
|
207
|
+
...requestOptions.context ? { context: requestOptions.context } : {},
|
|
156
208
|
optimisticValues: (prev) => {
|
|
157
209
|
const prevMessages = prev?.messages ?? [];
|
|
158
210
|
return { ...prev, messages: [...prevMessages, newMessage] };
|
|
@@ -165,6 +217,7 @@ function ParentMessengerProvider({
|
|
|
165
217
|
return;
|
|
166
218
|
}
|
|
167
219
|
if (payload.type == "command" && payload.command === "onSetOptions") {
|
|
220
|
+
latestOptionsRef.current = payload.data ?? null;
|
|
168
221
|
if (onSetOptionsHandlersRef.current.size > 0) {
|
|
169
222
|
onSetOptionsHandlersRef.current.forEach((handler2) => {
|
|
170
223
|
handler2(payload.data);
|
|
@@ -274,10 +327,40 @@ function useParentMessenger({ onSetOptions } = {}) {
|
|
|
274
327
|
return messenger;
|
|
275
328
|
}
|
|
276
329
|
|
|
330
|
+
// src/lib/thread-context-usage.ts
|
|
331
|
+
function normalizeContextUsageNumber(value) {
|
|
332
|
+
if (typeof value === "number" && Number.isFinite(value) && value >= 0) {
|
|
333
|
+
return Math.floor(value);
|
|
334
|
+
}
|
|
335
|
+
if (typeof value === "string") {
|
|
336
|
+
const parsed = Number.parseFloat(value);
|
|
337
|
+
if (Number.isFinite(parsed) && parsed >= 0) {
|
|
338
|
+
return Math.floor(parsed);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
return null;
|
|
342
|
+
}
|
|
343
|
+
function getThreadContextUsage(state, agentKey) {
|
|
344
|
+
if (!agentKey) return null;
|
|
345
|
+
return state[agentKey] ?? null;
|
|
346
|
+
}
|
|
347
|
+
function getThreadContextUsageTotalTokens(event) {
|
|
348
|
+
return normalizeContextUsageNumber(event?.usage?.totalTokens);
|
|
349
|
+
}
|
|
350
|
+
function resolveUsedContextSize(options) {
|
|
351
|
+
const realtimeUsedTokens = getThreadContextUsageTotalTokens(
|
|
352
|
+
options.realtimeUsage
|
|
353
|
+
);
|
|
354
|
+
if (realtimeUsedTokens != null) {
|
|
355
|
+
return realtimeUsedTokens;
|
|
356
|
+
}
|
|
357
|
+
return normalizeContextUsageNumber(options.fallbackUsedTokens) ?? 0;
|
|
358
|
+
}
|
|
359
|
+
|
|
277
360
|
// src/providers/Stream.tsx
|
|
278
361
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
279
362
|
var StreamContext = createContext2(void 0);
|
|
280
|
-
var defaultApiUrl = import.meta.env.VITE_XPERTAI_API_URL ?? "https://api.
|
|
363
|
+
var defaultApiUrl = import.meta.env.VITE_XPERTAI_API_URL ?? "https://api.xpertai.cn/api/ai";
|
|
281
364
|
var useStreamContext = () => {
|
|
282
365
|
const context = useContext2(StreamContext);
|
|
283
366
|
if (!context) {
|
|
@@ -408,6 +491,7 @@ var en_US_default = {
|
|
|
408
491
|
loadingThread: "Loading thread...",
|
|
409
492
|
stop: "Stop",
|
|
410
493
|
send: "Send message",
|
|
494
|
+
scrollToBottom: "Scroll to bottom",
|
|
411
495
|
retryUpload: "Retry upload",
|
|
412
496
|
poweredBy: "Powered by Xpert AI",
|
|
413
497
|
errors: {
|
|
@@ -466,6 +550,7 @@ var zh_CN_default = {
|
|
|
466
550
|
loadingThread: "\u6B63\u5728\u52A0\u8F7D\u7EBF\u7A0B...",
|
|
467
551
|
stop: "\u505C\u6B62",
|
|
468
552
|
send: "\u53D1\u9001\u6D88\u606F",
|
|
553
|
+
scrollToBottom: "\u56DE\u5230\u5E95\u90E8",
|
|
469
554
|
retryUpload: "\u91CD\u65B0\u4E0A\u4F20",
|
|
470
555
|
poweredBy: "\u7531 Xpert AI \u9A71\u52A8",
|
|
471
556
|
errors: {
|
|
@@ -1435,7 +1520,11 @@ import ReactMarkdown from "react-markdown";
|
|
|
1435
1520
|
import remarkGfm from "remark-gfm";
|
|
1436
1521
|
import rehypeKatex from "rehype-katex";
|
|
1437
1522
|
import remarkMath from "remark-math";
|
|
1438
|
-
import {
|
|
1523
|
+
import {
|
|
1524
|
+
Children,
|
|
1525
|
+
memo,
|
|
1526
|
+
useState as useState5
|
|
1527
|
+
} from "react";
|
|
1439
1528
|
import { CheckIcon, CopyIcon } from "lucide-react";
|
|
1440
1529
|
|
|
1441
1530
|
// src/components/thread/syntax-highlighter.tsx
|
|
@@ -1564,6 +1653,12 @@ TooltipIconButton.displayName = "TooltipIconButton";
|
|
|
1564
1653
|
// src/components/thread/markdown-text.tsx
|
|
1565
1654
|
import "katex/dist/katex.min.css";
|
|
1566
1655
|
import { Fragment as Fragment2, jsx as jsx17, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1656
|
+
var getTextContent = (children) => Children.toArray(children).map((child) => {
|
|
1657
|
+
if (typeof child === "string" || typeof child === "number") {
|
|
1658
|
+
return String(child);
|
|
1659
|
+
}
|
|
1660
|
+
return "";
|
|
1661
|
+
}).join("");
|
|
1567
1662
|
var useCopyToClipboard = ({
|
|
1568
1663
|
copiedDuration = 3e3
|
|
1569
1664
|
} = {}) => {
|
|
@@ -1600,7 +1695,7 @@ var CodeHeader = ({ language, code }) => {
|
|
|
1600
1695
|
] });
|
|
1601
1696
|
};
|
|
1602
1697
|
var defaultComponents = {
|
|
1603
|
-
h1: ({ className, ...props }) => /* @__PURE__ */ jsx17(
|
|
1698
|
+
h1: ({ className, node: _node, ...props }) => /* @__PURE__ */ jsx17(
|
|
1604
1699
|
"h1",
|
|
1605
1700
|
{
|
|
1606
1701
|
className: cn(
|
|
@@ -1610,7 +1705,7 @@ var defaultComponents = {
|
|
|
1610
1705
|
...props
|
|
1611
1706
|
}
|
|
1612
1707
|
),
|
|
1613
|
-
h2: ({ className, ...props }) => /* @__PURE__ */ jsx17(
|
|
1708
|
+
h2: ({ className, node: _node, ...props }) => /* @__PURE__ */ jsx17(
|
|
1614
1709
|
"h2",
|
|
1615
1710
|
{
|
|
1616
1711
|
className: cn(
|
|
@@ -1620,7 +1715,7 @@ var defaultComponents = {
|
|
|
1620
1715
|
...props
|
|
1621
1716
|
}
|
|
1622
1717
|
),
|
|
1623
|
-
h3: ({ className, ...props }) => /* @__PURE__ */ jsx17(
|
|
1718
|
+
h3: ({ className, node: _node, ...props }) => /* @__PURE__ */ jsx17(
|
|
1624
1719
|
"h3",
|
|
1625
1720
|
{
|
|
1626
1721
|
className: cn(
|
|
@@ -1630,7 +1725,7 @@ var defaultComponents = {
|
|
|
1630
1725
|
...props
|
|
1631
1726
|
}
|
|
1632
1727
|
),
|
|
1633
|
-
h4: ({ className, ...props }) => /* @__PURE__ */ jsx17(
|
|
1728
|
+
h4: ({ className, node: _node, ...props }) => /* @__PURE__ */ jsx17(
|
|
1634
1729
|
"h4",
|
|
1635
1730
|
{
|
|
1636
1731
|
className: cn(
|
|
@@ -1640,7 +1735,7 @@ var defaultComponents = {
|
|
|
1640
1735
|
...props
|
|
1641
1736
|
}
|
|
1642
1737
|
),
|
|
1643
|
-
h5: ({ className, ...props }) => /* @__PURE__ */ jsx17(
|
|
1738
|
+
h5: ({ className, node: _node, ...props }) => /* @__PURE__ */ jsx17(
|
|
1644
1739
|
"h5",
|
|
1645
1740
|
{
|
|
1646
1741
|
className: cn(
|
|
@@ -1650,21 +1745,21 @@ var defaultComponents = {
|
|
|
1650
1745
|
...props
|
|
1651
1746
|
}
|
|
1652
1747
|
),
|
|
1653
|
-
h6: ({ className, ...props }) => /* @__PURE__ */ jsx17(
|
|
1748
|
+
h6: ({ className, node: _node, ...props }) => /* @__PURE__ */ jsx17(
|
|
1654
1749
|
"h6",
|
|
1655
1750
|
{
|
|
1656
1751
|
className: cn("my-4 font-semibold first:mt-0 last:mb-0", className),
|
|
1657
1752
|
...props
|
|
1658
1753
|
}
|
|
1659
1754
|
),
|
|
1660
|
-
p: ({ className, ...props }) => /* @__PURE__ */ jsx17(
|
|
1755
|
+
p: ({ className, node: _node, ...props }) => /* @__PURE__ */ jsx17(
|
|
1661
1756
|
"p",
|
|
1662
1757
|
{
|
|
1663
1758
|
className: cn("mt-5 mb-5 leading-7 first:mt-0 last:mb-0", className),
|
|
1664
1759
|
...props
|
|
1665
1760
|
}
|
|
1666
1761
|
),
|
|
1667
|
-
a: ({ className, ...props }) => /* @__PURE__ */ jsx17(
|
|
1762
|
+
a: ({ className, node: _node, ...props }) => /* @__PURE__ */ jsx17(
|
|
1668
1763
|
"a",
|
|
1669
1764
|
{
|
|
1670
1765
|
className: cn(
|
|
@@ -1676,35 +1771,46 @@ var defaultComponents = {
|
|
|
1676
1771
|
...props
|
|
1677
1772
|
}
|
|
1678
1773
|
),
|
|
1679
|
-
blockquote: ({
|
|
1774
|
+
blockquote: ({
|
|
1775
|
+
className,
|
|
1776
|
+
node: _node,
|
|
1777
|
+
...props
|
|
1778
|
+
}) => /* @__PURE__ */ jsx17(
|
|
1680
1779
|
"blockquote",
|
|
1681
1780
|
{
|
|
1682
|
-
className: cn(
|
|
1781
|
+
className: cn(
|
|
1782
|
+
"border-l-4 border-border pl-6 italic text-muted-foreground",
|
|
1783
|
+
className
|
|
1784
|
+
),
|
|
1683
1785
|
...props
|
|
1684
1786
|
}
|
|
1685
1787
|
),
|
|
1686
|
-
ul: ({ className, ...props }) => /* @__PURE__ */ jsx17(
|
|
1788
|
+
ul: ({ className, node: _node, ...props }) => /* @__PURE__ */ jsx17(
|
|
1687
1789
|
"ul",
|
|
1688
1790
|
{
|
|
1689
1791
|
className: cn("my-5 list-outside list-disc pl-6 [&>li]:mt-2", className),
|
|
1690
1792
|
...props
|
|
1691
1793
|
}
|
|
1692
1794
|
),
|
|
1693
|
-
ol: ({ className, ...props }) => /* @__PURE__ */ jsx17(
|
|
1795
|
+
ol: ({ className, node: _node, ...props }) => /* @__PURE__ */ jsx17(
|
|
1694
1796
|
"ol",
|
|
1695
1797
|
{
|
|
1696
1798
|
className: cn("my-5 list-outside list-decimal pl-8 [&>li]:mt-2", className),
|
|
1697
1799
|
...props
|
|
1698
1800
|
}
|
|
1699
1801
|
),
|
|
1700
|
-
hr: ({ className, ...props }) => /* @__PURE__ */ jsx17(
|
|
1802
|
+
hr: ({ className, node: _node, ...props }) => /* @__PURE__ */ jsx17(
|
|
1701
1803
|
"hr",
|
|
1702
1804
|
{
|
|
1703
1805
|
className: cn("my-5 border-b", className),
|
|
1704
1806
|
...props
|
|
1705
1807
|
}
|
|
1706
1808
|
),
|
|
1707
|
-
table: ({
|
|
1809
|
+
table: ({
|
|
1810
|
+
className,
|
|
1811
|
+
node: _node,
|
|
1812
|
+
...props
|
|
1813
|
+
}) => /* @__PURE__ */ jsx17(
|
|
1708
1814
|
"table",
|
|
1709
1815
|
{
|
|
1710
1816
|
className: cn(
|
|
@@ -1714,48 +1820,48 @@ var defaultComponents = {
|
|
|
1714
1820
|
...props
|
|
1715
1821
|
}
|
|
1716
1822
|
),
|
|
1717
|
-
th: ({ className, ...props }) => /* @__PURE__ */ jsx17(
|
|
1823
|
+
th: ({ className, node: _node, ...props }) => /* @__PURE__ */ jsx17(
|
|
1718
1824
|
"th",
|
|
1719
1825
|
{
|
|
1720
1826
|
className: cn(
|
|
1721
|
-
"bg-muted px-4 py-2 text-left font-bold first:rounded-tl-lg last:rounded-tr-lg [&[align=center]]:text-center [&[align=right]]:text-right",
|
|
1827
|
+
"bg-muted border-border border-y border-l px-4 py-2 text-left font-bold first:rounded-tl-lg last:rounded-tr-lg last:border-r [&[align=center]]:text-center [&[align=right]]:text-right",
|
|
1722
1828
|
className
|
|
1723
1829
|
),
|
|
1724
1830
|
...props
|
|
1725
1831
|
}
|
|
1726
1832
|
),
|
|
1727
|
-
td: ({ className, ...props }) => /* @__PURE__ */ jsx17(
|
|
1833
|
+
td: ({ className, node: _node, ...props }) => /* @__PURE__ */ jsx17(
|
|
1728
1834
|
"td",
|
|
1729
1835
|
{
|
|
1730
1836
|
className: cn(
|
|
1731
|
-
"border-b border-l px-4 py-2 text-left last:border-r [&[align=center]]:text-center [&[align=right]]:text-right",
|
|
1837
|
+
"border-border border-b border-l px-4 py-2 text-left last:border-r [&[align=center]]:text-center [&[align=right]]:text-right",
|
|
1732
1838
|
className
|
|
1733
1839
|
),
|
|
1734
1840
|
...props
|
|
1735
1841
|
}
|
|
1736
1842
|
),
|
|
1737
|
-
tr: ({ className, ...props }) => /* @__PURE__ */ jsx17(
|
|
1843
|
+
tr: ({ className, node: _node, ...props }) => /* @__PURE__ */ jsx17(
|
|
1738
1844
|
"tr",
|
|
1739
1845
|
{
|
|
1740
1846
|
className: cn(
|
|
1741
|
-
"m-0
|
|
1847
|
+
"m-0 p-0 even:bg-muted/50 [&:last-child>td:first-child]:rounded-bl-lg [&:last-child>td:last-child]:rounded-br-lg",
|
|
1742
1848
|
className
|
|
1743
1849
|
),
|
|
1744
1850
|
...props
|
|
1745
1851
|
}
|
|
1746
1852
|
),
|
|
1747
|
-
sup: ({ className, ...props }) => /* @__PURE__ */ jsx17(
|
|
1853
|
+
sup: ({ className, node: _node, ...props }) => /* @__PURE__ */ jsx17(
|
|
1748
1854
|
"sup",
|
|
1749
1855
|
{
|
|
1750
1856
|
className: cn("[&>a]:text-xs [&>a]:no-underline", className),
|
|
1751
1857
|
...props
|
|
1752
1858
|
}
|
|
1753
1859
|
),
|
|
1754
|
-
pre: ({ className, ...props }) => /* @__PURE__ */ jsx17(
|
|
1755
|
-
"
|
|
1860
|
+
pre: ({ className, node: _node, ...props }) => /* @__PURE__ */ jsx17(
|
|
1861
|
+
"div",
|
|
1756
1862
|
{
|
|
1757
1863
|
className: cn(
|
|
1758
|
-
"max-w-4xl overflow-x-auto rounded-lg text-sm bg-black text-white dark:bg-zinc-800
|
|
1864
|
+
"max-w-4xl overflow-x-auto rounded-lg text-sm bg-black text-white dark:bg-zinc-800",
|
|
1759
1865
|
className
|
|
1760
1866
|
),
|
|
1761
1867
|
...props
|
|
@@ -1764,18 +1870,21 @@ var defaultComponents = {
|
|
|
1764
1870
|
code: ({
|
|
1765
1871
|
className,
|
|
1766
1872
|
children,
|
|
1873
|
+
node: _node,
|
|
1767
1874
|
...props
|
|
1768
1875
|
}) => {
|
|
1769
1876
|
const match = /language-(\w+)/.exec(className || "");
|
|
1877
|
+
const code = getTextContent(children);
|
|
1878
|
+
const isBlockCode = code.includes("\n");
|
|
1770
1879
|
if (match) {
|
|
1771
1880
|
const language = match[1];
|
|
1772
|
-
const
|
|
1881
|
+
const normalizedCode = code.replace(/\n$/, "");
|
|
1773
1882
|
return /* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
1774
1883
|
/* @__PURE__ */ jsx17(
|
|
1775
1884
|
CodeHeader,
|
|
1776
1885
|
{
|
|
1777
1886
|
language,
|
|
1778
|
-
code
|
|
1887
|
+
code: normalizedCode
|
|
1779
1888
|
}
|
|
1780
1889
|
),
|
|
1781
1890
|
/* @__PURE__ */ jsx17(
|
|
@@ -1783,15 +1892,31 @@ var defaultComponents = {
|
|
|
1783
1892
|
{
|
|
1784
1893
|
language,
|
|
1785
1894
|
className,
|
|
1786
|
-
children:
|
|
1895
|
+
children: normalizedCode
|
|
1787
1896
|
}
|
|
1788
1897
|
)
|
|
1789
1898
|
] });
|
|
1790
1899
|
}
|
|
1900
|
+
if (isBlockCode) {
|
|
1901
|
+
return /* @__PURE__ */ jsx17(
|
|
1902
|
+
"code",
|
|
1903
|
+
{
|
|
1904
|
+
className: cn(
|
|
1905
|
+
"block min-w-full whitespace-pre px-4 py-4 font-mono text-inherit",
|
|
1906
|
+
className
|
|
1907
|
+
),
|
|
1908
|
+
...props,
|
|
1909
|
+
children: code.replace(/\n$/, "")
|
|
1910
|
+
}
|
|
1911
|
+
);
|
|
1912
|
+
}
|
|
1791
1913
|
return /* @__PURE__ */ jsx17(
|
|
1792
1914
|
"code",
|
|
1793
1915
|
{
|
|
1794
|
-
className: cn(
|
|
1916
|
+
className: cn(
|
|
1917
|
+
"bg-muted rounded px-1.5 py-0.5 font-mono text-[0.9em] font-semibold break-all",
|
|
1918
|
+
className
|
|
1919
|
+
),
|
|
1795
1920
|
...props,
|
|
1796
1921
|
children
|
|
1797
1922
|
}
|
|
@@ -1911,6 +2036,8 @@ function MemoryBlock({ content }) {
|
|
|
1911
2036
|
function ComponentBlock({ content }) {
|
|
1912
2037
|
const [isExpanded, setIsExpanded] = React13.useState(false);
|
|
1913
2038
|
const contentRef = React13.useRef(null);
|
|
2039
|
+
const shouldAutoScrollRef = React13.useRef(true);
|
|
2040
|
+
const previousScrollTopRef = React13.useRef(0);
|
|
1914
2041
|
const data = content.data ?? {};
|
|
1915
2042
|
const category = data.category ?? "Component";
|
|
1916
2043
|
const title = data.tool && category === "Tool" ? data.tool : data.title ?? data.type ?? "Component";
|
|
@@ -1924,10 +2051,36 @@ function ComponentBlock({ content }) {
|
|
|
1924
2051
|
if (status === "running" && output !== null) setIsExpanded(true);
|
|
1925
2052
|
}, [status, output]);
|
|
1926
2053
|
React13.useEffect(() => {
|
|
1927
|
-
|
|
1928
|
-
|
|
2054
|
+
const element = contentRef.current;
|
|
2055
|
+
if (!element) return;
|
|
2056
|
+
previousScrollTopRef.current = element.scrollTop;
|
|
2057
|
+
const updateAutoScrollState = () => {
|
|
2058
|
+
const nextScrollTop = element.scrollTop;
|
|
2059
|
+
const isScrollingUp = nextScrollTop < previousScrollTopRef.current - 1;
|
|
2060
|
+
previousScrollTopRef.current = nextScrollTop;
|
|
2061
|
+
if (isScrollingUp) {
|
|
2062
|
+
shouldAutoScrollRef.current = false;
|
|
2063
|
+
return;
|
|
2064
|
+
}
|
|
2065
|
+
shouldAutoScrollRef.current = isNearBottom(element);
|
|
2066
|
+
};
|
|
2067
|
+
updateAutoScrollState();
|
|
2068
|
+
element.addEventListener("scroll", updateAutoScrollState, { passive: true });
|
|
2069
|
+
return () => {
|
|
2070
|
+
element.removeEventListener("scroll", updateAutoScrollState);
|
|
2071
|
+
};
|
|
2072
|
+
}, [isExpanded]);
|
|
2073
|
+
React13.useEffect(() => {
|
|
2074
|
+
if (status !== "running") {
|
|
2075
|
+
shouldAutoScrollRef.current = true;
|
|
2076
|
+
return;
|
|
1929
2077
|
}
|
|
1930
|
-
|
|
2078
|
+
const element = contentRef.current;
|
|
2079
|
+
if (!element || !shouldAutoScrollRef.current) {
|
|
2080
|
+
return;
|
|
2081
|
+
}
|
|
2082
|
+
element.scrollTop = element.scrollHeight;
|
|
2083
|
+
}, [isExpanded, output, status]);
|
|
1931
2084
|
const config = status ? statusConfig[status] : null;
|
|
1932
2085
|
const StatusIcon = config?.icon;
|
|
1933
2086
|
return /* @__PURE__ */ jsxs8(Card, { children: [
|
|
@@ -2358,18 +2511,6 @@ var kNumberFormatter = new Intl.NumberFormat("en-US", {
|
|
|
2358
2511
|
minimumFractionDigits: 0,
|
|
2359
2512
|
maximumFractionDigits: 1
|
|
2360
2513
|
});
|
|
2361
|
-
function normalizeContextSize(value) {
|
|
2362
|
-
if (typeof value === "number" && Number.isFinite(value) && value >= 0) {
|
|
2363
|
-
return Math.floor(value);
|
|
2364
|
-
}
|
|
2365
|
-
if (typeof value === "string") {
|
|
2366
|
-
const parsed = Number.parseInt(value, 10);
|
|
2367
|
-
if (Number.isFinite(parsed) && parsed >= 0) {
|
|
2368
|
-
return parsed;
|
|
2369
|
-
}
|
|
2370
|
-
}
|
|
2371
|
-
return null;
|
|
2372
|
-
}
|
|
2373
2514
|
function normalizeAgentKey(value) {
|
|
2374
2515
|
if (typeof value !== "string") {
|
|
2375
2516
|
return null;
|
|
@@ -2378,7 +2519,7 @@ function normalizeAgentKey(value) {
|
|
|
2378
2519
|
return normalized ? normalized : null;
|
|
2379
2520
|
}
|
|
2380
2521
|
function resolveAssistantContextSize(assistant) {
|
|
2381
|
-
return
|
|
2522
|
+
return normalizeContextUsageNumber(assistant.metadata?.context_size) ?? normalizeContextUsageNumber(assistant.config?.configurable?.context_size);
|
|
2382
2523
|
}
|
|
2383
2524
|
function resolveAssistantAgentKey(assistant) {
|
|
2384
2525
|
return normalizeAgentKey(assistant.metadata?.agent_key) ?? normalizeAgentKey(assistant.config?.configurable?.agentKey);
|
|
@@ -2401,6 +2542,16 @@ function ContextUsageIndicator({
|
|
|
2401
2542
|
const [maxContextSize, setMaxContextSize] = React17.useState(null);
|
|
2402
2543
|
const [usedContextSize, setUsedContextSize] = React17.useState(null);
|
|
2403
2544
|
const [assistantAgentKey, setAssistantAgentKey] = React17.useState(null);
|
|
2545
|
+
const latestRealtimeUsageRef = React17.useRef({
|
|
2546
|
+
threadId: null,
|
|
2547
|
+
agentKey: null,
|
|
2548
|
+
usedTokens: null
|
|
2549
|
+
});
|
|
2550
|
+
const realtimeUsage = React17.useMemo(
|
|
2551
|
+
() => getThreadContextUsage(stream.contextUsageByAgentKey, assistantAgentKey),
|
|
2552
|
+
[assistantAgentKey, stream.contextUsageByAgentKey]
|
|
2553
|
+
);
|
|
2554
|
+
const realtimeUsedContextSize = getThreadContextUsageTotalTokens(realtimeUsage);
|
|
2404
2555
|
React17.useEffect(() => {
|
|
2405
2556
|
if (!stream.client || !stream.assistantId) {
|
|
2406
2557
|
setMaxContextSize(null);
|
|
@@ -2421,6 +2572,17 @@ function ContextUsageIndicator({
|
|
|
2421
2572
|
cancelled = true;
|
|
2422
2573
|
};
|
|
2423
2574
|
}, [stream.client, stream.assistantId]);
|
|
2575
|
+
React17.useEffect(() => {
|
|
2576
|
+
latestRealtimeUsageRef.current = {
|
|
2577
|
+
threadId: stream.threadId ?? null,
|
|
2578
|
+
agentKey: assistantAgentKey,
|
|
2579
|
+
usedTokens: realtimeUsedContextSize
|
|
2580
|
+
};
|
|
2581
|
+
}, [assistantAgentKey, realtimeUsedContextSize, stream.threadId]);
|
|
2582
|
+
React17.useEffect(() => {
|
|
2583
|
+
if (realtimeUsedContextSize == null) return;
|
|
2584
|
+
setUsedContextSize(realtimeUsedContextSize);
|
|
2585
|
+
}, [realtimeUsedContextSize]);
|
|
2424
2586
|
React17.useEffect(() => {
|
|
2425
2587
|
if (!stream.client) {
|
|
2426
2588
|
setUsedContextSize(null);
|
|
@@ -2430,14 +2592,25 @@ function ContextUsageIndicator({
|
|
|
2430
2592
|
setUsedContextSize(0);
|
|
2431
2593
|
return;
|
|
2432
2594
|
}
|
|
2595
|
+
if (realtimeUsedContextSize != null) return;
|
|
2433
2596
|
if (stream.isLoading) return;
|
|
2434
2597
|
let cancelled = false;
|
|
2598
|
+
const requestThreadId = stream.threadId;
|
|
2599
|
+
const requestAgentKey = assistantAgentKey;
|
|
2435
2600
|
stream.client.threads.getContextUsage(
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
).then((result) =>
|
|
2601
|
+
requestThreadId,
|
|
2602
|
+
requestAgentKey ? { agentKey: requestAgentKey } : void 0
|
|
2603
|
+
).then((result) => normalizeContextUsageNumber(result?.usage?.context_tokens)).then((result) => {
|
|
2439
2604
|
if (cancelled) return;
|
|
2440
|
-
|
|
2605
|
+
const latestRealtimeUsage = latestRealtimeUsageRef.current;
|
|
2606
|
+
if (latestRealtimeUsage.usedTokens != null && latestRealtimeUsage.threadId === requestThreadId && latestRealtimeUsage.agentKey === requestAgentKey) {
|
|
2607
|
+
return;
|
|
2608
|
+
}
|
|
2609
|
+
setUsedContextSize(
|
|
2610
|
+
resolveUsedContextSize({
|
|
2611
|
+
fallbackUsedTokens: result
|
|
2612
|
+
})
|
|
2613
|
+
);
|
|
2441
2614
|
}).catch((err) => {
|
|
2442
2615
|
if (cancelled) return;
|
|
2443
2616
|
console.warn("[Chat] Failed to load thread context usage:", err);
|
|
@@ -2445,7 +2618,15 @@ function ContextUsageIndicator({
|
|
|
2445
2618
|
return () => {
|
|
2446
2619
|
cancelled = true;
|
|
2447
2620
|
};
|
|
2448
|
-
}, [
|
|
2621
|
+
}, [
|
|
2622
|
+
assistantAgentKey,
|
|
2623
|
+
realtimeUsedContextSize,
|
|
2624
|
+
stream.apiKey,
|
|
2625
|
+
stream.apiUrl,
|
|
2626
|
+
stream.client,
|
|
2627
|
+
stream.threadId,
|
|
2628
|
+
stream.isLoading
|
|
2629
|
+
]);
|
|
2449
2630
|
if (typeof maxContextSize !== "number" || !Number.isFinite(maxContextSize) || maxContextSize <= 0) {
|
|
2450
2631
|
return null;
|
|
2451
2632
|
}
|
|
@@ -2563,6 +2744,8 @@ function Chat({
|
|
|
2563
2744
|
const [draft, setDraft] = React18.useState("");
|
|
2564
2745
|
const [selectedTool, setSelectedTool] = React18.useState(null);
|
|
2565
2746
|
const [attachments, setAttachments] = React18.useState([]);
|
|
2747
|
+
const [isAtBottom, setIsAtBottom] = React18.useState(true);
|
|
2748
|
+
const [hasUpdatesBelow, setHasUpdatesBelow] = React18.useState(false);
|
|
2566
2749
|
const {
|
|
2567
2750
|
threads,
|
|
2568
2751
|
deleteThread,
|
|
@@ -2571,27 +2754,141 @@ function Chat({
|
|
|
2571
2754
|
} = useThreads();
|
|
2572
2755
|
const viewportRef = React18.useRef(null);
|
|
2573
2756
|
const fileInputRef = React18.useRef(null);
|
|
2757
|
+
const shouldAutoScrollRef = React18.useRef(true);
|
|
2758
|
+
const forceFollowRef = React18.useRef(false);
|
|
2759
|
+
const previousMessageCountRef = React18.useRef(0);
|
|
2760
|
+
const previousScrollTopRef = React18.useRef(0);
|
|
2761
|
+
const autoScrollFrameRef = React18.useRef(null);
|
|
2762
|
+
const isPointerDownRef = React18.useRef(false);
|
|
2763
|
+
const lastTouchYRef = React18.useRef(null);
|
|
2574
2764
|
const resolvedTitle = title ?? t("chat.title");
|
|
2575
2765
|
const resolvedPlaceholder = placeholder ?? t("chat.placeholder");
|
|
2576
2766
|
const inputPlaceholder = selectedTool?.placeholderOverride ?? composer?.placeholder ?? resolvedPlaceholder;
|
|
2577
|
-
const messages = stream.messages ?? [];
|
|
2767
|
+
const messages = React18.useMemo(() => stream.messages ?? [], [stream.messages]);
|
|
2578
2768
|
const trimmedDraft = draft.trim();
|
|
2579
|
-
const
|
|
2580
|
-
|
|
2769
|
+
const cancelPendingAutoScroll = React18.useCallback(() => {
|
|
2770
|
+
if (autoScrollFrameRef.current !== null) {
|
|
2771
|
+
cancelAnimationFrame(autoScrollFrameRef.current);
|
|
2772
|
+
autoScrollFrameRef.current = null;
|
|
2773
|
+
}
|
|
2774
|
+
}, []);
|
|
2775
|
+
const disableAutoFollow = React18.useCallback(() => {
|
|
2776
|
+
forceFollowRef.current = false;
|
|
2777
|
+
shouldAutoScrollRef.current = false;
|
|
2778
|
+
cancelPendingAutoScroll();
|
|
2779
|
+
}, [cancelPendingAutoScroll]);
|
|
2780
|
+
const enableAutoFollow = React18.useCallback(() => {
|
|
2781
|
+
forceFollowRef.current = true;
|
|
2782
|
+
shouldAutoScrollRef.current = true;
|
|
2783
|
+
setHasUpdatesBelow(false);
|
|
2784
|
+
}, []);
|
|
2785
|
+
const scrollToBottom = React18.useCallback((smooth = false, force = false) => {
|
|
2786
|
+
if (force) {
|
|
2787
|
+
enableAutoFollow();
|
|
2788
|
+
}
|
|
2789
|
+
cancelPendingAutoScroll();
|
|
2790
|
+
autoScrollFrameRef.current = requestAnimationFrame(() => {
|
|
2791
|
+
autoScrollFrameRef.current = null;
|
|
2581
2792
|
const viewport = viewportRef.current;
|
|
2582
2793
|
if (viewport) {
|
|
2794
|
+
if (!force && !shouldAutoScrollRef.current) {
|
|
2795
|
+
return;
|
|
2796
|
+
}
|
|
2583
2797
|
viewport.scrollTo({
|
|
2584
2798
|
top: viewport.scrollHeight,
|
|
2585
2799
|
behavior: smooth ? "smooth" : "instant"
|
|
2586
2800
|
});
|
|
2587
2801
|
}
|
|
2588
2802
|
});
|
|
2589
|
-
}, []);
|
|
2803
|
+
}, [cancelPendingAutoScroll, enableAutoFollow]);
|
|
2590
2804
|
React18.useEffect(() => {
|
|
2591
|
-
|
|
2592
|
-
|
|
2805
|
+
const viewport = viewportRef.current;
|
|
2806
|
+
if (!viewport) return;
|
|
2807
|
+
previousScrollTopRef.current = viewport.scrollTop;
|
|
2808
|
+
const stopPointerTracking = () => {
|
|
2809
|
+
isPointerDownRef.current = false;
|
|
2810
|
+
};
|
|
2811
|
+
const updateAutoScrollState = () => {
|
|
2812
|
+
const nextScrollTop = viewport.scrollTop;
|
|
2813
|
+
const isScrollingUp = nextScrollTop < previousScrollTopRef.current - 1;
|
|
2814
|
+
previousScrollTopRef.current = nextScrollTop;
|
|
2815
|
+
const nearBottom = isNearBottom(viewport);
|
|
2816
|
+
setIsAtBottom(nearBottom);
|
|
2817
|
+
if (nearBottom) {
|
|
2818
|
+
shouldAutoScrollRef.current = true;
|
|
2819
|
+
setHasUpdatesBelow(false);
|
|
2820
|
+
return;
|
|
2821
|
+
}
|
|
2822
|
+
if (forceFollowRef.current) {
|
|
2823
|
+
shouldAutoScrollRef.current = true;
|
|
2824
|
+
return;
|
|
2825
|
+
}
|
|
2826
|
+
if (isPointerDownRef.current && isScrollingUp) {
|
|
2827
|
+
disableAutoFollow();
|
|
2828
|
+
return;
|
|
2829
|
+
}
|
|
2830
|
+
shouldAutoScrollRef.current = false;
|
|
2831
|
+
};
|
|
2832
|
+
const handleWheel = (event) => {
|
|
2833
|
+
if (event.deltaY < 0) {
|
|
2834
|
+
disableAutoFollow();
|
|
2835
|
+
}
|
|
2836
|
+
};
|
|
2837
|
+
const handlePointerDown = () => {
|
|
2838
|
+
isPointerDownRef.current = true;
|
|
2839
|
+
};
|
|
2840
|
+
const handleTouchStart = (event) => {
|
|
2841
|
+
lastTouchYRef.current = event.touches[0]?.clientY ?? null;
|
|
2842
|
+
};
|
|
2843
|
+
const handleTouchMove = (event) => {
|
|
2844
|
+
const nextTouchY = event.touches[0]?.clientY;
|
|
2845
|
+
if (typeof nextTouchY !== "number") return;
|
|
2846
|
+
if (lastTouchYRef.current !== null && nextTouchY > lastTouchYRef.current + 1) {
|
|
2847
|
+
disableAutoFollow();
|
|
2848
|
+
}
|
|
2849
|
+
lastTouchYRef.current = nextTouchY;
|
|
2850
|
+
};
|
|
2851
|
+
const handleTouchEnd = () => {
|
|
2852
|
+
lastTouchYRef.current = null;
|
|
2853
|
+
};
|
|
2854
|
+
updateAutoScrollState();
|
|
2855
|
+
viewport.addEventListener("wheel", handleWheel, { passive: true });
|
|
2856
|
+
viewport.addEventListener("pointerdown", handlePointerDown, { passive: true });
|
|
2857
|
+
viewport.addEventListener("scroll", updateAutoScrollState, { passive: true });
|
|
2858
|
+
viewport.addEventListener("touchstart", handleTouchStart, { passive: true });
|
|
2859
|
+
viewport.addEventListener("touchmove", handleTouchMove, { passive: true });
|
|
2860
|
+
viewport.addEventListener("touchend", handleTouchEnd, { passive: true });
|
|
2861
|
+
window.addEventListener("pointerup", stopPointerTracking, { passive: true });
|
|
2862
|
+
window.addEventListener("pointercancel", stopPointerTracking, { passive: true });
|
|
2863
|
+
return () => {
|
|
2864
|
+
cancelPendingAutoScroll();
|
|
2865
|
+
viewport.removeEventListener("wheel", handleWheel);
|
|
2866
|
+
viewport.removeEventListener("pointerdown", handlePointerDown);
|
|
2867
|
+
viewport.removeEventListener("scroll", updateAutoScrollState);
|
|
2868
|
+
viewport.removeEventListener("touchstart", handleTouchStart);
|
|
2869
|
+
viewport.removeEventListener("touchmove", handleTouchMove);
|
|
2870
|
+
viewport.removeEventListener("touchend", handleTouchEnd);
|
|
2871
|
+
window.removeEventListener("pointerup", stopPointerTracking);
|
|
2872
|
+
window.removeEventListener("pointercancel", stopPointerTracking);
|
|
2873
|
+
};
|
|
2874
|
+
}, [cancelPendingAutoScroll, disableAutoFollow]);
|
|
2593
2875
|
React18.useEffect(() => {
|
|
2594
|
-
|
|
2876
|
+
shouldAutoScrollRef.current = true;
|
|
2877
|
+
forceFollowRef.current = false;
|
|
2878
|
+
previousScrollTopRef.current = 0;
|
|
2879
|
+
setIsAtBottom(true);
|
|
2880
|
+
setHasUpdatesBelow(false);
|
|
2881
|
+
}, [stream.threadId]);
|
|
2882
|
+
React18.useEffect(() => {
|
|
2883
|
+
const messageCountChanged = messages.length !== previousMessageCountRef.current;
|
|
2884
|
+
previousMessageCountRef.current = messages.length;
|
|
2885
|
+
if (!shouldAutoScrollRef.current) {
|
|
2886
|
+
if (messageCountChanged || stream.isLoading) {
|
|
2887
|
+
setHasUpdatesBelow(true);
|
|
2888
|
+
}
|
|
2889
|
+
return;
|
|
2890
|
+
}
|
|
2891
|
+
if (messageCountChanged || stream.isLoading) {
|
|
2595
2892
|
scrollToBottom();
|
|
2596
2893
|
}
|
|
2597
2894
|
}, [stream.isLoading, messages, scrollToBottom]);
|
|
@@ -2640,16 +2937,24 @@ function Chat({
|
|
|
2640
2937
|
if (filesToSend) {
|
|
2641
2938
|
inputPayload.files = filesToSend;
|
|
2642
2939
|
}
|
|
2940
|
+
const requestOptions = buildInjectedRequestOptions({
|
|
2941
|
+
defaults: options?.request,
|
|
2942
|
+
humanInput: inputPayload
|
|
2943
|
+
});
|
|
2643
2944
|
stream.submit(
|
|
2644
|
-
{ input: inputPayload },
|
|
2645
2945
|
{
|
|
2946
|
+
input: inputPayload,
|
|
2947
|
+
...requestOptions.state ? { state: requestOptions.state } : {}
|
|
2948
|
+
},
|
|
2949
|
+
{
|
|
2950
|
+
...requestOptions.context ? { context: requestOptions.context } : {},
|
|
2646
2951
|
optimisticValues: (prev) => {
|
|
2647
2952
|
const prevMessages = prev?.messages ?? [];
|
|
2648
2953
|
return { ...prev, messages: [...prevMessages, newMessage] };
|
|
2649
2954
|
}
|
|
2650
2955
|
}
|
|
2651
2956
|
);
|
|
2652
|
-
scrollToBottom(true);
|
|
2957
|
+
scrollToBottom(true, true);
|
|
2653
2958
|
if (selectedTool && !selectedTool.pinned) {
|
|
2654
2959
|
setSelectedTool(null);
|
|
2655
2960
|
}
|
|
@@ -2751,7 +3056,7 @@ function Chat({
|
|
|
2751
3056
|
}
|
|
2752
3057
|
}
|
|
2753
3058
|
);
|
|
2754
|
-
scrollToBottom(true);
|
|
3059
|
+
scrollToBottom(true, true);
|
|
2755
3060
|
};
|
|
2756
3061
|
const loadConversationMessages = React18.useCallback(
|
|
2757
3062
|
async (recordId) => {
|
|
@@ -2831,6 +3136,7 @@ function Chat({
|
|
|
2831
3136
|
}
|
|
2832
3137
|
}
|
|
2833
3138
|
);
|
|
3139
|
+
scrollToBottom(true, true);
|
|
2834
3140
|
}
|
|
2835
3141
|
};
|
|
2836
3142
|
const acceptMimes = composer?.attachments?.accept ? Object.entries(composer.attachments.accept).map(([mime, exts]) => [mime, ...exts.map((e) => `.${e}`)].join(",")).join(",") : void 0;
|
|
@@ -2849,7 +3155,7 @@ function Chat({
|
|
|
2849
3155
|
{
|
|
2850
3156
|
ref: viewportRef,
|
|
2851
3157
|
className: cn(
|
|
2852
|
-
"flex h-full w-full flex-col flex-1 overflow-y-auto bg-background shadow-sm",
|
|
3158
|
+
"relative flex h-full w-full flex-col flex-1 overflow-y-auto bg-background shadow-sm",
|
|
2853
3159
|
className
|
|
2854
3160
|
),
|
|
2855
3161
|
children: [
|
|
@@ -2986,6 +3292,22 @@ function Chat({
|
|
|
2986
3292
|
})()
|
|
2987
3293
|
] })
|
|
2988
3294
|
] }),
|
|
3295
|
+
!isAtBottom && messages.length > 0 && /* @__PURE__ */ jsx24("div", { className: "sticky bottom-20 z-20 flex justify-center px-4 pointer-events-none", children: /* @__PURE__ */ jsx24(
|
|
3296
|
+
Button,
|
|
3297
|
+
{
|
|
3298
|
+
type: "button",
|
|
3299
|
+
size: "icon-sm",
|
|
3300
|
+
variant: hasUpdatesBelow ? "default" : "outline",
|
|
3301
|
+
className: cn(
|
|
3302
|
+
"pointer-events-auto rounded-full shadow-md dark:border-white/20 dark:ring-1 dark:ring-white/15 dark:shadow-[0_0_0_1px_rgba(255,255,255,0.06),0_10px_30px_rgba(0,0,0,0.45)]",
|
|
3303
|
+
hasUpdatesBelow && "animate-bounce"
|
|
3304
|
+
),
|
|
3305
|
+
onClick: () => scrollToBottom(true, true),
|
|
3306
|
+
"aria-label": t("chat.scrollToBottom"),
|
|
3307
|
+
title: t("chat.scrollToBottom"),
|
|
3308
|
+
children: /* @__PURE__ */ jsx24(ArrowDown, { size: 16 })
|
|
3309
|
+
}
|
|
3310
|
+
) }),
|
|
2989
3311
|
/* @__PURE__ */ jsxs13("div", { className: "p-2 sticky bottom-0 z-10 bg-background", children: [
|
|
2990
3312
|
threadErrorMessage && /* @__PURE__ */ jsx24("div", { className: "mb-3 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive", children: threadErrorMessage }),
|
|
2991
3313
|
/* @__PURE__ */ jsx24(
|