@xpert-ai/chatkit-ui 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/assets/{_baseUniq-DOSftAYs.js → _baseUniq-CAxobs9N.js} +1 -1
- package/dist/app/assets/{abap-D8t_liei.js → abap-wdK8JaHa.js} +1 -1
- package/dist/app/assets/{abnf-jhem6Fdp.js → abnf-B4QVrCDX.js} +1 -1
- package/dist/app/assets/{actionscript-AgAqywOC.js → actionscript-BbKSvJrq.js} +1 -1
- package/dist/app/assets/{ada-BR3Q6K2R.js → ada-BkwiItKH.js} +1 -1
- package/dist/app/assets/{agda-s2LPXGxr.js → agda-BHGf_Fgl.js} +1 -1
- package/dist/app/assets/{al-DbvPGDsA.js → al-CpdhQzD9.js} +1 -1
- package/dist/app/assets/{antlr4-Dde8A9o-.js → antlr4-CLQ7xEno.js} +1 -1
- package/dist/app/assets/{apacheconf-XU1nZV0U.js → apacheconf-6iBdrfFM.js} +1 -1
- package/dist/app/assets/{apex-dwhJyh_8.js → apex-DBXBvaz5.js} +1 -1
- package/dist/app/assets/{apl-6TVT9aj4.js → apl-D8vc149P.js} +1 -1
- package/dist/app/assets/{applescript-CK6TQ3Fp.js → applescript-BTZUYWS_.js} +1 -1
- package/dist/app/assets/{aql-CAitgyBw.js → aql-BxB6KDJQ.js} +1 -1
- package/dist/app/assets/{arc-y7BBKPBC.js → arc-CNi1G9DJ.js} +1 -1
- package/dist/app/assets/{architectureDiagram-Q4EWVU46-CKPXDiCw.js → architectureDiagram-Q4EWVU46-BL0mPAR9.js} +1 -1
- package/dist/app/assets/{arduino-BX92l-fC.js → arduino-Cx04QCrp.js} +1 -1
- package/dist/app/assets/{arff-TZ2mzCjA.js → arff-MqnrnEC8.js} +1 -1
- package/dist/app/assets/{asciidoc-CbdSoDU0.js → asciidoc-sz7M5yXr.js} +1 -1
- package/dist/app/assets/{asm6502-DB6lK7kM.js → asm6502-BZ8xfWko.js} +1 -1
- package/dist/app/assets/{asmatmel-DUbAVWcI.js → asmatmel-D-cI_as7.js} +1 -1
- package/dist/app/assets/{aspnet-BJclsNGz.js → aspnet-wNdsZF1M.js} +1 -1
- package/dist/app/assets/{autohotkey-BAHo4mzJ.js → autohotkey-CERdGivs.js} +1 -1
- package/dist/app/assets/{autoit-CpXn4Gjh.js → autoit-CQsoUza0.js} +1 -1
- package/dist/app/assets/{avisynth-CB7WaK_0.js → avisynth-DMTk2nsi.js} +1 -1
- package/dist/app/assets/{avro-idl-C-DAHRE1.js → avro-idl-VdXZfwVL.js} +1 -1
- package/dist/app/assets/{bash-De_5PB_T.js → bash-BKoQnhB6.js} +1 -1
- package/dist/app/assets/{basic-TAOzT46e.js → basic-BvRsQ9vo.js} +1 -1
- package/dist/app/assets/{batch-yBjeCG2_.js → batch-DkZb4POU.js} +1 -1
- package/dist/app/assets/{bbcode-zhuhkwPV.js → bbcode-BkkYngk6.js} +1 -1
- package/dist/app/assets/{bicep-3sditE87.js → bicep-DY62eX6n.js} +1 -1
- package/dist/app/assets/{birb-B91lhwFM.js → birb-Cf3Wn8DP.js} +1 -1
- package/dist/app/assets/{bison-Zl9yhw_8.js → bison-CMVsgR8E.js} +1 -1
- package/dist/app/assets/{blockDiagram-DXYQGD6D-CbzYvF40.js → blockDiagram-DXYQGD6D-DdgOXTCq.js} +1 -1
- package/dist/app/assets/{bnf-BTyJWL2-.js → bnf-C53AC5ba.js} +1 -1
- package/dist/app/assets/{brainfuck-D-gtcLd6.js → brainfuck-DBcYtGip.js} +1 -1
- package/dist/app/assets/{brightscript-CtoapRkx.js → brightscript-uWYyj7Le.js} +1 -1
- package/dist/app/assets/{bro-MqwpLO_C.js → bro-Bnqn5jLn.js} +1 -1
- package/dist/app/assets/{bsl-B51ARJIQ.js → bsl-eeHcx6I3.js} +1 -1
- package/dist/app/assets/{c-Dd7OPCIn.js → c-Y_E2ZZ8h.js} +1 -1
- package/dist/app/assets/{c4Diagram-AHTNJAMY-Cl2FGnEB.js → c4Diagram-AHTNJAMY-BAZeiIaA.js} +1 -1
- package/dist/app/assets/{cfscript-BEyB5tLd.js → cfscript-swSriW5q.js} +1 -1
- package/dist/app/assets/{chaiscript-BEE5daDb.js → chaiscript-BHR5pIfl.js} +1 -1
- package/dist/app/assets/channel-C4IK_RZn.js +1 -0
- package/dist/app/assets/{chunk-4BX2VUAB-CdWO6X3v.js → chunk-4BX2VUAB-Deyo77pg.js} +1 -1
- package/dist/app/assets/{chunk-4TB4RGXK-B99XSc_o.js → chunk-4TB4RGXK-BSgPz1Fn.js} +1 -1
- package/dist/app/assets/{chunk-55IACEB6-Bf8lWYm0.js → chunk-55IACEB6-DekOqO8-.js} +1 -1
- package/dist/app/assets/{chunk-EDXVE4YY-D0jGhBDV.js → chunk-EDXVE4YY-VI2aoR3H.js} +1 -1
- package/dist/app/assets/{chunk-FMBD7UC4-CPVhZRqV.js → chunk-FMBD7UC4-DVPMFZIh.js} +1 -1
- package/dist/app/assets/{chunk-OYMX7WX6-B3B3qd2F.js → chunk-OYMX7WX6-C_5OySCp.js} +1 -1
- package/dist/app/assets/{chunk-QZHKN3VN-C9zZSGTB.js → chunk-QZHKN3VN-CQ4PJ94U.js} +1 -1
- package/dist/app/assets/{chunk-YZCP3GAM-BX0g-UOY.js → chunk-YZCP3GAM-40VMFur6.js} +1 -1
- package/dist/app/assets/{cil-DfLzhPVn.js → cil-BlB-Qnhz.js} +1 -1
- package/dist/app/assets/classDiagram-6PBFFD2Q-LicCc7Qv.js +1 -0
- package/dist/app/assets/classDiagram-v2-HSJHXN6E-LicCc7Qv.js +1 -0
- package/dist/app/assets/{clike-Dd07rx25.js → clike-cGW_OpAz.js} +1 -1
- package/dist/app/assets/{clojure-Du6gb2Do.js → clojure-BwM8_y2w.js} +1 -1
- package/dist/app/assets/clone-BC1Apkgy.js +1 -0
- package/dist/app/assets/{cmake-DpKAfrpv.js → cmake-B_tPIs0N.js} +1 -1
- package/dist/app/assets/{cobol-CMhyCAN0.js → cobol-awMTn3SL.js} +1 -1
- package/dist/app/assets/{coffeescript-C_hK5LrH.js → coffeescript-BdPUATdq.js} +1 -1
- package/dist/app/assets/{concurnas-BzzuO0wJ.js → concurnas-DD4NroNG.js} +1 -1
- package/dist/app/assets/{coq-D28Kf8H7.js → coq-WP9t6Mya.js} +1 -1
- package/dist/app/assets/{core-CkMLmhj1.js → core-Dl1d1z_B.js} +1 -1
- package/dist/app/assets/{cose-bilkent-S5V4N54A-Bnbhbxn8.js → cose-bilkent-S5V4N54A-CIsQWWLS.js} +1 -1
- package/dist/app/assets/{cpp-DMtEaL9D.js → cpp-DRq2558J.js} +1 -1
- package/dist/app/assets/{crystal-BPv3cq00.js → crystal-CmMEvlYk.js} +1 -1
- package/dist/app/assets/{csharp-CogydNTP.js → csharp-CmdWJQ_7.js} +1 -1
- package/dist/app/assets/{cshtml-DwKZdXN4.js → cshtml-D-PG0yKy.js} +1 -1
- package/dist/app/assets/{csp-EdkmOQr2.js → csp-CoYEQK4_.js} +1 -1
- package/dist/app/assets/{css-extras-_xrLQVK9.js → css-extras-CvcfPwL5.js} +1 -1
- package/dist/app/assets/{css-GGj7gjJp.js → css-qzCJaYzE.js} +1 -1
- package/dist/app/assets/{csv-DQnF4IQS.js → csv-BOSHHM-P.js} +1 -1
- package/dist/app/assets/{cypher-mlTzP2DC.js → cypher-DF-LRYf2.js} +1 -1
- package/dist/app/assets/{d-CA6ua4gG.js → d-DT7HGItG.js} +1 -1
- package/dist/app/assets/{dagre-KV5264BT-2pUvoHnZ.js → dagre-KV5264BT-BXDHR3FY.js} +1 -1
- package/dist/app/assets/{dart-BSRdjoJD.js → dart-C53tv9tc.js} +1 -1
- package/dist/app/assets/{dataweave-CTK9G89H.js → dataweave-DfVl-B8U.js} +1 -1
- package/dist/app/assets/{dax-CLAaspXf.js → dax-CtLDIvLu.js} +1 -1
- package/dist/app/assets/{dhall-DvmFF2lw.js → dhall-B4vfpjKK.js} +1 -1
- package/dist/app/assets/{diagram-5BDNPKRD--2m-CBif.js → diagram-5BDNPKRD-C2jQZSnh.js} +1 -1
- package/dist/app/assets/{diagram-G4DWMVQ6-xfTAcTBK.js → diagram-G4DWMVQ6-DkBF8pst.js} +1 -1
- package/dist/app/assets/{diagram-MMDJMWI5-DJ9-7Sko.js → diagram-MMDJMWI5-DkBy1EJI.js} +1 -1
- package/dist/app/assets/{diagram-TYMM5635-Dbu04dwS.js → diagram-TYMM5635-BG7IFHFj.js} +1 -1
- package/dist/app/assets/{diff-DexI-NjF.js → diff-CAGXr455.js} +1 -1
- package/dist/app/assets/{django-BJtz28yd.js → django-Bt-Xandi.js} +1 -1
- package/dist/app/assets/{dns-zone-file-C-rZlLjq.js → dns-zone-file-CUQqHN_u.js} +1 -1
- package/dist/app/assets/{docker-D3zkJQBB.js → docker-Cmx-jfGB.js} +1 -1
- package/dist/app/assets/{dot-CYyhO0AU.js → dot-CtNw9lX4.js} +1 -1
- package/dist/app/assets/{ebnf-DRQkwE29.js → ebnf-Dl_Q5Or1.js} +1 -1
- package/dist/app/assets/{editorconfig-BqLWNpRj.js → editorconfig-DZYXnV_C.js} +1 -1
- package/dist/app/assets/{eiffel-C9PIq1yy.js → eiffel-CgccC4xz.js} +1 -1
- package/dist/app/assets/{ejs-B6_5mrfN.js → ejs-Cj1dQzfI.js} +1 -1
- package/dist/app/assets/{elixir-jtsDOmKm.js → elixir-B3SWPivz.js} +1 -1
- package/dist/app/assets/{elm-DRbXA7ir.js → elm-Bp_TQfaA.js} +1 -1
- package/dist/app/assets/{erDiagram-SMLLAGMA-CrI2ZkzN.js → erDiagram-SMLLAGMA-Cby23XmU.js} +1 -1
- package/dist/app/assets/{erb-G2oGuDtf.js → erb-Cb-K6pZE.js} +1 -1
- package/dist/app/assets/{erlang-CT-pjUEp.js → erlang-F72Fjwv2.js} +1 -1
- package/dist/app/assets/{etlua-qmLyJp4f.js → etlua-DFUJG9GZ.js} +1 -1
- package/dist/app/assets/{excel-formula-3pfMQM_6.js → excel-formula-B8hn4WlO.js} +1 -1
- package/dist/app/assets/{factor-Bo9zUudA.js → factor-BlEqbeI0.js} +1 -1
- package/dist/app/assets/{false-oN6u3jCd.js → false-DMURsqlU.js} +1 -1
- package/dist/app/assets/{firestore-security-rules-CtzUeAWq.js → firestore-security-rules-DswDVNNa.js} +1 -1
- package/dist/app/assets/{flow-nzq0GfkM.js → flow-C4reo-gu.js} +1 -1
- package/dist/app/assets/{flowDiagram-DWJPFMVM-CGpnDmCG.js → flowDiagram-DWJPFMVM-BxNNsar9.js} +1 -1
- package/dist/app/assets/{fortran-DVeArHMZ.js → fortran-BAmD5KHF.js} +1 -1
- package/dist/app/assets/{fsharp--fFnup68.js → fsharp-CPq2O12L.js} +1 -1
- package/dist/app/assets/{ftl-BMxP4X-x.js → ftl-Cgbeq2-z.js} +1 -1
- package/dist/app/assets/{ganttDiagram-T4ZO3ILL-CCTn88VZ.js → ganttDiagram-T4ZO3ILL-BLd3DH-5.js} +1 -1
- package/dist/app/assets/{gap-B7zirCOJ.js → gap-Bge3tvcZ.js} +1 -1
- package/dist/app/assets/{gcode-CQFJN_Te.js → gcode-CAVcsFdN.js} +1 -1
- package/dist/app/assets/{gdscript-BTRKMIlE.js → gdscript-nkDP0xMM.js} +1 -1
- package/dist/app/assets/{gedcom-4Y3UUWcB.js → gedcom-BA8GnDnW.js} +1 -1
- package/dist/app/assets/{gherkin-DK5Y4NpK.js → gherkin-DvBWzm8E.js} +1 -1
- package/dist/app/assets/{git-DD3NDd7U.js → git-LJ9ums7L.js} +1 -1
- package/dist/app/assets/{gitGraphDiagram-UUTBAWPF-nEeDINSI.js → gitGraphDiagram-UUTBAWPF-JZEE6gBT.js} +1 -1
- package/dist/app/assets/{glsl-BCT9m8QS.js → glsl-D4U4_9LH.js} +1 -1
- package/dist/app/assets/{gml-CCB73B6Z.js → gml-CQtoiCZT.js} +1 -1
- package/dist/app/assets/{gn-BIFCrkIE.js → gn-DxTb0Jqi.js} +1 -1
- package/dist/app/assets/{go-dyQD8YyU.js → go-D7ELL60F.js} +1 -1
- package/dist/app/assets/{go-module-BXpIFu8x.js → go-module-Ck8j-Kcm.js} +1 -1
- package/dist/app/assets/{graph-wLpqxdfC.js → graph-pBSG-4mT.js} +1 -1
- package/dist/app/assets/{graphql-D-ZoQblr.js → graphql-C-10AxQD.js} +1 -1
- package/dist/app/assets/{groovy-CHjkA2bW.js → groovy-SpWCEWzX.js} +1 -1
- package/dist/app/assets/{haml-ghcX4l2W.js → haml-C2aM6_El.js} +1 -1
- package/dist/app/assets/{handlebars-x0LtkeUm.js → handlebars-ChMYyLZl.js} +1 -1
- package/dist/app/assets/{haskell-B-bDSuV-.js → haskell-DagwvSeE.js} +1 -1
- package/dist/app/assets/{haxe-Vm5mZw57.js → haxe-BG5B6d9K.js} +1 -1
- package/dist/app/assets/{hcl-CGN3jDav.js → hcl-B8Gd__02.js} +1 -1
- package/dist/app/assets/{hlsl-DMKySN6W.js → hlsl-CSu8CgjO.js} +1 -1
- package/dist/app/assets/{hoon-3jplpPAg.js → hoon-BUjyY25K.js} +1 -1
- package/dist/app/assets/{hpkp-DMJ5jXpf.js → hpkp-C5yMlUDS.js} +1 -1
- package/dist/app/assets/{hsts-CKBkWb38.js → hsts-DzNiiTKI.js} +1 -1
- package/dist/app/assets/{http-97sq51fE.js → http-DYWI6rav.js} +1 -1
- package/dist/app/assets/{ichigojam-CZ6nOPE1.js → ichigojam-DrBDAbYO.js} +1 -1
- package/dist/app/assets/{icon-CDqvp1g4.js → icon-BezsFCDL.js} +1 -1
- package/dist/app/assets/{icu-message-format-BjYuZ-Om.js → icu-message-format-BCSOltos.js} +1 -1
- package/dist/app/assets/{idris-pEOqm1H_.js → idris-B8Tj6LSh.js} +1 -1
- package/dist/app/assets/{iecst-CRrTHf_1.js → iecst-CfA7HSP8.js} +1 -1
- package/dist/app/assets/{ignore-CxkUxQmB.js → ignore-E_v5CiMN.js} +1 -1
- package/dist/app/assets/index-BojjVNpv.css +1 -0
- package/dist/app/assets/{index-n0Xlprbh.js → index-CAv2vOlh.js} +184 -184
- package/dist/app/assets/{infoDiagram-42DDH7IO-C8jVtFvE.js → infoDiagram-42DDH7IO-eZsn31yB.js} +1 -1
- package/dist/app/assets/{inform7-CJDC1PVH.js → inform7-Dj75C-lM.js} +1 -1
- package/dist/app/assets/{ini-BP8l3Q_m.js → ini-DnYgp5_G.js} +1 -1
- package/dist/app/assets/{io-L3Lj4xsH.js → io-D59cMlU5.js} +1 -1
- package/dist/app/assets/{ishikawaDiagram-UXIWVN3A-BCChdzZf.js → ishikawaDiagram-UXIWVN3A-Cb8G56a8.js} +1 -1
- package/dist/app/assets/{j-BkUK2Ldb.js → j-CuOplqKY.js} +1 -1
- package/dist/app/assets/{java-lKbQcHmi.js → java-DiKpa4Y3.js} +1 -1
- package/dist/app/assets/{javadoc-CkX_P5bm.js → javadoc-DshvkFVS.js} +1 -1
- package/dist/app/assets/{javadoclike-DKo0tRDk.js → javadoclike-Dl0yZMbR.js} +1 -1
- package/dist/app/assets/{javascript-JBI-h3GD.js → javascript-C3lRkH0T.js} +1 -1
- package/dist/app/assets/{javastacktrace-DuXSjAnS.js → javastacktrace-BAZDNyis.js} +1 -1
- package/dist/app/assets/{jexl-txJd9uA8.js → jexl-BvqPLTYh.js} +1 -1
- package/dist/app/assets/{jolie-BHXVY7fU.js → jolie-DXjsE0XX.js} +1 -1
- package/dist/app/assets/{journeyDiagram-VCZTEJTY-DgqozfYW.js → journeyDiagram-VCZTEJTY-9aLWSRay.js} +1 -1
- package/dist/app/assets/{jq-Csyhu6Mu.js → jq-CLFx4HBH.js} +1 -1
- package/dist/app/assets/{js-extras-hN_zFrKs.js → js-extras-D33J2WNl.js} +1 -1
- package/dist/app/assets/{js-templates-CKV7gOwt.js → js-templates-DlMN6fgo.js} +1 -1
- package/dist/app/assets/{jsdoc-DvQtkqGY.js → jsdoc-CGVgLZ2j.js} +1 -1
- package/dist/app/assets/{json-BWJc5nIm.js → json-BTnVvJgU.js} +1 -1
- package/dist/app/assets/{json5-SIZfmxdY.js → json5-BW8yCajk.js} +1 -1
- package/dist/app/assets/{jsonp-BCZTSaV5.js → jsonp-iQTQx19C.js} +1 -1
- package/dist/app/assets/{jsstacktrace-gzJEwbAz.js → jsstacktrace-DXxcFNfy.js} +1 -1
- package/dist/app/assets/{jsx-CjDjGsx0.js → jsx-D1npDekI.js} +1 -1
- package/dist/app/assets/{julia-D7oaevR9.js → julia-E711iN6A.js} +1 -1
- package/dist/app/assets/{kanban-definition-6JOO6SKY-IxcIrcgX.js → kanban-definition-6JOO6SKY-COnahS5T.js} +1 -1
- package/dist/app/assets/{keepalived-Cd4E72kG.js → keepalived-Da5-tKqr.js} +1 -1
- package/dist/app/assets/{keyman-CnnhX5FN.js → keyman-CR_is7Lf.js} +1 -1
- package/dist/app/assets/{kotlin-Bb9joIt9.js → kotlin-6F8UihuI.js} +1 -1
- package/dist/app/assets/{kumir-2AUUqPdZ.js → kumir-BGVXhhZU.js} +1 -1
- package/dist/app/assets/{kusto-BYT2Y4Ec.js → kusto-xzJ5QDBT.js} +1 -1
- package/dist/app/assets/{latex-C7vJjHLG.js → latex-jsq1GqdL.js} +1 -1
- package/dist/app/assets/{latte-B40IhbBN.js → latte-CqObxNvY.js} +1 -1
- package/dist/app/assets/{layout-JYzSZ2a2.js → layout-Od8azvI5.js} +1 -1
- package/dist/app/assets/{less-CfVevww_.js → less-vdQIwlhr.js} +1 -1
- package/dist/app/assets/{lilypond-Car5OZdt.js → lilypond-CYhZp9Do.js} +1 -1
- package/dist/app/assets/{linear-C52-vlD3.js → linear-BVmuh868.js} +1 -1
- package/dist/app/assets/{liquid-B5H1JE3W.js → liquid-CF_8y_W1.js} +1 -1
- package/dist/app/assets/{lisp-CzR77rD6.js → lisp-DqmYhGox.js} +1 -1
- package/dist/app/assets/{livescript-DaurQsHd.js → livescript-DEuoDOv7.js} +1 -1
- package/dist/app/assets/{llvm-HQsMJlhb.js → llvm-DlajzOZN.js} +1 -1
- package/dist/app/assets/{log-p-v4zt5b.js → log-CU2WH4Lm.js} +1 -1
- package/dist/app/assets/{lolcode-BUEwX00W.js → lolcode-CDbraZlO.js} +1 -1
- package/dist/app/assets/{lua-BMmOVEjM.js → lua-C7PRrDvP.js} +1 -1
- package/dist/app/assets/{magma-B8nyW6y4.js → magma-CEu2U_uQ.js} +1 -1
- package/dist/app/assets/{makefile-DcXOWSLr.js → makefile-BpvnX-Nx.js} +1 -1
- package/dist/app/assets/{markdown-DLWYEU3e.js → markdown-BTkzQyNu.js} +1 -1
- package/dist/app/assets/{markup-jsuSUme0.js → markup-Dje0J_2C.js} +1 -1
- package/dist/app/assets/{markup-templating-Dm7qXJKw.js → markup-templating-cYyMwZ4b.js} +1 -1
- package/dist/app/assets/{matlab-C0-FOdqd.js → matlab-RV1EEhcL.js} +1 -1
- package/dist/app/assets/{maxscript-Cfo0XQkR.js → maxscript-Bo7lyT0p.js} +1 -1
- package/dist/app/assets/{mel-DOCIJjQg.js → mel-kP-zTDHf.js} +1 -1
- package/dist/app/assets/{mermaid-BflTtQG8.js → mermaid-D1yX-Bwv.js} +1 -1
- package/dist/app/assets/{min-C1ji-XBz.js → min-z4SxYbt2.js} +1 -1
- package/dist/app/assets/{mindmap-definition-QFDTVHPH-B5ikGBES.js → mindmap-definition-QFDTVHPH-Dm1nn9t1.js} +1 -1
- package/dist/app/assets/{mizar-Bts2s8Hn.js → mizar-DD-lNTs3.js} +1 -1
- package/dist/app/assets/{mongodb-DQXudfKX.js → mongodb-By_x69ne.js} +1 -1
- package/dist/app/assets/{monkey-DrRHqOn1.js → monkey-CQneMnOq.js} +1 -1
- package/dist/app/assets/{moonscript-C7Xd-yhU.js → moonscript-Cv1IiKWR.js} +1 -1
- package/dist/app/assets/{n1ql-B_wltsIt.js → n1ql-BZ-dWxn_.js} +1 -1
- package/dist/app/assets/{n4js-BzoEPRsS.js → n4js-aHhU-EQW.js} +1 -1
- package/dist/app/assets/{nand2tetris-hdl-DC6szN4I.js → nand2tetris-hdl-Ct9NqibY.js} +1 -1
- package/dist/app/assets/{naniscript-Dtp-YV0U.js → naniscript-jrYYiXE3.js} +1 -1
- package/dist/app/assets/{nasm-0VzUWfWE.js → nasm-CR4fygO0.js} +1 -1
- package/dist/app/assets/{neon-7L9mJ622.js → neon-Bn9xaC-T.js} +1 -1
- package/dist/app/assets/{nevod-_UYv_FLm.js → nevod-DwwkUQZl.js} +1 -1
- package/dist/app/assets/{nginx-DjVc7ZO-.js → nginx-CxzxW55o.js} +1 -1
- package/dist/app/assets/{nim-DLWLAJSB.js → nim-_ziHrYai.js} +1 -1
- package/dist/app/assets/{nix-Biu8zxbr.js → nix-CnfynVyh.js} +1 -1
- package/dist/app/assets/{nsis-dCQyknmT.js → nsis-CTa60cBQ.js} +1 -1
- package/dist/app/assets/{objectivec-CSM9DCwb.js → objectivec-CxzV-EqQ.js} +1 -1
- package/dist/app/assets/{ocaml-CH0AuJ_r.js → ocaml-CXQfo6wC.js} +1 -1
- package/dist/app/assets/{opencl-JabGmje3.js → opencl-CdW2Jum5.js} +1 -1
- package/dist/app/assets/{openqasm-BGt4V7bR.js → openqasm-99txnqqb.js} +1 -1
- package/dist/app/assets/{oz-DbIu1th5.js → oz-CIEq0aNc.js} +1 -1
- package/dist/app/assets/{parigp-xeAu0pqa.js → parigp-D9vfJxo4.js} +1 -1
- package/dist/app/assets/{parser-BWTLDUYa.js → parser-DndpAxSG.js} +1 -1
- package/dist/app/assets/{pascal-D17KeDTg.js → pascal-RZKxz-_c.js} +1 -1
- package/dist/app/assets/{pascaligo-D2OO9Rgu.js → pascaligo-B7sniYrp.js} +1 -1
- package/dist/app/assets/{pcaxis-BcB430lz.js → pcaxis-B5p4fAPz.js} +1 -1
- package/dist/app/assets/{peoplecode-Y2S6Vb55.js → peoplecode-fCeRfJQ5.js} +1 -1
- package/dist/app/assets/{perl-DS-n0m7F.js → perl-CYh0437K.js} +1 -1
- package/dist/app/assets/{php-extras-CaqAl_Dh.js → php-extras-DCzP567Q.js} +1 -1
- package/dist/app/assets/{php--G5fMCND.js → php-rTdvXKxw.js} +1 -1
- package/dist/app/assets/{phpdoc-DLIcyuW1.js → phpdoc-BLbjAEWJ.js} +1 -1
- package/dist/app/assets/{pieDiagram-DEJITSTG-BhkQtnMG.js → pieDiagram-DEJITSTG-BuH3UT8S.js} +1 -1
- package/dist/app/assets/{plsql-Fq8oOWwI.js → plsql-B9JKIw1T.js} +1 -1
- package/dist/app/assets/{powerquery-CeNFj3PH.js → powerquery-Beeqnhtp.js} +1 -1
- package/dist/app/assets/{powershell-DX9U9N7r.js → powershell-DofDkeyl.js} +1 -1
- package/dist/app/assets/{processing-DkdV2LdA.js → processing-C-Nru_27.js} +1 -1
- package/dist/app/assets/{prolog-BQyE7F2m.js → prolog-Blc4S8Hs.js} +1 -1
- package/dist/app/assets/{promql-CO35w8Xd.js → promql-BsC9xRrD.js} +1 -1
- package/dist/app/assets/{properties-CD226fdu.js → properties-BNFVcgDb.js} +1 -1
- package/dist/app/assets/{protobuf-D44q9Zcx.js → protobuf-BlpX_T1K.js} +1 -1
- package/dist/app/assets/{psl-BKaJpoBk.js → psl-D2Hoa7_4.js} +1 -1
- package/dist/app/assets/{pug-DXId-Es4.js → pug-DBlY2nRe.js} +1 -1
- package/dist/app/assets/{puppet-B6U3R2i1.js → puppet-BfKwQiWD.js} +1 -1
- package/dist/app/assets/{pure-C6n52fSg.js → pure-CgWRG2Cz.js} +1 -1
- package/dist/app/assets/{purebasic-BSRzkysO.js → purebasic-C4IB7b6g.js} +1 -1
- package/dist/app/assets/{purescript-ac4_QHhP.js → purescript-DpbOv2_5.js} +1 -1
- package/dist/app/assets/{q-n7P06m3R.js → q-Bhw7S_Ff.js} +1 -1
- package/dist/app/assets/{qml-Bsb9t-6f.js → qml-BCy5slwb.js} +1 -1
- package/dist/app/assets/{qore-BY0sM7Wa.js → qore-C00kyzGf.js} +1 -1
- package/dist/app/assets/{qsharp-DwMCUEEj.js → qsharp-CN2CDpkI.js} +1 -1
- package/dist/app/assets/{quadrantDiagram-34T5L4WZ-BciQCjKx.js → quadrantDiagram-34T5L4WZ-DF36QwGT.js} +1 -1
- package/dist/app/assets/{r-wuXzKN8w.js → r-B_BK6AZu.js} +1 -1
- package/dist/app/assets/{racket-EWJYOBhv.js → racket-ByLawBwM.js} +1 -1
- package/dist/app/assets/{reason-b1aTIbDw.js → reason-BDBRcGMx.js} +1 -1
- package/dist/app/assets/{regex-BT-NVms-.js → regex-ChgfKyvR.js} +1 -1
- package/dist/app/assets/{rego-BkXfmH_T.js → rego-D_XvU-HX.js} +1 -1
- package/dist/app/assets/{renpy-CWSfrITs.js → renpy-5nIbfjm_.js} +1 -1
- package/dist/app/assets/{requirementDiagram-MS252O5E-Bw_GMi8G.js → requirementDiagram-MS252O5E-DoM__lrz.js} +1 -1
- package/dist/app/assets/{rest-CSIS2oaI.js → rest-D0kyBqSB.js} +1 -1
- package/dist/app/assets/{rip-DA5e5rbA.js → rip-CYiR9G3s.js} +1 -1
- package/dist/app/assets/{roboconf-CGLShPJZ.js → roboconf-NbRqT12s.js} +1 -1
- package/dist/app/assets/{robotframework-AuJ8NHH8.js → robotframework-DVLdugea.js} +1 -1
- package/dist/app/assets/{ruby-Dmo3oqYL.js → ruby-CXYqjyLr.js} +1 -1
- package/dist/app/assets/{rust-Yh4xDsPl.js → rust-DtiosDKR.js} +1 -1
- package/dist/app/assets/{sankeyDiagram-XADWPNL6-CwpL5Ag9.js → sankeyDiagram-XADWPNL6-DAGXEQXz.js} +1 -1
- package/dist/app/assets/{sas-BajPfouh.js → sas-CBuO0A4r.js} +1 -1
- package/dist/app/assets/{sass-BZ3IyTf0.js → sass-DAOC_JY6.js} +1 -1
- package/dist/app/assets/{scala-BJGdd8vd.js → scala-DrjxfsaL.js} +1 -1
- package/dist/app/assets/{scheme-tmXEra4U.js → scheme-Dqq_pAgd.js} +1 -1
- package/dist/app/assets/{scss-Dz5CBs5F.js → scss-Cs8enbPf.js} +1 -1
- package/dist/app/assets/{sequenceDiagram-FGHM5R23-Zb9ONvzy.js → sequenceDiagram-FGHM5R23-D_580_d2.js} +1 -1
- package/dist/app/assets/{shell-session-U_ooQzX-.js → shell-session-jQLXH-IX.js} +1 -1
- package/dist/app/assets/{smali-DMhdPO_F.js → smali-BjlQ2Fb8.js} +1 -1
- package/dist/app/assets/{smalltalk-CtwqxdOy.js → smalltalk-CvvaQ-vE.js} +1 -1
- package/dist/app/assets/{smarty-B-_Ggfpm.js → smarty-CuW15FKs.js} +1 -1
- package/dist/app/assets/{sml-Bvj3KzUv.js → sml-C2rZNwaS.js} +1 -1
- package/dist/app/assets/{solidity-CRfpXCnL.js → solidity-Bz0UCY5q.js} +1 -1
- package/dist/app/assets/{solution-file-CYfvOj9X.js → solution-file-DY6Szhc0.js} +1 -1
- package/dist/app/assets/{soy-DoUU5YOQ.js → soy-DupXqVr6.js} +1 -1
- package/dist/app/assets/{sparql-BRk34Rn9.js → sparql-CKXEGfsk.js} +1 -1
- package/dist/app/assets/{splunk-spl-C5FnseSI.js → splunk-spl-ylrNAn0q.js} +1 -1
- package/dist/app/assets/{sqf-BeyFDkm3.js → sqf-lJvrZCtE.js} +1 -1
- package/dist/app/assets/{sql-D-HqwAd-.js → sql-B7hLAkUR.js} +1 -1
- package/dist/app/assets/{squirrel-cZQ0YNSS.js → squirrel-BH1Y674s.js} +1 -1
- package/dist/app/assets/{stan-zqHKC64S.js → stan-fR7Qg8Ut.js} +1 -1
- package/dist/app/assets/{stateDiagram-FHFEXIEX-CyoWPE1S.js → stateDiagram-FHFEXIEX-B8jUR8FD.js} +1 -1
- package/dist/app/assets/stateDiagram-v2-QKLJ7IA2-ByxORwfu.js +1 -0
- package/dist/app/assets/{stylus-jeXHFpb6.js → stylus-s7kCNuJK.js} +1 -1
- package/dist/app/assets/{swift-DD5qP3LK.js → swift-CCtYkHCf.js} +1 -1
- package/dist/app/assets/{systemd-dyYpUoVh.js → systemd-BCElHahC.js} +1 -1
- package/dist/app/assets/{t4-cs-DdzwIItd.js → t4-cs-H1_QKrKm.js} +1 -1
- package/dist/app/assets/{t4-templating-7MUBL1iq.js → t4-templating-6bPJc-Uq.js} +1 -1
- package/dist/app/assets/{t4-vb-WExQNH7h.js → t4-vb-DJucVBb5.js} +1 -1
- package/dist/app/assets/{tap-BK66GXcT.js → tap-B_SCHNXn.js} +1 -1
- package/dist/app/assets/{tcl-CX-Ne5lF.js → tcl-BNEpqSgM.js} +1 -1
- package/dist/app/assets/{textile-ByimrlEC.js → textile-uWVZjI0f.js} +1 -1
- package/dist/app/assets/{timeline-definition-GMOUNBTQ-uUI7-tyD.js → timeline-definition-GMOUNBTQ-pCO1IuTh.js} +1 -1
- package/dist/app/assets/{toml-BLYx3Nck.js → toml-IfqaxX6C.js} +1 -1
- package/dist/app/assets/{tremor-18nu0iOH.js → tremor-CXc27b0y.js} +1 -1
- package/dist/app/assets/{tt2-bzqhHd_O.js → tt2-CSiBMY4w.js} +1 -1
- package/dist/app/assets/{turtle-Cjm_9khs.js → turtle-BG1NGns7.js} +1 -1
- package/dist/app/assets/{twig-D0iQcF_6.js → twig-BApA7lBN.js} +1 -1
- package/dist/app/assets/{typescript-2OfP3mlH.js → typescript-CRhq3lVo.js} +1 -1
- package/dist/app/assets/{typoscript-BsOytkAv.js → typoscript-CbCyspbX.js} +1 -1
- package/dist/app/assets/{unrealscript-BWxPoPCn.js → unrealscript-C0oIJrK_.js} +1 -1
- package/dist/app/assets/{uorazor-CscffpjI.js → uorazor-CCeC8ukV.js} +1 -1
- package/dist/app/assets/{uri-DoCyUAH6.js → uri-BbJq2oKI.js} +1 -1
- package/dist/app/assets/{v-BTNlJKoZ.js → v-DWbZTbl1.js} +1 -1
- package/dist/app/assets/{vala-DiIqhFLn.js → vala-cNE5mkqv.js} +1 -1
- package/dist/app/assets/{vbnet-CBoOr9B0.js → vbnet-C4ps1ulT.js} +1 -1
- package/dist/app/assets/{velocity-X1I_pFrR.js → velocity-BqiV4VvP.js} +1 -1
- package/dist/app/assets/{vennDiagram-DHZGUBPP-B-52fvBA.js → vennDiagram-DHZGUBPP-DsozMeQe.js} +1 -1
- package/dist/app/assets/{verilog-LAXVYlck.js → verilog-uM22GI8M.js} +1 -1
- package/dist/app/assets/{vhdl-CXjkeBYt.js → vhdl-CjipXQit.js} +1 -1
- package/dist/app/assets/{vim-prtu90pQ.js → vim-DAu-IiFJ.js} +1 -1
- package/dist/app/assets/{visual-basic-B3Hd0Gdb.js → visual-basic-CdGIHeQV.js} +1 -1
- package/dist/app/assets/{wardley-RL74JXVD-BZVhJWb7.js → wardley-RL74JXVD-oEncjGLp.js} +1 -1
- package/dist/app/assets/{wardleyDiagram-NUSXRM2D-Cm0ghnek.js → wardleyDiagram-NUSXRM2D-DNMPqgtw.js} +1 -1
- package/dist/app/assets/{warpscript-0VPXBfCe.js → warpscript-ijeKRGom.js} +1 -1
- package/dist/app/assets/{wasm-6RzyTp2Y.js → wasm-CyK5pI_Y.js} +1 -1
- package/dist/app/assets/{web-idl-rCsaK0nr.js → web-idl-3RbxQwXD.js} +1 -1
- package/dist/app/assets/{wiki-FlEbAGMc.js → wiki-Vqqp-2xX.js} +1 -1
- package/dist/app/assets/{wolfram-DFlSzi0Z.js → wolfram-Bsi7joP0.js} +1 -1
- package/dist/app/assets/{wren-CRHW6GG3.js → wren-WQYmqFb4.js} +1 -1
- package/dist/app/assets/{xeora-BcvzW0pz.js → xeora-D38FYsRy.js} +1 -1
- package/dist/app/assets/{xml-doc-DzJzyzOc.js → xml-doc-wUzx0i81.js} +1 -1
- package/dist/app/assets/{xojo-CX4Uo-V_.js → xojo-CGKogxG9.js} +1 -1
- package/dist/app/assets/{xquery-Cm_nyuyl.js → xquery-Dv5QvWSQ.js} +1 -1
- package/dist/app/assets/{xychartDiagram-5P7HB3ND-CeOBdBC2.js → xychartDiagram-5P7HB3ND-BsbjEvIN.js} +1 -1
- package/dist/app/assets/{yaml-zn_2tPBx.js → yaml-BGAxdcfl.js} +1 -1
- package/dist/app/assets/{yang-9OrfznQV.js → yang-DbR14Qhe.js} +1 -1
- package/dist/app/assets/{zig-DwTTGKoo.js → zig-BZnMCGLn.js} +1 -1
- package/dist/app/index.html +2 -2
- package/dist/index.cjs +1524 -632
- package/dist/index.js +1498 -591
- package/package.json +2 -2
- package/dist/app/assets/channel-Ocy9uBDH.js +0 -1
- package/dist/app/assets/classDiagram-6PBFFD2Q-DPVg45WL.js +0 -1
- package/dist/app/assets/classDiagram-v2-HSJHXN6E-DPVg45WL.js +0 -1
- package/dist/app/assets/clone-AdHtfCx4.js +0 -1
- package/dist/app/assets/index-Cb5pIUJX.css +0 -1
- package/dist/app/assets/stateDiagram-v2-QKLJ7IA2-3eYSeZ9d.js +0 -1
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// src/components/chat.tsx
|
|
2
|
-
import * as
|
|
2
|
+
import * as React44 from "react";
|
|
3
3
|
import {
|
|
4
4
|
ArrowDown as ArrowDown2,
|
|
5
5
|
FileText as FileText3,
|
|
6
6
|
ImageIcon,
|
|
7
|
-
Loader2 as
|
|
7
|
+
Loader2 as Loader26,
|
|
8
8
|
Pencil as Pencil4,
|
|
9
9
|
Quote,
|
|
10
10
|
RefreshCw as RefreshCw2,
|
|
@@ -145,7 +145,7 @@ import {
|
|
|
145
145
|
} from "@xpert-ai/xpert-sdk";
|
|
146
146
|
import "@langchain/core/messages/tool";
|
|
147
147
|
import {
|
|
148
|
-
ChatMessageEventTypeEnum,
|
|
148
|
+
ChatMessageEventTypeEnum as ChatMessageEventTypeEnum2,
|
|
149
149
|
ChatMessageTypeEnum,
|
|
150
150
|
REQUEST_USER_INPUT_RESULT_PURPOSE_IMPLEMENTATION_CONFIRMATION,
|
|
151
151
|
REQUEST_USER_INPUT_RESULT_PURPOSE_PLAN_CLARIFICATION,
|
|
@@ -155,6 +155,26 @@ import {
|
|
|
155
155
|
isClientToolRequest as isClientToolRequest2
|
|
156
156
|
} from "@xpert-ai/chatkit-types";
|
|
157
157
|
|
|
158
|
+
// src/lib/agent-runs.ts
|
|
159
|
+
import {
|
|
160
|
+
ChatMessageEventTypeEnum
|
|
161
|
+
} from "@xpert-ai/chatkit-types";
|
|
162
|
+
function isAgentEventContent(content) {
|
|
163
|
+
return content.type === "agent_event";
|
|
164
|
+
}
|
|
165
|
+
function readContentExecutionId(content) {
|
|
166
|
+
if (!content || typeof content === "string") return void 0;
|
|
167
|
+
return typeof content.executionId === "string" && content.executionId.trim() ? content.executionId.trim() : void 0;
|
|
168
|
+
}
|
|
169
|
+
function readContentParentExecutionId(content) {
|
|
170
|
+
if (!content || typeof content === "string") return void 0;
|
|
171
|
+
return typeof content.parentExecutionId === "string" && content.parentExecutionId.trim() ? content.parentExecutionId.trim() : void 0;
|
|
172
|
+
}
|
|
173
|
+
function readContentAgentKey(content) {
|
|
174
|
+
if (!content || typeof content === "string") return void 0;
|
|
175
|
+
return typeof content.agentKey === "string" && content.agentKey.trim() ? content.agentKey.trim() : void 0;
|
|
176
|
+
}
|
|
177
|
+
|
|
158
178
|
// src/lib/api-config.ts
|
|
159
179
|
function hasConfiguredValue(value) {
|
|
160
180
|
return typeof value === "string" && value.trim().length > 0;
|
|
@@ -1491,6 +1511,38 @@ var en_US_default = {
|
|
|
1491
1511
|
option: "Option",
|
|
1492
1512
|
other: "Other"
|
|
1493
1513
|
},
|
|
1514
|
+
agentRun: {
|
|
1515
|
+
defaultTitle: "Sub-agent",
|
|
1516
|
+
inputLabel: "Input",
|
|
1517
|
+
errorLabel: "Error",
|
|
1518
|
+
status: {
|
|
1519
|
+
running: "Running",
|
|
1520
|
+
success: "Done",
|
|
1521
|
+
error: "Error",
|
|
1522
|
+
replied: "Replied",
|
|
1523
|
+
pending: "Pending",
|
|
1524
|
+
interrupted: "Interrupted",
|
|
1525
|
+
timeout: "Timed out"
|
|
1526
|
+
},
|
|
1527
|
+
counts: {
|
|
1528
|
+
messages: {
|
|
1529
|
+
one: "{{count}} message",
|
|
1530
|
+
other: "{{count}} messages"
|
|
1531
|
+
},
|
|
1532
|
+
tools: {
|
|
1533
|
+
one: "{{count}} tool",
|
|
1534
|
+
other: "{{count}} tools"
|
|
1535
|
+
},
|
|
1536
|
+
events: {
|
|
1537
|
+
one: "{{count}} event",
|
|
1538
|
+
other: "{{count}} events"
|
|
1539
|
+
},
|
|
1540
|
+
children: {
|
|
1541
|
+
one: "{{count}} child agent",
|
|
1542
|
+
other: "{{count}} child agents"
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1545
|
+
},
|
|
1494
1546
|
toolGroup: {
|
|
1495
1547
|
status: {
|
|
1496
1548
|
running: "Processing",
|
|
@@ -1503,6 +1555,7 @@ var en_US_default = {
|
|
|
1503
1555
|
jsonTitle: "JSON",
|
|
1504
1556
|
jsonTree: "Tree",
|
|
1505
1557
|
jsonRaw: "Raw",
|
|
1558
|
+
sourcesTitle: "Sources",
|
|
1506
1559
|
copy: "Copy",
|
|
1507
1560
|
copied: "Copied",
|
|
1508
1561
|
separator: ", ",
|
|
@@ -1783,6 +1836,38 @@ var zh_CN_default = {
|
|
|
1783
1836
|
option: "\u9009\u9879",
|
|
1784
1837
|
other: "\u5176\u4ED6"
|
|
1785
1838
|
},
|
|
1839
|
+
agentRun: {
|
|
1840
|
+
defaultTitle: "\u5B50\u667A\u80FD\u4F53",
|
|
1841
|
+
inputLabel: "\u8F93\u5165",
|
|
1842
|
+
errorLabel: "\u9519\u8BEF",
|
|
1843
|
+
status: {
|
|
1844
|
+
running: "\u8FD0\u884C\u4E2D",
|
|
1845
|
+
success: "\u5DF2\u5B8C\u6210",
|
|
1846
|
+
error: "\u9519\u8BEF",
|
|
1847
|
+
replied: "\u5DF2\u56DE\u590D",
|
|
1848
|
+
pending: "\u7B49\u5F85\u4E2D",
|
|
1849
|
+
interrupted: "\u5DF2\u4E2D\u65AD",
|
|
1850
|
+
timeout: "\u5DF2\u8D85\u65F6"
|
|
1851
|
+
},
|
|
1852
|
+
counts: {
|
|
1853
|
+
messages: {
|
|
1854
|
+
one: "{{count}} \u6761\u6D88\u606F",
|
|
1855
|
+
other: "{{count}} \u6761\u6D88\u606F"
|
|
1856
|
+
},
|
|
1857
|
+
tools: {
|
|
1858
|
+
one: "{{count}} \u4E2A\u5DE5\u5177",
|
|
1859
|
+
other: "{{count}} \u4E2A\u5DE5\u5177"
|
|
1860
|
+
},
|
|
1861
|
+
events: {
|
|
1862
|
+
one: "{{count}} \u4E2A\u4E8B\u4EF6",
|
|
1863
|
+
other: "{{count}} \u4E2A\u4E8B\u4EF6"
|
|
1864
|
+
},
|
|
1865
|
+
children: {
|
|
1866
|
+
one: "{{count}} \u4E2A\u5B50\u667A\u80FD\u4F53",
|
|
1867
|
+
other: "{{count}} \u4E2A\u5B50\u667A\u80FD\u4F53"
|
|
1868
|
+
}
|
|
1869
|
+
}
|
|
1870
|
+
},
|
|
1786
1871
|
toolGroup: {
|
|
1787
1872
|
status: {
|
|
1788
1873
|
running: "\u6B63\u5728\u5904\u7406",
|
|
@@ -1795,6 +1880,7 @@ var zh_CN_default = {
|
|
|
1795
1880
|
jsonTitle: "JSON",
|
|
1796
1881
|
jsonTree: "\u6811\u5F62",
|
|
1797
1882
|
jsonRaw: "\u539F\u59CB",
|
|
1883
|
+
sourcesTitle: "\u4FE1\u606F\u6E90",
|
|
1798
1884
|
copy: "\u590D\u5236",
|
|
1799
1885
|
copied: "\u5DF2\u590D\u5236",
|
|
1800
1886
|
separator: "\uFF0C",
|
|
@@ -3435,7 +3521,17 @@ function SlashPalette({
|
|
|
3435
3521
|
}
|
|
3436
3522
|
),
|
|
3437
3523
|
/* @__PURE__ */ jsxs6("span", { className: "flex min-w-0 flex-1 items-baseline gap-2", children: [
|
|
3438
|
-
/* @__PURE__ */
|
|
3524
|
+
/* @__PURE__ */ jsxs6("span", { className: "flex min-w-0 shrink-0 items-baseline gap-1.5", children: [
|
|
3525
|
+
/* @__PURE__ */ jsx13("span", { className: "truncate font-medium", children: option.label }),
|
|
3526
|
+
option.kind === "command" && option.capabilityType && typeof option.childCount === "number" ? /* @__PURE__ */ jsx13(
|
|
3527
|
+
"span",
|
|
3528
|
+
{
|
|
3529
|
+
"data-slot": "slash-palette-child-count",
|
|
3530
|
+
className: "inline-flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full bg-muted px-1 text-[10px] font-medium leading-none text-muted-foreground",
|
|
3531
|
+
children: option.childCount
|
|
3532
|
+
}
|
|
3533
|
+
) : null
|
|
3534
|
+
] }),
|
|
3439
3535
|
option.description && /* @__PURE__ */ jsx13("span", { className: "min-w-0 flex-1 truncate text-muted-foreground", children: option.description })
|
|
3440
3536
|
] }),
|
|
3441
3537
|
option.kind === "command" && option.capabilityType ? /* @__PURE__ */ jsx13("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center text-muted-foreground", children: option.expanded ? /* @__PURE__ */ jsx13(ChevronDown, { size: 14 }) : /* @__PURE__ */ jsx13(ChevronRight2, { size: 14 }) }) : null
|
|
@@ -6107,19 +6203,22 @@ function resolveRuntimeCapabilityPalette(value, selectionStart) {
|
|
|
6107
6203
|
return null;
|
|
6108
6204
|
}
|
|
6109
6205
|
const beforeCaret = value.slice(0, selectionStart);
|
|
6110
|
-
const match = /(^|\s)
|
|
6206
|
+
const match = /(^|\s)([/$])([^\s/]*)$/.exec(beforeCaret);
|
|
6111
6207
|
if (!match) {
|
|
6112
6208
|
return null;
|
|
6113
6209
|
}
|
|
6114
|
-
const
|
|
6210
|
+
const trigger = match[2];
|
|
6211
|
+
const query = match[3] ?? "";
|
|
6115
6212
|
const start = beforeCaret.length - query.length - 1;
|
|
6116
6213
|
const beforeTrigger = beforeCaret.slice(0, start);
|
|
6117
6214
|
return {
|
|
6215
|
+
trigger,
|
|
6118
6216
|
query,
|
|
6119
6217
|
start,
|
|
6120
6218
|
end: selectionStart,
|
|
6121
6219
|
activeIndex: 0,
|
|
6122
|
-
atMessageStart: beforeTrigger.trim().length === 0
|
|
6220
|
+
atMessageStart: beforeTrigger.trim().length === 0,
|
|
6221
|
+
...trigger === "$" ? { capabilityTypes: ["skill"] } : {}
|
|
6123
6222
|
};
|
|
6124
6223
|
}
|
|
6125
6224
|
function matchesQuery(values, query) {
|
|
@@ -6156,7 +6255,11 @@ function matchesCapability(option, query, capabilityTypes) {
|
|
|
6156
6255
|
if (capabilityTypes?.length && !capabilityTypes.includes(option.type)) {
|
|
6157
6256
|
return false;
|
|
6158
6257
|
}
|
|
6159
|
-
|
|
6258
|
+
const skillAliases = option.type === "skill" ? [`$${option.id}`, `$${option.label}`] : [];
|
|
6259
|
+
return matchesQuery(
|
|
6260
|
+
[option.id, option.label, option.description, option.type, ...skillAliases],
|
|
6261
|
+
query
|
|
6262
|
+
);
|
|
6160
6263
|
}
|
|
6161
6264
|
function getCommandPaletteOption(command) {
|
|
6162
6265
|
const capabilityType = CAPABILITY_GROUP_COMMANDS[command.name];
|
|
@@ -6703,13 +6806,284 @@ function useSlashCommands({
|
|
|
6703
6806
|
}
|
|
6704
6807
|
|
|
6705
6808
|
// src/components/thread/messages/ai.tsx
|
|
6706
|
-
import * as
|
|
6809
|
+
import * as React31 from "react";
|
|
6707
6810
|
import {
|
|
6708
6811
|
ChevronDown as ChevronDown4,
|
|
6709
|
-
Clock3,
|
|
6710
|
-
Loader2 as
|
|
6812
|
+
Clock3 as Clock32,
|
|
6813
|
+
Loader2 as Loader25
|
|
6711
6814
|
} from "lucide-react";
|
|
6712
6815
|
|
|
6816
|
+
// src/lib/agent-run-render-tree.ts
|
|
6817
|
+
function isTextContent(content) {
|
|
6818
|
+
return content.type === "text";
|
|
6819
|
+
}
|
|
6820
|
+
function isReasoningContent(content) {
|
|
6821
|
+
return content.type === "reasoning";
|
|
6822
|
+
}
|
|
6823
|
+
function isComponentContent(content) {
|
|
6824
|
+
return content.type === "component";
|
|
6825
|
+
}
|
|
6826
|
+
function parseDateValue(value) {
|
|
6827
|
+
if (value instanceof Date) {
|
|
6828
|
+
const timestamp2 = value.getTime();
|
|
6829
|
+
return Number.isNaN(timestamp2) ? null : timestamp2;
|
|
6830
|
+
}
|
|
6831
|
+
if (typeof value !== "string") {
|
|
6832
|
+
return null;
|
|
6833
|
+
}
|
|
6834
|
+
const timestamp = Date.parse(value);
|
|
6835
|
+
return Number.isNaN(timestamp) ? null : timestamp;
|
|
6836
|
+
}
|
|
6837
|
+
function readContentTitle(content) {
|
|
6838
|
+
if (typeof content === "string") return void 0;
|
|
6839
|
+
if (typeof content.xpertName === "string" && content.xpertName.trim()) {
|
|
6840
|
+
return content.xpertName.trim();
|
|
6841
|
+
}
|
|
6842
|
+
return void 0;
|
|
6843
|
+
}
|
|
6844
|
+
function readContentStringField(content, field) {
|
|
6845
|
+
if (typeof content === "string") return void 0;
|
|
6846
|
+
const value = content[field];
|
|
6847
|
+
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
6848
|
+
}
|
|
6849
|
+
function normalizeRunStatus(status) {
|
|
6850
|
+
return typeof status === "string" && status.trim() ? status.trim().toLowerCase() : "pending";
|
|
6851
|
+
}
|
|
6852
|
+
function isRunningRunStatus(status) {
|
|
6853
|
+
return normalizeRunStatus(status) === "running";
|
|
6854
|
+
}
|
|
6855
|
+
function isFailedRunStatus(status) {
|
|
6856
|
+
const normalized = normalizeRunStatus(status);
|
|
6857
|
+
return normalized === "error" || normalized === "fail" || normalized === "failed";
|
|
6858
|
+
}
|
|
6859
|
+
function hasVisibleAgentRunDetails(info) {
|
|
6860
|
+
return info.error !== void 0;
|
|
6861
|
+
}
|
|
6862
|
+
function getAgentRunTitle(info, fallback) {
|
|
6863
|
+
return info.title?.trim() || info.xpertName?.trim() || info.agentKey?.trim() || fallback || null;
|
|
6864
|
+
}
|
|
6865
|
+
function getAgentRunDuration(info) {
|
|
6866
|
+
if (typeof info.elapsedTime === "number" && Number.isFinite(info.elapsedTime)) {
|
|
6867
|
+
return info.elapsedTime;
|
|
6868
|
+
}
|
|
6869
|
+
const startedAt = parseDateValue(info.startedAt) ?? parseDateValue(info.createdAt);
|
|
6870
|
+
const endedAt = parseDateValue(info.endedAt) ?? parseDateValue(info.updatedAt);
|
|
6871
|
+
if (startedAt === null || endedAt === null) return null;
|
|
6872
|
+
return Math.max(0, endedAt - startedAt);
|
|
6873
|
+
}
|
|
6874
|
+
function getAgentRunCounts(node) {
|
|
6875
|
+
let text = 0;
|
|
6876
|
+
let tools = 0;
|
|
6877
|
+
let events = 0;
|
|
6878
|
+
for (const entry of node.entries) {
|
|
6879
|
+
const item = entry.item;
|
|
6880
|
+
if (typeof item === "string") {
|
|
6881
|
+
if (item.trim()) text += 1;
|
|
6882
|
+
continue;
|
|
6883
|
+
}
|
|
6884
|
+
if (isTextContent(item) || isReasoningContent(item)) {
|
|
6885
|
+
if (item.text?.trim()) text += 1;
|
|
6886
|
+
continue;
|
|
6887
|
+
}
|
|
6888
|
+
if (isComponentContent(item)) {
|
|
6889
|
+
tools += 1;
|
|
6890
|
+
continue;
|
|
6891
|
+
}
|
|
6892
|
+
if (isAgentEventContent(item)) {
|
|
6893
|
+
events += 1;
|
|
6894
|
+
}
|
|
6895
|
+
}
|
|
6896
|
+
return {
|
|
6897
|
+
text,
|
|
6898
|
+
tools,
|
|
6899
|
+
events,
|
|
6900
|
+
children: node.children.length
|
|
6901
|
+
};
|
|
6902
|
+
}
|
|
6903
|
+
function createAgentRunNode(nodes, id, info, order) {
|
|
6904
|
+
const existing = nodes.get(id);
|
|
6905
|
+
if (existing) {
|
|
6906
|
+
existing.info = {
|
|
6907
|
+
...existing.info,
|
|
6908
|
+
...info,
|
|
6909
|
+
id,
|
|
6910
|
+
parentId: info.parentId ?? existing.info.parentId,
|
|
6911
|
+
parentExecutionId: info.parentExecutionId ?? existing.info.parentExecutionId,
|
|
6912
|
+
agentKey: info.agentKey ?? existing.info.agentKey,
|
|
6913
|
+
xpertName: info.xpertName ?? existing.info.xpertName,
|
|
6914
|
+
title: info.title ?? existing.info.title,
|
|
6915
|
+
status: info.status ?? existing.info.status,
|
|
6916
|
+
elapsedTime: info.elapsedTime ?? existing.info.elapsedTime,
|
|
6917
|
+
error: info.error ?? existing.info.error,
|
|
6918
|
+
inputs: info.inputs ?? existing.info.inputs
|
|
6919
|
+
};
|
|
6920
|
+
existing.firstOrder = Math.min(existing.firstOrder, order);
|
|
6921
|
+
return existing;
|
|
6922
|
+
}
|
|
6923
|
+
const node = {
|
|
6924
|
+
id,
|
|
6925
|
+
info: { ...info, id },
|
|
6926
|
+
entries: [],
|
|
6927
|
+
children: [],
|
|
6928
|
+
firstOrder: order
|
|
6929
|
+
};
|
|
6930
|
+
nodes.set(id, node);
|
|
6931
|
+
return node;
|
|
6932
|
+
}
|
|
6933
|
+
function findFallbackRunByAgentKey(runs, agentKey, rootExecutionId) {
|
|
6934
|
+
if (!agentKey) return null;
|
|
6935
|
+
const candidates = runs.filter(
|
|
6936
|
+
(run) => run.agentKey === agentKey && run.id !== rootExecutionId
|
|
6937
|
+
);
|
|
6938
|
+
if (candidates.length === 0) return null;
|
|
6939
|
+
for (let index = candidates.length - 1; index >= 0; index -= 1) {
|
|
6940
|
+
if (isRunningRunStatus(candidates[index].status)) {
|
|
6941
|
+
return candidates[index];
|
|
6942
|
+
}
|
|
6943
|
+
}
|
|
6944
|
+
return candidates[candidates.length - 1];
|
|
6945
|
+
}
|
|
6946
|
+
function getEntryRunTarget(entry, runs, rootExecutionId) {
|
|
6947
|
+
const item = entry.item;
|
|
6948
|
+
const executionId = readContentExecutionId(item);
|
|
6949
|
+
const parentExecutionId = readContentParentExecutionId(item);
|
|
6950
|
+
const agentKey = readContentAgentKey(item);
|
|
6951
|
+
if (executionId) {
|
|
6952
|
+
return {
|
|
6953
|
+
executionId,
|
|
6954
|
+
parentExecutionId,
|
|
6955
|
+
agentKey
|
|
6956
|
+
};
|
|
6957
|
+
}
|
|
6958
|
+
const fallbackRun = findFallbackRunByAgentKey(
|
|
6959
|
+
runs,
|
|
6960
|
+
agentKey,
|
|
6961
|
+
rootExecutionId
|
|
6962
|
+
);
|
|
6963
|
+
if (!fallbackRun) return null;
|
|
6964
|
+
return {
|
|
6965
|
+
executionId: fallbackRun.id,
|
|
6966
|
+
parentExecutionId: fallbackRun.parentId ?? fallbackRun.parentExecutionId,
|
|
6967
|
+
agentKey
|
|
6968
|
+
};
|
|
6969
|
+
}
|
|
6970
|
+
function createInfoFromEntry(id, entry, parentExecutionId) {
|
|
6971
|
+
return {
|
|
6972
|
+
id,
|
|
6973
|
+
...parentExecutionId ? { parentId: parentExecutionId, parentExecutionId } : {},
|
|
6974
|
+
...readContentAgentKey(entry.item) ? { agentKey: readContentAgentKey(entry.item) } : {},
|
|
6975
|
+
...readContentTitle(entry.item) ? { xpertName: readContentTitle(entry.item) } : {},
|
|
6976
|
+
...readContentStringField(entry.item, "runId") ? { runId: readContentStringField(entry.item, "runId") } : {}
|
|
6977
|
+
};
|
|
6978
|
+
}
|
|
6979
|
+
function normalizeAssistantEntries(message) {
|
|
6980
|
+
const entries = [];
|
|
6981
|
+
if (typeof message.content === "string") {
|
|
6982
|
+
if (message.content.trim()) {
|
|
6983
|
+
entries.push({
|
|
6984
|
+
item: message.content,
|
|
6985
|
+
index: 0,
|
|
6986
|
+
source: "content",
|
|
6987
|
+
order: 0
|
|
6988
|
+
});
|
|
6989
|
+
}
|
|
6990
|
+
} else if (Array.isArray(message.content)) {
|
|
6991
|
+
message.content.forEach((item, index) => {
|
|
6992
|
+
entries.push({
|
|
6993
|
+
item,
|
|
6994
|
+
index,
|
|
6995
|
+
source: "content",
|
|
6996
|
+
order: index
|
|
6997
|
+
});
|
|
6998
|
+
});
|
|
6999
|
+
}
|
|
7000
|
+
const contentCount = entries.length;
|
|
7001
|
+
(message.reasoning ?? []).forEach((item, index) => {
|
|
7002
|
+
entries.push({
|
|
7003
|
+
item,
|
|
7004
|
+
index,
|
|
7005
|
+
source: "reasoning",
|
|
7006
|
+
order: contentCount + index
|
|
7007
|
+
});
|
|
7008
|
+
});
|
|
7009
|
+
return entries;
|
|
7010
|
+
}
|
|
7011
|
+
function refreshAgentNodeOrder(node) {
|
|
7012
|
+
let order = node.firstOrder;
|
|
7013
|
+
for (const child of node.children) {
|
|
7014
|
+
order = Math.min(order, refreshAgentNodeOrder(child));
|
|
7015
|
+
}
|
|
7016
|
+
node.firstOrder = order;
|
|
7017
|
+
node.children.sort((a, b) => a.firstOrder - b.firstOrder);
|
|
7018
|
+
return order;
|
|
7019
|
+
}
|
|
7020
|
+
function buildAssistantRenderTree(message) {
|
|
7021
|
+
const rootExecutionId = message.executionId;
|
|
7022
|
+
const runs = message.agentRuns ?? [];
|
|
7023
|
+
const entries = normalizeAssistantEntries(message);
|
|
7024
|
+
const nodes = /* @__PURE__ */ new Map();
|
|
7025
|
+
const rootEntries = [];
|
|
7026
|
+
const rootReasoning = [];
|
|
7027
|
+
const baseOrder = entries.length + 1;
|
|
7028
|
+
runs.forEach((run, index) => {
|
|
7029
|
+
createAgentRunNode(nodes, run.id, run, baseOrder + index / 1e3);
|
|
7030
|
+
});
|
|
7031
|
+
for (const entry of entries) {
|
|
7032
|
+
const target = getEntryRunTarget(entry, runs, rootExecutionId);
|
|
7033
|
+
const shouldGroup = Boolean(target?.executionId) && (target?.executionId !== rootExecutionId || Boolean(target?.parentExecutionId));
|
|
7034
|
+
if (!target || !shouldGroup) {
|
|
7035
|
+
if (entry.source === "reasoning" && typeof entry.item !== "string") {
|
|
7036
|
+
rootReasoning.push(entry.item);
|
|
7037
|
+
} else {
|
|
7038
|
+
rootEntries.push(entry);
|
|
7039
|
+
}
|
|
7040
|
+
continue;
|
|
7041
|
+
}
|
|
7042
|
+
const node = createAgentRunNode(
|
|
7043
|
+
nodes,
|
|
7044
|
+
target.executionId,
|
|
7045
|
+
createInfoFromEntry(target.executionId, entry, target.parentExecutionId),
|
|
7046
|
+
entry.order
|
|
7047
|
+
);
|
|
7048
|
+
node.entries.push(entry);
|
|
7049
|
+
node.firstOrder = Math.min(node.firstOrder, entry.order);
|
|
7050
|
+
}
|
|
7051
|
+
const roots = [];
|
|
7052
|
+
for (const node of nodes.values()) {
|
|
7053
|
+
if (node.id === rootExecutionId && !node.info.parentId) {
|
|
7054
|
+
continue;
|
|
7055
|
+
}
|
|
7056
|
+
const parentId = node.info.parentId ?? node.info.parentExecutionId;
|
|
7057
|
+
if (parentId && parentId !== rootExecutionId && parentId !== node.id) {
|
|
7058
|
+
const parent = nodes.get(parentId);
|
|
7059
|
+
if (parent) {
|
|
7060
|
+
parent.children.push(node);
|
|
7061
|
+
continue;
|
|
7062
|
+
}
|
|
7063
|
+
}
|
|
7064
|
+
roots.push(node);
|
|
7065
|
+
}
|
|
7066
|
+
roots.forEach(refreshAgentNodeOrder);
|
|
7067
|
+
roots.sort((a, b) => a.firstOrder - b.firstOrder);
|
|
7068
|
+
const units = [
|
|
7069
|
+
...rootEntries.map((entry) => ({
|
|
7070
|
+
type: "entry",
|
|
7071
|
+
entry,
|
|
7072
|
+
order: entry.order
|
|
7073
|
+
})),
|
|
7074
|
+
...roots.map((node) => ({
|
|
7075
|
+
type: "agent",
|
|
7076
|
+
node,
|
|
7077
|
+
order: node.firstOrder
|
|
7078
|
+
}))
|
|
7079
|
+
].sort((a, b) => a.order - b.order);
|
|
7080
|
+
return {
|
|
7081
|
+
units,
|
|
7082
|
+
rootReasoning,
|
|
7083
|
+
hasAgentRuns: roots.length > 0
|
|
7084
|
+
};
|
|
7085
|
+
}
|
|
7086
|
+
|
|
6713
7087
|
// src/components/ui/badge.tsx
|
|
6714
7088
|
import * as React24 from "react";
|
|
6715
7089
|
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
@@ -7924,26 +8298,436 @@ var MarkdownTextImpl = ({ children }) => {
|
|
|
7924
8298
|
};
|
|
7925
8299
|
var MarkdownText = memo(MarkdownTextImpl);
|
|
7926
8300
|
|
|
7927
|
-
// src/components/thread/messages/
|
|
8301
|
+
// src/components/thread/messages/agent-run-group.tsx
|
|
7928
8302
|
import * as React28 from "react";
|
|
8303
|
+
import {
|
|
8304
|
+
Bot as Bot3,
|
|
8305
|
+
Braces,
|
|
8306
|
+
CheckCircle2 as CheckCircle22,
|
|
8307
|
+
ChevronRight as ChevronRight6,
|
|
8308
|
+
Clock3,
|
|
8309
|
+
GitBranch,
|
|
8310
|
+
Info as Info4,
|
|
8311
|
+
Loader2 as Loader23,
|
|
8312
|
+
MessageSquareText,
|
|
8313
|
+
Wrench,
|
|
8314
|
+
XCircle
|
|
8315
|
+
} from "lucide-react";
|
|
8316
|
+
import { jsx as jsx31, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
8317
|
+
function safeJson2(value) {
|
|
8318
|
+
try {
|
|
8319
|
+
return JSON.stringify(value, null, 2);
|
|
8320
|
+
} catch {
|
|
8321
|
+
return String(value);
|
|
8322
|
+
}
|
|
8323
|
+
}
|
|
8324
|
+
function formatDisplayValue2(value) {
|
|
8325
|
+
return typeof value === "string" ? value : safeJson2(value);
|
|
8326
|
+
}
|
|
8327
|
+
function formatStepDuration(durationMs) {
|
|
8328
|
+
if (durationMs < 1e3) {
|
|
8329
|
+
return `${durationMs}ms`;
|
|
8330
|
+
}
|
|
8331
|
+
if (durationMs < 1e4) {
|
|
8332
|
+
return `${(durationMs / 1e3).toFixed(1)}s`;
|
|
8333
|
+
}
|
|
8334
|
+
if (durationMs < 6e4) {
|
|
8335
|
+
return `${Math.round(durationMs / 1e3)}s`;
|
|
8336
|
+
}
|
|
8337
|
+
const hours = Math.floor(durationMs / 36e5);
|
|
8338
|
+
const minutes = Math.floor(durationMs % 36e5 / 6e4);
|
|
8339
|
+
const seconds = Math.floor(durationMs % 6e4 / 1e3);
|
|
8340
|
+
if (hours > 0) {
|
|
8341
|
+
return `${hours}h ${minutes}m ${seconds}s`;
|
|
8342
|
+
}
|
|
8343
|
+
return `${minutes}m ${seconds}s`;
|
|
8344
|
+
}
|
|
8345
|
+
function getAgentRunStatusConfig(status, hasReply = false) {
|
|
8346
|
+
const normalized = normalizeRunStatus(status);
|
|
8347
|
+
if (normalized === "running") {
|
|
8348
|
+
return {
|
|
8349
|
+
icon: Loader23,
|
|
8350
|
+
iconClass: "text-blue-700",
|
|
8351
|
+
labelKey: "running",
|
|
8352
|
+
spin: true
|
|
8353
|
+
};
|
|
8354
|
+
}
|
|
8355
|
+
if (normalized === "success" || normalized === "succeeded") {
|
|
8356
|
+
return {
|
|
8357
|
+
icon: CheckCircle22,
|
|
8358
|
+
iconClass: "text-green-700",
|
|
8359
|
+
labelKey: "success",
|
|
8360
|
+
spin: false
|
|
8361
|
+
};
|
|
8362
|
+
}
|
|
8363
|
+
if (isFailedRunStatus(normalized)) {
|
|
8364
|
+
return {
|
|
8365
|
+
icon: XCircle,
|
|
8366
|
+
iconClass: "text-red-700",
|
|
8367
|
+
labelKey: "error",
|
|
8368
|
+
spin: false
|
|
8369
|
+
};
|
|
8370
|
+
}
|
|
8371
|
+
if (normalized === "pending" && hasReply) {
|
|
8372
|
+
return {
|
|
8373
|
+
icon: CheckCircle22,
|
|
8374
|
+
iconClass: "text-green-700",
|
|
8375
|
+
labelKey: "replied",
|
|
8376
|
+
spin: false
|
|
8377
|
+
};
|
|
8378
|
+
}
|
|
8379
|
+
return {
|
|
8380
|
+
icon: Clock3,
|
|
8381
|
+
iconClass: "text-muted-foreground",
|
|
8382
|
+
labelKey: normalized,
|
|
8383
|
+
spin: false
|
|
8384
|
+
};
|
|
8385
|
+
}
|
|
8386
|
+
function AgentRunHeaderMetric({
|
|
8387
|
+
icon: Icon,
|
|
8388
|
+
label,
|
|
8389
|
+
value,
|
|
8390
|
+
children
|
|
8391
|
+
}) {
|
|
8392
|
+
return /* @__PURE__ */ jsxs19(Tooltip, { children: [
|
|
8393
|
+
/* @__PURE__ */ jsx31(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs19(
|
|
8394
|
+
"span",
|
|
8395
|
+
{
|
|
8396
|
+
"aria-label": label,
|
|
8397
|
+
className: "inline-flex shrink-0 items-center gap-1 rounded-sm text-[11px] text-muted-foreground/60 transition-colors group-hover/agent:text-muted-foreground",
|
|
8398
|
+
children: [
|
|
8399
|
+
/* @__PURE__ */ jsx31(Icon, { className: "h-3.5 w-3.5" }),
|
|
8400
|
+
value !== void 0 ? /* @__PURE__ */ jsx31("span", { children: value }) : null
|
|
8401
|
+
]
|
|
8402
|
+
}
|
|
8403
|
+
) }),
|
|
8404
|
+
/* @__PURE__ */ jsx31(TooltipContent, { side: "top", sideOffset: 6, className: "max-w-80 text-left", children })
|
|
8405
|
+
] });
|
|
8406
|
+
}
|
|
8407
|
+
function getAgentNodeUnits(node) {
|
|
8408
|
+
return [
|
|
8409
|
+
...node.entries.map((entry) => ({
|
|
8410
|
+
type: "entry",
|
|
8411
|
+
entry,
|
|
8412
|
+
order: entry.order
|
|
8413
|
+
})),
|
|
8414
|
+
...node.children.map((child) => ({
|
|
8415
|
+
type: "agent",
|
|
8416
|
+
node: child,
|
|
8417
|
+
order: child.firstOrder
|
|
8418
|
+
}))
|
|
8419
|
+
].sort((a, b) => a.order - b.order);
|
|
8420
|
+
}
|
|
8421
|
+
function AgentEventRow({ content }) {
|
|
8422
|
+
const label = content.title?.trim() || content.message?.trim() || content.event?.trim() || "Event";
|
|
8423
|
+
const detail = content.title?.trim() && content.message?.trim() ? content.message.trim() : null;
|
|
8424
|
+
const isError = content.error !== void 0 || isFailedRunStatus(content.status);
|
|
8425
|
+
return /* @__PURE__ */ jsxs19(
|
|
8426
|
+
"div",
|
|
8427
|
+
{
|
|
8428
|
+
className: cn(
|
|
8429
|
+
"flex items-start gap-2 rounded-md px-2 py-1.5 text-xs leading-5",
|
|
8430
|
+
isError ? "bg-destructive/10 text-destructive" : "bg-muted/40 text-muted-foreground"
|
|
8431
|
+
),
|
|
8432
|
+
children: [
|
|
8433
|
+
/* @__PURE__ */ jsx31(Info4, { className: "mt-0.5 h-3.5 w-3.5 shrink-0" }),
|
|
8434
|
+
/* @__PURE__ */ jsxs19("div", { className: "min-w-0 flex-1", children: [
|
|
8435
|
+
/* @__PURE__ */ jsx31("div", { className: "truncate font-medium", children: label }),
|
|
8436
|
+
detail ? /* @__PURE__ */ jsx31("div", { className: "wrap-break-word", children: detail }) : null,
|
|
8437
|
+
content.error !== void 0 ? /* @__PURE__ */ jsx31("pre", { className: "mt-1 whitespace-pre-wrap wrap-break-word", children: formatDisplayValue2(content.error) }) : null
|
|
8438
|
+
] })
|
|
8439
|
+
]
|
|
8440
|
+
}
|
|
8441
|
+
);
|
|
8442
|
+
}
|
|
8443
|
+
function AgentRunGroup({
|
|
8444
|
+
node,
|
|
8445
|
+
hasFollowingItem,
|
|
8446
|
+
depth,
|
|
8447
|
+
renderUnits
|
|
8448
|
+
}) {
|
|
8449
|
+
const { t } = useChatkitTranslation();
|
|
8450
|
+
const counts = getAgentRunCounts(node);
|
|
8451
|
+
const statusConfig = getAgentRunStatusConfig(
|
|
8452
|
+
node.info.status,
|
|
8453
|
+
counts.text > 0
|
|
8454
|
+
);
|
|
8455
|
+
const StatusIcon = statusConfig.icon;
|
|
8456
|
+
const isRunning = isRunningRunStatus(node.info.status);
|
|
8457
|
+
const [isExpanded, setIsExpanded] = React28.useState(
|
|
8458
|
+
() => isRunning || !hasFollowingItem
|
|
8459
|
+
);
|
|
8460
|
+
const title = getAgentRunTitle(node.info, t("message.agentRun.defaultTitle"));
|
|
8461
|
+
const duration = getAgentRunDuration(node.info);
|
|
8462
|
+
const statusLabel = t(`message.agentRun.status.${statusConfig.labelKey}`, {
|
|
8463
|
+
defaultValue: node.info.status ?? statusConfig.labelKey
|
|
8464
|
+
});
|
|
8465
|
+
const detailsId = React28.useId();
|
|
8466
|
+
React28.useEffect(() => {
|
|
8467
|
+
if (isRunning) {
|
|
8468
|
+
setIsExpanded(true);
|
|
8469
|
+
return;
|
|
8470
|
+
}
|
|
8471
|
+
setIsExpanded(!hasFollowingItem);
|
|
8472
|
+
}, [hasFollowingItem, isRunning]);
|
|
8473
|
+
const countItems = [
|
|
8474
|
+
counts.text > 0 ? {
|
|
8475
|
+
icon: MessageSquareText,
|
|
8476
|
+
count: counts.text,
|
|
8477
|
+
label: t(
|
|
8478
|
+
`message.agentRun.counts.messages.${counts.text === 1 ? "one" : "other"}`,
|
|
8479
|
+
{ count: counts.text }
|
|
8480
|
+
)
|
|
8481
|
+
} : null,
|
|
8482
|
+
counts.tools > 0 ? {
|
|
8483
|
+
icon: Wrench,
|
|
8484
|
+
count: counts.tools,
|
|
8485
|
+
label: t(
|
|
8486
|
+
`message.agentRun.counts.tools.${counts.tools === 1 ? "one" : "other"}`,
|
|
8487
|
+
{ count: counts.tools }
|
|
8488
|
+
)
|
|
8489
|
+
} : null,
|
|
8490
|
+
counts.events > 0 ? {
|
|
8491
|
+
icon: Info4,
|
|
8492
|
+
count: counts.events,
|
|
8493
|
+
label: t(
|
|
8494
|
+
`message.agentRun.counts.events.${counts.events === 1 ? "one" : "other"}`,
|
|
8495
|
+
{ count: counts.events }
|
|
8496
|
+
)
|
|
8497
|
+
} : null,
|
|
8498
|
+
counts.children > 0 ? {
|
|
8499
|
+
icon: GitBranch,
|
|
8500
|
+
count: counts.children,
|
|
8501
|
+
label: t(
|
|
8502
|
+
`message.agentRun.counts.children.${counts.children === 1 ? "one" : "other"}`,
|
|
8503
|
+
{ count: counts.children }
|
|
8504
|
+
)
|
|
8505
|
+
} : null
|
|
8506
|
+
].filter(
|
|
8507
|
+
(item) => Boolean(item)
|
|
8508
|
+
);
|
|
8509
|
+
return /* @__PURE__ */ jsxs19("div", { className: cn("border-l border-border/70 pl-2", depth > 0 ? "ml-1" : "-mx-2.5"), children: [
|
|
8510
|
+
/* @__PURE__ */ jsxs19(
|
|
8511
|
+
"button",
|
|
8512
|
+
{
|
|
8513
|
+
type: "button",
|
|
8514
|
+
className: "group/agent group-agent flex w-full items-start justify-between gap-2 rounded-md px-0 py-1.5 text-left",
|
|
8515
|
+
"aria-expanded": isExpanded,
|
|
8516
|
+
"aria-controls": detailsId,
|
|
8517
|
+
onClick: () => setIsExpanded((prev) => !prev),
|
|
8518
|
+
children: [
|
|
8519
|
+
/* @__PURE__ */ jsx31("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsxs19("div", { className: "flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-1", children: [
|
|
8520
|
+
/* @__PURE__ */ jsx31(Bot3, { className: "h-4 w-4 shrink-0 text-muted-foreground/55 transition-colors group-hover/agent:text-muted-foreground" }),
|
|
8521
|
+
/* @__PURE__ */ jsx31("span", { className: "min-w-0 max-w-[16rem] truncate text-sm font-medium text-foreground/65 transition-colors group-hover/agent:text-foreground", children: title }),
|
|
8522
|
+
/* @__PURE__ */ jsxs19("span", { className: "inline-flex shrink-0 items-center gap-1 text-[11px] text-muted-foreground/65 transition-colors group-hover/agent:text-muted-foreground", children: [
|
|
8523
|
+
/* @__PURE__ */ jsx31(
|
|
8524
|
+
StatusIcon,
|
|
8525
|
+
{
|
|
8526
|
+
className: cn(
|
|
8527
|
+
"h-3.5 w-3.5",
|
|
8528
|
+
statusConfig.iconClass,
|
|
8529
|
+
statusConfig.spin && "animate-spin"
|
|
8530
|
+
)
|
|
8531
|
+
}
|
|
8532
|
+
),
|
|
8533
|
+
statusLabel
|
|
8534
|
+
] }),
|
|
8535
|
+
duration !== null ? /* @__PURE__ */ jsxs19("span", { className: "inline-flex shrink-0 items-center gap-1 text-[11px] text-muted-foreground/60 tabular-nums transition-colors group-hover/agent:text-muted-foreground", children: [
|
|
8536
|
+
/* @__PURE__ */ jsx31(Clock3, { className: "h-3 w-3" }),
|
|
8537
|
+
formatStepDuration(duration)
|
|
8538
|
+
] }) : null,
|
|
8539
|
+
node.info.inputs !== void 0 ? /* @__PURE__ */ jsx31(
|
|
8540
|
+
AgentRunHeaderMetric,
|
|
8541
|
+
{
|
|
8542
|
+
icon: Braces,
|
|
8543
|
+
label: t("message.agentRun.inputLabel"),
|
|
8544
|
+
children: /* @__PURE__ */ jsxs19("div", { className: "space-y-1", children: [
|
|
8545
|
+
/* @__PURE__ */ jsx31("div", { className: "font-medium", children: t("message.agentRun.inputLabel") }),
|
|
8546
|
+
/* @__PURE__ */ jsx31("pre", { className: "max-h-64 overflow-auto whitespace-pre-wrap wrap-break-word text-xs", children: formatDisplayValue2(node.info.inputs) })
|
|
8547
|
+
] })
|
|
8548
|
+
}
|
|
8549
|
+
) : null,
|
|
8550
|
+
countItems.map((item) => {
|
|
8551
|
+
const CountIcon = item.icon;
|
|
8552
|
+
return /* @__PURE__ */ jsx31(
|
|
8553
|
+
AgentRunHeaderMetric,
|
|
8554
|
+
{
|
|
8555
|
+
icon: CountIcon,
|
|
8556
|
+
label: item.label,
|
|
8557
|
+
value: item.count,
|
|
8558
|
+
children: /* @__PURE__ */ jsx31("span", { children: item.label })
|
|
8559
|
+
},
|
|
8560
|
+
item.label
|
|
8561
|
+
);
|
|
8562
|
+
})
|
|
8563
|
+
] }) }),
|
|
8564
|
+
/* @__PURE__ */ jsx31(
|
|
8565
|
+
ChevronRight6,
|
|
8566
|
+
{
|
|
8567
|
+
"aria-hidden": "true",
|
|
8568
|
+
className: cn(
|
|
8569
|
+
"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground/55 opacity-0 transition-[color,transform] group-hover/agent:text-muted-foreground group-hover/agent:opacity-100",
|
|
8570
|
+
isExpanded && "rotate-90"
|
|
8571
|
+
)
|
|
8572
|
+
}
|
|
8573
|
+
)
|
|
8574
|
+
]
|
|
8575
|
+
}
|
|
8576
|
+
),
|
|
8577
|
+
isExpanded ? /* @__PURE__ */ jsxs19("div", { id: detailsId, className: "mt-2 space-y-3", children: [
|
|
8578
|
+
hasVisibleAgentRunDetails(node.info) ? /* @__PURE__ */ jsx31("div", { className: "space-y-2 rounded-md bg-muted/30 px-2 py-2 text-xs text-muted-foreground", children: node.info.error !== void 0 ? /* @__PURE__ */ jsxs19("div", { children: [
|
|
8579
|
+
/* @__PURE__ */ jsx31("div", { className: "mb-1 font-medium text-destructive", children: t("message.agentRun.errorLabel") }),
|
|
8580
|
+
/* @__PURE__ */ jsx31("pre", { className: "whitespace-pre-wrap wrap-break-word text-destructive", children: formatDisplayValue2(node.info.error) })
|
|
8581
|
+
] }) : null }) : null,
|
|
8582
|
+
renderUnits(getAgentNodeUnits(node), depth + 1)
|
|
8583
|
+
] }) : null
|
|
8584
|
+
] });
|
|
8585
|
+
}
|
|
8586
|
+
|
|
8587
|
+
// src/components/thread/messages/web-search-component-renderer.tsx
|
|
8588
|
+
import { jsx as jsx32, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
8589
|
+
var webSearchComponentRenderer = {
|
|
8590
|
+
id: "computer-web-search-sources",
|
|
8591
|
+
presentation: "grouped-step",
|
|
8592
|
+
match: isComputerWebSearchComponent,
|
|
8593
|
+
hasDetails: hasWebSearchSources,
|
|
8594
|
+
renderDetails: WebSearchToolCallOutput
|
|
8595
|
+
};
|
|
8596
|
+
function normalizeToolToken(value) {
|
|
8597
|
+
if (typeof value !== "string") return null;
|
|
8598
|
+
const normalized = value.trim().toLowerCase().replace(/[\s-]+/g, "_");
|
|
8599
|
+
return normalized || null;
|
|
8600
|
+
}
|
|
8601
|
+
function readOptionalString(value) {
|
|
8602
|
+
if (typeof value !== "string") return void 0;
|
|
8603
|
+
const trimmed = value.trim();
|
|
8604
|
+
return trimmed || void 0;
|
|
8605
|
+
}
|
|
8606
|
+
function normalizeWebSearchSource(value) {
|
|
8607
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
8608
|
+
return null;
|
|
8609
|
+
}
|
|
8610
|
+
const candidate = value;
|
|
8611
|
+
const title = readOptionalString(candidate.title);
|
|
8612
|
+
const url = readOptionalString(candidate.url);
|
|
8613
|
+
if (!title || !url) return null;
|
|
8614
|
+
const content = readOptionalString(candidate.content);
|
|
8615
|
+
const description = readOptionalString(candidate.description);
|
|
8616
|
+
const publishedDate = readOptionalString(
|
|
8617
|
+
candidate.publishedDate ?? candidate.published_date ?? candidate.publishedAt
|
|
8618
|
+
);
|
|
8619
|
+
const author = readOptionalString(candidate.author);
|
|
8620
|
+
return {
|
|
8621
|
+
title,
|
|
8622
|
+
url,
|
|
8623
|
+
...content ? { content } : {},
|
|
8624
|
+
...description ? { description } : {},
|
|
8625
|
+
...publishedDate ? { publishedDate } : {},
|
|
8626
|
+
...author ? { author } : {}
|
|
8627
|
+
};
|
|
8628
|
+
}
|
|
8629
|
+
function getWebSearchSources(data) {
|
|
8630
|
+
if (!Array.isArray(data.data)) return [];
|
|
8631
|
+
return data.data.flatMap((item) => {
|
|
8632
|
+
const source = normalizeWebSearchSource(item);
|
|
8633
|
+
return source ? [source] : [];
|
|
8634
|
+
});
|
|
8635
|
+
}
|
|
8636
|
+
function hasWebSearchSources(_content, data) {
|
|
8637
|
+
return getWebSearchSources(data).length > 0;
|
|
8638
|
+
}
|
|
8639
|
+
function isComputerWebSearchComponent(_content, data) {
|
|
8640
|
+
const isComputer = data.category === "Computer";
|
|
8641
|
+
const isWebSearch = normalizeToolToken(data.type) === "web_search";
|
|
8642
|
+
if (!isComputer || !isWebSearch) return false;
|
|
8643
|
+
return normalizeToolToken(data.tool) === "web_search" || getWebSearchSources(data).length > 0;
|
|
8644
|
+
}
|
|
8645
|
+
function getSourceHost(url) {
|
|
8646
|
+
try {
|
|
8647
|
+
return new URL(url).hostname.replace(/^www\./, "") || null;
|
|
8648
|
+
} catch {
|
|
8649
|
+
return null;
|
|
8650
|
+
}
|
|
8651
|
+
}
|
|
8652
|
+
function WebSearchToolCallOutput({
|
|
8653
|
+
data
|
|
8654
|
+
}) {
|
|
8655
|
+
const { t } = useChatkitTranslation();
|
|
8656
|
+
const sources = getWebSearchSources(data);
|
|
8657
|
+
if (sources.length === 0 || data.error !== void 0) return null;
|
|
8658
|
+
return /* @__PURE__ */ jsxs20("div", { className: "space-y-2", children: [
|
|
8659
|
+
/* @__PURE__ */ jsx32("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.toolGroup.sourcesTitle") }),
|
|
8660
|
+
/* @__PURE__ */ jsx32("div", { className: "space-y-2", children: sources.map((source, index) => {
|
|
8661
|
+
const sourceHost = getSourceHost(source.url);
|
|
8662
|
+
const snippet = source.content ?? source.description;
|
|
8663
|
+
const metaParts = [
|
|
8664
|
+
sourceHost,
|
|
8665
|
+
source.publishedDate,
|
|
8666
|
+
source.author
|
|
8667
|
+
].filter((item) => Boolean(item));
|
|
8668
|
+
return /* @__PURE__ */ jsxs20(
|
|
8669
|
+
"div",
|
|
8670
|
+
{
|
|
8671
|
+
className: "min-w-0 rounded-md border border-border/60 bg-background/80 px-3 py-2",
|
|
8672
|
+
children: [
|
|
8673
|
+
metaParts.length > 0 ? /* @__PURE__ */ jsx32("div", { className: "mb-1 truncate text-[11px] text-muted-foreground", children: metaParts.join(" / ") }) : null,
|
|
8674
|
+
/* @__PURE__ */ jsx32(
|
|
8675
|
+
"a",
|
|
8676
|
+
{
|
|
8677
|
+
href: source.url,
|
|
8678
|
+
target: "_blank",
|
|
8679
|
+
rel: "noreferrer",
|
|
8680
|
+
className: "block min-w-0 line-clamp-2 text-sm font-medium leading-5 text-foreground hover:underline",
|
|
8681
|
+
children: source.title
|
|
8682
|
+
}
|
|
8683
|
+
),
|
|
8684
|
+
snippet ? /* @__PURE__ */ jsx32("p", { className: "mt-1 line-clamp-3 text-xs leading-5 text-muted-foreground", children: snippet }) : null
|
|
8685
|
+
]
|
|
8686
|
+
},
|
|
8687
|
+
`${source.url}-${index}`
|
|
8688
|
+
);
|
|
8689
|
+
}) })
|
|
8690
|
+
] });
|
|
8691
|
+
}
|
|
8692
|
+
|
|
8693
|
+
// src/components/thread/messages/component-message-renderers.tsx
|
|
8694
|
+
var COMPONENT_MESSAGE_RENDERERS = [
|
|
8695
|
+
webSearchComponentRenderer
|
|
8696
|
+
];
|
|
8697
|
+
function getComponentMessageRenderer(content, data) {
|
|
8698
|
+
return COMPONENT_MESSAGE_RENDERERS.find(
|
|
8699
|
+
(renderer) => renderer.match(content, data)
|
|
8700
|
+
) ?? null;
|
|
8701
|
+
}
|
|
8702
|
+
function getComponentMessagePresentation(content, data) {
|
|
8703
|
+
return getComponentMessageRenderer(content, data)?.presentation ?? null;
|
|
8704
|
+
}
|
|
8705
|
+
function hasComponentMessageRendererDetails(renderer, content, data) {
|
|
8706
|
+
if (!renderer?.renderDetails) return false;
|
|
8707
|
+
return renderer.hasDetails?.(content, data) ?? true;
|
|
8708
|
+
}
|
|
8709
|
+
|
|
8710
|
+
// src/components/thread/messages/tool-component-group.tsx
|
|
8711
|
+
import * as React29 from "react";
|
|
7929
8712
|
import {
|
|
7930
8713
|
BookOpen,
|
|
7931
8714
|
Brain as Brain3,
|
|
7932
8715
|
Building2,
|
|
7933
8716
|
Check as Check3,
|
|
7934
|
-
CheckCircle2 as
|
|
7935
|
-
ChevronRight as
|
|
8717
|
+
CheckCircle2 as CheckCircle23,
|
|
8718
|
+
ChevronRight as ChevronRight7,
|
|
7936
8719
|
CircleHelp,
|
|
7937
8720
|
Copy,
|
|
7938
8721
|
FileText as FileText2,
|
|
7939
8722
|
Files,
|
|
7940
|
-
Loader2 as
|
|
8723
|
+
Loader2 as Loader24,
|
|
7941
8724
|
ListTodo as ListTodo2,
|
|
7942
8725
|
Network,
|
|
7943
8726
|
Repeat2,
|
|
8727
|
+
Search as Search2,
|
|
7944
8728
|
SquareTerminal,
|
|
7945
|
-
Wrench,
|
|
7946
|
-
XCircle
|
|
8729
|
+
Wrench as Wrench2,
|
|
8730
|
+
XCircle as XCircle2
|
|
7947
8731
|
} from "lucide-react";
|
|
7948
8732
|
|
|
7949
8733
|
// src/i18n/localized-text.ts
|
|
@@ -7996,19 +8780,19 @@ function resolveLocalizedText(value, language) {
|
|
|
7996
8780
|
}
|
|
7997
8781
|
|
|
7998
8782
|
// src/components/thread/messages/tool-component-group.tsx
|
|
7999
|
-
import { jsx as
|
|
8783
|
+
import { jsx as jsx33, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
8000
8784
|
var toolStatusConfig = {
|
|
8001
8785
|
success: {
|
|
8002
8786
|
iconClass: "border-green-500 text-green-700",
|
|
8003
|
-
icon:
|
|
8787
|
+
icon: CheckCircle23
|
|
8004
8788
|
},
|
|
8005
8789
|
fail: {
|
|
8006
8790
|
iconClass: "border-red-500 text-red-700",
|
|
8007
|
-
icon:
|
|
8791
|
+
icon: XCircle2
|
|
8008
8792
|
},
|
|
8009
8793
|
running: {
|
|
8010
8794
|
iconClass: "border-blue-500 text-blue-700",
|
|
8011
|
-
icon:
|
|
8795
|
+
icon: Loader24
|
|
8012
8796
|
}
|
|
8013
8797
|
};
|
|
8014
8798
|
var TOOL_GROUP_CATEGORY_ORDER = [
|
|
@@ -8083,7 +8867,7 @@ function getEffectiveToolStepStatus(data, isThreadRunning) {
|
|
|
8083
8867
|
}
|
|
8084
8868
|
return data.status;
|
|
8085
8869
|
}
|
|
8086
|
-
function
|
|
8870
|
+
function formatStepDuration2(durationMs) {
|
|
8087
8871
|
if (durationMs < 1e3) {
|
|
8088
8872
|
return `${durationMs}ms`;
|
|
8089
8873
|
}
|
|
@@ -8102,10 +8886,10 @@ function formatStepDuration(durationMs) {
|
|
|
8102
8886
|
return `${minutes}m ${seconds}s`;
|
|
8103
8887
|
}
|
|
8104
8888
|
function useFrozenTimestamp(shouldFreeze) {
|
|
8105
|
-
const [frozenAt, setFrozenAt] =
|
|
8889
|
+
const [frozenAt, setFrozenAt] = React29.useState(
|
|
8106
8890
|
() => shouldFreeze ? Date.now() : null
|
|
8107
8891
|
);
|
|
8108
|
-
|
|
8892
|
+
React29.useEffect(() => {
|
|
8109
8893
|
if (shouldFreeze) {
|
|
8110
8894
|
setFrozenAt((current) => current ?? Date.now());
|
|
8111
8895
|
return;
|
|
@@ -8115,12 +8899,12 @@ function useFrozenTimestamp(shouldFreeze) {
|
|
|
8115
8899
|
return frozenAt;
|
|
8116
8900
|
}
|
|
8117
8901
|
function useToolStepDurationLabel(data, options) {
|
|
8118
|
-
const [durationNow, setDurationNow] =
|
|
8902
|
+
const [durationNow, setDurationNow] = React29.useState(() => Date.now());
|
|
8119
8903
|
const createdAt = parseStepDate(data.created_date);
|
|
8120
8904
|
const explicitEndedAt = parseStepDate(data.end_date);
|
|
8121
8905
|
const status = options?.status ?? data.status;
|
|
8122
8906
|
const endedAt = explicitEndedAt ?? (status !== "running" ? options?.fallbackEndedAt ?? null : null);
|
|
8123
|
-
|
|
8907
|
+
React29.useEffect(() => {
|
|
8124
8908
|
if (status !== "running" || createdAt === null || endedAt !== null) {
|
|
8125
8909
|
return;
|
|
8126
8910
|
}
|
|
@@ -8134,43 +8918,47 @@ function useToolStepDurationLabel(data, options) {
|
|
|
8134
8918
|
}, [createdAt, endedAt, status]);
|
|
8135
8919
|
if (createdAt === null) return null;
|
|
8136
8920
|
const durationMs = Math.max(0, (endedAt ?? durationNow) - createdAt);
|
|
8137
|
-
return
|
|
8921
|
+
return formatStepDuration2(durationMs);
|
|
8138
8922
|
}
|
|
8139
|
-
function
|
|
8923
|
+
function isComponentContent2(content) {
|
|
8140
8924
|
return content.type === "component";
|
|
8141
8925
|
}
|
|
8142
|
-
function
|
|
8926
|
+
function isTextContent2(content) {
|
|
8143
8927
|
return content.type === "text";
|
|
8144
8928
|
}
|
|
8145
|
-
function
|
|
8929
|
+
function isReasoningContent2(content) {
|
|
8146
8930
|
return content.type === "reasoning";
|
|
8147
8931
|
}
|
|
8148
8932
|
function isWidgetComponent(content) {
|
|
8149
8933
|
const data = content.data;
|
|
8150
8934
|
return data?.type === "Widget" && Array.isArray(data.widgets);
|
|
8151
8935
|
}
|
|
8152
|
-
function
|
|
8936
|
+
function isGroupableStepComponent(content) {
|
|
8153
8937
|
if (!content || typeof content === "string") return false;
|
|
8154
|
-
|
|
8938
|
+
if (!isComponentContent2(content) || isWidgetComponent(content)) return false;
|
|
8939
|
+
const data = getToolStepData(content);
|
|
8940
|
+
const renderer = getComponentMessageRenderer(content, data);
|
|
8941
|
+
if (renderer) return renderer.presentation === "grouped-step";
|
|
8942
|
+
return data.category === "Tool";
|
|
8155
8943
|
}
|
|
8156
8944
|
function isSkippableToolGroupSeparator(content) {
|
|
8157
8945
|
if (typeof content === "string") return !content.trim();
|
|
8158
8946
|
if (!content) return true;
|
|
8159
|
-
if (
|
|
8947
|
+
if (isTextContent2(content)) {
|
|
8160
8948
|
return !content.text?.trim();
|
|
8161
8949
|
}
|
|
8162
|
-
if (
|
|
8950
|
+
if (isReasoningContent2(content)) {
|
|
8163
8951
|
return !content.text?.trim();
|
|
8164
8952
|
}
|
|
8165
8953
|
return false;
|
|
8166
8954
|
}
|
|
8167
|
-
function
|
|
8955
|
+
function normalizeToolToken2(value) {
|
|
8168
8956
|
if (typeof value !== "string") return null;
|
|
8169
8957
|
const normalized = value.trim().toLowerCase().replace(/[\s-]+/g, "_");
|
|
8170
8958
|
return normalized || null;
|
|
8171
8959
|
}
|
|
8172
8960
|
function classifyToolToken(value) {
|
|
8173
|
-
const normalized =
|
|
8961
|
+
const normalized = normalizeToolToken2(
|
|
8174
8962
|
typeof value === "string" ? value : resolveLocalizedText(value, "en-US")
|
|
8175
8963
|
);
|
|
8176
8964
|
if (!normalized) return null;
|
|
@@ -8209,8 +8997,8 @@ function getToolActivityLabel(content, language, statusOverride) {
|
|
|
8209
8997
|
if (status === "running") {
|
|
8210
8998
|
return message ?? title ?? tool ?? type ?? "Tool";
|
|
8211
8999
|
}
|
|
8212
|
-
const titleToken =
|
|
8213
|
-
const genericTitle = titleToken !== null && [tool, type].map((candidate) =>
|
|
9000
|
+
const titleToken = normalizeToolToken2(title);
|
|
9001
|
+
const genericTitle = titleToken !== null && [tool, type].map((candidate) => normalizeToolToken2(candidate)).some((candidate) => candidate === titleToken);
|
|
8214
9002
|
if (message && (!title || genericTitle)) {
|
|
8215
9003
|
return message;
|
|
8216
9004
|
}
|
|
@@ -8229,7 +9017,7 @@ function buildToolComponentRenderUnits(content, options) {
|
|
|
8229
9017
|
const units = [];
|
|
8230
9018
|
const pendingTools = [];
|
|
8231
9019
|
content.forEach((item, index) => {
|
|
8232
|
-
if (
|
|
9020
|
+
if (isGroupableStepComponent(item) && options?.shouldGroupComponent?.(item) !== false) {
|
|
8233
9021
|
pendingTools.push({ item, index });
|
|
8234
9022
|
return;
|
|
8235
9023
|
}
|
|
@@ -8294,13 +9082,13 @@ function createToolsetAvatarUrl(toolsetId, apiUrl) {
|
|
|
8294
9082
|
}
|
|
8295
9083
|
}
|
|
8296
9084
|
function shouldUseToolsetAvatar(toolset) {
|
|
8297
|
-
const normalized =
|
|
9085
|
+
const normalized = normalizeToolToken2(toolset);
|
|
8298
9086
|
return normalized === "mcp" || normalized === "openapi";
|
|
8299
9087
|
}
|
|
8300
9088
|
function useToolsetAvatar(toolsetId, enabled, apiUrl) {
|
|
8301
9089
|
const avatarUrl = enabled ? createToolsetAvatarUrl(toolsetId, apiUrl) : null;
|
|
8302
|
-
const [avatar, setAvatar] =
|
|
8303
|
-
|
|
9090
|
+
const [avatar, setAvatar] = React29.useState(null);
|
|
9091
|
+
React29.useEffect(() => {
|
|
8304
9092
|
if (!avatarUrl) {
|
|
8305
9093
|
setAvatar(null);
|
|
8306
9094
|
return;
|
|
@@ -8332,7 +9120,7 @@ function ToolAvatarIcon({
|
|
|
8332
9120
|
className
|
|
8333
9121
|
}) {
|
|
8334
9122
|
if (avatar.url) {
|
|
8335
|
-
return /* @__PURE__ */
|
|
9123
|
+
return /* @__PURE__ */ jsx33(
|
|
8336
9124
|
"img",
|
|
8337
9125
|
{
|
|
8338
9126
|
alt: "",
|
|
@@ -8345,7 +9133,7 @@ function ToolAvatarIcon({
|
|
|
8345
9133
|
}
|
|
8346
9134
|
const emoji = unicodeFromUnified2(avatar.emoji?.unified);
|
|
8347
9135
|
if (emoji) {
|
|
8348
|
-
return /* @__PURE__ */
|
|
9136
|
+
return /* @__PURE__ */ jsx33(
|
|
8349
9137
|
"span",
|
|
8350
9138
|
{
|
|
8351
9139
|
"aria-hidden": "true",
|
|
@@ -8360,7 +9148,7 @@ function ToolAvatarIcon({
|
|
|
8360
9148
|
}
|
|
8361
9149
|
);
|
|
8362
9150
|
}
|
|
8363
|
-
return /* @__PURE__ */
|
|
9151
|
+
return /* @__PURE__ */ jsx33(
|
|
8364
9152
|
CircleHelp,
|
|
8365
9153
|
{
|
|
8366
9154
|
className,
|
|
@@ -8370,7 +9158,7 @@ function ToolAvatarIcon({
|
|
|
8370
9158
|
);
|
|
8371
9159
|
}
|
|
8372
9160
|
function getKnownToolsetIcon(toolset) {
|
|
8373
|
-
const normalized =
|
|
9161
|
+
const normalized = normalizeToolToken2(toolset);
|
|
8374
9162
|
if (!normalized) return null;
|
|
8375
9163
|
switch (normalized) {
|
|
8376
9164
|
case "project":
|
|
@@ -8385,7 +9173,7 @@ function getKnownToolsetIcon(toolset) {
|
|
|
8385
9173
|
case "memories":
|
|
8386
9174
|
return Brain3;
|
|
8387
9175
|
case "workflow_agent_tool":
|
|
8388
|
-
return
|
|
9176
|
+
return Wrench2;
|
|
8389
9177
|
case "workflow_task":
|
|
8390
9178
|
return Network;
|
|
8391
9179
|
default:
|
|
@@ -8393,7 +9181,7 @@ function getKnownToolsetIcon(toolset) {
|
|
|
8393
9181
|
}
|
|
8394
9182
|
}
|
|
8395
9183
|
function getStepTypeIcon(type) {
|
|
8396
|
-
const normalized =
|
|
9184
|
+
const normalized = normalizeToolToken2(type);
|
|
8397
9185
|
if (!normalized) return null;
|
|
8398
9186
|
switch (normalized) {
|
|
8399
9187
|
case "file":
|
|
@@ -8402,6 +9190,8 @@ function getStepTypeIcon(type) {
|
|
|
8402
9190
|
return Files;
|
|
8403
9191
|
case "program":
|
|
8404
9192
|
return SquareTerminal;
|
|
9193
|
+
case "web_search":
|
|
9194
|
+
return Search2;
|
|
8405
9195
|
case "knowledges":
|
|
8406
9196
|
return BookOpen;
|
|
8407
9197
|
default:
|
|
@@ -8421,12 +9211,12 @@ function ToolStepIcon({
|
|
|
8421
9211
|
apiUrl
|
|
8422
9212
|
);
|
|
8423
9213
|
const iconUrl = createToolsetIconUrl(data.toolset, organizationId, apiUrl);
|
|
8424
|
-
const [failedIconUrl, setFailedIconUrl] =
|
|
8425
|
-
|
|
9214
|
+
const [failedIconUrl, setFailedIconUrl] = React29.useState(null);
|
|
9215
|
+
React29.useEffect(() => {
|
|
8426
9216
|
setFailedIconUrl(null);
|
|
8427
9217
|
}, [iconUrl]);
|
|
8428
9218
|
if (avatar) {
|
|
8429
|
-
return /* @__PURE__ */
|
|
9219
|
+
return /* @__PURE__ */ jsx33(
|
|
8430
9220
|
ToolAvatarIcon,
|
|
8431
9221
|
{
|
|
8432
9222
|
avatar,
|
|
@@ -8436,7 +9226,7 @@ function ToolStepIcon({
|
|
|
8436
9226
|
);
|
|
8437
9227
|
}
|
|
8438
9228
|
if (iconUrl && failedIconUrl !== iconUrl) {
|
|
8439
|
-
return /* @__PURE__ */
|
|
9229
|
+
return /* @__PURE__ */ jsx33(
|
|
8440
9230
|
"img",
|
|
8441
9231
|
{
|
|
8442
9232
|
alt: "",
|
|
@@ -8450,7 +9240,7 @@ function ToolStepIcon({
|
|
|
8450
9240
|
}
|
|
8451
9241
|
const TypeIcon = getStepTypeIcon(data.type);
|
|
8452
9242
|
if (TypeIcon) {
|
|
8453
|
-
return /* @__PURE__ */
|
|
9243
|
+
return /* @__PURE__ */ jsx33(
|
|
8454
9244
|
TypeIcon,
|
|
8455
9245
|
{
|
|
8456
9246
|
className,
|
|
@@ -8461,7 +9251,7 @@ function ToolStepIcon({
|
|
|
8461
9251
|
}
|
|
8462
9252
|
const ToolsetIcon = getKnownToolsetIcon(data.toolset);
|
|
8463
9253
|
if (ToolsetIcon) {
|
|
8464
|
-
return /* @__PURE__ */
|
|
9254
|
+
return /* @__PURE__ */ jsx33(
|
|
8465
9255
|
ToolsetIcon,
|
|
8466
9256
|
{
|
|
8467
9257
|
className,
|
|
@@ -8471,7 +9261,7 @@ function ToolStepIcon({
|
|
|
8471
9261
|
);
|
|
8472
9262
|
}
|
|
8473
9263
|
if (usesToolsetAvatar) {
|
|
8474
|
-
return /* @__PURE__ */
|
|
9264
|
+
return /* @__PURE__ */ jsx33(
|
|
8475
9265
|
CircleHelp,
|
|
8476
9266
|
{
|
|
8477
9267
|
className,
|
|
@@ -8480,7 +9270,7 @@ function ToolStepIcon({
|
|
|
8480
9270
|
}
|
|
8481
9271
|
);
|
|
8482
9272
|
}
|
|
8483
|
-
return /* @__PURE__ */
|
|
9273
|
+
return /* @__PURE__ */ jsx33(
|
|
8484
9274
|
CircleHelp,
|
|
8485
9275
|
{
|
|
8486
9276
|
className,
|
|
@@ -8491,15 +9281,15 @@ function ToolStepIcon({
|
|
|
8491
9281
|
}
|
|
8492
9282
|
function ToolCallCopyButton({ value }) {
|
|
8493
9283
|
const { t } = useChatkitTranslation();
|
|
8494
|
-
const [isCopied, setIsCopied] =
|
|
8495
|
-
const resetTimeoutRef =
|
|
8496
|
-
const clearResetTimeout =
|
|
9284
|
+
const [isCopied, setIsCopied] = React29.useState(false);
|
|
9285
|
+
const resetTimeoutRef = React29.useRef(null);
|
|
9286
|
+
const clearResetTimeout = React29.useCallback(() => {
|
|
8497
9287
|
if (resetTimeoutRef.current === null) return;
|
|
8498
9288
|
window.clearTimeout(resetTimeoutRef.current);
|
|
8499
9289
|
resetTimeoutRef.current = null;
|
|
8500
9290
|
}, []);
|
|
8501
|
-
|
|
8502
|
-
const handleCopy =
|
|
9291
|
+
React29.useEffect(() => clearResetTimeout, [clearResetTimeout]);
|
|
9292
|
+
const handleCopy = React29.useCallback(() => {
|
|
8503
9293
|
if (typeof navigator === "undefined" || !navigator.clipboard) return;
|
|
8504
9294
|
void navigator.clipboard.writeText(value).then(() => {
|
|
8505
9295
|
setIsCopied(true);
|
|
@@ -8511,7 +9301,7 @@ function ToolCallCopyButton({ value }) {
|
|
|
8511
9301
|
}).catch(() => void 0);
|
|
8512
9302
|
}, [clearResetTimeout, value]);
|
|
8513
9303
|
const label = isCopied ? t("message.toolGroup.copied") : t("message.toolGroup.copy");
|
|
8514
|
-
return /* @__PURE__ */
|
|
9304
|
+
return /* @__PURE__ */ jsx33(
|
|
8515
9305
|
"button",
|
|
8516
9306
|
{
|
|
8517
9307
|
type: "button",
|
|
@@ -8519,7 +9309,7 @@ function ToolCallCopyButton({ value }) {
|
|
|
8519
9309
|
"aria-label": label,
|
|
8520
9310
|
title: label,
|
|
8521
9311
|
onClick: handleCopy,
|
|
8522
|
-
children: isCopied ? /* @__PURE__ */
|
|
9312
|
+
children: isCopied ? /* @__PURE__ */ jsx33(Check3, { className: "h-3.5 w-3.5", "aria-hidden": "true" }) : /* @__PURE__ */ jsx33(Copy, { className: "h-3.5 w-3.5", "aria-hidden": "true" })
|
|
8523
9313
|
}
|
|
8524
9314
|
);
|
|
8525
9315
|
}
|
|
@@ -8530,28 +9320,28 @@ function ToolCallValueBlock({
|
|
|
8530
9320
|
const { t } = useChatkitTranslation();
|
|
8531
9321
|
const detected = detectJsonValue(value);
|
|
8532
9322
|
if (detected.kind === "text") {
|
|
8533
|
-
return /* @__PURE__ */
|
|
8534
|
-
/* @__PURE__ */
|
|
8535
|
-
/* @__PURE__ */
|
|
9323
|
+
return /* @__PURE__ */ jsxs21("div", { className: "min-w-0 space-y-1", children: [
|
|
9324
|
+
/* @__PURE__ */ jsx33("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx33(ToolCallCopyButton, { value: detected.text }) }),
|
|
9325
|
+
/* @__PURE__ */ jsx33(PlainTextBlock, { value: detected.text, destructive })
|
|
8536
9326
|
] });
|
|
8537
9327
|
}
|
|
8538
|
-
return /* @__PURE__ */
|
|
8539
|
-
/* @__PURE__ */
|
|
8540
|
-
/* @__PURE__ */
|
|
9328
|
+
return /* @__PURE__ */ jsxs21(Tabs, { defaultValue: "tree", className: "min-w-0", children: [
|
|
9329
|
+
/* @__PURE__ */ jsxs21("div", { className: "mb-2 flex min-w-0 items-center justify-between gap-2", children: [
|
|
9330
|
+
/* @__PURE__ */ jsxs21("span", { className: "min-w-0 truncate text-[11px] text-muted-foreground", children: [
|
|
8541
9331
|
t("message.toolGroup.jsonTitle"),
|
|
8542
9332
|
" \xB7 ",
|
|
8543
9333
|
getJsonValueSummary(detected.value)
|
|
8544
9334
|
] }),
|
|
8545
|
-
/* @__PURE__ */
|
|
8546
|
-
/* @__PURE__ */
|
|
8547
|
-
/* @__PURE__ */
|
|
8548
|
-
/* @__PURE__ */
|
|
8549
|
-
/* @__PURE__ */
|
|
9335
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
9336
|
+
/* @__PURE__ */ jsx33(ToolCallCopyButton, { value: detected.raw }),
|
|
9337
|
+
/* @__PURE__ */ jsxs21(TabsList, { className: "rounded-md p-0.5", children: [
|
|
9338
|
+
/* @__PURE__ */ jsx33(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "tree", children: t("message.toolGroup.jsonTree") }),
|
|
9339
|
+
/* @__PURE__ */ jsx33(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "raw", children: t("message.toolGroup.jsonRaw") })
|
|
8550
9340
|
] })
|
|
8551
9341
|
] })
|
|
8552
9342
|
] }),
|
|
8553
|
-
/* @__PURE__ */
|
|
8554
|
-
/* @__PURE__ */
|
|
9343
|
+
/* @__PURE__ */ jsx33(TabsContent, { value: "tree", className: "mt-0", children: /* @__PURE__ */ jsx33(JsonTreeView, { value: detected.value }) }),
|
|
9344
|
+
/* @__PURE__ */ jsx33(TabsContent, { value: "raw", className: "mt-0", children: /* @__PURE__ */ jsx33(RawJsonBlock, { raw: detected.raw }) })
|
|
8555
9345
|
] });
|
|
8556
9346
|
}
|
|
8557
9347
|
function DefaultToolCallOutput({ data }) {
|
|
@@ -8559,31 +9349,37 @@ function DefaultToolCallOutput({ data }) {
|
|
|
8559
9349
|
const output = data.output ?? null;
|
|
8560
9350
|
const error = data.error ?? null;
|
|
8561
9351
|
if (error) {
|
|
8562
|
-
return /* @__PURE__ */
|
|
8563
|
-
/* @__PURE__ */
|
|
8564
|
-
/* @__PURE__ */
|
|
9352
|
+
return /* @__PURE__ */ jsxs21("div", { className: "space-y-1", children: [
|
|
9353
|
+
/* @__PURE__ */ jsx33("div", { className: "text-[11px] font-medium text-destructive", children: t("message.toolGroup.errorTitle") }),
|
|
9354
|
+
/* @__PURE__ */ jsx33(ToolCallValueBlock, { value: error, destructive: true })
|
|
8565
9355
|
] });
|
|
8566
9356
|
}
|
|
8567
9357
|
if (output === null) return null;
|
|
8568
|
-
return /* @__PURE__ */
|
|
8569
|
-
/* @__PURE__ */
|
|
8570
|
-
/* @__PURE__ */
|
|
9358
|
+
return /* @__PURE__ */ jsxs21("div", { className: "space-y-1", children: [
|
|
9359
|
+
/* @__PURE__ */ jsx33("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.toolGroup.outputTitle") }),
|
|
9360
|
+
/* @__PURE__ */ jsx33(ToolCallValueBlock, { value: output })
|
|
8571
9361
|
] });
|
|
8572
9362
|
}
|
|
8573
9363
|
function ToolCallDetails({ content }) {
|
|
8574
9364
|
const { t } = useChatkitTranslation();
|
|
8575
9365
|
const data = getToolStepData(content);
|
|
9366
|
+
const renderer = getComponentMessageRenderer(content, data);
|
|
9367
|
+
const hasCustomDetails = data.error === void 0 && hasComponentMessageRendererDetails(renderer, content, data);
|
|
9368
|
+
const CustomDetailsRenderer = hasCustomDetails ? renderer?.renderDetails : void 0;
|
|
9369
|
+
if (CustomDetailsRenderer) {
|
|
9370
|
+
return /* @__PURE__ */ jsx33("div", { className: "ml-6 mt-1 max-h-60 overflow-auto rounded-md bg-muted/30 text-xs text-muted-foreground", children: /* @__PURE__ */ jsx33(CustomDetailsRenderer, { content, data }) });
|
|
9371
|
+
}
|
|
8576
9372
|
const OutputRenderer = getToolCallOutputRenderer(data);
|
|
8577
9373
|
const hasInput = data.input !== void 0 && data.input !== null;
|
|
8578
9374
|
const hasOutput = data.error !== void 0 || data.output !== void 0;
|
|
8579
9375
|
if (!hasInput && !hasOutput) return null;
|
|
8580
|
-
return /* @__PURE__ */
|
|
8581
|
-
hasInput && /* @__PURE__ */
|
|
8582
|
-
/* @__PURE__ */
|
|
8583
|
-
/* @__PURE__ */
|
|
9376
|
+
return /* @__PURE__ */ jsxs21("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: [
|
|
9377
|
+
hasInput && /* @__PURE__ */ jsxs21("div", { className: "space-y-1", children: [
|
|
9378
|
+
/* @__PURE__ */ jsx33("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.toolGroup.inputTitle") }),
|
|
9379
|
+
/* @__PURE__ */ jsx33(ToolCallValueBlock, { value: data.input })
|
|
8584
9380
|
] }),
|
|
8585
|
-
hasInput && hasOutput ? /* @__PURE__ */
|
|
8586
|
-
hasOutput ? /* @__PURE__ */
|
|
9381
|
+
hasInput && hasOutput ? /* @__PURE__ */ jsx33("div", { className: "h-2" }) : null,
|
|
9382
|
+
hasOutput ? /* @__PURE__ */ jsx33(OutputRenderer, { content, data }) : null
|
|
8587
9383
|
] });
|
|
8588
9384
|
}
|
|
8589
9385
|
function areToolCallRowPropsEqual(previous, next) {
|
|
@@ -8600,8 +9396,10 @@ function ToolCallRowContent({
|
|
|
8600
9396
|
const status = getEffectiveToolStepStatus(data, isThreadRunning);
|
|
8601
9397
|
const hasError = status === "fail" || Boolean(data.error);
|
|
8602
9398
|
const label = getToolActivityLabel(content, i18n2.language, status);
|
|
8603
|
-
const detailsId =
|
|
8604
|
-
const
|
|
9399
|
+
const detailsId = React29.useId();
|
|
9400
|
+
const renderer = getComponentMessageRenderer(content, data);
|
|
9401
|
+
const hasCustomDetails = data.error === void 0 && hasComponentMessageRendererDetails(renderer, content, data);
|
|
9402
|
+
const hasDetails = data.input !== void 0 || data.error !== void 0 || data.output !== void 0 || hasCustomDetails;
|
|
8605
9403
|
const fallbackEndedAt = useFrozenTimestamp(
|
|
8606
9404
|
data.status === "running" && status === "fail"
|
|
8607
9405
|
);
|
|
@@ -8609,14 +9407,14 @@ function ToolCallRowContent({
|
|
|
8609
9407
|
status,
|
|
8610
9408
|
fallbackEndedAt
|
|
8611
9409
|
});
|
|
8612
|
-
const [isExpanded, setIsExpanded] =
|
|
8613
|
-
|
|
9410
|
+
const [isExpanded, setIsExpanded] = React29.useState(false);
|
|
9411
|
+
React29.useEffect(() => {
|
|
8614
9412
|
if (status === "running" && data.output !== void 0) {
|
|
8615
9413
|
setIsExpanded(true);
|
|
8616
9414
|
}
|
|
8617
9415
|
}, [data.output, status]);
|
|
8618
|
-
return /* @__PURE__ */
|
|
8619
|
-
/* @__PURE__ */
|
|
9416
|
+
return /* @__PURE__ */ jsxs21("li", { className: "min-w-0", children: [
|
|
9417
|
+
/* @__PURE__ */ jsxs21(
|
|
8620
9418
|
"button",
|
|
8621
9419
|
{
|
|
8622
9420
|
type: "button",
|
|
@@ -8633,7 +9431,7 @@ function ToolCallRowContent({
|
|
|
8633
9431
|
if (hasDetails) setIsExpanded((prev) => !prev);
|
|
8634
9432
|
},
|
|
8635
9433
|
children: [
|
|
8636
|
-
status ? /* @__PURE__ */
|
|
9434
|
+
status ? /* @__PURE__ */ jsx33(
|
|
8637
9435
|
ToolStepIcon,
|
|
8638
9436
|
{
|
|
8639
9437
|
data,
|
|
@@ -8644,8 +9442,8 @@ function ToolCallRowContent({
|
|
|
8644
9442
|
hasError ? "text-destructive" : "text-muted-foreground"
|
|
8645
9443
|
)
|
|
8646
9444
|
}
|
|
8647
|
-
) : /* @__PURE__ */
|
|
8648
|
-
/* @__PURE__ */
|
|
9445
|
+
) : /* @__PURE__ */ jsx33("span", { className: "h-3.5 w-3.5 shrink-0", "aria-hidden": "true" }),
|
|
9446
|
+
/* @__PURE__ */ jsx33(
|
|
8649
9447
|
"span",
|
|
8650
9448
|
{
|
|
8651
9449
|
className: cn(
|
|
@@ -8656,9 +9454,9 @@ function ToolCallRowContent({
|
|
|
8656
9454
|
children: label
|
|
8657
9455
|
}
|
|
8658
9456
|
),
|
|
8659
|
-
durationLabel ? /* @__PURE__ */
|
|
8660
|
-
hasDetails ? /* @__PURE__ */
|
|
8661
|
-
|
|
9457
|
+
durationLabel ? /* @__PURE__ */ jsx33("span", { className: "shrink-0 text-[11px] tabular-nums text-muted-foreground/80", children: durationLabel }) : null,
|
|
9458
|
+
hasDetails ? /* @__PURE__ */ jsx33(
|
|
9459
|
+
ChevronRight7,
|
|
8662
9460
|
{
|
|
8663
9461
|
"aria-hidden": "true",
|
|
8664
9462
|
className: cn(
|
|
@@ -8670,10 +9468,10 @@ function ToolCallRowContent({
|
|
|
8670
9468
|
]
|
|
8671
9469
|
}
|
|
8672
9470
|
),
|
|
8673
|
-
hasDetails && isExpanded ? /* @__PURE__ */
|
|
9471
|
+
hasDetails && isExpanded ? /* @__PURE__ */ jsx33("div", { id: detailsId, children: /* @__PURE__ */ jsx33(ToolCallDetails, { content }) }) : null
|
|
8674
9472
|
] });
|
|
8675
9473
|
}
|
|
8676
|
-
var ToolCallRow =
|
|
9474
|
+
var ToolCallRow = React29.memo(ToolCallRowContent, areToolCallRowPropsEqual);
|
|
8677
9475
|
ToolCallRow.displayName = "ToolCallRow";
|
|
8678
9476
|
function ToolComponentGroup({
|
|
8679
9477
|
items,
|
|
@@ -8683,8 +9481,8 @@ function ToolComponentGroup({
|
|
|
8683
9481
|
apiUrl
|
|
8684
9482
|
}) {
|
|
8685
9483
|
const { t } = useChatkitTranslation();
|
|
8686
|
-
const contentId =
|
|
8687
|
-
const [isExpanded, setIsExpanded] =
|
|
9484
|
+
const contentId = React29.useId();
|
|
9485
|
+
const [isExpanded, setIsExpanded] = React29.useState(!hasFollowingItem);
|
|
8688
9486
|
const categoryCounts = getToolGroupCategoryCounts(items);
|
|
8689
9487
|
const categorySummary = TOOL_GROUP_CATEGORY_ORDER.flatMap((category) => {
|
|
8690
9488
|
const count = categoryCounts[category] ?? 0;
|
|
@@ -8699,11 +9497,11 @@ function ToolComponentGroup({
|
|
|
8699
9497
|
const summary = `${t("message.toolGroup.status.success")} ${categorySummary}`;
|
|
8700
9498
|
const config = toolStatusConfig.success;
|
|
8701
9499
|
const StatusIcon = config.icon;
|
|
8702
|
-
|
|
9500
|
+
React29.useEffect(() => {
|
|
8703
9501
|
setIsExpanded(!hasFollowingItem);
|
|
8704
9502
|
}, [hasFollowingItem, items.length]);
|
|
8705
|
-
return /* @__PURE__ */
|
|
8706
|
-
/* @__PURE__ */
|
|
9503
|
+
return /* @__PURE__ */ jsxs21("div", { className: "px-1 py-1", children: [
|
|
9504
|
+
/* @__PURE__ */ jsxs21(
|
|
8707
9505
|
"button",
|
|
8708
9506
|
{
|
|
8709
9507
|
type: "button",
|
|
@@ -8712,8 +9510,8 @@ function ToolComponentGroup({
|
|
|
8712
9510
|
"aria-controls": contentId,
|
|
8713
9511
|
onClick: () => setIsExpanded((prev) => !prev),
|
|
8714
9512
|
children: [
|
|
8715
|
-
/* @__PURE__ */
|
|
8716
|
-
/* @__PURE__ */
|
|
9513
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex min-w-0 items-center gap-2 text-sm font-medium text-muted-foreground", children: [
|
|
9514
|
+
/* @__PURE__ */ jsx33(
|
|
8717
9515
|
StatusIcon,
|
|
8718
9516
|
{
|
|
8719
9517
|
className: cn(
|
|
@@ -8722,10 +9520,10 @@ function ToolComponentGroup({
|
|
|
8722
9520
|
)
|
|
8723
9521
|
}
|
|
8724
9522
|
),
|
|
8725
|
-
/* @__PURE__ */
|
|
9523
|
+
/* @__PURE__ */ jsx33("span", { className: "truncate", children: summary })
|
|
8726
9524
|
] }),
|
|
8727
|
-
/* @__PURE__ */
|
|
8728
|
-
|
|
9525
|
+
/* @__PURE__ */ jsx33(
|
|
9526
|
+
ChevronRight7,
|
|
8729
9527
|
{
|
|
8730
9528
|
"aria-hidden": "true",
|
|
8731
9529
|
className: cn(
|
|
@@ -8737,7 +9535,7 @@ function ToolComponentGroup({
|
|
|
8737
9535
|
]
|
|
8738
9536
|
}
|
|
8739
9537
|
),
|
|
8740
|
-
isExpanded && /* @__PURE__ */
|
|
9538
|
+
isExpanded && /* @__PURE__ */ jsx33("ul", { id: contentId, className: "mt-2 space-y-1.5 overflow-y-auto pr-1", children: items.map((item, index) => /* @__PURE__ */ jsx33(
|
|
8741
9539
|
ToolCallRow,
|
|
8742
9540
|
{
|
|
8743
9541
|
content: item,
|
|
@@ -8756,8 +9554,8 @@ import {
|
|
|
8756
9554
|
REQUEST_USER_INPUT_RESULT_TYPE as REQUEST_USER_INPUT_RESULT_TYPE2,
|
|
8757
9555
|
REQUEST_USER_INPUT_TOOL_NAME as REQUEST_USER_INPUT_TOOL_NAME2
|
|
8758
9556
|
} from "@xpert-ai/chatkit-types";
|
|
8759
|
-
import { CheckCircle2 as
|
|
8760
|
-
import { jsx as
|
|
9557
|
+
import { CheckCircle2 as CheckCircle24 } from "lucide-react";
|
|
9558
|
+
import { jsx as jsx34, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
8761
9559
|
function isRecord2(value) {
|
|
8762
9560
|
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
8763
9561
|
}
|
|
@@ -8869,7 +9667,7 @@ function RequestUserInputResultCard({
|
|
|
8869
9667
|
className
|
|
8870
9668
|
}) {
|
|
8871
9669
|
const { t } = useChatkitTranslation();
|
|
8872
|
-
return /* @__PURE__ */
|
|
9670
|
+
return /* @__PURE__ */ jsxs22(
|
|
8873
9671
|
"section",
|
|
8874
9672
|
{
|
|
8875
9673
|
"aria-label": t("message.requestUserInputResult.title"),
|
|
@@ -8878,23 +9676,23 @@ function RequestUserInputResultCard({
|
|
|
8878
9676
|
className
|
|
8879
9677
|
),
|
|
8880
9678
|
children: [
|
|
8881
|
-
/* @__PURE__ */
|
|
8882
|
-
/* @__PURE__ */
|
|
8883
|
-
/* @__PURE__ */
|
|
9679
|
+
/* @__PURE__ */ jsxs22("div", { className: "mb-2 flex items-center gap-2 text-sm font-semibold text-foreground", children: [
|
|
9680
|
+
/* @__PURE__ */ jsx34(CheckCircle24, { className: "h-4 w-4 text-primary" }),
|
|
9681
|
+
/* @__PURE__ */ jsx34("span", { children: t("message.requestUserInputResult.title") })
|
|
8884
9682
|
] }),
|
|
8885
|
-
/* @__PURE__ */
|
|
9683
|
+
/* @__PURE__ */ jsx34("div", { className: "space-y-2", children: result.answers.map((answer, index) => /* @__PURE__ */ jsxs22(
|
|
8886
9684
|
"div",
|
|
8887
9685
|
{
|
|
8888
9686
|
className: "rounded-md bg-background/70 px-2.5 py-2",
|
|
8889
9687
|
children: [
|
|
8890
|
-
/* @__PURE__ */
|
|
8891
|
-
/* @__PURE__ */
|
|
8892
|
-
/* @__PURE__ */
|
|
8893
|
-
/* @__PURE__ */
|
|
9688
|
+
/* @__PURE__ */ jsx34("div", { className: "text-xs font-medium leading-5 text-muted-foreground", children: answer.question }),
|
|
9689
|
+
/* @__PURE__ */ jsxs22("div", { className: "mt-0.5 flex min-w-0 flex-wrap items-center gap-1.5", children: [
|
|
9690
|
+
/* @__PURE__ */ jsx34("span", { className: "min-w-0 wrap-break-word text-sm font-semibold text-foreground", children: answer.label ?? answer.value }),
|
|
9691
|
+
/* @__PURE__ */ jsx34("span", { className: "rounded-full bg-muted px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground", children: t(
|
|
8894
9692
|
answer.type === "other" ? "message.requestUserInputResult.other" : "message.requestUserInputResult.option"
|
|
8895
9693
|
) })
|
|
8896
9694
|
] }),
|
|
8897
|
-
answer.description ? /* @__PURE__ */
|
|
9695
|
+
answer.description ? /* @__PURE__ */ jsx34("div", { className: "mt-1 text-xs leading-5 text-muted-foreground", children: answer.description }) : null
|
|
8898
9696
|
]
|
|
8899
9697
|
},
|
|
8900
9698
|
`${answer.id}-${index}`
|
|
@@ -8906,18 +9704,18 @@ function RequestUserInputResultCard({
|
|
|
8906
9704
|
|
|
8907
9705
|
// src/components/thread/messages/widget.tsx
|
|
8908
9706
|
import { SurfaceRenderer } from "@xpert-ai/a2ui-react";
|
|
8909
|
-
import { jsx as
|
|
9707
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
8910
9708
|
function WidgetMessage({ messageId, data }) {
|
|
8911
9709
|
const widgets = Array.isArray(data.widgets) ? data.widgets : [];
|
|
8912
9710
|
if (widgets.length === 0) return null;
|
|
8913
9711
|
const baseSurfaceId = `widget-${messageId}`;
|
|
8914
|
-
return /* @__PURE__ */
|
|
9712
|
+
return /* @__PURE__ */ jsx35("div", { className: "space-y-3", children: widgets.map((widget, index) => {
|
|
8915
9713
|
const config = widget?.config;
|
|
8916
9714
|
if (!config || typeof config !== "object") {
|
|
8917
9715
|
return null;
|
|
8918
9716
|
}
|
|
8919
9717
|
const surfaceId = widgets.length > 1 ? `${baseSurfaceId}-${index}` : baseSurfaceId;
|
|
8920
|
-
return /* @__PURE__ */
|
|
9718
|
+
return /* @__PURE__ */ jsx35(
|
|
8921
9719
|
SurfaceRenderer,
|
|
8922
9720
|
{
|
|
8923
9721
|
surfaceId,
|
|
@@ -8929,17 +9727,18 @@ function WidgetMessage({ messageId, data }) {
|
|
|
8929
9727
|
}
|
|
8930
9728
|
|
|
8931
9729
|
// src/components/thread/messages/ai.tsx
|
|
8932
|
-
import { jsx as
|
|
8933
|
-
|
|
9730
|
+
import { jsx as jsx36, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
9731
|
+
var assistantMessageStackClassName = "space-y-3 in-data-[density=compact]:space-y-2 in-data-[density=spacious]:space-y-4";
|
|
9732
|
+
function isTextContent3(content) {
|
|
8934
9733
|
return content.type === "text";
|
|
8935
9734
|
}
|
|
8936
|
-
function
|
|
9735
|
+
function isReasoningContent3(content) {
|
|
8937
9736
|
return content.type === "reasoning";
|
|
8938
9737
|
}
|
|
8939
9738
|
function isImageContent(content) {
|
|
8940
9739
|
return content.type === "image_url";
|
|
8941
9740
|
}
|
|
8942
|
-
function
|
|
9741
|
+
function isComponentContent3(content) {
|
|
8943
9742
|
return content.type === "component";
|
|
8944
9743
|
}
|
|
8945
9744
|
function isWidgetComponent2(content) {
|
|
@@ -8949,24 +9748,24 @@ function isWidgetComponent2(content) {
|
|
|
8949
9748
|
function isMemoryContent(content) {
|
|
8950
9749
|
return content.type === "memory";
|
|
8951
9750
|
}
|
|
8952
|
-
function
|
|
9751
|
+
function safeJson3(value) {
|
|
8953
9752
|
try {
|
|
8954
9753
|
return JSON.stringify(value, null, 2);
|
|
8955
9754
|
} catch {
|
|
8956
9755
|
return String(value);
|
|
8957
9756
|
}
|
|
8958
9757
|
}
|
|
8959
|
-
function
|
|
8960
|
-
return typeof value === "string" ? value :
|
|
9758
|
+
function formatDisplayValue3(value) {
|
|
9759
|
+
return typeof value === "string" ? value : safeJson3(value);
|
|
8961
9760
|
}
|
|
8962
9761
|
function ReasoningBlock({ reasoning }) {
|
|
8963
9762
|
const blocks = reasoning.filter((item) => item.text?.trim());
|
|
8964
9763
|
if (blocks.length === 0) return null;
|
|
8965
|
-
return /* @__PURE__ */
|
|
9764
|
+
return /* @__PURE__ */ jsx36("div", { className: "space-y-2", children: blocks.map((item, index) => /* @__PURE__ */ jsx36(
|
|
8966
9765
|
"div",
|
|
8967
9766
|
{
|
|
8968
9767
|
className: "rounded-lg border bg-muted/40 p-3 text-xs text-muted-foreground",
|
|
8969
|
-
children: /* @__PURE__ */
|
|
9768
|
+
children: /* @__PURE__ */ jsx36("p", { className: "whitespace-pre-wrap wrap-break-word leading-relaxed", children: item.text })
|
|
8970
9769
|
},
|
|
8971
9770
|
item.id ?? `reasoning-${index}`
|
|
8972
9771
|
)) });
|
|
@@ -8974,20 +9773,20 @@ function ReasoningBlock({ reasoning }) {
|
|
|
8974
9773
|
function ImageBlock({ content }) {
|
|
8975
9774
|
const imageUrl = typeof content.image_url === "string" ? content.image_url : typeof content.image_url?.url === "string" ? content.image_url.url : null;
|
|
8976
9775
|
if (!imageUrl) {
|
|
8977
|
-
return /* @__PURE__ */
|
|
8978
|
-
/* @__PURE__ */
|
|
8979
|
-
/* @__PURE__ */
|
|
9776
|
+
return /* @__PURE__ */ jsxs23(Card, { children: [
|
|
9777
|
+
/* @__PURE__ */ jsx36(CardHeader, { className: "space-y-1", children: /* @__PURE__ */ jsx36(CardTitle, { className: "text-sm", children: "Image" }) }),
|
|
9778
|
+
/* @__PURE__ */ jsx36(CardContent, { className: "text-xs text-muted-foreground", children: safeJson3(content) })
|
|
8980
9779
|
] });
|
|
8981
9780
|
}
|
|
8982
|
-
return /* @__PURE__ */
|
|
9781
|
+
return /* @__PURE__ */ jsx36("figure", { className: "overflow-hidden rounded-lg border bg-background", children: /* @__PURE__ */ jsx36("img", { src: imageUrl, alt: "Assistant output", className: "h-auto w-full object-cover" }) });
|
|
8983
9782
|
}
|
|
8984
9783
|
function MemoryBlock({ content }) {
|
|
8985
|
-
return /* @__PURE__ */
|
|
8986
|
-
/* @__PURE__ */
|
|
8987
|
-
/* @__PURE__ */
|
|
8988
|
-
/* @__PURE__ */
|
|
9784
|
+
return /* @__PURE__ */ jsxs23(Card, { children: [
|
|
9785
|
+
/* @__PURE__ */ jsxs23(CardHeader, { className: "flex flex-row items-center justify-between gap-2", children: [
|
|
9786
|
+
/* @__PURE__ */ jsx36(CardTitle, { className: "text-sm", children: "Memory" }),
|
|
9787
|
+
/* @__PURE__ */ jsx36(Badge, { variant: "secondary", children: "Memory" })
|
|
8989
9788
|
] }),
|
|
8990
|
-
/* @__PURE__ */
|
|
9789
|
+
/* @__PURE__ */ jsx36(CardContent, { className: "text-xs text-muted-foreground", children: /* @__PURE__ */ jsx36("pre", { className: "whitespace-pre-wrap wrap-break-word", children: safeJson3(content.data ?? []) }) })
|
|
8991
9790
|
] });
|
|
8992
9791
|
}
|
|
8993
9792
|
function parseStepDate2(value) {
|
|
@@ -9001,7 +9800,7 @@ function parseStepDate2(value) {
|
|
|
9001
9800
|
const timestamp = Date.parse(value);
|
|
9002
9801
|
return Number.isNaN(timestamp) ? null : timestamp;
|
|
9003
9802
|
}
|
|
9004
|
-
function
|
|
9803
|
+
function formatStepDuration3(durationMs) {
|
|
9005
9804
|
if (durationMs < 1e3) {
|
|
9006
9805
|
return `${durationMs}ms`;
|
|
9007
9806
|
}
|
|
@@ -9021,11 +9820,11 @@ function formatStepDuration2(durationMs) {
|
|
|
9021
9820
|
}
|
|
9022
9821
|
function ComponentBlock({ content }) {
|
|
9023
9822
|
const { i18n: i18n2 } = useChatkitTranslation();
|
|
9024
|
-
const [isExpanded, setIsExpanded] =
|
|
9025
|
-
const contentRef =
|
|
9026
|
-
const shouldAutoScrollRef =
|
|
9027
|
-
const previousScrollTopRef =
|
|
9028
|
-
const [durationNow, setDurationNow] =
|
|
9823
|
+
const [isExpanded, setIsExpanded] = React31.useState(false);
|
|
9824
|
+
const contentRef = React31.useRef(null);
|
|
9825
|
+
const shouldAutoScrollRef = React31.useRef(true);
|
|
9826
|
+
const previousScrollTopRef = React31.useRef(0);
|
|
9827
|
+
const [durationNow, setDurationNow] = React31.useState(() => Date.now());
|
|
9029
9828
|
const data = getToolStepData(content);
|
|
9030
9829
|
const category = data.category ?? "Component";
|
|
9031
9830
|
const title = getToolActivityLabel(content, i18n2.language);
|
|
@@ -9038,11 +9837,11 @@ function ComponentBlock({ content }) {
|
|
|
9038
9837
|
const createdAt = parseStepDate2(data.created_date);
|
|
9039
9838
|
const endedAt = parseStepDate2(data.end_date);
|
|
9040
9839
|
const durationMs = createdAt === null ? null : Math.max(0, (endedAt ?? durationNow) - createdAt);
|
|
9041
|
-
const durationLabel = durationMs === null ? null :
|
|
9042
|
-
|
|
9840
|
+
const durationLabel = durationMs === null ? null : formatStepDuration3(durationMs);
|
|
9841
|
+
React31.useEffect(() => {
|
|
9043
9842
|
if (status === "running" && output !== null) setIsExpanded(true);
|
|
9044
9843
|
}, [status, output]);
|
|
9045
|
-
|
|
9844
|
+
React31.useEffect(() => {
|
|
9046
9845
|
if (status !== "running" || createdAt === null || endedAt !== null) {
|
|
9047
9846
|
return;
|
|
9048
9847
|
}
|
|
@@ -9054,7 +9853,7 @@ function ComponentBlock({ content }) {
|
|
|
9054
9853
|
window.clearInterval(timer);
|
|
9055
9854
|
};
|
|
9056
9855
|
}, [createdAt, endedAt, status]);
|
|
9057
|
-
|
|
9856
|
+
React31.useEffect(() => {
|
|
9058
9857
|
const element = contentRef.current;
|
|
9059
9858
|
if (!element) return;
|
|
9060
9859
|
previousScrollTopRef.current = element.scrollTop;
|
|
@@ -9074,7 +9873,7 @@ function ComponentBlock({ content }) {
|
|
|
9074
9873
|
element.removeEventListener("scroll", updateAutoScrollState);
|
|
9075
9874
|
};
|
|
9076
9875
|
}, [isExpanded]);
|
|
9077
|
-
|
|
9876
|
+
React31.useEffect(() => {
|
|
9078
9877
|
if (status !== "running") {
|
|
9079
9878
|
shouldAutoScrollRef.current = true;
|
|
9080
9879
|
return;
|
|
@@ -9087,24 +9886,24 @@ function ComponentBlock({ content }) {
|
|
|
9087
9886
|
}, [isExpanded, output, status]);
|
|
9088
9887
|
const config = status ? toolStatusConfig[status] : null;
|
|
9089
9888
|
const StatusIcon = config?.icon;
|
|
9090
|
-
return /* @__PURE__ */
|
|
9091
|
-
/* @__PURE__ */
|
|
9092
|
-
/* @__PURE__ */
|
|
9093
|
-
status && StatusIcon && /* @__PURE__ */
|
|
9094
|
-
/* @__PURE__ */
|
|
9889
|
+
return /* @__PURE__ */ jsxs23(Card, { children: [
|
|
9890
|
+
/* @__PURE__ */ jsxs23(CardHeader, { className: "flex flex-row items-center justify-between gap-2 px-2 py-1 cursor-pointer", onClick: () => setIsExpanded(!isExpanded), children: [
|
|
9891
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex items-center space-x-1 flex-1 min-w-0", children: [
|
|
9892
|
+
status && StatusIcon && /* @__PURE__ */ jsx36(StatusIcon, { className: cn("h-4 w-4", config?.iconClass, status === "running" && "animate-spin") }),
|
|
9893
|
+
/* @__PURE__ */ jsx36(CardTitle, { className: "text-sm truncate", children: title })
|
|
9095
9894
|
] }),
|
|
9096
|
-
/* @__PURE__ */
|
|
9097
|
-
durationLabel && /* @__PURE__ */
|
|
9098
|
-
/* @__PURE__ */
|
|
9099
|
-
/* @__PURE__ */
|
|
9895
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex flex-wrap items-center gap-2 shrink-0", children: [
|
|
9896
|
+
durationLabel && /* @__PURE__ */ jsxs23("div", { className: "inline-flex items-center gap-1 text-[11px] text-muted-foreground tabular-nums", children: [
|
|
9897
|
+
/* @__PURE__ */ jsx36(Clock32, { className: "h-3 w-3" }),
|
|
9898
|
+
/* @__PURE__ */ jsx36("span", { children: durationLabel })
|
|
9100
9899
|
] }),
|
|
9101
|
-
/* @__PURE__ */
|
|
9102
|
-
/* @__PURE__ */
|
|
9900
|
+
/* @__PURE__ */ jsx36(Badge, { variant: "secondary", className: "rounded-lg px-1.5", children: category }),
|
|
9901
|
+
/* @__PURE__ */ jsx36(
|
|
9103
9902
|
"button",
|
|
9104
9903
|
{
|
|
9105
9904
|
className: "text-muted-foreground hover:text-foreground transition-colors",
|
|
9106
9905
|
"aria-label": isExpanded ? "Collapse" : "Expand",
|
|
9107
|
-
children: /* @__PURE__ */
|
|
9906
|
+
children: /* @__PURE__ */ jsx36(
|
|
9108
9907
|
ChevronDown4,
|
|
9109
9908
|
{
|
|
9110
9909
|
className: cn("h-4 w-4 transition-transform", isExpanded && "rotate-180")
|
|
@@ -9114,61 +9913,82 @@ function ComponentBlock({ content }) {
|
|
|
9114
9913
|
)
|
|
9115
9914
|
] })
|
|
9116
9915
|
] }),
|
|
9117
|
-
isExpanded && /* @__PURE__ */
|
|
9118
|
-
data.input && /* @__PURE__ */
|
|
9119
|
-
error ? /* @__PURE__ */
|
|
9916
|
+
isExpanded && /* @__PURE__ */ jsxs23(CardContent, { ref: contentRef, className: "text-xs text-muted-foreground max-h-60 overflow-auto", children: [
|
|
9917
|
+
data.input && /* @__PURE__ */ jsx36("pre", { className: "whitespace-pre-wrap wrap-break-word", children: formatDisplayValue3(data.input) }),
|
|
9918
|
+
error ? /* @__PURE__ */ jsx36("pre", { className: "whitespace-pre-wrap wrap-break-word text-destructive", children: formatDisplayValue3(error) }) : hasOutput && /* @__PURE__ */ jsx36("pre", { className: "whitespace-pre-wrap wrap-break-word", children: formatDisplayValue3(fallback) })
|
|
9120
9919
|
] })
|
|
9121
9920
|
] });
|
|
9122
9921
|
}
|
|
9123
9922
|
function UnknownBlock({ content }) {
|
|
9124
|
-
return /* @__PURE__ */
|
|
9125
|
-
/* @__PURE__ */
|
|
9126
|
-
/* @__PURE__ */
|
|
9127
|
-
/* @__PURE__ */
|
|
9923
|
+
return /* @__PURE__ */ jsxs23(Card, { children: [
|
|
9924
|
+
/* @__PURE__ */ jsxs23(CardHeader, { className: "flex flex-row items-center justify-between gap-2", children: [
|
|
9925
|
+
/* @__PURE__ */ jsx36(CardTitle, { className: "text-sm", children: "Assistant Content" }),
|
|
9926
|
+
/* @__PURE__ */ jsx36(Badge, { variant: "outline", children: content.type ?? "unknown" })
|
|
9128
9927
|
] }),
|
|
9129
|
-
/* @__PURE__ */
|
|
9928
|
+
/* @__PURE__ */ jsx36(CardContent, { className: "text-xs text-muted-foreground", children: /* @__PURE__ */ jsx36("pre", { className: "whitespace-pre-wrap break-words", children: safeJson3(content) }) })
|
|
9130
9929
|
] });
|
|
9131
9930
|
}
|
|
9132
|
-
function renderContentItem(content, index, message, lookupMessages) {
|
|
9931
|
+
function renderContentItem(content, index, message, lookupMessages, options) {
|
|
9133
9932
|
const messageId = message.id;
|
|
9933
|
+
const textClassName = options?.isAgentOutput ? "text-sm [&_.markdown-content_p]:!leading-6" : void 0;
|
|
9134
9934
|
if (typeof content === "string") {
|
|
9135
|
-
return /* @__PURE__ */
|
|
9935
|
+
return /* @__PURE__ */ jsx36("div", { className: textClassName, children: /* @__PURE__ */ jsx36(MarkdownText, { children: content }) }, `text-${index}`);
|
|
9136
9936
|
}
|
|
9137
|
-
if (
|
|
9138
|
-
return /* @__PURE__ */
|
|
9937
|
+
if (isTextContent3(content)) {
|
|
9938
|
+
return /* @__PURE__ */ jsx36("div", { className: textClassName, children: /* @__PURE__ */ jsx36(MarkdownText, { children: content.text }) }, content.id ?? `text-${index}`);
|
|
9139
9939
|
}
|
|
9140
|
-
if (
|
|
9141
|
-
return /* @__PURE__ */
|
|
9940
|
+
if (isReasoningContent3(content)) {
|
|
9941
|
+
return /* @__PURE__ */ jsx36("div", { children: /* @__PURE__ */ jsx36(ReasoningBlock, { reasoning: [content] }) }, content.id ?? `reasoning-${index}`);
|
|
9142
9942
|
}
|
|
9143
9943
|
if (isImageContent(content)) {
|
|
9144
|
-
return /* @__PURE__ */
|
|
9944
|
+
return /* @__PURE__ */ jsx36("div", { children: /* @__PURE__ */ jsx36(ImageBlock, { content }) }, content.id ?? `image-${index}`);
|
|
9145
9945
|
}
|
|
9146
|
-
if (
|
|
9946
|
+
if (isComponentContent3(content)) {
|
|
9147
9947
|
const requestUserInputResult = getRequestUserInputResultCardData(
|
|
9148
9948
|
content,
|
|
9149
9949
|
lookupMessages
|
|
9150
9950
|
);
|
|
9151
9951
|
if (requestUserInputResult) {
|
|
9152
|
-
return /* @__PURE__ */
|
|
9952
|
+
return /* @__PURE__ */ jsx36("div", { children: /* @__PURE__ */ jsx36(RequestUserInputResultCard, { result: requestUserInputResult }) }, content.id ?? `request-user-input-result-${index}`);
|
|
9153
9953
|
}
|
|
9154
9954
|
if (isWidgetComponent2(content)) {
|
|
9155
|
-
return /* @__PURE__ */
|
|
9955
|
+
return /* @__PURE__ */ jsx36("div", { children: /* @__PURE__ */ jsx36(WidgetMessage, { messageId, data: content.data }) }, content.id ?? `widget-${index}`);
|
|
9156
9956
|
}
|
|
9157
|
-
|
|
9957
|
+
if (getComponentMessagePresentation(content, getToolStepData(content)) === "grouped-step") {
|
|
9958
|
+
return /* @__PURE__ */ jsx36("div", { children: /* @__PURE__ */ jsx36(
|
|
9959
|
+
ToolComponentGroup,
|
|
9960
|
+
{
|
|
9961
|
+
items: [content],
|
|
9962
|
+
hasFollowingItem: false,
|
|
9963
|
+
isThreadRunning: options?.isThreadRunning,
|
|
9964
|
+
organizationId: options?.organizationId,
|
|
9965
|
+
apiUrl: options?.apiUrl
|
|
9966
|
+
}
|
|
9967
|
+
) }, content.id ?? `component-group-${index}`);
|
|
9968
|
+
}
|
|
9969
|
+
return /* @__PURE__ */ jsx36("div", { children: /* @__PURE__ */ jsx36(ComponentBlock, { content }) }, content.id ?? `component-${index}`);
|
|
9158
9970
|
}
|
|
9159
9971
|
if (isMemoryContent(content)) {
|
|
9160
|
-
return /* @__PURE__ */
|
|
9972
|
+
return /* @__PURE__ */ jsx36("div", { children: /* @__PURE__ */ jsx36(MemoryBlock, { content }) }, content.id ?? `memory-${index}`);
|
|
9161
9973
|
}
|
|
9162
|
-
|
|
9974
|
+
if (isAgentEventContent(content)) {
|
|
9975
|
+
return /* @__PURE__ */ jsx36("div", { children: /* @__PURE__ */ jsx36(AgentEventRow, { content }) }, content.id ?? `agent-event-${index}`);
|
|
9976
|
+
}
|
|
9977
|
+
return /* @__PURE__ */ jsx36("div", { children: /* @__PURE__ */ jsx36(UnknownBlock, { content }) }, content.id ?? `unknown-${index}`);
|
|
9163
9978
|
}
|
|
9164
9979
|
function renderContentUnit(unit, message, lookupMessages, hasFollowingItem, options) {
|
|
9165
9980
|
if (unit.type === "item") {
|
|
9166
|
-
return renderContentItem(unit.item, unit.index, message, lookupMessages
|
|
9981
|
+
return renderContentItem(unit.item, unit.index, message, lookupMessages, {
|
|
9982
|
+
isThreadRunning: options?.isThreadRunning,
|
|
9983
|
+
organizationId: options?.organizationId,
|
|
9984
|
+
apiUrl: options?.apiUrl,
|
|
9985
|
+
isAgentOutput: options?.isAgentOutput
|
|
9986
|
+
});
|
|
9167
9987
|
}
|
|
9168
|
-
return /* @__PURE__ */
|
|
9988
|
+
return /* @__PURE__ */ jsx36(
|
|
9169
9989
|
"div",
|
|
9170
9990
|
{
|
|
9171
|
-
children: /* @__PURE__ */
|
|
9991
|
+
children: /* @__PURE__ */ jsx36(
|
|
9172
9992
|
ToolComponentGroup,
|
|
9173
9993
|
{
|
|
9174
9994
|
items: unit.items,
|
|
@@ -9182,17 +10002,91 @@ function renderContentUnit(unit, message, lookupMessages, hasFollowingItem, opti
|
|
|
9182
10002
|
`tool-group-${unit.startIndex}-${unit.items[0]?.id ?? "tool"}-${unit.items.length}`
|
|
9183
10003
|
);
|
|
9184
10004
|
}
|
|
10005
|
+
function renderEntryBatch(entries, message, lookupMessages, hasFollowingItem, options) {
|
|
10006
|
+
if (entries.length === 0) return null;
|
|
10007
|
+
const renderUnits = buildToolComponentRenderUnits(
|
|
10008
|
+
entries.map((entry) => entry.item),
|
|
10009
|
+
{
|
|
10010
|
+
shouldGroupComponent: (item) => getRequestUserInputResultCardData(item, lookupMessages) === null
|
|
10011
|
+
}
|
|
10012
|
+
);
|
|
10013
|
+
return renderUnits.map(
|
|
10014
|
+
(unit, index) => renderContentUnit(
|
|
10015
|
+
unit,
|
|
10016
|
+
message,
|
|
10017
|
+
lookupMessages,
|
|
10018
|
+
index < renderUnits.length - 1 || hasFollowingItem,
|
|
10019
|
+
options
|
|
10020
|
+
)
|
|
10021
|
+
);
|
|
10022
|
+
}
|
|
10023
|
+
function renderAssistantRenderUnits(units, message, lookupMessages, options, depth = 0) {
|
|
10024
|
+
const rendered = [];
|
|
10025
|
+
let entryBatch = [];
|
|
10026
|
+
const flushEntries = (hasFollowingItem) => {
|
|
10027
|
+
if (entryBatch.length === 0) return;
|
|
10028
|
+
const batch = entryBatch;
|
|
10029
|
+
entryBatch = [];
|
|
10030
|
+
rendered.push(
|
|
10031
|
+
/* @__PURE__ */ jsx36(React31.Fragment, { children: renderEntryBatch(batch, message, lookupMessages, hasFollowingItem, {
|
|
10032
|
+
...options,
|
|
10033
|
+
isAgentOutput: depth > 0
|
|
10034
|
+
}) }, `entries-${batch[0]?.order ?? rendered.length}`)
|
|
10035
|
+
);
|
|
10036
|
+
};
|
|
10037
|
+
units.forEach((unit, index) => {
|
|
10038
|
+
const hasFollowingItem = index < units.length - 1;
|
|
10039
|
+
if (unit.type === "entry") {
|
|
10040
|
+
entryBatch.push(unit.entry);
|
|
10041
|
+
if (!hasFollowingItem) {
|
|
10042
|
+
flushEntries(false);
|
|
10043
|
+
}
|
|
10044
|
+
return;
|
|
10045
|
+
}
|
|
10046
|
+
flushEntries(true);
|
|
10047
|
+
rendered.push(
|
|
10048
|
+
/* @__PURE__ */ jsx36(
|
|
10049
|
+
AgentRunGroup,
|
|
10050
|
+
{
|
|
10051
|
+
node: unit.node,
|
|
10052
|
+
hasFollowingItem,
|
|
10053
|
+
depth,
|
|
10054
|
+
renderUnits: (childUnits, nextDepth) => renderAssistantRenderUnits(
|
|
10055
|
+
childUnits,
|
|
10056
|
+
message,
|
|
10057
|
+
lookupMessages,
|
|
10058
|
+
options,
|
|
10059
|
+
nextDepth
|
|
10060
|
+
)
|
|
10061
|
+
},
|
|
10062
|
+
unit.node.id
|
|
10063
|
+
)
|
|
10064
|
+
);
|
|
10065
|
+
});
|
|
10066
|
+
return rendered;
|
|
10067
|
+
}
|
|
9185
10068
|
function renderContent(message, lookupMessages, options) {
|
|
10069
|
+
const renderTree = buildAssistantRenderTree(
|
|
10070
|
+
message
|
|
10071
|
+
);
|
|
10072
|
+
if (renderTree.hasAgentRuns) {
|
|
10073
|
+
return /* @__PURE__ */ jsx36("div", { className: assistantMessageStackClassName, children: renderAssistantRenderUnits(
|
|
10074
|
+
renderTree.units,
|
|
10075
|
+
message,
|
|
10076
|
+
lookupMessages,
|
|
10077
|
+
options
|
|
10078
|
+
) });
|
|
10079
|
+
}
|
|
9186
10080
|
const content = message.content;
|
|
9187
10081
|
if (typeof content === "string") {
|
|
9188
10082
|
if (!content.trim()) return null;
|
|
9189
|
-
return /* @__PURE__ */
|
|
10083
|
+
return /* @__PURE__ */ jsx36(MarkdownText, { children: content });
|
|
9190
10084
|
}
|
|
9191
10085
|
if (!Array.isArray(content) || content.length === 0) return null;
|
|
9192
10086
|
const renderUnits = buildToolComponentRenderUnits(content, {
|
|
9193
10087
|
shouldGroupComponent: (item) => getRequestUserInputResultCardData(item, lookupMessages) === null
|
|
9194
10088
|
});
|
|
9195
|
-
return /* @__PURE__ */
|
|
10089
|
+
return /* @__PURE__ */ jsx36("div", { className: "space-y-3", children: renderUnits.map(
|
|
9196
10090
|
(unit, index) => renderContentUnit(
|
|
9197
10091
|
unit,
|
|
9198
10092
|
message,
|
|
@@ -9212,20 +10106,29 @@ function AssistantStreamingIndicator({
|
|
|
9212
10106
|
thinking: t("message.thinking"),
|
|
9213
10107
|
answering: t("message.answering")
|
|
9214
10108
|
};
|
|
9215
|
-
return /* @__PURE__ */
|
|
9216
|
-
|
|
9217
|
-
|
|
9218
|
-
|
|
9219
|
-
|
|
9220
|
-
|
|
9221
|
-
|
|
9222
|
-
|
|
9223
|
-
|
|
9224
|
-
|
|
9225
|
-
|
|
9226
|
-
|
|
9227
|
-
|
|
9228
|
-
|
|
10109
|
+
return /* @__PURE__ */ jsxs23(
|
|
10110
|
+
"div",
|
|
10111
|
+
{
|
|
10112
|
+
className: cn(
|
|
10113
|
+
"flex items-center gap-2 text-xs text-muted-foreground",
|
|
10114
|
+
className
|
|
10115
|
+
),
|
|
10116
|
+
children: [
|
|
10117
|
+
status === "loading" && /* @__PURE__ */ jsx36(Loader25, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
10118
|
+
status === "thinking" && /* @__PURE__ */ jsxs23("div", { className: "flex items-end gap-1", "aria-hidden": "true", children: [
|
|
10119
|
+
/* @__PURE__ */ jsx36("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:-0.3s]" }),
|
|
10120
|
+
/* @__PURE__ */ jsx36("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:-0.15s]" }),
|
|
10121
|
+
/* @__PURE__ */ jsx36("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce" })
|
|
10122
|
+
] }),
|
|
10123
|
+
status === "answering" && /* @__PURE__ */ jsxs23("div", { className: "flex items-end gap-1", "aria-hidden": "true", children: [
|
|
10124
|
+
/* @__PURE__ */ jsx36("span", { className: "h-2 w-0.5 rounded-full bg-current animate-pulse [animation-delay:-0.25s]" }),
|
|
10125
|
+
/* @__PURE__ */ jsx36("span", { className: "h-3 w-0.5 rounded-full bg-current animate-pulse [animation-delay:-0.1s]" }),
|
|
10126
|
+
/* @__PURE__ */ jsx36("span", { className: "h-2.5 w-0.5 rounded-full bg-current animate-pulse" })
|
|
10127
|
+
] }),
|
|
10128
|
+
/* @__PURE__ */ jsx36("span", { children: labelMap[status] })
|
|
10129
|
+
]
|
|
10130
|
+
}
|
|
10131
|
+
);
|
|
9229
10132
|
}
|
|
9230
10133
|
function AssistantMessage({
|
|
9231
10134
|
message,
|
|
@@ -9238,8 +10141,12 @@ function AssistantMessage({
|
|
|
9238
10141
|
apiUrl
|
|
9239
10142
|
}) {
|
|
9240
10143
|
const { t } = useChatkitTranslation();
|
|
9241
|
-
const
|
|
9242
|
-
|
|
10144
|
+
const renderTree = buildAssistantRenderTree(
|
|
10145
|
+
message
|
|
10146
|
+
);
|
|
10147
|
+
const rootReasoning = renderTree.hasAgentRuns ? renderTree.rootReasoning : message.reasoning;
|
|
10148
|
+
const hasContent = hasRenderableMessageContent(message.content) || renderTree.hasAgentRuns;
|
|
10149
|
+
const hasReasoning = hasRenderableReasoning(rootReasoning);
|
|
9243
10150
|
const resolvedStreamingStatus = streamingStatus ?? getAssistantStreamingStatus(message, isStreaming);
|
|
9244
10151
|
const lookupMessages = messages?.length ? messages : [message];
|
|
9245
10152
|
const answerNode = renderContent(message, lookupMessages, {
|
|
@@ -9247,42 +10154,42 @@ function AssistantMessage({
|
|
|
9247
10154
|
organizationId,
|
|
9248
10155
|
apiUrl
|
|
9249
10156
|
});
|
|
9250
|
-
const reasoningNode = hasReasoning ? /* @__PURE__ */
|
|
9251
|
-
if (!
|
|
10157
|
+
const reasoningNode = hasReasoning ? /* @__PURE__ */ jsx36(ReasoningBlock, { reasoning: rootReasoning ?? [] }) : null;
|
|
10158
|
+
if (!hasContent && !hasReasoning && !resolvedStreamingStatus) return null;
|
|
9252
10159
|
const streamingClass = isStreaming ? "streaming-active" : "";
|
|
9253
|
-
if (!
|
|
9254
|
-
return /* @__PURE__ */
|
|
10160
|
+
if (!hasContent && !hasReasoning && resolvedStreamingStatus) {
|
|
10161
|
+
return /* @__PURE__ */ jsx36("div", { className: cn("space-y-3", streamingClass, className), children: /* @__PURE__ */ jsx36(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) });
|
|
9255
10162
|
}
|
|
9256
10163
|
if (hasContent && hasReasoning) {
|
|
9257
|
-
return /* @__PURE__ */
|
|
9258
|
-
/* @__PURE__ */
|
|
10164
|
+
return /* @__PURE__ */ jsxs23("div", { className: cn("space-y-3", streamingClass, className), children: [
|
|
10165
|
+
/* @__PURE__ */ jsxs23(
|
|
9259
10166
|
Tabs,
|
|
9260
10167
|
{
|
|
9261
10168
|
defaultValue: message.status === "reasoning" ? "reasoning" : "answer",
|
|
9262
10169
|
className: "w-full",
|
|
9263
10170
|
children: [
|
|
9264
|
-
/* @__PURE__ */
|
|
9265
|
-
/* @__PURE__ */
|
|
9266
|
-
/* @__PURE__ */
|
|
10171
|
+
/* @__PURE__ */ jsxs23(TabsList, { className: "", children: [
|
|
10172
|
+
/* @__PURE__ */ jsx36(TabsTrigger, { value: "answer", children: t("message.answer") }),
|
|
10173
|
+
/* @__PURE__ */ jsx36(TabsTrigger, { value: "reasoning", children: t("message.reasoning") })
|
|
9267
10174
|
] }),
|
|
9268
|
-
/* @__PURE__ */
|
|
9269
|
-
/* @__PURE__ */
|
|
10175
|
+
/* @__PURE__ */ jsx36(TabsContent, { value: "answer", className: "space-y-3", children: answerNode }),
|
|
10176
|
+
/* @__PURE__ */ jsx36(TabsContent, { value: "reasoning", className: "space-y-3", children: reasoningNode })
|
|
9270
10177
|
]
|
|
9271
10178
|
}
|
|
9272
10179
|
),
|
|
9273
|
-
resolvedStreamingStatus ? /* @__PURE__ */
|
|
10180
|
+
resolvedStreamingStatus ? /* @__PURE__ */ jsx36(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) : null
|
|
9274
10181
|
] });
|
|
9275
10182
|
}
|
|
9276
|
-
return /* @__PURE__ */
|
|
10183
|
+
return /* @__PURE__ */ jsxs23("div", { className: cn("space-y-3", streamingClass, className), children: [
|
|
9277
10184
|
hasReasoning ? reasoningNode : answerNode,
|
|
9278
|
-
resolvedStreamingStatus ? /* @__PURE__ */
|
|
10185
|
+
resolvedStreamingStatus ? /* @__PURE__ */ jsx36(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) : null
|
|
9279
10186
|
] });
|
|
9280
10187
|
}
|
|
9281
10188
|
|
|
9282
10189
|
// src/components/thread/MessageActions.tsx
|
|
9283
|
-
import * as
|
|
10190
|
+
import * as React32 from "react";
|
|
9284
10191
|
import { Check as Check4, Copy as Copy2, RefreshCw } from "lucide-react";
|
|
9285
|
-
import { jsx as
|
|
10192
|
+
import { jsx as jsx37, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
9286
10193
|
function MessageActions({
|
|
9287
10194
|
content,
|
|
9288
10195
|
isAssistant = false,
|
|
@@ -9291,7 +10198,7 @@ function MessageActions({
|
|
|
9291
10198
|
className
|
|
9292
10199
|
}) {
|
|
9293
10200
|
const { t } = useChatkitTranslation();
|
|
9294
|
-
const [copied, setCopied] =
|
|
10201
|
+
const [copied, setCopied] = React32.useState(false);
|
|
9295
10202
|
const handleCopy = async () => {
|
|
9296
10203
|
try {
|
|
9297
10204
|
await navigator.clipboard.writeText(content);
|
|
@@ -9304,7 +10211,7 @@ function MessageActions({
|
|
|
9304
10211
|
if (isStreaming) {
|
|
9305
10212
|
return null;
|
|
9306
10213
|
}
|
|
9307
|
-
return /* @__PURE__ */
|
|
10214
|
+
return /* @__PURE__ */ jsxs24(
|
|
9308
10215
|
"div",
|
|
9309
10216
|
{
|
|
9310
10217
|
className: cn(
|
|
@@ -9312,7 +10219,7 @@ function MessageActions({
|
|
|
9312
10219
|
className
|
|
9313
10220
|
),
|
|
9314
10221
|
children: [
|
|
9315
|
-
/* @__PURE__ */
|
|
10222
|
+
/* @__PURE__ */ jsx37(
|
|
9316
10223
|
"button",
|
|
9317
10224
|
{
|
|
9318
10225
|
type: "button",
|
|
@@ -9322,17 +10229,17 @@ function MessageActions({
|
|
|
9322
10229
|
copied && "text-green-500"
|
|
9323
10230
|
),
|
|
9324
10231
|
title: copied ? t("messageActions.copied") : t("messageActions.copy"),
|
|
9325
|
-
children: copied ? /* @__PURE__ */
|
|
10232
|
+
children: copied ? /* @__PURE__ */ jsx37(Check4, { size: 14 }) : /* @__PURE__ */ jsx37(Copy2, { size: 14 })
|
|
9326
10233
|
}
|
|
9327
10234
|
),
|
|
9328
|
-
isAssistant && onRetry && /* @__PURE__ */
|
|
10235
|
+
isAssistant && onRetry && /* @__PURE__ */ jsx37(
|
|
9329
10236
|
"button",
|
|
9330
10237
|
{
|
|
9331
10238
|
type: "button",
|
|
9332
10239
|
onClick: onRetry,
|
|
9333
10240
|
className: "p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",
|
|
9334
10241
|
title: t("messageActions.regenerate"),
|
|
9335
|
-
children: /* @__PURE__ */
|
|
10242
|
+
children: /* @__PURE__ */ jsx37(RefreshCw, { size: 14 })
|
|
9336
10243
|
}
|
|
9337
10244
|
)
|
|
9338
10245
|
]
|
|
@@ -9349,22 +10256,22 @@ import {
|
|
|
9349
10256
|
HelpCircle,
|
|
9350
10257
|
Lightbulb as Lightbulb2,
|
|
9351
10258
|
Pencil as Pencil3,
|
|
9352
|
-
Search as
|
|
10259
|
+
Search as Search3,
|
|
9353
10260
|
Sparkles as Sparkles3,
|
|
9354
10261
|
Zap
|
|
9355
10262
|
} from "lucide-react";
|
|
9356
|
-
import { jsx as
|
|
10263
|
+
import { jsx as jsx38, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
9357
10264
|
function getIconComponent2(icon) {
|
|
9358
10265
|
const iconMap = {
|
|
9359
|
-
"circle-question": /* @__PURE__ */
|
|
9360
|
-
"lightbulb": /* @__PURE__ */
|
|
9361
|
-
"sparkle": /* @__PURE__ */
|
|
9362
|
-
"write": /* @__PURE__ */
|
|
9363
|
-
"search": /* @__PURE__ */
|
|
9364
|
-
"globe": /* @__PURE__ */
|
|
9365
|
-
"book-open": /* @__PURE__ */
|
|
9366
|
-
"compass": /* @__PURE__ */
|
|
9367
|
-
"bolt": /* @__PURE__ */
|
|
10266
|
+
"circle-question": /* @__PURE__ */ jsx38(HelpCircle, { size: 20 }),
|
|
10267
|
+
"lightbulb": /* @__PURE__ */ jsx38(Lightbulb2, { size: 20 }),
|
|
10268
|
+
"sparkle": /* @__PURE__ */ jsx38(Sparkles3, { size: 20 }),
|
|
10269
|
+
"write": /* @__PURE__ */ jsx38(Pencil3, { size: 20 }),
|
|
10270
|
+
"search": /* @__PURE__ */ jsx38(Search3, { size: 20 }),
|
|
10271
|
+
"globe": /* @__PURE__ */ jsx38(Globe2, { size: 20 }),
|
|
10272
|
+
"book-open": /* @__PURE__ */ jsx38(BookOpen2, { size: 20 }),
|
|
10273
|
+
"compass": /* @__PURE__ */ jsx38(Compass, { size: 20 }),
|
|
10274
|
+
"bolt": /* @__PURE__ */ jsx38(Zap, { size: 20 })
|
|
9368
10275
|
};
|
|
9369
10276
|
return icon ? iconMap[icon] || iconMap["sparkle"] : iconMap["sparkle"];
|
|
9370
10277
|
}
|
|
@@ -9372,9 +10279,9 @@ function StartScreen({ startScreen, onPromptClick, className }) {
|
|
|
9372
10279
|
const { t } = useChatkitTranslation();
|
|
9373
10280
|
const greeting = startScreen?.greeting ?? t("startScreen.greeting");
|
|
9374
10281
|
const prompts = startScreen?.prompts ?? [];
|
|
9375
|
-
return /* @__PURE__ */
|
|
9376
|
-
/* @__PURE__ */
|
|
9377
|
-
prompts.length > 0 && /* @__PURE__ */
|
|
10282
|
+
return /* @__PURE__ */ jsxs25("div", { className: cn("flex flex-col items-center justify-center py-12 px-4", className), children: [
|
|
10283
|
+
/* @__PURE__ */ jsx38("div", { className: "mb-8 text-center", children: /* @__PURE__ */ jsx38("h2", { className: "text-2xl font-semibold text-foreground mb-2", children: greeting }) }),
|
|
10284
|
+
prompts.length > 0 && /* @__PURE__ */ jsx38("div", { className: "w-full max-w-2xl", children: /* @__PURE__ */ jsx38("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: prompts.map((item, index) => /* @__PURE__ */ jsxs25(
|
|
9378
10285
|
"button",
|
|
9379
10286
|
{
|
|
9380
10287
|
type: "button",
|
|
@@ -9385,8 +10292,8 @@ function StartScreen({ startScreen, onPromptClick, className }) {
|
|
|
9385
10292
|
"focus:outline-none focus:ring-2 focus:ring-primary/20"
|
|
9386
10293
|
),
|
|
9387
10294
|
children: [
|
|
9388
|
-
/* @__PURE__ */
|
|
9389
|
-
/* @__PURE__ */
|
|
10295
|
+
/* @__PURE__ */ jsx38("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary", children: getIconComponent2(item.icon) }),
|
|
10296
|
+
/* @__PURE__ */ jsx38("span", { className: "text-sm font-medium text-foreground", children: item.label })
|
|
9390
10297
|
]
|
|
9391
10298
|
},
|
|
9392
10299
|
`prompt-${index}`
|
|
@@ -9395,7 +10302,7 @@ function StartScreen({ startScreen, onPromptClick, className }) {
|
|
|
9395
10302
|
}
|
|
9396
10303
|
|
|
9397
10304
|
// src/hooks/useThreads.ts
|
|
9398
|
-
import * as
|
|
10305
|
+
import * as React34 from "react";
|
|
9399
10306
|
var DEFAULT_LIMIT = 50;
|
|
9400
10307
|
var getThreadTitle = (threadRecord) => {
|
|
9401
10308
|
const title = threadRecord.title?.trim();
|
|
@@ -9448,16 +10355,16 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
9448
10355
|
isLoading: isStreamLoading,
|
|
9449
10356
|
error: streamError
|
|
9450
10357
|
} = useStreamContext();
|
|
9451
|
-
const [threadRecords, setThreadRecords] =
|
|
9452
|
-
const [isLoading, setIsLoading] =
|
|
9453
|
-
const [error, setError] =
|
|
9454
|
-
const upsertThreadRecord =
|
|
10358
|
+
const [threadRecords, setThreadRecords] = React34.useState([]);
|
|
10359
|
+
const [isLoading, setIsLoading] = React34.useState(false);
|
|
10360
|
+
const [error, setError] = React34.useState(null);
|
|
10361
|
+
const upsertThreadRecord = React34.useCallback((threadRecord) => {
|
|
9455
10362
|
setThreadRecords((prev) => {
|
|
9456
10363
|
const next = prev.filter((item) => item.id !== threadRecord.id);
|
|
9457
10364
|
return sortThreadRecords([threadRecord, ...next]);
|
|
9458
10365
|
});
|
|
9459
10366
|
}, []);
|
|
9460
|
-
const refreshThreads =
|
|
10367
|
+
const refreshThreads = React34.useCallback(async () => {
|
|
9461
10368
|
setIsLoading(true);
|
|
9462
10369
|
setError(null);
|
|
9463
10370
|
try {
|
|
@@ -9473,7 +10380,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
9473
10380
|
setIsLoading(false);
|
|
9474
10381
|
}
|
|
9475
10382
|
}, [client, limit, assistantId]);
|
|
9476
|
-
const createThread =
|
|
10383
|
+
const createThread = React34.useCallback(
|
|
9477
10384
|
async (input) => {
|
|
9478
10385
|
setError(null);
|
|
9479
10386
|
const payload = {};
|
|
@@ -9487,7 +10394,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
9487
10394
|
},
|
|
9488
10395
|
[client, upsertThreadRecord]
|
|
9489
10396
|
);
|
|
9490
|
-
const updateThread =
|
|
10397
|
+
const updateThread = React34.useCallback(
|
|
9491
10398
|
async (recordId, payload) => {
|
|
9492
10399
|
setError(null);
|
|
9493
10400
|
const updated = await client.conversations.update(recordId, payload);
|
|
@@ -9496,7 +10403,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
9496
10403
|
},
|
|
9497
10404
|
[client, upsertThreadRecord]
|
|
9498
10405
|
);
|
|
9499
|
-
const deleteThread =
|
|
10406
|
+
const deleteThread = React34.useCallback(
|
|
9500
10407
|
async (recordId) => {
|
|
9501
10408
|
setError(null);
|
|
9502
10409
|
await client.conversations.delete(recordId);
|
|
@@ -9504,11 +10411,11 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
9504
10411
|
},
|
|
9505
10412
|
[client]
|
|
9506
10413
|
);
|
|
9507
|
-
|
|
10414
|
+
React34.useEffect(() => {
|
|
9508
10415
|
if (!isReady) return;
|
|
9509
10416
|
void refreshThreads();
|
|
9510
10417
|
}, [refreshThreads, isReady]);
|
|
9511
|
-
|
|
10418
|
+
React34.useEffect(() => {
|
|
9512
10419
|
if (!threadId || !isStreamLoading) return;
|
|
9513
10420
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
9514
10421
|
const busyStatus = "busy";
|
|
@@ -9529,7 +10436,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
9529
10436
|
return changed ? sortThreadRecords(next) : prev;
|
|
9530
10437
|
});
|
|
9531
10438
|
}, [threadId, isStreamLoading]);
|
|
9532
|
-
|
|
10439
|
+
React34.useEffect(() => {
|
|
9533
10440
|
const message = getErrorMessage(streamError)?.trim();
|
|
9534
10441
|
if (!threadId || !message) return;
|
|
9535
10442
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -9551,7 +10458,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
9551
10458
|
return changed ? sortThreadRecords(next) : prev;
|
|
9552
10459
|
});
|
|
9553
10460
|
}, [threadId, streamError]);
|
|
9554
|
-
|
|
10461
|
+
React34.useEffect(() => {
|
|
9555
10462
|
if (!isReady || !threadId || isStreamLoading) return;
|
|
9556
10463
|
let cancelled = false;
|
|
9557
10464
|
void client.conversations.search({ where: { threadId }, limit: 1 }).then((result) => {
|
|
@@ -9565,7 +10472,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
9565
10472
|
cancelled = true;
|
|
9566
10473
|
};
|
|
9567
10474
|
}, [client, threadId, upsertThreadRecord, isReady, isStreamLoading]);
|
|
9568
|
-
const threads =
|
|
10475
|
+
const threads = React34.useMemo(
|
|
9569
10476
|
() => threadRecords.map((threadRecord) => toThreadItem(threadRecord)),
|
|
9570
10477
|
[threadRecords]
|
|
9571
10478
|
);
|
|
@@ -9582,10 +10489,10 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
9582
10489
|
}
|
|
9583
10490
|
|
|
9584
10491
|
// src/components/thread/context-usage-indicator.tsx
|
|
9585
|
-
import * as
|
|
10492
|
+
import * as React35 from "react";
|
|
9586
10493
|
|
|
9587
10494
|
// src/components/ui/progress-circle.tsx
|
|
9588
|
-
import { jsx as
|
|
10495
|
+
import { jsx as jsx39, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
9589
10496
|
function clamp2(input, a, b) {
|
|
9590
10497
|
return Math.max(Math.min(input, Math.max(a, b)), Math.min(a, b));
|
|
9591
10498
|
}
|
|
@@ -9608,7 +10515,7 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
|
|
|
9608
10515
|
return (
|
|
9609
10516
|
// biome-ignore lint/a11y/useFocusableInteractive: false positive (progress + progressbar are not focusable interactives)
|
|
9610
10517
|
// biome-ignore lint/nursery/useAriaPropsSupportedByRole: biome rule at odds with mdn docs (presumed nursary bug with rule)
|
|
9611
|
-
/* @__PURE__ */
|
|
10518
|
+
/* @__PURE__ */ jsxs26(
|
|
9612
10519
|
"svg",
|
|
9613
10520
|
{
|
|
9614
10521
|
role: "progressbar",
|
|
@@ -9619,8 +10526,8 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
|
|
|
9619
10526
|
"aria-valuemax": 100,
|
|
9620
10527
|
...restSvgProps,
|
|
9621
10528
|
children: [
|
|
9622
|
-
/* @__PURE__ */
|
|
9623
|
-
/* @__PURE__ */
|
|
10529
|
+
/* @__PURE__ */ jsx39("circle", { ...commonParams, className: "stroke-current/25" }),
|
|
10530
|
+
/* @__PURE__ */ jsx39(
|
|
9624
10531
|
"circle",
|
|
9625
10532
|
{
|
|
9626
10533
|
...commonParams,
|
|
@@ -9639,7 +10546,7 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
|
|
|
9639
10546
|
};
|
|
9640
10547
|
|
|
9641
10548
|
// src/components/thread/context-usage-indicator.tsx
|
|
9642
|
-
import { jsx as
|
|
10549
|
+
import { jsx as jsx40, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
9643
10550
|
var kNumberFormatter = new Intl.NumberFormat("en-US", {
|
|
9644
10551
|
minimumFractionDigits: 0,
|
|
9645
10552
|
maximumFractionDigits: 1
|
|
@@ -9672,20 +10579,20 @@ function ContextUsageIndicator({
|
|
|
9672
10579
|
}) {
|
|
9673
10580
|
const { t } = useChatkitTranslation();
|
|
9674
10581
|
const stream = useStreamContext();
|
|
9675
|
-
const [maxContextSize, setMaxContextSize] =
|
|
9676
|
-
const [usedContextSize, setUsedContextSize] =
|
|
9677
|
-
const [assistantAgentKey, setAssistantAgentKey] =
|
|
9678
|
-
const latestRealtimeUsageRef =
|
|
10582
|
+
const [maxContextSize, setMaxContextSize] = React35.useState(null);
|
|
10583
|
+
const [usedContextSize, setUsedContextSize] = React35.useState(null);
|
|
10584
|
+
const [assistantAgentKey, setAssistantAgentKey] = React35.useState(null);
|
|
10585
|
+
const latestRealtimeUsageRef = React35.useRef({
|
|
9679
10586
|
threadId: null,
|
|
9680
10587
|
agentKey: null,
|
|
9681
10588
|
usedTokens: null
|
|
9682
10589
|
});
|
|
9683
|
-
const realtimeUsage =
|
|
10590
|
+
const realtimeUsage = React35.useMemo(
|
|
9684
10591
|
() => getThreadContextUsage(stream.contextUsageByAgentKey, assistantAgentKey),
|
|
9685
10592
|
[assistantAgentKey, stream.contextUsageByAgentKey]
|
|
9686
10593
|
);
|
|
9687
10594
|
const realtimeUsedContextSize = getThreadContextUsageTotalTokens(realtimeUsage);
|
|
9688
|
-
|
|
10595
|
+
React35.useEffect(() => {
|
|
9689
10596
|
if (!stream.client || !stream.assistantId) {
|
|
9690
10597
|
setMaxContextSize(null);
|
|
9691
10598
|
setAssistantAgentKey(null);
|
|
@@ -9705,18 +10612,18 @@ function ContextUsageIndicator({
|
|
|
9705
10612
|
cancelled = true;
|
|
9706
10613
|
};
|
|
9707
10614
|
}, [stream.client, stream.assistantId]);
|
|
9708
|
-
|
|
10615
|
+
React35.useEffect(() => {
|
|
9709
10616
|
latestRealtimeUsageRef.current = {
|
|
9710
10617
|
threadId: stream.threadId ?? null,
|
|
9711
10618
|
agentKey: assistantAgentKey,
|
|
9712
10619
|
usedTokens: realtimeUsedContextSize
|
|
9713
10620
|
};
|
|
9714
10621
|
}, [assistantAgentKey, realtimeUsedContextSize, stream.threadId]);
|
|
9715
|
-
|
|
10622
|
+
React35.useEffect(() => {
|
|
9716
10623
|
if (realtimeUsedContextSize == null) return;
|
|
9717
10624
|
setUsedContextSize(realtimeUsedContextSize);
|
|
9718
10625
|
}, [realtimeUsedContextSize]);
|
|
9719
|
-
|
|
10626
|
+
React35.useEffect(() => {
|
|
9720
10627
|
if (!stream.client) {
|
|
9721
10628
|
setUsedContextSize(null);
|
|
9722
10629
|
return;
|
|
@@ -9781,8 +10688,8 @@ function ContextUsageIndicator({
|
|
|
9781
10688
|
});
|
|
9782
10689
|
const usageLabelWithSuffix = usageLabel.endsWith(":") ? usageLabel : `${usageLabel}:`;
|
|
9783
10690
|
const progressClassName = percent >= 90 ? "text-destructive" : percent >= 75 ? "text-amber-500" : "text-primary dark:text-zinc-300";
|
|
9784
|
-
return /* @__PURE__ */
|
|
9785
|
-
/* @__PURE__ */
|
|
10691
|
+
return /* @__PURE__ */ jsxs27(Tooltip, { children: [
|
|
10692
|
+
/* @__PURE__ */ jsx40(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx40(
|
|
9786
10693
|
"button",
|
|
9787
10694
|
{
|
|
9788
10695
|
type: "button",
|
|
@@ -9791,31 +10698,31 @@ function ContextUsageIndicator({
|
|
|
9791
10698
|
className
|
|
9792
10699
|
),
|
|
9793
10700
|
"aria-label": `${usageLabelWithSuffix} ${usageFullLabel}. ${usageTokensLabel}`,
|
|
9794
|
-
children: /* @__PURE__ */
|
|
10701
|
+
children: /* @__PURE__ */ jsx40(ProgressCircle, { value: percent, className: cn("size-3.5", progressClassName) })
|
|
9795
10702
|
}
|
|
9796
10703
|
) }),
|
|
9797
|
-
/* @__PURE__ */
|
|
9798
|
-
/* @__PURE__ */
|
|
9799
|
-
/* @__PURE__ */
|
|
9800
|
-
/* @__PURE__ */
|
|
10704
|
+
/* @__PURE__ */ jsxs27(TooltipContent, { side: "top", sideOffset: 6, className: "space-y-0.5 px-3 py-2 text-center", children: [
|
|
10705
|
+
/* @__PURE__ */ jsx40("div", { className: "text-primary-foreground/70", children: usageLabelWithSuffix }),
|
|
10706
|
+
/* @__PURE__ */ jsx40("div", { className: "font-medium text-primary-foreground/80", children: usageFullLabel }),
|
|
10707
|
+
/* @__PURE__ */ jsx40("div", { className: "text-sm font-semibold", children: usageTokensLabel })
|
|
9801
10708
|
] })
|
|
9802
10709
|
] });
|
|
9803
10710
|
}
|
|
9804
10711
|
|
|
9805
10712
|
// src/components/pet/PetBridge.tsx
|
|
9806
|
-
import * as
|
|
10713
|
+
import * as React36 from "react";
|
|
9807
10714
|
import { normalizePetOptions } from "@xpert-ai/chatkit-types";
|
|
9808
10715
|
function PetBridge({ pet, state }) {
|
|
9809
10716
|
const parentMessenger = useParentMessenger();
|
|
9810
10717
|
const sendEvent = parentMessenger?.sendEvent;
|
|
9811
|
-
const options =
|
|
9812
|
-
|
|
10718
|
+
const options = React36.useMemo(() => normalizePetOptions(pet), [pet]);
|
|
10719
|
+
React36.useEffect(() => {
|
|
9813
10720
|
if (!sendEvent) {
|
|
9814
10721
|
return;
|
|
9815
10722
|
}
|
|
9816
10723
|
sendEvent("pet_options_change", { pet: pet ?? null });
|
|
9817
10724
|
}, [sendEvent, pet]);
|
|
9818
|
-
|
|
10725
|
+
React36.useEffect(() => {
|
|
9819
10726
|
if (!sendEvent || !options) {
|
|
9820
10727
|
return;
|
|
9821
10728
|
}
|
|
@@ -9825,15 +10732,15 @@ function PetBridge({ pet, state }) {
|
|
|
9825
10732
|
}
|
|
9826
10733
|
|
|
9827
10734
|
// src/components/settings/SettingsSheet.tsx
|
|
9828
|
-
import * as
|
|
10735
|
+
import * as React43 from "react";
|
|
9829
10736
|
import { PawPrint, Settings } from "lucide-react";
|
|
9830
10737
|
|
|
9831
10738
|
// src/components/ui/input.tsx
|
|
9832
|
-
import * as
|
|
9833
|
-
import { jsx as
|
|
9834
|
-
var Input =
|
|
10739
|
+
import * as React37 from "react";
|
|
10740
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
10741
|
+
var Input = React37.forwardRef(
|
|
9835
10742
|
({ className, type, ...props }, ref) => {
|
|
9836
|
-
return /* @__PURE__ */
|
|
10743
|
+
return /* @__PURE__ */ jsx41(
|
|
9837
10744
|
"input",
|
|
9838
10745
|
{
|
|
9839
10746
|
ref,
|
|
@@ -9853,17 +10760,17 @@ Input.displayName = "Input";
|
|
|
9853
10760
|
import "react";
|
|
9854
10761
|
import { Select as SelectPrimitive } from "radix-ui";
|
|
9855
10762
|
import { ChevronDownIcon as ChevronDownIcon2, CheckIcon as CheckIcon4, ChevronUpIcon } from "lucide-react";
|
|
9856
|
-
import { jsx as
|
|
10763
|
+
import { jsx as jsx42, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
9857
10764
|
function Select({
|
|
9858
10765
|
...props
|
|
9859
10766
|
}) {
|
|
9860
|
-
return /* @__PURE__ */
|
|
10767
|
+
return /* @__PURE__ */ jsx42(SelectPrimitive.Root, { "data-slot": "select", ...props });
|
|
9861
10768
|
}
|
|
9862
10769
|
function SelectGroup({
|
|
9863
10770
|
className,
|
|
9864
10771
|
...props
|
|
9865
10772
|
}) {
|
|
9866
|
-
return /* @__PURE__ */
|
|
10773
|
+
return /* @__PURE__ */ jsx42(
|
|
9867
10774
|
SelectPrimitive.Group,
|
|
9868
10775
|
{
|
|
9869
10776
|
"data-slot": "select-group",
|
|
@@ -9875,7 +10782,7 @@ function SelectGroup({
|
|
|
9875
10782
|
function SelectValue({
|
|
9876
10783
|
...props
|
|
9877
10784
|
}) {
|
|
9878
|
-
return /* @__PURE__ */
|
|
10785
|
+
return /* @__PURE__ */ jsx42(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
|
|
9879
10786
|
}
|
|
9880
10787
|
function SelectTrigger({
|
|
9881
10788
|
className,
|
|
@@ -9883,7 +10790,7 @@ function SelectTrigger({
|
|
|
9883
10790
|
children,
|
|
9884
10791
|
...props
|
|
9885
10792
|
}) {
|
|
9886
|
-
return /* @__PURE__ */
|
|
10793
|
+
return /* @__PURE__ */ jsxs28(
|
|
9887
10794
|
SelectPrimitive.Trigger,
|
|
9888
10795
|
{
|
|
9889
10796
|
"data-slot": "select-trigger",
|
|
@@ -9895,7 +10802,7 @@ function SelectTrigger({
|
|
|
9895
10802
|
...props,
|
|
9896
10803
|
children: [
|
|
9897
10804
|
children,
|
|
9898
|
-
/* @__PURE__ */
|
|
10805
|
+
/* @__PURE__ */ jsx42(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx42(ChevronDownIcon2, { className: "pointer-events-none size-4 text-muted-foreground" }) })
|
|
9899
10806
|
]
|
|
9900
10807
|
}
|
|
9901
10808
|
);
|
|
@@ -9907,7 +10814,7 @@ function SelectContent({
|
|
|
9907
10814
|
align = "center",
|
|
9908
10815
|
...props
|
|
9909
10816
|
}) {
|
|
9910
|
-
return /* @__PURE__ */
|
|
10817
|
+
return /* @__PURE__ */ jsx42(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs28(
|
|
9911
10818
|
SelectPrimitive.Content,
|
|
9912
10819
|
{
|
|
9913
10820
|
"data-slot": "select-content",
|
|
@@ -9917,8 +10824,8 @@ function SelectContent({
|
|
|
9917
10824
|
align,
|
|
9918
10825
|
...props,
|
|
9919
10826
|
children: [
|
|
9920
|
-
/* @__PURE__ */
|
|
9921
|
-
/* @__PURE__ */
|
|
10827
|
+
/* @__PURE__ */ jsx42(SelectScrollUpButton, {}),
|
|
10828
|
+
/* @__PURE__ */ jsx42(
|
|
9922
10829
|
SelectPrimitive.Viewport,
|
|
9923
10830
|
{
|
|
9924
10831
|
"data-position": position,
|
|
@@ -9929,7 +10836,7 @@ function SelectContent({
|
|
|
9929
10836
|
children
|
|
9930
10837
|
}
|
|
9931
10838
|
),
|
|
9932
|
-
/* @__PURE__ */
|
|
10839
|
+
/* @__PURE__ */ jsx42(SelectScrollDownButton, {})
|
|
9933
10840
|
]
|
|
9934
10841
|
}
|
|
9935
10842
|
) });
|
|
@@ -9939,7 +10846,7 @@ function SelectItem({
|
|
|
9939
10846
|
children,
|
|
9940
10847
|
...props
|
|
9941
10848
|
}) {
|
|
9942
|
-
return /* @__PURE__ */
|
|
10849
|
+
return /* @__PURE__ */ jsxs28(
|
|
9943
10850
|
SelectPrimitive.Item,
|
|
9944
10851
|
{
|
|
9945
10852
|
"data-slot": "select-item",
|
|
@@ -9949,8 +10856,8 @@ function SelectItem({
|
|
|
9949
10856
|
),
|
|
9950
10857
|
...props,
|
|
9951
10858
|
children: [
|
|
9952
|
-
/* @__PURE__ */
|
|
9953
|
-
/* @__PURE__ */
|
|
10859
|
+
/* @__PURE__ */ jsx42("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ jsx42(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx42(CheckIcon4, { className: "pointer-events-none" }) }) }),
|
|
10860
|
+
/* @__PURE__ */ jsx42(SelectPrimitive.ItemText, { children })
|
|
9954
10861
|
]
|
|
9955
10862
|
}
|
|
9956
10863
|
);
|
|
@@ -9959,7 +10866,7 @@ function SelectScrollUpButton({
|
|
|
9959
10866
|
className,
|
|
9960
10867
|
...props
|
|
9961
10868
|
}) {
|
|
9962
|
-
return /* @__PURE__ */
|
|
10869
|
+
return /* @__PURE__ */ jsx42(
|
|
9963
10870
|
SelectPrimitive.ScrollUpButton,
|
|
9964
10871
|
{
|
|
9965
10872
|
"data-slot": "select-scroll-up-button",
|
|
@@ -9968,7 +10875,7 @@ function SelectScrollUpButton({
|
|
|
9968
10875
|
className
|
|
9969
10876
|
),
|
|
9970
10877
|
...props,
|
|
9971
|
-
children: /* @__PURE__ */
|
|
10878
|
+
children: /* @__PURE__ */ jsx42(
|
|
9972
10879
|
ChevronUpIcon,
|
|
9973
10880
|
{}
|
|
9974
10881
|
)
|
|
@@ -9979,7 +10886,7 @@ function SelectScrollDownButton({
|
|
|
9979
10886
|
className,
|
|
9980
10887
|
...props
|
|
9981
10888
|
}) {
|
|
9982
|
-
return /* @__PURE__ */
|
|
10889
|
+
return /* @__PURE__ */ jsx42(
|
|
9983
10890
|
SelectPrimitive.ScrollDownButton,
|
|
9984
10891
|
{
|
|
9985
10892
|
"data-slot": "select-scroll-down-button",
|
|
@@ -9988,7 +10895,7 @@ function SelectScrollDownButton({
|
|
|
9988
10895
|
className
|
|
9989
10896
|
),
|
|
9990
10897
|
...props,
|
|
9991
|
-
children: /* @__PURE__ */
|
|
10898
|
+
children: /* @__PURE__ */ jsx42(
|
|
9992
10899
|
ChevronDownIcon2,
|
|
9993
10900
|
{}
|
|
9994
10901
|
)
|
|
@@ -9997,9 +10904,9 @@ function SelectScrollDownButton({
|
|
|
9997
10904
|
}
|
|
9998
10905
|
|
|
9999
10906
|
// src/components/ui/slider.tsx
|
|
10000
|
-
import * as
|
|
10907
|
+
import * as React39 from "react";
|
|
10001
10908
|
import { Slider as SliderPrimitive } from "radix-ui";
|
|
10002
|
-
import { jsx as
|
|
10909
|
+
import { jsx as jsx43, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
10003
10910
|
function Slider({
|
|
10004
10911
|
className,
|
|
10005
10912
|
defaultValue,
|
|
@@ -10008,11 +10915,11 @@ function Slider({
|
|
|
10008
10915
|
max = 100,
|
|
10009
10916
|
...props
|
|
10010
10917
|
}) {
|
|
10011
|
-
const _values =
|
|
10918
|
+
const _values = React39.useMemo(
|
|
10012
10919
|
() => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
|
|
10013
10920
|
[value, defaultValue, min, max]
|
|
10014
10921
|
);
|
|
10015
|
-
return /* @__PURE__ */
|
|
10922
|
+
return /* @__PURE__ */ jsxs29(
|
|
10016
10923
|
SliderPrimitive.Root,
|
|
10017
10924
|
{
|
|
10018
10925
|
"data-slot": "slider",
|
|
@@ -10026,12 +10933,12 @@ function Slider({
|
|
|
10026
10933
|
),
|
|
10027
10934
|
...props,
|
|
10028
10935
|
children: [
|
|
10029
|
-
/* @__PURE__ */
|
|
10936
|
+
/* @__PURE__ */ jsx43(
|
|
10030
10937
|
SliderPrimitive.Track,
|
|
10031
10938
|
{
|
|
10032
10939
|
"data-slot": "slider-track",
|
|
10033
10940
|
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",
|
|
10034
|
-
children: /* @__PURE__ */
|
|
10941
|
+
children: /* @__PURE__ */ jsx43(
|
|
10035
10942
|
SliderPrimitive.Range,
|
|
10036
10943
|
{
|
|
10037
10944
|
"data-slot": "slider-range",
|
|
@@ -10040,7 +10947,7 @@ function Slider({
|
|
|
10040
10947
|
)
|
|
10041
10948
|
}
|
|
10042
10949
|
),
|
|
10043
|
-
Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */
|
|
10950
|
+
Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */ jsx43(
|
|
10044
10951
|
SliderPrimitive.Thumb,
|
|
10045
10952
|
{
|
|
10046
10953
|
"data-slot": "slider-thumb",
|
|
@@ -10054,7 +10961,7 @@ function Slider({
|
|
|
10054
10961
|
}
|
|
10055
10962
|
|
|
10056
10963
|
// src/components/ui/toggle-group.tsx
|
|
10057
|
-
import * as
|
|
10964
|
+
import * as React41 from "react";
|
|
10058
10965
|
import "class-variance-authority";
|
|
10059
10966
|
import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui";
|
|
10060
10967
|
|
|
@@ -10062,7 +10969,7 @@ import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui";
|
|
|
10062
10969
|
import "react";
|
|
10063
10970
|
import { cva as cva2 } from "class-variance-authority";
|
|
10064
10971
|
import { Toggle as TogglePrimitive } from "radix-ui";
|
|
10065
|
-
import { jsx as
|
|
10972
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
10066
10973
|
var toggleVariants = cva2(
|
|
10067
10974
|
"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",
|
|
10068
10975
|
{
|
|
@@ -10085,8 +10992,8 @@ var toggleVariants = cva2(
|
|
|
10085
10992
|
);
|
|
10086
10993
|
|
|
10087
10994
|
// src/components/ui/toggle-group.tsx
|
|
10088
|
-
import { jsx as
|
|
10089
|
-
var ToggleGroupContext =
|
|
10995
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
10996
|
+
var ToggleGroupContext = React41.createContext({
|
|
10090
10997
|
size: "default",
|
|
10091
10998
|
variant: "default",
|
|
10092
10999
|
spacing: 0,
|
|
@@ -10101,7 +11008,7 @@ function ToggleGroup({
|
|
|
10101
11008
|
children,
|
|
10102
11009
|
...props
|
|
10103
11010
|
}) {
|
|
10104
|
-
return /* @__PURE__ */
|
|
11011
|
+
return /* @__PURE__ */ jsx45(
|
|
10105
11012
|
ToggleGroupPrimitive.Root,
|
|
10106
11013
|
{
|
|
10107
11014
|
"data-slot": "toggle-group",
|
|
@@ -10115,7 +11022,7 @@ function ToggleGroup({
|
|
|
10115
11022
|
className
|
|
10116
11023
|
),
|
|
10117
11024
|
...props,
|
|
10118
|
-
children: /* @__PURE__ */
|
|
11025
|
+
children: /* @__PURE__ */ jsx45(
|
|
10119
11026
|
ToggleGroupContext.Provider,
|
|
10120
11027
|
{
|
|
10121
11028
|
value: { variant, size: size2, spacing, orientation },
|
|
@@ -10132,8 +11039,8 @@ function ToggleGroupItem({
|
|
|
10132
11039
|
size: size2 = "default",
|
|
10133
11040
|
...props
|
|
10134
11041
|
}) {
|
|
10135
|
-
const context =
|
|
10136
|
-
return /* @__PURE__ */
|
|
11042
|
+
const context = React41.useContext(ToggleGroupContext);
|
|
11043
|
+
return /* @__PURE__ */ jsx45(
|
|
10137
11044
|
ToggleGroupPrimitive.Item,
|
|
10138
11045
|
{
|
|
10139
11046
|
"data-slot": "toggle-group-item",
|
|
@@ -10373,7 +11280,7 @@ import {
|
|
|
10373
11280
|
} from "@xpert-ai/chatkit-types";
|
|
10374
11281
|
|
|
10375
11282
|
// src/components/pet/PetPreview.tsx
|
|
10376
|
-
import { jsx as
|
|
11283
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
10377
11284
|
function escapeCssUrl(value) {
|
|
10378
11285
|
return value.replace(/["\\]/g, "\\$&");
|
|
10379
11286
|
}
|
|
@@ -10381,7 +11288,7 @@ function PetPreview({ src, label, className }) {
|
|
|
10381
11288
|
const scale = 0.13;
|
|
10382
11289
|
const width = petSpriteAtlas.cellWidth;
|
|
10383
11290
|
const height = petSpriteAtlas.cellHeight;
|
|
10384
|
-
return /* @__PURE__ */
|
|
11291
|
+
return /* @__PURE__ */ jsx46(
|
|
10385
11292
|
"span",
|
|
10386
11293
|
{
|
|
10387
11294
|
className: cn(
|
|
@@ -10390,7 +11297,7 @@ function PetPreview({ src, label, className }) {
|
|
|
10390
11297
|
),
|
|
10391
11298
|
"aria-hidden": "true",
|
|
10392
11299
|
title: label,
|
|
10393
|
-
children: /* @__PURE__ */
|
|
11300
|
+
children: /* @__PURE__ */ jsx46(
|
|
10394
11301
|
"span",
|
|
10395
11302
|
{
|
|
10396
11303
|
className: "absolute left-1/2 top-1/2 block",
|
|
@@ -10412,7 +11319,7 @@ function PetPreview({ src, label, className }) {
|
|
|
10412
11319
|
}
|
|
10413
11320
|
|
|
10414
11321
|
// src/components/settings/SettingsSheet.tsx
|
|
10415
|
-
import { jsx as
|
|
11322
|
+
import { jsx as jsx47, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
10416
11323
|
var CHARACTER_TYPES2 = [
|
|
10417
11324
|
"builtin",
|
|
10418
11325
|
"atlas"
|
|
@@ -10428,13 +11335,13 @@ function SettingsSheet({
|
|
|
10428
11335
|
onSave
|
|
10429
11336
|
}) {
|
|
10430
11337
|
const { t } = useChatkitTranslation();
|
|
10431
|
-
const [draft, setDraft] =
|
|
10432
|
-
|
|
11338
|
+
const [draft, setDraft] = React43.useState(settings);
|
|
11339
|
+
React43.useEffect(() => {
|
|
10433
11340
|
if (open) {
|
|
10434
11341
|
setDraft(petRequired ? { ...settings, enabled: true } : settings);
|
|
10435
11342
|
}
|
|
10436
11343
|
}, [open, petRequired, settings]);
|
|
10437
|
-
const updateDraft =
|
|
11344
|
+
const updateDraft = React43.useCallback(
|
|
10438
11345
|
(patch) => {
|
|
10439
11346
|
setDraft((previous) => ({ ...previous, ...patch }));
|
|
10440
11347
|
},
|
|
@@ -10452,23 +11359,23 @@ function SettingsSheet({
|
|
|
10452
11359
|
defaultValue: selectedBuiltinPet.label
|
|
10453
11360
|
}
|
|
10454
11361
|
);
|
|
10455
|
-
return /* @__PURE__ */
|
|
10456
|
-
/* @__PURE__ */
|
|
10457
|
-
/* @__PURE__ */
|
|
10458
|
-
/* @__PURE__ */
|
|
11362
|
+
return /* @__PURE__ */ jsx47(Sheet, { open, onOpenChange, children: /* @__PURE__ */ jsxs30(SheetContent, { side: "right", className: "w-[min(92vw,26rem)] overflow-y-auto", children: [
|
|
11363
|
+
/* @__PURE__ */ jsx47(SheetHeader, { children: /* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-2", children: [
|
|
11364
|
+
/* @__PURE__ */ jsx47("span", { className: "flex h-8 w-8 items-center justify-center rounded-md bg-primary/10 text-primary", children: /* @__PURE__ */ jsx47(Settings, { size: 16 }) }),
|
|
11365
|
+
/* @__PURE__ */ jsx47(SheetTitle, { children: t("settings.title") })
|
|
10459
11366
|
] }) }),
|
|
10460
|
-
/* @__PURE__ */
|
|
10461
|
-
/* @__PURE__ */
|
|
10462
|
-
/* @__PURE__ */
|
|
10463
|
-
/* @__PURE__ */
|
|
10464
|
-
/* @__PURE__ */
|
|
11367
|
+
/* @__PURE__ */ jsxs30("form", { className: "mt-6 space-y-5", onSubmit: handleSubmit, children: [
|
|
11368
|
+
/* @__PURE__ */ jsxs30("section", { className: "space-y-5", children: [
|
|
11369
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-2", children: [
|
|
11370
|
+
/* @__PURE__ */ jsx47("span", { className: "flex h-7 w-7 items-center justify-center rounded-md bg-muted text-muted-foreground", children: /* @__PURE__ */ jsx47(PawPrint, { size: 15 }) }),
|
|
11371
|
+
/* @__PURE__ */ jsx47("h3", { className: "text-sm font-semibold", children: t("pet.settings.title") })
|
|
10465
11372
|
] }),
|
|
10466
|
-
/* @__PURE__ */
|
|
10467
|
-
/* @__PURE__ */
|
|
10468
|
-
/* @__PURE__ */
|
|
10469
|
-
petRequired && /* @__PURE__ */
|
|
11373
|
+
/* @__PURE__ */ jsxs30("label", { className: "flex items-center justify-between gap-4 rounded-md border border-border px-3 py-2", children: [
|
|
11374
|
+
/* @__PURE__ */ jsxs30("span", { className: "min-w-0", children: [
|
|
11375
|
+
/* @__PURE__ */ jsx47("span", { className: "block text-sm font-medium", children: t("pet.settings.enabled") }),
|
|
11376
|
+
petRequired && /* @__PURE__ */ jsx47("span", { className: "mt-0.5 block text-xs text-muted-foreground", children: t("pet.settings.requiredHint") })
|
|
10470
11377
|
] }),
|
|
10471
|
-
/* @__PURE__ */
|
|
11378
|
+
/* @__PURE__ */ jsx47(
|
|
10472
11379
|
"button",
|
|
10473
11380
|
{
|
|
10474
11381
|
type: "button",
|
|
@@ -10481,7 +11388,7 @@ function SettingsSheet({
|
|
|
10481
11388
|
draft.enabled ? "bg-primary" : "bg-muted-foreground/20",
|
|
10482
11389
|
petRequired ? "cursor-not-allowed opacity-70" : ""
|
|
10483
11390
|
].join(" "),
|
|
10484
|
-
children: /* @__PURE__ */
|
|
11391
|
+
children: /* @__PURE__ */ jsx47(
|
|
10485
11392
|
"span",
|
|
10486
11393
|
{
|
|
10487
11394
|
className: [
|
|
@@ -10494,9 +11401,9 @@ function SettingsSheet({
|
|
|
10494
11401
|
)
|
|
10495
11402
|
] })
|
|
10496
11403
|
] }),
|
|
10497
|
-
/* @__PURE__ */
|
|
10498
|
-
/* @__PURE__ */
|
|
10499
|
-
/* @__PURE__ */
|
|
11404
|
+
/* @__PURE__ */ jsxs30("div", { className: "space-y-2", children: [
|
|
11405
|
+
/* @__PURE__ */ jsx47("span", { id: "chatkit-pet-type-label", className: "text-sm font-medium", children: t("pet.settings.characterType") }),
|
|
11406
|
+
/* @__PURE__ */ jsx47(
|
|
10500
11407
|
ToggleGroup,
|
|
10501
11408
|
{
|
|
10502
11409
|
id: "chatkit-pet-type",
|
|
@@ -10511,7 +11418,7 @@ function SettingsSheet({
|
|
|
10511
11418
|
variant: "outline",
|
|
10512
11419
|
spacing: 2,
|
|
10513
11420
|
className: "!w-full",
|
|
10514
|
-
children: CHARACTER_TYPES2.map((type) => /* @__PURE__ */
|
|
11421
|
+
children: CHARACTER_TYPES2.map((type) => /* @__PURE__ */ jsx47(
|
|
10515
11422
|
ToggleGroupItem,
|
|
10516
11423
|
{
|
|
10517
11424
|
value: type,
|
|
@@ -10523,8 +11430,8 @@ function SettingsSheet({
|
|
|
10523
11430
|
}
|
|
10524
11431
|
)
|
|
10525
11432
|
] }),
|
|
10526
|
-
draft.characterType === "builtin" && /* @__PURE__ */
|
|
10527
|
-
/* @__PURE__ */
|
|
11433
|
+
draft.characterType === "builtin" && /* @__PURE__ */ jsxs30("div", { className: "space-y-2", children: [
|
|
11434
|
+
/* @__PURE__ */ jsx47(
|
|
10528
11435
|
"label",
|
|
10529
11436
|
{
|
|
10530
11437
|
htmlFor: "chatkit-pet-builtin",
|
|
@@ -10532,7 +11439,7 @@ function SettingsSheet({
|
|
|
10532
11439
|
children: t("pet.settings.builtin")
|
|
10533
11440
|
}
|
|
10534
11441
|
),
|
|
10535
|
-
/* @__PURE__ */
|
|
11442
|
+
/* @__PURE__ */ jsxs30(
|
|
10536
11443
|
Select,
|
|
10537
11444
|
{
|
|
10538
11445
|
value: selectedBuiltinPet.id,
|
|
@@ -10543,26 +11450,26 @@ function SettingsSheet({
|
|
|
10543
11450
|
}
|
|
10544
11451
|
},
|
|
10545
11452
|
children: [
|
|
10546
|
-
/* @__PURE__ */
|
|
11453
|
+
/* @__PURE__ */ jsx47(
|
|
10547
11454
|
SelectTrigger,
|
|
10548
11455
|
{
|
|
10549
11456
|
id: "chatkit-pet-builtin",
|
|
10550
11457
|
className: "min-h-12 w-full px-3 py-2",
|
|
10551
|
-
children: /* @__PURE__ */
|
|
11458
|
+
children: /* @__PURE__ */ jsx47(SelectValue, { placeholder: selectedBuiltinPetLabel })
|
|
10552
11459
|
}
|
|
10553
11460
|
),
|
|
10554
|
-
/* @__PURE__ */
|
|
11461
|
+
/* @__PURE__ */ jsx47(SelectContent, { className: "w-[var(--radix-select-trigger-width)]", children: /* @__PURE__ */ jsx47(SelectGroup, { children: INCLUDED_PET_OPTIONS.map((pet) => {
|
|
10555
11462
|
const label = t(`pet.settings.builtins.${pet.id}`, {
|
|
10556
11463
|
defaultValue: pet.label
|
|
10557
11464
|
});
|
|
10558
|
-
return /* @__PURE__ */
|
|
11465
|
+
return /* @__PURE__ */ jsx47(
|
|
10559
11466
|
SelectItem,
|
|
10560
11467
|
{
|
|
10561
11468
|
value: pet.id,
|
|
10562
11469
|
className: "min-h-10 py-1.5 pl-2 pr-8",
|
|
10563
|
-
children: /* @__PURE__ */
|
|
10564
|
-
/* @__PURE__ */
|
|
10565
|
-
/* @__PURE__ */
|
|
11470
|
+
children: /* @__PURE__ */ jsxs30("span", { className: "flex min-w-0 items-center gap-2", children: [
|
|
11471
|
+
/* @__PURE__ */ jsx47(PetPreview, { src: pet.previewSrc, label }),
|
|
11472
|
+
/* @__PURE__ */ jsx47("span", { className: "min-w-0 truncate", children: label })
|
|
10566
11473
|
] })
|
|
10567
11474
|
},
|
|
10568
11475
|
pet.id
|
|
@@ -10572,8 +11479,8 @@ function SettingsSheet({
|
|
|
10572
11479
|
}
|
|
10573
11480
|
)
|
|
10574
11481
|
] }),
|
|
10575
|
-
draft.characterType === "atlas" && /* @__PURE__ */
|
|
10576
|
-
/* @__PURE__ */
|
|
11482
|
+
draft.characterType === "atlas" && /* @__PURE__ */ jsxs30("div", { className: "space-y-2", children: [
|
|
11483
|
+
/* @__PURE__ */ jsx47(
|
|
10577
11484
|
"label",
|
|
10578
11485
|
{
|
|
10579
11486
|
className: "text-sm font-medium",
|
|
@@ -10581,7 +11488,7 @@ function SettingsSheet({
|
|
|
10581
11488
|
children: t("pet.settings.atlasUrl")
|
|
10582
11489
|
}
|
|
10583
11490
|
),
|
|
10584
|
-
/* @__PURE__ */
|
|
11491
|
+
/* @__PURE__ */ jsx47(
|
|
10585
11492
|
Input,
|
|
10586
11493
|
{
|
|
10587
11494
|
id: "chatkit-pet-atlas",
|
|
@@ -10591,15 +11498,15 @@ function SettingsSheet({
|
|
|
10591
11498
|
}
|
|
10592
11499
|
)
|
|
10593
11500
|
] }),
|
|
10594
|
-
/* @__PURE__ */
|
|
10595
|
-
/* @__PURE__ */
|
|
10596
|
-
/* @__PURE__ */
|
|
10597
|
-
/* @__PURE__ */
|
|
11501
|
+
/* @__PURE__ */ jsxs30("div", { className: "space-y-2", children: [
|
|
11502
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex items-center justify-between gap-4", children: [
|
|
11503
|
+
/* @__PURE__ */ jsx47("label", { className: "text-sm font-medium", htmlFor: "chatkit-pet-scale", children: t("pet.settings.scale") }),
|
|
11504
|
+
/* @__PURE__ */ jsxs30("span", { className: "text-xs tabular-nums text-muted-foreground", children: [
|
|
10598
11505
|
draft.scale.toFixed(2),
|
|
10599
11506
|
"x"
|
|
10600
11507
|
] })
|
|
10601
11508
|
] }),
|
|
10602
|
-
/* @__PURE__ */
|
|
11509
|
+
/* @__PURE__ */ jsx47(
|
|
10603
11510
|
Slider,
|
|
10604
11511
|
{
|
|
10605
11512
|
id: "chatkit-pet-scale",
|
|
@@ -10613,8 +11520,8 @@ function SettingsSheet({
|
|
|
10613
11520
|
}
|
|
10614
11521
|
)
|
|
10615
11522
|
] }),
|
|
10616
|
-
/* @__PURE__ */
|
|
10617
|
-
/* @__PURE__ */
|
|
11523
|
+
/* @__PURE__ */ jsxs30("label", { className: "flex items-center gap-2 text-sm", children: [
|
|
11524
|
+
/* @__PURE__ */ jsx47(
|
|
10618
11525
|
"input",
|
|
10619
11526
|
{
|
|
10620
11527
|
type: "checkbox",
|
|
@@ -10625,8 +11532,8 @@ function SettingsSheet({
|
|
|
10625
11532
|
),
|
|
10626
11533
|
t("pet.settings.draggable")
|
|
10627
11534
|
] }),
|
|
10628
|
-
/* @__PURE__ */
|
|
10629
|
-
/* @__PURE__ */
|
|
11535
|
+
/* @__PURE__ */ jsxs30("label", { className: "flex items-center gap-2 text-sm", children: [
|
|
11536
|
+
/* @__PURE__ */ jsx47(
|
|
10630
11537
|
"input",
|
|
10631
11538
|
{
|
|
10632
11539
|
type: "checkbox",
|
|
@@ -10637,8 +11544,8 @@ function SettingsSheet({
|
|
|
10637
11544
|
),
|
|
10638
11545
|
t("pet.settings.persistPosition")
|
|
10639
11546
|
] }),
|
|
10640
|
-
/* @__PURE__ */
|
|
10641
|
-
/* @__PURE__ */
|
|
11547
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex justify-end gap-2 pt-2", children: [
|
|
11548
|
+
/* @__PURE__ */ jsx47(
|
|
10642
11549
|
Button,
|
|
10643
11550
|
{
|
|
10644
11551
|
type: "button",
|
|
@@ -10647,7 +11554,7 @@ function SettingsSheet({
|
|
|
10647
11554
|
children: t("pet.settings.cancel")
|
|
10648
11555
|
}
|
|
10649
11556
|
),
|
|
10650
|
-
/* @__PURE__ */
|
|
11557
|
+
/* @__PURE__ */ jsx47(Button, { type: "submit", children: t("pet.settings.save") })
|
|
10651
11558
|
] })
|
|
10652
11559
|
] })
|
|
10653
11560
|
] }) });
|
|
@@ -11153,7 +12060,7 @@ function findDomPointForComposerOffset(root, offset) {
|
|
|
11153
12060
|
}
|
|
11154
12061
|
|
|
11155
12062
|
// src/components/chat.tsx
|
|
11156
|
-
import { Fragment as
|
|
12063
|
+
import { Fragment as Fragment7, jsx as jsx48, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
11157
12064
|
var defaultApiUrl2 = import.meta.env.VITE_XPERTAI_API_URL;
|
|
11158
12065
|
var COMPOSER_INPUT_MAX_HEIGHT = 128;
|
|
11159
12066
|
var LONG_TEXT_REFERENCE_THRESHOLD = 5e3;
|
|
@@ -11286,7 +12193,7 @@ function ReferenceChip({
|
|
|
11286
12193
|
const metaLine = getReferenceMetaLine(reference);
|
|
11287
12194
|
const isComposer = variant === "composer";
|
|
11288
12195
|
const Icon = reference.type === "quote" ? Quote : reference.type === "image" ? ImageIcon : FileText3;
|
|
11289
|
-
return /* @__PURE__ */
|
|
12196
|
+
return /* @__PURE__ */ jsxs31(
|
|
11290
12197
|
"div",
|
|
11291
12198
|
{
|
|
11292
12199
|
className: cn(
|
|
@@ -11295,7 +12202,7 @@ function ReferenceChip({
|
|
|
11295
12202
|
),
|
|
11296
12203
|
title: getReferenceTitle(reference),
|
|
11297
12204
|
children: [
|
|
11298
|
-
/* @__PURE__ */
|
|
12205
|
+
/* @__PURE__ */ jsx48(
|
|
11299
12206
|
Icon,
|
|
11300
12207
|
{
|
|
11301
12208
|
size: isComposer ? 14 : 12,
|
|
@@ -11305,8 +12212,8 @@ function ReferenceChip({
|
|
|
11305
12212
|
)
|
|
11306
12213
|
}
|
|
11307
12214
|
),
|
|
11308
|
-
/* @__PURE__ */
|
|
11309
|
-
/* @__PURE__ */
|
|
12215
|
+
/* @__PURE__ */ jsxs31("div", { className: "min-w-0 flex-1", children: [
|
|
12216
|
+
/* @__PURE__ */ jsx48(
|
|
11310
12217
|
"div",
|
|
11311
12218
|
{
|
|
11312
12219
|
className: cn(
|
|
@@ -11316,7 +12223,7 @@ function ReferenceChip({
|
|
|
11316
12223
|
children: getReferenceLabel(reference)
|
|
11317
12224
|
}
|
|
11318
12225
|
),
|
|
11319
|
-
metaLine && /* @__PURE__ */
|
|
12226
|
+
metaLine && /* @__PURE__ */ jsx48(
|
|
11320
12227
|
"div",
|
|
11321
12228
|
{
|
|
11322
12229
|
className: cn(
|
|
@@ -11327,7 +12234,7 @@ function ReferenceChip({
|
|
|
11327
12234
|
}
|
|
11328
12235
|
)
|
|
11329
12236
|
] }),
|
|
11330
|
-
onRemove && removeLabel && /* @__PURE__ */
|
|
12237
|
+
onRemove && removeLabel && /* @__PURE__ */ jsx48(
|
|
11331
12238
|
"button",
|
|
11332
12239
|
{
|
|
11333
12240
|
type: "button",
|
|
@@ -11338,7 +12245,7 @@ function ReferenceChip({
|
|
|
11338
12245
|
),
|
|
11339
12246
|
title: removeLabel,
|
|
11340
12247
|
"aria-label": removeLabel,
|
|
11341
|
-
children: /* @__PURE__ */
|
|
12248
|
+
children: /* @__PURE__ */ jsx48(X5, { size: 12 })
|
|
11342
12249
|
}
|
|
11343
12250
|
)
|
|
11344
12251
|
]
|
|
@@ -11362,20 +12269,20 @@ function Chat({
|
|
|
11362
12269
|
const { setStream } = useStreamManager();
|
|
11363
12270
|
const stream = useStreamContext();
|
|
11364
12271
|
const { theme } = useTheme();
|
|
11365
|
-
const [isHistoryLoading, setIsHistoryLoading] =
|
|
11366
|
-
const [historyError, setHistoryError] =
|
|
11367
|
-
const [assistantName, setAssistantName] =
|
|
11368
|
-
const [assistantAvatar, setAssistantAvatar] =
|
|
12272
|
+
const [isHistoryLoading, setIsHistoryLoading] = React44.useState(false);
|
|
12273
|
+
const [historyError, setHistoryError] = React44.useState(null);
|
|
12274
|
+
const [assistantName, setAssistantName] = React44.useState(null);
|
|
12275
|
+
const [assistantAvatar, setAssistantAvatar] = React44.useState(null);
|
|
11369
12276
|
const LOADING_DOTS_MIN_DURATION = 800;
|
|
11370
12277
|
const STREAMING_STATUS_REFRESH_MS = 250;
|
|
11371
|
-
const [showLoadingDots, setShowLoadingDots] =
|
|
11372
|
-
const [streamingNow, setStreamingNow] =
|
|
11373
|
-
const loadingStartTimeRef =
|
|
11374
|
-
const lastStreamOutputAtRef =
|
|
11375
|
-
|
|
12278
|
+
const [showLoadingDots, setShowLoadingDots] = React44.useState(false);
|
|
12279
|
+
const [streamingNow, setStreamingNow] = React44.useState(() => Date.now());
|
|
12280
|
+
const loadingStartTimeRef = React44.useRef(null);
|
|
12281
|
+
const lastStreamOutputAtRef = React44.useRef(null);
|
|
12282
|
+
React44.useEffect(() => {
|
|
11376
12283
|
setStream(stream);
|
|
11377
12284
|
}, [setStream, stream]);
|
|
11378
|
-
|
|
12285
|
+
React44.useEffect(() => {
|
|
11379
12286
|
if (stream.isLoading) {
|
|
11380
12287
|
if (!loadingStartTimeRef.current) {
|
|
11381
12288
|
loadingStartTimeRef.current = Date.now();
|
|
@@ -11398,7 +12305,7 @@ function Chat({
|
|
|
11398
12305
|
}
|
|
11399
12306
|
}
|
|
11400
12307
|
}, [stream.isLoading]);
|
|
11401
|
-
|
|
12308
|
+
React44.useEffect(() => {
|
|
11402
12309
|
if (!stream.isLoading) {
|
|
11403
12310
|
lastStreamOutputAtRef.current = null;
|
|
11404
12311
|
setStreamingNow(Date.now());
|
|
@@ -11408,7 +12315,7 @@ function Chat({
|
|
|
11408
12315
|
lastStreamOutputAtRef.current = now;
|
|
11409
12316
|
setStreamingNow(now);
|
|
11410
12317
|
}, [stream.messages, stream.isLoading]);
|
|
11411
|
-
|
|
12318
|
+
React44.useEffect(() => {
|
|
11412
12319
|
if (!stream.isLoading) {
|
|
11413
12320
|
return;
|
|
11414
12321
|
}
|
|
@@ -11417,74 +12324,74 @@ function Chat({
|
|
|
11417
12324
|
}, STREAMING_STATUS_REFRESH_MS);
|
|
11418
12325
|
return () => window.clearInterval(timer);
|
|
11419
12326
|
}, [stream.isLoading]);
|
|
11420
|
-
const [composerParts, setComposerParts] =
|
|
11421
|
-
const [renderedComposerParts, setRenderedComposerParts] =
|
|
11422
|
-
const [composerDomVersion, setComposerDomVersion] =
|
|
11423
|
-
const [selectedTool, setSelectedTool] =
|
|
12327
|
+
const [composerParts, setComposerParts] = React44.useState([]);
|
|
12328
|
+
const [renderedComposerParts, setRenderedComposerParts] = React44.useState([]);
|
|
12329
|
+
const [composerDomVersion, setComposerDomVersion] = React44.useState(0);
|
|
12330
|
+
const [selectedTool, setSelectedTool] = React44.useState(
|
|
11424
12331
|
null
|
|
11425
12332
|
);
|
|
11426
|
-
const [planModeEnabled, setPlanModeEnabled] =
|
|
11427
|
-
const [petSettingsOpen, setPetSettingsOpen] =
|
|
11428
|
-
const [petLocalSettings, setPetLocalSettings] =
|
|
11429
|
-
const [runtimeCapabilities, setRuntimeCapabilities] =
|
|
11430
|
-
const [runtimeCapabilitiesReady, setRuntimeCapabilitiesReady] =
|
|
11431
|
-
const [sessionRuntimeCapabilities, setSessionRuntimeCapabilities] =
|
|
12333
|
+
const [planModeEnabled, setPlanModeEnabled] = React44.useState(false);
|
|
12334
|
+
const [petSettingsOpen, setPetSettingsOpen] = React44.useState(false);
|
|
12335
|
+
const [petLocalSettings, setPetLocalSettings] = React44.useState(() => readPetLocalSettings());
|
|
12336
|
+
const [runtimeCapabilities, setRuntimeCapabilities] = React44.useState(null);
|
|
12337
|
+
const [runtimeCapabilitiesReady, setRuntimeCapabilitiesReady] = React44.useState(false);
|
|
12338
|
+
const [sessionRuntimeCapabilities, setSessionRuntimeCapabilities] = React44.useState(
|
|
11432
12339
|
() => createEmptyRuntimeCapabilitiesSelection()
|
|
11433
12340
|
);
|
|
11434
|
-
const [runRuntimeCapabilities, setRunRuntimeCapabilities] =
|
|
12341
|
+
const [runRuntimeCapabilities, setRunRuntimeCapabilities] = React44.useState(
|
|
11435
12342
|
() => createEmptyRuntimeCapabilitiesSelection()
|
|
11436
12343
|
);
|
|
11437
|
-
const [runtimeCapabilityPalette, setRuntimeCapabilityPalette] =
|
|
11438
|
-
const [attachments, setAttachments] =
|
|
11439
|
-
const [references, setReferences] =
|
|
11440
|
-
const [isUploadingReferenceImages, setIsUploadingReferenceImages] =
|
|
11441
|
-
const [quoteSelection, setQuoteSelection] =
|
|
11442
|
-
const [isAtBottom, setIsAtBottom] =
|
|
11443
|
-
const [hasUpdatesBelow, setHasUpdatesBelow] =
|
|
12344
|
+
const [runtimeCapabilityPalette, setRuntimeCapabilityPalette] = React44.useState(null);
|
|
12345
|
+
const [attachments, setAttachments] = React44.useState([]);
|
|
12346
|
+
const [references, setReferences] = React44.useState([]);
|
|
12347
|
+
const [isUploadingReferenceImages, setIsUploadingReferenceImages] = React44.useState(false);
|
|
12348
|
+
const [quoteSelection, setQuoteSelection] = React44.useState(null);
|
|
12349
|
+
const [isAtBottom, setIsAtBottom] = React44.useState(true);
|
|
12350
|
+
const [hasUpdatesBelow, setHasUpdatesBelow] = React44.useState(false);
|
|
11444
12351
|
const {
|
|
11445
12352
|
threads,
|
|
11446
12353
|
deleteThread,
|
|
11447
12354
|
refreshThreads,
|
|
11448
12355
|
isLoading: isThreadsLoading
|
|
11449
12356
|
} = useThreads();
|
|
11450
|
-
const viewportRef =
|
|
11451
|
-
const fileInputRef =
|
|
11452
|
-
const composerInputRef =
|
|
11453
|
-
const slashPaletteRef =
|
|
11454
|
-
const slashPaletteOptionRefs =
|
|
12357
|
+
const viewportRef = React44.useRef(null);
|
|
12358
|
+
const fileInputRef = React44.useRef(null);
|
|
12359
|
+
const composerInputRef = React44.useRef(null);
|
|
12360
|
+
const slashPaletteRef = React44.useRef(null);
|
|
12361
|
+
const slashPaletteOptionRefs = React44.useRef(
|
|
11455
12362
|
[]
|
|
11456
12363
|
);
|
|
11457
|
-
const composerPartsRef =
|
|
11458
|
-
const pendingComposerCaretOffsetRef =
|
|
11459
|
-
const shouldAutoScrollRef =
|
|
11460
|
-
const forceFollowRef =
|
|
11461
|
-
const previousMessageCountRef =
|
|
11462
|
-
const previousScrollTopRef =
|
|
11463
|
-
const autoScrollFrameRef =
|
|
11464
|
-
const isPointerDownRef =
|
|
11465
|
-
const lastTouchYRef =
|
|
11466
|
-
const runtimeCapabilityPreferenceLoadRef =
|
|
12364
|
+
const composerPartsRef = React44.useRef([]);
|
|
12365
|
+
const pendingComposerCaretOffsetRef = React44.useRef(null);
|
|
12366
|
+
const shouldAutoScrollRef = React44.useRef(true);
|
|
12367
|
+
const forceFollowRef = React44.useRef(false);
|
|
12368
|
+
const previousMessageCountRef = React44.useRef(0);
|
|
12369
|
+
const previousScrollTopRef = React44.useRef(0);
|
|
12370
|
+
const autoScrollFrameRef = React44.useRef(null);
|
|
12371
|
+
const isPointerDownRef = React44.useRef(false);
|
|
12372
|
+
const lastTouchYRef = React44.useRef(null);
|
|
12373
|
+
const runtimeCapabilityPreferenceLoadRef = React44.useRef(0);
|
|
11467
12374
|
const resolvedTitle = title ?? t("chat.title");
|
|
11468
12375
|
const resolvedPlaceholder = placeholder ?? t("chat.placeholder");
|
|
11469
12376
|
const petRequired = options?.displayMode === "pet";
|
|
11470
|
-
const basePetSettings =
|
|
12377
|
+
const basePetSettings = React44.useMemo(
|
|
11471
12378
|
() => derivePetLocalSettings(options?.pet),
|
|
11472
12379
|
[options?.pet]
|
|
11473
12380
|
);
|
|
11474
|
-
const displayedPetSettings =
|
|
12381
|
+
const displayedPetSettings = React44.useMemo(
|
|
11475
12382
|
() => ({
|
|
11476
12383
|
...petLocalSettings ?? basePetSettings,
|
|
11477
12384
|
...petRequired ? { enabled: true } : {}
|
|
11478
12385
|
}),
|
|
11479
12386
|
[basePetSettings, petLocalSettings, petRequired]
|
|
11480
12387
|
);
|
|
11481
|
-
const effectivePet =
|
|
12388
|
+
const effectivePet = React44.useMemo(() => {
|
|
11482
12389
|
if (petRequired || petLocalSettings) {
|
|
11483
12390
|
return buildPetOptionsFromLocalSettings(displayedPetSettings);
|
|
11484
12391
|
}
|
|
11485
12392
|
return options?.pet ?? null;
|
|
11486
12393
|
}, [displayedPetSettings, options?.pet, petLocalSettings, petRequired]);
|
|
11487
|
-
const savePetLocalSettings =
|
|
12394
|
+
const savePetLocalSettings = React44.useCallback(
|
|
11488
12395
|
(settings) => {
|
|
11489
12396
|
const nextSettings = petRequired ? { ...settings, enabled: true } : settings;
|
|
11490
12397
|
setPetLocalSettings(nextSettings);
|
|
@@ -11492,7 +12399,7 @@ function Chat({
|
|
|
11492
12399
|
},
|
|
11493
12400
|
[petRequired]
|
|
11494
12401
|
);
|
|
11495
|
-
const handlePetCommand =
|
|
12402
|
+
const handlePetCommand = React44.useCallback(
|
|
11496
12403
|
(mode) => {
|
|
11497
12404
|
if (mode === "settings") {
|
|
11498
12405
|
setPetSettingsOpen(true);
|
|
@@ -11514,11 +12421,11 @@ function Chat({
|
|
|
11514
12421
|
[displayedPetSettings, effectivePet, petRequired, savePetLocalSettings]
|
|
11515
12422
|
);
|
|
11516
12423
|
const inputPlaceholder = selectedTool?.placeholderOverride ?? composer?.placeholder ?? resolvedPlaceholder;
|
|
11517
|
-
const messages =
|
|
12424
|
+
const messages = React44.useMemo(
|
|
11518
12425
|
() => stream.messages ?? [],
|
|
11519
12426
|
[stream.messages]
|
|
11520
12427
|
);
|
|
11521
|
-
const draft =
|
|
12428
|
+
const draft = React44.useMemo(
|
|
11522
12429
|
() => getComposerPlainText(composerParts),
|
|
11523
12430
|
[composerParts]
|
|
11524
12431
|
);
|
|
@@ -11530,7 +12437,7 @@ function Chat({
|
|
|
11530
12437
|
isEmpty: isComposerInputEmpty,
|
|
11531
12438
|
isStacked: isComposerStacked
|
|
11532
12439
|
});
|
|
11533
|
-
const pendingFollowUps =
|
|
12440
|
+
const pendingFollowUps = React44.useMemo(
|
|
11534
12441
|
() => [...stream.pendingFollowUps ?? []].sort(
|
|
11535
12442
|
(a, b) => a.createdAt - b.createdAt
|
|
11536
12443
|
),
|
|
@@ -11541,18 +12448,18 @@ function Chat({
|
|
|
11541
12448
|
const hasPendingHITLRequest = Boolean(stream.pendingHITLRequest);
|
|
11542
12449
|
const hasPendingInteractiveRequest = hasPendingRequestUserInput || hasPendingHITLRequest;
|
|
11543
12450
|
const hasPendingTodos = Boolean(stream.todos?.items.length);
|
|
11544
|
-
const runtimeCapabilityOptions =
|
|
12451
|
+
const runtimeCapabilityOptions = React44.useMemo(
|
|
11545
12452
|
() => getRuntimeCapabilityOptions(runtimeCapabilities),
|
|
11546
12453
|
[runtimeCapabilities]
|
|
11547
12454
|
);
|
|
11548
|
-
const effectiveSessionRuntimeCapabilities =
|
|
12455
|
+
const effectiveSessionRuntimeCapabilities = React44.useMemo(
|
|
11549
12456
|
() => runtimeCapabilitiesReady && runtimeCapabilities ? mergeRuntimeCapabilitiesSelections(
|
|
11550
12457
|
runtimeCapabilities,
|
|
11551
12458
|
sessionRuntimeCapabilities
|
|
11552
12459
|
) : null,
|
|
11553
12460
|
[runtimeCapabilities, runtimeCapabilitiesReady, sessionRuntimeCapabilities]
|
|
11554
12461
|
);
|
|
11555
|
-
const runRuntimeCapabilityOptions =
|
|
12462
|
+
const runRuntimeCapabilityOptions = React44.useMemo(
|
|
11556
12463
|
() => runtimeCapabilityOptions.filter(
|
|
11557
12464
|
(option) => isRuntimeCapabilitySelected(
|
|
11558
12465
|
runRuntimeCapabilities,
|
|
@@ -11562,11 +12469,11 @@ function Chat({
|
|
|
11562
12469
|
),
|
|
11563
12470
|
[runRuntimeCapabilities, runtimeCapabilityOptions]
|
|
11564
12471
|
);
|
|
11565
|
-
const composerRuntimeCapabilitySelectionKeys =
|
|
12472
|
+
const composerRuntimeCapabilitySelectionKeys = React44.useMemo(
|
|
11566
12473
|
() => getComposerCapabilitySelectionKeys(composerParts),
|
|
11567
12474
|
[composerParts]
|
|
11568
12475
|
);
|
|
11569
|
-
const detachedRunRuntimeCapabilityOptions =
|
|
12476
|
+
const detachedRunRuntimeCapabilityOptions = React44.useMemo(
|
|
11570
12477
|
() => runRuntimeCapabilityOptions.filter(
|
|
11571
12478
|
(option) => !composerRuntimeCapabilitySelectionKeys.has(
|
|
11572
12479
|
getRuntimeCapabilityOptionKey(option)
|
|
@@ -11574,7 +12481,7 @@ function Chat({
|
|
|
11574
12481
|
),
|
|
11575
12482
|
[composerRuntimeCapabilitySelectionKeys, runRuntimeCapabilityOptions]
|
|
11576
12483
|
);
|
|
11577
|
-
const persistSessionRuntimeCapabilities =
|
|
12484
|
+
const persistSessionRuntimeCapabilities = React44.useCallback(
|
|
11578
12485
|
async (threadId, selection) => {
|
|
11579
12486
|
if (!runtimeCapabilities || !selection) {
|
|
11580
12487
|
return;
|
|
@@ -11599,10 +12506,10 @@ function Chat({
|
|
|
11599
12506
|
},
|
|
11600
12507
|
[runtimeCapabilities, stream.client]
|
|
11601
12508
|
);
|
|
11602
|
-
const clearQuoteSelection =
|
|
12509
|
+
const clearQuoteSelection = React44.useCallback(() => {
|
|
11603
12510
|
setQuoteSelection(null);
|
|
11604
12511
|
}, []);
|
|
11605
|
-
const commitComposerParts =
|
|
12512
|
+
const commitComposerParts = React44.useCallback(
|
|
11606
12513
|
(nextParts, options2) => {
|
|
11607
12514
|
const normalized = normalizeComposerParts(nextParts);
|
|
11608
12515
|
const previous = composerPartsRef.current;
|
|
@@ -11638,7 +12545,7 @@ function Chat({
|
|
|
11638
12545
|
},
|
|
11639
12546
|
[]
|
|
11640
12547
|
);
|
|
11641
|
-
const setComposerText =
|
|
12548
|
+
const setComposerText = React44.useCallback(
|
|
11642
12549
|
(text, caretOffset = text.length) => {
|
|
11643
12550
|
commitComposerParts(createComposerTextParts(text), {
|
|
11644
12551
|
caretOffset,
|
|
@@ -11648,7 +12555,7 @@ function Chat({
|
|
|
11648
12555
|
},
|
|
11649
12556
|
[commitComposerParts]
|
|
11650
12557
|
);
|
|
11651
|
-
const focusComposerAt =
|
|
12558
|
+
const focusComposerAt = React44.useCallback((position) => {
|
|
11652
12559
|
const nextPosition = position ?? getComposerEditingLength(composerPartsRef.current);
|
|
11653
12560
|
pendingComposerCaretOffsetRef.current = nextPosition;
|
|
11654
12561
|
requestAnimationFrame(() => {
|
|
@@ -11660,7 +12567,7 @@ function Chat({
|
|
|
11660
12567
|
});
|
|
11661
12568
|
}, []);
|
|
11662
12569
|
const parentMessenger = useParentMessenger({
|
|
11663
|
-
onSetComposerValue:
|
|
12570
|
+
onSetComposerValue: React44.useCallback(
|
|
11664
12571
|
(payload) => {
|
|
11665
12572
|
if (!payload) {
|
|
11666
12573
|
return;
|
|
@@ -11683,10 +12590,10 @@ function Chat({
|
|
|
11683
12590
|
},
|
|
11684
12591
|
[composer?.tools, setComposerText]
|
|
11685
12592
|
),
|
|
11686
|
-
onFocusComposer:
|
|
12593
|
+
onFocusComposer: React44.useCallback(() => {
|
|
11687
12594
|
composerInputRef.current?.focus();
|
|
11688
12595
|
}, []),
|
|
11689
|
-
onSetPetEnabled:
|
|
12596
|
+
onSetPetEnabled: React44.useCallback(
|
|
11690
12597
|
(enabled) => {
|
|
11691
12598
|
if (petRequired) {
|
|
11692
12599
|
return;
|
|
@@ -11699,7 +12606,7 @@ function Chat({
|
|
|
11699
12606
|
[displayedPetSettings, petRequired, savePetLocalSettings]
|
|
11700
12607
|
)
|
|
11701
12608
|
});
|
|
11702
|
-
const syncQuoteSelection =
|
|
12609
|
+
const syncQuoteSelection = React44.useCallback(() => {
|
|
11703
12610
|
if (typeof window === "undefined") {
|
|
11704
12611
|
clearQuoteSelection();
|
|
11705
12612
|
return;
|
|
@@ -11744,23 +12651,23 @@ function Chat({
|
|
|
11744
12651
|
left
|
|
11745
12652
|
});
|
|
11746
12653
|
}, [clearQuoteSelection]);
|
|
11747
|
-
const cancelPendingAutoScroll =
|
|
12654
|
+
const cancelPendingAutoScroll = React44.useCallback(() => {
|
|
11748
12655
|
if (autoScrollFrameRef.current !== null) {
|
|
11749
12656
|
cancelAnimationFrame(autoScrollFrameRef.current);
|
|
11750
12657
|
autoScrollFrameRef.current = null;
|
|
11751
12658
|
}
|
|
11752
12659
|
}, []);
|
|
11753
|
-
const disableAutoFollow =
|
|
12660
|
+
const disableAutoFollow = React44.useCallback(() => {
|
|
11754
12661
|
forceFollowRef.current = false;
|
|
11755
12662
|
shouldAutoScrollRef.current = false;
|
|
11756
12663
|
cancelPendingAutoScroll();
|
|
11757
12664
|
}, [cancelPendingAutoScroll]);
|
|
11758
|
-
const enableAutoFollow =
|
|
12665
|
+
const enableAutoFollow = React44.useCallback(() => {
|
|
11759
12666
|
forceFollowRef.current = true;
|
|
11760
12667
|
shouldAutoScrollRef.current = true;
|
|
11761
12668
|
setHasUpdatesBelow(false);
|
|
11762
12669
|
}, []);
|
|
11763
|
-
const scrollToBottom =
|
|
12670
|
+
const scrollToBottom = React44.useCallback(
|
|
11764
12671
|
(smooth = false, force = false) => {
|
|
11765
12672
|
if (force) {
|
|
11766
12673
|
enableAutoFollow();
|
|
@@ -11787,7 +12694,7 @@ function Chat({
|
|
|
11787
12694
|
},
|
|
11788
12695
|
[cancelPendingAutoScroll, enableAutoFollow]
|
|
11789
12696
|
);
|
|
11790
|
-
|
|
12697
|
+
React44.useEffect(() => {
|
|
11791
12698
|
const viewport = viewportRef.current;
|
|
11792
12699
|
if (!viewport) return;
|
|
11793
12700
|
previousScrollTopRef.current = viewport.scrollTop;
|
|
@@ -11868,14 +12775,14 @@ function Chat({
|
|
|
11868
12775
|
window.removeEventListener("pointercancel", stopPointerTracking);
|
|
11869
12776
|
};
|
|
11870
12777
|
}, [cancelPendingAutoScroll, disableAutoFollow]);
|
|
11871
|
-
|
|
12778
|
+
React44.useEffect(() => {
|
|
11872
12779
|
shouldAutoScrollRef.current = true;
|
|
11873
12780
|
forceFollowRef.current = false;
|
|
11874
12781
|
previousScrollTopRef.current = 0;
|
|
11875
12782
|
setIsAtBottom(true);
|
|
11876
12783
|
setHasUpdatesBelow(false);
|
|
11877
12784
|
}, [stream.threadId]);
|
|
11878
|
-
|
|
12785
|
+
React44.useEffect(() => {
|
|
11879
12786
|
const messageCountChanged = messages.length !== previousMessageCountRef.current;
|
|
11880
12787
|
previousMessageCountRef.current = messages.length;
|
|
11881
12788
|
if (!shouldAutoScrollRef.current) {
|
|
@@ -11894,7 +12801,7 @@ function Chat({
|
|
|
11894
12801
|
clientSecret: effectiveClientSecret
|
|
11895
12802
|
});
|
|
11896
12803
|
const missingConfig = Boolean(missingConfigKind);
|
|
11897
|
-
const missingConfigShortMessage =
|
|
12804
|
+
const missingConfigShortMessage = React44.useMemo(() => {
|
|
11898
12805
|
switch (missingConfigKind) {
|
|
11899
12806
|
case "apiUrl":
|
|
11900
12807
|
return t("chat.missingApiUrlShort");
|
|
@@ -11906,7 +12813,7 @@ function Chat({
|
|
|
11906
12813
|
return t("chat.missingConfigShort");
|
|
11907
12814
|
}
|
|
11908
12815
|
}, [missingConfigKind, t]);
|
|
11909
|
-
const missingConfigDetailMessage =
|
|
12816
|
+
const missingConfigDetailMessage = React44.useMemo(() => {
|
|
11910
12817
|
switch (missingConfigKind) {
|
|
11911
12818
|
case "apiUrl":
|
|
11912
12819
|
return t("chat.missingApiUrlDetail");
|
|
@@ -11921,7 +12828,7 @@ function Chat({
|
|
|
11921
12828
|
const showMissingConfig = !isClientSecretInitializing && missingConfig;
|
|
11922
12829
|
const hasUploadingFiles = attachments.some((a) => a.status === "uploading");
|
|
11923
12830
|
const isSendDisabled = !trimmedDraft && !hasReferences || hasPendingInteractiveRequest || missingConfig || isHistoryLoading || hasUploadingFiles || isUploadingReferenceImages;
|
|
11924
|
-
const resizeComposerInput =
|
|
12831
|
+
const resizeComposerInput = React44.useCallback(() => {
|
|
11925
12832
|
const input = composerInputRef.current;
|
|
11926
12833
|
if (!input) {
|
|
11927
12834
|
return;
|
|
@@ -11929,7 +12836,7 @@ function Chat({
|
|
|
11929
12836
|
input.style.maxHeight = `${COMPOSER_INPUT_MAX_HEIGHT}px`;
|
|
11930
12837
|
input.style.overflowY = input.scrollHeight > COMPOSER_INPUT_MAX_HEIGHT ? "auto" : "hidden";
|
|
11931
12838
|
}, []);
|
|
11932
|
-
|
|
12839
|
+
React44.useLayoutEffect(() => {
|
|
11933
12840
|
composerPartsRef.current = composerParts;
|
|
11934
12841
|
resizeComposerInput();
|
|
11935
12842
|
const caretOffset = pendingComposerCaretOffsetRef.current;
|
|
@@ -11941,13 +12848,13 @@ function Chat({
|
|
|
11941
12848
|
}
|
|
11942
12849
|
}
|
|
11943
12850
|
}, [composerDomVersion, composerParts, resizeComposerInput]);
|
|
11944
|
-
|
|
12851
|
+
React44.useEffect(() => {
|
|
11945
12852
|
document.addEventListener("selectionchange", syncQuoteSelection);
|
|
11946
12853
|
return () => {
|
|
11947
12854
|
document.removeEventListener("selectionchange", syncQuoteSelection);
|
|
11948
12855
|
};
|
|
11949
12856
|
}, [syncQuoteSelection]);
|
|
11950
|
-
|
|
12857
|
+
React44.useEffect(() => {
|
|
11951
12858
|
const viewport = viewportRef.current;
|
|
11952
12859
|
if (!viewport) {
|
|
11953
12860
|
return;
|
|
@@ -11964,14 +12871,14 @@ function Chat({
|
|
|
11964
12871
|
window.removeEventListener("resize", handleViewportScroll);
|
|
11965
12872
|
};
|
|
11966
12873
|
}, [clearQuoteSelection]);
|
|
11967
|
-
|
|
12874
|
+
React44.useEffect(() => {
|
|
11968
12875
|
clearQuoteSelection();
|
|
11969
12876
|
}, [messages.length, stream.threadId, clearQuoteSelection]);
|
|
11970
|
-
|
|
12877
|
+
React44.useEffect(() => {
|
|
11971
12878
|
if (missingConfig) return;
|
|
11972
12879
|
void refreshThreads();
|
|
11973
12880
|
}, [missingConfig, refreshThreads]);
|
|
11974
|
-
|
|
12881
|
+
React44.useEffect(() => {
|
|
11975
12882
|
if (missingConfig || !stream.client || !stream.assistantId) {
|
|
11976
12883
|
setAssistantName(null);
|
|
11977
12884
|
setAssistantAvatar(null);
|
|
@@ -11994,7 +12901,7 @@ function Chat({
|
|
|
11994
12901
|
cancelled = true;
|
|
11995
12902
|
};
|
|
11996
12903
|
}, [missingConfig, stream.client, stream.assistantId]);
|
|
11997
|
-
|
|
12904
|
+
React44.useEffect(() => {
|
|
11998
12905
|
if (missingConfig || !stream.client || !stream.assistantId) {
|
|
11999
12906
|
setRuntimeCapabilities(null);
|
|
12000
12907
|
setRuntimeCapabilitiesReady(false);
|
|
@@ -12041,7 +12948,7 @@ function Chat({
|
|
|
12041
12948
|
});
|
|
12042
12949
|
return () => controller.abort();
|
|
12043
12950
|
}, [missingConfig, stream.client, stream.assistantId]);
|
|
12044
|
-
|
|
12951
|
+
React44.useEffect(() => {
|
|
12045
12952
|
setRunRuntimeCapabilities(
|
|
12046
12953
|
createEmptyRuntimeCapabilitiesSelection(runtimeCapabilities)
|
|
12047
12954
|
);
|
|
@@ -12098,7 +13005,7 @@ function Chat({
|
|
|
12098
13005
|
mimetype: a.storageFile?.mimetype ?? a.file.type,
|
|
12099
13006
|
size: a.storageFile?.size ?? a.file.size
|
|
12100
13007
|
}));
|
|
12101
|
-
const handleSessionRuntimeCapabilityToggle =
|
|
13008
|
+
const handleSessionRuntimeCapabilityToggle = React44.useCallback(
|
|
12102
13009
|
(type, id, selected) => {
|
|
12103
13010
|
setSessionRuntimeCapabilities((previous) => {
|
|
12104
13011
|
const nextSelection = toggleRuntimeCapabilitySelection(
|
|
@@ -12116,7 +13023,7 @@ function Chat({
|
|
|
12116
13023
|
},
|
|
12117
13024
|
[persistSessionRuntimeCapabilities, stream.threadId]
|
|
12118
13025
|
);
|
|
12119
|
-
const updateRuntimeCapabilityPalette =
|
|
13026
|
+
const updateRuntimeCapabilityPalette = React44.useCallback(
|
|
12120
13027
|
(parts, selectionStart) => {
|
|
12121
13028
|
const input = composerInputRef.current;
|
|
12122
13029
|
const editingText = getComposerEditingText(parts);
|
|
@@ -12128,7 +13035,7 @@ function Chat({
|
|
|
12128
13035
|
},
|
|
12129
13036
|
[]
|
|
12130
13037
|
);
|
|
12131
|
-
const syncComposerInputFromElement =
|
|
13038
|
+
const syncComposerInputFromElement = React44.useCallback(
|
|
12132
13039
|
(input) => {
|
|
12133
13040
|
const previousCapabilities = getComposerCapabilityPartMap(
|
|
12134
13041
|
composerPartsRef.current
|
|
@@ -12146,25 +13053,25 @@ function Chat({
|
|
|
12146
13053
|
},
|
|
12147
13054
|
[commitComposerParts, updateRuntimeCapabilityPalette]
|
|
12148
13055
|
);
|
|
12149
|
-
const handleComposerInput =
|
|
13056
|
+
const handleComposerInput = React44.useCallback(
|
|
12150
13057
|
(event) => {
|
|
12151
13058
|
syncComposerInputFromElement(event.currentTarget);
|
|
12152
13059
|
},
|
|
12153
13060
|
[syncComposerInputFromElement]
|
|
12154
13061
|
);
|
|
12155
|
-
const handleComposerCompositionEnd =
|
|
13062
|
+
const handleComposerCompositionEnd = React44.useCallback(
|
|
12156
13063
|
(event) => {
|
|
12157
13064
|
syncComposerInputFromElement(event.currentTarget);
|
|
12158
13065
|
},
|
|
12159
13066
|
[syncComposerInputFromElement]
|
|
12160
13067
|
);
|
|
12161
|
-
const handleComposerSelect =
|
|
13068
|
+
const handleComposerSelect = React44.useCallback(() => {
|
|
12162
13069
|
updateRuntimeCapabilityPalette(
|
|
12163
13070
|
composerPartsRef.current,
|
|
12164
13071
|
composerInputRef.current ? getComposerSelectionOffset(composerInputRef.current) : void 0
|
|
12165
13072
|
);
|
|
12166
13073
|
}, [updateRuntimeCapabilityPalette]);
|
|
12167
|
-
const removeRunRuntimeCapability =
|
|
13074
|
+
const removeRunRuntimeCapability = React44.useCallback(
|
|
12168
13075
|
(option) => {
|
|
12169
13076
|
setRunRuntimeCapabilities(
|
|
12170
13077
|
(previous) => toggleRuntimeCapabilitySelection(
|
|
@@ -12184,7 +13091,7 @@ function Chat({
|
|
|
12184
13091
|
},
|
|
12185
13092
|
[commitComposerParts]
|
|
12186
13093
|
);
|
|
12187
|
-
const submitDraft =
|
|
13094
|
+
const submitDraft = React44.useCallback(
|
|
12188
13095
|
(optionsOrFollowUp) => {
|
|
12189
13096
|
if (isSendDisabled) return;
|
|
12190
13097
|
const submitOptions = typeof optionsOrFollowUp === "string" ? { followUpOverride: optionsOrFollowUp } : optionsOrFollowUp ?? {};
|
|
@@ -12308,7 +13215,7 @@ function Chat({
|
|
|
12308
13215
|
t
|
|
12309
13216
|
]
|
|
12310
13217
|
);
|
|
12311
|
-
const addRunRuntimeCapabilities =
|
|
13218
|
+
const addRunRuntimeCapabilities = React44.useCallback(
|
|
12312
13219
|
(selection) => {
|
|
12313
13220
|
setRunRuntimeCapabilities(
|
|
12314
13221
|
(previous) => runtimeCapabilities ? mergeRuntimeCapabilitiesSelections(
|
|
@@ -12320,7 +13227,7 @@ function Chat({
|
|
|
12320
13227
|
},
|
|
12321
13228
|
[runtimeCapabilities]
|
|
12322
13229
|
);
|
|
12323
|
-
const insertComposerCapabilityToken =
|
|
13230
|
+
const insertComposerCapabilityToken = React44.useCallback(
|
|
12324
13231
|
(capability, range) => {
|
|
12325
13232
|
const token = createComposerCapabilityPart(capability, createMessageId());
|
|
12326
13233
|
const currentParts = composerPartsRef.current;
|
|
@@ -12391,7 +13298,7 @@ function Chat({
|
|
|
12391
13298
|
plugin: t("composer.slashCommands.empty.loadingCapabilities"),
|
|
12392
13299
|
subAgent: t("composer.slashCommands.empty.loadingCapabilities")
|
|
12393
13300
|
};
|
|
12394
|
-
|
|
13301
|
+
React44.useEffect(() => {
|
|
12395
13302
|
if (!runtimeCapabilityPalette) {
|
|
12396
13303
|
return;
|
|
12397
13304
|
}
|
|
@@ -12410,7 +13317,7 @@ function Chat({
|
|
|
12410
13317
|
);
|
|
12411
13318
|
}
|
|
12412
13319
|
}, [slashPaletteOptions.length, runtimeCapabilityPalette]);
|
|
12413
|
-
|
|
13320
|
+
React44.useLayoutEffect(() => {
|
|
12414
13321
|
if (!runtimeCapabilityPalette) {
|
|
12415
13322
|
return;
|
|
12416
13323
|
}
|
|
@@ -12434,7 +13341,7 @@ function Chat({
|
|
|
12434
13341
|
}
|
|
12435
13342
|
submitDraft();
|
|
12436
13343
|
};
|
|
12437
|
-
const handleEditPendingFollowUp =
|
|
13344
|
+
const handleEditPendingFollowUp = React44.useCallback(
|
|
12438
13345
|
(id) => {
|
|
12439
13346
|
const item = pendingFollowUps.find(
|
|
12440
13347
|
(entry) => entry.id === id && entry.mode === "queue"
|
|
@@ -12461,7 +13368,7 @@ function Chat({
|
|
|
12461
13368
|
},
|
|
12462
13369
|
[pendingFollowUps, setComposerText, stream]
|
|
12463
13370
|
);
|
|
12464
|
-
const handleQuoteSelection =
|
|
13371
|
+
const handleQuoteSelection = React44.useCallback(() => {
|
|
12465
13372
|
if (!quoteSelection) {
|
|
12466
13373
|
return;
|
|
12467
13374
|
}
|
|
@@ -12477,7 +13384,7 @@ function Chat({
|
|
|
12477
13384
|
const handleAttachmentClick = () => {
|
|
12478
13385
|
fileInputRef.current?.click();
|
|
12479
13386
|
};
|
|
12480
|
-
const uploadContextFile =
|
|
13387
|
+
const uploadContextFile = React44.useCallback(
|
|
12481
13388
|
(file) => stream.client.contexts.uploadFile(file),
|
|
12482
13389
|
[stream.client]
|
|
12483
13390
|
);
|
|
@@ -12581,7 +13488,7 @@ function Chat({
|
|
|
12581
13488
|
}
|
|
12582
13489
|
submitDraft();
|
|
12583
13490
|
};
|
|
12584
|
-
const handleComposerPaste =
|
|
13491
|
+
const handleComposerPaste = React44.useCallback(
|
|
12585
13492
|
(event) => {
|
|
12586
13493
|
const clipboardData = event.clipboardData;
|
|
12587
13494
|
if (!clipboardData) {
|
|
@@ -12680,18 +13587,18 @@ function Chat({
|
|
|
12680
13587
|
uploadContextFile
|
|
12681
13588
|
]
|
|
12682
13589
|
);
|
|
12683
|
-
const alternateFollowUpShortcutLabel =
|
|
13590
|
+
const alternateFollowUpShortcutLabel = React44.useMemo(() => {
|
|
12684
13591
|
if (typeof navigator === "undefined") {
|
|
12685
13592
|
return "\u2318Enter";
|
|
12686
13593
|
}
|
|
12687
13594
|
const platform = navigator.platform || navigator.userAgent;
|
|
12688
13595
|
return /Mac|iPhone|iPad|iPod/i.test(platform) ? "\u2318Enter" : "Ctrl+Enter";
|
|
12689
13596
|
}, []);
|
|
12690
|
-
const followUpShortcutLabels =
|
|
13597
|
+
const followUpShortcutLabels = React44.useMemo(
|
|
12691
13598
|
() => getComposerFollowUpShortcutLabels(alternateFollowUpShortcutLabel),
|
|
12692
13599
|
[alternateFollowUpShortcutLabel]
|
|
12693
13600
|
);
|
|
12694
|
-
const uploadFile =
|
|
13601
|
+
const uploadFile = React44.useCallback(
|
|
12695
13602
|
async (localId, file) => {
|
|
12696
13603
|
try {
|
|
12697
13604
|
const result = await uploadContextFile(file);
|
|
@@ -12714,7 +13621,7 @@ function Chat({
|
|
|
12714
13621
|
},
|
|
12715
13622
|
[uploadContextFile]
|
|
12716
13623
|
);
|
|
12717
|
-
const handleRetryUpload =
|
|
13624
|
+
const handleRetryUpload = React44.useCallback(
|
|
12718
13625
|
(localId) => {
|
|
12719
13626
|
const attachment = attachments.find((a) => a.localId === localId);
|
|
12720
13627
|
if (!attachment || attachment.status !== "error") return;
|
|
@@ -12813,7 +13720,7 @@ function Chat({
|
|
|
12813
13720
|
);
|
|
12814
13721
|
scrollToBottom(true, true);
|
|
12815
13722
|
};
|
|
12816
|
-
const loadConversationMessages =
|
|
13723
|
+
const loadConversationMessages = React44.useCallback(
|
|
12817
13724
|
async (recordId) => {
|
|
12818
13725
|
if (missingConfig) {
|
|
12819
13726
|
setHistoryError(missingConfigShortMessage);
|
|
@@ -12908,12 +13815,12 @@ function Chat({
|
|
|
12908
13815
|
}
|
|
12909
13816
|
};
|
|
12910
13817
|
const acceptMimes = composer?.attachments?.accept ? Object.entries(composer.attachments.accept).map(([mime, exts]) => [mime, ...exts.map((e) => `.${e}`)].join(",")).join(",") : void 0;
|
|
12911
|
-
const currentThread =
|
|
13818
|
+
const currentThread = React44.useMemo(
|
|
12912
13819
|
() => threads.find((item) => item.id === stream.threadId),
|
|
12913
13820
|
[threads, stream.threadId]
|
|
12914
13821
|
);
|
|
12915
13822
|
const streamErrorMessage = stream.error instanceof Error ? stream.error.message : void 0;
|
|
12916
|
-
const threadErrorMessage =
|
|
13823
|
+
const threadErrorMessage = React44.useMemo(() => {
|
|
12917
13824
|
if (streamErrorMessage?.trim()) return streamErrorMessage.trim();
|
|
12918
13825
|
if (currentThread?.status !== "error") return void 0;
|
|
12919
13826
|
const message = currentThread.error?.trim();
|
|
@@ -12944,7 +13851,7 @@ function Chat({
|
|
|
12944
13851
|
fallbackTitle: t("history.threadFallback")
|
|
12945
13852
|
});
|
|
12946
13853
|
const assistantTitle = assistantName || resolvedTitle;
|
|
12947
|
-
return /* @__PURE__ */
|
|
13854
|
+
return /* @__PURE__ */ jsxs31(
|
|
12948
13855
|
"div",
|
|
12949
13856
|
{
|
|
12950
13857
|
ref: viewportRef,
|
|
@@ -12954,10 +13861,10 @@ function Chat({
|
|
|
12954
13861
|
className
|
|
12955
13862
|
),
|
|
12956
13863
|
children: [
|
|
12957
|
-
/* @__PURE__ */
|
|
12958
|
-
/* @__PURE__ */
|
|
12959
|
-
/* @__PURE__ */
|
|
12960
|
-
/* @__PURE__ */
|
|
13864
|
+
/* @__PURE__ */ jsxs31("div", { className: "flex items-center justify-between border-b p-2 sticky top-0 z-10 bg-background", children: [
|
|
13865
|
+
/* @__PURE__ */ jsxs31("div", { className: "flex items-center gap-3 overflow-hidden", children: [
|
|
13866
|
+
/* @__PURE__ */ jsxs31("div", { className: "relative shrink-0", children: [
|
|
13867
|
+
/* @__PURE__ */ jsx48(
|
|
12961
13868
|
ChatkitAvatar,
|
|
12962
13869
|
{
|
|
12963
13870
|
avatar: assistantAvatar,
|
|
@@ -12965,10 +13872,10 @@ function Chat({
|
|
|
12965
13872
|
label: assistantTitle
|
|
12966
13873
|
}
|
|
12967
13874
|
),
|
|
12968
|
-
/* @__PURE__ */
|
|
13875
|
+
/* @__PURE__ */ jsx48("span", { className: "absolute bottom-0 right-0 h-2.5 w-2.5 rounded-full border-2 border-background bg-green-500" })
|
|
12969
13876
|
] }),
|
|
12970
|
-
/* @__PURE__ */
|
|
12971
|
-
/* @__PURE__ */
|
|
13877
|
+
/* @__PURE__ */ jsxs31("div", { className: "truncate", children: [
|
|
13878
|
+
/* @__PURE__ */ jsx48(
|
|
12972
13879
|
"h2",
|
|
12973
13880
|
{
|
|
12974
13881
|
className: "text-lg font-semibold truncate",
|
|
@@ -12976,12 +13883,12 @@ function Chat({
|
|
|
12976
13883
|
children: assistantTitle
|
|
12977
13884
|
}
|
|
12978
13885
|
),
|
|
12979
|
-
/* @__PURE__ */
|
|
13886
|
+
/* @__PURE__ */ jsx48("p", { className: "text-xs text-muted-foreground", children: t("chat.statusOnline") })
|
|
12980
13887
|
] })
|
|
12981
13888
|
] }),
|
|
12982
|
-
/* @__PURE__ */
|
|
12983
|
-
/* @__PURE__ */
|
|
12984
|
-
/* @__PURE__ */
|
|
13889
|
+
/* @__PURE__ */ jsxs31("div", { className: "flex items-center gap-1", children: [
|
|
13890
|
+
/* @__PURE__ */ jsxs31(Tooltip, { children: [
|
|
13891
|
+
/* @__PURE__ */ jsx48(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx48("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ jsx48(
|
|
12985
13892
|
"button",
|
|
12986
13893
|
{
|
|
12987
13894
|
type: "button",
|
|
@@ -12992,14 +13899,14 @@ function Chat({
|
|
|
12992
13899
|
"transition-colors duration-150"
|
|
12993
13900
|
),
|
|
12994
13901
|
"aria-label": t("settings.open"),
|
|
12995
|
-
children: /* @__PURE__ */
|
|
13902
|
+
children: /* @__PURE__ */ jsx48(Settings2, { size: 16 })
|
|
12996
13903
|
}
|
|
12997
13904
|
) }) }),
|
|
12998
|
-
/* @__PURE__ */
|
|
13905
|
+
/* @__PURE__ */ jsx48(TooltipContent, { side: "bottom", children: t("settings.open") })
|
|
12999
13906
|
] }),
|
|
13000
|
-
history?.enabled !== false && /* @__PURE__ */
|
|
13001
|
-
/* @__PURE__ */
|
|
13002
|
-
/* @__PURE__ */
|
|
13907
|
+
history?.enabled !== false && /* @__PURE__ */ jsxs31(Fragment7, { children: [
|
|
13908
|
+
/* @__PURE__ */ jsxs31(Tooltip, { children: [
|
|
13909
|
+
/* @__PURE__ */ jsx48(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx48("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ jsx48(
|
|
13003
13910
|
"button",
|
|
13004
13911
|
{
|
|
13005
13912
|
type: "button",
|
|
@@ -13012,12 +13919,12 @@ function Chat({
|
|
|
13012
13919
|
"disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed"
|
|
13013
13920
|
),
|
|
13014
13921
|
"aria-label": t("history.newThread"),
|
|
13015
|
-
children: /* @__PURE__ */
|
|
13922
|
+
children: /* @__PURE__ */ jsx48(Pencil4, { size: 16 })
|
|
13016
13923
|
}
|
|
13017
13924
|
) }) }),
|
|
13018
|
-
/* @__PURE__ */
|
|
13925
|
+
/* @__PURE__ */ jsx48(TooltipContent, { side: "bottom", children: t("history.newThread") })
|
|
13019
13926
|
] }),
|
|
13020
|
-
/* @__PURE__ */
|
|
13927
|
+
/* @__PURE__ */ jsx48(
|
|
13021
13928
|
HistorySidebar,
|
|
13022
13929
|
{
|
|
13023
13930
|
threads,
|
|
@@ -13032,18 +13939,18 @@ function Chat({
|
|
|
13032
13939
|
] })
|
|
13033
13940
|
] })
|
|
13034
13941
|
] }),
|
|
13035
|
-
/* @__PURE__ */
|
|
13036
|
-
errorMessage && /* @__PURE__ */
|
|
13037
|
-
historyError && /* @__PURE__ */
|
|
13038
|
-
showMissingConfig && /* @__PURE__ */
|
|
13039
|
-
isHistoryLoading && /* @__PURE__ */
|
|
13040
|
-
messages.length === 0 ? /* @__PURE__ */
|
|
13942
|
+
/* @__PURE__ */ jsxs31("div", { className: "flex-1 p-4", children: [
|
|
13943
|
+
errorMessage && /* @__PURE__ */ jsx48("div", { className: "mb-4 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive", children: errorMessage }),
|
|
13944
|
+
historyError && /* @__PURE__ */ jsx48("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: historyError }),
|
|
13945
|
+
showMissingConfig && /* @__PURE__ */ jsx48("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: missingConfigDetailMessage }),
|
|
13946
|
+
isHistoryLoading && /* @__PURE__ */ jsx48("div", { className: "mb-4 rounded-lg border border-muted px-3 py-2 text-sm text-muted-foreground", children: t("chat.loadingThread") }),
|
|
13947
|
+
messages.length === 0 ? /* @__PURE__ */ jsx48(
|
|
13041
13948
|
StartScreen,
|
|
13042
13949
|
{
|
|
13043
13950
|
startScreen,
|
|
13044
13951
|
onPromptClick: handlePromptClick
|
|
13045
13952
|
}
|
|
13046
|
-
) : /* @__PURE__ */
|
|
13953
|
+
) : /* @__PURE__ */ jsxs31("div", { className: "space-y-4", children: [
|
|
13047
13954
|
messages.map((message, index) => {
|
|
13048
13955
|
const messageType = String(message.type);
|
|
13049
13956
|
const isAssistantMessage = messageType === "assistant" || messageType === "ai";
|
|
@@ -13076,7 +13983,7 @@ function Chat({
|
|
|
13076
13983
|
if (!isAssistantMessage && !hasPlainRenderableContent && !hasHumanAttachments && humanRuntimeCapabilityOptions.length === 0 && humanReferences.length === 0) {
|
|
13077
13984
|
return null;
|
|
13078
13985
|
}
|
|
13079
|
-
return /* @__PURE__ */
|
|
13986
|
+
return /* @__PURE__ */ jsx48(
|
|
13080
13987
|
"div",
|
|
13081
13988
|
{
|
|
13082
13989
|
className: cn(
|
|
@@ -13084,8 +13991,8 @@ function Chat({
|
|
|
13084
13991
|
message.type === "human" ? "justify-end" : "justify-start -ml-1"
|
|
13085
13992
|
// AI messages: slightly closer to left
|
|
13086
13993
|
),
|
|
13087
|
-
children: /* @__PURE__ */
|
|
13088
|
-
/* @__PURE__ */
|
|
13994
|
+
children: /* @__PURE__ */ jsxs31("div", { className: "flex flex-col px-3 overflow-hidden", children: [
|
|
13995
|
+
/* @__PURE__ */ jsx48(
|
|
13089
13996
|
"div",
|
|
13090
13997
|
{
|
|
13091
13998
|
...canQuoteMessage ? {
|
|
@@ -13097,7 +14004,7 @@ function Chat({
|
|
|
13097
14004
|
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"
|
|
13098
14005
|
// AI messages: use chat-specific foreground color
|
|
13099
14006
|
),
|
|
13100
|
-
children: isAssistantMessage ? /* @__PURE__ */
|
|
14007
|
+
children: isAssistantMessage ? /* @__PURE__ */ jsx48(
|
|
13101
14008
|
AssistantMessage,
|
|
13102
14009
|
{
|
|
13103
14010
|
message: {
|
|
@@ -13116,25 +14023,25 @@ function Chat({
|
|
|
13116
14023
|
organizationId: stream.organizationId,
|
|
13117
14024
|
apiUrl: stream.apiUrl
|
|
13118
14025
|
}
|
|
13119
|
-
) : /* @__PURE__ */
|
|
13120
|
-
message.type === "human" && humanRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */
|
|
14026
|
+
) : /* @__PURE__ */ jsxs31(Fragment7, { children: [
|
|
14027
|
+
message.type === "human" && humanRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ jsx48("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanRuntimeCapabilityOptions.map((option) => /* @__PURE__ */ jsxs31(
|
|
13121
14028
|
"span",
|
|
13122
14029
|
{
|
|
13123
14030
|
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",
|
|
13124
14031
|
children: [
|
|
13125
|
-
/* @__PURE__ */
|
|
14032
|
+
/* @__PURE__ */ jsx48(
|
|
13126
14033
|
RuntimeCapabilityIcon,
|
|
13127
14034
|
{
|
|
13128
14035
|
option,
|
|
13129
14036
|
variant: "chip"
|
|
13130
14037
|
}
|
|
13131
14038
|
),
|
|
13132
|
-
/* @__PURE__ */
|
|
14039
|
+
/* @__PURE__ */ jsx48("span", { className: "max-w-[9rem] truncate", children: option.label })
|
|
13133
14040
|
]
|
|
13134
14041
|
},
|
|
13135
14042
|
`${option.type}:${option.id}`
|
|
13136
14043
|
)) }),
|
|
13137
|
-
message.type === "human" && humanReferences.length > 0 && /* @__PURE__ */
|
|
14044
|
+
message.type === "human" && humanReferences.length > 0 && /* @__PURE__ */ jsx48("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanReferences.map((reference) => /* @__PURE__ */ jsx48(
|
|
13138
14045
|
ReferenceChip,
|
|
13139
14046
|
{
|
|
13140
14047
|
reference,
|
|
@@ -13142,29 +14049,29 @@ function Chat({
|
|
|
13142
14049
|
},
|
|
13143
14050
|
getReferenceKey(reference)
|
|
13144
14051
|
)) }),
|
|
13145
|
-
message.type === "human" && humanAttachments.length > 0 && /* @__PURE__ */
|
|
14052
|
+
message.type === "human" && humanAttachments.length > 0 && /* @__PURE__ */ jsx48("div", { className: "flex flex-wrap gap-1.5 mb-2", children: humanAttachments.map((file, fileIndex) => /* @__PURE__ */ jsxs31(
|
|
13146
14053
|
"div",
|
|
13147
14054
|
{
|
|
13148
14055
|
className: "flex items-center gap-1.5 rounded-md bg-primary-foreground/20 px-2 py-1 text-xs",
|
|
13149
14056
|
children: [
|
|
13150
|
-
/* @__PURE__ */
|
|
13151
|
-
/* @__PURE__ */
|
|
14057
|
+
/* @__PURE__ */ jsx48(FileText3, { size: 12 }),
|
|
14058
|
+
/* @__PURE__ */ jsx48("span", { className: "max-w-[100px] truncate", children: file.originalName })
|
|
13152
14059
|
]
|
|
13153
14060
|
},
|
|
13154
14061
|
fileIndex
|
|
13155
14062
|
)) }),
|
|
13156
|
-
Array.isArray(message.content) ? message.content.map((part, partIndex) => /* @__PURE__ */
|
|
14063
|
+
Array.isArray(message.content) ? message.content.map((part, partIndex) => /* @__PURE__ */ jsx48(
|
|
13157
14064
|
"p",
|
|
13158
14065
|
{
|
|
13159
14066
|
className: "wrap-break-word text-sm leading-relaxed",
|
|
13160
14067
|
children: formatMessageContent(part)
|
|
13161
14068
|
},
|
|
13162
14069
|
`${part.type}-${partIndex}`
|
|
13163
|
-
)) : /* @__PURE__ */
|
|
14070
|
+
)) : /* @__PURE__ */ jsx48("span", { className: "wrap-break-word text-sm leading-relaxed", children: formatMessageContent(message.content) })
|
|
13164
14071
|
] })
|
|
13165
14072
|
}
|
|
13166
14073
|
),
|
|
13167
|
-
/* @__PURE__ */
|
|
14074
|
+
/* @__PURE__ */ jsx48(
|
|
13168
14075
|
MessageActions,
|
|
13169
14076
|
{
|
|
13170
14077
|
content: messageContent,
|
|
@@ -13200,7 +14107,7 @@ function Chat({
|
|
|
13200
14107
|
stream.isLoading,
|
|
13201
14108
|
{ now: streamingNow }
|
|
13202
14109
|
);
|
|
13203
|
-
return /* @__PURE__ */
|
|
14110
|
+
return /* @__PURE__ */ jsx48("div", { className: "flex justify-start gap-3 -ml-2", children: /* @__PURE__ */ jsx48("div", { className: "max-w-full rounded-2xl py-2.5", children: /* @__PURE__ */ jsx48(
|
|
13204
14111
|
AssistantStreamingIndicator,
|
|
13205
14112
|
{
|
|
13206
14113
|
status: fallbackStreamingStatus ?? "loading"
|
|
@@ -13209,7 +14116,7 @@ function Chat({
|
|
|
13209
14116
|
})()
|
|
13210
14117
|
] })
|
|
13211
14118
|
] }),
|
|
13212
|
-
!isAtBottom && messages.length > 0 && /* @__PURE__ */
|
|
14119
|
+
!isAtBottom && messages.length > 0 && /* @__PURE__ */ jsx48("div", { className: "sticky bottom-20 z-20 flex justify-center px-4 pointer-events-none", children: /* @__PURE__ */ jsx48(
|
|
13213
14120
|
Button,
|
|
13214
14121
|
{
|
|
13215
14122
|
type: "button",
|
|
@@ -13222,10 +14129,10 @@ function Chat({
|
|
|
13222
14129
|
onClick: () => scrollToBottom(true, true),
|
|
13223
14130
|
"aria-label": t("chat.scrollToBottom"),
|
|
13224
14131
|
title: t("chat.scrollToBottom"),
|
|
13225
|
-
children: /* @__PURE__ */
|
|
14132
|
+
children: /* @__PURE__ */ jsx48(ArrowDown2, { size: 16 })
|
|
13226
14133
|
}
|
|
13227
14134
|
) }),
|
|
13228
|
-
quoteSelection && /* @__PURE__ */
|
|
14135
|
+
quoteSelection && /* @__PURE__ */ jsx48(
|
|
13229
14136
|
"div",
|
|
13230
14137
|
{
|
|
13231
14138
|
className: "pointer-events-none fixed z-50",
|
|
@@ -13234,7 +14141,7 @@ function Chat({
|
|
|
13234
14141
|
left: `${quoteSelection.left}px`,
|
|
13235
14142
|
transform: "translateX(-50%)"
|
|
13236
14143
|
},
|
|
13237
|
-
children: /* @__PURE__ */
|
|
14144
|
+
children: /* @__PURE__ */ jsxs31(
|
|
13238
14145
|
Button,
|
|
13239
14146
|
{
|
|
13240
14147
|
type: "button",
|
|
@@ -13246,16 +14153,16 @@ function Chat({
|
|
|
13246
14153
|
"aria-label": t("composer.quoteSelection"),
|
|
13247
14154
|
title: t("composer.quoteSelection"),
|
|
13248
14155
|
children: [
|
|
13249
|
-
/* @__PURE__ */
|
|
14156
|
+
/* @__PURE__ */ jsx48(Quote, { size: 14 }),
|
|
13250
14157
|
t("composer.quoteSelection")
|
|
13251
14158
|
]
|
|
13252
14159
|
}
|
|
13253
14160
|
)
|
|
13254
14161
|
}
|
|
13255
14162
|
),
|
|
13256
|
-
/* @__PURE__ */
|
|
13257
|
-
threadErrorMessage && /* @__PURE__ */
|
|
13258
|
-
/* @__PURE__ */
|
|
14163
|
+
/* @__PURE__ */ jsxs31("div", { className: "p-2 sticky bottom-0 z-10 bg-background", children: [
|
|
14164
|
+
threadErrorMessage && /* @__PURE__ */ jsx48("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 }),
|
|
14165
|
+
/* @__PURE__ */ jsx48(
|
|
13259
14166
|
"input",
|
|
13260
14167
|
{
|
|
13261
14168
|
ref: fileInputRef,
|
|
@@ -13266,7 +14173,7 @@ function Chat({
|
|
|
13266
14173
|
className: "hidden"
|
|
13267
14174
|
}
|
|
13268
14175
|
),
|
|
13269
|
-
attachments.length > 0 && /* @__PURE__ */
|
|
14176
|
+
attachments.length > 0 && /* @__PURE__ */ jsx48("div", { className: "mb-3 flex flex-wrap gap-2", children: attachments.map((item) => /* @__PURE__ */ jsxs31(
|
|
13270
14177
|
"div",
|
|
13271
14178
|
{
|
|
13272
14179
|
className: cn(
|
|
@@ -13274,16 +14181,16 @@ function Chat({
|
|
|
13274
14181
|
item.status === "error" ? "bg-destructive/10 border border-destructive/30" : "bg-muted"
|
|
13275
14182
|
),
|
|
13276
14183
|
children: [
|
|
13277
|
-
item.status === "uploading" && /* @__PURE__ */
|
|
13278
|
-
|
|
14184
|
+
item.status === "uploading" && /* @__PURE__ */ jsx48(
|
|
14185
|
+
Loader26,
|
|
13279
14186
|
{
|
|
13280
14187
|
size: 14,
|
|
13281
14188
|
className: "animate-spin text-muted-foreground"
|
|
13282
14189
|
}
|
|
13283
14190
|
),
|
|
13284
|
-
item.status === "success" && /* @__PURE__ */
|
|
13285
|
-
item.status === "error" && /* @__PURE__ */
|
|
13286
|
-
/* @__PURE__ */
|
|
14191
|
+
item.status === "success" && /* @__PURE__ */ jsx48(FileText3, { size: 14, className: "text-muted-foreground" }),
|
|
14192
|
+
item.status === "error" && /* @__PURE__ */ jsx48(FileText3, { size: 14, className: "text-destructive" }),
|
|
14193
|
+
/* @__PURE__ */ jsx48(
|
|
13287
14194
|
"span",
|
|
13288
14195
|
{
|
|
13289
14196
|
className: cn(
|
|
@@ -13293,17 +14200,17 @@ function Chat({
|
|
|
13293
14200
|
children: item.file.name
|
|
13294
14201
|
}
|
|
13295
14202
|
),
|
|
13296
|
-
item.status === "error" && /* @__PURE__ */
|
|
14203
|
+
item.status === "error" && /* @__PURE__ */ jsx48(
|
|
13297
14204
|
"button",
|
|
13298
14205
|
{
|
|
13299
14206
|
type: "button",
|
|
13300
14207
|
onClick: () => handleRetryUpload(item.localId),
|
|
13301
14208
|
className: "ml-1 rounded-full p-0.5 text-destructive hover:bg-destructive/20",
|
|
13302
14209
|
title: t("chat.retryUpload"),
|
|
13303
|
-
children: /* @__PURE__ */
|
|
14210
|
+
children: /* @__PURE__ */ jsx48(RefreshCw2, { size: 12 })
|
|
13304
14211
|
}
|
|
13305
14212
|
),
|
|
13306
|
-
/* @__PURE__ */
|
|
14213
|
+
/* @__PURE__ */ jsx48(
|
|
13307
14214
|
"button",
|
|
13308
14215
|
{
|
|
13309
14216
|
type: "button",
|
|
@@ -13312,14 +14219,14 @@ function Chat({
|
|
|
13312
14219
|
"ml-1 rounded-full p-0.5",
|
|
13313
14220
|
item.status === "error" ? "text-destructive hover:bg-destructive/20" : "hover:bg-muted-foreground/20"
|
|
13314
14221
|
),
|
|
13315
|
-
children: /* @__PURE__ */
|
|
14222
|
+
children: /* @__PURE__ */ jsx48(X5, { size: 12 })
|
|
13316
14223
|
}
|
|
13317
14224
|
)
|
|
13318
14225
|
]
|
|
13319
14226
|
},
|
|
13320
14227
|
item.localId
|
|
13321
14228
|
)) }),
|
|
13322
|
-
references.length > 0 && /* @__PURE__ */
|
|
14229
|
+
references.length > 0 && /* @__PURE__ */ jsx48("div", { className: "mb-3 flex flex-wrap gap-2", children: references.map((reference) => /* @__PURE__ */ jsx48(
|
|
13323
14230
|
ReferenceChip,
|
|
13324
14231
|
{
|
|
13325
14232
|
reference,
|
|
@@ -13333,16 +14240,16 @@ function Chat({
|
|
|
13333
14240
|
},
|
|
13334
14241
|
getReferenceKey(reference)
|
|
13335
14242
|
)) }),
|
|
13336
|
-
detachedRunRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */
|
|
13337
|
-
/* @__PURE__ */
|
|
13338
|
-
detachedRunRuntimeCapabilityOptions.map((option) => /* @__PURE__ */
|
|
14243
|
+
detachedRunRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ jsxs31("div", { className: "mb-2 flex flex-wrap items-center gap-2", children: [
|
|
14244
|
+
/* @__PURE__ */ jsx48("span", { className: "text-xs text-muted-foreground", children: t("composer.capabilities.runOnly") }),
|
|
14245
|
+
detachedRunRuntimeCapabilityOptions.map((option) => /* @__PURE__ */ jsxs31(
|
|
13339
14246
|
"span",
|
|
13340
14247
|
{
|
|
13341
14248
|
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",
|
|
13342
14249
|
children: [
|
|
13343
|
-
/* @__PURE__ */
|
|
13344
|
-
/* @__PURE__ */
|
|
13345
|
-
/* @__PURE__ */
|
|
14250
|
+
/* @__PURE__ */ jsx48(RuntimeCapabilityIcon, { option, variant: "chip" }),
|
|
14251
|
+
/* @__PURE__ */ jsx48("span", { className: "max-w-40 truncate", children: option.label }),
|
|
14252
|
+
/* @__PURE__ */ jsx48(
|
|
13346
14253
|
"button",
|
|
13347
14254
|
{
|
|
13348
14255
|
type: "button",
|
|
@@ -13350,7 +14257,7 @@ function Chat({
|
|
|
13350
14257
|
className: "rounded-full p-0.5 hover:bg-primary/15",
|
|
13351
14258
|
title: t("composer.capabilities.removeRunCapability"),
|
|
13352
14259
|
"aria-label": t("composer.capabilities.removeRunCapability"),
|
|
13353
|
-
children: /* @__PURE__ */
|
|
14260
|
+
children: /* @__PURE__ */ jsx48(X5, { size: 11 })
|
|
13354
14261
|
}
|
|
13355
14262
|
)
|
|
13356
14263
|
]
|
|
@@ -13358,7 +14265,7 @@ function Chat({
|
|
|
13358
14265
|
`${option.type}:${option.id}`
|
|
13359
14266
|
))
|
|
13360
14267
|
] }),
|
|
13361
|
-
/* @__PURE__ */
|
|
14268
|
+
/* @__PURE__ */ jsx48(
|
|
13362
14269
|
PendingRuntimeServices,
|
|
13363
14270
|
{
|
|
13364
14271
|
state: stream.runtimeActivities.sandboxServices,
|
|
@@ -13367,7 +14274,7 @@ function Chat({
|
|
|
13367
14274
|
className: hasPendingTodos || hasPendingFollowUps ? "mb-2" : void 0
|
|
13368
14275
|
}
|
|
13369
14276
|
),
|
|
13370
|
-
/* @__PURE__ */
|
|
14277
|
+
/* @__PURE__ */ jsx48(
|
|
13371
14278
|
PendingTodos,
|
|
13372
14279
|
{
|
|
13373
14280
|
snapshot: stream.todos,
|
|
@@ -13375,7 +14282,7 @@ function Chat({
|
|
|
13375
14282
|
className: hasPendingFollowUps ? "mb-2" : void 0
|
|
13376
14283
|
}
|
|
13377
14284
|
),
|
|
13378
|
-
/* @__PURE__ */
|
|
14285
|
+
/* @__PURE__ */ jsx48(
|
|
13379
14286
|
PendingFollowUps,
|
|
13380
14287
|
{
|
|
13381
14288
|
items: pendingFollowUps,
|
|
@@ -13390,7 +14297,7 @@ function Chat({
|
|
|
13390
14297
|
attachToComposer: true
|
|
13391
14298
|
}
|
|
13392
14299
|
),
|
|
13393
|
-
/* @__PURE__ */
|
|
14300
|
+
/* @__PURE__ */ jsx48(
|
|
13394
14301
|
RequestUserInputPanel,
|
|
13395
14302
|
{
|
|
13396
14303
|
request: stream.pendingRequestUserInput,
|
|
@@ -13399,7 +14306,7 @@ function Chat({
|
|
|
13399
14306
|
attachToComposer: true
|
|
13400
14307
|
}
|
|
13401
14308
|
),
|
|
13402
|
-
/* @__PURE__ */
|
|
14309
|
+
/* @__PURE__ */ jsx48(
|
|
13403
14310
|
HITLApprovalPanel,
|
|
13404
14311
|
{
|
|
13405
14312
|
request: stream.pendingHITLRequest,
|
|
@@ -13408,7 +14315,7 @@ function Chat({
|
|
|
13408
14315
|
attachToComposer: true
|
|
13409
14316
|
}
|
|
13410
14317
|
),
|
|
13411
|
-
runtimeCapabilityPalette && /* @__PURE__ */
|
|
14318
|
+
runtimeCapabilityPalette && /* @__PURE__ */ jsx48(
|
|
13412
14319
|
SlashPalette,
|
|
13413
14320
|
{
|
|
13414
14321
|
palette: runtimeCapabilityPalette,
|
|
@@ -13422,7 +14329,7 @@ function Chat({
|
|
|
13422
14329
|
onSelect: selectSlashPaletteOption
|
|
13423
14330
|
}
|
|
13424
14331
|
),
|
|
13425
|
-
/* @__PURE__ */
|
|
14332
|
+
/* @__PURE__ */ jsx48("form", { className: "flex items-end", onSubmit: handleSubmit, children: /* @__PURE__ */ jsxs31(
|
|
13426
14333
|
"div",
|
|
13427
14334
|
{
|
|
13428
14335
|
"data-slot": "composer-input-shell",
|
|
@@ -13436,7 +14343,7 @@ function Chat({
|
|
|
13436
14343
|
composerInputRoundedClass
|
|
13437
14344
|
),
|
|
13438
14345
|
children: [
|
|
13439
|
-
/* @__PURE__ */
|
|
14346
|
+
/* @__PURE__ */ jsx48(
|
|
13440
14347
|
"div",
|
|
13441
14348
|
{
|
|
13442
14349
|
ref: composerInputRef,
|
|
@@ -13458,7 +14365,7 @@ function Chat({
|
|
|
13458
14365
|
(missingConfig || isHistoryLoading || hasPendingInteractiveRequest) && "cursor-not-allowed opacity-50"
|
|
13459
14366
|
),
|
|
13460
14367
|
children: renderedComposerParts.map(
|
|
13461
|
-
(part, index) => part.type === "text" ? /* @__PURE__ */
|
|
14368
|
+
(part, index) => part.type === "text" ? /* @__PURE__ */ jsx48(React44.Fragment, { children: part.text }, `text-${index}`) : /* @__PURE__ */ jsxs31(
|
|
13462
14369
|
"span",
|
|
13463
14370
|
{
|
|
13464
14371
|
"data-composer-capability-key": part.key,
|
|
@@ -13467,14 +14374,14 @@ function Chat({
|
|
|
13467
14374
|
contentEditable: false,
|
|
13468
14375
|
className: "mx-0.5 inline-flex max-w-[14rem] select-none items-center gap-1 text-sm font-semibold text-primary align-baseline",
|
|
13469
14376
|
children: [
|
|
13470
|
-
/* @__PURE__ */
|
|
14377
|
+
/* @__PURE__ */ jsx48(
|
|
13471
14378
|
RuntimeCapabilityIcon,
|
|
13472
14379
|
{
|
|
13473
14380
|
option: part.capability,
|
|
13474
14381
|
variant: "chip"
|
|
13475
14382
|
}
|
|
13476
14383
|
),
|
|
13477
|
-
/* @__PURE__ */
|
|
14384
|
+
/* @__PURE__ */ jsx48("span", { className: "truncate", children: part.capability.label })
|
|
13478
14385
|
]
|
|
13479
14386
|
},
|
|
13480
14387
|
part.key
|
|
@@ -13483,14 +14390,14 @@ function Chat({
|
|
|
13483
14390
|
},
|
|
13484
14391
|
composerDomVersion
|
|
13485
14392
|
),
|
|
13486
|
-
/* @__PURE__ */
|
|
14393
|
+
/* @__PURE__ */ jsxs31(
|
|
13487
14394
|
"div",
|
|
13488
14395
|
{
|
|
13489
14396
|
"data-slot": "composer-action-bar",
|
|
13490
14397
|
className: "pointer-events-none absolute inset-x-1.5 bottom-1 flex min-h-10 items-center justify-between gap-2",
|
|
13491
14398
|
children: [
|
|
13492
|
-
/* @__PURE__ */
|
|
13493
|
-
/* @__PURE__ */
|
|
14399
|
+
/* @__PURE__ */ jsxs31("div", { className: "pointer-events-none flex min-w-0 flex-1 items-center gap-1.5", children: [
|
|
14400
|
+
/* @__PURE__ */ jsx48("div", { className: "pointer-events-auto flex shrink-0 items-center gap-1.5", children: /* @__PURE__ */ jsx48(
|
|
13494
14401
|
ComposerMenu,
|
|
13495
14402
|
{
|
|
13496
14403
|
composer,
|
|
@@ -13505,20 +14412,20 @@ function Chat({
|
|
|
13505
14412
|
disabled: missingConfig || isHistoryLoading || hasPendingInteractiveRequest
|
|
13506
14413
|
}
|
|
13507
14414
|
) }),
|
|
13508
|
-
selectedTool && /* @__PURE__ */
|
|
13509
|
-
/* @__PURE__ */
|
|
13510
|
-
/* @__PURE__ */
|
|
14415
|
+
selectedTool && /* @__PURE__ */ jsxs31("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: [
|
|
14416
|
+
/* @__PURE__ */ jsx48("span", { className: "truncate", children: selectedTool.shortLabel ?? selectedTool.label }),
|
|
14417
|
+
/* @__PURE__ */ jsx48(
|
|
13511
14418
|
"button",
|
|
13512
14419
|
{
|
|
13513
14420
|
type: "button",
|
|
13514
14421
|
onClick: () => setSelectedTool(null),
|
|
13515
14422
|
className: "shrink-0 rounded-full p-0.5 text-primary/70 hover:bg-primary/10 hover:text-primary",
|
|
13516
|
-
children: /* @__PURE__ */
|
|
14423
|
+
children: /* @__PURE__ */ jsx48(X5, { size: 12 })
|
|
13517
14424
|
}
|
|
13518
14425
|
)
|
|
13519
14426
|
] })
|
|
13520
14427
|
] }),
|
|
13521
|
-
/* @__PURE__ */
|
|
14428
|
+
/* @__PURE__ */ jsx48("div", { className: "pointer-events-auto shrink-0", children: /* @__PURE__ */ jsx48(
|
|
13522
14429
|
SendButton,
|
|
13523
14430
|
{
|
|
13524
14431
|
disabled: isSendDisabled,
|
|
@@ -13545,7 +14452,7 @@ function Chat({
|
|
|
13545
14452
|
]
|
|
13546
14453
|
}
|
|
13547
14454
|
) }),
|
|
13548
|
-
disclaimer?.text && /* @__PURE__ */
|
|
14455
|
+
disclaimer?.text && /* @__PURE__ */ jsx48(
|
|
13549
14456
|
"p",
|
|
13550
14457
|
{
|
|
13551
14458
|
className: cn(
|
|
@@ -13555,12 +14462,12 @@ function Chat({
|
|
|
13555
14462
|
children: disclaimer.text
|
|
13556
14463
|
}
|
|
13557
14464
|
),
|
|
13558
|
-
/* @__PURE__ */
|
|
13559
|
-
/* @__PURE__ */
|
|
13560
|
-
/* @__PURE__ */
|
|
14465
|
+
/* @__PURE__ */ jsxs31("div", { className: "mt-2 flex items-center justify-center gap-2 text-xs text-muted-foreground", children: [
|
|
14466
|
+
/* @__PURE__ */ jsx48("span", { children: t("chat.poweredBy") }),
|
|
14467
|
+
/* @__PURE__ */ jsx48(ContextUsageIndicator, { className: "absolute right-4" })
|
|
13561
14468
|
] })
|
|
13562
14469
|
] }),
|
|
13563
|
-
/* @__PURE__ */
|
|
14470
|
+
/* @__PURE__ */ jsx48(
|
|
13564
14471
|
SettingsSheet,
|
|
13565
14472
|
{
|
|
13566
14473
|
open: petSettingsOpen,
|
|
@@ -13570,17 +14477,17 @@ function Chat({
|
|
|
13570
14477
|
onSave: savePetLocalSettings
|
|
13571
14478
|
}
|
|
13572
14479
|
),
|
|
13573
|
-
/* @__PURE__ */
|
|
14480
|
+
/* @__PURE__ */ jsx48(PetBridge, { pet: effectivePet, state: petAutoState })
|
|
13574
14481
|
]
|
|
13575
14482
|
}
|
|
13576
14483
|
);
|
|
13577
14484
|
}
|
|
13578
14485
|
|
|
13579
14486
|
// src/components/ui/separator.tsx
|
|
13580
|
-
import * as
|
|
13581
|
-
import { jsx as
|
|
13582
|
-
var Separator =
|
|
13583
|
-
({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */
|
|
14487
|
+
import * as React45 from "react";
|
|
14488
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
14489
|
+
var Separator = React45.forwardRef(
|
|
14490
|
+
({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */ jsx49(
|
|
13584
14491
|
"div",
|
|
13585
14492
|
{
|
|
13586
14493
|
ref,
|