@xpert-ai/chatkit-ui 0.3.6 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/assets/{_baseUniq-PQJUyd2p.js → _baseUniq-DgbE-Zpp.js} +1 -1
- package/dist/app/assets/{abap-DBNQvwwq.js → abap-B0ywZp7w.js} +1 -1
- package/dist/app/assets/{abnf-DAYjyqbD.js → abnf-vKucRloH.js} +1 -1
- package/dist/app/assets/{actionscript-CC6WSmTp.js → actionscript-CvpjcrZC.js} +1 -1
- package/dist/app/assets/{ada-BKGodcKv.js → ada-DV5KTTo4.js} +1 -1
- package/dist/app/assets/{agda-Btmo1dV2.js → agda-BTTYVnbo.js} +1 -1
- package/dist/app/assets/{al-ZGIJe93k.js → al-u-oZSiBm.js} +1 -1
- package/dist/app/assets/{antlr4-5WGUtMyl.js → antlr4-CY1PBdPM.js} +1 -1
- package/dist/app/assets/{apacheconf-DUR_1QqW.js → apacheconf-CIk6CfdC.js} +1 -1
- package/dist/app/assets/{apex-BintsQD-.js → apex-BdhgEWXC.js} +1 -1
- package/dist/app/assets/{apl-B7pUHOBS.js → apl-Mv4j7Tlu.js} +1 -1
- package/dist/app/assets/{applescript-CanCSogn.js → applescript-BnoQn48O.js} +1 -1
- package/dist/app/assets/{aql-iDHrUFca.js → aql-Do8Nhg8p.js} +1 -1
- package/dist/app/assets/{arc-VbTm84dM.js → arc-edZU_NW2.js} +1 -1
- package/dist/app/assets/{architectureDiagram-Q4EWVU46-BwbXOlsJ.js → architectureDiagram-Q4EWVU46-Dtt89Y19.js} +1 -1
- package/dist/app/assets/{arduino-CvuY6cDV.js → arduino-C48-q0UX.js} +1 -1
- package/dist/app/assets/{arff-C7UK1Sqo.js → arff-CvXAFvRm.js} +1 -1
- package/dist/app/assets/{asciidoc-jaQgm_Ci.js → asciidoc-CA--68DS.js} +1 -1
- package/dist/app/assets/{asm6502-Bec9iTSO.js → asm6502-BcBLxpHN.js} +1 -1
- package/dist/app/assets/{asmatmel-CWWLYM-f.js → asmatmel-CDMg3LIG.js} +1 -1
- package/dist/app/assets/{aspnet-EICvaNos.js → aspnet-BzZAtk5n.js} +1 -1
- package/dist/app/assets/{autohotkey-CgvCc8dt.js → autohotkey-C8WkQEjI.js} +1 -1
- package/dist/app/assets/{autoit-BbrdfXjj.js → autoit-D5_mrv5m.js} +1 -1
- package/dist/app/assets/{avisynth-C7cOgG-q.js → avisynth-Dh_xask5.js} +1 -1
- package/dist/app/assets/{avro-idl-BsT9yVqS.js → avro-idl-AEaYO6yK.js} +1 -1
- package/dist/app/assets/{bash-BF1ylQ6_.js → bash-RlP16Xm5.js} +1 -1
- package/dist/app/assets/{basic-DyO_cuAQ.js → basic-Xn_eY79M.js} +1 -1
- package/dist/app/assets/{batch-DdxmhDRT.js → batch-B_zss_9m.js} +1 -1
- package/dist/app/assets/{bbcode-Csh0dpf7.js → bbcode-D5qIIsoM.js} +1 -1
- package/dist/app/assets/{bicep-CEnRCsw4.js → bicep-DFAY7lin.js} +1 -1
- package/dist/app/assets/{birb-H4aZEyfE.js → birb-DZZhpbmW.js} +1 -1
- package/dist/app/assets/{bison-B4NzJQL4.js → bison-B-dGF85b.js} +1 -1
- package/dist/app/assets/{blockDiagram-DXYQGD6D-BQrs2vZp.js → blockDiagram-DXYQGD6D-oXU3wiI6.js} +1 -1
- package/dist/app/assets/{bnf-BpnLOKBL.js → bnf-6CRAamZR.js} +1 -1
- package/dist/app/assets/{brainfuck-BcXFtTZS.js → brainfuck-CexdbLJh.js} +1 -1
- package/dist/app/assets/{brightscript-C-G4maiE.js → brightscript-CaxTO5da.js} +1 -1
- package/dist/app/assets/{bro-JcLlkXX7.js → bro-BRI4lLX7.js} +1 -1
- package/dist/app/assets/{bsl-C7EgrPBt.js → bsl-QOrG17u7.js} +1 -1
- package/dist/app/assets/{c-0vDIBgc3.js → c-D3L-REE8.js} +1 -1
- package/dist/app/assets/{c4Diagram-AHTNJAMY-wtHHI5rn.js → c4Diagram-AHTNJAMY-zIBgyFbC.js} +1 -1
- package/dist/app/assets/{cfscript-B5a7v4dm.js → cfscript-CgDikVyK.js} +1 -1
- package/dist/app/assets/{chaiscript-CC6j4sQE.js → chaiscript-BPTekNbB.js} +1 -1
- package/dist/app/assets/channel-DJrI2Cpl.js +1 -0
- package/dist/app/assets/{chunk-4BX2VUAB-Dlz831RQ.js → chunk-4BX2VUAB-C8q0nzRo.js} +1 -1
- package/dist/app/assets/{chunk-4TB4RGXK-D5P5dUqt.js → chunk-4TB4RGXK-C8eclN6u.js} +1 -1
- package/dist/app/assets/{chunk-55IACEB6-BqMvjwUA.js → chunk-55IACEB6-CC_AZKq2.js} +1 -1
- package/dist/app/assets/{chunk-EDXVE4YY-DnPhlqJA.js → chunk-EDXVE4YY-BKhbC1sp.js} +1 -1
- package/dist/app/assets/{chunk-FMBD7UC4-DNRIZD8O.js → chunk-FMBD7UC4-BuH_t_j-.js} +1 -1
- package/dist/app/assets/{chunk-OYMX7WX6-JXHjhCxm.js → chunk-OYMX7WX6-DRM_T71-.js} +1 -1
- package/dist/app/assets/{chunk-QZHKN3VN-BkxXCZY4.js → chunk-QZHKN3VN-BiziHb7K.js} +1 -1
- package/dist/app/assets/{chunk-YZCP3GAM-EpFGzvxp.js → chunk-YZCP3GAM-ns5Vk1f0.js} +1 -1
- package/dist/app/assets/{cil-iQdhNO4Q.js → cil-CQ1VUn3A.js} +1 -1
- package/dist/app/assets/classDiagram-6PBFFD2Q-DlrWIn_z.js +1 -0
- package/dist/app/assets/classDiagram-v2-HSJHXN6E-DlrWIn_z.js +1 -0
- package/dist/app/assets/{clike-CQAeHYPM.js → clike-Bk_7iChK.js} +1 -1
- package/dist/app/assets/{clojure-Cql6MpyZ.js → clojure-oh6_RnlA.js} +1 -1
- package/dist/app/assets/clone-DypLoQyD.js +1 -0
- package/dist/app/assets/{cmake-BfKHjCsg.js → cmake-ySS0jC1Y.js} +1 -1
- package/dist/app/assets/{cobol-CKkM0fVl.js → cobol-iXcezfTy.js} +1 -1
- package/dist/app/assets/{coffeescript-CgyUEXhV.js → coffeescript-BUy0IOTJ.js} +1 -1
- package/dist/app/assets/{concurnas-CeEqG40V.js → concurnas-By_kYzwm.js} +1 -1
- package/dist/app/assets/{coq-CkWZFRlP.js → coq-DZiJnQYk.js} +1 -1
- package/dist/app/assets/{core-CcAPm-aU.js → core-BjYqaHIK.js} +1 -1
- package/dist/app/assets/{cose-bilkent-S5V4N54A-kULVHEg6.js → cose-bilkent-S5V4N54A-DRg86qAz.js} +1 -1
- package/dist/app/assets/{cpp-Bwq_b1tA.js → cpp-fVJetTCh.js} +1 -1
- package/dist/app/assets/{crystal-YNIUD3Bs.js → crystal-Dqa1FSjq.js} +1 -1
- package/dist/app/assets/{csharp-P6DguRUY.js → csharp-BEpd8Bfz.js} +1 -1
- package/dist/app/assets/{cshtml-B5QmdkLH.js → cshtml-cleS7x9a.js} +1 -1
- package/dist/app/assets/{csp-DFeKy3lq.js → csp-DJNuAuVo.js} +1 -1
- package/dist/app/assets/{css-extras-BFuChsao.js → css-extras-DqcDnxi2.js} +1 -1
- package/dist/app/assets/{css-CRC3M3rp.js → css-laKMA7ps.js} +1 -1
- package/dist/app/assets/{csv-C4LMPB8f.js → csv-CcsGtqB7.js} +1 -1
- package/dist/app/assets/{cypher-HIcVk2j0.js → cypher-tCYaF_sw.js} +1 -1
- package/dist/app/assets/{d-BnjQOzu7.js → d-ZjP-D4jP.js} +1 -1
- package/dist/app/assets/{dagre-KV5264BT-DYeQuZ_S.js → dagre-KV5264BT-BMg6cnfG.js} +1 -1
- package/dist/app/assets/{dart-BY_HEqIc.js → dart-aEIC0xv8.js} +1 -1
- package/dist/app/assets/{dataweave-IZkekg5J.js → dataweave-CM7DNyRc.js} +1 -1
- package/dist/app/assets/{dax-BDxI87qH.js → dax-D-1tRMAS.js} +1 -1
- package/dist/app/assets/{dhall-BI7me9By.js → dhall-B4G6sh_3.js} +1 -1
- package/dist/app/assets/{diagram-5BDNPKRD-DqUtPt3D.js → diagram-5BDNPKRD-BGIhlwaI.js} +1 -1
- package/dist/app/assets/{diagram-G4DWMVQ6-DUz5iheG.js → diagram-G4DWMVQ6-CqKLelet.js} +1 -1
- package/dist/app/assets/{diagram-MMDJMWI5-DqMZVdpe.js → diagram-MMDJMWI5-2IpGHxI2.js} +1 -1
- package/dist/app/assets/{diagram-TYMM5635-D4dMAYPV.js → diagram-TYMM5635-_HRiSNgh.js} +1 -1
- package/dist/app/assets/{diff-D1eveguk.js → diff-CAWzHumm.js} +1 -1
- package/dist/app/assets/{django-n2RdeMZg.js → django-BLlxHysq.js} +1 -1
- package/dist/app/assets/{dns-zone-file-C7ZVuM_8.js → dns-zone-file-Bu1BFi4x.js} +1 -1
- package/dist/app/assets/{docker-2dKv2uP8.js → docker-DQtdSM6w.js} +1 -1
- package/dist/app/assets/{dot-CnM9kCZh.js → dot-M_8dtQ-J.js} +1 -1
- package/dist/app/assets/{ebnf-DNNgDJ77.js → ebnf-Bqjz4X_l.js} +1 -1
- package/dist/app/assets/{editorconfig-BOtWIdJu.js → editorconfig-H1gZsYaD.js} +1 -1
- package/dist/app/assets/{eiffel-DZJsL-6U.js → eiffel-jToyfE3K.js} +1 -1
- package/dist/app/assets/{ejs-DlY_5WK7.js → ejs-Xg8x_yq-.js} +1 -1
- package/dist/app/assets/{elixir-DnflWYYw.js → elixir-BG9SfjVk.js} +1 -1
- package/dist/app/assets/{elm-DiBtRJyK.js → elm-7rvkjNwn.js} +1 -1
- package/dist/app/assets/{erDiagram-SMLLAGMA-s249XOhW.js → erDiagram-SMLLAGMA-CwJ0JEfE.js} +1 -1
- package/dist/app/assets/{erb-Ctwnlnto.js → erb-CipiWC9j.js} +1 -1
- package/dist/app/assets/{erlang-BnrgWRyV.js → erlang-DyGWgpYG.js} +1 -1
- package/dist/app/assets/{etlua-B-b2a1aT.js → etlua-Ct6VkCC4.js} +1 -1
- package/dist/app/assets/{excel-formula-BfwuYhTY.js → excel-formula-CY9oxCkI.js} +1 -1
- package/dist/app/assets/{factor-2cFlXUFG.js → factor-DBGcEQMr.js} +1 -1
- package/dist/app/assets/{false-DVJW4Xbm.js → false-D7Yj-SPJ.js} +1 -1
- package/dist/app/assets/{firestore-security-rules-BDB3ruEY.js → firestore-security-rules-BKeRzWep.js} +1 -1
- package/dist/app/assets/{flow-v_X8TsCx.js → flow-BUWiIzEU.js} +1 -1
- package/dist/app/assets/{flowDiagram-DWJPFMVM-Dz8lk_A8.js → flowDiagram-DWJPFMVM-C3YhD-oq.js} +1 -1
- package/dist/app/assets/{fortran-VlXf9wYr.js → fortran-Bj52YXe0.js} +1 -1
- package/dist/app/assets/{fsharp-BgmRbToz.js → fsharp-DmCVgmnH.js} +1 -1
- package/dist/app/assets/{ftl-CX7l6a-K.js → ftl-Cbmvxbh6.js} +1 -1
- package/dist/app/assets/{ganttDiagram-T4ZO3ILL-C8JxZNAd.js → ganttDiagram-T4ZO3ILL-D9xW5yhh.js} +1 -1
- package/dist/app/assets/{gap-C3towync.js → gap-D23ZRtRz.js} +1 -1
- package/dist/app/assets/{gcode-pPl8BHC6.js → gcode-D5-N3nr_.js} +1 -1
- package/dist/app/assets/{gdscript-CQ5KQpTU.js → gdscript-DWERnX-a.js} +1 -1
- package/dist/app/assets/{gedcom-UKqoiZ_B.js → gedcom-Ck_Ym3Q2.js} +1 -1
- package/dist/app/assets/{gherkin-oHLPyBSJ.js → gherkin-BksiIjs-.js} +1 -1
- package/dist/app/assets/{git-QJvYrr1x.js → git-CO1eb-gL.js} +1 -1
- package/dist/app/assets/{gitGraphDiagram-UUTBAWPF-D8hAIW7o.js → gitGraphDiagram-UUTBAWPF-DZLT8zDA.js} +1 -1
- package/dist/app/assets/{glsl-D9mjvqGV.js → glsl-CN-vqwC_.js} +1 -1
- package/dist/app/assets/{gml-DyeDbLje.js → gml-J5W8Y4yz.js} +1 -1
- package/dist/app/assets/{gn-CQxx-3wR.js → gn-D7Pv9idR.js} +1 -1
- package/dist/app/assets/{go-BlxfTxGG.js → go-6Lw_nSyb.js} +1 -1
- package/dist/app/assets/{go-module-aUBiuILx.js → go-module-BCe-jjCg.js} +1 -1
- package/dist/app/assets/{graph-D-X2uhF1.js → graph-BhsGz6M4.js} +1 -1
- package/dist/app/assets/{graphql-Clt8HaZ7.js → graphql-4_hbbnNw.js} +1 -1
- package/dist/app/assets/{groovy-CZSeQO36.js → groovy-BZvyCoNS.js} +1 -1
- package/dist/app/assets/{haml-DMf7PiKp.js → haml-MpET2CYX.js} +1 -1
- package/dist/app/assets/{handlebars-BphhMxT6.js → handlebars-CMygNMyQ.js} +1 -1
- package/dist/app/assets/{haskell-Ccj1mGN_.js → haskell-H9hWCrb6.js} +1 -1
- package/dist/app/assets/{haxe-CtvRdMmt.js → haxe-DynXLs0c.js} +1 -1
- package/dist/app/assets/{hcl-HQGsM91R.js → hcl-DU8hXUXo.js} +1 -1
- package/dist/app/assets/{hlsl-U_2FN4GV.js → hlsl-BGurDJ01.js} +1 -1
- package/dist/app/assets/{hoon-DSS3mQR5.js → hoon-Od_h6WWn.js} +1 -1
- package/dist/app/assets/{hpkp-BPnzFZ5n.js → hpkp-CnNmkfHz.js} +1 -1
- package/dist/app/assets/{hsts-BRaWTgmx.js → hsts-DJA5z9FY.js} +1 -1
- package/dist/app/assets/{http-DgZif8XP.js → http-C2OpZukU.js} +1 -1
- package/dist/app/assets/{ichigojam-ypramSfH.js → ichigojam-CrG2EGSI.js} +1 -1
- package/dist/app/assets/{icon-DsD0Czia.js → icon-cOzaCn0m.js} +1 -1
- package/dist/app/assets/{icu-message-format-BVJiYPkB.js → icu-message-format-DDXTMDH-.js} +1 -1
- package/dist/app/assets/{idris-BvurrLkY.js → idris-CFY7Fru9.js} +1 -1
- package/dist/app/assets/{iecst-Clwdf_8K.js → iecst-DxqDXmAZ.js} +1 -1
- package/dist/app/assets/{ignore-DkK-S7HP.js → ignore-50gVavjI.js} +1 -1
- package/dist/app/assets/{index-D-y0b7ri.js → index-3vHiuCMV.js} +170 -170
- package/dist/app/assets/index-CY_xTM-7.css +1 -0
- package/dist/app/assets/{infoDiagram-42DDH7IO-BocjJZwC.js → infoDiagram-42DDH7IO-BhZutCsZ.js} +1 -1
- package/dist/app/assets/{inform7-yFSTqWIe.js → inform7-CwMWEErA.js} +1 -1
- package/dist/app/assets/{ini-BcO8nYi7.js → ini-Cj0QsVUh.js} +1 -1
- package/dist/app/assets/{io-BBkn-xXo.js → io-CaTOfNpm.js} +1 -1
- package/dist/app/assets/{ishikawaDiagram-UXIWVN3A-Dlw93ArC.js → ishikawaDiagram-UXIWVN3A-JJt8O0hb.js} +1 -1
- package/dist/app/assets/{j-M5UTfImQ.js → j-B9yG1_XZ.js} +1 -1
- package/dist/app/assets/{java-Xjo5k22g.js → java-CcqZsJHc.js} +1 -1
- package/dist/app/assets/{javadoc-D6lpCK4S.js → javadoc-BdkFH1qi.js} +1 -1
- package/dist/app/assets/{javadoclike-DGBCsKaU.js → javadoclike-BBDtbsNc.js} +1 -1
- package/dist/app/assets/{javascript-DkE8xAaV.js → javascript-0ZJ71oW2.js} +1 -1
- package/dist/app/assets/{javastacktrace-Be5zC165.js → javastacktrace-yNjh86GL.js} +1 -1
- package/dist/app/assets/{jexl-C1l-HPYI.js → jexl-BwLpMn8D.js} +1 -1
- package/dist/app/assets/{jolie-CRI76P3X.js → jolie-BiDUXy8i.js} +1 -1
- package/dist/app/assets/{journeyDiagram-VCZTEJTY-BOongVs3.js → journeyDiagram-VCZTEJTY-BkVWz3Vf.js} +1 -1
- package/dist/app/assets/{jq-CrFpn7ql.js → jq-CCJ3EBtV.js} +1 -1
- package/dist/app/assets/{js-extras-BvLZUIJ5.js → js-extras-Ck7OEXSL.js} +1 -1
- package/dist/app/assets/{js-templates-fYKII4Os.js → js-templates-DjSt7lxm.js} +1 -1
- package/dist/app/assets/{jsdoc-DGONDzA5.js → jsdoc-BcTgtGoR.js} +1 -1
- package/dist/app/assets/{json-BxIxewuG.js → json-tB4iX3yE.js} +1 -1
- package/dist/app/assets/{json5-BP9OBqRe.js → json5-JIq4apAt.js} +1 -1
- package/dist/app/assets/{jsonp-Br67zaRL.js → jsonp-DKXtWLpG.js} +1 -1
- package/dist/app/assets/{jsstacktrace-BB-1Bcpa.js → jsstacktrace-4bYPPqLT.js} +1 -1
- package/dist/app/assets/{jsx-BNfIlN8n.js → jsx-BgQQp2PC.js} +1 -1
- package/dist/app/assets/{julia-DVIi4XSJ.js → julia-Dv7hfdzo.js} +1 -1
- package/dist/app/assets/{kanban-definition-6JOO6SKY-DD7E-Llo.js → kanban-definition-6JOO6SKY-CWuWLs3K.js} +1 -1
- package/dist/app/assets/{keepalived-DmPJ3LF8.js → keepalived-C0mYwr0z.js} +1 -1
- package/dist/app/assets/{keyman-Cp-gCfcq.js → keyman-BKpH4p1R.js} +1 -1
- package/dist/app/assets/{kotlin-DCptm4kq.js → kotlin-mOfhxbOx.js} +1 -1
- package/dist/app/assets/{kumir-Cohjvjog.js → kumir-C6zx-0Ca.js} +1 -1
- package/dist/app/assets/{kusto-C2dOIgK1.js → kusto-hO54CA70.js} +1 -1
- package/dist/app/assets/{latex-DaFCffTw.js → latex-Dzk8WiHu.js} +1 -1
- package/dist/app/assets/{latte-D2mtlTen.js → latte-b3QfOSp4.js} +1 -1
- package/dist/app/assets/{layout-C7fpWjpB.js → layout-DBe88OgK.js} +1 -1
- package/dist/app/assets/{less-CycfawGH.js → less-B4kl6C6H.js} +1 -1
- package/dist/app/assets/{lilypond-DrvS8AAl.js → lilypond-kwN07IjR.js} +1 -1
- package/dist/app/assets/{linear-2np4qyjJ.js → linear-DFqpmono.js} +1 -1
- package/dist/app/assets/{liquid-BQH0bAHC.js → liquid-CMRtVaic.js} +1 -1
- package/dist/app/assets/{lisp-BCWvn2A1.js → lisp-D12Kpj2D.js} +1 -1
- package/dist/app/assets/{livescript-DGRf3L1-.js → livescript-CB8ITmGz.js} +1 -1
- package/dist/app/assets/{llvm-C_6xvGBO.js → llvm-DBTCiFwL.js} +1 -1
- package/dist/app/assets/{log-uCcZN8k2.js → log-BR6SSFh9.js} +1 -1
- package/dist/app/assets/{lolcode-XEyTNgnB.js → lolcode-BuzAaCM6.js} +1 -1
- package/dist/app/assets/{lua-Dy0fpGeF.js → lua-Ci_ub2Kx.js} +1 -1
- package/dist/app/assets/{magma-D6d2r_W9.js → magma-DqKac23z.js} +1 -1
- package/dist/app/assets/{makefile-DOydYPAQ.js → makefile-ClFyCfh0.js} +1 -1
- package/dist/app/assets/{markdown-CPxRHFza.js → markdown-CJP4BvY0.js} +1 -1
- package/dist/app/assets/{markup-jgYp2Lb8.js → markup-BqBuEoCj.js} +1 -1
- package/dist/app/assets/{markup-templating-lT8EutTe.js → markup-templating-gWox0fgS.js} +1 -1
- package/dist/app/assets/{matlab-y_OOgSc_.js → matlab-D8fITaV4.js} +1 -1
- package/dist/app/assets/{maxscript-PMli6_xE.js → maxscript-BONF8rMy.js} +1 -1
- package/dist/app/assets/{mel-CIopQCOU.js → mel-C055oCEm.js} +1 -1
- package/dist/app/assets/{mermaid-CN6aoo9D.js → mermaid-CJgXcURP.js} +1 -1
- package/dist/app/assets/{min-DDl12nhy.js → min-C4k7eVH-.js} +1 -1
- package/dist/app/assets/{mindmap-definition-QFDTVHPH-Bosd0mf9.js → mindmap-definition-QFDTVHPH-D5WLdtFz.js} +1 -1
- package/dist/app/assets/{mizar-A9B8KORd.js → mizar-DfBcXuj4.js} +1 -1
- package/dist/app/assets/{mongodb-DV-yCsoK.js → mongodb-BBCH2cAI.js} +1 -1
- package/dist/app/assets/{monkey-HEFodtZa.js → monkey-5xytVR9c.js} +1 -1
- package/dist/app/assets/{moonscript-Bj3xAxEV.js → moonscript-DTD_dUoG.js} +1 -1
- package/dist/app/assets/{n1ql-DX2KWloB.js → n1ql-CKMBpvrf.js} +1 -1
- package/dist/app/assets/{n4js-DQoNqDS9.js → n4js-BLOx_BAB.js} +1 -1
- package/dist/app/assets/{nand2tetris-hdl-BFqj7ePK.js → nand2tetris-hdl-B-nkUk0U.js} +1 -1
- package/dist/app/assets/{naniscript-Cz--o1by.js → naniscript-DFNNmSZZ.js} +1 -1
- package/dist/app/assets/{nasm-Dcb8t8q6.js → nasm-Bp0N-krf.js} +1 -1
- package/dist/app/assets/{neon-CK7vx6_x.js → neon-CdOV9D5g.js} +1 -1
- package/dist/app/assets/{nevod-BePMNPK5.js → nevod-BKMLRWeT.js} +1 -1
- package/dist/app/assets/{nginx-BmbGx2v1.js → nginx-C53g3llS.js} +1 -1
- package/dist/app/assets/{nim-B8GUCE2H.js → nim--ucdlwkH.js} +1 -1
- package/dist/app/assets/{nix-lGZ9zLZy.js → nix-2nB75Hnm.js} +1 -1
- package/dist/app/assets/{nsis-kBAOh3Cs.js → nsis-Cg1me2qV.js} +1 -1
- package/dist/app/assets/{objectivec-Bngj8IHt.js → objectivec-HgsJzBVJ.js} +1 -1
- package/dist/app/assets/{ocaml-Bba8eOIn.js → ocaml-B_DzHMGS.js} +1 -1
- package/dist/app/assets/{opencl-DgfdBrQ_.js → opencl-DBy2C90-.js} +1 -1
- package/dist/app/assets/{openqasm-CQV2wxlC.js → openqasm-kR3M1YBJ.js} +1 -1
- package/dist/app/assets/{oz-CcMDAMF8.js → oz-CsEQzF2k.js} +1 -1
- package/dist/app/assets/{parigp-Cr7bHjhJ.js → parigp-C2gYP3BM.js} +1 -1
- package/dist/app/assets/{parser-DX-CvQ44.js → parser-D7agmsnU.js} +1 -1
- package/dist/app/assets/{pascal-CCpiRTqn.js → pascal-Dk8h_JiR.js} +1 -1
- package/dist/app/assets/{pascaligo-uYvOwN6J.js → pascaligo-DXayKpW1.js} +1 -1
- package/dist/app/assets/{pcaxis-dCoAlH4q.js → pcaxis-BbHDn4xw.js} +1 -1
- package/dist/app/assets/{peoplecode-BZU0iRIF.js → peoplecode-DgWHb3qM.js} +1 -1
- package/dist/app/assets/{perl-Iesy2DKz.js → perl-BCQmJW3u.js} +1 -1
- package/dist/app/assets/{php-a3Z68PaM.js → php-Z7u6UBSf.js} +1 -1
- package/dist/app/assets/{php-extras-CSgWIoUx.js → php-extras-Bbf1PJiM.js} +1 -1
- package/dist/app/assets/{phpdoc-ClEamK9m.js → phpdoc-BUdOOavZ.js} +1 -1
- package/dist/app/assets/{pieDiagram-DEJITSTG-D3AaN8D3.js → pieDiagram-DEJITSTG-Bk_gHD7q.js} +1 -1
- package/dist/app/assets/{plsql-BUydR2je.js → plsql-KN64tq9c.js} +1 -1
- package/dist/app/assets/{powerquery-CbE5r1LK.js → powerquery-DL49etLI.js} +1 -1
- package/dist/app/assets/{powershell-DubIcaqQ.js → powershell-jryB4gBu.js} +1 -1
- package/dist/app/assets/{processing-CGZk9MFa.js → processing-D-nRflir.js} +1 -1
- package/dist/app/assets/{prolog-DWiKE05T.js → prolog-J9p2Dtp3.js} +1 -1
- package/dist/app/assets/{promql-ZM0X0cVe.js → promql-Bt3PTIs-.js} +1 -1
- package/dist/app/assets/{properties-C_MgCVL7.js → properties-DOzUf5m_.js} +1 -1
- package/dist/app/assets/{protobuf-DTptx08I.js → protobuf-CulfNgOj.js} +1 -1
- package/dist/app/assets/{psl-AUkZATpo.js → psl-UT93PnFk.js} +1 -1
- package/dist/app/assets/{pug-CiJR0sLM.js → pug-Ckrp6b5P.js} +1 -1
- package/dist/app/assets/{puppet-DRojzo7w.js → puppet-wUZgXx_p.js} +1 -1
- package/dist/app/assets/{pure-DAC784GG.js → pure-CNGrkBhJ.js} +1 -1
- package/dist/app/assets/{purebasic-VM4UEIrk.js → purebasic-CwWLgK7e.js} +1 -1
- package/dist/app/assets/{purescript-w5sMhquf.js → purescript-BRm-R-3v.js} +1 -1
- package/dist/app/assets/{q-CBWya0ez.js → q-wRiaQZTW.js} +1 -1
- package/dist/app/assets/{qml-BO1SKCTG.js → qml-hZdBAFTK.js} +1 -1
- package/dist/app/assets/{qore-BLEy3V2Q.js → qore-Cye0wnFE.js} +1 -1
- package/dist/app/assets/{qsharp-DpGm5nXm.js → qsharp-DufTxaMQ.js} +1 -1
- package/dist/app/assets/{quadrantDiagram-34T5L4WZ-zqVJRfM0.js → quadrantDiagram-34T5L4WZ-BSbm0wBP.js} +1 -1
- package/dist/app/assets/{r-DJwW4woE.js → r-JhyQLVqm.js} +1 -1
- package/dist/app/assets/{racket-tfAlhm9J.js → racket-CcEcl1lQ.js} +1 -1
- package/dist/app/assets/{reason-CuQcs6Us.js → reason-WFsaqaXn.js} +1 -1
- package/dist/app/assets/{regex-BjBaDCpX.js → regex-Cj5qFUZM.js} +1 -1
- package/dist/app/assets/{rego-DWENKceX.js → rego-CfoDWHPw.js} +1 -1
- package/dist/app/assets/{renpy-BgVqATTk.js → renpy-D3lRim5H.js} +1 -1
- package/dist/app/assets/{requirementDiagram-MS252O5E-B8E8SJly.js → requirementDiagram-MS252O5E-BNs2nP8U.js} +1 -1
- package/dist/app/assets/{rest-B9oIUmDJ.js → rest-DktyegXU.js} +1 -1
- package/dist/app/assets/{rip-kd5zQPVz.js → rip-D0VY5apf.js} +1 -1
- package/dist/app/assets/{roboconf-B1kUkQdY.js → roboconf-y6-jDOpj.js} +1 -1
- package/dist/app/assets/{robotframework-B8Cn6zw0.js → robotframework-CC00uJgj.js} +1 -1
- package/dist/app/assets/{ruby-CnbgIhf_.js → ruby-dAbspD_k.js} +1 -1
- package/dist/app/assets/{rust-C8OTkz5t.js → rust-7wWC8B4O.js} +1 -1
- package/dist/app/assets/{sankeyDiagram-XADWPNL6-BWdy5fPK.js → sankeyDiagram-XADWPNL6-CvpH_gH5.js} +1 -1
- package/dist/app/assets/{sas-Dw7vQpkk.js → sas-BMwqJCyV.js} +1 -1
- package/dist/app/assets/{sass-b7SoCESY.js → sass-Deo2TBca.js} +1 -1
- package/dist/app/assets/{scala-D-p3rZbv.js → scala-CDQ_Q6w1.js} +1 -1
- package/dist/app/assets/{scheme-BPbr0IV_.js → scheme-Dnvc5SgS.js} +1 -1
- package/dist/app/assets/{scss-Cyjt-V6Q.js → scss-CQnjZBSP.js} +1 -1
- package/dist/app/assets/{sequenceDiagram-FGHM5R23-D-ACA62M.js → sequenceDiagram-FGHM5R23-CbfExnPM.js} +1 -1
- package/dist/app/assets/{shell-session-C7s1XZ_p.js → shell-session-CUzpt9u_.js} +1 -1
- package/dist/app/assets/{smali-C621-SJz.js → smali-gUIPUNS_.js} +1 -1
- package/dist/app/assets/{smalltalk-CuF0kpcz.js → smalltalk-BWqWeTOj.js} +1 -1
- package/dist/app/assets/{smarty-CHbvlN7a.js → smarty-D_6NQwpr.js} +1 -1
- package/dist/app/assets/{sml-BGi33Pu0.js → sml-C6fu3ORs.js} +1 -1
- package/dist/app/assets/{solidity-CZYdcu6z.js → solidity-aHCvIORR.js} +1 -1
- package/dist/app/assets/{solution-file-ChgVI9u6.js → solution-file-rfXcmDEi.js} +1 -1
- package/dist/app/assets/{soy-CWvn9QzG.js → soy-CYlWSpIs.js} +1 -1
- package/dist/app/assets/{sparql-7JjN18LQ.js → sparql-BAW721Ow.js} +1 -1
- package/dist/app/assets/{splunk-spl-DOh97vYU.js → splunk-spl-BTzYVj8d.js} +1 -1
- package/dist/app/assets/{sqf-x5ivlIR7.js → sqf-UIbNftU1.js} +1 -1
- package/dist/app/assets/{sql-BshsXXbk.js → sql-CgGxned9.js} +1 -1
- package/dist/app/assets/{squirrel-BtrGPSbs.js → squirrel-CIcV4Ny-.js} +1 -1
- package/dist/app/assets/{stan-sDuPYbZs.js → stan-DgfUhApV.js} +1 -1
- package/dist/app/assets/{stateDiagram-FHFEXIEX-C06KYdye.js → stateDiagram-FHFEXIEX-D1iTvQX_.js} +1 -1
- package/dist/app/assets/stateDiagram-v2-QKLJ7IA2-BCtIcdWI.js +1 -0
- package/dist/app/assets/{stylus-9qu1XZ91.js → stylus-sv3Ey9M5.js} +1 -1
- package/dist/app/assets/{swift-UgAKrg8O.js → swift-DS573qiY.js} +1 -1
- package/dist/app/assets/{systemd-D1t2IK6h.js → systemd-CzDCvoIg.js} +1 -1
- package/dist/app/assets/{t4-cs-D5pPXmrn.js → t4-cs-D4nbx6z2.js} +1 -1
- package/dist/app/assets/{t4-templating-DGpA7dEe.js → t4-templating-BMZwZyOE.js} +1 -1
- package/dist/app/assets/{t4-vb-DeaFY-L7.js → t4-vb-DIeP4ybv.js} +1 -1
- package/dist/app/assets/{tap-B2Jlbmzn.js → tap-De3Jnd4S.js} +1 -1
- package/dist/app/assets/{tcl-D3Cxl9RS.js → tcl-BjCUiiee.js} +1 -1
- package/dist/app/assets/{textile-vleyTozU.js → textile-DZ3GKhqr.js} +1 -1
- package/dist/app/assets/{timeline-definition-GMOUNBTQ-DSaRfuOY.js → timeline-definition-GMOUNBTQ-DNIfYJfl.js} +1 -1
- package/dist/app/assets/{toml-Qo-F6Xf4.js → toml-On6uzvVe.js} +1 -1
- package/dist/app/assets/{tremor-J5ixbTSm.js → tremor-BU60aKH_.js} +1 -1
- package/dist/app/assets/{tt2-DOa_Af-o.js → tt2-BuKbFZt_.js} +1 -1
- package/dist/app/assets/{turtle-D8Su1Ry0.js → turtle-DXMNKdPK.js} +1 -1
- package/dist/app/assets/{twig-GBJoDW8g.js → twig-Bo_MbBRd.js} +1 -1
- package/dist/app/assets/{typescript-DimFy1wk.js → typescript-CR7wxlXD.js} +1 -1
- package/dist/app/assets/{typoscript-Corm9VPj.js → typoscript-CMw0wwok.js} +1 -1
- package/dist/app/assets/{unrealscript-dSS5kIDz.js → unrealscript-B776bLew.js} +1 -1
- package/dist/app/assets/{uorazor-BGl4DTbK.js → uorazor-BYELARrG.js} +1 -1
- package/dist/app/assets/{uri-B403JigU.js → uri-CRKYpN9S.js} +1 -1
- package/dist/app/assets/{v-D1nzy8SK.js → v-YJo6805g.js} +1 -1
- package/dist/app/assets/{vala-CbskSA-6.js → vala-gsYpVkOH.js} +1 -1
- package/dist/app/assets/{vbnet-BQwFvsFF.js → vbnet-CmBlYcGa.js} +1 -1
- package/dist/app/assets/{velocity-dmmAE00U.js → velocity-Q2c3XfQY.js} +1 -1
- package/dist/app/assets/{vennDiagram-DHZGUBPP-BZ7Hb9Hn.js → vennDiagram-DHZGUBPP-BadpBWfC.js} +1 -1
- package/dist/app/assets/{verilog-BMPc4qiW.js → verilog-5WEqrogK.js} +1 -1
- package/dist/app/assets/{vhdl-BwLIiaQ3.js → vhdl-Co2ZNHLl.js} +1 -1
- package/dist/app/assets/{vim-NxGSno01.js → vim-BWHpRDI0.js} +1 -1
- package/dist/app/assets/{visual-basic-DT3do2iL.js → visual-basic-DdcJ6qp_.js} +1 -1
- package/dist/app/assets/{wardley-RL74JXVD-BQuDsmFg.js → wardley-RL74JXVD-nnCu88t4.js} +1 -1
- package/dist/app/assets/{wardleyDiagram-NUSXRM2D-DwMCEfDA.js → wardleyDiagram-NUSXRM2D-DLRxHCOy.js} +1 -1
- package/dist/app/assets/{warpscript-natO4zPn.js → warpscript-DQTWfQQI.js} +1 -1
- package/dist/app/assets/{wasm-BfugFzDn.js → wasm-P74bjf6T.js} +1 -1
- package/dist/app/assets/{web-idl-Bics_ax6.js → web-idl-BwlVUL20.js} +1 -1
- package/dist/app/assets/{wiki-Blq646qq.js → wiki-3koXxGGM.js} +1 -1
- package/dist/app/assets/{wolfram-Ddn6uV9M.js → wolfram-GHXEYNh8.js} +1 -1
- package/dist/app/assets/{wren-CZ9gfbdr.js → wren-DDEdbB41.js} +1 -1
- package/dist/app/assets/{xeora-zVJDHWYP.js → xeora-C5eIogh-.js} +1 -1
- package/dist/app/assets/{xml-doc-D9g-q5Fh.js → xml-doc-Dxj1u1SJ.js} +1 -1
- package/dist/app/assets/{xojo-WpdjfLKR.js → xojo-CeTBKDSR.js} +1 -1
- package/dist/app/assets/{xquery-DFrusbUY.js → xquery-C4vwM7F2.js} +1 -1
- package/dist/app/assets/{xychartDiagram-5P7HB3ND-BRMmacnH.js → xychartDiagram-5P7HB3ND-8doH-fTN.js} +1 -1
- package/dist/app/assets/{yaml-DB6og7ei.js → yaml-Clzy20XF.js} +1 -1
- package/dist/app/assets/{yang-CdFoUEPj.js → yang-BTHiGiHX.js} +1 -1
- package/dist/app/assets/{zig-C79X6U04.js → zig-BkXx74nT.js} +1 -1
- package/dist/app/index.html +2 -2
- package/dist/index.cjs +869 -578
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +837 -545
- package/package.json +3 -3
- package/dist/app/assets/channel-B6zrZ2OM.js +0 -1
- package/dist/app/assets/classDiagram-6PBFFD2Q-CrRCjWNC.js +0 -1
- package/dist/app/assets/classDiagram-v2-HSJHXN6E-CrRCjWNC.js +0 -1
- package/dist/app/assets/clone-DF9MaeHz.js +0 -1
- package/dist/app/assets/index-D4gddvdJ.css +0 -1
- package/dist/app/assets/stateDiagram-v2-QKLJ7IA2-sEMQqWl2.js +0 -1
package/dist/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
// src/components/chat.tsx
|
|
2
|
-
import * as
|
|
2
|
+
import * as React45 from "react";
|
|
3
3
|
import {
|
|
4
4
|
ArrowDown as ArrowDown2,
|
|
5
5
|
FileText as FileText3,
|
|
6
6
|
ImageIcon,
|
|
7
7
|
Loader2 as Loader26,
|
|
8
|
+
Minus,
|
|
8
9
|
Pencil as Pencil4,
|
|
9
10
|
Quote,
|
|
10
11
|
RefreshCw as RefreshCw2,
|
|
@@ -1285,6 +1286,7 @@ var en_US_default = {
|
|
|
1285
1286
|
loadingThread: "Loading thread...",
|
|
1286
1287
|
stop: "Stop",
|
|
1287
1288
|
send: "Send message",
|
|
1289
|
+
minimizeToPet: "Minimize to pet",
|
|
1288
1290
|
referencedContentOnly: "Referenced content",
|
|
1289
1291
|
youLabel: "You",
|
|
1290
1292
|
scrollToBottom: "Scroll to bottom",
|
|
@@ -1566,6 +1568,14 @@ var en_US_default = {
|
|
|
1566
1568
|
copy: "Copy",
|
|
1567
1569
|
copied: "Copied",
|
|
1568
1570
|
separator: ", ",
|
|
1571
|
+
shell: {
|
|
1572
|
+
success: "Success",
|
|
1573
|
+
running: "Running",
|
|
1574
|
+
failed: "Failed",
|
|
1575
|
+
exitCode: "Exit code {{code}}",
|
|
1576
|
+
ranCommand: "Ran {{command}}",
|
|
1577
|
+
runningCommand: "Running {{command}}"
|
|
1578
|
+
},
|
|
1569
1579
|
categories: {
|
|
1570
1580
|
files: {
|
|
1571
1581
|
one: "{{count}} file",
|
|
@@ -1617,6 +1627,7 @@ var zh_CN_default = {
|
|
|
1617
1627
|
loadingThread: "\u6B63\u5728\u52A0\u8F7D\u7EBF\u7A0B...",
|
|
1618
1628
|
stop: "\u505C\u6B62",
|
|
1619
1629
|
send: "\u53D1\u9001\u6D88\u606F",
|
|
1630
|
+
minimizeToPet: "\u6700\u5C0F\u5316\u5230 Pet",
|
|
1620
1631
|
referencedContentOnly: "\u5DF2\u5F15\u7528\u5185\u5BB9",
|
|
1621
1632
|
youLabel: "\u4F60",
|
|
1622
1633
|
scrollToBottom: "\u56DE\u5230\u5E95\u90E8",
|
|
@@ -1898,6 +1909,14 @@ var zh_CN_default = {
|
|
|
1898
1909
|
copy: "\u590D\u5236",
|
|
1899
1910
|
copied: "\u5DF2\u590D\u5236",
|
|
1900
1911
|
separator: "\uFF0C",
|
|
1912
|
+
shell: {
|
|
1913
|
+
success: "\u6210\u529F",
|
|
1914
|
+
running: "\u8FD0\u884C\u4E2D",
|
|
1915
|
+
failed: "\u5931\u8D25",
|
|
1916
|
+
exitCode: "\u9000\u51FA\u7801 {{code}}",
|
|
1917
|
+
ranCommand: "\u5DF2\u8FD0\u884C {{command}}",
|
|
1918
|
+
runningCommand: "\u6B63\u5728\u8FD0\u884C {{command}}"
|
|
1919
|
+
},
|
|
1901
1920
|
categories: {
|
|
1902
1921
|
files: {
|
|
1903
1922
|
one: "{{count}} \u4E2A\u6587\u4EF6",
|
|
@@ -6820,7 +6839,7 @@ function useSlashCommands({
|
|
|
6820
6839
|
}
|
|
6821
6840
|
|
|
6822
6841
|
// src/components/thread/messages/ai.tsx
|
|
6823
|
-
import * as
|
|
6842
|
+
import * as React32 from "react";
|
|
6824
6843
|
import {
|
|
6825
6844
|
ChevronDown as ChevronDown4,
|
|
6826
6845
|
Clock3 as Clock32,
|
|
@@ -9020,16 +9039,16 @@ function hasComponentMessageRendererDetails(renderer, content, data) {
|
|
|
9020
9039
|
}
|
|
9021
9040
|
|
|
9022
9041
|
// src/components/thread/messages/tool-component-group.tsx
|
|
9023
|
-
import * as
|
|
9042
|
+
import * as React30 from "react";
|
|
9024
9043
|
import {
|
|
9025
9044
|
BookOpen,
|
|
9026
9045
|
Brain as Brain3,
|
|
9027
9046
|
Building2,
|
|
9028
|
-
Check as
|
|
9047
|
+
Check as Check4,
|
|
9029
9048
|
CheckCircle2 as CheckCircle23,
|
|
9030
9049
|
ChevronRight as ChevronRight7,
|
|
9031
9050
|
CircleHelp,
|
|
9032
|
-
Copy,
|
|
9051
|
+
Copy as Copy2,
|
|
9033
9052
|
FileText as FileText2,
|
|
9034
9053
|
Files,
|
|
9035
9054
|
Loader2 as Loader24,
|
|
@@ -9041,7 +9060,248 @@ import {
|
|
|
9041
9060
|
Wrench as Wrench2,
|
|
9042
9061
|
XCircle as XCircle2
|
|
9043
9062
|
} from "lucide-react";
|
|
9063
|
+
|
|
9064
|
+
// src/components/thread/messages/sandbox-shell-tool-call.tsx
|
|
9065
|
+
import * as React29 from "react";
|
|
9066
|
+
import { Check as Check3, Copy } from "lucide-react";
|
|
9044
9067
|
import { jsx as jsx34, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
9068
|
+
var SANDBOX_SHELL_TEXT_CLASS = "text-[13px] leading-5 in-data-[density=compact]:text-xs in-data-[density=compact]:leading-4 in-data-[density=spacious]:text-sm in-data-[density=spacious]:leading-6";
|
|
9069
|
+
var SANDBOX_SHELL_SECTION_GAP_CLASS = "mt-2 in-data-[density=compact]:mt-1.5 in-data-[density=spacious]:mt-3";
|
|
9070
|
+
function normalizeShellToken(value) {
|
|
9071
|
+
if (typeof value !== "string") return null;
|
|
9072
|
+
const normalized = value.trim().toLowerCase().replace(/[\s-]+/g, "_");
|
|
9073
|
+
return normalized || null;
|
|
9074
|
+
}
|
|
9075
|
+
function isPlainObject(value) {
|
|
9076
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
9077
|
+
}
|
|
9078
|
+
function readShellString(value) {
|
|
9079
|
+
if (typeof value !== "string") return null;
|
|
9080
|
+
const trimmed = value.trim();
|
|
9081
|
+
return trimmed || null;
|
|
9082
|
+
}
|
|
9083
|
+
function stringifyShellText(value) {
|
|
9084
|
+
if (value === null || value === void 0) return null;
|
|
9085
|
+
if (typeof value === "string") return value;
|
|
9086
|
+
if (typeof value === "number" || typeof value === "boolean") {
|
|
9087
|
+
return String(value);
|
|
9088
|
+
}
|
|
9089
|
+
if (Array.isArray(value)) {
|
|
9090
|
+
const output = value.map((item) => stringifyShellText(item)).filter((item) => item !== null).join("");
|
|
9091
|
+
return output || null;
|
|
9092
|
+
}
|
|
9093
|
+
if (!isPlainObject(value)) return formatDisplayValue(value);
|
|
9094
|
+
const source = value;
|
|
9095
|
+
const textParts = [
|
|
9096
|
+
source.stdout,
|
|
9097
|
+
source.stderr,
|
|
9098
|
+
source.output,
|
|
9099
|
+
source.text,
|
|
9100
|
+
source.logs,
|
|
9101
|
+
source.content,
|
|
9102
|
+
source.chunk,
|
|
9103
|
+
source.delta
|
|
9104
|
+
].map((item) => stringifyShellText(item)).filter((item) => item !== null && item.length > 0);
|
|
9105
|
+
if (textParts.length > 0) return textParts.join("");
|
|
9106
|
+
return null;
|
|
9107
|
+
}
|
|
9108
|
+
function getSandboxShellCommand(data, language) {
|
|
9109
|
+
const input = data.input;
|
|
9110
|
+
if (typeof input === "string") return input;
|
|
9111
|
+
if (isPlainObject(input)) {
|
|
9112
|
+
const source = input;
|
|
9113
|
+
const command = readShellString(source.command) ?? readShellString(source.cmd) ?? readShellString(source.input);
|
|
9114
|
+
if (command) return command;
|
|
9115
|
+
}
|
|
9116
|
+
const payload = data.data;
|
|
9117
|
+
if (isPlainObject(payload)) {
|
|
9118
|
+
const source = payload;
|
|
9119
|
+
const command = readShellString(source.command) ?? readShellString(source.cmd) ?? readShellString(source.input);
|
|
9120
|
+
if (command) return command;
|
|
9121
|
+
}
|
|
9122
|
+
return readShellString(resolveLocalizedText(data.message, language)) ?? readShellString(resolveLocalizedText(data.title, language)) ?? "sandbox_shell";
|
|
9123
|
+
}
|
|
9124
|
+
function getSandboxShellOutput(data) {
|
|
9125
|
+
const output = stringifyShellText(data.output) ?? stringifyShellText(data.data) ?? stringifyShellText(data.error);
|
|
9126
|
+
return output ?? "";
|
|
9127
|
+
}
|
|
9128
|
+
function readExitCodeFrom(value) {
|
|
9129
|
+
if (!isPlainObject(value)) return null;
|
|
9130
|
+
const source = value;
|
|
9131
|
+
const candidate = source.exit_code ?? source.exitCode ?? source.return_code ?? source.returnCode ?? source.code;
|
|
9132
|
+
if (typeof candidate === "number" && Number.isFinite(candidate)) {
|
|
9133
|
+
return candidate;
|
|
9134
|
+
}
|
|
9135
|
+
if (typeof candidate === "string" && candidate.trim() !== "") {
|
|
9136
|
+
const parsed = Number(candidate);
|
|
9137
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
9138
|
+
}
|
|
9139
|
+
return null;
|
|
9140
|
+
}
|
|
9141
|
+
function getSandboxShellExitCode(data) {
|
|
9142
|
+
return readExitCodeFrom(data.output) ?? readExitCodeFrom(data.data) ?? readExitCodeFrom(data);
|
|
9143
|
+
}
|
|
9144
|
+
function isSandboxShellStep(data) {
|
|
9145
|
+
const namedData = data;
|
|
9146
|
+
return [data.tool, data.type, data.title, namedData.name].some(
|
|
9147
|
+
(value) => normalizeShellToken(value) === "sandbox_shell"
|
|
9148
|
+
);
|
|
9149
|
+
}
|
|
9150
|
+
function formatShellCommand(command) {
|
|
9151
|
+
const trimmed = command.trim();
|
|
9152
|
+
return trimmed.startsWith("$") ? trimmed : `$ ${trimmed}`;
|
|
9153
|
+
}
|
|
9154
|
+
function getSandboxShellActivityLabel(data, status, language, t) {
|
|
9155
|
+
const command = getSandboxShellCommand(data, language);
|
|
9156
|
+
const key = status === "running" ? "message.toolGroup.shell.runningCommand" : "message.toolGroup.shell.ranCommand";
|
|
9157
|
+
return t(key, { command });
|
|
9158
|
+
}
|
|
9159
|
+
function ShellCopyButton({
|
|
9160
|
+
value,
|
|
9161
|
+
className
|
|
9162
|
+
}) {
|
|
9163
|
+
const { t } = useChatkitTranslation();
|
|
9164
|
+
const [isCopied, setIsCopied] = React29.useState(false);
|
|
9165
|
+
const resetTimeoutRef = React29.useRef(null);
|
|
9166
|
+
const clearResetTimeout = React29.useCallback(() => {
|
|
9167
|
+
if (resetTimeoutRef.current === null) return;
|
|
9168
|
+
window.clearTimeout(resetTimeoutRef.current);
|
|
9169
|
+
resetTimeoutRef.current = null;
|
|
9170
|
+
}, []);
|
|
9171
|
+
React29.useEffect(() => clearResetTimeout, [clearResetTimeout]);
|
|
9172
|
+
const handleCopy = React29.useCallback(() => {
|
|
9173
|
+
if (typeof navigator === "undefined" || !navigator.clipboard) return;
|
|
9174
|
+
void navigator.clipboard.writeText(value).then(() => {
|
|
9175
|
+
setIsCopied(true);
|
|
9176
|
+
clearResetTimeout();
|
|
9177
|
+
resetTimeoutRef.current = window.setTimeout(() => {
|
|
9178
|
+
setIsCopied(false);
|
|
9179
|
+
resetTimeoutRef.current = null;
|
|
9180
|
+
}, 1500);
|
|
9181
|
+
}).catch(() => void 0);
|
|
9182
|
+
}, [clearResetTimeout, value]);
|
|
9183
|
+
const label = isCopied ? t("message.toolGroup.copied") : t("message.toolGroup.copy");
|
|
9184
|
+
return /* @__PURE__ */ jsx34(
|
|
9185
|
+
"button",
|
|
9186
|
+
{
|
|
9187
|
+
type: "button",
|
|
9188
|
+
className: cn(
|
|
9189
|
+
"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-background hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
|
|
9190
|
+
className
|
|
9191
|
+
),
|
|
9192
|
+
"aria-label": label,
|
|
9193
|
+
title: label,
|
|
9194
|
+
onClick: handleCopy,
|
|
9195
|
+
children: isCopied ? /* @__PURE__ */ jsx34(Check3, { className: "h-3.5 w-3.5", "aria-hidden": "true" }) : /* @__PURE__ */ jsx34(Copy, { className: "h-3.5 w-3.5", "aria-hidden": "true" })
|
|
9196
|
+
}
|
|
9197
|
+
);
|
|
9198
|
+
}
|
|
9199
|
+
function SandboxShellStatus({
|
|
9200
|
+
data,
|
|
9201
|
+
exitCode
|
|
9202
|
+
}) {
|
|
9203
|
+
const { t } = useChatkitTranslation();
|
|
9204
|
+
if (exitCode !== null) {
|
|
9205
|
+
return /* @__PURE__ */ jsx34("span", { className: "text-muted-foreground/90", children: t("message.toolGroup.shell.exitCode", { code: exitCode }) });
|
|
9206
|
+
}
|
|
9207
|
+
if (data.status === "running") {
|
|
9208
|
+
return /* @__PURE__ */ jsx34("span", { className: "text-muted-foreground/90", children: t("message.toolGroup.shell.running") });
|
|
9209
|
+
}
|
|
9210
|
+
if (data.status === "fail" || data.error) {
|
|
9211
|
+
return /* @__PURE__ */ jsx34("span", { className: "text-destructive/90", children: t("message.toolGroup.shell.failed") });
|
|
9212
|
+
}
|
|
9213
|
+
return /* @__PURE__ */ jsxs22("span", { className: "inline-flex items-center gap-1 text-muted-foreground/90", children: [
|
|
9214
|
+
/* @__PURE__ */ jsx34(Check3, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
|
|
9215
|
+
t("message.toolGroup.shell.success")
|
|
9216
|
+
] });
|
|
9217
|
+
}
|
|
9218
|
+
function SandboxShellToolCallCard({ data }) {
|
|
9219
|
+
const { i18n: i18n2 } = useChatkitTranslation();
|
|
9220
|
+
const command = getSandboxShellCommand(data, i18n2.language);
|
|
9221
|
+
const formattedCommand = formatShellCommand(command);
|
|
9222
|
+
const output = getSandboxShellOutput(data);
|
|
9223
|
+
const exitCode = getSandboxShellExitCode(data);
|
|
9224
|
+
const copyButtonClassName = "absolute right-1 top-1 h-6 w-6 opacity-0 transition-opacity group-hover/shell-copy:opacity-100 group-focus-within/shell-copy:opacity-100 in-data-[density=compact]:right-0.5 in-data-[density=compact]:top-0.5 in-data-[density=compact]:h-5 in-data-[density=compact]:w-5 in-data-[density=spacious]:right-1.5 in-data-[density=spacious]:top-1.5 in-data-[density=spacious]:h-7 in-data-[density=spacious]:w-7";
|
|
9225
|
+
return /* @__PURE__ */ jsxs22(
|
|
9226
|
+
"div",
|
|
9227
|
+
{
|
|
9228
|
+
className: "flex max-h-64 min-w-0 flex-col overflow-hidden rounded-md bg-muted/60 px-3 py-2 text-left shadow-sm ring-1 ring-border/30 in-data-[density=compact]:max-h-52 in-data-[density=compact]:px-2 in-data-[density=compact]:py-1.5 in-data-[density=spacious]:max-h-80 in-data-[density=spacious]:px-4 in-data-[density=spacious]:py-3",
|
|
9229
|
+
"data-slot": "sandbox-shell-tool-call",
|
|
9230
|
+
"aria-label": "Shell",
|
|
9231
|
+
children: [
|
|
9232
|
+
/* @__PURE__ */ jsx34(
|
|
9233
|
+
"div",
|
|
9234
|
+
{
|
|
9235
|
+
className: cn(
|
|
9236
|
+
"font-medium text-muted-foreground",
|
|
9237
|
+
SANDBOX_SHELL_TEXT_CLASS
|
|
9238
|
+
),
|
|
9239
|
+
children: "Shell"
|
|
9240
|
+
}
|
|
9241
|
+
),
|
|
9242
|
+
/* @__PURE__ */ jsxs22(
|
|
9243
|
+
"div",
|
|
9244
|
+
{
|
|
9245
|
+
className: cn(
|
|
9246
|
+
"group/shell-copy relative min-w-0",
|
|
9247
|
+
SANDBOX_SHELL_SECTION_GAP_CLASS
|
|
9248
|
+
),
|
|
9249
|
+
children: [
|
|
9250
|
+
/* @__PURE__ */ jsx34(
|
|
9251
|
+
"pre",
|
|
9252
|
+
{
|
|
9253
|
+
className: cn(
|
|
9254
|
+
"whitespace-pre-wrap break-words pr-8 font-mono text-foreground in-data-[density=compact]:pr-6 in-data-[density=spacious]:pr-10",
|
|
9255
|
+
SANDBOX_SHELL_TEXT_CLASS
|
|
9256
|
+
),
|
|
9257
|
+
"data-slot": "sandbox-shell-command",
|
|
9258
|
+
children: formattedCommand
|
|
9259
|
+
}
|
|
9260
|
+
),
|
|
9261
|
+
/* @__PURE__ */ jsx34(ShellCopyButton, { value: command, className: copyButtonClassName })
|
|
9262
|
+
]
|
|
9263
|
+
}
|
|
9264
|
+
),
|
|
9265
|
+
output ? /* @__PURE__ */ jsxs22(
|
|
9266
|
+
"div",
|
|
9267
|
+
{
|
|
9268
|
+
className: cn(
|
|
9269
|
+
"group/shell-copy relative min-h-0 flex-1",
|
|
9270
|
+
SANDBOX_SHELL_SECTION_GAP_CLASS
|
|
9271
|
+
),
|
|
9272
|
+
children: [
|
|
9273
|
+
/* @__PURE__ */ jsx34(
|
|
9274
|
+
"pre",
|
|
9275
|
+
{
|
|
9276
|
+
className: cn(
|
|
9277
|
+
"min-h-0 overflow-auto whitespace-pre pr-8 font-mono text-muted-foreground/85 in-data-[density=compact]:pr-6 in-data-[density=spacious]:pr-10",
|
|
9278
|
+
SANDBOX_SHELL_TEXT_CLASS
|
|
9279
|
+
),
|
|
9280
|
+
"data-slot": "sandbox-shell-output",
|
|
9281
|
+
children: output
|
|
9282
|
+
}
|
|
9283
|
+
),
|
|
9284
|
+
/* @__PURE__ */ jsx34(ShellCopyButton, { value: output, className: copyButtonClassName })
|
|
9285
|
+
]
|
|
9286
|
+
}
|
|
9287
|
+
) : null,
|
|
9288
|
+
/* @__PURE__ */ jsx34(
|
|
9289
|
+
"div",
|
|
9290
|
+
{
|
|
9291
|
+
className: cn(
|
|
9292
|
+
"mt-3 flex shrink-0 justify-end in-data-[density=compact]:mt-2 in-data-[density=spacious]:mt-4",
|
|
9293
|
+
SANDBOX_SHELL_TEXT_CLASS
|
|
9294
|
+
),
|
|
9295
|
+
children: /* @__PURE__ */ jsx34(SandboxShellStatus, { data, exitCode })
|
|
9296
|
+
}
|
|
9297
|
+
)
|
|
9298
|
+
]
|
|
9299
|
+
}
|
|
9300
|
+
);
|
|
9301
|
+
}
|
|
9302
|
+
|
|
9303
|
+
// src/components/thread/messages/tool-component-group.tsx
|
|
9304
|
+
import { jsx as jsx35, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
9045
9305
|
var toolStatusConfig = {
|
|
9046
9306
|
success: {
|
|
9047
9307
|
iconClass: "border-green-500 text-green-700",
|
|
@@ -9147,10 +9407,10 @@ function formatStepDuration2(durationMs) {
|
|
|
9147
9407
|
return `${minutes}m ${seconds}s`;
|
|
9148
9408
|
}
|
|
9149
9409
|
function useFrozenTimestamp(shouldFreeze) {
|
|
9150
|
-
const [frozenAt, setFrozenAt] =
|
|
9410
|
+
const [frozenAt, setFrozenAt] = React30.useState(
|
|
9151
9411
|
() => shouldFreeze ? Date.now() : null
|
|
9152
9412
|
);
|
|
9153
|
-
|
|
9413
|
+
React30.useEffect(() => {
|
|
9154
9414
|
if (shouldFreeze) {
|
|
9155
9415
|
setFrozenAt((current) => current ?? Date.now());
|
|
9156
9416
|
return;
|
|
@@ -9160,12 +9420,12 @@ function useFrozenTimestamp(shouldFreeze) {
|
|
|
9160
9420
|
return frozenAt;
|
|
9161
9421
|
}
|
|
9162
9422
|
function useToolStepDurationLabel(data, options) {
|
|
9163
|
-
const [durationNow, setDurationNow] =
|
|
9423
|
+
const [durationNow, setDurationNow] = React30.useState(() => Date.now());
|
|
9164
9424
|
const createdAt = parseStepDate(data.created_date);
|
|
9165
9425
|
const explicitEndedAt = parseStepDate(data.end_date);
|
|
9166
9426
|
const status = options?.status ?? data.status;
|
|
9167
9427
|
const endedAt = explicitEndedAt ?? (status !== "running" ? options?.fallbackEndedAt ?? null : null);
|
|
9168
|
-
|
|
9428
|
+
React30.useEffect(() => {
|
|
9169
9429
|
if (status !== "running" || createdAt === null || endedAt !== null) {
|
|
9170
9430
|
return;
|
|
9171
9431
|
}
|
|
@@ -9227,7 +9487,7 @@ function classifyToolToken(value) {
|
|
|
9227
9487
|
if (directMatch) return directMatch;
|
|
9228
9488
|
if (normalized.includes("search")) return "searches";
|
|
9229
9489
|
if (normalized.includes("file")) return "files";
|
|
9230
|
-
if (normalized.includes("command") || normalized.includes("cmd") || normalized.includes("program") || normalized.includes("exec") || normalized.startsWith("run_") || normalized.includes("_run")) {
|
|
9490
|
+
if (normalized.includes("command") || normalized.includes("cmd") || normalized.includes("program") || normalized.includes("exec") || normalized.includes("shell") || normalized.includes("terminal") || normalized.startsWith("run_") || normalized.includes("_run")) {
|
|
9231
9491
|
return "commands";
|
|
9232
9492
|
}
|
|
9233
9493
|
if (normalized.includes("list")) return "lists";
|
|
@@ -9239,6 +9499,7 @@ function classifyToolToken(value) {
|
|
|
9239
9499
|
}
|
|
9240
9500
|
function getToolGroupCategory(content) {
|
|
9241
9501
|
const data = getToolStepData(content);
|
|
9502
|
+
if (isSandboxShellStep(data)) return "commands";
|
|
9242
9503
|
return classifyToolToken(data.type) ?? classifyToolToken(data.tool) ?? classifyToolToken(data.title) ?? classifyToolToken(data.message) ?? "tools";
|
|
9243
9504
|
}
|
|
9244
9505
|
function getToolGroupCategoryCounts(items) {
|
|
@@ -9348,8 +9609,8 @@ function shouldUseToolsetAvatar(toolset) {
|
|
|
9348
9609
|
}
|
|
9349
9610
|
function useToolsetAvatar(toolsetId, enabled, apiUrl) {
|
|
9350
9611
|
const avatarUrl = enabled ? createToolsetAvatarUrl(toolsetId, apiUrl) : null;
|
|
9351
|
-
const [avatar, setAvatar] =
|
|
9352
|
-
|
|
9612
|
+
const [avatar, setAvatar] = React30.useState(null);
|
|
9613
|
+
React30.useEffect(() => {
|
|
9353
9614
|
if (!avatarUrl) {
|
|
9354
9615
|
setAvatar(null);
|
|
9355
9616
|
return;
|
|
@@ -9381,7 +9642,7 @@ function ToolAvatarIcon({
|
|
|
9381
9642
|
className
|
|
9382
9643
|
}) {
|
|
9383
9644
|
if (avatar.url) {
|
|
9384
|
-
return /* @__PURE__ */
|
|
9645
|
+
return /* @__PURE__ */ jsx35(
|
|
9385
9646
|
"img",
|
|
9386
9647
|
{
|
|
9387
9648
|
alt: "",
|
|
@@ -9394,7 +9655,7 @@ function ToolAvatarIcon({
|
|
|
9394
9655
|
}
|
|
9395
9656
|
const emoji = unicodeFromUnified2(avatar.emoji?.unified);
|
|
9396
9657
|
if (emoji) {
|
|
9397
|
-
return /* @__PURE__ */
|
|
9658
|
+
return /* @__PURE__ */ jsx35(
|
|
9398
9659
|
"span",
|
|
9399
9660
|
{
|
|
9400
9661
|
"aria-hidden": "true",
|
|
@@ -9409,7 +9670,7 @@ function ToolAvatarIcon({
|
|
|
9409
9670
|
}
|
|
9410
9671
|
);
|
|
9411
9672
|
}
|
|
9412
|
-
return /* @__PURE__ */
|
|
9673
|
+
return /* @__PURE__ */ jsx35(
|
|
9413
9674
|
CircleHelp,
|
|
9414
9675
|
{
|
|
9415
9676
|
className,
|
|
@@ -9472,12 +9733,12 @@ function ToolStepIcon({
|
|
|
9472
9733
|
apiUrl
|
|
9473
9734
|
);
|
|
9474
9735
|
const iconUrl = createToolsetIconUrl(data.toolset, organizationId, apiUrl);
|
|
9475
|
-
const [failedIconUrl, setFailedIconUrl] =
|
|
9476
|
-
|
|
9736
|
+
const [failedIconUrl, setFailedIconUrl] = React30.useState(null);
|
|
9737
|
+
React30.useEffect(() => {
|
|
9477
9738
|
setFailedIconUrl(null);
|
|
9478
9739
|
}, [iconUrl]);
|
|
9479
9740
|
if (avatar) {
|
|
9480
|
-
return /* @__PURE__ */
|
|
9741
|
+
return /* @__PURE__ */ jsx35(
|
|
9481
9742
|
ToolAvatarIcon,
|
|
9482
9743
|
{
|
|
9483
9744
|
avatar,
|
|
@@ -9487,7 +9748,7 @@ function ToolStepIcon({
|
|
|
9487
9748
|
);
|
|
9488
9749
|
}
|
|
9489
9750
|
if (iconUrl && failedIconUrl !== iconUrl) {
|
|
9490
|
-
return /* @__PURE__ */
|
|
9751
|
+
return /* @__PURE__ */ jsx35(
|
|
9491
9752
|
"img",
|
|
9492
9753
|
{
|
|
9493
9754
|
alt: "",
|
|
@@ -9501,7 +9762,7 @@ function ToolStepIcon({
|
|
|
9501
9762
|
}
|
|
9502
9763
|
const TypeIcon = getStepTypeIcon(data.type);
|
|
9503
9764
|
if (TypeIcon) {
|
|
9504
|
-
return /* @__PURE__ */
|
|
9765
|
+
return /* @__PURE__ */ jsx35(
|
|
9505
9766
|
TypeIcon,
|
|
9506
9767
|
{
|
|
9507
9768
|
className,
|
|
@@ -9512,7 +9773,7 @@ function ToolStepIcon({
|
|
|
9512
9773
|
}
|
|
9513
9774
|
const ToolsetIcon = getKnownToolsetIcon(data.toolset);
|
|
9514
9775
|
if (ToolsetIcon) {
|
|
9515
|
-
return /* @__PURE__ */
|
|
9776
|
+
return /* @__PURE__ */ jsx35(
|
|
9516
9777
|
ToolsetIcon,
|
|
9517
9778
|
{
|
|
9518
9779
|
className,
|
|
@@ -9522,7 +9783,7 @@ function ToolStepIcon({
|
|
|
9522
9783
|
);
|
|
9523
9784
|
}
|
|
9524
9785
|
if (usesToolsetAvatar) {
|
|
9525
|
-
return /* @__PURE__ */
|
|
9786
|
+
return /* @__PURE__ */ jsx35(
|
|
9526
9787
|
CircleHelp,
|
|
9527
9788
|
{
|
|
9528
9789
|
className,
|
|
@@ -9531,7 +9792,7 @@ function ToolStepIcon({
|
|
|
9531
9792
|
}
|
|
9532
9793
|
);
|
|
9533
9794
|
}
|
|
9534
|
-
return /* @__PURE__ */
|
|
9795
|
+
return /* @__PURE__ */ jsx35(
|
|
9535
9796
|
CircleHelp,
|
|
9536
9797
|
{
|
|
9537
9798
|
className,
|
|
@@ -9540,17 +9801,20 @@ function ToolStepIcon({
|
|
|
9540
9801
|
}
|
|
9541
9802
|
);
|
|
9542
9803
|
}
|
|
9543
|
-
function ToolCallCopyButton({
|
|
9804
|
+
function ToolCallCopyButton({
|
|
9805
|
+
value,
|
|
9806
|
+
className
|
|
9807
|
+
}) {
|
|
9544
9808
|
const { t } = useChatkitTranslation();
|
|
9545
|
-
const [isCopied, setIsCopied] =
|
|
9546
|
-
const resetTimeoutRef =
|
|
9547
|
-
const clearResetTimeout =
|
|
9809
|
+
const [isCopied, setIsCopied] = React30.useState(false);
|
|
9810
|
+
const resetTimeoutRef = React30.useRef(null);
|
|
9811
|
+
const clearResetTimeout = React30.useCallback(() => {
|
|
9548
9812
|
if (resetTimeoutRef.current === null) return;
|
|
9549
9813
|
window.clearTimeout(resetTimeoutRef.current);
|
|
9550
9814
|
resetTimeoutRef.current = null;
|
|
9551
9815
|
}, []);
|
|
9552
|
-
|
|
9553
|
-
const handleCopy =
|
|
9816
|
+
React30.useEffect(() => clearResetTimeout, [clearResetTimeout]);
|
|
9817
|
+
const handleCopy = React30.useCallback(() => {
|
|
9554
9818
|
if (typeof navigator === "undefined" || !navigator.clipboard) return;
|
|
9555
9819
|
void navigator.clipboard.writeText(value).then(() => {
|
|
9556
9820
|
setIsCopied(true);
|
|
@@ -9562,15 +9826,18 @@ function ToolCallCopyButton({ value }) {
|
|
|
9562
9826
|
}).catch(() => void 0);
|
|
9563
9827
|
}, [clearResetTimeout, value]);
|
|
9564
9828
|
const label = isCopied ? t("message.toolGroup.copied") : t("message.toolGroup.copy");
|
|
9565
|
-
return /* @__PURE__ */
|
|
9829
|
+
return /* @__PURE__ */ jsx35(
|
|
9566
9830
|
"button",
|
|
9567
9831
|
{
|
|
9568
9832
|
type: "button",
|
|
9569
|
-
className:
|
|
9833
|
+
className: cn(
|
|
9834
|
+
"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-background hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
|
|
9835
|
+
className
|
|
9836
|
+
),
|
|
9570
9837
|
"aria-label": label,
|
|
9571
9838
|
title: label,
|
|
9572
9839
|
onClick: handleCopy,
|
|
9573
|
-
children: isCopied ? /* @__PURE__ */
|
|
9840
|
+
children: isCopied ? /* @__PURE__ */ jsx35(Check4, { className: "h-3.5 w-3.5", "aria-hidden": "true" }) : /* @__PURE__ */ jsx35(Copy2, { className: "h-3.5 w-3.5", "aria-hidden": "true" })
|
|
9574
9841
|
}
|
|
9575
9842
|
);
|
|
9576
9843
|
}
|
|
@@ -9581,28 +9848,28 @@ function ToolCallValueBlock({
|
|
|
9581
9848
|
const { t } = useChatkitTranslation();
|
|
9582
9849
|
const detected = detectJsonValue(value);
|
|
9583
9850
|
if (detected.kind === "text") {
|
|
9584
|
-
return /* @__PURE__ */
|
|
9585
|
-
/* @__PURE__ */
|
|
9586
|
-
/* @__PURE__ */
|
|
9851
|
+
return /* @__PURE__ */ jsxs23("div", { className: "min-w-0 space-y-1", children: [
|
|
9852
|
+
/* @__PURE__ */ jsx35("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx35(ToolCallCopyButton, { value: detected.text }) }),
|
|
9853
|
+
/* @__PURE__ */ jsx35(PlainTextBlock, { value: detected.text, destructive })
|
|
9587
9854
|
] });
|
|
9588
9855
|
}
|
|
9589
|
-
return /* @__PURE__ */
|
|
9590
|
-
/* @__PURE__ */
|
|
9591
|
-
/* @__PURE__ */
|
|
9856
|
+
return /* @__PURE__ */ jsxs23(Tabs, { defaultValue: "tree", className: "min-w-0", children: [
|
|
9857
|
+
/* @__PURE__ */ jsxs23("div", { className: "mb-2 flex min-w-0 items-center justify-between gap-2", children: [
|
|
9858
|
+
/* @__PURE__ */ jsxs23("span", { className: "min-w-0 truncate text-[11px] text-muted-foreground", children: [
|
|
9592
9859
|
t("message.toolGroup.jsonTitle"),
|
|
9593
9860
|
" \xB7 ",
|
|
9594
9861
|
getJsonValueSummary(detected.value)
|
|
9595
9862
|
] }),
|
|
9596
|
-
/* @__PURE__ */
|
|
9597
|
-
/* @__PURE__ */
|
|
9598
|
-
/* @__PURE__ */
|
|
9599
|
-
/* @__PURE__ */
|
|
9600
|
-
/* @__PURE__ */
|
|
9863
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
9864
|
+
/* @__PURE__ */ jsx35(ToolCallCopyButton, { value: detected.raw }),
|
|
9865
|
+
/* @__PURE__ */ jsxs23(TabsList, { className: "rounded-md p-0.5", children: [
|
|
9866
|
+
/* @__PURE__ */ jsx35(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "tree", children: t("message.toolGroup.jsonTree") }),
|
|
9867
|
+
/* @__PURE__ */ jsx35(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "raw", children: t("message.toolGroup.jsonRaw") })
|
|
9601
9868
|
] })
|
|
9602
9869
|
] })
|
|
9603
9870
|
] }),
|
|
9604
|
-
/* @__PURE__ */
|
|
9605
|
-
/* @__PURE__ */
|
|
9871
|
+
/* @__PURE__ */ jsx35(TabsContent, { value: "tree", className: "mt-0", children: /* @__PURE__ */ jsx35(JsonTreeView, { value: detected.value }) }),
|
|
9872
|
+
/* @__PURE__ */ jsx35(TabsContent, { value: "raw", className: "mt-0", children: /* @__PURE__ */ jsx35(RawJsonBlock, { raw: detected.raw }) })
|
|
9606
9873
|
] });
|
|
9607
9874
|
}
|
|
9608
9875
|
function DefaultToolCallOutput({ data }) {
|
|
@@ -9610,37 +9877,40 @@ function DefaultToolCallOutput({ data }) {
|
|
|
9610
9877
|
const output = data.output ?? null;
|
|
9611
9878
|
const error = data.error ?? null;
|
|
9612
9879
|
if (error) {
|
|
9613
|
-
return /* @__PURE__ */
|
|
9614
|
-
/* @__PURE__ */
|
|
9615
|
-
/* @__PURE__ */
|
|
9880
|
+
return /* @__PURE__ */ jsxs23("div", { className: "space-y-1", children: [
|
|
9881
|
+
/* @__PURE__ */ jsx35("div", { className: "text-[11px] font-medium text-destructive", children: t("message.toolGroup.errorTitle") }),
|
|
9882
|
+
/* @__PURE__ */ jsx35(ToolCallValueBlock, { value: error, destructive: true })
|
|
9616
9883
|
] });
|
|
9617
9884
|
}
|
|
9618
9885
|
if (output === null) return null;
|
|
9619
|
-
return /* @__PURE__ */
|
|
9620
|
-
/* @__PURE__ */
|
|
9621
|
-
/* @__PURE__ */
|
|
9886
|
+
return /* @__PURE__ */ jsxs23("div", { className: "space-y-1", children: [
|
|
9887
|
+
/* @__PURE__ */ jsx35("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.toolGroup.outputTitle") }),
|
|
9888
|
+
/* @__PURE__ */ jsx35(ToolCallValueBlock, { value: output })
|
|
9622
9889
|
] });
|
|
9623
9890
|
}
|
|
9624
9891
|
function ToolCallDetails({ content }) {
|
|
9625
9892
|
const { t } = useChatkitTranslation();
|
|
9626
9893
|
const data = getToolStepData(content);
|
|
9894
|
+
if (isSandboxShellStep(data)) {
|
|
9895
|
+
return /* @__PURE__ */ jsx35("div", { className: "ml-6 mt-1", children: /* @__PURE__ */ jsx35(SandboxShellToolCallCard, { data }) });
|
|
9896
|
+
}
|
|
9627
9897
|
const renderer = getComponentMessageRenderer(content, data);
|
|
9628
9898
|
const hasCustomDetails = data.error === void 0 && hasComponentMessageRendererDetails(renderer, content, data);
|
|
9629
9899
|
const CustomDetailsRenderer = hasCustomDetails ? renderer?.renderDetails : void 0;
|
|
9630
9900
|
if (CustomDetailsRenderer) {
|
|
9631
|
-
return /* @__PURE__ */
|
|
9901
|
+
return /* @__PURE__ */ jsx35("div", { className: "ml-6 mt-1 max-h-60 overflow-auto rounded-md bg-muted/30 text-xs text-muted-foreground", children: /* @__PURE__ */ jsx35(CustomDetailsRenderer, { content, data }) });
|
|
9632
9902
|
}
|
|
9633
9903
|
const OutputRenderer = getToolCallOutputRenderer(data);
|
|
9634
9904
|
const hasInput = data.input !== void 0 && data.input !== null;
|
|
9635
9905
|
const hasOutput = data.error !== void 0 || data.output !== void 0;
|
|
9636
9906
|
if (!hasInput && !hasOutput) return null;
|
|
9637
|
-
return /* @__PURE__ */
|
|
9638
|
-
hasInput && /* @__PURE__ */
|
|
9639
|
-
/* @__PURE__ */
|
|
9640
|
-
/* @__PURE__ */
|
|
9907
|
+
return /* @__PURE__ */ jsxs23("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: [
|
|
9908
|
+
hasInput && /* @__PURE__ */ jsxs23("div", { className: "space-y-1", children: [
|
|
9909
|
+
/* @__PURE__ */ jsx35("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.toolGroup.inputTitle") }),
|
|
9910
|
+
/* @__PURE__ */ jsx35(ToolCallValueBlock, { value: data.input })
|
|
9641
9911
|
] }),
|
|
9642
|
-
hasInput && hasOutput ? /* @__PURE__ */
|
|
9643
|
-
hasOutput ? /* @__PURE__ */
|
|
9912
|
+
hasInput && hasOutput ? /* @__PURE__ */ jsx35("div", { className: "h-2" }) : null,
|
|
9913
|
+
hasOutput ? /* @__PURE__ */ jsx35(OutputRenderer, { content, data }) : null
|
|
9644
9914
|
] });
|
|
9645
9915
|
}
|
|
9646
9916
|
function areToolCallRowPropsEqual(previous, next) {
|
|
@@ -9652,15 +9922,16 @@ function ToolCallRowContent({
|
|
|
9652
9922
|
organizationId,
|
|
9653
9923
|
apiUrl
|
|
9654
9924
|
}) {
|
|
9655
|
-
const { i18n: i18n2 } = useChatkitTranslation();
|
|
9925
|
+
const { i18n: i18n2, t } = useChatkitTranslation();
|
|
9656
9926
|
const data = getToolStepData(content);
|
|
9657
9927
|
const status = getEffectiveToolStepStatus(data, isThreadRunning);
|
|
9658
9928
|
const hasError = status === "fail" || Boolean(data.error);
|
|
9659
|
-
const
|
|
9929
|
+
const isSandboxShell = isSandboxShellStep(data);
|
|
9930
|
+
const detailsId = React30.useId();
|
|
9660
9931
|
const renderer = getComponentMessageRenderer(content, data);
|
|
9661
|
-
const label = renderer?.getTitle?.(content, data, i18n2.language) ?? getToolActivityLabel(content, i18n2.language, status);
|
|
9932
|
+
const label = isSandboxShell ? getSandboxShellActivityLabel(data, status, i18n2.language, t) : renderer?.getTitle?.(content, data, i18n2.language) ?? getToolActivityLabel(content, i18n2.language, status);
|
|
9662
9933
|
const hasCustomDetails = data.error === void 0 && hasComponentMessageRendererDetails(renderer, content, data);
|
|
9663
|
-
const hasDetails = data.input !== void 0 || data.error !== void 0 || data.output !== void 0 || hasCustomDetails;
|
|
9934
|
+
const hasDetails = isSandboxShell || data.input !== void 0 || data.error !== void 0 || data.output !== void 0 || hasCustomDetails;
|
|
9664
9935
|
const fallbackEndedAt = useFrozenTimestamp(
|
|
9665
9936
|
data.status === "running" && status === "fail"
|
|
9666
9937
|
);
|
|
@@ -9668,14 +9939,14 @@ function ToolCallRowContent({
|
|
|
9668
9939
|
status,
|
|
9669
9940
|
fallbackEndedAt
|
|
9670
9941
|
});
|
|
9671
|
-
const [isExpanded, setIsExpanded] =
|
|
9672
|
-
|
|
9942
|
+
const [isExpanded, setIsExpanded] = React30.useState(false);
|
|
9943
|
+
React30.useEffect(() => {
|
|
9673
9944
|
if (status === "running" && data.output !== void 0) {
|
|
9674
9945
|
setIsExpanded(true);
|
|
9675
9946
|
}
|
|
9676
9947
|
}, [data.output, status]);
|
|
9677
|
-
return /* @__PURE__ */
|
|
9678
|
-
/* @__PURE__ */
|
|
9948
|
+
return /* @__PURE__ */ jsxs23("li", { className: "ck-tool-call-row-enter min-w-0", children: [
|
|
9949
|
+
/* @__PURE__ */ jsxs23(
|
|
9679
9950
|
"button",
|
|
9680
9951
|
{
|
|
9681
9952
|
type: "button",
|
|
@@ -9683,7 +9954,7 @@ function ToolCallRowContent({
|
|
|
9683
9954
|
"group/tool-call flex w-full min-w-0 items-center gap-2 text-left text-muted-foreground",
|
|
9684
9955
|
TOOL_CALL_ROW_TEXT_CLASS,
|
|
9685
9956
|
hasDetails && "cursor-pointer hover:text-foreground",
|
|
9686
|
-
hasError && "text-destructive hover:text-destructive"
|
|
9957
|
+
hasError && !isSandboxShell && "text-destructive hover:text-destructive"
|
|
9687
9958
|
),
|
|
9688
9959
|
"aria-expanded": hasDetails ? isExpanded : void 0,
|
|
9689
9960
|
"aria-controls": hasDetails ? detailsId : void 0,
|
|
@@ -9692,7 +9963,7 @@ function ToolCallRowContent({
|
|
|
9692
9963
|
if (hasDetails) setIsExpanded((prev) => !prev);
|
|
9693
9964
|
},
|
|
9694
9965
|
children: [
|
|
9695
|
-
status ? /* @__PURE__ */
|
|
9966
|
+
status ? /* @__PURE__ */ jsx35(
|
|
9696
9967
|
ToolStepIcon,
|
|
9697
9968
|
{
|
|
9698
9969
|
data,
|
|
@@ -9700,11 +9971,11 @@ function ToolCallRowContent({
|
|
|
9700
9971
|
apiUrl,
|
|
9701
9972
|
className: cn(
|
|
9702
9973
|
"h-3.5 w-3.5 shrink-0",
|
|
9703
|
-
hasError ? "text-destructive" : "text-muted-foreground"
|
|
9974
|
+
hasError && !isSandboxShell ? "text-destructive" : "text-muted-foreground"
|
|
9704
9975
|
)
|
|
9705
9976
|
}
|
|
9706
|
-
) : /* @__PURE__ */
|
|
9707
|
-
/* @__PURE__ */
|
|
9977
|
+
) : /* @__PURE__ */ jsx35("span", { className: "h-3.5 w-3.5 shrink-0", "aria-hidden": "true" }),
|
|
9978
|
+
/* @__PURE__ */ jsx35(
|
|
9708
9979
|
"span",
|
|
9709
9980
|
{
|
|
9710
9981
|
className: cn(
|
|
@@ -9715,8 +9986,8 @@ function ToolCallRowContent({
|
|
|
9715
9986
|
children: label
|
|
9716
9987
|
}
|
|
9717
9988
|
),
|
|
9718
|
-
durationLabel ? /* @__PURE__ */
|
|
9719
|
-
hasDetails ? /* @__PURE__ */
|
|
9989
|
+
durationLabel ? /* @__PURE__ */ jsx35("span", { className: "shrink-0 text-[11px] tabular-nums text-muted-foreground/80", children: durationLabel }) : null,
|
|
9990
|
+
hasDetails ? /* @__PURE__ */ jsx35(
|
|
9720
9991
|
ChevronRight7,
|
|
9721
9992
|
{
|
|
9722
9993
|
"aria-hidden": "true",
|
|
@@ -9729,10 +10000,10 @@ function ToolCallRowContent({
|
|
|
9729
10000
|
]
|
|
9730
10001
|
}
|
|
9731
10002
|
),
|
|
9732
|
-
hasDetails && isExpanded ? /* @__PURE__ */
|
|
10003
|
+
hasDetails && isExpanded ? /* @__PURE__ */ jsx35("div", { id: detailsId, children: /* @__PURE__ */ jsx35(ToolCallDetails, { content }) }) : null
|
|
9733
10004
|
] });
|
|
9734
10005
|
}
|
|
9735
|
-
var ToolCallRow =
|
|
10006
|
+
var ToolCallRow = React30.memo(ToolCallRowContent, areToolCallRowPropsEqual);
|
|
9736
10007
|
ToolCallRow.displayName = "ToolCallRow";
|
|
9737
10008
|
function ToolComponentGroup({
|
|
9738
10009
|
items,
|
|
@@ -9742,8 +10013,8 @@ function ToolComponentGroup({
|
|
|
9742
10013
|
apiUrl
|
|
9743
10014
|
}) {
|
|
9744
10015
|
const { t } = useChatkitTranslation();
|
|
9745
|
-
const contentId =
|
|
9746
|
-
const [isExpanded, setIsExpanded] =
|
|
10016
|
+
const contentId = React30.useId();
|
|
10017
|
+
const [isExpanded, setIsExpanded] = React30.useState(!hasFollowingItem);
|
|
9747
10018
|
const categoryCounts = getToolGroupCategoryCounts(items);
|
|
9748
10019
|
const categorySummary = TOOL_GROUP_CATEGORY_ORDER.flatMap((category) => {
|
|
9749
10020
|
const count = categoryCounts[category] ?? 0;
|
|
@@ -9758,11 +10029,11 @@ function ToolComponentGroup({
|
|
|
9758
10029
|
const summary = `${t("message.toolGroup.status.success")} ${categorySummary}`;
|
|
9759
10030
|
const config = toolStatusConfig.success;
|
|
9760
10031
|
const StatusIcon = config.icon;
|
|
9761
|
-
|
|
10032
|
+
React30.useEffect(() => {
|
|
9762
10033
|
setIsExpanded(!hasFollowingItem);
|
|
9763
10034
|
}, [hasFollowingItem]);
|
|
9764
|
-
return /* @__PURE__ */
|
|
9765
|
-
/* @__PURE__ */
|
|
10035
|
+
return /* @__PURE__ */ jsxs23("div", { className: "px-1 py-1", children: [
|
|
10036
|
+
/* @__PURE__ */ jsxs23(
|
|
9766
10037
|
"button",
|
|
9767
10038
|
{
|
|
9768
10039
|
type: "button",
|
|
@@ -9771,8 +10042,8 @@ function ToolComponentGroup({
|
|
|
9771
10042
|
"aria-controls": contentId,
|
|
9772
10043
|
onClick: () => setIsExpanded((prev) => !prev),
|
|
9773
10044
|
children: [
|
|
9774
|
-
/* @__PURE__ */
|
|
9775
|
-
/* @__PURE__ */
|
|
10045
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex min-w-0 items-center gap-2 text-sm font-medium text-muted-foreground", children: [
|
|
10046
|
+
/* @__PURE__ */ jsx35(
|
|
9776
10047
|
StatusIcon,
|
|
9777
10048
|
{
|
|
9778
10049
|
className: cn(
|
|
@@ -9781,9 +10052,9 @@ function ToolComponentGroup({
|
|
|
9781
10052
|
)
|
|
9782
10053
|
}
|
|
9783
10054
|
),
|
|
9784
|
-
/* @__PURE__ */
|
|
10055
|
+
/* @__PURE__ */ jsx35("span", { className: "truncate", children: summary })
|
|
9785
10056
|
] }),
|
|
9786
|
-
/* @__PURE__ */
|
|
10057
|
+
/* @__PURE__ */ jsx35(
|
|
9787
10058
|
ChevronRight7,
|
|
9788
10059
|
{
|
|
9789
10060
|
"aria-hidden": "true",
|
|
@@ -9796,7 +10067,7 @@ function ToolComponentGroup({
|
|
|
9796
10067
|
]
|
|
9797
10068
|
}
|
|
9798
10069
|
),
|
|
9799
|
-
isExpanded && /* @__PURE__ */
|
|
10070
|
+
isExpanded && /* @__PURE__ */ jsx35("ul", { id: contentId, className: "mt-2 space-y-1.5 overflow-y-auto pr-1", children: items.map((item, index) => /* @__PURE__ */ jsx35(
|
|
9800
10071
|
ToolCallRow,
|
|
9801
10072
|
{
|
|
9802
10073
|
content: item,
|
|
@@ -9816,7 +10087,7 @@ import {
|
|
|
9816
10087
|
REQUEST_USER_INPUT_TOOL_NAME as REQUEST_USER_INPUT_TOOL_NAME2
|
|
9817
10088
|
} from "@xpert-ai/chatkit-types";
|
|
9818
10089
|
import { CheckCircle2 as CheckCircle24 } from "lucide-react";
|
|
9819
|
-
import { jsx as
|
|
10090
|
+
import { jsx as jsx36, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
9820
10091
|
function isRecord3(value) {
|
|
9821
10092
|
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
9822
10093
|
}
|
|
@@ -9928,7 +10199,7 @@ function RequestUserInputResultCard({
|
|
|
9928
10199
|
className
|
|
9929
10200
|
}) {
|
|
9930
10201
|
const { t } = useChatkitTranslation();
|
|
9931
|
-
return /* @__PURE__ */
|
|
10202
|
+
return /* @__PURE__ */ jsxs24(
|
|
9932
10203
|
"section",
|
|
9933
10204
|
{
|
|
9934
10205
|
"aria-label": t("message.requestUserInputResult.title"),
|
|
@@ -9937,23 +10208,23 @@ function RequestUserInputResultCard({
|
|
|
9937
10208
|
className
|
|
9938
10209
|
),
|
|
9939
10210
|
children: [
|
|
9940
|
-
/* @__PURE__ */
|
|
9941
|
-
/* @__PURE__ */
|
|
9942
|
-
/* @__PURE__ */
|
|
10211
|
+
/* @__PURE__ */ jsxs24("div", { className: "mb-2 flex items-center gap-2 text-sm font-semibold text-foreground", children: [
|
|
10212
|
+
/* @__PURE__ */ jsx36(CheckCircle24, { className: "h-4 w-4 text-primary" }),
|
|
10213
|
+
/* @__PURE__ */ jsx36("span", { children: t("message.requestUserInputResult.title") })
|
|
9943
10214
|
] }),
|
|
9944
|
-
/* @__PURE__ */
|
|
10215
|
+
/* @__PURE__ */ jsx36("div", { className: "space-y-2", children: result.answers.map((answer, index) => /* @__PURE__ */ jsxs24(
|
|
9945
10216
|
"div",
|
|
9946
10217
|
{
|
|
9947
10218
|
className: "rounded-md bg-background/70 px-2.5 py-2",
|
|
9948
10219
|
children: [
|
|
9949
|
-
/* @__PURE__ */
|
|
9950
|
-
/* @__PURE__ */
|
|
9951
|
-
/* @__PURE__ */
|
|
9952
|
-
/* @__PURE__ */
|
|
10220
|
+
/* @__PURE__ */ jsx36("div", { className: "text-xs font-medium leading-5 text-muted-foreground", children: answer.question }),
|
|
10221
|
+
/* @__PURE__ */ jsxs24("div", { className: "mt-0.5 flex min-w-0 flex-wrap items-center gap-1.5", children: [
|
|
10222
|
+
/* @__PURE__ */ jsx36("span", { className: "min-w-0 wrap-break-word text-sm font-semibold text-foreground", children: answer.label ?? answer.value }),
|
|
10223
|
+
/* @__PURE__ */ jsx36("span", { className: "rounded-full bg-muted px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground", children: t(
|
|
9953
10224
|
answer.type === "other" ? "message.requestUserInputResult.other" : "message.requestUserInputResult.option"
|
|
9954
10225
|
) })
|
|
9955
10226
|
] }),
|
|
9956
|
-
answer.description ? /* @__PURE__ */
|
|
10227
|
+
answer.description ? /* @__PURE__ */ jsx36("div", { className: "mt-1 text-xs leading-5 text-muted-foreground", children: answer.description }) : null
|
|
9957
10228
|
]
|
|
9958
10229
|
},
|
|
9959
10230
|
`${answer.id}-${index}`
|
|
@@ -9965,18 +10236,18 @@ function RequestUserInputResultCard({
|
|
|
9965
10236
|
|
|
9966
10237
|
// src/components/thread/messages/widget.tsx
|
|
9967
10238
|
import { SurfaceRenderer } from "@xpert-ai/a2ui-react";
|
|
9968
|
-
import { jsx as
|
|
10239
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
9969
10240
|
function WidgetMessage({ messageId, data }) {
|
|
9970
10241
|
const widgets = Array.isArray(data.widgets) ? data.widgets : [];
|
|
9971
10242
|
if (widgets.length === 0) return null;
|
|
9972
10243
|
const baseSurfaceId = `widget-${messageId}`;
|
|
9973
|
-
return /* @__PURE__ */
|
|
10244
|
+
return /* @__PURE__ */ jsx37("div", { className: "space-y-3", children: widgets.map((widget, index) => {
|
|
9974
10245
|
const config = widget?.config;
|
|
9975
10246
|
if (!config || typeof config !== "object") {
|
|
9976
10247
|
return null;
|
|
9977
10248
|
}
|
|
9978
10249
|
const surfaceId = widgets.length > 1 ? `${baseSurfaceId}-${index}` : baseSurfaceId;
|
|
9979
|
-
return /* @__PURE__ */
|
|
10250
|
+
return /* @__PURE__ */ jsx37(
|
|
9980
10251
|
SurfaceRenderer,
|
|
9981
10252
|
{
|
|
9982
10253
|
surfaceId,
|
|
@@ -9988,7 +10259,7 @@ function WidgetMessage({ messageId, data }) {
|
|
|
9988
10259
|
}
|
|
9989
10260
|
|
|
9990
10261
|
// src/components/thread/messages/ai.tsx
|
|
9991
|
-
import { jsx as
|
|
10262
|
+
import { jsx as jsx38, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
9992
10263
|
var assistantMessageStackClassName = "space-y-3 in-data-[density=compact]:space-y-2 in-data-[density=spacious]:space-y-4";
|
|
9993
10264
|
function isTextContent3(content) {
|
|
9994
10265
|
return content.type === "text";
|
|
@@ -10022,11 +10293,11 @@ function formatDisplayValue3(value) {
|
|
|
10022
10293
|
function ReasoningBlock({ reasoning }) {
|
|
10023
10294
|
const blocks = reasoning.filter((item) => item.text?.trim());
|
|
10024
10295
|
if (blocks.length === 0) return null;
|
|
10025
|
-
return /* @__PURE__ */
|
|
10296
|
+
return /* @__PURE__ */ jsx38("div", { className: "space-y-2", children: blocks.map((item, index) => /* @__PURE__ */ jsx38(
|
|
10026
10297
|
"div",
|
|
10027
10298
|
{
|
|
10028
10299
|
className: "rounded-lg border bg-muted/40 p-3 text-xs text-muted-foreground",
|
|
10029
|
-
children: /* @__PURE__ */
|
|
10300
|
+
children: /* @__PURE__ */ jsx38("p", { className: "whitespace-pre-wrap wrap-break-word leading-relaxed", children: item.text })
|
|
10030
10301
|
},
|
|
10031
10302
|
item.id ?? `reasoning-${index}`
|
|
10032
10303
|
)) });
|
|
@@ -10034,20 +10305,20 @@ function ReasoningBlock({ reasoning }) {
|
|
|
10034
10305
|
function ImageBlock({ content }) {
|
|
10035
10306
|
const imageUrl = typeof content.image_url === "string" ? content.image_url : typeof content.image_url?.url === "string" ? content.image_url.url : null;
|
|
10036
10307
|
if (!imageUrl) {
|
|
10037
|
-
return /* @__PURE__ */
|
|
10038
|
-
/* @__PURE__ */
|
|
10039
|
-
/* @__PURE__ */
|
|
10308
|
+
return /* @__PURE__ */ jsxs25(Card, { children: [
|
|
10309
|
+
/* @__PURE__ */ jsx38(CardHeader, { className: "space-y-1", children: /* @__PURE__ */ jsx38(CardTitle, { className: "text-sm", children: "Image" }) }),
|
|
10310
|
+
/* @__PURE__ */ jsx38(CardContent, { className: "text-xs text-muted-foreground", children: safeJson3(content) })
|
|
10040
10311
|
] });
|
|
10041
10312
|
}
|
|
10042
|
-
return /* @__PURE__ */
|
|
10313
|
+
return /* @__PURE__ */ jsx38("figure", { className: "overflow-hidden rounded-lg border bg-background", children: /* @__PURE__ */ jsx38("img", { src: imageUrl, alt: "Assistant output", className: "h-auto w-full object-cover" }) });
|
|
10043
10314
|
}
|
|
10044
10315
|
function MemoryBlock({ content }) {
|
|
10045
|
-
return /* @__PURE__ */
|
|
10046
|
-
/* @__PURE__ */
|
|
10047
|
-
/* @__PURE__ */
|
|
10048
|
-
/* @__PURE__ */
|
|
10316
|
+
return /* @__PURE__ */ jsxs25(Card, { children: [
|
|
10317
|
+
/* @__PURE__ */ jsxs25(CardHeader, { className: "flex flex-row items-center justify-between gap-2", children: [
|
|
10318
|
+
/* @__PURE__ */ jsx38(CardTitle, { className: "text-sm", children: "Memory" }),
|
|
10319
|
+
/* @__PURE__ */ jsx38(Badge, { variant: "secondary", children: "Memory" })
|
|
10049
10320
|
] }),
|
|
10050
|
-
/* @__PURE__ */
|
|
10321
|
+
/* @__PURE__ */ jsx38(CardContent, { className: "text-xs text-muted-foreground", children: /* @__PURE__ */ jsx38("pre", { className: "whitespace-pre-wrap wrap-break-word", children: safeJson3(content.data ?? []) }) })
|
|
10051
10322
|
] });
|
|
10052
10323
|
}
|
|
10053
10324
|
function parseStepDate2(value) {
|
|
@@ -10081,11 +10352,11 @@ function formatStepDuration3(durationMs) {
|
|
|
10081
10352
|
}
|
|
10082
10353
|
function ComponentBlock({ content }) {
|
|
10083
10354
|
const { i18n: i18n2 } = useChatkitTranslation();
|
|
10084
|
-
const [isExpanded, setIsExpanded] =
|
|
10085
|
-
const contentRef =
|
|
10086
|
-
const shouldAutoScrollRef =
|
|
10087
|
-
const previousScrollTopRef =
|
|
10088
|
-
const [durationNow, setDurationNow] =
|
|
10355
|
+
const [isExpanded, setIsExpanded] = React32.useState(false);
|
|
10356
|
+
const contentRef = React32.useRef(null);
|
|
10357
|
+
const shouldAutoScrollRef = React32.useRef(true);
|
|
10358
|
+
const previousScrollTopRef = React32.useRef(0);
|
|
10359
|
+
const [durationNow, setDurationNow] = React32.useState(() => Date.now());
|
|
10089
10360
|
const data = getToolStepData(content);
|
|
10090
10361
|
const category = data.category ?? "Component";
|
|
10091
10362
|
const title = getToolActivityLabel(content, i18n2.language);
|
|
@@ -10099,10 +10370,10 @@ function ComponentBlock({ content }) {
|
|
|
10099
10370
|
const endedAt = parseStepDate2(data.end_date);
|
|
10100
10371
|
const durationMs = createdAt === null ? null : Math.max(0, (endedAt ?? durationNow) - createdAt);
|
|
10101
10372
|
const durationLabel = durationMs === null ? null : formatStepDuration3(durationMs);
|
|
10102
|
-
|
|
10373
|
+
React32.useEffect(() => {
|
|
10103
10374
|
if (status === "running" && output !== null) setIsExpanded(true);
|
|
10104
10375
|
}, [status, output]);
|
|
10105
|
-
|
|
10376
|
+
React32.useEffect(() => {
|
|
10106
10377
|
if (status !== "running" || createdAt === null || endedAt !== null) {
|
|
10107
10378
|
return;
|
|
10108
10379
|
}
|
|
@@ -10114,7 +10385,7 @@ function ComponentBlock({ content }) {
|
|
|
10114
10385
|
window.clearInterval(timer);
|
|
10115
10386
|
};
|
|
10116
10387
|
}, [createdAt, endedAt, status]);
|
|
10117
|
-
|
|
10388
|
+
React32.useEffect(() => {
|
|
10118
10389
|
const element = contentRef.current;
|
|
10119
10390
|
if (!element) return;
|
|
10120
10391
|
previousScrollTopRef.current = element.scrollTop;
|
|
@@ -10134,7 +10405,7 @@ function ComponentBlock({ content }) {
|
|
|
10134
10405
|
element.removeEventListener("scroll", updateAutoScrollState);
|
|
10135
10406
|
};
|
|
10136
10407
|
}, [isExpanded]);
|
|
10137
|
-
|
|
10408
|
+
React32.useEffect(() => {
|
|
10138
10409
|
if (status !== "running") {
|
|
10139
10410
|
shouldAutoScrollRef.current = true;
|
|
10140
10411
|
return;
|
|
@@ -10147,24 +10418,24 @@ function ComponentBlock({ content }) {
|
|
|
10147
10418
|
}, [isExpanded, output, status]);
|
|
10148
10419
|
const config = status ? toolStatusConfig[status] : null;
|
|
10149
10420
|
const StatusIcon = config?.icon;
|
|
10150
|
-
return /* @__PURE__ */
|
|
10151
|
-
/* @__PURE__ */
|
|
10152
|
-
/* @__PURE__ */
|
|
10153
|
-
status && StatusIcon && /* @__PURE__ */
|
|
10154
|
-
/* @__PURE__ */
|
|
10421
|
+
return /* @__PURE__ */ jsxs25(Card, { children: [
|
|
10422
|
+
/* @__PURE__ */ jsxs25(CardHeader, { className: "flex flex-row items-center justify-between gap-2 px-2 py-1 cursor-pointer", onClick: () => setIsExpanded(!isExpanded), children: [
|
|
10423
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex items-center space-x-1 flex-1 min-w-0", children: [
|
|
10424
|
+
status && StatusIcon && /* @__PURE__ */ jsx38(StatusIcon, { className: cn("h-4 w-4", config?.iconClass, status === "running" && "animate-spin") }),
|
|
10425
|
+
/* @__PURE__ */ jsx38(CardTitle, { className: "text-sm truncate", children: title })
|
|
10155
10426
|
] }),
|
|
10156
|
-
/* @__PURE__ */
|
|
10157
|
-
durationLabel && /* @__PURE__ */
|
|
10158
|
-
/* @__PURE__ */
|
|
10159
|
-
/* @__PURE__ */
|
|
10427
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex flex-wrap items-center gap-2 shrink-0", children: [
|
|
10428
|
+
durationLabel && /* @__PURE__ */ jsxs25("div", { className: "inline-flex items-center gap-1 text-[11px] text-muted-foreground tabular-nums", children: [
|
|
10429
|
+
/* @__PURE__ */ jsx38(Clock32, { className: "h-3 w-3" }),
|
|
10430
|
+
/* @__PURE__ */ jsx38("span", { children: durationLabel })
|
|
10160
10431
|
] }),
|
|
10161
|
-
/* @__PURE__ */
|
|
10162
|
-
/* @__PURE__ */
|
|
10432
|
+
/* @__PURE__ */ jsx38(Badge, { variant: "secondary", className: "rounded-lg px-1.5", children: category }),
|
|
10433
|
+
/* @__PURE__ */ jsx38(
|
|
10163
10434
|
"button",
|
|
10164
10435
|
{
|
|
10165
10436
|
className: "text-muted-foreground hover:text-foreground transition-colors",
|
|
10166
10437
|
"aria-label": isExpanded ? "Collapse" : "Expand",
|
|
10167
|
-
children: /* @__PURE__ */
|
|
10438
|
+
children: /* @__PURE__ */ jsx38(
|
|
10168
10439
|
ChevronDown4,
|
|
10169
10440
|
{
|
|
10170
10441
|
className: cn("h-4 w-4 transition-transform", isExpanded && "rotate-180")
|
|
@@ -10174,35 +10445,35 @@ function ComponentBlock({ content }) {
|
|
|
10174
10445
|
)
|
|
10175
10446
|
] })
|
|
10176
10447
|
] }),
|
|
10177
|
-
isExpanded && /* @__PURE__ */
|
|
10178
|
-
data.input && /* @__PURE__ */
|
|
10179
|
-
error ? /* @__PURE__ */
|
|
10448
|
+
isExpanded && /* @__PURE__ */ jsxs25(CardContent, { ref: contentRef, className: "text-xs text-muted-foreground max-h-60 overflow-auto", children: [
|
|
10449
|
+
data.input && /* @__PURE__ */ jsx38("pre", { className: "whitespace-pre-wrap wrap-break-word", children: formatDisplayValue3(data.input) }),
|
|
10450
|
+
error ? /* @__PURE__ */ jsx38("pre", { className: "whitespace-pre-wrap wrap-break-word text-destructive", children: formatDisplayValue3(error) }) : hasOutput && /* @__PURE__ */ jsx38("pre", { className: "whitespace-pre-wrap wrap-break-word", children: formatDisplayValue3(fallback) })
|
|
10180
10451
|
] })
|
|
10181
10452
|
] });
|
|
10182
10453
|
}
|
|
10183
10454
|
function UnknownBlock({ content }) {
|
|
10184
|
-
return /* @__PURE__ */
|
|
10185
|
-
/* @__PURE__ */
|
|
10186
|
-
/* @__PURE__ */
|
|
10187
|
-
/* @__PURE__ */
|
|
10455
|
+
return /* @__PURE__ */ jsxs25(Card, { children: [
|
|
10456
|
+
/* @__PURE__ */ jsxs25(CardHeader, { className: "flex flex-row items-center justify-between gap-2", children: [
|
|
10457
|
+
/* @__PURE__ */ jsx38(CardTitle, { className: "text-sm", children: "Assistant Content" }),
|
|
10458
|
+
/* @__PURE__ */ jsx38(Badge, { variant: "outline", children: content.type ?? "unknown" })
|
|
10188
10459
|
] }),
|
|
10189
|
-
/* @__PURE__ */
|
|
10460
|
+
/* @__PURE__ */ jsx38(CardContent, { className: "text-xs text-muted-foreground", children: /* @__PURE__ */ jsx38("pre", { className: "whitespace-pre-wrap break-words", children: safeJson3(content) }) })
|
|
10190
10461
|
] });
|
|
10191
10462
|
}
|
|
10192
10463
|
function renderContentItem(content, index, message, lookupMessages, options) {
|
|
10193
10464
|
const messageId = message.id;
|
|
10194
10465
|
const textClassName = options?.isAgentOutput ? "text-sm [&_.markdown-content_p]:!leading-6" : void 0;
|
|
10195
10466
|
if (typeof content === "string") {
|
|
10196
|
-
return /* @__PURE__ */
|
|
10467
|
+
return /* @__PURE__ */ jsx38("div", { className: textClassName, children: /* @__PURE__ */ jsx38(MarkdownText, { children: content }) }, `text-${index}`);
|
|
10197
10468
|
}
|
|
10198
10469
|
if (isTextContent3(content)) {
|
|
10199
|
-
return /* @__PURE__ */
|
|
10470
|
+
return /* @__PURE__ */ jsx38("div", { className: textClassName, children: /* @__PURE__ */ jsx38(MarkdownText, { children: content.text }) }, content.id ?? `text-${index}`);
|
|
10200
10471
|
}
|
|
10201
10472
|
if (isReasoningContent3(content)) {
|
|
10202
|
-
return /* @__PURE__ */
|
|
10473
|
+
return /* @__PURE__ */ jsx38("div", { children: /* @__PURE__ */ jsx38(ReasoningBlock, { reasoning: [content] }) }, content.id ?? `reasoning-${index}`);
|
|
10203
10474
|
}
|
|
10204
10475
|
if (isImageContent(content)) {
|
|
10205
|
-
return /* @__PURE__ */
|
|
10476
|
+
return /* @__PURE__ */ jsx38("div", { children: /* @__PURE__ */ jsx38(ImageBlock, { content }) }, content.id ?? `image-${index}`);
|
|
10206
10477
|
}
|
|
10207
10478
|
if (isComponentContent3(content)) {
|
|
10208
10479
|
const requestUserInputResult = getRequestUserInputResultCardData(
|
|
@@ -10210,13 +10481,13 @@ function renderContentItem(content, index, message, lookupMessages, options) {
|
|
|
10210
10481
|
lookupMessages
|
|
10211
10482
|
);
|
|
10212
10483
|
if (requestUserInputResult) {
|
|
10213
|
-
return /* @__PURE__ */
|
|
10484
|
+
return /* @__PURE__ */ jsx38("div", { children: /* @__PURE__ */ jsx38(RequestUserInputResultCard, { result: requestUserInputResult }) }, content.id ?? `request-user-input-result-${index}`);
|
|
10214
10485
|
}
|
|
10215
10486
|
if (isWidgetComponent2(content)) {
|
|
10216
|
-
return /* @__PURE__ */
|
|
10487
|
+
return /* @__PURE__ */ jsx38("div", { children: /* @__PURE__ */ jsx38(WidgetMessage, { messageId, data: content.data }) }, content.id ?? `widget-${index}`);
|
|
10217
10488
|
}
|
|
10218
10489
|
if (getComponentMessagePresentation(content, getToolStepData(content)) === "grouped-step") {
|
|
10219
|
-
return /* @__PURE__ */
|
|
10490
|
+
return /* @__PURE__ */ jsx38("div", { children: /* @__PURE__ */ jsx38(
|
|
10220
10491
|
ToolComponentGroup,
|
|
10221
10492
|
{
|
|
10222
10493
|
items: [content],
|
|
@@ -10227,15 +10498,15 @@ function renderContentItem(content, index, message, lookupMessages, options) {
|
|
|
10227
10498
|
}
|
|
10228
10499
|
) }, content.id ?? `component-group-${index}`);
|
|
10229
10500
|
}
|
|
10230
|
-
return /* @__PURE__ */
|
|
10501
|
+
return /* @__PURE__ */ jsx38("div", { children: /* @__PURE__ */ jsx38(ComponentBlock, { content }) }, content.id ?? `component-${index}`);
|
|
10231
10502
|
}
|
|
10232
10503
|
if (isMemoryContent(content)) {
|
|
10233
|
-
return /* @__PURE__ */
|
|
10504
|
+
return /* @__PURE__ */ jsx38("div", { children: /* @__PURE__ */ jsx38(MemoryBlock, { content }) }, content.id ?? `memory-${index}`);
|
|
10234
10505
|
}
|
|
10235
10506
|
if (isAgentEventContent(content)) {
|
|
10236
|
-
return /* @__PURE__ */
|
|
10507
|
+
return /* @__PURE__ */ jsx38("div", { children: /* @__PURE__ */ jsx38(AgentEventRow, { content }) }, content.id ?? `agent-event-${index}`);
|
|
10237
10508
|
}
|
|
10238
|
-
return /* @__PURE__ */
|
|
10509
|
+
return /* @__PURE__ */ jsx38("div", { children: /* @__PURE__ */ jsx38(UnknownBlock, { content }) }, content.id ?? `unknown-${index}`);
|
|
10239
10510
|
}
|
|
10240
10511
|
function renderContentUnit(unit, message, lookupMessages, hasFollowingItem, options) {
|
|
10241
10512
|
if (unit.type === "item") {
|
|
@@ -10246,7 +10517,7 @@ function renderContentUnit(unit, message, lookupMessages, hasFollowingItem, opti
|
|
|
10246
10517
|
isAgentOutput: options?.isAgentOutput
|
|
10247
10518
|
});
|
|
10248
10519
|
}
|
|
10249
|
-
return /* @__PURE__ */
|
|
10520
|
+
return /* @__PURE__ */ jsx38("div", { children: /* @__PURE__ */ jsx38(
|
|
10250
10521
|
ToolComponentGroup,
|
|
10251
10522
|
{
|
|
10252
10523
|
items: unit.items,
|
|
@@ -10283,7 +10554,7 @@ function renderAssistantRenderUnits(units, message, lookupMessages, options, dep
|
|
|
10283
10554
|
const batch = entryBatch;
|
|
10284
10555
|
entryBatch = [];
|
|
10285
10556
|
rendered.push(
|
|
10286
|
-
/* @__PURE__ */
|
|
10557
|
+
/* @__PURE__ */ jsx38(React32.Fragment, { children: renderEntryBatch(batch, message, lookupMessages, hasFollowingItem, {
|
|
10287
10558
|
...options,
|
|
10288
10559
|
isAgentOutput: depth > 0
|
|
10289
10560
|
}) }, `entries-${batch[0]?.order ?? rendered.length}`)
|
|
@@ -10300,7 +10571,7 @@ function renderAssistantRenderUnits(units, message, lookupMessages, options, dep
|
|
|
10300
10571
|
}
|
|
10301
10572
|
flushEntries(true);
|
|
10302
10573
|
rendered.push(
|
|
10303
|
-
/* @__PURE__ */
|
|
10574
|
+
/* @__PURE__ */ jsx38(
|
|
10304
10575
|
AgentRunGroup,
|
|
10305
10576
|
{
|
|
10306
10577
|
node: unit.node,
|
|
@@ -10325,7 +10596,7 @@ function renderContent(message, lookupMessages, options) {
|
|
|
10325
10596
|
message
|
|
10326
10597
|
);
|
|
10327
10598
|
if (renderTree.hasAgentRuns) {
|
|
10328
|
-
return /* @__PURE__ */
|
|
10599
|
+
return /* @__PURE__ */ jsx38("div", { className: assistantMessageStackClassName, children: renderAssistantRenderUnits(
|
|
10329
10600
|
renderTree.units,
|
|
10330
10601
|
message,
|
|
10331
10602
|
lookupMessages,
|
|
@@ -10335,13 +10606,13 @@ function renderContent(message, lookupMessages, options) {
|
|
|
10335
10606
|
const content = message.content;
|
|
10336
10607
|
if (typeof content === "string") {
|
|
10337
10608
|
if (!content.trim()) return null;
|
|
10338
|
-
return /* @__PURE__ */
|
|
10609
|
+
return /* @__PURE__ */ jsx38(MarkdownText, { children: content });
|
|
10339
10610
|
}
|
|
10340
10611
|
if (!Array.isArray(content) || content.length === 0) return null;
|
|
10341
10612
|
const renderUnits = buildToolComponentRenderUnits(content, {
|
|
10342
10613
|
shouldGroupComponent: (item) => getRequestUserInputResultCardData(item, lookupMessages) === null
|
|
10343
10614
|
});
|
|
10344
|
-
return /* @__PURE__ */
|
|
10615
|
+
return /* @__PURE__ */ jsx38("div", { className: "space-y-3", children: renderUnits.map(
|
|
10345
10616
|
(unit, index) => renderContentUnit(
|
|
10346
10617
|
unit,
|
|
10347
10618
|
message,
|
|
@@ -10361,7 +10632,7 @@ function AssistantStreamingIndicator({
|
|
|
10361
10632
|
thinking: t("message.thinking"),
|
|
10362
10633
|
answering: t("message.answering")
|
|
10363
10634
|
};
|
|
10364
|
-
return /* @__PURE__ */
|
|
10635
|
+
return /* @__PURE__ */ jsxs25(
|
|
10365
10636
|
"div",
|
|
10366
10637
|
{
|
|
10367
10638
|
className: cn(
|
|
@@ -10369,18 +10640,18 @@ function AssistantStreamingIndicator({
|
|
|
10369
10640
|
className
|
|
10370
10641
|
),
|
|
10371
10642
|
children: [
|
|
10372
|
-
status === "loading" && /* @__PURE__ */
|
|
10373
|
-
status === "thinking" && /* @__PURE__ */
|
|
10374
|
-
/* @__PURE__ */
|
|
10375
|
-
/* @__PURE__ */
|
|
10376
|
-
/* @__PURE__ */
|
|
10643
|
+
status === "loading" && /* @__PURE__ */ jsx38(Loader25, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
10644
|
+
status === "thinking" && /* @__PURE__ */ jsxs25("div", { className: "flex items-end gap-1", "aria-hidden": "true", children: [
|
|
10645
|
+
/* @__PURE__ */ jsx38("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:-0.3s]" }),
|
|
10646
|
+
/* @__PURE__ */ jsx38("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:-0.15s]" }),
|
|
10647
|
+
/* @__PURE__ */ jsx38("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce" })
|
|
10377
10648
|
] }),
|
|
10378
|
-
status === "answering" && /* @__PURE__ */
|
|
10379
|
-
/* @__PURE__ */
|
|
10380
|
-
/* @__PURE__ */
|
|
10381
|
-
/* @__PURE__ */
|
|
10649
|
+
status === "answering" && /* @__PURE__ */ jsxs25("div", { className: "flex items-end gap-1", "aria-hidden": "true", children: [
|
|
10650
|
+
/* @__PURE__ */ jsx38("span", { className: "h-2 w-0.5 rounded-full bg-current animate-pulse [animation-delay:-0.25s]" }),
|
|
10651
|
+
/* @__PURE__ */ jsx38("span", { className: "h-3 w-0.5 rounded-full bg-current animate-pulse [animation-delay:-0.1s]" }),
|
|
10652
|
+
/* @__PURE__ */ jsx38("span", { className: "h-2.5 w-0.5 rounded-full bg-current animate-pulse" })
|
|
10382
10653
|
] }),
|
|
10383
|
-
/* @__PURE__ */
|
|
10654
|
+
/* @__PURE__ */ jsx38("span", { children: labelMap[status] })
|
|
10384
10655
|
]
|
|
10385
10656
|
}
|
|
10386
10657
|
);
|
|
@@ -10409,42 +10680,42 @@ function AssistantMessage({
|
|
|
10409
10680
|
organizationId,
|
|
10410
10681
|
apiUrl
|
|
10411
10682
|
});
|
|
10412
|
-
const reasoningNode = hasReasoning ? /* @__PURE__ */
|
|
10683
|
+
const reasoningNode = hasReasoning ? /* @__PURE__ */ jsx38(ReasoningBlock, { reasoning: rootReasoning ?? [] }) : null;
|
|
10413
10684
|
if (!hasContent && !hasReasoning && !resolvedStreamingStatus) return null;
|
|
10414
10685
|
const streamingClass = isStreaming ? "streaming-active" : "";
|
|
10415
10686
|
if (!hasContent && !hasReasoning && resolvedStreamingStatus) {
|
|
10416
|
-
return /* @__PURE__ */
|
|
10687
|
+
return /* @__PURE__ */ jsx38("div", { className: cn("space-y-3", streamingClass, className), children: /* @__PURE__ */ jsx38(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) });
|
|
10417
10688
|
}
|
|
10418
10689
|
if (hasContent && hasReasoning) {
|
|
10419
|
-
return /* @__PURE__ */
|
|
10420
|
-
/* @__PURE__ */
|
|
10690
|
+
return /* @__PURE__ */ jsxs25("div", { className: cn("space-y-3", streamingClass, className), children: [
|
|
10691
|
+
/* @__PURE__ */ jsxs25(
|
|
10421
10692
|
Tabs,
|
|
10422
10693
|
{
|
|
10423
10694
|
defaultValue: message.status === "reasoning" ? "reasoning" : "answer",
|
|
10424
10695
|
className: "w-full",
|
|
10425
10696
|
children: [
|
|
10426
|
-
/* @__PURE__ */
|
|
10427
|
-
/* @__PURE__ */
|
|
10428
|
-
/* @__PURE__ */
|
|
10697
|
+
/* @__PURE__ */ jsxs25(TabsList, { className: "", children: [
|
|
10698
|
+
/* @__PURE__ */ jsx38(TabsTrigger, { value: "answer", children: t("message.answer") }),
|
|
10699
|
+
/* @__PURE__ */ jsx38(TabsTrigger, { value: "reasoning", children: t("message.reasoning") })
|
|
10429
10700
|
] }),
|
|
10430
|
-
/* @__PURE__ */
|
|
10431
|
-
/* @__PURE__ */
|
|
10701
|
+
/* @__PURE__ */ jsx38(TabsContent, { value: "answer", className: "space-y-3", children: answerNode }),
|
|
10702
|
+
/* @__PURE__ */ jsx38(TabsContent, { value: "reasoning", className: "space-y-3", children: reasoningNode })
|
|
10432
10703
|
]
|
|
10433
10704
|
}
|
|
10434
10705
|
),
|
|
10435
|
-
resolvedStreamingStatus ? /* @__PURE__ */
|
|
10706
|
+
resolvedStreamingStatus ? /* @__PURE__ */ jsx38(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) : null
|
|
10436
10707
|
] });
|
|
10437
10708
|
}
|
|
10438
|
-
return /* @__PURE__ */
|
|
10709
|
+
return /* @__PURE__ */ jsxs25("div", { className: cn("space-y-3", streamingClass, className), children: [
|
|
10439
10710
|
hasReasoning ? reasoningNode : answerNode,
|
|
10440
|
-
resolvedStreamingStatus ? /* @__PURE__ */
|
|
10711
|
+
resolvedStreamingStatus ? /* @__PURE__ */ jsx38(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) : null
|
|
10441
10712
|
] });
|
|
10442
10713
|
}
|
|
10443
10714
|
|
|
10444
10715
|
// src/components/thread/MessageActions.tsx
|
|
10445
|
-
import * as
|
|
10446
|
-
import { Check as
|
|
10447
|
-
import { jsx as
|
|
10716
|
+
import * as React33 from "react";
|
|
10717
|
+
import { Check as Check5, Copy as Copy3, RefreshCw } from "lucide-react";
|
|
10718
|
+
import { jsx as jsx39, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
10448
10719
|
function MessageActions({
|
|
10449
10720
|
content,
|
|
10450
10721
|
isAssistant = false,
|
|
@@ -10453,7 +10724,7 @@ function MessageActions({
|
|
|
10453
10724
|
className
|
|
10454
10725
|
}) {
|
|
10455
10726
|
const { t } = useChatkitTranslation();
|
|
10456
|
-
const [copied, setCopied] =
|
|
10727
|
+
const [copied, setCopied] = React33.useState(false);
|
|
10457
10728
|
const handleCopy = async () => {
|
|
10458
10729
|
try {
|
|
10459
10730
|
await navigator.clipboard.writeText(content);
|
|
@@ -10466,7 +10737,7 @@ function MessageActions({
|
|
|
10466
10737
|
if (isStreaming) {
|
|
10467
10738
|
return null;
|
|
10468
10739
|
}
|
|
10469
|
-
return /* @__PURE__ */
|
|
10740
|
+
return /* @__PURE__ */ jsxs26(
|
|
10470
10741
|
"div",
|
|
10471
10742
|
{
|
|
10472
10743
|
className: cn(
|
|
@@ -10474,7 +10745,7 @@ function MessageActions({
|
|
|
10474
10745
|
className
|
|
10475
10746
|
),
|
|
10476
10747
|
children: [
|
|
10477
|
-
/* @__PURE__ */
|
|
10748
|
+
/* @__PURE__ */ jsx39(
|
|
10478
10749
|
"button",
|
|
10479
10750
|
{
|
|
10480
10751
|
type: "button",
|
|
@@ -10484,17 +10755,17 @@ function MessageActions({
|
|
|
10484
10755
|
copied && "text-green-500"
|
|
10485
10756
|
),
|
|
10486
10757
|
title: copied ? t("messageActions.copied") : t("messageActions.copy"),
|
|
10487
|
-
children: copied ? /* @__PURE__ */
|
|
10758
|
+
children: copied ? /* @__PURE__ */ jsx39(Check5, { size: 14 }) : /* @__PURE__ */ jsx39(Copy3, { size: 14 })
|
|
10488
10759
|
}
|
|
10489
10760
|
),
|
|
10490
|
-
isAssistant && onRetry && /* @__PURE__ */
|
|
10761
|
+
isAssistant && onRetry && /* @__PURE__ */ jsx39(
|
|
10491
10762
|
"button",
|
|
10492
10763
|
{
|
|
10493
10764
|
type: "button",
|
|
10494
10765
|
onClick: onRetry,
|
|
10495
10766
|
className: "p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",
|
|
10496
10767
|
title: t("messageActions.regenerate"),
|
|
10497
|
-
children: /* @__PURE__ */
|
|
10768
|
+
children: /* @__PURE__ */ jsx39(RefreshCw, { size: 14 })
|
|
10498
10769
|
}
|
|
10499
10770
|
)
|
|
10500
10771
|
]
|
|
@@ -10515,18 +10786,18 @@ import {
|
|
|
10515
10786
|
Sparkles as Sparkles3,
|
|
10516
10787
|
Zap
|
|
10517
10788
|
} from "lucide-react";
|
|
10518
|
-
import { jsx as
|
|
10789
|
+
import { jsx as jsx40, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
10519
10790
|
function getIconComponent2(icon) {
|
|
10520
10791
|
const iconMap = {
|
|
10521
|
-
"circle-question": /* @__PURE__ */
|
|
10522
|
-
"lightbulb": /* @__PURE__ */
|
|
10523
|
-
"sparkle": /* @__PURE__ */
|
|
10524
|
-
"write": /* @__PURE__ */
|
|
10525
|
-
"search": /* @__PURE__ */
|
|
10526
|
-
"globe": /* @__PURE__ */
|
|
10527
|
-
"book-open": /* @__PURE__ */
|
|
10528
|
-
"compass": /* @__PURE__ */
|
|
10529
|
-
"bolt": /* @__PURE__ */
|
|
10792
|
+
"circle-question": /* @__PURE__ */ jsx40(HelpCircle, { size: 20 }),
|
|
10793
|
+
"lightbulb": /* @__PURE__ */ jsx40(Lightbulb2, { size: 20 }),
|
|
10794
|
+
"sparkle": /* @__PURE__ */ jsx40(Sparkles3, { size: 20 }),
|
|
10795
|
+
"write": /* @__PURE__ */ jsx40(Pencil3, { size: 20 }),
|
|
10796
|
+
"search": /* @__PURE__ */ jsx40(Search3, { size: 20 }),
|
|
10797
|
+
"globe": /* @__PURE__ */ jsx40(Globe2, { size: 20 }),
|
|
10798
|
+
"book-open": /* @__PURE__ */ jsx40(BookOpen2, { size: 20 }),
|
|
10799
|
+
"compass": /* @__PURE__ */ jsx40(Compass, { size: 20 }),
|
|
10800
|
+
"bolt": /* @__PURE__ */ jsx40(Zap, { size: 20 })
|
|
10530
10801
|
};
|
|
10531
10802
|
return icon ? iconMap[icon] || iconMap["sparkle"] : iconMap["sparkle"];
|
|
10532
10803
|
}
|
|
@@ -10534,9 +10805,9 @@ function StartScreen({ startScreen, onPromptClick, className }) {
|
|
|
10534
10805
|
const { t } = useChatkitTranslation();
|
|
10535
10806
|
const greeting = startScreen?.greeting ?? t("startScreen.greeting");
|
|
10536
10807
|
const prompts = startScreen?.prompts ?? [];
|
|
10537
|
-
return /* @__PURE__ */
|
|
10538
|
-
/* @__PURE__ */
|
|
10539
|
-
prompts.length > 0 && /* @__PURE__ */
|
|
10808
|
+
return /* @__PURE__ */ jsxs27("div", { className: cn("flex flex-col items-center justify-center py-12 px-4", className), children: [
|
|
10809
|
+
/* @__PURE__ */ jsx40("div", { className: "mb-8 text-center", children: /* @__PURE__ */ jsx40("h2", { className: "text-2xl font-semibold text-foreground mb-2", children: greeting }) }),
|
|
10810
|
+
prompts.length > 0 && /* @__PURE__ */ jsx40("div", { className: "w-full max-w-2xl", children: /* @__PURE__ */ jsx40("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: prompts.map((item, index) => /* @__PURE__ */ jsxs27(
|
|
10540
10811
|
"button",
|
|
10541
10812
|
{
|
|
10542
10813
|
type: "button",
|
|
@@ -10547,8 +10818,8 @@ function StartScreen({ startScreen, onPromptClick, className }) {
|
|
|
10547
10818
|
"focus:outline-none focus:ring-2 focus:ring-primary/20"
|
|
10548
10819
|
),
|
|
10549
10820
|
children: [
|
|
10550
|
-
/* @__PURE__ */
|
|
10551
|
-
/* @__PURE__ */
|
|
10821
|
+
/* @__PURE__ */ jsx40("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary", children: getIconComponent2(item.icon) }),
|
|
10822
|
+
/* @__PURE__ */ jsx40("span", { className: "text-sm font-medium text-foreground", children: item.label })
|
|
10552
10823
|
]
|
|
10553
10824
|
},
|
|
10554
10825
|
`prompt-${index}`
|
|
@@ -10557,7 +10828,7 @@ function StartScreen({ startScreen, onPromptClick, className }) {
|
|
|
10557
10828
|
}
|
|
10558
10829
|
|
|
10559
10830
|
// src/hooks/useThreads.ts
|
|
10560
|
-
import * as
|
|
10831
|
+
import * as React35 from "react";
|
|
10561
10832
|
var DEFAULT_LIMIT = 50;
|
|
10562
10833
|
var getThreadTitle = (threadRecord) => {
|
|
10563
10834
|
const title = threadRecord.title?.trim();
|
|
@@ -10610,16 +10881,16 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10610
10881
|
isLoading: isStreamLoading,
|
|
10611
10882
|
error: streamError
|
|
10612
10883
|
} = useStreamContext();
|
|
10613
|
-
const [threadRecords, setThreadRecords] =
|
|
10614
|
-
const [isLoading, setIsLoading] =
|
|
10615
|
-
const [error, setError] =
|
|
10616
|
-
const upsertThreadRecord =
|
|
10884
|
+
const [threadRecords, setThreadRecords] = React35.useState([]);
|
|
10885
|
+
const [isLoading, setIsLoading] = React35.useState(false);
|
|
10886
|
+
const [error, setError] = React35.useState(null);
|
|
10887
|
+
const upsertThreadRecord = React35.useCallback((threadRecord) => {
|
|
10617
10888
|
setThreadRecords((prev) => {
|
|
10618
10889
|
const next = prev.filter((item) => item.id !== threadRecord.id);
|
|
10619
10890
|
return sortThreadRecords([threadRecord, ...next]);
|
|
10620
10891
|
});
|
|
10621
10892
|
}, []);
|
|
10622
|
-
const refreshThreads =
|
|
10893
|
+
const refreshThreads = React35.useCallback(async () => {
|
|
10623
10894
|
setIsLoading(true);
|
|
10624
10895
|
setError(null);
|
|
10625
10896
|
try {
|
|
@@ -10635,7 +10906,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10635
10906
|
setIsLoading(false);
|
|
10636
10907
|
}
|
|
10637
10908
|
}, [client, limit, assistantId]);
|
|
10638
|
-
const createThread =
|
|
10909
|
+
const createThread = React35.useCallback(
|
|
10639
10910
|
async (input) => {
|
|
10640
10911
|
setError(null);
|
|
10641
10912
|
const payload = {};
|
|
@@ -10649,7 +10920,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10649
10920
|
},
|
|
10650
10921
|
[client, upsertThreadRecord]
|
|
10651
10922
|
);
|
|
10652
|
-
const updateThread =
|
|
10923
|
+
const updateThread = React35.useCallback(
|
|
10653
10924
|
async (recordId, payload) => {
|
|
10654
10925
|
setError(null);
|
|
10655
10926
|
const updated = await client.conversations.update(recordId, payload);
|
|
@@ -10658,7 +10929,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10658
10929
|
},
|
|
10659
10930
|
[client, upsertThreadRecord]
|
|
10660
10931
|
);
|
|
10661
|
-
const deleteThread =
|
|
10932
|
+
const deleteThread = React35.useCallback(
|
|
10662
10933
|
async (recordId) => {
|
|
10663
10934
|
setError(null);
|
|
10664
10935
|
await client.conversations.delete(recordId);
|
|
@@ -10666,11 +10937,11 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10666
10937
|
},
|
|
10667
10938
|
[client]
|
|
10668
10939
|
);
|
|
10669
|
-
|
|
10940
|
+
React35.useEffect(() => {
|
|
10670
10941
|
if (!isReady) return;
|
|
10671
10942
|
void refreshThreads();
|
|
10672
10943
|
}, [refreshThreads, isReady]);
|
|
10673
|
-
|
|
10944
|
+
React35.useEffect(() => {
|
|
10674
10945
|
if (!threadId || !isStreamLoading) return;
|
|
10675
10946
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
10676
10947
|
const busyStatus = "busy";
|
|
@@ -10691,7 +10962,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10691
10962
|
return changed ? sortThreadRecords(next) : prev;
|
|
10692
10963
|
});
|
|
10693
10964
|
}, [threadId, isStreamLoading]);
|
|
10694
|
-
|
|
10965
|
+
React35.useEffect(() => {
|
|
10695
10966
|
const message = getErrorMessage(streamError)?.trim();
|
|
10696
10967
|
if (!threadId || !message) return;
|
|
10697
10968
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -10713,7 +10984,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10713
10984
|
return changed ? sortThreadRecords(next) : prev;
|
|
10714
10985
|
});
|
|
10715
10986
|
}, [threadId, streamError]);
|
|
10716
|
-
|
|
10987
|
+
React35.useEffect(() => {
|
|
10717
10988
|
if (!isReady || !threadId || isStreamLoading) return;
|
|
10718
10989
|
let cancelled = false;
|
|
10719
10990
|
void client.conversations.search({ where: { threadId }, limit: 1 }).then((result) => {
|
|
@@ -10727,7 +10998,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10727
10998
|
cancelled = true;
|
|
10728
10999
|
};
|
|
10729
11000
|
}, [client, threadId, upsertThreadRecord, isReady, isStreamLoading]);
|
|
10730
|
-
const threads =
|
|
11001
|
+
const threads = React35.useMemo(
|
|
10731
11002
|
() => threadRecords.map((threadRecord) => toThreadItem(threadRecord)),
|
|
10732
11003
|
[threadRecords]
|
|
10733
11004
|
);
|
|
@@ -10744,10 +11015,10 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10744
11015
|
}
|
|
10745
11016
|
|
|
10746
11017
|
// src/components/thread/context-usage-indicator.tsx
|
|
10747
|
-
import * as
|
|
11018
|
+
import * as React36 from "react";
|
|
10748
11019
|
|
|
10749
11020
|
// src/components/ui/progress-circle.tsx
|
|
10750
|
-
import { jsx as
|
|
11021
|
+
import { jsx as jsx41, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
10751
11022
|
function clamp2(input, a, b) {
|
|
10752
11023
|
return Math.max(Math.min(input, Math.max(a, b)), Math.min(a, b));
|
|
10753
11024
|
}
|
|
@@ -10770,7 +11041,7 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
|
|
|
10770
11041
|
return (
|
|
10771
11042
|
// biome-ignore lint/a11y/useFocusableInteractive: false positive (progress + progressbar are not focusable interactives)
|
|
10772
11043
|
// biome-ignore lint/nursery/useAriaPropsSupportedByRole: biome rule at odds with mdn docs (presumed nursary bug with rule)
|
|
10773
|
-
/* @__PURE__ */
|
|
11044
|
+
/* @__PURE__ */ jsxs28(
|
|
10774
11045
|
"svg",
|
|
10775
11046
|
{
|
|
10776
11047
|
role: "progressbar",
|
|
@@ -10781,8 +11052,8 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
|
|
|
10781
11052
|
"aria-valuemax": 100,
|
|
10782
11053
|
...restSvgProps,
|
|
10783
11054
|
children: [
|
|
10784
|
-
/* @__PURE__ */
|
|
10785
|
-
/* @__PURE__ */
|
|
11055
|
+
/* @__PURE__ */ jsx41("circle", { ...commonParams, className: "stroke-current/25" }),
|
|
11056
|
+
/* @__PURE__ */ jsx41(
|
|
10786
11057
|
"circle",
|
|
10787
11058
|
{
|
|
10788
11059
|
...commonParams,
|
|
@@ -10801,7 +11072,7 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
|
|
|
10801
11072
|
};
|
|
10802
11073
|
|
|
10803
11074
|
// src/components/thread/context-usage-indicator.tsx
|
|
10804
|
-
import { jsx as
|
|
11075
|
+
import { jsx as jsx42, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
10805
11076
|
var kNumberFormatter = new Intl.NumberFormat("en-US", {
|
|
10806
11077
|
minimumFractionDigits: 0,
|
|
10807
11078
|
maximumFractionDigits: 1
|
|
@@ -10834,20 +11105,20 @@ function ContextUsageIndicator({
|
|
|
10834
11105
|
}) {
|
|
10835
11106
|
const { t } = useChatkitTranslation();
|
|
10836
11107
|
const stream = useStreamContext();
|
|
10837
|
-
const [maxContextSize, setMaxContextSize] =
|
|
10838
|
-
const [usedContextSize, setUsedContextSize] =
|
|
10839
|
-
const [assistantAgentKey, setAssistantAgentKey] =
|
|
10840
|
-
const latestRealtimeUsageRef =
|
|
11108
|
+
const [maxContextSize, setMaxContextSize] = React36.useState(null);
|
|
11109
|
+
const [usedContextSize, setUsedContextSize] = React36.useState(null);
|
|
11110
|
+
const [assistantAgentKey, setAssistantAgentKey] = React36.useState(null);
|
|
11111
|
+
const latestRealtimeUsageRef = React36.useRef({
|
|
10841
11112
|
threadId: null,
|
|
10842
11113
|
agentKey: null,
|
|
10843
11114
|
usedTokens: null
|
|
10844
11115
|
});
|
|
10845
|
-
const realtimeUsage =
|
|
11116
|
+
const realtimeUsage = React36.useMemo(
|
|
10846
11117
|
() => getThreadContextUsage(stream.contextUsageByAgentKey, assistantAgentKey),
|
|
10847
11118
|
[assistantAgentKey, stream.contextUsageByAgentKey]
|
|
10848
11119
|
);
|
|
10849
11120
|
const realtimeUsedContextSize = getThreadContextUsageTotalTokens(realtimeUsage);
|
|
10850
|
-
|
|
11121
|
+
React36.useEffect(() => {
|
|
10851
11122
|
if (!stream.client || !stream.assistantId) {
|
|
10852
11123
|
setMaxContextSize(null);
|
|
10853
11124
|
setAssistantAgentKey(null);
|
|
@@ -10867,18 +11138,18 @@ function ContextUsageIndicator({
|
|
|
10867
11138
|
cancelled = true;
|
|
10868
11139
|
};
|
|
10869
11140
|
}, [stream.client, stream.assistantId]);
|
|
10870
|
-
|
|
11141
|
+
React36.useEffect(() => {
|
|
10871
11142
|
latestRealtimeUsageRef.current = {
|
|
10872
11143
|
threadId: stream.threadId ?? null,
|
|
10873
11144
|
agentKey: assistantAgentKey,
|
|
10874
11145
|
usedTokens: realtimeUsedContextSize
|
|
10875
11146
|
};
|
|
10876
11147
|
}, [assistantAgentKey, realtimeUsedContextSize, stream.threadId]);
|
|
10877
|
-
|
|
11148
|
+
React36.useEffect(() => {
|
|
10878
11149
|
if (realtimeUsedContextSize == null) return;
|
|
10879
11150
|
setUsedContextSize(realtimeUsedContextSize);
|
|
10880
11151
|
}, [realtimeUsedContextSize]);
|
|
10881
|
-
|
|
11152
|
+
React36.useEffect(() => {
|
|
10882
11153
|
if (!stream.client) {
|
|
10883
11154
|
setUsedContextSize(null);
|
|
10884
11155
|
return;
|
|
@@ -10943,8 +11214,8 @@ function ContextUsageIndicator({
|
|
|
10943
11214
|
});
|
|
10944
11215
|
const usageLabelWithSuffix = usageLabel.endsWith(":") ? usageLabel : `${usageLabel}:`;
|
|
10945
11216
|
const progressClassName = percent >= 90 ? "text-destructive" : percent >= 75 ? "text-amber-500" : "text-primary dark:text-zinc-300";
|
|
10946
|
-
return /* @__PURE__ */
|
|
10947
|
-
/* @__PURE__ */
|
|
11217
|
+
return /* @__PURE__ */ jsxs29(Tooltip, { children: [
|
|
11218
|
+
/* @__PURE__ */ jsx42(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx42(
|
|
10948
11219
|
"button",
|
|
10949
11220
|
{
|
|
10950
11221
|
type: "button",
|
|
@@ -10953,31 +11224,31 @@ function ContextUsageIndicator({
|
|
|
10953
11224
|
className
|
|
10954
11225
|
),
|
|
10955
11226
|
"aria-label": `${usageLabelWithSuffix} ${usageFullLabel}. ${usageTokensLabel}`,
|
|
10956
|
-
children: /* @__PURE__ */
|
|
11227
|
+
children: /* @__PURE__ */ jsx42(ProgressCircle, { value: percent, className: cn("size-3.5", progressClassName) })
|
|
10957
11228
|
}
|
|
10958
11229
|
) }),
|
|
10959
|
-
/* @__PURE__ */
|
|
10960
|
-
/* @__PURE__ */
|
|
10961
|
-
/* @__PURE__ */
|
|
10962
|
-
/* @__PURE__ */
|
|
11230
|
+
/* @__PURE__ */ jsxs29(TooltipContent, { side: "top", sideOffset: 6, className: "space-y-0.5 px-3 py-2 text-center", children: [
|
|
11231
|
+
/* @__PURE__ */ jsx42("div", { className: "text-primary-foreground/70", children: usageLabelWithSuffix }),
|
|
11232
|
+
/* @__PURE__ */ jsx42("div", { className: "font-medium text-primary-foreground/80", children: usageFullLabel }),
|
|
11233
|
+
/* @__PURE__ */ jsx42("div", { className: "text-sm font-semibold", children: usageTokensLabel })
|
|
10963
11234
|
] })
|
|
10964
11235
|
] });
|
|
10965
11236
|
}
|
|
10966
11237
|
|
|
10967
11238
|
// src/components/pet/PetBridge.tsx
|
|
10968
|
-
import * as
|
|
11239
|
+
import * as React37 from "react";
|
|
10969
11240
|
import { normalizePetOptions } from "@xpert-ai/chatkit-types";
|
|
10970
11241
|
function PetBridge({ pet, state }) {
|
|
10971
11242
|
const parentMessenger = useParentMessenger();
|
|
10972
11243
|
const sendEvent = parentMessenger?.sendEvent;
|
|
10973
|
-
const options =
|
|
10974
|
-
|
|
11244
|
+
const options = React37.useMemo(() => normalizePetOptions(pet), [pet]);
|
|
11245
|
+
React37.useEffect(() => {
|
|
10975
11246
|
if (!sendEvent) {
|
|
10976
11247
|
return;
|
|
10977
11248
|
}
|
|
10978
11249
|
sendEvent("pet_options_change", { pet: pet ?? null });
|
|
10979
11250
|
}, [sendEvent, pet]);
|
|
10980
|
-
|
|
11251
|
+
React37.useEffect(() => {
|
|
10981
11252
|
if (!sendEvent || !options) {
|
|
10982
11253
|
return;
|
|
10983
11254
|
}
|
|
@@ -10987,15 +11258,15 @@ function PetBridge({ pet, state }) {
|
|
|
10987
11258
|
}
|
|
10988
11259
|
|
|
10989
11260
|
// src/components/settings/SettingsSheet.tsx
|
|
10990
|
-
import * as
|
|
11261
|
+
import * as React44 from "react";
|
|
10991
11262
|
import { PawPrint, Settings } from "lucide-react";
|
|
10992
11263
|
|
|
10993
11264
|
// src/components/ui/input.tsx
|
|
10994
|
-
import * as
|
|
10995
|
-
import { jsx as
|
|
10996
|
-
var Input =
|
|
11265
|
+
import * as React38 from "react";
|
|
11266
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
11267
|
+
var Input = React38.forwardRef(
|
|
10997
11268
|
({ className, type, ...props }, ref) => {
|
|
10998
|
-
return /* @__PURE__ */
|
|
11269
|
+
return /* @__PURE__ */ jsx43(
|
|
10999
11270
|
"input",
|
|
11000
11271
|
{
|
|
11001
11272
|
ref,
|
|
@@ -11015,17 +11286,17 @@ Input.displayName = "Input";
|
|
|
11015
11286
|
import "react";
|
|
11016
11287
|
import { Select as SelectPrimitive } from "radix-ui";
|
|
11017
11288
|
import { ChevronDownIcon as ChevronDownIcon2, CheckIcon as CheckIcon4, ChevronUpIcon } from "lucide-react";
|
|
11018
|
-
import { jsx as
|
|
11289
|
+
import { jsx as jsx44, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
11019
11290
|
function Select({
|
|
11020
11291
|
...props
|
|
11021
11292
|
}) {
|
|
11022
|
-
return /* @__PURE__ */
|
|
11293
|
+
return /* @__PURE__ */ jsx44(SelectPrimitive.Root, { "data-slot": "select", ...props });
|
|
11023
11294
|
}
|
|
11024
11295
|
function SelectGroup({
|
|
11025
11296
|
className,
|
|
11026
11297
|
...props
|
|
11027
11298
|
}) {
|
|
11028
|
-
return /* @__PURE__ */
|
|
11299
|
+
return /* @__PURE__ */ jsx44(
|
|
11029
11300
|
SelectPrimitive.Group,
|
|
11030
11301
|
{
|
|
11031
11302
|
"data-slot": "select-group",
|
|
@@ -11037,7 +11308,7 @@ function SelectGroup({
|
|
|
11037
11308
|
function SelectValue({
|
|
11038
11309
|
...props
|
|
11039
11310
|
}) {
|
|
11040
|
-
return /* @__PURE__ */
|
|
11311
|
+
return /* @__PURE__ */ jsx44(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
|
|
11041
11312
|
}
|
|
11042
11313
|
function SelectTrigger({
|
|
11043
11314
|
className,
|
|
@@ -11045,7 +11316,7 @@ function SelectTrigger({
|
|
|
11045
11316
|
children,
|
|
11046
11317
|
...props
|
|
11047
11318
|
}) {
|
|
11048
|
-
return /* @__PURE__ */
|
|
11319
|
+
return /* @__PURE__ */ jsxs30(
|
|
11049
11320
|
SelectPrimitive.Trigger,
|
|
11050
11321
|
{
|
|
11051
11322
|
"data-slot": "select-trigger",
|
|
@@ -11057,7 +11328,7 @@ function SelectTrigger({
|
|
|
11057
11328
|
...props,
|
|
11058
11329
|
children: [
|
|
11059
11330
|
children,
|
|
11060
|
-
/* @__PURE__ */
|
|
11331
|
+
/* @__PURE__ */ jsx44(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx44(ChevronDownIcon2, { className: "pointer-events-none size-4 text-muted-foreground" }) })
|
|
11061
11332
|
]
|
|
11062
11333
|
}
|
|
11063
11334
|
);
|
|
@@ -11069,7 +11340,7 @@ function SelectContent({
|
|
|
11069
11340
|
align = "center",
|
|
11070
11341
|
...props
|
|
11071
11342
|
}) {
|
|
11072
|
-
return /* @__PURE__ */
|
|
11343
|
+
return /* @__PURE__ */ jsx44(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs30(
|
|
11073
11344
|
SelectPrimitive.Content,
|
|
11074
11345
|
{
|
|
11075
11346
|
"data-slot": "select-content",
|
|
@@ -11079,8 +11350,8 @@ function SelectContent({
|
|
|
11079
11350
|
align,
|
|
11080
11351
|
...props,
|
|
11081
11352
|
children: [
|
|
11082
|
-
/* @__PURE__ */
|
|
11083
|
-
/* @__PURE__ */
|
|
11353
|
+
/* @__PURE__ */ jsx44(SelectScrollUpButton, {}),
|
|
11354
|
+
/* @__PURE__ */ jsx44(
|
|
11084
11355
|
SelectPrimitive.Viewport,
|
|
11085
11356
|
{
|
|
11086
11357
|
"data-position": position,
|
|
@@ -11091,7 +11362,7 @@ function SelectContent({
|
|
|
11091
11362
|
children
|
|
11092
11363
|
}
|
|
11093
11364
|
),
|
|
11094
|
-
/* @__PURE__ */
|
|
11365
|
+
/* @__PURE__ */ jsx44(SelectScrollDownButton, {})
|
|
11095
11366
|
]
|
|
11096
11367
|
}
|
|
11097
11368
|
) });
|
|
@@ -11101,7 +11372,7 @@ function SelectItem({
|
|
|
11101
11372
|
children,
|
|
11102
11373
|
...props
|
|
11103
11374
|
}) {
|
|
11104
|
-
return /* @__PURE__ */
|
|
11375
|
+
return /* @__PURE__ */ jsxs30(
|
|
11105
11376
|
SelectPrimitive.Item,
|
|
11106
11377
|
{
|
|
11107
11378
|
"data-slot": "select-item",
|
|
@@ -11111,8 +11382,8 @@ function SelectItem({
|
|
|
11111
11382
|
),
|
|
11112
11383
|
...props,
|
|
11113
11384
|
children: [
|
|
11114
|
-
/* @__PURE__ */
|
|
11115
|
-
/* @__PURE__ */
|
|
11385
|
+
/* @__PURE__ */ jsx44("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ jsx44(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx44(CheckIcon4, { className: "pointer-events-none" }) }) }),
|
|
11386
|
+
/* @__PURE__ */ jsx44(SelectPrimitive.ItemText, { children })
|
|
11116
11387
|
]
|
|
11117
11388
|
}
|
|
11118
11389
|
);
|
|
@@ -11121,7 +11392,7 @@ function SelectScrollUpButton({
|
|
|
11121
11392
|
className,
|
|
11122
11393
|
...props
|
|
11123
11394
|
}) {
|
|
11124
|
-
return /* @__PURE__ */
|
|
11395
|
+
return /* @__PURE__ */ jsx44(
|
|
11125
11396
|
SelectPrimitive.ScrollUpButton,
|
|
11126
11397
|
{
|
|
11127
11398
|
"data-slot": "select-scroll-up-button",
|
|
@@ -11130,7 +11401,7 @@ function SelectScrollUpButton({
|
|
|
11130
11401
|
className
|
|
11131
11402
|
),
|
|
11132
11403
|
...props,
|
|
11133
|
-
children: /* @__PURE__ */
|
|
11404
|
+
children: /* @__PURE__ */ jsx44(
|
|
11134
11405
|
ChevronUpIcon,
|
|
11135
11406
|
{}
|
|
11136
11407
|
)
|
|
@@ -11141,7 +11412,7 @@ function SelectScrollDownButton({
|
|
|
11141
11412
|
className,
|
|
11142
11413
|
...props
|
|
11143
11414
|
}) {
|
|
11144
|
-
return /* @__PURE__ */
|
|
11415
|
+
return /* @__PURE__ */ jsx44(
|
|
11145
11416
|
SelectPrimitive.ScrollDownButton,
|
|
11146
11417
|
{
|
|
11147
11418
|
"data-slot": "select-scroll-down-button",
|
|
@@ -11150,7 +11421,7 @@ function SelectScrollDownButton({
|
|
|
11150
11421
|
className
|
|
11151
11422
|
),
|
|
11152
11423
|
...props,
|
|
11153
|
-
children: /* @__PURE__ */
|
|
11424
|
+
children: /* @__PURE__ */ jsx44(
|
|
11154
11425
|
ChevronDownIcon2,
|
|
11155
11426
|
{}
|
|
11156
11427
|
)
|
|
@@ -11159,9 +11430,9 @@ function SelectScrollDownButton({
|
|
|
11159
11430
|
}
|
|
11160
11431
|
|
|
11161
11432
|
// src/components/ui/slider.tsx
|
|
11162
|
-
import * as
|
|
11433
|
+
import * as React40 from "react";
|
|
11163
11434
|
import { Slider as SliderPrimitive } from "radix-ui";
|
|
11164
|
-
import { jsx as
|
|
11435
|
+
import { jsx as jsx45, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
11165
11436
|
function Slider({
|
|
11166
11437
|
className,
|
|
11167
11438
|
defaultValue,
|
|
@@ -11170,11 +11441,11 @@ function Slider({
|
|
|
11170
11441
|
max = 100,
|
|
11171
11442
|
...props
|
|
11172
11443
|
}) {
|
|
11173
|
-
const _values =
|
|
11444
|
+
const _values = React40.useMemo(
|
|
11174
11445
|
() => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
|
|
11175
11446
|
[value, defaultValue, min, max]
|
|
11176
11447
|
);
|
|
11177
|
-
return /* @__PURE__ */
|
|
11448
|
+
return /* @__PURE__ */ jsxs31(
|
|
11178
11449
|
SliderPrimitive.Root,
|
|
11179
11450
|
{
|
|
11180
11451
|
"data-slot": "slider",
|
|
@@ -11188,12 +11459,12 @@ function Slider({
|
|
|
11188
11459
|
),
|
|
11189
11460
|
...props,
|
|
11190
11461
|
children: [
|
|
11191
|
-
/* @__PURE__ */
|
|
11462
|
+
/* @__PURE__ */ jsx45(
|
|
11192
11463
|
SliderPrimitive.Track,
|
|
11193
11464
|
{
|
|
11194
11465
|
"data-slot": "slider-track",
|
|
11195
11466
|
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",
|
|
11196
|
-
children: /* @__PURE__ */
|
|
11467
|
+
children: /* @__PURE__ */ jsx45(
|
|
11197
11468
|
SliderPrimitive.Range,
|
|
11198
11469
|
{
|
|
11199
11470
|
"data-slot": "slider-range",
|
|
@@ -11202,7 +11473,7 @@ function Slider({
|
|
|
11202
11473
|
)
|
|
11203
11474
|
}
|
|
11204
11475
|
),
|
|
11205
|
-
Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */
|
|
11476
|
+
Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */ jsx45(
|
|
11206
11477
|
SliderPrimitive.Thumb,
|
|
11207
11478
|
{
|
|
11208
11479
|
"data-slot": "slider-thumb",
|
|
@@ -11216,7 +11487,7 @@ function Slider({
|
|
|
11216
11487
|
}
|
|
11217
11488
|
|
|
11218
11489
|
// src/components/ui/toggle-group.tsx
|
|
11219
|
-
import * as
|
|
11490
|
+
import * as React42 from "react";
|
|
11220
11491
|
import "class-variance-authority";
|
|
11221
11492
|
import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui";
|
|
11222
11493
|
|
|
@@ -11224,7 +11495,7 @@ import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui";
|
|
|
11224
11495
|
import "react";
|
|
11225
11496
|
import { cva as cva2 } from "class-variance-authority";
|
|
11226
11497
|
import { Toggle as TogglePrimitive } from "radix-ui";
|
|
11227
|
-
import { jsx as
|
|
11498
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
11228
11499
|
var toggleVariants = cva2(
|
|
11229
11500
|
"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",
|
|
11230
11501
|
{
|
|
@@ -11247,8 +11518,8 @@ var toggleVariants = cva2(
|
|
|
11247
11518
|
);
|
|
11248
11519
|
|
|
11249
11520
|
// src/components/ui/toggle-group.tsx
|
|
11250
|
-
import { jsx as
|
|
11251
|
-
var ToggleGroupContext =
|
|
11521
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
11522
|
+
var ToggleGroupContext = React42.createContext({
|
|
11252
11523
|
size: "default",
|
|
11253
11524
|
variant: "default",
|
|
11254
11525
|
spacing: 0,
|
|
@@ -11263,7 +11534,7 @@ function ToggleGroup({
|
|
|
11263
11534
|
children,
|
|
11264
11535
|
...props
|
|
11265
11536
|
}) {
|
|
11266
|
-
return /* @__PURE__ */
|
|
11537
|
+
return /* @__PURE__ */ jsx47(
|
|
11267
11538
|
ToggleGroupPrimitive.Root,
|
|
11268
11539
|
{
|
|
11269
11540
|
"data-slot": "toggle-group",
|
|
@@ -11277,7 +11548,7 @@ function ToggleGroup({
|
|
|
11277
11548
|
className
|
|
11278
11549
|
),
|
|
11279
11550
|
...props,
|
|
11280
|
-
children: /* @__PURE__ */
|
|
11551
|
+
children: /* @__PURE__ */ jsx47(
|
|
11281
11552
|
ToggleGroupContext.Provider,
|
|
11282
11553
|
{
|
|
11283
11554
|
value: { variant, size: size2, spacing, orientation },
|
|
@@ -11294,8 +11565,8 @@ function ToggleGroupItem({
|
|
|
11294
11565
|
size: size2 = "default",
|
|
11295
11566
|
...props
|
|
11296
11567
|
}) {
|
|
11297
|
-
const context =
|
|
11298
|
-
return /* @__PURE__ */
|
|
11568
|
+
const context = React42.useContext(ToggleGroupContext);
|
|
11569
|
+
return /* @__PURE__ */ jsx47(
|
|
11299
11570
|
ToggleGroupPrimitive.Item,
|
|
11300
11571
|
{
|
|
11301
11572
|
"data-slot": "toggle-group-item",
|
|
@@ -11535,7 +11806,7 @@ import {
|
|
|
11535
11806
|
} from "@xpert-ai/chatkit-types";
|
|
11536
11807
|
|
|
11537
11808
|
// src/components/pet/PetPreview.tsx
|
|
11538
|
-
import { jsx as
|
|
11809
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
11539
11810
|
function escapeCssUrl(value) {
|
|
11540
11811
|
return value.replace(/["\\]/g, "\\$&");
|
|
11541
11812
|
}
|
|
@@ -11543,7 +11814,7 @@ function PetPreview({ src, label, className }) {
|
|
|
11543
11814
|
const scale = 0.13;
|
|
11544
11815
|
const width = petSpriteAtlas.cellWidth;
|
|
11545
11816
|
const height = petSpriteAtlas.cellHeight;
|
|
11546
|
-
return /* @__PURE__ */
|
|
11817
|
+
return /* @__PURE__ */ jsx48(
|
|
11547
11818
|
"span",
|
|
11548
11819
|
{
|
|
11549
11820
|
className: cn(
|
|
@@ -11552,7 +11823,7 @@ function PetPreview({ src, label, className }) {
|
|
|
11552
11823
|
),
|
|
11553
11824
|
"aria-hidden": "true",
|
|
11554
11825
|
title: label,
|
|
11555
|
-
children: /* @__PURE__ */
|
|
11826
|
+
children: /* @__PURE__ */ jsx48(
|
|
11556
11827
|
"span",
|
|
11557
11828
|
{
|
|
11558
11829
|
className: "absolute left-1/2 top-1/2 block",
|
|
@@ -11574,7 +11845,7 @@ function PetPreview({ src, label, className }) {
|
|
|
11574
11845
|
}
|
|
11575
11846
|
|
|
11576
11847
|
// src/components/settings/SettingsSheet.tsx
|
|
11577
|
-
import { jsx as
|
|
11848
|
+
import { jsx as jsx49, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
11578
11849
|
var CHARACTER_TYPES2 = [
|
|
11579
11850
|
"builtin",
|
|
11580
11851
|
"atlas"
|
|
@@ -11590,13 +11861,13 @@ function SettingsSheet({
|
|
|
11590
11861
|
onSave
|
|
11591
11862
|
}) {
|
|
11592
11863
|
const { t } = useChatkitTranslation();
|
|
11593
|
-
const [draft, setDraft] =
|
|
11594
|
-
|
|
11864
|
+
const [draft, setDraft] = React44.useState(settings);
|
|
11865
|
+
React44.useEffect(() => {
|
|
11595
11866
|
if (open) {
|
|
11596
11867
|
setDraft(petRequired ? { ...settings, enabled: true } : settings);
|
|
11597
11868
|
}
|
|
11598
11869
|
}, [open, petRequired, settings]);
|
|
11599
|
-
const updateDraft =
|
|
11870
|
+
const updateDraft = React44.useCallback(
|
|
11600
11871
|
(patch) => {
|
|
11601
11872
|
setDraft((previous) => ({ ...previous, ...patch }));
|
|
11602
11873
|
},
|
|
@@ -11614,23 +11885,23 @@ function SettingsSheet({
|
|
|
11614
11885
|
defaultValue: selectedBuiltinPet.label
|
|
11615
11886
|
}
|
|
11616
11887
|
);
|
|
11617
|
-
return /* @__PURE__ */
|
|
11618
|
-
/* @__PURE__ */
|
|
11619
|
-
/* @__PURE__ */
|
|
11620
|
-
/* @__PURE__ */
|
|
11888
|
+
return /* @__PURE__ */ jsx49(Sheet, { open, onOpenChange, children: /* @__PURE__ */ jsxs32(SheetContent, { side: "right", className: "w-[min(92vw,26rem)] overflow-y-auto", children: [
|
|
11889
|
+
/* @__PURE__ */ jsx49(SheetHeader, { children: /* @__PURE__ */ jsxs32("div", { className: "flex items-center gap-2", children: [
|
|
11890
|
+
/* @__PURE__ */ jsx49("span", { className: "flex h-8 w-8 items-center justify-center rounded-md bg-primary/10 text-primary", children: /* @__PURE__ */ jsx49(Settings, { size: 16 }) }),
|
|
11891
|
+
/* @__PURE__ */ jsx49(SheetTitle, { children: t("settings.title") })
|
|
11621
11892
|
] }) }),
|
|
11622
|
-
/* @__PURE__ */
|
|
11623
|
-
/* @__PURE__ */
|
|
11624
|
-
/* @__PURE__ */
|
|
11625
|
-
/* @__PURE__ */
|
|
11626
|
-
/* @__PURE__ */
|
|
11893
|
+
/* @__PURE__ */ jsxs32("form", { className: "mt-6 space-y-5", onSubmit: handleSubmit, children: [
|
|
11894
|
+
/* @__PURE__ */ jsxs32("section", { className: "space-y-5", children: [
|
|
11895
|
+
/* @__PURE__ */ jsxs32("div", { className: "flex items-center gap-2", children: [
|
|
11896
|
+
/* @__PURE__ */ jsx49("span", { className: "flex h-7 w-7 items-center justify-center rounded-md bg-muted text-muted-foreground", children: /* @__PURE__ */ jsx49(PawPrint, { size: 15 }) }),
|
|
11897
|
+
/* @__PURE__ */ jsx49("h3", { className: "text-sm font-semibold", children: t("pet.settings.title") })
|
|
11627
11898
|
] }),
|
|
11628
|
-
/* @__PURE__ */
|
|
11629
|
-
/* @__PURE__ */
|
|
11630
|
-
/* @__PURE__ */
|
|
11631
|
-
petRequired && /* @__PURE__ */
|
|
11899
|
+
/* @__PURE__ */ jsxs32("label", { className: "flex items-center justify-between gap-4 rounded-md border border-border px-3 py-2", children: [
|
|
11900
|
+
/* @__PURE__ */ jsxs32("span", { className: "min-w-0", children: [
|
|
11901
|
+
/* @__PURE__ */ jsx49("span", { className: "block text-sm font-medium", children: t("pet.settings.enabled") }),
|
|
11902
|
+
petRequired && /* @__PURE__ */ jsx49("span", { className: "mt-0.5 block text-xs text-muted-foreground", children: t("pet.settings.requiredHint") })
|
|
11632
11903
|
] }),
|
|
11633
|
-
/* @__PURE__ */
|
|
11904
|
+
/* @__PURE__ */ jsx49(
|
|
11634
11905
|
"button",
|
|
11635
11906
|
{
|
|
11636
11907
|
type: "button",
|
|
@@ -11643,7 +11914,7 @@ function SettingsSheet({
|
|
|
11643
11914
|
draft.enabled ? "bg-primary" : "bg-muted-foreground/20",
|
|
11644
11915
|
petRequired ? "cursor-not-allowed opacity-70" : ""
|
|
11645
11916
|
].join(" "),
|
|
11646
|
-
children: /* @__PURE__ */
|
|
11917
|
+
children: /* @__PURE__ */ jsx49(
|
|
11647
11918
|
"span",
|
|
11648
11919
|
{
|
|
11649
11920
|
className: [
|
|
@@ -11656,9 +11927,9 @@ function SettingsSheet({
|
|
|
11656
11927
|
)
|
|
11657
11928
|
] })
|
|
11658
11929
|
] }),
|
|
11659
|
-
/* @__PURE__ */
|
|
11660
|
-
/* @__PURE__ */
|
|
11661
|
-
/* @__PURE__ */
|
|
11930
|
+
/* @__PURE__ */ jsxs32("div", { className: "space-y-2", children: [
|
|
11931
|
+
/* @__PURE__ */ jsx49("span", { id: "chatkit-pet-type-label", className: "text-sm font-medium", children: t("pet.settings.characterType") }),
|
|
11932
|
+
/* @__PURE__ */ jsx49(
|
|
11662
11933
|
ToggleGroup,
|
|
11663
11934
|
{
|
|
11664
11935
|
id: "chatkit-pet-type",
|
|
@@ -11673,7 +11944,7 @@ function SettingsSheet({
|
|
|
11673
11944
|
variant: "outline",
|
|
11674
11945
|
spacing: 2,
|
|
11675
11946
|
className: "!w-full",
|
|
11676
|
-
children: CHARACTER_TYPES2.map((type) => /* @__PURE__ */
|
|
11947
|
+
children: CHARACTER_TYPES2.map((type) => /* @__PURE__ */ jsx49(
|
|
11677
11948
|
ToggleGroupItem,
|
|
11678
11949
|
{
|
|
11679
11950
|
value: type,
|
|
@@ -11685,8 +11956,8 @@ function SettingsSheet({
|
|
|
11685
11956
|
}
|
|
11686
11957
|
)
|
|
11687
11958
|
] }),
|
|
11688
|
-
draft.characterType === "builtin" && /* @__PURE__ */
|
|
11689
|
-
/* @__PURE__ */
|
|
11959
|
+
draft.characterType === "builtin" && /* @__PURE__ */ jsxs32("div", { className: "space-y-2", children: [
|
|
11960
|
+
/* @__PURE__ */ jsx49(
|
|
11690
11961
|
"label",
|
|
11691
11962
|
{
|
|
11692
11963
|
htmlFor: "chatkit-pet-builtin",
|
|
@@ -11694,7 +11965,7 @@ function SettingsSheet({
|
|
|
11694
11965
|
children: t("pet.settings.builtin")
|
|
11695
11966
|
}
|
|
11696
11967
|
),
|
|
11697
|
-
/* @__PURE__ */
|
|
11968
|
+
/* @__PURE__ */ jsxs32(
|
|
11698
11969
|
Select,
|
|
11699
11970
|
{
|
|
11700
11971
|
value: selectedBuiltinPet.id,
|
|
@@ -11705,26 +11976,26 @@ function SettingsSheet({
|
|
|
11705
11976
|
}
|
|
11706
11977
|
},
|
|
11707
11978
|
children: [
|
|
11708
|
-
/* @__PURE__ */
|
|
11979
|
+
/* @__PURE__ */ jsx49(
|
|
11709
11980
|
SelectTrigger,
|
|
11710
11981
|
{
|
|
11711
11982
|
id: "chatkit-pet-builtin",
|
|
11712
11983
|
className: "min-h-12 w-full px-3 py-2",
|
|
11713
|
-
children: /* @__PURE__ */
|
|
11984
|
+
children: /* @__PURE__ */ jsx49(SelectValue, { placeholder: selectedBuiltinPetLabel })
|
|
11714
11985
|
}
|
|
11715
11986
|
),
|
|
11716
|
-
/* @__PURE__ */
|
|
11987
|
+
/* @__PURE__ */ jsx49(SelectContent, { className: "w-[var(--radix-select-trigger-width)]", children: /* @__PURE__ */ jsx49(SelectGroup, { children: INCLUDED_PET_OPTIONS.map((pet) => {
|
|
11717
11988
|
const label = t(`pet.settings.builtins.${pet.id}`, {
|
|
11718
11989
|
defaultValue: pet.label
|
|
11719
11990
|
});
|
|
11720
|
-
return /* @__PURE__ */
|
|
11991
|
+
return /* @__PURE__ */ jsx49(
|
|
11721
11992
|
SelectItem,
|
|
11722
11993
|
{
|
|
11723
11994
|
value: pet.id,
|
|
11724
11995
|
className: "min-h-10 py-1.5 pl-2 pr-8",
|
|
11725
|
-
children: /* @__PURE__ */
|
|
11726
|
-
/* @__PURE__ */
|
|
11727
|
-
/* @__PURE__ */
|
|
11996
|
+
children: /* @__PURE__ */ jsxs32("span", { className: "flex min-w-0 items-center gap-2", children: [
|
|
11997
|
+
/* @__PURE__ */ jsx49(PetPreview, { src: pet.previewSrc, label }),
|
|
11998
|
+
/* @__PURE__ */ jsx49("span", { className: "min-w-0 truncate", children: label })
|
|
11728
11999
|
] })
|
|
11729
12000
|
},
|
|
11730
12001
|
pet.id
|
|
@@ -11734,8 +12005,8 @@ function SettingsSheet({
|
|
|
11734
12005
|
}
|
|
11735
12006
|
)
|
|
11736
12007
|
] }),
|
|
11737
|
-
draft.characterType === "atlas" && /* @__PURE__ */
|
|
11738
|
-
/* @__PURE__ */
|
|
12008
|
+
draft.characterType === "atlas" && /* @__PURE__ */ jsxs32("div", { className: "space-y-2", children: [
|
|
12009
|
+
/* @__PURE__ */ jsx49(
|
|
11739
12010
|
"label",
|
|
11740
12011
|
{
|
|
11741
12012
|
className: "text-sm font-medium",
|
|
@@ -11743,7 +12014,7 @@ function SettingsSheet({
|
|
|
11743
12014
|
children: t("pet.settings.atlasUrl")
|
|
11744
12015
|
}
|
|
11745
12016
|
),
|
|
11746
|
-
/* @__PURE__ */
|
|
12017
|
+
/* @__PURE__ */ jsx49(
|
|
11747
12018
|
Input,
|
|
11748
12019
|
{
|
|
11749
12020
|
id: "chatkit-pet-atlas",
|
|
@@ -11753,15 +12024,15 @@ function SettingsSheet({
|
|
|
11753
12024
|
}
|
|
11754
12025
|
)
|
|
11755
12026
|
] }),
|
|
11756
|
-
/* @__PURE__ */
|
|
11757
|
-
/* @__PURE__ */
|
|
11758
|
-
/* @__PURE__ */
|
|
11759
|
-
/* @__PURE__ */
|
|
12027
|
+
/* @__PURE__ */ jsxs32("div", { className: "space-y-2", children: [
|
|
12028
|
+
/* @__PURE__ */ jsxs32("div", { className: "flex items-center justify-between gap-4", children: [
|
|
12029
|
+
/* @__PURE__ */ jsx49("label", { className: "text-sm font-medium", htmlFor: "chatkit-pet-scale", children: t("pet.settings.scale") }),
|
|
12030
|
+
/* @__PURE__ */ jsxs32("span", { className: "text-xs tabular-nums text-muted-foreground", children: [
|
|
11760
12031
|
draft.scale.toFixed(2),
|
|
11761
12032
|
"x"
|
|
11762
12033
|
] })
|
|
11763
12034
|
] }),
|
|
11764
|
-
/* @__PURE__ */
|
|
12035
|
+
/* @__PURE__ */ jsx49(
|
|
11765
12036
|
Slider,
|
|
11766
12037
|
{
|
|
11767
12038
|
id: "chatkit-pet-scale",
|
|
@@ -11775,8 +12046,8 @@ function SettingsSheet({
|
|
|
11775
12046
|
}
|
|
11776
12047
|
)
|
|
11777
12048
|
] }),
|
|
11778
|
-
/* @__PURE__ */
|
|
11779
|
-
/* @__PURE__ */
|
|
12049
|
+
/* @__PURE__ */ jsxs32("label", { className: "flex items-center gap-2 text-sm", children: [
|
|
12050
|
+
/* @__PURE__ */ jsx49(
|
|
11780
12051
|
"input",
|
|
11781
12052
|
{
|
|
11782
12053
|
type: "checkbox",
|
|
@@ -11787,8 +12058,8 @@ function SettingsSheet({
|
|
|
11787
12058
|
),
|
|
11788
12059
|
t("pet.settings.draggable")
|
|
11789
12060
|
] }),
|
|
11790
|
-
/* @__PURE__ */
|
|
11791
|
-
/* @__PURE__ */
|
|
12061
|
+
/* @__PURE__ */ jsxs32("label", { className: "flex items-center gap-2 text-sm", children: [
|
|
12062
|
+
/* @__PURE__ */ jsx49(
|
|
11792
12063
|
"input",
|
|
11793
12064
|
{
|
|
11794
12065
|
type: "checkbox",
|
|
@@ -11799,8 +12070,8 @@ function SettingsSheet({
|
|
|
11799
12070
|
),
|
|
11800
12071
|
t("pet.settings.persistPosition")
|
|
11801
12072
|
] }),
|
|
11802
|
-
/* @__PURE__ */
|
|
11803
|
-
/* @__PURE__ */
|
|
12073
|
+
/* @__PURE__ */ jsxs32("div", { className: "flex justify-end gap-2 pt-2", children: [
|
|
12074
|
+
/* @__PURE__ */ jsx49(
|
|
11804
12075
|
Button,
|
|
11805
12076
|
{
|
|
11806
12077
|
type: "button",
|
|
@@ -11809,7 +12080,7 @@ function SettingsSheet({
|
|
|
11809
12080
|
children: t("pet.settings.cancel")
|
|
11810
12081
|
}
|
|
11811
12082
|
),
|
|
11812
|
-
/* @__PURE__ */
|
|
12083
|
+
/* @__PURE__ */ jsx49(Button, { type: "submit", children: t("pet.settings.save") })
|
|
11813
12084
|
] })
|
|
11814
12085
|
] })
|
|
11815
12086
|
] }) });
|
|
@@ -12315,7 +12586,7 @@ function findDomPointForComposerOffset(root, offset) {
|
|
|
12315
12586
|
}
|
|
12316
12587
|
|
|
12317
12588
|
// src/components/chat.tsx
|
|
12318
|
-
import { Fragment as Fragment7, jsx as
|
|
12589
|
+
import { Fragment as Fragment7, jsx as jsx50, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
12319
12590
|
var defaultApiUrl2 = import.meta.env.VITE_XPERTAI_API_URL;
|
|
12320
12591
|
var COMPOSER_INPUT_MAX_HEIGHT = 128;
|
|
12321
12592
|
var LONG_TEXT_REFERENCE_THRESHOLD = 5e3;
|
|
@@ -12448,7 +12719,7 @@ function ReferenceChip({
|
|
|
12448
12719
|
const metaLine = getReferenceMetaLine(reference);
|
|
12449
12720
|
const isComposer = variant === "composer";
|
|
12450
12721
|
const Icon = reference.type === "quote" ? Quote : reference.type === "image" ? ImageIcon : FileText3;
|
|
12451
|
-
return /* @__PURE__ */
|
|
12722
|
+
return /* @__PURE__ */ jsxs33(
|
|
12452
12723
|
"div",
|
|
12453
12724
|
{
|
|
12454
12725
|
className: cn(
|
|
@@ -12457,7 +12728,7 @@ function ReferenceChip({
|
|
|
12457
12728
|
),
|
|
12458
12729
|
title: getReferenceTitle(reference),
|
|
12459
12730
|
children: [
|
|
12460
|
-
/* @__PURE__ */
|
|
12731
|
+
/* @__PURE__ */ jsx50(
|
|
12461
12732
|
Icon,
|
|
12462
12733
|
{
|
|
12463
12734
|
size: isComposer ? 14 : 12,
|
|
@@ -12467,8 +12738,8 @@ function ReferenceChip({
|
|
|
12467
12738
|
)
|
|
12468
12739
|
}
|
|
12469
12740
|
),
|
|
12470
|
-
/* @__PURE__ */
|
|
12471
|
-
/* @__PURE__ */
|
|
12741
|
+
/* @__PURE__ */ jsxs33("div", { className: "min-w-0 flex-1", children: [
|
|
12742
|
+
/* @__PURE__ */ jsx50(
|
|
12472
12743
|
"div",
|
|
12473
12744
|
{
|
|
12474
12745
|
className: cn(
|
|
@@ -12478,7 +12749,7 @@ function ReferenceChip({
|
|
|
12478
12749
|
children: getReferenceLabel(reference)
|
|
12479
12750
|
}
|
|
12480
12751
|
),
|
|
12481
|
-
metaLine && /* @__PURE__ */
|
|
12752
|
+
metaLine && /* @__PURE__ */ jsx50(
|
|
12482
12753
|
"div",
|
|
12483
12754
|
{
|
|
12484
12755
|
className: cn(
|
|
@@ -12489,7 +12760,7 @@ function ReferenceChip({
|
|
|
12489
12760
|
}
|
|
12490
12761
|
)
|
|
12491
12762
|
] }),
|
|
12492
|
-
onRemove && removeLabel && /* @__PURE__ */
|
|
12763
|
+
onRemove && removeLabel && /* @__PURE__ */ jsx50(
|
|
12493
12764
|
"button",
|
|
12494
12765
|
{
|
|
12495
12766
|
type: "button",
|
|
@@ -12500,7 +12771,7 @@ function ReferenceChip({
|
|
|
12500
12771
|
),
|
|
12501
12772
|
title: removeLabel,
|
|
12502
12773
|
"aria-label": removeLabel,
|
|
12503
|
-
children: /* @__PURE__ */
|
|
12774
|
+
children: /* @__PURE__ */ jsx50(X5, { size: 12 })
|
|
12504
12775
|
}
|
|
12505
12776
|
)
|
|
12506
12777
|
]
|
|
@@ -12524,20 +12795,20 @@ function Chat({
|
|
|
12524
12795
|
const { setStream } = useStreamManager();
|
|
12525
12796
|
const stream = useStreamContext();
|
|
12526
12797
|
const { theme } = useTheme();
|
|
12527
|
-
const [isHistoryLoading, setIsHistoryLoading] =
|
|
12528
|
-
const [historyError, setHistoryError] =
|
|
12529
|
-
const [assistantName, setAssistantName] =
|
|
12530
|
-
const [assistantAvatar, setAssistantAvatar] =
|
|
12798
|
+
const [isHistoryLoading, setIsHistoryLoading] = React45.useState(false);
|
|
12799
|
+
const [historyError, setHistoryError] = React45.useState(null);
|
|
12800
|
+
const [assistantName, setAssistantName] = React45.useState(null);
|
|
12801
|
+
const [assistantAvatar, setAssistantAvatar] = React45.useState(null);
|
|
12531
12802
|
const LOADING_DOTS_MIN_DURATION = 800;
|
|
12532
12803
|
const STREAMING_STATUS_REFRESH_MS = 250;
|
|
12533
|
-
const [showLoadingDots, setShowLoadingDots] =
|
|
12534
|
-
const [streamingNow, setStreamingNow] =
|
|
12535
|
-
const loadingStartTimeRef =
|
|
12536
|
-
const lastStreamOutputAtRef =
|
|
12537
|
-
|
|
12804
|
+
const [showLoadingDots, setShowLoadingDots] = React45.useState(false);
|
|
12805
|
+
const [streamingNow, setStreamingNow] = React45.useState(() => Date.now());
|
|
12806
|
+
const loadingStartTimeRef = React45.useRef(null);
|
|
12807
|
+
const lastStreamOutputAtRef = React45.useRef(null);
|
|
12808
|
+
React45.useEffect(() => {
|
|
12538
12809
|
setStream(stream);
|
|
12539
12810
|
}, [setStream, stream]);
|
|
12540
|
-
|
|
12811
|
+
React45.useEffect(() => {
|
|
12541
12812
|
if (stream.isLoading) {
|
|
12542
12813
|
if (!loadingStartTimeRef.current) {
|
|
12543
12814
|
loadingStartTimeRef.current = Date.now();
|
|
@@ -12560,7 +12831,7 @@ function Chat({
|
|
|
12560
12831
|
}
|
|
12561
12832
|
}
|
|
12562
12833
|
}, [stream.isLoading]);
|
|
12563
|
-
|
|
12834
|
+
React45.useEffect(() => {
|
|
12564
12835
|
if (!stream.isLoading) {
|
|
12565
12836
|
lastStreamOutputAtRef.current = null;
|
|
12566
12837
|
setStreamingNow(Date.now());
|
|
@@ -12570,7 +12841,7 @@ function Chat({
|
|
|
12570
12841
|
lastStreamOutputAtRef.current = now;
|
|
12571
12842
|
setStreamingNow(now);
|
|
12572
12843
|
}, [stream.messages, stream.isLoading]);
|
|
12573
|
-
|
|
12844
|
+
React45.useEffect(() => {
|
|
12574
12845
|
if (!stream.isLoading) {
|
|
12575
12846
|
return;
|
|
12576
12847
|
}
|
|
@@ -12579,74 +12850,74 @@ function Chat({
|
|
|
12579
12850
|
}, STREAMING_STATUS_REFRESH_MS);
|
|
12580
12851
|
return () => window.clearInterval(timer);
|
|
12581
12852
|
}, [stream.isLoading]);
|
|
12582
|
-
const [composerParts, setComposerParts] =
|
|
12583
|
-
const [renderedComposerParts, setRenderedComposerParts] =
|
|
12584
|
-
const [composerDomVersion, setComposerDomVersion] =
|
|
12585
|
-
const [selectedTool, setSelectedTool] =
|
|
12853
|
+
const [composerParts, setComposerParts] = React45.useState([]);
|
|
12854
|
+
const [renderedComposerParts, setRenderedComposerParts] = React45.useState([]);
|
|
12855
|
+
const [composerDomVersion, setComposerDomVersion] = React45.useState(0);
|
|
12856
|
+
const [selectedTool, setSelectedTool] = React45.useState(
|
|
12586
12857
|
null
|
|
12587
12858
|
);
|
|
12588
|
-
const [planModeEnabled, setPlanModeEnabled] =
|
|
12589
|
-
const [petSettingsOpen, setPetSettingsOpen] =
|
|
12590
|
-
const [petLocalSettings, setPetLocalSettings] =
|
|
12591
|
-
const [runtimeCapabilities, setRuntimeCapabilities] =
|
|
12592
|
-
const [runtimeCapabilitiesReady, setRuntimeCapabilitiesReady] =
|
|
12593
|
-
const [sessionRuntimeCapabilities, setSessionRuntimeCapabilities] =
|
|
12859
|
+
const [planModeEnabled, setPlanModeEnabled] = React45.useState(false);
|
|
12860
|
+
const [petSettingsOpen, setPetSettingsOpen] = React45.useState(false);
|
|
12861
|
+
const [petLocalSettings, setPetLocalSettings] = React45.useState(() => readPetLocalSettings());
|
|
12862
|
+
const [runtimeCapabilities, setRuntimeCapabilities] = React45.useState(null);
|
|
12863
|
+
const [runtimeCapabilitiesReady, setRuntimeCapabilitiesReady] = React45.useState(false);
|
|
12864
|
+
const [sessionRuntimeCapabilities, setSessionRuntimeCapabilities] = React45.useState(
|
|
12594
12865
|
() => createEmptyRuntimeCapabilitiesSelection()
|
|
12595
12866
|
);
|
|
12596
|
-
const [runRuntimeCapabilities, setRunRuntimeCapabilities] =
|
|
12867
|
+
const [runRuntimeCapabilities, setRunRuntimeCapabilities] = React45.useState(
|
|
12597
12868
|
() => createEmptyRuntimeCapabilitiesSelection()
|
|
12598
12869
|
);
|
|
12599
|
-
const [runtimeCapabilityPalette, setRuntimeCapabilityPalette] =
|
|
12600
|
-
const [attachments, setAttachments] =
|
|
12601
|
-
const [references, setReferences] =
|
|
12602
|
-
const [isUploadingReferenceImages, setIsUploadingReferenceImages] =
|
|
12603
|
-
const [quoteSelection, setQuoteSelection] =
|
|
12604
|
-
const [isAtBottom, setIsAtBottom] =
|
|
12605
|
-
const [hasUpdatesBelow, setHasUpdatesBelow] =
|
|
12870
|
+
const [runtimeCapabilityPalette, setRuntimeCapabilityPalette] = React45.useState(null);
|
|
12871
|
+
const [attachments, setAttachments] = React45.useState([]);
|
|
12872
|
+
const [references, setReferences] = React45.useState([]);
|
|
12873
|
+
const [isUploadingReferenceImages, setIsUploadingReferenceImages] = React45.useState(false);
|
|
12874
|
+
const [quoteSelection, setQuoteSelection] = React45.useState(null);
|
|
12875
|
+
const [isAtBottom, setIsAtBottom] = React45.useState(true);
|
|
12876
|
+
const [hasUpdatesBelow, setHasUpdatesBelow] = React45.useState(false);
|
|
12606
12877
|
const {
|
|
12607
12878
|
threads,
|
|
12608
12879
|
deleteThread,
|
|
12609
12880
|
refreshThreads,
|
|
12610
12881
|
isLoading: isThreadsLoading
|
|
12611
12882
|
} = useThreads();
|
|
12612
|
-
const viewportRef =
|
|
12613
|
-
const fileInputRef =
|
|
12614
|
-
const composerInputRef =
|
|
12615
|
-
const slashPaletteRef =
|
|
12616
|
-
const slashPaletteOptionRefs =
|
|
12883
|
+
const viewportRef = React45.useRef(null);
|
|
12884
|
+
const fileInputRef = React45.useRef(null);
|
|
12885
|
+
const composerInputRef = React45.useRef(null);
|
|
12886
|
+
const slashPaletteRef = React45.useRef(null);
|
|
12887
|
+
const slashPaletteOptionRefs = React45.useRef(
|
|
12617
12888
|
[]
|
|
12618
12889
|
);
|
|
12619
|
-
const composerPartsRef =
|
|
12620
|
-
const pendingComposerCaretOffsetRef =
|
|
12621
|
-
const shouldAutoScrollRef =
|
|
12622
|
-
const forceFollowRef =
|
|
12623
|
-
const previousMessageCountRef =
|
|
12624
|
-
const previousScrollTopRef =
|
|
12625
|
-
const autoScrollFrameRef =
|
|
12626
|
-
const isPointerDownRef =
|
|
12627
|
-
const lastTouchYRef =
|
|
12628
|
-
const runtimeCapabilityPreferenceLoadRef =
|
|
12890
|
+
const composerPartsRef = React45.useRef([]);
|
|
12891
|
+
const pendingComposerCaretOffsetRef = React45.useRef(null);
|
|
12892
|
+
const shouldAutoScrollRef = React45.useRef(true);
|
|
12893
|
+
const forceFollowRef = React45.useRef(false);
|
|
12894
|
+
const previousMessageCountRef = React45.useRef(0);
|
|
12895
|
+
const previousScrollTopRef = React45.useRef(0);
|
|
12896
|
+
const autoScrollFrameRef = React45.useRef(null);
|
|
12897
|
+
const isPointerDownRef = React45.useRef(false);
|
|
12898
|
+
const lastTouchYRef = React45.useRef(null);
|
|
12899
|
+
const runtimeCapabilityPreferenceLoadRef = React45.useRef(0);
|
|
12629
12900
|
const resolvedTitle = title ?? t("chat.title");
|
|
12630
12901
|
const resolvedPlaceholder = placeholder ?? t("chat.placeholder");
|
|
12631
12902
|
const petRequired = options?.displayMode === "pet";
|
|
12632
|
-
const basePetSettings =
|
|
12903
|
+
const basePetSettings = React45.useMemo(
|
|
12633
12904
|
() => derivePetLocalSettings(options?.pet),
|
|
12634
12905
|
[options?.pet]
|
|
12635
12906
|
);
|
|
12636
|
-
const displayedPetSettings =
|
|
12907
|
+
const displayedPetSettings = React45.useMemo(
|
|
12637
12908
|
() => ({
|
|
12638
12909
|
...petLocalSettings ?? basePetSettings,
|
|
12639
12910
|
...petRequired ? { enabled: true } : {}
|
|
12640
12911
|
}),
|
|
12641
12912
|
[basePetSettings, petLocalSettings, petRequired]
|
|
12642
12913
|
);
|
|
12643
|
-
const effectivePet =
|
|
12914
|
+
const effectivePet = React45.useMemo(() => {
|
|
12644
12915
|
if (petRequired || petLocalSettings) {
|
|
12645
12916
|
return buildPetOptionsFromLocalSettings(displayedPetSettings);
|
|
12646
12917
|
}
|
|
12647
12918
|
return options?.pet ?? null;
|
|
12648
12919
|
}, [displayedPetSettings, options?.pet, petLocalSettings, petRequired]);
|
|
12649
|
-
const savePetLocalSettings =
|
|
12920
|
+
const savePetLocalSettings = React45.useCallback(
|
|
12650
12921
|
(settings) => {
|
|
12651
12922
|
const nextSettings = petRequired ? { ...settings, enabled: true } : settings;
|
|
12652
12923
|
setPetLocalSettings(nextSettings);
|
|
@@ -12654,7 +12925,7 @@ function Chat({
|
|
|
12654
12925
|
},
|
|
12655
12926
|
[petRequired]
|
|
12656
12927
|
);
|
|
12657
|
-
const handlePetCommand =
|
|
12928
|
+
const handlePetCommand = React45.useCallback(
|
|
12658
12929
|
(mode) => {
|
|
12659
12930
|
if (mode === "settings") {
|
|
12660
12931
|
setPetSettingsOpen(true);
|
|
@@ -12676,11 +12947,11 @@ function Chat({
|
|
|
12676
12947
|
[displayedPetSettings, effectivePet, petRequired, savePetLocalSettings]
|
|
12677
12948
|
);
|
|
12678
12949
|
const inputPlaceholder = selectedTool?.placeholderOverride ?? composer?.placeholder ?? resolvedPlaceholder;
|
|
12679
|
-
const messages =
|
|
12950
|
+
const messages = React45.useMemo(
|
|
12680
12951
|
() => stream.messages ?? [],
|
|
12681
12952
|
[stream.messages]
|
|
12682
12953
|
);
|
|
12683
|
-
const draft =
|
|
12954
|
+
const draft = React45.useMemo(
|
|
12684
12955
|
() => getComposerPlainText(composerParts),
|
|
12685
12956
|
[composerParts]
|
|
12686
12957
|
);
|
|
@@ -12692,7 +12963,7 @@ function Chat({
|
|
|
12692
12963
|
isEmpty: isComposerInputEmpty,
|
|
12693
12964
|
isStacked: isComposerStacked
|
|
12694
12965
|
});
|
|
12695
|
-
const pendingFollowUps =
|
|
12966
|
+
const pendingFollowUps = React45.useMemo(
|
|
12696
12967
|
() => [...stream.pendingFollowUps ?? []].sort(
|
|
12697
12968
|
(a, b) => a.createdAt - b.createdAt
|
|
12698
12969
|
),
|
|
@@ -12703,18 +12974,18 @@ function Chat({
|
|
|
12703
12974
|
const hasPendingHITLRequest = Boolean(stream.pendingHITLRequest);
|
|
12704
12975
|
const hasPendingInteractiveRequest = hasPendingRequestUserInput || hasPendingHITLRequest;
|
|
12705
12976
|
const hasPendingTodos = Boolean(stream.todos?.items.length);
|
|
12706
|
-
const runtimeCapabilityOptions =
|
|
12977
|
+
const runtimeCapabilityOptions = React45.useMemo(
|
|
12707
12978
|
() => getRuntimeCapabilityOptions(runtimeCapabilities),
|
|
12708
12979
|
[runtimeCapabilities]
|
|
12709
12980
|
);
|
|
12710
|
-
const effectiveSessionRuntimeCapabilities =
|
|
12981
|
+
const effectiveSessionRuntimeCapabilities = React45.useMemo(
|
|
12711
12982
|
() => runtimeCapabilitiesReady && runtimeCapabilities ? mergeRuntimeCapabilitiesSelections(
|
|
12712
12983
|
runtimeCapabilities,
|
|
12713
12984
|
sessionRuntimeCapabilities
|
|
12714
12985
|
) : null,
|
|
12715
12986
|
[runtimeCapabilities, runtimeCapabilitiesReady, sessionRuntimeCapabilities]
|
|
12716
12987
|
);
|
|
12717
|
-
const runRuntimeCapabilityOptions =
|
|
12988
|
+
const runRuntimeCapabilityOptions = React45.useMemo(
|
|
12718
12989
|
() => runtimeCapabilityOptions.filter(
|
|
12719
12990
|
(option) => isRuntimeCapabilitySelected(
|
|
12720
12991
|
runRuntimeCapabilities,
|
|
@@ -12724,11 +12995,11 @@ function Chat({
|
|
|
12724
12995
|
),
|
|
12725
12996
|
[runRuntimeCapabilities, runtimeCapabilityOptions]
|
|
12726
12997
|
);
|
|
12727
|
-
const composerRuntimeCapabilitySelectionKeys =
|
|
12998
|
+
const composerRuntimeCapabilitySelectionKeys = React45.useMemo(
|
|
12728
12999
|
() => getComposerCapabilitySelectionKeys(composerParts),
|
|
12729
13000
|
[composerParts]
|
|
12730
13001
|
);
|
|
12731
|
-
const detachedRunRuntimeCapabilityOptions =
|
|
13002
|
+
const detachedRunRuntimeCapabilityOptions = React45.useMemo(
|
|
12732
13003
|
() => runRuntimeCapabilityOptions.filter(
|
|
12733
13004
|
(option) => !composerRuntimeCapabilitySelectionKeys.has(
|
|
12734
13005
|
getRuntimeCapabilityOptionKey(option)
|
|
@@ -12736,7 +13007,7 @@ function Chat({
|
|
|
12736
13007
|
),
|
|
12737
13008
|
[composerRuntimeCapabilitySelectionKeys, runRuntimeCapabilityOptions]
|
|
12738
13009
|
);
|
|
12739
|
-
const persistSessionRuntimeCapabilities =
|
|
13010
|
+
const persistSessionRuntimeCapabilities = React45.useCallback(
|
|
12740
13011
|
async (threadId, selection) => {
|
|
12741
13012
|
if (!runtimeCapabilities || !selection) {
|
|
12742
13013
|
return;
|
|
@@ -12761,10 +13032,10 @@ function Chat({
|
|
|
12761
13032
|
},
|
|
12762
13033
|
[runtimeCapabilities, stream.client]
|
|
12763
13034
|
);
|
|
12764
|
-
const clearQuoteSelection =
|
|
13035
|
+
const clearQuoteSelection = React45.useCallback(() => {
|
|
12765
13036
|
setQuoteSelection(null);
|
|
12766
13037
|
}, []);
|
|
12767
|
-
const commitComposerParts =
|
|
13038
|
+
const commitComposerParts = React45.useCallback(
|
|
12768
13039
|
(nextParts, options2) => {
|
|
12769
13040
|
const normalized = normalizeComposerParts(nextParts);
|
|
12770
13041
|
const previous = composerPartsRef.current;
|
|
@@ -12800,7 +13071,7 @@ function Chat({
|
|
|
12800
13071
|
},
|
|
12801
13072
|
[]
|
|
12802
13073
|
);
|
|
12803
|
-
const setComposerText =
|
|
13074
|
+
const setComposerText = React45.useCallback(
|
|
12804
13075
|
(text, caretOffset = text.length) => {
|
|
12805
13076
|
commitComposerParts(createComposerTextParts(text), {
|
|
12806
13077
|
caretOffset,
|
|
@@ -12810,7 +13081,7 @@ function Chat({
|
|
|
12810
13081
|
},
|
|
12811
13082
|
[commitComposerParts]
|
|
12812
13083
|
);
|
|
12813
|
-
const focusComposerAt =
|
|
13084
|
+
const focusComposerAt = React45.useCallback((position) => {
|
|
12814
13085
|
const nextPosition = position ?? getComposerEditingLength(composerPartsRef.current);
|
|
12815
13086
|
pendingComposerCaretOffsetRef.current = nextPosition;
|
|
12816
13087
|
requestAnimationFrame(() => {
|
|
@@ -12822,7 +13093,7 @@ function Chat({
|
|
|
12822
13093
|
});
|
|
12823
13094
|
}, []);
|
|
12824
13095
|
const parentMessenger = useParentMessenger({
|
|
12825
|
-
onSetComposerValue:
|
|
13096
|
+
onSetComposerValue: React45.useCallback(
|
|
12826
13097
|
(payload) => {
|
|
12827
13098
|
if (!payload) {
|
|
12828
13099
|
return;
|
|
@@ -12845,10 +13116,10 @@ function Chat({
|
|
|
12845
13116
|
},
|
|
12846
13117
|
[composer?.tools, setComposerText]
|
|
12847
13118
|
),
|
|
12848
|
-
onFocusComposer:
|
|
13119
|
+
onFocusComposer: React45.useCallback(() => {
|
|
12849
13120
|
composerInputRef.current?.focus();
|
|
12850
13121
|
}, []),
|
|
12851
|
-
onSetPetEnabled:
|
|
13122
|
+
onSetPetEnabled: React45.useCallback(
|
|
12852
13123
|
(enabled) => {
|
|
12853
13124
|
if (petRequired) {
|
|
12854
13125
|
return;
|
|
@@ -12861,7 +13132,11 @@ function Chat({
|
|
|
12861
13132
|
[displayedPetSettings, petRequired, savePetLocalSettings]
|
|
12862
13133
|
)
|
|
12863
13134
|
});
|
|
12864
|
-
const
|
|
13135
|
+
const canMinimizeToPet = parentMessenger?.isParentAvailable === true && isPetEnabled(effectivePet);
|
|
13136
|
+
const handleMinimizeToPet = React45.useCallback(() => {
|
|
13137
|
+
parentMessenger?.sendEvent("chat_minimize_change", { minimized: true });
|
|
13138
|
+
}, [parentMessenger]);
|
|
13139
|
+
const syncQuoteSelection = React45.useCallback(() => {
|
|
12865
13140
|
if (typeof window === "undefined") {
|
|
12866
13141
|
clearQuoteSelection();
|
|
12867
13142
|
return;
|
|
@@ -12906,23 +13181,23 @@ function Chat({
|
|
|
12906
13181
|
left
|
|
12907
13182
|
});
|
|
12908
13183
|
}, [clearQuoteSelection]);
|
|
12909
|
-
const cancelPendingAutoScroll =
|
|
13184
|
+
const cancelPendingAutoScroll = React45.useCallback(() => {
|
|
12910
13185
|
if (autoScrollFrameRef.current !== null) {
|
|
12911
13186
|
cancelAnimationFrame(autoScrollFrameRef.current);
|
|
12912
13187
|
autoScrollFrameRef.current = null;
|
|
12913
13188
|
}
|
|
12914
13189
|
}, []);
|
|
12915
|
-
const disableAutoFollow =
|
|
13190
|
+
const disableAutoFollow = React45.useCallback(() => {
|
|
12916
13191
|
forceFollowRef.current = false;
|
|
12917
13192
|
shouldAutoScrollRef.current = false;
|
|
12918
13193
|
cancelPendingAutoScroll();
|
|
12919
13194
|
}, [cancelPendingAutoScroll]);
|
|
12920
|
-
const enableAutoFollow =
|
|
13195
|
+
const enableAutoFollow = React45.useCallback(() => {
|
|
12921
13196
|
forceFollowRef.current = true;
|
|
12922
13197
|
shouldAutoScrollRef.current = true;
|
|
12923
13198
|
setHasUpdatesBelow(false);
|
|
12924
13199
|
}, []);
|
|
12925
|
-
const scrollToBottom =
|
|
13200
|
+
const scrollToBottom = React45.useCallback(
|
|
12926
13201
|
(smooth = false, force = false) => {
|
|
12927
13202
|
if (force) {
|
|
12928
13203
|
enableAutoFollow();
|
|
@@ -12949,7 +13224,7 @@ function Chat({
|
|
|
12949
13224
|
},
|
|
12950
13225
|
[cancelPendingAutoScroll, enableAutoFollow]
|
|
12951
13226
|
);
|
|
12952
|
-
|
|
13227
|
+
React45.useEffect(() => {
|
|
12953
13228
|
const viewport = viewportRef.current;
|
|
12954
13229
|
if (!viewport) return;
|
|
12955
13230
|
previousScrollTopRef.current = viewport.scrollTop;
|
|
@@ -13030,14 +13305,14 @@ function Chat({
|
|
|
13030
13305
|
window.removeEventListener("pointercancel", stopPointerTracking);
|
|
13031
13306
|
};
|
|
13032
13307
|
}, [cancelPendingAutoScroll, disableAutoFollow]);
|
|
13033
|
-
|
|
13308
|
+
React45.useEffect(() => {
|
|
13034
13309
|
shouldAutoScrollRef.current = true;
|
|
13035
13310
|
forceFollowRef.current = false;
|
|
13036
13311
|
previousScrollTopRef.current = 0;
|
|
13037
13312
|
setIsAtBottom(true);
|
|
13038
13313
|
setHasUpdatesBelow(false);
|
|
13039
13314
|
}, [stream.threadId]);
|
|
13040
|
-
|
|
13315
|
+
React45.useEffect(() => {
|
|
13041
13316
|
const messageCountChanged = messages.length !== previousMessageCountRef.current;
|
|
13042
13317
|
previousMessageCountRef.current = messages.length;
|
|
13043
13318
|
if (!shouldAutoScrollRef.current) {
|
|
@@ -13056,7 +13331,7 @@ function Chat({
|
|
|
13056
13331
|
clientSecret: effectiveClientSecret
|
|
13057
13332
|
});
|
|
13058
13333
|
const missingConfig = Boolean(missingConfigKind);
|
|
13059
|
-
const missingConfigShortMessage =
|
|
13334
|
+
const missingConfigShortMessage = React45.useMemo(() => {
|
|
13060
13335
|
switch (missingConfigKind) {
|
|
13061
13336
|
case "apiUrl":
|
|
13062
13337
|
return t("chat.missingApiUrlShort");
|
|
@@ -13068,7 +13343,7 @@ function Chat({
|
|
|
13068
13343
|
return t("chat.missingConfigShort");
|
|
13069
13344
|
}
|
|
13070
13345
|
}, [missingConfigKind, t]);
|
|
13071
|
-
const missingConfigDetailMessage =
|
|
13346
|
+
const missingConfigDetailMessage = React45.useMemo(() => {
|
|
13072
13347
|
switch (missingConfigKind) {
|
|
13073
13348
|
case "apiUrl":
|
|
13074
13349
|
return t("chat.missingApiUrlDetail");
|
|
@@ -13083,7 +13358,7 @@ function Chat({
|
|
|
13083
13358
|
const showMissingConfig = !isClientSecretInitializing && missingConfig;
|
|
13084
13359
|
const hasUploadingFiles = attachments.some((a) => a.status === "uploading");
|
|
13085
13360
|
const isSendDisabled = !trimmedDraft && !hasReferences || hasPendingInteractiveRequest || missingConfig || isHistoryLoading || hasUploadingFiles || isUploadingReferenceImages;
|
|
13086
|
-
const resizeComposerInput =
|
|
13361
|
+
const resizeComposerInput = React45.useCallback(() => {
|
|
13087
13362
|
const input = composerInputRef.current;
|
|
13088
13363
|
if (!input) {
|
|
13089
13364
|
return;
|
|
@@ -13091,7 +13366,7 @@ function Chat({
|
|
|
13091
13366
|
input.style.maxHeight = `${COMPOSER_INPUT_MAX_HEIGHT}px`;
|
|
13092
13367
|
input.style.overflowY = input.scrollHeight > COMPOSER_INPUT_MAX_HEIGHT ? "auto" : "hidden";
|
|
13093
13368
|
}, []);
|
|
13094
|
-
|
|
13369
|
+
React45.useLayoutEffect(() => {
|
|
13095
13370
|
composerPartsRef.current = composerParts;
|
|
13096
13371
|
resizeComposerInput();
|
|
13097
13372
|
const caretOffset = pendingComposerCaretOffsetRef.current;
|
|
@@ -13103,13 +13378,13 @@ function Chat({
|
|
|
13103
13378
|
}
|
|
13104
13379
|
}
|
|
13105
13380
|
}, [composerDomVersion, composerParts, resizeComposerInput]);
|
|
13106
|
-
|
|
13381
|
+
React45.useEffect(() => {
|
|
13107
13382
|
document.addEventListener("selectionchange", syncQuoteSelection);
|
|
13108
13383
|
return () => {
|
|
13109
13384
|
document.removeEventListener("selectionchange", syncQuoteSelection);
|
|
13110
13385
|
};
|
|
13111
13386
|
}, [syncQuoteSelection]);
|
|
13112
|
-
|
|
13387
|
+
React45.useEffect(() => {
|
|
13113
13388
|
const viewport = viewportRef.current;
|
|
13114
13389
|
if (!viewport) {
|
|
13115
13390
|
return;
|
|
@@ -13126,14 +13401,14 @@ function Chat({
|
|
|
13126
13401
|
window.removeEventListener("resize", handleViewportScroll);
|
|
13127
13402
|
};
|
|
13128
13403
|
}, [clearQuoteSelection]);
|
|
13129
|
-
|
|
13404
|
+
React45.useEffect(() => {
|
|
13130
13405
|
clearQuoteSelection();
|
|
13131
13406
|
}, [messages.length, stream.threadId, clearQuoteSelection]);
|
|
13132
|
-
|
|
13407
|
+
React45.useEffect(() => {
|
|
13133
13408
|
if (missingConfig) return;
|
|
13134
13409
|
void refreshThreads();
|
|
13135
13410
|
}, [missingConfig, refreshThreads]);
|
|
13136
|
-
|
|
13411
|
+
React45.useEffect(() => {
|
|
13137
13412
|
if (missingConfig || !stream.client || !stream.assistantId) {
|
|
13138
13413
|
setAssistantName(null);
|
|
13139
13414
|
setAssistantAvatar(null);
|
|
@@ -13156,7 +13431,7 @@ function Chat({
|
|
|
13156
13431
|
cancelled = true;
|
|
13157
13432
|
};
|
|
13158
13433
|
}, [missingConfig, stream.client, stream.assistantId]);
|
|
13159
|
-
|
|
13434
|
+
React45.useEffect(() => {
|
|
13160
13435
|
if (missingConfig || !stream.client || !stream.assistantId) {
|
|
13161
13436
|
setRuntimeCapabilities(null);
|
|
13162
13437
|
setRuntimeCapabilitiesReady(false);
|
|
@@ -13203,7 +13478,7 @@ function Chat({
|
|
|
13203
13478
|
});
|
|
13204
13479
|
return () => controller.abort();
|
|
13205
13480
|
}, [missingConfig, stream.client, stream.assistantId]);
|
|
13206
|
-
|
|
13481
|
+
React45.useEffect(() => {
|
|
13207
13482
|
setRunRuntimeCapabilities(
|
|
13208
13483
|
createEmptyRuntimeCapabilitiesSelection(runtimeCapabilities)
|
|
13209
13484
|
);
|
|
@@ -13260,7 +13535,7 @@ function Chat({
|
|
|
13260
13535
|
mimetype: a.storageFile?.mimetype ?? a.file.type,
|
|
13261
13536
|
size: a.storageFile?.size ?? a.file.size
|
|
13262
13537
|
}));
|
|
13263
|
-
const handleSessionRuntimeCapabilityToggle =
|
|
13538
|
+
const handleSessionRuntimeCapabilityToggle = React45.useCallback(
|
|
13264
13539
|
(type, id, selected) => {
|
|
13265
13540
|
setSessionRuntimeCapabilities((previous) => {
|
|
13266
13541
|
const nextSelection = toggleRuntimeCapabilitySelection(
|
|
@@ -13278,7 +13553,7 @@ function Chat({
|
|
|
13278
13553
|
},
|
|
13279
13554
|
[persistSessionRuntimeCapabilities, stream.threadId]
|
|
13280
13555
|
);
|
|
13281
|
-
const updateRuntimeCapabilityPalette =
|
|
13556
|
+
const updateRuntimeCapabilityPalette = React45.useCallback(
|
|
13282
13557
|
(parts, selectionStart) => {
|
|
13283
13558
|
const input = composerInputRef.current;
|
|
13284
13559
|
const editingText = getComposerEditingText(parts);
|
|
@@ -13290,7 +13565,7 @@ function Chat({
|
|
|
13290
13565
|
},
|
|
13291
13566
|
[]
|
|
13292
13567
|
);
|
|
13293
|
-
const syncComposerInputFromElement =
|
|
13568
|
+
const syncComposerInputFromElement = React45.useCallback(
|
|
13294
13569
|
(input) => {
|
|
13295
13570
|
const previousCapabilities = getComposerCapabilityPartMap(
|
|
13296
13571
|
composerPartsRef.current
|
|
@@ -13308,25 +13583,25 @@ function Chat({
|
|
|
13308
13583
|
},
|
|
13309
13584
|
[commitComposerParts, updateRuntimeCapabilityPalette]
|
|
13310
13585
|
);
|
|
13311
|
-
const handleComposerInput =
|
|
13586
|
+
const handleComposerInput = React45.useCallback(
|
|
13312
13587
|
(event) => {
|
|
13313
13588
|
syncComposerInputFromElement(event.currentTarget);
|
|
13314
13589
|
},
|
|
13315
13590
|
[syncComposerInputFromElement]
|
|
13316
13591
|
);
|
|
13317
|
-
const handleComposerCompositionEnd =
|
|
13592
|
+
const handleComposerCompositionEnd = React45.useCallback(
|
|
13318
13593
|
(event) => {
|
|
13319
13594
|
syncComposerInputFromElement(event.currentTarget);
|
|
13320
13595
|
},
|
|
13321
13596
|
[syncComposerInputFromElement]
|
|
13322
13597
|
);
|
|
13323
|
-
const handleComposerSelect =
|
|
13598
|
+
const handleComposerSelect = React45.useCallback(() => {
|
|
13324
13599
|
updateRuntimeCapabilityPalette(
|
|
13325
13600
|
composerPartsRef.current,
|
|
13326
13601
|
composerInputRef.current ? getComposerSelectionOffset(composerInputRef.current) : void 0
|
|
13327
13602
|
);
|
|
13328
13603
|
}, [updateRuntimeCapabilityPalette]);
|
|
13329
|
-
const removeRunRuntimeCapability =
|
|
13604
|
+
const removeRunRuntimeCapability = React45.useCallback(
|
|
13330
13605
|
(option) => {
|
|
13331
13606
|
setRunRuntimeCapabilities(
|
|
13332
13607
|
(previous) => toggleRuntimeCapabilitySelection(
|
|
@@ -13346,7 +13621,7 @@ function Chat({
|
|
|
13346
13621
|
},
|
|
13347
13622
|
[commitComposerParts]
|
|
13348
13623
|
);
|
|
13349
|
-
const submitDraft =
|
|
13624
|
+
const submitDraft = React45.useCallback(
|
|
13350
13625
|
(optionsOrFollowUp) => {
|
|
13351
13626
|
if (isSendDisabled) return;
|
|
13352
13627
|
const submitOptions = typeof optionsOrFollowUp === "string" ? { followUpOverride: optionsOrFollowUp } : optionsOrFollowUp ?? {};
|
|
@@ -13470,7 +13745,7 @@ function Chat({
|
|
|
13470
13745
|
t
|
|
13471
13746
|
]
|
|
13472
13747
|
);
|
|
13473
|
-
const addRunRuntimeCapabilities =
|
|
13748
|
+
const addRunRuntimeCapabilities = React45.useCallback(
|
|
13474
13749
|
(selection) => {
|
|
13475
13750
|
setRunRuntimeCapabilities(
|
|
13476
13751
|
(previous) => runtimeCapabilities ? mergeRuntimeCapabilitiesSelections(
|
|
@@ -13482,7 +13757,7 @@ function Chat({
|
|
|
13482
13757
|
},
|
|
13483
13758
|
[runtimeCapabilities]
|
|
13484
13759
|
);
|
|
13485
|
-
const insertComposerCapabilityToken =
|
|
13760
|
+
const insertComposerCapabilityToken = React45.useCallback(
|
|
13486
13761
|
(capability, range) => {
|
|
13487
13762
|
const token = createComposerCapabilityPart(capability, createMessageId());
|
|
13488
13763
|
const currentParts = composerPartsRef.current;
|
|
@@ -13553,7 +13828,7 @@ function Chat({
|
|
|
13553
13828
|
plugin: t("composer.slashCommands.empty.loadingCapabilities"),
|
|
13554
13829
|
subAgent: t("composer.slashCommands.empty.loadingCapabilities")
|
|
13555
13830
|
};
|
|
13556
|
-
|
|
13831
|
+
React45.useEffect(() => {
|
|
13557
13832
|
if (!runtimeCapabilityPalette) {
|
|
13558
13833
|
return;
|
|
13559
13834
|
}
|
|
@@ -13572,7 +13847,7 @@ function Chat({
|
|
|
13572
13847
|
);
|
|
13573
13848
|
}
|
|
13574
13849
|
}, [slashPaletteOptions.length, runtimeCapabilityPalette]);
|
|
13575
|
-
|
|
13850
|
+
React45.useLayoutEffect(() => {
|
|
13576
13851
|
if (!runtimeCapabilityPalette) {
|
|
13577
13852
|
return;
|
|
13578
13853
|
}
|
|
@@ -13596,7 +13871,7 @@ function Chat({
|
|
|
13596
13871
|
}
|
|
13597
13872
|
submitDraft();
|
|
13598
13873
|
};
|
|
13599
|
-
const handleEditPendingFollowUp =
|
|
13874
|
+
const handleEditPendingFollowUp = React45.useCallback(
|
|
13600
13875
|
(id) => {
|
|
13601
13876
|
const item = pendingFollowUps.find(
|
|
13602
13877
|
(entry) => entry.id === id && entry.mode === "queue"
|
|
@@ -13623,7 +13898,7 @@ function Chat({
|
|
|
13623
13898
|
},
|
|
13624
13899
|
[pendingFollowUps, setComposerText, stream]
|
|
13625
13900
|
);
|
|
13626
|
-
const handleQuoteSelection =
|
|
13901
|
+
const handleQuoteSelection = React45.useCallback(() => {
|
|
13627
13902
|
if (!quoteSelection) {
|
|
13628
13903
|
return;
|
|
13629
13904
|
}
|
|
@@ -13639,7 +13914,7 @@ function Chat({
|
|
|
13639
13914
|
const handleAttachmentClick = () => {
|
|
13640
13915
|
fileInputRef.current?.click();
|
|
13641
13916
|
};
|
|
13642
|
-
const uploadContextFile =
|
|
13917
|
+
const uploadContextFile = React45.useCallback(
|
|
13643
13918
|
(file) => stream.client.contexts.uploadFile(file),
|
|
13644
13919
|
[stream.client]
|
|
13645
13920
|
);
|
|
@@ -13743,7 +14018,7 @@ function Chat({
|
|
|
13743
14018
|
}
|
|
13744
14019
|
submitDraft();
|
|
13745
14020
|
};
|
|
13746
|
-
const handleComposerPaste =
|
|
14021
|
+
const handleComposerPaste = React45.useCallback(
|
|
13747
14022
|
(event) => {
|
|
13748
14023
|
const clipboardData = event.clipboardData;
|
|
13749
14024
|
if (!clipboardData) {
|
|
@@ -13842,18 +14117,18 @@ function Chat({
|
|
|
13842
14117
|
uploadContextFile
|
|
13843
14118
|
]
|
|
13844
14119
|
);
|
|
13845
|
-
const alternateFollowUpShortcutLabel =
|
|
14120
|
+
const alternateFollowUpShortcutLabel = React45.useMemo(() => {
|
|
13846
14121
|
if (typeof navigator === "undefined") {
|
|
13847
14122
|
return "\u2318Enter";
|
|
13848
14123
|
}
|
|
13849
14124
|
const platform = navigator.platform || navigator.userAgent;
|
|
13850
14125
|
return /Mac|iPhone|iPad|iPod/i.test(platform) ? "\u2318Enter" : "Ctrl+Enter";
|
|
13851
14126
|
}, []);
|
|
13852
|
-
const followUpShortcutLabels =
|
|
14127
|
+
const followUpShortcutLabels = React45.useMemo(
|
|
13853
14128
|
() => getComposerFollowUpShortcutLabels(alternateFollowUpShortcutLabel),
|
|
13854
14129
|
[alternateFollowUpShortcutLabel]
|
|
13855
14130
|
);
|
|
13856
|
-
const uploadFile =
|
|
14131
|
+
const uploadFile = React45.useCallback(
|
|
13857
14132
|
async (localId, file) => {
|
|
13858
14133
|
try {
|
|
13859
14134
|
const result = await uploadContextFile(file);
|
|
@@ -13876,7 +14151,7 @@ function Chat({
|
|
|
13876
14151
|
},
|
|
13877
14152
|
[uploadContextFile]
|
|
13878
14153
|
);
|
|
13879
|
-
const handleRetryUpload =
|
|
14154
|
+
const handleRetryUpload = React45.useCallback(
|
|
13880
14155
|
(localId) => {
|
|
13881
14156
|
const attachment = attachments.find((a) => a.localId === localId);
|
|
13882
14157
|
if (!attachment || attachment.status !== "error") return;
|
|
@@ -13975,7 +14250,7 @@ function Chat({
|
|
|
13975
14250
|
);
|
|
13976
14251
|
scrollToBottom(true, true);
|
|
13977
14252
|
};
|
|
13978
|
-
const loadConversationMessages =
|
|
14253
|
+
const loadConversationMessages = React45.useCallback(
|
|
13979
14254
|
async (recordId) => {
|
|
13980
14255
|
if (missingConfig) {
|
|
13981
14256
|
setHistoryError(missingConfigShortMessage);
|
|
@@ -14070,12 +14345,12 @@ function Chat({
|
|
|
14070
14345
|
}
|
|
14071
14346
|
};
|
|
14072
14347
|
const acceptMimes = composer?.attachments?.accept ? Object.entries(composer.attachments.accept).map(([mime, exts]) => [mime, ...exts.map((e) => `.${e}`)].join(",")).join(",") : void 0;
|
|
14073
|
-
const currentThread =
|
|
14348
|
+
const currentThread = React45.useMemo(
|
|
14074
14349
|
() => threads.find((item) => item.id === stream.threadId),
|
|
14075
14350
|
[threads, stream.threadId]
|
|
14076
14351
|
);
|
|
14077
14352
|
const streamErrorMessage = stream.error instanceof Error ? stream.error.message : void 0;
|
|
14078
|
-
const threadErrorMessage =
|
|
14353
|
+
const threadErrorMessage = React45.useMemo(() => {
|
|
14079
14354
|
if (streamErrorMessage?.trim()) return streamErrorMessage.trim();
|
|
14080
14355
|
if (currentThread?.status !== "error") return void 0;
|
|
14081
14356
|
const message = currentThread.error?.trim();
|
|
@@ -14106,7 +14381,7 @@ function Chat({
|
|
|
14106
14381
|
fallbackTitle: t("history.threadFallback")
|
|
14107
14382
|
});
|
|
14108
14383
|
const assistantTitle = assistantName || resolvedTitle;
|
|
14109
|
-
return /* @__PURE__ */
|
|
14384
|
+
return /* @__PURE__ */ jsxs33(
|
|
14110
14385
|
"div",
|
|
14111
14386
|
{
|
|
14112
14387
|
ref: viewportRef,
|
|
@@ -14116,10 +14391,10 @@ function Chat({
|
|
|
14116
14391
|
className
|
|
14117
14392
|
),
|
|
14118
14393
|
children: [
|
|
14119
|
-
/* @__PURE__ */
|
|
14120
|
-
/* @__PURE__ */
|
|
14121
|
-
/* @__PURE__ */
|
|
14122
|
-
/* @__PURE__ */
|
|
14394
|
+
/* @__PURE__ */ jsxs33("div", { className: "flex items-center justify-between border-b p-2 sticky top-0 z-10 bg-background", children: [
|
|
14395
|
+
/* @__PURE__ */ jsxs33("div", { className: "flex items-center gap-3 overflow-hidden", children: [
|
|
14396
|
+
/* @__PURE__ */ jsxs33("div", { className: "relative shrink-0", children: [
|
|
14397
|
+
/* @__PURE__ */ jsx50(
|
|
14123
14398
|
ChatkitAvatar,
|
|
14124
14399
|
{
|
|
14125
14400
|
avatar: assistantAvatar,
|
|
@@ -14127,10 +14402,10 @@ function Chat({
|
|
|
14127
14402
|
label: assistantTitle
|
|
14128
14403
|
}
|
|
14129
14404
|
),
|
|
14130
|
-
/* @__PURE__ */
|
|
14405
|
+
/* @__PURE__ */ jsx50("span", { className: "absolute bottom-0 right-0 h-2.5 w-2.5 rounded-full border-2 border-background bg-green-500" })
|
|
14131
14406
|
] }),
|
|
14132
|
-
/* @__PURE__ */
|
|
14133
|
-
/* @__PURE__ */
|
|
14407
|
+
/* @__PURE__ */ jsxs33("div", { className: "truncate", children: [
|
|
14408
|
+
/* @__PURE__ */ jsx50(
|
|
14134
14409
|
"h2",
|
|
14135
14410
|
{
|
|
14136
14411
|
className: "text-lg font-semibold truncate",
|
|
@@ -14138,12 +14413,29 @@ function Chat({
|
|
|
14138
14413
|
children: assistantTitle
|
|
14139
14414
|
}
|
|
14140
14415
|
),
|
|
14141
|
-
/* @__PURE__ */
|
|
14416
|
+
/* @__PURE__ */ jsx50("p", { className: "text-xs text-muted-foreground", children: t("chat.statusOnline") })
|
|
14142
14417
|
] })
|
|
14143
14418
|
] }),
|
|
14144
|
-
/* @__PURE__ */
|
|
14145
|
-
/* @__PURE__ */
|
|
14146
|
-
/* @__PURE__ */
|
|
14419
|
+
/* @__PURE__ */ jsxs33("div", { className: "flex items-center gap-1", children: [
|
|
14420
|
+
canMinimizeToPet && /* @__PURE__ */ jsxs33(Tooltip, { children: [
|
|
14421
|
+
/* @__PURE__ */ jsx50(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx50("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ jsx50(
|
|
14422
|
+
"button",
|
|
14423
|
+
{
|
|
14424
|
+
type: "button",
|
|
14425
|
+
onClick: handleMinimizeToPet,
|
|
14426
|
+
className: cn(
|
|
14427
|
+
"flex h-8 w-8 cursor-pointer items-center justify-center rounded-md",
|
|
14428
|
+
"text-muted-foreground hover:text-foreground hover:bg-muted",
|
|
14429
|
+
"transition-colors duration-150"
|
|
14430
|
+
),
|
|
14431
|
+
"aria-label": t("chat.minimizeToPet"),
|
|
14432
|
+
children: /* @__PURE__ */ jsx50(Minus, { size: 16 })
|
|
14433
|
+
}
|
|
14434
|
+
) }) }),
|
|
14435
|
+
/* @__PURE__ */ jsx50(TooltipContent, { side: "bottom", children: t("chat.minimizeToPet") })
|
|
14436
|
+
] }),
|
|
14437
|
+
/* @__PURE__ */ jsxs33(Tooltip, { children: [
|
|
14438
|
+
/* @__PURE__ */ jsx50(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx50("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ jsx50(
|
|
14147
14439
|
"button",
|
|
14148
14440
|
{
|
|
14149
14441
|
type: "button",
|
|
@@ -14154,14 +14446,14 @@ function Chat({
|
|
|
14154
14446
|
"transition-colors duration-150"
|
|
14155
14447
|
),
|
|
14156
14448
|
"aria-label": t("settings.open"),
|
|
14157
|
-
children: /* @__PURE__ */
|
|
14449
|
+
children: /* @__PURE__ */ jsx50(Settings2, { size: 16 })
|
|
14158
14450
|
}
|
|
14159
14451
|
) }) }),
|
|
14160
|
-
/* @__PURE__ */
|
|
14452
|
+
/* @__PURE__ */ jsx50(TooltipContent, { side: "bottom", children: t("settings.open") })
|
|
14161
14453
|
] }),
|
|
14162
|
-
history?.enabled !== false && /* @__PURE__ */
|
|
14163
|
-
/* @__PURE__ */
|
|
14164
|
-
/* @__PURE__ */
|
|
14454
|
+
history?.enabled !== false && /* @__PURE__ */ jsxs33(Fragment7, { children: [
|
|
14455
|
+
/* @__PURE__ */ jsxs33(Tooltip, { children: [
|
|
14456
|
+
/* @__PURE__ */ jsx50(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx50("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ jsx50(
|
|
14165
14457
|
"button",
|
|
14166
14458
|
{
|
|
14167
14459
|
type: "button",
|
|
@@ -14174,12 +14466,12 @@ function Chat({
|
|
|
14174
14466
|
"disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed"
|
|
14175
14467
|
),
|
|
14176
14468
|
"aria-label": t("history.newThread"),
|
|
14177
|
-
children: /* @__PURE__ */
|
|
14469
|
+
children: /* @__PURE__ */ jsx50(Pencil4, { size: 16 })
|
|
14178
14470
|
}
|
|
14179
14471
|
) }) }),
|
|
14180
|
-
/* @__PURE__ */
|
|
14472
|
+
/* @__PURE__ */ jsx50(TooltipContent, { side: "bottom", children: t("history.newThread") })
|
|
14181
14473
|
] }),
|
|
14182
|
-
/* @__PURE__ */
|
|
14474
|
+
/* @__PURE__ */ jsx50(
|
|
14183
14475
|
HistorySidebar,
|
|
14184
14476
|
{
|
|
14185
14477
|
threads,
|
|
@@ -14194,18 +14486,18 @@ function Chat({
|
|
|
14194
14486
|
] })
|
|
14195
14487
|
] })
|
|
14196
14488
|
] }),
|
|
14197
|
-
/* @__PURE__ */
|
|
14198
|
-
errorMessage && /* @__PURE__ */
|
|
14199
|
-
historyError && /* @__PURE__ */
|
|
14200
|
-
showMissingConfig && /* @__PURE__ */
|
|
14201
|
-
isHistoryLoading && /* @__PURE__ */
|
|
14202
|
-
messages.length === 0 ? /* @__PURE__ */
|
|
14489
|
+
/* @__PURE__ */ jsxs33("div", { className: "flex-1 p-4", children: [
|
|
14490
|
+
errorMessage && /* @__PURE__ */ jsx50("div", { className: "mb-4 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive", children: errorMessage }),
|
|
14491
|
+
historyError && /* @__PURE__ */ jsx50("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: historyError }),
|
|
14492
|
+
showMissingConfig && /* @__PURE__ */ jsx50("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: missingConfigDetailMessage }),
|
|
14493
|
+
isHistoryLoading && /* @__PURE__ */ jsx50("div", { className: "mb-4 rounded-lg border border-muted px-3 py-2 text-sm text-muted-foreground", children: t("chat.loadingThread") }),
|
|
14494
|
+
messages.length === 0 ? /* @__PURE__ */ jsx50(
|
|
14203
14495
|
StartScreen,
|
|
14204
14496
|
{
|
|
14205
14497
|
startScreen,
|
|
14206
14498
|
onPromptClick: handlePromptClick
|
|
14207
14499
|
}
|
|
14208
|
-
) : /* @__PURE__ */
|
|
14500
|
+
) : /* @__PURE__ */ jsxs33("div", { className: "space-y-4", children: [
|
|
14209
14501
|
messages.map((message, index) => {
|
|
14210
14502
|
const messageType = String(message.type);
|
|
14211
14503
|
const isAssistantMessage = messageType === "assistant" || messageType === "ai";
|
|
@@ -14238,7 +14530,7 @@ function Chat({
|
|
|
14238
14530
|
if (!isAssistantMessage && !hasPlainRenderableContent && !hasHumanAttachments && humanRuntimeCapabilityOptions.length === 0 && humanReferences.length === 0) {
|
|
14239
14531
|
return null;
|
|
14240
14532
|
}
|
|
14241
|
-
return /* @__PURE__ */
|
|
14533
|
+
return /* @__PURE__ */ jsx50(
|
|
14242
14534
|
"div",
|
|
14243
14535
|
{
|
|
14244
14536
|
className: cn(
|
|
@@ -14246,8 +14538,8 @@ function Chat({
|
|
|
14246
14538
|
message.type === "human" ? "justify-end" : "justify-start -ml-1"
|
|
14247
14539
|
// AI messages: slightly closer to left
|
|
14248
14540
|
),
|
|
14249
|
-
children: /* @__PURE__ */
|
|
14250
|
-
/* @__PURE__ */
|
|
14541
|
+
children: /* @__PURE__ */ jsxs33("div", { className: "flex flex-col px-3 overflow-hidden", children: [
|
|
14542
|
+
/* @__PURE__ */ jsx50(
|
|
14251
14543
|
"div",
|
|
14252
14544
|
{
|
|
14253
14545
|
...canQuoteMessage ? {
|
|
@@ -14259,7 +14551,7 @@ function Chat({
|
|
|
14259
14551
|
message.type === "human" ? "bg-primary text-primary-foreground px-4 py-2.5" : message.type === "system" ? "bg-muted text-muted-foreground text-xs px-4 py-2.5" : "py-1 text-chat-foreground"
|
|
14260
14552
|
// AI messages: use chat-specific foreground color
|
|
14261
14553
|
),
|
|
14262
|
-
children: isAssistantMessage ? /* @__PURE__ */
|
|
14554
|
+
children: isAssistantMessage ? /* @__PURE__ */ jsx50(
|
|
14263
14555
|
AssistantMessage,
|
|
14264
14556
|
{
|
|
14265
14557
|
message: {
|
|
@@ -14278,25 +14570,25 @@ function Chat({
|
|
|
14278
14570
|
organizationId: stream.organizationId,
|
|
14279
14571
|
apiUrl: stream.apiUrl
|
|
14280
14572
|
}
|
|
14281
|
-
) : /* @__PURE__ */
|
|
14282
|
-
message.type === "human" && humanRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */
|
|
14573
|
+
) : /* @__PURE__ */ jsxs33(Fragment7, { children: [
|
|
14574
|
+
message.type === "human" && humanRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ jsx50("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanRuntimeCapabilityOptions.map((option) => /* @__PURE__ */ jsxs33(
|
|
14283
14575
|
"span",
|
|
14284
14576
|
{
|
|
14285
14577
|
className: "inline-flex max-w-full items-center gap-1 rounded-md bg-primary-foreground/20 px-2 py-1 text-xs font-medium text-primary-foreground",
|
|
14286
14578
|
children: [
|
|
14287
|
-
/* @__PURE__ */
|
|
14579
|
+
/* @__PURE__ */ jsx50(
|
|
14288
14580
|
RuntimeCapabilityIcon,
|
|
14289
14581
|
{
|
|
14290
14582
|
option,
|
|
14291
14583
|
variant: "chip"
|
|
14292
14584
|
}
|
|
14293
14585
|
),
|
|
14294
|
-
/* @__PURE__ */
|
|
14586
|
+
/* @__PURE__ */ jsx50("span", { className: "max-w-[9rem] truncate", children: option.label })
|
|
14295
14587
|
]
|
|
14296
14588
|
},
|
|
14297
14589
|
`${option.type}:${option.id}`
|
|
14298
14590
|
)) }),
|
|
14299
|
-
message.type === "human" && humanReferences.length > 0 && /* @__PURE__ */
|
|
14591
|
+
message.type === "human" && humanReferences.length > 0 && /* @__PURE__ */ jsx50("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanReferences.map((reference) => /* @__PURE__ */ jsx50(
|
|
14300
14592
|
ReferenceChip,
|
|
14301
14593
|
{
|
|
14302
14594
|
reference,
|
|
@@ -14304,29 +14596,29 @@ function Chat({
|
|
|
14304
14596
|
},
|
|
14305
14597
|
getReferenceKey(reference)
|
|
14306
14598
|
)) }),
|
|
14307
|
-
message.type === "human" && humanAttachments.length > 0 && /* @__PURE__ */
|
|
14599
|
+
message.type === "human" && humanAttachments.length > 0 && /* @__PURE__ */ jsx50("div", { className: "flex flex-wrap gap-1.5 mb-2", children: humanAttachments.map((file, fileIndex) => /* @__PURE__ */ jsxs33(
|
|
14308
14600
|
"div",
|
|
14309
14601
|
{
|
|
14310
14602
|
className: "flex items-center gap-1.5 rounded-md bg-primary-foreground/20 px-2 py-1 text-xs",
|
|
14311
14603
|
children: [
|
|
14312
|
-
/* @__PURE__ */
|
|
14313
|
-
/* @__PURE__ */
|
|
14604
|
+
/* @__PURE__ */ jsx50(FileText3, { size: 12 }),
|
|
14605
|
+
/* @__PURE__ */ jsx50("span", { className: "max-w-[100px] truncate", children: file.originalName })
|
|
14314
14606
|
]
|
|
14315
14607
|
},
|
|
14316
14608
|
fileIndex
|
|
14317
14609
|
)) }),
|
|
14318
|
-
Array.isArray(message.content) ? message.content.map((part, partIndex) => /* @__PURE__ */
|
|
14610
|
+
Array.isArray(message.content) ? message.content.map((part, partIndex) => /* @__PURE__ */ jsx50(
|
|
14319
14611
|
"p",
|
|
14320
14612
|
{
|
|
14321
14613
|
className: "wrap-break-word text-sm leading-relaxed",
|
|
14322
14614
|
children: formatMessageContent(part)
|
|
14323
14615
|
},
|
|
14324
14616
|
`${part.type}-${partIndex}`
|
|
14325
|
-
)) : /* @__PURE__ */
|
|
14617
|
+
)) : /* @__PURE__ */ jsx50("span", { className: "wrap-break-word text-sm leading-relaxed", children: formatMessageContent(message.content) })
|
|
14326
14618
|
] })
|
|
14327
14619
|
}
|
|
14328
14620
|
),
|
|
14329
|
-
/* @__PURE__ */
|
|
14621
|
+
/* @__PURE__ */ jsx50(
|
|
14330
14622
|
MessageActions,
|
|
14331
14623
|
{
|
|
14332
14624
|
content: messageContent,
|
|
@@ -14362,7 +14654,7 @@ function Chat({
|
|
|
14362
14654
|
stream.isLoading,
|
|
14363
14655
|
{ now: streamingNow }
|
|
14364
14656
|
);
|
|
14365
|
-
return /* @__PURE__ */
|
|
14657
|
+
return /* @__PURE__ */ jsx50("div", { className: "flex justify-start gap-3 -ml-2", children: /* @__PURE__ */ jsx50("div", { className: "max-w-full rounded-2xl py-2.5", children: /* @__PURE__ */ jsx50(
|
|
14366
14658
|
AssistantStreamingIndicator,
|
|
14367
14659
|
{
|
|
14368
14660
|
status: fallbackStreamingStatus ?? "loading"
|
|
@@ -14371,7 +14663,7 @@ function Chat({
|
|
|
14371
14663
|
})()
|
|
14372
14664
|
] })
|
|
14373
14665
|
] }),
|
|
14374
|
-
!isAtBottom && messages.length > 0 && /* @__PURE__ */
|
|
14666
|
+
!isAtBottom && messages.length > 0 && /* @__PURE__ */ jsx50("div", { className: "sticky bottom-20 z-20 flex justify-center px-4 pointer-events-none", children: /* @__PURE__ */ jsx50(
|
|
14375
14667
|
Button,
|
|
14376
14668
|
{
|
|
14377
14669
|
type: "button",
|
|
@@ -14384,10 +14676,10 @@ function Chat({
|
|
|
14384
14676
|
onClick: () => scrollToBottom(true, true),
|
|
14385
14677
|
"aria-label": t("chat.scrollToBottom"),
|
|
14386
14678
|
title: t("chat.scrollToBottom"),
|
|
14387
|
-
children: /* @__PURE__ */
|
|
14679
|
+
children: /* @__PURE__ */ jsx50(ArrowDown2, { size: 16 })
|
|
14388
14680
|
}
|
|
14389
14681
|
) }),
|
|
14390
|
-
quoteSelection && /* @__PURE__ */
|
|
14682
|
+
quoteSelection && /* @__PURE__ */ jsx50(
|
|
14391
14683
|
"div",
|
|
14392
14684
|
{
|
|
14393
14685
|
className: "pointer-events-none fixed z-50",
|
|
@@ -14396,7 +14688,7 @@ function Chat({
|
|
|
14396
14688
|
left: `${quoteSelection.left}px`,
|
|
14397
14689
|
transform: "translateX(-50%)"
|
|
14398
14690
|
},
|
|
14399
|
-
children: /* @__PURE__ */
|
|
14691
|
+
children: /* @__PURE__ */ jsxs33(
|
|
14400
14692
|
Button,
|
|
14401
14693
|
{
|
|
14402
14694
|
type: "button",
|
|
@@ -14408,16 +14700,16 @@ function Chat({
|
|
|
14408
14700
|
"aria-label": t("composer.quoteSelection"),
|
|
14409
14701
|
title: t("composer.quoteSelection"),
|
|
14410
14702
|
children: [
|
|
14411
|
-
/* @__PURE__ */
|
|
14703
|
+
/* @__PURE__ */ jsx50(Quote, { size: 14 }),
|
|
14412
14704
|
t("composer.quoteSelection")
|
|
14413
14705
|
]
|
|
14414
14706
|
}
|
|
14415
14707
|
)
|
|
14416
14708
|
}
|
|
14417
14709
|
),
|
|
14418
|
-
/* @__PURE__ */
|
|
14419
|
-
threadErrorMessage && /* @__PURE__ */
|
|
14420
|
-
/* @__PURE__ */
|
|
14710
|
+
/* @__PURE__ */ jsxs33("div", { className: "p-2 sticky bottom-0 z-10 bg-background", children: [
|
|
14711
|
+
threadErrorMessage && /* @__PURE__ */ jsx50("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 }),
|
|
14712
|
+
/* @__PURE__ */ jsx50(
|
|
14421
14713
|
"input",
|
|
14422
14714
|
{
|
|
14423
14715
|
ref: fileInputRef,
|
|
@@ -14428,7 +14720,7 @@ function Chat({
|
|
|
14428
14720
|
className: "hidden"
|
|
14429
14721
|
}
|
|
14430
14722
|
),
|
|
14431
|
-
attachments.length > 0 && /* @__PURE__ */
|
|
14723
|
+
attachments.length > 0 && /* @__PURE__ */ jsx50("div", { className: "mb-3 flex flex-wrap gap-2", children: attachments.map((item) => /* @__PURE__ */ jsxs33(
|
|
14432
14724
|
"div",
|
|
14433
14725
|
{
|
|
14434
14726
|
className: cn(
|
|
@@ -14436,16 +14728,16 @@ function Chat({
|
|
|
14436
14728
|
item.status === "error" ? "bg-destructive/10 border border-destructive/30" : "bg-muted"
|
|
14437
14729
|
),
|
|
14438
14730
|
children: [
|
|
14439
|
-
item.status === "uploading" && /* @__PURE__ */
|
|
14731
|
+
item.status === "uploading" && /* @__PURE__ */ jsx50(
|
|
14440
14732
|
Loader26,
|
|
14441
14733
|
{
|
|
14442
14734
|
size: 14,
|
|
14443
14735
|
className: "animate-spin text-muted-foreground"
|
|
14444
14736
|
}
|
|
14445
14737
|
),
|
|
14446
|
-
item.status === "success" && /* @__PURE__ */
|
|
14447
|
-
item.status === "error" && /* @__PURE__ */
|
|
14448
|
-
/* @__PURE__ */
|
|
14738
|
+
item.status === "success" && /* @__PURE__ */ jsx50(FileText3, { size: 14, className: "text-muted-foreground" }),
|
|
14739
|
+
item.status === "error" && /* @__PURE__ */ jsx50(FileText3, { size: 14, className: "text-destructive" }),
|
|
14740
|
+
/* @__PURE__ */ jsx50(
|
|
14449
14741
|
"span",
|
|
14450
14742
|
{
|
|
14451
14743
|
className: cn(
|
|
@@ -14455,17 +14747,17 @@ function Chat({
|
|
|
14455
14747
|
children: item.file.name
|
|
14456
14748
|
}
|
|
14457
14749
|
),
|
|
14458
|
-
item.status === "error" && /* @__PURE__ */
|
|
14750
|
+
item.status === "error" && /* @__PURE__ */ jsx50(
|
|
14459
14751
|
"button",
|
|
14460
14752
|
{
|
|
14461
14753
|
type: "button",
|
|
14462
14754
|
onClick: () => handleRetryUpload(item.localId),
|
|
14463
14755
|
className: "ml-1 rounded-full p-0.5 text-destructive hover:bg-destructive/20",
|
|
14464
14756
|
title: t("chat.retryUpload"),
|
|
14465
|
-
children: /* @__PURE__ */
|
|
14757
|
+
children: /* @__PURE__ */ jsx50(RefreshCw2, { size: 12 })
|
|
14466
14758
|
}
|
|
14467
14759
|
),
|
|
14468
|
-
/* @__PURE__ */
|
|
14760
|
+
/* @__PURE__ */ jsx50(
|
|
14469
14761
|
"button",
|
|
14470
14762
|
{
|
|
14471
14763
|
type: "button",
|
|
@@ -14474,14 +14766,14 @@ function Chat({
|
|
|
14474
14766
|
"ml-1 rounded-full p-0.5",
|
|
14475
14767
|
item.status === "error" ? "text-destructive hover:bg-destructive/20" : "hover:bg-muted-foreground/20"
|
|
14476
14768
|
),
|
|
14477
|
-
children: /* @__PURE__ */
|
|
14769
|
+
children: /* @__PURE__ */ jsx50(X5, { size: 12 })
|
|
14478
14770
|
}
|
|
14479
14771
|
)
|
|
14480
14772
|
]
|
|
14481
14773
|
},
|
|
14482
14774
|
item.localId
|
|
14483
14775
|
)) }),
|
|
14484
|
-
references.length > 0 && /* @__PURE__ */
|
|
14776
|
+
references.length > 0 && /* @__PURE__ */ jsx50("div", { className: "mb-3 flex flex-wrap gap-2", children: references.map((reference) => /* @__PURE__ */ jsx50(
|
|
14485
14777
|
ReferenceChip,
|
|
14486
14778
|
{
|
|
14487
14779
|
reference,
|
|
@@ -14495,16 +14787,16 @@ function Chat({
|
|
|
14495
14787
|
},
|
|
14496
14788
|
getReferenceKey(reference)
|
|
14497
14789
|
)) }),
|
|
14498
|
-
detachedRunRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */
|
|
14499
|
-
/* @__PURE__ */
|
|
14500
|
-
detachedRunRuntimeCapabilityOptions.map((option) => /* @__PURE__ */
|
|
14790
|
+
detachedRunRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ jsxs33("div", { className: "mb-2 flex flex-wrap items-center gap-2", children: [
|
|
14791
|
+
/* @__PURE__ */ jsx50("span", { className: "text-xs text-muted-foreground", children: t("composer.capabilities.runOnly") }),
|
|
14792
|
+
detachedRunRuntimeCapabilityOptions.map((option) => /* @__PURE__ */ jsxs33(
|
|
14501
14793
|
"span",
|
|
14502
14794
|
{
|
|
14503
14795
|
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",
|
|
14504
14796
|
children: [
|
|
14505
|
-
/* @__PURE__ */
|
|
14506
|
-
/* @__PURE__ */
|
|
14507
|
-
/* @__PURE__ */
|
|
14797
|
+
/* @__PURE__ */ jsx50(RuntimeCapabilityIcon, { option, variant: "chip" }),
|
|
14798
|
+
/* @__PURE__ */ jsx50("span", { className: "max-w-40 truncate", children: option.label }),
|
|
14799
|
+
/* @__PURE__ */ jsx50(
|
|
14508
14800
|
"button",
|
|
14509
14801
|
{
|
|
14510
14802
|
type: "button",
|
|
@@ -14512,7 +14804,7 @@ function Chat({
|
|
|
14512
14804
|
className: "rounded-full p-0.5 hover:bg-primary/15",
|
|
14513
14805
|
title: t("composer.capabilities.removeRunCapability"),
|
|
14514
14806
|
"aria-label": t("composer.capabilities.removeRunCapability"),
|
|
14515
|
-
children: /* @__PURE__ */
|
|
14807
|
+
children: /* @__PURE__ */ jsx50(X5, { size: 11 })
|
|
14516
14808
|
}
|
|
14517
14809
|
)
|
|
14518
14810
|
]
|
|
@@ -14520,7 +14812,7 @@ function Chat({
|
|
|
14520
14812
|
`${option.type}:${option.id}`
|
|
14521
14813
|
))
|
|
14522
14814
|
] }),
|
|
14523
|
-
/* @__PURE__ */
|
|
14815
|
+
/* @__PURE__ */ jsx50(
|
|
14524
14816
|
PendingRuntimeServices,
|
|
14525
14817
|
{
|
|
14526
14818
|
state: stream.runtimeActivities.sandboxServices,
|
|
@@ -14529,7 +14821,7 @@ function Chat({
|
|
|
14529
14821
|
className: hasPendingTodos || hasPendingFollowUps ? "mb-2" : void 0
|
|
14530
14822
|
}
|
|
14531
14823
|
),
|
|
14532
|
-
/* @__PURE__ */
|
|
14824
|
+
/* @__PURE__ */ jsx50(
|
|
14533
14825
|
PendingTodos,
|
|
14534
14826
|
{
|
|
14535
14827
|
snapshot: stream.todos,
|
|
@@ -14537,7 +14829,7 @@ function Chat({
|
|
|
14537
14829
|
className: hasPendingFollowUps ? "mb-2" : void 0
|
|
14538
14830
|
}
|
|
14539
14831
|
),
|
|
14540
|
-
/* @__PURE__ */
|
|
14832
|
+
/* @__PURE__ */ jsx50(
|
|
14541
14833
|
PendingFollowUps,
|
|
14542
14834
|
{
|
|
14543
14835
|
items: pendingFollowUps,
|
|
@@ -14552,7 +14844,7 @@ function Chat({
|
|
|
14552
14844
|
attachToComposer: true
|
|
14553
14845
|
}
|
|
14554
14846
|
),
|
|
14555
|
-
/* @__PURE__ */
|
|
14847
|
+
/* @__PURE__ */ jsx50(
|
|
14556
14848
|
RequestUserInputPanel,
|
|
14557
14849
|
{
|
|
14558
14850
|
request: stream.pendingRequestUserInput,
|
|
@@ -14561,7 +14853,7 @@ function Chat({
|
|
|
14561
14853
|
attachToComposer: true
|
|
14562
14854
|
}
|
|
14563
14855
|
),
|
|
14564
|
-
/* @__PURE__ */
|
|
14856
|
+
/* @__PURE__ */ jsx50(
|
|
14565
14857
|
HITLApprovalPanel,
|
|
14566
14858
|
{
|
|
14567
14859
|
request: stream.pendingHITLRequest,
|
|
@@ -14570,7 +14862,7 @@ function Chat({
|
|
|
14570
14862
|
attachToComposer: true
|
|
14571
14863
|
}
|
|
14572
14864
|
),
|
|
14573
|
-
runtimeCapabilityPalette && /* @__PURE__ */
|
|
14865
|
+
runtimeCapabilityPalette && /* @__PURE__ */ jsx50(
|
|
14574
14866
|
SlashPalette,
|
|
14575
14867
|
{
|
|
14576
14868
|
palette: runtimeCapabilityPalette,
|
|
@@ -14584,7 +14876,7 @@ function Chat({
|
|
|
14584
14876
|
onSelect: selectSlashPaletteOption
|
|
14585
14877
|
}
|
|
14586
14878
|
),
|
|
14587
|
-
/* @__PURE__ */
|
|
14879
|
+
/* @__PURE__ */ jsx50("form", { className: "flex items-end", onSubmit: handleSubmit, children: /* @__PURE__ */ jsxs33(
|
|
14588
14880
|
"div",
|
|
14589
14881
|
{
|
|
14590
14882
|
"data-slot": "composer-input-shell",
|
|
@@ -14598,7 +14890,7 @@ function Chat({
|
|
|
14598
14890
|
composerInputRoundedClass
|
|
14599
14891
|
),
|
|
14600
14892
|
children: [
|
|
14601
|
-
/* @__PURE__ */
|
|
14893
|
+
/* @__PURE__ */ jsx50(
|
|
14602
14894
|
"div",
|
|
14603
14895
|
{
|
|
14604
14896
|
ref: composerInputRef,
|
|
@@ -14620,7 +14912,7 @@ function Chat({
|
|
|
14620
14912
|
(missingConfig || isHistoryLoading || hasPendingInteractiveRequest) && "cursor-not-allowed opacity-50"
|
|
14621
14913
|
),
|
|
14622
14914
|
children: renderedComposerParts.map(
|
|
14623
|
-
(part, index) => part.type === "text" ? /* @__PURE__ */
|
|
14915
|
+
(part, index) => part.type === "text" ? /* @__PURE__ */ jsx50(React45.Fragment, { children: part.text }, `text-${index}`) : /* @__PURE__ */ jsxs33(
|
|
14624
14916
|
"span",
|
|
14625
14917
|
{
|
|
14626
14918
|
"data-composer-capability-key": part.key,
|
|
@@ -14629,14 +14921,14 @@ function Chat({
|
|
|
14629
14921
|
contentEditable: false,
|
|
14630
14922
|
className: "mx-0.5 inline-flex max-w-[14rem] select-none items-center gap-1 text-sm font-semibold text-primary align-baseline",
|
|
14631
14923
|
children: [
|
|
14632
|
-
/* @__PURE__ */
|
|
14924
|
+
/* @__PURE__ */ jsx50(
|
|
14633
14925
|
RuntimeCapabilityIcon,
|
|
14634
14926
|
{
|
|
14635
14927
|
option: part.capability,
|
|
14636
14928
|
variant: "chip"
|
|
14637
14929
|
}
|
|
14638
14930
|
),
|
|
14639
|
-
/* @__PURE__ */
|
|
14931
|
+
/* @__PURE__ */ jsx50("span", { className: "truncate", children: part.capability.label })
|
|
14640
14932
|
]
|
|
14641
14933
|
},
|
|
14642
14934
|
part.key
|
|
@@ -14645,14 +14937,14 @@ function Chat({
|
|
|
14645
14937
|
},
|
|
14646
14938
|
composerDomVersion
|
|
14647
14939
|
),
|
|
14648
|
-
/* @__PURE__ */
|
|
14940
|
+
/* @__PURE__ */ jsxs33(
|
|
14649
14941
|
"div",
|
|
14650
14942
|
{
|
|
14651
14943
|
"data-slot": "composer-action-bar",
|
|
14652
14944
|
className: "pointer-events-none absolute inset-x-1.5 bottom-1 flex min-h-10 items-center justify-between gap-2",
|
|
14653
14945
|
children: [
|
|
14654
|
-
/* @__PURE__ */
|
|
14655
|
-
/* @__PURE__ */
|
|
14946
|
+
/* @__PURE__ */ jsxs33("div", { className: "pointer-events-none flex min-w-0 flex-1 items-center gap-1.5", children: [
|
|
14947
|
+
/* @__PURE__ */ jsx50("div", { className: "pointer-events-auto flex shrink-0 items-center gap-1.5", children: /* @__PURE__ */ jsx50(
|
|
14656
14948
|
ComposerMenu,
|
|
14657
14949
|
{
|
|
14658
14950
|
composer,
|
|
@@ -14667,20 +14959,20 @@ function Chat({
|
|
|
14667
14959
|
disabled: missingConfig || isHistoryLoading || hasPendingInteractiveRequest
|
|
14668
14960
|
}
|
|
14669
14961
|
) }),
|
|
14670
|
-
selectedTool && /* @__PURE__ */
|
|
14671
|
-
/* @__PURE__ */
|
|
14672
|
-
/* @__PURE__ */
|
|
14962
|
+
selectedTool && /* @__PURE__ */ jsxs33("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: [
|
|
14963
|
+
/* @__PURE__ */ jsx50("span", { className: "truncate", children: selectedTool.shortLabel ?? selectedTool.label }),
|
|
14964
|
+
/* @__PURE__ */ jsx50(
|
|
14673
14965
|
"button",
|
|
14674
14966
|
{
|
|
14675
14967
|
type: "button",
|
|
14676
14968
|
onClick: () => setSelectedTool(null),
|
|
14677
14969
|
className: "shrink-0 rounded-full p-0.5 text-primary/70 hover:bg-primary/10 hover:text-primary",
|
|
14678
|
-
children: /* @__PURE__ */
|
|
14970
|
+
children: /* @__PURE__ */ jsx50(X5, { size: 12 })
|
|
14679
14971
|
}
|
|
14680
14972
|
)
|
|
14681
14973
|
] })
|
|
14682
14974
|
] }),
|
|
14683
|
-
/* @__PURE__ */
|
|
14975
|
+
/* @__PURE__ */ jsx50("div", { className: "pointer-events-auto shrink-0", children: /* @__PURE__ */ jsx50(
|
|
14684
14976
|
SendButton,
|
|
14685
14977
|
{
|
|
14686
14978
|
disabled: isSendDisabled,
|
|
@@ -14707,7 +14999,7 @@ function Chat({
|
|
|
14707
14999
|
]
|
|
14708
15000
|
}
|
|
14709
15001
|
) }),
|
|
14710
|
-
disclaimer?.text && /* @__PURE__ */
|
|
15002
|
+
disclaimer?.text && /* @__PURE__ */ jsx50(
|
|
14711
15003
|
"p",
|
|
14712
15004
|
{
|
|
14713
15005
|
className: cn(
|
|
@@ -14717,12 +15009,12 @@ function Chat({
|
|
|
14717
15009
|
children: disclaimer.text
|
|
14718
15010
|
}
|
|
14719
15011
|
),
|
|
14720
|
-
/* @__PURE__ */
|
|
14721
|
-
/* @__PURE__ */
|
|
14722
|
-
/* @__PURE__ */
|
|
15012
|
+
/* @__PURE__ */ jsxs33("div", { className: "mt-2 flex items-center justify-center gap-2 text-xs text-muted-foreground", children: [
|
|
15013
|
+
/* @__PURE__ */ jsx50("span", { children: t("chat.poweredBy") }),
|
|
15014
|
+
/* @__PURE__ */ jsx50(ContextUsageIndicator, { className: "absolute right-4" })
|
|
14723
15015
|
] })
|
|
14724
15016
|
] }),
|
|
14725
|
-
/* @__PURE__ */
|
|
15017
|
+
/* @__PURE__ */ jsx50(
|
|
14726
15018
|
SettingsSheet,
|
|
14727
15019
|
{
|
|
14728
15020
|
open: petSettingsOpen,
|
|
@@ -14732,17 +15024,17 @@ function Chat({
|
|
|
14732
15024
|
onSave: savePetLocalSettings
|
|
14733
15025
|
}
|
|
14734
15026
|
),
|
|
14735
|
-
/* @__PURE__ */
|
|
15027
|
+
/* @__PURE__ */ jsx50(PetBridge, { pet: effectivePet, state: petAutoState })
|
|
14736
15028
|
]
|
|
14737
15029
|
}
|
|
14738
15030
|
);
|
|
14739
15031
|
}
|
|
14740
15032
|
|
|
14741
15033
|
// src/components/ui/separator.tsx
|
|
14742
|
-
import * as
|
|
14743
|
-
import { jsx as
|
|
14744
|
-
var Separator =
|
|
14745
|
-
({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */
|
|
15034
|
+
import * as React46 from "react";
|
|
15035
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
15036
|
+
var Separator = React46.forwardRef(
|
|
15037
|
+
({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */ jsx51(
|
|
14746
15038
|
"div",
|
|
14747
15039
|
{
|
|
14748
15040
|
ref,
|