@xpert-ai/chatkit-ui 0.3.7 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/assets/{_baseUniq-DgbE-Zpp.js → _baseUniq-zJf1BKo2.js} +1 -1
- package/dist/app/assets/{abap-B0ywZp7w.js → abap-Cu1EkeUh.js} +1 -1
- package/dist/app/assets/{abnf-vKucRloH.js → abnf-CqAS5kWV.js} +1 -1
- package/dist/app/assets/{actionscript-CvpjcrZC.js → actionscript-Nbsf22Ov.js} +1 -1
- package/dist/app/assets/{ada-DV5KTTo4.js → ada-C1imLgfX.js} +1 -1
- package/dist/app/assets/{agda-BTTYVnbo.js → agda-Hj3EJXKu.js} +1 -1
- package/dist/app/assets/{al-u-oZSiBm.js → al-s-V4qjCK.js} +1 -1
- package/dist/app/assets/{antlr4-CY1PBdPM.js → antlr4-BX7TjEsM.js} +1 -1
- package/dist/app/assets/{apacheconf-CIk6CfdC.js → apacheconf-BV4I00_T.js} +1 -1
- package/dist/app/assets/{apex-BdhgEWXC.js → apex-ENPSWKzR.js} +1 -1
- package/dist/app/assets/{apl-Mv4j7Tlu.js → apl-D-jUGzMj.js} +1 -1
- package/dist/app/assets/{applescript-BnoQn48O.js → applescript-D-0dnXQK.js} +1 -1
- package/dist/app/assets/{aql-Do8Nhg8p.js → aql-BWNy8GP9.js} +1 -1
- package/dist/app/assets/{arc-edZU_NW2.js → arc-MRAhurHy.js} +1 -1
- package/dist/app/assets/{architectureDiagram-Q4EWVU46-Dtt89Y19.js → architectureDiagram-Q4EWVU46-0FQ4f47B.js} +1 -1
- package/dist/app/assets/{arduino-C48-q0UX.js → arduino-CNo6VmKi.js} +1 -1
- package/dist/app/assets/{arff-CvXAFvRm.js → arff-DoHakQ8l.js} +1 -1
- package/dist/app/assets/{asciidoc-CA--68DS.js → asciidoc-CID4pu1O.js} +1 -1
- package/dist/app/assets/{asm6502-BcBLxpHN.js → asm6502-DhP-yvtv.js} +1 -1
- package/dist/app/assets/{asmatmel-CDMg3LIG.js → asmatmel-08PvVU6w.js} +1 -1
- package/dist/app/assets/{aspnet-BzZAtk5n.js → aspnet-C3KzaEhl.js} +1 -1
- package/dist/app/assets/{autohotkey-C8WkQEjI.js → autohotkey-YMH9Ryj9.js} +1 -1
- package/dist/app/assets/{autoit-D5_mrv5m.js → autoit-Cu6bIE1N.js} +1 -1
- package/dist/app/assets/{avisynth-Dh_xask5.js → avisynth-Qbs8YrYL.js} +1 -1
- package/dist/app/assets/{avro-idl-AEaYO6yK.js → avro-idl-CaKenPK5.js} +1 -1
- package/dist/app/assets/{bash-RlP16Xm5.js → bash-vbYUf6n8.js} +1 -1
- package/dist/app/assets/{basic-Xn_eY79M.js → basic-BfXRs4VW.js} +1 -1
- package/dist/app/assets/{batch-B_zss_9m.js → batch-EE0zGUec.js} +1 -1
- package/dist/app/assets/{bbcode-D5qIIsoM.js → bbcode-oURfVSu_.js} +1 -1
- package/dist/app/assets/{bicep-DFAY7lin.js → bicep-C_YEwqCC.js} +1 -1
- package/dist/app/assets/{birb-DZZhpbmW.js → birb-BMXrMSFJ.js} +1 -1
- package/dist/app/assets/{bison-B-dGF85b.js → bison-B3ZshxCf.js} +1 -1
- package/dist/app/assets/{blockDiagram-DXYQGD6D-oXU3wiI6.js → blockDiagram-DXYQGD6D-C97eDLIt.js} +1 -1
- package/dist/app/assets/{bnf-6CRAamZR.js → bnf-CGucWzUq.js} +1 -1
- package/dist/app/assets/{brainfuck-CexdbLJh.js → brainfuck-CRashDtN.js} +1 -1
- package/dist/app/assets/{brightscript-CaxTO5da.js → brightscript-DRXXdYYA.js} +1 -1
- package/dist/app/assets/{bro-BRI4lLX7.js → bro-y2jQJy1k.js} +1 -1
- package/dist/app/assets/{bsl-QOrG17u7.js → bsl-Bd7aNBvB.js} +1 -1
- package/dist/app/assets/{c-D3L-REE8.js → c-GdiRPwSp.js} +1 -1
- package/dist/app/assets/{c4Diagram-AHTNJAMY-zIBgyFbC.js → c4Diagram-AHTNJAMY-B1vGfQnc.js} +1 -1
- package/dist/app/assets/{cfscript-CgDikVyK.js → cfscript-Bk6ptVZ7.js} +1 -1
- package/dist/app/assets/{chaiscript-BPTekNbB.js → chaiscript-DVbDikdY.js} +1 -1
- package/dist/app/assets/channel-B8rTNXaE.js +1 -0
- package/dist/app/assets/{chunk-4BX2VUAB-C8q0nzRo.js → chunk-4BX2VUAB-aOlX8Tsl.js} +1 -1
- package/dist/app/assets/{chunk-4TB4RGXK-C8eclN6u.js → chunk-4TB4RGXK-Cct6HmQ2.js} +1 -1
- package/dist/app/assets/{chunk-55IACEB6-CC_AZKq2.js → chunk-55IACEB6--c2hOnxs.js} +1 -1
- package/dist/app/assets/{chunk-EDXVE4YY-BKhbC1sp.js → chunk-EDXVE4YY-BdLtGCVI.js} +1 -1
- package/dist/app/assets/{chunk-FMBD7UC4-BuH_t_j-.js → chunk-FMBD7UC4-yA5L8QIq.js} +1 -1
- package/dist/app/assets/{chunk-OYMX7WX6-DRM_T71-.js → chunk-OYMX7WX6-CyCG-0_T.js} +1 -1
- package/dist/app/assets/{chunk-QZHKN3VN-BiziHb7K.js → chunk-QZHKN3VN-tUWDkfpT.js} +1 -1
- package/dist/app/assets/{chunk-YZCP3GAM-ns5Vk1f0.js → chunk-YZCP3GAM-JrANxk3g.js} +1 -1
- package/dist/app/assets/{cil-CQ1VUn3A.js → cil-CWcIBeyN.js} +1 -1
- package/dist/app/assets/classDiagram-6PBFFD2Q-Bzz5eezS.js +1 -0
- package/dist/app/assets/classDiagram-v2-HSJHXN6E-Bzz5eezS.js +1 -0
- package/dist/app/assets/{clike-Bk_7iChK.js → clike-BDDDUpjh.js} +1 -1
- package/dist/app/assets/{clojure-oh6_RnlA.js → clojure-B18OSjNd.js} +1 -1
- package/dist/app/assets/clone-CebL2qD9.js +1 -0
- package/dist/app/assets/{cmake-ySS0jC1Y.js → cmake-CE-5PhKC.js} +1 -1
- package/dist/app/assets/{cobol-iXcezfTy.js → cobol-e4-CuEUG.js} +1 -1
- package/dist/app/assets/{coffeescript-BUy0IOTJ.js → coffeescript-DMB3o73k.js} +1 -1
- package/dist/app/assets/{concurnas-By_kYzwm.js → concurnas-B-zQJRS2.js} +1 -1
- package/dist/app/assets/{coq-DZiJnQYk.js → coq-BYIXlV_y.js} +1 -1
- package/dist/app/assets/{core-BjYqaHIK.js → core-Ca6h4DfX.js} +1 -1
- package/dist/app/assets/{cose-bilkent-S5V4N54A-DRg86qAz.js → cose-bilkent-S5V4N54A-CxrdGCeV.js} +1 -1
- package/dist/app/assets/{cpp-fVJetTCh.js → cpp-BjZ4f5Y0.js} +1 -1
- package/dist/app/assets/{crystal-Dqa1FSjq.js → crystal-tS-wFJVJ.js} +1 -1
- package/dist/app/assets/{csharp-BEpd8Bfz.js → csharp-JABcNerk.js} +1 -1
- package/dist/app/assets/{cshtml-cleS7x9a.js → cshtml-5eaazXZG.js} +1 -1
- package/dist/app/assets/{csp-DJNuAuVo.js → csp-iC5C2J_s.js} +1 -1
- package/dist/app/assets/{css-laKMA7ps.js → css-SH10_CNe.js} +1 -1
- package/dist/app/assets/{css-extras-DqcDnxi2.js → css-extras-p80Zq4YI.js} +1 -1
- package/dist/app/assets/{csv-CcsGtqB7.js → csv-CpJu4Q0I.js} +1 -1
- package/dist/app/assets/{cypher-tCYaF_sw.js → cypher-DssxnB4c.js} +1 -1
- package/dist/app/assets/{d-ZjP-D4jP.js → d-BMsuQGcX.js} +1 -1
- package/dist/app/assets/{dagre-KV5264BT-BMg6cnfG.js → dagre-KV5264BT-CuyZNdL-.js} +1 -1
- package/dist/app/assets/{dart-aEIC0xv8.js → dart-DoGPpSU5.js} +1 -1
- package/dist/app/assets/{dataweave-CM7DNyRc.js → dataweave-k7gDL0hD.js} +1 -1
- package/dist/app/assets/{dax-D-1tRMAS.js → dax-N-vG7fJN.js} +1 -1
- package/dist/app/assets/{dhall-B4G6sh_3.js → dhall-BVC_l7R6.js} +1 -1
- package/dist/app/assets/{diagram-5BDNPKRD-BGIhlwaI.js → diagram-5BDNPKRD-TL2Nl6Pu.js} +1 -1
- package/dist/app/assets/{diagram-G4DWMVQ6-CqKLelet.js → diagram-G4DWMVQ6-BMsfmMXA.js} +1 -1
- package/dist/app/assets/{diagram-MMDJMWI5-2IpGHxI2.js → diagram-MMDJMWI5-BfNwEPAz.js} +1 -1
- package/dist/app/assets/{diagram-TYMM5635-_HRiSNgh.js → diagram-TYMM5635-Bh65Up_l.js} +1 -1
- package/dist/app/assets/{diff-CAWzHumm.js → diff-Dq-Wl_rl.js} +1 -1
- package/dist/app/assets/{django-BLlxHysq.js → django-nqkF6SVu.js} +1 -1
- package/dist/app/assets/{dns-zone-file-Bu1BFi4x.js → dns-zone-file--EtUIqUz.js} +1 -1
- package/dist/app/assets/{docker-DQtdSM6w.js → docker-CWieq5E6.js} +1 -1
- package/dist/app/assets/{dot-M_8dtQ-J.js → dot-BHVG56Qh.js} +1 -1
- package/dist/app/assets/{ebnf-Bqjz4X_l.js → ebnf-BOYTxY8t.js} +1 -1
- package/dist/app/assets/{editorconfig-H1gZsYaD.js → editorconfig-DO8bfY96.js} +1 -1
- package/dist/app/assets/{eiffel-jToyfE3K.js → eiffel-BDvcUlCo.js} +1 -1
- package/dist/app/assets/{ejs-Xg8x_yq-.js → ejs-CRonzdyL.js} +1 -1
- package/dist/app/assets/{elixir-BG9SfjVk.js → elixir-JLXxG3mm.js} +1 -1
- package/dist/app/assets/{elm-7rvkjNwn.js → elm-DdvIr0Kw.js} +1 -1
- package/dist/app/assets/{erDiagram-SMLLAGMA-CwJ0JEfE.js → erDiagram-SMLLAGMA-DK9nnYy4.js} +1 -1
- package/dist/app/assets/{erb-CipiWC9j.js → erb-BlWxg5di.js} +1 -1
- package/dist/app/assets/{erlang-DyGWgpYG.js → erlang-Dr8ifve2.js} +1 -1
- package/dist/app/assets/{etlua-Ct6VkCC4.js → etlua-BOGzUF6g.js} +1 -1
- package/dist/app/assets/{excel-formula-CY9oxCkI.js → excel-formula-D8pzu8qZ.js} +1 -1
- package/dist/app/assets/{factor-DBGcEQMr.js → factor-CJlai45M.js} +1 -1
- package/dist/app/assets/{false-D7Yj-SPJ.js → false-0MKeXzIN.js} +1 -1
- package/dist/app/assets/{firestore-security-rules-BKeRzWep.js → firestore-security-rules-Chvt90vZ.js} +1 -1
- package/dist/app/assets/{flow-BUWiIzEU.js → flow-q16-31H5.js} +1 -1
- package/dist/app/assets/{flowDiagram-DWJPFMVM-C3YhD-oq.js → flowDiagram-DWJPFMVM-COgy_gHI.js} +1 -1
- package/dist/app/assets/{fortran-Bj52YXe0.js → fortran-DH6vymC-.js} +1 -1
- package/dist/app/assets/{fsharp-DmCVgmnH.js → fsharp-RoYDjp48.js} +1 -1
- package/dist/app/assets/{ftl-Cbmvxbh6.js → ftl-D1gLmJ7k.js} +1 -1
- package/dist/app/assets/{ganttDiagram-T4ZO3ILL-D9xW5yhh.js → ganttDiagram-T4ZO3ILL-BtrKdHBv.js} +1 -1
- package/dist/app/assets/{gap-D23ZRtRz.js → gap-CoePkKFo.js} +1 -1
- package/dist/app/assets/{gcode-D5-N3nr_.js → gcode-BJFvmkRd.js} +1 -1
- package/dist/app/assets/{gdscript-DWERnX-a.js → gdscript-BLnH9xef.js} +1 -1
- package/dist/app/assets/{gedcom-Ck_Ym3Q2.js → gedcom-Cb1W1HPn.js} +1 -1
- package/dist/app/assets/{gherkin-BksiIjs-.js → gherkin-DR_tGOrT.js} +1 -1
- package/dist/app/assets/{git-CO1eb-gL.js → git-BVcDXb4a.js} +1 -1
- package/dist/app/assets/{gitGraphDiagram-UUTBAWPF-DZLT8zDA.js → gitGraphDiagram-UUTBAWPF-CAHcfSwl.js} +1 -1
- package/dist/app/assets/{glsl-CN-vqwC_.js → glsl-DnYRu7LE.js} +1 -1
- package/dist/app/assets/{gml-J5W8Y4yz.js → gml-B2_ego1R.js} +1 -1
- package/dist/app/assets/{gn-D7Pv9idR.js → gn-CRiBhhko.js} +1 -1
- package/dist/app/assets/{go-6Lw_nSyb.js → go-B7dO2ylQ.js} +1 -1
- package/dist/app/assets/{go-module-BCe-jjCg.js → go-module-CeZJSofs.js} +1 -1
- package/dist/app/assets/{graph-BhsGz6M4.js → graph-eZYVWD6P.js} +1 -1
- package/dist/app/assets/{graphql-4_hbbnNw.js → graphql-Unukc8fz.js} +1 -1
- package/dist/app/assets/{groovy-BZvyCoNS.js → groovy-B44blE34.js} +1 -1
- package/dist/app/assets/{haml-MpET2CYX.js → haml-DdCY1uYA.js} +1 -1
- package/dist/app/assets/{handlebars-CMygNMyQ.js → handlebars-JUEPhE3e.js} +1 -1
- package/dist/app/assets/{haskell-H9hWCrb6.js → haskell-9PM4bYLP.js} +1 -1
- package/dist/app/assets/{haxe-DynXLs0c.js → haxe-Df4FLr0i.js} +1 -1
- package/dist/app/assets/{hcl-DU8hXUXo.js → hcl-BDlRjAUR.js} +1 -1
- package/dist/app/assets/{hlsl-BGurDJ01.js → hlsl-D_po1e1Z.js} +1 -1
- package/dist/app/assets/{hoon-Od_h6WWn.js → hoon-BMh5gCjg.js} +1 -1
- package/dist/app/assets/{hpkp-CnNmkfHz.js → hpkp-DoCB_sk7.js} +1 -1
- package/dist/app/assets/{hsts-DJA5z9FY.js → hsts-DESjcvH0.js} +1 -1
- package/dist/app/assets/{http-C2OpZukU.js → http-DFy_Xl8u.js} +1 -1
- package/dist/app/assets/{ichigojam-CrG2EGSI.js → ichigojam-CiZij_ux.js} +1 -1
- package/dist/app/assets/{icon-cOzaCn0m.js → icon-BmVRXwZJ.js} +1 -1
- package/dist/app/assets/{icu-message-format-DDXTMDH-.js → icu-message-format-CwQPjmeS.js} +1 -1
- package/dist/app/assets/{idris-CFY7Fru9.js → idris-COR7TtKH.js} +1 -1
- package/dist/app/assets/{iecst-DxqDXmAZ.js → iecst-CssklREm.js} +1 -1
- package/dist/app/assets/{ignore-50gVavjI.js → ignore-DDGdM2i4.js} +1 -1
- package/dist/app/assets/index-CYldSx7G.css +1 -0
- package/dist/app/assets/{index-3vHiuCMV.js → index-Dyt4Ufb6.js} +129 -129
- package/dist/app/assets/{infoDiagram-42DDH7IO-BhZutCsZ.js → infoDiagram-42DDH7IO-C-oJinvl.js} +1 -1
- package/dist/app/assets/{inform7-CwMWEErA.js → inform7-BFRimPpU.js} +1 -1
- package/dist/app/assets/{ini-Cj0QsVUh.js → ini-Dhu8SOFl.js} +1 -1
- package/dist/app/assets/{io-CaTOfNpm.js → io-DYIw1lw-.js} +1 -1
- package/dist/app/assets/{ishikawaDiagram-UXIWVN3A-JJt8O0hb.js → ishikawaDiagram-UXIWVN3A-Bb1xxiKo.js} +1 -1
- package/dist/app/assets/{j-B9yG1_XZ.js → j-5lxhiNkU.js} +1 -1
- package/dist/app/assets/{java-CcqZsJHc.js → java-Cupob46S.js} +1 -1
- package/dist/app/assets/{javadoc-BdkFH1qi.js → javadoc-Coc5O5uw.js} +1 -1
- package/dist/app/assets/{javadoclike-BBDtbsNc.js → javadoclike-BxklgpQx.js} +1 -1
- package/dist/app/assets/{javascript-0ZJ71oW2.js → javascript-spspNCkm.js} +1 -1
- package/dist/app/assets/{javastacktrace-yNjh86GL.js → javastacktrace-BzQLrZi6.js} +1 -1
- package/dist/app/assets/{jexl-BwLpMn8D.js → jexl-DEKgdIyE.js} +1 -1
- package/dist/app/assets/{jolie-BiDUXy8i.js → jolie-QTrQutYN.js} +1 -1
- package/dist/app/assets/{journeyDiagram-VCZTEJTY-BkVWz3Vf.js → journeyDiagram-VCZTEJTY-DMIzXS62.js} +1 -1
- package/dist/app/assets/{jq-CCJ3EBtV.js → jq-HVEhlQfN.js} +1 -1
- package/dist/app/assets/{js-extras-Ck7OEXSL.js → js-extras-NGcAmwqF.js} +1 -1
- package/dist/app/assets/{js-templates-DjSt7lxm.js → js-templates-BdbvU5YD.js} +1 -1
- package/dist/app/assets/{jsdoc-BcTgtGoR.js → jsdoc-D98n9NCT.js} +1 -1
- package/dist/app/assets/{json-tB4iX3yE.js → json-1D-NO0VF.js} +1 -1
- package/dist/app/assets/{json5-JIq4apAt.js → json5-Dh1CdNvD.js} +1 -1
- package/dist/app/assets/{jsonp-DKXtWLpG.js → jsonp-BtDJZ2Mb.js} +1 -1
- package/dist/app/assets/{jsstacktrace-4bYPPqLT.js → jsstacktrace-DkE3SZv7.js} +1 -1
- package/dist/app/assets/{jsx-BgQQp2PC.js → jsx-BT58cyQW.js} +1 -1
- package/dist/app/assets/{julia-Dv7hfdzo.js → julia-D3Js5Hgq.js} +1 -1
- package/dist/app/assets/{kanban-definition-6JOO6SKY-CWuWLs3K.js → kanban-definition-6JOO6SKY-BcNXZ6Vr.js} +1 -1
- package/dist/app/assets/{keepalived-C0mYwr0z.js → keepalived-C6I_Mg7r.js} +1 -1
- package/dist/app/assets/{keyman-BKpH4p1R.js → keyman-D79f0cKj.js} +1 -1
- package/dist/app/assets/{kotlin-mOfhxbOx.js → kotlin-no80mpWM.js} +1 -1
- package/dist/app/assets/{kumir-C6zx-0Ca.js → kumir-CUsULg8c.js} +1 -1
- package/dist/app/assets/{kusto-hO54CA70.js → kusto-C89Mk7tC.js} +1 -1
- package/dist/app/assets/{latex-Dzk8WiHu.js → latex-B1GrtcXz.js} +1 -1
- package/dist/app/assets/{latte-b3QfOSp4.js → latte-DKsxQqtd.js} +1 -1
- package/dist/app/assets/{layout-DBe88OgK.js → layout-FP0BP6AJ.js} +1 -1
- package/dist/app/assets/{less-B4kl6C6H.js → less-Ck3CCze6.js} +1 -1
- package/dist/app/assets/{lilypond-kwN07IjR.js → lilypond-Dvcoj5IH.js} +1 -1
- package/dist/app/assets/{linear-DFqpmono.js → linear-0F3ksWhc.js} +1 -1
- package/dist/app/assets/{liquid-CMRtVaic.js → liquid-Dtelxs9T.js} +1 -1
- package/dist/app/assets/{lisp-D12Kpj2D.js → lisp-CN9bAHD6.js} +1 -1
- package/dist/app/assets/{livescript-CB8ITmGz.js → livescript-_a8eCHSn.js} +1 -1
- package/dist/app/assets/{llvm-DBTCiFwL.js → llvm-BcDhUOfQ.js} +1 -1
- package/dist/app/assets/{log-BR6SSFh9.js → log-DEmQzTVt.js} +1 -1
- package/dist/app/assets/{lolcode-BuzAaCM6.js → lolcode-Cbxd_Lat.js} +1 -1
- package/dist/app/assets/{lua-Ci_ub2Kx.js → lua-C7PRqwyU.js} +1 -1
- package/dist/app/assets/{magma-DqKac23z.js → magma-DYhSc7gy.js} +1 -1
- package/dist/app/assets/{makefile-ClFyCfh0.js → makefile-CIYTyv-_.js} +1 -1
- package/dist/app/assets/{markdown-CJP4BvY0.js → markdown-CUW8Bmu0.js} +1 -1
- package/dist/app/assets/{markup-BqBuEoCj.js → markup-DqCt2Fw1.js} +1 -1
- package/dist/app/assets/{markup-templating-gWox0fgS.js → markup-templating-Dkhpub0K.js} +1 -1
- package/dist/app/assets/{matlab-D8fITaV4.js → matlab-CLdOvMwl.js} +1 -1
- package/dist/app/assets/{maxscript-BONF8rMy.js → maxscript-C-ai6J5K.js} +1 -1
- package/dist/app/assets/{mel-C055oCEm.js → mel-BkZHjRGV.js} +1 -1
- package/dist/app/assets/{mermaid-CJgXcURP.js → mermaid-BvP_XD9I.js} +1 -1
- package/dist/app/assets/{min-C4k7eVH-.js → min-DDsiHe4M.js} +1 -1
- package/dist/app/assets/{mindmap-definition-QFDTVHPH-D5WLdtFz.js → mindmap-definition-QFDTVHPH-DDcs253m.js} +1 -1
- package/dist/app/assets/{mizar-DfBcXuj4.js → mizar-CqM7QHDl.js} +1 -1
- package/dist/app/assets/{mongodb-BBCH2cAI.js → mongodb-KIcxFPEF.js} +1 -1
- package/dist/app/assets/{monkey-5xytVR9c.js → monkey-BQRy0JSe.js} +1 -1
- package/dist/app/assets/{moonscript-DTD_dUoG.js → moonscript-BuA2Ki-R.js} +1 -1
- package/dist/app/assets/{n1ql-CKMBpvrf.js → n1ql-DKlLH4ON.js} +1 -1
- package/dist/app/assets/{n4js-BLOx_BAB.js → n4js-DeW0Oyxu.js} +1 -1
- package/dist/app/assets/{nand2tetris-hdl-B-nkUk0U.js → nand2tetris-hdl-Dvb6ZB4S.js} +1 -1
- package/dist/app/assets/{naniscript-DFNNmSZZ.js → naniscript-C7b7oIUs.js} +1 -1
- package/dist/app/assets/{nasm-Bp0N-krf.js → nasm-D3L2SzF4.js} +1 -1
- package/dist/app/assets/{neon-CdOV9D5g.js → neon-Cezgf87Z.js} +1 -1
- package/dist/app/assets/{nevod-BKMLRWeT.js → nevod-jWaksWLJ.js} +1 -1
- package/dist/app/assets/{nginx-C53g3llS.js → nginx-OtlcHMqB.js} +1 -1
- package/dist/app/assets/{nim--ucdlwkH.js → nim-CK5ozk2o.js} +1 -1
- package/dist/app/assets/{nix-2nB75Hnm.js → nix-kew2nHCz.js} +1 -1
- package/dist/app/assets/{nsis-Cg1me2qV.js → nsis-nR7oX-gB.js} +1 -1
- package/dist/app/assets/{objectivec-HgsJzBVJ.js → objectivec-BMNOr9Tr.js} +1 -1
- package/dist/app/assets/{ocaml-B_DzHMGS.js → ocaml-BSvaKj3e.js} +1 -1
- package/dist/app/assets/{opencl-DBy2C90-.js → opencl-BMEmGl0_.js} +1 -1
- package/dist/app/assets/{openqasm-kR3M1YBJ.js → openqasm-B374tvk5.js} +1 -1
- package/dist/app/assets/{oz-CsEQzF2k.js → oz-C3lpNl9d.js} +1 -1
- package/dist/app/assets/{parigp-C2gYP3BM.js → parigp-CgXf8xa2.js} +1 -1
- package/dist/app/assets/{parser-D7agmsnU.js → parser-CcPMowgW.js} +1 -1
- package/dist/app/assets/{pascal-Dk8h_JiR.js → pascal-BByqQTlw.js} +1 -1
- package/dist/app/assets/{pascaligo-DXayKpW1.js → pascaligo-BbXiOknW.js} +1 -1
- package/dist/app/assets/{pcaxis-BbHDn4xw.js → pcaxis-Be47C9OK.js} +1 -1
- package/dist/app/assets/{peoplecode-DgWHb3qM.js → peoplecode-CxvjBVSh.js} +1 -1
- package/dist/app/assets/{perl-BCQmJW3u.js → perl-CtpqiEjU.js} +1 -1
- package/dist/app/assets/{php-Z7u6UBSf.js → php-Dyamm2pr.js} +1 -1
- package/dist/app/assets/{php-extras-Bbf1PJiM.js → php-extras-7Nx5rVLl.js} +1 -1
- package/dist/app/assets/{phpdoc-BUdOOavZ.js → phpdoc-Bsjg7VKs.js} +1 -1
- package/dist/app/assets/{pieDiagram-DEJITSTG-Bk_gHD7q.js → pieDiagram-DEJITSTG-BiXtBqki.js} +1 -1
- package/dist/app/assets/{plsql-KN64tq9c.js → plsql-eZypyTGh.js} +1 -1
- package/dist/app/assets/{powerquery-DL49etLI.js → powerquery-Buf8bIo-.js} +1 -1
- package/dist/app/assets/{powershell-jryB4gBu.js → powershell-K3XGDztR.js} +1 -1
- package/dist/app/assets/{processing-D-nRflir.js → processing-BhQB59Bp.js} +1 -1
- package/dist/app/assets/{prolog-J9p2Dtp3.js → prolog-BIyNttGM.js} +1 -1
- package/dist/app/assets/{promql-Bt3PTIs-.js → promql-DDITNP3r.js} +1 -1
- package/dist/app/assets/{properties-DOzUf5m_.js → properties-DJl0ewQ_.js} +1 -1
- package/dist/app/assets/{protobuf-CulfNgOj.js → protobuf-CYx2y8Fr.js} +1 -1
- package/dist/app/assets/{psl-UT93PnFk.js → psl-B2mJawCU.js} +1 -1
- package/dist/app/assets/{pug-Ckrp6b5P.js → pug-CYZsdEU7.js} +1 -1
- package/dist/app/assets/{puppet-wUZgXx_p.js → puppet-CWwXOX6e.js} +1 -1
- package/dist/app/assets/{pure-CNGrkBhJ.js → pure-B-Fff_Aq.js} +1 -1
- package/dist/app/assets/{purebasic-CwWLgK7e.js → purebasic-PfUC-hAA.js} +1 -1
- package/dist/app/assets/{purescript-BRm-R-3v.js → purescript-CqqQFpaW.js} +1 -1
- package/dist/app/assets/{q-wRiaQZTW.js → q-DR4346wr.js} +1 -1
- package/dist/app/assets/{qml-hZdBAFTK.js → qml-VgW_Ugpd.js} +1 -1
- package/dist/app/assets/{qore-Cye0wnFE.js → qore-CHsGRbXU.js} +1 -1
- package/dist/app/assets/{qsharp-DufTxaMQ.js → qsharp-Du544C4-.js} +1 -1
- package/dist/app/assets/{quadrantDiagram-34T5L4WZ-BSbm0wBP.js → quadrantDiagram-34T5L4WZ-DDIHe9Cb.js} +1 -1
- package/dist/app/assets/{r-JhyQLVqm.js → r-B2KuBHD-.js} +1 -1
- package/dist/app/assets/{racket-CcEcl1lQ.js → racket-CgObu2Yj.js} +1 -1
- package/dist/app/assets/{reason-WFsaqaXn.js → reason-BdXTE0Xv.js} +1 -1
- package/dist/app/assets/{regex-Cj5qFUZM.js → regex-BFecarun.js} +1 -1
- package/dist/app/assets/{rego-CfoDWHPw.js → rego-NdYgWh_R.js} +1 -1
- package/dist/app/assets/{renpy-D3lRim5H.js → renpy-B0jJSpyT.js} +1 -1
- package/dist/app/assets/{requirementDiagram-MS252O5E-BNs2nP8U.js → requirementDiagram-MS252O5E-Bel4OeHd.js} +1 -1
- package/dist/app/assets/{rest-DktyegXU.js → rest-BHKz74x2.js} +1 -1
- package/dist/app/assets/{rip-D0VY5apf.js → rip-D8-iQw5t.js} +1 -1
- package/dist/app/assets/{roboconf-y6-jDOpj.js → roboconf-CuDVEUns.js} +1 -1
- package/dist/app/assets/{robotframework-CC00uJgj.js → robotframework-DPvo9dvH.js} +1 -1
- package/dist/app/assets/{ruby-dAbspD_k.js → ruby-ahKLYmR2.js} +1 -1
- package/dist/app/assets/{rust-7wWC8B4O.js → rust-w2HNKEVP.js} +1 -1
- package/dist/app/assets/{sankeyDiagram-XADWPNL6-CvpH_gH5.js → sankeyDiagram-XADWPNL6-CPOJWDoW.js} +1 -1
- package/dist/app/assets/{sas-BMwqJCyV.js → sas-BckZnWwO.js} +1 -1
- package/dist/app/assets/{sass-Deo2TBca.js → sass-K9vXz_J2.js} +1 -1
- package/dist/app/assets/{scala-CDQ_Q6w1.js → scala-D8UBcMe3.js} +1 -1
- package/dist/app/assets/{scheme-Dnvc5SgS.js → scheme-EVCCBHHE.js} +1 -1
- package/dist/app/assets/{scss-CQnjZBSP.js → scss-lgF12twN.js} +1 -1
- package/dist/app/assets/{sequenceDiagram-FGHM5R23-CbfExnPM.js → sequenceDiagram-FGHM5R23-BEigv2pO.js} +1 -1
- package/dist/app/assets/{shell-session-CUzpt9u_.js → shell-session-CEXGpqDh.js} +1 -1
- package/dist/app/assets/{smali-gUIPUNS_.js → smali-BjfU85md.js} +1 -1
- package/dist/app/assets/{smalltalk-BWqWeTOj.js → smalltalk-DNNjBzDr.js} +1 -1
- package/dist/app/assets/{smarty-D_6NQwpr.js → smarty-CE1m6psz.js} +1 -1
- package/dist/app/assets/{sml-C6fu3ORs.js → sml-B-M0aYoL.js} +1 -1
- package/dist/app/assets/{solidity-aHCvIORR.js → solidity-JFHLRhmS.js} +1 -1
- package/dist/app/assets/{solution-file-rfXcmDEi.js → solution-file-yTsqnfhG.js} +1 -1
- package/dist/app/assets/{soy-CYlWSpIs.js → soy-wfqd3xGN.js} +1 -1
- package/dist/app/assets/{sparql-BAW721Ow.js → sparql-CB9ciiIG.js} +1 -1
- package/dist/app/assets/{splunk-spl-BTzYVj8d.js → splunk-spl-Bwe0aY_-.js} +1 -1
- package/dist/app/assets/{sqf-UIbNftU1.js → sqf-BUIm45P2.js} +1 -1
- package/dist/app/assets/{sql-CgGxned9.js → sql-BeX4Dc62.js} +1 -1
- package/dist/app/assets/{squirrel-CIcV4Ny-.js → squirrel-BRuFeHvN.js} +1 -1
- package/dist/app/assets/{stan-DgfUhApV.js → stan-CV1v9dBF.js} +1 -1
- package/dist/app/assets/{stateDiagram-FHFEXIEX-D1iTvQX_.js → stateDiagram-FHFEXIEX-e7LfE1cT.js} +1 -1
- package/dist/app/assets/stateDiagram-v2-QKLJ7IA2-Bu-3LFWP.js +1 -0
- package/dist/app/assets/{stylus-sv3Ey9M5.js → stylus-BRS2xQmR.js} +1 -1
- package/dist/app/assets/{swift-DS573qiY.js → swift-BudLZRRW.js} +1 -1
- package/dist/app/assets/{systemd-CzDCvoIg.js → systemd-xKdHekwX.js} +1 -1
- package/dist/app/assets/{t4-cs-D4nbx6z2.js → t4-cs-Bj5P6V5L.js} +1 -1
- package/dist/app/assets/{t4-templating-BMZwZyOE.js → t4-templating-0G4ZNaN0.js} +1 -1
- package/dist/app/assets/{t4-vb-DIeP4ybv.js → t4-vb-CosfkjgV.js} +1 -1
- package/dist/app/assets/{tap-De3Jnd4S.js → tap-DGsfsadn.js} +1 -1
- package/dist/app/assets/{tcl-BjCUiiee.js → tcl-DXAoE4yI.js} +1 -1
- package/dist/app/assets/{textile-DZ3GKhqr.js → textile-CpnmYvQR.js} +1 -1
- package/dist/app/assets/{timeline-definition-GMOUNBTQ-DNIfYJfl.js → timeline-definition-GMOUNBTQ-pQ0DO6vU.js} +1 -1
- package/dist/app/assets/{toml-On6uzvVe.js → toml-B_JOO1XI.js} +1 -1
- package/dist/app/assets/{tremor-BU60aKH_.js → tremor-CxXXb0rX.js} +1 -1
- package/dist/app/assets/{tt2-BuKbFZt_.js → tt2-D4lJ_d_g.js} +1 -1
- package/dist/app/assets/{turtle-DXMNKdPK.js → turtle-iwyAJJ6w.js} +1 -1
- package/dist/app/assets/{twig-Bo_MbBRd.js → twig-BZQTv9el.js} +1 -1
- package/dist/app/assets/{typescript-CR7wxlXD.js → typescript-CPKefurw.js} +1 -1
- package/dist/app/assets/{typoscript-CMw0wwok.js → typoscript-0qIU0uLG.js} +1 -1
- package/dist/app/assets/{unrealscript-B776bLew.js → unrealscript-BcB60Vbj.js} +1 -1
- package/dist/app/assets/{uorazor-BYELARrG.js → uorazor-Dckkbt15.js} +1 -1
- package/dist/app/assets/{uri-CRKYpN9S.js → uri-DE-7oKOJ.js} +1 -1
- package/dist/app/assets/{v-YJo6805g.js → v-DeTq4j-B.js} +1 -1
- package/dist/app/assets/{vala-gsYpVkOH.js → vala-BTZNOPyG.js} +1 -1
- package/dist/app/assets/{vbnet-CmBlYcGa.js → vbnet-BGU0v6_8.js} +1 -1
- package/dist/app/assets/{velocity-Q2c3XfQY.js → velocity-B4q0vyZW.js} +1 -1
- package/dist/app/assets/{vennDiagram-DHZGUBPP-BadpBWfC.js → vennDiagram-DHZGUBPP-kshURHY6.js} +1 -1
- package/dist/app/assets/{verilog-5WEqrogK.js → verilog-DEDp0IPd.js} +1 -1
- package/dist/app/assets/{vhdl-Co2ZNHLl.js → vhdl-DRwrjPNO.js} +1 -1
- package/dist/app/assets/{vim-BWHpRDI0.js → vim-CHsYXV0-.js} +1 -1
- package/dist/app/assets/{visual-basic-DdcJ6qp_.js → visual-basic-Bfqr7fu6.js} +1 -1
- package/dist/app/assets/{wardley-RL74JXVD-nnCu88t4.js → wardley-RL74JXVD-DYR_esY-.js} +1 -1
- package/dist/app/assets/{wardleyDiagram-NUSXRM2D-DLRxHCOy.js → wardleyDiagram-NUSXRM2D-BafKr6Ss.js} +1 -1
- package/dist/app/assets/{warpscript-DQTWfQQI.js → warpscript-Div1HCjK.js} +1 -1
- package/dist/app/assets/{wasm-P74bjf6T.js → wasm-SeqvoPgO.js} +1 -1
- package/dist/app/assets/{web-idl-BwlVUL20.js → web-idl-kANtAVZr.js} +1 -1
- package/dist/app/assets/{wiki-3koXxGGM.js → wiki-7yk2Wrx1.js} +1 -1
- package/dist/app/assets/{wolfram-GHXEYNh8.js → wolfram-DAbqNGxJ.js} +1 -1
- package/dist/app/assets/{wren-DDEdbB41.js → wren-BINDN5Zg.js} +1 -1
- package/dist/app/assets/{xeora-C5eIogh-.js → xeora-KdqYnXxI.js} +1 -1
- package/dist/app/assets/{xml-doc-Dxj1u1SJ.js → xml-doc-DCjDWqVy.js} +1 -1
- package/dist/app/assets/{xojo-CeTBKDSR.js → xojo-aK43PrGs.js} +1 -1
- package/dist/app/assets/{xquery-C4vwM7F2.js → xquery-BFNumVvw.js} +1 -1
- package/dist/app/assets/{xychartDiagram-5P7HB3ND-8doH-fTN.js → xychartDiagram-5P7HB3ND-DxOv7_VL.js} +1 -1
- package/dist/app/assets/{yaml-Clzy20XF.js → yaml-oBSf8mGr.js} +1 -1
- package/dist/app/assets/{yang-BTHiGiHX.js → yang-CSWns_1Z.js} +1 -1
- package/dist/app/assets/{zig-BkXx74nT.js → zig-Dplgcvhw.js} +1 -1
- package/dist/app/index.html +2 -2
- package/dist/index.cjs +926 -795
- package/dist/index.js +890 -761
- package/package.json +3 -3
- package/dist/app/assets/channel-DJrI2Cpl.js +0 -1
- package/dist/app/assets/classDiagram-6PBFFD2Q-DlrWIn_z.js +0 -1
- package/dist/app/assets/classDiagram-v2-HSJHXN6E-DlrWIn_z.js +0 -1
- package/dist/app/assets/clone-DypLoQyD.js +0 -1
- package/dist/app/assets/index-CY_xTM-7.css +0 -1
- package/dist/app/assets/stateDiagram-v2-QKLJ7IA2-BCtIcdWI.js +0 -1
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// src/components/chat.tsx
|
|
2
|
-
import * as
|
|
2
|
+
import * as React46 from "react";
|
|
3
3
|
import {
|
|
4
4
|
ArrowDown as ArrowDown2,
|
|
5
|
-
FileText as
|
|
5
|
+
FileText as FileText4,
|
|
6
6
|
ImageIcon,
|
|
7
|
-
Loader2 as
|
|
7
|
+
Loader2 as Loader27,
|
|
8
8
|
Minus,
|
|
9
9
|
Pencil as Pencil4,
|
|
10
10
|
Quote,
|
|
@@ -1508,6 +1508,12 @@ var en_US_default = {
|
|
|
1508
1508
|
loading: "Loading",
|
|
1509
1509
|
thinking: "Thinking",
|
|
1510
1510
|
answering: "Answering",
|
|
1511
|
+
contextCompression: {
|
|
1512
|
+
running: "Automatically compressing context",
|
|
1513
|
+
success: "Context automatically compressed",
|
|
1514
|
+
skipped: "Context not compressed",
|
|
1515
|
+
fail: "Context compression failed"
|
|
1516
|
+
},
|
|
1511
1517
|
requestUserInputResult: {
|
|
1512
1518
|
title: "Selections confirmed",
|
|
1513
1519
|
option: "Option",
|
|
@@ -1849,6 +1855,12 @@ var zh_CN_default = {
|
|
|
1849
1855
|
loading: "\u6B63\u5728\u52A0\u8F7D",
|
|
1850
1856
|
thinking: "\u6B63\u5728\u601D\u8003",
|
|
1851
1857
|
answering: "\u6B63\u5728\u751F\u6210",
|
|
1858
|
+
contextCompression: {
|
|
1859
|
+
running: "\u6B63\u5728\u81EA\u52A8\u538B\u7F29\u4E0A\u4E0B\u6587",
|
|
1860
|
+
success: "\u4E0A\u4E0B\u6587\u5DF2\u81EA\u52A8\u538B\u7F29",
|
|
1861
|
+
skipped: "\u4E0A\u4E0B\u6587\u65E0\u9700\u538B\u7F29",
|
|
1862
|
+
fail: "\u4E0A\u4E0B\u6587\u538B\u7F29\u5931\u8D25"
|
|
1863
|
+
},
|
|
1852
1864
|
requestUserInputResult: {
|
|
1853
1865
|
title: "\u5DF2\u786E\u8BA4\u9009\u62E9",
|
|
1854
1866
|
option: "\u9009\u9879",
|
|
@@ -6839,12 +6851,8 @@ function useSlashCommands({
|
|
|
6839
6851
|
}
|
|
6840
6852
|
|
|
6841
6853
|
// src/components/thread/messages/ai.tsx
|
|
6842
|
-
import * as
|
|
6843
|
-
import {
|
|
6844
|
-
ChevronDown as ChevronDown4,
|
|
6845
|
-
Clock3 as Clock32,
|
|
6846
|
-
Loader2 as Loader25
|
|
6847
|
-
} from "lucide-react";
|
|
6854
|
+
import * as React33 from "react";
|
|
6855
|
+
import { ChevronDown as ChevronDown4, Clock3 as Clock32, Loader2 as Loader26 } from "lucide-react";
|
|
6848
6856
|
|
|
6849
6857
|
// src/lib/agent-run-render-tree.ts
|
|
6850
6858
|
function isTextContent(content) {
|
|
@@ -8617,57 +8625,116 @@ function AgentRunGroup({
|
|
|
8617
8625
|
] });
|
|
8618
8626
|
}
|
|
8619
8627
|
|
|
8620
|
-
// src/
|
|
8621
|
-
|
|
8622
|
-
|
|
8623
|
-
|
|
8624
|
-
|
|
8625
|
-
|
|
8626
|
-
|
|
8627
|
-
|
|
8628
|
-
|
|
8629
|
-
|
|
8630
|
-
|
|
8631
|
-
|
|
8632
|
-
|
|
8633
|
-
|
|
8634
|
-
|
|
8635
|
-
|
|
8636
|
-
|
|
8637
|
-
|
|
8638
|
-
|
|
8639
|
-
|
|
8640
|
-
|
|
8641
|
-
"
|
|
8642
|
-
|
|
8643
|
-
|
|
8644
|
-
|
|
8645
|
-
|
|
8646
|
-
"
|
|
8647
|
-
|
|
8648
|
-
|
|
8649
|
-
|
|
8650
|
-
"zh-Hans",
|
|
8651
|
-
"zh_CN",
|
|
8652
|
-
"zh-CN",
|
|
8653
|
-
"zh"
|
|
8654
|
-
];
|
|
8655
|
-
for (const key of preferredKeys) {
|
|
8656
|
-
const candidate = localized[key];
|
|
8657
|
-
if (typeof candidate === "string" && candidate.trim()) {
|
|
8658
|
-
return candidate.trim();
|
|
8659
|
-
}
|
|
8628
|
+
// src/components/thread/messages/context-compression-message.tsx
|
|
8629
|
+
import "react";
|
|
8630
|
+
import {
|
|
8631
|
+
resolveLocalizedText
|
|
8632
|
+
} from "@xpert-ai/chatkit-types";
|
|
8633
|
+
import { FileText as FileText2, Loader2 as Loader24, XCircle as XCircle2 } from "lucide-react";
|
|
8634
|
+
import { jsx as jsx32, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
8635
|
+
var CONTEXT_COMPRESSION_COMPONENT_TYPE = "context-compression";
|
|
8636
|
+
function isContextCompressionComponent(content) {
|
|
8637
|
+
return content.data.category === "Tool" && content.data.type === CONTEXT_COMPRESSION_COMPONENT_TYPE;
|
|
8638
|
+
}
|
|
8639
|
+
function isSkipped(reason) {
|
|
8640
|
+
return reason === "no_messages" || reason === "no_unprotected_history" || reason === "no_token_gain";
|
|
8641
|
+
}
|
|
8642
|
+
function ContextCompressionLabel({
|
|
8643
|
+
data
|
|
8644
|
+
}) {
|
|
8645
|
+
const { t } = useChatkitTranslation();
|
|
8646
|
+
const status = data.status ?? "running";
|
|
8647
|
+
const skipped = isSkipped(data.reason);
|
|
8648
|
+
if (skipped) {
|
|
8649
|
+
return t("message.contextCompression.skipped");
|
|
8650
|
+
}
|
|
8651
|
+
switch (status) {
|
|
8652
|
+
case "success":
|
|
8653
|
+
return t("message.contextCompression.success");
|
|
8654
|
+
case "fail":
|
|
8655
|
+
return t("message.contextCompression.fail");
|
|
8656
|
+
default:
|
|
8657
|
+
return t("message.contextCompression.running");
|
|
8660
8658
|
}
|
|
8661
|
-
|
|
8662
|
-
|
|
8663
|
-
|
|
8664
|
-
|
|
8659
|
+
}
|
|
8660
|
+
function ContextCompressionIcon({
|
|
8661
|
+
data
|
|
8662
|
+
}) {
|
|
8663
|
+
const status = data.status ?? "running";
|
|
8664
|
+
const skipped = isSkipped(data.reason);
|
|
8665
|
+
if (status === "running") {
|
|
8666
|
+
return /* @__PURE__ */ jsx32(Loader24, { "aria-hidden": "true", className: "h-4 w-4 shrink-0 animate-spin" });
|
|
8665
8667
|
}
|
|
8666
|
-
|
|
8668
|
+
if (status === "fail") {
|
|
8669
|
+
return /* @__PURE__ */ jsx32(XCircle2, { "aria-hidden": "true", className: "h-4 w-4 shrink-0" });
|
|
8670
|
+
}
|
|
8671
|
+
return /* @__PURE__ */ jsx32(
|
|
8672
|
+
FileText2,
|
|
8673
|
+
{
|
|
8674
|
+
"aria-hidden": "true",
|
|
8675
|
+
className: cn("h-4 w-4 shrink-0", skipped && "opacity-80")
|
|
8676
|
+
}
|
|
8677
|
+
);
|
|
8678
|
+
}
|
|
8679
|
+
function getTooltipText(data, language) {
|
|
8680
|
+
return resolveLocalizedText(
|
|
8681
|
+
data.summary || data.error || data.message,
|
|
8682
|
+
language
|
|
8683
|
+
);
|
|
8684
|
+
}
|
|
8685
|
+
function ContextCompressionMessage({
|
|
8686
|
+
content
|
|
8687
|
+
}) {
|
|
8688
|
+
const { i18n: i18n2 } = useChatkitTranslation();
|
|
8689
|
+
const data = content.data;
|
|
8690
|
+
const status = data.status ?? "running";
|
|
8691
|
+
const tooltipText = getTooltipText(data, i18n2.language);
|
|
8692
|
+
const label = /* @__PURE__ */ jsx32(ContextCompressionLabel, { data });
|
|
8693
|
+
const center = /* @__PURE__ */ jsxs20(
|
|
8694
|
+
"div",
|
|
8695
|
+
{
|
|
8696
|
+
className: cn(
|
|
8697
|
+
"inline-flex max-w-[80%] shrink-0 items-center gap-1.5 rounded-md px-2 py-1 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",
|
|
8698
|
+
tooltipText && "cursor-help",
|
|
8699
|
+
status === "fail" && "text-destructive hover:text-destructive"
|
|
8700
|
+
),
|
|
8701
|
+
children: [
|
|
8702
|
+
/* @__PURE__ */ jsx32(ContextCompressionIcon, { data }),
|
|
8703
|
+
/* @__PURE__ */ jsx32(
|
|
8704
|
+
"span",
|
|
8705
|
+
{
|
|
8706
|
+
className: cn(
|
|
8707
|
+
"truncate",
|
|
8708
|
+
status === "running" && "ck-tool-call-running-text"
|
|
8709
|
+
),
|
|
8710
|
+
children: label
|
|
8711
|
+
}
|
|
8712
|
+
)
|
|
8713
|
+
]
|
|
8714
|
+
}
|
|
8715
|
+
);
|
|
8716
|
+
return /* @__PURE__ */ jsxs20("div", { className: "flex w-full items-center justify-center gap-3 py-6", children: [
|
|
8717
|
+
/* @__PURE__ */ jsx32("div", { className: "h-px min-w-8 flex-1 bg-border" }),
|
|
8718
|
+
tooltipText ? /* @__PURE__ */ jsxs20(Tooltip, { children: [
|
|
8719
|
+
/* @__PURE__ */ jsx32(TooltipTrigger, { asChild: true, children: center }),
|
|
8720
|
+
/* @__PURE__ */ jsx32(
|
|
8721
|
+
TooltipContent,
|
|
8722
|
+
{
|
|
8723
|
+
side: "top",
|
|
8724
|
+
className: "max-h-80 max-w-xl overflow-auto whitespace-pre-wrap text-left text-xs leading-5",
|
|
8725
|
+
children: tooltipText
|
|
8726
|
+
}
|
|
8727
|
+
)
|
|
8728
|
+
] }) : center,
|
|
8729
|
+
/* @__PURE__ */ jsx32("div", { className: "h-px min-w-8 flex-1 bg-border" })
|
|
8730
|
+
] });
|
|
8667
8731
|
}
|
|
8668
8732
|
|
|
8733
|
+
// src/i18n/localized-text.ts
|
|
8734
|
+
import { resolveLocalizedText as resolveLocalizedText2 } from "@xpert-ai/chatkit-types";
|
|
8735
|
+
|
|
8669
8736
|
// src/components/thread/messages/knowledge-retriever-component-renderer.tsx
|
|
8670
|
-
import { jsx as
|
|
8737
|
+
import { jsx as jsx33, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
8671
8738
|
var KNOWLEDGE_RETRIEVER_TITLE = "Knowledge Retriever";
|
|
8672
8739
|
var KNOWLEDGE_METADATA_SKIP_KEYS = /* @__PURE__ */ new Set([
|
|
8673
8740
|
"assets",
|
|
@@ -8778,7 +8845,7 @@ function getRetrieverQuery(data, language) {
|
|
|
8778
8845
|
if (isRecord2(input)) {
|
|
8779
8846
|
return readString(input.query) ?? readString(input.input) ?? readString(input.question);
|
|
8780
8847
|
}
|
|
8781
|
-
return readString(
|
|
8848
|
+
return readString(resolveLocalizedText2(data.message, language)) ?? readString(input);
|
|
8782
8849
|
}
|
|
8783
8850
|
function hasKnowledgeRetrieverDetails(_content, data) {
|
|
8784
8851
|
return isKnowledgeRetrieverComponent(_content, data);
|
|
@@ -8790,23 +8857,23 @@ function KnowledgeRawDataBlock({ value }) {
|
|
|
8790
8857
|
const { t } = useChatkitTranslation();
|
|
8791
8858
|
const detected = detectJsonValue(value);
|
|
8792
8859
|
if (detected.kind === "text") {
|
|
8793
|
-
return /* @__PURE__ */
|
|
8860
|
+
return /* @__PURE__ */ jsx33(PlainTextBlock, { value: detected.text });
|
|
8794
8861
|
}
|
|
8795
|
-
return /* @__PURE__ */
|
|
8796
|
-
/* @__PURE__ */
|
|
8797
|
-
/* @__PURE__ */
|
|
8862
|
+
return /* @__PURE__ */ jsxs21(Tabs, { defaultValue: "tree", className: "min-w-0", children: [
|
|
8863
|
+
/* @__PURE__ */ jsxs21("div", { className: "mb-2 flex min-w-0 items-center justify-between gap-2", children: [
|
|
8864
|
+
/* @__PURE__ */ jsxs21("span", { className: "min-w-0 truncate text-[11px] text-muted-foreground", children: [
|
|
8798
8865
|
t("message.toolGroup.jsonTitle"),
|
|
8799
8866
|
" \xB7",
|
|
8800
8867
|
" ",
|
|
8801
8868
|
getJsonValueSummary(detected.value)
|
|
8802
8869
|
] }),
|
|
8803
|
-
/* @__PURE__ */
|
|
8804
|
-
/* @__PURE__ */
|
|
8805
|
-
/* @__PURE__ */
|
|
8870
|
+
/* @__PURE__ */ jsxs21(TabsList, { className: "rounded-md p-0.5", children: [
|
|
8871
|
+
/* @__PURE__ */ jsx33(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "tree", children: t("message.toolGroup.jsonTree") }),
|
|
8872
|
+
/* @__PURE__ */ jsx33(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "raw", children: t("message.toolGroup.jsonRaw") })
|
|
8806
8873
|
] })
|
|
8807
8874
|
] }),
|
|
8808
|
-
/* @__PURE__ */
|
|
8809
|
-
/* @__PURE__ */
|
|
8875
|
+
/* @__PURE__ */ jsx33(TabsContent, { value: "tree", className: "mt-0", children: /* @__PURE__ */ jsx33(JsonTreeView, { value: detected.value }) }),
|
|
8876
|
+
/* @__PURE__ */ jsx33(TabsContent, { value: "raw", className: "mt-0", children: /* @__PURE__ */ jsx33(RawJsonBlock, { raw: detected.raw }) })
|
|
8810
8877
|
] });
|
|
8811
8878
|
}
|
|
8812
8879
|
function KnowledgeRetrieverDetails({
|
|
@@ -8819,16 +8886,16 @@ function KnowledgeRetrieverDetails({
|
|
|
8819
8886
|
const hasArrayData = Array.isArray(data.data);
|
|
8820
8887
|
const hasRawFallback = rawData !== null && rawData !== void 0 && (!hasArrayData || Array.isArray(data.data) && data.data.length > 0 && results.length === 0);
|
|
8821
8888
|
const showEmptyState = results.length === 0 && !hasRawFallback && data.status !== "running";
|
|
8822
|
-
return /* @__PURE__ */
|
|
8823
|
-
query ? /* @__PURE__ */
|
|
8824
|
-
/* @__PURE__ */
|
|
8825
|
-
/* @__PURE__ */
|
|
8889
|
+
return /* @__PURE__ */ jsxs21("div", { className: "min-w-0 space-y-3 px-3 py-2", children: [
|
|
8890
|
+
query ? /* @__PURE__ */ jsxs21("div", { className: "min-w-0 space-y-1", children: [
|
|
8891
|
+
/* @__PURE__ */ jsx33("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.knowledgeRetriever.queryTitle") }),
|
|
8892
|
+
/* @__PURE__ */ jsx33("div", { className: "min-w-0 whitespace-pre-wrap wrap-break-word rounded-md bg-muted/40 px-3 py-2 font-mono text-[12px] leading-5 text-foreground/80", children: query })
|
|
8826
8893
|
] }) : null,
|
|
8827
|
-
results.length > 0 ? /* @__PURE__ */
|
|
8828
|
-
/* @__PURE__ */
|
|
8894
|
+
results.length > 0 ? /* @__PURE__ */ jsxs21("div", { className: "min-w-0 space-y-2", children: [
|
|
8895
|
+
/* @__PURE__ */ jsx33("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.knowledgeRetriever.resultsTitle", {
|
|
8829
8896
|
count: results.length
|
|
8830
8897
|
}) }),
|
|
8831
|
-
/* @__PURE__ */
|
|
8898
|
+
/* @__PURE__ */ jsx33("div", { className: "space-y-2", children: results.map((result, index) => /* @__PURE__ */ jsx33(
|
|
8832
8899
|
KnowledgeResultCard,
|
|
8833
8900
|
{
|
|
8834
8901
|
result,
|
|
@@ -8837,11 +8904,11 @@ function KnowledgeRetrieverDetails({
|
|
|
8837
8904
|
result.id ?? `${result.title}-${index}`
|
|
8838
8905
|
)) })
|
|
8839
8906
|
] }) : null,
|
|
8840
|
-
hasRawFallback ? /* @__PURE__ */
|
|
8841
|
-
/* @__PURE__ */
|
|
8842
|
-
/* @__PURE__ */
|
|
8907
|
+
hasRawFallback ? /* @__PURE__ */ jsxs21("div", { className: "min-w-0 space-y-1", children: [
|
|
8908
|
+
/* @__PURE__ */ jsx33("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.knowledgeRetriever.rawDataTitle") }),
|
|
8909
|
+
/* @__PURE__ */ jsx33(KnowledgeRawDataBlock, { value: rawData })
|
|
8843
8910
|
] }) : null,
|
|
8844
|
-
showEmptyState ? /* @__PURE__ */
|
|
8911
|
+
showEmptyState ? /* @__PURE__ */ jsx33("div", { className: "rounded-md border border-dashed border-border/70 px-3 py-4 text-center text-xs text-muted-foreground", children: t("message.knowledgeRetriever.noResults") }) : null
|
|
8845
8912
|
] });
|
|
8846
8913
|
}
|
|
8847
8914
|
function KnowledgeResultCard({
|
|
@@ -8860,10 +8927,10 @@ function KnowledgeResultCard({
|
|
|
8860
8927
|
...result.metadata
|
|
8861
8928
|
];
|
|
8862
8929
|
const titleClassName = "min-w-0 line-clamp-2 text-sm font-medium leading-5 text-foreground";
|
|
8863
|
-
return /* @__PURE__ */
|
|
8864
|
-
/* @__PURE__ */
|
|
8865
|
-
/* @__PURE__ */
|
|
8866
|
-
result.url ? /* @__PURE__ */
|
|
8930
|
+
return /* @__PURE__ */ jsx33("article", { className: "min-w-0 rounded-md border border-border/60 bg-background/80 px-3 py-2", children: /* @__PURE__ */ jsxs21("div", { className: "flex min-w-0 items-start gap-2", children: [
|
|
8931
|
+
/* @__PURE__ */ jsx33("span", { className: "mt-0.5 inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-muted text-[11px] font-medium text-muted-foreground", children: index + 1 }),
|
|
8932
|
+
/* @__PURE__ */ jsxs21("div", { className: "min-w-0 flex-1", children: [
|
|
8933
|
+
result.url ? /* @__PURE__ */ jsxs21(
|
|
8867
8934
|
"a",
|
|
8868
8935
|
{
|
|
8869
8936
|
id: titleId,
|
|
@@ -8873,37 +8940,37 @@ function KnowledgeResultCard({
|
|
|
8873
8940
|
className: cn(titleClassName, "hover:underline"),
|
|
8874
8941
|
children: [
|
|
8875
8942
|
result.title,
|
|
8876
|
-
result.lineRange ? /* @__PURE__ */
|
|
8943
|
+
result.lineRange ? /* @__PURE__ */ jsxs21("span", { className: "ml-1 text-muted-foreground", children: [
|
|
8877
8944
|
"[",
|
|
8878
8945
|
result.lineRange,
|
|
8879
8946
|
"]"
|
|
8880
8947
|
] }) : null
|
|
8881
8948
|
]
|
|
8882
8949
|
}
|
|
8883
|
-
) : /* @__PURE__ */
|
|
8950
|
+
) : /* @__PURE__ */ jsxs21("div", { id: titleId, className: titleClassName, children: [
|
|
8884
8951
|
result.title,
|
|
8885
|
-
result.lineRange ? /* @__PURE__ */
|
|
8952
|
+
result.lineRange ? /* @__PURE__ */ jsxs21("span", { className: "ml-1 text-muted-foreground", children: [
|
|
8886
8953
|
"[",
|
|
8887
8954
|
result.lineRange,
|
|
8888
8955
|
"]"
|
|
8889
8956
|
] }) : null
|
|
8890
8957
|
] }),
|
|
8891
|
-
result.content ? /* @__PURE__ */
|
|
8892
|
-
metadata.length > 0 ? /* @__PURE__ */
|
|
8958
|
+
result.content ? /* @__PURE__ */ jsx33("p", { className: "mt-1 line-clamp-3 whitespace-pre-wrap text-xs leading-5 text-muted-foreground", children: result.content }) : null,
|
|
8959
|
+
metadata.length > 0 ? /* @__PURE__ */ jsx33(
|
|
8893
8960
|
"div",
|
|
8894
8961
|
{
|
|
8895
8962
|
className: "mt-2 flex flex-wrap gap-1.5",
|
|
8896
8963
|
"aria-labelledby": titleId,
|
|
8897
|
-
children: metadata.slice(0, 10).map((item) => /* @__PURE__ */
|
|
8964
|
+
children: metadata.slice(0, 10).map((item) => /* @__PURE__ */ jsxs21(
|
|
8898
8965
|
"span",
|
|
8899
8966
|
{
|
|
8900
8967
|
className: "inline-flex min-w-0 max-w-full items-center gap-1 rounded-md bg-muted/50 px-1.5 py-0.5 text-[11px] leading-4 text-muted-foreground",
|
|
8901
8968
|
children: [
|
|
8902
|
-
/* @__PURE__ */
|
|
8969
|
+
/* @__PURE__ */ jsxs21("span", { className: "shrink-0 font-medium text-foreground/70", children: [
|
|
8903
8970
|
item.key,
|
|
8904
8971
|
":"
|
|
8905
8972
|
] }),
|
|
8906
|
-
/* @__PURE__ */
|
|
8973
|
+
/* @__PURE__ */ jsx33("span", { className: "min-w-0 truncate font-mono", children: item.value })
|
|
8907
8974
|
]
|
|
8908
8975
|
},
|
|
8909
8976
|
`${item.key}:${item.value}`
|
|
@@ -8915,7 +8982,7 @@ function KnowledgeResultCard({
|
|
|
8915
8982
|
}
|
|
8916
8983
|
|
|
8917
8984
|
// src/components/thread/messages/web-search-component-renderer.tsx
|
|
8918
|
-
import { jsx as
|
|
8985
|
+
import { jsx as jsx34, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
8919
8986
|
var webSearchComponentRenderer = {
|
|
8920
8987
|
id: "computer-web-search-sources",
|
|
8921
8988
|
presentation: "grouped-step",
|
|
@@ -8985,9 +9052,9 @@ function WebSearchToolCallOutput({
|
|
|
8985
9052
|
const { t } = useChatkitTranslation();
|
|
8986
9053
|
const sources = getWebSearchSources(data);
|
|
8987
9054
|
if (sources.length === 0 || data.error !== void 0) return null;
|
|
8988
|
-
return /* @__PURE__ */
|
|
8989
|
-
/* @__PURE__ */
|
|
8990
|
-
/* @__PURE__ */
|
|
9055
|
+
return /* @__PURE__ */ jsxs22("div", { className: "space-y-2", children: [
|
|
9056
|
+
/* @__PURE__ */ jsx34("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.toolGroup.sourcesTitle") }),
|
|
9057
|
+
/* @__PURE__ */ jsx34("div", { className: "space-y-2", children: sources.map((source, index) => {
|
|
8991
9058
|
const sourceHost = getSourceHost(source.url);
|
|
8992
9059
|
const snippet = source.content ?? source.description;
|
|
8993
9060
|
const metaParts = [
|
|
@@ -8995,13 +9062,13 @@ function WebSearchToolCallOutput({
|
|
|
8995
9062
|
source.publishedDate,
|
|
8996
9063
|
source.author
|
|
8997
9064
|
].filter((item) => Boolean(item));
|
|
8998
|
-
return /* @__PURE__ */
|
|
9065
|
+
return /* @__PURE__ */ jsxs22(
|
|
8999
9066
|
"div",
|
|
9000
9067
|
{
|
|
9001
9068
|
className: "min-w-0 rounded-md border border-border/60 bg-background/80 px-3 py-2",
|
|
9002
9069
|
children: [
|
|
9003
|
-
metaParts.length > 0 ? /* @__PURE__ */
|
|
9004
|
-
/* @__PURE__ */
|
|
9070
|
+
metaParts.length > 0 ? /* @__PURE__ */ jsx34("div", { className: "mb-1 truncate text-[11px] text-muted-foreground", children: metaParts.join(" / ") }) : null,
|
|
9071
|
+
/* @__PURE__ */ jsx34(
|
|
9005
9072
|
"a",
|
|
9006
9073
|
{
|
|
9007
9074
|
href: source.url,
|
|
@@ -9011,7 +9078,7 @@ function WebSearchToolCallOutput({
|
|
|
9011
9078
|
children: source.title
|
|
9012
9079
|
}
|
|
9013
9080
|
),
|
|
9014
|
-
snippet ? /* @__PURE__ */
|
|
9081
|
+
snippet ? /* @__PURE__ */ jsx34("p", { className: "mt-1 line-clamp-3 text-xs leading-5 text-muted-foreground", children: snippet }) : null
|
|
9015
9082
|
]
|
|
9016
9083
|
},
|
|
9017
9084
|
`${source.url}-${index}`
|
|
@@ -9022,6 +9089,12 @@ function WebSearchToolCallOutput({
|
|
|
9022
9089
|
|
|
9023
9090
|
// src/components/thread/messages/component-message-renderers.tsx
|
|
9024
9091
|
var COMPONENT_MESSAGE_RENDERERS = [
|
|
9092
|
+
{
|
|
9093
|
+
id: "context-compression",
|
|
9094
|
+
presentation: "standalone",
|
|
9095
|
+
match: (content) => isContextCompressionComponent(content),
|
|
9096
|
+
hasDetails: () => false
|
|
9097
|
+
},
|
|
9025
9098
|
knowledgeRetrieverComponentRenderer,
|
|
9026
9099
|
webSearchComponentRenderer
|
|
9027
9100
|
];
|
|
@@ -9039,7 +9112,7 @@ function hasComponentMessageRendererDetails(renderer, content, data) {
|
|
|
9039
9112
|
}
|
|
9040
9113
|
|
|
9041
9114
|
// src/components/thread/messages/tool-component-group.tsx
|
|
9042
|
-
import * as
|
|
9115
|
+
import * as React31 from "react";
|
|
9043
9116
|
import {
|
|
9044
9117
|
BookOpen,
|
|
9045
9118
|
Brain as Brain3,
|
|
@@ -9049,22 +9122,22 @@ import {
|
|
|
9049
9122
|
ChevronRight as ChevronRight7,
|
|
9050
9123
|
CircleHelp,
|
|
9051
9124
|
Copy as Copy2,
|
|
9052
|
-
FileText as
|
|
9125
|
+
FileText as FileText3,
|
|
9053
9126
|
Files,
|
|
9054
|
-
Loader2 as
|
|
9127
|
+
Loader2 as Loader25,
|
|
9055
9128
|
ListTodo as ListTodo2,
|
|
9056
9129
|
Network,
|
|
9057
9130
|
Repeat2,
|
|
9058
9131
|
Search as Search2,
|
|
9059
9132
|
SquareTerminal,
|
|
9060
9133
|
Wrench as Wrench2,
|
|
9061
|
-
XCircle as
|
|
9134
|
+
XCircle as XCircle3
|
|
9062
9135
|
} from "lucide-react";
|
|
9063
9136
|
|
|
9064
9137
|
// src/components/thread/messages/sandbox-shell-tool-call.tsx
|
|
9065
|
-
import * as
|
|
9138
|
+
import * as React30 from "react";
|
|
9066
9139
|
import { Check as Check3, Copy } from "lucide-react";
|
|
9067
|
-
import { jsx as
|
|
9140
|
+
import { jsx as jsx35, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
9068
9141
|
var SANDBOX_SHELL_TEXT_CLASS = "text-[13px] leading-5 in-data-[density=compact]:text-xs in-data-[density=compact]:leading-4 in-data-[density=spacious]:text-sm in-data-[density=spacious]:leading-6";
|
|
9069
9142
|
var SANDBOX_SHELL_SECTION_GAP_CLASS = "mt-2 in-data-[density=compact]:mt-1.5 in-data-[density=spacious]:mt-3";
|
|
9070
9143
|
function normalizeShellToken(value) {
|
|
@@ -9119,7 +9192,7 @@ function getSandboxShellCommand(data, language) {
|
|
|
9119
9192
|
const command = readShellString(source.command) ?? readShellString(source.cmd) ?? readShellString(source.input);
|
|
9120
9193
|
if (command) return command;
|
|
9121
9194
|
}
|
|
9122
|
-
return readShellString(
|
|
9195
|
+
return readShellString(resolveLocalizedText2(data.message, language)) ?? readShellString(resolveLocalizedText2(data.title, language)) ?? "sandbox_shell";
|
|
9123
9196
|
}
|
|
9124
9197
|
function getSandboxShellOutput(data) {
|
|
9125
9198
|
const output = stringifyShellText(data.output) ?? stringifyShellText(data.data) ?? stringifyShellText(data.error);
|
|
@@ -9161,15 +9234,15 @@ function ShellCopyButton({
|
|
|
9161
9234
|
className
|
|
9162
9235
|
}) {
|
|
9163
9236
|
const { t } = useChatkitTranslation();
|
|
9164
|
-
const [isCopied, setIsCopied] =
|
|
9165
|
-
const resetTimeoutRef =
|
|
9166
|
-
const clearResetTimeout =
|
|
9237
|
+
const [isCopied, setIsCopied] = React30.useState(false);
|
|
9238
|
+
const resetTimeoutRef = React30.useRef(null);
|
|
9239
|
+
const clearResetTimeout = React30.useCallback(() => {
|
|
9167
9240
|
if (resetTimeoutRef.current === null) return;
|
|
9168
9241
|
window.clearTimeout(resetTimeoutRef.current);
|
|
9169
9242
|
resetTimeoutRef.current = null;
|
|
9170
9243
|
}, []);
|
|
9171
|
-
|
|
9172
|
-
const handleCopy =
|
|
9244
|
+
React30.useEffect(() => clearResetTimeout, [clearResetTimeout]);
|
|
9245
|
+
const handleCopy = React30.useCallback(() => {
|
|
9173
9246
|
if (typeof navigator === "undefined" || !navigator.clipboard) return;
|
|
9174
9247
|
void navigator.clipboard.writeText(value).then(() => {
|
|
9175
9248
|
setIsCopied(true);
|
|
@@ -9181,7 +9254,7 @@ function ShellCopyButton({
|
|
|
9181
9254
|
}).catch(() => void 0);
|
|
9182
9255
|
}, [clearResetTimeout, value]);
|
|
9183
9256
|
const label = isCopied ? t("message.toolGroup.copied") : t("message.toolGroup.copy");
|
|
9184
|
-
return /* @__PURE__ */
|
|
9257
|
+
return /* @__PURE__ */ jsx35(
|
|
9185
9258
|
"button",
|
|
9186
9259
|
{
|
|
9187
9260
|
type: "button",
|
|
@@ -9192,7 +9265,7 @@ function ShellCopyButton({
|
|
|
9192
9265
|
"aria-label": label,
|
|
9193
9266
|
title: label,
|
|
9194
9267
|
onClick: handleCopy,
|
|
9195
|
-
children: isCopied ? /* @__PURE__ */
|
|
9268
|
+
children: isCopied ? /* @__PURE__ */ jsx35(Check3, { className: "h-3.5 w-3.5", "aria-hidden": "true" }) : /* @__PURE__ */ jsx35(Copy, { className: "h-3.5 w-3.5", "aria-hidden": "true" })
|
|
9196
9269
|
}
|
|
9197
9270
|
);
|
|
9198
9271
|
}
|
|
@@ -9202,16 +9275,16 @@ function SandboxShellStatus({
|
|
|
9202
9275
|
}) {
|
|
9203
9276
|
const { t } = useChatkitTranslation();
|
|
9204
9277
|
if (exitCode !== null) {
|
|
9205
|
-
return /* @__PURE__ */
|
|
9278
|
+
return /* @__PURE__ */ jsx35("span", { className: "text-muted-foreground/90", children: t("message.toolGroup.shell.exitCode", { code: exitCode }) });
|
|
9206
9279
|
}
|
|
9207
9280
|
if (data.status === "running") {
|
|
9208
|
-
return /* @__PURE__ */
|
|
9281
|
+
return /* @__PURE__ */ jsx35("span", { className: "text-muted-foreground/90", children: t("message.toolGroup.shell.running") });
|
|
9209
9282
|
}
|
|
9210
9283
|
if (data.status === "fail" || data.error) {
|
|
9211
|
-
return /* @__PURE__ */
|
|
9284
|
+
return /* @__PURE__ */ jsx35("span", { className: "text-destructive/90", children: t("message.toolGroup.shell.failed") });
|
|
9212
9285
|
}
|
|
9213
|
-
return /* @__PURE__ */
|
|
9214
|
-
/* @__PURE__ */
|
|
9286
|
+
return /* @__PURE__ */ jsxs23("span", { className: "inline-flex items-center gap-1 text-muted-foreground/90", children: [
|
|
9287
|
+
/* @__PURE__ */ jsx35(Check3, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
|
|
9215
9288
|
t("message.toolGroup.shell.success")
|
|
9216
9289
|
] });
|
|
9217
9290
|
}
|
|
@@ -9222,14 +9295,14 @@ function SandboxShellToolCallCard({ data }) {
|
|
|
9222
9295
|
const output = getSandboxShellOutput(data);
|
|
9223
9296
|
const exitCode = getSandboxShellExitCode(data);
|
|
9224
9297
|
const copyButtonClassName = "absolute right-1 top-1 h-6 w-6 opacity-0 transition-opacity group-hover/shell-copy:opacity-100 group-focus-within/shell-copy:opacity-100 in-data-[density=compact]:right-0.5 in-data-[density=compact]:top-0.5 in-data-[density=compact]:h-5 in-data-[density=compact]:w-5 in-data-[density=spacious]:right-1.5 in-data-[density=spacious]:top-1.5 in-data-[density=spacious]:h-7 in-data-[density=spacious]:w-7";
|
|
9225
|
-
return /* @__PURE__ */
|
|
9298
|
+
return /* @__PURE__ */ jsxs23(
|
|
9226
9299
|
"div",
|
|
9227
9300
|
{
|
|
9228
|
-
className: "flex max-h-64 min-w-0 flex-col overflow-hidden rounded-md bg-muted/60 px-3
|
|
9301
|
+
className: "flex max-h-64 min-w-0 flex-col overflow-hidden rounded-md bg-muted/60 px-3 my-1 text-left shadow-sm ring-1 ring-border/30 in-data-[density=compact]:max-h-52 in-data-[density=compact]:px-2 in-data-[density=compact]:py-1.5 in-data-[density=spacious]:max-h-80 in-data-[density=spacious]:px-4 in-data-[density=spacious]:py-3",
|
|
9229
9302
|
"data-slot": "sandbox-shell-tool-call",
|
|
9230
9303
|
"aria-label": "Shell",
|
|
9231
9304
|
children: [
|
|
9232
|
-
/* @__PURE__ */
|
|
9305
|
+
/* @__PURE__ */ jsx35(
|
|
9233
9306
|
"div",
|
|
9234
9307
|
{
|
|
9235
9308
|
className: cn(
|
|
@@ -9239,7 +9312,7 @@ function SandboxShellToolCallCard({ data }) {
|
|
|
9239
9312
|
children: "Shell"
|
|
9240
9313
|
}
|
|
9241
9314
|
),
|
|
9242
|
-
/* @__PURE__ */
|
|
9315
|
+
/* @__PURE__ */ jsxs23(
|
|
9243
9316
|
"div",
|
|
9244
9317
|
{
|
|
9245
9318
|
className: cn(
|
|
@@ -9247,7 +9320,7 @@ function SandboxShellToolCallCard({ data }) {
|
|
|
9247
9320
|
SANDBOX_SHELL_SECTION_GAP_CLASS
|
|
9248
9321
|
),
|
|
9249
9322
|
children: [
|
|
9250
|
-
/* @__PURE__ */
|
|
9323
|
+
/* @__PURE__ */ jsx35(
|
|
9251
9324
|
"pre",
|
|
9252
9325
|
{
|
|
9253
9326
|
className: cn(
|
|
@@ -9258,11 +9331,11 @@ function SandboxShellToolCallCard({ data }) {
|
|
|
9258
9331
|
children: formattedCommand
|
|
9259
9332
|
}
|
|
9260
9333
|
),
|
|
9261
|
-
/* @__PURE__ */
|
|
9334
|
+
/* @__PURE__ */ jsx35(ShellCopyButton, { value: command, className: copyButtonClassName })
|
|
9262
9335
|
]
|
|
9263
9336
|
}
|
|
9264
9337
|
),
|
|
9265
|
-
output ? /* @__PURE__ */
|
|
9338
|
+
output ? /* @__PURE__ */ jsxs23(
|
|
9266
9339
|
"div",
|
|
9267
9340
|
{
|
|
9268
9341
|
className: cn(
|
|
@@ -9270,7 +9343,7 @@ function SandboxShellToolCallCard({ data }) {
|
|
|
9270
9343
|
SANDBOX_SHELL_SECTION_GAP_CLASS
|
|
9271
9344
|
),
|
|
9272
9345
|
children: [
|
|
9273
|
-
/* @__PURE__ */
|
|
9346
|
+
/* @__PURE__ */ jsx35(
|
|
9274
9347
|
"pre",
|
|
9275
9348
|
{
|
|
9276
9349
|
className: cn(
|
|
@@ -9281,18 +9354,18 @@ function SandboxShellToolCallCard({ data }) {
|
|
|
9281
9354
|
children: output
|
|
9282
9355
|
}
|
|
9283
9356
|
),
|
|
9284
|
-
/* @__PURE__ */
|
|
9357
|
+
/* @__PURE__ */ jsx35(ShellCopyButton, { value: output, className: copyButtonClassName })
|
|
9285
9358
|
]
|
|
9286
9359
|
}
|
|
9287
9360
|
) : null,
|
|
9288
|
-
/* @__PURE__ */
|
|
9361
|
+
/* @__PURE__ */ jsx35(
|
|
9289
9362
|
"div",
|
|
9290
9363
|
{
|
|
9291
9364
|
className: cn(
|
|
9292
9365
|
"mt-3 flex shrink-0 justify-end in-data-[density=compact]:mt-2 in-data-[density=spacious]:mt-4",
|
|
9293
9366
|
SANDBOX_SHELL_TEXT_CLASS
|
|
9294
9367
|
),
|
|
9295
|
-
children: /* @__PURE__ */
|
|
9368
|
+
children: /* @__PURE__ */ jsx35(SandboxShellStatus, { data, exitCode })
|
|
9296
9369
|
}
|
|
9297
9370
|
)
|
|
9298
9371
|
]
|
|
@@ -9301,7 +9374,7 @@ function SandboxShellToolCallCard({ data }) {
|
|
|
9301
9374
|
}
|
|
9302
9375
|
|
|
9303
9376
|
// src/components/thread/messages/tool-component-group.tsx
|
|
9304
|
-
import { jsx as
|
|
9377
|
+
import { jsx as jsx36, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
9305
9378
|
var toolStatusConfig = {
|
|
9306
9379
|
success: {
|
|
9307
9380
|
iconClass: "border-green-500 text-green-700",
|
|
@@ -9309,11 +9382,11 @@ var toolStatusConfig = {
|
|
|
9309
9382
|
},
|
|
9310
9383
|
fail: {
|
|
9311
9384
|
iconClass: "border-red-500 text-red-700",
|
|
9312
|
-
icon:
|
|
9385
|
+
icon: XCircle3
|
|
9313
9386
|
},
|
|
9314
9387
|
running: {
|
|
9315
9388
|
iconClass: "border-blue-500 text-blue-700",
|
|
9316
|
-
icon:
|
|
9389
|
+
icon: Loader25
|
|
9317
9390
|
}
|
|
9318
9391
|
};
|
|
9319
9392
|
var TOOL_GROUP_CATEGORY_ORDER = [
|
|
@@ -9407,10 +9480,10 @@ function formatStepDuration2(durationMs) {
|
|
|
9407
9480
|
return `${minutes}m ${seconds}s`;
|
|
9408
9481
|
}
|
|
9409
9482
|
function useFrozenTimestamp(shouldFreeze) {
|
|
9410
|
-
const [frozenAt, setFrozenAt] =
|
|
9483
|
+
const [frozenAt, setFrozenAt] = React31.useState(
|
|
9411
9484
|
() => shouldFreeze ? Date.now() : null
|
|
9412
9485
|
);
|
|
9413
|
-
|
|
9486
|
+
React31.useEffect(() => {
|
|
9414
9487
|
if (shouldFreeze) {
|
|
9415
9488
|
setFrozenAt((current) => current ?? Date.now());
|
|
9416
9489
|
return;
|
|
@@ -9420,12 +9493,12 @@ function useFrozenTimestamp(shouldFreeze) {
|
|
|
9420
9493
|
return frozenAt;
|
|
9421
9494
|
}
|
|
9422
9495
|
function useToolStepDurationLabel(data, options) {
|
|
9423
|
-
const [durationNow, setDurationNow] =
|
|
9496
|
+
const [durationNow, setDurationNow] = React31.useState(() => Date.now());
|
|
9424
9497
|
const createdAt = parseStepDate(data.created_date);
|
|
9425
9498
|
const explicitEndedAt = parseStepDate(data.end_date);
|
|
9426
9499
|
const status = options?.status ?? data.status;
|
|
9427
9500
|
const endedAt = explicitEndedAt ?? (status !== "running" ? options?.fallbackEndedAt ?? null : null);
|
|
9428
|
-
|
|
9501
|
+
React31.useEffect(() => {
|
|
9429
9502
|
if (status !== "running" || createdAt === null || endedAt !== null) {
|
|
9430
9503
|
return;
|
|
9431
9504
|
}
|
|
@@ -9480,7 +9553,7 @@ function normalizeToolToken3(value) {
|
|
|
9480
9553
|
}
|
|
9481
9554
|
function classifyToolToken(value) {
|
|
9482
9555
|
const normalized = normalizeToolToken3(
|
|
9483
|
-
typeof value === "string" ? value :
|
|
9556
|
+
typeof value === "string" ? value : resolveLocalizedText2(value, "en-US")
|
|
9484
9557
|
);
|
|
9485
9558
|
if (!normalized) return null;
|
|
9486
9559
|
const directMatch = TOOL_GROUP_TOKEN_CATEGORY[normalized];
|
|
@@ -9512,10 +9585,10 @@ function getToolGroupCategoryCounts(items) {
|
|
|
9512
9585
|
function getToolActivityLabel(content, language, statusOverride) {
|
|
9513
9586
|
const data = getToolStepData(content);
|
|
9514
9587
|
const status = statusOverride ?? data.status;
|
|
9515
|
-
const message =
|
|
9516
|
-
const title =
|
|
9517
|
-
const tool =
|
|
9518
|
-
const type =
|
|
9588
|
+
const message = resolveLocalizedText2(data.message, language);
|
|
9589
|
+
const title = resolveLocalizedText2(data.title, language);
|
|
9590
|
+
const tool = resolveLocalizedText2(data.tool, language);
|
|
9591
|
+
const type = resolveLocalizedText2(data.type, language);
|
|
9519
9592
|
if (status === "running") {
|
|
9520
9593
|
return message ?? title ?? tool ?? type ?? "Tool";
|
|
9521
9594
|
}
|
|
@@ -9609,8 +9682,8 @@ function shouldUseToolsetAvatar(toolset) {
|
|
|
9609
9682
|
}
|
|
9610
9683
|
function useToolsetAvatar(toolsetId, enabled, apiUrl) {
|
|
9611
9684
|
const avatarUrl = enabled ? createToolsetAvatarUrl(toolsetId, apiUrl) : null;
|
|
9612
|
-
const [avatar, setAvatar] =
|
|
9613
|
-
|
|
9685
|
+
const [avatar, setAvatar] = React31.useState(null);
|
|
9686
|
+
React31.useEffect(() => {
|
|
9614
9687
|
if (!avatarUrl) {
|
|
9615
9688
|
setAvatar(null);
|
|
9616
9689
|
return;
|
|
@@ -9642,7 +9715,7 @@ function ToolAvatarIcon({
|
|
|
9642
9715
|
className
|
|
9643
9716
|
}) {
|
|
9644
9717
|
if (avatar.url) {
|
|
9645
|
-
return /* @__PURE__ */
|
|
9718
|
+
return /* @__PURE__ */ jsx36(
|
|
9646
9719
|
"img",
|
|
9647
9720
|
{
|
|
9648
9721
|
alt: "",
|
|
@@ -9655,7 +9728,7 @@ function ToolAvatarIcon({
|
|
|
9655
9728
|
}
|
|
9656
9729
|
const emoji = unicodeFromUnified2(avatar.emoji?.unified);
|
|
9657
9730
|
if (emoji) {
|
|
9658
|
-
return /* @__PURE__ */
|
|
9731
|
+
return /* @__PURE__ */ jsx36(
|
|
9659
9732
|
"span",
|
|
9660
9733
|
{
|
|
9661
9734
|
"aria-hidden": "true",
|
|
@@ -9670,7 +9743,7 @@ function ToolAvatarIcon({
|
|
|
9670
9743
|
}
|
|
9671
9744
|
);
|
|
9672
9745
|
}
|
|
9673
|
-
return /* @__PURE__ */
|
|
9746
|
+
return /* @__PURE__ */ jsx36(
|
|
9674
9747
|
CircleHelp,
|
|
9675
9748
|
{
|
|
9676
9749
|
className,
|
|
@@ -9707,7 +9780,7 @@ function getStepTypeIcon(type) {
|
|
|
9707
9780
|
if (!normalized) return null;
|
|
9708
9781
|
switch (normalized) {
|
|
9709
9782
|
case "file":
|
|
9710
|
-
return
|
|
9783
|
+
return FileText3;
|
|
9711
9784
|
case "files":
|
|
9712
9785
|
return Files;
|
|
9713
9786
|
case "program":
|
|
@@ -9733,12 +9806,12 @@ function ToolStepIcon({
|
|
|
9733
9806
|
apiUrl
|
|
9734
9807
|
);
|
|
9735
9808
|
const iconUrl = createToolsetIconUrl(data.toolset, organizationId, apiUrl);
|
|
9736
|
-
const [failedIconUrl, setFailedIconUrl] =
|
|
9737
|
-
|
|
9809
|
+
const [failedIconUrl, setFailedIconUrl] = React31.useState(null);
|
|
9810
|
+
React31.useEffect(() => {
|
|
9738
9811
|
setFailedIconUrl(null);
|
|
9739
9812
|
}, [iconUrl]);
|
|
9740
9813
|
if (avatar) {
|
|
9741
|
-
return /* @__PURE__ */
|
|
9814
|
+
return /* @__PURE__ */ jsx36(
|
|
9742
9815
|
ToolAvatarIcon,
|
|
9743
9816
|
{
|
|
9744
9817
|
avatar,
|
|
@@ -9748,7 +9821,7 @@ function ToolStepIcon({
|
|
|
9748
9821
|
);
|
|
9749
9822
|
}
|
|
9750
9823
|
if (iconUrl && failedIconUrl !== iconUrl) {
|
|
9751
|
-
return /* @__PURE__ */
|
|
9824
|
+
return /* @__PURE__ */ jsx36(
|
|
9752
9825
|
"img",
|
|
9753
9826
|
{
|
|
9754
9827
|
alt: "",
|
|
@@ -9762,7 +9835,7 @@ function ToolStepIcon({
|
|
|
9762
9835
|
}
|
|
9763
9836
|
const TypeIcon = getStepTypeIcon(data.type);
|
|
9764
9837
|
if (TypeIcon) {
|
|
9765
|
-
return /* @__PURE__ */
|
|
9838
|
+
return /* @__PURE__ */ jsx36(
|
|
9766
9839
|
TypeIcon,
|
|
9767
9840
|
{
|
|
9768
9841
|
className,
|
|
@@ -9773,7 +9846,7 @@ function ToolStepIcon({
|
|
|
9773
9846
|
}
|
|
9774
9847
|
const ToolsetIcon = getKnownToolsetIcon(data.toolset);
|
|
9775
9848
|
if (ToolsetIcon) {
|
|
9776
|
-
return /* @__PURE__ */
|
|
9849
|
+
return /* @__PURE__ */ jsx36(
|
|
9777
9850
|
ToolsetIcon,
|
|
9778
9851
|
{
|
|
9779
9852
|
className,
|
|
@@ -9783,7 +9856,7 @@ function ToolStepIcon({
|
|
|
9783
9856
|
);
|
|
9784
9857
|
}
|
|
9785
9858
|
if (usesToolsetAvatar) {
|
|
9786
|
-
return /* @__PURE__ */
|
|
9859
|
+
return /* @__PURE__ */ jsx36(
|
|
9787
9860
|
CircleHelp,
|
|
9788
9861
|
{
|
|
9789
9862
|
className,
|
|
@@ -9792,7 +9865,7 @@ function ToolStepIcon({
|
|
|
9792
9865
|
}
|
|
9793
9866
|
);
|
|
9794
9867
|
}
|
|
9795
|
-
return /* @__PURE__ */
|
|
9868
|
+
return /* @__PURE__ */ jsx36(
|
|
9796
9869
|
CircleHelp,
|
|
9797
9870
|
{
|
|
9798
9871
|
className,
|
|
@@ -9806,15 +9879,15 @@ function ToolCallCopyButton({
|
|
|
9806
9879
|
className
|
|
9807
9880
|
}) {
|
|
9808
9881
|
const { t } = useChatkitTranslation();
|
|
9809
|
-
const [isCopied, setIsCopied] =
|
|
9810
|
-
const resetTimeoutRef =
|
|
9811
|
-
const clearResetTimeout =
|
|
9882
|
+
const [isCopied, setIsCopied] = React31.useState(false);
|
|
9883
|
+
const resetTimeoutRef = React31.useRef(null);
|
|
9884
|
+
const clearResetTimeout = React31.useCallback(() => {
|
|
9812
9885
|
if (resetTimeoutRef.current === null) return;
|
|
9813
9886
|
window.clearTimeout(resetTimeoutRef.current);
|
|
9814
9887
|
resetTimeoutRef.current = null;
|
|
9815
9888
|
}, []);
|
|
9816
|
-
|
|
9817
|
-
const handleCopy =
|
|
9889
|
+
React31.useEffect(() => clearResetTimeout, [clearResetTimeout]);
|
|
9890
|
+
const handleCopy = React31.useCallback(() => {
|
|
9818
9891
|
if (typeof navigator === "undefined" || !navigator.clipboard) return;
|
|
9819
9892
|
void navigator.clipboard.writeText(value).then(() => {
|
|
9820
9893
|
setIsCopied(true);
|
|
@@ -9826,7 +9899,7 @@ function ToolCallCopyButton({
|
|
|
9826
9899
|
}).catch(() => void 0);
|
|
9827
9900
|
}, [clearResetTimeout, value]);
|
|
9828
9901
|
const label = isCopied ? t("message.toolGroup.copied") : t("message.toolGroup.copy");
|
|
9829
|
-
return /* @__PURE__ */
|
|
9902
|
+
return /* @__PURE__ */ jsx36(
|
|
9830
9903
|
"button",
|
|
9831
9904
|
{
|
|
9832
9905
|
type: "button",
|
|
@@ -9837,7 +9910,7 @@ function ToolCallCopyButton({
|
|
|
9837
9910
|
"aria-label": label,
|
|
9838
9911
|
title: label,
|
|
9839
9912
|
onClick: handleCopy,
|
|
9840
|
-
children: isCopied ? /* @__PURE__ */
|
|
9913
|
+
children: isCopied ? /* @__PURE__ */ jsx36(Check4, { className: "h-3.5 w-3.5", "aria-hidden": "true" }) : /* @__PURE__ */ jsx36(Copy2, { className: "h-3.5 w-3.5", "aria-hidden": "true" })
|
|
9841
9914
|
}
|
|
9842
9915
|
);
|
|
9843
9916
|
}
|
|
@@ -9848,28 +9921,28 @@ function ToolCallValueBlock({
|
|
|
9848
9921
|
const { t } = useChatkitTranslation();
|
|
9849
9922
|
const detected = detectJsonValue(value);
|
|
9850
9923
|
if (detected.kind === "text") {
|
|
9851
|
-
return /* @__PURE__ */
|
|
9852
|
-
/* @__PURE__ */
|
|
9853
|
-
/* @__PURE__ */
|
|
9924
|
+
return /* @__PURE__ */ jsxs24("div", { className: "min-w-0 space-y-1", children: [
|
|
9925
|
+
/* @__PURE__ */ jsx36("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx36(ToolCallCopyButton, { value: detected.text }) }),
|
|
9926
|
+
/* @__PURE__ */ jsx36(PlainTextBlock, { value: detected.text, destructive })
|
|
9854
9927
|
] });
|
|
9855
9928
|
}
|
|
9856
|
-
return /* @__PURE__ */
|
|
9857
|
-
/* @__PURE__ */
|
|
9858
|
-
/* @__PURE__ */
|
|
9929
|
+
return /* @__PURE__ */ jsxs24(Tabs, { defaultValue: "tree", className: "min-w-0", children: [
|
|
9930
|
+
/* @__PURE__ */ jsxs24("div", { className: "mb-2 flex min-w-0 items-center justify-between gap-2", children: [
|
|
9931
|
+
/* @__PURE__ */ jsxs24("span", { className: "min-w-0 truncate text-[11px] text-muted-foreground", children: [
|
|
9859
9932
|
t("message.toolGroup.jsonTitle"),
|
|
9860
9933
|
" \xB7 ",
|
|
9861
9934
|
getJsonValueSummary(detected.value)
|
|
9862
9935
|
] }),
|
|
9863
|
-
/* @__PURE__ */
|
|
9864
|
-
/* @__PURE__ */
|
|
9865
|
-
/* @__PURE__ */
|
|
9866
|
-
/* @__PURE__ */
|
|
9867
|
-
/* @__PURE__ */
|
|
9936
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
9937
|
+
/* @__PURE__ */ jsx36(ToolCallCopyButton, { value: detected.raw }),
|
|
9938
|
+
/* @__PURE__ */ jsxs24(TabsList, { className: "rounded-md p-0.5", children: [
|
|
9939
|
+
/* @__PURE__ */ jsx36(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "tree", children: t("message.toolGroup.jsonTree") }),
|
|
9940
|
+
/* @__PURE__ */ jsx36(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "raw", children: t("message.toolGroup.jsonRaw") })
|
|
9868
9941
|
] })
|
|
9869
9942
|
] })
|
|
9870
9943
|
] }),
|
|
9871
|
-
/* @__PURE__ */
|
|
9872
|
-
/* @__PURE__ */
|
|
9944
|
+
/* @__PURE__ */ jsx36(TabsContent, { value: "tree", className: "mt-0", children: /* @__PURE__ */ jsx36(JsonTreeView, { value: detected.value }) }),
|
|
9945
|
+
/* @__PURE__ */ jsx36(TabsContent, { value: "raw", className: "mt-0", children: /* @__PURE__ */ jsx36(RawJsonBlock, { raw: detected.raw }) })
|
|
9873
9946
|
] });
|
|
9874
9947
|
}
|
|
9875
9948
|
function DefaultToolCallOutput({ data }) {
|
|
@@ -9877,40 +9950,40 @@ function DefaultToolCallOutput({ data }) {
|
|
|
9877
9950
|
const output = data.output ?? null;
|
|
9878
9951
|
const error = data.error ?? null;
|
|
9879
9952
|
if (error) {
|
|
9880
|
-
return /* @__PURE__ */
|
|
9881
|
-
/* @__PURE__ */
|
|
9882
|
-
/* @__PURE__ */
|
|
9953
|
+
return /* @__PURE__ */ jsxs24("div", { className: "space-y-1", children: [
|
|
9954
|
+
/* @__PURE__ */ jsx36("div", { className: "text-[11px] font-medium text-destructive", children: t("message.toolGroup.errorTitle") }),
|
|
9955
|
+
/* @__PURE__ */ jsx36(ToolCallValueBlock, { value: error, destructive: true })
|
|
9883
9956
|
] });
|
|
9884
9957
|
}
|
|
9885
9958
|
if (output === null) return null;
|
|
9886
|
-
return /* @__PURE__ */
|
|
9887
|
-
/* @__PURE__ */
|
|
9888
|
-
/* @__PURE__ */
|
|
9959
|
+
return /* @__PURE__ */ jsxs24("div", { className: "space-y-1", children: [
|
|
9960
|
+
/* @__PURE__ */ jsx36("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.toolGroup.outputTitle") }),
|
|
9961
|
+
/* @__PURE__ */ jsx36(ToolCallValueBlock, { value: output })
|
|
9889
9962
|
] });
|
|
9890
9963
|
}
|
|
9891
9964
|
function ToolCallDetails({ content }) {
|
|
9892
9965
|
const { t } = useChatkitTranslation();
|
|
9893
9966
|
const data = getToolStepData(content);
|
|
9894
9967
|
if (isSandboxShellStep(data)) {
|
|
9895
|
-
return /* @__PURE__ */
|
|
9968
|
+
return /* @__PURE__ */ jsx36("div", { className: "ml-2 mt-1", children: /* @__PURE__ */ jsx36(SandboxShellToolCallCard, { data }) });
|
|
9896
9969
|
}
|
|
9897
9970
|
const renderer = getComponentMessageRenderer(content, data);
|
|
9898
9971
|
const hasCustomDetails = data.error === void 0 && hasComponentMessageRendererDetails(renderer, content, data);
|
|
9899
9972
|
const CustomDetailsRenderer = hasCustomDetails ? renderer?.renderDetails : void 0;
|
|
9900
9973
|
if (CustomDetailsRenderer) {
|
|
9901
|
-
return /* @__PURE__ */
|
|
9974
|
+
return /* @__PURE__ */ jsx36("div", { className: "ml-6 mt-1 max-h-60 overflow-auto rounded-md bg-muted/30 text-xs text-muted-foreground", children: /* @__PURE__ */ jsx36(CustomDetailsRenderer, { content, data }) });
|
|
9902
9975
|
}
|
|
9903
9976
|
const OutputRenderer = getToolCallOutputRenderer(data);
|
|
9904
9977
|
const hasInput = data.input !== void 0 && data.input !== null;
|
|
9905
9978
|
const hasOutput = data.error !== void 0 || data.output !== void 0;
|
|
9906
9979
|
if (!hasInput && !hasOutput) return null;
|
|
9907
|
-
return /* @__PURE__ */
|
|
9908
|
-
hasInput && /* @__PURE__ */
|
|
9909
|
-
/* @__PURE__ */
|
|
9910
|
-
/* @__PURE__ */
|
|
9980
|
+
return /* @__PURE__ */ jsxs24("div", { className: "ml-6 mt-1 max-h-60 overflow-auto rounded-md bg-muted/30 px-3 py-2 text-xs text-muted-foreground", children: [
|
|
9981
|
+
hasInput && /* @__PURE__ */ jsxs24("div", { className: "space-y-1", children: [
|
|
9982
|
+
/* @__PURE__ */ jsx36("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.toolGroup.inputTitle") }),
|
|
9983
|
+
/* @__PURE__ */ jsx36(ToolCallValueBlock, { value: data.input })
|
|
9911
9984
|
] }),
|
|
9912
|
-
hasInput && hasOutput ? /* @__PURE__ */
|
|
9913
|
-
hasOutput ? /* @__PURE__ */
|
|
9985
|
+
hasInput && hasOutput ? /* @__PURE__ */ jsx36("div", { className: "h-2" }) : null,
|
|
9986
|
+
hasOutput ? /* @__PURE__ */ jsx36(OutputRenderer, { content, data }) : null
|
|
9914
9987
|
] });
|
|
9915
9988
|
}
|
|
9916
9989
|
function areToolCallRowPropsEqual(previous, next) {
|
|
@@ -9927,7 +10000,7 @@ function ToolCallRowContent({
|
|
|
9927
10000
|
const status = getEffectiveToolStepStatus(data, isThreadRunning);
|
|
9928
10001
|
const hasError = status === "fail" || Boolean(data.error);
|
|
9929
10002
|
const isSandboxShell = isSandboxShellStep(data);
|
|
9930
|
-
const detailsId =
|
|
10003
|
+
const detailsId = React31.useId();
|
|
9931
10004
|
const renderer = getComponentMessageRenderer(content, data);
|
|
9932
10005
|
const label = isSandboxShell ? getSandboxShellActivityLabel(data, status, i18n2.language, t) : renderer?.getTitle?.(content, data, i18n2.language) ?? getToolActivityLabel(content, i18n2.language, status);
|
|
9933
10006
|
const hasCustomDetails = data.error === void 0 && hasComponentMessageRendererDetails(renderer, content, data);
|
|
@@ -9939,14 +10012,14 @@ function ToolCallRowContent({
|
|
|
9939
10012
|
status,
|
|
9940
10013
|
fallbackEndedAt
|
|
9941
10014
|
});
|
|
9942
|
-
const [isExpanded, setIsExpanded] =
|
|
9943
|
-
|
|
10015
|
+
const [isExpanded, setIsExpanded] = React31.useState(false);
|
|
10016
|
+
React31.useEffect(() => {
|
|
9944
10017
|
if (status === "running" && data.output !== void 0) {
|
|
9945
10018
|
setIsExpanded(true);
|
|
9946
10019
|
}
|
|
9947
10020
|
}, [data.output, status]);
|
|
9948
|
-
return /* @__PURE__ */
|
|
9949
|
-
/* @__PURE__ */
|
|
10021
|
+
return /* @__PURE__ */ jsxs24("li", { className: "ck-tool-call-row-enter min-w-0", children: [
|
|
10022
|
+
/* @__PURE__ */ jsxs24(
|
|
9950
10023
|
"button",
|
|
9951
10024
|
{
|
|
9952
10025
|
type: "button",
|
|
@@ -9963,7 +10036,7 @@ function ToolCallRowContent({
|
|
|
9963
10036
|
if (hasDetails) setIsExpanded((prev) => !prev);
|
|
9964
10037
|
},
|
|
9965
10038
|
children: [
|
|
9966
|
-
status ? /* @__PURE__ */
|
|
10039
|
+
status ? /* @__PURE__ */ jsx36(
|
|
9967
10040
|
ToolStepIcon,
|
|
9968
10041
|
{
|
|
9969
10042
|
data,
|
|
@@ -9974,8 +10047,8 @@ function ToolCallRowContent({
|
|
|
9974
10047
|
hasError && !isSandboxShell ? "text-destructive" : "text-muted-foreground"
|
|
9975
10048
|
)
|
|
9976
10049
|
}
|
|
9977
|
-
) : /* @__PURE__ */
|
|
9978
|
-
/* @__PURE__ */
|
|
10050
|
+
) : /* @__PURE__ */ jsx36("span", { className: "h-3.5 w-3.5 shrink-0", "aria-hidden": "true" }),
|
|
10051
|
+
/* @__PURE__ */ jsx36(
|
|
9979
10052
|
"span",
|
|
9980
10053
|
{
|
|
9981
10054
|
className: cn(
|
|
@@ -9986,8 +10059,8 @@ function ToolCallRowContent({
|
|
|
9986
10059
|
children: label
|
|
9987
10060
|
}
|
|
9988
10061
|
),
|
|
9989
|
-
durationLabel ? /* @__PURE__ */
|
|
9990
|
-
hasDetails ? /* @__PURE__ */
|
|
10062
|
+
durationLabel ? /* @__PURE__ */ jsx36("span", { className: "shrink-0 text-[11px] tabular-nums text-muted-foreground/80", children: durationLabel }) : null,
|
|
10063
|
+
hasDetails ? /* @__PURE__ */ jsx36(
|
|
9991
10064
|
ChevronRight7,
|
|
9992
10065
|
{
|
|
9993
10066
|
"aria-hidden": "true",
|
|
@@ -10000,10 +10073,10 @@ function ToolCallRowContent({
|
|
|
10000
10073
|
]
|
|
10001
10074
|
}
|
|
10002
10075
|
),
|
|
10003
|
-
hasDetails && isExpanded ? /* @__PURE__ */
|
|
10076
|
+
hasDetails && isExpanded ? /* @__PURE__ */ jsx36("div", { id: detailsId, children: /* @__PURE__ */ jsx36(ToolCallDetails, { content }) }) : null
|
|
10004
10077
|
] });
|
|
10005
10078
|
}
|
|
10006
|
-
var ToolCallRow =
|
|
10079
|
+
var ToolCallRow = React31.memo(ToolCallRowContent, areToolCallRowPropsEqual);
|
|
10007
10080
|
ToolCallRow.displayName = "ToolCallRow";
|
|
10008
10081
|
function ToolComponentGroup({
|
|
10009
10082
|
items,
|
|
@@ -10013,8 +10086,8 @@ function ToolComponentGroup({
|
|
|
10013
10086
|
apiUrl
|
|
10014
10087
|
}) {
|
|
10015
10088
|
const { t } = useChatkitTranslation();
|
|
10016
|
-
const contentId =
|
|
10017
|
-
const [isExpanded, setIsExpanded] =
|
|
10089
|
+
const contentId = React31.useId();
|
|
10090
|
+
const [isExpanded, setIsExpanded] = React31.useState(!hasFollowingItem);
|
|
10018
10091
|
const categoryCounts = getToolGroupCategoryCounts(items);
|
|
10019
10092
|
const categorySummary = TOOL_GROUP_CATEGORY_ORDER.flatMap((category) => {
|
|
10020
10093
|
const count = categoryCounts[category] ?? 0;
|
|
@@ -10029,11 +10102,11 @@ function ToolComponentGroup({
|
|
|
10029
10102
|
const summary = `${t("message.toolGroup.status.success")} ${categorySummary}`;
|
|
10030
10103
|
const config = toolStatusConfig.success;
|
|
10031
10104
|
const StatusIcon = config.icon;
|
|
10032
|
-
|
|
10105
|
+
React31.useEffect(() => {
|
|
10033
10106
|
setIsExpanded(!hasFollowingItem);
|
|
10034
10107
|
}, [hasFollowingItem]);
|
|
10035
|
-
return /* @__PURE__ */
|
|
10036
|
-
/* @__PURE__ */
|
|
10108
|
+
return /* @__PURE__ */ jsxs24("div", { className: "px-1 py-1", children: [
|
|
10109
|
+
/* @__PURE__ */ jsxs24(
|
|
10037
10110
|
"button",
|
|
10038
10111
|
{
|
|
10039
10112
|
type: "button",
|
|
@@ -10042,8 +10115,8 @@ function ToolComponentGroup({
|
|
|
10042
10115
|
"aria-controls": contentId,
|
|
10043
10116
|
onClick: () => setIsExpanded((prev) => !prev),
|
|
10044
10117
|
children: [
|
|
10045
|
-
/* @__PURE__ */
|
|
10046
|
-
/* @__PURE__ */
|
|
10118
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex min-w-0 items-center gap-2 text-sm font-medium text-muted-foreground", children: [
|
|
10119
|
+
/* @__PURE__ */ jsx36(
|
|
10047
10120
|
StatusIcon,
|
|
10048
10121
|
{
|
|
10049
10122
|
className: cn(
|
|
@@ -10052,9 +10125,9 @@ function ToolComponentGroup({
|
|
|
10052
10125
|
)
|
|
10053
10126
|
}
|
|
10054
10127
|
),
|
|
10055
|
-
/* @__PURE__ */
|
|
10128
|
+
/* @__PURE__ */ jsx36("span", { className: "truncate", children: summary })
|
|
10056
10129
|
] }),
|
|
10057
|
-
/* @__PURE__ */
|
|
10130
|
+
/* @__PURE__ */ jsx36(
|
|
10058
10131
|
ChevronRight7,
|
|
10059
10132
|
{
|
|
10060
10133
|
"aria-hidden": "true",
|
|
@@ -10067,7 +10140,7 @@ function ToolComponentGroup({
|
|
|
10067
10140
|
]
|
|
10068
10141
|
}
|
|
10069
10142
|
),
|
|
10070
|
-
isExpanded && /* @__PURE__ */
|
|
10143
|
+
isExpanded && /* @__PURE__ */ jsx36("ul", { id: contentId, className: "mt-2 space-y-1.5 overflow-y-auto pr-1", children: items.map((item, index) => /* @__PURE__ */ jsx36(
|
|
10071
10144
|
ToolCallRow,
|
|
10072
10145
|
{
|
|
10073
10146
|
content: item,
|
|
@@ -10087,7 +10160,7 @@ import {
|
|
|
10087
10160
|
REQUEST_USER_INPUT_TOOL_NAME as REQUEST_USER_INPUT_TOOL_NAME2
|
|
10088
10161
|
} from "@xpert-ai/chatkit-types";
|
|
10089
10162
|
import { CheckCircle2 as CheckCircle24 } from "lucide-react";
|
|
10090
|
-
import { jsx as
|
|
10163
|
+
import { jsx as jsx37, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
10091
10164
|
function isRecord3(value) {
|
|
10092
10165
|
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
10093
10166
|
}
|
|
@@ -10199,7 +10272,7 @@ function RequestUserInputResultCard({
|
|
|
10199
10272
|
className
|
|
10200
10273
|
}) {
|
|
10201
10274
|
const { t } = useChatkitTranslation();
|
|
10202
|
-
return /* @__PURE__ */
|
|
10275
|
+
return /* @__PURE__ */ jsxs25(
|
|
10203
10276
|
"section",
|
|
10204
10277
|
{
|
|
10205
10278
|
"aria-label": t("message.requestUserInputResult.title"),
|
|
@@ -10208,23 +10281,23 @@ function RequestUserInputResultCard({
|
|
|
10208
10281
|
className
|
|
10209
10282
|
),
|
|
10210
10283
|
children: [
|
|
10211
|
-
/* @__PURE__ */
|
|
10212
|
-
/* @__PURE__ */
|
|
10213
|
-
/* @__PURE__ */
|
|
10284
|
+
/* @__PURE__ */ jsxs25("div", { className: "mb-2 flex items-center gap-2 text-sm font-semibold text-foreground", children: [
|
|
10285
|
+
/* @__PURE__ */ jsx37(CheckCircle24, { className: "h-4 w-4 text-primary" }),
|
|
10286
|
+
/* @__PURE__ */ jsx37("span", { children: t("message.requestUserInputResult.title") })
|
|
10214
10287
|
] }),
|
|
10215
|
-
/* @__PURE__ */
|
|
10288
|
+
/* @__PURE__ */ jsx37("div", { className: "space-y-2", children: result.answers.map((answer, index) => /* @__PURE__ */ jsxs25(
|
|
10216
10289
|
"div",
|
|
10217
10290
|
{
|
|
10218
10291
|
className: "rounded-md bg-background/70 px-2.5 py-2",
|
|
10219
10292
|
children: [
|
|
10220
|
-
/* @__PURE__ */
|
|
10221
|
-
/* @__PURE__ */
|
|
10222
|
-
/* @__PURE__ */
|
|
10223
|
-
/* @__PURE__ */
|
|
10293
|
+
/* @__PURE__ */ jsx37("div", { className: "text-xs font-medium leading-5 text-muted-foreground", children: answer.question }),
|
|
10294
|
+
/* @__PURE__ */ jsxs25("div", { className: "mt-0.5 flex min-w-0 flex-wrap items-center gap-1.5", children: [
|
|
10295
|
+
/* @__PURE__ */ jsx37("span", { className: "min-w-0 wrap-break-word text-sm font-semibold text-foreground", children: answer.label ?? answer.value }),
|
|
10296
|
+
/* @__PURE__ */ jsx37("span", { className: "rounded-full bg-muted px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground", children: t(
|
|
10224
10297
|
answer.type === "other" ? "message.requestUserInputResult.other" : "message.requestUserInputResult.option"
|
|
10225
10298
|
) })
|
|
10226
10299
|
] }),
|
|
10227
|
-
answer.description ? /* @__PURE__ */
|
|
10300
|
+
answer.description ? /* @__PURE__ */ jsx37("div", { className: "mt-1 text-xs leading-5 text-muted-foreground", children: answer.description }) : null
|
|
10228
10301
|
]
|
|
10229
10302
|
},
|
|
10230
10303
|
`${answer.id}-${index}`
|
|
@@ -10236,18 +10309,18 @@ function RequestUserInputResultCard({
|
|
|
10236
10309
|
|
|
10237
10310
|
// src/components/thread/messages/widget.tsx
|
|
10238
10311
|
import { SurfaceRenderer } from "@xpert-ai/a2ui-react";
|
|
10239
|
-
import { jsx as
|
|
10312
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
10240
10313
|
function WidgetMessage({ messageId, data }) {
|
|
10241
10314
|
const widgets = Array.isArray(data.widgets) ? data.widgets : [];
|
|
10242
10315
|
if (widgets.length === 0) return null;
|
|
10243
10316
|
const baseSurfaceId = `widget-${messageId}`;
|
|
10244
|
-
return /* @__PURE__ */
|
|
10317
|
+
return /* @__PURE__ */ jsx38("div", { className: "space-y-3", children: widgets.map((widget, index) => {
|
|
10245
10318
|
const config = widget?.config;
|
|
10246
10319
|
if (!config || typeof config !== "object") {
|
|
10247
10320
|
return null;
|
|
10248
10321
|
}
|
|
10249
10322
|
const surfaceId = widgets.length > 1 ? `${baseSurfaceId}-${index}` : baseSurfaceId;
|
|
10250
|
-
return /* @__PURE__ */
|
|
10323
|
+
return /* @__PURE__ */ jsx38(
|
|
10251
10324
|
SurfaceRenderer,
|
|
10252
10325
|
{
|
|
10253
10326
|
surfaceId,
|
|
@@ -10259,7 +10332,7 @@ function WidgetMessage({ messageId, data }) {
|
|
|
10259
10332
|
}
|
|
10260
10333
|
|
|
10261
10334
|
// src/components/thread/messages/ai.tsx
|
|
10262
|
-
import { jsx as
|
|
10335
|
+
import { jsx as jsx39, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
10263
10336
|
var assistantMessageStackClassName = "space-y-3 in-data-[density=compact]:space-y-2 in-data-[density=spacious]:space-y-4";
|
|
10264
10337
|
function isTextContent3(content) {
|
|
10265
10338
|
return content.type === "text";
|
|
@@ -10290,14 +10363,16 @@ function safeJson3(value) {
|
|
|
10290
10363
|
function formatDisplayValue3(value) {
|
|
10291
10364
|
return typeof value === "string" ? value : safeJson3(value);
|
|
10292
10365
|
}
|
|
10293
|
-
function ReasoningBlock({
|
|
10366
|
+
function ReasoningBlock({
|
|
10367
|
+
reasoning
|
|
10368
|
+
}) {
|
|
10294
10369
|
const blocks = reasoning.filter((item) => item.text?.trim());
|
|
10295
10370
|
if (blocks.length === 0) return null;
|
|
10296
|
-
return /* @__PURE__ */
|
|
10371
|
+
return /* @__PURE__ */ jsx39("div", { className: "space-y-2", children: blocks.map((item, index) => /* @__PURE__ */ jsx39(
|
|
10297
10372
|
"div",
|
|
10298
10373
|
{
|
|
10299
10374
|
className: "rounded-lg border bg-muted/40 p-3 text-xs text-muted-foreground",
|
|
10300
|
-
children: /* @__PURE__ */
|
|
10375
|
+
children: /* @__PURE__ */ jsx39("p", { className: "whitespace-pre-wrap wrap-break-word leading-relaxed", children: item.text })
|
|
10301
10376
|
},
|
|
10302
10377
|
item.id ?? `reasoning-${index}`
|
|
10303
10378
|
)) });
|
|
@@ -10305,20 +10380,27 @@ function ReasoningBlock({ reasoning }) {
|
|
|
10305
10380
|
function ImageBlock({ content }) {
|
|
10306
10381
|
const imageUrl = typeof content.image_url === "string" ? content.image_url : typeof content.image_url?.url === "string" ? content.image_url.url : null;
|
|
10307
10382
|
if (!imageUrl) {
|
|
10308
|
-
return /* @__PURE__ */
|
|
10309
|
-
/* @__PURE__ */
|
|
10310
|
-
/* @__PURE__ */
|
|
10383
|
+
return /* @__PURE__ */ jsxs26(Card, { children: [
|
|
10384
|
+
/* @__PURE__ */ jsx39(CardHeader, { className: "space-y-1", children: /* @__PURE__ */ jsx39(CardTitle, { className: "text-sm", children: "Image" }) }),
|
|
10385
|
+
/* @__PURE__ */ jsx39(CardContent, { className: "text-xs text-muted-foreground", children: safeJson3(content) })
|
|
10311
10386
|
] });
|
|
10312
10387
|
}
|
|
10313
|
-
return /* @__PURE__ */
|
|
10388
|
+
return /* @__PURE__ */ jsx39("figure", { className: "overflow-hidden rounded-lg border bg-background", children: /* @__PURE__ */ jsx39(
|
|
10389
|
+
"img",
|
|
10390
|
+
{
|
|
10391
|
+
src: imageUrl,
|
|
10392
|
+
alt: "Assistant output",
|
|
10393
|
+
className: "h-auto w-full object-cover"
|
|
10394
|
+
}
|
|
10395
|
+
) });
|
|
10314
10396
|
}
|
|
10315
10397
|
function MemoryBlock({ content }) {
|
|
10316
|
-
return /* @__PURE__ */
|
|
10317
|
-
/* @__PURE__ */
|
|
10318
|
-
/* @__PURE__ */
|
|
10319
|
-
/* @__PURE__ */
|
|
10398
|
+
return /* @__PURE__ */ jsxs26(Card, { children: [
|
|
10399
|
+
/* @__PURE__ */ jsxs26(CardHeader, { className: "flex flex-row items-center justify-between gap-2", children: [
|
|
10400
|
+
/* @__PURE__ */ jsx39(CardTitle, { className: "text-sm", children: "Memory" }),
|
|
10401
|
+
/* @__PURE__ */ jsx39(Badge, { variant: "secondary", children: "Memory" })
|
|
10320
10402
|
] }),
|
|
10321
|
-
/* @__PURE__ */
|
|
10403
|
+
/* @__PURE__ */ jsx39(CardContent, { className: "text-xs text-muted-foreground", children: /* @__PURE__ */ jsx39("pre", { className: "whitespace-pre-wrap wrap-break-word", children: safeJson3(content.data ?? []) }) })
|
|
10322
10404
|
] });
|
|
10323
10405
|
}
|
|
10324
10406
|
function parseStepDate2(value) {
|
|
@@ -10352,11 +10434,11 @@ function formatStepDuration3(durationMs) {
|
|
|
10352
10434
|
}
|
|
10353
10435
|
function ComponentBlock({ content }) {
|
|
10354
10436
|
const { i18n: i18n2 } = useChatkitTranslation();
|
|
10355
|
-
const [isExpanded, setIsExpanded] =
|
|
10356
|
-
const contentRef =
|
|
10357
|
-
const shouldAutoScrollRef =
|
|
10358
|
-
const previousScrollTopRef =
|
|
10359
|
-
const [durationNow, setDurationNow] =
|
|
10437
|
+
const [isExpanded, setIsExpanded] = React33.useState(false);
|
|
10438
|
+
const contentRef = React33.useRef(null);
|
|
10439
|
+
const shouldAutoScrollRef = React33.useRef(true);
|
|
10440
|
+
const previousScrollTopRef = React33.useRef(0);
|
|
10441
|
+
const [durationNow, setDurationNow] = React33.useState(() => Date.now());
|
|
10360
10442
|
const data = getToolStepData(content);
|
|
10361
10443
|
const category = data.category ?? "Component";
|
|
10362
10444
|
const title = getToolActivityLabel(content, i18n2.language);
|
|
@@ -10370,10 +10452,10 @@ function ComponentBlock({ content }) {
|
|
|
10370
10452
|
const endedAt = parseStepDate2(data.end_date);
|
|
10371
10453
|
const durationMs = createdAt === null ? null : Math.max(0, (endedAt ?? durationNow) - createdAt);
|
|
10372
10454
|
const durationLabel = durationMs === null ? null : formatStepDuration3(durationMs);
|
|
10373
|
-
|
|
10455
|
+
React33.useEffect(() => {
|
|
10374
10456
|
if (status === "running" && output !== null) setIsExpanded(true);
|
|
10375
10457
|
}, [status, output]);
|
|
10376
|
-
|
|
10458
|
+
React33.useEffect(() => {
|
|
10377
10459
|
if (status !== "running" || createdAt === null || endedAt !== null) {
|
|
10378
10460
|
return;
|
|
10379
10461
|
}
|
|
@@ -10385,7 +10467,7 @@ function ComponentBlock({ content }) {
|
|
|
10385
10467
|
window.clearInterval(timer);
|
|
10386
10468
|
};
|
|
10387
10469
|
}, [createdAt, endedAt, status]);
|
|
10388
|
-
|
|
10470
|
+
React33.useEffect(() => {
|
|
10389
10471
|
const element = contentRef.current;
|
|
10390
10472
|
if (!element) return;
|
|
10391
10473
|
previousScrollTopRef.current = element.scrollTop;
|
|
@@ -10400,12 +10482,14 @@ function ComponentBlock({ content }) {
|
|
|
10400
10482
|
shouldAutoScrollRef.current = isNearBottom(element);
|
|
10401
10483
|
};
|
|
10402
10484
|
updateAutoScrollState();
|
|
10403
|
-
element.addEventListener("scroll", updateAutoScrollState, {
|
|
10485
|
+
element.addEventListener("scroll", updateAutoScrollState, {
|
|
10486
|
+
passive: true
|
|
10487
|
+
});
|
|
10404
10488
|
return () => {
|
|
10405
10489
|
element.removeEventListener("scroll", updateAutoScrollState);
|
|
10406
10490
|
};
|
|
10407
10491
|
}, [isExpanded]);
|
|
10408
|
-
|
|
10492
|
+
React33.useEffect(() => {
|
|
10409
10493
|
if (status !== "running") {
|
|
10410
10494
|
shouldAutoScrollRef.current = true;
|
|
10411
10495
|
return;
|
|
@@ -10418,76 +10502,112 @@ function ComponentBlock({ content }) {
|
|
|
10418
10502
|
}, [isExpanded, output, status]);
|
|
10419
10503
|
const config = status ? toolStatusConfig[status] : null;
|
|
10420
10504
|
const StatusIcon = config?.icon;
|
|
10421
|
-
return /* @__PURE__ */
|
|
10422
|
-
/* @__PURE__ */
|
|
10423
|
-
|
|
10424
|
-
|
|
10425
|
-
|
|
10426
|
-
|
|
10427
|
-
|
|
10428
|
-
|
|
10429
|
-
|
|
10430
|
-
|
|
10431
|
-
|
|
10432
|
-
|
|
10433
|
-
|
|
10434
|
-
|
|
10435
|
-
|
|
10436
|
-
|
|
10437
|
-
|
|
10438
|
-
|
|
10439
|
-
|
|
10505
|
+
return /* @__PURE__ */ jsxs26(Card, { children: [
|
|
10506
|
+
/* @__PURE__ */ jsxs26(
|
|
10507
|
+
CardHeader,
|
|
10508
|
+
{
|
|
10509
|
+
className: "flex flex-row items-center justify-between gap-2 px-2 py-1 cursor-pointer",
|
|
10510
|
+
onClick: () => setIsExpanded(!isExpanded),
|
|
10511
|
+
children: [
|
|
10512
|
+
/* @__PURE__ */ jsxs26("div", { className: "flex items-center space-x-1 flex-1 min-w-0", children: [
|
|
10513
|
+
status && StatusIcon && /* @__PURE__ */ jsx39(
|
|
10514
|
+
StatusIcon,
|
|
10515
|
+
{
|
|
10516
|
+
className: cn(
|
|
10517
|
+
"h-4 w-4",
|
|
10518
|
+
config?.iconClass,
|
|
10519
|
+
status === "running" && "animate-spin"
|
|
10520
|
+
)
|
|
10521
|
+
}
|
|
10522
|
+
),
|
|
10523
|
+
/* @__PURE__ */ jsx39(CardTitle, { className: "text-sm truncate", children: title })
|
|
10524
|
+
] }),
|
|
10525
|
+
/* @__PURE__ */ jsxs26("div", { className: "flex flex-wrap items-center gap-2 shrink-0", children: [
|
|
10526
|
+
durationLabel && /* @__PURE__ */ jsxs26("div", { className: "inline-flex items-center gap-1 text-[11px] text-muted-foreground tabular-nums", children: [
|
|
10527
|
+
/* @__PURE__ */ jsx39(Clock32, { className: "h-3 w-3" }),
|
|
10528
|
+
/* @__PURE__ */ jsx39("span", { children: durationLabel })
|
|
10529
|
+
] }),
|
|
10530
|
+
/* @__PURE__ */ jsx39(Badge, { variant: "secondary", className: "rounded-lg px-1.5", children: category }),
|
|
10531
|
+
/* @__PURE__ */ jsx39(
|
|
10532
|
+
"button",
|
|
10440
10533
|
{
|
|
10441
|
-
className:
|
|
10534
|
+
className: "text-muted-foreground hover:text-foreground transition-colors",
|
|
10535
|
+
"aria-label": isExpanded ? "Collapse" : "Expand",
|
|
10536
|
+
children: /* @__PURE__ */ jsx39(
|
|
10537
|
+
ChevronDown4,
|
|
10538
|
+
{
|
|
10539
|
+
className: cn(
|
|
10540
|
+
"h-4 w-4 transition-transform",
|
|
10541
|
+
isExpanded && "rotate-180"
|
|
10542
|
+
)
|
|
10543
|
+
}
|
|
10544
|
+
)
|
|
10442
10545
|
}
|
|
10443
10546
|
)
|
|
10444
|
-
}
|
|
10445
|
-
|
|
10446
|
-
|
|
10447
|
-
|
|
10448
|
-
isExpanded && /* @__PURE__ */
|
|
10449
|
-
|
|
10450
|
-
|
|
10451
|
-
|
|
10547
|
+
] })
|
|
10548
|
+
]
|
|
10549
|
+
}
|
|
10550
|
+
),
|
|
10551
|
+
isExpanded && /* @__PURE__ */ jsxs26(
|
|
10552
|
+
CardContent,
|
|
10553
|
+
{
|
|
10554
|
+
ref: contentRef,
|
|
10555
|
+
className: "text-xs text-muted-foreground max-h-60 overflow-auto",
|
|
10556
|
+
children: [
|
|
10557
|
+
data.input && /* @__PURE__ */ jsx39("pre", { className: "whitespace-pre-wrap wrap-break-word", children: formatDisplayValue3(data.input) }),
|
|
10558
|
+
error ? /* @__PURE__ */ jsx39("pre", { className: "whitespace-pre-wrap wrap-break-word text-destructive", children: formatDisplayValue3(error) }) : hasOutput && /* @__PURE__ */ jsx39("pre", { className: "whitespace-pre-wrap wrap-break-word", children: formatDisplayValue3(fallback) })
|
|
10559
|
+
]
|
|
10560
|
+
}
|
|
10561
|
+
)
|
|
10452
10562
|
] });
|
|
10453
10563
|
}
|
|
10454
10564
|
function UnknownBlock({ content }) {
|
|
10455
|
-
return /* @__PURE__ */
|
|
10456
|
-
/* @__PURE__ */
|
|
10457
|
-
/* @__PURE__ */
|
|
10458
|
-
/* @__PURE__ */
|
|
10565
|
+
return /* @__PURE__ */ jsxs26(Card, { children: [
|
|
10566
|
+
/* @__PURE__ */ jsxs26(CardHeader, { className: "flex flex-row items-center justify-between gap-2", children: [
|
|
10567
|
+
/* @__PURE__ */ jsx39(CardTitle, { className: "text-sm", children: "Assistant Content" }),
|
|
10568
|
+
/* @__PURE__ */ jsx39(Badge, { variant: "outline", children: content.type ?? "unknown" })
|
|
10459
10569
|
] }),
|
|
10460
|
-
/* @__PURE__ */
|
|
10570
|
+
/* @__PURE__ */ jsx39(CardContent, { className: "text-xs text-muted-foreground", children: /* @__PURE__ */ jsx39("pre", { className: "whitespace-pre-wrap break-words", children: safeJson3(content) }) })
|
|
10461
10571
|
] });
|
|
10462
10572
|
}
|
|
10463
10573
|
function renderContentItem(content, index, message, lookupMessages, options) {
|
|
10464
10574
|
const messageId = message.id;
|
|
10465
10575
|
const textClassName = options?.isAgentOutput ? "text-sm [&_.markdown-content_p]:!leading-6" : void 0;
|
|
10466
10576
|
if (typeof content === "string") {
|
|
10467
|
-
return /* @__PURE__ */
|
|
10577
|
+
return /* @__PURE__ */ jsx39("div", { className: textClassName, children: /* @__PURE__ */ jsx39(MarkdownText, { children: content }) }, `text-${index}`);
|
|
10468
10578
|
}
|
|
10469
10579
|
if (isTextContent3(content)) {
|
|
10470
|
-
return /* @__PURE__ */
|
|
10580
|
+
return /* @__PURE__ */ jsx39("div", { className: textClassName, children: /* @__PURE__ */ jsx39(MarkdownText, { children: content.text }) }, content.id ?? `text-${index}`);
|
|
10471
10581
|
}
|
|
10472
10582
|
if (isReasoningContent3(content)) {
|
|
10473
|
-
return /* @__PURE__ */
|
|
10583
|
+
return /* @__PURE__ */ jsx39("div", { children: /* @__PURE__ */ jsx39(ReasoningBlock, { reasoning: [content] }) }, content.id ?? `reasoning-${index}`);
|
|
10474
10584
|
}
|
|
10475
10585
|
if (isImageContent(content)) {
|
|
10476
|
-
return /* @__PURE__ */
|
|
10586
|
+
return /* @__PURE__ */ jsx39("div", { children: /* @__PURE__ */ jsx39(ImageBlock, { content }) }, content.id ?? `image-${index}`);
|
|
10477
10587
|
}
|
|
10478
10588
|
if (isComponentContent3(content)) {
|
|
10589
|
+
if (isContextCompressionComponent(content)) {
|
|
10590
|
+
return /* @__PURE__ */ jsx39(
|
|
10591
|
+
"div",
|
|
10592
|
+
{
|
|
10593
|
+
className: "w-full",
|
|
10594
|
+
children: /* @__PURE__ */ jsx39(ContextCompressionMessage, { content })
|
|
10595
|
+
},
|
|
10596
|
+
content.id ?? `context-compression-${index}`
|
|
10597
|
+
);
|
|
10598
|
+
}
|
|
10479
10599
|
const requestUserInputResult = getRequestUserInputResultCardData(
|
|
10480
10600
|
content,
|
|
10481
10601
|
lookupMessages
|
|
10482
10602
|
);
|
|
10483
10603
|
if (requestUserInputResult) {
|
|
10484
|
-
return /* @__PURE__ */
|
|
10604
|
+
return /* @__PURE__ */ jsx39("div", { children: /* @__PURE__ */ jsx39(RequestUserInputResultCard, { result: requestUserInputResult }) }, content.id ?? `request-user-input-result-${index}`);
|
|
10485
10605
|
}
|
|
10486
10606
|
if (isWidgetComponent2(content)) {
|
|
10487
|
-
return /* @__PURE__ */
|
|
10607
|
+
return /* @__PURE__ */ jsx39("div", { children: /* @__PURE__ */ jsx39(WidgetMessage, { messageId, data: content.data }) }, content.id ?? `widget-${index}`);
|
|
10488
10608
|
}
|
|
10489
10609
|
if (getComponentMessagePresentation(content, getToolStepData(content)) === "grouped-step") {
|
|
10490
|
-
return /* @__PURE__ */
|
|
10610
|
+
return /* @__PURE__ */ jsx39("div", { children: /* @__PURE__ */ jsx39(
|
|
10491
10611
|
ToolComponentGroup,
|
|
10492
10612
|
{
|
|
10493
10613
|
items: [content],
|
|
@@ -10498,15 +10618,15 @@ function renderContentItem(content, index, message, lookupMessages, options) {
|
|
|
10498
10618
|
}
|
|
10499
10619
|
) }, content.id ?? `component-group-${index}`);
|
|
10500
10620
|
}
|
|
10501
|
-
return /* @__PURE__ */
|
|
10621
|
+
return /* @__PURE__ */ jsx39("div", { children: /* @__PURE__ */ jsx39(ComponentBlock, { content }) }, content.id ?? `component-${index}`);
|
|
10502
10622
|
}
|
|
10503
10623
|
if (isMemoryContent(content)) {
|
|
10504
|
-
return /* @__PURE__ */
|
|
10624
|
+
return /* @__PURE__ */ jsx39("div", { children: /* @__PURE__ */ jsx39(MemoryBlock, { content }) }, content.id ?? `memory-${index}`);
|
|
10505
10625
|
}
|
|
10506
10626
|
if (isAgentEventContent(content)) {
|
|
10507
|
-
return /* @__PURE__ */
|
|
10627
|
+
return /* @__PURE__ */ jsx39("div", { children: /* @__PURE__ */ jsx39(AgentEventRow, { content }) }, content.id ?? `agent-event-${index}`);
|
|
10508
10628
|
}
|
|
10509
|
-
return /* @__PURE__ */
|
|
10629
|
+
return /* @__PURE__ */ jsx39("div", { children: /* @__PURE__ */ jsx39(UnknownBlock, { content }) }, content.id ?? `unknown-${index}`);
|
|
10510
10630
|
}
|
|
10511
10631
|
function renderContentUnit(unit, message, lookupMessages, hasFollowingItem, options) {
|
|
10512
10632
|
if (unit.type === "item") {
|
|
@@ -10517,7 +10637,7 @@ function renderContentUnit(unit, message, lookupMessages, hasFollowingItem, opti
|
|
|
10517
10637
|
isAgentOutput: options?.isAgentOutput
|
|
10518
10638
|
});
|
|
10519
10639
|
}
|
|
10520
|
-
return /* @__PURE__ */
|
|
10640
|
+
return /* @__PURE__ */ jsx39("div", { children: /* @__PURE__ */ jsx39(
|
|
10521
10641
|
ToolComponentGroup,
|
|
10522
10642
|
{
|
|
10523
10643
|
items: unit.items,
|
|
@@ -10554,7 +10674,7 @@ function renderAssistantRenderUnits(units, message, lookupMessages, options, dep
|
|
|
10554
10674
|
const batch = entryBatch;
|
|
10555
10675
|
entryBatch = [];
|
|
10556
10676
|
rendered.push(
|
|
10557
|
-
/* @__PURE__ */
|
|
10677
|
+
/* @__PURE__ */ jsx39(React33.Fragment, { children: renderEntryBatch(batch, message, lookupMessages, hasFollowingItem, {
|
|
10558
10678
|
...options,
|
|
10559
10679
|
isAgentOutput: depth > 0
|
|
10560
10680
|
}) }, `entries-${batch[0]?.order ?? rendered.length}`)
|
|
@@ -10571,7 +10691,7 @@ function renderAssistantRenderUnits(units, message, lookupMessages, options, dep
|
|
|
10571
10691
|
}
|
|
10572
10692
|
flushEntries(true);
|
|
10573
10693
|
rendered.push(
|
|
10574
|
-
/* @__PURE__ */
|
|
10694
|
+
/* @__PURE__ */ jsx39(
|
|
10575
10695
|
AgentRunGroup,
|
|
10576
10696
|
{
|
|
10577
10697
|
node: unit.node,
|
|
@@ -10596,7 +10716,7 @@ function renderContent(message, lookupMessages, options) {
|
|
|
10596
10716
|
message
|
|
10597
10717
|
);
|
|
10598
10718
|
if (renderTree.hasAgentRuns) {
|
|
10599
|
-
return /* @__PURE__ */
|
|
10719
|
+
return /* @__PURE__ */ jsx39("div", { className: assistantMessageStackClassName, children: renderAssistantRenderUnits(
|
|
10600
10720
|
renderTree.units,
|
|
10601
10721
|
message,
|
|
10602
10722
|
lookupMessages,
|
|
@@ -10606,13 +10726,13 @@ function renderContent(message, lookupMessages, options) {
|
|
|
10606
10726
|
const content = message.content;
|
|
10607
10727
|
if (typeof content === "string") {
|
|
10608
10728
|
if (!content.trim()) return null;
|
|
10609
|
-
return /* @__PURE__ */
|
|
10729
|
+
return /* @__PURE__ */ jsx39(MarkdownText, { children: content });
|
|
10610
10730
|
}
|
|
10611
10731
|
if (!Array.isArray(content) || content.length === 0) return null;
|
|
10612
10732
|
const renderUnits = buildToolComponentRenderUnits(content, {
|
|
10613
10733
|
shouldGroupComponent: (item) => getRequestUserInputResultCardData(item, lookupMessages) === null
|
|
10614
10734
|
});
|
|
10615
|
-
return /* @__PURE__ */
|
|
10735
|
+
return /* @__PURE__ */ jsx39("div", { className: "space-y-3", children: renderUnits.map(
|
|
10616
10736
|
(unit, index) => renderContentUnit(
|
|
10617
10737
|
unit,
|
|
10618
10738
|
message,
|
|
@@ -10632,7 +10752,7 @@ function AssistantStreamingIndicator({
|
|
|
10632
10752
|
thinking: t("message.thinking"),
|
|
10633
10753
|
answering: t("message.answering")
|
|
10634
10754
|
};
|
|
10635
|
-
return /* @__PURE__ */
|
|
10755
|
+
return /* @__PURE__ */ jsxs26(
|
|
10636
10756
|
"div",
|
|
10637
10757
|
{
|
|
10638
10758
|
className: cn(
|
|
@@ -10640,18 +10760,18 @@ function AssistantStreamingIndicator({
|
|
|
10640
10760
|
className
|
|
10641
10761
|
),
|
|
10642
10762
|
children: [
|
|
10643
|
-
status === "loading" && /* @__PURE__ */
|
|
10644
|
-
status === "thinking" && /* @__PURE__ */
|
|
10645
|
-
/* @__PURE__ */
|
|
10646
|
-
/* @__PURE__ */
|
|
10647
|
-
/* @__PURE__ */
|
|
10763
|
+
status === "loading" && /* @__PURE__ */ jsx39(Loader26, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
10764
|
+
status === "thinking" && /* @__PURE__ */ jsxs26("div", { className: "flex items-end gap-1", "aria-hidden": "true", children: [
|
|
10765
|
+
/* @__PURE__ */ jsx39("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:-0.3s]" }),
|
|
10766
|
+
/* @__PURE__ */ jsx39("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:-0.15s]" }),
|
|
10767
|
+
/* @__PURE__ */ jsx39("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce" })
|
|
10648
10768
|
] }),
|
|
10649
|
-
status === "answering" && /* @__PURE__ */
|
|
10650
|
-
/* @__PURE__ */
|
|
10651
|
-
/* @__PURE__ */
|
|
10652
|
-
/* @__PURE__ */
|
|
10769
|
+
status === "answering" && /* @__PURE__ */ jsxs26("div", { className: "flex items-end gap-1", "aria-hidden": "true", children: [
|
|
10770
|
+
/* @__PURE__ */ jsx39("span", { className: "h-2 w-0.5 rounded-full bg-current animate-pulse [animation-delay:-0.25s]" }),
|
|
10771
|
+
/* @__PURE__ */ jsx39("span", { className: "h-3 w-0.5 rounded-full bg-current animate-pulse [animation-delay:-0.1s]" }),
|
|
10772
|
+
/* @__PURE__ */ jsx39("span", { className: "h-2.5 w-0.5 rounded-full bg-current animate-pulse" })
|
|
10653
10773
|
] }),
|
|
10654
|
-
/* @__PURE__ */
|
|
10774
|
+
/* @__PURE__ */ jsx39("span", { children: labelMap[status] })
|
|
10655
10775
|
]
|
|
10656
10776
|
}
|
|
10657
10777
|
);
|
|
@@ -10680,42 +10800,42 @@ function AssistantMessage({
|
|
|
10680
10800
|
organizationId,
|
|
10681
10801
|
apiUrl
|
|
10682
10802
|
});
|
|
10683
|
-
const reasoningNode = hasReasoning ? /* @__PURE__ */
|
|
10803
|
+
const reasoningNode = hasReasoning ? /* @__PURE__ */ jsx39(ReasoningBlock, { reasoning: rootReasoning ?? [] }) : null;
|
|
10684
10804
|
if (!hasContent && !hasReasoning && !resolvedStreamingStatus) return null;
|
|
10685
10805
|
const streamingClass = isStreaming ? "streaming-active" : "";
|
|
10686
10806
|
if (!hasContent && !hasReasoning && resolvedStreamingStatus) {
|
|
10687
|
-
return /* @__PURE__ */
|
|
10807
|
+
return /* @__PURE__ */ jsx39("div", { className: cn("space-y-3", streamingClass, className), children: /* @__PURE__ */ jsx39(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) });
|
|
10688
10808
|
}
|
|
10689
10809
|
if (hasContent && hasReasoning) {
|
|
10690
|
-
return /* @__PURE__ */
|
|
10691
|
-
/* @__PURE__ */
|
|
10810
|
+
return /* @__PURE__ */ jsxs26("div", { className: cn("space-y-3", streamingClass, className), children: [
|
|
10811
|
+
/* @__PURE__ */ jsxs26(
|
|
10692
10812
|
Tabs,
|
|
10693
10813
|
{
|
|
10694
10814
|
defaultValue: message.status === "reasoning" ? "reasoning" : "answer",
|
|
10695
10815
|
className: "w-full",
|
|
10696
10816
|
children: [
|
|
10697
|
-
/* @__PURE__ */
|
|
10698
|
-
/* @__PURE__ */
|
|
10699
|
-
/* @__PURE__ */
|
|
10817
|
+
/* @__PURE__ */ jsxs26(TabsList, { className: "", children: [
|
|
10818
|
+
/* @__PURE__ */ jsx39(TabsTrigger, { value: "answer", children: t("message.answer") }),
|
|
10819
|
+
/* @__PURE__ */ jsx39(TabsTrigger, { value: "reasoning", children: t("message.reasoning") })
|
|
10700
10820
|
] }),
|
|
10701
|
-
/* @__PURE__ */
|
|
10702
|
-
/* @__PURE__ */
|
|
10821
|
+
/* @__PURE__ */ jsx39(TabsContent, { value: "answer", className: "space-y-3", children: answerNode }),
|
|
10822
|
+
/* @__PURE__ */ jsx39(TabsContent, { value: "reasoning", className: "space-y-3", children: reasoningNode })
|
|
10703
10823
|
]
|
|
10704
10824
|
}
|
|
10705
10825
|
),
|
|
10706
|
-
resolvedStreamingStatus ? /* @__PURE__ */
|
|
10826
|
+
resolvedStreamingStatus ? /* @__PURE__ */ jsx39(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) : null
|
|
10707
10827
|
] });
|
|
10708
10828
|
}
|
|
10709
|
-
return /* @__PURE__ */
|
|
10829
|
+
return /* @__PURE__ */ jsxs26("div", { className: cn("space-y-3", streamingClass, className), children: [
|
|
10710
10830
|
hasReasoning ? reasoningNode : answerNode,
|
|
10711
|
-
resolvedStreamingStatus ? /* @__PURE__ */
|
|
10831
|
+
resolvedStreamingStatus ? /* @__PURE__ */ jsx39(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) : null
|
|
10712
10832
|
] });
|
|
10713
10833
|
}
|
|
10714
10834
|
|
|
10715
10835
|
// src/components/thread/MessageActions.tsx
|
|
10716
|
-
import * as
|
|
10836
|
+
import * as React34 from "react";
|
|
10717
10837
|
import { Check as Check5, Copy as Copy3, RefreshCw } from "lucide-react";
|
|
10718
|
-
import { jsx as
|
|
10838
|
+
import { jsx as jsx40, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
10719
10839
|
function MessageActions({
|
|
10720
10840
|
content,
|
|
10721
10841
|
isAssistant = false,
|
|
@@ -10724,7 +10844,7 @@ function MessageActions({
|
|
|
10724
10844
|
className
|
|
10725
10845
|
}) {
|
|
10726
10846
|
const { t } = useChatkitTranslation();
|
|
10727
|
-
const [copied, setCopied] =
|
|
10847
|
+
const [copied, setCopied] = React34.useState(false);
|
|
10728
10848
|
const handleCopy = async () => {
|
|
10729
10849
|
try {
|
|
10730
10850
|
await navigator.clipboard.writeText(content);
|
|
@@ -10737,7 +10857,7 @@ function MessageActions({
|
|
|
10737
10857
|
if (isStreaming) {
|
|
10738
10858
|
return null;
|
|
10739
10859
|
}
|
|
10740
|
-
return /* @__PURE__ */
|
|
10860
|
+
return /* @__PURE__ */ jsxs27(
|
|
10741
10861
|
"div",
|
|
10742
10862
|
{
|
|
10743
10863
|
className: cn(
|
|
@@ -10745,7 +10865,7 @@ function MessageActions({
|
|
|
10745
10865
|
className
|
|
10746
10866
|
),
|
|
10747
10867
|
children: [
|
|
10748
|
-
/* @__PURE__ */
|
|
10868
|
+
/* @__PURE__ */ jsx40(
|
|
10749
10869
|
"button",
|
|
10750
10870
|
{
|
|
10751
10871
|
type: "button",
|
|
@@ -10755,17 +10875,17 @@ function MessageActions({
|
|
|
10755
10875
|
copied && "text-green-500"
|
|
10756
10876
|
),
|
|
10757
10877
|
title: copied ? t("messageActions.copied") : t("messageActions.copy"),
|
|
10758
|
-
children: copied ? /* @__PURE__ */
|
|
10878
|
+
children: copied ? /* @__PURE__ */ jsx40(Check5, { size: 14 }) : /* @__PURE__ */ jsx40(Copy3, { size: 14 })
|
|
10759
10879
|
}
|
|
10760
10880
|
),
|
|
10761
|
-
isAssistant && onRetry && /* @__PURE__ */
|
|
10881
|
+
isAssistant && onRetry && /* @__PURE__ */ jsx40(
|
|
10762
10882
|
"button",
|
|
10763
10883
|
{
|
|
10764
10884
|
type: "button",
|
|
10765
10885
|
onClick: onRetry,
|
|
10766
10886
|
className: "p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",
|
|
10767
10887
|
title: t("messageActions.regenerate"),
|
|
10768
|
-
children: /* @__PURE__ */
|
|
10888
|
+
children: /* @__PURE__ */ jsx40(RefreshCw, { size: 14 })
|
|
10769
10889
|
}
|
|
10770
10890
|
)
|
|
10771
10891
|
]
|
|
@@ -10786,18 +10906,18 @@ import {
|
|
|
10786
10906
|
Sparkles as Sparkles3,
|
|
10787
10907
|
Zap
|
|
10788
10908
|
} from "lucide-react";
|
|
10789
|
-
import { jsx as
|
|
10909
|
+
import { jsx as jsx41, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
10790
10910
|
function getIconComponent2(icon) {
|
|
10791
10911
|
const iconMap = {
|
|
10792
|
-
"circle-question": /* @__PURE__ */
|
|
10793
|
-
"lightbulb": /* @__PURE__ */
|
|
10794
|
-
"sparkle": /* @__PURE__ */
|
|
10795
|
-
"write": /* @__PURE__ */
|
|
10796
|
-
"search": /* @__PURE__ */
|
|
10797
|
-
"globe": /* @__PURE__ */
|
|
10798
|
-
"book-open": /* @__PURE__ */
|
|
10799
|
-
"compass": /* @__PURE__ */
|
|
10800
|
-
"bolt": /* @__PURE__ */
|
|
10912
|
+
"circle-question": /* @__PURE__ */ jsx41(HelpCircle, { size: 20 }),
|
|
10913
|
+
"lightbulb": /* @__PURE__ */ jsx41(Lightbulb2, { size: 20 }),
|
|
10914
|
+
"sparkle": /* @__PURE__ */ jsx41(Sparkles3, { size: 20 }),
|
|
10915
|
+
"write": /* @__PURE__ */ jsx41(Pencil3, { size: 20 }),
|
|
10916
|
+
"search": /* @__PURE__ */ jsx41(Search3, { size: 20 }),
|
|
10917
|
+
"globe": /* @__PURE__ */ jsx41(Globe2, { size: 20 }),
|
|
10918
|
+
"book-open": /* @__PURE__ */ jsx41(BookOpen2, { size: 20 }),
|
|
10919
|
+
"compass": /* @__PURE__ */ jsx41(Compass, { size: 20 }),
|
|
10920
|
+
"bolt": /* @__PURE__ */ jsx41(Zap, { size: 20 })
|
|
10801
10921
|
};
|
|
10802
10922
|
return icon ? iconMap[icon] || iconMap["sparkle"] : iconMap["sparkle"];
|
|
10803
10923
|
}
|
|
@@ -10805,9 +10925,9 @@ function StartScreen({ startScreen, onPromptClick, className }) {
|
|
|
10805
10925
|
const { t } = useChatkitTranslation();
|
|
10806
10926
|
const greeting = startScreen?.greeting ?? t("startScreen.greeting");
|
|
10807
10927
|
const prompts = startScreen?.prompts ?? [];
|
|
10808
|
-
return /* @__PURE__ */
|
|
10809
|
-
/* @__PURE__ */
|
|
10810
|
-
prompts.length > 0 && /* @__PURE__ */
|
|
10928
|
+
return /* @__PURE__ */ jsxs28("div", { className: cn("flex flex-col items-center justify-center py-12 px-4", className), children: [
|
|
10929
|
+
/* @__PURE__ */ jsx41("div", { className: "mb-8 text-center", children: /* @__PURE__ */ jsx41("h2", { className: "text-2xl font-semibold text-foreground mb-2", children: greeting }) }),
|
|
10930
|
+
prompts.length > 0 && /* @__PURE__ */ jsx41("div", { className: "w-full max-w-2xl", children: /* @__PURE__ */ jsx41("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: prompts.map((item, index) => /* @__PURE__ */ jsxs28(
|
|
10811
10931
|
"button",
|
|
10812
10932
|
{
|
|
10813
10933
|
type: "button",
|
|
@@ -10818,8 +10938,8 @@ function StartScreen({ startScreen, onPromptClick, className }) {
|
|
|
10818
10938
|
"focus:outline-none focus:ring-2 focus:ring-primary/20"
|
|
10819
10939
|
),
|
|
10820
10940
|
children: [
|
|
10821
|
-
/* @__PURE__ */
|
|
10822
|
-
/* @__PURE__ */
|
|
10941
|
+
/* @__PURE__ */ jsx41("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary", children: getIconComponent2(item.icon) }),
|
|
10942
|
+
/* @__PURE__ */ jsx41("span", { className: "text-sm font-medium text-foreground", children: item.label })
|
|
10823
10943
|
]
|
|
10824
10944
|
},
|
|
10825
10945
|
`prompt-${index}`
|
|
@@ -10828,7 +10948,7 @@ function StartScreen({ startScreen, onPromptClick, className }) {
|
|
|
10828
10948
|
}
|
|
10829
10949
|
|
|
10830
10950
|
// src/hooks/useThreads.ts
|
|
10831
|
-
import * as
|
|
10951
|
+
import * as React36 from "react";
|
|
10832
10952
|
var DEFAULT_LIMIT = 50;
|
|
10833
10953
|
var getThreadTitle = (threadRecord) => {
|
|
10834
10954
|
const title = threadRecord.title?.trim();
|
|
@@ -10881,16 +11001,16 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10881
11001
|
isLoading: isStreamLoading,
|
|
10882
11002
|
error: streamError
|
|
10883
11003
|
} = useStreamContext();
|
|
10884
|
-
const [threadRecords, setThreadRecords] =
|
|
10885
|
-
const [isLoading, setIsLoading] =
|
|
10886
|
-
const [error, setError] =
|
|
10887
|
-
const upsertThreadRecord =
|
|
11004
|
+
const [threadRecords, setThreadRecords] = React36.useState([]);
|
|
11005
|
+
const [isLoading, setIsLoading] = React36.useState(false);
|
|
11006
|
+
const [error, setError] = React36.useState(null);
|
|
11007
|
+
const upsertThreadRecord = React36.useCallback((threadRecord) => {
|
|
10888
11008
|
setThreadRecords((prev) => {
|
|
10889
11009
|
const next = prev.filter((item) => item.id !== threadRecord.id);
|
|
10890
11010
|
return sortThreadRecords([threadRecord, ...next]);
|
|
10891
11011
|
});
|
|
10892
11012
|
}, []);
|
|
10893
|
-
const refreshThreads =
|
|
11013
|
+
const refreshThreads = React36.useCallback(async () => {
|
|
10894
11014
|
setIsLoading(true);
|
|
10895
11015
|
setError(null);
|
|
10896
11016
|
try {
|
|
@@ -10906,7 +11026,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10906
11026
|
setIsLoading(false);
|
|
10907
11027
|
}
|
|
10908
11028
|
}, [client, limit, assistantId]);
|
|
10909
|
-
const createThread =
|
|
11029
|
+
const createThread = React36.useCallback(
|
|
10910
11030
|
async (input) => {
|
|
10911
11031
|
setError(null);
|
|
10912
11032
|
const payload = {};
|
|
@@ -10920,7 +11040,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10920
11040
|
},
|
|
10921
11041
|
[client, upsertThreadRecord]
|
|
10922
11042
|
);
|
|
10923
|
-
const updateThread =
|
|
11043
|
+
const updateThread = React36.useCallback(
|
|
10924
11044
|
async (recordId, payload) => {
|
|
10925
11045
|
setError(null);
|
|
10926
11046
|
const updated = await client.conversations.update(recordId, payload);
|
|
@@ -10929,7 +11049,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10929
11049
|
},
|
|
10930
11050
|
[client, upsertThreadRecord]
|
|
10931
11051
|
);
|
|
10932
|
-
const deleteThread =
|
|
11052
|
+
const deleteThread = React36.useCallback(
|
|
10933
11053
|
async (recordId) => {
|
|
10934
11054
|
setError(null);
|
|
10935
11055
|
await client.conversations.delete(recordId);
|
|
@@ -10937,11 +11057,11 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10937
11057
|
},
|
|
10938
11058
|
[client]
|
|
10939
11059
|
);
|
|
10940
|
-
|
|
11060
|
+
React36.useEffect(() => {
|
|
10941
11061
|
if (!isReady) return;
|
|
10942
11062
|
void refreshThreads();
|
|
10943
11063
|
}, [refreshThreads, isReady]);
|
|
10944
|
-
|
|
11064
|
+
React36.useEffect(() => {
|
|
10945
11065
|
if (!threadId || !isStreamLoading) return;
|
|
10946
11066
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
10947
11067
|
const busyStatus = "busy";
|
|
@@ -10962,7 +11082,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10962
11082
|
return changed ? sortThreadRecords(next) : prev;
|
|
10963
11083
|
});
|
|
10964
11084
|
}, [threadId, isStreamLoading]);
|
|
10965
|
-
|
|
11085
|
+
React36.useEffect(() => {
|
|
10966
11086
|
const message = getErrorMessage(streamError)?.trim();
|
|
10967
11087
|
if (!threadId || !message) return;
|
|
10968
11088
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -10984,7 +11104,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10984
11104
|
return changed ? sortThreadRecords(next) : prev;
|
|
10985
11105
|
});
|
|
10986
11106
|
}, [threadId, streamError]);
|
|
10987
|
-
|
|
11107
|
+
React36.useEffect(() => {
|
|
10988
11108
|
if (!isReady || !threadId || isStreamLoading) return;
|
|
10989
11109
|
let cancelled = false;
|
|
10990
11110
|
void client.conversations.search({ where: { threadId }, limit: 1 }).then((result) => {
|
|
@@ -10998,7 +11118,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10998
11118
|
cancelled = true;
|
|
10999
11119
|
};
|
|
11000
11120
|
}, [client, threadId, upsertThreadRecord, isReady, isStreamLoading]);
|
|
11001
|
-
const threads =
|
|
11121
|
+
const threads = React36.useMemo(
|
|
11002
11122
|
() => threadRecords.map((threadRecord) => toThreadItem(threadRecord)),
|
|
11003
11123
|
[threadRecords]
|
|
11004
11124
|
);
|
|
@@ -11015,10 +11135,10 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
11015
11135
|
}
|
|
11016
11136
|
|
|
11017
11137
|
// src/components/thread/context-usage-indicator.tsx
|
|
11018
|
-
import * as
|
|
11138
|
+
import * as React37 from "react";
|
|
11019
11139
|
|
|
11020
11140
|
// src/components/ui/progress-circle.tsx
|
|
11021
|
-
import { jsx as
|
|
11141
|
+
import { jsx as jsx42, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
11022
11142
|
function clamp2(input, a, b) {
|
|
11023
11143
|
return Math.max(Math.min(input, Math.max(a, b)), Math.min(a, b));
|
|
11024
11144
|
}
|
|
@@ -11041,7 +11161,7 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
|
|
|
11041
11161
|
return (
|
|
11042
11162
|
// biome-ignore lint/a11y/useFocusableInteractive: false positive (progress + progressbar are not focusable interactives)
|
|
11043
11163
|
// biome-ignore lint/nursery/useAriaPropsSupportedByRole: biome rule at odds with mdn docs (presumed nursary bug with rule)
|
|
11044
|
-
/* @__PURE__ */
|
|
11164
|
+
/* @__PURE__ */ jsxs29(
|
|
11045
11165
|
"svg",
|
|
11046
11166
|
{
|
|
11047
11167
|
role: "progressbar",
|
|
@@ -11052,8 +11172,8 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
|
|
|
11052
11172
|
"aria-valuemax": 100,
|
|
11053
11173
|
...restSvgProps,
|
|
11054
11174
|
children: [
|
|
11055
|
-
/* @__PURE__ */
|
|
11056
|
-
/* @__PURE__ */
|
|
11175
|
+
/* @__PURE__ */ jsx42("circle", { ...commonParams, className: "stroke-current/25" }),
|
|
11176
|
+
/* @__PURE__ */ jsx42(
|
|
11057
11177
|
"circle",
|
|
11058
11178
|
{
|
|
11059
11179
|
...commonParams,
|
|
@@ -11072,7 +11192,7 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
|
|
|
11072
11192
|
};
|
|
11073
11193
|
|
|
11074
11194
|
// src/components/thread/context-usage-indicator.tsx
|
|
11075
|
-
import { jsx as
|
|
11195
|
+
import { jsx as jsx43, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
11076
11196
|
var kNumberFormatter = new Intl.NumberFormat("en-US", {
|
|
11077
11197
|
minimumFractionDigits: 0,
|
|
11078
11198
|
maximumFractionDigits: 1
|
|
@@ -11105,20 +11225,20 @@ function ContextUsageIndicator({
|
|
|
11105
11225
|
}) {
|
|
11106
11226
|
const { t } = useChatkitTranslation();
|
|
11107
11227
|
const stream = useStreamContext();
|
|
11108
|
-
const [maxContextSize, setMaxContextSize] =
|
|
11109
|
-
const [usedContextSize, setUsedContextSize] =
|
|
11110
|
-
const [assistantAgentKey, setAssistantAgentKey] =
|
|
11111
|
-
const latestRealtimeUsageRef =
|
|
11228
|
+
const [maxContextSize, setMaxContextSize] = React37.useState(null);
|
|
11229
|
+
const [usedContextSize, setUsedContextSize] = React37.useState(null);
|
|
11230
|
+
const [assistantAgentKey, setAssistantAgentKey] = React37.useState(null);
|
|
11231
|
+
const latestRealtimeUsageRef = React37.useRef({
|
|
11112
11232
|
threadId: null,
|
|
11113
11233
|
agentKey: null,
|
|
11114
11234
|
usedTokens: null
|
|
11115
11235
|
});
|
|
11116
|
-
const realtimeUsage =
|
|
11236
|
+
const realtimeUsage = React37.useMemo(
|
|
11117
11237
|
() => getThreadContextUsage(stream.contextUsageByAgentKey, assistantAgentKey),
|
|
11118
11238
|
[assistantAgentKey, stream.contextUsageByAgentKey]
|
|
11119
11239
|
);
|
|
11120
11240
|
const realtimeUsedContextSize = getThreadContextUsageTotalTokens(realtimeUsage);
|
|
11121
|
-
|
|
11241
|
+
React37.useEffect(() => {
|
|
11122
11242
|
if (!stream.client || !stream.assistantId) {
|
|
11123
11243
|
setMaxContextSize(null);
|
|
11124
11244
|
setAssistantAgentKey(null);
|
|
@@ -11138,18 +11258,18 @@ function ContextUsageIndicator({
|
|
|
11138
11258
|
cancelled = true;
|
|
11139
11259
|
};
|
|
11140
11260
|
}, [stream.client, stream.assistantId]);
|
|
11141
|
-
|
|
11261
|
+
React37.useEffect(() => {
|
|
11142
11262
|
latestRealtimeUsageRef.current = {
|
|
11143
11263
|
threadId: stream.threadId ?? null,
|
|
11144
11264
|
agentKey: assistantAgentKey,
|
|
11145
11265
|
usedTokens: realtimeUsedContextSize
|
|
11146
11266
|
};
|
|
11147
11267
|
}, [assistantAgentKey, realtimeUsedContextSize, stream.threadId]);
|
|
11148
|
-
|
|
11268
|
+
React37.useEffect(() => {
|
|
11149
11269
|
if (realtimeUsedContextSize == null) return;
|
|
11150
11270
|
setUsedContextSize(realtimeUsedContextSize);
|
|
11151
11271
|
}, [realtimeUsedContextSize]);
|
|
11152
|
-
|
|
11272
|
+
React37.useEffect(() => {
|
|
11153
11273
|
if (!stream.client) {
|
|
11154
11274
|
setUsedContextSize(null);
|
|
11155
11275
|
return;
|
|
@@ -11214,8 +11334,8 @@ function ContextUsageIndicator({
|
|
|
11214
11334
|
});
|
|
11215
11335
|
const usageLabelWithSuffix = usageLabel.endsWith(":") ? usageLabel : `${usageLabel}:`;
|
|
11216
11336
|
const progressClassName = percent >= 90 ? "text-destructive" : percent >= 75 ? "text-amber-500" : "text-primary dark:text-zinc-300";
|
|
11217
|
-
return /* @__PURE__ */
|
|
11218
|
-
/* @__PURE__ */
|
|
11337
|
+
return /* @__PURE__ */ jsxs30(Tooltip, { children: [
|
|
11338
|
+
/* @__PURE__ */ jsx43(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx43(
|
|
11219
11339
|
"button",
|
|
11220
11340
|
{
|
|
11221
11341
|
type: "button",
|
|
@@ -11224,31 +11344,31 @@ function ContextUsageIndicator({
|
|
|
11224
11344
|
className
|
|
11225
11345
|
),
|
|
11226
11346
|
"aria-label": `${usageLabelWithSuffix} ${usageFullLabel}. ${usageTokensLabel}`,
|
|
11227
|
-
children: /* @__PURE__ */
|
|
11347
|
+
children: /* @__PURE__ */ jsx43(ProgressCircle, { value: percent, className: cn("size-3.5", progressClassName) })
|
|
11228
11348
|
}
|
|
11229
11349
|
) }),
|
|
11230
|
-
/* @__PURE__ */
|
|
11231
|
-
/* @__PURE__ */
|
|
11232
|
-
/* @__PURE__ */
|
|
11233
|
-
/* @__PURE__ */
|
|
11350
|
+
/* @__PURE__ */ jsxs30(TooltipContent, { side: "top", sideOffset: 6, className: "space-y-0.5 px-3 py-2 text-center", children: [
|
|
11351
|
+
/* @__PURE__ */ jsx43("div", { className: "text-primary-foreground/70", children: usageLabelWithSuffix }),
|
|
11352
|
+
/* @__PURE__ */ jsx43("div", { className: "font-medium text-primary-foreground/80", children: usageFullLabel }),
|
|
11353
|
+
/* @__PURE__ */ jsx43("div", { className: "text-sm font-semibold", children: usageTokensLabel })
|
|
11234
11354
|
] })
|
|
11235
11355
|
] });
|
|
11236
11356
|
}
|
|
11237
11357
|
|
|
11238
11358
|
// src/components/pet/PetBridge.tsx
|
|
11239
|
-
import * as
|
|
11359
|
+
import * as React38 from "react";
|
|
11240
11360
|
import { normalizePetOptions } from "@xpert-ai/chatkit-types";
|
|
11241
11361
|
function PetBridge({ pet, state }) {
|
|
11242
11362
|
const parentMessenger = useParentMessenger();
|
|
11243
11363
|
const sendEvent = parentMessenger?.sendEvent;
|
|
11244
|
-
const options =
|
|
11245
|
-
|
|
11364
|
+
const options = React38.useMemo(() => normalizePetOptions(pet), [pet]);
|
|
11365
|
+
React38.useEffect(() => {
|
|
11246
11366
|
if (!sendEvent) {
|
|
11247
11367
|
return;
|
|
11248
11368
|
}
|
|
11249
11369
|
sendEvent("pet_options_change", { pet: pet ?? null });
|
|
11250
11370
|
}, [sendEvent, pet]);
|
|
11251
|
-
|
|
11371
|
+
React38.useEffect(() => {
|
|
11252
11372
|
if (!sendEvent || !options) {
|
|
11253
11373
|
return;
|
|
11254
11374
|
}
|
|
@@ -11258,15 +11378,15 @@ function PetBridge({ pet, state }) {
|
|
|
11258
11378
|
}
|
|
11259
11379
|
|
|
11260
11380
|
// src/components/settings/SettingsSheet.tsx
|
|
11261
|
-
import * as
|
|
11381
|
+
import * as React45 from "react";
|
|
11262
11382
|
import { PawPrint, Settings } from "lucide-react";
|
|
11263
11383
|
|
|
11264
11384
|
// src/components/ui/input.tsx
|
|
11265
|
-
import * as
|
|
11266
|
-
import { jsx as
|
|
11267
|
-
var Input =
|
|
11385
|
+
import * as React39 from "react";
|
|
11386
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
11387
|
+
var Input = React39.forwardRef(
|
|
11268
11388
|
({ className, type, ...props }, ref) => {
|
|
11269
|
-
return /* @__PURE__ */
|
|
11389
|
+
return /* @__PURE__ */ jsx44(
|
|
11270
11390
|
"input",
|
|
11271
11391
|
{
|
|
11272
11392
|
ref,
|
|
@@ -11286,17 +11406,17 @@ Input.displayName = "Input";
|
|
|
11286
11406
|
import "react";
|
|
11287
11407
|
import { Select as SelectPrimitive } from "radix-ui";
|
|
11288
11408
|
import { ChevronDownIcon as ChevronDownIcon2, CheckIcon as CheckIcon4, ChevronUpIcon } from "lucide-react";
|
|
11289
|
-
import { jsx as
|
|
11409
|
+
import { jsx as jsx45, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
11290
11410
|
function Select({
|
|
11291
11411
|
...props
|
|
11292
11412
|
}) {
|
|
11293
|
-
return /* @__PURE__ */
|
|
11413
|
+
return /* @__PURE__ */ jsx45(SelectPrimitive.Root, { "data-slot": "select", ...props });
|
|
11294
11414
|
}
|
|
11295
11415
|
function SelectGroup({
|
|
11296
11416
|
className,
|
|
11297
11417
|
...props
|
|
11298
11418
|
}) {
|
|
11299
|
-
return /* @__PURE__ */
|
|
11419
|
+
return /* @__PURE__ */ jsx45(
|
|
11300
11420
|
SelectPrimitive.Group,
|
|
11301
11421
|
{
|
|
11302
11422
|
"data-slot": "select-group",
|
|
@@ -11308,7 +11428,7 @@ function SelectGroup({
|
|
|
11308
11428
|
function SelectValue({
|
|
11309
11429
|
...props
|
|
11310
11430
|
}) {
|
|
11311
|
-
return /* @__PURE__ */
|
|
11431
|
+
return /* @__PURE__ */ jsx45(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
|
|
11312
11432
|
}
|
|
11313
11433
|
function SelectTrigger({
|
|
11314
11434
|
className,
|
|
@@ -11316,7 +11436,7 @@ function SelectTrigger({
|
|
|
11316
11436
|
children,
|
|
11317
11437
|
...props
|
|
11318
11438
|
}) {
|
|
11319
|
-
return /* @__PURE__ */
|
|
11439
|
+
return /* @__PURE__ */ jsxs31(
|
|
11320
11440
|
SelectPrimitive.Trigger,
|
|
11321
11441
|
{
|
|
11322
11442
|
"data-slot": "select-trigger",
|
|
@@ -11328,7 +11448,7 @@ function SelectTrigger({
|
|
|
11328
11448
|
...props,
|
|
11329
11449
|
children: [
|
|
11330
11450
|
children,
|
|
11331
|
-
/* @__PURE__ */
|
|
11451
|
+
/* @__PURE__ */ jsx45(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx45(ChevronDownIcon2, { className: "pointer-events-none size-4 text-muted-foreground" }) })
|
|
11332
11452
|
]
|
|
11333
11453
|
}
|
|
11334
11454
|
);
|
|
@@ -11340,7 +11460,7 @@ function SelectContent({
|
|
|
11340
11460
|
align = "center",
|
|
11341
11461
|
...props
|
|
11342
11462
|
}) {
|
|
11343
|
-
return /* @__PURE__ */
|
|
11463
|
+
return /* @__PURE__ */ jsx45(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs31(
|
|
11344
11464
|
SelectPrimitive.Content,
|
|
11345
11465
|
{
|
|
11346
11466
|
"data-slot": "select-content",
|
|
@@ -11350,8 +11470,8 @@ function SelectContent({
|
|
|
11350
11470
|
align,
|
|
11351
11471
|
...props,
|
|
11352
11472
|
children: [
|
|
11353
|
-
/* @__PURE__ */
|
|
11354
|
-
/* @__PURE__ */
|
|
11473
|
+
/* @__PURE__ */ jsx45(SelectScrollUpButton, {}),
|
|
11474
|
+
/* @__PURE__ */ jsx45(
|
|
11355
11475
|
SelectPrimitive.Viewport,
|
|
11356
11476
|
{
|
|
11357
11477
|
"data-position": position,
|
|
@@ -11362,7 +11482,7 @@ function SelectContent({
|
|
|
11362
11482
|
children
|
|
11363
11483
|
}
|
|
11364
11484
|
),
|
|
11365
|
-
/* @__PURE__ */
|
|
11485
|
+
/* @__PURE__ */ jsx45(SelectScrollDownButton, {})
|
|
11366
11486
|
]
|
|
11367
11487
|
}
|
|
11368
11488
|
) });
|
|
@@ -11372,7 +11492,7 @@ function SelectItem({
|
|
|
11372
11492
|
children,
|
|
11373
11493
|
...props
|
|
11374
11494
|
}) {
|
|
11375
|
-
return /* @__PURE__ */
|
|
11495
|
+
return /* @__PURE__ */ jsxs31(
|
|
11376
11496
|
SelectPrimitive.Item,
|
|
11377
11497
|
{
|
|
11378
11498
|
"data-slot": "select-item",
|
|
@@ -11382,8 +11502,8 @@ function SelectItem({
|
|
|
11382
11502
|
),
|
|
11383
11503
|
...props,
|
|
11384
11504
|
children: [
|
|
11385
|
-
/* @__PURE__ */
|
|
11386
|
-
/* @__PURE__ */
|
|
11505
|
+
/* @__PURE__ */ jsx45("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ jsx45(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx45(CheckIcon4, { className: "pointer-events-none" }) }) }),
|
|
11506
|
+
/* @__PURE__ */ jsx45(SelectPrimitive.ItemText, { children })
|
|
11387
11507
|
]
|
|
11388
11508
|
}
|
|
11389
11509
|
);
|
|
@@ -11392,7 +11512,7 @@ function SelectScrollUpButton({
|
|
|
11392
11512
|
className,
|
|
11393
11513
|
...props
|
|
11394
11514
|
}) {
|
|
11395
|
-
return /* @__PURE__ */
|
|
11515
|
+
return /* @__PURE__ */ jsx45(
|
|
11396
11516
|
SelectPrimitive.ScrollUpButton,
|
|
11397
11517
|
{
|
|
11398
11518
|
"data-slot": "select-scroll-up-button",
|
|
@@ -11401,7 +11521,7 @@ function SelectScrollUpButton({
|
|
|
11401
11521
|
className
|
|
11402
11522
|
),
|
|
11403
11523
|
...props,
|
|
11404
|
-
children: /* @__PURE__ */
|
|
11524
|
+
children: /* @__PURE__ */ jsx45(
|
|
11405
11525
|
ChevronUpIcon,
|
|
11406
11526
|
{}
|
|
11407
11527
|
)
|
|
@@ -11412,7 +11532,7 @@ function SelectScrollDownButton({
|
|
|
11412
11532
|
className,
|
|
11413
11533
|
...props
|
|
11414
11534
|
}) {
|
|
11415
|
-
return /* @__PURE__ */
|
|
11535
|
+
return /* @__PURE__ */ jsx45(
|
|
11416
11536
|
SelectPrimitive.ScrollDownButton,
|
|
11417
11537
|
{
|
|
11418
11538
|
"data-slot": "select-scroll-down-button",
|
|
@@ -11421,7 +11541,7 @@ function SelectScrollDownButton({
|
|
|
11421
11541
|
className
|
|
11422
11542
|
),
|
|
11423
11543
|
...props,
|
|
11424
|
-
children: /* @__PURE__ */
|
|
11544
|
+
children: /* @__PURE__ */ jsx45(
|
|
11425
11545
|
ChevronDownIcon2,
|
|
11426
11546
|
{}
|
|
11427
11547
|
)
|
|
@@ -11430,9 +11550,9 @@ function SelectScrollDownButton({
|
|
|
11430
11550
|
}
|
|
11431
11551
|
|
|
11432
11552
|
// src/components/ui/slider.tsx
|
|
11433
|
-
import * as
|
|
11553
|
+
import * as React41 from "react";
|
|
11434
11554
|
import { Slider as SliderPrimitive } from "radix-ui";
|
|
11435
|
-
import { jsx as
|
|
11555
|
+
import { jsx as jsx46, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
11436
11556
|
function Slider({
|
|
11437
11557
|
className,
|
|
11438
11558
|
defaultValue,
|
|
@@ -11441,11 +11561,11 @@ function Slider({
|
|
|
11441
11561
|
max = 100,
|
|
11442
11562
|
...props
|
|
11443
11563
|
}) {
|
|
11444
|
-
const _values =
|
|
11564
|
+
const _values = React41.useMemo(
|
|
11445
11565
|
() => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
|
|
11446
11566
|
[value, defaultValue, min, max]
|
|
11447
11567
|
);
|
|
11448
|
-
return /* @__PURE__ */
|
|
11568
|
+
return /* @__PURE__ */ jsxs32(
|
|
11449
11569
|
SliderPrimitive.Root,
|
|
11450
11570
|
{
|
|
11451
11571
|
"data-slot": "slider",
|
|
@@ -11459,12 +11579,12 @@ function Slider({
|
|
|
11459
11579
|
),
|
|
11460
11580
|
...props,
|
|
11461
11581
|
children: [
|
|
11462
|
-
/* @__PURE__ */
|
|
11582
|
+
/* @__PURE__ */ jsx46(
|
|
11463
11583
|
SliderPrimitive.Track,
|
|
11464
11584
|
{
|
|
11465
11585
|
"data-slot": "slider-track",
|
|
11466
11586
|
className: "relative grow overflow-hidden rounded-full bg-muted data-horizontal:h-1 data-horizontal:w-full data-vertical:h-full data-vertical:w-1",
|
|
11467
|
-
children: /* @__PURE__ */
|
|
11587
|
+
children: /* @__PURE__ */ jsx46(
|
|
11468
11588
|
SliderPrimitive.Range,
|
|
11469
11589
|
{
|
|
11470
11590
|
"data-slot": "slider-range",
|
|
@@ -11473,7 +11593,7 @@ function Slider({
|
|
|
11473
11593
|
)
|
|
11474
11594
|
}
|
|
11475
11595
|
),
|
|
11476
|
-
Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */
|
|
11596
|
+
Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */ jsx46(
|
|
11477
11597
|
SliderPrimitive.Thumb,
|
|
11478
11598
|
{
|
|
11479
11599
|
"data-slot": "slider-thumb",
|
|
@@ -11487,7 +11607,7 @@ function Slider({
|
|
|
11487
11607
|
}
|
|
11488
11608
|
|
|
11489
11609
|
// src/components/ui/toggle-group.tsx
|
|
11490
|
-
import * as
|
|
11610
|
+
import * as React43 from "react";
|
|
11491
11611
|
import "class-variance-authority";
|
|
11492
11612
|
import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui";
|
|
11493
11613
|
|
|
@@ -11495,7 +11615,7 @@ import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui";
|
|
|
11495
11615
|
import "react";
|
|
11496
11616
|
import { cva as cva2 } from "class-variance-authority";
|
|
11497
11617
|
import { Toggle as TogglePrimitive } from "radix-ui";
|
|
11498
|
-
import { jsx as
|
|
11618
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
11499
11619
|
var toggleVariants = cva2(
|
|
11500
11620
|
"group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
11501
11621
|
{
|
|
@@ -11518,8 +11638,8 @@ var toggleVariants = cva2(
|
|
|
11518
11638
|
);
|
|
11519
11639
|
|
|
11520
11640
|
// src/components/ui/toggle-group.tsx
|
|
11521
|
-
import { jsx as
|
|
11522
|
-
var ToggleGroupContext =
|
|
11641
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
11642
|
+
var ToggleGroupContext = React43.createContext({
|
|
11523
11643
|
size: "default",
|
|
11524
11644
|
variant: "default",
|
|
11525
11645
|
spacing: 0,
|
|
@@ -11534,7 +11654,7 @@ function ToggleGroup({
|
|
|
11534
11654
|
children,
|
|
11535
11655
|
...props
|
|
11536
11656
|
}) {
|
|
11537
|
-
return /* @__PURE__ */
|
|
11657
|
+
return /* @__PURE__ */ jsx48(
|
|
11538
11658
|
ToggleGroupPrimitive.Root,
|
|
11539
11659
|
{
|
|
11540
11660
|
"data-slot": "toggle-group",
|
|
@@ -11548,7 +11668,7 @@ function ToggleGroup({
|
|
|
11548
11668
|
className
|
|
11549
11669
|
),
|
|
11550
11670
|
...props,
|
|
11551
|
-
children: /* @__PURE__ */
|
|
11671
|
+
children: /* @__PURE__ */ jsx48(
|
|
11552
11672
|
ToggleGroupContext.Provider,
|
|
11553
11673
|
{
|
|
11554
11674
|
value: { variant, size: size2, spacing, orientation },
|
|
@@ -11565,8 +11685,8 @@ function ToggleGroupItem({
|
|
|
11565
11685
|
size: size2 = "default",
|
|
11566
11686
|
...props
|
|
11567
11687
|
}) {
|
|
11568
|
-
const context =
|
|
11569
|
-
return /* @__PURE__ */
|
|
11688
|
+
const context = React43.useContext(ToggleGroupContext);
|
|
11689
|
+
return /* @__PURE__ */ jsx48(
|
|
11570
11690
|
ToggleGroupPrimitive.Item,
|
|
11571
11691
|
{
|
|
11572
11692
|
"data-slot": "toggle-group-item",
|
|
@@ -11806,7 +11926,7 @@ import {
|
|
|
11806
11926
|
} from "@xpert-ai/chatkit-types";
|
|
11807
11927
|
|
|
11808
11928
|
// src/components/pet/PetPreview.tsx
|
|
11809
|
-
import { jsx as
|
|
11929
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
11810
11930
|
function escapeCssUrl(value) {
|
|
11811
11931
|
return value.replace(/["\\]/g, "\\$&");
|
|
11812
11932
|
}
|
|
@@ -11814,7 +11934,7 @@ function PetPreview({ src, label, className }) {
|
|
|
11814
11934
|
const scale = 0.13;
|
|
11815
11935
|
const width = petSpriteAtlas.cellWidth;
|
|
11816
11936
|
const height = petSpriteAtlas.cellHeight;
|
|
11817
|
-
return /* @__PURE__ */
|
|
11937
|
+
return /* @__PURE__ */ jsx49(
|
|
11818
11938
|
"span",
|
|
11819
11939
|
{
|
|
11820
11940
|
className: cn(
|
|
@@ -11823,7 +11943,7 @@ function PetPreview({ src, label, className }) {
|
|
|
11823
11943
|
),
|
|
11824
11944
|
"aria-hidden": "true",
|
|
11825
11945
|
title: label,
|
|
11826
|
-
children: /* @__PURE__ */
|
|
11946
|
+
children: /* @__PURE__ */ jsx49(
|
|
11827
11947
|
"span",
|
|
11828
11948
|
{
|
|
11829
11949
|
className: "absolute left-1/2 top-1/2 block",
|
|
@@ -11845,7 +11965,7 @@ function PetPreview({ src, label, className }) {
|
|
|
11845
11965
|
}
|
|
11846
11966
|
|
|
11847
11967
|
// src/components/settings/SettingsSheet.tsx
|
|
11848
|
-
import { jsx as
|
|
11968
|
+
import { jsx as jsx50, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
11849
11969
|
var CHARACTER_TYPES2 = [
|
|
11850
11970
|
"builtin",
|
|
11851
11971
|
"atlas"
|
|
@@ -11861,13 +11981,13 @@ function SettingsSheet({
|
|
|
11861
11981
|
onSave
|
|
11862
11982
|
}) {
|
|
11863
11983
|
const { t } = useChatkitTranslation();
|
|
11864
|
-
const [draft, setDraft] =
|
|
11865
|
-
|
|
11984
|
+
const [draft, setDraft] = React45.useState(settings);
|
|
11985
|
+
React45.useEffect(() => {
|
|
11866
11986
|
if (open) {
|
|
11867
11987
|
setDraft(petRequired ? { ...settings, enabled: true } : settings);
|
|
11868
11988
|
}
|
|
11869
11989
|
}, [open, petRequired, settings]);
|
|
11870
|
-
const updateDraft =
|
|
11990
|
+
const updateDraft = React45.useCallback(
|
|
11871
11991
|
(patch) => {
|
|
11872
11992
|
setDraft((previous) => ({ ...previous, ...patch }));
|
|
11873
11993
|
},
|
|
@@ -11885,23 +12005,23 @@ function SettingsSheet({
|
|
|
11885
12005
|
defaultValue: selectedBuiltinPet.label
|
|
11886
12006
|
}
|
|
11887
12007
|
);
|
|
11888
|
-
return /* @__PURE__ */
|
|
11889
|
-
/* @__PURE__ */
|
|
11890
|
-
/* @__PURE__ */
|
|
11891
|
-
/* @__PURE__ */
|
|
12008
|
+
return /* @__PURE__ */ jsx50(Sheet, { open, onOpenChange, children: /* @__PURE__ */ jsxs33(SheetContent, { side: "right", className: "w-[min(92vw,26rem)] overflow-y-auto", children: [
|
|
12009
|
+
/* @__PURE__ */ jsx50(SheetHeader, { children: /* @__PURE__ */ jsxs33("div", { className: "flex items-center gap-2", children: [
|
|
12010
|
+
/* @__PURE__ */ jsx50("span", { className: "flex h-8 w-8 items-center justify-center rounded-md bg-primary/10 text-primary", children: /* @__PURE__ */ jsx50(Settings, { size: 16 }) }),
|
|
12011
|
+
/* @__PURE__ */ jsx50(SheetTitle, { children: t("settings.title") })
|
|
11892
12012
|
] }) }),
|
|
11893
|
-
/* @__PURE__ */
|
|
11894
|
-
/* @__PURE__ */
|
|
11895
|
-
/* @__PURE__ */
|
|
11896
|
-
/* @__PURE__ */
|
|
11897
|
-
/* @__PURE__ */
|
|
12013
|
+
/* @__PURE__ */ jsxs33("form", { className: "mt-6 space-y-5", onSubmit: handleSubmit, children: [
|
|
12014
|
+
/* @__PURE__ */ jsxs33("section", { className: "space-y-5", children: [
|
|
12015
|
+
/* @__PURE__ */ jsxs33("div", { className: "flex items-center gap-2", children: [
|
|
12016
|
+
/* @__PURE__ */ jsx50("span", { className: "flex h-7 w-7 items-center justify-center rounded-md bg-muted text-muted-foreground", children: /* @__PURE__ */ jsx50(PawPrint, { size: 15 }) }),
|
|
12017
|
+
/* @__PURE__ */ jsx50("h3", { className: "text-sm font-semibold", children: t("pet.settings.title") })
|
|
11898
12018
|
] }),
|
|
11899
|
-
/* @__PURE__ */
|
|
11900
|
-
/* @__PURE__ */
|
|
11901
|
-
/* @__PURE__ */
|
|
11902
|
-
petRequired && /* @__PURE__ */
|
|
12019
|
+
/* @__PURE__ */ jsxs33("label", { className: "flex items-center justify-between gap-4 rounded-md border border-border px-3 py-2", children: [
|
|
12020
|
+
/* @__PURE__ */ jsxs33("span", { className: "min-w-0", children: [
|
|
12021
|
+
/* @__PURE__ */ jsx50("span", { className: "block text-sm font-medium", children: t("pet.settings.enabled") }),
|
|
12022
|
+
petRequired && /* @__PURE__ */ jsx50("span", { className: "mt-0.5 block text-xs text-muted-foreground", children: t("pet.settings.requiredHint") })
|
|
11903
12023
|
] }),
|
|
11904
|
-
/* @__PURE__ */
|
|
12024
|
+
/* @__PURE__ */ jsx50(
|
|
11905
12025
|
"button",
|
|
11906
12026
|
{
|
|
11907
12027
|
type: "button",
|
|
@@ -11914,7 +12034,7 @@ function SettingsSheet({
|
|
|
11914
12034
|
draft.enabled ? "bg-primary" : "bg-muted-foreground/20",
|
|
11915
12035
|
petRequired ? "cursor-not-allowed opacity-70" : ""
|
|
11916
12036
|
].join(" "),
|
|
11917
|
-
children: /* @__PURE__ */
|
|
12037
|
+
children: /* @__PURE__ */ jsx50(
|
|
11918
12038
|
"span",
|
|
11919
12039
|
{
|
|
11920
12040
|
className: [
|
|
@@ -11927,9 +12047,9 @@ function SettingsSheet({
|
|
|
11927
12047
|
)
|
|
11928
12048
|
] })
|
|
11929
12049
|
] }),
|
|
11930
|
-
/* @__PURE__ */
|
|
11931
|
-
/* @__PURE__ */
|
|
11932
|
-
/* @__PURE__ */
|
|
12050
|
+
/* @__PURE__ */ jsxs33("div", { className: "space-y-2", children: [
|
|
12051
|
+
/* @__PURE__ */ jsx50("span", { id: "chatkit-pet-type-label", className: "text-sm font-medium", children: t("pet.settings.characterType") }),
|
|
12052
|
+
/* @__PURE__ */ jsx50(
|
|
11933
12053
|
ToggleGroup,
|
|
11934
12054
|
{
|
|
11935
12055
|
id: "chatkit-pet-type",
|
|
@@ -11944,7 +12064,7 @@ function SettingsSheet({
|
|
|
11944
12064
|
variant: "outline",
|
|
11945
12065
|
spacing: 2,
|
|
11946
12066
|
className: "!w-full",
|
|
11947
|
-
children: CHARACTER_TYPES2.map((type) => /* @__PURE__ */
|
|
12067
|
+
children: CHARACTER_TYPES2.map((type) => /* @__PURE__ */ jsx50(
|
|
11948
12068
|
ToggleGroupItem,
|
|
11949
12069
|
{
|
|
11950
12070
|
value: type,
|
|
@@ -11956,8 +12076,8 @@ function SettingsSheet({
|
|
|
11956
12076
|
}
|
|
11957
12077
|
)
|
|
11958
12078
|
] }),
|
|
11959
|
-
draft.characterType === "builtin" && /* @__PURE__ */
|
|
11960
|
-
/* @__PURE__ */
|
|
12079
|
+
draft.characterType === "builtin" && /* @__PURE__ */ jsxs33("div", { className: "space-y-2", children: [
|
|
12080
|
+
/* @__PURE__ */ jsx50(
|
|
11961
12081
|
"label",
|
|
11962
12082
|
{
|
|
11963
12083
|
htmlFor: "chatkit-pet-builtin",
|
|
@@ -11965,7 +12085,7 @@ function SettingsSheet({
|
|
|
11965
12085
|
children: t("pet.settings.builtin")
|
|
11966
12086
|
}
|
|
11967
12087
|
),
|
|
11968
|
-
/* @__PURE__ */
|
|
12088
|
+
/* @__PURE__ */ jsxs33(
|
|
11969
12089
|
Select,
|
|
11970
12090
|
{
|
|
11971
12091
|
value: selectedBuiltinPet.id,
|
|
@@ -11976,26 +12096,26 @@ function SettingsSheet({
|
|
|
11976
12096
|
}
|
|
11977
12097
|
},
|
|
11978
12098
|
children: [
|
|
11979
|
-
/* @__PURE__ */
|
|
12099
|
+
/* @__PURE__ */ jsx50(
|
|
11980
12100
|
SelectTrigger,
|
|
11981
12101
|
{
|
|
11982
12102
|
id: "chatkit-pet-builtin",
|
|
11983
12103
|
className: "min-h-12 w-full px-3 py-2",
|
|
11984
|
-
children: /* @__PURE__ */
|
|
12104
|
+
children: /* @__PURE__ */ jsx50(SelectValue, { placeholder: selectedBuiltinPetLabel })
|
|
11985
12105
|
}
|
|
11986
12106
|
),
|
|
11987
|
-
/* @__PURE__ */
|
|
12107
|
+
/* @__PURE__ */ jsx50(SelectContent, { className: "w-[var(--radix-select-trigger-width)]", children: /* @__PURE__ */ jsx50(SelectGroup, { children: INCLUDED_PET_OPTIONS.map((pet) => {
|
|
11988
12108
|
const label = t(`pet.settings.builtins.${pet.id}`, {
|
|
11989
12109
|
defaultValue: pet.label
|
|
11990
12110
|
});
|
|
11991
|
-
return /* @__PURE__ */
|
|
12111
|
+
return /* @__PURE__ */ jsx50(
|
|
11992
12112
|
SelectItem,
|
|
11993
12113
|
{
|
|
11994
12114
|
value: pet.id,
|
|
11995
12115
|
className: "min-h-10 py-1.5 pl-2 pr-8",
|
|
11996
|
-
children: /* @__PURE__ */
|
|
11997
|
-
/* @__PURE__ */
|
|
11998
|
-
/* @__PURE__ */
|
|
12116
|
+
children: /* @__PURE__ */ jsxs33("span", { className: "flex min-w-0 items-center gap-2", children: [
|
|
12117
|
+
/* @__PURE__ */ jsx50(PetPreview, { src: pet.previewSrc, label }),
|
|
12118
|
+
/* @__PURE__ */ jsx50("span", { className: "min-w-0 truncate", children: label })
|
|
11999
12119
|
] })
|
|
12000
12120
|
},
|
|
12001
12121
|
pet.id
|
|
@@ -12005,8 +12125,8 @@ function SettingsSheet({
|
|
|
12005
12125
|
}
|
|
12006
12126
|
)
|
|
12007
12127
|
] }),
|
|
12008
|
-
draft.characterType === "atlas" && /* @__PURE__ */
|
|
12009
|
-
/* @__PURE__ */
|
|
12128
|
+
draft.characterType === "atlas" && /* @__PURE__ */ jsxs33("div", { className: "space-y-2", children: [
|
|
12129
|
+
/* @__PURE__ */ jsx50(
|
|
12010
12130
|
"label",
|
|
12011
12131
|
{
|
|
12012
12132
|
className: "text-sm font-medium",
|
|
@@ -12014,7 +12134,7 @@ function SettingsSheet({
|
|
|
12014
12134
|
children: t("pet.settings.atlasUrl")
|
|
12015
12135
|
}
|
|
12016
12136
|
),
|
|
12017
|
-
/* @__PURE__ */
|
|
12137
|
+
/* @__PURE__ */ jsx50(
|
|
12018
12138
|
Input,
|
|
12019
12139
|
{
|
|
12020
12140
|
id: "chatkit-pet-atlas",
|
|
@@ -12024,15 +12144,15 @@ function SettingsSheet({
|
|
|
12024
12144
|
}
|
|
12025
12145
|
)
|
|
12026
12146
|
] }),
|
|
12027
|
-
/* @__PURE__ */
|
|
12028
|
-
/* @__PURE__ */
|
|
12029
|
-
/* @__PURE__ */
|
|
12030
|
-
/* @__PURE__ */
|
|
12147
|
+
/* @__PURE__ */ jsxs33("div", { className: "space-y-2", children: [
|
|
12148
|
+
/* @__PURE__ */ jsxs33("div", { className: "flex items-center justify-between gap-4", children: [
|
|
12149
|
+
/* @__PURE__ */ jsx50("label", { className: "text-sm font-medium", htmlFor: "chatkit-pet-scale", children: t("pet.settings.scale") }),
|
|
12150
|
+
/* @__PURE__ */ jsxs33("span", { className: "text-xs tabular-nums text-muted-foreground", children: [
|
|
12031
12151
|
draft.scale.toFixed(2),
|
|
12032
12152
|
"x"
|
|
12033
12153
|
] })
|
|
12034
12154
|
] }),
|
|
12035
|
-
/* @__PURE__ */
|
|
12155
|
+
/* @__PURE__ */ jsx50(
|
|
12036
12156
|
Slider,
|
|
12037
12157
|
{
|
|
12038
12158
|
id: "chatkit-pet-scale",
|
|
@@ -12046,8 +12166,8 @@ function SettingsSheet({
|
|
|
12046
12166
|
}
|
|
12047
12167
|
)
|
|
12048
12168
|
] }),
|
|
12049
|
-
/* @__PURE__ */
|
|
12050
|
-
/* @__PURE__ */
|
|
12169
|
+
/* @__PURE__ */ jsxs33("label", { className: "flex items-center gap-2 text-sm", children: [
|
|
12170
|
+
/* @__PURE__ */ jsx50(
|
|
12051
12171
|
"input",
|
|
12052
12172
|
{
|
|
12053
12173
|
type: "checkbox",
|
|
@@ -12058,8 +12178,8 @@ function SettingsSheet({
|
|
|
12058
12178
|
),
|
|
12059
12179
|
t("pet.settings.draggable")
|
|
12060
12180
|
] }),
|
|
12061
|
-
/* @__PURE__ */
|
|
12062
|
-
/* @__PURE__ */
|
|
12181
|
+
/* @__PURE__ */ jsxs33("label", { className: "flex items-center gap-2 text-sm", children: [
|
|
12182
|
+
/* @__PURE__ */ jsx50(
|
|
12063
12183
|
"input",
|
|
12064
12184
|
{
|
|
12065
12185
|
type: "checkbox",
|
|
@@ -12070,8 +12190,8 @@ function SettingsSheet({
|
|
|
12070
12190
|
),
|
|
12071
12191
|
t("pet.settings.persistPosition")
|
|
12072
12192
|
] }),
|
|
12073
|
-
/* @__PURE__ */
|
|
12074
|
-
/* @__PURE__ */
|
|
12193
|
+
/* @__PURE__ */ jsxs33("div", { className: "flex justify-end gap-2 pt-2", children: [
|
|
12194
|
+
/* @__PURE__ */ jsx50(
|
|
12075
12195
|
Button,
|
|
12076
12196
|
{
|
|
12077
12197
|
type: "button",
|
|
@@ -12080,7 +12200,7 @@ function SettingsSheet({
|
|
|
12080
12200
|
children: t("pet.settings.cancel")
|
|
12081
12201
|
}
|
|
12082
12202
|
),
|
|
12083
|
-
/* @__PURE__ */
|
|
12203
|
+
/* @__PURE__ */ jsx50(Button, { type: "submit", children: t("pet.settings.save") })
|
|
12084
12204
|
] })
|
|
12085
12205
|
] })
|
|
12086
12206
|
] }) });
|
|
@@ -12586,7 +12706,7 @@ function findDomPointForComposerOffset(root, offset) {
|
|
|
12586
12706
|
}
|
|
12587
12707
|
|
|
12588
12708
|
// src/components/chat.tsx
|
|
12589
|
-
import { Fragment as Fragment7, jsx as
|
|
12709
|
+
import { Fragment as Fragment7, jsx as jsx51, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
12590
12710
|
var defaultApiUrl2 = import.meta.env.VITE_XPERTAI_API_URL;
|
|
12591
12711
|
var COMPOSER_INPUT_MAX_HEIGHT = 128;
|
|
12592
12712
|
var LONG_TEXT_REFERENCE_THRESHOLD = 5e3;
|
|
@@ -12718,8 +12838,8 @@ function ReferenceChip({
|
|
|
12718
12838
|
}) {
|
|
12719
12839
|
const metaLine = getReferenceMetaLine(reference);
|
|
12720
12840
|
const isComposer = variant === "composer";
|
|
12721
|
-
const Icon = reference.type === "quote" ? Quote : reference.type === "image" ? ImageIcon :
|
|
12722
|
-
return /* @__PURE__ */
|
|
12841
|
+
const Icon = reference.type === "quote" ? Quote : reference.type === "image" ? ImageIcon : FileText4;
|
|
12842
|
+
return /* @__PURE__ */ jsxs34(
|
|
12723
12843
|
"div",
|
|
12724
12844
|
{
|
|
12725
12845
|
className: cn(
|
|
@@ -12728,7 +12848,7 @@ function ReferenceChip({
|
|
|
12728
12848
|
),
|
|
12729
12849
|
title: getReferenceTitle(reference),
|
|
12730
12850
|
children: [
|
|
12731
|
-
/* @__PURE__ */
|
|
12851
|
+
/* @__PURE__ */ jsx51(
|
|
12732
12852
|
Icon,
|
|
12733
12853
|
{
|
|
12734
12854
|
size: isComposer ? 14 : 12,
|
|
@@ -12738,8 +12858,8 @@ function ReferenceChip({
|
|
|
12738
12858
|
)
|
|
12739
12859
|
}
|
|
12740
12860
|
),
|
|
12741
|
-
/* @__PURE__ */
|
|
12742
|
-
/* @__PURE__ */
|
|
12861
|
+
/* @__PURE__ */ jsxs34("div", { className: "min-w-0 flex-1", children: [
|
|
12862
|
+
/* @__PURE__ */ jsx51(
|
|
12743
12863
|
"div",
|
|
12744
12864
|
{
|
|
12745
12865
|
className: cn(
|
|
@@ -12749,7 +12869,7 @@ function ReferenceChip({
|
|
|
12749
12869
|
children: getReferenceLabel(reference)
|
|
12750
12870
|
}
|
|
12751
12871
|
),
|
|
12752
|
-
metaLine && /* @__PURE__ */
|
|
12872
|
+
metaLine && /* @__PURE__ */ jsx51(
|
|
12753
12873
|
"div",
|
|
12754
12874
|
{
|
|
12755
12875
|
className: cn(
|
|
@@ -12760,7 +12880,7 @@ function ReferenceChip({
|
|
|
12760
12880
|
}
|
|
12761
12881
|
)
|
|
12762
12882
|
] }),
|
|
12763
|
-
onRemove && removeLabel && /* @__PURE__ */
|
|
12883
|
+
onRemove && removeLabel && /* @__PURE__ */ jsx51(
|
|
12764
12884
|
"button",
|
|
12765
12885
|
{
|
|
12766
12886
|
type: "button",
|
|
@@ -12771,7 +12891,7 @@ function ReferenceChip({
|
|
|
12771
12891
|
),
|
|
12772
12892
|
title: removeLabel,
|
|
12773
12893
|
"aria-label": removeLabel,
|
|
12774
|
-
children: /* @__PURE__ */
|
|
12894
|
+
children: /* @__PURE__ */ jsx51(X5, { size: 12 })
|
|
12775
12895
|
}
|
|
12776
12896
|
)
|
|
12777
12897
|
]
|
|
@@ -12795,20 +12915,20 @@ function Chat({
|
|
|
12795
12915
|
const { setStream } = useStreamManager();
|
|
12796
12916
|
const stream = useStreamContext();
|
|
12797
12917
|
const { theme } = useTheme();
|
|
12798
|
-
const [isHistoryLoading, setIsHistoryLoading] =
|
|
12799
|
-
const [historyError, setHistoryError] =
|
|
12800
|
-
const [assistantName, setAssistantName] =
|
|
12801
|
-
const [assistantAvatar, setAssistantAvatar] =
|
|
12918
|
+
const [isHistoryLoading, setIsHistoryLoading] = React46.useState(false);
|
|
12919
|
+
const [historyError, setHistoryError] = React46.useState(null);
|
|
12920
|
+
const [assistantName, setAssistantName] = React46.useState(null);
|
|
12921
|
+
const [assistantAvatar, setAssistantAvatar] = React46.useState(null);
|
|
12802
12922
|
const LOADING_DOTS_MIN_DURATION = 800;
|
|
12803
12923
|
const STREAMING_STATUS_REFRESH_MS = 250;
|
|
12804
|
-
const [showLoadingDots, setShowLoadingDots] =
|
|
12805
|
-
const [streamingNow, setStreamingNow] =
|
|
12806
|
-
const loadingStartTimeRef =
|
|
12807
|
-
const lastStreamOutputAtRef =
|
|
12808
|
-
|
|
12924
|
+
const [showLoadingDots, setShowLoadingDots] = React46.useState(false);
|
|
12925
|
+
const [streamingNow, setStreamingNow] = React46.useState(() => Date.now());
|
|
12926
|
+
const loadingStartTimeRef = React46.useRef(null);
|
|
12927
|
+
const lastStreamOutputAtRef = React46.useRef(null);
|
|
12928
|
+
React46.useEffect(() => {
|
|
12809
12929
|
setStream(stream);
|
|
12810
12930
|
}, [setStream, stream]);
|
|
12811
|
-
|
|
12931
|
+
React46.useEffect(() => {
|
|
12812
12932
|
if (stream.isLoading) {
|
|
12813
12933
|
if (!loadingStartTimeRef.current) {
|
|
12814
12934
|
loadingStartTimeRef.current = Date.now();
|
|
@@ -12831,7 +12951,7 @@ function Chat({
|
|
|
12831
12951
|
}
|
|
12832
12952
|
}
|
|
12833
12953
|
}, [stream.isLoading]);
|
|
12834
|
-
|
|
12954
|
+
React46.useEffect(() => {
|
|
12835
12955
|
if (!stream.isLoading) {
|
|
12836
12956
|
lastStreamOutputAtRef.current = null;
|
|
12837
12957
|
setStreamingNow(Date.now());
|
|
@@ -12841,7 +12961,7 @@ function Chat({
|
|
|
12841
12961
|
lastStreamOutputAtRef.current = now;
|
|
12842
12962
|
setStreamingNow(now);
|
|
12843
12963
|
}, [stream.messages, stream.isLoading]);
|
|
12844
|
-
|
|
12964
|
+
React46.useEffect(() => {
|
|
12845
12965
|
if (!stream.isLoading) {
|
|
12846
12966
|
return;
|
|
12847
12967
|
}
|
|
@@ -12850,74 +12970,74 @@ function Chat({
|
|
|
12850
12970
|
}, STREAMING_STATUS_REFRESH_MS);
|
|
12851
12971
|
return () => window.clearInterval(timer);
|
|
12852
12972
|
}, [stream.isLoading]);
|
|
12853
|
-
const [composerParts, setComposerParts] =
|
|
12854
|
-
const [renderedComposerParts, setRenderedComposerParts] =
|
|
12855
|
-
const [composerDomVersion, setComposerDomVersion] =
|
|
12856
|
-
const [selectedTool, setSelectedTool] =
|
|
12973
|
+
const [composerParts, setComposerParts] = React46.useState([]);
|
|
12974
|
+
const [renderedComposerParts, setRenderedComposerParts] = React46.useState([]);
|
|
12975
|
+
const [composerDomVersion, setComposerDomVersion] = React46.useState(0);
|
|
12976
|
+
const [selectedTool, setSelectedTool] = React46.useState(
|
|
12857
12977
|
null
|
|
12858
12978
|
);
|
|
12859
|
-
const [planModeEnabled, setPlanModeEnabled] =
|
|
12860
|
-
const [petSettingsOpen, setPetSettingsOpen] =
|
|
12861
|
-
const [petLocalSettings, setPetLocalSettings] =
|
|
12862
|
-
const [runtimeCapabilities, setRuntimeCapabilities] =
|
|
12863
|
-
const [runtimeCapabilitiesReady, setRuntimeCapabilitiesReady] =
|
|
12864
|
-
const [sessionRuntimeCapabilities, setSessionRuntimeCapabilities] =
|
|
12979
|
+
const [planModeEnabled, setPlanModeEnabled] = React46.useState(false);
|
|
12980
|
+
const [petSettingsOpen, setPetSettingsOpen] = React46.useState(false);
|
|
12981
|
+
const [petLocalSettings, setPetLocalSettings] = React46.useState(() => readPetLocalSettings());
|
|
12982
|
+
const [runtimeCapabilities, setRuntimeCapabilities] = React46.useState(null);
|
|
12983
|
+
const [runtimeCapabilitiesReady, setRuntimeCapabilitiesReady] = React46.useState(false);
|
|
12984
|
+
const [sessionRuntimeCapabilities, setSessionRuntimeCapabilities] = React46.useState(
|
|
12865
12985
|
() => createEmptyRuntimeCapabilitiesSelection()
|
|
12866
12986
|
);
|
|
12867
|
-
const [runRuntimeCapabilities, setRunRuntimeCapabilities] =
|
|
12987
|
+
const [runRuntimeCapabilities, setRunRuntimeCapabilities] = React46.useState(
|
|
12868
12988
|
() => createEmptyRuntimeCapabilitiesSelection()
|
|
12869
12989
|
);
|
|
12870
|
-
const [runtimeCapabilityPalette, setRuntimeCapabilityPalette] =
|
|
12871
|
-
const [attachments, setAttachments] =
|
|
12872
|
-
const [references, setReferences] =
|
|
12873
|
-
const [isUploadingReferenceImages, setIsUploadingReferenceImages] =
|
|
12874
|
-
const [quoteSelection, setQuoteSelection] =
|
|
12875
|
-
const [isAtBottom, setIsAtBottom] =
|
|
12876
|
-
const [hasUpdatesBelow, setHasUpdatesBelow] =
|
|
12990
|
+
const [runtimeCapabilityPalette, setRuntimeCapabilityPalette] = React46.useState(null);
|
|
12991
|
+
const [attachments, setAttachments] = React46.useState([]);
|
|
12992
|
+
const [references, setReferences] = React46.useState([]);
|
|
12993
|
+
const [isUploadingReferenceImages, setIsUploadingReferenceImages] = React46.useState(false);
|
|
12994
|
+
const [quoteSelection, setQuoteSelection] = React46.useState(null);
|
|
12995
|
+
const [isAtBottom, setIsAtBottom] = React46.useState(true);
|
|
12996
|
+
const [hasUpdatesBelow, setHasUpdatesBelow] = React46.useState(false);
|
|
12877
12997
|
const {
|
|
12878
12998
|
threads,
|
|
12879
12999
|
deleteThread,
|
|
12880
13000
|
refreshThreads,
|
|
12881
13001
|
isLoading: isThreadsLoading
|
|
12882
13002
|
} = useThreads();
|
|
12883
|
-
const viewportRef =
|
|
12884
|
-
const fileInputRef =
|
|
12885
|
-
const composerInputRef =
|
|
12886
|
-
const slashPaletteRef =
|
|
12887
|
-
const slashPaletteOptionRefs =
|
|
13003
|
+
const viewportRef = React46.useRef(null);
|
|
13004
|
+
const fileInputRef = React46.useRef(null);
|
|
13005
|
+
const composerInputRef = React46.useRef(null);
|
|
13006
|
+
const slashPaletteRef = React46.useRef(null);
|
|
13007
|
+
const slashPaletteOptionRefs = React46.useRef(
|
|
12888
13008
|
[]
|
|
12889
13009
|
);
|
|
12890
|
-
const composerPartsRef =
|
|
12891
|
-
const pendingComposerCaretOffsetRef =
|
|
12892
|
-
const shouldAutoScrollRef =
|
|
12893
|
-
const forceFollowRef =
|
|
12894
|
-
const previousMessageCountRef =
|
|
12895
|
-
const previousScrollTopRef =
|
|
12896
|
-
const autoScrollFrameRef =
|
|
12897
|
-
const isPointerDownRef =
|
|
12898
|
-
const lastTouchYRef =
|
|
12899
|
-
const runtimeCapabilityPreferenceLoadRef =
|
|
13010
|
+
const composerPartsRef = React46.useRef([]);
|
|
13011
|
+
const pendingComposerCaretOffsetRef = React46.useRef(null);
|
|
13012
|
+
const shouldAutoScrollRef = React46.useRef(true);
|
|
13013
|
+
const forceFollowRef = React46.useRef(false);
|
|
13014
|
+
const previousMessageCountRef = React46.useRef(0);
|
|
13015
|
+
const previousScrollTopRef = React46.useRef(0);
|
|
13016
|
+
const autoScrollFrameRef = React46.useRef(null);
|
|
13017
|
+
const isPointerDownRef = React46.useRef(false);
|
|
13018
|
+
const lastTouchYRef = React46.useRef(null);
|
|
13019
|
+
const runtimeCapabilityPreferenceLoadRef = React46.useRef(0);
|
|
12900
13020
|
const resolvedTitle = title ?? t("chat.title");
|
|
12901
13021
|
const resolvedPlaceholder = placeholder ?? t("chat.placeholder");
|
|
12902
13022
|
const petRequired = options?.displayMode === "pet";
|
|
12903
|
-
const basePetSettings =
|
|
13023
|
+
const basePetSettings = React46.useMemo(
|
|
12904
13024
|
() => derivePetLocalSettings(options?.pet),
|
|
12905
13025
|
[options?.pet]
|
|
12906
13026
|
);
|
|
12907
|
-
const displayedPetSettings =
|
|
13027
|
+
const displayedPetSettings = React46.useMemo(
|
|
12908
13028
|
() => ({
|
|
12909
13029
|
...petLocalSettings ?? basePetSettings,
|
|
12910
13030
|
...petRequired ? { enabled: true } : {}
|
|
12911
13031
|
}),
|
|
12912
13032
|
[basePetSettings, petLocalSettings, petRequired]
|
|
12913
13033
|
);
|
|
12914
|
-
const effectivePet =
|
|
13034
|
+
const effectivePet = React46.useMemo(() => {
|
|
12915
13035
|
if (petRequired || petLocalSettings) {
|
|
12916
13036
|
return buildPetOptionsFromLocalSettings(displayedPetSettings);
|
|
12917
13037
|
}
|
|
12918
13038
|
return options?.pet ?? null;
|
|
12919
13039
|
}, [displayedPetSettings, options?.pet, petLocalSettings, petRequired]);
|
|
12920
|
-
const savePetLocalSettings =
|
|
13040
|
+
const savePetLocalSettings = React46.useCallback(
|
|
12921
13041
|
(settings) => {
|
|
12922
13042
|
const nextSettings = petRequired ? { ...settings, enabled: true } : settings;
|
|
12923
13043
|
setPetLocalSettings(nextSettings);
|
|
@@ -12925,7 +13045,7 @@ function Chat({
|
|
|
12925
13045
|
},
|
|
12926
13046
|
[petRequired]
|
|
12927
13047
|
);
|
|
12928
|
-
const handlePetCommand =
|
|
13048
|
+
const handlePetCommand = React46.useCallback(
|
|
12929
13049
|
(mode) => {
|
|
12930
13050
|
if (mode === "settings") {
|
|
12931
13051
|
setPetSettingsOpen(true);
|
|
@@ -12947,11 +13067,11 @@ function Chat({
|
|
|
12947
13067
|
[displayedPetSettings, effectivePet, petRequired, savePetLocalSettings]
|
|
12948
13068
|
);
|
|
12949
13069
|
const inputPlaceholder = selectedTool?.placeholderOverride ?? composer?.placeholder ?? resolvedPlaceholder;
|
|
12950
|
-
const messages =
|
|
13070
|
+
const messages = React46.useMemo(
|
|
12951
13071
|
() => stream.messages ?? [],
|
|
12952
13072
|
[stream.messages]
|
|
12953
13073
|
);
|
|
12954
|
-
const draft =
|
|
13074
|
+
const draft = React46.useMemo(
|
|
12955
13075
|
() => getComposerPlainText(composerParts),
|
|
12956
13076
|
[composerParts]
|
|
12957
13077
|
);
|
|
@@ -12963,7 +13083,7 @@ function Chat({
|
|
|
12963
13083
|
isEmpty: isComposerInputEmpty,
|
|
12964
13084
|
isStacked: isComposerStacked
|
|
12965
13085
|
});
|
|
12966
|
-
const pendingFollowUps =
|
|
13086
|
+
const pendingFollowUps = React46.useMemo(
|
|
12967
13087
|
() => [...stream.pendingFollowUps ?? []].sort(
|
|
12968
13088
|
(a, b) => a.createdAt - b.createdAt
|
|
12969
13089
|
),
|
|
@@ -12974,18 +13094,18 @@ function Chat({
|
|
|
12974
13094
|
const hasPendingHITLRequest = Boolean(stream.pendingHITLRequest);
|
|
12975
13095
|
const hasPendingInteractiveRequest = hasPendingRequestUserInput || hasPendingHITLRequest;
|
|
12976
13096
|
const hasPendingTodos = Boolean(stream.todos?.items.length);
|
|
12977
|
-
const runtimeCapabilityOptions =
|
|
13097
|
+
const runtimeCapabilityOptions = React46.useMemo(
|
|
12978
13098
|
() => getRuntimeCapabilityOptions(runtimeCapabilities),
|
|
12979
13099
|
[runtimeCapabilities]
|
|
12980
13100
|
);
|
|
12981
|
-
const effectiveSessionRuntimeCapabilities =
|
|
13101
|
+
const effectiveSessionRuntimeCapabilities = React46.useMemo(
|
|
12982
13102
|
() => runtimeCapabilitiesReady && runtimeCapabilities ? mergeRuntimeCapabilitiesSelections(
|
|
12983
13103
|
runtimeCapabilities,
|
|
12984
13104
|
sessionRuntimeCapabilities
|
|
12985
13105
|
) : null,
|
|
12986
13106
|
[runtimeCapabilities, runtimeCapabilitiesReady, sessionRuntimeCapabilities]
|
|
12987
13107
|
);
|
|
12988
|
-
const runRuntimeCapabilityOptions =
|
|
13108
|
+
const runRuntimeCapabilityOptions = React46.useMemo(
|
|
12989
13109
|
() => runtimeCapabilityOptions.filter(
|
|
12990
13110
|
(option) => isRuntimeCapabilitySelected(
|
|
12991
13111
|
runRuntimeCapabilities,
|
|
@@ -12995,11 +13115,11 @@ function Chat({
|
|
|
12995
13115
|
),
|
|
12996
13116
|
[runRuntimeCapabilities, runtimeCapabilityOptions]
|
|
12997
13117
|
);
|
|
12998
|
-
const composerRuntimeCapabilitySelectionKeys =
|
|
13118
|
+
const composerRuntimeCapabilitySelectionKeys = React46.useMemo(
|
|
12999
13119
|
() => getComposerCapabilitySelectionKeys(composerParts),
|
|
13000
13120
|
[composerParts]
|
|
13001
13121
|
);
|
|
13002
|
-
const detachedRunRuntimeCapabilityOptions =
|
|
13122
|
+
const detachedRunRuntimeCapabilityOptions = React46.useMemo(
|
|
13003
13123
|
() => runRuntimeCapabilityOptions.filter(
|
|
13004
13124
|
(option) => !composerRuntimeCapabilitySelectionKeys.has(
|
|
13005
13125
|
getRuntimeCapabilityOptionKey(option)
|
|
@@ -13007,7 +13127,7 @@ function Chat({
|
|
|
13007
13127
|
),
|
|
13008
13128
|
[composerRuntimeCapabilitySelectionKeys, runRuntimeCapabilityOptions]
|
|
13009
13129
|
);
|
|
13010
|
-
const persistSessionRuntimeCapabilities =
|
|
13130
|
+
const persistSessionRuntimeCapabilities = React46.useCallback(
|
|
13011
13131
|
async (threadId, selection) => {
|
|
13012
13132
|
if (!runtimeCapabilities || !selection) {
|
|
13013
13133
|
return;
|
|
@@ -13032,10 +13152,10 @@ function Chat({
|
|
|
13032
13152
|
},
|
|
13033
13153
|
[runtimeCapabilities, stream.client]
|
|
13034
13154
|
);
|
|
13035
|
-
const clearQuoteSelection =
|
|
13155
|
+
const clearQuoteSelection = React46.useCallback(() => {
|
|
13036
13156
|
setQuoteSelection(null);
|
|
13037
13157
|
}, []);
|
|
13038
|
-
const commitComposerParts =
|
|
13158
|
+
const commitComposerParts = React46.useCallback(
|
|
13039
13159
|
(nextParts, options2) => {
|
|
13040
13160
|
const normalized = normalizeComposerParts(nextParts);
|
|
13041
13161
|
const previous = composerPartsRef.current;
|
|
@@ -13071,7 +13191,7 @@ function Chat({
|
|
|
13071
13191
|
},
|
|
13072
13192
|
[]
|
|
13073
13193
|
);
|
|
13074
|
-
const setComposerText =
|
|
13194
|
+
const setComposerText = React46.useCallback(
|
|
13075
13195
|
(text, caretOffset = text.length) => {
|
|
13076
13196
|
commitComposerParts(createComposerTextParts(text), {
|
|
13077
13197
|
caretOffset,
|
|
@@ -13081,7 +13201,7 @@ function Chat({
|
|
|
13081
13201
|
},
|
|
13082
13202
|
[commitComposerParts]
|
|
13083
13203
|
);
|
|
13084
|
-
const focusComposerAt =
|
|
13204
|
+
const focusComposerAt = React46.useCallback((position) => {
|
|
13085
13205
|
const nextPosition = position ?? getComposerEditingLength(composerPartsRef.current);
|
|
13086
13206
|
pendingComposerCaretOffsetRef.current = nextPosition;
|
|
13087
13207
|
requestAnimationFrame(() => {
|
|
@@ -13093,7 +13213,7 @@ function Chat({
|
|
|
13093
13213
|
});
|
|
13094
13214
|
}, []);
|
|
13095
13215
|
const parentMessenger = useParentMessenger({
|
|
13096
|
-
onSetComposerValue:
|
|
13216
|
+
onSetComposerValue: React46.useCallback(
|
|
13097
13217
|
(payload) => {
|
|
13098
13218
|
if (!payload) {
|
|
13099
13219
|
return;
|
|
@@ -13116,10 +13236,10 @@ function Chat({
|
|
|
13116
13236
|
},
|
|
13117
13237
|
[composer?.tools, setComposerText]
|
|
13118
13238
|
),
|
|
13119
|
-
onFocusComposer:
|
|
13239
|
+
onFocusComposer: React46.useCallback(() => {
|
|
13120
13240
|
composerInputRef.current?.focus();
|
|
13121
13241
|
}, []),
|
|
13122
|
-
onSetPetEnabled:
|
|
13242
|
+
onSetPetEnabled: React46.useCallback(
|
|
13123
13243
|
(enabled) => {
|
|
13124
13244
|
if (petRequired) {
|
|
13125
13245
|
return;
|
|
@@ -13133,10 +13253,10 @@ function Chat({
|
|
|
13133
13253
|
)
|
|
13134
13254
|
});
|
|
13135
13255
|
const canMinimizeToPet = parentMessenger?.isParentAvailable === true && isPetEnabled(effectivePet);
|
|
13136
|
-
const handleMinimizeToPet =
|
|
13256
|
+
const handleMinimizeToPet = React46.useCallback(() => {
|
|
13137
13257
|
parentMessenger?.sendEvent("chat_minimize_change", { minimized: true });
|
|
13138
13258
|
}, [parentMessenger]);
|
|
13139
|
-
const syncQuoteSelection =
|
|
13259
|
+
const syncQuoteSelection = React46.useCallback(() => {
|
|
13140
13260
|
if (typeof window === "undefined") {
|
|
13141
13261
|
clearQuoteSelection();
|
|
13142
13262
|
return;
|
|
@@ -13181,23 +13301,23 @@ function Chat({
|
|
|
13181
13301
|
left
|
|
13182
13302
|
});
|
|
13183
13303
|
}, [clearQuoteSelection]);
|
|
13184
|
-
const cancelPendingAutoScroll =
|
|
13304
|
+
const cancelPendingAutoScroll = React46.useCallback(() => {
|
|
13185
13305
|
if (autoScrollFrameRef.current !== null) {
|
|
13186
13306
|
cancelAnimationFrame(autoScrollFrameRef.current);
|
|
13187
13307
|
autoScrollFrameRef.current = null;
|
|
13188
13308
|
}
|
|
13189
13309
|
}, []);
|
|
13190
|
-
const disableAutoFollow =
|
|
13310
|
+
const disableAutoFollow = React46.useCallback(() => {
|
|
13191
13311
|
forceFollowRef.current = false;
|
|
13192
13312
|
shouldAutoScrollRef.current = false;
|
|
13193
13313
|
cancelPendingAutoScroll();
|
|
13194
13314
|
}, [cancelPendingAutoScroll]);
|
|
13195
|
-
const enableAutoFollow =
|
|
13315
|
+
const enableAutoFollow = React46.useCallback(() => {
|
|
13196
13316
|
forceFollowRef.current = true;
|
|
13197
13317
|
shouldAutoScrollRef.current = true;
|
|
13198
13318
|
setHasUpdatesBelow(false);
|
|
13199
13319
|
}, []);
|
|
13200
|
-
const scrollToBottom =
|
|
13320
|
+
const scrollToBottom = React46.useCallback(
|
|
13201
13321
|
(smooth = false, force = false) => {
|
|
13202
13322
|
if (force) {
|
|
13203
13323
|
enableAutoFollow();
|
|
@@ -13224,7 +13344,7 @@ function Chat({
|
|
|
13224
13344
|
},
|
|
13225
13345
|
[cancelPendingAutoScroll, enableAutoFollow]
|
|
13226
13346
|
);
|
|
13227
|
-
|
|
13347
|
+
React46.useEffect(() => {
|
|
13228
13348
|
const viewport = viewportRef.current;
|
|
13229
13349
|
if (!viewport) return;
|
|
13230
13350
|
previousScrollTopRef.current = viewport.scrollTop;
|
|
@@ -13305,14 +13425,14 @@ function Chat({
|
|
|
13305
13425
|
window.removeEventListener("pointercancel", stopPointerTracking);
|
|
13306
13426
|
};
|
|
13307
13427
|
}, [cancelPendingAutoScroll, disableAutoFollow]);
|
|
13308
|
-
|
|
13428
|
+
React46.useEffect(() => {
|
|
13309
13429
|
shouldAutoScrollRef.current = true;
|
|
13310
13430
|
forceFollowRef.current = false;
|
|
13311
13431
|
previousScrollTopRef.current = 0;
|
|
13312
13432
|
setIsAtBottom(true);
|
|
13313
13433
|
setHasUpdatesBelow(false);
|
|
13314
13434
|
}, [stream.threadId]);
|
|
13315
|
-
|
|
13435
|
+
React46.useEffect(() => {
|
|
13316
13436
|
const messageCountChanged = messages.length !== previousMessageCountRef.current;
|
|
13317
13437
|
previousMessageCountRef.current = messages.length;
|
|
13318
13438
|
if (!shouldAutoScrollRef.current) {
|
|
@@ -13331,7 +13451,7 @@ function Chat({
|
|
|
13331
13451
|
clientSecret: effectiveClientSecret
|
|
13332
13452
|
});
|
|
13333
13453
|
const missingConfig = Boolean(missingConfigKind);
|
|
13334
|
-
const missingConfigShortMessage =
|
|
13454
|
+
const missingConfigShortMessage = React46.useMemo(() => {
|
|
13335
13455
|
switch (missingConfigKind) {
|
|
13336
13456
|
case "apiUrl":
|
|
13337
13457
|
return t("chat.missingApiUrlShort");
|
|
@@ -13343,7 +13463,7 @@ function Chat({
|
|
|
13343
13463
|
return t("chat.missingConfigShort");
|
|
13344
13464
|
}
|
|
13345
13465
|
}, [missingConfigKind, t]);
|
|
13346
|
-
const missingConfigDetailMessage =
|
|
13466
|
+
const missingConfigDetailMessage = React46.useMemo(() => {
|
|
13347
13467
|
switch (missingConfigKind) {
|
|
13348
13468
|
case "apiUrl":
|
|
13349
13469
|
return t("chat.missingApiUrlDetail");
|
|
@@ -13358,7 +13478,7 @@ function Chat({
|
|
|
13358
13478
|
const showMissingConfig = !isClientSecretInitializing && missingConfig;
|
|
13359
13479
|
const hasUploadingFiles = attachments.some((a) => a.status === "uploading");
|
|
13360
13480
|
const isSendDisabled = !trimmedDraft && !hasReferences || hasPendingInteractiveRequest || missingConfig || isHistoryLoading || hasUploadingFiles || isUploadingReferenceImages;
|
|
13361
|
-
const resizeComposerInput =
|
|
13481
|
+
const resizeComposerInput = React46.useCallback(() => {
|
|
13362
13482
|
const input = composerInputRef.current;
|
|
13363
13483
|
if (!input) {
|
|
13364
13484
|
return;
|
|
@@ -13366,7 +13486,7 @@ function Chat({
|
|
|
13366
13486
|
input.style.maxHeight = `${COMPOSER_INPUT_MAX_HEIGHT}px`;
|
|
13367
13487
|
input.style.overflowY = input.scrollHeight > COMPOSER_INPUT_MAX_HEIGHT ? "auto" : "hidden";
|
|
13368
13488
|
}, []);
|
|
13369
|
-
|
|
13489
|
+
React46.useLayoutEffect(() => {
|
|
13370
13490
|
composerPartsRef.current = composerParts;
|
|
13371
13491
|
resizeComposerInput();
|
|
13372
13492
|
const caretOffset = pendingComposerCaretOffsetRef.current;
|
|
@@ -13378,13 +13498,13 @@ function Chat({
|
|
|
13378
13498
|
}
|
|
13379
13499
|
}
|
|
13380
13500
|
}, [composerDomVersion, composerParts, resizeComposerInput]);
|
|
13381
|
-
|
|
13501
|
+
React46.useEffect(() => {
|
|
13382
13502
|
document.addEventListener("selectionchange", syncQuoteSelection);
|
|
13383
13503
|
return () => {
|
|
13384
13504
|
document.removeEventListener("selectionchange", syncQuoteSelection);
|
|
13385
13505
|
};
|
|
13386
13506
|
}, [syncQuoteSelection]);
|
|
13387
|
-
|
|
13507
|
+
React46.useEffect(() => {
|
|
13388
13508
|
const viewport = viewportRef.current;
|
|
13389
13509
|
if (!viewport) {
|
|
13390
13510
|
return;
|
|
@@ -13401,14 +13521,14 @@ function Chat({
|
|
|
13401
13521
|
window.removeEventListener("resize", handleViewportScroll);
|
|
13402
13522
|
};
|
|
13403
13523
|
}, [clearQuoteSelection]);
|
|
13404
|
-
|
|
13524
|
+
React46.useEffect(() => {
|
|
13405
13525
|
clearQuoteSelection();
|
|
13406
13526
|
}, [messages.length, stream.threadId, clearQuoteSelection]);
|
|
13407
|
-
|
|
13527
|
+
React46.useEffect(() => {
|
|
13408
13528
|
if (missingConfig) return;
|
|
13409
13529
|
void refreshThreads();
|
|
13410
13530
|
}, [missingConfig, refreshThreads]);
|
|
13411
|
-
|
|
13531
|
+
React46.useEffect(() => {
|
|
13412
13532
|
if (missingConfig || !stream.client || !stream.assistantId) {
|
|
13413
13533
|
setAssistantName(null);
|
|
13414
13534
|
setAssistantAvatar(null);
|
|
@@ -13431,7 +13551,7 @@ function Chat({
|
|
|
13431
13551
|
cancelled = true;
|
|
13432
13552
|
};
|
|
13433
13553
|
}, [missingConfig, stream.client, stream.assistantId]);
|
|
13434
|
-
|
|
13554
|
+
React46.useEffect(() => {
|
|
13435
13555
|
if (missingConfig || !stream.client || !stream.assistantId) {
|
|
13436
13556
|
setRuntimeCapabilities(null);
|
|
13437
13557
|
setRuntimeCapabilitiesReady(false);
|
|
@@ -13478,7 +13598,7 @@ function Chat({
|
|
|
13478
13598
|
});
|
|
13479
13599
|
return () => controller.abort();
|
|
13480
13600
|
}, [missingConfig, stream.client, stream.assistantId]);
|
|
13481
|
-
|
|
13601
|
+
React46.useEffect(() => {
|
|
13482
13602
|
setRunRuntimeCapabilities(
|
|
13483
13603
|
createEmptyRuntimeCapabilitiesSelection(runtimeCapabilities)
|
|
13484
13604
|
);
|
|
@@ -13535,7 +13655,7 @@ function Chat({
|
|
|
13535
13655
|
mimetype: a.storageFile?.mimetype ?? a.file.type,
|
|
13536
13656
|
size: a.storageFile?.size ?? a.file.size
|
|
13537
13657
|
}));
|
|
13538
|
-
const handleSessionRuntimeCapabilityToggle =
|
|
13658
|
+
const handleSessionRuntimeCapabilityToggle = React46.useCallback(
|
|
13539
13659
|
(type, id, selected) => {
|
|
13540
13660
|
setSessionRuntimeCapabilities((previous) => {
|
|
13541
13661
|
const nextSelection = toggleRuntimeCapabilitySelection(
|
|
@@ -13553,7 +13673,7 @@ function Chat({
|
|
|
13553
13673
|
},
|
|
13554
13674
|
[persistSessionRuntimeCapabilities, stream.threadId]
|
|
13555
13675
|
);
|
|
13556
|
-
const updateRuntimeCapabilityPalette =
|
|
13676
|
+
const updateRuntimeCapabilityPalette = React46.useCallback(
|
|
13557
13677
|
(parts, selectionStart) => {
|
|
13558
13678
|
const input = composerInputRef.current;
|
|
13559
13679
|
const editingText = getComposerEditingText(parts);
|
|
@@ -13565,7 +13685,7 @@ function Chat({
|
|
|
13565
13685
|
},
|
|
13566
13686
|
[]
|
|
13567
13687
|
);
|
|
13568
|
-
const syncComposerInputFromElement =
|
|
13688
|
+
const syncComposerInputFromElement = React46.useCallback(
|
|
13569
13689
|
(input) => {
|
|
13570
13690
|
const previousCapabilities = getComposerCapabilityPartMap(
|
|
13571
13691
|
composerPartsRef.current
|
|
@@ -13583,25 +13703,25 @@ function Chat({
|
|
|
13583
13703
|
},
|
|
13584
13704
|
[commitComposerParts, updateRuntimeCapabilityPalette]
|
|
13585
13705
|
);
|
|
13586
|
-
const handleComposerInput =
|
|
13706
|
+
const handleComposerInput = React46.useCallback(
|
|
13587
13707
|
(event) => {
|
|
13588
13708
|
syncComposerInputFromElement(event.currentTarget);
|
|
13589
13709
|
},
|
|
13590
13710
|
[syncComposerInputFromElement]
|
|
13591
13711
|
);
|
|
13592
|
-
const handleComposerCompositionEnd =
|
|
13712
|
+
const handleComposerCompositionEnd = React46.useCallback(
|
|
13593
13713
|
(event) => {
|
|
13594
13714
|
syncComposerInputFromElement(event.currentTarget);
|
|
13595
13715
|
},
|
|
13596
13716
|
[syncComposerInputFromElement]
|
|
13597
13717
|
);
|
|
13598
|
-
const handleComposerSelect =
|
|
13718
|
+
const handleComposerSelect = React46.useCallback(() => {
|
|
13599
13719
|
updateRuntimeCapabilityPalette(
|
|
13600
13720
|
composerPartsRef.current,
|
|
13601
13721
|
composerInputRef.current ? getComposerSelectionOffset(composerInputRef.current) : void 0
|
|
13602
13722
|
);
|
|
13603
13723
|
}, [updateRuntimeCapabilityPalette]);
|
|
13604
|
-
const removeRunRuntimeCapability =
|
|
13724
|
+
const removeRunRuntimeCapability = React46.useCallback(
|
|
13605
13725
|
(option) => {
|
|
13606
13726
|
setRunRuntimeCapabilities(
|
|
13607
13727
|
(previous) => toggleRuntimeCapabilitySelection(
|
|
@@ -13621,7 +13741,7 @@ function Chat({
|
|
|
13621
13741
|
},
|
|
13622
13742
|
[commitComposerParts]
|
|
13623
13743
|
);
|
|
13624
|
-
const submitDraft =
|
|
13744
|
+
const submitDraft = React46.useCallback(
|
|
13625
13745
|
(optionsOrFollowUp) => {
|
|
13626
13746
|
if (isSendDisabled) return;
|
|
13627
13747
|
const submitOptions = typeof optionsOrFollowUp === "string" ? { followUpOverride: optionsOrFollowUp } : optionsOrFollowUp ?? {};
|
|
@@ -13745,7 +13865,7 @@ function Chat({
|
|
|
13745
13865
|
t
|
|
13746
13866
|
]
|
|
13747
13867
|
);
|
|
13748
|
-
const addRunRuntimeCapabilities =
|
|
13868
|
+
const addRunRuntimeCapabilities = React46.useCallback(
|
|
13749
13869
|
(selection) => {
|
|
13750
13870
|
setRunRuntimeCapabilities(
|
|
13751
13871
|
(previous) => runtimeCapabilities ? mergeRuntimeCapabilitiesSelections(
|
|
@@ -13757,7 +13877,7 @@ function Chat({
|
|
|
13757
13877
|
},
|
|
13758
13878
|
[runtimeCapabilities]
|
|
13759
13879
|
);
|
|
13760
|
-
const insertComposerCapabilityToken =
|
|
13880
|
+
const insertComposerCapabilityToken = React46.useCallback(
|
|
13761
13881
|
(capability, range) => {
|
|
13762
13882
|
const token = createComposerCapabilityPart(capability, createMessageId());
|
|
13763
13883
|
const currentParts = composerPartsRef.current;
|
|
@@ -13828,7 +13948,7 @@ function Chat({
|
|
|
13828
13948
|
plugin: t("composer.slashCommands.empty.loadingCapabilities"),
|
|
13829
13949
|
subAgent: t("composer.slashCommands.empty.loadingCapabilities")
|
|
13830
13950
|
};
|
|
13831
|
-
|
|
13951
|
+
React46.useEffect(() => {
|
|
13832
13952
|
if (!runtimeCapabilityPalette) {
|
|
13833
13953
|
return;
|
|
13834
13954
|
}
|
|
@@ -13847,7 +13967,7 @@ function Chat({
|
|
|
13847
13967
|
);
|
|
13848
13968
|
}
|
|
13849
13969
|
}, [slashPaletteOptions.length, runtimeCapabilityPalette]);
|
|
13850
|
-
|
|
13970
|
+
React46.useLayoutEffect(() => {
|
|
13851
13971
|
if (!runtimeCapabilityPalette) {
|
|
13852
13972
|
return;
|
|
13853
13973
|
}
|
|
@@ -13871,7 +13991,7 @@ function Chat({
|
|
|
13871
13991
|
}
|
|
13872
13992
|
submitDraft();
|
|
13873
13993
|
};
|
|
13874
|
-
const handleEditPendingFollowUp =
|
|
13994
|
+
const handleEditPendingFollowUp = React46.useCallback(
|
|
13875
13995
|
(id) => {
|
|
13876
13996
|
const item = pendingFollowUps.find(
|
|
13877
13997
|
(entry) => entry.id === id && entry.mode === "queue"
|
|
@@ -13898,7 +14018,7 @@ function Chat({
|
|
|
13898
14018
|
},
|
|
13899
14019
|
[pendingFollowUps, setComposerText, stream]
|
|
13900
14020
|
);
|
|
13901
|
-
const handleQuoteSelection =
|
|
14021
|
+
const handleQuoteSelection = React46.useCallback(() => {
|
|
13902
14022
|
if (!quoteSelection) {
|
|
13903
14023
|
return;
|
|
13904
14024
|
}
|
|
@@ -13914,7 +14034,7 @@ function Chat({
|
|
|
13914
14034
|
const handleAttachmentClick = () => {
|
|
13915
14035
|
fileInputRef.current?.click();
|
|
13916
14036
|
};
|
|
13917
|
-
const uploadContextFile =
|
|
14037
|
+
const uploadContextFile = React46.useCallback(
|
|
13918
14038
|
(file) => stream.client.contexts.uploadFile(file),
|
|
13919
14039
|
[stream.client]
|
|
13920
14040
|
);
|
|
@@ -14018,7 +14138,7 @@ function Chat({
|
|
|
14018
14138
|
}
|
|
14019
14139
|
submitDraft();
|
|
14020
14140
|
};
|
|
14021
|
-
const handleComposerPaste =
|
|
14141
|
+
const handleComposerPaste = React46.useCallback(
|
|
14022
14142
|
(event) => {
|
|
14023
14143
|
const clipboardData = event.clipboardData;
|
|
14024
14144
|
if (!clipboardData) {
|
|
@@ -14117,18 +14237,18 @@ function Chat({
|
|
|
14117
14237
|
uploadContextFile
|
|
14118
14238
|
]
|
|
14119
14239
|
);
|
|
14120
|
-
const alternateFollowUpShortcutLabel =
|
|
14240
|
+
const alternateFollowUpShortcutLabel = React46.useMemo(() => {
|
|
14121
14241
|
if (typeof navigator === "undefined") {
|
|
14122
14242
|
return "\u2318Enter";
|
|
14123
14243
|
}
|
|
14124
14244
|
const platform = navigator.platform || navigator.userAgent;
|
|
14125
14245
|
return /Mac|iPhone|iPad|iPod/i.test(platform) ? "\u2318Enter" : "Ctrl+Enter";
|
|
14126
14246
|
}, []);
|
|
14127
|
-
const followUpShortcutLabels =
|
|
14247
|
+
const followUpShortcutLabels = React46.useMemo(
|
|
14128
14248
|
() => getComposerFollowUpShortcutLabels(alternateFollowUpShortcutLabel),
|
|
14129
14249
|
[alternateFollowUpShortcutLabel]
|
|
14130
14250
|
);
|
|
14131
|
-
const uploadFile =
|
|
14251
|
+
const uploadFile = React46.useCallback(
|
|
14132
14252
|
async (localId, file) => {
|
|
14133
14253
|
try {
|
|
14134
14254
|
const result = await uploadContextFile(file);
|
|
@@ -14151,7 +14271,7 @@ function Chat({
|
|
|
14151
14271
|
},
|
|
14152
14272
|
[uploadContextFile]
|
|
14153
14273
|
);
|
|
14154
|
-
const handleRetryUpload =
|
|
14274
|
+
const handleRetryUpload = React46.useCallback(
|
|
14155
14275
|
(localId) => {
|
|
14156
14276
|
const attachment = attachments.find((a) => a.localId === localId);
|
|
14157
14277
|
if (!attachment || attachment.status !== "error") return;
|
|
@@ -14250,7 +14370,7 @@ function Chat({
|
|
|
14250
14370
|
);
|
|
14251
14371
|
scrollToBottom(true, true);
|
|
14252
14372
|
};
|
|
14253
|
-
const loadConversationMessages =
|
|
14373
|
+
const loadConversationMessages = React46.useCallback(
|
|
14254
14374
|
async (recordId) => {
|
|
14255
14375
|
if (missingConfig) {
|
|
14256
14376
|
setHistoryError(missingConfigShortMessage);
|
|
@@ -14345,12 +14465,12 @@ function Chat({
|
|
|
14345
14465
|
}
|
|
14346
14466
|
};
|
|
14347
14467
|
const acceptMimes = composer?.attachments?.accept ? Object.entries(composer.attachments.accept).map(([mime, exts]) => [mime, ...exts.map((e) => `.${e}`)].join(",")).join(",") : void 0;
|
|
14348
|
-
const currentThread =
|
|
14468
|
+
const currentThread = React46.useMemo(
|
|
14349
14469
|
() => threads.find((item) => item.id === stream.threadId),
|
|
14350
14470
|
[threads, stream.threadId]
|
|
14351
14471
|
);
|
|
14352
14472
|
const streamErrorMessage = stream.error instanceof Error ? stream.error.message : void 0;
|
|
14353
|
-
const threadErrorMessage =
|
|
14473
|
+
const threadErrorMessage = React46.useMemo(() => {
|
|
14354
14474
|
if (streamErrorMessage?.trim()) return streamErrorMessage.trim();
|
|
14355
14475
|
if (currentThread?.status !== "error") return void 0;
|
|
14356
14476
|
const message = currentThread.error?.trim();
|
|
@@ -14381,7 +14501,7 @@ function Chat({
|
|
|
14381
14501
|
fallbackTitle: t("history.threadFallback")
|
|
14382
14502
|
});
|
|
14383
14503
|
const assistantTitle = assistantName || resolvedTitle;
|
|
14384
|
-
return /* @__PURE__ */
|
|
14504
|
+
return /* @__PURE__ */ jsxs34(
|
|
14385
14505
|
"div",
|
|
14386
14506
|
{
|
|
14387
14507
|
ref: viewportRef,
|
|
@@ -14391,10 +14511,10 @@ function Chat({
|
|
|
14391
14511
|
className
|
|
14392
14512
|
),
|
|
14393
14513
|
children: [
|
|
14394
|
-
/* @__PURE__ */
|
|
14395
|
-
/* @__PURE__ */
|
|
14396
|
-
/* @__PURE__ */
|
|
14397
|
-
/* @__PURE__ */
|
|
14514
|
+
/* @__PURE__ */ jsxs34("div", { className: "flex items-center justify-between border-b p-2 sticky top-0 z-10 bg-background", children: [
|
|
14515
|
+
/* @__PURE__ */ jsxs34("div", { className: "flex items-center gap-3 overflow-hidden", children: [
|
|
14516
|
+
/* @__PURE__ */ jsxs34("div", { className: "relative shrink-0", children: [
|
|
14517
|
+
/* @__PURE__ */ jsx51(
|
|
14398
14518
|
ChatkitAvatar,
|
|
14399
14519
|
{
|
|
14400
14520
|
avatar: assistantAvatar,
|
|
@@ -14402,10 +14522,10 @@ function Chat({
|
|
|
14402
14522
|
label: assistantTitle
|
|
14403
14523
|
}
|
|
14404
14524
|
),
|
|
14405
|
-
/* @__PURE__ */
|
|
14525
|
+
/* @__PURE__ */ jsx51("span", { className: "absolute bottom-0 right-0 h-2.5 w-2.5 rounded-full border-2 border-background bg-green-500" })
|
|
14406
14526
|
] }),
|
|
14407
|
-
/* @__PURE__ */
|
|
14408
|
-
/* @__PURE__ */
|
|
14527
|
+
/* @__PURE__ */ jsxs34("div", { className: "truncate", children: [
|
|
14528
|
+
/* @__PURE__ */ jsx51(
|
|
14409
14529
|
"h2",
|
|
14410
14530
|
{
|
|
14411
14531
|
className: "text-lg font-semibold truncate",
|
|
@@ -14413,12 +14533,12 @@ function Chat({
|
|
|
14413
14533
|
children: assistantTitle
|
|
14414
14534
|
}
|
|
14415
14535
|
),
|
|
14416
|
-
/* @__PURE__ */
|
|
14536
|
+
/* @__PURE__ */ jsx51("p", { className: "text-xs text-muted-foreground", children: t("chat.statusOnline") })
|
|
14417
14537
|
] })
|
|
14418
14538
|
] }),
|
|
14419
|
-
/* @__PURE__ */
|
|
14420
|
-
canMinimizeToPet && /* @__PURE__ */
|
|
14421
|
-
/* @__PURE__ */
|
|
14539
|
+
/* @__PURE__ */ jsxs34("div", { className: "flex items-center gap-1", children: [
|
|
14540
|
+
canMinimizeToPet && /* @__PURE__ */ jsxs34(Tooltip, { children: [
|
|
14541
|
+
/* @__PURE__ */ jsx51(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx51("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ jsx51(
|
|
14422
14542
|
"button",
|
|
14423
14543
|
{
|
|
14424
14544
|
type: "button",
|
|
@@ -14429,13 +14549,13 @@ function Chat({
|
|
|
14429
14549
|
"transition-colors duration-150"
|
|
14430
14550
|
),
|
|
14431
14551
|
"aria-label": t("chat.minimizeToPet"),
|
|
14432
|
-
children: /* @__PURE__ */
|
|
14552
|
+
children: /* @__PURE__ */ jsx51(Minus, { size: 16 })
|
|
14433
14553
|
}
|
|
14434
14554
|
) }) }),
|
|
14435
|
-
/* @__PURE__ */
|
|
14555
|
+
/* @__PURE__ */ jsx51(TooltipContent, { side: "bottom", children: t("chat.minimizeToPet") })
|
|
14436
14556
|
] }),
|
|
14437
|
-
/* @__PURE__ */
|
|
14438
|
-
/* @__PURE__ */
|
|
14557
|
+
/* @__PURE__ */ jsxs34(Tooltip, { children: [
|
|
14558
|
+
/* @__PURE__ */ jsx51(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx51("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ jsx51(
|
|
14439
14559
|
"button",
|
|
14440
14560
|
{
|
|
14441
14561
|
type: "button",
|
|
@@ -14446,14 +14566,14 @@ function Chat({
|
|
|
14446
14566
|
"transition-colors duration-150"
|
|
14447
14567
|
),
|
|
14448
14568
|
"aria-label": t("settings.open"),
|
|
14449
|
-
children: /* @__PURE__ */
|
|
14569
|
+
children: /* @__PURE__ */ jsx51(Settings2, { size: 16 })
|
|
14450
14570
|
}
|
|
14451
14571
|
) }) }),
|
|
14452
|
-
/* @__PURE__ */
|
|
14572
|
+
/* @__PURE__ */ jsx51(TooltipContent, { side: "bottom", children: t("settings.open") })
|
|
14453
14573
|
] }),
|
|
14454
|
-
history?.enabled !== false && /* @__PURE__ */
|
|
14455
|
-
/* @__PURE__ */
|
|
14456
|
-
/* @__PURE__ */
|
|
14574
|
+
history?.enabled !== false && /* @__PURE__ */ jsxs34(Fragment7, { children: [
|
|
14575
|
+
/* @__PURE__ */ jsxs34(Tooltip, { children: [
|
|
14576
|
+
/* @__PURE__ */ jsx51(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx51("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ jsx51(
|
|
14457
14577
|
"button",
|
|
14458
14578
|
{
|
|
14459
14579
|
type: "button",
|
|
@@ -14466,12 +14586,12 @@ function Chat({
|
|
|
14466
14586
|
"disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed"
|
|
14467
14587
|
),
|
|
14468
14588
|
"aria-label": t("history.newThread"),
|
|
14469
|
-
children: /* @__PURE__ */
|
|
14589
|
+
children: /* @__PURE__ */ jsx51(Pencil4, { size: 16 })
|
|
14470
14590
|
}
|
|
14471
14591
|
) }) }),
|
|
14472
|
-
/* @__PURE__ */
|
|
14592
|
+
/* @__PURE__ */ jsx51(TooltipContent, { side: "bottom", children: t("history.newThread") })
|
|
14473
14593
|
] }),
|
|
14474
|
-
/* @__PURE__ */
|
|
14594
|
+
/* @__PURE__ */ jsx51(
|
|
14475
14595
|
HistorySidebar,
|
|
14476
14596
|
{
|
|
14477
14597
|
threads,
|
|
@@ -14486,18 +14606,18 @@ function Chat({
|
|
|
14486
14606
|
] })
|
|
14487
14607
|
] })
|
|
14488
14608
|
] }),
|
|
14489
|
-
/* @__PURE__ */
|
|
14490
|
-
errorMessage && /* @__PURE__ */
|
|
14491
|
-
historyError && /* @__PURE__ */
|
|
14492
|
-
showMissingConfig && /* @__PURE__ */
|
|
14493
|
-
isHistoryLoading && /* @__PURE__ */
|
|
14494
|
-
messages.length === 0 ? /* @__PURE__ */
|
|
14609
|
+
/* @__PURE__ */ jsxs34("div", { className: "flex-1 p-4", children: [
|
|
14610
|
+
errorMessage && /* @__PURE__ */ jsx51("div", { className: "mb-4 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive", children: errorMessage }),
|
|
14611
|
+
historyError && /* @__PURE__ */ jsx51("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: historyError }),
|
|
14612
|
+
showMissingConfig && /* @__PURE__ */ jsx51("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: missingConfigDetailMessage }),
|
|
14613
|
+
isHistoryLoading && /* @__PURE__ */ jsx51("div", { className: "mb-4 rounded-lg border border-muted px-3 py-2 text-sm text-muted-foreground", children: t("chat.loadingThread") }),
|
|
14614
|
+
messages.length === 0 ? /* @__PURE__ */ jsx51(
|
|
14495
14615
|
StartScreen,
|
|
14496
14616
|
{
|
|
14497
14617
|
startScreen,
|
|
14498
14618
|
onPromptClick: handlePromptClick
|
|
14499
14619
|
}
|
|
14500
|
-
) : /* @__PURE__ */
|
|
14620
|
+
) : /* @__PURE__ */ jsxs34("div", { className: "space-y-4", children: [
|
|
14501
14621
|
messages.map((message, index) => {
|
|
14502
14622
|
const messageType = String(message.type);
|
|
14503
14623
|
const isAssistantMessage = messageType === "assistant" || messageType === "ai";
|
|
@@ -14530,7 +14650,7 @@ function Chat({
|
|
|
14530
14650
|
if (!isAssistantMessage && !hasPlainRenderableContent && !hasHumanAttachments && humanRuntimeCapabilityOptions.length === 0 && humanReferences.length === 0) {
|
|
14531
14651
|
return null;
|
|
14532
14652
|
}
|
|
14533
|
-
return /* @__PURE__ */
|
|
14653
|
+
return /* @__PURE__ */ jsx51(
|
|
14534
14654
|
"div",
|
|
14535
14655
|
{
|
|
14536
14656
|
className: cn(
|
|
@@ -14538,96 +14658,105 @@ function Chat({
|
|
|
14538
14658
|
message.type === "human" ? "justify-end" : "justify-start -ml-1"
|
|
14539
14659
|
// AI messages: slightly closer to left
|
|
14540
14660
|
),
|
|
14541
|
-
children: /* @__PURE__ */
|
|
14542
|
-
|
|
14543
|
-
|
|
14544
|
-
|
|
14545
|
-
|
|
14546
|
-
|
|
14547
|
-
|
|
14548
|
-
|
|
14549
|
-
|
|
14550
|
-
"
|
|
14551
|
-
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"
|
|
14552
|
-
// AI messages: use chat-specific foreground color
|
|
14553
|
-
),
|
|
14554
|
-
children: isAssistantMessage ? /* @__PURE__ */ jsx50(
|
|
14555
|
-
AssistantMessage,
|
|
14661
|
+
children: /* @__PURE__ */ jsxs34(
|
|
14662
|
+
"div",
|
|
14663
|
+
{
|
|
14664
|
+
className: cn(
|
|
14665
|
+
"flex flex-col px-3 overflow-hidden",
|
|
14666
|
+
isAssistantMessage && "min-w-0 flex-1"
|
|
14667
|
+
),
|
|
14668
|
+
children: [
|
|
14669
|
+
/* @__PURE__ */ jsx51(
|
|
14670
|
+
"div",
|
|
14556
14671
|
{
|
|
14557
|
-
|
|
14558
|
-
|
|
14559
|
-
|
|
14560
|
-
},
|
|
14561
|
-
|
|
14562
|
-
|
|
14563
|
-
|
|
14564
|
-
|
|
14565
|
-
})
|
|
14672
|
+
...canQuoteMessage ? {
|
|
14673
|
+
"data-quote-message-id": message.id,
|
|
14674
|
+
"data-quote-source": quoteSource
|
|
14675
|
+
} : {},
|
|
14676
|
+
className: cn(
|
|
14677
|
+
"max-w-full rounded-2xl",
|
|
14678
|
+
message.type === "human" ? "bg-primary text-primary-foreground px-4 py-2.5" : message.type === "system" ? "bg-muted text-muted-foreground text-xs px-4 py-2.5" : "py-1 text-chat-foreground"
|
|
14679
|
+
// AI messages: use chat-specific foreground color
|
|
14566
14680
|
),
|
|
14681
|
+
children: isAssistantMessage ? /* @__PURE__ */ jsx51(
|
|
14682
|
+
AssistantMessage,
|
|
14683
|
+
{
|
|
14684
|
+
message: {
|
|
14685
|
+
...message,
|
|
14686
|
+
type: "assistant"
|
|
14687
|
+
},
|
|
14688
|
+
messages: messages.slice(0, index + 1).map(
|
|
14689
|
+
(item) => ({
|
|
14690
|
+
...item,
|
|
14691
|
+
type: String(item.type) === "ai" ? "assistant" : item.type
|
|
14692
|
+
})
|
|
14693
|
+
),
|
|
14694
|
+
isStreaming: isStreamingMessage,
|
|
14695
|
+
streamingStatus,
|
|
14696
|
+
isThreadRunning: currentThreadIsRunning,
|
|
14697
|
+
organizationId: stream.organizationId,
|
|
14698
|
+
apiUrl: stream.apiUrl
|
|
14699
|
+
}
|
|
14700
|
+
) : /* @__PURE__ */ jsxs34(Fragment7, { children: [
|
|
14701
|
+
message.type === "human" && humanRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ jsx51("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanRuntimeCapabilityOptions.map((option) => /* @__PURE__ */ jsxs34(
|
|
14702
|
+
"span",
|
|
14703
|
+
{
|
|
14704
|
+
className: "inline-flex max-w-full items-center gap-1 rounded-md bg-primary-foreground/20 px-2 py-1 text-xs font-medium text-primary-foreground",
|
|
14705
|
+
children: [
|
|
14706
|
+
/* @__PURE__ */ jsx51(
|
|
14707
|
+
RuntimeCapabilityIcon,
|
|
14708
|
+
{
|
|
14709
|
+
option,
|
|
14710
|
+
variant: "chip"
|
|
14711
|
+
}
|
|
14712
|
+
),
|
|
14713
|
+
/* @__PURE__ */ jsx51("span", { className: "max-w-[9rem] truncate", children: option.label })
|
|
14714
|
+
]
|
|
14715
|
+
},
|
|
14716
|
+
`${option.type}:${option.id}`
|
|
14717
|
+
)) }),
|
|
14718
|
+
message.type === "human" && humanReferences.length > 0 && /* @__PURE__ */ jsx51("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanReferences.map((reference) => /* @__PURE__ */ jsx51(
|
|
14719
|
+
ReferenceChip,
|
|
14720
|
+
{
|
|
14721
|
+
reference,
|
|
14722
|
+
variant: "message"
|
|
14723
|
+
},
|
|
14724
|
+
getReferenceKey(reference)
|
|
14725
|
+
)) }),
|
|
14726
|
+
message.type === "human" && humanAttachments.length > 0 && /* @__PURE__ */ jsx51("div", { className: "flex flex-wrap gap-1.5 mb-2", children: humanAttachments.map((file, fileIndex) => /* @__PURE__ */ jsxs34(
|
|
14727
|
+
"div",
|
|
14728
|
+
{
|
|
14729
|
+
className: "flex items-center gap-1.5 rounded-md bg-primary-foreground/20 px-2 py-1 text-xs",
|
|
14730
|
+
children: [
|
|
14731
|
+
/* @__PURE__ */ jsx51(FileText4, { size: 12 }),
|
|
14732
|
+
/* @__PURE__ */ jsx51("span", { className: "max-w-[100px] truncate", children: file.originalName })
|
|
14733
|
+
]
|
|
14734
|
+
},
|
|
14735
|
+
fileIndex
|
|
14736
|
+
)) }),
|
|
14737
|
+
Array.isArray(message.content) ? message.content.map((part, partIndex) => /* @__PURE__ */ jsx51(
|
|
14738
|
+
"p",
|
|
14739
|
+
{
|
|
14740
|
+
className: "wrap-break-word text-sm leading-relaxed",
|
|
14741
|
+
children: formatMessageContent(part)
|
|
14742
|
+
},
|
|
14743
|
+
`${part.type}-${partIndex}`
|
|
14744
|
+
)) : /* @__PURE__ */ jsx51("span", { className: "wrap-break-word text-sm leading-relaxed", children: formatMessageContent(message.content) })
|
|
14745
|
+
] })
|
|
14746
|
+
}
|
|
14747
|
+
),
|
|
14748
|
+
/* @__PURE__ */ jsx51(
|
|
14749
|
+
MessageActions,
|
|
14750
|
+
{
|
|
14751
|
+
content: messageContent,
|
|
14752
|
+
isAssistant: isAssistantMessage,
|
|
14567
14753
|
isStreaming: isStreamingMessage,
|
|
14568
|
-
|
|
14569
|
-
isThreadRunning: currentThreadIsRunning,
|
|
14570
|
-
organizationId: stream.organizationId,
|
|
14571
|
-
apiUrl: stream.apiUrl
|
|
14754
|
+
onRetry: isAssistantMessage && !stream.isLoading && index === messages.length - 1 ? () => handleRetry(index) : void 0
|
|
14572
14755
|
}
|
|
14573
|
-
)
|
|
14574
|
-
|
|
14575
|
-
|
|
14576
|
-
|
|
14577
|
-
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",
|
|
14578
|
-
children: [
|
|
14579
|
-
/* @__PURE__ */ jsx50(
|
|
14580
|
-
RuntimeCapabilityIcon,
|
|
14581
|
-
{
|
|
14582
|
-
option,
|
|
14583
|
-
variant: "chip"
|
|
14584
|
-
}
|
|
14585
|
-
),
|
|
14586
|
-
/* @__PURE__ */ jsx50("span", { className: "max-w-[9rem] truncate", children: option.label })
|
|
14587
|
-
]
|
|
14588
|
-
},
|
|
14589
|
-
`${option.type}:${option.id}`
|
|
14590
|
-
)) }),
|
|
14591
|
-
message.type === "human" && humanReferences.length > 0 && /* @__PURE__ */ jsx50("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanReferences.map((reference) => /* @__PURE__ */ jsx50(
|
|
14592
|
-
ReferenceChip,
|
|
14593
|
-
{
|
|
14594
|
-
reference,
|
|
14595
|
-
variant: "message"
|
|
14596
|
-
},
|
|
14597
|
-
getReferenceKey(reference)
|
|
14598
|
-
)) }),
|
|
14599
|
-
message.type === "human" && humanAttachments.length > 0 && /* @__PURE__ */ jsx50("div", { className: "flex flex-wrap gap-1.5 mb-2", children: humanAttachments.map((file, fileIndex) => /* @__PURE__ */ jsxs33(
|
|
14600
|
-
"div",
|
|
14601
|
-
{
|
|
14602
|
-
className: "flex items-center gap-1.5 rounded-md bg-primary-foreground/20 px-2 py-1 text-xs",
|
|
14603
|
-
children: [
|
|
14604
|
-
/* @__PURE__ */ jsx50(FileText3, { size: 12 }),
|
|
14605
|
-
/* @__PURE__ */ jsx50("span", { className: "max-w-[100px] truncate", children: file.originalName })
|
|
14606
|
-
]
|
|
14607
|
-
},
|
|
14608
|
-
fileIndex
|
|
14609
|
-
)) }),
|
|
14610
|
-
Array.isArray(message.content) ? message.content.map((part, partIndex) => /* @__PURE__ */ jsx50(
|
|
14611
|
-
"p",
|
|
14612
|
-
{
|
|
14613
|
-
className: "wrap-break-word text-sm leading-relaxed",
|
|
14614
|
-
children: formatMessageContent(part)
|
|
14615
|
-
},
|
|
14616
|
-
`${part.type}-${partIndex}`
|
|
14617
|
-
)) : /* @__PURE__ */ jsx50("span", { className: "wrap-break-word text-sm leading-relaxed", children: formatMessageContent(message.content) })
|
|
14618
|
-
] })
|
|
14619
|
-
}
|
|
14620
|
-
),
|
|
14621
|
-
/* @__PURE__ */ jsx50(
|
|
14622
|
-
MessageActions,
|
|
14623
|
-
{
|
|
14624
|
-
content: messageContent,
|
|
14625
|
-
isAssistant: isAssistantMessage,
|
|
14626
|
-
isStreaming: isStreamingMessage,
|
|
14627
|
-
onRetry: isAssistantMessage && !stream.isLoading && index === messages.length - 1 ? () => handleRetry(index) : void 0
|
|
14628
|
-
}
|
|
14629
|
-
)
|
|
14630
|
-
] })
|
|
14756
|
+
)
|
|
14757
|
+
]
|
|
14758
|
+
}
|
|
14759
|
+
)
|
|
14631
14760
|
},
|
|
14632
14761
|
message.id ?? `${message.type}-${index}`
|
|
14633
14762
|
);
|
|
@@ -14654,7 +14783,7 @@ function Chat({
|
|
|
14654
14783
|
stream.isLoading,
|
|
14655
14784
|
{ now: streamingNow }
|
|
14656
14785
|
);
|
|
14657
|
-
return /* @__PURE__ */
|
|
14786
|
+
return /* @__PURE__ */ jsx51("div", { className: "flex justify-start gap-3 -ml-2", children: /* @__PURE__ */ jsx51("div", { className: "max-w-full rounded-2xl py-2.5", children: /* @__PURE__ */ jsx51(
|
|
14658
14787
|
AssistantStreamingIndicator,
|
|
14659
14788
|
{
|
|
14660
14789
|
status: fallbackStreamingStatus ?? "loading"
|
|
@@ -14663,7 +14792,7 @@ function Chat({
|
|
|
14663
14792
|
})()
|
|
14664
14793
|
] })
|
|
14665
14794
|
] }),
|
|
14666
|
-
!isAtBottom && messages.length > 0 && /* @__PURE__ */
|
|
14795
|
+
!isAtBottom && messages.length > 0 && /* @__PURE__ */ jsx51("div", { className: "sticky bottom-20 z-20 flex justify-center px-4 pointer-events-none", children: /* @__PURE__ */ jsx51(
|
|
14667
14796
|
Button,
|
|
14668
14797
|
{
|
|
14669
14798
|
type: "button",
|
|
@@ -14676,10 +14805,10 @@ function Chat({
|
|
|
14676
14805
|
onClick: () => scrollToBottom(true, true),
|
|
14677
14806
|
"aria-label": t("chat.scrollToBottom"),
|
|
14678
14807
|
title: t("chat.scrollToBottom"),
|
|
14679
|
-
children: /* @__PURE__ */
|
|
14808
|
+
children: /* @__PURE__ */ jsx51(ArrowDown2, { size: 16 })
|
|
14680
14809
|
}
|
|
14681
14810
|
) }),
|
|
14682
|
-
quoteSelection && /* @__PURE__ */
|
|
14811
|
+
quoteSelection && /* @__PURE__ */ jsx51(
|
|
14683
14812
|
"div",
|
|
14684
14813
|
{
|
|
14685
14814
|
className: "pointer-events-none fixed z-50",
|
|
@@ -14688,7 +14817,7 @@ function Chat({
|
|
|
14688
14817
|
left: `${quoteSelection.left}px`,
|
|
14689
14818
|
transform: "translateX(-50%)"
|
|
14690
14819
|
},
|
|
14691
|
-
children: /* @__PURE__ */
|
|
14820
|
+
children: /* @__PURE__ */ jsxs34(
|
|
14692
14821
|
Button,
|
|
14693
14822
|
{
|
|
14694
14823
|
type: "button",
|
|
@@ -14700,16 +14829,16 @@ function Chat({
|
|
|
14700
14829
|
"aria-label": t("composer.quoteSelection"),
|
|
14701
14830
|
title: t("composer.quoteSelection"),
|
|
14702
14831
|
children: [
|
|
14703
|
-
/* @__PURE__ */
|
|
14832
|
+
/* @__PURE__ */ jsx51(Quote, { size: 14 }),
|
|
14704
14833
|
t("composer.quoteSelection")
|
|
14705
14834
|
]
|
|
14706
14835
|
}
|
|
14707
14836
|
)
|
|
14708
14837
|
}
|
|
14709
14838
|
),
|
|
14710
|
-
/* @__PURE__ */
|
|
14711
|
-
threadErrorMessage && /* @__PURE__ */
|
|
14712
|
-
/* @__PURE__ */
|
|
14839
|
+
/* @__PURE__ */ jsxs34("div", { className: "p-2 sticky bottom-0 z-10 bg-background", children: [
|
|
14840
|
+
threadErrorMessage && /* @__PURE__ */ jsx51("div", { className: "mb-3 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive overflow-auto", children: threadErrorMessage }),
|
|
14841
|
+
/* @__PURE__ */ jsx51(
|
|
14713
14842
|
"input",
|
|
14714
14843
|
{
|
|
14715
14844
|
ref: fileInputRef,
|
|
@@ -14720,7 +14849,7 @@ function Chat({
|
|
|
14720
14849
|
className: "hidden"
|
|
14721
14850
|
}
|
|
14722
14851
|
),
|
|
14723
|
-
attachments.length > 0 && /* @__PURE__ */
|
|
14852
|
+
attachments.length > 0 && /* @__PURE__ */ jsx51("div", { className: "mb-3 flex flex-wrap gap-2", children: attachments.map((item) => /* @__PURE__ */ jsxs34(
|
|
14724
14853
|
"div",
|
|
14725
14854
|
{
|
|
14726
14855
|
className: cn(
|
|
@@ -14728,16 +14857,16 @@ function Chat({
|
|
|
14728
14857
|
item.status === "error" ? "bg-destructive/10 border border-destructive/30" : "bg-muted"
|
|
14729
14858
|
),
|
|
14730
14859
|
children: [
|
|
14731
|
-
item.status === "uploading" && /* @__PURE__ */
|
|
14732
|
-
|
|
14860
|
+
item.status === "uploading" && /* @__PURE__ */ jsx51(
|
|
14861
|
+
Loader27,
|
|
14733
14862
|
{
|
|
14734
14863
|
size: 14,
|
|
14735
14864
|
className: "animate-spin text-muted-foreground"
|
|
14736
14865
|
}
|
|
14737
14866
|
),
|
|
14738
|
-
item.status === "success" && /* @__PURE__ */
|
|
14739
|
-
item.status === "error" && /* @__PURE__ */
|
|
14740
|
-
/* @__PURE__ */
|
|
14867
|
+
item.status === "success" && /* @__PURE__ */ jsx51(FileText4, { size: 14, className: "text-muted-foreground" }),
|
|
14868
|
+
item.status === "error" && /* @__PURE__ */ jsx51(FileText4, { size: 14, className: "text-destructive" }),
|
|
14869
|
+
/* @__PURE__ */ jsx51(
|
|
14741
14870
|
"span",
|
|
14742
14871
|
{
|
|
14743
14872
|
className: cn(
|
|
@@ -14747,17 +14876,17 @@ function Chat({
|
|
|
14747
14876
|
children: item.file.name
|
|
14748
14877
|
}
|
|
14749
14878
|
),
|
|
14750
|
-
item.status === "error" && /* @__PURE__ */
|
|
14879
|
+
item.status === "error" && /* @__PURE__ */ jsx51(
|
|
14751
14880
|
"button",
|
|
14752
14881
|
{
|
|
14753
14882
|
type: "button",
|
|
14754
14883
|
onClick: () => handleRetryUpload(item.localId),
|
|
14755
14884
|
className: "ml-1 rounded-full p-0.5 text-destructive hover:bg-destructive/20",
|
|
14756
14885
|
title: t("chat.retryUpload"),
|
|
14757
|
-
children: /* @__PURE__ */
|
|
14886
|
+
children: /* @__PURE__ */ jsx51(RefreshCw2, { size: 12 })
|
|
14758
14887
|
}
|
|
14759
14888
|
),
|
|
14760
|
-
/* @__PURE__ */
|
|
14889
|
+
/* @__PURE__ */ jsx51(
|
|
14761
14890
|
"button",
|
|
14762
14891
|
{
|
|
14763
14892
|
type: "button",
|
|
@@ -14766,14 +14895,14 @@ function Chat({
|
|
|
14766
14895
|
"ml-1 rounded-full p-0.5",
|
|
14767
14896
|
item.status === "error" ? "text-destructive hover:bg-destructive/20" : "hover:bg-muted-foreground/20"
|
|
14768
14897
|
),
|
|
14769
|
-
children: /* @__PURE__ */
|
|
14898
|
+
children: /* @__PURE__ */ jsx51(X5, { size: 12 })
|
|
14770
14899
|
}
|
|
14771
14900
|
)
|
|
14772
14901
|
]
|
|
14773
14902
|
},
|
|
14774
14903
|
item.localId
|
|
14775
14904
|
)) }),
|
|
14776
|
-
references.length > 0 && /* @__PURE__ */
|
|
14905
|
+
references.length > 0 && /* @__PURE__ */ jsx51("div", { className: "mb-3 flex flex-wrap gap-2", children: references.map((reference) => /* @__PURE__ */ jsx51(
|
|
14777
14906
|
ReferenceChip,
|
|
14778
14907
|
{
|
|
14779
14908
|
reference,
|
|
@@ -14787,16 +14916,16 @@ function Chat({
|
|
|
14787
14916
|
},
|
|
14788
14917
|
getReferenceKey(reference)
|
|
14789
14918
|
)) }),
|
|
14790
|
-
detachedRunRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */
|
|
14791
|
-
/* @__PURE__ */
|
|
14792
|
-
detachedRunRuntimeCapabilityOptions.map((option) => /* @__PURE__ */
|
|
14919
|
+
detachedRunRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ jsxs34("div", { className: "mb-2 flex flex-wrap items-center gap-2", children: [
|
|
14920
|
+
/* @__PURE__ */ jsx51("span", { className: "text-xs text-muted-foreground", children: t("composer.capabilities.runOnly") }),
|
|
14921
|
+
detachedRunRuntimeCapabilityOptions.map((option) => /* @__PURE__ */ jsxs34(
|
|
14793
14922
|
"span",
|
|
14794
14923
|
{
|
|
14795
14924
|
className: "inline-flex max-w-full items-center gap-1 rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",
|
|
14796
14925
|
children: [
|
|
14797
|
-
/* @__PURE__ */
|
|
14798
|
-
/* @__PURE__ */
|
|
14799
|
-
/* @__PURE__ */
|
|
14926
|
+
/* @__PURE__ */ jsx51(RuntimeCapabilityIcon, { option, variant: "chip" }),
|
|
14927
|
+
/* @__PURE__ */ jsx51("span", { className: "max-w-40 truncate", children: option.label }),
|
|
14928
|
+
/* @__PURE__ */ jsx51(
|
|
14800
14929
|
"button",
|
|
14801
14930
|
{
|
|
14802
14931
|
type: "button",
|
|
@@ -14804,7 +14933,7 @@ function Chat({
|
|
|
14804
14933
|
className: "rounded-full p-0.5 hover:bg-primary/15",
|
|
14805
14934
|
title: t("composer.capabilities.removeRunCapability"),
|
|
14806
14935
|
"aria-label": t("composer.capabilities.removeRunCapability"),
|
|
14807
|
-
children: /* @__PURE__ */
|
|
14936
|
+
children: /* @__PURE__ */ jsx51(X5, { size: 11 })
|
|
14808
14937
|
}
|
|
14809
14938
|
)
|
|
14810
14939
|
]
|
|
@@ -14812,7 +14941,7 @@ function Chat({
|
|
|
14812
14941
|
`${option.type}:${option.id}`
|
|
14813
14942
|
))
|
|
14814
14943
|
] }),
|
|
14815
|
-
/* @__PURE__ */
|
|
14944
|
+
/* @__PURE__ */ jsx51(
|
|
14816
14945
|
PendingRuntimeServices,
|
|
14817
14946
|
{
|
|
14818
14947
|
state: stream.runtimeActivities.sandboxServices,
|
|
@@ -14821,7 +14950,7 @@ function Chat({
|
|
|
14821
14950
|
className: hasPendingTodos || hasPendingFollowUps ? "mb-2" : void 0
|
|
14822
14951
|
}
|
|
14823
14952
|
),
|
|
14824
|
-
/* @__PURE__ */
|
|
14953
|
+
/* @__PURE__ */ jsx51(
|
|
14825
14954
|
PendingTodos,
|
|
14826
14955
|
{
|
|
14827
14956
|
snapshot: stream.todos,
|
|
@@ -14829,7 +14958,7 @@ function Chat({
|
|
|
14829
14958
|
className: hasPendingFollowUps ? "mb-2" : void 0
|
|
14830
14959
|
}
|
|
14831
14960
|
),
|
|
14832
|
-
/* @__PURE__ */
|
|
14961
|
+
/* @__PURE__ */ jsx51(
|
|
14833
14962
|
PendingFollowUps,
|
|
14834
14963
|
{
|
|
14835
14964
|
items: pendingFollowUps,
|
|
@@ -14844,7 +14973,7 @@ function Chat({
|
|
|
14844
14973
|
attachToComposer: true
|
|
14845
14974
|
}
|
|
14846
14975
|
),
|
|
14847
|
-
/* @__PURE__ */
|
|
14976
|
+
/* @__PURE__ */ jsx51(
|
|
14848
14977
|
RequestUserInputPanel,
|
|
14849
14978
|
{
|
|
14850
14979
|
request: stream.pendingRequestUserInput,
|
|
@@ -14853,7 +14982,7 @@ function Chat({
|
|
|
14853
14982
|
attachToComposer: true
|
|
14854
14983
|
}
|
|
14855
14984
|
),
|
|
14856
|
-
/* @__PURE__ */
|
|
14985
|
+
/* @__PURE__ */ jsx51(
|
|
14857
14986
|
HITLApprovalPanel,
|
|
14858
14987
|
{
|
|
14859
14988
|
request: stream.pendingHITLRequest,
|
|
@@ -14862,7 +14991,7 @@ function Chat({
|
|
|
14862
14991
|
attachToComposer: true
|
|
14863
14992
|
}
|
|
14864
14993
|
),
|
|
14865
|
-
runtimeCapabilityPalette && /* @__PURE__ */
|
|
14994
|
+
runtimeCapabilityPalette && /* @__PURE__ */ jsx51(
|
|
14866
14995
|
SlashPalette,
|
|
14867
14996
|
{
|
|
14868
14997
|
palette: runtimeCapabilityPalette,
|
|
@@ -14876,7 +15005,7 @@ function Chat({
|
|
|
14876
15005
|
onSelect: selectSlashPaletteOption
|
|
14877
15006
|
}
|
|
14878
15007
|
),
|
|
14879
|
-
/* @__PURE__ */
|
|
15008
|
+
/* @__PURE__ */ jsx51("form", { className: "flex items-end", onSubmit: handleSubmit, children: /* @__PURE__ */ jsxs34(
|
|
14880
15009
|
"div",
|
|
14881
15010
|
{
|
|
14882
15011
|
"data-slot": "composer-input-shell",
|
|
@@ -14890,7 +15019,7 @@ function Chat({
|
|
|
14890
15019
|
composerInputRoundedClass
|
|
14891
15020
|
),
|
|
14892
15021
|
children: [
|
|
14893
|
-
/* @__PURE__ */
|
|
15022
|
+
/* @__PURE__ */ jsx51(
|
|
14894
15023
|
"div",
|
|
14895
15024
|
{
|
|
14896
15025
|
ref: composerInputRef,
|
|
@@ -14912,7 +15041,7 @@ function Chat({
|
|
|
14912
15041
|
(missingConfig || isHistoryLoading || hasPendingInteractiveRequest) && "cursor-not-allowed opacity-50"
|
|
14913
15042
|
),
|
|
14914
15043
|
children: renderedComposerParts.map(
|
|
14915
|
-
(part, index) => part.type === "text" ? /* @__PURE__ */
|
|
15044
|
+
(part, index) => part.type === "text" ? /* @__PURE__ */ jsx51(React46.Fragment, { children: part.text }, `text-${index}`) : /* @__PURE__ */ jsxs34(
|
|
14916
15045
|
"span",
|
|
14917
15046
|
{
|
|
14918
15047
|
"data-composer-capability-key": part.key,
|
|
@@ -14921,14 +15050,14 @@ function Chat({
|
|
|
14921
15050
|
contentEditable: false,
|
|
14922
15051
|
className: "mx-0.5 inline-flex max-w-[14rem] select-none items-center gap-1 text-sm font-semibold text-primary align-baseline",
|
|
14923
15052
|
children: [
|
|
14924
|
-
/* @__PURE__ */
|
|
15053
|
+
/* @__PURE__ */ jsx51(
|
|
14925
15054
|
RuntimeCapabilityIcon,
|
|
14926
15055
|
{
|
|
14927
15056
|
option: part.capability,
|
|
14928
15057
|
variant: "chip"
|
|
14929
15058
|
}
|
|
14930
15059
|
),
|
|
14931
|
-
/* @__PURE__ */
|
|
15060
|
+
/* @__PURE__ */ jsx51("span", { className: "truncate", children: part.capability.label })
|
|
14932
15061
|
]
|
|
14933
15062
|
},
|
|
14934
15063
|
part.key
|
|
@@ -14937,14 +15066,14 @@ function Chat({
|
|
|
14937
15066
|
},
|
|
14938
15067
|
composerDomVersion
|
|
14939
15068
|
),
|
|
14940
|
-
/* @__PURE__ */
|
|
15069
|
+
/* @__PURE__ */ jsxs34(
|
|
14941
15070
|
"div",
|
|
14942
15071
|
{
|
|
14943
15072
|
"data-slot": "composer-action-bar",
|
|
14944
15073
|
className: "pointer-events-none absolute inset-x-1.5 bottom-1 flex min-h-10 items-center justify-between gap-2",
|
|
14945
15074
|
children: [
|
|
14946
|
-
/* @__PURE__ */
|
|
14947
|
-
/* @__PURE__ */
|
|
15075
|
+
/* @__PURE__ */ jsxs34("div", { className: "pointer-events-none flex min-w-0 flex-1 items-center gap-1.5", children: [
|
|
15076
|
+
/* @__PURE__ */ jsx51("div", { className: "pointer-events-auto flex shrink-0 items-center gap-1.5", children: /* @__PURE__ */ jsx51(
|
|
14948
15077
|
ComposerMenu,
|
|
14949
15078
|
{
|
|
14950
15079
|
composer,
|
|
@@ -14959,20 +15088,20 @@ function Chat({
|
|
|
14959
15088
|
disabled: missingConfig || isHistoryLoading || hasPendingInteractiveRequest
|
|
14960
15089
|
}
|
|
14961
15090
|
) }),
|
|
14962
|
-
selectedTool && /* @__PURE__ */
|
|
14963
|
-
/* @__PURE__ */
|
|
14964
|
-
/* @__PURE__ */
|
|
15091
|
+
selectedTool && /* @__PURE__ */ jsxs34("span", { className: "pointer-events-auto inline-flex h-8 min-w-0 max-w-[14rem] shrink items-center gap-1.5 rounded-full bg-primary/10 px-2 text-xs font-medium text-primary transition-all duration-200", children: [
|
|
15092
|
+
/* @__PURE__ */ jsx51("span", { className: "truncate", children: selectedTool.shortLabel ?? selectedTool.label }),
|
|
15093
|
+
/* @__PURE__ */ jsx51(
|
|
14965
15094
|
"button",
|
|
14966
15095
|
{
|
|
14967
15096
|
type: "button",
|
|
14968
15097
|
onClick: () => setSelectedTool(null),
|
|
14969
15098
|
className: "shrink-0 rounded-full p-0.5 text-primary/70 hover:bg-primary/10 hover:text-primary",
|
|
14970
|
-
children: /* @__PURE__ */
|
|
15099
|
+
children: /* @__PURE__ */ jsx51(X5, { size: 12 })
|
|
14971
15100
|
}
|
|
14972
15101
|
)
|
|
14973
15102
|
] })
|
|
14974
15103
|
] }),
|
|
14975
|
-
/* @__PURE__ */
|
|
15104
|
+
/* @__PURE__ */ jsx51("div", { className: "pointer-events-auto shrink-0", children: /* @__PURE__ */ jsx51(
|
|
14976
15105
|
SendButton,
|
|
14977
15106
|
{
|
|
14978
15107
|
disabled: isSendDisabled,
|
|
@@ -14999,7 +15128,7 @@ function Chat({
|
|
|
14999
15128
|
]
|
|
15000
15129
|
}
|
|
15001
15130
|
) }),
|
|
15002
|
-
disclaimer?.text && /* @__PURE__ */
|
|
15131
|
+
disclaimer?.text && /* @__PURE__ */ jsx51(
|
|
15003
15132
|
"p",
|
|
15004
15133
|
{
|
|
15005
15134
|
className: cn(
|
|
@@ -15009,12 +15138,12 @@ function Chat({
|
|
|
15009
15138
|
children: disclaimer.text
|
|
15010
15139
|
}
|
|
15011
15140
|
),
|
|
15012
|
-
/* @__PURE__ */
|
|
15013
|
-
/* @__PURE__ */
|
|
15014
|
-
/* @__PURE__ */
|
|
15141
|
+
/* @__PURE__ */ jsxs34("div", { className: "mt-2 flex items-center justify-center gap-2 text-xs text-muted-foreground", children: [
|
|
15142
|
+
/* @__PURE__ */ jsx51("span", { children: t("chat.poweredBy") }),
|
|
15143
|
+
/* @__PURE__ */ jsx51(ContextUsageIndicator, { className: "absolute right-4" })
|
|
15015
15144
|
] })
|
|
15016
15145
|
] }),
|
|
15017
|
-
/* @__PURE__ */
|
|
15146
|
+
/* @__PURE__ */ jsx51(
|
|
15018
15147
|
SettingsSheet,
|
|
15019
15148
|
{
|
|
15020
15149
|
open: petSettingsOpen,
|
|
@@ -15024,17 +15153,17 @@ function Chat({
|
|
|
15024
15153
|
onSave: savePetLocalSettings
|
|
15025
15154
|
}
|
|
15026
15155
|
),
|
|
15027
|
-
/* @__PURE__ */
|
|
15156
|
+
/* @__PURE__ */ jsx51(PetBridge, { pet: effectivePet, state: petAutoState })
|
|
15028
15157
|
]
|
|
15029
15158
|
}
|
|
15030
15159
|
);
|
|
15031
15160
|
}
|
|
15032
15161
|
|
|
15033
15162
|
// src/components/ui/separator.tsx
|
|
15034
|
-
import * as
|
|
15035
|
-
import { jsx as
|
|
15036
|
-
var Separator =
|
|
15037
|
-
({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */
|
|
15163
|
+
import * as React47 from "react";
|
|
15164
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
15165
|
+
var Separator = React47.forwardRef(
|
|
15166
|
+
({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */ jsx52(
|
|
15038
15167
|
"div",
|
|
15039
15168
|
{
|
|
15040
15169
|
ref,
|