@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.cjs
CHANGED
|
@@ -67,8 +67,8 @@ __export(index_exports, {
|
|
|
67
67
|
module.exports = __toCommonJS(index_exports);
|
|
68
68
|
|
|
69
69
|
// src/components/chat.tsx
|
|
70
|
-
var
|
|
71
|
-
var
|
|
70
|
+
var React46 = __toESM(require("react"), 1);
|
|
71
|
+
var import_lucide_react26 = require("lucide-react");
|
|
72
72
|
|
|
73
73
|
// src/lib/utils.ts
|
|
74
74
|
var import_clsx = require("clsx");
|
|
@@ -1514,6 +1514,12 @@ var en_US_default = {
|
|
|
1514
1514
|
loading: "Loading",
|
|
1515
1515
|
thinking: "Thinking",
|
|
1516
1516
|
answering: "Answering",
|
|
1517
|
+
contextCompression: {
|
|
1518
|
+
running: "Automatically compressing context",
|
|
1519
|
+
success: "Context automatically compressed",
|
|
1520
|
+
skipped: "Context not compressed",
|
|
1521
|
+
fail: "Context compression failed"
|
|
1522
|
+
},
|
|
1517
1523
|
requestUserInputResult: {
|
|
1518
1524
|
title: "Selections confirmed",
|
|
1519
1525
|
option: "Option",
|
|
@@ -1855,6 +1861,12 @@ var zh_CN_default = {
|
|
|
1855
1861
|
loading: "\u6B63\u5728\u52A0\u8F7D",
|
|
1856
1862
|
thinking: "\u6B63\u5728\u601D\u8003",
|
|
1857
1863
|
answering: "\u6B63\u5728\u751F\u6210",
|
|
1864
|
+
contextCompression: {
|
|
1865
|
+
running: "\u6B63\u5728\u81EA\u52A8\u538B\u7F29\u4E0A\u4E0B\u6587",
|
|
1866
|
+
success: "\u4E0A\u4E0B\u6587\u5DF2\u81EA\u52A8\u538B\u7F29",
|
|
1867
|
+
skipped: "\u4E0A\u4E0B\u6587\u65E0\u9700\u538B\u7F29",
|
|
1868
|
+
fail: "\u4E0A\u4E0B\u6587\u538B\u7F29\u5931\u8D25"
|
|
1869
|
+
},
|
|
1858
1870
|
requestUserInputResult: {
|
|
1859
1871
|
title: "\u5DF2\u786E\u8BA4\u9009\u62E9",
|
|
1860
1872
|
option: "\u9009\u9879",
|
|
@@ -6801,8 +6813,8 @@ function useSlashCommands({
|
|
|
6801
6813
|
}
|
|
6802
6814
|
|
|
6803
6815
|
// src/components/thread/messages/ai.tsx
|
|
6804
|
-
var
|
|
6805
|
-
var
|
|
6816
|
+
var React33 = __toESM(require("react"), 1);
|
|
6817
|
+
var import_lucide_react21 = require("lucide-react");
|
|
6806
6818
|
|
|
6807
6819
|
// src/lib/agent-run-render-tree.ts
|
|
6808
6820
|
function isTextContent(content) {
|
|
@@ -8548,57 +8560,114 @@ function AgentRunGroup({
|
|
|
8548
8560
|
] });
|
|
8549
8561
|
}
|
|
8550
8562
|
|
|
8551
|
-
// src/
|
|
8552
|
-
|
|
8553
|
-
|
|
8554
|
-
|
|
8555
|
-
|
|
8556
|
-
|
|
8557
|
-
|
|
8558
|
-
|
|
8559
|
-
|
|
8560
|
-
|
|
8561
|
-
|
|
8562
|
-
|
|
8563
|
-
|
|
8564
|
-
|
|
8565
|
-
|
|
8566
|
-
|
|
8567
|
-
|
|
8568
|
-
|
|
8569
|
-
|
|
8570
|
-
"
|
|
8571
|
-
|
|
8572
|
-
|
|
8573
|
-
|
|
8574
|
-
|
|
8575
|
-
|
|
8576
|
-
|
|
8577
|
-
|
|
8578
|
-
|
|
8579
|
-
languagePrefix,
|
|
8580
|
-
"zh_Hans",
|
|
8581
|
-
"zh-Hans",
|
|
8582
|
-
"zh_CN",
|
|
8583
|
-
"zh-CN",
|
|
8584
|
-
"zh"
|
|
8585
|
-
];
|
|
8586
|
-
for (const key of preferredKeys) {
|
|
8587
|
-
const candidate = localized[key];
|
|
8588
|
-
if (typeof candidate === "string" && candidate.trim()) {
|
|
8589
|
-
return candidate.trim();
|
|
8590
|
-
}
|
|
8563
|
+
// src/components/thread/messages/context-compression-message.tsx
|
|
8564
|
+
var React29 = require("react");
|
|
8565
|
+
var import_chatkit_types6 = require("@xpert-ai/chatkit-types");
|
|
8566
|
+
var import_lucide_react17 = require("lucide-react");
|
|
8567
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
8568
|
+
var CONTEXT_COMPRESSION_COMPONENT_TYPE = "context-compression";
|
|
8569
|
+
function isContextCompressionComponent(content) {
|
|
8570
|
+
return content.data.category === "Tool" && content.data.type === CONTEXT_COMPRESSION_COMPONENT_TYPE;
|
|
8571
|
+
}
|
|
8572
|
+
function isSkipped(reason) {
|
|
8573
|
+
return reason === "no_messages" || reason === "no_unprotected_history" || reason === "no_token_gain";
|
|
8574
|
+
}
|
|
8575
|
+
function ContextCompressionLabel({
|
|
8576
|
+
data
|
|
8577
|
+
}) {
|
|
8578
|
+
const { t } = useChatkitTranslation();
|
|
8579
|
+
const status = data.status ?? "running";
|
|
8580
|
+
const skipped = isSkipped(data.reason);
|
|
8581
|
+
if (skipped) {
|
|
8582
|
+
return t("message.contextCompression.skipped");
|
|
8583
|
+
}
|
|
8584
|
+
switch (status) {
|
|
8585
|
+
case "success":
|
|
8586
|
+
return t("message.contextCompression.success");
|
|
8587
|
+
case "fail":
|
|
8588
|
+
return t("message.contextCompression.fail");
|
|
8589
|
+
default:
|
|
8590
|
+
return t("message.contextCompression.running");
|
|
8591
8591
|
}
|
|
8592
|
-
|
|
8593
|
-
|
|
8594
|
-
|
|
8595
|
-
|
|
8592
|
+
}
|
|
8593
|
+
function ContextCompressionIcon({
|
|
8594
|
+
data
|
|
8595
|
+
}) {
|
|
8596
|
+
const status = data.status ?? "running";
|
|
8597
|
+
const skipped = isSkipped(data.reason);
|
|
8598
|
+
if (status === "running") {
|
|
8599
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react17.Loader2, { "aria-hidden": "true", className: "h-4 w-4 shrink-0 animate-spin" });
|
|
8596
8600
|
}
|
|
8597
|
-
|
|
8601
|
+
if (status === "fail") {
|
|
8602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react17.XCircle, { "aria-hidden": "true", className: "h-4 w-4 shrink-0" });
|
|
8603
|
+
}
|
|
8604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
8605
|
+
import_lucide_react17.FileText,
|
|
8606
|
+
{
|
|
8607
|
+
"aria-hidden": "true",
|
|
8608
|
+
className: cn("h-4 w-4 shrink-0", skipped && "opacity-80")
|
|
8609
|
+
}
|
|
8610
|
+
);
|
|
8611
|
+
}
|
|
8612
|
+
function getTooltipText(data, language) {
|
|
8613
|
+
return (0, import_chatkit_types6.resolveLocalizedText)(
|
|
8614
|
+
data.summary || data.error || data.message,
|
|
8615
|
+
language
|
|
8616
|
+
);
|
|
8617
|
+
}
|
|
8618
|
+
function ContextCompressionMessage({
|
|
8619
|
+
content
|
|
8620
|
+
}) {
|
|
8621
|
+
const { i18n: i18n2 } = useChatkitTranslation();
|
|
8622
|
+
const data = content.data;
|
|
8623
|
+
const status = data.status ?? "running";
|
|
8624
|
+
const tooltipText = getTooltipText(data, i18n2.language);
|
|
8625
|
+
const label = /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ContextCompressionLabel, { data });
|
|
8626
|
+
const center = /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
8627
|
+
"div",
|
|
8628
|
+
{
|
|
8629
|
+
className: cn(
|
|
8630
|
+
"inline-flex max-w-[80%] shrink-0 items-center gap-1.5 rounded-md px-2 py-1 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",
|
|
8631
|
+
tooltipText && "cursor-help",
|
|
8632
|
+
status === "fail" && "text-destructive hover:text-destructive"
|
|
8633
|
+
),
|
|
8634
|
+
children: [
|
|
8635
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ContextCompressionIcon, { data }),
|
|
8636
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
8637
|
+
"span",
|
|
8638
|
+
{
|
|
8639
|
+
className: cn(
|
|
8640
|
+
"truncate",
|
|
8641
|
+
status === "running" && "ck-tool-call-running-text"
|
|
8642
|
+
),
|
|
8643
|
+
children: label
|
|
8644
|
+
}
|
|
8645
|
+
)
|
|
8646
|
+
]
|
|
8647
|
+
}
|
|
8648
|
+
);
|
|
8649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex w-full items-center justify-center gap-3 py-6", children: [
|
|
8650
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "h-px min-w-8 flex-1 bg-border" }),
|
|
8651
|
+
tooltipText ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Tooltip, { children: [
|
|
8652
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TooltipTrigger, { asChild: true, children: center }),
|
|
8653
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
8654
|
+
TooltipContent,
|
|
8655
|
+
{
|
|
8656
|
+
side: "top",
|
|
8657
|
+
className: "max-h-80 max-w-xl overflow-auto whitespace-pre-wrap text-left text-xs leading-5",
|
|
8658
|
+
children: tooltipText
|
|
8659
|
+
}
|
|
8660
|
+
)
|
|
8661
|
+
] }) : center,
|
|
8662
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "h-px min-w-8 flex-1 bg-border" })
|
|
8663
|
+
] });
|
|
8598
8664
|
}
|
|
8599
8665
|
|
|
8666
|
+
// src/i18n/localized-text.ts
|
|
8667
|
+
var import_chatkit_types7 = require("@xpert-ai/chatkit-types");
|
|
8668
|
+
|
|
8600
8669
|
// src/components/thread/messages/knowledge-retriever-component-renderer.tsx
|
|
8601
|
-
var
|
|
8670
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
8602
8671
|
var KNOWLEDGE_RETRIEVER_TITLE = "Knowledge Retriever";
|
|
8603
8672
|
var KNOWLEDGE_METADATA_SKIP_KEYS = /* @__PURE__ */ new Set([
|
|
8604
8673
|
"assets",
|
|
@@ -8709,7 +8778,7 @@ function getRetrieverQuery(data, language) {
|
|
|
8709
8778
|
if (isRecord2(input)) {
|
|
8710
8779
|
return readString(input.query) ?? readString(input.input) ?? readString(input.question);
|
|
8711
8780
|
}
|
|
8712
|
-
return readString(resolveLocalizedText(data.message, language)) ?? readString(input);
|
|
8781
|
+
return readString((0, import_chatkit_types7.resolveLocalizedText)(data.message, language)) ?? readString(input);
|
|
8713
8782
|
}
|
|
8714
8783
|
function hasKnowledgeRetrieverDetails(_content, data) {
|
|
8715
8784
|
return isKnowledgeRetrieverComponent(_content, data);
|
|
@@ -8721,23 +8790,23 @@ function KnowledgeRawDataBlock({ value }) {
|
|
|
8721
8790
|
const { t } = useChatkitTranslation();
|
|
8722
8791
|
const detected = detectJsonValue(value);
|
|
8723
8792
|
if (detected.kind === "text") {
|
|
8724
|
-
return /* @__PURE__ */ (0,
|
|
8793
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(PlainTextBlock, { value: detected.text });
|
|
8725
8794
|
}
|
|
8726
|
-
return /* @__PURE__ */ (0,
|
|
8727
|
-
/* @__PURE__ */ (0,
|
|
8728
|
-
/* @__PURE__ */ (0,
|
|
8795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Tabs, { defaultValue: "tree", className: "min-w-0", children: [
|
|
8796
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "mb-2 flex min-w-0 items-center justify-between gap-2", children: [
|
|
8797
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "min-w-0 truncate text-[11px] text-muted-foreground", children: [
|
|
8729
8798
|
t("message.toolGroup.jsonTitle"),
|
|
8730
8799
|
" \xB7",
|
|
8731
8800
|
" ",
|
|
8732
8801
|
getJsonValueSummary(detected.value)
|
|
8733
8802
|
] }),
|
|
8734
|
-
/* @__PURE__ */ (0,
|
|
8735
|
-
/* @__PURE__ */ (0,
|
|
8736
|
-
/* @__PURE__ */ (0,
|
|
8803
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(TabsList, { className: "rounded-md p-0.5", children: [
|
|
8804
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "tree", children: t("message.toolGroup.jsonTree") }),
|
|
8805
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "raw", children: t("message.toolGroup.jsonRaw") })
|
|
8737
8806
|
] })
|
|
8738
8807
|
] }),
|
|
8739
|
-
/* @__PURE__ */ (0,
|
|
8740
|
-
/* @__PURE__ */ (0,
|
|
8808
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TabsContent, { value: "tree", className: "mt-0", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(JsonTreeView, { value: detected.value }) }),
|
|
8809
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TabsContent, { value: "raw", className: "mt-0", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(RawJsonBlock, { raw: detected.raw }) })
|
|
8741
8810
|
] });
|
|
8742
8811
|
}
|
|
8743
8812
|
function KnowledgeRetrieverDetails({
|
|
@@ -8750,16 +8819,16 @@ function KnowledgeRetrieverDetails({
|
|
|
8750
8819
|
const hasArrayData = Array.isArray(data.data);
|
|
8751
8820
|
const hasRawFallback = rawData !== null && rawData !== void 0 && (!hasArrayData || Array.isArray(data.data) && data.data.length > 0 && results.length === 0);
|
|
8752
8821
|
const showEmptyState = results.length === 0 && !hasRawFallback && data.status !== "running";
|
|
8753
|
-
return /* @__PURE__ */ (0,
|
|
8754
|
-
query ? /* @__PURE__ */ (0,
|
|
8755
|
-
/* @__PURE__ */ (0,
|
|
8756
|
-
/* @__PURE__ */ (0,
|
|
8822
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "min-w-0 space-y-3 px-3 py-2", children: [
|
|
8823
|
+
query ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "min-w-0 space-y-1", children: [
|
|
8824
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.knowledgeRetriever.queryTitle") }),
|
|
8825
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "min-w-0 whitespace-pre-wrap wrap-break-word rounded-md bg-muted/40 px-3 py-2 font-mono text-[12px] leading-5 text-foreground/80", children: query })
|
|
8757
8826
|
] }) : null,
|
|
8758
|
-
results.length > 0 ? /* @__PURE__ */ (0,
|
|
8759
|
-
/* @__PURE__ */ (0,
|
|
8827
|
+
results.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "min-w-0 space-y-2", children: [
|
|
8828
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.knowledgeRetriever.resultsTitle", {
|
|
8760
8829
|
count: results.length
|
|
8761
8830
|
}) }),
|
|
8762
|
-
/* @__PURE__ */ (0,
|
|
8831
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "space-y-2", children: results.map((result, index) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
8763
8832
|
KnowledgeResultCard,
|
|
8764
8833
|
{
|
|
8765
8834
|
result,
|
|
@@ -8768,11 +8837,11 @@ function KnowledgeRetrieverDetails({
|
|
|
8768
8837
|
result.id ?? `${result.title}-${index}`
|
|
8769
8838
|
)) })
|
|
8770
8839
|
] }) : null,
|
|
8771
|
-
hasRawFallback ? /* @__PURE__ */ (0,
|
|
8772
|
-
/* @__PURE__ */ (0,
|
|
8773
|
-
/* @__PURE__ */ (0,
|
|
8840
|
+
hasRawFallback ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "min-w-0 space-y-1", children: [
|
|
8841
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.knowledgeRetriever.rawDataTitle") }),
|
|
8842
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(KnowledgeRawDataBlock, { value: rawData })
|
|
8774
8843
|
] }) : null,
|
|
8775
|
-
showEmptyState ? /* @__PURE__ */ (0,
|
|
8844
|
+
showEmptyState ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "rounded-md border border-dashed border-border/70 px-3 py-4 text-center text-xs text-muted-foreground", children: t("message.knowledgeRetriever.noResults") }) : null
|
|
8776
8845
|
] });
|
|
8777
8846
|
}
|
|
8778
8847
|
function KnowledgeResultCard({
|
|
@@ -8791,10 +8860,10 @@ function KnowledgeResultCard({
|
|
|
8791
8860
|
...result.metadata
|
|
8792
8861
|
];
|
|
8793
8862
|
const titleClassName = "min-w-0 line-clamp-2 text-sm font-medium leading-5 text-foreground";
|
|
8794
|
-
return /* @__PURE__ */ (0,
|
|
8795
|
-
/* @__PURE__ */ (0,
|
|
8796
|
-
/* @__PURE__ */ (0,
|
|
8797
|
-
result.url ? /* @__PURE__ */ (0,
|
|
8863
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("article", { className: "min-w-0 rounded-md border border-border/60 bg-background/80 px-3 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex min-w-0 items-start gap-2", children: [
|
|
8864
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "mt-0.5 inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-muted text-[11px] font-medium text-muted-foreground", children: index + 1 }),
|
|
8865
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
8866
|
+
result.url ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
8798
8867
|
"a",
|
|
8799
8868
|
{
|
|
8800
8869
|
id: titleId,
|
|
@@ -8804,37 +8873,37 @@ function KnowledgeResultCard({
|
|
|
8804
8873
|
className: cn(titleClassName, "hover:underline"),
|
|
8805
8874
|
children: [
|
|
8806
8875
|
result.title,
|
|
8807
|
-
result.lineRange ? /* @__PURE__ */ (0,
|
|
8876
|
+
result.lineRange ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "ml-1 text-muted-foreground", children: [
|
|
8808
8877
|
"[",
|
|
8809
8878
|
result.lineRange,
|
|
8810
8879
|
"]"
|
|
8811
8880
|
] }) : null
|
|
8812
8881
|
]
|
|
8813
8882
|
}
|
|
8814
|
-
) : /* @__PURE__ */ (0,
|
|
8883
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { id: titleId, className: titleClassName, children: [
|
|
8815
8884
|
result.title,
|
|
8816
|
-
result.lineRange ? /* @__PURE__ */ (0,
|
|
8885
|
+
result.lineRange ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "ml-1 text-muted-foreground", children: [
|
|
8817
8886
|
"[",
|
|
8818
8887
|
result.lineRange,
|
|
8819
8888
|
"]"
|
|
8820
8889
|
] }) : null
|
|
8821
8890
|
] }),
|
|
8822
|
-
result.content ? /* @__PURE__ */ (0,
|
|
8823
|
-
metadata.length > 0 ? /* @__PURE__ */ (0,
|
|
8891
|
+
result.content ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "mt-1 line-clamp-3 whitespace-pre-wrap text-xs leading-5 text-muted-foreground", children: result.content }) : null,
|
|
8892
|
+
metadata.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
8824
8893
|
"div",
|
|
8825
8894
|
{
|
|
8826
8895
|
className: "mt-2 flex flex-wrap gap-1.5",
|
|
8827
8896
|
"aria-labelledby": titleId,
|
|
8828
|
-
children: metadata.slice(0, 10).map((item) => /* @__PURE__ */ (0,
|
|
8897
|
+
children: metadata.slice(0, 10).map((item) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
8829
8898
|
"span",
|
|
8830
8899
|
{
|
|
8831
8900
|
className: "inline-flex min-w-0 max-w-full items-center gap-1 rounded-md bg-muted/50 px-1.5 py-0.5 text-[11px] leading-4 text-muted-foreground",
|
|
8832
8901
|
children: [
|
|
8833
|
-
/* @__PURE__ */ (0,
|
|
8902
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "shrink-0 font-medium text-foreground/70", children: [
|
|
8834
8903
|
item.key,
|
|
8835
8904
|
":"
|
|
8836
8905
|
] }),
|
|
8837
|
-
/* @__PURE__ */ (0,
|
|
8906
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "min-w-0 truncate font-mono", children: item.value })
|
|
8838
8907
|
]
|
|
8839
8908
|
},
|
|
8840
8909
|
`${item.key}:${item.value}`
|
|
@@ -8846,7 +8915,7 @@ function KnowledgeResultCard({
|
|
|
8846
8915
|
}
|
|
8847
8916
|
|
|
8848
8917
|
// src/components/thread/messages/web-search-component-renderer.tsx
|
|
8849
|
-
var
|
|
8918
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
8850
8919
|
var webSearchComponentRenderer = {
|
|
8851
8920
|
id: "computer-web-search-sources",
|
|
8852
8921
|
presentation: "grouped-step",
|
|
@@ -8916,9 +8985,9 @@ function WebSearchToolCallOutput({
|
|
|
8916
8985
|
const { t } = useChatkitTranslation();
|
|
8917
8986
|
const sources = getWebSearchSources(data);
|
|
8918
8987
|
if (sources.length === 0 || data.error !== void 0) return null;
|
|
8919
|
-
return /* @__PURE__ */ (0,
|
|
8920
|
-
/* @__PURE__ */ (0,
|
|
8921
|
-
/* @__PURE__ */ (0,
|
|
8988
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "space-y-2", children: [
|
|
8989
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.toolGroup.sourcesTitle") }),
|
|
8990
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "space-y-2", children: sources.map((source, index) => {
|
|
8922
8991
|
const sourceHost = getSourceHost(source.url);
|
|
8923
8992
|
const snippet = source.content ?? source.description;
|
|
8924
8993
|
const metaParts = [
|
|
@@ -8926,13 +8995,13 @@ function WebSearchToolCallOutput({
|
|
|
8926
8995
|
source.publishedDate,
|
|
8927
8996
|
source.author
|
|
8928
8997
|
].filter((item) => Boolean(item));
|
|
8929
|
-
return /* @__PURE__ */ (0,
|
|
8998
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
8930
8999
|
"div",
|
|
8931
9000
|
{
|
|
8932
9001
|
className: "min-w-0 rounded-md border border-border/60 bg-background/80 px-3 py-2",
|
|
8933
9002
|
children: [
|
|
8934
|
-
metaParts.length > 0 ? /* @__PURE__ */ (0,
|
|
8935
|
-
/* @__PURE__ */ (0,
|
|
9003
|
+
metaParts.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "mb-1 truncate text-[11px] text-muted-foreground", children: metaParts.join(" / ") }) : null,
|
|
9004
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
8936
9005
|
"a",
|
|
8937
9006
|
{
|
|
8938
9007
|
href: source.url,
|
|
@@ -8942,7 +9011,7 @@ function WebSearchToolCallOutput({
|
|
|
8942
9011
|
children: source.title
|
|
8943
9012
|
}
|
|
8944
9013
|
),
|
|
8945
|
-
snippet ? /* @__PURE__ */ (0,
|
|
9014
|
+
snippet ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "mt-1 line-clamp-3 text-xs leading-5 text-muted-foreground", children: snippet }) : null
|
|
8946
9015
|
]
|
|
8947
9016
|
},
|
|
8948
9017
|
`${source.url}-${index}`
|
|
@@ -8953,6 +9022,12 @@ function WebSearchToolCallOutput({
|
|
|
8953
9022
|
|
|
8954
9023
|
// src/components/thread/messages/component-message-renderers.tsx
|
|
8955
9024
|
var COMPONENT_MESSAGE_RENDERERS = [
|
|
9025
|
+
{
|
|
9026
|
+
id: "context-compression",
|
|
9027
|
+
presentation: "standalone",
|
|
9028
|
+
match: (content) => isContextCompressionComponent(content),
|
|
9029
|
+
hasDetails: () => false
|
|
9030
|
+
},
|
|
8956
9031
|
knowledgeRetrieverComponentRenderer,
|
|
8957
9032
|
webSearchComponentRenderer
|
|
8958
9033
|
];
|
|
@@ -8970,13 +9045,13 @@ function hasComponentMessageRendererDetails(renderer, content, data) {
|
|
|
8970
9045
|
}
|
|
8971
9046
|
|
|
8972
9047
|
// src/components/thread/messages/tool-component-group.tsx
|
|
8973
|
-
var
|
|
8974
|
-
var
|
|
9048
|
+
var React31 = __toESM(require("react"), 1);
|
|
9049
|
+
var import_lucide_react19 = require("lucide-react");
|
|
8975
9050
|
|
|
8976
9051
|
// src/components/thread/messages/sandbox-shell-tool-call.tsx
|
|
8977
|
-
var
|
|
8978
|
-
var
|
|
8979
|
-
var
|
|
9052
|
+
var React30 = __toESM(require("react"), 1);
|
|
9053
|
+
var import_lucide_react18 = require("lucide-react");
|
|
9054
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
8980
9055
|
var SANDBOX_SHELL_TEXT_CLASS = "text-[13px] leading-5 in-data-[density=compact]:text-xs in-data-[density=compact]:leading-4 in-data-[density=spacious]:text-sm in-data-[density=spacious]:leading-6";
|
|
8981
9056
|
var SANDBOX_SHELL_SECTION_GAP_CLASS = "mt-2 in-data-[density=compact]:mt-1.5 in-data-[density=spacious]:mt-3";
|
|
8982
9057
|
function normalizeShellToken(value) {
|
|
@@ -9031,7 +9106,7 @@ function getSandboxShellCommand(data, language) {
|
|
|
9031
9106
|
const command = readShellString(source.command) ?? readShellString(source.cmd) ?? readShellString(source.input);
|
|
9032
9107
|
if (command) return command;
|
|
9033
9108
|
}
|
|
9034
|
-
return readShellString(resolveLocalizedText(data.message, language)) ?? readShellString(resolveLocalizedText(data.title, language)) ?? "sandbox_shell";
|
|
9109
|
+
return readShellString((0, import_chatkit_types7.resolveLocalizedText)(data.message, language)) ?? readShellString((0, import_chatkit_types7.resolveLocalizedText)(data.title, language)) ?? "sandbox_shell";
|
|
9035
9110
|
}
|
|
9036
9111
|
function getSandboxShellOutput(data) {
|
|
9037
9112
|
const output = stringifyShellText(data.output) ?? stringifyShellText(data.data) ?? stringifyShellText(data.error);
|
|
@@ -9073,15 +9148,15 @@ function ShellCopyButton({
|
|
|
9073
9148
|
className
|
|
9074
9149
|
}) {
|
|
9075
9150
|
const { t } = useChatkitTranslation();
|
|
9076
|
-
const [isCopied, setIsCopied] =
|
|
9077
|
-
const resetTimeoutRef =
|
|
9078
|
-
const clearResetTimeout =
|
|
9151
|
+
const [isCopied, setIsCopied] = React30.useState(false);
|
|
9152
|
+
const resetTimeoutRef = React30.useRef(null);
|
|
9153
|
+
const clearResetTimeout = React30.useCallback(() => {
|
|
9079
9154
|
if (resetTimeoutRef.current === null) return;
|
|
9080
9155
|
window.clearTimeout(resetTimeoutRef.current);
|
|
9081
9156
|
resetTimeoutRef.current = null;
|
|
9082
9157
|
}, []);
|
|
9083
|
-
|
|
9084
|
-
const handleCopy =
|
|
9158
|
+
React30.useEffect(() => clearResetTimeout, [clearResetTimeout]);
|
|
9159
|
+
const handleCopy = React30.useCallback(() => {
|
|
9085
9160
|
if (typeof navigator === "undefined" || !navigator.clipboard) return;
|
|
9086
9161
|
void navigator.clipboard.writeText(value).then(() => {
|
|
9087
9162
|
setIsCopied(true);
|
|
@@ -9093,7 +9168,7 @@ function ShellCopyButton({
|
|
|
9093
9168
|
}).catch(() => void 0);
|
|
9094
9169
|
}, [clearResetTimeout, value]);
|
|
9095
9170
|
const label = isCopied ? t("message.toolGroup.copied") : t("message.toolGroup.copy");
|
|
9096
|
-
return /* @__PURE__ */ (0,
|
|
9171
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
9097
9172
|
"button",
|
|
9098
9173
|
{
|
|
9099
9174
|
type: "button",
|
|
@@ -9104,7 +9179,7 @@ function ShellCopyButton({
|
|
|
9104
9179
|
"aria-label": label,
|
|
9105
9180
|
title: label,
|
|
9106
9181
|
onClick: handleCopy,
|
|
9107
|
-
children: isCopied ? /* @__PURE__ */ (0,
|
|
9182
|
+
children: isCopied ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react18.Check, { className: "h-3.5 w-3.5", "aria-hidden": "true" }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react18.Copy, { className: "h-3.5 w-3.5", "aria-hidden": "true" })
|
|
9108
9183
|
}
|
|
9109
9184
|
);
|
|
9110
9185
|
}
|
|
@@ -9114,16 +9189,16 @@ function SandboxShellStatus({
|
|
|
9114
9189
|
}) {
|
|
9115
9190
|
const { t } = useChatkitTranslation();
|
|
9116
9191
|
if (exitCode !== null) {
|
|
9117
|
-
return /* @__PURE__ */ (0,
|
|
9192
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-muted-foreground/90", children: t("message.toolGroup.shell.exitCode", { code: exitCode }) });
|
|
9118
9193
|
}
|
|
9119
9194
|
if (data.status === "running") {
|
|
9120
|
-
return /* @__PURE__ */ (0,
|
|
9195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-muted-foreground/90", children: t("message.toolGroup.shell.running") });
|
|
9121
9196
|
}
|
|
9122
9197
|
if (data.status === "fail" || data.error) {
|
|
9123
|
-
return /* @__PURE__ */ (0,
|
|
9198
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-destructive/90", children: t("message.toolGroup.shell.failed") });
|
|
9124
9199
|
}
|
|
9125
|
-
return /* @__PURE__ */ (0,
|
|
9126
|
-
/* @__PURE__ */ (0,
|
|
9200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "inline-flex items-center gap-1 text-muted-foreground/90", children: [
|
|
9201
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react18.Check, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
|
|
9127
9202
|
t("message.toolGroup.shell.success")
|
|
9128
9203
|
] });
|
|
9129
9204
|
}
|
|
@@ -9134,14 +9209,14 @@ function SandboxShellToolCallCard({ data }) {
|
|
|
9134
9209
|
const output = getSandboxShellOutput(data);
|
|
9135
9210
|
const exitCode = getSandboxShellExitCode(data);
|
|
9136
9211
|
const copyButtonClassName = "absolute right-1 top-1 h-6 w-6 opacity-0 transition-opacity group-hover/shell-copy:opacity-100 group-focus-within/shell-copy:opacity-100 in-data-[density=compact]:right-0.5 in-data-[density=compact]:top-0.5 in-data-[density=compact]:h-5 in-data-[density=compact]:w-5 in-data-[density=spacious]:right-1.5 in-data-[density=spacious]:top-1.5 in-data-[density=spacious]:h-7 in-data-[density=spacious]:w-7";
|
|
9137
|
-
return /* @__PURE__ */ (0,
|
|
9212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
9138
9213
|
"div",
|
|
9139
9214
|
{
|
|
9140
|
-
className: "flex max-h-64 min-w-0 flex-col overflow-hidden rounded-md bg-muted/60 px-3
|
|
9215
|
+
className: "flex max-h-64 min-w-0 flex-col overflow-hidden rounded-md bg-muted/60 px-3 my-1 text-left shadow-sm ring-1 ring-border/30 in-data-[density=compact]:max-h-52 in-data-[density=compact]:px-2 in-data-[density=compact]:py-1.5 in-data-[density=spacious]:max-h-80 in-data-[density=spacious]:px-4 in-data-[density=spacious]:py-3",
|
|
9141
9216
|
"data-slot": "sandbox-shell-tool-call",
|
|
9142
9217
|
"aria-label": "Shell",
|
|
9143
9218
|
children: [
|
|
9144
|
-
/* @__PURE__ */ (0,
|
|
9219
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
9145
9220
|
"div",
|
|
9146
9221
|
{
|
|
9147
9222
|
className: cn(
|
|
@@ -9151,7 +9226,7 @@ function SandboxShellToolCallCard({ data }) {
|
|
|
9151
9226
|
children: "Shell"
|
|
9152
9227
|
}
|
|
9153
9228
|
),
|
|
9154
|
-
/* @__PURE__ */ (0,
|
|
9229
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
9155
9230
|
"div",
|
|
9156
9231
|
{
|
|
9157
9232
|
className: cn(
|
|
@@ -9159,7 +9234,7 @@ function SandboxShellToolCallCard({ data }) {
|
|
|
9159
9234
|
SANDBOX_SHELL_SECTION_GAP_CLASS
|
|
9160
9235
|
),
|
|
9161
9236
|
children: [
|
|
9162
|
-
/* @__PURE__ */ (0,
|
|
9237
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
9163
9238
|
"pre",
|
|
9164
9239
|
{
|
|
9165
9240
|
className: cn(
|
|
@@ -9170,11 +9245,11 @@ function SandboxShellToolCallCard({ data }) {
|
|
|
9170
9245
|
children: formattedCommand
|
|
9171
9246
|
}
|
|
9172
9247
|
),
|
|
9173
|
-
/* @__PURE__ */ (0,
|
|
9248
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ShellCopyButton, { value: command, className: copyButtonClassName })
|
|
9174
9249
|
]
|
|
9175
9250
|
}
|
|
9176
9251
|
),
|
|
9177
|
-
output ? /* @__PURE__ */ (0,
|
|
9252
|
+
output ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
9178
9253
|
"div",
|
|
9179
9254
|
{
|
|
9180
9255
|
className: cn(
|
|
@@ -9182,7 +9257,7 @@ function SandboxShellToolCallCard({ data }) {
|
|
|
9182
9257
|
SANDBOX_SHELL_SECTION_GAP_CLASS
|
|
9183
9258
|
),
|
|
9184
9259
|
children: [
|
|
9185
|
-
/* @__PURE__ */ (0,
|
|
9260
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
9186
9261
|
"pre",
|
|
9187
9262
|
{
|
|
9188
9263
|
className: cn(
|
|
@@ -9193,18 +9268,18 @@ function SandboxShellToolCallCard({ data }) {
|
|
|
9193
9268
|
children: output
|
|
9194
9269
|
}
|
|
9195
9270
|
),
|
|
9196
|
-
/* @__PURE__ */ (0,
|
|
9271
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ShellCopyButton, { value: output, className: copyButtonClassName })
|
|
9197
9272
|
]
|
|
9198
9273
|
}
|
|
9199
9274
|
) : null,
|
|
9200
|
-
/* @__PURE__ */ (0,
|
|
9275
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
9201
9276
|
"div",
|
|
9202
9277
|
{
|
|
9203
9278
|
className: cn(
|
|
9204
9279
|
"mt-3 flex shrink-0 justify-end in-data-[density=compact]:mt-2 in-data-[density=spacious]:mt-4",
|
|
9205
9280
|
SANDBOX_SHELL_TEXT_CLASS
|
|
9206
9281
|
),
|
|
9207
|
-
children: /* @__PURE__ */ (0,
|
|
9282
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SandboxShellStatus, { data, exitCode })
|
|
9208
9283
|
}
|
|
9209
9284
|
)
|
|
9210
9285
|
]
|
|
@@ -9213,19 +9288,19 @@ function SandboxShellToolCallCard({ data }) {
|
|
|
9213
9288
|
}
|
|
9214
9289
|
|
|
9215
9290
|
// src/components/thread/messages/tool-component-group.tsx
|
|
9216
|
-
var
|
|
9291
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
9217
9292
|
var toolStatusConfig = {
|
|
9218
9293
|
success: {
|
|
9219
9294
|
iconClass: "border-green-500 text-green-700",
|
|
9220
|
-
icon:
|
|
9295
|
+
icon: import_lucide_react19.CheckCircle2
|
|
9221
9296
|
},
|
|
9222
9297
|
fail: {
|
|
9223
9298
|
iconClass: "border-red-500 text-red-700",
|
|
9224
|
-
icon:
|
|
9299
|
+
icon: import_lucide_react19.XCircle
|
|
9225
9300
|
},
|
|
9226
9301
|
running: {
|
|
9227
9302
|
iconClass: "border-blue-500 text-blue-700",
|
|
9228
|
-
icon:
|
|
9303
|
+
icon: import_lucide_react19.Loader2
|
|
9229
9304
|
}
|
|
9230
9305
|
};
|
|
9231
9306
|
var TOOL_GROUP_CATEGORY_ORDER = [
|
|
@@ -9319,10 +9394,10 @@ function formatStepDuration2(durationMs) {
|
|
|
9319
9394
|
return `${minutes}m ${seconds}s`;
|
|
9320
9395
|
}
|
|
9321
9396
|
function useFrozenTimestamp(shouldFreeze) {
|
|
9322
|
-
const [frozenAt, setFrozenAt] =
|
|
9397
|
+
const [frozenAt, setFrozenAt] = React31.useState(
|
|
9323
9398
|
() => shouldFreeze ? Date.now() : null
|
|
9324
9399
|
);
|
|
9325
|
-
|
|
9400
|
+
React31.useEffect(() => {
|
|
9326
9401
|
if (shouldFreeze) {
|
|
9327
9402
|
setFrozenAt((current) => current ?? Date.now());
|
|
9328
9403
|
return;
|
|
@@ -9332,12 +9407,12 @@ function useFrozenTimestamp(shouldFreeze) {
|
|
|
9332
9407
|
return frozenAt;
|
|
9333
9408
|
}
|
|
9334
9409
|
function useToolStepDurationLabel(data, options) {
|
|
9335
|
-
const [durationNow, setDurationNow] =
|
|
9410
|
+
const [durationNow, setDurationNow] = React31.useState(() => Date.now());
|
|
9336
9411
|
const createdAt = parseStepDate(data.created_date);
|
|
9337
9412
|
const explicitEndedAt = parseStepDate(data.end_date);
|
|
9338
9413
|
const status = options?.status ?? data.status;
|
|
9339
9414
|
const endedAt = explicitEndedAt ?? (status !== "running" ? options?.fallbackEndedAt ?? null : null);
|
|
9340
|
-
|
|
9415
|
+
React31.useEffect(() => {
|
|
9341
9416
|
if (status !== "running" || createdAt === null || endedAt !== null) {
|
|
9342
9417
|
return;
|
|
9343
9418
|
}
|
|
@@ -9392,7 +9467,7 @@ function normalizeToolToken3(value) {
|
|
|
9392
9467
|
}
|
|
9393
9468
|
function classifyToolToken(value) {
|
|
9394
9469
|
const normalized = normalizeToolToken3(
|
|
9395
|
-
typeof value === "string" ? value : resolveLocalizedText(value, "en-US")
|
|
9470
|
+
typeof value === "string" ? value : (0, import_chatkit_types7.resolveLocalizedText)(value, "en-US")
|
|
9396
9471
|
);
|
|
9397
9472
|
if (!normalized) return null;
|
|
9398
9473
|
const directMatch = TOOL_GROUP_TOKEN_CATEGORY[normalized];
|
|
@@ -9424,10 +9499,10 @@ function getToolGroupCategoryCounts(items) {
|
|
|
9424
9499
|
function getToolActivityLabel(content, language, statusOverride) {
|
|
9425
9500
|
const data = getToolStepData(content);
|
|
9426
9501
|
const status = statusOverride ?? data.status;
|
|
9427
|
-
const message = resolveLocalizedText(data.message, language);
|
|
9428
|
-
const title = resolveLocalizedText(data.title, language);
|
|
9429
|
-
const tool = resolveLocalizedText(data.tool, language);
|
|
9430
|
-
const type = resolveLocalizedText(data.type, language);
|
|
9502
|
+
const message = (0, import_chatkit_types7.resolveLocalizedText)(data.message, language);
|
|
9503
|
+
const title = (0, import_chatkit_types7.resolveLocalizedText)(data.title, language);
|
|
9504
|
+
const tool = (0, import_chatkit_types7.resolveLocalizedText)(data.tool, language);
|
|
9505
|
+
const type = (0, import_chatkit_types7.resolveLocalizedText)(data.type, language);
|
|
9431
9506
|
if (status === "running") {
|
|
9432
9507
|
return message ?? title ?? tool ?? type ?? "Tool";
|
|
9433
9508
|
}
|
|
@@ -9521,8 +9596,8 @@ function shouldUseToolsetAvatar(toolset) {
|
|
|
9521
9596
|
}
|
|
9522
9597
|
function useToolsetAvatar(toolsetId, enabled, apiUrl) {
|
|
9523
9598
|
const avatarUrl = enabled ? createToolsetAvatarUrl(toolsetId, apiUrl) : null;
|
|
9524
|
-
const [avatar, setAvatar] =
|
|
9525
|
-
|
|
9599
|
+
const [avatar, setAvatar] = React31.useState(null);
|
|
9600
|
+
React31.useEffect(() => {
|
|
9526
9601
|
if (!avatarUrl) {
|
|
9527
9602
|
setAvatar(null);
|
|
9528
9603
|
return;
|
|
@@ -9554,7 +9629,7 @@ function ToolAvatarIcon({
|
|
|
9554
9629
|
className
|
|
9555
9630
|
}) {
|
|
9556
9631
|
if (avatar.url) {
|
|
9557
|
-
return /* @__PURE__ */ (0,
|
|
9632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9558
9633
|
"img",
|
|
9559
9634
|
{
|
|
9560
9635
|
alt: "",
|
|
@@ -9567,7 +9642,7 @@ function ToolAvatarIcon({
|
|
|
9567
9642
|
}
|
|
9568
9643
|
const emoji = unicodeFromUnified2(avatar.emoji?.unified);
|
|
9569
9644
|
if (emoji) {
|
|
9570
|
-
return /* @__PURE__ */ (0,
|
|
9645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9571
9646
|
"span",
|
|
9572
9647
|
{
|
|
9573
9648
|
"aria-hidden": "true",
|
|
@@ -9582,8 +9657,8 @@ function ToolAvatarIcon({
|
|
|
9582
9657
|
}
|
|
9583
9658
|
);
|
|
9584
9659
|
}
|
|
9585
|
-
return /* @__PURE__ */ (0,
|
|
9586
|
-
|
|
9660
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9661
|
+
import_lucide_react19.CircleHelp,
|
|
9587
9662
|
{
|
|
9588
9663
|
className,
|
|
9589
9664
|
"aria-hidden": "true",
|
|
@@ -9596,20 +9671,20 @@ function getKnownToolsetIcon(toolset) {
|
|
|
9596
9671
|
if (!normalized) return null;
|
|
9597
9672
|
switch (normalized) {
|
|
9598
9673
|
case "project":
|
|
9599
|
-
return
|
|
9674
|
+
return import_lucide_react19.Building2;
|
|
9600
9675
|
case "transfer_to":
|
|
9601
|
-
return
|
|
9676
|
+
return import_lucide_react19.Repeat2;
|
|
9602
9677
|
case "knowledge":
|
|
9603
9678
|
case "knowledgebase":
|
|
9604
|
-
return
|
|
9679
|
+
return import_lucide_react19.BookOpen;
|
|
9605
9680
|
case "project_tasks":
|
|
9606
|
-
return
|
|
9681
|
+
return import_lucide_react19.ListTodo;
|
|
9607
9682
|
case "memories":
|
|
9608
|
-
return
|
|
9683
|
+
return import_lucide_react19.Brain;
|
|
9609
9684
|
case "workflow_agent_tool":
|
|
9610
|
-
return
|
|
9685
|
+
return import_lucide_react19.Wrench;
|
|
9611
9686
|
case "workflow_task":
|
|
9612
|
-
return
|
|
9687
|
+
return import_lucide_react19.Network;
|
|
9613
9688
|
default:
|
|
9614
9689
|
return null;
|
|
9615
9690
|
}
|
|
@@ -9619,15 +9694,15 @@ function getStepTypeIcon(type) {
|
|
|
9619
9694
|
if (!normalized) return null;
|
|
9620
9695
|
switch (normalized) {
|
|
9621
9696
|
case "file":
|
|
9622
|
-
return
|
|
9697
|
+
return import_lucide_react19.FileText;
|
|
9623
9698
|
case "files":
|
|
9624
|
-
return
|
|
9699
|
+
return import_lucide_react19.Files;
|
|
9625
9700
|
case "program":
|
|
9626
|
-
return
|
|
9701
|
+
return import_lucide_react19.SquareTerminal;
|
|
9627
9702
|
case "web_search":
|
|
9628
|
-
return
|
|
9703
|
+
return import_lucide_react19.Search;
|
|
9629
9704
|
case "knowledges":
|
|
9630
|
-
return
|
|
9705
|
+
return import_lucide_react19.BookOpen;
|
|
9631
9706
|
default:
|
|
9632
9707
|
return null;
|
|
9633
9708
|
}
|
|
@@ -9645,12 +9720,12 @@ function ToolStepIcon({
|
|
|
9645
9720
|
apiUrl
|
|
9646
9721
|
);
|
|
9647
9722
|
const iconUrl = createToolsetIconUrl(data.toolset, organizationId, apiUrl);
|
|
9648
|
-
const [failedIconUrl, setFailedIconUrl] =
|
|
9649
|
-
|
|
9723
|
+
const [failedIconUrl, setFailedIconUrl] = React31.useState(null);
|
|
9724
|
+
React31.useEffect(() => {
|
|
9650
9725
|
setFailedIconUrl(null);
|
|
9651
9726
|
}, [iconUrl]);
|
|
9652
9727
|
if (avatar) {
|
|
9653
|
-
return /* @__PURE__ */ (0,
|
|
9728
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9654
9729
|
ToolAvatarIcon,
|
|
9655
9730
|
{
|
|
9656
9731
|
avatar,
|
|
@@ -9660,7 +9735,7 @@ function ToolStepIcon({
|
|
|
9660
9735
|
);
|
|
9661
9736
|
}
|
|
9662
9737
|
if (iconUrl && failedIconUrl !== iconUrl) {
|
|
9663
|
-
return /* @__PURE__ */ (0,
|
|
9738
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9664
9739
|
"img",
|
|
9665
9740
|
{
|
|
9666
9741
|
alt: "",
|
|
@@ -9674,7 +9749,7 @@ function ToolStepIcon({
|
|
|
9674
9749
|
}
|
|
9675
9750
|
const TypeIcon = getStepTypeIcon(data.type);
|
|
9676
9751
|
if (TypeIcon) {
|
|
9677
|
-
return /* @__PURE__ */ (0,
|
|
9752
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9678
9753
|
TypeIcon,
|
|
9679
9754
|
{
|
|
9680
9755
|
className,
|
|
@@ -9685,7 +9760,7 @@ function ToolStepIcon({
|
|
|
9685
9760
|
}
|
|
9686
9761
|
const ToolsetIcon = getKnownToolsetIcon(data.toolset);
|
|
9687
9762
|
if (ToolsetIcon) {
|
|
9688
|
-
return /* @__PURE__ */ (0,
|
|
9763
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9689
9764
|
ToolsetIcon,
|
|
9690
9765
|
{
|
|
9691
9766
|
className,
|
|
@@ -9695,8 +9770,8 @@ function ToolStepIcon({
|
|
|
9695
9770
|
);
|
|
9696
9771
|
}
|
|
9697
9772
|
if (usesToolsetAvatar) {
|
|
9698
|
-
return /* @__PURE__ */ (0,
|
|
9699
|
-
|
|
9773
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9774
|
+
import_lucide_react19.CircleHelp,
|
|
9700
9775
|
{
|
|
9701
9776
|
className,
|
|
9702
9777
|
"aria-hidden": "true",
|
|
@@ -9704,8 +9779,8 @@ function ToolStepIcon({
|
|
|
9704
9779
|
}
|
|
9705
9780
|
);
|
|
9706
9781
|
}
|
|
9707
|
-
return /* @__PURE__ */ (0,
|
|
9708
|
-
|
|
9782
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9783
|
+
import_lucide_react19.CircleHelp,
|
|
9709
9784
|
{
|
|
9710
9785
|
className,
|
|
9711
9786
|
"aria-hidden": "true",
|
|
@@ -9718,15 +9793,15 @@ function ToolCallCopyButton({
|
|
|
9718
9793
|
className
|
|
9719
9794
|
}) {
|
|
9720
9795
|
const { t } = useChatkitTranslation();
|
|
9721
|
-
const [isCopied, setIsCopied] =
|
|
9722
|
-
const resetTimeoutRef =
|
|
9723
|
-
const clearResetTimeout =
|
|
9796
|
+
const [isCopied, setIsCopied] = React31.useState(false);
|
|
9797
|
+
const resetTimeoutRef = React31.useRef(null);
|
|
9798
|
+
const clearResetTimeout = React31.useCallback(() => {
|
|
9724
9799
|
if (resetTimeoutRef.current === null) return;
|
|
9725
9800
|
window.clearTimeout(resetTimeoutRef.current);
|
|
9726
9801
|
resetTimeoutRef.current = null;
|
|
9727
9802
|
}, []);
|
|
9728
|
-
|
|
9729
|
-
const handleCopy =
|
|
9803
|
+
React31.useEffect(() => clearResetTimeout, [clearResetTimeout]);
|
|
9804
|
+
const handleCopy = React31.useCallback(() => {
|
|
9730
9805
|
if (typeof navigator === "undefined" || !navigator.clipboard) return;
|
|
9731
9806
|
void navigator.clipboard.writeText(value).then(() => {
|
|
9732
9807
|
setIsCopied(true);
|
|
@@ -9738,7 +9813,7 @@ function ToolCallCopyButton({
|
|
|
9738
9813
|
}).catch(() => void 0);
|
|
9739
9814
|
}, [clearResetTimeout, value]);
|
|
9740
9815
|
const label = isCopied ? t("message.toolGroup.copied") : t("message.toolGroup.copy");
|
|
9741
|
-
return /* @__PURE__ */ (0,
|
|
9816
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9742
9817
|
"button",
|
|
9743
9818
|
{
|
|
9744
9819
|
type: "button",
|
|
@@ -9749,7 +9824,7 @@ function ToolCallCopyButton({
|
|
|
9749
9824
|
"aria-label": label,
|
|
9750
9825
|
title: label,
|
|
9751
9826
|
onClick: handleCopy,
|
|
9752
|
-
children: isCopied ? /* @__PURE__ */ (0,
|
|
9827
|
+
children: isCopied ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react19.Check, { className: "h-3.5 w-3.5", "aria-hidden": "true" }) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react19.Copy, { className: "h-3.5 w-3.5", "aria-hidden": "true" })
|
|
9753
9828
|
}
|
|
9754
9829
|
);
|
|
9755
9830
|
}
|
|
@@ -9760,28 +9835,28 @@ function ToolCallValueBlock({
|
|
|
9760
9835
|
const { t } = useChatkitTranslation();
|
|
9761
9836
|
const detected = detectJsonValue(value);
|
|
9762
9837
|
if (detected.kind === "text") {
|
|
9763
|
-
return /* @__PURE__ */ (0,
|
|
9764
|
-
/* @__PURE__ */ (0,
|
|
9765
|
-
/* @__PURE__ */ (0,
|
|
9838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "min-w-0 space-y-1", children: [
|
|
9839
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ToolCallCopyButton, { value: detected.text }) }),
|
|
9840
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(PlainTextBlock, { value: detected.text, destructive })
|
|
9766
9841
|
] });
|
|
9767
9842
|
}
|
|
9768
|
-
return /* @__PURE__ */ (0,
|
|
9769
|
-
/* @__PURE__ */ (0,
|
|
9770
|
-
/* @__PURE__ */ (0,
|
|
9843
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Tabs, { defaultValue: "tree", className: "min-w-0", children: [
|
|
9844
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "mb-2 flex min-w-0 items-center justify-between gap-2", children: [
|
|
9845
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "min-w-0 truncate text-[11px] text-muted-foreground", children: [
|
|
9771
9846
|
t("message.toolGroup.jsonTitle"),
|
|
9772
9847
|
" \xB7 ",
|
|
9773
9848
|
getJsonValueSummary(detected.value)
|
|
9774
9849
|
] }),
|
|
9775
|
-
/* @__PURE__ */ (0,
|
|
9776
|
-
/* @__PURE__ */ (0,
|
|
9777
|
-
/* @__PURE__ */ (0,
|
|
9778
|
-
/* @__PURE__ */ (0,
|
|
9779
|
-
/* @__PURE__ */ (0,
|
|
9850
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
9851
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ToolCallCopyButton, { value: detected.raw }),
|
|
9852
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(TabsList, { className: "rounded-md p-0.5", children: [
|
|
9853
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "tree", children: t("message.toolGroup.jsonTree") }),
|
|
9854
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "raw", children: t("message.toolGroup.jsonRaw") })
|
|
9780
9855
|
] })
|
|
9781
9856
|
] })
|
|
9782
9857
|
] }),
|
|
9783
|
-
/* @__PURE__ */ (0,
|
|
9784
|
-
/* @__PURE__ */ (0,
|
|
9858
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TabsContent, { value: "tree", className: "mt-0", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(JsonTreeView, { value: detected.value }) }),
|
|
9859
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TabsContent, { value: "raw", className: "mt-0", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(RawJsonBlock, { raw: detected.raw }) })
|
|
9785
9860
|
] });
|
|
9786
9861
|
}
|
|
9787
9862
|
function DefaultToolCallOutput({ data }) {
|
|
@@ -9789,40 +9864,40 @@ function DefaultToolCallOutput({ data }) {
|
|
|
9789
9864
|
const output = data.output ?? null;
|
|
9790
9865
|
const error = data.error ?? null;
|
|
9791
9866
|
if (error) {
|
|
9792
|
-
return /* @__PURE__ */ (0,
|
|
9793
|
-
/* @__PURE__ */ (0,
|
|
9794
|
-
/* @__PURE__ */ (0,
|
|
9867
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "space-y-1", children: [
|
|
9868
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "text-[11px] font-medium text-destructive", children: t("message.toolGroup.errorTitle") }),
|
|
9869
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ToolCallValueBlock, { value: error, destructive: true })
|
|
9795
9870
|
] });
|
|
9796
9871
|
}
|
|
9797
9872
|
if (output === null) return null;
|
|
9798
|
-
return /* @__PURE__ */ (0,
|
|
9799
|
-
/* @__PURE__ */ (0,
|
|
9800
|
-
/* @__PURE__ */ (0,
|
|
9873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "space-y-1", children: [
|
|
9874
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.toolGroup.outputTitle") }),
|
|
9875
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ToolCallValueBlock, { value: output })
|
|
9801
9876
|
] });
|
|
9802
9877
|
}
|
|
9803
9878
|
function ToolCallDetails({ content }) {
|
|
9804
9879
|
const { t } = useChatkitTranslation();
|
|
9805
9880
|
const data = getToolStepData(content);
|
|
9806
9881
|
if (isSandboxShellStep(data)) {
|
|
9807
|
-
return /* @__PURE__ */ (0,
|
|
9882
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "ml-2 mt-1", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(SandboxShellToolCallCard, { data }) });
|
|
9808
9883
|
}
|
|
9809
9884
|
const renderer = getComponentMessageRenderer(content, data);
|
|
9810
9885
|
const hasCustomDetails = data.error === void 0 && hasComponentMessageRendererDetails(renderer, content, data);
|
|
9811
9886
|
const CustomDetailsRenderer = hasCustomDetails ? renderer?.renderDetails : void 0;
|
|
9812
9887
|
if (CustomDetailsRenderer) {
|
|
9813
|
-
return /* @__PURE__ */ (0,
|
|
9888
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "ml-6 mt-1 max-h-60 overflow-auto rounded-md bg-muted/30 text-xs text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CustomDetailsRenderer, { content, data }) });
|
|
9814
9889
|
}
|
|
9815
9890
|
const OutputRenderer = getToolCallOutputRenderer(data);
|
|
9816
9891
|
const hasInput = data.input !== void 0 && data.input !== null;
|
|
9817
9892
|
const hasOutput = data.error !== void 0 || data.output !== void 0;
|
|
9818
9893
|
if (!hasInput && !hasOutput) return null;
|
|
9819
|
-
return /* @__PURE__ */ (0,
|
|
9820
|
-
hasInput && /* @__PURE__ */ (0,
|
|
9821
|
-
/* @__PURE__ */ (0,
|
|
9822
|
-
/* @__PURE__ */ (0,
|
|
9894
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "ml-6 mt-1 max-h-60 overflow-auto rounded-md bg-muted/30 px-3 py-2 text-xs text-muted-foreground", children: [
|
|
9895
|
+
hasInput && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "space-y-1", children: [
|
|
9896
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.toolGroup.inputTitle") }),
|
|
9897
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ToolCallValueBlock, { value: data.input })
|
|
9823
9898
|
] }),
|
|
9824
|
-
hasInput && hasOutput ? /* @__PURE__ */ (0,
|
|
9825
|
-
hasOutput ? /* @__PURE__ */ (0,
|
|
9899
|
+
hasInput && hasOutput ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "h-2" }) : null,
|
|
9900
|
+
hasOutput ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(OutputRenderer, { content, data }) : null
|
|
9826
9901
|
] });
|
|
9827
9902
|
}
|
|
9828
9903
|
function areToolCallRowPropsEqual(previous, next) {
|
|
@@ -9839,7 +9914,7 @@ function ToolCallRowContent({
|
|
|
9839
9914
|
const status = getEffectiveToolStepStatus(data, isThreadRunning);
|
|
9840
9915
|
const hasError = status === "fail" || Boolean(data.error);
|
|
9841
9916
|
const isSandboxShell = isSandboxShellStep(data);
|
|
9842
|
-
const detailsId =
|
|
9917
|
+
const detailsId = React31.useId();
|
|
9843
9918
|
const renderer = getComponentMessageRenderer(content, data);
|
|
9844
9919
|
const label = isSandboxShell ? getSandboxShellActivityLabel(data, status, i18n2.language, t) : renderer?.getTitle?.(content, data, i18n2.language) ?? getToolActivityLabel(content, i18n2.language, status);
|
|
9845
9920
|
const hasCustomDetails = data.error === void 0 && hasComponentMessageRendererDetails(renderer, content, data);
|
|
@@ -9851,14 +9926,14 @@ function ToolCallRowContent({
|
|
|
9851
9926
|
status,
|
|
9852
9927
|
fallbackEndedAt
|
|
9853
9928
|
});
|
|
9854
|
-
const [isExpanded, setIsExpanded] =
|
|
9855
|
-
|
|
9929
|
+
const [isExpanded, setIsExpanded] = React31.useState(false);
|
|
9930
|
+
React31.useEffect(() => {
|
|
9856
9931
|
if (status === "running" && data.output !== void 0) {
|
|
9857
9932
|
setIsExpanded(true);
|
|
9858
9933
|
}
|
|
9859
9934
|
}, [data.output, status]);
|
|
9860
|
-
return /* @__PURE__ */ (0,
|
|
9861
|
-
/* @__PURE__ */ (0,
|
|
9935
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("li", { className: "ck-tool-call-row-enter min-w-0", children: [
|
|
9936
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
9862
9937
|
"button",
|
|
9863
9938
|
{
|
|
9864
9939
|
type: "button",
|
|
@@ -9875,7 +9950,7 @@ function ToolCallRowContent({
|
|
|
9875
9950
|
if (hasDetails) setIsExpanded((prev) => !prev);
|
|
9876
9951
|
},
|
|
9877
9952
|
children: [
|
|
9878
|
-
status ? /* @__PURE__ */ (0,
|
|
9953
|
+
status ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9879
9954
|
ToolStepIcon,
|
|
9880
9955
|
{
|
|
9881
9956
|
data,
|
|
@@ -9886,8 +9961,8 @@ function ToolCallRowContent({
|
|
|
9886
9961
|
hasError && !isSandboxShell ? "text-destructive" : "text-muted-foreground"
|
|
9887
9962
|
)
|
|
9888
9963
|
}
|
|
9889
|
-
) : /* @__PURE__ */ (0,
|
|
9890
|
-
/* @__PURE__ */ (0,
|
|
9964
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "h-3.5 w-3.5 shrink-0", "aria-hidden": "true" }),
|
|
9965
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9891
9966
|
"span",
|
|
9892
9967
|
{
|
|
9893
9968
|
className: cn(
|
|
@@ -9898,9 +9973,9 @@ function ToolCallRowContent({
|
|
|
9898
9973
|
children: label
|
|
9899
9974
|
}
|
|
9900
9975
|
),
|
|
9901
|
-
durationLabel ? /* @__PURE__ */ (0,
|
|
9902
|
-
hasDetails ? /* @__PURE__ */ (0,
|
|
9903
|
-
|
|
9976
|
+
durationLabel ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "shrink-0 text-[11px] tabular-nums text-muted-foreground/80", children: durationLabel }) : null,
|
|
9977
|
+
hasDetails ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9978
|
+
import_lucide_react19.ChevronRight,
|
|
9904
9979
|
{
|
|
9905
9980
|
"aria-hidden": "true",
|
|
9906
9981
|
className: cn(
|
|
@@ -9912,10 +9987,10 @@ function ToolCallRowContent({
|
|
|
9912
9987
|
]
|
|
9913
9988
|
}
|
|
9914
9989
|
),
|
|
9915
|
-
hasDetails && isExpanded ? /* @__PURE__ */ (0,
|
|
9990
|
+
hasDetails && isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { id: detailsId, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ToolCallDetails, { content }) }) : null
|
|
9916
9991
|
] });
|
|
9917
9992
|
}
|
|
9918
|
-
var ToolCallRow =
|
|
9993
|
+
var ToolCallRow = React31.memo(ToolCallRowContent, areToolCallRowPropsEqual);
|
|
9919
9994
|
ToolCallRow.displayName = "ToolCallRow";
|
|
9920
9995
|
function ToolComponentGroup({
|
|
9921
9996
|
items,
|
|
@@ -9925,8 +10000,8 @@ function ToolComponentGroup({
|
|
|
9925
10000
|
apiUrl
|
|
9926
10001
|
}) {
|
|
9927
10002
|
const { t } = useChatkitTranslation();
|
|
9928
|
-
const contentId =
|
|
9929
|
-
const [isExpanded, setIsExpanded] =
|
|
10003
|
+
const contentId = React31.useId();
|
|
10004
|
+
const [isExpanded, setIsExpanded] = React31.useState(!hasFollowingItem);
|
|
9930
10005
|
const categoryCounts = getToolGroupCategoryCounts(items);
|
|
9931
10006
|
const categorySummary = TOOL_GROUP_CATEGORY_ORDER.flatMap((category) => {
|
|
9932
10007
|
const count = categoryCounts[category] ?? 0;
|
|
@@ -9941,11 +10016,11 @@ function ToolComponentGroup({
|
|
|
9941
10016
|
const summary = `${t("message.toolGroup.status.success")} ${categorySummary}`;
|
|
9942
10017
|
const config = toolStatusConfig.success;
|
|
9943
10018
|
const StatusIcon = config.icon;
|
|
9944
|
-
|
|
10019
|
+
React31.useEffect(() => {
|
|
9945
10020
|
setIsExpanded(!hasFollowingItem);
|
|
9946
10021
|
}, [hasFollowingItem]);
|
|
9947
|
-
return /* @__PURE__ */ (0,
|
|
9948
|
-
/* @__PURE__ */ (0,
|
|
10022
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "px-1 py-1", children: [
|
|
10023
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
9949
10024
|
"button",
|
|
9950
10025
|
{
|
|
9951
10026
|
type: "button",
|
|
@@ -9954,8 +10029,8 @@ function ToolComponentGroup({
|
|
|
9954
10029
|
"aria-controls": contentId,
|
|
9955
10030
|
onClick: () => setIsExpanded((prev) => !prev),
|
|
9956
10031
|
children: [
|
|
9957
|
-
/* @__PURE__ */ (0,
|
|
9958
|
-
/* @__PURE__ */ (0,
|
|
10032
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex min-w-0 items-center gap-2 text-sm font-medium text-muted-foreground", children: [
|
|
10033
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9959
10034
|
StatusIcon,
|
|
9960
10035
|
{
|
|
9961
10036
|
className: cn(
|
|
@@ -9964,10 +10039,10 @@ function ToolComponentGroup({
|
|
|
9964
10039
|
)
|
|
9965
10040
|
}
|
|
9966
10041
|
),
|
|
9967
|
-
/* @__PURE__ */ (0,
|
|
10042
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "truncate", children: summary })
|
|
9968
10043
|
] }),
|
|
9969
|
-
/* @__PURE__ */ (0,
|
|
9970
|
-
|
|
10044
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
10045
|
+
import_lucide_react19.ChevronRight,
|
|
9971
10046
|
{
|
|
9972
10047
|
"aria-hidden": "true",
|
|
9973
10048
|
className: cn(
|
|
@@ -9979,7 +10054,7 @@ function ToolComponentGroup({
|
|
|
9979
10054
|
]
|
|
9980
10055
|
}
|
|
9981
10056
|
),
|
|
9982
|
-
isExpanded && /* @__PURE__ */ (0,
|
|
10057
|
+
isExpanded && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("ul", { id: contentId, className: "mt-2 space-y-1.5 overflow-y-auto pr-1", children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9983
10058
|
ToolCallRow,
|
|
9984
10059
|
{
|
|
9985
10060
|
content: item,
|
|
@@ -9993,10 +10068,10 @@ function ToolComponentGroup({
|
|
|
9993
10068
|
}
|
|
9994
10069
|
|
|
9995
10070
|
// src/components/thread/messages/request-user-input-result-card.tsx
|
|
9996
|
-
var
|
|
9997
|
-
var
|
|
9998
|
-
var
|
|
9999
|
-
var
|
|
10071
|
+
var React32 = require("react");
|
|
10072
|
+
var import_chatkit_types8 = require("@xpert-ai/chatkit-types");
|
|
10073
|
+
var import_lucide_react20 = require("lucide-react");
|
|
10074
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
10000
10075
|
function isRecord3(value) {
|
|
10001
10076
|
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
10002
10077
|
}
|
|
@@ -10035,7 +10110,7 @@ function collectPotentialToolCalls(messages) {
|
|
|
10035
10110
|
function findRequestUserInputClientToolCallById(messages, id) {
|
|
10036
10111
|
if (!id) return null;
|
|
10037
10112
|
return collectPotentialToolCalls(messages).find(
|
|
10038
|
-
(call) => getToolCallId(call) === id && getToolCallName(call) ===
|
|
10113
|
+
(call) => getToolCallId(call) === id && getToolCallName(call) === import_chatkit_types8.REQUEST_USER_INPUT_TOOL_NAME
|
|
10039
10114
|
) ?? null;
|
|
10040
10115
|
}
|
|
10041
10116
|
function normalizeAnswer(value) {
|
|
@@ -10070,7 +10145,7 @@ function parseResultOutput(output) {
|
|
|
10070
10145
|
if (!isRecord3(result) || !Array.isArray(result.answers)) {
|
|
10071
10146
|
return null;
|
|
10072
10147
|
}
|
|
10073
|
-
const hasExplicitType = result.type ===
|
|
10148
|
+
const hasExplicitType = result.type === import_chatkit_types8.REQUEST_USER_INPUT_RESULT_TYPE;
|
|
10074
10149
|
const answers = result.answers.map(normalizeAnswer);
|
|
10075
10150
|
if (answers.some((answer) => answer === null)) {
|
|
10076
10151
|
return null;
|
|
@@ -10108,7 +10183,7 @@ function RequestUserInputResultCard({
|
|
|
10108
10183
|
className
|
|
10109
10184
|
}) {
|
|
10110
10185
|
const { t } = useChatkitTranslation();
|
|
10111
|
-
return /* @__PURE__ */ (0,
|
|
10186
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
10112
10187
|
"section",
|
|
10113
10188
|
{
|
|
10114
10189
|
"aria-label": t("message.requestUserInputResult.title"),
|
|
@@ -10117,23 +10192,23 @@ function RequestUserInputResultCard({
|
|
|
10117
10192
|
className
|
|
10118
10193
|
),
|
|
10119
10194
|
children: [
|
|
10120
|
-
/* @__PURE__ */ (0,
|
|
10121
|
-
/* @__PURE__ */ (0,
|
|
10122
|
-
/* @__PURE__ */ (0,
|
|
10195
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "mb-2 flex items-center gap-2 text-sm font-semibold text-foreground", children: [
|
|
10196
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react20.CheckCircle2, { className: "h-4 w-4 text-primary" }),
|
|
10197
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { children: t("message.requestUserInputResult.title") })
|
|
10123
10198
|
] }),
|
|
10124
|
-
/* @__PURE__ */ (0,
|
|
10199
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "space-y-2", children: result.answers.map((answer, index) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
10125
10200
|
"div",
|
|
10126
10201
|
{
|
|
10127
10202
|
className: "rounded-md bg-background/70 px-2.5 py-2",
|
|
10128
10203
|
children: [
|
|
10129
|
-
/* @__PURE__ */ (0,
|
|
10130
|
-
/* @__PURE__ */ (0,
|
|
10131
|
-
/* @__PURE__ */ (0,
|
|
10132
|
-
/* @__PURE__ */ (0,
|
|
10204
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "text-xs font-medium leading-5 text-muted-foreground", children: answer.question }),
|
|
10205
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "mt-0.5 flex min-w-0 flex-wrap items-center gap-1.5", children: [
|
|
10206
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "min-w-0 wrap-break-word text-sm font-semibold text-foreground", children: answer.label ?? answer.value }),
|
|
10207
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "rounded-full bg-muted px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground", children: t(
|
|
10133
10208
|
answer.type === "other" ? "message.requestUserInputResult.other" : "message.requestUserInputResult.option"
|
|
10134
10209
|
) })
|
|
10135
10210
|
] }),
|
|
10136
|
-
answer.description ? /* @__PURE__ */ (0,
|
|
10211
|
+
answer.description ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "mt-1 text-xs leading-5 text-muted-foreground", children: answer.description }) : null
|
|
10137
10212
|
]
|
|
10138
10213
|
},
|
|
10139
10214
|
`${answer.id}-${index}`
|
|
@@ -10145,18 +10220,18 @@ function RequestUserInputResultCard({
|
|
|
10145
10220
|
|
|
10146
10221
|
// src/components/thread/messages/widget.tsx
|
|
10147
10222
|
var import_a2ui_react = require("@xpert-ai/a2ui-react");
|
|
10148
|
-
var
|
|
10223
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
10149
10224
|
function WidgetMessage({ messageId, data }) {
|
|
10150
10225
|
const widgets = Array.isArray(data.widgets) ? data.widgets : [];
|
|
10151
10226
|
if (widgets.length === 0) return null;
|
|
10152
10227
|
const baseSurfaceId = `widget-${messageId}`;
|
|
10153
|
-
return /* @__PURE__ */ (0,
|
|
10228
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "space-y-3", children: widgets.map((widget, index) => {
|
|
10154
10229
|
const config = widget?.config;
|
|
10155
10230
|
if (!config || typeof config !== "object") {
|
|
10156
10231
|
return null;
|
|
10157
10232
|
}
|
|
10158
10233
|
const surfaceId = widgets.length > 1 ? `${baseSurfaceId}-${index}` : baseSurfaceId;
|
|
10159
|
-
return /* @__PURE__ */ (0,
|
|
10234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
10160
10235
|
import_a2ui_react.SurfaceRenderer,
|
|
10161
10236
|
{
|
|
10162
10237
|
surfaceId,
|
|
@@ -10168,7 +10243,7 @@ function WidgetMessage({ messageId, data }) {
|
|
|
10168
10243
|
}
|
|
10169
10244
|
|
|
10170
10245
|
// src/components/thread/messages/ai.tsx
|
|
10171
|
-
var
|
|
10246
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
10172
10247
|
var assistantMessageStackClassName = "space-y-3 in-data-[density=compact]:space-y-2 in-data-[density=spacious]:space-y-4";
|
|
10173
10248
|
function isTextContent3(content) {
|
|
10174
10249
|
return content.type === "text";
|
|
@@ -10199,14 +10274,16 @@ function safeJson3(value) {
|
|
|
10199
10274
|
function formatDisplayValue3(value) {
|
|
10200
10275
|
return typeof value === "string" ? value : safeJson3(value);
|
|
10201
10276
|
}
|
|
10202
|
-
function ReasoningBlock({
|
|
10277
|
+
function ReasoningBlock({
|
|
10278
|
+
reasoning
|
|
10279
|
+
}) {
|
|
10203
10280
|
const blocks = reasoning.filter((item) => item.text?.trim());
|
|
10204
10281
|
if (blocks.length === 0) return null;
|
|
10205
|
-
return /* @__PURE__ */ (0,
|
|
10282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "space-y-2", children: blocks.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
10206
10283
|
"div",
|
|
10207
10284
|
{
|
|
10208
10285
|
className: "rounded-lg border bg-muted/40 p-3 text-xs text-muted-foreground",
|
|
10209
|
-
children: /* @__PURE__ */ (0,
|
|
10286
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "whitespace-pre-wrap wrap-break-word leading-relaxed", children: item.text })
|
|
10210
10287
|
},
|
|
10211
10288
|
item.id ?? `reasoning-${index}`
|
|
10212
10289
|
)) });
|
|
@@ -10214,20 +10291,27 @@ function ReasoningBlock({ reasoning }) {
|
|
|
10214
10291
|
function ImageBlock({ content }) {
|
|
10215
10292
|
const imageUrl = typeof content.image_url === "string" ? content.image_url : typeof content.image_url?.url === "string" ? content.image_url.url : null;
|
|
10216
10293
|
if (!imageUrl) {
|
|
10217
|
-
return /* @__PURE__ */ (0,
|
|
10218
|
-
/* @__PURE__ */ (0,
|
|
10219
|
-
/* @__PURE__ */ (0,
|
|
10294
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Card, { children: [
|
|
10295
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CardHeader, { className: "space-y-1", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CardTitle, { className: "text-sm", children: "Image" }) }),
|
|
10296
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CardContent, { className: "text-xs text-muted-foreground", children: safeJson3(content) })
|
|
10220
10297
|
] });
|
|
10221
10298
|
}
|
|
10222
|
-
return /* @__PURE__ */ (0,
|
|
10299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("figure", { className: "overflow-hidden rounded-lg border bg-background", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
10300
|
+
"img",
|
|
10301
|
+
{
|
|
10302
|
+
src: imageUrl,
|
|
10303
|
+
alt: "Assistant output",
|
|
10304
|
+
className: "h-auto w-full object-cover"
|
|
10305
|
+
}
|
|
10306
|
+
) });
|
|
10223
10307
|
}
|
|
10224
10308
|
function MemoryBlock({ content }) {
|
|
10225
|
-
return /* @__PURE__ */ (0,
|
|
10226
|
-
/* @__PURE__ */ (0,
|
|
10227
|
-
/* @__PURE__ */ (0,
|
|
10228
|
-
/* @__PURE__ */ (0,
|
|
10309
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Card, { children: [
|
|
10310
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(CardHeader, { className: "flex flex-row items-center justify-between gap-2", children: [
|
|
10311
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CardTitle, { className: "text-sm", children: "Memory" }),
|
|
10312
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Badge, { variant: "secondary", children: "Memory" })
|
|
10229
10313
|
] }),
|
|
10230
|
-
/* @__PURE__ */ (0,
|
|
10314
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CardContent, { className: "text-xs text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("pre", { className: "whitespace-pre-wrap wrap-break-word", children: safeJson3(content.data ?? []) }) })
|
|
10231
10315
|
] });
|
|
10232
10316
|
}
|
|
10233
10317
|
function parseStepDate2(value) {
|
|
@@ -10261,11 +10345,11 @@ function formatStepDuration3(durationMs) {
|
|
|
10261
10345
|
}
|
|
10262
10346
|
function ComponentBlock({ content }) {
|
|
10263
10347
|
const { i18n: i18n2 } = useChatkitTranslation();
|
|
10264
|
-
const [isExpanded, setIsExpanded] =
|
|
10265
|
-
const contentRef =
|
|
10266
|
-
const shouldAutoScrollRef =
|
|
10267
|
-
const previousScrollTopRef =
|
|
10268
|
-
const [durationNow, setDurationNow] =
|
|
10348
|
+
const [isExpanded, setIsExpanded] = React33.useState(false);
|
|
10349
|
+
const contentRef = React33.useRef(null);
|
|
10350
|
+
const shouldAutoScrollRef = React33.useRef(true);
|
|
10351
|
+
const previousScrollTopRef = React33.useRef(0);
|
|
10352
|
+
const [durationNow, setDurationNow] = React33.useState(() => Date.now());
|
|
10269
10353
|
const data = getToolStepData(content);
|
|
10270
10354
|
const category = data.category ?? "Component";
|
|
10271
10355
|
const title = getToolActivityLabel(content, i18n2.language);
|
|
@@ -10279,10 +10363,10 @@ function ComponentBlock({ content }) {
|
|
|
10279
10363
|
const endedAt = parseStepDate2(data.end_date);
|
|
10280
10364
|
const durationMs = createdAt === null ? null : Math.max(0, (endedAt ?? durationNow) - createdAt);
|
|
10281
10365
|
const durationLabel = durationMs === null ? null : formatStepDuration3(durationMs);
|
|
10282
|
-
|
|
10366
|
+
React33.useEffect(() => {
|
|
10283
10367
|
if (status === "running" && output !== null) setIsExpanded(true);
|
|
10284
10368
|
}, [status, output]);
|
|
10285
|
-
|
|
10369
|
+
React33.useEffect(() => {
|
|
10286
10370
|
if (status !== "running" || createdAt === null || endedAt !== null) {
|
|
10287
10371
|
return;
|
|
10288
10372
|
}
|
|
@@ -10294,7 +10378,7 @@ function ComponentBlock({ content }) {
|
|
|
10294
10378
|
window.clearInterval(timer);
|
|
10295
10379
|
};
|
|
10296
10380
|
}, [createdAt, endedAt, status]);
|
|
10297
|
-
|
|
10381
|
+
React33.useEffect(() => {
|
|
10298
10382
|
const element = contentRef.current;
|
|
10299
10383
|
if (!element) return;
|
|
10300
10384
|
previousScrollTopRef.current = element.scrollTop;
|
|
@@ -10309,12 +10393,14 @@ function ComponentBlock({ content }) {
|
|
|
10309
10393
|
shouldAutoScrollRef.current = isNearBottom(element);
|
|
10310
10394
|
};
|
|
10311
10395
|
updateAutoScrollState();
|
|
10312
|
-
element.addEventListener("scroll", updateAutoScrollState, {
|
|
10396
|
+
element.addEventListener("scroll", updateAutoScrollState, {
|
|
10397
|
+
passive: true
|
|
10398
|
+
});
|
|
10313
10399
|
return () => {
|
|
10314
10400
|
element.removeEventListener("scroll", updateAutoScrollState);
|
|
10315
10401
|
};
|
|
10316
10402
|
}, [isExpanded]);
|
|
10317
|
-
|
|
10403
|
+
React33.useEffect(() => {
|
|
10318
10404
|
if (status !== "running") {
|
|
10319
10405
|
shouldAutoScrollRef.current = true;
|
|
10320
10406
|
return;
|
|
@@ -10327,76 +10413,112 @@ function ComponentBlock({ content }) {
|
|
|
10327
10413
|
}, [isExpanded, output, status]);
|
|
10328
10414
|
const config = status ? toolStatusConfig[status] : null;
|
|
10329
10415
|
const StatusIcon = config?.icon;
|
|
10330
|
-
return /* @__PURE__ */ (0,
|
|
10331
|
-
/* @__PURE__ */ (0,
|
|
10332
|
-
|
|
10333
|
-
|
|
10334
|
-
|
|
10335
|
-
|
|
10336
|
-
|
|
10337
|
-
|
|
10338
|
-
|
|
10339
|
-
|
|
10340
|
-
|
|
10341
|
-
|
|
10342
|
-
|
|
10343
|
-
|
|
10344
|
-
|
|
10345
|
-
|
|
10346
|
-
|
|
10347
|
-
|
|
10348
|
-
|
|
10416
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Card, { children: [
|
|
10417
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
10418
|
+
CardHeader,
|
|
10419
|
+
{
|
|
10420
|
+
className: "flex flex-row items-center justify-between gap-2 px-2 py-1 cursor-pointer",
|
|
10421
|
+
onClick: () => setIsExpanded(!isExpanded),
|
|
10422
|
+
children: [
|
|
10423
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-center space-x-1 flex-1 min-w-0", children: [
|
|
10424
|
+
status && StatusIcon && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
10425
|
+
StatusIcon,
|
|
10426
|
+
{
|
|
10427
|
+
className: cn(
|
|
10428
|
+
"h-4 w-4",
|
|
10429
|
+
config?.iconClass,
|
|
10430
|
+
status === "running" && "animate-spin"
|
|
10431
|
+
)
|
|
10432
|
+
}
|
|
10433
|
+
),
|
|
10434
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CardTitle, { className: "text-sm truncate", children: title })
|
|
10435
|
+
] }),
|
|
10436
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex flex-wrap items-center gap-2 shrink-0", children: [
|
|
10437
|
+
durationLabel && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "inline-flex items-center gap-1 text-[11px] text-muted-foreground tabular-nums", children: [
|
|
10438
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react21.Clock3, { className: "h-3 w-3" }),
|
|
10439
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: durationLabel })
|
|
10440
|
+
] }),
|
|
10441
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Badge, { variant: "secondary", className: "rounded-lg px-1.5", children: category }),
|
|
10442
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
10443
|
+
"button",
|
|
10349
10444
|
{
|
|
10350
|
-
className:
|
|
10445
|
+
className: "text-muted-foreground hover:text-foreground transition-colors",
|
|
10446
|
+
"aria-label": isExpanded ? "Collapse" : "Expand",
|
|
10447
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
10448
|
+
import_lucide_react21.ChevronDown,
|
|
10449
|
+
{
|
|
10450
|
+
className: cn(
|
|
10451
|
+
"h-4 w-4 transition-transform",
|
|
10452
|
+
isExpanded && "rotate-180"
|
|
10453
|
+
)
|
|
10454
|
+
}
|
|
10455
|
+
)
|
|
10351
10456
|
}
|
|
10352
10457
|
)
|
|
10353
|
-
}
|
|
10354
|
-
|
|
10355
|
-
|
|
10356
|
-
|
|
10357
|
-
isExpanded && /* @__PURE__ */ (0,
|
|
10358
|
-
|
|
10359
|
-
|
|
10360
|
-
|
|
10458
|
+
] })
|
|
10459
|
+
]
|
|
10460
|
+
}
|
|
10461
|
+
),
|
|
10462
|
+
isExpanded && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
10463
|
+
CardContent,
|
|
10464
|
+
{
|
|
10465
|
+
ref: contentRef,
|
|
10466
|
+
className: "text-xs text-muted-foreground max-h-60 overflow-auto",
|
|
10467
|
+
children: [
|
|
10468
|
+
data.input && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("pre", { className: "whitespace-pre-wrap wrap-break-word", children: formatDisplayValue3(data.input) }),
|
|
10469
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("pre", { className: "whitespace-pre-wrap wrap-break-word text-destructive", children: formatDisplayValue3(error) }) : hasOutput && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("pre", { className: "whitespace-pre-wrap wrap-break-word", children: formatDisplayValue3(fallback) })
|
|
10470
|
+
]
|
|
10471
|
+
}
|
|
10472
|
+
)
|
|
10361
10473
|
] });
|
|
10362
10474
|
}
|
|
10363
10475
|
function UnknownBlock({ content }) {
|
|
10364
|
-
return /* @__PURE__ */ (0,
|
|
10365
|
-
/* @__PURE__ */ (0,
|
|
10366
|
-
/* @__PURE__ */ (0,
|
|
10367
|
-
/* @__PURE__ */ (0,
|
|
10476
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Card, { children: [
|
|
10477
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(CardHeader, { className: "flex flex-row items-center justify-between gap-2", children: [
|
|
10478
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CardTitle, { className: "text-sm", children: "Assistant Content" }),
|
|
10479
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Badge, { variant: "outline", children: content.type ?? "unknown" })
|
|
10368
10480
|
] }),
|
|
10369
|
-
/* @__PURE__ */ (0,
|
|
10481
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CardContent, { className: "text-xs text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("pre", { className: "whitespace-pre-wrap break-words", children: safeJson3(content) }) })
|
|
10370
10482
|
] });
|
|
10371
10483
|
}
|
|
10372
10484
|
function renderContentItem(content, index, message, lookupMessages, options) {
|
|
10373
10485
|
const messageId = message.id;
|
|
10374
10486
|
const textClassName = options?.isAgentOutput ? "text-sm [&_.markdown-content_p]:!leading-6" : void 0;
|
|
10375
10487
|
if (typeof content === "string") {
|
|
10376
|
-
return /* @__PURE__ */ (0,
|
|
10488
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: textClassName, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MarkdownText, { children: content }) }, `text-${index}`);
|
|
10377
10489
|
}
|
|
10378
10490
|
if (isTextContent3(content)) {
|
|
10379
|
-
return /* @__PURE__ */ (0,
|
|
10491
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: textClassName, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MarkdownText, { children: content.text }) }, content.id ?? `text-${index}`);
|
|
10380
10492
|
}
|
|
10381
10493
|
if (isReasoningContent3(content)) {
|
|
10382
|
-
return /* @__PURE__ */ (0,
|
|
10494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ReasoningBlock, { reasoning: [content] }) }, content.id ?? `reasoning-${index}`);
|
|
10383
10495
|
}
|
|
10384
10496
|
if (isImageContent(content)) {
|
|
10385
|
-
return /* @__PURE__ */ (0,
|
|
10497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ImageBlock, { content }) }, content.id ?? `image-${index}`);
|
|
10386
10498
|
}
|
|
10387
10499
|
if (isComponentContent3(content)) {
|
|
10500
|
+
if (isContextCompressionComponent(content)) {
|
|
10501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
10502
|
+
"div",
|
|
10503
|
+
{
|
|
10504
|
+
className: "w-full",
|
|
10505
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ContextCompressionMessage, { content })
|
|
10506
|
+
},
|
|
10507
|
+
content.id ?? `context-compression-${index}`
|
|
10508
|
+
);
|
|
10509
|
+
}
|
|
10388
10510
|
const requestUserInputResult = getRequestUserInputResultCardData(
|
|
10389
10511
|
content,
|
|
10390
10512
|
lookupMessages
|
|
10391
10513
|
);
|
|
10392
10514
|
if (requestUserInputResult) {
|
|
10393
|
-
return /* @__PURE__ */ (0,
|
|
10515
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(RequestUserInputResultCard, { result: requestUserInputResult }) }, content.id ?? `request-user-input-result-${index}`);
|
|
10394
10516
|
}
|
|
10395
10517
|
if (isWidgetComponent2(content)) {
|
|
10396
|
-
return /* @__PURE__ */ (0,
|
|
10518
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(WidgetMessage, { messageId, data: content.data }) }, content.id ?? `widget-${index}`);
|
|
10397
10519
|
}
|
|
10398
10520
|
if (getComponentMessagePresentation(content, getToolStepData(content)) === "grouped-step") {
|
|
10399
|
-
return /* @__PURE__ */ (0,
|
|
10521
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
10400
10522
|
ToolComponentGroup,
|
|
10401
10523
|
{
|
|
10402
10524
|
items: [content],
|
|
@@ -10407,15 +10529,15 @@ function renderContentItem(content, index, message, lookupMessages, options) {
|
|
|
10407
10529
|
}
|
|
10408
10530
|
) }, content.id ?? `component-group-${index}`);
|
|
10409
10531
|
}
|
|
10410
|
-
return /* @__PURE__ */ (0,
|
|
10532
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ComponentBlock, { content }) }, content.id ?? `component-${index}`);
|
|
10411
10533
|
}
|
|
10412
10534
|
if (isMemoryContent(content)) {
|
|
10413
|
-
return /* @__PURE__ */ (0,
|
|
10535
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MemoryBlock, { content }) }, content.id ?? `memory-${index}`);
|
|
10414
10536
|
}
|
|
10415
10537
|
if (isAgentEventContent(content)) {
|
|
10416
|
-
return /* @__PURE__ */ (0,
|
|
10538
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(AgentEventRow, { content }) }, content.id ?? `agent-event-${index}`);
|
|
10417
10539
|
}
|
|
10418
|
-
return /* @__PURE__ */ (0,
|
|
10540
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(UnknownBlock, { content }) }, content.id ?? `unknown-${index}`);
|
|
10419
10541
|
}
|
|
10420
10542
|
function renderContentUnit(unit, message, lookupMessages, hasFollowingItem, options) {
|
|
10421
10543
|
if (unit.type === "item") {
|
|
@@ -10426,7 +10548,7 @@ function renderContentUnit(unit, message, lookupMessages, hasFollowingItem, opti
|
|
|
10426
10548
|
isAgentOutput: options?.isAgentOutput
|
|
10427
10549
|
});
|
|
10428
10550
|
}
|
|
10429
|
-
return /* @__PURE__ */ (0,
|
|
10551
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
10430
10552
|
ToolComponentGroup,
|
|
10431
10553
|
{
|
|
10432
10554
|
items: unit.items,
|
|
@@ -10463,7 +10585,7 @@ function renderAssistantRenderUnits(units, message, lookupMessages, options, dep
|
|
|
10463
10585
|
const batch = entryBatch;
|
|
10464
10586
|
entryBatch = [];
|
|
10465
10587
|
rendered.push(
|
|
10466
|
-
/* @__PURE__ */ (0,
|
|
10588
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(React33.Fragment, { children: renderEntryBatch(batch, message, lookupMessages, hasFollowingItem, {
|
|
10467
10589
|
...options,
|
|
10468
10590
|
isAgentOutput: depth > 0
|
|
10469
10591
|
}) }, `entries-${batch[0]?.order ?? rendered.length}`)
|
|
@@ -10480,7 +10602,7 @@ function renderAssistantRenderUnits(units, message, lookupMessages, options, dep
|
|
|
10480
10602
|
}
|
|
10481
10603
|
flushEntries(true);
|
|
10482
10604
|
rendered.push(
|
|
10483
|
-
/* @__PURE__ */ (0,
|
|
10605
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
10484
10606
|
AgentRunGroup,
|
|
10485
10607
|
{
|
|
10486
10608
|
node: unit.node,
|
|
@@ -10505,7 +10627,7 @@ function renderContent(message, lookupMessages, options) {
|
|
|
10505
10627
|
message
|
|
10506
10628
|
);
|
|
10507
10629
|
if (renderTree.hasAgentRuns) {
|
|
10508
|
-
return /* @__PURE__ */ (0,
|
|
10630
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: assistantMessageStackClassName, children: renderAssistantRenderUnits(
|
|
10509
10631
|
renderTree.units,
|
|
10510
10632
|
message,
|
|
10511
10633
|
lookupMessages,
|
|
@@ -10515,13 +10637,13 @@ function renderContent(message, lookupMessages, options) {
|
|
|
10515
10637
|
const content = message.content;
|
|
10516
10638
|
if (typeof content === "string") {
|
|
10517
10639
|
if (!content.trim()) return null;
|
|
10518
|
-
return /* @__PURE__ */ (0,
|
|
10640
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MarkdownText, { children: content });
|
|
10519
10641
|
}
|
|
10520
10642
|
if (!Array.isArray(content) || content.length === 0) return null;
|
|
10521
10643
|
const renderUnits = buildToolComponentRenderUnits(content, {
|
|
10522
10644
|
shouldGroupComponent: (item) => getRequestUserInputResultCardData(item, lookupMessages) === null
|
|
10523
10645
|
});
|
|
10524
|
-
return /* @__PURE__ */ (0,
|
|
10646
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "space-y-3", children: renderUnits.map(
|
|
10525
10647
|
(unit, index) => renderContentUnit(
|
|
10526
10648
|
unit,
|
|
10527
10649
|
message,
|
|
@@ -10541,7 +10663,7 @@ function AssistantStreamingIndicator({
|
|
|
10541
10663
|
thinking: t("message.thinking"),
|
|
10542
10664
|
answering: t("message.answering")
|
|
10543
10665
|
};
|
|
10544
|
-
return /* @__PURE__ */ (0,
|
|
10666
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
10545
10667
|
"div",
|
|
10546
10668
|
{
|
|
10547
10669
|
className: cn(
|
|
@@ -10549,18 +10671,18 @@ function AssistantStreamingIndicator({
|
|
|
10549
10671
|
className
|
|
10550
10672
|
),
|
|
10551
10673
|
children: [
|
|
10552
|
-
status === "loading" && /* @__PURE__ */ (0,
|
|
10553
|
-
status === "thinking" && /* @__PURE__ */ (0,
|
|
10554
|
-
/* @__PURE__ */ (0,
|
|
10555
|
-
/* @__PURE__ */ (0,
|
|
10556
|
-
/* @__PURE__ */ (0,
|
|
10674
|
+
status === "loading" && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react21.Loader2, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
10675
|
+
status === "thinking" && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-end gap-1", "aria-hidden": "true", children: [
|
|
10676
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:-0.3s]" }),
|
|
10677
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:-0.15s]" }),
|
|
10678
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce" })
|
|
10557
10679
|
] }),
|
|
10558
|
-
status === "answering" && /* @__PURE__ */ (0,
|
|
10559
|
-
/* @__PURE__ */ (0,
|
|
10560
|
-
/* @__PURE__ */ (0,
|
|
10561
|
-
/* @__PURE__ */ (0,
|
|
10680
|
+
status === "answering" && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-end gap-1", "aria-hidden": "true", children: [
|
|
10681
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "h-2 w-0.5 rounded-full bg-current animate-pulse [animation-delay:-0.25s]" }),
|
|
10682
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "h-3 w-0.5 rounded-full bg-current animate-pulse [animation-delay:-0.1s]" }),
|
|
10683
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "h-2.5 w-0.5 rounded-full bg-current animate-pulse" })
|
|
10562
10684
|
] }),
|
|
10563
|
-
/* @__PURE__ */ (0,
|
|
10685
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: labelMap[status] })
|
|
10564
10686
|
]
|
|
10565
10687
|
}
|
|
10566
10688
|
);
|
|
@@ -10589,42 +10711,42 @@ function AssistantMessage({
|
|
|
10589
10711
|
organizationId,
|
|
10590
10712
|
apiUrl
|
|
10591
10713
|
});
|
|
10592
|
-
const reasoningNode = hasReasoning ? /* @__PURE__ */ (0,
|
|
10714
|
+
const reasoningNode = hasReasoning ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ReasoningBlock, { reasoning: rootReasoning ?? [] }) : null;
|
|
10593
10715
|
if (!hasContent && !hasReasoning && !resolvedStreamingStatus) return null;
|
|
10594
10716
|
const streamingClass = isStreaming ? "streaming-active" : "";
|
|
10595
10717
|
if (!hasContent && !hasReasoning && resolvedStreamingStatus) {
|
|
10596
|
-
return /* @__PURE__ */ (0,
|
|
10718
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: cn("space-y-3", streamingClass, className), children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) });
|
|
10597
10719
|
}
|
|
10598
10720
|
if (hasContent && hasReasoning) {
|
|
10599
|
-
return /* @__PURE__ */ (0,
|
|
10600
|
-
/* @__PURE__ */ (0,
|
|
10721
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: cn("space-y-3", streamingClass, className), children: [
|
|
10722
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
10601
10723
|
Tabs,
|
|
10602
10724
|
{
|
|
10603
10725
|
defaultValue: message.status === "reasoning" ? "reasoning" : "answer",
|
|
10604
10726
|
className: "w-full",
|
|
10605
10727
|
children: [
|
|
10606
|
-
/* @__PURE__ */ (0,
|
|
10607
|
-
/* @__PURE__ */ (0,
|
|
10608
|
-
/* @__PURE__ */ (0,
|
|
10728
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(TabsList, { className: "", children: [
|
|
10729
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TabsTrigger, { value: "answer", children: t("message.answer") }),
|
|
10730
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TabsTrigger, { value: "reasoning", children: t("message.reasoning") })
|
|
10609
10731
|
] }),
|
|
10610
|
-
/* @__PURE__ */ (0,
|
|
10611
|
-
/* @__PURE__ */ (0,
|
|
10732
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TabsContent, { value: "answer", className: "space-y-3", children: answerNode }),
|
|
10733
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TabsContent, { value: "reasoning", className: "space-y-3", children: reasoningNode })
|
|
10612
10734
|
]
|
|
10613
10735
|
}
|
|
10614
10736
|
),
|
|
10615
|
-
resolvedStreamingStatus ? /* @__PURE__ */ (0,
|
|
10737
|
+
resolvedStreamingStatus ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) : null
|
|
10616
10738
|
] });
|
|
10617
10739
|
}
|
|
10618
|
-
return /* @__PURE__ */ (0,
|
|
10740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: cn("space-y-3", streamingClass, className), children: [
|
|
10619
10741
|
hasReasoning ? reasoningNode : answerNode,
|
|
10620
|
-
resolvedStreamingStatus ? /* @__PURE__ */ (0,
|
|
10742
|
+
resolvedStreamingStatus ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) : null
|
|
10621
10743
|
] });
|
|
10622
10744
|
}
|
|
10623
10745
|
|
|
10624
10746
|
// src/components/thread/MessageActions.tsx
|
|
10625
|
-
var
|
|
10626
|
-
var
|
|
10627
|
-
var
|
|
10747
|
+
var React34 = __toESM(require("react"), 1);
|
|
10748
|
+
var import_lucide_react22 = require("lucide-react");
|
|
10749
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
10628
10750
|
function MessageActions({
|
|
10629
10751
|
content,
|
|
10630
10752
|
isAssistant = false,
|
|
@@ -10633,7 +10755,7 @@ function MessageActions({
|
|
|
10633
10755
|
className
|
|
10634
10756
|
}) {
|
|
10635
10757
|
const { t } = useChatkitTranslation();
|
|
10636
|
-
const [copied, setCopied] =
|
|
10758
|
+
const [copied, setCopied] = React34.useState(false);
|
|
10637
10759
|
const handleCopy = async () => {
|
|
10638
10760
|
try {
|
|
10639
10761
|
await navigator.clipboard.writeText(content);
|
|
@@ -10646,7 +10768,7 @@ function MessageActions({
|
|
|
10646
10768
|
if (isStreaming) {
|
|
10647
10769
|
return null;
|
|
10648
10770
|
}
|
|
10649
|
-
return /* @__PURE__ */ (0,
|
|
10771
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
10650
10772
|
"div",
|
|
10651
10773
|
{
|
|
10652
10774
|
className: cn(
|
|
@@ -10654,7 +10776,7 @@ function MessageActions({
|
|
|
10654
10776
|
className
|
|
10655
10777
|
),
|
|
10656
10778
|
children: [
|
|
10657
|
-
/* @__PURE__ */ (0,
|
|
10779
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
10658
10780
|
"button",
|
|
10659
10781
|
{
|
|
10660
10782
|
type: "button",
|
|
@@ -10664,17 +10786,17 @@ function MessageActions({
|
|
|
10664
10786
|
copied && "text-green-500"
|
|
10665
10787
|
),
|
|
10666
10788
|
title: copied ? t("messageActions.copied") : t("messageActions.copy"),
|
|
10667
|
-
children: copied ? /* @__PURE__ */ (0,
|
|
10789
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react22.Check, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react22.Copy, { size: 14 })
|
|
10668
10790
|
}
|
|
10669
10791
|
),
|
|
10670
|
-
isAssistant && onRetry && /* @__PURE__ */ (0,
|
|
10792
|
+
isAssistant && onRetry && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
10671
10793
|
"button",
|
|
10672
10794
|
{
|
|
10673
10795
|
type: "button",
|
|
10674
10796
|
onClick: onRetry,
|
|
10675
10797
|
className: "p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",
|
|
10676
10798
|
title: t("messageActions.regenerate"),
|
|
10677
|
-
children: /* @__PURE__ */ (0,
|
|
10799
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react22.RefreshCw, { size: 14 })
|
|
10678
10800
|
}
|
|
10679
10801
|
)
|
|
10680
10802
|
]
|
|
@@ -10683,20 +10805,20 @@ function MessageActions({
|
|
|
10683
10805
|
}
|
|
10684
10806
|
|
|
10685
10807
|
// src/components/thread/StartScreen.tsx
|
|
10686
|
-
var
|
|
10687
|
-
var
|
|
10688
|
-
var
|
|
10808
|
+
var React35 = require("react");
|
|
10809
|
+
var import_lucide_react23 = require("lucide-react");
|
|
10810
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
10689
10811
|
function getIconComponent2(icon) {
|
|
10690
10812
|
const iconMap = {
|
|
10691
|
-
"circle-question": /* @__PURE__ */ (0,
|
|
10692
|
-
"lightbulb": /* @__PURE__ */ (0,
|
|
10693
|
-
"sparkle": /* @__PURE__ */ (0,
|
|
10694
|
-
"write": /* @__PURE__ */ (0,
|
|
10695
|
-
"search": /* @__PURE__ */ (0,
|
|
10696
|
-
"globe": /* @__PURE__ */ (0,
|
|
10697
|
-
"book-open": /* @__PURE__ */ (0,
|
|
10698
|
-
"compass": /* @__PURE__ */ (0,
|
|
10699
|
-
"bolt": /* @__PURE__ */ (0,
|
|
10813
|
+
"circle-question": /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react23.HelpCircle, { size: 20 }),
|
|
10814
|
+
"lightbulb": /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react23.Lightbulb, { size: 20 }),
|
|
10815
|
+
"sparkle": /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react23.Sparkles, { size: 20 }),
|
|
10816
|
+
"write": /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react23.Pencil, { size: 20 }),
|
|
10817
|
+
"search": /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react23.Search, { size: 20 }),
|
|
10818
|
+
"globe": /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react23.Globe, { size: 20 }),
|
|
10819
|
+
"book-open": /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react23.BookOpen, { size: 20 }),
|
|
10820
|
+
"compass": /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react23.Compass, { size: 20 }),
|
|
10821
|
+
"bolt": /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react23.Zap, { size: 20 })
|
|
10700
10822
|
};
|
|
10701
10823
|
return icon ? iconMap[icon] || iconMap["sparkle"] : iconMap["sparkle"];
|
|
10702
10824
|
}
|
|
@@ -10704,9 +10826,9 @@ function StartScreen({ startScreen, onPromptClick, className }) {
|
|
|
10704
10826
|
const { t } = useChatkitTranslation();
|
|
10705
10827
|
const greeting = startScreen?.greeting ?? t("startScreen.greeting");
|
|
10706
10828
|
const prompts = startScreen?.prompts ?? [];
|
|
10707
|
-
return /* @__PURE__ */ (0,
|
|
10708
|
-
/* @__PURE__ */ (0,
|
|
10709
|
-
prompts.length > 0 && /* @__PURE__ */ (0,
|
|
10829
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: cn("flex flex-col items-center justify-center py-12 px-4", className), children: [
|
|
10830
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "mb-8 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("h2", { className: "text-2xl font-semibold text-foreground mb-2", children: greeting }) }),
|
|
10831
|
+
prompts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "w-full max-w-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: prompts.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
10710
10832
|
"button",
|
|
10711
10833
|
{
|
|
10712
10834
|
type: "button",
|
|
@@ -10717,8 +10839,8 @@ function StartScreen({ startScreen, onPromptClick, className }) {
|
|
|
10717
10839
|
"focus:outline-none focus:ring-2 focus:ring-primary/20"
|
|
10718
10840
|
),
|
|
10719
10841
|
children: [
|
|
10720
|
-
/* @__PURE__ */ (0,
|
|
10721
|
-
/* @__PURE__ */ (0,
|
|
10842
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary", children: getIconComponent2(item.icon) }),
|
|
10843
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-sm font-medium text-foreground", children: item.label })
|
|
10722
10844
|
]
|
|
10723
10845
|
},
|
|
10724
10846
|
`prompt-${index}`
|
|
@@ -10727,7 +10849,7 @@ function StartScreen({ startScreen, onPromptClick, className }) {
|
|
|
10727
10849
|
}
|
|
10728
10850
|
|
|
10729
10851
|
// src/hooks/useThreads.ts
|
|
10730
|
-
var
|
|
10852
|
+
var React36 = __toESM(require("react"), 1);
|
|
10731
10853
|
var DEFAULT_LIMIT = 50;
|
|
10732
10854
|
var getThreadTitle = (threadRecord) => {
|
|
10733
10855
|
const title = threadRecord.title?.trim();
|
|
@@ -10780,16 +10902,16 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10780
10902
|
isLoading: isStreamLoading,
|
|
10781
10903
|
error: streamError
|
|
10782
10904
|
} = useStreamContext();
|
|
10783
|
-
const [threadRecords, setThreadRecords] =
|
|
10784
|
-
const [isLoading, setIsLoading] =
|
|
10785
|
-
const [error, setError] =
|
|
10786
|
-
const upsertThreadRecord =
|
|
10905
|
+
const [threadRecords, setThreadRecords] = React36.useState([]);
|
|
10906
|
+
const [isLoading, setIsLoading] = React36.useState(false);
|
|
10907
|
+
const [error, setError] = React36.useState(null);
|
|
10908
|
+
const upsertThreadRecord = React36.useCallback((threadRecord) => {
|
|
10787
10909
|
setThreadRecords((prev) => {
|
|
10788
10910
|
const next = prev.filter((item) => item.id !== threadRecord.id);
|
|
10789
10911
|
return sortThreadRecords([threadRecord, ...next]);
|
|
10790
10912
|
});
|
|
10791
10913
|
}, []);
|
|
10792
|
-
const refreshThreads =
|
|
10914
|
+
const refreshThreads = React36.useCallback(async () => {
|
|
10793
10915
|
setIsLoading(true);
|
|
10794
10916
|
setError(null);
|
|
10795
10917
|
try {
|
|
@@ -10805,7 +10927,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10805
10927
|
setIsLoading(false);
|
|
10806
10928
|
}
|
|
10807
10929
|
}, [client, limit, assistantId]);
|
|
10808
|
-
const createThread =
|
|
10930
|
+
const createThread = React36.useCallback(
|
|
10809
10931
|
async (input) => {
|
|
10810
10932
|
setError(null);
|
|
10811
10933
|
const payload = {};
|
|
@@ -10819,7 +10941,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10819
10941
|
},
|
|
10820
10942
|
[client, upsertThreadRecord]
|
|
10821
10943
|
);
|
|
10822
|
-
const updateThread =
|
|
10944
|
+
const updateThread = React36.useCallback(
|
|
10823
10945
|
async (recordId, payload) => {
|
|
10824
10946
|
setError(null);
|
|
10825
10947
|
const updated = await client.conversations.update(recordId, payload);
|
|
@@ -10828,7 +10950,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10828
10950
|
},
|
|
10829
10951
|
[client, upsertThreadRecord]
|
|
10830
10952
|
);
|
|
10831
|
-
const deleteThread =
|
|
10953
|
+
const deleteThread = React36.useCallback(
|
|
10832
10954
|
async (recordId) => {
|
|
10833
10955
|
setError(null);
|
|
10834
10956
|
await client.conversations.delete(recordId);
|
|
@@ -10836,11 +10958,11 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10836
10958
|
},
|
|
10837
10959
|
[client]
|
|
10838
10960
|
);
|
|
10839
|
-
|
|
10961
|
+
React36.useEffect(() => {
|
|
10840
10962
|
if (!isReady) return;
|
|
10841
10963
|
void refreshThreads();
|
|
10842
10964
|
}, [refreshThreads, isReady]);
|
|
10843
|
-
|
|
10965
|
+
React36.useEffect(() => {
|
|
10844
10966
|
if (!threadId || !isStreamLoading) return;
|
|
10845
10967
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
10846
10968
|
const busyStatus = "busy";
|
|
@@ -10861,7 +10983,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10861
10983
|
return changed ? sortThreadRecords(next) : prev;
|
|
10862
10984
|
});
|
|
10863
10985
|
}, [threadId, isStreamLoading]);
|
|
10864
|
-
|
|
10986
|
+
React36.useEffect(() => {
|
|
10865
10987
|
const message = getErrorMessage(streamError)?.trim();
|
|
10866
10988
|
if (!threadId || !message) return;
|
|
10867
10989
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -10883,7 +11005,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10883
11005
|
return changed ? sortThreadRecords(next) : prev;
|
|
10884
11006
|
});
|
|
10885
11007
|
}, [threadId, streamError]);
|
|
10886
|
-
|
|
11008
|
+
React36.useEffect(() => {
|
|
10887
11009
|
if (!isReady || !threadId || isStreamLoading) return;
|
|
10888
11010
|
let cancelled = false;
|
|
10889
11011
|
void client.conversations.search({ where: { threadId }, limit: 1 }).then((result) => {
|
|
@@ -10897,7 +11019,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10897
11019
|
cancelled = true;
|
|
10898
11020
|
};
|
|
10899
11021
|
}, [client, threadId, upsertThreadRecord, isReady, isStreamLoading]);
|
|
10900
|
-
const threads =
|
|
11022
|
+
const threads = React36.useMemo(
|
|
10901
11023
|
() => threadRecords.map((threadRecord) => toThreadItem(threadRecord)),
|
|
10902
11024
|
[threadRecords]
|
|
10903
11025
|
);
|
|
@@ -10914,10 +11036,10 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10914
11036
|
}
|
|
10915
11037
|
|
|
10916
11038
|
// src/components/thread/context-usage-indicator.tsx
|
|
10917
|
-
var
|
|
11039
|
+
var React37 = __toESM(require("react"), 1);
|
|
10918
11040
|
|
|
10919
11041
|
// src/components/ui/progress-circle.tsx
|
|
10920
|
-
var
|
|
11042
|
+
var import_jsx_runtime42 = (
|
|
10921
11043
|
// biome-ignore lint/a11y/useFocusableInteractive: false positive (progress + progressbar are not focusable interactives)
|
|
10922
11044
|
// biome-ignore lint/nursery/useAriaPropsSupportedByRole: biome rule at odds with mdn docs (presumed nursary bug with rule)
|
|
10923
11045
|
require("react/jsx-runtime")
|
|
@@ -10941,7 +11063,7 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
|
|
|
10941
11063
|
fill: "none",
|
|
10942
11064
|
strokeWidth
|
|
10943
11065
|
};
|
|
10944
|
-
return /* @__PURE__ */ (0,
|
|
11066
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
10945
11067
|
"svg",
|
|
10946
11068
|
{
|
|
10947
11069
|
role: "progressbar",
|
|
@@ -10952,8 +11074,8 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
|
|
|
10952
11074
|
"aria-valuemax": 100,
|
|
10953
11075
|
...restSvgProps,
|
|
10954
11076
|
children: [
|
|
10955
|
-
/* @__PURE__ */ (0,
|
|
10956
|
-
/* @__PURE__ */ (0,
|
|
11077
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("circle", { ...commonParams, className: "stroke-current/25" }),
|
|
11078
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
10957
11079
|
"circle",
|
|
10958
11080
|
{
|
|
10959
11081
|
...commonParams,
|
|
@@ -10971,7 +11093,7 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
|
|
|
10971
11093
|
};
|
|
10972
11094
|
|
|
10973
11095
|
// src/components/thread/context-usage-indicator.tsx
|
|
10974
|
-
var
|
|
11096
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
10975
11097
|
var kNumberFormatter = new Intl.NumberFormat("en-US", {
|
|
10976
11098
|
minimumFractionDigits: 0,
|
|
10977
11099
|
maximumFractionDigits: 1
|
|
@@ -11004,20 +11126,20 @@ function ContextUsageIndicator({
|
|
|
11004
11126
|
}) {
|
|
11005
11127
|
const { t } = useChatkitTranslation();
|
|
11006
11128
|
const stream = useStreamContext();
|
|
11007
|
-
const [maxContextSize, setMaxContextSize] =
|
|
11008
|
-
const [usedContextSize, setUsedContextSize] =
|
|
11009
|
-
const [assistantAgentKey, setAssistantAgentKey] =
|
|
11010
|
-
const latestRealtimeUsageRef =
|
|
11129
|
+
const [maxContextSize, setMaxContextSize] = React37.useState(null);
|
|
11130
|
+
const [usedContextSize, setUsedContextSize] = React37.useState(null);
|
|
11131
|
+
const [assistantAgentKey, setAssistantAgentKey] = React37.useState(null);
|
|
11132
|
+
const latestRealtimeUsageRef = React37.useRef({
|
|
11011
11133
|
threadId: null,
|
|
11012
11134
|
agentKey: null,
|
|
11013
11135
|
usedTokens: null
|
|
11014
11136
|
});
|
|
11015
|
-
const realtimeUsage =
|
|
11137
|
+
const realtimeUsage = React37.useMemo(
|
|
11016
11138
|
() => getThreadContextUsage(stream.contextUsageByAgentKey, assistantAgentKey),
|
|
11017
11139
|
[assistantAgentKey, stream.contextUsageByAgentKey]
|
|
11018
11140
|
);
|
|
11019
11141
|
const realtimeUsedContextSize = getThreadContextUsageTotalTokens(realtimeUsage);
|
|
11020
|
-
|
|
11142
|
+
React37.useEffect(() => {
|
|
11021
11143
|
if (!stream.client || !stream.assistantId) {
|
|
11022
11144
|
setMaxContextSize(null);
|
|
11023
11145
|
setAssistantAgentKey(null);
|
|
@@ -11037,18 +11159,18 @@ function ContextUsageIndicator({
|
|
|
11037
11159
|
cancelled = true;
|
|
11038
11160
|
};
|
|
11039
11161
|
}, [stream.client, stream.assistantId]);
|
|
11040
|
-
|
|
11162
|
+
React37.useEffect(() => {
|
|
11041
11163
|
latestRealtimeUsageRef.current = {
|
|
11042
11164
|
threadId: stream.threadId ?? null,
|
|
11043
11165
|
agentKey: assistantAgentKey,
|
|
11044
11166
|
usedTokens: realtimeUsedContextSize
|
|
11045
11167
|
};
|
|
11046
11168
|
}, [assistantAgentKey, realtimeUsedContextSize, stream.threadId]);
|
|
11047
|
-
|
|
11169
|
+
React37.useEffect(() => {
|
|
11048
11170
|
if (realtimeUsedContextSize == null) return;
|
|
11049
11171
|
setUsedContextSize(realtimeUsedContextSize);
|
|
11050
11172
|
}, [realtimeUsedContextSize]);
|
|
11051
|
-
|
|
11173
|
+
React37.useEffect(() => {
|
|
11052
11174
|
if (!stream.client) {
|
|
11053
11175
|
setUsedContextSize(null);
|
|
11054
11176
|
return;
|
|
@@ -11113,8 +11235,8 @@ function ContextUsageIndicator({
|
|
|
11113
11235
|
});
|
|
11114
11236
|
const usageLabelWithSuffix = usageLabel.endsWith(":") ? usageLabel : `${usageLabel}:`;
|
|
11115
11237
|
const progressClassName = percent >= 90 ? "text-destructive" : percent >= 75 ? "text-amber-500" : "text-primary dark:text-zinc-300";
|
|
11116
|
-
return /* @__PURE__ */ (0,
|
|
11117
|
-
/* @__PURE__ */ (0,
|
|
11238
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(Tooltip, { children: [
|
|
11239
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
11118
11240
|
"button",
|
|
11119
11241
|
{
|
|
11120
11242
|
type: "button",
|
|
@@ -11123,31 +11245,31 @@ function ContextUsageIndicator({
|
|
|
11123
11245
|
className
|
|
11124
11246
|
),
|
|
11125
11247
|
"aria-label": `${usageLabelWithSuffix} ${usageFullLabel}. ${usageTokensLabel}`,
|
|
11126
|
-
children: /* @__PURE__ */ (0,
|
|
11248
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ProgressCircle, { value: percent, className: cn("size-3.5", progressClassName) })
|
|
11127
11249
|
}
|
|
11128
11250
|
) }),
|
|
11129
|
-
/* @__PURE__ */ (0,
|
|
11130
|
-
/* @__PURE__ */ (0,
|
|
11131
|
-
/* @__PURE__ */ (0,
|
|
11132
|
-
/* @__PURE__ */ (0,
|
|
11251
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(TooltipContent, { side: "top", sideOffset: 6, className: "space-y-0.5 px-3 py-2 text-center", children: [
|
|
11252
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "text-primary-foreground/70", children: usageLabelWithSuffix }),
|
|
11253
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "font-medium text-primary-foreground/80", children: usageFullLabel }),
|
|
11254
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "text-sm font-semibold", children: usageTokensLabel })
|
|
11133
11255
|
] })
|
|
11134
11256
|
] });
|
|
11135
11257
|
}
|
|
11136
11258
|
|
|
11137
11259
|
// src/components/pet/PetBridge.tsx
|
|
11138
|
-
var
|
|
11139
|
-
var
|
|
11260
|
+
var React38 = __toESM(require("react"), 1);
|
|
11261
|
+
var import_chatkit_types9 = require("@xpert-ai/chatkit-types");
|
|
11140
11262
|
function PetBridge({ pet, state }) {
|
|
11141
11263
|
const parentMessenger = useParentMessenger();
|
|
11142
11264
|
const sendEvent = parentMessenger?.sendEvent;
|
|
11143
|
-
const options =
|
|
11144
|
-
|
|
11265
|
+
const options = React38.useMemo(() => (0, import_chatkit_types9.normalizePetOptions)(pet), [pet]);
|
|
11266
|
+
React38.useEffect(() => {
|
|
11145
11267
|
if (!sendEvent) {
|
|
11146
11268
|
return;
|
|
11147
11269
|
}
|
|
11148
11270
|
sendEvent("pet_options_change", { pet: pet ?? null });
|
|
11149
11271
|
}, [sendEvent, pet]);
|
|
11150
|
-
|
|
11272
|
+
React38.useEffect(() => {
|
|
11151
11273
|
if (!sendEvent || !options) {
|
|
11152
11274
|
return;
|
|
11153
11275
|
}
|
|
@@ -11157,15 +11279,15 @@ function PetBridge({ pet, state }) {
|
|
|
11157
11279
|
}
|
|
11158
11280
|
|
|
11159
11281
|
// src/components/settings/SettingsSheet.tsx
|
|
11160
|
-
var
|
|
11161
|
-
var
|
|
11282
|
+
var React45 = __toESM(require("react"), 1);
|
|
11283
|
+
var import_lucide_react25 = require("lucide-react");
|
|
11162
11284
|
|
|
11163
11285
|
// src/components/ui/input.tsx
|
|
11164
|
-
var
|
|
11165
|
-
var
|
|
11166
|
-
var Input =
|
|
11286
|
+
var React39 = __toESM(require("react"), 1);
|
|
11287
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
11288
|
+
var Input = React39.forwardRef(
|
|
11167
11289
|
({ className, type, ...props }, ref) => {
|
|
11168
|
-
return /* @__PURE__ */ (0,
|
|
11290
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
11169
11291
|
"input",
|
|
11170
11292
|
{
|
|
11171
11293
|
ref,
|
|
@@ -11182,20 +11304,20 @@ var Input = React38.forwardRef(
|
|
|
11182
11304
|
Input.displayName = "Input";
|
|
11183
11305
|
|
|
11184
11306
|
// src/components/ui/select.tsx
|
|
11185
|
-
var
|
|
11307
|
+
var React40 = require("react");
|
|
11186
11308
|
var import_radix_ui2 = require("radix-ui");
|
|
11187
|
-
var
|
|
11188
|
-
var
|
|
11309
|
+
var import_lucide_react24 = require("lucide-react");
|
|
11310
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
11189
11311
|
function Select({
|
|
11190
11312
|
...props
|
|
11191
11313
|
}) {
|
|
11192
|
-
return /* @__PURE__ */ (0,
|
|
11314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_radix_ui2.Select.Root, { "data-slot": "select", ...props });
|
|
11193
11315
|
}
|
|
11194
11316
|
function SelectGroup({
|
|
11195
11317
|
className,
|
|
11196
11318
|
...props
|
|
11197
11319
|
}) {
|
|
11198
|
-
return /* @__PURE__ */ (0,
|
|
11320
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
11199
11321
|
import_radix_ui2.Select.Group,
|
|
11200
11322
|
{
|
|
11201
11323
|
"data-slot": "select-group",
|
|
@@ -11207,7 +11329,7 @@ function SelectGroup({
|
|
|
11207
11329
|
function SelectValue({
|
|
11208
11330
|
...props
|
|
11209
11331
|
}) {
|
|
11210
|
-
return /* @__PURE__ */ (0,
|
|
11332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_radix_ui2.Select.Value, { "data-slot": "select-value", ...props });
|
|
11211
11333
|
}
|
|
11212
11334
|
function SelectTrigger({
|
|
11213
11335
|
className,
|
|
@@ -11215,7 +11337,7 @@ function SelectTrigger({
|
|
|
11215
11337
|
children,
|
|
11216
11338
|
...props
|
|
11217
11339
|
}) {
|
|
11218
|
-
return /* @__PURE__ */ (0,
|
|
11340
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
11219
11341
|
import_radix_ui2.Select.Trigger,
|
|
11220
11342
|
{
|
|
11221
11343
|
"data-slot": "select-trigger",
|
|
@@ -11227,7 +11349,7 @@ function SelectTrigger({
|
|
|
11227
11349
|
...props,
|
|
11228
11350
|
children: [
|
|
11229
11351
|
children,
|
|
11230
|
-
/* @__PURE__ */ (0,
|
|
11352
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_radix_ui2.Select.Icon, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react24.ChevronDownIcon, { className: "pointer-events-none size-4 text-muted-foreground" }) })
|
|
11231
11353
|
]
|
|
11232
11354
|
}
|
|
11233
11355
|
);
|
|
@@ -11239,7 +11361,7 @@ function SelectContent({
|
|
|
11239
11361
|
align = "center",
|
|
11240
11362
|
...props
|
|
11241
11363
|
}) {
|
|
11242
|
-
return /* @__PURE__ */ (0,
|
|
11364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_radix_ui2.Select.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
11243
11365
|
import_radix_ui2.Select.Content,
|
|
11244
11366
|
{
|
|
11245
11367
|
"data-slot": "select-content",
|
|
@@ -11249,8 +11371,8 @@ function SelectContent({
|
|
|
11249
11371
|
align,
|
|
11250
11372
|
...props,
|
|
11251
11373
|
children: [
|
|
11252
|
-
/* @__PURE__ */ (0,
|
|
11253
|
-
/* @__PURE__ */ (0,
|
|
11374
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SelectScrollUpButton, {}),
|
|
11375
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
11254
11376
|
import_radix_ui2.Select.Viewport,
|
|
11255
11377
|
{
|
|
11256
11378
|
"data-position": position,
|
|
@@ -11261,7 +11383,7 @@ function SelectContent({
|
|
|
11261
11383
|
children
|
|
11262
11384
|
}
|
|
11263
11385
|
),
|
|
11264
|
-
/* @__PURE__ */ (0,
|
|
11386
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SelectScrollDownButton, {})
|
|
11265
11387
|
]
|
|
11266
11388
|
}
|
|
11267
11389
|
) });
|
|
@@ -11271,7 +11393,7 @@ function SelectItem({
|
|
|
11271
11393
|
children,
|
|
11272
11394
|
...props
|
|
11273
11395
|
}) {
|
|
11274
|
-
return /* @__PURE__ */ (0,
|
|
11396
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
11275
11397
|
import_radix_ui2.Select.Item,
|
|
11276
11398
|
{
|
|
11277
11399
|
"data-slot": "select-item",
|
|
@@ -11281,8 +11403,8 @@ function SelectItem({
|
|
|
11281
11403
|
),
|
|
11282
11404
|
...props,
|
|
11283
11405
|
children: [
|
|
11284
|
-
/* @__PURE__ */ (0,
|
|
11285
|
-
/* @__PURE__ */ (0,
|
|
11406
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_radix_ui2.Select.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react24.CheckIcon, { className: "pointer-events-none" }) }) }),
|
|
11407
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_radix_ui2.Select.ItemText, { children })
|
|
11286
11408
|
]
|
|
11287
11409
|
}
|
|
11288
11410
|
);
|
|
@@ -11291,7 +11413,7 @@ function SelectScrollUpButton({
|
|
|
11291
11413
|
className,
|
|
11292
11414
|
...props
|
|
11293
11415
|
}) {
|
|
11294
|
-
return /* @__PURE__ */ (0,
|
|
11416
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
11295
11417
|
import_radix_ui2.Select.ScrollUpButton,
|
|
11296
11418
|
{
|
|
11297
11419
|
"data-slot": "select-scroll-up-button",
|
|
@@ -11300,8 +11422,8 @@ function SelectScrollUpButton({
|
|
|
11300
11422
|
className
|
|
11301
11423
|
),
|
|
11302
11424
|
...props,
|
|
11303
|
-
children: /* @__PURE__ */ (0,
|
|
11304
|
-
|
|
11425
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
11426
|
+
import_lucide_react24.ChevronUpIcon,
|
|
11305
11427
|
{}
|
|
11306
11428
|
)
|
|
11307
11429
|
}
|
|
@@ -11311,7 +11433,7 @@ function SelectScrollDownButton({
|
|
|
11311
11433
|
className,
|
|
11312
11434
|
...props
|
|
11313
11435
|
}) {
|
|
11314
|
-
return /* @__PURE__ */ (0,
|
|
11436
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
11315
11437
|
import_radix_ui2.Select.ScrollDownButton,
|
|
11316
11438
|
{
|
|
11317
11439
|
"data-slot": "select-scroll-down-button",
|
|
@@ -11320,8 +11442,8 @@ function SelectScrollDownButton({
|
|
|
11320
11442
|
className
|
|
11321
11443
|
),
|
|
11322
11444
|
...props,
|
|
11323
|
-
children: /* @__PURE__ */ (0,
|
|
11324
|
-
|
|
11445
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
11446
|
+
import_lucide_react24.ChevronDownIcon,
|
|
11325
11447
|
{}
|
|
11326
11448
|
)
|
|
11327
11449
|
}
|
|
@@ -11329,9 +11451,9 @@ function SelectScrollDownButton({
|
|
|
11329
11451
|
}
|
|
11330
11452
|
|
|
11331
11453
|
// src/components/ui/slider.tsx
|
|
11332
|
-
var
|
|
11454
|
+
var React41 = __toESM(require("react"), 1);
|
|
11333
11455
|
var import_radix_ui3 = require("radix-ui");
|
|
11334
|
-
var
|
|
11456
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
11335
11457
|
function Slider({
|
|
11336
11458
|
className,
|
|
11337
11459
|
defaultValue,
|
|
@@ -11340,11 +11462,11 @@ function Slider({
|
|
|
11340
11462
|
max = 100,
|
|
11341
11463
|
...props
|
|
11342
11464
|
}) {
|
|
11343
|
-
const _values =
|
|
11465
|
+
const _values = React41.useMemo(
|
|
11344
11466
|
() => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
|
|
11345
11467
|
[value, defaultValue, min, max]
|
|
11346
11468
|
);
|
|
11347
|
-
return /* @__PURE__ */ (0,
|
|
11469
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
11348
11470
|
import_radix_ui3.Slider.Root,
|
|
11349
11471
|
{
|
|
11350
11472
|
"data-slot": "slider",
|
|
@@ -11358,12 +11480,12 @@ function Slider({
|
|
|
11358
11480
|
),
|
|
11359
11481
|
...props,
|
|
11360
11482
|
children: [
|
|
11361
|
-
/* @__PURE__ */ (0,
|
|
11483
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
11362
11484
|
import_radix_ui3.Slider.Track,
|
|
11363
11485
|
{
|
|
11364
11486
|
"data-slot": "slider-track",
|
|
11365
11487
|
className: "relative grow overflow-hidden rounded-full bg-muted data-horizontal:h-1 data-horizontal:w-full data-vertical:h-full data-vertical:w-1",
|
|
11366
|
-
children: /* @__PURE__ */ (0,
|
|
11488
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
11367
11489
|
import_radix_ui3.Slider.Range,
|
|
11368
11490
|
{
|
|
11369
11491
|
"data-slot": "slider-range",
|
|
@@ -11372,7 +11494,7 @@ function Slider({
|
|
|
11372
11494
|
)
|
|
11373
11495
|
}
|
|
11374
11496
|
),
|
|
11375
|
-
Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */ (0,
|
|
11497
|
+
Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
11376
11498
|
import_radix_ui3.Slider.Thumb,
|
|
11377
11499
|
{
|
|
11378
11500
|
"data-slot": "slider-thumb",
|
|
@@ -11386,15 +11508,15 @@ function Slider({
|
|
|
11386
11508
|
}
|
|
11387
11509
|
|
|
11388
11510
|
// src/components/ui/toggle-group.tsx
|
|
11389
|
-
var
|
|
11511
|
+
var React43 = __toESM(require("react"), 1);
|
|
11390
11512
|
var import_class_variance_authority3 = require("class-variance-authority");
|
|
11391
11513
|
var import_radix_ui5 = require("radix-ui");
|
|
11392
11514
|
|
|
11393
11515
|
// src/components/ui/toggle.tsx
|
|
11394
|
-
var
|
|
11516
|
+
var React42 = require("react");
|
|
11395
11517
|
var import_class_variance_authority2 = require("class-variance-authority");
|
|
11396
11518
|
var import_radix_ui4 = require("radix-ui");
|
|
11397
|
-
var
|
|
11519
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
11398
11520
|
var toggleVariants = (0, import_class_variance_authority2.cva)(
|
|
11399
11521
|
"group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
11400
11522
|
{
|
|
@@ -11417,8 +11539,8 @@ var toggleVariants = (0, import_class_variance_authority2.cva)(
|
|
|
11417
11539
|
);
|
|
11418
11540
|
|
|
11419
11541
|
// src/components/ui/toggle-group.tsx
|
|
11420
|
-
var
|
|
11421
|
-
var ToggleGroupContext =
|
|
11542
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
11543
|
+
var ToggleGroupContext = React43.createContext({
|
|
11422
11544
|
size: "default",
|
|
11423
11545
|
variant: "default",
|
|
11424
11546
|
spacing: 0,
|
|
@@ -11433,7 +11555,7 @@ function ToggleGroup({
|
|
|
11433
11555
|
children,
|
|
11434
11556
|
...props
|
|
11435
11557
|
}) {
|
|
11436
|
-
return /* @__PURE__ */ (0,
|
|
11558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
11437
11559
|
import_radix_ui5.ToggleGroup.Root,
|
|
11438
11560
|
{
|
|
11439
11561
|
"data-slot": "toggle-group",
|
|
@@ -11447,7 +11569,7 @@ function ToggleGroup({
|
|
|
11447
11569
|
className
|
|
11448
11570
|
),
|
|
11449
11571
|
...props,
|
|
11450
|
-
children: /* @__PURE__ */ (0,
|
|
11572
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
11451
11573
|
ToggleGroupContext.Provider,
|
|
11452
11574
|
{
|
|
11453
11575
|
value: { variant, size: size2, spacing, orientation },
|
|
@@ -11464,8 +11586,8 @@ function ToggleGroupItem({
|
|
|
11464
11586
|
size: size2 = "default",
|
|
11465
11587
|
...props
|
|
11466
11588
|
}) {
|
|
11467
|
-
const context =
|
|
11468
|
-
return /* @__PURE__ */ (0,
|
|
11589
|
+
const context = React43.useContext(ToggleGroupContext);
|
|
11590
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
11469
11591
|
import_radix_ui5.ToggleGroup.Item,
|
|
11470
11592
|
{
|
|
11471
11593
|
"data-slot": "toggle-group-item",
|
|
@@ -11487,7 +11609,7 @@ function ToggleGroupItem({
|
|
|
11487
11609
|
}
|
|
11488
11610
|
|
|
11489
11611
|
// src/components/pet/pet-local-settings.ts
|
|
11490
|
-
var
|
|
11612
|
+
var import_chatkit_types10 = require("@xpert-ai/chatkit-types");
|
|
11491
11613
|
|
|
11492
11614
|
// src/components/pet/builtinPets.ts
|
|
11493
11615
|
var PUBLIC_PETS = [
|
|
@@ -11661,7 +11783,7 @@ function derivePetLocalSettings(pet) {
|
|
|
11661
11783
|
if (!pet) {
|
|
11662
11784
|
return { ...DEFAULT_PET_LOCAL_SETTINGS };
|
|
11663
11785
|
}
|
|
11664
|
-
const normalized = (0,
|
|
11786
|
+
const normalized = (0, import_chatkit_types10.normalizePetOptions)(pet ?? null);
|
|
11665
11787
|
if (!normalized) {
|
|
11666
11788
|
return { ...DEFAULT_PET_LOCAL_SETTINGS };
|
|
11667
11789
|
}
|
|
@@ -11691,25 +11813,25 @@ function derivePetLocalSettings(pet) {
|
|
|
11691
11813
|
return base2;
|
|
11692
11814
|
}
|
|
11693
11815
|
function isPetEnabled(pet) {
|
|
11694
|
-
return Boolean((0,
|
|
11816
|
+
return Boolean((0, import_chatkit_types10.normalizePetOptions)(pet ?? null));
|
|
11695
11817
|
}
|
|
11696
11818
|
|
|
11697
11819
|
// src/components/pet/PetPreview.tsx
|
|
11698
|
-
var
|
|
11820
|
+
var React44 = require("react");
|
|
11699
11821
|
|
|
11700
11822
|
// src/components/pet/petSpriteAtlas.ts
|
|
11701
|
-
var
|
|
11823
|
+
var import_chatkit_types11 = require("@xpert-ai/chatkit-types");
|
|
11702
11824
|
|
|
11703
11825
|
// src/components/pet/PetPreview.tsx
|
|
11704
|
-
var
|
|
11826
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
11705
11827
|
function escapeCssUrl(value) {
|
|
11706
11828
|
return value.replace(/["\\]/g, "\\$&");
|
|
11707
11829
|
}
|
|
11708
11830
|
function PetPreview({ src, label, className }) {
|
|
11709
11831
|
const scale = 0.13;
|
|
11710
|
-
const width =
|
|
11711
|
-
const height =
|
|
11712
|
-
return /* @__PURE__ */ (0,
|
|
11832
|
+
const width = import_chatkit_types11.petSpriteAtlas.cellWidth;
|
|
11833
|
+
const height = import_chatkit_types11.petSpriteAtlas.cellHeight;
|
|
11834
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
11713
11835
|
"span",
|
|
11714
11836
|
{
|
|
11715
11837
|
className: cn(
|
|
@@ -11718,7 +11840,7 @@ function PetPreview({ src, label, className }) {
|
|
|
11718
11840
|
),
|
|
11719
11841
|
"aria-hidden": "true",
|
|
11720
11842
|
title: label,
|
|
11721
|
-
children: /* @__PURE__ */ (0,
|
|
11843
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
11722
11844
|
"span",
|
|
11723
11845
|
{
|
|
11724
11846
|
className: "absolute left-1/2 top-1/2 block",
|
|
@@ -11729,7 +11851,7 @@ function PetPreview({ src, label, className }) {
|
|
|
11729
11851
|
transformOrigin: "center",
|
|
11730
11852
|
backgroundImage: `url("${escapeCssUrl(src)}")`,
|
|
11731
11853
|
backgroundRepeat: "no-repeat",
|
|
11732
|
-
backgroundSize: `${
|
|
11854
|
+
backgroundSize: `${import_chatkit_types11.petSpriteAtlas.columns * width}px ${import_chatkit_types11.petSpriteAtlas.rows * height}px`,
|
|
11733
11855
|
backgroundPosition: "0px 0px",
|
|
11734
11856
|
imageRendering: "auto"
|
|
11735
11857
|
}
|
|
@@ -11740,7 +11862,7 @@ function PetPreview({ src, label, className }) {
|
|
|
11740
11862
|
}
|
|
11741
11863
|
|
|
11742
11864
|
// src/components/settings/SettingsSheet.tsx
|
|
11743
|
-
var
|
|
11865
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
11744
11866
|
var CHARACTER_TYPES2 = [
|
|
11745
11867
|
"builtin",
|
|
11746
11868
|
"atlas"
|
|
@@ -11756,13 +11878,13 @@ function SettingsSheet({
|
|
|
11756
11878
|
onSave
|
|
11757
11879
|
}) {
|
|
11758
11880
|
const { t } = useChatkitTranslation();
|
|
11759
|
-
const [draft, setDraft] =
|
|
11760
|
-
|
|
11881
|
+
const [draft, setDraft] = React45.useState(settings);
|
|
11882
|
+
React45.useEffect(() => {
|
|
11761
11883
|
if (open) {
|
|
11762
11884
|
setDraft(petRequired ? { ...settings, enabled: true } : settings);
|
|
11763
11885
|
}
|
|
11764
11886
|
}, [open, petRequired, settings]);
|
|
11765
|
-
const updateDraft =
|
|
11887
|
+
const updateDraft = React45.useCallback(
|
|
11766
11888
|
(patch) => {
|
|
11767
11889
|
setDraft((previous) => ({ ...previous, ...patch }));
|
|
11768
11890
|
},
|
|
@@ -11780,23 +11902,23 @@ function SettingsSheet({
|
|
|
11780
11902
|
defaultValue: selectedBuiltinPet.label
|
|
11781
11903
|
}
|
|
11782
11904
|
);
|
|
11783
|
-
return /* @__PURE__ */ (0,
|
|
11784
|
-
/* @__PURE__ */ (0,
|
|
11785
|
-
/* @__PURE__ */ (0,
|
|
11786
|
-
/* @__PURE__ */ (0,
|
|
11905
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Sheet, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(SheetContent, { side: "right", className: "w-[min(92vw,26rem)] overflow-y-auto", children: [
|
|
11906
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SheetHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
11907
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "flex h-8 w-8 items-center justify-center rounded-md bg-primary/10 text-primary", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react25.Settings, { size: 16 }) }),
|
|
11908
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SheetTitle, { children: t("settings.title") })
|
|
11787
11909
|
] }) }),
|
|
11788
|
-
/* @__PURE__ */ (0,
|
|
11789
|
-
/* @__PURE__ */ (0,
|
|
11790
|
-
/* @__PURE__ */ (0,
|
|
11791
|
-
/* @__PURE__ */ (0,
|
|
11792
|
-
/* @__PURE__ */ (0,
|
|
11910
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("form", { className: "mt-6 space-y-5", onSubmit: handleSubmit, children: [
|
|
11911
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("section", { className: "space-y-5", children: [
|
|
11912
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
11913
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "flex h-7 w-7 items-center justify-center rounded-md bg-muted text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react25.PawPrint, { size: 15 }) }),
|
|
11914
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("h3", { className: "text-sm font-semibold", children: t("pet.settings.title") })
|
|
11793
11915
|
] }),
|
|
11794
|
-
/* @__PURE__ */ (0,
|
|
11795
|
-
/* @__PURE__ */ (0,
|
|
11796
|
-
/* @__PURE__ */ (0,
|
|
11797
|
-
petRequired && /* @__PURE__ */ (0,
|
|
11916
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("label", { className: "flex items-center justify-between gap-4 rounded-md border border-border px-3 py-2", children: [
|
|
11917
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("span", { className: "min-w-0", children: [
|
|
11918
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "block text-sm font-medium", children: t("pet.settings.enabled") }),
|
|
11919
|
+
petRequired && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "mt-0.5 block text-xs text-muted-foreground", children: t("pet.settings.requiredHint") })
|
|
11798
11920
|
] }),
|
|
11799
|
-
/* @__PURE__ */ (0,
|
|
11921
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
11800
11922
|
"button",
|
|
11801
11923
|
{
|
|
11802
11924
|
type: "button",
|
|
@@ -11809,7 +11931,7 @@ function SettingsSheet({
|
|
|
11809
11931
|
draft.enabled ? "bg-primary" : "bg-muted-foreground/20",
|
|
11810
11932
|
petRequired ? "cursor-not-allowed opacity-70" : ""
|
|
11811
11933
|
].join(" "),
|
|
11812
|
-
children: /* @__PURE__ */ (0,
|
|
11934
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
11813
11935
|
"span",
|
|
11814
11936
|
{
|
|
11815
11937
|
className: [
|
|
@@ -11822,9 +11944,9 @@ function SettingsSheet({
|
|
|
11822
11944
|
)
|
|
11823
11945
|
] })
|
|
11824
11946
|
] }),
|
|
11825
|
-
/* @__PURE__ */ (0,
|
|
11826
|
-
/* @__PURE__ */ (0,
|
|
11827
|
-
/* @__PURE__ */ (0,
|
|
11947
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "space-y-2", children: [
|
|
11948
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { id: "chatkit-pet-type-label", className: "text-sm font-medium", children: t("pet.settings.characterType") }),
|
|
11949
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
11828
11950
|
ToggleGroup,
|
|
11829
11951
|
{
|
|
11830
11952
|
id: "chatkit-pet-type",
|
|
@@ -11839,7 +11961,7 @@ function SettingsSheet({
|
|
|
11839
11961
|
variant: "outline",
|
|
11840
11962
|
spacing: 2,
|
|
11841
11963
|
className: "!w-full",
|
|
11842
|
-
children: CHARACTER_TYPES2.map((type) => /* @__PURE__ */ (0,
|
|
11964
|
+
children: CHARACTER_TYPES2.map((type) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
11843
11965
|
ToggleGroupItem,
|
|
11844
11966
|
{
|
|
11845
11967
|
value: type,
|
|
@@ -11851,8 +11973,8 @@ function SettingsSheet({
|
|
|
11851
11973
|
}
|
|
11852
11974
|
)
|
|
11853
11975
|
] }),
|
|
11854
|
-
draft.characterType === "builtin" && /* @__PURE__ */ (0,
|
|
11855
|
-
/* @__PURE__ */ (0,
|
|
11976
|
+
draft.characterType === "builtin" && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "space-y-2", children: [
|
|
11977
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
11856
11978
|
"label",
|
|
11857
11979
|
{
|
|
11858
11980
|
htmlFor: "chatkit-pet-builtin",
|
|
@@ -11860,7 +11982,7 @@ function SettingsSheet({
|
|
|
11860
11982
|
children: t("pet.settings.builtin")
|
|
11861
11983
|
}
|
|
11862
11984
|
),
|
|
11863
|
-
/* @__PURE__ */ (0,
|
|
11985
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
11864
11986
|
Select,
|
|
11865
11987
|
{
|
|
11866
11988
|
value: selectedBuiltinPet.id,
|
|
@@ -11871,26 +11993,26 @@ function SettingsSheet({
|
|
|
11871
11993
|
}
|
|
11872
11994
|
},
|
|
11873
11995
|
children: [
|
|
11874
|
-
/* @__PURE__ */ (0,
|
|
11996
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
11875
11997
|
SelectTrigger,
|
|
11876
11998
|
{
|
|
11877
11999
|
id: "chatkit-pet-builtin",
|
|
11878
12000
|
className: "min-h-12 w-full px-3 py-2",
|
|
11879
|
-
children: /* @__PURE__ */ (0,
|
|
12001
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SelectValue, { placeholder: selectedBuiltinPetLabel })
|
|
11880
12002
|
}
|
|
11881
12003
|
),
|
|
11882
|
-
/* @__PURE__ */ (0,
|
|
12004
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SelectContent, { className: "w-[var(--radix-select-trigger-width)]", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SelectGroup, { children: INCLUDED_PET_OPTIONS.map((pet) => {
|
|
11883
12005
|
const label = t(`pet.settings.builtins.${pet.id}`, {
|
|
11884
12006
|
defaultValue: pet.label
|
|
11885
12007
|
});
|
|
11886
|
-
return /* @__PURE__ */ (0,
|
|
12008
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
11887
12009
|
SelectItem,
|
|
11888
12010
|
{
|
|
11889
12011
|
value: pet.id,
|
|
11890
12012
|
className: "min-h-10 py-1.5 pl-2 pr-8",
|
|
11891
|
-
children: /* @__PURE__ */ (0,
|
|
11892
|
-
/* @__PURE__ */ (0,
|
|
11893
|
-
/* @__PURE__ */ (0,
|
|
12013
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("span", { className: "flex min-w-0 items-center gap-2", children: [
|
|
12014
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(PetPreview, { src: pet.previewSrc, label }),
|
|
12015
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "min-w-0 truncate", children: label })
|
|
11894
12016
|
] })
|
|
11895
12017
|
},
|
|
11896
12018
|
pet.id
|
|
@@ -11900,8 +12022,8 @@ function SettingsSheet({
|
|
|
11900
12022
|
}
|
|
11901
12023
|
)
|
|
11902
12024
|
] }),
|
|
11903
|
-
draft.characterType === "atlas" && /* @__PURE__ */ (0,
|
|
11904
|
-
/* @__PURE__ */ (0,
|
|
12025
|
+
draft.characterType === "atlas" && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "space-y-2", children: [
|
|
12026
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
11905
12027
|
"label",
|
|
11906
12028
|
{
|
|
11907
12029
|
className: "text-sm font-medium",
|
|
@@ -11909,7 +12031,7 @@ function SettingsSheet({
|
|
|
11909
12031
|
children: t("pet.settings.atlasUrl")
|
|
11910
12032
|
}
|
|
11911
12033
|
),
|
|
11912
|
-
/* @__PURE__ */ (0,
|
|
12034
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
11913
12035
|
Input,
|
|
11914
12036
|
{
|
|
11915
12037
|
id: "chatkit-pet-atlas",
|
|
@@ -11919,15 +12041,15 @@ function SettingsSheet({
|
|
|
11919
12041
|
}
|
|
11920
12042
|
)
|
|
11921
12043
|
] }),
|
|
11922
|
-
/* @__PURE__ */ (0,
|
|
11923
|
-
/* @__PURE__ */ (0,
|
|
11924
|
-
/* @__PURE__ */ (0,
|
|
11925
|
-
/* @__PURE__ */ (0,
|
|
12044
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "space-y-2", children: [
|
|
12045
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
12046
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("label", { className: "text-sm font-medium", htmlFor: "chatkit-pet-scale", children: t("pet.settings.scale") }),
|
|
12047
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("span", { className: "text-xs tabular-nums text-muted-foreground", children: [
|
|
11926
12048
|
draft.scale.toFixed(2),
|
|
11927
12049
|
"x"
|
|
11928
12050
|
] })
|
|
11929
12051
|
] }),
|
|
11930
|
-
/* @__PURE__ */ (0,
|
|
12052
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
11931
12053
|
Slider,
|
|
11932
12054
|
{
|
|
11933
12055
|
id: "chatkit-pet-scale",
|
|
@@ -11941,8 +12063,8 @@ function SettingsSheet({
|
|
|
11941
12063
|
}
|
|
11942
12064
|
)
|
|
11943
12065
|
] }),
|
|
11944
|
-
/* @__PURE__ */ (0,
|
|
11945
|
-
/* @__PURE__ */ (0,
|
|
12066
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("label", { className: "flex items-center gap-2 text-sm", children: [
|
|
12067
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
11946
12068
|
"input",
|
|
11947
12069
|
{
|
|
11948
12070
|
type: "checkbox",
|
|
@@ -11953,8 +12075,8 @@ function SettingsSheet({
|
|
|
11953
12075
|
),
|
|
11954
12076
|
t("pet.settings.draggable")
|
|
11955
12077
|
] }),
|
|
11956
|
-
/* @__PURE__ */ (0,
|
|
11957
|
-
/* @__PURE__ */ (0,
|
|
12078
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("label", { className: "flex items-center gap-2 text-sm", children: [
|
|
12079
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
11958
12080
|
"input",
|
|
11959
12081
|
{
|
|
11960
12082
|
type: "checkbox",
|
|
@@ -11965,8 +12087,8 @@ function SettingsSheet({
|
|
|
11965
12087
|
),
|
|
11966
12088
|
t("pet.settings.persistPosition")
|
|
11967
12089
|
] }),
|
|
11968
|
-
/* @__PURE__ */ (0,
|
|
11969
|
-
/* @__PURE__ */ (0,
|
|
12090
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex justify-end gap-2 pt-2", children: [
|
|
12091
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
11970
12092
|
Button,
|
|
11971
12093
|
{
|
|
11972
12094
|
type: "button",
|
|
@@ -11975,7 +12097,7 @@ function SettingsSheet({
|
|
|
11975
12097
|
children: t("pet.settings.cancel")
|
|
11976
12098
|
}
|
|
11977
12099
|
),
|
|
11978
|
-
/* @__PURE__ */ (0,
|
|
12100
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Button, { type: "submit", children: t("pet.settings.save") })
|
|
11979
12101
|
] })
|
|
11980
12102
|
] })
|
|
11981
12103
|
] }) });
|
|
@@ -12481,7 +12603,7 @@ function findDomPointForComposerOffset(root, offset) {
|
|
|
12481
12603
|
}
|
|
12482
12604
|
|
|
12483
12605
|
// src/components/chat.tsx
|
|
12484
|
-
var
|
|
12606
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
12485
12607
|
var import_meta2 = {};
|
|
12486
12608
|
var defaultApiUrl2 = import_meta2.env.VITE_XPERTAI_API_URL;
|
|
12487
12609
|
var COMPOSER_INPUT_MAX_HEIGHT = 128;
|
|
@@ -12614,8 +12736,8 @@ function ReferenceChip({
|
|
|
12614
12736
|
}) {
|
|
12615
12737
|
const metaLine = getReferenceMetaLine(reference);
|
|
12616
12738
|
const isComposer = variant === "composer";
|
|
12617
|
-
const Icon = reference.type === "quote" ?
|
|
12618
|
-
return /* @__PURE__ */ (0,
|
|
12739
|
+
const Icon = reference.type === "quote" ? import_lucide_react26.Quote : reference.type === "image" ? import_lucide_react26.ImageIcon : import_lucide_react26.FileText;
|
|
12740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
12619
12741
|
"div",
|
|
12620
12742
|
{
|
|
12621
12743
|
className: cn(
|
|
@@ -12624,7 +12746,7 @@ function ReferenceChip({
|
|
|
12624
12746
|
),
|
|
12625
12747
|
title: getReferenceTitle(reference),
|
|
12626
12748
|
children: [
|
|
12627
|
-
/* @__PURE__ */ (0,
|
|
12749
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
12628
12750
|
Icon,
|
|
12629
12751
|
{
|
|
12630
12752
|
size: isComposer ? 14 : 12,
|
|
@@ -12634,8 +12756,8 @@ function ReferenceChip({
|
|
|
12634
12756
|
)
|
|
12635
12757
|
}
|
|
12636
12758
|
),
|
|
12637
|
-
/* @__PURE__ */ (0,
|
|
12638
|
-
/* @__PURE__ */ (0,
|
|
12759
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
12760
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
12639
12761
|
"div",
|
|
12640
12762
|
{
|
|
12641
12763
|
className: cn(
|
|
@@ -12645,7 +12767,7 @@ function ReferenceChip({
|
|
|
12645
12767
|
children: getReferenceLabel(reference)
|
|
12646
12768
|
}
|
|
12647
12769
|
),
|
|
12648
|
-
metaLine && /* @__PURE__ */ (0,
|
|
12770
|
+
metaLine && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
12649
12771
|
"div",
|
|
12650
12772
|
{
|
|
12651
12773
|
className: cn(
|
|
@@ -12656,7 +12778,7 @@ function ReferenceChip({
|
|
|
12656
12778
|
}
|
|
12657
12779
|
)
|
|
12658
12780
|
] }),
|
|
12659
|
-
onRemove && removeLabel && /* @__PURE__ */ (0,
|
|
12781
|
+
onRemove && removeLabel && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
12660
12782
|
"button",
|
|
12661
12783
|
{
|
|
12662
12784
|
type: "button",
|
|
@@ -12667,7 +12789,7 @@ function ReferenceChip({
|
|
|
12667
12789
|
),
|
|
12668
12790
|
title: removeLabel,
|
|
12669
12791
|
"aria-label": removeLabel,
|
|
12670
|
-
children: /* @__PURE__ */ (0,
|
|
12792
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react26.X, { size: 12 })
|
|
12671
12793
|
}
|
|
12672
12794
|
)
|
|
12673
12795
|
]
|
|
@@ -12691,20 +12813,20 @@ function Chat({
|
|
|
12691
12813
|
const { setStream } = useStreamManager();
|
|
12692
12814
|
const stream = useStreamContext();
|
|
12693
12815
|
const { theme } = useTheme();
|
|
12694
|
-
const [isHistoryLoading, setIsHistoryLoading] =
|
|
12695
|
-
const [historyError, setHistoryError] =
|
|
12696
|
-
const [assistantName, setAssistantName] =
|
|
12697
|
-
const [assistantAvatar, setAssistantAvatar] =
|
|
12816
|
+
const [isHistoryLoading, setIsHistoryLoading] = React46.useState(false);
|
|
12817
|
+
const [historyError, setHistoryError] = React46.useState(null);
|
|
12818
|
+
const [assistantName, setAssistantName] = React46.useState(null);
|
|
12819
|
+
const [assistantAvatar, setAssistantAvatar] = React46.useState(null);
|
|
12698
12820
|
const LOADING_DOTS_MIN_DURATION = 800;
|
|
12699
12821
|
const STREAMING_STATUS_REFRESH_MS = 250;
|
|
12700
|
-
const [showLoadingDots, setShowLoadingDots] =
|
|
12701
|
-
const [streamingNow, setStreamingNow] =
|
|
12702
|
-
const loadingStartTimeRef =
|
|
12703
|
-
const lastStreamOutputAtRef =
|
|
12704
|
-
|
|
12822
|
+
const [showLoadingDots, setShowLoadingDots] = React46.useState(false);
|
|
12823
|
+
const [streamingNow, setStreamingNow] = React46.useState(() => Date.now());
|
|
12824
|
+
const loadingStartTimeRef = React46.useRef(null);
|
|
12825
|
+
const lastStreamOutputAtRef = React46.useRef(null);
|
|
12826
|
+
React46.useEffect(() => {
|
|
12705
12827
|
setStream(stream);
|
|
12706
12828
|
}, [setStream, stream]);
|
|
12707
|
-
|
|
12829
|
+
React46.useEffect(() => {
|
|
12708
12830
|
if (stream.isLoading) {
|
|
12709
12831
|
if (!loadingStartTimeRef.current) {
|
|
12710
12832
|
loadingStartTimeRef.current = Date.now();
|
|
@@ -12727,7 +12849,7 @@ function Chat({
|
|
|
12727
12849
|
}
|
|
12728
12850
|
}
|
|
12729
12851
|
}, [stream.isLoading]);
|
|
12730
|
-
|
|
12852
|
+
React46.useEffect(() => {
|
|
12731
12853
|
if (!stream.isLoading) {
|
|
12732
12854
|
lastStreamOutputAtRef.current = null;
|
|
12733
12855
|
setStreamingNow(Date.now());
|
|
@@ -12737,7 +12859,7 @@ function Chat({
|
|
|
12737
12859
|
lastStreamOutputAtRef.current = now;
|
|
12738
12860
|
setStreamingNow(now);
|
|
12739
12861
|
}, [stream.messages, stream.isLoading]);
|
|
12740
|
-
|
|
12862
|
+
React46.useEffect(() => {
|
|
12741
12863
|
if (!stream.isLoading) {
|
|
12742
12864
|
return;
|
|
12743
12865
|
}
|
|
@@ -12746,74 +12868,74 @@ function Chat({
|
|
|
12746
12868
|
}, STREAMING_STATUS_REFRESH_MS);
|
|
12747
12869
|
return () => window.clearInterval(timer);
|
|
12748
12870
|
}, [stream.isLoading]);
|
|
12749
|
-
const [composerParts, setComposerParts] =
|
|
12750
|
-
const [renderedComposerParts, setRenderedComposerParts] =
|
|
12751
|
-
const [composerDomVersion, setComposerDomVersion] =
|
|
12752
|
-
const [selectedTool, setSelectedTool] =
|
|
12871
|
+
const [composerParts, setComposerParts] = React46.useState([]);
|
|
12872
|
+
const [renderedComposerParts, setRenderedComposerParts] = React46.useState([]);
|
|
12873
|
+
const [composerDomVersion, setComposerDomVersion] = React46.useState(0);
|
|
12874
|
+
const [selectedTool, setSelectedTool] = React46.useState(
|
|
12753
12875
|
null
|
|
12754
12876
|
);
|
|
12755
|
-
const [planModeEnabled, setPlanModeEnabled] =
|
|
12756
|
-
const [petSettingsOpen, setPetSettingsOpen] =
|
|
12757
|
-
const [petLocalSettings, setPetLocalSettings] =
|
|
12758
|
-
const [runtimeCapabilities, setRuntimeCapabilities] =
|
|
12759
|
-
const [runtimeCapabilitiesReady, setRuntimeCapabilitiesReady] =
|
|
12760
|
-
const [sessionRuntimeCapabilities, setSessionRuntimeCapabilities] =
|
|
12877
|
+
const [planModeEnabled, setPlanModeEnabled] = React46.useState(false);
|
|
12878
|
+
const [petSettingsOpen, setPetSettingsOpen] = React46.useState(false);
|
|
12879
|
+
const [petLocalSettings, setPetLocalSettings] = React46.useState(() => readPetLocalSettings());
|
|
12880
|
+
const [runtimeCapabilities, setRuntimeCapabilities] = React46.useState(null);
|
|
12881
|
+
const [runtimeCapabilitiesReady, setRuntimeCapabilitiesReady] = React46.useState(false);
|
|
12882
|
+
const [sessionRuntimeCapabilities, setSessionRuntimeCapabilities] = React46.useState(
|
|
12761
12883
|
() => createEmptyRuntimeCapabilitiesSelection()
|
|
12762
12884
|
);
|
|
12763
|
-
const [runRuntimeCapabilities, setRunRuntimeCapabilities] =
|
|
12885
|
+
const [runRuntimeCapabilities, setRunRuntimeCapabilities] = React46.useState(
|
|
12764
12886
|
() => createEmptyRuntimeCapabilitiesSelection()
|
|
12765
12887
|
);
|
|
12766
|
-
const [runtimeCapabilityPalette, setRuntimeCapabilityPalette] =
|
|
12767
|
-
const [attachments, setAttachments] =
|
|
12768
|
-
const [references, setReferences] =
|
|
12769
|
-
const [isUploadingReferenceImages, setIsUploadingReferenceImages] =
|
|
12770
|
-
const [quoteSelection, setQuoteSelection] =
|
|
12771
|
-
const [isAtBottom, setIsAtBottom] =
|
|
12772
|
-
const [hasUpdatesBelow, setHasUpdatesBelow] =
|
|
12888
|
+
const [runtimeCapabilityPalette, setRuntimeCapabilityPalette] = React46.useState(null);
|
|
12889
|
+
const [attachments, setAttachments] = React46.useState([]);
|
|
12890
|
+
const [references, setReferences] = React46.useState([]);
|
|
12891
|
+
const [isUploadingReferenceImages, setIsUploadingReferenceImages] = React46.useState(false);
|
|
12892
|
+
const [quoteSelection, setQuoteSelection] = React46.useState(null);
|
|
12893
|
+
const [isAtBottom, setIsAtBottom] = React46.useState(true);
|
|
12894
|
+
const [hasUpdatesBelow, setHasUpdatesBelow] = React46.useState(false);
|
|
12773
12895
|
const {
|
|
12774
12896
|
threads,
|
|
12775
12897
|
deleteThread,
|
|
12776
12898
|
refreshThreads,
|
|
12777
12899
|
isLoading: isThreadsLoading
|
|
12778
12900
|
} = useThreads();
|
|
12779
|
-
const viewportRef =
|
|
12780
|
-
const fileInputRef =
|
|
12781
|
-
const composerInputRef =
|
|
12782
|
-
const slashPaletteRef =
|
|
12783
|
-
const slashPaletteOptionRefs =
|
|
12901
|
+
const viewportRef = React46.useRef(null);
|
|
12902
|
+
const fileInputRef = React46.useRef(null);
|
|
12903
|
+
const composerInputRef = React46.useRef(null);
|
|
12904
|
+
const slashPaletteRef = React46.useRef(null);
|
|
12905
|
+
const slashPaletteOptionRefs = React46.useRef(
|
|
12784
12906
|
[]
|
|
12785
12907
|
);
|
|
12786
|
-
const composerPartsRef =
|
|
12787
|
-
const pendingComposerCaretOffsetRef =
|
|
12788
|
-
const shouldAutoScrollRef =
|
|
12789
|
-
const forceFollowRef =
|
|
12790
|
-
const previousMessageCountRef =
|
|
12791
|
-
const previousScrollTopRef =
|
|
12792
|
-
const autoScrollFrameRef =
|
|
12793
|
-
const isPointerDownRef =
|
|
12794
|
-
const lastTouchYRef =
|
|
12795
|
-
const runtimeCapabilityPreferenceLoadRef =
|
|
12908
|
+
const composerPartsRef = React46.useRef([]);
|
|
12909
|
+
const pendingComposerCaretOffsetRef = React46.useRef(null);
|
|
12910
|
+
const shouldAutoScrollRef = React46.useRef(true);
|
|
12911
|
+
const forceFollowRef = React46.useRef(false);
|
|
12912
|
+
const previousMessageCountRef = React46.useRef(0);
|
|
12913
|
+
const previousScrollTopRef = React46.useRef(0);
|
|
12914
|
+
const autoScrollFrameRef = React46.useRef(null);
|
|
12915
|
+
const isPointerDownRef = React46.useRef(false);
|
|
12916
|
+
const lastTouchYRef = React46.useRef(null);
|
|
12917
|
+
const runtimeCapabilityPreferenceLoadRef = React46.useRef(0);
|
|
12796
12918
|
const resolvedTitle = title ?? t("chat.title");
|
|
12797
12919
|
const resolvedPlaceholder = placeholder ?? t("chat.placeholder");
|
|
12798
12920
|
const petRequired = options?.displayMode === "pet";
|
|
12799
|
-
const basePetSettings =
|
|
12921
|
+
const basePetSettings = React46.useMemo(
|
|
12800
12922
|
() => derivePetLocalSettings(options?.pet),
|
|
12801
12923
|
[options?.pet]
|
|
12802
12924
|
);
|
|
12803
|
-
const displayedPetSettings =
|
|
12925
|
+
const displayedPetSettings = React46.useMemo(
|
|
12804
12926
|
() => ({
|
|
12805
12927
|
...petLocalSettings ?? basePetSettings,
|
|
12806
12928
|
...petRequired ? { enabled: true } : {}
|
|
12807
12929
|
}),
|
|
12808
12930
|
[basePetSettings, petLocalSettings, petRequired]
|
|
12809
12931
|
);
|
|
12810
|
-
const effectivePet =
|
|
12932
|
+
const effectivePet = React46.useMemo(() => {
|
|
12811
12933
|
if (petRequired || petLocalSettings) {
|
|
12812
12934
|
return buildPetOptionsFromLocalSettings(displayedPetSettings);
|
|
12813
12935
|
}
|
|
12814
12936
|
return options?.pet ?? null;
|
|
12815
12937
|
}, [displayedPetSettings, options?.pet, petLocalSettings, petRequired]);
|
|
12816
|
-
const savePetLocalSettings =
|
|
12938
|
+
const savePetLocalSettings = React46.useCallback(
|
|
12817
12939
|
(settings) => {
|
|
12818
12940
|
const nextSettings = petRequired ? { ...settings, enabled: true } : settings;
|
|
12819
12941
|
setPetLocalSettings(nextSettings);
|
|
@@ -12821,7 +12943,7 @@ function Chat({
|
|
|
12821
12943
|
},
|
|
12822
12944
|
[petRequired]
|
|
12823
12945
|
);
|
|
12824
|
-
const handlePetCommand =
|
|
12946
|
+
const handlePetCommand = React46.useCallback(
|
|
12825
12947
|
(mode) => {
|
|
12826
12948
|
if (mode === "settings") {
|
|
12827
12949
|
setPetSettingsOpen(true);
|
|
@@ -12843,11 +12965,11 @@ function Chat({
|
|
|
12843
12965
|
[displayedPetSettings, effectivePet, petRequired, savePetLocalSettings]
|
|
12844
12966
|
);
|
|
12845
12967
|
const inputPlaceholder = selectedTool?.placeholderOverride ?? composer?.placeholder ?? resolvedPlaceholder;
|
|
12846
|
-
const messages =
|
|
12968
|
+
const messages = React46.useMemo(
|
|
12847
12969
|
() => stream.messages ?? [],
|
|
12848
12970
|
[stream.messages]
|
|
12849
12971
|
);
|
|
12850
|
-
const draft =
|
|
12972
|
+
const draft = React46.useMemo(
|
|
12851
12973
|
() => getComposerPlainText(composerParts),
|
|
12852
12974
|
[composerParts]
|
|
12853
12975
|
);
|
|
@@ -12859,7 +12981,7 @@ function Chat({
|
|
|
12859
12981
|
isEmpty: isComposerInputEmpty,
|
|
12860
12982
|
isStacked: isComposerStacked
|
|
12861
12983
|
});
|
|
12862
|
-
const pendingFollowUps =
|
|
12984
|
+
const pendingFollowUps = React46.useMemo(
|
|
12863
12985
|
() => [...stream.pendingFollowUps ?? []].sort(
|
|
12864
12986
|
(a, b) => a.createdAt - b.createdAt
|
|
12865
12987
|
),
|
|
@@ -12870,18 +12992,18 @@ function Chat({
|
|
|
12870
12992
|
const hasPendingHITLRequest = Boolean(stream.pendingHITLRequest);
|
|
12871
12993
|
const hasPendingInteractiveRequest = hasPendingRequestUserInput || hasPendingHITLRequest;
|
|
12872
12994
|
const hasPendingTodos = Boolean(stream.todos?.items.length);
|
|
12873
|
-
const runtimeCapabilityOptions =
|
|
12995
|
+
const runtimeCapabilityOptions = React46.useMemo(
|
|
12874
12996
|
() => getRuntimeCapabilityOptions(runtimeCapabilities),
|
|
12875
12997
|
[runtimeCapabilities]
|
|
12876
12998
|
);
|
|
12877
|
-
const effectiveSessionRuntimeCapabilities =
|
|
12999
|
+
const effectiveSessionRuntimeCapabilities = React46.useMemo(
|
|
12878
13000
|
() => runtimeCapabilitiesReady && runtimeCapabilities ? mergeRuntimeCapabilitiesSelections(
|
|
12879
13001
|
runtimeCapabilities,
|
|
12880
13002
|
sessionRuntimeCapabilities
|
|
12881
13003
|
) : null,
|
|
12882
13004
|
[runtimeCapabilities, runtimeCapabilitiesReady, sessionRuntimeCapabilities]
|
|
12883
13005
|
);
|
|
12884
|
-
const runRuntimeCapabilityOptions =
|
|
13006
|
+
const runRuntimeCapabilityOptions = React46.useMemo(
|
|
12885
13007
|
() => runtimeCapabilityOptions.filter(
|
|
12886
13008
|
(option) => isRuntimeCapabilitySelected(
|
|
12887
13009
|
runRuntimeCapabilities,
|
|
@@ -12891,11 +13013,11 @@ function Chat({
|
|
|
12891
13013
|
),
|
|
12892
13014
|
[runRuntimeCapabilities, runtimeCapabilityOptions]
|
|
12893
13015
|
);
|
|
12894
|
-
const composerRuntimeCapabilitySelectionKeys =
|
|
13016
|
+
const composerRuntimeCapabilitySelectionKeys = React46.useMemo(
|
|
12895
13017
|
() => getComposerCapabilitySelectionKeys(composerParts),
|
|
12896
13018
|
[composerParts]
|
|
12897
13019
|
);
|
|
12898
|
-
const detachedRunRuntimeCapabilityOptions =
|
|
13020
|
+
const detachedRunRuntimeCapabilityOptions = React46.useMemo(
|
|
12899
13021
|
() => runRuntimeCapabilityOptions.filter(
|
|
12900
13022
|
(option) => !composerRuntimeCapabilitySelectionKeys.has(
|
|
12901
13023
|
getRuntimeCapabilityOptionKey(option)
|
|
@@ -12903,7 +13025,7 @@ function Chat({
|
|
|
12903
13025
|
),
|
|
12904
13026
|
[composerRuntimeCapabilitySelectionKeys, runRuntimeCapabilityOptions]
|
|
12905
13027
|
);
|
|
12906
|
-
const persistSessionRuntimeCapabilities =
|
|
13028
|
+
const persistSessionRuntimeCapabilities = React46.useCallback(
|
|
12907
13029
|
async (threadId, selection) => {
|
|
12908
13030
|
if (!runtimeCapabilities || !selection) {
|
|
12909
13031
|
return;
|
|
@@ -12928,10 +13050,10 @@ function Chat({
|
|
|
12928
13050
|
},
|
|
12929
13051
|
[runtimeCapabilities, stream.client]
|
|
12930
13052
|
);
|
|
12931
|
-
const clearQuoteSelection =
|
|
13053
|
+
const clearQuoteSelection = React46.useCallback(() => {
|
|
12932
13054
|
setQuoteSelection(null);
|
|
12933
13055
|
}, []);
|
|
12934
|
-
const commitComposerParts =
|
|
13056
|
+
const commitComposerParts = React46.useCallback(
|
|
12935
13057
|
(nextParts, options2) => {
|
|
12936
13058
|
const normalized = normalizeComposerParts(nextParts);
|
|
12937
13059
|
const previous = composerPartsRef.current;
|
|
@@ -12967,7 +13089,7 @@ function Chat({
|
|
|
12967
13089
|
},
|
|
12968
13090
|
[]
|
|
12969
13091
|
);
|
|
12970
|
-
const setComposerText =
|
|
13092
|
+
const setComposerText = React46.useCallback(
|
|
12971
13093
|
(text, caretOffset = text.length) => {
|
|
12972
13094
|
commitComposerParts(createComposerTextParts(text), {
|
|
12973
13095
|
caretOffset,
|
|
@@ -12977,7 +13099,7 @@ function Chat({
|
|
|
12977
13099
|
},
|
|
12978
13100
|
[commitComposerParts]
|
|
12979
13101
|
);
|
|
12980
|
-
const focusComposerAt =
|
|
13102
|
+
const focusComposerAt = React46.useCallback((position) => {
|
|
12981
13103
|
const nextPosition = position ?? getComposerEditingLength(composerPartsRef.current);
|
|
12982
13104
|
pendingComposerCaretOffsetRef.current = nextPosition;
|
|
12983
13105
|
requestAnimationFrame(() => {
|
|
@@ -12989,7 +13111,7 @@ function Chat({
|
|
|
12989
13111
|
});
|
|
12990
13112
|
}, []);
|
|
12991
13113
|
const parentMessenger = useParentMessenger({
|
|
12992
|
-
onSetComposerValue:
|
|
13114
|
+
onSetComposerValue: React46.useCallback(
|
|
12993
13115
|
(payload) => {
|
|
12994
13116
|
if (!payload) {
|
|
12995
13117
|
return;
|
|
@@ -13012,10 +13134,10 @@ function Chat({
|
|
|
13012
13134
|
},
|
|
13013
13135
|
[composer?.tools, setComposerText]
|
|
13014
13136
|
),
|
|
13015
|
-
onFocusComposer:
|
|
13137
|
+
onFocusComposer: React46.useCallback(() => {
|
|
13016
13138
|
composerInputRef.current?.focus();
|
|
13017
13139
|
}, []),
|
|
13018
|
-
onSetPetEnabled:
|
|
13140
|
+
onSetPetEnabled: React46.useCallback(
|
|
13019
13141
|
(enabled) => {
|
|
13020
13142
|
if (petRequired) {
|
|
13021
13143
|
return;
|
|
@@ -13029,10 +13151,10 @@ function Chat({
|
|
|
13029
13151
|
)
|
|
13030
13152
|
});
|
|
13031
13153
|
const canMinimizeToPet = parentMessenger?.isParentAvailable === true && isPetEnabled(effectivePet);
|
|
13032
|
-
const handleMinimizeToPet =
|
|
13154
|
+
const handleMinimizeToPet = React46.useCallback(() => {
|
|
13033
13155
|
parentMessenger?.sendEvent("chat_minimize_change", { minimized: true });
|
|
13034
13156
|
}, [parentMessenger]);
|
|
13035
|
-
const syncQuoteSelection =
|
|
13157
|
+
const syncQuoteSelection = React46.useCallback(() => {
|
|
13036
13158
|
if (typeof window === "undefined") {
|
|
13037
13159
|
clearQuoteSelection();
|
|
13038
13160
|
return;
|
|
@@ -13077,23 +13199,23 @@ function Chat({
|
|
|
13077
13199
|
left
|
|
13078
13200
|
});
|
|
13079
13201
|
}, [clearQuoteSelection]);
|
|
13080
|
-
const cancelPendingAutoScroll =
|
|
13202
|
+
const cancelPendingAutoScroll = React46.useCallback(() => {
|
|
13081
13203
|
if (autoScrollFrameRef.current !== null) {
|
|
13082
13204
|
cancelAnimationFrame(autoScrollFrameRef.current);
|
|
13083
13205
|
autoScrollFrameRef.current = null;
|
|
13084
13206
|
}
|
|
13085
13207
|
}, []);
|
|
13086
|
-
const disableAutoFollow =
|
|
13208
|
+
const disableAutoFollow = React46.useCallback(() => {
|
|
13087
13209
|
forceFollowRef.current = false;
|
|
13088
13210
|
shouldAutoScrollRef.current = false;
|
|
13089
13211
|
cancelPendingAutoScroll();
|
|
13090
13212
|
}, [cancelPendingAutoScroll]);
|
|
13091
|
-
const enableAutoFollow =
|
|
13213
|
+
const enableAutoFollow = React46.useCallback(() => {
|
|
13092
13214
|
forceFollowRef.current = true;
|
|
13093
13215
|
shouldAutoScrollRef.current = true;
|
|
13094
13216
|
setHasUpdatesBelow(false);
|
|
13095
13217
|
}, []);
|
|
13096
|
-
const scrollToBottom =
|
|
13218
|
+
const scrollToBottom = React46.useCallback(
|
|
13097
13219
|
(smooth = false, force = false) => {
|
|
13098
13220
|
if (force) {
|
|
13099
13221
|
enableAutoFollow();
|
|
@@ -13120,7 +13242,7 @@ function Chat({
|
|
|
13120
13242
|
},
|
|
13121
13243
|
[cancelPendingAutoScroll, enableAutoFollow]
|
|
13122
13244
|
);
|
|
13123
|
-
|
|
13245
|
+
React46.useEffect(() => {
|
|
13124
13246
|
const viewport = viewportRef.current;
|
|
13125
13247
|
if (!viewport) return;
|
|
13126
13248
|
previousScrollTopRef.current = viewport.scrollTop;
|
|
@@ -13201,14 +13323,14 @@ function Chat({
|
|
|
13201
13323
|
window.removeEventListener("pointercancel", stopPointerTracking);
|
|
13202
13324
|
};
|
|
13203
13325
|
}, [cancelPendingAutoScroll, disableAutoFollow]);
|
|
13204
|
-
|
|
13326
|
+
React46.useEffect(() => {
|
|
13205
13327
|
shouldAutoScrollRef.current = true;
|
|
13206
13328
|
forceFollowRef.current = false;
|
|
13207
13329
|
previousScrollTopRef.current = 0;
|
|
13208
13330
|
setIsAtBottom(true);
|
|
13209
13331
|
setHasUpdatesBelow(false);
|
|
13210
13332
|
}, [stream.threadId]);
|
|
13211
|
-
|
|
13333
|
+
React46.useEffect(() => {
|
|
13212
13334
|
const messageCountChanged = messages.length !== previousMessageCountRef.current;
|
|
13213
13335
|
previousMessageCountRef.current = messages.length;
|
|
13214
13336
|
if (!shouldAutoScrollRef.current) {
|
|
@@ -13227,7 +13349,7 @@ function Chat({
|
|
|
13227
13349
|
clientSecret: effectiveClientSecret
|
|
13228
13350
|
});
|
|
13229
13351
|
const missingConfig = Boolean(missingConfigKind);
|
|
13230
|
-
const missingConfigShortMessage =
|
|
13352
|
+
const missingConfigShortMessage = React46.useMemo(() => {
|
|
13231
13353
|
switch (missingConfigKind) {
|
|
13232
13354
|
case "apiUrl":
|
|
13233
13355
|
return t("chat.missingApiUrlShort");
|
|
@@ -13239,7 +13361,7 @@ function Chat({
|
|
|
13239
13361
|
return t("chat.missingConfigShort");
|
|
13240
13362
|
}
|
|
13241
13363
|
}, [missingConfigKind, t]);
|
|
13242
|
-
const missingConfigDetailMessage =
|
|
13364
|
+
const missingConfigDetailMessage = React46.useMemo(() => {
|
|
13243
13365
|
switch (missingConfigKind) {
|
|
13244
13366
|
case "apiUrl":
|
|
13245
13367
|
return t("chat.missingApiUrlDetail");
|
|
@@ -13254,7 +13376,7 @@ function Chat({
|
|
|
13254
13376
|
const showMissingConfig = !isClientSecretInitializing && missingConfig;
|
|
13255
13377
|
const hasUploadingFiles = attachments.some((a) => a.status === "uploading");
|
|
13256
13378
|
const isSendDisabled = !trimmedDraft && !hasReferences || hasPendingInteractiveRequest || missingConfig || isHistoryLoading || hasUploadingFiles || isUploadingReferenceImages;
|
|
13257
|
-
const resizeComposerInput =
|
|
13379
|
+
const resizeComposerInput = React46.useCallback(() => {
|
|
13258
13380
|
const input = composerInputRef.current;
|
|
13259
13381
|
if (!input) {
|
|
13260
13382
|
return;
|
|
@@ -13262,7 +13384,7 @@ function Chat({
|
|
|
13262
13384
|
input.style.maxHeight = `${COMPOSER_INPUT_MAX_HEIGHT}px`;
|
|
13263
13385
|
input.style.overflowY = input.scrollHeight > COMPOSER_INPUT_MAX_HEIGHT ? "auto" : "hidden";
|
|
13264
13386
|
}, []);
|
|
13265
|
-
|
|
13387
|
+
React46.useLayoutEffect(() => {
|
|
13266
13388
|
composerPartsRef.current = composerParts;
|
|
13267
13389
|
resizeComposerInput();
|
|
13268
13390
|
const caretOffset = pendingComposerCaretOffsetRef.current;
|
|
@@ -13274,13 +13396,13 @@ function Chat({
|
|
|
13274
13396
|
}
|
|
13275
13397
|
}
|
|
13276
13398
|
}, [composerDomVersion, composerParts, resizeComposerInput]);
|
|
13277
|
-
|
|
13399
|
+
React46.useEffect(() => {
|
|
13278
13400
|
document.addEventListener("selectionchange", syncQuoteSelection);
|
|
13279
13401
|
return () => {
|
|
13280
13402
|
document.removeEventListener("selectionchange", syncQuoteSelection);
|
|
13281
13403
|
};
|
|
13282
13404
|
}, [syncQuoteSelection]);
|
|
13283
|
-
|
|
13405
|
+
React46.useEffect(() => {
|
|
13284
13406
|
const viewport = viewportRef.current;
|
|
13285
13407
|
if (!viewport) {
|
|
13286
13408
|
return;
|
|
@@ -13297,14 +13419,14 @@ function Chat({
|
|
|
13297
13419
|
window.removeEventListener("resize", handleViewportScroll);
|
|
13298
13420
|
};
|
|
13299
13421
|
}, [clearQuoteSelection]);
|
|
13300
|
-
|
|
13422
|
+
React46.useEffect(() => {
|
|
13301
13423
|
clearQuoteSelection();
|
|
13302
13424
|
}, [messages.length, stream.threadId, clearQuoteSelection]);
|
|
13303
|
-
|
|
13425
|
+
React46.useEffect(() => {
|
|
13304
13426
|
if (missingConfig) return;
|
|
13305
13427
|
void refreshThreads();
|
|
13306
13428
|
}, [missingConfig, refreshThreads]);
|
|
13307
|
-
|
|
13429
|
+
React46.useEffect(() => {
|
|
13308
13430
|
if (missingConfig || !stream.client || !stream.assistantId) {
|
|
13309
13431
|
setAssistantName(null);
|
|
13310
13432
|
setAssistantAvatar(null);
|
|
@@ -13327,7 +13449,7 @@ function Chat({
|
|
|
13327
13449
|
cancelled = true;
|
|
13328
13450
|
};
|
|
13329
13451
|
}, [missingConfig, stream.client, stream.assistantId]);
|
|
13330
|
-
|
|
13452
|
+
React46.useEffect(() => {
|
|
13331
13453
|
if (missingConfig || !stream.client || !stream.assistantId) {
|
|
13332
13454
|
setRuntimeCapabilities(null);
|
|
13333
13455
|
setRuntimeCapabilitiesReady(false);
|
|
@@ -13374,7 +13496,7 @@ function Chat({
|
|
|
13374
13496
|
});
|
|
13375
13497
|
return () => controller.abort();
|
|
13376
13498
|
}, [missingConfig, stream.client, stream.assistantId]);
|
|
13377
|
-
|
|
13499
|
+
React46.useEffect(() => {
|
|
13378
13500
|
setRunRuntimeCapabilities(
|
|
13379
13501
|
createEmptyRuntimeCapabilitiesSelection(runtimeCapabilities)
|
|
13380
13502
|
);
|
|
@@ -13431,7 +13553,7 @@ function Chat({
|
|
|
13431
13553
|
mimetype: a.storageFile?.mimetype ?? a.file.type,
|
|
13432
13554
|
size: a.storageFile?.size ?? a.file.size
|
|
13433
13555
|
}));
|
|
13434
|
-
const handleSessionRuntimeCapabilityToggle =
|
|
13556
|
+
const handleSessionRuntimeCapabilityToggle = React46.useCallback(
|
|
13435
13557
|
(type, id, selected) => {
|
|
13436
13558
|
setSessionRuntimeCapabilities((previous) => {
|
|
13437
13559
|
const nextSelection = toggleRuntimeCapabilitySelection(
|
|
@@ -13449,7 +13571,7 @@ function Chat({
|
|
|
13449
13571
|
},
|
|
13450
13572
|
[persistSessionRuntimeCapabilities, stream.threadId]
|
|
13451
13573
|
);
|
|
13452
|
-
const updateRuntimeCapabilityPalette =
|
|
13574
|
+
const updateRuntimeCapabilityPalette = React46.useCallback(
|
|
13453
13575
|
(parts, selectionStart) => {
|
|
13454
13576
|
const input = composerInputRef.current;
|
|
13455
13577
|
const editingText = getComposerEditingText(parts);
|
|
@@ -13461,7 +13583,7 @@ function Chat({
|
|
|
13461
13583
|
},
|
|
13462
13584
|
[]
|
|
13463
13585
|
);
|
|
13464
|
-
const syncComposerInputFromElement =
|
|
13586
|
+
const syncComposerInputFromElement = React46.useCallback(
|
|
13465
13587
|
(input) => {
|
|
13466
13588
|
const previousCapabilities = getComposerCapabilityPartMap(
|
|
13467
13589
|
composerPartsRef.current
|
|
@@ -13479,25 +13601,25 @@ function Chat({
|
|
|
13479
13601
|
},
|
|
13480
13602
|
[commitComposerParts, updateRuntimeCapabilityPalette]
|
|
13481
13603
|
);
|
|
13482
|
-
const handleComposerInput =
|
|
13604
|
+
const handleComposerInput = React46.useCallback(
|
|
13483
13605
|
(event) => {
|
|
13484
13606
|
syncComposerInputFromElement(event.currentTarget);
|
|
13485
13607
|
},
|
|
13486
13608
|
[syncComposerInputFromElement]
|
|
13487
13609
|
);
|
|
13488
|
-
const handleComposerCompositionEnd =
|
|
13610
|
+
const handleComposerCompositionEnd = React46.useCallback(
|
|
13489
13611
|
(event) => {
|
|
13490
13612
|
syncComposerInputFromElement(event.currentTarget);
|
|
13491
13613
|
},
|
|
13492
13614
|
[syncComposerInputFromElement]
|
|
13493
13615
|
);
|
|
13494
|
-
const handleComposerSelect =
|
|
13616
|
+
const handleComposerSelect = React46.useCallback(() => {
|
|
13495
13617
|
updateRuntimeCapabilityPalette(
|
|
13496
13618
|
composerPartsRef.current,
|
|
13497
13619
|
composerInputRef.current ? getComposerSelectionOffset(composerInputRef.current) : void 0
|
|
13498
13620
|
);
|
|
13499
13621
|
}, [updateRuntimeCapabilityPalette]);
|
|
13500
|
-
const removeRunRuntimeCapability =
|
|
13622
|
+
const removeRunRuntimeCapability = React46.useCallback(
|
|
13501
13623
|
(option) => {
|
|
13502
13624
|
setRunRuntimeCapabilities(
|
|
13503
13625
|
(previous) => toggleRuntimeCapabilitySelection(
|
|
@@ -13517,7 +13639,7 @@ function Chat({
|
|
|
13517
13639
|
},
|
|
13518
13640
|
[commitComposerParts]
|
|
13519
13641
|
);
|
|
13520
|
-
const submitDraft =
|
|
13642
|
+
const submitDraft = React46.useCallback(
|
|
13521
13643
|
(optionsOrFollowUp) => {
|
|
13522
13644
|
if (isSendDisabled) return;
|
|
13523
13645
|
const submitOptions = typeof optionsOrFollowUp === "string" ? { followUpOverride: optionsOrFollowUp } : optionsOrFollowUp ?? {};
|
|
@@ -13641,7 +13763,7 @@ function Chat({
|
|
|
13641
13763
|
t
|
|
13642
13764
|
]
|
|
13643
13765
|
);
|
|
13644
|
-
const addRunRuntimeCapabilities =
|
|
13766
|
+
const addRunRuntimeCapabilities = React46.useCallback(
|
|
13645
13767
|
(selection) => {
|
|
13646
13768
|
setRunRuntimeCapabilities(
|
|
13647
13769
|
(previous) => runtimeCapabilities ? mergeRuntimeCapabilitiesSelections(
|
|
@@ -13653,7 +13775,7 @@ function Chat({
|
|
|
13653
13775
|
},
|
|
13654
13776
|
[runtimeCapabilities]
|
|
13655
13777
|
);
|
|
13656
|
-
const insertComposerCapabilityToken =
|
|
13778
|
+
const insertComposerCapabilityToken = React46.useCallback(
|
|
13657
13779
|
(capability, range) => {
|
|
13658
13780
|
const token = createComposerCapabilityPart(capability, createMessageId());
|
|
13659
13781
|
const currentParts = composerPartsRef.current;
|
|
@@ -13724,7 +13846,7 @@ function Chat({
|
|
|
13724
13846
|
plugin: t("composer.slashCommands.empty.loadingCapabilities"),
|
|
13725
13847
|
subAgent: t("composer.slashCommands.empty.loadingCapabilities")
|
|
13726
13848
|
};
|
|
13727
|
-
|
|
13849
|
+
React46.useEffect(() => {
|
|
13728
13850
|
if (!runtimeCapabilityPalette) {
|
|
13729
13851
|
return;
|
|
13730
13852
|
}
|
|
@@ -13743,7 +13865,7 @@ function Chat({
|
|
|
13743
13865
|
);
|
|
13744
13866
|
}
|
|
13745
13867
|
}, [slashPaletteOptions.length, runtimeCapabilityPalette]);
|
|
13746
|
-
|
|
13868
|
+
React46.useLayoutEffect(() => {
|
|
13747
13869
|
if (!runtimeCapabilityPalette) {
|
|
13748
13870
|
return;
|
|
13749
13871
|
}
|
|
@@ -13767,7 +13889,7 @@ function Chat({
|
|
|
13767
13889
|
}
|
|
13768
13890
|
submitDraft();
|
|
13769
13891
|
};
|
|
13770
|
-
const handleEditPendingFollowUp =
|
|
13892
|
+
const handleEditPendingFollowUp = React46.useCallback(
|
|
13771
13893
|
(id) => {
|
|
13772
13894
|
const item = pendingFollowUps.find(
|
|
13773
13895
|
(entry) => entry.id === id && entry.mode === "queue"
|
|
@@ -13794,7 +13916,7 @@ function Chat({
|
|
|
13794
13916
|
},
|
|
13795
13917
|
[pendingFollowUps, setComposerText, stream]
|
|
13796
13918
|
);
|
|
13797
|
-
const handleQuoteSelection =
|
|
13919
|
+
const handleQuoteSelection = React46.useCallback(() => {
|
|
13798
13920
|
if (!quoteSelection) {
|
|
13799
13921
|
return;
|
|
13800
13922
|
}
|
|
@@ -13810,7 +13932,7 @@ function Chat({
|
|
|
13810
13932
|
const handleAttachmentClick = () => {
|
|
13811
13933
|
fileInputRef.current?.click();
|
|
13812
13934
|
};
|
|
13813
|
-
const uploadContextFile =
|
|
13935
|
+
const uploadContextFile = React46.useCallback(
|
|
13814
13936
|
(file) => stream.client.contexts.uploadFile(file),
|
|
13815
13937
|
[stream.client]
|
|
13816
13938
|
);
|
|
@@ -13914,7 +14036,7 @@ function Chat({
|
|
|
13914
14036
|
}
|
|
13915
14037
|
submitDraft();
|
|
13916
14038
|
};
|
|
13917
|
-
const handleComposerPaste =
|
|
14039
|
+
const handleComposerPaste = React46.useCallback(
|
|
13918
14040
|
(event) => {
|
|
13919
14041
|
const clipboardData = event.clipboardData;
|
|
13920
14042
|
if (!clipboardData) {
|
|
@@ -14013,18 +14135,18 @@ function Chat({
|
|
|
14013
14135
|
uploadContextFile
|
|
14014
14136
|
]
|
|
14015
14137
|
);
|
|
14016
|
-
const alternateFollowUpShortcutLabel =
|
|
14138
|
+
const alternateFollowUpShortcutLabel = React46.useMemo(() => {
|
|
14017
14139
|
if (typeof navigator === "undefined") {
|
|
14018
14140
|
return "\u2318Enter";
|
|
14019
14141
|
}
|
|
14020
14142
|
const platform = navigator.platform || navigator.userAgent;
|
|
14021
14143
|
return /Mac|iPhone|iPad|iPod/i.test(platform) ? "\u2318Enter" : "Ctrl+Enter";
|
|
14022
14144
|
}, []);
|
|
14023
|
-
const followUpShortcutLabels =
|
|
14145
|
+
const followUpShortcutLabels = React46.useMemo(
|
|
14024
14146
|
() => getComposerFollowUpShortcutLabels(alternateFollowUpShortcutLabel),
|
|
14025
14147
|
[alternateFollowUpShortcutLabel]
|
|
14026
14148
|
);
|
|
14027
|
-
const uploadFile =
|
|
14149
|
+
const uploadFile = React46.useCallback(
|
|
14028
14150
|
async (localId, file) => {
|
|
14029
14151
|
try {
|
|
14030
14152
|
const result = await uploadContextFile(file);
|
|
@@ -14047,7 +14169,7 @@ function Chat({
|
|
|
14047
14169
|
},
|
|
14048
14170
|
[uploadContextFile]
|
|
14049
14171
|
);
|
|
14050
|
-
const handleRetryUpload =
|
|
14172
|
+
const handleRetryUpload = React46.useCallback(
|
|
14051
14173
|
(localId) => {
|
|
14052
14174
|
const attachment = attachments.find((a) => a.localId === localId);
|
|
14053
14175
|
if (!attachment || attachment.status !== "error") return;
|
|
@@ -14146,7 +14268,7 @@ function Chat({
|
|
|
14146
14268
|
);
|
|
14147
14269
|
scrollToBottom(true, true);
|
|
14148
14270
|
};
|
|
14149
|
-
const loadConversationMessages =
|
|
14271
|
+
const loadConversationMessages = React46.useCallback(
|
|
14150
14272
|
async (recordId) => {
|
|
14151
14273
|
if (missingConfig) {
|
|
14152
14274
|
setHistoryError(missingConfigShortMessage);
|
|
@@ -14241,12 +14363,12 @@ function Chat({
|
|
|
14241
14363
|
}
|
|
14242
14364
|
};
|
|
14243
14365
|
const acceptMimes = composer?.attachments?.accept ? Object.entries(composer.attachments.accept).map(([mime, exts]) => [mime, ...exts.map((e) => `.${e}`)].join(",")).join(",") : void 0;
|
|
14244
|
-
const currentThread =
|
|
14366
|
+
const currentThread = React46.useMemo(
|
|
14245
14367
|
() => threads.find((item) => item.id === stream.threadId),
|
|
14246
14368
|
[threads, stream.threadId]
|
|
14247
14369
|
);
|
|
14248
14370
|
const streamErrorMessage = stream.error instanceof Error ? stream.error.message : void 0;
|
|
14249
|
-
const threadErrorMessage =
|
|
14371
|
+
const threadErrorMessage = React46.useMemo(() => {
|
|
14250
14372
|
if (streamErrorMessage?.trim()) return streamErrorMessage.trim();
|
|
14251
14373
|
if (currentThread?.status !== "error") return void 0;
|
|
14252
14374
|
const message = currentThread.error?.trim();
|
|
@@ -14277,7 +14399,7 @@ function Chat({
|
|
|
14277
14399
|
fallbackTitle: t("history.threadFallback")
|
|
14278
14400
|
});
|
|
14279
14401
|
const assistantTitle = assistantName || resolvedTitle;
|
|
14280
|
-
return /* @__PURE__ */ (0,
|
|
14402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
14281
14403
|
"div",
|
|
14282
14404
|
{
|
|
14283
14405
|
ref: viewportRef,
|
|
@@ -14287,10 +14409,10 @@ function Chat({
|
|
|
14287
14409
|
className
|
|
14288
14410
|
),
|
|
14289
14411
|
children: [
|
|
14290
|
-
/* @__PURE__ */ (0,
|
|
14291
|
-
/* @__PURE__ */ (0,
|
|
14292
|
-
/* @__PURE__ */ (0,
|
|
14293
|
-
/* @__PURE__ */ (0,
|
|
14412
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center justify-between border-b p-2 sticky top-0 z-10 bg-background", children: [
|
|
14413
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center gap-3 overflow-hidden", children: [
|
|
14414
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "relative shrink-0", children: [
|
|
14415
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14294
14416
|
ChatkitAvatar,
|
|
14295
14417
|
{
|
|
14296
14418
|
avatar: assistantAvatar,
|
|
@@ -14298,10 +14420,10 @@ function Chat({
|
|
|
14298
14420
|
label: assistantTitle
|
|
14299
14421
|
}
|
|
14300
14422
|
),
|
|
14301
|
-
/* @__PURE__ */ (0,
|
|
14423
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "absolute bottom-0 right-0 h-2.5 w-2.5 rounded-full border-2 border-background bg-green-500" })
|
|
14302
14424
|
] }),
|
|
14303
|
-
/* @__PURE__ */ (0,
|
|
14304
|
-
/* @__PURE__ */ (0,
|
|
14425
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "truncate", children: [
|
|
14426
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14305
14427
|
"h2",
|
|
14306
14428
|
{
|
|
14307
14429
|
className: "text-lg font-semibold truncate",
|
|
@@ -14309,12 +14431,12 @@ function Chat({
|
|
|
14309
14431
|
children: assistantTitle
|
|
14310
14432
|
}
|
|
14311
14433
|
),
|
|
14312
|
-
/* @__PURE__ */ (0,
|
|
14434
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("p", { className: "text-xs text-muted-foreground", children: t("chat.statusOnline") })
|
|
14313
14435
|
] })
|
|
14314
14436
|
] }),
|
|
14315
|
-
/* @__PURE__ */ (0,
|
|
14316
|
-
canMinimizeToPet && /* @__PURE__ */ (0,
|
|
14317
|
-
/* @__PURE__ */ (0,
|
|
14437
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
14438
|
+
canMinimizeToPet && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Tooltip, { children: [
|
|
14439
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14318
14440
|
"button",
|
|
14319
14441
|
{
|
|
14320
14442
|
type: "button",
|
|
@@ -14325,13 +14447,13 @@ function Chat({
|
|
|
14325
14447
|
"transition-colors duration-150"
|
|
14326
14448
|
),
|
|
14327
14449
|
"aria-label": t("chat.minimizeToPet"),
|
|
14328
|
-
children: /* @__PURE__ */ (0,
|
|
14450
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react26.Minus, { size: 16 })
|
|
14329
14451
|
}
|
|
14330
14452
|
) }) }),
|
|
14331
|
-
/* @__PURE__ */ (0,
|
|
14453
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TooltipContent, { side: "bottom", children: t("chat.minimizeToPet") })
|
|
14332
14454
|
] }),
|
|
14333
|
-
/* @__PURE__ */ (0,
|
|
14334
|
-
/* @__PURE__ */ (0,
|
|
14455
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Tooltip, { children: [
|
|
14456
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14335
14457
|
"button",
|
|
14336
14458
|
{
|
|
14337
14459
|
type: "button",
|
|
@@ -14342,14 +14464,14 @@ function Chat({
|
|
|
14342
14464
|
"transition-colors duration-150"
|
|
14343
14465
|
),
|
|
14344
14466
|
"aria-label": t("settings.open"),
|
|
14345
|
-
children: /* @__PURE__ */ (0,
|
|
14467
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react26.Settings, { size: 16 })
|
|
14346
14468
|
}
|
|
14347
14469
|
) }) }),
|
|
14348
|
-
/* @__PURE__ */ (0,
|
|
14470
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TooltipContent, { side: "bottom", children: t("settings.open") })
|
|
14349
14471
|
] }),
|
|
14350
|
-
history?.enabled !== false && /* @__PURE__ */ (0,
|
|
14351
|
-
/* @__PURE__ */ (0,
|
|
14352
|
-
/* @__PURE__ */ (0,
|
|
14472
|
+
history?.enabled !== false && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
14473
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Tooltip, { children: [
|
|
14474
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14353
14475
|
"button",
|
|
14354
14476
|
{
|
|
14355
14477
|
type: "button",
|
|
@@ -14362,12 +14484,12 @@ function Chat({
|
|
|
14362
14484
|
"disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed"
|
|
14363
14485
|
),
|
|
14364
14486
|
"aria-label": t("history.newThread"),
|
|
14365
|
-
children: /* @__PURE__ */ (0,
|
|
14487
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react26.Pencil, { size: 16 })
|
|
14366
14488
|
}
|
|
14367
14489
|
) }) }),
|
|
14368
|
-
/* @__PURE__ */ (0,
|
|
14490
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TooltipContent, { side: "bottom", children: t("history.newThread") })
|
|
14369
14491
|
] }),
|
|
14370
|
-
/* @__PURE__ */ (0,
|
|
14492
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14371
14493
|
HistorySidebar,
|
|
14372
14494
|
{
|
|
14373
14495
|
threads,
|
|
@@ -14382,18 +14504,18 @@ function Chat({
|
|
|
14382
14504
|
] })
|
|
14383
14505
|
] })
|
|
14384
14506
|
] }),
|
|
14385
|
-
/* @__PURE__ */ (0,
|
|
14386
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
14387
|
-
historyError && /* @__PURE__ */ (0,
|
|
14388
|
-
showMissingConfig && /* @__PURE__ */ (0,
|
|
14389
|
-
isHistoryLoading && /* @__PURE__ */ (0,
|
|
14390
|
-
messages.length === 0 ? /* @__PURE__ */ (0,
|
|
14507
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex-1 p-4", children: [
|
|
14508
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "mb-4 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive", children: errorMessage }),
|
|
14509
|
+
historyError && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: historyError }),
|
|
14510
|
+
showMissingConfig && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: missingConfigDetailMessage }),
|
|
14511
|
+
isHistoryLoading && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "mb-4 rounded-lg border border-muted px-3 py-2 text-sm text-muted-foreground", children: t("chat.loadingThread") }),
|
|
14512
|
+
messages.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14391
14513
|
StartScreen,
|
|
14392
14514
|
{
|
|
14393
14515
|
startScreen,
|
|
14394
14516
|
onPromptClick: handlePromptClick
|
|
14395
14517
|
}
|
|
14396
|
-
) : /* @__PURE__ */ (0,
|
|
14518
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "space-y-4", children: [
|
|
14397
14519
|
messages.map((message, index) => {
|
|
14398
14520
|
const messageType = String(message.type);
|
|
14399
14521
|
const isAssistantMessage = messageType === "assistant" || messageType === "ai";
|
|
@@ -14426,7 +14548,7 @@ function Chat({
|
|
|
14426
14548
|
if (!isAssistantMessage && !hasPlainRenderableContent && !hasHumanAttachments && humanRuntimeCapabilityOptions.length === 0 && humanReferences.length === 0) {
|
|
14427
14549
|
return null;
|
|
14428
14550
|
}
|
|
14429
|
-
return /* @__PURE__ */ (0,
|
|
14551
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14430
14552
|
"div",
|
|
14431
14553
|
{
|
|
14432
14554
|
className: cn(
|
|
@@ -14434,96 +14556,105 @@ function Chat({
|
|
|
14434
14556
|
message.type === "human" ? "justify-end" : "justify-start -ml-1"
|
|
14435
14557
|
// AI messages: slightly closer to left
|
|
14436
14558
|
),
|
|
14437
|
-
children: /* @__PURE__ */ (0,
|
|
14438
|
-
|
|
14439
|
-
|
|
14440
|
-
|
|
14441
|
-
|
|
14442
|
-
|
|
14443
|
-
|
|
14444
|
-
|
|
14445
|
-
|
|
14446
|
-
"
|
|
14447
|
-
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"
|
|
14448
|
-
// AI messages: use chat-specific foreground color
|
|
14449
|
-
),
|
|
14450
|
-
children: isAssistantMessage ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
14451
|
-
AssistantMessage,
|
|
14559
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
14560
|
+
"div",
|
|
14561
|
+
{
|
|
14562
|
+
className: cn(
|
|
14563
|
+
"flex flex-col px-3 overflow-hidden",
|
|
14564
|
+
isAssistantMessage && "min-w-0 flex-1"
|
|
14565
|
+
),
|
|
14566
|
+
children: [
|
|
14567
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14568
|
+
"div",
|
|
14452
14569
|
{
|
|
14453
|
-
|
|
14454
|
-
|
|
14455
|
-
|
|
14456
|
-
},
|
|
14457
|
-
|
|
14458
|
-
|
|
14459
|
-
|
|
14460
|
-
|
|
14461
|
-
})
|
|
14570
|
+
...canQuoteMessage ? {
|
|
14571
|
+
"data-quote-message-id": message.id,
|
|
14572
|
+
"data-quote-source": quoteSource
|
|
14573
|
+
} : {},
|
|
14574
|
+
className: cn(
|
|
14575
|
+
"max-w-full rounded-2xl",
|
|
14576
|
+
message.type === "human" ? "bg-primary text-primary-foreground px-4 py-2.5" : message.type === "system" ? "bg-muted text-muted-foreground text-xs px-4 py-2.5" : "py-1 text-chat-foreground"
|
|
14577
|
+
// AI messages: use chat-specific foreground color
|
|
14462
14578
|
),
|
|
14579
|
+
children: isAssistantMessage ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14580
|
+
AssistantMessage,
|
|
14581
|
+
{
|
|
14582
|
+
message: {
|
|
14583
|
+
...message,
|
|
14584
|
+
type: "assistant"
|
|
14585
|
+
},
|
|
14586
|
+
messages: messages.slice(0, index + 1).map(
|
|
14587
|
+
(item) => ({
|
|
14588
|
+
...item,
|
|
14589
|
+
type: String(item.type) === "ai" ? "assistant" : item.type
|
|
14590
|
+
})
|
|
14591
|
+
),
|
|
14592
|
+
isStreaming: isStreamingMessage,
|
|
14593
|
+
streamingStatus,
|
|
14594
|
+
isThreadRunning: currentThreadIsRunning,
|
|
14595
|
+
organizationId: stream.organizationId,
|
|
14596
|
+
apiUrl: stream.apiUrl
|
|
14597
|
+
}
|
|
14598
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
14599
|
+
message.type === "human" && humanRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanRuntimeCapabilityOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
14600
|
+
"span",
|
|
14601
|
+
{
|
|
14602
|
+
className: "inline-flex max-w-full items-center gap-1 rounded-md bg-primary-foreground/20 px-2 py-1 text-xs font-medium text-primary-foreground",
|
|
14603
|
+
children: [
|
|
14604
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14605
|
+
RuntimeCapabilityIcon,
|
|
14606
|
+
{
|
|
14607
|
+
option,
|
|
14608
|
+
variant: "chip"
|
|
14609
|
+
}
|
|
14610
|
+
),
|
|
14611
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "max-w-[9rem] truncate", children: option.label })
|
|
14612
|
+
]
|
|
14613
|
+
},
|
|
14614
|
+
`${option.type}:${option.id}`
|
|
14615
|
+
)) }),
|
|
14616
|
+
message.type === "human" && humanReferences.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanReferences.map((reference) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14617
|
+
ReferenceChip,
|
|
14618
|
+
{
|
|
14619
|
+
reference,
|
|
14620
|
+
variant: "message"
|
|
14621
|
+
},
|
|
14622
|
+
getReferenceKey(reference)
|
|
14623
|
+
)) }),
|
|
14624
|
+
message.type === "human" && humanAttachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-2", children: humanAttachments.map((file, fileIndex) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
14625
|
+
"div",
|
|
14626
|
+
{
|
|
14627
|
+
className: "flex items-center gap-1.5 rounded-md bg-primary-foreground/20 px-2 py-1 text-xs",
|
|
14628
|
+
children: [
|
|
14629
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react26.FileText, { size: 12 }),
|
|
14630
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "max-w-[100px] truncate", children: file.originalName })
|
|
14631
|
+
]
|
|
14632
|
+
},
|
|
14633
|
+
fileIndex
|
|
14634
|
+
)) }),
|
|
14635
|
+
Array.isArray(message.content) ? message.content.map((part, partIndex) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14636
|
+
"p",
|
|
14637
|
+
{
|
|
14638
|
+
className: "wrap-break-word text-sm leading-relaxed",
|
|
14639
|
+
children: formatMessageContent(part)
|
|
14640
|
+
},
|
|
14641
|
+
`${part.type}-${partIndex}`
|
|
14642
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "wrap-break-word text-sm leading-relaxed", children: formatMessageContent(message.content) })
|
|
14643
|
+
] })
|
|
14644
|
+
}
|
|
14645
|
+
),
|
|
14646
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14647
|
+
MessageActions,
|
|
14648
|
+
{
|
|
14649
|
+
content: messageContent,
|
|
14650
|
+
isAssistant: isAssistantMessage,
|
|
14463
14651
|
isStreaming: isStreamingMessage,
|
|
14464
|
-
|
|
14465
|
-
isThreadRunning: currentThreadIsRunning,
|
|
14466
|
-
organizationId: stream.organizationId,
|
|
14467
|
-
apiUrl: stream.apiUrl
|
|
14652
|
+
onRetry: isAssistantMessage && !stream.isLoading && index === messages.length - 1 ? () => handleRetry(index) : void 0
|
|
14468
14653
|
}
|
|
14469
|
-
)
|
|
14470
|
-
|
|
14471
|
-
|
|
14472
|
-
|
|
14473
|
-
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",
|
|
14474
|
-
children: [
|
|
14475
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
14476
|
-
RuntimeCapabilityIcon,
|
|
14477
|
-
{
|
|
14478
|
-
option,
|
|
14479
|
-
variant: "chip"
|
|
14480
|
-
}
|
|
14481
|
-
),
|
|
14482
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "max-w-[9rem] truncate", children: option.label })
|
|
14483
|
-
]
|
|
14484
|
-
},
|
|
14485
|
-
`${option.type}:${option.id}`
|
|
14486
|
-
)) }),
|
|
14487
|
-
message.type === "human" && humanReferences.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanReferences.map((reference) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
14488
|
-
ReferenceChip,
|
|
14489
|
-
{
|
|
14490
|
-
reference,
|
|
14491
|
-
variant: "message"
|
|
14492
|
-
},
|
|
14493
|
-
getReferenceKey(reference)
|
|
14494
|
-
)) }),
|
|
14495
|
-
message.type === "human" && humanAttachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-2", children: humanAttachments.map((file, fileIndex) => /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
14496
|
-
"div",
|
|
14497
|
-
{
|
|
14498
|
-
className: "flex items-center gap-1.5 rounded-md bg-primary-foreground/20 px-2 py-1 text-xs",
|
|
14499
|
-
children: [
|
|
14500
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react25.FileText, { size: 12 }),
|
|
14501
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "max-w-[100px] truncate", children: file.originalName })
|
|
14502
|
-
]
|
|
14503
|
-
},
|
|
14504
|
-
fileIndex
|
|
14505
|
-
)) }),
|
|
14506
|
-
Array.isArray(message.content) ? message.content.map((part, partIndex) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
14507
|
-
"p",
|
|
14508
|
-
{
|
|
14509
|
-
className: "wrap-break-word text-sm leading-relaxed",
|
|
14510
|
-
children: formatMessageContent(part)
|
|
14511
|
-
},
|
|
14512
|
-
`${part.type}-${partIndex}`
|
|
14513
|
-
)) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "wrap-break-word text-sm leading-relaxed", children: formatMessageContent(message.content) })
|
|
14514
|
-
] })
|
|
14515
|
-
}
|
|
14516
|
-
),
|
|
14517
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
14518
|
-
MessageActions,
|
|
14519
|
-
{
|
|
14520
|
-
content: messageContent,
|
|
14521
|
-
isAssistant: isAssistantMessage,
|
|
14522
|
-
isStreaming: isStreamingMessage,
|
|
14523
|
-
onRetry: isAssistantMessage && !stream.isLoading && index === messages.length - 1 ? () => handleRetry(index) : void 0
|
|
14524
|
-
}
|
|
14525
|
-
)
|
|
14526
|
-
] })
|
|
14654
|
+
)
|
|
14655
|
+
]
|
|
14656
|
+
}
|
|
14657
|
+
)
|
|
14527
14658
|
},
|
|
14528
14659
|
message.id ?? `${message.type}-${index}`
|
|
14529
14660
|
);
|
|
@@ -14550,7 +14681,7 @@ function Chat({
|
|
|
14550
14681
|
stream.isLoading,
|
|
14551
14682
|
{ now: streamingNow }
|
|
14552
14683
|
);
|
|
14553
|
-
return /* @__PURE__ */ (0,
|
|
14684
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "flex justify-start gap-3 -ml-2", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "max-w-full rounded-2xl py-2.5", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14554
14685
|
AssistantStreamingIndicator,
|
|
14555
14686
|
{
|
|
14556
14687
|
status: fallbackStreamingStatus ?? "loading"
|
|
@@ -14559,7 +14690,7 @@ function Chat({
|
|
|
14559
14690
|
})()
|
|
14560
14691
|
] })
|
|
14561
14692
|
] }),
|
|
14562
|
-
!isAtBottom && messages.length > 0 && /* @__PURE__ */ (0,
|
|
14693
|
+
!isAtBottom && messages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "sticky bottom-20 z-20 flex justify-center px-4 pointer-events-none", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14563
14694
|
Button,
|
|
14564
14695
|
{
|
|
14565
14696
|
type: "button",
|
|
@@ -14572,10 +14703,10 @@ function Chat({
|
|
|
14572
14703
|
onClick: () => scrollToBottom(true, true),
|
|
14573
14704
|
"aria-label": t("chat.scrollToBottom"),
|
|
14574
14705
|
title: t("chat.scrollToBottom"),
|
|
14575
|
-
children: /* @__PURE__ */ (0,
|
|
14706
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react26.ArrowDown, { size: 16 })
|
|
14576
14707
|
}
|
|
14577
14708
|
) }),
|
|
14578
|
-
quoteSelection && /* @__PURE__ */ (0,
|
|
14709
|
+
quoteSelection && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14579
14710
|
"div",
|
|
14580
14711
|
{
|
|
14581
14712
|
className: "pointer-events-none fixed z-50",
|
|
@@ -14584,7 +14715,7 @@ function Chat({
|
|
|
14584
14715
|
left: `${quoteSelection.left}px`,
|
|
14585
14716
|
transform: "translateX(-50%)"
|
|
14586
14717
|
},
|
|
14587
|
-
children: /* @__PURE__ */ (0,
|
|
14718
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
14588
14719
|
Button,
|
|
14589
14720
|
{
|
|
14590
14721
|
type: "button",
|
|
@@ -14596,16 +14727,16 @@ function Chat({
|
|
|
14596
14727
|
"aria-label": t("composer.quoteSelection"),
|
|
14597
14728
|
title: t("composer.quoteSelection"),
|
|
14598
14729
|
children: [
|
|
14599
|
-
/* @__PURE__ */ (0,
|
|
14730
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react26.Quote, { size: 14 }),
|
|
14600
14731
|
t("composer.quoteSelection")
|
|
14601
14732
|
]
|
|
14602
14733
|
}
|
|
14603
14734
|
)
|
|
14604
14735
|
}
|
|
14605
14736
|
),
|
|
14606
|
-
/* @__PURE__ */ (0,
|
|
14607
|
-
threadErrorMessage && /* @__PURE__ */ (0,
|
|
14608
|
-
/* @__PURE__ */ (0,
|
|
14737
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "p-2 sticky bottom-0 z-10 bg-background", children: [
|
|
14738
|
+
threadErrorMessage && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "mb-3 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive overflow-auto", children: threadErrorMessage }),
|
|
14739
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14609
14740
|
"input",
|
|
14610
14741
|
{
|
|
14611
14742
|
ref: fileInputRef,
|
|
@@ -14616,7 +14747,7 @@ function Chat({
|
|
|
14616
14747
|
className: "hidden"
|
|
14617
14748
|
}
|
|
14618
14749
|
),
|
|
14619
|
-
attachments.length > 0 && /* @__PURE__ */ (0,
|
|
14750
|
+
attachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "mb-3 flex flex-wrap gap-2", children: attachments.map((item) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
14620
14751
|
"div",
|
|
14621
14752
|
{
|
|
14622
14753
|
className: cn(
|
|
@@ -14624,16 +14755,16 @@ function Chat({
|
|
|
14624
14755
|
item.status === "error" ? "bg-destructive/10 border border-destructive/30" : "bg-muted"
|
|
14625
14756
|
),
|
|
14626
14757
|
children: [
|
|
14627
|
-
item.status === "uploading" && /* @__PURE__ */ (0,
|
|
14628
|
-
|
|
14758
|
+
item.status === "uploading" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14759
|
+
import_lucide_react26.Loader2,
|
|
14629
14760
|
{
|
|
14630
14761
|
size: 14,
|
|
14631
14762
|
className: "animate-spin text-muted-foreground"
|
|
14632
14763
|
}
|
|
14633
14764
|
),
|
|
14634
|
-
item.status === "success" && /* @__PURE__ */ (0,
|
|
14635
|
-
item.status === "error" && /* @__PURE__ */ (0,
|
|
14636
|
-
/* @__PURE__ */ (0,
|
|
14765
|
+
item.status === "success" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react26.FileText, { size: 14, className: "text-muted-foreground" }),
|
|
14766
|
+
item.status === "error" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react26.FileText, { size: 14, className: "text-destructive" }),
|
|
14767
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14637
14768
|
"span",
|
|
14638
14769
|
{
|
|
14639
14770
|
className: cn(
|
|
@@ -14643,17 +14774,17 @@ function Chat({
|
|
|
14643
14774
|
children: item.file.name
|
|
14644
14775
|
}
|
|
14645
14776
|
),
|
|
14646
|
-
item.status === "error" && /* @__PURE__ */ (0,
|
|
14777
|
+
item.status === "error" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14647
14778
|
"button",
|
|
14648
14779
|
{
|
|
14649
14780
|
type: "button",
|
|
14650
14781
|
onClick: () => handleRetryUpload(item.localId),
|
|
14651
14782
|
className: "ml-1 rounded-full p-0.5 text-destructive hover:bg-destructive/20",
|
|
14652
14783
|
title: t("chat.retryUpload"),
|
|
14653
|
-
children: /* @__PURE__ */ (0,
|
|
14784
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react26.RefreshCw, { size: 12 })
|
|
14654
14785
|
}
|
|
14655
14786
|
),
|
|
14656
|
-
/* @__PURE__ */ (0,
|
|
14787
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14657
14788
|
"button",
|
|
14658
14789
|
{
|
|
14659
14790
|
type: "button",
|
|
@@ -14662,14 +14793,14 @@ function Chat({
|
|
|
14662
14793
|
"ml-1 rounded-full p-0.5",
|
|
14663
14794
|
item.status === "error" ? "text-destructive hover:bg-destructive/20" : "hover:bg-muted-foreground/20"
|
|
14664
14795
|
),
|
|
14665
|
-
children: /* @__PURE__ */ (0,
|
|
14796
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react26.X, { size: 12 })
|
|
14666
14797
|
}
|
|
14667
14798
|
)
|
|
14668
14799
|
]
|
|
14669
14800
|
},
|
|
14670
14801
|
item.localId
|
|
14671
14802
|
)) }),
|
|
14672
|
-
references.length > 0 && /* @__PURE__ */ (0,
|
|
14803
|
+
references.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "mb-3 flex flex-wrap gap-2", children: references.map((reference) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14673
14804
|
ReferenceChip,
|
|
14674
14805
|
{
|
|
14675
14806
|
reference,
|
|
@@ -14683,16 +14814,16 @@ function Chat({
|
|
|
14683
14814
|
},
|
|
14684
14815
|
getReferenceKey(reference)
|
|
14685
14816
|
)) }),
|
|
14686
|
-
detachedRunRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ (0,
|
|
14687
|
-
/* @__PURE__ */ (0,
|
|
14688
|
-
detachedRunRuntimeCapabilityOptions.map((option) => /* @__PURE__ */ (0,
|
|
14817
|
+
detachedRunRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "mb-2 flex flex-wrap items-center gap-2", children: [
|
|
14818
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "text-xs text-muted-foreground", children: t("composer.capabilities.runOnly") }),
|
|
14819
|
+
detachedRunRuntimeCapabilityOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
14689
14820
|
"span",
|
|
14690
14821
|
{
|
|
14691
14822
|
className: "inline-flex max-w-full items-center gap-1 rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",
|
|
14692
14823
|
children: [
|
|
14693
|
-
/* @__PURE__ */ (0,
|
|
14694
|
-
/* @__PURE__ */ (0,
|
|
14695
|
-
/* @__PURE__ */ (0,
|
|
14824
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(RuntimeCapabilityIcon, { option, variant: "chip" }),
|
|
14825
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "max-w-40 truncate", children: option.label }),
|
|
14826
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14696
14827
|
"button",
|
|
14697
14828
|
{
|
|
14698
14829
|
type: "button",
|
|
@@ -14700,7 +14831,7 @@ function Chat({
|
|
|
14700
14831
|
className: "rounded-full p-0.5 hover:bg-primary/15",
|
|
14701
14832
|
title: t("composer.capabilities.removeRunCapability"),
|
|
14702
14833
|
"aria-label": t("composer.capabilities.removeRunCapability"),
|
|
14703
|
-
children: /* @__PURE__ */ (0,
|
|
14834
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react26.X, { size: 11 })
|
|
14704
14835
|
}
|
|
14705
14836
|
)
|
|
14706
14837
|
]
|
|
@@ -14708,7 +14839,7 @@ function Chat({
|
|
|
14708
14839
|
`${option.type}:${option.id}`
|
|
14709
14840
|
))
|
|
14710
14841
|
] }),
|
|
14711
|
-
/* @__PURE__ */ (0,
|
|
14842
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14712
14843
|
PendingRuntimeServices,
|
|
14713
14844
|
{
|
|
14714
14845
|
state: stream.runtimeActivities.sandboxServices,
|
|
@@ -14717,7 +14848,7 @@ function Chat({
|
|
|
14717
14848
|
className: hasPendingTodos || hasPendingFollowUps ? "mb-2" : void 0
|
|
14718
14849
|
}
|
|
14719
14850
|
),
|
|
14720
|
-
/* @__PURE__ */ (0,
|
|
14851
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14721
14852
|
PendingTodos,
|
|
14722
14853
|
{
|
|
14723
14854
|
snapshot: stream.todos,
|
|
@@ -14725,7 +14856,7 @@ function Chat({
|
|
|
14725
14856
|
className: hasPendingFollowUps ? "mb-2" : void 0
|
|
14726
14857
|
}
|
|
14727
14858
|
),
|
|
14728
|
-
/* @__PURE__ */ (0,
|
|
14859
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14729
14860
|
PendingFollowUps,
|
|
14730
14861
|
{
|
|
14731
14862
|
items: pendingFollowUps,
|
|
@@ -14740,7 +14871,7 @@ function Chat({
|
|
|
14740
14871
|
attachToComposer: true
|
|
14741
14872
|
}
|
|
14742
14873
|
),
|
|
14743
|
-
/* @__PURE__ */ (0,
|
|
14874
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14744
14875
|
RequestUserInputPanel,
|
|
14745
14876
|
{
|
|
14746
14877
|
request: stream.pendingRequestUserInput,
|
|
@@ -14749,7 +14880,7 @@ function Chat({
|
|
|
14749
14880
|
attachToComposer: true
|
|
14750
14881
|
}
|
|
14751
14882
|
),
|
|
14752
|
-
/* @__PURE__ */ (0,
|
|
14883
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14753
14884
|
HITLApprovalPanel,
|
|
14754
14885
|
{
|
|
14755
14886
|
request: stream.pendingHITLRequest,
|
|
@@ -14758,7 +14889,7 @@ function Chat({
|
|
|
14758
14889
|
attachToComposer: true
|
|
14759
14890
|
}
|
|
14760
14891
|
),
|
|
14761
|
-
runtimeCapabilityPalette && /* @__PURE__ */ (0,
|
|
14892
|
+
runtimeCapabilityPalette && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14762
14893
|
SlashPalette,
|
|
14763
14894
|
{
|
|
14764
14895
|
palette: runtimeCapabilityPalette,
|
|
@@ -14772,7 +14903,7 @@ function Chat({
|
|
|
14772
14903
|
onSelect: selectSlashPaletteOption
|
|
14773
14904
|
}
|
|
14774
14905
|
),
|
|
14775
|
-
/* @__PURE__ */ (0,
|
|
14906
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("form", { className: "flex items-end", onSubmit: handleSubmit, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
14776
14907
|
"div",
|
|
14777
14908
|
{
|
|
14778
14909
|
"data-slot": "composer-input-shell",
|
|
@@ -14786,7 +14917,7 @@ function Chat({
|
|
|
14786
14917
|
composerInputRoundedClass
|
|
14787
14918
|
),
|
|
14788
14919
|
children: [
|
|
14789
|
-
/* @__PURE__ */ (0,
|
|
14920
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14790
14921
|
"div",
|
|
14791
14922
|
{
|
|
14792
14923
|
ref: composerInputRef,
|
|
@@ -14808,7 +14939,7 @@ function Chat({
|
|
|
14808
14939
|
(missingConfig || isHistoryLoading || hasPendingInteractiveRequest) && "cursor-not-allowed opacity-50"
|
|
14809
14940
|
),
|
|
14810
14941
|
children: renderedComposerParts.map(
|
|
14811
|
-
(part, index) => part.type === "text" ? /* @__PURE__ */ (0,
|
|
14942
|
+
(part, index) => part.type === "text" ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(React46.Fragment, { children: part.text }, `text-${index}`) : /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
14812
14943
|
"span",
|
|
14813
14944
|
{
|
|
14814
14945
|
"data-composer-capability-key": part.key,
|
|
@@ -14817,14 +14948,14 @@ function Chat({
|
|
|
14817
14948
|
contentEditable: false,
|
|
14818
14949
|
className: "mx-0.5 inline-flex max-w-[14rem] select-none items-center gap-1 text-sm font-semibold text-primary align-baseline",
|
|
14819
14950
|
children: [
|
|
14820
|
-
/* @__PURE__ */ (0,
|
|
14951
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14821
14952
|
RuntimeCapabilityIcon,
|
|
14822
14953
|
{
|
|
14823
14954
|
option: part.capability,
|
|
14824
14955
|
variant: "chip"
|
|
14825
14956
|
}
|
|
14826
14957
|
),
|
|
14827
|
-
/* @__PURE__ */ (0,
|
|
14958
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "truncate", children: part.capability.label })
|
|
14828
14959
|
]
|
|
14829
14960
|
},
|
|
14830
14961
|
part.key
|
|
@@ -14833,14 +14964,14 @@ function Chat({
|
|
|
14833
14964
|
},
|
|
14834
14965
|
composerDomVersion
|
|
14835
14966
|
),
|
|
14836
|
-
/* @__PURE__ */ (0,
|
|
14967
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
14837
14968
|
"div",
|
|
14838
14969
|
{
|
|
14839
14970
|
"data-slot": "composer-action-bar",
|
|
14840
14971
|
className: "pointer-events-none absolute inset-x-1.5 bottom-1 flex min-h-10 items-center justify-between gap-2",
|
|
14841
14972
|
children: [
|
|
14842
|
-
/* @__PURE__ */ (0,
|
|
14843
|
-
/* @__PURE__ */ (0,
|
|
14973
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "pointer-events-none flex min-w-0 flex-1 items-center gap-1.5", children: [
|
|
14974
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "pointer-events-auto flex shrink-0 items-center gap-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14844
14975
|
ComposerMenu,
|
|
14845
14976
|
{
|
|
14846
14977
|
composer,
|
|
@@ -14855,20 +14986,20 @@ function Chat({
|
|
|
14855
14986
|
disabled: missingConfig || isHistoryLoading || hasPendingInteractiveRequest
|
|
14856
14987
|
}
|
|
14857
14988
|
) }),
|
|
14858
|
-
selectedTool && /* @__PURE__ */ (0,
|
|
14859
|
-
/* @__PURE__ */ (0,
|
|
14860
|
-
/* @__PURE__ */ (0,
|
|
14989
|
+
selectedTool && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("span", { className: "pointer-events-auto inline-flex h-8 min-w-0 max-w-[14rem] shrink items-center gap-1.5 rounded-full bg-primary/10 px-2 text-xs font-medium text-primary transition-all duration-200", children: [
|
|
14990
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "truncate", children: selectedTool.shortLabel ?? selectedTool.label }),
|
|
14991
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14861
14992
|
"button",
|
|
14862
14993
|
{
|
|
14863
14994
|
type: "button",
|
|
14864
14995
|
onClick: () => setSelectedTool(null),
|
|
14865
14996
|
className: "shrink-0 rounded-full p-0.5 text-primary/70 hover:bg-primary/10 hover:text-primary",
|
|
14866
|
-
children: /* @__PURE__ */ (0,
|
|
14997
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react26.X, { size: 12 })
|
|
14867
14998
|
}
|
|
14868
14999
|
)
|
|
14869
15000
|
] })
|
|
14870
15001
|
] }),
|
|
14871
|
-
/* @__PURE__ */ (0,
|
|
15002
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "pointer-events-auto shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14872
15003
|
SendButton,
|
|
14873
15004
|
{
|
|
14874
15005
|
disabled: isSendDisabled,
|
|
@@ -14895,7 +15026,7 @@ function Chat({
|
|
|
14895
15026
|
]
|
|
14896
15027
|
}
|
|
14897
15028
|
) }),
|
|
14898
|
-
disclaimer?.text && /* @__PURE__ */ (0,
|
|
15029
|
+
disclaimer?.text && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14899
15030
|
"p",
|
|
14900
15031
|
{
|
|
14901
15032
|
className: cn(
|
|
@@ -14905,12 +15036,12 @@ function Chat({
|
|
|
14905
15036
|
children: disclaimer.text
|
|
14906
15037
|
}
|
|
14907
15038
|
),
|
|
14908
|
-
/* @__PURE__ */ (0,
|
|
14909
|
-
/* @__PURE__ */ (0,
|
|
14910
|
-
/* @__PURE__ */ (0,
|
|
15039
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "mt-2 flex items-center justify-center gap-2 text-xs text-muted-foreground", children: [
|
|
15040
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { children: t("chat.poweredBy") }),
|
|
15041
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ContextUsageIndicator, { className: "absolute right-4" })
|
|
14911
15042
|
] })
|
|
14912
15043
|
] }),
|
|
14913
|
-
/* @__PURE__ */ (0,
|
|
15044
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
14914
15045
|
SettingsSheet,
|
|
14915
15046
|
{
|
|
14916
15047
|
open: petSettingsOpen,
|
|
@@ -14920,17 +15051,17 @@ function Chat({
|
|
|
14920
15051
|
onSave: savePetLocalSettings
|
|
14921
15052
|
}
|
|
14922
15053
|
),
|
|
14923
|
-
/* @__PURE__ */ (0,
|
|
15054
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(PetBridge, { pet: effectivePet, state: petAutoState })
|
|
14924
15055
|
]
|
|
14925
15056
|
}
|
|
14926
15057
|
);
|
|
14927
15058
|
}
|
|
14928
15059
|
|
|
14929
15060
|
// src/components/ui/separator.tsx
|
|
14930
|
-
var
|
|
14931
|
-
var
|
|
14932
|
-
var Separator =
|
|
14933
|
-
({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */ (0,
|
|
15061
|
+
var React47 = __toESM(require("react"), 1);
|
|
15062
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
15063
|
+
var Separator = React47.forwardRef(
|
|
15064
|
+
({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
14934
15065
|
"div",
|
|
14935
15066
|
{
|
|
14936
15067
|
ref,
|