@xpert-ai/chatkit-ui 0.3.5 → 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-CAxobs9N.js → _baseUniq-DgbE-Zpp.js} +1 -1
- package/dist/app/assets/{abap-wdK8JaHa.js → abap-B0ywZp7w.js} +1 -1
- package/dist/app/assets/{abnf-B4QVrCDX.js → abnf-vKucRloH.js} +1 -1
- package/dist/app/assets/{actionscript-BbKSvJrq.js → actionscript-CvpjcrZC.js} +1 -1
- package/dist/app/assets/{ada-BkwiItKH.js → ada-DV5KTTo4.js} +1 -1
- package/dist/app/assets/{agda-BHGf_Fgl.js → agda-BTTYVnbo.js} +1 -1
- package/dist/app/assets/{al-CpdhQzD9.js → al-u-oZSiBm.js} +1 -1
- package/dist/app/assets/{antlr4-CLQ7xEno.js → antlr4-CY1PBdPM.js} +1 -1
- package/dist/app/assets/{apacheconf-6iBdrfFM.js → apacheconf-CIk6CfdC.js} +1 -1
- package/dist/app/assets/{apex-DBXBvaz5.js → apex-BdhgEWXC.js} +1 -1
- package/dist/app/assets/{apl-D8vc149P.js → apl-Mv4j7Tlu.js} +1 -1
- package/dist/app/assets/{applescript-BTZUYWS_.js → applescript-BnoQn48O.js} +1 -1
- package/dist/app/assets/{aql-BxB6KDJQ.js → aql-Do8Nhg8p.js} +1 -1
- package/dist/app/assets/{arc-CNi1G9DJ.js → arc-edZU_NW2.js} +1 -1
- package/dist/app/assets/{architectureDiagram-Q4EWVU46-BL0mPAR9.js → architectureDiagram-Q4EWVU46-Dtt89Y19.js} +1 -1
- package/dist/app/assets/{arduino-Cx04QCrp.js → arduino-C48-q0UX.js} +1 -1
- package/dist/app/assets/{arff-MqnrnEC8.js → arff-CvXAFvRm.js} +1 -1
- package/dist/app/assets/{asciidoc-sz7M5yXr.js → asciidoc-CA--68DS.js} +1 -1
- package/dist/app/assets/{asm6502-BZ8xfWko.js → asm6502-BcBLxpHN.js} +1 -1
- package/dist/app/assets/{asmatmel-D-cI_as7.js → asmatmel-CDMg3LIG.js} +1 -1
- package/dist/app/assets/{aspnet-wNdsZF1M.js → aspnet-BzZAtk5n.js} +1 -1
- package/dist/app/assets/{autohotkey-CERdGivs.js → autohotkey-C8WkQEjI.js} +1 -1
- package/dist/app/assets/{autoit-CQsoUza0.js → autoit-D5_mrv5m.js} +1 -1
- package/dist/app/assets/{avisynth-DMTk2nsi.js → avisynth-Dh_xask5.js} +1 -1
- package/dist/app/assets/{avro-idl-VdXZfwVL.js → avro-idl-AEaYO6yK.js} +1 -1
- package/dist/app/assets/{bash-BKoQnhB6.js → bash-RlP16Xm5.js} +1 -1
- package/dist/app/assets/{basic-BvRsQ9vo.js → basic-Xn_eY79M.js} +1 -1
- package/dist/app/assets/{batch-DkZb4POU.js → batch-B_zss_9m.js} +1 -1
- package/dist/app/assets/{bbcode-BkkYngk6.js → bbcode-D5qIIsoM.js} +1 -1
- package/dist/app/assets/{bicep-DY62eX6n.js → bicep-DFAY7lin.js} +1 -1
- package/dist/app/assets/{birb-Cf3Wn8DP.js → birb-DZZhpbmW.js} +1 -1
- package/dist/app/assets/{bison-CMVsgR8E.js → bison-B-dGF85b.js} +1 -1
- package/dist/app/assets/{blockDiagram-DXYQGD6D-DdgOXTCq.js → blockDiagram-DXYQGD6D-oXU3wiI6.js} +1 -1
- package/dist/app/assets/{bnf-C53AC5ba.js → bnf-6CRAamZR.js} +1 -1
- package/dist/app/assets/{brainfuck-DBcYtGip.js → brainfuck-CexdbLJh.js} +1 -1
- package/dist/app/assets/{brightscript-uWYyj7Le.js → brightscript-CaxTO5da.js} +1 -1
- package/dist/app/assets/{bro-Bnqn5jLn.js → bro-BRI4lLX7.js} +1 -1
- package/dist/app/assets/{bsl-eeHcx6I3.js → bsl-QOrG17u7.js} +1 -1
- package/dist/app/assets/{c-Y_E2ZZ8h.js → c-D3L-REE8.js} +1 -1
- package/dist/app/assets/{c4Diagram-AHTNJAMY-BAZeiIaA.js → c4Diagram-AHTNJAMY-zIBgyFbC.js} +1 -1
- package/dist/app/assets/{cfscript-swSriW5q.js → cfscript-CgDikVyK.js} +1 -1
- package/dist/app/assets/{chaiscript-BHR5pIfl.js → chaiscript-BPTekNbB.js} +1 -1
- package/dist/app/assets/channel-DJrI2Cpl.js +1 -0
- package/dist/app/assets/{chunk-4BX2VUAB-Deyo77pg.js → chunk-4BX2VUAB-C8q0nzRo.js} +1 -1
- package/dist/app/assets/{chunk-4TB4RGXK-BSgPz1Fn.js → chunk-4TB4RGXK-C8eclN6u.js} +1 -1
- package/dist/app/assets/{chunk-55IACEB6-DekOqO8-.js → chunk-55IACEB6-CC_AZKq2.js} +1 -1
- package/dist/app/assets/{chunk-EDXVE4YY-VI2aoR3H.js → chunk-EDXVE4YY-BKhbC1sp.js} +1 -1
- package/dist/app/assets/{chunk-FMBD7UC4-DVPMFZIh.js → chunk-FMBD7UC4-BuH_t_j-.js} +1 -1
- package/dist/app/assets/{chunk-OYMX7WX6-C_5OySCp.js → chunk-OYMX7WX6-DRM_T71-.js} +1 -1
- package/dist/app/assets/{chunk-QZHKN3VN-CQ4PJ94U.js → chunk-QZHKN3VN-BiziHb7K.js} +1 -1
- package/dist/app/assets/{chunk-YZCP3GAM-40VMFur6.js → chunk-YZCP3GAM-ns5Vk1f0.js} +1 -1
- package/dist/app/assets/{cil-BlB-Qnhz.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-cGW_OpAz.js → clike-Bk_7iChK.js} +1 -1
- package/dist/app/assets/{clojure-BwM8_y2w.js → clojure-oh6_RnlA.js} +1 -1
- package/dist/app/assets/clone-DypLoQyD.js +1 -0
- package/dist/app/assets/{cmake-B_tPIs0N.js → cmake-ySS0jC1Y.js} +1 -1
- package/dist/app/assets/{cobol-awMTn3SL.js → cobol-iXcezfTy.js} +1 -1
- package/dist/app/assets/{coffeescript-BdPUATdq.js → coffeescript-BUy0IOTJ.js} +1 -1
- package/dist/app/assets/{concurnas-DD4NroNG.js → concurnas-By_kYzwm.js} +1 -1
- package/dist/app/assets/{coq-WP9t6Mya.js → coq-DZiJnQYk.js} +1 -1
- package/dist/app/assets/{core-Dl1d1z_B.js → core-BjYqaHIK.js} +1 -1
- package/dist/app/assets/{cose-bilkent-S5V4N54A-CIsQWWLS.js → cose-bilkent-S5V4N54A-DRg86qAz.js} +1 -1
- package/dist/app/assets/{cpp-DRq2558J.js → cpp-fVJetTCh.js} +1 -1
- package/dist/app/assets/{crystal-CmMEvlYk.js → crystal-Dqa1FSjq.js} +1 -1
- package/dist/app/assets/{csharp-CmdWJQ_7.js → csharp-BEpd8Bfz.js} +1 -1
- package/dist/app/assets/{cshtml-D-PG0yKy.js → cshtml-cleS7x9a.js} +1 -1
- package/dist/app/assets/{csp-CoYEQK4_.js → csp-DJNuAuVo.js} +1 -1
- package/dist/app/assets/{css-extras-CvcfPwL5.js → css-extras-DqcDnxi2.js} +1 -1
- package/dist/app/assets/{css-qzCJaYzE.js → css-laKMA7ps.js} +1 -1
- package/dist/app/assets/{csv-BOSHHM-P.js → csv-CcsGtqB7.js} +1 -1
- package/dist/app/assets/{cypher-DF-LRYf2.js → cypher-tCYaF_sw.js} +1 -1
- package/dist/app/assets/{d-DT7HGItG.js → d-ZjP-D4jP.js} +1 -1
- package/dist/app/assets/{dagre-KV5264BT-BXDHR3FY.js → dagre-KV5264BT-BMg6cnfG.js} +1 -1
- package/dist/app/assets/{dart-C53tv9tc.js → dart-aEIC0xv8.js} +1 -1
- package/dist/app/assets/{dataweave-DfVl-B8U.js → dataweave-CM7DNyRc.js} +1 -1
- package/dist/app/assets/{dax-CtLDIvLu.js → dax-D-1tRMAS.js} +1 -1
- package/dist/app/assets/{dhall-B4vfpjKK.js → dhall-B4G6sh_3.js} +1 -1
- package/dist/app/assets/{diagram-5BDNPKRD-C2jQZSnh.js → diagram-5BDNPKRD-BGIhlwaI.js} +1 -1
- package/dist/app/assets/{diagram-G4DWMVQ6-DkBF8pst.js → diagram-G4DWMVQ6-CqKLelet.js} +1 -1
- package/dist/app/assets/{diagram-MMDJMWI5-DkBy1EJI.js → diagram-MMDJMWI5-2IpGHxI2.js} +1 -1
- package/dist/app/assets/{diagram-TYMM5635-BG7IFHFj.js → diagram-TYMM5635-_HRiSNgh.js} +1 -1
- package/dist/app/assets/{diff-CAGXr455.js → diff-CAWzHumm.js} +1 -1
- package/dist/app/assets/{django-Bt-Xandi.js → django-BLlxHysq.js} +1 -1
- package/dist/app/assets/{dns-zone-file-CUQqHN_u.js → dns-zone-file-Bu1BFi4x.js} +1 -1
- package/dist/app/assets/{docker-Cmx-jfGB.js → docker-DQtdSM6w.js} +1 -1
- package/dist/app/assets/{dot-CtNw9lX4.js → dot-M_8dtQ-J.js} +1 -1
- package/dist/app/assets/{ebnf-Dl_Q5Or1.js → ebnf-Bqjz4X_l.js} +1 -1
- package/dist/app/assets/{editorconfig-DZYXnV_C.js → editorconfig-H1gZsYaD.js} +1 -1
- package/dist/app/assets/{eiffel-CgccC4xz.js → eiffel-jToyfE3K.js} +1 -1
- package/dist/app/assets/{ejs-Cj1dQzfI.js → ejs-Xg8x_yq-.js} +1 -1
- package/dist/app/assets/{elixir-B3SWPivz.js → elixir-BG9SfjVk.js} +1 -1
- package/dist/app/assets/{elm-Bp_TQfaA.js → elm-7rvkjNwn.js} +1 -1
- package/dist/app/assets/{erDiagram-SMLLAGMA-Cby23XmU.js → erDiagram-SMLLAGMA-CwJ0JEfE.js} +1 -1
- package/dist/app/assets/{erb-Cb-K6pZE.js → erb-CipiWC9j.js} +1 -1
- package/dist/app/assets/{erlang-F72Fjwv2.js → erlang-DyGWgpYG.js} +1 -1
- package/dist/app/assets/{etlua-DFUJG9GZ.js → etlua-Ct6VkCC4.js} +1 -1
- package/dist/app/assets/{excel-formula-B8hn4WlO.js → excel-formula-CY9oxCkI.js} +1 -1
- package/dist/app/assets/{factor-BlEqbeI0.js → factor-DBGcEQMr.js} +1 -1
- package/dist/app/assets/{false-DMURsqlU.js → false-D7Yj-SPJ.js} +1 -1
- package/dist/app/assets/{firestore-security-rules-DswDVNNa.js → firestore-security-rules-BKeRzWep.js} +1 -1
- package/dist/app/assets/{flow-C4reo-gu.js → flow-BUWiIzEU.js} +1 -1
- package/dist/app/assets/{flowDiagram-DWJPFMVM-BxNNsar9.js → flowDiagram-DWJPFMVM-C3YhD-oq.js} +1 -1
- package/dist/app/assets/{fortran-BAmD5KHF.js → fortran-Bj52YXe0.js} +1 -1
- package/dist/app/assets/{fsharp-CPq2O12L.js → fsharp-DmCVgmnH.js} +1 -1
- package/dist/app/assets/{ftl-Cgbeq2-z.js → ftl-Cbmvxbh6.js} +1 -1
- package/dist/app/assets/{ganttDiagram-T4ZO3ILL-BLd3DH-5.js → ganttDiagram-T4ZO3ILL-D9xW5yhh.js} +1 -1
- package/dist/app/assets/{gap-Bge3tvcZ.js → gap-D23ZRtRz.js} +1 -1
- package/dist/app/assets/{gcode-CAVcsFdN.js → gcode-D5-N3nr_.js} +1 -1
- package/dist/app/assets/{gdscript-nkDP0xMM.js → gdscript-DWERnX-a.js} +1 -1
- package/dist/app/assets/{gedcom-BA8GnDnW.js → gedcom-Ck_Ym3Q2.js} +1 -1
- package/dist/app/assets/{gherkin-DvBWzm8E.js → gherkin-BksiIjs-.js} +1 -1
- package/dist/app/assets/{git-LJ9ums7L.js → git-CO1eb-gL.js} +1 -1
- package/dist/app/assets/{gitGraphDiagram-UUTBAWPF-JZEE6gBT.js → gitGraphDiagram-UUTBAWPF-DZLT8zDA.js} +1 -1
- package/dist/app/assets/{glsl-D4U4_9LH.js → glsl-CN-vqwC_.js} +1 -1
- package/dist/app/assets/{gml-CQtoiCZT.js → gml-J5W8Y4yz.js} +1 -1
- package/dist/app/assets/{gn-DxTb0Jqi.js → gn-D7Pv9idR.js} +1 -1
- package/dist/app/assets/{go-D7ELL60F.js → go-6Lw_nSyb.js} +1 -1
- package/dist/app/assets/{go-module-Ck8j-Kcm.js → go-module-BCe-jjCg.js} +1 -1
- package/dist/app/assets/{graph-pBSG-4mT.js → graph-BhsGz6M4.js} +1 -1
- package/dist/app/assets/{graphql-C-10AxQD.js → graphql-4_hbbnNw.js} +1 -1
- package/dist/app/assets/{groovy-SpWCEWzX.js → groovy-BZvyCoNS.js} +1 -1
- package/dist/app/assets/{haml-C2aM6_El.js → haml-MpET2CYX.js} +1 -1
- package/dist/app/assets/{handlebars-ChMYyLZl.js → handlebars-CMygNMyQ.js} +1 -1
- package/dist/app/assets/{haskell-DagwvSeE.js → haskell-H9hWCrb6.js} +1 -1
- package/dist/app/assets/{haxe-BG5B6d9K.js → haxe-DynXLs0c.js} +1 -1
- package/dist/app/assets/{hcl-B8Gd__02.js → hcl-DU8hXUXo.js} +1 -1
- package/dist/app/assets/{hlsl-CSu8CgjO.js → hlsl-BGurDJ01.js} +1 -1
- package/dist/app/assets/{hoon-BUjyY25K.js → hoon-Od_h6WWn.js} +1 -1
- package/dist/app/assets/{hpkp-C5yMlUDS.js → hpkp-CnNmkfHz.js} +1 -1
- package/dist/app/assets/{hsts-DzNiiTKI.js → hsts-DJA5z9FY.js} +1 -1
- package/dist/app/assets/{http-DYWI6rav.js → http-C2OpZukU.js} +1 -1
- package/dist/app/assets/{ichigojam-DrBDAbYO.js → ichigojam-CrG2EGSI.js} +1 -1
- package/dist/app/assets/{icon-BezsFCDL.js → icon-cOzaCn0m.js} +1 -1
- package/dist/app/assets/{icu-message-format-BCSOltos.js → icu-message-format-DDXTMDH-.js} +1 -1
- package/dist/app/assets/{idris-B8Tj6LSh.js → idris-CFY7Fru9.js} +1 -1
- package/dist/app/assets/{iecst-CfA7HSP8.js → iecst-DxqDXmAZ.js} +1 -1
- package/dist/app/assets/{ignore-E_v5CiMN.js → ignore-50gVavjI.js} +1 -1
- package/dist/app/assets/{index-CAv2vOlh.js → index-3vHiuCMV.js} +171 -171
- package/dist/app/assets/index-CY_xTM-7.css +1 -0
- package/dist/app/assets/{infoDiagram-42DDH7IO-eZsn31yB.js → infoDiagram-42DDH7IO-BhZutCsZ.js} +1 -1
- package/dist/app/assets/{inform7-Dj75C-lM.js → inform7-CwMWEErA.js} +1 -1
- package/dist/app/assets/{ini-DnYgp5_G.js → ini-Cj0QsVUh.js} +1 -1
- package/dist/app/assets/{io-D59cMlU5.js → io-CaTOfNpm.js} +1 -1
- package/dist/app/assets/{ishikawaDiagram-UXIWVN3A-Cb8G56a8.js → ishikawaDiagram-UXIWVN3A-JJt8O0hb.js} +1 -1
- package/dist/app/assets/{j-CuOplqKY.js → j-B9yG1_XZ.js} +1 -1
- package/dist/app/assets/{java-DiKpa4Y3.js → java-CcqZsJHc.js} +1 -1
- package/dist/app/assets/{javadoc-DshvkFVS.js → javadoc-BdkFH1qi.js} +1 -1
- package/dist/app/assets/{javadoclike-Dl0yZMbR.js → javadoclike-BBDtbsNc.js} +1 -1
- package/dist/app/assets/{javascript-C3lRkH0T.js → javascript-0ZJ71oW2.js} +1 -1
- package/dist/app/assets/{javastacktrace-BAZDNyis.js → javastacktrace-yNjh86GL.js} +1 -1
- package/dist/app/assets/{jexl-BvqPLTYh.js → jexl-BwLpMn8D.js} +1 -1
- package/dist/app/assets/{jolie-DXjsE0XX.js → jolie-BiDUXy8i.js} +1 -1
- package/dist/app/assets/{journeyDiagram-VCZTEJTY-9aLWSRay.js → journeyDiagram-VCZTEJTY-BkVWz3Vf.js} +1 -1
- package/dist/app/assets/{jq-CLFx4HBH.js → jq-CCJ3EBtV.js} +1 -1
- package/dist/app/assets/{js-extras-D33J2WNl.js → js-extras-Ck7OEXSL.js} +1 -1
- package/dist/app/assets/{js-templates-DlMN6fgo.js → js-templates-DjSt7lxm.js} +1 -1
- package/dist/app/assets/{jsdoc-CGVgLZ2j.js → jsdoc-BcTgtGoR.js} +1 -1
- package/dist/app/assets/{json-BTnVvJgU.js → json-tB4iX3yE.js} +1 -1
- package/dist/app/assets/{json5-BW8yCajk.js → json5-JIq4apAt.js} +1 -1
- package/dist/app/assets/{jsonp-iQTQx19C.js → jsonp-DKXtWLpG.js} +1 -1
- package/dist/app/assets/{jsstacktrace-DXxcFNfy.js → jsstacktrace-4bYPPqLT.js} +1 -1
- package/dist/app/assets/{jsx-D1npDekI.js → jsx-BgQQp2PC.js} +1 -1
- package/dist/app/assets/{julia-E711iN6A.js → julia-Dv7hfdzo.js} +1 -1
- package/dist/app/assets/{kanban-definition-6JOO6SKY-COnahS5T.js → kanban-definition-6JOO6SKY-CWuWLs3K.js} +1 -1
- package/dist/app/assets/{keepalived-Da5-tKqr.js → keepalived-C0mYwr0z.js} +1 -1
- package/dist/app/assets/{keyman-CR_is7Lf.js → keyman-BKpH4p1R.js} +1 -1
- package/dist/app/assets/{kotlin-6F8UihuI.js → kotlin-mOfhxbOx.js} +1 -1
- package/dist/app/assets/{kumir-BGVXhhZU.js → kumir-C6zx-0Ca.js} +1 -1
- package/dist/app/assets/{kusto-xzJ5QDBT.js → kusto-hO54CA70.js} +1 -1
- package/dist/app/assets/{latex-jsq1GqdL.js → latex-Dzk8WiHu.js} +1 -1
- package/dist/app/assets/{latte-CqObxNvY.js → latte-b3QfOSp4.js} +1 -1
- package/dist/app/assets/{layout-Od8azvI5.js → layout-DBe88OgK.js} +1 -1
- package/dist/app/assets/{less-vdQIwlhr.js → less-B4kl6C6H.js} +1 -1
- package/dist/app/assets/{lilypond-CYhZp9Do.js → lilypond-kwN07IjR.js} +1 -1
- package/dist/app/assets/{linear-BVmuh868.js → linear-DFqpmono.js} +1 -1
- package/dist/app/assets/{liquid-CF_8y_W1.js → liquid-CMRtVaic.js} +1 -1
- package/dist/app/assets/{lisp-DqmYhGox.js → lisp-D12Kpj2D.js} +1 -1
- package/dist/app/assets/{livescript-DEuoDOv7.js → livescript-CB8ITmGz.js} +1 -1
- package/dist/app/assets/{llvm-DlajzOZN.js → llvm-DBTCiFwL.js} +1 -1
- package/dist/app/assets/{log-CU2WH4Lm.js → log-BR6SSFh9.js} +1 -1
- package/dist/app/assets/{lolcode-CDbraZlO.js → lolcode-BuzAaCM6.js} +1 -1
- package/dist/app/assets/{lua-C7PRrDvP.js → lua-Ci_ub2Kx.js} +1 -1
- package/dist/app/assets/{magma-CEu2U_uQ.js → magma-DqKac23z.js} +1 -1
- package/dist/app/assets/{makefile-BpvnX-Nx.js → makefile-ClFyCfh0.js} +1 -1
- package/dist/app/assets/{markdown-BTkzQyNu.js → markdown-CJP4BvY0.js} +1 -1
- package/dist/app/assets/{markup-Dje0J_2C.js → markup-BqBuEoCj.js} +1 -1
- package/dist/app/assets/{markup-templating-cYyMwZ4b.js → markup-templating-gWox0fgS.js} +1 -1
- package/dist/app/assets/{matlab-RV1EEhcL.js → matlab-D8fITaV4.js} +1 -1
- package/dist/app/assets/{maxscript-Bo7lyT0p.js → maxscript-BONF8rMy.js} +1 -1
- package/dist/app/assets/{mel-kP-zTDHf.js → mel-C055oCEm.js} +1 -1
- package/dist/app/assets/{mermaid-D1yX-Bwv.js → mermaid-CJgXcURP.js} +1 -1
- package/dist/app/assets/{min-z4SxYbt2.js → min-C4k7eVH-.js} +1 -1
- package/dist/app/assets/{mindmap-definition-QFDTVHPH-Dm1nn9t1.js → mindmap-definition-QFDTVHPH-D5WLdtFz.js} +1 -1
- package/dist/app/assets/{mizar-DD-lNTs3.js → mizar-DfBcXuj4.js} +1 -1
- package/dist/app/assets/{mongodb-By_x69ne.js → mongodb-BBCH2cAI.js} +1 -1
- package/dist/app/assets/{monkey-CQneMnOq.js → monkey-5xytVR9c.js} +1 -1
- package/dist/app/assets/{moonscript-Cv1IiKWR.js → moonscript-DTD_dUoG.js} +1 -1
- package/dist/app/assets/{n1ql-BZ-dWxn_.js → n1ql-CKMBpvrf.js} +1 -1
- package/dist/app/assets/{n4js-aHhU-EQW.js → n4js-BLOx_BAB.js} +1 -1
- package/dist/app/assets/{nand2tetris-hdl-Ct9NqibY.js → nand2tetris-hdl-B-nkUk0U.js} +1 -1
- package/dist/app/assets/{naniscript-jrYYiXE3.js → naniscript-DFNNmSZZ.js} +1 -1
- package/dist/app/assets/{nasm-CR4fygO0.js → nasm-Bp0N-krf.js} +1 -1
- package/dist/app/assets/{neon-Bn9xaC-T.js → neon-CdOV9D5g.js} +1 -1
- package/dist/app/assets/{nevod-DwwkUQZl.js → nevod-BKMLRWeT.js} +1 -1
- package/dist/app/assets/{nginx-CxzxW55o.js → nginx-C53g3llS.js} +1 -1
- package/dist/app/assets/{nim-_ziHrYai.js → nim--ucdlwkH.js} +1 -1
- package/dist/app/assets/{nix-CnfynVyh.js → nix-2nB75Hnm.js} +1 -1
- package/dist/app/assets/{nsis-CTa60cBQ.js → nsis-Cg1me2qV.js} +1 -1
- package/dist/app/assets/{objectivec-CxzV-EqQ.js → objectivec-HgsJzBVJ.js} +1 -1
- package/dist/app/assets/{ocaml-CXQfo6wC.js → ocaml-B_DzHMGS.js} +1 -1
- package/dist/app/assets/{opencl-CdW2Jum5.js → opencl-DBy2C90-.js} +1 -1
- package/dist/app/assets/{openqasm-99txnqqb.js → openqasm-kR3M1YBJ.js} +1 -1
- package/dist/app/assets/{oz-CIEq0aNc.js → oz-CsEQzF2k.js} +1 -1
- package/dist/app/assets/{parigp-D9vfJxo4.js → parigp-C2gYP3BM.js} +1 -1
- package/dist/app/assets/{parser-DndpAxSG.js → parser-D7agmsnU.js} +1 -1
- package/dist/app/assets/{pascal-RZKxz-_c.js → pascal-Dk8h_JiR.js} +1 -1
- package/dist/app/assets/{pascaligo-B7sniYrp.js → pascaligo-DXayKpW1.js} +1 -1
- package/dist/app/assets/{pcaxis-B5p4fAPz.js → pcaxis-BbHDn4xw.js} +1 -1
- package/dist/app/assets/{peoplecode-fCeRfJQ5.js → peoplecode-DgWHb3qM.js} +1 -1
- package/dist/app/assets/{perl-CYh0437K.js → perl-BCQmJW3u.js} +1 -1
- package/dist/app/assets/{php-rTdvXKxw.js → php-Z7u6UBSf.js} +1 -1
- package/dist/app/assets/{php-extras-DCzP567Q.js → php-extras-Bbf1PJiM.js} +1 -1
- package/dist/app/assets/{phpdoc-BLbjAEWJ.js → phpdoc-BUdOOavZ.js} +1 -1
- package/dist/app/assets/{pieDiagram-DEJITSTG-BuH3UT8S.js → pieDiagram-DEJITSTG-Bk_gHD7q.js} +1 -1
- package/dist/app/assets/{plsql-B9JKIw1T.js → plsql-KN64tq9c.js} +1 -1
- package/dist/app/assets/{powerquery-Beeqnhtp.js → powerquery-DL49etLI.js} +1 -1
- package/dist/app/assets/{powershell-DofDkeyl.js → powershell-jryB4gBu.js} +1 -1
- package/dist/app/assets/{processing-C-Nru_27.js → processing-D-nRflir.js} +1 -1
- package/dist/app/assets/{prolog-Blc4S8Hs.js → prolog-J9p2Dtp3.js} +1 -1
- package/dist/app/assets/{promql-BsC9xRrD.js → promql-Bt3PTIs-.js} +1 -1
- package/dist/app/assets/{properties-BNFVcgDb.js → properties-DOzUf5m_.js} +1 -1
- package/dist/app/assets/{protobuf-BlpX_T1K.js → protobuf-CulfNgOj.js} +1 -1
- package/dist/app/assets/{psl-D2Hoa7_4.js → psl-UT93PnFk.js} +1 -1
- package/dist/app/assets/{pug-DBlY2nRe.js → pug-Ckrp6b5P.js} +1 -1
- package/dist/app/assets/{puppet-BfKwQiWD.js → puppet-wUZgXx_p.js} +1 -1
- package/dist/app/assets/{pure-CgWRG2Cz.js → pure-CNGrkBhJ.js} +1 -1
- package/dist/app/assets/{purebasic-C4IB7b6g.js → purebasic-CwWLgK7e.js} +1 -1
- package/dist/app/assets/{purescript-DpbOv2_5.js → purescript-BRm-R-3v.js} +1 -1
- package/dist/app/assets/{q-Bhw7S_Ff.js → q-wRiaQZTW.js} +1 -1
- package/dist/app/assets/{qml-BCy5slwb.js → qml-hZdBAFTK.js} +1 -1
- package/dist/app/assets/{qore-C00kyzGf.js → qore-Cye0wnFE.js} +1 -1
- package/dist/app/assets/{qsharp-CN2CDpkI.js → qsharp-DufTxaMQ.js} +1 -1
- package/dist/app/assets/{quadrantDiagram-34T5L4WZ-DF36QwGT.js → quadrantDiagram-34T5L4WZ-BSbm0wBP.js} +1 -1
- package/dist/app/assets/{r-B_BK6AZu.js → r-JhyQLVqm.js} +1 -1
- package/dist/app/assets/{racket-ByLawBwM.js → racket-CcEcl1lQ.js} +1 -1
- package/dist/app/assets/{reason-BDBRcGMx.js → reason-WFsaqaXn.js} +1 -1
- package/dist/app/assets/{regex-ChgfKyvR.js → regex-Cj5qFUZM.js} +1 -1
- package/dist/app/assets/{rego-D_XvU-HX.js → rego-CfoDWHPw.js} +1 -1
- package/dist/app/assets/{renpy-5nIbfjm_.js → renpy-D3lRim5H.js} +1 -1
- package/dist/app/assets/{requirementDiagram-MS252O5E-DoM__lrz.js → requirementDiagram-MS252O5E-BNs2nP8U.js} +1 -1
- package/dist/app/assets/{rest-D0kyBqSB.js → rest-DktyegXU.js} +1 -1
- package/dist/app/assets/{rip-CYiR9G3s.js → rip-D0VY5apf.js} +1 -1
- package/dist/app/assets/{roboconf-NbRqT12s.js → roboconf-y6-jDOpj.js} +1 -1
- package/dist/app/assets/{robotframework-DVLdugea.js → robotframework-CC00uJgj.js} +1 -1
- package/dist/app/assets/{ruby-CXYqjyLr.js → ruby-dAbspD_k.js} +1 -1
- package/dist/app/assets/{rust-DtiosDKR.js → rust-7wWC8B4O.js} +1 -1
- package/dist/app/assets/{sankeyDiagram-XADWPNL6-DAGXEQXz.js → sankeyDiagram-XADWPNL6-CvpH_gH5.js} +1 -1
- package/dist/app/assets/{sas-CBuO0A4r.js → sas-BMwqJCyV.js} +1 -1
- package/dist/app/assets/{sass-DAOC_JY6.js → sass-Deo2TBca.js} +1 -1
- package/dist/app/assets/{scala-DrjxfsaL.js → scala-CDQ_Q6w1.js} +1 -1
- package/dist/app/assets/{scheme-Dqq_pAgd.js → scheme-Dnvc5SgS.js} +1 -1
- package/dist/app/assets/{scss-Cs8enbPf.js → scss-CQnjZBSP.js} +1 -1
- package/dist/app/assets/{sequenceDiagram-FGHM5R23-D_580_d2.js → sequenceDiagram-FGHM5R23-CbfExnPM.js} +1 -1
- package/dist/app/assets/{shell-session-jQLXH-IX.js → shell-session-CUzpt9u_.js} +1 -1
- package/dist/app/assets/{smali-BjlQ2Fb8.js → smali-gUIPUNS_.js} +1 -1
- package/dist/app/assets/{smalltalk-CvvaQ-vE.js → smalltalk-BWqWeTOj.js} +1 -1
- package/dist/app/assets/{smarty-CuW15FKs.js → smarty-D_6NQwpr.js} +1 -1
- package/dist/app/assets/{sml-C2rZNwaS.js → sml-C6fu3ORs.js} +1 -1
- package/dist/app/assets/{solidity-Bz0UCY5q.js → solidity-aHCvIORR.js} +1 -1
- package/dist/app/assets/{solution-file-DY6Szhc0.js → solution-file-rfXcmDEi.js} +1 -1
- package/dist/app/assets/{soy-DupXqVr6.js → soy-CYlWSpIs.js} +1 -1
- package/dist/app/assets/{sparql-CKXEGfsk.js → sparql-BAW721Ow.js} +1 -1
- package/dist/app/assets/{splunk-spl-ylrNAn0q.js → splunk-spl-BTzYVj8d.js} +1 -1
- package/dist/app/assets/{sqf-lJvrZCtE.js → sqf-UIbNftU1.js} +1 -1
- package/dist/app/assets/{sql-B7hLAkUR.js → sql-CgGxned9.js} +1 -1
- package/dist/app/assets/{squirrel-BH1Y674s.js → squirrel-CIcV4Ny-.js} +1 -1
- package/dist/app/assets/{stan-fR7Qg8Ut.js → stan-DgfUhApV.js} +1 -1
- package/dist/app/assets/{stateDiagram-FHFEXIEX-B8jUR8FD.js → stateDiagram-FHFEXIEX-D1iTvQX_.js} +1 -1
- package/dist/app/assets/stateDiagram-v2-QKLJ7IA2-BCtIcdWI.js +1 -0
- package/dist/app/assets/{stylus-s7kCNuJK.js → stylus-sv3Ey9M5.js} +1 -1
- package/dist/app/assets/{swift-CCtYkHCf.js → swift-DS573qiY.js} +1 -1
- package/dist/app/assets/{systemd-BCElHahC.js → systemd-CzDCvoIg.js} +1 -1
- package/dist/app/assets/{t4-cs-H1_QKrKm.js → t4-cs-D4nbx6z2.js} +1 -1
- package/dist/app/assets/{t4-templating-6bPJc-Uq.js → t4-templating-BMZwZyOE.js} +1 -1
- package/dist/app/assets/{t4-vb-DJucVBb5.js → t4-vb-DIeP4ybv.js} +1 -1
- package/dist/app/assets/{tap-B_SCHNXn.js → tap-De3Jnd4S.js} +1 -1
- package/dist/app/assets/{tcl-BNEpqSgM.js → tcl-BjCUiiee.js} +1 -1
- package/dist/app/assets/{textile-uWVZjI0f.js → textile-DZ3GKhqr.js} +1 -1
- package/dist/app/assets/{timeline-definition-GMOUNBTQ-pCO1IuTh.js → timeline-definition-GMOUNBTQ-DNIfYJfl.js} +1 -1
- package/dist/app/assets/{toml-IfqaxX6C.js → toml-On6uzvVe.js} +1 -1
- package/dist/app/assets/{tremor-CXc27b0y.js → tremor-BU60aKH_.js} +1 -1
- package/dist/app/assets/{tt2-CSiBMY4w.js → tt2-BuKbFZt_.js} +1 -1
- package/dist/app/assets/{turtle-BG1NGns7.js → turtle-DXMNKdPK.js} +1 -1
- package/dist/app/assets/{twig-BApA7lBN.js → twig-Bo_MbBRd.js} +1 -1
- package/dist/app/assets/{typescript-CRhq3lVo.js → typescript-CR7wxlXD.js} +1 -1
- package/dist/app/assets/{typoscript-CbCyspbX.js → typoscript-CMw0wwok.js} +1 -1
- package/dist/app/assets/{unrealscript-C0oIJrK_.js → unrealscript-B776bLew.js} +1 -1
- package/dist/app/assets/{uorazor-CCeC8ukV.js → uorazor-BYELARrG.js} +1 -1
- package/dist/app/assets/{uri-BbJq2oKI.js → uri-CRKYpN9S.js} +1 -1
- package/dist/app/assets/{v-DWbZTbl1.js → v-YJo6805g.js} +1 -1
- package/dist/app/assets/{vala-cNE5mkqv.js → vala-gsYpVkOH.js} +1 -1
- package/dist/app/assets/{vbnet-C4ps1ulT.js → vbnet-CmBlYcGa.js} +1 -1
- package/dist/app/assets/{velocity-BqiV4VvP.js → velocity-Q2c3XfQY.js} +1 -1
- package/dist/app/assets/{vennDiagram-DHZGUBPP-DsozMeQe.js → vennDiagram-DHZGUBPP-BadpBWfC.js} +1 -1
- package/dist/app/assets/{verilog-uM22GI8M.js → verilog-5WEqrogK.js} +1 -1
- package/dist/app/assets/{vhdl-CjipXQit.js → vhdl-Co2ZNHLl.js} +1 -1
- package/dist/app/assets/{vim-DAu-IiFJ.js → vim-BWHpRDI0.js} +1 -1
- package/dist/app/assets/{visual-basic-CdGIHeQV.js → visual-basic-DdcJ6qp_.js} +1 -1
- package/dist/app/assets/{wardley-RL74JXVD-oEncjGLp.js → wardley-RL74JXVD-nnCu88t4.js} +1 -1
- package/dist/app/assets/{wardleyDiagram-NUSXRM2D-DNMPqgtw.js → wardleyDiagram-NUSXRM2D-DLRxHCOy.js} +1 -1
- package/dist/app/assets/{warpscript-ijeKRGom.js → warpscript-DQTWfQQI.js} +1 -1
- package/dist/app/assets/{wasm-CyK5pI_Y.js → wasm-P74bjf6T.js} +1 -1
- package/dist/app/assets/{web-idl-3RbxQwXD.js → web-idl-BwlVUL20.js} +1 -1
- package/dist/app/assets/{wiki-Vqqp-2xX.js → wiki-3koXxGGM.js} +1 -1
- package/dist/app/assets/{wolfram-Bsi7joP0.js → wolfram-GHXEYNh8.js} +1 -1
- package/dist/app/assets/{wren-WQYmqFb4.js → wren-DDEdbB41.js} +1 -1
- package/dist/app/assets/{xeora-D38FYsRy.js → xeora-C5eIogh-.js} +1 -1
- package/dist/app/assets/{xml-doc-wUzx0i81.js → xml-doc-Dxj1u1SJ.js} +1 -1
- package/dist/app/assets/{xojo-CGKogxG9.js → xojo-CeTBKDSR.js} +1 -1
- package/dist/app/assets/{xquery-Dv5QvWSQ.js → xquery-C4vwM7F2.js} +1 -1
- package/dist/app/assets/{xychartDiagram-5P7HB3ND-BsbjEvIN.js → xychartDiagram-5P7HB3ND-8doH-fTN.js} +1 -1
- package/dist/app/assets/{yaml-BGAxdcfl.js → yaml-Clzy20XF.js} +1 -1
- package/dist/app/assets/{yang-DbR14Qhe.js → yang-BTHiGiHX.js} +1 -1
- package/dist/app/assets/{zig-BZnMCGLn.js → zig-BkXx74nT.js} +1 -1
- package/dist/app/index.html +2 -2
- package/dist/index.cjs +1217 -671
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1184 -637
- package/package.json +3 -3
- package/dist/app/assets/channel-C4IK_RZn.js +0 -1
- package/dist/app/assets/classDiagram-6PBFFD2Q-LicCc7Qv.js +0 -1
- package/dist/app/assets/classDiagram-v2-HSJHXN6E-LicCc7Qv.js +0 -1
- package/dist/app/assets/clone-BC1Apkgy.js +0 -1
- package/dist/app/assets/index-BojjVNpv.css +0 -1
- package/dist/app/assets/stateDiagram-v2-QKLJ7IA2-ByxORwfu.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",
|
|
@@ -1511,6 +1513,13 @@ var en_US_default = {
|
|
|
1511
1513
|
option: "Option",
|
|
1512
1514
|
other: "Other"
|
|
1513
1515
|
},
|
|
1516
|
+
knowledgeRetriever: {
|
|
1517
|
+
queryTitle: "Query",
|
|
1518
|
+
resultsTitle: "Retrieved results ({{count}})",
|
|
1519
|
+
rawDataTitle: "Raw data",
|
|
1520
|
+
noResults: "No knowledge results found",
|
|
1521
|
+
scoreLabel: "Score"
|
|
1522
|
+
},
|
|
1514
1523
|
agentRun: {
|
|
1515
1524
|
defaultTitle: "Sub-agent",
|
|
1516
1525
|
inputLabel: "Input",
|
|
@@ -1559,6 +1568,14 @@ var en_US_default = {
|
|
|
1559
1568
|
copy: "Copy",
|
|
1560
1569
|
copied: "Copied",
|
|
1561
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
|
+
},
|
|
1562
1579
|
categories: {
|
|
1563
1580
|
files: {
|
|
1564
1581
|
one: "{{count}} file",
|
|
@@ -1610,6 +1627,7 @@ var zh_CN_default = {
|
|
|
1610
1627
|
loadingThread: "\u6B63\u5728\u52A0\u8F7D\u7EBF\u7A0B...",
|
|
1611
1628
|
stop: "\u505C\u6B62",
|
|
1612
1629
|
send: "\u53D1\u9001\u6D88\u606F",
|
|
1630
|
+
minimizeToPet: "\u6700\u5C0F\u5316\u5230 Pet",
|
|
1613
1631
|
referencedContentOnly: "\u5DF2\u5F15\u7528\u5185\u5BB9",
|
|
1614
1632
|
youLabel: "\u4F60",
|
|
1615
1633
|
scrollToBottom: "\u56DE\u5230\u5E95\u90E8",
|
|
@@ -1836,6 +1854,13 @@ var zh_CN_default = {
|
|
|
1836
1854
|
option: "\u9009\u9879",
|
|
1837
1855
|
other: "\u5176\u4ED6"
|
|
1838
1856
|
},
|
|
1857
|
+
knowledgeRetriever: {
|
|
1858
|
+
queryTitle: "\u67E5\u8BE2",
|
|
1859
|
+
resultsTitle: "\u68C0\u7D22\u7ED3\u679C\uFF08{{count}}\uFF09",
|
|
1860
|
+
rawDataTitle: "\u539F\u59CB\u6570\u636E",
|
|
1861
|
+
noResults: "\u672A\u627E\u5230\u77E5\u8BC6\u7ED3\u679C",
|
|
1862
|
+
scoreLabel: "\u5206\u6570"
|
|
1863
|
+
},
|
|
1839
1864
|
agentRun: {
|
|
1840
1865
|
defaultTitle: "\u5B50\u667A\u80FD\u4F53",
|
|
1841
1866
|
inputLabel: "\u8F93\u5165",
|
|
@@ -1884,6 +1909,14 @@ var zh_CN_default = {
|
|
|
1884
1909
|
copy: "\u590D\u5236",
|
|
1885
1910
|
copied: "\u5DF2\u590D\u5236",
|
|
1886
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
|
+
},
|
|
1887
1920
|
categories: {
|
|
1888
1921
|
files: {
|
|
1889
1922
|
one: "{{count}} \u4E2A\u6587\u4EF6",
|
|
@@ -6806,7 +6839,7 @@ function useSlashCommands({
|
|
|
6806
6839
|
}
|
|
6807
6840
|
|
|
6808
6841
|
// src/components/thread/messages/ai.tsx
|
|
6809
|
-
import * as
|
|
6842
|
+
import * as React32 from "react";
|
|
6810
6843
|
import {
|
|
6811
6844
|
ChevronDown as ChevronDown4,
|
|
6812
6845
|
Clock3 as Clock32,
|
|
@@ -8584,8 +8617,305 @@ function AgentRunGroup({
|
|
|
8584
8617
|
] });
|
|
8585
8618
|
}
|
|
8586
8619
|
|
|
8587
|
-
// src/
|
|
8620
|
+
// src/i18n/localized-text.ts
|
|
8621
|
+
function resolveLocalizedText(value, language) {
|
|
8622
|
+
if (typeof value === "string") {
|
|
8623
|
+
const trimmed = value.trim();
|
|
8624
|
+
return trimmed || null;
|
|
8625
|
+
}
|
|
8626
|
+
if (!value || typeof value !== "object") return null;
|
|
8627
|
+
const localized = value;
|
|
8628
|
+
const normalizedLanguage = language.trim();
|
|
8629
|
+
const underscoredLanguage = normalizedLanguage.replace(/-/g, "_");
|
|
8630
|
+
const languagePrefix = normalizedLanguage.split("-")[0];
|
|
8631
|
+
const preferredKeys = normalizedLanguage.startsWith("zh") ? [
|
|
8632
|
+
normalizedLanguage,
|
|
8633
|
+
underscoredLanguage,
|
|
8634
|
+
"zh_Hans",
|
|
8635
|
+
"zh-Hans",
|
|
8636
|
+
"zh_CN",
|
|
8637
|
+
"zh-CN",
|
|
8638
|
+
"zh",
|
|
8639
|
+
"en_US",
|
|
8640
|
+
"en-US",
|
|
8641
|
+
"en"
|
|
8642
|
+
] : [
|
|
8643
|
+
normalizedLanguage,
|
|
8644
|
+
underscoredLanguage,
|
|
8645
|
+
"en_US",
|
|
8646
|
+
"en-US",
|
|
8647
|
+
"en",
|
|
8648
|
+
languagePrefix,
|
|
8649
|
+
"zh_Hans",
|
|
8650
|
+
"zh-Hans",
|
|
8651
|
+
"zh_CN",
|
|
8652
|
+
"zh-CN",
|
|
8653
|
+
"zh"
|
|
8654
|
+
];
|
|
8655
|
+
for (const key of preferredKeys) {
|
|
8656
|
+
const candidate = localized[key];
|
|
8657
|
+
if (typeof candidate === "string" && candidate.trim()) {
|
|
8658
|
+
return candidate.trim();
|
|
8659
|
+
}
|
|
8660
|
+
}
|
|
8661
|
+
for (const candidate of Object.values(localized)) {
|
|
8662
|
+
if (typeof candidate === "string" && candidate.trim()) {
|
|
8663
|
+
return candidate.trim();
|
|
8664
|
+
}
|
|
8665
|
+
}
|
|
8666
|
+
return null;
|
|
8667
|
+
}
|
|
8668
|
+
|
|
8669
|
+
// src/components/thread/messages/knowledge-retriever-component-renderer.tsx
|
|
8588
8670
|
import { jsx as jsx32, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
8671
|
+
var KNOWLEDGE_RETRIEVER_TITLE = "Knowledge Retriever";
|
|
8672
|
+
var KNOWLEDGE_METADATA_SKIP_KEYS = /* @__PURE__ */ new Set([
|
|
8673
|
+
"assets",
|
|
8674
|
+
"children",
|
|
8675
|
+
"loc",
|
|
8676
|
+
"relevanceScore",
|
|
8677
|
+
"score"
|
|
8678
|
+
]);
|
|
8679
|
+
var knowledgeRetrieverComponentRenderer = {
|
|
8680
|
+
id: "knowledge-retriever",
|
|
8681
|
+
presentation: "grouped-step",
|
|
8682
|
+
match: isKnowledgeRetrieverComponent,
|
|
8683
|
+
getTitle: () => KNOWLEDGE_RETRIEVER_TITLE,
|
|
8684
|
+
hasDetails: hasKnowledgeRetrieverDetails,
|
|
8685
|
+
renderDetails: KnowledgeRetrieverDetails
|
|
8686
|
+
};
|
|
8687
|
+
function normalizeToolToken(value) {
|
|
8688
|
+
if (typeof value !== "string") return null;
|
|
8689
|
+
const normalized = value.trim().toLowerCase().replace(/[\s-]+/g, "_");
|
|
8690
|
+
return normalized || null;
|
|
8691
|
+
}
|
|
8692
|
+
function isRecord2(value) {
|
|
8693
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
8694
|
+
}
|
|
8695
|
+
function readString(value) {
|
|
8696
|
+
if (typeof value !== "string") return void 0;
|
|
8697
|
+
const trimmed = value.trim();
|
|
8698
|
+
return trimmed || void 0;
|
|
8699
|
+
}
|
|
8700
|
+
function stringifyValue(value) {
|
|
8701
|
+
if (value === null || value === void 0) return void 0;
|
|
8702
|
+
if (typeof value === "string") return readString(value);
|
|
8703
|
+
if (typeof value === "number" || typeof value === "boolean") {
|
|
8704
|
+
return String(value);
|
|
8705
|
+
}
|
|
8706
|
+
try {
|
|
8707
|
+
const serialized = JSON.stringify(value);
|
|
8708
|
+
return serialized && serialized !== "{}" ? serialized : void 0;
|
|
8709
|
+
} catch {
|
|
8710
|
+
return String(value);
|
|
8711
|
+
}
|
|
8712
|
+
}
|
|
8713
|
+
function truncateMetadataValue(value) {
|
|
8714
|
+
return value.length > 90 ? `${value.slice(0, 87)}...` : value;
|
|
8715
|
+
}
|
|
8716
|
+
function formatScore(value) {
|
|
8717
|
+
if (typeof value === "number") {
|
|
8718
|
+
return Number.isFinite(value) ? value.toFixed(value < 1 ? 3 : 2) : void 0;
|
|
8719
|
+
}
|
|
8720
|
+
return readString(value);
|
|
8721
|
+
}
|
|
8722
|
+
function getLineRange(metadata) {
|
|
8723
|
+
const loc = metadata.loc;
|
|
8724
|
+
if (!isRecord2(loc)) return void 0;
|
|
8725
|
+
const lines = loc.lines;
|
|
8726
|
+
if (!isRecord2(lines)) return void 0;
|
|
8727
|
+
const from = stringifyValue(lines.from);
|
|
8728
|
+
const to = stringifyValue(lines.to);
|
|
8729
|
+
if (from && to) return `${from}-${to}`;
|
|
8730
|
+
return from ?? to;
|
|
8731
|
+
}
|
|
8732
|
+
function normalizeMetadataEntries(metadata) {
|
|
8733
|
+
return Object.entries(metadata).flatMap(([key, value]) => {
|
|
8734
|
+
if (KNOWLEDGE_METADATA_SKIP_KEYS.has(key)) return [];
|
|
8735
|
+
const formatted = stringifyValue(value);
|
|
8736
|
+
if (!formatted) return [];
|
|
8737
|
+
return [
|
|
8738
|
+
{
|
|
8739
|
+
key,
|
|
8740
|
+
value: truncateMetadataValue(formatted)
|
|
8741
|
+
}
|
|
8742
|
+
];
|
|
8743
|
+
});
|
|
8744
|
+
}
|
|
8745
|
+
function normalizeKnowledgeResult(value, fallbackTitle) {
|
|
8746
|
+
if (!isRecord2(value)) return null;
|
|
8747
|
+
const metadata = isRecord2(value.metadata) ? value.metadata : {};
|
|
8748
|
+
const document2 = isRecord2(value.document) ? value.document : {};
|
|
8749
|
+
const content = readString(value.pageContent);
|
|
8750
|
+
const title = readString(document2.name) ?? readString(metadata.originalFileName) ?? readString(metadata.source) ?? readString(value.id) ?? readString(metadata.chunkId) ?? fallbackTitle;
|
|
8751
|
+
if (!content && Object.keys(metadata).length === 0 && Object.keys(document2).length === 0) {
|
|
8752
|
+
return null;
|
|
8753
|
+
}
|
|
8754
|
+
return {
|
|
8755
|
+
id: readString(value.id) ?? readString(metadata.chunkId),
|
|
8756
|
+
title,
|
|
8757
|
+
url: readString(document2.fileUrl),
|
|
8758
|
+
content,
|
|
8759
|
+
lineRange: getLineRange(metadata),
|
|
8760
|
+
score: formatScore(
|
|
8761
|
+
metadata.relevanceScore ?? metadata.score ?? value.score
|
|
8762
|
+
),
|
|
8763
|
+
metadata: normalizeMetadataEntries(metadata)
|
|
8764
|
+
};
|
|
8765
|
+
}
|
|
8766
|
+
function getKnowledgeResults(data) {
|
|
8767
|
+
if (!Array.isArray(data.data)) return [];
|
|
8768
|
+
return data.data.flatMap((item, index) => {
|
|
8769
|
+
const result = normalizeKnowledgeResult(item, `Result ${index + 1}`);
|
|
8770
|
+
return result ? [result] : [];
|
|
8771
|
+
});
|
|
8772
|
+
}
|
|
8773
|
+
function getRawKnowledgeData(data) {
|
|
8774
|
+
return data.data ?? data.output ?? null;
|
|
8775
|
+
}
|
|
8776
|
+
function getRetrieverQuery(data, language) {
|
|
8777
|
+
const input = data.input;
|
|
8778
|
+
if (isRecord2(input)) {
|
|
8779
|
+
return readString(input.query) ?? readString(input.input) ?? readString(input.question);
|
|
8780
|
+
}
|
|
8781
|
+
return readString(resolveLocalizedText(data.message, language)) ?? readString(input);
|
|
8782
|
+
}
|
|
8783
|
+
function hasKnowledgeRetrieverDetails(_content, data) {
|
|
8784
|
+
return isKnowledgeRetrieverComponent(_content, data);
|
|
8785
|
+
}
|
|
8786
|
+
function isKnowledgeRetrieverComponent(_content, data) {
|
|
8787
|
+
return normalizeToolToken(data.type) === "knowledges";
|
|
8788
|
+
}
|
|
8789
|
+
function KnowledgeRawDataBlock({ value }) {
|
|
8790
|
+
const { t } = useChatkitTranslation();
|
|
8791
|
+
const detected = detectJsonValue(value);
|
|
8792
|
+
if (detected.kind === "text") {
|
|
8793
|
+
return /* @__PURE__ */ jsx32(PlainTextBlock, { value: detected.text });
|
|
8794
|
+
}
|
|
8795
|
+
return /* @__PURE__ */ jsxs20(Tabs, { defaultValue: "tree", className: "min-w-0", children: [
|
|
8796
|
+
/* @__PURE__ */ jsxs20("div", { className: "mb-2 flex min-w-0 items-center justify-between gap-2", children: [
|
|
8797
|
+
/* @__PURE__ */ jsxs20("span", { className: "min-w-0 truncate text-[11px] text-muted-foreground", children: [
|
|
8798
|
+
t("message.toolGroup.jsonTitle"),
|
|
8799
|
+
" \xB7",
|
|
8800
|
+
" ",
|
|
8801
|
+
getJsonValueSummary(detected.value)
|
|
8802
|
+
] }),
|
|
8803
|
+
/* @__PURE__ */ jsxs20(TabsList, { className: "rounded-md p-0.5", children: [
|
|
8804
|
+
/* @__PURE__ */ jsx32(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "tree", children: t("message.toolGroup.jsonTree") }),
|
|
8805
|
+
/* @__PURE__ */ jsx32(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "raw", children: t("message.toolGroup.jsonRaw") })
|
|
8806
|
+
] })
|
|
8807
|
+
] }),
|
|
8808
|
+
/* @__PURE__ */ jsx32(TabsContent, { value: "tree", className: "mt-0", children: /* @__PURE__ */ jsx32(JsonTreeView, { value: detected.value }) }),
|
|
8809
|
+
/* @__PURE__ */ jsx32(TabsContent, { value: "raw", className: "mt-0", children: /* @__PURE__ */ jsx32(RawJsonBlock, { raw: detected.raw }) })
|
|
8810
|
+
] });
|
|
8811
|
+
}
|
|
8812
|
+
function KnowledgeRetrieverDetails({
|
|
8813
|
+
data
|
|
8814
|
+
}) {
|
|
8815
|
+
const { i18n: i18n2, t } = useChatkitTranslation();
|
|
8816
|
+
const query = getRetrieverQuery(data, i18n2.language);
|
|
8817
|
+
const results = getKnowledgeResults(data);
|
|
8818
|
+
const rawData = getRawKnowledgeData(data);
|
|
8819
|
+
const hasArrayData = Array.isArray(data.data);
|
|
8820
|
+
const hasRawFallback = rawData !== null && rawData !== void 0 && (!hasArrayData || Array.isArray(data.data) && data.data.length > 0 && results.length === 0);
|
|
8821
|
+
const showEmptyState = results.length === 0 && !hasRawFallback && data.status !== "running";
|
|
8822
|
+
return /* @__PURE__ */ jsxs20("div", { className: "min-w-0 space-y-3 px-3 py-2", children: [
|
|
8823
|
+
query ? /* @__PURE__ */ jsxs20("div", { className: "min-w-0 space-y-1", children: [
|
|
8824
|
+
/* @__PURE__ */ jsx32("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.knowledgeRetriever.queryTitle") }),
|
|
8825
|
+
/* @__PURE__ */ jsx32("div", { className: "min-w-0 whitespace-pre-wrap wrap-break-word rounded-md bg-muted/40 px-3 py-2 font-mono text-[12px] leading-5 text-foreground/80", children: query })
|
|
8826
|
+
] }) : null,
|
|
8827
|
+
results.length > 0 ? /* @__PURE__ */ jsxs20("div", { className: "min-w-0 space-y-2", children: [
|
|
8828
|
+
/* @__PURE__ */ jsx32("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.knowledgeRetriever.resultsTitle", {
|
|
8829
|
+
count: results.length
|
|
8830
|
+
}) }),
|
|
8831
|
+
/* @__PURE__ */ jsx32("div", { className: "space-y-2", children: results.map((result, index) => /* @__PURE__ */ jsx32(
|
|
8832
|
+
KnowledgeResultCard,
|
|
8833
|
+
{
|
|
8834
|
+
result,
|
|
8835
|
+
index
|
|
8836
|
+
},
|
|
8837
|
+
result.id ?? `${result.title}-${index}`
|
|
8838
|
+
)) })
|
|
8839
|
+
] }) : null,
|
|
8840
|
+
hasRawFallback ? /* @__PURE__ */ jsxs20("div", { className: "min-w-0 space-y-1", children: [
|
|
8841
|
+
/* @__PURE__ */ jsx32("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.knowledgeRetriever.rawDataTitle") }),
|
|
8842
|
+
/* @__PURE__ */ jsx32(KnowledgeRawDataBlock, { value: rawData })
|
|
8843
|
+
] }) : null,
|
|
8844
|
+
showEmptyState ? /* @__PURE__ */ jsx32("div", { className: "rounded-md border border-dashed border-border/70 px-3 py-4 text-center text-xs text-muted-foreground", children: t("message.knowledgeRetriever.noResults") }) : null
|
|
8845
|
+
] });
|
|
8846
|
+
}
|
|
8847
|
+
function KnowledgeResultCard({
|
|
8848
|
+
result,
|
|
8849
|
+
index
|
|
8850
|
+
}) {
|
|
8851
|
+
const { t } = useChatkitTranslation();
|
|
8852
|
+
const titleId = `knowledge-result-${index + 1}`;
|
|
8853
|
+
const metadata = [
|
|
8854
|
+
...result.score ? [
|
|
8855
|
+
{
|
|
8856
|
+
key: t("message.knowledgeRetriever.scoreLabel"),
|
|
8857
|
+
value: result.score
|
|
8858
|
+
}
|
|
8859
|
+
] : [],
|
|
8860
|
+
...result.metadata
|
|
8861
|
+
];
|
|
8862
|
+
const titleClassName = "min-w-0 line-clamp-2 text-sm font-medium leading-5 text-foreground";
|
|
8863
|
+
return /* @__PURE__ */ jsx32("article", { className: "min-w-0 rounded-md border border-border/60 bg-background/80 px-3 py-2", children: /* @__PURE__ */ jsxs20("div", { className: "flex min-w-0 items-start gap-2", children: [
|
|
8864
|
+
/* @__PURE__ */ jsx32("span", { className: "mt-0.5 inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-muted text-[11px] font-medium text-muted-foreground", children: index + 1 }),
|
|
8865
|
+
/* @__PURE__ */ jsxs20("div", { className: "min-w-0 flex-1", children: [
|
|
8866
|
+
result.url ? /* @__PURE__ */ jsxs20(
|
|
8867
|
+
"a",
|
|
8868
|
+
{
|
|
8869
|
+
id: titleId,
|
|
8870
|
+
href: result.url,
|
|
8871
|
+
target: "_blank",
|
|
8872
|
+
rel: "noreferrer",
|
|
8873
|
+
className: cn(titleClassName, "hover:underline"),
|
|
8874
|
+
children: [
|
|
8875
|
+
result.title,
|
|
8876
|
+
result.lineRange ? /* @__PURE__ */ jsxs20("span", { className: "ml-1 text-muted-foreground", children: [
|
|
8877
|
+
"[",
|
|
8878
|
+
result.lineRange,
|
|
8879
|
+
"]"
|
|
8880
|
+
] }) : null
|
|
8881
|
+
]
|
|
8882
|
+
}
|
|
8883
|
+
) : /* @__PURE__ */ jsxs20("div", { id: titleId, className: titleClassName, children: [
|
|
8884
|
+
result.title,
|
|
8885
|
+
result.lineRange ? /* @__PURE__ */ jsxs20("span", { className: "ml-1 text-muted-foreground", children: [
|
|
8886
|
+
"[",
|
|
8887
|
+
result.lineRange,
|
|
8888
|
+
"]"
|
|
8889
|
+
] }) : null
|
|
8890
|
+
] }),
|
|
8891
|
+
result.content ? /* @__PURE__ */ jsx32("p", { className: "mt-1 line-clamp-3 whitespace-pre-wrap text-xs leading-5 text-muted-foreground", children: result.content }) : null,
|
|
8892
|
+
metadata.length > 0 ? /* @__PURE__ */ jsx32(
|
|
8893
|
+
"div",
|
|
8894
|
+
{
|
|
8895
|
+
className: "mt-2 flex flex-wrap gap-1.5",
|
|
8896
|
+
"aria-labelledby": titleId,
|
|
8897
|
+
children: metadata.slice(0, 10).map((item) => /* @__PURE__ */ jsxs20(
|
|
8898
|
+
"span",
|
|
8899
|
+
{
|
|
8900
|
+
className: "inline-flex min-w-0 max-w-full items-center gap-1 rounded-md bg-muted/50 px-1.5 py-0.5 text-[11px] leading-4 text-muted-foreground",
|
|
8901
|
+
children: [
|
|
8902
|
+
/* @__PURE__ */ jsxs20("span", { className: "shrink-0 font-medium text-foreground/70", children: [
|
|
8903
|
+
item.key,
|
|
8904
|
+
":"
|
|
8905
|
+
] }),
|
|
8906
|
+
/* @__PURE__ */ jsx32("span", { className: "min-w-0 truncate font-mono", children: item.value })
|
|
8907
|
+
]
|
|
8908
|
+
},
|
|
8909
|
+
`${item.key}:${item.value}`
|
|
8910
|
+
))
|
|
8911
|
+
}
|
|
8912
|
+
) : null
|
|
8913
|
+
] })
|
|
8914
|
+
] }) });
|
|
8915
|
+
}
|
|
8916
|
+
|
|
8917
|
+
// src/components/thread/messages/web-search-component-renderer.tsx
|
|
8918
|
+
import { jsx as jsx33, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
8589
8919
|
var webSearchComponentRenderer = {
|
|
8590
8920
|
id: "computer-web-search-sources",
|
|
8591
8921
|
presentation: "grouped-step",
|
|
@@ -8593,7 +8923,7 @@ var webSearchComponentRenderer = {
|
|
|
8593
8923
|
hasDetails: hasWebSearchSources,
|
|
8594
8924
|
renderDetails: WebSearchToolCallOutput
|
|
8595
8925
|
};
|
|
8596
|
-
function
|
|
8926
|
+
function normalizeToolToken2(value) {
|
|
8597
8927
|
if (typeof value !== "string") return null;
|
|
8598
8928
|
const normalized = value.trim().toLowerCase().replace(/[\s-]+/g, "_");
|
|
8599
8929
|
return normalized || null;
|
|
@@ -8638,9 +8968,9 @@ function hasWebSearchSources(_content, data) {
|
|
|
8638
8968
|
}
|
|
8639
8969
|
function isComputerWebSearchComponent(_content, data) {
|
|
8640
8970
|
const isComputer = data.category === "Computer";
|
|
8641
|
-
const isWebSearch =
|
|
8971
|
+
const isWebSearch = normalizeToolToken2(data.type) === "web_search";
|
|
8642
8972
|
if (!isComputer || !isWebSearch) return false;
|
|
8643
|
-
return
|
|
8973
|
+
return normalizeToolToken2(data.tool) === "web_search" || getWebSearchSources(data).length > 0;
|
|
8644
8974
|
}
|
|
8645
8975
|
function getSourceHost(url) {
|
|
8646
8976
|
try {
|
|
@@ -8655,9 +8985,9 @@ function WebSearchToolCallOutput({
|
|
|
8655
8985
|
const { t } = useChatkitTranslation();
|
|
8656
8986
|
const sources = getWebSearchSources(data);
|
|
8657
8987
|
if (sources.length === 0 || data.error !== void 0) return null;
|
|
8658
|
-
return /* @__PURE__ */
|
|
8659
|
-
/* @__PURE__ */
|
|
8660
|
-
/* @__PURE__ */
|
|
8988
|
+
return /* @__PURE__ */ jsxs21("div", { className: "space-y-2", children: [
|
|
8989
|
+
/* @__PURE__ */ jsx33("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.toolGroup.sourcesTitle") }),
|
|
8990
|
+
/* @__PURE__ */ jsx33("div", { className: "space-y-2", children: sources.map((source, index) => {
|
|
8661
8991
|
const sourceHost = getSourceHost(source.url);
|
|
8662
8992
|
const snippet = source.content ?? source.description;
|
|
8663
8993
|
const metaParts = [
|
|
@@ -8665,13 +8995,13 @@ function WebSearchToolCallOutput({
|
|
|
8665
8995
|
source.publishedDate,
|
|
8666
8996
|
source.author
|
|
8667
8997
|
].filter((item) => Boolean(item));
|
|
8668
|
-
return /* @__PURE__ */
|
|
8998
|
+
return /* @__PURE__ */ jsxs21(
|
|
8669
8999
|
"div",
|
|
8670
9000
|
{
|
|
8671
9001
|
className: "min-w-0 rounded-md border border-border/60 bg-background/80 px-3 py-2",
|
|
8672
9002
|
children: [
|
|
8673
|
-
metaParts.length > 0 ? /* @__PURE__ */
|
|
8674
|
-
/* @__PURE__ */
|
|
9003
|
+
metaParts.length > 0 ? /* @__PURE__ */ jsx33("div", { className: "mb-1 truncate text-[11px] text-muted-foreground", children: metaParts.join(" / ") }) : null,
|
|
9004
|
+
/* @__PURE__ */ jsx33(
|
|
8675
9005
|
"a",
|
|
8676
9006
|
{
|
|
8677
9007
|
href: source.url,
|
|
@@ -8681,7 +9011,7 @@ function WebSearchToolCallOutput({
|
|
|
8681
9011
|
children: source.title
|
|
8682
9012
|
}
|
|
8683
9013
|
),
|
|
8684
|
-
snippet ? /* @__PURE__ */
|
|
9014
|
+
snippet ? /* @__PURE__ */ jsx33("p", { className: "mt-1 line-clamp-3 text-xs leading-5 text-muted-foreground", children: snippet }) : null
|
|
8685
9015
|
]
|
|
8686
9016
|
},
|
|
8687
9017
|
`${source.url}-${index}`
|
|
@@ -8692,6 +9022,7 @@ function WebSearchToolCallOutput({
|
|
|
8692
9022
|
|
|
8693
9023
|
// src/components/thread/messages/component-message-renderers.tsx
|
|
8694
9024
|
var COMPONENT_MESSAGE_RENDERERS = [
|
|
9025
|
+
knowledgeRetrieverComponentRenderer,
|
|
8695
9026
|
webSearchComponentRenderer
|
|
8696
9027
|
];
|
|
8697
9028
|
function getComponentMessageRenderer(content, data) {
|
|
@@ -8708,16 +9039,16 @@ function hasComponentMessageRendererDetails(renderer, content, data) {
|
|
|
8708
9039
|
}
|
|
8709
9040
|
|
|
8710
9041
|
// src/components/thread/messages/tool-component-group.tsx
|
|
8711
|
-
import * as
|
|
9042
|
+
import * as React30 from "react";
|
|
8712
9043
|
import {
|
|
8713
9044
|
BookOpen,
|
|
8714
9045
|
Brain as Brain3,
|
|
8715
9046
|
Building2,
|
|
8716
|
-
Check as
|
|
9047
|
+
Check as Check4,
|
|
8717
9048
|
CheckCircle2 as CheckCircle23,
|
|
8718
9049
|
ChevronRight as ChevronRight7,
|
|
8719
9050
|
CircleHelp,
|
|
8720
|
-
Copy,
|
|
9051
|
+
Copy as Copy2,
|
|
8721
9052
|
FileText as FileText2,
|
|
8722
9053
|
Files,
|
|
8723
9054
|
Loader2 as Loader24,
|
|
@@ -8730,57 +9061,247 @@ import {
|
|
|
8730
9061
|
XCircle as XCircle2
|
|
8731
9062
|
} from "lucide-react";
|
|
8732
9063
|
|
|
8733
|
-
// src/
|
|
8734
|
-
|
|
8735
|
-
|
|
8736
|
-
|
|
8737
|
-
|
|
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";
|
|
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);
|
|
8738
9088
|
}
|
|
8739
|
-
if (
|
|
8740
|
-
|
|
8741
|
-
|
|
8742
|
-
|
|
8743
|
-
|
|
8744
|
-
const
|
|
8745
|
-
|
|
8746
|
-
|
|
8747
|
-
|
|
8748
|
-
|
|
8749
|
-
|
|
8750
|
-
|
|
8751
|
-
|
|
8752
|
-
|
|
8753
|
-
|
|
8754
|
-
|
|
8755
|
-
|
|
8756
|
-
|
|
8757
|
-
|
|
8758
|
-
|
|
8759
|
-
|
|
8760
|
-
|
|
8761
|
-
|
|
8762
|
-
|
|
8763
|
-
|
|
8764
|
-
|
|
8765
|
-
|
|
8766
|
-
|
|
8767
|
-
|
|
8768
|
-
|
|
8769
|
-
const
|
|
8770
|
-
if (
|
|
8771
|
-
|
|
8772
|
-
|
|
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;
|
|
8773
9138
|
}
|
|
8774
|
-
|
|
8775
|
-
|
|
8776
|
-
|
|
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" })
|
|
8777
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 }) });
|
|
8778
9206
|
}
|
|
8779
|
-
|
|
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
|
+
);
|
|
8780
9301
|
}
|
|
8781
9302
|
|
|
8782
9303
|
// src/components/thread/messages/tool-component-group.tsx
|
|
8783
|
-
import { jsx as
|
|
9304
|
+
import { jsx as jsx35, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
8784
9305
|
var toolStatusConfig = {
|
|
8785
9306
|
success: {
|
|
8786
9307
|
iconClass: "border-green-500 text-green-700",
|
|
@@ -8886,10 +9407,10 @@ function formatStepDuration2(durationMs) {
|
|
|
8886
9407
|
return `${minutes}m ${seconds}s`;
|
|
8887
9408
|
}
|
|
8888
9409
|
function useFrozenTimestamp(shouldFreeze) {
|
|
8889
|
-
const [frozenAt, setFrozenAt] =
|
|
9410
|
+
const [frozenAt, setFrozenAt] = React30.useState(
|
|
8890
9411
|
() => shouldFreeze ? Date.now() : null
|
|
8891
9412
|
);
|
|
8892
|
-
|
|
9413
|
+
React30.useEffect(() => {
|
|
8893
9414
|
if (shouldFreeze) {
|
|
8894
9415
|
setFrozenAt((current) => current ?? Date.now());
|
|
8895
9416
|
return;
|
|
@@ -8899,12 +9420,12 @@ function useFrozenTimestamp(shouldFreeze) {
|
|
|
8899
9420
|
return frozenAt;
|
|
8900
9421
|
}
|
|
8901
9422
|
function useToolStepDurationLabel(data, options) {
|
|
8902
|
-
const [durationNow, setDurationNow] =
|
|
9423
|
+
const [durationNow, setDurationNow] = React30.useState(() => Date.now());
|
|
8903
9424
|
const createdAt = parseStepDate(data.created_date);
|
|
8904
9425
|
const explicitEndedAt = parseStepDate(data.end_date);
|
|
8905
9426
|
const status = options?.status ?? data.status;
|
|
8906
9427
|
const endedAt = explicitEndedAt ?? (status !== "running" ? options?.fallbackEndedAt ?? null : null);
|
|
8907
|
-
|
|
9428
|
+
React30.useEffect(() => {
|
|
8908
9429
|
if (status !== "running" || createdAt === null || endedAt !== null) {
|
|
8909
9430
|
return;
|
|
8910
9431
|
}
|
|
@@ -8952,13 +9473,13 @@ function isSkippableToolGroupSeparator(content) {
|
|
|
8952
9473
|
}
|
|
8953
9474
|
return false;
|
|
8954
9475
|
}
|
|
8955
|
-
function
|
|
9476
|
+
function normalizeToolToken3(value) {
|
|
8956
9477
|
if (typeof value !== "string") return null;
|
|
8957
9478
|
const normalized = value.trim().toLowerCase().replace(/[\s-]+/g, "_");
|
|
8958
9479
|
return normalized || null;
|
|
8959
9480
|
}
|
|
8960
9481
|
function classifyToolToken(value) {
|
|
8961
|
-
const normalized =
|
|
9482
|
+
const normalized = normalizeToolToken3(
|
|
8962
9483
|
typeof value === "string" ? value : resolveLocalizedText(value, "en-US")
|
|
8963
9484
|
);
|
|
8964
9485
|
if (!normalized) return null;
|
|
@@ -8966,7 +9487,7 @@ function classifyToolToken(value) {
|
|
|
8966
9487
|
if (directMatch) return directMatch;
|
|
8967
9488
|
if (normalized.includes("search")) return "searches";
|
|
8968
9489
|
if (normalized.includes("file")) return "files";
|
|
8969
|
-
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")) {
|
|
8970
9491
|
return "commands";
|
|
8971
9492
|
}
|
|
8972
9493
|
if (normalized.includes("list")) return "lists";
|
|
@@ -8978,6 +9499,7 @@ function classifyToolToken(value) {
|
|
|
8978
9499
|
}
|
|
8979
9500
|
function getToolGroupCategory(content) {
|
|
8980
9501
|
const data = getToolStepData(content);
|
|
9502
|
+
if (isSandboxShellStep(data)) return "commands";
|
|
8981
9503
|
return classifyToolToken(data.type) ?? classifyToolToken(data.tool) ?? classifyToolToken(data.title) ?? classifyToolToken(data.message) ?? "tools";
|
|
8982
9504
|
}
|
|
8983
9505
|
function getToolGroupCategoryCounts(items) {
|
|
@@ -8997,8 +9519,8 @@ function getToolActivityLabel(content, language, statusOverride) {
|
|
|
8997
9519
|
if (status === "running") {
|
|
8998
9520
|
return message ?? title ?? tool ?? type ?? "Tool";
|
|
8999
9521
|
}
|
|
9000
|
-
const titleToken =
|
|
9001
|
-
const genericTitle = titleToken !== null && [tool, type].map((candidate) =>
|
|
9522
|
+
const titleToken = normalizeToolToken3(title);
|
|
9523
|
+
const genericTitle = titleToken !== null && [tool, type].map((candidate) => normalizeToolToken3(candidate)).some((candidate) => candidate === titleToken);
|
|
9002
9524
|
if (message && (!title || genericTitle)) {
|
|
9003
9525
|
return message;
|
|
9004
9526
|
}
|
|
@@ -9082,13 +9604,13 @@ function createToolsetAvatarUrl(toolsetId, apiUrl) {
|
|
|
9082
9604
|
}
|
|
9083
9605
|
}
|
|
9084
9606
|
function shouldUseToolsetAvatar(toolset) {
|
|
9085
|
-
const normalized =
|
|
9607
|
+
const normalized = normalizeToolToken3(toolset);
|
|
9086
9608
|
return normalized === "mcp" || normalized === "openapi";
|
|
9087
9609
|
}
|
|
9088
9610
|
function useToolsetAvatar(toolsetId, enabled, apiUrl) {
|
|
9089
9611
|
const avatarUrl = enabled ? createToolsetAvatarUrl(toolsetId, apiUrl) : null;
|
|
9090
|
-
const [avatar, setAvatar] =
|
|
9091
|
-
|
|
9612
|
+
const [avatar, setAvatar] = React30.useState(null);
|
|
9613
|
+
React30.useEffect(() => {
|
|
9092
9614
|
if (!avatarUrl) {
|
|
9093
9615
|
setAvatar(null);
|
|
9094
9616
|
return;
|
|
@@ -9120,7 +9642,7 @@ function ToolAvatarIcon({
|
|
|
9120
9642
|
className
|
|
9121
9643
|
}) {
|
|
9122
9644
|
if (avatar.url) {
|
|
9123
|
-
return /* @__PURE__ */
|
|
9645
|
+
return /* @__PURE__ */ jsx35(
|
|
9124
9646
|
"img",
|
|
9125
9647
|
{
|
|
9126
9648
|
alt: "",
|
|
@@ -9133,7 +9655,7 @@ function ToolAvatarIcon({
|
|
|
9133
9655
|
}
|
|
9134
9656
|
const emoji = unicodeFromUnified2(avatar.emoji?.unified);
|
|
9135
9657
|
if (emoji) {
|
|
9136
|
-
return /* @__PURE__ */
|
|
9658
|
+
return /* @__PURE__ */ jsx35(
|
|
9137
9659
|
"span",
|
|
9138
9660
|
{
|
|
9139
9661
|
"aria-hidden": "true",
|
|
@@ -9148,7 +9670,7 @@ function ToolAvatarIcon({
|
|
|
9148
9670
|
}
|
|
9149
9671
|
);
|
|
9150
9672
|
}
|
|
9151
|
-
return /* @__PURE__ */
|
|
9673
|
+
return /* @__PURE__ */ jsx35(
|
|
9152
9674
|
CircleHelp,
|
|
9153
9675
|
{
|
|
9154
9676
|
className,
|
|
@@ -9158,7 +9680,7 @@ function ToolAvatarIcon({
|
|
|
9158
9680
|
);
|
|
9159
9681
|
}
|
|
9160
9682
|
function getKnownToolsetIcon(toolset) {
|
|
9161
|
-
const normalized =
|
|
9683
|
+
const normalized = normalizeToolToken3(toolset);
|
|
9162
9684
|
if (!normalized) return null;
|
|
9163
9685
|
switch (normalized) {
|
|
9164
9686
|
case "project":
|
|
@@ -9181,7 +9703,7 @@ function getKnownToolsetIcon(toolset) {
|
|
|
9181
9703
|
}
|
|
9182
9704
|
}
|
|
9183
9705
|
function getStepTypeIcon(type) {
|
|
9184
|
-
const normalized =
|
|
9706
|
+
const normalized = normalizeToolToken3(type);
|
|
9185
9707
|
if (!normalized) return null;
|
|
9186
9708
|
switch (normalized) {
|
|
9187
9709
|
case "file":
|
|
@@ -9211,12 +9733,12 @@ function ToolStepIcon({
|
|
|
9211
9733
|
apiUrl
|
|
9212
9734
|
);
|
|
9213
9735
|
const iconUrl = createToolsetIconUrl(data.toolset, organizationId, apiUrl);
|
|
9214
|
-
const [failedIconUrl, setFailedIconUrl] =
|
|
9215
|
-
|
|
9736
|
+
const [failedIconUrl, setFailedIconUrl] = React30.useState(null);
|
|
9737
|
+
React30.useEffect(() => {
|
|
9216
9738
|
setFailedIconUrl(null);
|
|
9217
9739
|
}, [iconUrl]);
|
|
9218
9740
|
if (avatar) {
|
|
9219
|
-
return /* @__PURE__ */
|
|
9741
|
+
return /* @__PURE__ */ jsx35(
|
|
9220
9742
|
ToolAvatarIcon,
|
|
9221
9743
|
{
|
|
9222
9744
|
avatar,
|
|
@@ -9226,7 +9748,7 @@ function ToolStepIcon({
|
|
|
9226
9748
|
);
|
|
9227
9749
|
}
|
|
9228
9750
|
if (iconUrl && failedIconUrl !== iconUrl) {
|
|
9229
|
-
return /* @__PURE__ */
|
|
9751
|
+
return /* @__PURE__ */ jsx35(
|
|
9230
9752
|
"img",
|
|
9231
9753
|
{
|
|
9232
9754
|
alt: "",
|
|
@@ -9240,7 +9762,7 @@ function ToolStepIcon({
|
|
|
9240
9762
|
}
|
|
9241
9763
|
const TypeIcon = getStepTypeIcon(data.type);
|
|
9242
9764
|
if (TypeIcon) {
|
|
9243
|
-
return /* @__PURE__ */
|
|
9765
|
+
return /* @__PURE__ */ jsx35(
|
|
9244
9766
|
TypeIcon,
|
|
9245
9767
|
{
|
|
9246
9768
|
className,
|
|
@@ -9251,7 +9773,7 @@ function ToolStepIcon({
|
|
|
9251
9773
|
}
|
|
9252
9774
|
const ToolsetIcon = getKnownToolsetIcon(data.toolset);
|
|
9253
9775
|
if (ToolsetIcon) {
|
|
9254
|
-
return /* @__PURE__ */
|
|
9776
|
+
return /* @__PURE__ */ jsx35(
|
|
9255
9777
|
ToolsetIcon,
|
|
9256
9778
|
{
|
|
9257
9779
|
className,
|
|
@@ -9261,7 +9783,7 @@ function ToolStepIcon({
|
|
|
9261
9783
|
);
|
|
9262
9784
|
}
|
|
9263
9785
|
if (usesToolsetAvatar) {
|
|
9264
|
-
return /* @__PURE__ */
|
|
9786
|
+
return /* @__PURE__ */ jsx35(
|
|
9265
9787
|
CircleHelp,
|
|
9266
9788
|
{
|
|
9267
9789
|
className,
|
|
@@ -9270,7 +9792,7 @@ function ToolStepIcon({
|
|
|
9270
9792
|
}
|
|
9271
9793
|
);
|
|
9272
9794
|
}
|
|
9273
|
-
return /* @__PURE__ */
|
|
9795
|
+
return /* @__PURE__ */ jsx35(
|
|
9274
9796
|
CircleHelp,
|
|
9275
9797
|
{
|
|
9276
9798
|
className,
|
|
@@ -9279,17 +9801,20 @@ function ToolStepIcon({
|
|
|
9279
9801
|
}
|
|
9280
9802
|
);
|
|
9281
9803
|
}
|
|
9282
|
-
function ToolCallCopyButton({
|
|
9804
|
+
function ToolCallCopyButton({
|
|
9805
|
+
value,
|
|
9806
|
+
className
|
|
9807
|
+
}) {
|
|
9283
9808
|
const { t } = useChatkitTranslation();
|
|
9284
|
-
const [isCopied, setIsCopied] =
|
|
9285
|
-
const resetTimeoutRef =
|
|
9286
|
-
const clearResetTimeout =
|
|
9809
|
+
const [isCopied, setIsCopied] = React30.useState(false);
|
|
9810
|
+
const resetTimeoutRef = React30.useRef(null);
|
|
9811
|
+
const clearResetTimeout = React30.useCallback(() => {
|
|
9287
9812
|
if (resetTimeoutRef.current === null) return;
|
|
9288
9813
|
window.clearTimeout(resetTimeoutRef.current);
|
|
9289
9814
|
resetTimeoutRef.current = null;
|
|
9290
9815
|
}, []);
|
|
9291
|
-
|
|
9292
|
-
const handleCopy =
|
|
9816
|
+
React30.useEffect(() => clearResetTimeout, [clearResetTimeout]);
|
|
9817
|
+
const handleCopy = React30.useCallback(() => {
|
|
9293
9818
|
if (typeof navigator === "undefined" || !navigator.clipboard) return;
|
|
9294
9819
|
void navigator.clipboard.writeText(value).then(() => {
|
|
9295
9820
|
setIsCopied(true);
|
|
@@ -9301,15 +9826,18 @@ function ToolCallCopyButton({ value }) {
|
|
|
9301
9826
|
}).catch(() => void 0);
|
|
9302
9827
|
}, [clearResetTimeout, value]);
|
|
9303
9828
|
const label = isCopied ? t("message.toolGroup.copied") : t("message.toolGroup.copy");
|
|
9304
|
-
return /* @__PURE__ */
|
|
9829
|
+
return /* @__PURE__ */ jsx35(
|
|
9305
9830
|
"button",
|
|
9306
9831
|
{
|
|
9307
9832
|
type: "button",
|
|
9308
|
-
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
|
+
),
|
|
9309
9837
|
"aria-label": label,
|
|
9310
9838
|
title: label,
|
|
9311
9839
|
onClick: handleCopy,
|
|
9312
|
-
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" })
|
|
9313
9841
|
}
|
|
9314
9842
|
);
|
|
9315
9843
|
}
|
|
@@ -9320,28 +9848,28 @@ function ToolCallValueBlock({
|
|
|
9320
9848
|
const { t } = useChatkitTranslation();
|
|
9321
9849
|
const detected = detectJsonValue(value);
|
|
9322
9850
|
if (detected.kind === "text") {
|
|
9323
|
-
return /* @__PURE__ */
|
|
9324
|
-
/* @__PURE__ */
|
|
9325
|
-
/* @__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 })
|
|
9326
9854
|
] });
|
|
9327
9855
|
}
|
|
9328
|
-
return /* @__PURE__ */
|
|
9329
|
-
/* @__PURE__ */
|
|
9330
|
-
/* @__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: [
|
|
9331
9859
|
t("message.toolGroup.jsonTitle"),
|
|
9332
9860
|
" \xB7 ",
|
|
9333
9861
|
getJsonValueSummary(detected.value)
|
|
9334
9862
|
] }),
|
|
9335
|
-
/* @__PURE__ */
|
|
9336
|
-
/* @__PURE__ */
|
|
9337
|
-
/* @__PURE__ */
|
|
9338
|
-
/* @__PURE__ */
|
|
9339
|
-
/* @__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") })
|
|
9340
9868
|
] })
|
|
9341
9869
|
] })
|
|
9342
9870
|
] }),
|
|
9343
|
-
/* @__PURE__ */
|
|
9344
|
-
/* @__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 }) })
|
|
9345
9873
|
] });
|
|
9346
9874
|
}
|
|
9347
9875
|
function DefaultToolCallOutput({ data }) {
|
|
@@ -9349,37 +9877,40 @@ function DefaultToolCallOutput({ data }) {
|
|
|
9349
9877
|
const output = data.output ?? null;
|
|
9350
9878
|
const error = data.error ?? null;
|
|
9351
9879
|
if (error) {
|
|
9352
|
-
return /* @__PURE__ */
|
|
9353
|
-
/* @__PURE__ */
|
|
9354
|
-
/* @__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 })
|
|
9355
9883
|
] });
|
|
9356
9884
|
}
|
|
9357
9885
|
if (output === null) return null;
|
|
9358
|
-
return /* @__PURE__ */
|
|
9359
|
-
/* @__PURE__ */
|
|
9360
|
-
/* @__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 })
|
|
9361
9889
|
] });
|
|
9362
9890
|
}
|
|
9363
9891
|
function ToolCallDetails({ content }) {
|
|
9364
9892
|
const { t } = useChatkitTranslation();
|
|
9365
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
|
+
}
|
|
9366
9897
|
const renderer = getComponentMessageRenderer(content, data);
|
|
9367
9898
|
const hasCustomDetails = data.error === void 0 && hasComponentMessageRendererDetails(renderer, content, data);
|
|
9368
9899
|
const CustomDetailsRenderer = hasCustomDetails ? renderer?.renderDetails : void 0;
|
|
9369
9900
|
if (CustomDetailsRenderer) {
|
|
9370
|
-
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 }) });
|
|
9371
9902
|
}
|
|
9372
9903
|
const OutputRenderer = getToolCallOutputRenderer(data);
|
|
9373
9904
|
const hasInput = data.input !== void 0 && data.input !== null;
|
|
9374
9905
|
const hasOutput = data.error !== void 0 || data.output !== void 0;
|
|
9375
9906
|
if (!hasInput && !hasOutput) return null;
|
|
9376
|
-
return /* @__PURE__ */
|
|
9377
|
-
hasInput && /* @__PURE__ */
|
|
9378
|
-
/* @__PURE__ */
|
|
9379
|
-
/* @__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 })
|
|
9380
9911
|
] }),
|
|
9381
|
-
hasInput && hasOutput ? /* @__PURE__ */
|
|
9382
|
-
hasOutput ? /* @__PURE__ */
|
|
9912
|
+
hasInput && hasOutput ? /* @__PURE__ */ jsx35("div", { className: "h-2" }) : null,
|
|
9913
|
+
hasOutput ? /* @__PURE__ */ jsx35(OutputRenderer, { content, data }) : null
|
|
9383
9914
|
] });
|
|
9384
9915
|
}
|
|
9385
9916
|
function areToolCallRowPropsEqual(previous, next) {
|
|
@@ -9391,15 +9922,16 @@ function ToolCallRowContent({
|
|
|
9391
9922
|
organizationId,
|
|
9392
9923
|
apiUrl
|
|
9393
9924
|
}) {
|
|
9394
|
-
const { i18n: i18n2 } = useChatkitTranslation();
|
|
9925
|
+
const { i18n: i18n2, t } = useChatkitTranslation();
|
|
9395
9926
|
const data = getToolStepData(content);
|
|
9396
9927
|
const status = getEffectiveToolStepStatus(data, isThreadRunning);
|
|
9397
9928
|
const hasError = status === "fail" || Boolean(data.error);
|
|
9398
|
-
const
|
|
9399
|
-
const detailsId =
|
|
9929
|
+
const isSandboxShell = isSandboxShellStep(data);
|
|
9930
|
+
const detailsId = React30.useId();
|
|
9400
9931
|
const renderer = getComponentMessageRenderer(content, data);
|
|
9932
|
+
const label = isSandboxShell ? getSandboxShellActivityLabel(data, status, i18n2.language, t) : renderer?.getTitle?.(content, data, i18n2.language) ?? getToolActivityLabel(content, i18n2.language, status);
|
|
9401
9933
|
const hasCustomDetails = data.error === void 0 && hasComponentMessageRendererDetails(renderer, content, data);
|
|
9402
|
-
const hasDetails = data.input !== void 0 || data.error !== void 0 || data.output !== void 0 || hasCustomDetails;
|
|
9934
|
+
const hasDetails = isSandboxShell || data.input !== void 0 || data.error !== void 0 || data.output !== void 0 || hasCustomDetails;
|
|
9403
9935
|
const fallbackEndedAt = useFrozenTimestamp(
|
|
9404
9936
|
data.status === "running" && status === "fail"
|
|
9405
9937
|
);
|
|
@@ -9407,14 +9939,14 @@ function ToolCallRowContent({
|
|
|
9407
9939
|
status,
|
|
9408
9940
|
fallbackEndedAt
|
|
9409
9941
|
});
|
|
9410
|
-
const [isExpanded, setIsExpanded] =
|
|
9411
|
-
|
|
9942
|
+
const [isExpanded, setIsExpanded] = React30.useState(false);
|
|
9943
|
+
React30.useEffect(() => {
|
|
9412
9944
|
if (status === "running" && data.output !== void 0) {
|
|
9413
9945
|
setIsExpanded(true);
|
|
9414
9946
|
}
|
|
9415
9947
|
}, [data.output, status]);
|
|
9416
|
-
return /* @__PURE__ */
|
|
9417
|
-
/* @__PURE__ */
|
|
9948
|
+
return /* @__PURE__ */ jsxs23("li", { className: "ck-tool-call-row-enter min-w-0", children: [
|
|
9949
|
+
/* @__PURE__ */ jsxs23(
|
|
9418
9950
|
"button",
|
|
9419
9951
|
{
|
|
9420
9952
|
type: "button",
|
|
@@ -9422,7 +9954,7 @@ function ToolCallRowContent({
|
|
|
9422
9954
|
"group/tool-call flex w-full min-w-0 items-center gap-2 text-left text-muted-foreground",
|
|
9423
9955
|
TOOL_CALL_ROW_TEXT_CLASS,
|
|
9424
9956
|
hasDetails && "cursor-pointer hover:text-foreground",
|
|
9425
|
-
hasError && "text-destructive hover:text-destructive"
|
|
9957
|
+
hasError && !isSandboxShell && "text-destructive hover:text-destructive"
|
|
9426
9958
|
),
|
|
9427
9959
|
"aria-expanded": hasDetails ? isExpanded : void 0,
|
|
9428
9960
|
"aria-controls": hasDetails ? detailsId : void 0,
|
|
@@ -9431,7 +9963,7 @@ function ToolCallRowContent({
|
|
|
9431
9963
|
if (hasDetails) setIsExpanded((prev) => !prev);
|
|
9432
9964
|
},
|
|
9433
9965
|
children: [
|
|
9434
|
-
status ? /* @__PURE__ */
|
|
9966
|
+
status ? /* @__PURE__ */ jsx35(
|
|
9435
9967
|
ToolStepIcon,
|
|
9436
9968
|
{
|
|
9437
9969
|
data,
|
|
@@ -9439,11 +9971,11 @@ function ToolCallRowContent({
|
|
|
9439
9971
|
apiUrl,
|
|
9440
9972
|
className: cn(
|
|
9441
9973
|
"h-3.5 w-3.5 shrink-0",
|
|
9442
|
-
hasError ? "text-destructive" : "text-muted-foreground"
|
|
9974
|
+
hasError && !isSandboxShell ? "text-destructive" : "text-muted-foreground"
|
|
9443
9975
|
)
|
|
9444
9976
|
}
|
|
9445
|
-
) : /* @__PURE__ */
|
|
9446
|
-
/* @__PURE__ */
|
|
9977
|
+
) : /* @__PURE__ */ jsx35("span", { className: "h-3.5 w-3.5 shrink-0", "aria-hidden": "true" }),
|
|
9978
|
+
/* @__PURE__ */ jsx35(
|
|
9447
9979
|
"span",
|
|
9448
9980
|
{
|
|
9449
9981
|
className: cn(
|
|
@@ -9454,8 +9986,8 @@ function ToolCallRowContent({
|
|
|
9454
9986
|
children: label
|
|
9455
9987
|
}
|
|
9456
9988
|
),
|
|
9457
|
-
durationLabel ? /* @__PURE__ */
|
|
9458
|
-
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(
|
|
9459
9991
|
ChevronRight7,
|
|
9460
9992
|
{
|
|
9461
9993
|
"aria-hidden": "true",
|
|
@@ -9468,10 +10000,10 @@ function ToolCallRowContent({
|
|
|
9468
10000
|
]
|
|
9469
10001
|
}
|
|
9470
10002
|
),
|
|
9471
|
-
hasDetails && isExpanded ? /* @__PURE__ */
|
|
10003
|
+
hasDetails && isExpanded ? /* @__PURE__ */ jsx35("div", { id: detailsId, children: /* @__PURE__ */ jsx35(ToolCallDetails, { content }) }) : null
|
|
9472
10004
|
] });
|
|
9473
10005
|
}
|
|
9474
|
-
var ToolCallRow =
|
|
10006
|
+
var ToolCallRow = React30.memo(ToolCallRowContent, areToolCallRowPropsEqual);
|
|
9475
10007
|
ToolCallRow.displayName = "ToolCallRow";
|
|
9476
10008
|
function ToolComponentGroup({
|
|
9477
10009
|
items,
|
|
@@ -9481,8 +10013,8 @@ function ToolComponentGroup({
|
|
|
9481
10013
|
apiUrl
|
|
9482
10014
|
}) {
|
|
9483
10015
|
const { t } = useChatkitTranslation();
|
|
9484
|
-
const contentId =
|
|
9485
|
-
const [isExpanded, setIsExpanded] =
|
|
10016
|
+
const contentId = React30.useId();
|
|
10017
|
+
const [isExpanded, setIsExpanded] = React30.useState(!hasFollowingItem);
|
|
9486
10018
|
const categoryCounts = getToolGroupCategoryCounts(items);
|
|
9487
10019
|
const categorySummary = TOOL_GROUP_CATEGORY_ORDER.flatMap((category) => {
|
|
9488
10020
|
const count = categoryCounts[category] ?? 0;
|
|
@@ -9497,11 +10029,11 @@ function ToolComponentGroup({
|
|
|
9497
10029
|
const summary = `${t("message.toolGroup.status.success")} ${categorySummary}`;
|
|
9498
10030
|
const config = toolStatusConfig.success;
|
|
9499
10031
|
const StatusIcon = config.icon;
|
|
9500
|
-
|
|
10032
|
+
React30.useEffect(() => {
|
|
9501
10033
|
setIsExpanded(!hasFollowingItem);
|
|
9502
|
-
}, [hasFollowingItem
|
|
9503
|
-
return /* @__PURE__ */
|
|
9504
|
-
/* @__PURE__ */
|
|
10034
|
+
}, [hasFollowingItem]);
|
|
10035
|
+
return /* @__PURE__ */ jsxs23("div", { className: "px-1 py-1", children: [
|
|
10036
|
+
/* @__PURE__ */ jsxs23(
|
|
9505
10037
|
"button",
|
|
9506
10038
|
{
|
|
9507
10039
|
type: "button",
|
|
@@ -9510,8 +10042,8 @@ function ToolComponentGroup({
|
|
|
9510
10042
|
"aria-controls": contentId,
|
|
9511
10043
|
onClick: () => setIsExpanded((prev) => !prev),
|
|
9512
10044
|
children: [
|
|
9513
|
-
/* @__PURE__ */
|
|
9514
|
-
/* @__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(
|
|
9515
10047
|
StatusIcon,
|
|
9516
10048
|
{
|
|
9517
10049
|
className: cn(
|
|
@@ -9520,9 +10052,9 @@ function ToolComponentGroup({
|
|
|
9520
10052
|
)
|
|
9521
10053
|
}
|
|
9522
10054
|
),
|
|
9523
|
-
/* @__PURE__ */
|
|
10055
|
+
/* @__PURE__ */ jsx35("span", { className: "truncate", children: summary })
|
|
9524
10056
|
] }),
|
|
9525
|
-
/* @__PURE__ */
|
|
10057
|
+
/* @__PURE__ */ jsx35(
|
|
9526
10058
|
ChevronRight7,
|
|
9527
10059
|
{
|
|
9528
10060
|
"aria-hidden": "true",
|
|
@@ -9535,7 +10067,7 @@ function ToolComponentGroup({
|
|
|
9535
10067
|
]
|
|
9536
10068
|
}
|
|
9537
10069
|
),
|
|
9538
|
-
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(
|
|
9539
10071
|
ToolCallRow,
|
|
9540
10072
|
{
|
|
9541
10073
|
content: item,
|
|
@@ -9555,11 +10087,11 @@ import {
|
|
|
9555
10087
|
REQUEST_USER_INPUT_TOOL_NAME as REQUEST_USER_INPUT_TOOL_NAME2
|
|
9556
10088
|
} from "@xpert-ai/chatkit-types";
|
|
9557
10089
|
import { CheckCircle2 as CheckCircle24 } from "lucide-react";
|
|
9558
|
-
import { jsx as
|
|
9559
|
-
function
|
|
10090
|
+
import { jsx as jsx36, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
10091
|
+
function isRecord3(value) {
|
|
9560
10092
|
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
9561
10093
|
}
|
|
9562
|
-
function
|
|
10094
|
+
function readString2(record, keys) {
|
|
9563
10095
|
for (const key of keys) {
|
|
9564
10096
|
const value = record[key];
|
|
9565
10097
|
if (typeof value === "string" && value.trim()) {
|
|
@@ -9569,12 +10101,12 @@ function readString(record, keys) {
|
|
|
9569
10101
|
return null;
|
|
9570
10102
|
}
|
|
9571
10103
|
function getToolCallId(value) {
|
|
9572
|
-
if (!
|
|
9573
|
-
return
|
|
10104
|
+
if (!isRecord3(value)) return null;
|
|
10105
|
+
return readString2(value, ["id"]);
|
|
9574
10106
|
}
|
|
9575
10107
|
function getToolCallName(value) {
|
|
9576
|
-
if (!
|
|
9577
|
-
return
|
|
10108
|
+
if (!isRecord3(value)) return null;
|
|
10109
|
+
return readString2(value, ["name"]);
|
|
9578
10110
|
}
|
|
9579
10111
|
function pushClientToolCallsFromRecord(record, calls) {
|
|
9580
10112
|
const clientToolCalls = record.clientToolCalls;
|
|
@@ -9598,16 +10130,16 @@ function findRequestUserInputClientToolCallById(messages, id) {
|
|
|
9598
10130
|
) ?? null;
|
|
9599
10131
|
}
|
|
9600
10132
|
function normalizeAnswer(value) {
|
|
9601
|
-
if (!
|
|
9602
|
-
const id =
|
|
9603
|
-
const question =
|
|
9604
|
-
const answerValue =
|
|
9605
|
-
const type =
|
|
10133
|
+
if (!isRecord3(value)) return null;
|
|
10134
|
+
const id = readString2(value, ["id"]);
|
|
10135
|
+
const question = readString2(value, ["question"]);
|
|
10136
|
+
const answerValue = readString2(value, ["value"]);
|
|
10137
|
+
const type = readString2(value, ["type"]);
|
|
9606
10138
|
if (!id || !question || !answerValue || type !== "option" && type !== "other") {
|
|
9607
10139
|
return null;
|
|
9608
10140
|
}
|
|
9609
|
-
const label =
|
|
9610
|
-
const description =
|
|
10141
|
+
const label = readString2(value, ["label"]);
|
|
10142
|
+
const description = readString2(value, ["description"]);
|
|
9611
10143
|
return {
|
|
9612
10144
|
id,
|
|
9613
10145
|
question,
|
|
@@ -9626,7 +10158,7 @@ function parseResultOutput(output) {
|
|
|
9626
10158
|
return null;
|
|
9627
10159
|
}
|
|
9628
10160
|
}
|
|
9629
|
-
if (!
|
|
10161
|
+
if (!isRecord3(result) || !Array.isArray(result.answers)) {
|
|
9630
10162
|
return null;
|
|
9631
10163
|
}
|
|
9632
10164
|
const hasExplicitType = result.type === REQUEST_USER_INPUT_RESULT_TYPE2;
|
|
@@ -9640,7 +10172,7 @@ function parseResultOutput(output) {
|
|
|
9640
10172
|
};
|
|
9641
10173
|
}
|
|
9642
10174
|
function getRequestUserInputResultCardData(content, messages) {
|
|
9643
|
-
const data =
|
|
10175
|
+
const data = isRecord3(content.data) ? content.data : null;
|
|
9644
10176
|
if (data?.status !== "success") {
|
|
9645
10177
|
return null;
|
|
9646
10178
|
}
|
|
@@ -9667,7 +10199,7 @@ function RequestUserInputResultCard({
|
|
|
9667
10199
|
className
|
|
9668
10200
|
}) {
|
|
9669
10201
|
const { t } = useChatkitTranslation();
|
|
9670
|
-
return /* @__PURE__ */
|
|
10202
|
+
return /* @__PURE__ */ jsxs24(
|
|
9671
10203
|
"section",
|
|
9672
10204
|
{
|
|
9673
10205
|
"aria-label": t("message.requestUserInputResult.title"),
|
|
@@ -9676,23 +10208,23 @@ function RequestUserInputResultCard({
|
|
|
9676
10208
|
className
|
|
9677
10209
|
),
|
|
9678
10210
|
children: [
|
|
9679
|
-
/* @__PURE__ */
|
|
9680
|
-
/* @__PURE__ */
|
|
9681
|
-
/* @__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") })
|
|
9682
10214
|
] }),
|
|
9683
|
-
/* @__PURE__ */
|
|
10215
|
+
/* @__PURE__ */ jsx36("div", { className: "space-y-2", children: result.answers.map((answer, index) => /* @__PURE__ */ jsxs24(
|
|
9684
10216
|
"div",
|
|
9685
10217
|
{
|
|
9686
10218
|
className: "rounded-md bg-background/70 px-2.5 py-2",
|
|
9687
10219
|
children: [
|
|
9688
|
-
/* @__PURE__ */
|
|
9689
|
-
/* @__PURE__ */
|
|
9690
|
-
/* @__PURE__ */
|
|
9691
|
-
/* @__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(
|
|
9692
10224
|
answer.type === "other" ? "message.requestUserInputResult.other" : "message.requestUserInputResult.option"
|
|
9693
10225
|
) })
|
|
9694
10226
|
] }),
|
|
9695
|
-
answer.description ? /* @__PURE__ */
|
|
10227
|
+
answer.description ? /* @__PURE__ */ jsx36("div", { className: "mt-1 text-xs leading-5 text-muted-foreground", children: answer.description }) : null
|
|
9696
10228
|
]
|
|
9697
10229
|
},
|
|
9698
10230
|
`${answer.id}-${index}`
|
|
@@ -9704,18 +10236,18 @@ function RequestUserInputResultCard({
|
|
|
9704
10236
|
|
|
9705
10237
|
// src/components/thread/messages/widget.tsx
|
|
9706
10238
|
import { SurfaceRenderer } from "@xpert-ai/a2ui-react";
|
|
9707
|
-
import { jsx as
|
|
10239
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
9708
10240
|
function WidgetMessage({ messageId, data }) {
|
|
9709
10241
|
const widgets = Array.isArray(data.widgets) ? data.widgets : [];
|
|
9710
10242
|
if (widgets.length === 0) return null;
|
|
9711
10243
|
const baseSurfaceId = `widget-${messageId}`;
|
|
9712
|
-
return /* @__PURE__ */
|
|
10244
|
+
return /* @__PURE__ */ jsx37("div", { className: "space-y-3", children: widgets.map((widget, index) => {
|
|
9713
10245
|
const config = widget?.config;
|
|
9714
10246
|
if (!config || typeof config !== "object") {
|
|
9715
10247
|
return null;
|
|
9716
10248
|
}
|
|
9717
10249
|
const surfaceId = widgets.length > 1 ? `${baseSurfaceId}-${index}` : baseSurfaceId;
|
|
9718
|
-
return /* @__PURE__ */
|
|
10250
|
+
return /* @__PURE__ */ jsx37(
|
|
9719
10251
|
SurfaceRenderer,
|
|
9720
10252
|
{
|
|
9721
10253
|
surfaceId,
|
|
@@ -9727,7 +10259,7 @@ function WidgetMessage({ messageId, data }) {
|
|
|
9727
10259
|
}
|
|
9728
10260
|
|
|
9729
10261
|
// src/components/thread/messages/ai.tsx
|
|
9730
|
-
import { jsx as
|
|
10262
|
+
import { jsx as jsx38, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
9731
10263
|
var assistantMessageStackClassName = "space-y-3 in-data-[density=compact]:space-y-2 in-data-[density=spacious]:space-y-4";
|
|
9732
10264
|
function isTextContent3(content) {
|
|
9733
10265
|
return content.type === "text";
|
|
@@ -9761,11 +10293,11 @@ function formatDisplayValue3(value) {
|
|
|
9761
10293
|
function ReasoningBlock({ reasoning }) {
|
|
9762
10294
|
const blocks = reasoning.filter((item) => item.text?.trim());
|
|
9763
10295
|
if (blocks.length === 0) return null;
|
|
9764
|
-
return /* @__PURE__ */
|
|
10296
|
+
return /* @__PURE__ */ jsx38("div", { className: "space-y-2", children: blocks.map((item, index) => /* @__PURE__ */ jsx38(
|
|
9765
10297
|
"div",
|
|
9766
10298
|
{
|
|
9767
10299
|
className: "rounded-lg border bg-muted/40 p-3 text-xs text-muted-foreground",
|
|
9768
|
-
children: /* @__PURE__ */
|
|
10300
|
+
children: /* @__PURE__ */ jsx38("p", { className: "whitespace-pre-wrap wrap-break-word leading-relaxed", children: item.text })
|
|
9769
10301
|
},
|
|
9770
10302
|
item.id ?? `reasoning-${index}`
|
|
9771
10303
|
)) });
|
|
@@ -9773,20 +10305,20 @@ function ReasoningBlock({ reasoning }) {
|
|
|
9773
10305
|
function ImageBlock({ content }) {
|
|
9774
10306
|
const imageUrl = typeof content.image_url === "string" ? content.image_url : typeof content.image_url?.url === "string" ? content.image_url.url : null;
|
|
9775
10307
|
if (!imageUrl) {
|
|
9776
|
-
return /* @__PURE__ */
|
|
9777
|
-
/* @__PURE__ */
|
|
9778
|
-
/* @__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) })
|
|
9779
10311
|
] });
|
|
9780
10312
|
}
|
|
9781
|
-
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" }) });
|
|
9782
10314
|
}
|
|
9783
10315
|
function MemoryBlock({ content }) {
|
|
9784
|
-
return /* @__PURE__ */
|
|
9785
|
-
/* @__PURE__ */
|
|
9786
|
-
/* @__PURE__ */
|
|
9787
|
-
/* @__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" })
|
|
9788
10320
|
] }),
|
|
9789
|
-
/* @__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 ?? []) }) })
|
|
9790
10322
|
] });
|
|
9791
10323
|
}
|
|
9792
10324
|
function parseStepDate2(value) {
|
|
@@ -9820,11 +10352,11 @@ function formatStepDuration3(durationMs) {
|
|
|
9820
10352
|
}
|
|
9821
10353
|
function ComponentBlock({ content }) {
|
|
9822
10354
|
const { i18n: i18n2 } = useChatkitTranslation();
|
|
9823
|
-
const [isExpanded, setIsExpanded] =
|
|
9824
|
-
const contentRef =
|
|
9825
|
-
const shouldAutoScrollRef =
|
|
9826
|
-
const previousScrollTopRef =
|
|
9827
|
-
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());
|
|
9828
10360
|
const data = getToolStepData(content);
|
|
9829
10361
|
const category = data.category ?? "Component";
|
|
9830
10362
|
const title = getToolActivityLabel(content, i18n2.language);
|
|
@@ -9838,10 +10370,10 @@ function ComponentBlock({ content }) {
|
|
|
9838
10370
|
const endedAt = parseStepDate2(data.end_date);
|
|
9839
10371
|
const durationMs = createdAt === null ? null : Math.max(0, (endedAt ?? durationNow) - createdAt);
|
|
9840
10372
|
const durationLabel = durationMs === null ? null : formatStepDuration3(durationMs);
|
|
9841
|
-
|
|
10373
|
+
React32.useEffect(() => {
|
|
9842
10374
|
if (status === "running" && output !== null) setIsExpanded(true);
|
|
9843
10375
|
}, [status, output]);
|
|
9844
|
-
|
|
10376
|
+
React32.useEffect(() => {
|
|
9845
10377
|
if (status !== "running" || createdAt === null || endedAt !== null) {
|
|
9846
10378
|
return;
|
|
9847
10379
|
}
|
|
@@ -9853,7 +10385,7 @@ function ComponentBlock({ content }) {
|
|
|
9853
10385
|
window.clearInterval(timer);
|
|
9854
10386
|
};
|
|
9855
10387
|
}, [createdAt, endedAt, status]);
|
|
9856
|
-
|
|
10388
|
+
React32.useEffect(() => {
|
|
9857
10389
|
const element = contentRef.current;
|
|
9858
10390
|
if (!element) return;
|
|
9859
10391
|
previousScrollTopRef.current = element.scrollTop;
|
|
@@ -9873,7 +10405,7 @@ function ComponentBlock({ content }) {
|
|
|
9873
10405
|
element.removeEventListener("scroll", updateAutoScrollState);
|
|
9874
10406
|
};
|
|
9875
10407
|
}, [isExpanded]);
|
|
9876
|
-
|
|
10408
|
+
React32.useEffect(() => {
|
|
9877
10409
|
if (status !== "running") {
|
|
9878
10410
|
shouldAutoScrollRef.current = true;
|
|
9879
10411
|
return;
|
|
@@ -9886,24 +10418,24 @@ function ComponentBlock({ content }) {
|
|
|
9886
10418
|
}, [isExpanded, output, status]);
|
|
9887
10419
|
const config = status ? toolStatusConfig[status] : null;
|
|
9888
10420
|
const StatusIcon = config?.icon;
|
|
9889
|
-
return /* @__PURE__ */
|
|
9890
|
-
/* @__PURE__ */
|
|
9891
|
-
/* @__PURE__ */
|
|
9892
|
-
status && StatusIcon && /* @__PURE__ */
|
|
9893
|
-
/* @__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 })
|
|
9894
10426
|
] }),
|
|
9895
|
-
/* @__PURE__ */
|
|
9896
|
-
durationLabel && /* @__PURE__ */
|
|
9897
|
-
/* @__PURE__ */
|
|
9898
|
-
/* @__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 })
|
|
9899
10431
|
] }),
|
|
9900
|
-
/* @__PURE__ */
|
|
9901
|
-
/* @__PURE__ */
|
|
10432
|
+
/* @__PURE__ */ jsx38(Badge, { variant: "secondary", className: "rounded-lg px-1.5", children: category }),
|
|
10433
|
+
/* @__PURE__ */ jsx38(
|
|
9902
10434
|
"button",
|
|
9903
10435
|
{
|
|
9904
10436
|
className: "text-muted-foreground hover:text-foreground transition-colors",
|
|
9905
10437
|
"aria-label": isExpanded ? "Collapse" : "Expand",
|
|
9906
|
-
children: /* @__PURE__ */
|
|
10438
|
+
children: /* @__PURE__ */ jsx38(
|
|
9907
10439
|
ChevronDown4,
|
|
9908
10440
|
{
|
|
9909
10441
|
className: cn("h-4 w-4 transition-transform", isExpanded && "rotate-180")
|
|
@@ -9913,35 +10445,35 @@ function ComponentBlock({ content }) {
|
|
|
9913
10445
|
)
|
|
9914
10446
|
] })
|
|
9915
10447
|
] }),
|
|
9916
|
-
isExpanded && /* @__PURE__ */
|
|
9917
|
-
data.input && /* @__PURE__ */
|
|
9918
|
-
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) })
|
|
9919
10451
|
] })
|
|
9920
10452
|
] });
|
|
9921
10453
|
}
|
|
9922
10454
|
function UnknownBlock({ content }) {
|
|
9923
|
-
return /* @__PURE__ */
|
|
9924
|
-
/* @__PURE__ */
|
|
9925
|
-
/* @__PURE__ */
|
|
9926
|
-
/* @__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" })
|
|
9927
10459
|
] }),
|
|
9928
|
-
/* @__PURE__ */
|
|
10460
|
+
/* @__PURE__ */ jsx38(CardContent, { className: "text-xs text-muted-foreground", children: /* @__PURE__ */ jsx38("pre", { className: "whitespace-pre-wrap break-words", children: safeJson3(content) }) })
|
|
9929
10461
|
] });
|
|
9930
10462
|
}
|
|
9931
10463
|
function renderContentItem(content, index, message, lookupMessages, options) {
|
|
9932
10464
|
const messageId = message.id;
|
|
9933
10465
|
const textClassName = options?.isAgentOutput ? "text-sm [&_.markdown-content_p]:!leading-6" : void 0;
|
|
9934
10466
|
if (typeof content === "string") {
|
|
9935
|
-
return /* @__PURE__ */
|
|
10467
|
+
return /* @__PURE__ */ jsx38("div", { className: textClassName, children: /* @__PURE__ */ jsx38(MarkdownText, { children: content }) }, `text-${index}`);
|
|
9936
10468
|
}
|
|
9937
10469
|
if (isTextContent3(content)) {
|
|
9938
|
-
return /* @__PURE__ */
|
|
10470
|
+
return /* @__PURE__ */ jsx38("div", { className: textClassName, children: /* @__PURE__ */ jsx38(MarkdownText, { children: content.text }) }, content.id ?? `text-${index}`);
|
|
9939
10471
|
}
|
|
9940
10472
|
if (isReasoningContent3(content)) {
|
|
9941
|
-
return /* @__PURE__ */
|
|
10473
|
+
return /* @__PURE__ */ jsx38("div", { children: /* @__PURE__ */ jsx38(ReasoningBlock, { reasoning: [content] }) }, content.id ?? `reasoning-${index}`);
|
|
9942
10474
|
}
|
|
9943
10475
|
if (isImageContent(content)) {
|
|
9944
|
-
return /* @__PURE__ */
|
|
10476
|
+
return /* @__PURE__ */ jsx38("div", { children: /* @__PURE__ */ jsx38(ImageBlock, { content }) }, content.id ?? `image-${index}`);
|
|
9945
10477
|
}
|
|
9946
10478
|
if (isComponentContent3(content)) {
|
|
9947
10479
|
const requestUserInputResult = getRequestUserInputResultCardData(
|
|
@@ -9949,13 +10481,13 @@ function renderContentItem(content, index, message, lookupMessages, options) {
|
|
|
9949
10481
|
lookupMessages
|
|
9950
10482
|
);
|
|
9951
10483
|
if (requestUserInputResult) {
|
|
9952
|
-
return /* @__PURE__ */
|
|
10484
|
+
return /* @__PURE__ */ jsx38("div", { children: /* @__PURE__ */ jsx38(RequestUserInputResultCard, { result: requestUserInputResult }) }, content.id ?? `request-user-input-result-${index}`);
|
|
9953
10485
|
}
|
|
9954
10486
|
if (isWidgetComponent2(content)) {
|
|
9955
|
-
return /* @__PURE__ */
|
|
10487
|
+
return /* @__PURE__ */ jsx38("div", { children: /* @__PURE__ */ jsx38(WidgetMessage, { messageId, data: content.data }) }, content.id ?? `widget-${index}`);
|
|
9956
10488
|
}
|
|
9957
10489
|
if (getComponentMessagePresentation(content, getToolStepData(content)) === "grouped-step") {
|
|
9958
|
-
return /* @__PURE__ */
|
|
10490
|
+
return /* @__PURE__ */ jsx38("div", { children: /* @__PURE__ */ jsx38(
|
|
9959
10491
|
ToolComponentGroup,
|
|
9960
10492
|
{
|
|
9961
10493
|
items: [content],
|
|
@@ -9966,15 +10498,15 @@ function renderContentItem(content, index, message, lookupMessages, options) {
|
|
|
9966
10498
|
}
|
|
9967
10499
|
) }, content.id ?? `component-group-${index}`);
|
|
9968
10500
|
}
|
|
9969
|
-
return /* @__PURE__ */
|
|
10501
|
+
return /* @__PURE__ */ jsx38("div", { children: /* @__PURE__ */ jsx38(ComponentBlock, { content }) }, content.id ?? `component-${index}`);
|
|
9970
10502
|
}
|
|
9971
10503
|
if (isMemoryContent(content)) {
|
|
9972
|
-
return /* @__PURE__ */
|
|
10504
|
+
return /* @__PURE__ */ jsx38("div", { children: /* @__PURE__ */ jsx38(MemoryBlock, { content }) }, content.id ?? `memory-${index}`);
|
|
9973
10505
|
}
|
|
9974
10506
|
if (isAgentEventContent(content)) {
|
|
9975
|
-
return /* @__PURE__ */
|
|
10507
|
+
return /* @__PURE__ */ jsx38("div", { children: /* @__PURE__ */ jsx38(AgentEventRow, { content }) }, content.id ?? `agent-event-${index}`);
|
|
9976
10508
|
}
|
|
9977
|
-
return /* @__PURE__ */
|
|
10509
|
+
return /* @__PURE__ */ jsx38("div", { children: /* @__PURE__ */ jsx38(UnknownBlock, { content }) }, content.id ?? `unknown-${index}`);
|
|
9978
10510
|
}
|
|
9979
10511
|
function renderContentUnit(unit, message, lookupMessages, hasFollowingItem, options) {
|
|
9980
10512
|
if (unit.type === "item") {
|
|
@@ -9985,22 +10517,16 @@ function renderContentUnit(unit, message, lookupMessages, hasFollowingItem, opti
|
|
|
9985
10517
|
isAgentOutput: options?.isAgentOutput
|
|
9986
10518
|
});
|
|
9987
10519
|
}
|
|
9988
|
-
return /* @__PURE__ */
|
|
9989
|
-
|
|
10520
|
+
return /* @__PURE__ */ jsx38("div", { children: /* @__PURE__ */ jsx38(
|
|
10521
|
+
ToolComponentGroup,
|
|
9990
10522
|
{
|
|
9991
|
-
|
|
9992
|
-
|
|
9993
|
-
|
|
9994
|
-
|
|
9995
|
-
|
|
9996
|
-
|
|
9997
|
-
|
|
9998
|
-
apiUrl: options?.apiUrl
|
|
9999
|
-
}
|
|
10000
|
-
)
|
|
10001
|
-
},
|
|
10002
|
-
`tool-group-${unit.startIndex}-${unit.items[0]?.id ?? "tool"}-${unit.items.length}`
|
|
10003
|
-
);
|
|
10523
|
+
items: unit.items,
|
|
10524
|
+
hasFollowingItem,
|
|
10525
|
+
isThreadRunning: options?.isThreadRunning,
|
|
10526
|
+
organizationId: options?.organizationId,
|
|
10527
|
+
apiUrl: options?.apiUrl
|
|
10528
|
+
}
|
|
10529
|
+
) }, `tool-group-${unit.startIndex}-${unit.items[0]?.id ?? "tool"}`);
|
|
10004
10530
|
}
|
|
10005
10531
|
function renderEntryBatch(entries, message, lookupMessages, hasFollowingItem, options) {
|
|
10006
10532
|
if (entries.length === 0) return null;
|
|
@@ -10028,7 +10554,7 @@ function renderAssistantRenderUnits(units, message, lookupMessages, options, dep
|
|
|
10028
10554
|
const batch = entryBatch;
|
|
10029
10555
|
entryBatch = [];
|
|
10030
10556
|
rendered.push(
|
|
10031
|
-
/* @__PURE__ */
|
|
10557
|
+
/* @__PURE__ */ jsx38(React32.Fragment, { children: renderEntryBatch(batch, message, lookupMessages, hasFollowingItem, {
|
|
10032
10558
|
...options,
|
|
10033
10559
|
isAgentOutput: depth > 0
|
|
10034
10560
|
}) }, `entries-${batch[0]?.order ?? rendered.length}`)
|
|
@@ -10045,7 +10571,7 @@ function renderAssistantRenderUnits(units, message, lookupMessages, options, dep
|
|
|
10045
10571
|
}
|
|
10046
10572
|
flushEntries(true);
|
|
10047
10573
|
rendered.push(
|
|
10048
|
-
/* @__PURE__ */
|
|
10574
|
+
/* @__PURE__ */ jsx38(
|
|
10049
10575
|
AgentRunGroup,
|
|
10050
10576
|
{
|
|
10051
10577
|
node: unit.node,
|
|
@@ -10070,7 +10596,7 @@ function renderContent(message, lookupMessages, options) {
|
|
|
10070
10596
|
message
|
|
10071
10597
|
);
|
|
10072
10598
|
if (renderTree.hasAgentRuns) {
|
|
10073
|
-
return /* @__PURE__ */
|
|
10599
|
+
return /* @__PURE__ */ jsx38("div", { className: assistantMessageStackClassName, children: renderAssistantRenderUnits(
|
|
10074
10600
|
renderTree.units,
|
|
10075
10601
|
message,
|
|
10076
10602
|
lookupMessages,
|
|
@@ -10080,13 +10606,13 @@ function renderContent(message, lookupMessages, options) {
|
|
|
10080
10606
|
const content = message.content;
|
|
10081
10607
|
if (typeof content === "string") {
|
|
10082
10608
|
if (!content.trim()) return null;
|
|
10083
|
-
return /* @__PURE__ */
|
|
10609
|
+
return /* @__PURE__ */ jsx38(MarkdownText, { children: content });
|
|
10084
10610
|
}
|
|
10085
10611
|
if (!Array.isArray(content) || content.length === 0) return null;
|
|
10086
10612
|
const renderUnits = buildToolComponentRenderUnits(content, {
|
|
10087
10613
|
shouldGroupComponent: (item) => getRequestUserInputResultCardData(item, lookupMessages) === null
|
|
10088
10614
|
});
|
|
10089
|
-
return /* @__PURE__ */
|
|
10615
|
+
return /* @__PURE__ */ jsx38("div", { className: "space-y-3", children: renderUnits.map(
|
|
10090
10616
|
(unit, index) => renderContentUnit(
|
|
10091
10617
|
unit,
|
|
10092
10618
|
message,
|
|
@@ -10106,7 +10632,7 @@ function AssistantStreamingIndicator({
|
|
|
10106
10632
|
thinking: t("message.thinking"),
|
|
10107
10633
|
answering: t("message.answering")
|
|
10108
10634
|
};
|
|
10109
|
-
return /* @__PURE__ */
|
|
10635
|
+
return /* @__PURE__ */ jsxs25(
|
|
10110
10636
|
"div",
|
|
10111
10637
|
{
|
|
10112
10638
|
className: cn(
|
|
@@ -10114,18 +10640,18 @@ function AssistantStreamingIndicator({
|
|
|
10114
10640
|
className
|
|
10115
10641
|
),
|
|
10116
10642
|
children: [
|
|
10117
|
-
status === "loading" && /* @__PURE__ */
|
|
10118
|
-
status === "thinking" && /* @__PURE__ */
|
|
10119
|
-
/* @__PURE__ */
|
|
10120
|
-
/* @__PURE__ */
|
|
10121
|
-
/* @__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" })
|
|
10122
10648
|
] }),
|
|
10123
|
-
status === "answering" && /* @__PURE__ */
|
|
10124
|
-
/* @__PURE__ */
|
|
10125
|
-
/* @__PURE__ */
|
|
10126
|
-
/* @__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" })
|
|
10127
10653
|
] }),
|
|
10128
|
-
/* @__PURE__ */
|
|
10654
|
+
/* @__PURE__ */ jsx38("span", { children: labelMap[status] })
|
|
10129
10655
|
]
|
|
10130
10656
|
}
|
|
10131
10657
|
);
|
|
@@ -10154,42 +10680,42 @@ function AssistantMessage({
|
|
|
10154
10680
|
organizationId,
|
|
10155
10681
|
apiUrl
|
|
10156
10682
|
});
|
|
10157
|
-
const reasoningNode = hasReasoning ? /* @__PURE__ */
|
|
10683
|
+
const reasoningNode = hasReasoning ? /* @__PURE__ */ jsx38(ReasoningBlock, { reasoning: rootReasoning ?? [] }) : null;
|
|
10158
10684
|
if (!hasContent && !hasReasoning && !resolvedStreamingStatus) return null;
|
|
10159
10685
|
const streamingClass = isStreaming ? "streaming-active" : "";
|
|
10160
10686
|
if (!hasContent && !hasReasoning && resolvedStreamingStatus) {
|
|
10161
|
-
return /* @__PURE__ */
|
|
10687
|
+
return /* @__PURE__ */ jsx38("div", { className: cn("space-y-3", streamingClass, className), children: /* @__PURE__ */ jsx38(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) });
|
|
10162
10688
|
}
|
|
10163
10689
|
if (hasContent && hasReasoning) {
|
|
10164
|
-
return /* @__PURE__ */
|
|
10165
|
-
/* @__PURE__ */
|
|
10690
|
+
return /* @__PURE__ */ jsxs25("div", { className: cn("space-y-3", streamingClass, className), children: [
|
|
10691
|
+
/* @__PURE__ */ jsxs25(
|
|
10166
10692
|
Tabs,
|
|
10167
10693
|
{
|
|
10168
10694
|
defaultValue: message.status === "reasoning" ? "reasoning" : "answer",
|
|
10169
10695
|
className: "w-full",
|
|
10170
10696
|
children: [
|
|
10171
|
-
/* @__PURE__ */
|
|
10172
|
-
/* @__PURE__ */
|
|
10173
|
-
/* @__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") })
|
|
10174
10700
|
] }),
|
|
10175
|
-
/* @__PURE__ */
|
|
10176
|
-
/* @__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 })
|
|
10177
10703
|
]
|
|
10178
10704
|
}
|
|
10179
10705
|
),
|
|
10180
|
-
resolvedStreamingStatus ? /* @__PURE__ */
|
|
10706
|
+
resolvedStreamingStatus ? /* @__PURE__ */ jsx38(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) : null
|
|
10181
10707
|
] });
|
|
10182
10708
|
}
|
|
10183
|
-
return /* @__PURE__ */
|
|
10709
|
+
return /* @__PURE__ */ jsxs25("div", { className: cn("space-y-3", streamingClass, className), children: [
|
|
10184
10710
|
hasReasoning ? reasoningNode : answerNode,
|
|
10185
|
-
resolvedStreamingStatus ? /* @__PURE__ */
|
|
10711
|
+
resolvedStreamingStatus ? /* @__PURE__ */ jsx38(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) : null
|
|
10186
10712
|
] });
|
|
10187
10713
|
}
|
|
10188
10714
|
|
|
10189
10715
|
// src/components/thread/MessageActions.tsx
|
|
10190
|
-
import * as
|
|
10191
|
-
import { Check as
|
|
10192
|
-
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";
|
|
10193
10719
|
function MessageActions({
|
|
10194
10720
|
content,
|
|
10195
10721
|
isAssistant = false,
|
|
@@ -10198,7 +10724,7 @@ function MessageActions({
|
|
|
10198
10724
|
className
|
|
10199
10725
|
}) {
|
|
10200
10726
|
const { t } = useChatkitTranslation();
|
|
10201
|
-
const [copied, setCopied] =
|
|
10727
|
+
const [copied, setCopied] = React33.useState(false);
|
|
10202
10728
|
const handleCopy = async () => {
|
|
10203
10729
|
try {
|
|
10204
10730
|
await navigator.clipboard.writeText(content);
|
|
@@ -10211,7 +10737,7 @@ function MessageActions({
|
|
|
10211
10737
|
if (isStreaming) {
|
|
10212
10738
|
return null;
|
|
10213
10739
|
}
|
|
10214
|
-
return /* @__PURE__ */
|
|
10740
|
+
return /* @__PURE__ */ jsxs26(
|
|
10215
10741
|
"div",
|
|
10216
10742
|
{
|
|
10217
10743
|
className: cn(
|
|
@@ -10219,7 +10745,7 @@ function MessageActions({
|
|
|
10219
10745
|
className
|
|
10220
10746
|
),
|
|
10221
10747
|
children: [
|
|
10222
|
-
/* @__PURE__ */
|
|
10748
|
+
/* @__PURE__ */ jsx39(
|
|
10223
10749
|
"button",
|
|
10224
10750
|
{
|
|
10225
10751
|
type: "button",
|
|
@@ -10229,17 +10755,17 @@ function MessageActions({
|
|
|
10229
10755
|
copied && "text-green-500"
|
|
10230
10756
|
),
|
|
10231
10757
|
title: copied ? t("messageActions.copied") : t("messageActions.copy"),
|
|
10232
|
-
children: copied ? /* @__PURE__ */
|
|
10758
|
+
children: copied ? /* @__PURE__ */ jsx39(Check5, { size: 14 }) : /* @__PURE__ */ jsx39(Copy3, { size: 14 })
|
|
10233
10759
|
}
|
|
10234
10760
|
),
|
|
10235
|
-
isAssistant && onRetry && /* @__PURE__ */
|
|
10761
|
+
isAssistant && onRetry && /* @__PURE__ */ jsx39(
|
|
10236
10762
|
"button",
|
|
10237
10763
|
{
|
|
10238
10764
|
type: "button",
|
|
10239
10765
|
onClick: onRetry,
|
|
10240
10766
|
className: "p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",
|
|
10241
10767
|
title: t("messageActions.regenerate"),
|
|
10242
|
-
children: /* @__PURE__ */
|
|
10768
|
+
children: /* @__PURE__ */ jsx39(RefreshCw, { size: 14 })
|
|
10243
10769
|
}
|
|
10244
10770
|
)
|
|
10245
10771
|
]
|
|
@@ -10260,18 +10786,18 @@ import {
|
|
|
10260
10786
|
Sparkles as Sparkles3,
|
|
10261
10787
|
Zap
|
|
10262
10788
|
} from "lucide-react";
|
|
10263
|
-
import { jsx as
|
|
10789
|
+
import { jsx as jsx40, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
10264
10790
|
function getIconComponent2(icon) {
|
|
10265
10791
|
const iconMap = {
|
|
10266
|
-
"circle-question": /* @__PURE__ */
|
|
10267
|
-
"lightbulb": /* @__PURE__ */
|
|
10268
|
-
"sparkle": /* @__PURE__ */
|
|
10269
|
-
"write": /* @__PURE__ */
|
|
10270
|
-
"search": /* @__PURE__ */
|
|
10271
|
-
"globe": /* @__PURE__ */
|
|
10272
|
-
"book-open": /* @__PURE__ */
|
|
10273
|
-
"compass": /* @__PURE__ */
|
|
10274
|
-
"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 })
|
|
10275
10801
|
};
|
|
10276
10802
|
return icon ? iconMap[icon] || iconMap["sparkle"] : iconMap["sparkle"];
|
|
10277
10803
|
}
|
|
@@ -10279,9 +10805,9 @@ function StartScreen({ startScreen, onPromptClick, className }) {
|
|
|
10279
10805
|
const { t } = useChatkitTranslation();
|
|
10280
10806
|
const greeting = startScreen?.greeting ?? t("startScreen.greeting");
|
|
10281
10807
|
const prompts = startScreen?.prompts ?? [];
|
|
10282
|
-
return /* @__PURE__ */
|
|
10283
|
-
/* @__PURE__ */
|
|
10284
|
-
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(
|
|
10285
10811
|
"button",
|
|
10286
10812
|
{
|
|
10287
10813
|
type: "button",
|
|
@@ -10292,8 +10818,8 @@ function StartScreen({ startScreen, onPromptClick, className }) {
|
|
|
10292
10818
|
"focus:outline-none focus:ring-2 focus:ring-primary/20"
|
|
10293
10819
|
),
|
|
10294
10820
|
children: [
|
|
10295
|
-
/* @__PURE__ */
|
|
10296
|
-
/* @__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 })
|
|
10297
10823
|
]
|
|
10298
10824
|
},
|
|
10299
10825
|
`prompt-${index}`
|
|
@@ -10302,7 +10828,7 @@ function StartScreen({ startScreen, onPromptClick, className }) {
|
|
|
10302
10828
|
}
|
|
10303
10829
|
|
|
10304
10830
|
// src/hooks/useThreads.ts
|
|
10305
|
-
import * as
|
|
10831
|
+
import * as React35 from "react";
|
|
10306
10832
|
var DEFAULT_LIMIT = 50;
|
|
10307
10833
|
var getThreadTitle = (threadRecord) => {
|
|
10308
10834
|
const title = threadRecord.title?.trim();
|
|
@@ -10355,16 +10881,16 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10355
10881
|
isLoading: isStreamLoading,
|
|
10356
10882
|
error: streamError
|
|
10357
10883
|
} = useStreamContext();
|
|
10358
|
-
const [threadRecords, setThreadRecords] =
|
|
10359
|
-
const [isLoading, setIsLoading] =
|
|
10360
|
-
const [error, setError] =
|
|
10361
|
-
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) => {
|
|
10362
10888
|
setThreadRecords((prev) => {
|
|
10363
10889
|
const next = prev.filter((item) => item.id !== threadRecord.id);
|
|
10364
10890
|
return sortThreadRecords([threadRecord, ...next]);
|
|
10365
10891
|
});
|
|
10366
10892
|
}, []);
|
|
10367
|
-
const refreshThreads =
|
|
10893
|
+
const refreshThreads = React35.useCallback(async () => {
|
|
10368
10894
|
setIsLoading(true);
|
|
10369
10895
|
setError(null);
|
|
10370
10896
|
try {
|
|
@@ -10380,7 +10906,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10380
10906
|
setIsLoading(false);
|
|
10381
10907
|
}
|
|
10382
10908
|
}, [client, limit, assistantId]);
|
|
10383
|
-
const createThread =
|
|
10909
|
+
const createThread = React35.useCallback(
|
|
10384
10910
|
async (input) => {
|
|
10385
10911
|
setError(null);
|
|
10386
10912
|
const payload = {};
|
|
@@ -10394,7 +10920,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10394
10920
|
},
|
|
10395
10921
|
[client, upsertThreadRecord]
|
|
10396
10922
|
);
|
|
10397
|
-
const updateThread =
|
|
10923
|
+
const updateThread = React35.useCallback(
|
|
10398
10924
|
async (recordId, payload) => {
|
|
10399
10925
|
setError(null);
|
|
10400
10926
|
const updated = await client.conversations.update(recordId, payload);
|
|
@@ -10403,7 +10929,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10403
10929
|
},
|
|
10404
10930
|
[client, upsertThreadRecord]
|
|
10405
10931
|
);
|
|
10406
|
-
const deleteThread =
|
|
10932
|
+
const deleteThread = React35.useCallback(
|
|
10407
10933
|
async (recordId) => {
|
|
10408
10934
|
setError(null);
|
|
10409
10935
|
await client.conversations.delete(recordId);
|
|
@@ -10411,11 +10937,11 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10411
10937
|
},
|
|
10412
10938
|
[client]
|
|
10413
10939
|
);
|
|
10414
|
-
|
|
10940
|
+
React35.useEffect(() => {
|
|
10415
10941
|
if (!isReady) return;
|
|
10416
10942
|
void refreshThreads();
|
|
10417
10943
|
}, [refreshThreads, isReady]);
|
|
10418
|
-
|
|
10944
|
+
React35.useEffect(() => {
|
|
10419
10945
|
if (!threadId || !isStreamLoading) return;
|
|
10420
10946
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
10421
10947
|
const busyStatus = "busy";
|
|
@@ -10436,7 +10962,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10436
10962
|
return changed ? sortThreadRecords(next) : prev;
|
|
10437
10963
|
});
|
|
10438
10964
|
}, [threadId, isStreamLoading]);
|
|
10439
|
-
|
|
10965
|
+
React35.useEffect(() => {
|
|
10440
10966
|
const message = getErrorMessage(streamError)?.trim();
|
|
10441
10967
|
if (!threadId || !message) return;
|
|
10442
10968
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -10458,7 +10984,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10458
10984
|
return changed ? sortThreadRecords(next) : prev;
|
|
10459
10985
|
});
|
|
10460
10986
|
}, [threadId, streamError]);
|
|
10461
|
-
|
|
10987
|
+
React35.useEffect(() => {
|
|
10462
10988
|
if (!isReady || !threadId || isStreamLoading) return;
|
|
10463
10989
|
let cancelled = false;
|
|
10464
10990
|
void client.conversations.search({ where: { threadId }, limit: 1 }).then((result) => {
|
|
@@ -10472,7 +10998,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10472
10998
|
cancelled = true;
|
|
10473
10999
|
};
|
|
10474
11000
|
}, [client, threadId, upsertThreadRecord, isReady, isStreamLoading]);
|
|
10475
|
-
const threads =
|
|
11001
|
+
const threads = React35.useMemo(
|
|
10476
11002
|
() => threadRecords.map((threadRecord) => toThreadItem(threadRecord)),
|
|
10477
11003
|
[threadRecords]
|
|
10478
11004
|
);
|
|
@@ -10489,10 +11015,10 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
10489
11015
|
}
|
|
10490
11016
|
|
|
10491
11017
|
// src/components/thread/context-usage-indicator.tsx
|
|
10492
|
-
import * as
|
|
11018
|
+
import * as React36 from "react";
|
|
10493
11019
|
|
|
10494
11020
|
// src/components/ui/progress-circle.tsx
|
|
10495
|
-
import { jsx as
|
|
11021
|
+
import { jsx as jsx41, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
10496
11022
|
function clamp2(input, a, b) {
|
|
10497
11023
|
return Math.max(Math.min(input, Math.max(a, b)), Math.min(a, b));
|
|
10498
11024
|
}
|
|
@@ -10515,7 +11041,7 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
|
|
|
10515
11041
|
return (
|
|
10516
11042
|
// biome-ignore lint/a11y/useFocusableInteractive: false positive (progress + progressbar are not focusable interactives)
|
|
10517
11043
|
// biome-ignore lint/nursery/useAriaPropsSupportedByRole: biome rule at odds with mdn docs (presumed nursary bug with rule)
|
|
10518
|
-
/* @__PURE__ */
|
|
11044
|
+
/* @__PURE__ */ jsxs28(
|
|
10519
11045
|
"svg",
|
|
10520
11046
|
{
|
|
10521
11047
|
role: "progressbar",
|
|
@@ -10526,8 +11052,8 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
|
|
|
10526
11052
|
"aria-valuemax": 100,
|
|
10527
11053
|
...restSvgProps,
|
|
10528
11054
|
children: [
|
|
10529
|
-
/* @__PURE__ */
|
|
10530
|
-
/* @__PURE__ */
|
|
11055
|
+
/* @__PURE__ */ jsx41("circle", { ...commonParams, className: "stroke-current/25" }),
|
|
11056
|
+
/* @__PURE__ */ jsx41(
|
|
10531
11057
|
"circle",
|
|
10532
11058
|
{
|
|
10533
11059
|
...commonParams,
|
|
@@ -10546,7 +11072,7 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
|
|
|
10546
11072
|
};
|
|
10547
11073
|
|
|
10548
11074
|
// src/components/thread/context-usage-indicator.tsx
|
|
10549
|
-
import { jsx as
|
|
11075
|
+
import { jsx as jsx42, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
10550
11076
|
var kNumberFormatter = new Intl.NumberFormat("en-US", {
|
|
10551
11077
|
minimumFractionDigits: 0,
|
|
10552
11078
|
maximumFractionDigits: 1
|
|
@@ -10579,20 +11105,20 @@ function ContextUsageIndicator({
|
|
|
10579
11105
|
}) {
|
|
10580
11106
|
const { t } = useChatkitTranslation();
|
|
10581
11107
|
const stream = useStreamContext();
|
|
10582
|
-
const [maxContextSize, setMaxContextSize] =
|
|
10583
|
-
const [usedContextSize, setUsedContextSize] =
|
|
10584
|
-
const [assistantAgentKey, setAssistantAgentKey] =
|
|
10585
|
-
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({
|
|
10586
11112
|
threadId: null,
|
|
10587
11113
|
agentKey: null,
|
|
10588
11114
|
usedTokens: null
|
|
10589
11115
|
});
|
|
10590
|
-
const realtimeUsage =
|
|
11116
|
+
const realtimeUsage = React36.useMemo(
|
|
10591
11117
|
() => getThreadContextUsage(stream.contextUsageByAgentKey, assistantAgentKey),
|
|
10592
11118
|
[assistantAgentKey, stream.contextUsageByAgentKey]
|
|
10593
11119
|
);
|
|
10594
11120
|
const realtimeUsedContextSize = getThreadContextUsageTotalTokens(realtimeUsage);
|
|
10595
|
-
|
|
11121
|
+
React36.useEffect(() => {
|
|
10596
11122
|
if (!stream.client || !stream.assistantId) {
|
|
10597
11123
|
setMaxContextSize(null);
|
|
10598
11124
|
setAssistantAgentKey(null);
|
|
@@ -10612,18 +11138,18 @@ function ContextUsageIndicator({
|
|
|
10612
11138
|
cancelled = true;
|
|
10613
11139
|
};
|
|
10614
11140
|
}, [stream.client, stream.assistantId]);
|
|
10615
|
-
|
|
11141
|
+
React36.useEffect(() => {
|
|
10616
11142
|
latestRealtimeUsageRef.current = {
|
|
10617
11143
|
threadId: stream.threadId ?? null,
|
|
10618
11144
|
agentKey: assistantAgentKey,
|
|
10619
11145
|
usedTokens: realtimeUsedContextSize
|
|
10620
11146
|
};
|
|
10621
11147
|
}, [assistantAgentKey, realtimeUsedContextSize, stream.threadId]);
|
|
10622
|
-
|
|
11148
|
+
React36.useEffect(() => {
|
|
10623
11149
|
if (realtimeUsedContextSize == null) return;
|
|
10624
11150
|
setUsedContextSize(realtimeUsedContextSize);
|
|
10625
11151
|
}, [realtimeUsedContextSize]);
|
|
10626
|
-
|
|
11152
|
+
React36.useEffect(() => {
|
|
10627
11153
|
if (!stream.client) {
|
|
10628
11154
|
setUsedContextSize(null);
|
|
10629
11155
|
return;
|
|
@@ -10688,8 +11214,8 @@ function ContextUsageIndicator({
|
|
|
10688
11214
|
});
|
|
10689
11215
|
const usageLabelWithSuffix = usageLabel.endsWith(":") ? usageLabel : `${usageLabel}:`;
|
|
10690
11216
|
const progressClassName = percent >= 90 ? "text-destructive" : percent >= 75 ? "text-amber-500" : "text-primary dark:text-zinc-300";
|
|
10691
|
-
return /* @__PURE__ */
|
|
10692
|
-
/* @__PURE__ */
|
|
11217
|
+
return /* @__PURE__ */ jsxs29(Tooltip, { children: [
|
|
11218
|
+
/* @__PURE__ */ jsx42(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx42(
|
|
10693
11219
|
"button",
|
|
10694
11220
|
{
|
|
10695
11221
|
type: "button",
|
|
@@ -10698,31 +11224,31 @@ function ContextUsageIndicator({
|
|
|
10698
11224
|
className
|
|
10699
11225
|
),
|
|
10700
11226
|
"aria-label": `${usageLabelWithSuffix} ${usageFullLabel}. ${usageTokensLabel}`,
|
|
10701
|
-
children: /* @__PURE__ */
|
|
11227
|
+
children: /* @__PURE__ */ jsx42(ProgressCircle, { value: percent, className: cn("size-3.5", progressClassName) })
|
|
10702
11228
|
}
|
|
10703
11229
|
) }),
|
|
10704
|
-
/* @__PURE__ */
|
|
10705
|
-
/* @__PURE__ */
|
|
10706
|
-
/* @__PURE__ */
|
|
10707
|
-
/* @__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 })
|
|
10708
11234
|
] })
|
|
10709
11235
|
] });
|
|
10710
11236
|
}
|
|
10711
11237
|
|
|
10712
11238
|
// src/components/pet/PetBridge.tsx
|
|
10713
|
-
import * as
|
|
11239
|
+
import * as React37 from "react";
|
|
10714
11240
|
import { normalizePetOptions } from "@xpert-ai/chatkit-types";
|
|
10715
11241
|
function PetBridge({ pet, state }) {
|
|
10716
11242
|
const parentMessenger = useParentMessenger();
|
|
10717
11243
|
const sendEvent = parentMessenger?.sendEvent;
|
|
10718
|
-
const options =
|
|
10719
|
-
|
|
11244
|
+
const options = React37.useMemo(() => normalizePetOptions(pet), [pet]);
|
|
11245
|
+
React37.useEffect(() => {
|
|
10720
11246
|
if (!sendEvent) {
|
|
10721
11247
|
return;
|
|
10722
11248
|
}
|
|
10723
11249
|
sendEvent("pet_options_change", { pet: pet ?? null });
|
|
10724
11250
|
}, [sendEvent, pet]);
|
|
10725
|
-
|
|
11251
|
+
React37.useEffect(() => {
|
|
10726
11252
|
if (!sendEvent || !options) {
|
|
10727
11253
|
return;
|
|
10728
11254
|
}
|
|
@@ -10732,15 +11258,15 @@ function PetBridge({ pet, state }) {
|
|
|
10732
11258
|
}
|
|
10733
11259
|
|
|
10734
11260
|
// src/components/settings/SettingsSheet.tsx
|
|
10735
|
-
import * as
|
|
11261
|
+
import * as React44 from "react";
|
|
10736
11262
|
import { PawPrint, Settings } from "lucide-react";
|
|
10737
11263
|
|
|
10738
11264
|
// src/components/ui/input.tsx
|
|
10739
|
-
import * as
|
|
10740
|
-
import { jsx as
|
|
10741
|
-
var Input =
|
|
11265
|
+
import * as React38 from "react";
|
|
11266
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
11267
|
+
var Input = React38.forwardRef(
|
|
10742
11268
|
({ className, type, ...props }, ref) => {
|
|
10743
|
-
return /* @__PURE__ */
|
|
11269
|
+
return /* @__PURE__ */ jsx43(
|
|
10744
11270
|
"input",
|
|
10745
11271
|
{
|
|
10746
11272
|
ref,
|
|
@@ -10760,17 +11286,17 @@ Input.displayName = "Input";
|
|
|
10760
11286
|
import "react";
|
|
10761
11287
|
import { Select as SelectPrimitive } from "radix-ui";
|
|
10762
11288
|
import { ChevronDownIcon as ChevronDownIcon2, CheckIcon as CheckIcon4, ChevronUpIcon } from "lucide-react";
|
|
10763
|
-
import { jsx as
|
|
11289
|
+
import { jsx as jsx44, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
10764
11290
|
function Select({
|
|
10765
11291
|
...props
|
|
10766
11292
|
}) {
|
|
10767
|
-
return /* @__PURE__ */
|
|
11293
|
+
return /* @__PURE__ */ jsx44(SelectPrimitive.Root, { "data-slot": "select", ...props });
|
|
10768
11294
|
}
|
|
10769
11295
|
function SelectGroup({
|
|
10770
11296
|
className,
|
|
10771
11297
|
...props
|
|
10772
11298
|
}) {
|
|
10773
|
-
return /* @__PURE__ */
|
|
11299
|
+
return /* @__PURE__ */ jsx44(
|
|
10774
11300
|
SelectPrimitive.Group,
|
|
10775
11301
|
{
|
|
10776
11302
|
"data-slot": "select-group",
|
|
@@ -10782,7 +11308,7 @@ function SelectGroup({
|
|
|
10782
11308
|
function SelectValue({
|
|
10783
11309
|
...props
|
|
10784
11310
|
}) {
|
|
10785
|
-
return /* @__PURE__ */
|
|
11311
|
+
return /* @__PURE__ */ jsx44(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
|
|
10786
11312
|
}
|
|
10787
11313
|
function SelectTrigger({
|
|
10788
11314
|
className,
|
|
@@ -10790,7 +11316,7 @@ function SelectTrigger({
|
|
|
10790
11316
|
children,
|
|
10791
11317
|
...props
|
|
10792
11318
|
}) {
|
|
10793
|
-
return /* @__PURE__ */
|
|
11319
|
+
return /* @__PURE__ */ jsxs30(
|
|
10794
11320
|
SelectPrimitive.Trigger,
|
|
10795
11321
|
{
|
|
10796
11322
|
"data-slot": "select-trigger",
|
|
@@ -10802,7 +11328,7 @@ function SelectTrigger({
|
|
|
10802
11328
|
...props,
|
|
10803
11329
|
children: [
|
|
10804
11330
|
children,
|
|
10805
|
-
/* @__PURE__ */
|
|
11331
|
+
/* @__PURE__ */ jsx44(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx44(ChevronDownIcon2, { className: "pointer-events-none size-4 text-muted-foreground" }) })
|
|
10806
11332
|
]
|
|
10807
11333
|
}
|
|
10808
11334
|
);
|
|
@@ -10814,7 +11340,7 @@ function SelectContent({
|
|
|
10814
11340
|
align = "center",
|
|
10815
11341
|
...props
|
|
10816
11342
|
}) {
|
|
10817
|
-
return /* @__PURE__ */
|
|
11343
|
+
return /* @__PURE__ */ jsx44(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs30(
|
|
10818
11344
|
SelectPrimitive.Content,
|
|
10819
11345
|
{
|
|
10820
11346
|
"data-slot": "select-content",
|
|
@@ -10824,8 +11350,8 @@ function SelectContent({
|
|
|
10824
11350
|
align,
|
|
10825
11351
|
...props,
|
|
10826
11352
|
children: [
|
|
10827
|
-
/* @__PURE__ */
|
|
10828
|
-
/* @__PURE__ */
|
|
11353
|
+
/* @__PURE__ */ jsx44(SelectScrollUpButton, {}),
|
|
11354
|
+
/* @__PURE__ */ jsx44(
|
|
10829
11355
|
SelectPrimitive.Viewport,
|
|
10830
11356
|
{
|
|
10831
11357
|
"data-position": position,
|
|
@@ -10836,7 +11362,7 @@ function SelectContent({
|
|
|
10836
11362
|
children
|
|
10837
11363
|
}
|
|
10838
11364
|
),
|
|
10839
|
-
/* @__PURE__ */
|
|
11365
|
+
/* @__PURE__ */ jsx44(SelectScrollDownButton, {})
|
|
10840
11366
|
]
|
|
10841
11367
|
}
|
|
10842
11368
|
) });
|
|
@@ -10846,7 +11372,7 @@ function SelectItem({
|
|
|
10846
11372
|
children,
|
|
10847
11373
|
...props
|
|
10848
11374
|
}) {
|
|
10849
|
-
return /* @__PURE__ */
|
|
11375
|
+
return /* @__PURE__ */ jsxs30(
|
|
10850
11376
|
SelectPrimitive.Item,
|
|
10851
11377
|
{
|
|
10852
11378
|
"data-slot": "select-item",
|
|
@@ -10856,8 +11382,8 @@ function SelectItem({
|
|
|
10856
11382
|
),
|
|
10857
11383
|
...props,
|
|
10858
11384
|
children: [
|
|
10859
|
-
/* @__PURE__ */
|
|
10860
|
-
/* @__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 })
|
|
10861
11387
|
]
|
|
10862
11388
|
}
|
|
10863
11389
|
);
|
|
@@ -10866,7 +11392,7 @@ function SelectScrollUpButton({
|
|
|
10866
11392
|
className,
|
|
10867
11393
|
...props
|
|
10868
11394
|
}) {
|
|
10869
|
-
return /* @__PURE__ */
|
|
11395
|
+
return /* @__PURE__ */ jsx44(
|
|
10870
11396
|
SelectPrimitive.ScrollUpButton,
|
|
10871
11397
|
{
|
|
10872
11398
|
"data-slot": "select-scroll-up-button",
|
|
@@ -10875,7 +11401,7 @@ function SelectScrollUpButton({
|
|
|
10875
11401
|
className
|
|
10876
11402
|
),
|
|
10877
11403
|
...props,
|
|
10878
|
-
children: /* @__PURE__ */
|
|
11404
|
+
children: /* @__PURE__ */ jsx44(
|
|
10879
11405
|
ChevronUpIcon,
|
|
10880
11406
|
{}
|
|
10881
11407
|
)
|
|
@@ -10886,7 +11412,7 @@ function SelectScrollDownButton({
|
|
|
10886
11412
|
className,
|
|
10887
11413
|
...props
|
|
10888
11414
|
}) {
|
|
10889
|
-
return /* @__PURE__ */
|
|
11415
|
+
return /* @__PURE__ */ jsx44(
|
|
10890
11416
|
SelectPrimitive.ScrollDownButton,
|
|
10891
11417
|
{
|
|
10892
11418
|
"data-slot": "select-scroll-down-button",
|
|
@@ -10895,7 +11421,7 @@ function SelectScrollDownButton({
|
|
|
10895
11421
|
className
|
|
10896
11422
|
),
|
|
10897
11423
|
...props,
|
|
10898
|
-
children: /* @__PURE__ */
|
|
11424
|
+
children: /* @__PURE__ */ jsx44(
|
|
10899
11425
|
ChevronDownIcon2,
|
|
10900
11426
|
{}
|
|
10901
11427
|
)
|
|
@@ -10904,9 +11430,9 @@ function SelectScrollDownButton({
|
|
|
10904
11430
|
}
|
|
10905
11431
|
|
|
10906
11432
|
// src/components/ui/slider.tsx
|
|
10907
|
-
import * as
|
|
11433
|
+
import * as React40 from "react";
|
|
10908
11434
|
import { Slider as SliderPrimitive } from "radix-ui";
|
|
10909
|
-
import { jsx as
|
|
11435
|
+
import { jsx as jsx45, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
10910
11436
|
function Slider({
|
|
10911
11437
|
className,
|
|
10912
11438
|
defaultValue,
|
|
@@ -10915,11 +11441,11 @@ function Slider({
|
|
|
10915
11441
|
max = 100,
|
|
10916
11442
|
...props
|
|
10917
11443
|
}) {
|
|
10918
|
-
const _values =
|
|
11444
|
+
const _values = React40.useMemo(
|
|
10919
11445
|
() => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
|
|
10920
11446
|
[value, defaultValue, min, max]
|
|
10921
11447
|
);
|
|
10922
|
-
return /* @__PURE__ */
|
|
11448
|
+
return /* @__PURE__ */ jsxs31(
|
|
10923
11449
|
SliderPrimitive.Root,
|
|
10924
11450
|
{
|
|
10925
11451
|
"data-slot": "slider",
|
|
@@ -10933,12 +11459,12 @@ function Slider({
|
|
|
10933
11459
|
),
|
|
10934
11460
|
...props,
|
|
10935
11461
|
children: [
|
|
10936
|
-
/* @__PURE__ */
|
|
11462
|
+
/* @__PURE__ */ jsx45(
|
|
10937
11463
|
SliderPrimitive.Track,
|
|
10938
11464
|
{
|
|
10939
11465
|
"data-slot": "slider-track",
|
|
10940
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",
|
|
10941
|
-
children: /* @__PURE__ */
|
|
11467
|
+
children: /* @__PURE__ */ jsx45(
|
|
10942
11468
|
SliderPrimitive.Range,
|
|
10943
11469
|
{
|
|
10944
11470
|
"data-slot": "slider-range",
|
|
@@ -10947,7 +11473,7 @@ function Slider({
|
|
|
10947
11473
|
)
|
|
10948
11474
|
}
|
|
10949
11475
|
),
|
|
10950
|
-
Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */
|
|
11476
|
+
Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */ jsx45(
|
|
10951
11477
|
SliderPrimitive.Thumb,
|
|
10952
11478
|
{
|
|
10953
11479
|
"data-slot": "slider-thumb",
|
|
@@ -10961,7 +11487,7 @@ function Slider({
|
|
|
10961
11487
|
}
|
|
10962
11488
|
|
|
10963
11489
|
// src/components/ui/toggle-group.tsx
|
|
10964
|
-
import * as
|
|
11490
|
+
import * as React42 from "react";
|
|
10965
11491
|
import "class-variance-authority";
|
|
10966
11492
|
import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui";
|
|
10967
11493
|
|
|
@@ -10969,7 +11495,7 @@ import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui";
|
|
|
10969
11495
|
import "react";
|
|
10970
11496
|
import { cva as cva2 } from "class-variance-authority";
|
|
10971
11497
|
import { Toggle as TogglePrimitive } from "radix-ui";
|
|
10972
|
-
import { jsx as
|
|
11498
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
10973
11499
|
var toggleVariants = cva2(
|
|
10974
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",
|
|
10975
11501
|
{
|
|
@@ -10992,8 +11518,8 @@ var toggleVariants = cva2(
|
|
|
10992
11518
|
);
|
|
10993
11519
|
|
|
10994
11520
|
// src/components/ui/toggle-group.tsx
|
|
10995
|
-
import { jsx as
|
|
10996
|
-
var ToggleGroupContext =
|
|
11521
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
11522
|
+
var ToggleGroupContext = React42.createContext({
|
|
10997
11523
|
size: "default",
|
|
10998
11524
|
variant: "default",
|
|
10999
11525
|
spacing: 0,
|
|
@@ -11008,7 +11534,7 @@ function ToggleGroup({
|
|
|
11008
11534
|
children,
|
|
11009
11535
|
...props
|
|
11010
11536
|
}) {
|
|
11011
|
-
return /* @__PURE__ */
|
|
11537
|
+
return /* @__PURE__ */ jsx47(
|
|
11012
11538
|
ToggleGroupPrimitive.Root,
|
|
11013
11539
|
{
|
|
11014
11540
|
"data-slot": "toggle-group",
|
|
@@ -11022,7 +11548,7 @@ function ToggleGroup({
|
|
|
11022
11548
|
className
|
|
11023
11549
|
),
|
|
11024
11550
|
...props,
|
|
11025
|
-
children: /* @__PURE__ */
|
|
11551
|
+
children: /* @__PURE__ */ jsx47(
|
|
11026
11552
|
ToggleGroupContext.Provider,
|
|
11027
11553
|
{
|
|
11028
11554
|
value: { variant, size: size2, spacing, orientation },
|
|
@@ -11039,8 +11565,8 @@ function ToggleGroupItem({
|
|
|
11039
11565
|
size: size2 = "default",
|
|
11040
11566
|
...props
|
|
11041
11567
|
}) {
|
|
11042
|
-
const context =
|
|
11043
|
-
return /* @__PURE__ */
|
|
11568
|
+
const context = React42.useContext(ToggleGroupContext);
|
|
11569
|
+
return /* @__PURE__ */ jsx47(
|
|
11044
11570
|
ToggleGroupPrimitive.Item,
|
|
11045
11571
|
{
|
|
11046
11572
|
"data-slot": "toggle-group-item",
|
|
@@ -11280,7 +11806,7 @@ import {
|
|
|
11280
11806
|
} from "@xpert-ai/chatkit-types";
|
|
11281
11807
|
|
|
11282
11808
|
// src/components/pet/PetPreview.tsx
|
|
11283
|
-
import { jsx as
|
|
11809
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
11284
11810
|
function escapeCssUrl(value) {
|
|
11285
11811
|
return value.replace(/["\\]/g, "\\$&");
|
|
11286
11812
|
}
|
|
@@ -11288,7 +11814,7 @@ function PetPreview({ src, label, className }) {
|
|
|
11288
11814
|
const scale = 0.13;
|
|
11289
11815
|
const width = petSpriteAtlas.cellWidth;
|
|
11290
11816
|
const height = petSpriteAtlas.cellHeight;
|
|
11291
|
-
return /* @__PURE__ */
|
|
11817
|
+
return /* @__PURE__ */ jsx48(
|
|
11292
11818
|
"span",
|
|
11293
11819
|
{
|
|
11294
11820
|
className: cn(
|
|
@@ -11297,7 +11823,7 @@ function PetPreview({ src, label, className }) {
|
|
|
11297
11823
|
),
|
|
11298
11824
|
"aria-hidden": "true",
|
|
11299
11825
|
title: label,
|
|
11300
|
-
children: /* @__PURE__ */
|
|
11826
|
+
children: /* @__PURE__ */ jsx48(
|
|
11301
11827
|
"span",
|
|
11302
11828
|
{
|
|
11303
11829
|
className: "absolute left-1/2 top-1/2 block",
|
|
@@ -11319,7 +11845,7 @@ function PetPreview({ src, label, className }) {
|
|
|
11319
11845
|
}
|
|
11320
11846
|
|
|
11321
11847
|
// src/components/settings/SettingsSheet.tsx
|
|
11322
|
-
import { jsx as
|
|
11848
|
+
import { jsx as jsx49, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
11323
11849
|
var CHARACTER_TYPES2 = [
|
|
11324
11850
|
"builtin",
|
|
11325
11851
|
"atlas"
|
|
@@ -11335,13 +11861,13 @@ function SettingsSheet({
|
|
|
11335
11861
|
onSave
|
|
11336
11862
|
}) {
|
|
11337
11863
|
const { t } = useChatkitTranslation();
|
|
11338
|
-
const [draft, setDraft] =
|
|
11339
|
-
|
|
11864
|
+
const [draft, setDraft] = React44.useState(settings);
|
|
11865
|
+
React44.useEffect(() => {
|
|
11340
11866
|
if (open) {
|
|
11341
11867
|
setDraft(petRequired ? { ...settings, enabled: true } : settings);
|
|
11342
11868
|
}
|
|
11343
11869
|
}, [open, petRequired, settings]);
|
|
11344
|
-
const updateDraft =
|
|
11870
|
+
const updateDraft = React44.useCallback(
|
|
11345
11871
|
(patch) => {
|
|
11346
11872
|
setDraft((previous) => ({ ...previous, ...patch }));
|
|
11347
11873
|
},
|
|
@@ -11359,23 +11885,23 @@ function SettingsSheet({
|
|
|
11359
11885
|
defaultValue: selectedBuiltinPet.label
|
|
11360
11886
|
}
|
|
11361
11887
|
);
|
|
11362
|
-
return /* @__PURE__ */
|
|
11363
|
-
/* @__PURE__ */
|
|
11364
|
-
/* @__PURE__ */
|
|
11365
|
-
/* @__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") })
|
|
11366
11892
|
] }) }),
|
|
11367
|
-
/* @__PURE__ */
|
|
11368
|
-
/* @__PURE__ */
|
|
11369
|
-
/* @__PURE__ */
|
|
11370
|
-
/* @__PURE__ */
|
|
11371
|
-
/* @__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") })
|
|
11372
11898
|
] }),
|
|
11373
|
-
/* @__PURE__ */
|
|
11374
|
-
/* @__PURE__ */
|
|
11375
|
-
/* @__PURE__ */
|
|
11376
|
-
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") })
|
|
11377
11903
|
] }),
|
|
11378
|
-
/* @__PURE__ */
|
|
11904
|
+
/* @__PURE__ */ jsx49(
|
|
11379
11905
|
"button",
|
|
11380
11906
|
{
|
|
11381
11907
|
type: "button",
|
|
@@ -11388,7 +11914,7 @@ function SettingsSheet({
|
|
|
11388
11914
|
draft.enabled ? "bg-primary" : "bg-muted-foreground/20",
|
|
11389
11915
|
petRequired ? "cursor-not-allowed opacity-70" : ""
|
|
11390
11916
|
].join(" "),
|
|
11391
|
-
children: /* @__PURE__ */
|
|
11917
|
+
children: /* @__PURE__ */ jsx49(
|
|
11392
11918
|
"span",
|
|
11393
11919
|
{
|
|
11394
11920
|
className: [
|
|
@@ -11401,9 +11927,9 @@ function SettingsSheet({
|
|
|
11401
11927
|
)
|
|
11402
11928
|
] })
|
|
11403
11929
|
] }),
|
|
11404
|
-
/* @__PURE__ */
|
|
11405
|
-
/* @__PURE__ */
|
|
11406
|
-
/* @__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(
|
|
11407
11933
|
ToggleGroup,
|
|
11408
11934
|
{
|
|
11409
11935
|
id: "chatkit-pet-type",
|
|
@@ -11418,7 +11944,7 @@ function SettingsSheet({
|
|
|
11418
11944
|
variant: "outline",
|
|
11419
11945
|
spacing: 2,
|
|
11420
11946
|
className: "!w-full",
|
|
11421
|
-
children: CHARACTER_TYPES2.map((type) => /* @__PURE__ */
|
|
11947
|
+
children: CHARACTER_TYPES2.map((type) => /* @__PURE__ */ jsx49(
|
|
11422
11948
|
ToggleGroupItem,
|
|
11423
11949
|
{
|
|
11424
11950
|
value: type,
|
|
@@ -11430,8 +11956,8 @@ function SettingsSheet({
|
|
|
11430
11956
|
}
|
|
11431
11957
|
)
|
|
11432
11958
|
] }),
|
|
11433
|
-
draft.characterType === "builtin" && /* @__PURE__ */
|
|
11434
|
-
/* @__PURE__ */
|
|
11959
|
+
draft.characterType === "builtin" && /* @__PURE__ */ jsxs32("div", { className: "space-y-2", children: [
|
|
11960
|
+
/* @__PURE__ */ jsx49(
|
|
11435
11961
|
"label",
|
|
11436
11962
|
{
|
|
11437
11963
|
htmlFor: "chatkit-pet-builtin",
|
|
@@ -11439,7 +11965,7 @@ function SettingsSheet({
|
|
|
11439
11965
|
children: t("pet.settings.builtin")
|
|
11440
11966
|
}
|
|
11441
11967
|
),
|
|
11442
|
-
/* @__PURE__ */
|
|
11968
|
+
/* @__PURE__ */ jsxs32(
|
|
11443
11969
|
Select,
|
|
11444
11970
|
{
|
|
11445
11971
|
value: selectedBuiltinPet.id,
|
|
@@ -11450,26 +11976,26 @@ function SettingsSheet({
|
|
|
11450
11976
|
}
|
|
11451
11977
|
},
|
|
11452
11978
|
children: [
|
|
11453
|
-
/* @__PURE__ */
|
|
11979
|
+
/* @__PURE__ */ jsx49(
|
|
11454
11980
|
SelectTrigger,
|
|
11455
11981
|
{
|
|
11456
11982
|
id: "chatkit-pet-builtin",
|
|
11457
11983
|
className: "min-h-12 w-full px-3 py-2",
|
|
11458
|
-
children: /* @__PURE__ */
|
|
11984
|
+
children: /* @__PURE__ */ jsx49(SelectValue, { placeholder: selectedBuiltinPetLabel })
|
|
11459
11985
|
}
|
|
11460
11986
|
),
|
|
11461
|
-
/* @__PURE__ */
|
|
11987
|
+
/* @__PURE__ */ jsx49(SelectContent, { className: "w-[var(--radix-select-trigger-width)]", children: /* @__PURE__ */ jsx49(SelectGroup, { children: INCLUDED_PET_OPTIONS.map((pet) => {
|
|
11462
11988
|
const label = t(`pet.settings.builtins.${pet.id}`, {
|
|
11463
11989
|
defaultValue: pet.label
|
|
11464
11990
|
});
|
|
11465
|
-
return /* @__PURE__ */
|
|
11991
|
+
return /* @__PURE__ */ jsx49(
|
|
11466
11992
|
SelectItem,
|
|
11467
11993
|
{
|
|
11468
11994
|
value: pet.id,
|
|
11469
11995
|
className: "min-h-10 py-1.5 pl-2 pr-8",
|
|
11470
|
-
children: /* @__PURE__ */
|
|
11471
|
-
/* @__PURE__ */
|
|
11472
|
-
/* @__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 })
|
|
11473
11999
|
] })
|
|
11474
12000
|
},
|
|
11475
12001
|
pet.id
|
|
@@ -11479,8 +12005,8 @@ function SettingsSheet({
|
|
|
11479
12005
|
}
|
|
11480
12006
|
)
|
|
11481
12007
|
] }),
|
|
11482
|
-
draft.characterType === "atlas" && /* @__PURE__ */
|
|
11483
|
-
/* @__PURE__ */
|
|
12008
|
+
draft.characterType === "atlas" && /* @__PURE__ */ jsxs32("div", { className: "space-y-2", children: [
|
|
12009
|
+
/* @__PURE__ */ jsx49(
|
|
11484
12010
|
"label",
|
|
11485
12011
|
{
|
|
11486
12012
|
className: "text-sm font-medium",
|
|
@@ -11488,7 +12014,7 @@ function SettingsSheet({
|
|
|
11488
12014
|
children: t("pet.settings.atlasUrl")
|
|
11489
12015
|
}
|
|
11490
12016
|
),
|
|
11491
|
-
/* @__PURE__ */
|
|
12017
|
+
/* @__PURE__ */ jsx49(
|
|
11492
12018
|
Input,
|
|
11493
12019
|
{
|
|
11494
12020
|
id: "chatkit-pet-atlas",
|
|
@@ -11498,15 +12024,15 @@ function SettingsSheet({
|
|
|
11498
12024
|
}
|
|
11499
12025
|
)
|
|
11500
12026
|
] }),
|
|
11501
|
-
/* @__PURE__ */
|
|
11502
|
-
/* @__PURE__ */
|
|
11503
|
-
/* @__PURE__ */
|
|
11504
|
-
/* @__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: [
|
|
11505
12031
|
draft.scale.toFixed(2),
|
|
11506
12032
|
"x"
|
|
11507
12033
|
] })
|
|
11508
12034
|
] }),
|
|
11509
|
-
/* @__PURE__ */
|
|
12035
|
+
/* @__PURE__ */ jsx49(
|
|
11510
12036
|
Slider,
|
|
11511
12037
|
{
|
|
11512
12038
|
id: "chatkit-pet-scale",
|
|
@@ -11520,8 +12046,8 @@ function SettingsSheet({
|
|
|
11520
12046
|
}
|
|
11521
12047
|
)
|
|
11522
12048
|
] }),
|
|
11523
|
-
/* @__PURE__ */
|
|
11524
|
-
/* @__PURE__ */
|
|
12049
|
+
/* @__PURE__ */ jsxs32("label", { className: "flex items-center gap-2 text-sm", children: [
|
|
12050
|
+
/* @__PURE__ */ jsx49(
|
|
11525
12051
|
"input",
|
|
11526
12052
|
{
|
|
11527
12053
|
type: "checkbox",
|
|
@@ -11532,8 +12058,8 @@ function SettingsSheet({
|
|
|
11532
12058
|
),
|
|
11533
12059
|
t("pet.settings.draggable")
|
|
11534
12060
|
] }),
|
|
11535
|
-
/* @__PURE__ */
|
|
11536
|
-
/* @__PURE__ */
|
|
12061
|
+
/* @__PURE__ */ jsxs32("label", { className: "flex items-center gap-2 text-sm", children: [
|
|
12062
|
+
/* @__PURE__ */ jsx49(
|
|
11537
12063
|
"input",
|
|
11538
12064
|
{
|
|
11539
12065
|
type: "checkbox",
|
|
@@ -11544,8 +12070,8 @@ function SettingsSheet({
|
|
|
11544
12070
|
),
|
|
11545
12071
|
t("pet.settings.persistPosition")
|
|
11546
12072
|
] }),
|
|
11547
|
-
/* @__PURE__ */
|
|
11548
|
-
/* @__PURE__ */
|
|
12073
|
+
/* @__PURE__ */ jsxs32("div", { className: "flex justify-end gap-2 pt-2", children: [
|
|
12074
|
+
/* @__PURE__ */ jsx49(
|
|
11549
12075
|
Button,
|
|
11550
12076
|
{
|
|
11551
12077
|
type: "button",
|
|
@@ -11554,7 +12080,7 @@ function SettingsSheet({
|
|
|
11554
12080
|
children: t("pet.settings.cancel")
|
|
11555
12081
|
}
|
|
11556
12082
|
),
|
|
11557
|
-
/* @__PURE__ */
|
|
12083
|
+
/* @__PURE__ */ jsx49(Button, { type: "submit", children: t("pet.settings.save") })
|
|
11558
12084
|
] })
|
|
11559
12085
|
] })
|
|
11560
12086
|
] }) });
|
|
@@ -12060,7 +12586,7 @@ function findDomPointForComposerOffset(root, offset) {
|
|
|
12060
12586
|
}
|
|
12061
12587
|
|
|
12062
12588
|
// src/components/chat.tsx
|
|
12063
|
-
import { Fragment as Fragment7, jsx as
|
|
12589
|
+
import { Fragment as Fragment7, jsx as jsx50, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
12064
12590
|
var defaultApiUrl2 = import.meta.env.VITE_XPERTAI_API_URL;
|
|
12065
12591
|
var COMPOSER_INPUT_MAX_HEIGHT = 128;
|
|
12066
12592
|
var LONG_TEXT_REFERENCE_THRESHOLD = 5e3;
|
|
@@ -12193,7 +12719,7 @@ function ReferenceChip({
|
|
|
12193
12719
|
const metaLine = getReferenceMetaLine(reference);
|
|
12194
12720
|
const isComposer = variant === "composer";
|
|
12195
12721
|
const Icon = reference.type === "quote" ? Quote : reference.type === "image" ? ImageIcon : FileText3;
|
|
12196
|
-
return /* @__PURE__ */
|
|
12722
|
+
return /* @__PURE__ */ jsxs33(
|
|
12197
12723
|
"div",
|
|
12198
12724
|
{
|
|
12199
12725
|
className: cn(
|
|
@@ -12202,7 +12728,7 @@ function ReferenceChip({
|
|
|
12202
12728
|
),
|
|
12203
12729
|
title: getReferenceTitle(reference),
|
|
12204
12730
|
children: [
|
|
12205
|
-
/* @__PURE__ */
|
|
12731
|
+
/* @__PURE__ */ jsx50(
|
|
12206
12732
|
Icon,
|
|
12207
12733
|
{
|
|
12208
12734
|
size: isComposer ? 14 : 12,
|
|
@@ -12212,8 +12738,8 @@ function ReferenceChip({
|
|
|
12212
12738
|
)
|
|
12213
12739
|
}
|
|
12214
12740
|
),
|
|
12215
|
-
/* @__PURE__ */
|
|
12216
|
-
/* @__PURE__ */
|
|
12741
|
+
/* @__PURE__ */ jsxs33("div", { className: "min-w-0 flex-1", children: [
|
|
12742
|
+
/* @__PURE__ */ jsx50(
|
|
12217
12743
|
"div",
|
|
12218
12744
|
{
|
|
12219
12745
|
className: cn(
|
|
@@ -12223,7 +12749,7 @@ function ReferenceChip({
|
|
|
12223
12749
|
children: getReferenceLabel(reference)
|
|
12224
12750
|
}
|
|
12225
12751
|
),
|
|
12226
|
-
metaLine && /* @__PURE__ */
|
|
12752
|
+
metaLine && /* @__PURE__ */ jsx50(
|
|
12227
12753
|
"div",
|
|
12228
12754
|
{
|
|
12229
12755
|
className: cn(
|
|
@@ -12234,7 +12760,7 @@ function ReferenceChip({
|
|
|
12234
12760
|
}
|
|
12235
12761
|
)
|
|
12236
12762
|
] }),
|
|
12237
|
-
onRemove && removeLabel && /* @__PURE__ */
|
|
12763
|
+
onRemove && removeLabel && /* @__PURE__ */ jsx50(
|
|
12238
12764
|
"button",
|
|
12239
12765
|
{
|
|
12240
12766
|
type: "button",
|
|
@@ -12245,7 +12771,7 @@ function ReferenceChip({
|
|
|
12245
12771
|
),
|
|
12246
12772
|
title: removeLabel,
|
|
12247
12773
|
"aria-label": removeLabel,
|
|
12248
|
-
children: /* @__PURE__ */
|
|
12774
|
+
children: /* @__PURE__ */ jsx50(X5, { size: 12 })
|
|
12249
12775
|
}
|
|
12250
12776
|
)
|
|
12251
12777
|
]
|
|
@@ -12269,20 +12795,20 @@ function Chat({
|
|
|
12269
12795
|
const { setStream } = useStreamManager();
|
|
12270
12796
|
const stream = useStreamContext();
|
|
12271
12797
|
const { theme } = useTheme();
|
|
12272
|
-
const [isHistoryLoading, setIsHistoryLoading] =
|
|
12273
|
-
const [historyError, setHistoryError] =
|
|
12274
|
-
const [assistantName, setAssistantName] =
|
|
12275
|
-
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);
|
|
12276
12802
|
const LOADING_DOTS_MIN_DURATION = 800;
|
|
12277
12803
|
const STREAMING_STATUS_REFRESH_MS = 250;
|
|
12278
|
-
const [showLoadingDots, setShowLoadingDots] =
|
|
12279
|
-
const [streamingNow, setStreamingNow] =
|
|
12280
|
-
const loadingStartTimeRef =
|
|
12281
|
-
const lastStreamOutputAtRef =
|
|
12282
|
-
|
|
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(() => {
|
|
12283
12809
|
setStream(stream);
|
|
12284
12810
|
}, [setStream, stream]);
|
|
12285
|
-
|
|
12811
|
+
React45.useEffect(() => {
|
|
12286
12812
|
if (stream.isLoading) {
|
|
12287
12813
|
if (!loadingStartTimeRef.current) {
|
|
12288
12814
|
loadingStartTimeRef.current = Date.now();
|
|
@@ -12305,7 +12831,7 @@ function Chat({
|
|
|
12305
12831
|
}
|
|
12306
12832
|
}
|
|
12307
12833
|
}, [stream.isLoading]);
|
|
12308
|
-
|
|
12834
|
+
React45.useEffect(() => {
|
|
12309
12835
|
if (!stream.isLoading) {
|
|
12310
12836
|
lastStreamOutputAtRef.current = null;
|
|
12311
12837
|
setStreamingNow(Date.now());
|
|
@@ -12315,7 +12841,7 @@ function Chat({
|
|
|
12315
12841
|
lastStreamOutputAtRef.current = now;
|
|
12316
12842
|
setStreamingNow(now);
|
|
12317
12843
|
}, [stream.messages, stream.isLoading]);
|
|
12318
|
-
|
|
12844
|
+
React45.useEffect(() => {
|
|
12319
12845
|
if (!stream.isLoading) {
|
|
12320
12846
|
return;
|
|
12321
12847
|
}
|
|
@@ -12324,74 +12850,74 @@ function Chat({
|
|
|
12324
12850
|
}, STREAMING_STATUS_REFRESH_MS);
|
|
12325
12851
|
return () => window.clearInterval(timer);
|
|
12326
12852
|
}, [stream.isLoading]);
|
|
12327
|
-
const [composerParts, setComposerParts] =
|
|
12328
|
-
const [renderedComposerParts, setRenderedComposerParts] =
|
|
12329
|
-
const [composerDomVersion, setComposerDomVersion] =
|
|
12330
|
-
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(
|
|
12331
12857
|
null
|
|
12332
12858
|
);
|
|
12333
|
-
const [planModeEnabled, setPlanModeEnabled] =
|
|
12334
|
-
const [petSettingsOpen, setPetSettingsOpen] =
|
|
12335
|
-
const [petLocalSettings, setPetLocalSettings] =
|
|
12336
|
-
const [runtimeCapabilities, setRuntimeCapabilities] =
|
|
12337
|
-
const [runtimeCapabilitiesReady, setRuntimeCapabilitiesReady] =
|
|
12338
|
-
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(
|
|
12339
12865
|
() => createEmptyRuntimeCapabilitiesSelection()
|
|
12340
12866
|
);
|
|
12341
|
-
const [runRuntimeCapabilities, setRunRuntimeCapabilities] =
|
|
12867
|
+
const [runRuntimeCapabilities, setRunRuntimeCapabilities] = React45.useState(
|
|
12342
12868
|
() => createEmptyRuntimeCapabilitiesSelection()
|
|
12343
12869
|
);
|
|
12344
|
-
const [runtimeCapabilityPalette, setRuntimeCapabilityPalette] =
|
|
12345
|
-
const [attachments, setAttachments] =
|
|
12346
|
-
const [references, setReferences] =
|
|
12347
|
-
const [isUploadingReferenceImages, setIsUploadingReferenceImages] =
|
|
12348
|
-
const [quoteSelection, setQuoteSelection] =
|
|
12349
|
-
const [isAtBottom, setIsAtBottom] =
|
|
12350
|
-
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);
|
|
12351
12877
|
const {
|
|
12352
12878
|
threads,
|
|
12353
12879
|
deleteThread,
|
|
12354
12880
|
refreshThreads,
|
|
12355
12881
|
isLoading: isThreadsLoading
|
|
12356
12882
|
} = useThreads();
|
|
12357
|
-
const viewportRef =
|
|
12358
|
-
const fileInputRef =
|
|
12359
|
-
const composerInputRef =
|
|
12360
|
-
const slashPaletteRef =
|
|
12361
|
-
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(
|
|
12362
12888
|
[]
|
|
12363
12889
|
);
|
|
12364
|
-
const composerPartsRef =
|
|
12365
|
-
const pendingComposerCaretOffsetRef =
|
|
12366
|
-
const shouldAutoScrollRef =
|
|
12367
|
-
const forceFollowRef =
|
|
12368
|
-
const previousMessageCountRef =
|
|
12369
|
-
const previousScrollTopRef =
|
|
12370
|
-
const autoScrollFrameRef =
|
|
12371
|
-
const isPointerDownRef =
|
|
12372
|
-
const lastTouchYRef =
|
|
12373
|
-
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);
|
|
12374
12900
|
const resolvedTitle = title ?? t("chat.title");
|
|
12375
12901
|
const resolvedPlaceholder = placeholder ?? t("chat.placeholder");
|
|
12376
12902
|
const petRequired = options?.displayMode === "pet";
|
|
12377
|
-
const basePetSettings =
|
|
12903
|
+
const basePetSettings = React45.useMemo(
|
|
12378
12904
|
() => derivePetLocalSettings(options?.pet),
|
|
12379
12905
|
[options?.pet]
|
|
12380
12906
|
);
|
|
12381
|
-
const displayedPetSettings =
|
|
12907
|
+
const displayedPetSettings = React45.useMemo(
|
|
12382
12908
|
() => ({
|
|
12383
12909
|
...petLocalSettings ?? basePetSettings,
|
|
12384
12910
|
...petRequired ? { enabled: true } : {}
|
|
12385
12911
|
}),
|
|
12386
12912
|
[basePetSettings, petLocalSettings, petRequired]
|
|
12387
12913
|
);
|
|
12388
|
-
const effectivePet =
|
|
12914
|
+
const effectivePet = React45.useMemo(() => {
|
|
12389
12915
|
if (petRequired || petLocalSettings) {
|
|
12390
12916
|
return buildPetOptionsFromLocalSettings(displayedPetSettings);
|
|
12391
12917
|
}
|
|
12392
12918
|
return options?.pet ?? null;
|
|
12393
12919
|
}, [displayedPetSettings, options?.pet, petLocalSettings, petRequired]);
|
|
12394
|
-
const savePetLocalSettings =
|
|
12920
|
+
const savePetLocalSettings = React45.useCallback(
|
|
12395
12921
|
(settings) => {
|
|
12396
12922
|
const nextSettings = petRequired ? { ...settings, enabled: true } : settings;
|
|
12397
12923
|
setPetLocalSettings(nextSettings);
|
|
@@ -12399,7 +12925,7 @@ function Chat({
|
|
|
12399
12925
|
},
|
|
12400
12926
|
[petRequired]
|
|
12401
12927
|
);
|
|
12402
|
-
const handlePetCommand =
|
|
12928
|
+
const handlePetCommand = React45.useCallback(
|
|
12403
12929
|
(mode) => {
|
|
12404
12930
|
if (mode === "settings") {
|
|
12405
12931
|
setPetSettingsOpen(true);
|
|
@@ -12421,11 +12947,11 @@ function Chat({
|
|
|
12421
12947
|
[displayedPetSettings, effectivePet, petRequired, savePetLocalSettings]
|
|
12422
12948
|
);
|
|
12423
12949
|
const inputPlaceholder = selectedTool?.placeholderOverride ?? composer?.placeholder ?? resolvedPlaceholder;
|
|
12424
|
-
const messages =
|
|
12950
|
+
const messages = React45.useMemo(
|
|
12425
12951
|
() => stream.messages ?? [],
|
|
12426
12952
|
[stream.messages]
|
|
12427
12953
|
);
|
|
12428
|
-
const draft =
|
|
12954
|
+
const draft = React45.useMemo(
|
|
12429
12955
|
() => getComposerPlainText(composerParts),
|
|
12430
12956
|
[composerParts]
|
|
12431
12957
|
);
|
|
@@ -12437,7 +12963,7 @@ function Chat({
|
|
|
12437
12963
|
isEmpty: isComposerInputEmpty,
|
|
12438
12964
|
isStacked: isComposerStacked
|
|
12439
12965
|
});
|
|
12440
|
-
const pendingFollowUps =
|
|
12966
|
+
const pendingFollowUps = React45.useMemo(
|
|
12441
12967
|
() => [...stream.pendingFollowUps ?? []].sort(
|
|
12442
12968
|
(a, b) => a.createdAt - b.createdAt
|
|
12443
12969
|
),
|
|
@@ -12448,18 +12974,18 @@ function Chat({
|
|
|
12448
12974
|
const hasPendingHITLRequest = Boolean(stream.pendingHITLRequest);
|
|
12449
12975
|
const hasPendingInteractiveRequest = hasPendingRequestUserInput || hasPendingHITLRequest;
|
|
12450
12976
|
const hasPendingTodos = Boolean(stream.todos?.items.length);
|
|
12451
|
-
const runtimeCapabilityOptions =
|
|
12977
|
+
const runtimeCapabilityOptions = React45.useMemo(
|
|
12452
12978
|
() => getRuntimeCapabilityOptions(runtimeCapabilities),
|
|
12453
12979
|
[runtimeCapabilities]
|
|
12454
12980
|
);
|
|
12455
|
-
const effectiveSessionRuntimeCapabilities =
|
|
12981
|
+
const effectiveSessionRuntimeCapabilities = React45.useMemo(
|
|
12456
12982
|
() => runtimeCapabilitiesReady && runtimeCapabilities ? mergeRuntimeCapabilitiesSelections(
|
|
12457
12983
|
runtimeCapabilities,
|
|
12458
12984
|
sessionRuntimeCapabilities
|
|
12459
12985
|
) : null,
|
|
12460
12986
|
[runtimeCapabilities, runtimeCapabilitiesReady, sessionRuntimeCapabilities]
|
|
12461
12987
|
);
|
|
12462
|
-
const runRuntimeCapabilityOptions =
|
|
12988
|
+
const runRuntimeCapabilityOptions = React45.useMemo(
|
|
12463
12989
|
() => runtimeCapabilityOptions.filter(
|
|
12464
12990
|
(option) => isRuntimeCapabilitySelected(
|
|
12465
12991
|
runRuntimeCapabilities,
|
|
@@ -12469,11 +12995,11 @@ function Chat({
|
|
|
12469
12995
|
),
|
|
12470
12996
|
[runRuntimeCapabilities, runtimeCapabilityOptions]
|
|
12471
12997
|
);
|
|
12472
|
-
const composerRuntimeCapabilitySelectionKeys =
|
|
12998
|
+
const composerRuntimeCapabilitySelectionKeys = React45.useMemo(
|
|
12473
12999
|
() => getComposerCapabilitySelectionKeys(composerParts),
|
|
12474
13000
|
[composerParts]
|
|
12475
13001
|
);
|
|
12476
|
-
const detachedRunRuntimeCapabilityOptions =
|
|
13002
|
+
const detachedRunRuntimeCapabilityOptions = React45.useMemo(
|
|
12477
13003
|
() => runRuntimeCapabilityOptions.filter(
|
|
12478
13004
|
(option) => !composerRuntimeCapabilitySelectionKeys.has(
|
|
12479
13005
|
getRuntimeCapabilityOptionKey(option)
|
|
@@ -12481,7 +13007,7 @@ function Chat({
|
|
|
12481
13007
|
),
|
|
12482
13008
|
[composerRuntimeCapabilitySelectionKeys, runRuntimeCapabilityOptions]
|
|
12483
13009
|
);
|
|
12484
|
-
const persistSessionRuntimeCapabilities =
|
|
13010
|
+
const persistSessionRuntimeCapabilities = React45.useCallback(
|
|
12485
13011
|
async (threadId, selection) => {
|
|
12486
13012
|
if (!runtimeCapabilities || !selection) {
|
|
12487
13013
|
return;
|
|
@@ -12506,10 +13032,10 @@ function Chat({
|
|
|
12506
13032
|
},
|
|
12507
13033
|
[runtimeCapabilities, stream.client]
|
|
12508
13034
|
);
|
|
12509
|
-
const clearQuoteSelection =
|
|
13035
|
+
const clearQuoteSelection = React45.useCallback(() => {
|
|
12510
13036
|
setQuoteSelection(null);
|
|
12511
13037
|
}, []);
|
|
12512
|
-
const commitComposerParts =
|
|
13038
|
+
const commitComposerParts = React45.useCallback(
|
|
12513
13039
|
(nextParts, options2) => {
|
|
12514
13040
|
const normalized = normalizeComposerParts(nextParts);
|
|
12515
13041
|
const previous = composerPartsRef.current;
|
|
@@ -12545,7 +13071,7 @@ function Chat({
|
|
|
12545
13071
|
},
|
|
12546
13072
|
[]
|
|
12547
13073
|
);
|
|
12548
|
-
const setComposerText =
|
|
13074
|
+
const setComposerText = React45.useCallback(
|
|
12549
13075
|
(text, caretOffset = text.length) => {
|
|
12550
13076
|
commitComposerParts(createComposerTextParts(text), {
|
|
12551
13077
|
caretOffset,
|
|
@@ -12555,7 +13081,7 @@ function Chat({
|
|
|
12555
13081
|
},
|
|
12556
13082
|
[commitComposerParts]
|
|
12557
13083
|
);
|
|
12558
|
-
const focusComposerAt =
|
|
13084
|
+
const focusComposerAt = React45.useCallback((position) => {
|
|
12559
13085
|
const nextPosition = position ?? getComposerEditingLength(composerPartsRef.current);
|
|
12560
13086
|
pendingComposerCaretOffsetRef.current = nextPosition;
|
|
12561
13087
|
requestAnimationFrame(() => {
|
|
@@ -12567,7 +13093,7 @@ function Chat({
|
|
|
12567
13093
|
});
|
|
12568
13094
|
}, []);
|
|
12569
13095
|
const parentMessenger = useParentMessenger({
|
|
12570
|
-
onSetComposerValue:
|
|
13096
|
+
onSetComposerValue: React45.useCallback(
|
|
12571
13097
|
(payload) => {
|
|
12572
13098
|
if (!payload) {
|
|
12573
13099
|
return;
|
|
@@ -12590,10 +13116,10 @@ function Chat({
|
|
|
12590
13116
|
},
|
|
12591
13117
|
[composer?.tools, setComposerText]
|
|
12592
13118
|
),
|
|
12593
|
-
onFocusComposer:
|
|
13119
|
+
onFocusComposer: React45.useCallback(() => {
|
|
12594
13120
|
composerInputRef.current?.focus();
|
|
12595
13121
|
}, []),
|
|
12596
|
-
onSetPetEnabled:
|
|
13122
|
+
onSetPetEnabled: React45.useCallback(
|
|
12597
13123
|
(enabled) => {
|
|
12598
13124
|
if (petRequired) {
|
|
12599
13125
|
return;
|
|
@@ -12606,7 +13132,11 @@ function Chat({
|
|
|
12606
13132
|
[displayedPetSettings, petRequired, savePetLocalSettings]
|
|
12607
13133
|
)
|
|
12608
13134
|
});
|
|
12609
|
-
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(() => {
|
|
12610
13140
|
if (typeof window === "undefined") {
|
|
12611
13141
|
clearQuoteSelection();
|
|
12612
13142
|
return;
|
|
@@ -12651,23 +13181,23 @@ function Chat({
|
|
|
12651
13181
|
left
|
|
12652
13182
|
});
|
|
12653
13183
|
}, [clearQuoteSelection]);
|
|
12654
|
-
const cancelPendingAutoScroll =
|
|
13184
|
+
const cancelPendingAutoScroll = React45.useCallback(() => {
|
|
12655
13185
|
if (autoScrollFrameRef.current !== null) {
|
|
12656
13186
|
cancelAnimationFrame(autoScrollFrameRef.current);
|
|
12657
13187
|
autoScrollFrameRef.current = null;
|
|
12658
13188
|
}
|
|
12659
13189
|
}, []);
|
|
12660
|
-
const disableAutoFollow =
|
|
13190
|
+
const disableAutoFollow = React45.useCallback(() => {
|
|
12661
13191
|
forceFollowRef.current = false;
|
|
12662
13192
|
shouldAutoScrollRef.current = false;
|
|
12663
13193
|
cancelPendingAutoScroll();
|
|
12664
13194
|
}, [cancelPendingAutoScroll]);
|
|
12665
|
-
const enableAutoFollow =
|
|
13195
|
+
const enableAutoFollow = React45.useCallback(() => {
|
|
12666
13196
|
forceFollowRef.current = true;
|
|
12667
13197
|
shouldAutoScrollRef.current = true;
|
|
12668
13198
|
setHasUpdatesBelow(false);
|
|
12669
13199
|
}, []);
|
|
12670
|
-
const scrollToBottom =
|
|
13200
|
+
const scrollToBottom = React45.useCallback(
|
|
12671
13201
|
(smooth = false, force = false) => {
|
|
12672
13202
|
if (force) {
|
|
12673
13203
|
enableAutoFollow();
|
|
@@ -12694,7 +13224,7 @@ function Chat({
|
|
|
12694
13224
|
},
|
|
12695
13225
|
[cancelPendingAutoScroll, enableAutoFollow]
|
|
12696
13226
|
);
|
|
12697
|
-
|
|
13227
|
+
React45.useEffect(() => {
|
|
12698
13228
|
const viewport = viewportRef.current;
|
|
12699
13229
|
if (!viewport) return;
|
|
12700
13230
|
previousScrollTopRef.current = viewport.scrollTop;
|
|
@@ -12775,14 +13305,14 @@ function Chat({
|
|
|
12775
13305
|
window.removeEventListener("pointercancel", stopPointerTracking);
|
|
12776
13306
|
};
|
|
12777
13307
|
}, [cancelPendingAutoScroll, disableAutoFollow]);
|
|
12778
|
-
|
|
13308
|
+
React45.useEffect(() => {
|
|
12779
13309
|
shouldAutoScrollRef.current = true;
|
|
12780
13310
|
forceFollowRef.current = false;
|
|
12781
13311
|
previousScrollTopRef.current = 0;
|
|
12782
13312
|
setIsAtBottom(true);
|
|
12783
13313
|
setHasUpdatesBelow(false);
|
|
12784
13314
|
}, [stream.threadId]);
|
|
12785
|
-
|
|
13315
|
+
React45.useEffect(() => {
|
|
12786
13316
|
const messageCountChanged = messages.length !== previousMessageCountRef.current;
|
|
12787
13317
|
previousMessageCountRef.current = messages.length;
|
|
12788
13318
|
if (!shouldAutoScrollRef.current) {
|
|
@@ -12801,7 +13331,7 @@ function Chat({
|
|
|
12801
13331
|
clientSecret: effectiveClientSecret
|
|
12802
13332
|
});
|
|
12803
13333
|
const missingConfig = Boolean(missingConfigKind);
|
|
12804
|
-
const missingConfigShortMessage =
|
|
13334
|
+
const missingConfigShortMessage = React45.useMemo(() => {
|
|
12805
13335
|
switch (missingConfigKind) {
|
|
12806
13336
|
case "apiUrl":
|
|
12807
13337
|
return t("chat.missingApiUrlShort");
|
|
@@ -12813,7 +13343,7 @@ function Chat({
|
|
|
12813
13343
|
return t("chat.missingConfigShort");
|
|
12814
13344
|
}
|
|
12815
13345
|
}, [missingConfigKind, t]);
|
|
12816
|
-
const missingConfigDetailMessage =
|
|
13346
|
+
const missingConfigDetailMessage = React45.useMemo(() => {
|
|
12817
13347
|
switch (missingConfigKind) {
|
|
12818
13348
|
case "apiUrl":
|
|
12819
13349
|
return t("chat.missingApiUrlDetail");
|
|
@@ -12828,7 +13358,7 @@ function Chat({
|
|
|
12828
13358
|
const showMissingConfig = !isClientSecretInitializing && missingConfig;
|
|
12829
13359
|
const hasUploadingFiles = attachments.some((a) => a.status === "uploading");
|
|
12830
13360
|
const isSendDisabled = !trimmedDraft && !hasReferences || hasPendingInteractiveRequest || missingConfig || isHistoryLoading || hasUploadingFiles || isUploadingReferenceImages;
|
|
12831
|
-
const resizeComposerInput =
|
|
13361
|
+
const resizeComposerInput = React45.useCallback(() => {
|
|
12832
13362
|
const input = composerInputRef.current;
|
|
12833
13363
|
if (!input) {
|
|
12834
13364
|
return;
|
|
@@ -12836,7 +13366,7 @@ function Chat({
|
|
|
12836
13366
|
input.style.maxHeight = `${COMPOSER_INPUT_MAX_HEIGHT}px`;
|
|
12837
13367
|
input.style.overflowY = input.scrollHeight > COMPOSER_INPUT_MAX_HEIGHT ? "auto" : "hidden";
|
|
12838
13368
|
}, []);
|
|
12839
|
-
|
|
13369
|
+
React45.useLayoutEffect(() => {
|
|
12840
13370
|
composerPartsRef.current = composerParts;
|
|
12841
13371
|
resizeComposerInput();
|
|
12842
13372
|
const caretOffset = pendingComposerCaretOffsetRef.current;
|
|
@@ -12848,13 +13378,13 @@ function Chat({
|
|
|
12848
13378
|
}
|
|
12849
13379
|
}
|
|
12850
13380
|
}, [composerDomVersion, composerParts, resizeComposerInput]);
|
|
12851
|
-
|
|
13381
|
+
React45.useEffect(() => {
|
|
12852
13382
|
document.addEventListener("selectionchange", syncQuoteSelection);
|
|
12853
13383
|
return () => {
|
|
12854
13384
|
document.removeEventListener("selectionchange", syncQuoteSelection);
|
|
12855
13385
|
};
|
|
12856
13386
|
}, [syncQuoteSelection]);
|
|
12857
|
-
|
|
13387
|
+
React45.useEffect(() => {
|
|
12858
13388
|
const viewport = viewportRef.current;
|
|
12859
13389
|
if (!viewport) {
|
|
12860
13390
|
return;
|
|
@@ -12871,14 +13401,14 @@ function Chat({
|
|
|
12871
13401
|
window.removeEventListener("resize", handleViewportScroll);
|
|
12872
13402
|
};
|
|
12873
13403
|
}, [clearQuoteSelection]);
|
|
12874
|
-
|
|
13404
|
+
React45.useEffect(() => {
|
|
12875
13405
|
clearQuoteSelection();
|
|
12876
13406
|
}, [messages.length, stream.threadId, clearQuoteSelection]);
|
|
12877
|
-
|
|
13407
|
+
React45.useEffect(() => {
|
|
12878
13408
|
if (missingConfig) return;
|
|
12879
13409
|
void refreshThreads();
|
|
12880
13410
|
}, [missingConfig, refreshThreads]);
|
|
12881
|
-
|
|
13411
|
+
React45.useEffect(() => {
|
|
12882
13412
|
if (missingConfig || !stream.client || !stream.assistantId) {
|
|
12883
13413
|
setAssistantName(null);
|
|
12884
13414
|
setAssistantAvatar(null);
|
|
@@ -12901,7 +13431,7 @@ function Chat({
|
|
|
12901
13431
|
cancelled = true;
|
|
12902
13432
|
};
|
|
12903
13433
|
}, [missingConfig, stream.client, stream.assistantId]);
|
|
12904
|
-
|
|
13434
|
+
React45.useEffect(() => {
|
|
12905
13435
|
if (missingConfig || !stream.client || !stream.assistantId) {
|
|
12906
13436
|
setRuntimeCapabilities(null);
|
|
12907
13437
|
setRuntimeCapabilitiesReady(false);
|
|
@@ -12948,7 +13478,7 @@ function Chat({
|
|
|
12948
13478
|
});
|
|
12949
13479
|
return () => controller.abort();
|
|
12950
13480
|
}, [missingConfig, stream.client, stream.assistantId]);
|
|
12951
|
-
|
|
13481
|
+
React45.useEffect(() => {
|
|
12952
13482
|
setRunRuntimeCapabilities(
|
|
12953
13483
|
createEmptyRuntimeCapabilitiesSelection(runtimeCapabilities)
|
|
12954
13484
|
);
|
|
@@ -13005,7 +13535,7 @@ function Chat({
|
|
|
13005
13535
|
mimetype: a.storageFile?.mimetype ?? a.file.type,
|
|
13006
13536
|
size: a.storageFile?.size ?? a.file.size
|
|
13007
13537
|
}));
|
|
13008
|
-
const handleSessionRuntimeCapabilityToggle =
|
|
13538
|
+
const handleSessionRuntimeCapabilityToggle = React45.useCallback(
|
|
13009
13539
|
(type, id, selected) => {
|
|
13010
13540
|
setSessionRuntimeCapabilities((previous) => {
|
|
13011
13541
|
const nextSelection = toggleRuntimeCapabilitySelection(
|
|
@@ -13023,7 +13553,7 @@ function Chat({
|
|
|
13023
13553
|
},
|
|
13024
13554
|
[persistSessionRuntimeCapabilities, stream.threadId]
|
|
13025
13555
|
);
|
|
13026
|
-
const updateRuntimeCapabilityPalette =
|
|
13556
|
+
const updateRuntimeCapabilityPalette = React45.useCallback(
|
|
13027
13557
|
(parts, selectionStart) => {
|
|
13028
13558
|
const input = composerInputRef.current;
|
|
13029
13559
|
const editingText = getComposerEditingText(parts);
|
|
@@ -13035,7 +13565,7 @@ function Chat({
|
|
|
13035
13565
|
},
|
|
13036
13566
|
[]
|
|
13037
13567
|
);
|
|
13038
|
-
const syncComposerInputFromElement =
|
|
13568
|
+
const syncComposerInputFromElement = React45.useCallback(
|
|
13039
13569
|
(input) => {
|
|
13040
13570
|
const previousCapabilities = getComposerCapabilityPartMap(
|
|
13041
13571
|
composerPartsRef.current
|
|
@@ -13053,25 +13583,25 @@ function Chat({
|
|
|
13053
13583
|
},
|
|
13054
13584
|
[commitComposerParts, updateRuntimeCapabilityPalette]
|
|
13055
13585
|
);
|
|
13056
|
-
const handleComposerInput =
|
|
13586
|
+
const handleComposerInput = React45.useCallback(
|
|
13057
13587
|
(event) => {
|
|
13058
13588
|
syncComposerInputFromElement(event.currentTarget);
|
|
13059
13589
|
},
|
|
13060
13590
|
[syncComposerInputFromElement]
|
|
13061
13591
|
);
|
|
13062
|
-
const handleComposerCompositionEnd =
|
|
13592
|
+
const handleComposerCompositionEnd = React45.useCallback(
|
|
13063
13593
|
(event) => {
|
|
13064
13594
|
syncComposerInputFromElement(event.currentTarget);
|
|
13065
13595
|
},
|
|
13066
13596
|
[syncComposerInputFromElement]
|
|
13067
13597
|
);
|
|
13068
|
-
const handleComposerSelect =
|
|
13598
|
+
const handleComposerSelect = React45.useCallback(() => {
|
|
13069
13599
|
updateRuntimeCapabilityPalette(
|
|
13070
13600
|
composerPartsRef.current,
|
|
13071
13601
|
composerInputRef.current ? getComposerSelectionOffset(composerInputRef.current) : void 0
|
|
13072
13602
|
);
|
|
13073
13603
|
}, [updateRuntimeCapabilityPalette]);
|
|
13074
|
-
const removeRunRuntimeCapability =
|
|
13604
|
+
const removeRunRuntimeCapability = React45.useCallback(
|
|
13075
13605
|
(option) => {
|
|
13076
13606
|
setRunRuntimeCapabilities(
|
|
13077
13607
|
(previous) => toggleRuntimeCapabilitySelection(
|
|
@@ -13091,7 +13621,7 @@ function Chat({
|
|
|
13091
13621
|
},
|
|
13092
13622
|
[commitComposerParts]
|
|
13093
13623
|
);
|
|
13094
|
-
const submitDraft =
|
|
13624
|
+
const submitDraft = React45.useCallback(
|
|
13095
13625
|
(optionsOrFollowUp) => {
|
|
13096
13626
|
if (isSendDisabled) return;
|
|
13097
13627
|
const submitOptions = typeof optionsOrFollowUp === "string" ? { followUpOverride: optionsOrFollowUp } : optionsOrFollowUp ?? {};
|
|
@@ -13215,7 +13745,7 @@ function Chat({
|
|
|
13215
13745
|
t
|
|
13216
13746
|
]
|
|
13217
13747
|
);
|
|
13218
|
-
const addRunRuntimeCapabilities =
|
|
13748
|
+
const addRunRuntimeCapabilities = React45.useCallback(
|
|
13219
13749
|
(selection) => {
|
|
13220
13750
|
setRunRuntimeCapabilities(
|
|
13221
13751
|
(previous) => runtimeCapabilities ? mergeRuntimeCapabilitiesSelections(
|
|
@@ -13227,7 +13757,7 @@ function Chat({
|
|
|
13227
13757
|
},
|
|
13228
13758
|
[runtimeCapabilities]
|
|
13229
13759
|
);
|
|
13230
|
-
const insertComposerCapabilityToken =
|
|
13760
|
+
const insertComposerCapabilityToken = React45.useCallback(
|
|
13231
13761
|
(capability, range) => {
|
|
13232
13762
|
const token = createComposerCapabilityPart(capability, createMessageId());
|
|
13233
13763
|
const currentParts = composerPartsRef.current;
|
|
@@ -13298,7 +13828,7 @@ function Chat({
|
|
|
13298
13828
|
plugin: t("composer.slashCommands.empty.loadingCapabilities"),
|
|
13299
13829
|
subAgent: t("composer.slashCommands.empty.loadingCapabilities")
|
|
13300
13830
|
};
|
|
13301
|
-
|
|
13831
|
+
React45.useEffect(() => {
|
|
13302
13832
|
if (!runtimeCapabilityPalette) {
|
|
13303
13833
|
return;
|
|
13304
13834
|
}
|
|
@@ -13317,7 +13847,7 @@ function Chat({
|
|
|
13317
13847
|
);
|
|
13318
13848
|
}
|
|
13319
13849
|
}, [slashPaletteOptions.length, runtimeCapabilityPalette]);
|
|
13320
|
-
|
|
13850
|
+
React45.useLayoutEffect(() => {
|
|
13321
13851
|
if (!runtimeCapabilityPalette) {
|
|
13322
13852
|
return;
|
|
13323
13853
|
}
|
|
@@ -13341,7 +13871,7 @@ function Chat({
|
|
|
13341
13871
|
}
|
|
13342
13872
|
submitDraft();
|
|
13343
13873
|
};
|
|
13344
|
-
const handleEditPendingFollowUp =
|
|
13874
|
+
const handleEditPendingFollowUp = React45.useCallback(
|
|
13345
13875
|
(id) => {
|
|
13346
13876
|
const item = pendingFollowUps.find(
|
|
13347
13877
|
(entry) => entry.id === id && entry.mode === "queue"
|
|
@@ -13368,7 +13898,7 @@ function Chat({
|
|
|
13368
13898
|
},
|
|
13369
13899
|
[pendingFollowUps, setComposerText, stream]
|
|
13370
13900
|
);
|
|
13371
|
-
const handleQuoteSelection =
|
|
13901
|
+
const handleQuoteSelection = React45.useCallback(() => {
|
|
13372
13902
|
if (!quoteSelection) {
|
|
13373
13903
|
return;
|
|
13374
13904
|
}
|
|
@@ -13384,7 +13914,7 @@ function Chat({
|
|
|
13384
13914
|
const handleAttachmentClick = () => {
|
|
13385
13915
|
fileInputRef.current?.click();
|
|
13386
13916
|
};
|
|
13387
|
-
const uploadContextFile =
|
|
13917
|
+
const uploadContextFile = React45.useCallback(
|
|
13388
13918
|
(file) => stream.client.contexts.uploadFile(file),
|
|
13389
13919
|
[stream.client]
|
|
13390
13920
|
);
|
|
@@ -13488,7 +14018,7 @@ function Chat({
|
|
|
13488
14018
|
}
|
|
13489
14019
|
submitDraft();
|
|
13490
14020
|
};
|
|
13491
|
-
const handleComposerPaste =
|
|
14021
|
+
const handleComposerPaste = React45.useCallback(
|
|
13492
14022
|
(event) => {
|
|
13493
14023
|
const clipboardData = event.clipboardData;
|
|
13494
14024
|
if (!clipboardData) {
|
|
@@ -13587,18 +14117,18 @@ function Chat({
|
|
|
13587
14117
|
uploadContextFile
|
|
13588
14118
|
]
|
|
13589
14119
|
);
|
|
13590
|
-
const alternateFollowUpShortcutLabel =
|
|
14120
|
+
const alternateFollowUpShortcutLabel = React45.useMemo(() => {
|
|
13591
14121
|
if (typeof navigator === "undefined") {
|
|
13592
14122
|
return "\u2318Enter";
|
|
13593
14123
|
}
|
|
13594
14124
|
const platform = navigator.platform || navigator.userAgent;
|
|
13595
14125
|
return /Mac|iPhone|iPad|iPod/i.test(platform) ? "\u2318Enter" : "Ctrl+Enter";
|
|
13596
14126
|
}, []);
|
|
13597
|
-
const followUpShortcutLabels =
|
|
14127
|
+
const followUpShortcutLabels = React45.useMemo(
|
|
13598
14128
|
() => getComposerFollowUpShortcutLabels(alternateFollowUpShortcutLabel),
|
|
13599
14129
|
[alternateFollowUpShortcutLabel]
|
|
13600
14130
|
);
|
|
13601
|
-
const uploadFile =
|
|
14131
|
+
const uploadFile = React45.useCallback(
|
|
13602
14132
|
async (localId, file) => {
|
|
13603
14133
|
try {
|
|
13604
14134
|
const result = await uploadContextFile(file);
|
|
@@ -13621,7 +14151,7 @@ function Chat({
|
|
|
13621
14151
|
},
|
|
13622
14152
|
[uploadContextFile]
|
|
13623
14153
|
);
|
|
13624
|
-
const handleRetryUpload =
|
|
14154
|
+
const handleRetryUpload = React45.useCallback(
|
|
13625
14155
|
(localId) => {
|
|
13626
14156
|
const attachment = attachments.find((a) => a.localId === localId);
|
|
13627
14157
|
if (!attachment || attachment.status !== "error") return;
|
|
@@ -13720,7 +14250,7 @@ function Chat({
|
|
|
13720
14250
|
);
|
|
13721
14251
|
scrollToBottom(true, true);
|
|
13722
14252
|
};
|
|
13723
|
-
const loadConversationMessages =
|
|
14253
|
+
const loadConversationMessages = React45.useCallback(
|
|
13724
14254
|
async (recordId) => {
|
|
13725
14255
|
if (missingConfig) {
|
|
13726
14256
|
setHistoryError(missingConfigShortMessage);
|
|
@@ -13815,12 +14345,12 @@ function Chat({
|
|
|
13815
14345
|
}
|
|
13816
14346
|
};
|
|
13817
14347
|
const acceptMimes = composer?.attachments?.accept ? Object.entries(composer.attachments.accept).map(([mime, exts]) => [mime, ...exts.map((e) => `.${e}`)].join(",")).join(",") : void 0;
|
|
13818
|
-
const currentThread =
|
|
14348
|
+
const currentThread = React45.useMemo(
|
|
13819
14349
|
() => threads.find((item) => item.id === stream.threadId),
|
|
13820
14350
|
[threads, stream.threadId]
|
|
13821
14351
|
);
|
|
13822
14352
|
const streamErrorMessage = stream.error instanceof Error ? stream.error.message : void 0;
|
|
13823
|
-
const threadErrorMessage =
|
|
14353
|
+
const threadErrorMessage = React45.useMemo(() => {
|
|
13824
14354
|
if (streamErrorMessage?.trim()) return streamErrorMessage.trim();
|
|
13825
14355
|
if (currentThread?.status !== "error") return void 0;
|
|
13826
14356
|
const message = currentThread.error?.trim();
|
|
@@ -13851,7 +14381,7 @@ function Chat({
|
|
|
13851
14381
|
fallbackTitle: t("history.threadFallback")
|
|
13852
14382
|
});
|
|
13853
14383
|
const assistantTitle = assistantName || resolvedTitle;
|
|
13854
|
-
return /* @__PURE__ */
|
|
14384
|
+
return /* @__PURE__ */ jsxs33(
|
|
13855
14385
|
"div",
|
|
13856
14386
|
{
|
|
13857
14387
|
ref: viewportRef,
|
|
@@ -13861,10 +14391,10 @@ function Chat({
|
|
|
13861
14391
|
className
|
|
13862
14392
|
),
|
|
13863
14393
|
children: [
|
|
13864
|
-
/* @__PURE__ */
|
|
13865
|
-
/* @__PURE__ */
|
|
13866
|
-
/* @__PURE__ */
|
|
13867
|
-
/* @__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(
|
|
13868
14398
|
ChatkitAvatar,
|
|
13869
14399
|
{
|
|
13870
14400
|
avatar: assistantAvatar,
|
|
@@ -13872,10 +14402,10 @@ function Chat({
|
|
|
13872
14402
|
label: assistantTitle
|
|
13873
14403
|
}
|
|
13874
14404
|
),
|
|
13875
|
-
/* @__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" })
|
|
13876
14406
|
] }),
|
|
13877
|
-
/* @__PURE__ */
|
|
13878
|
-
/* @__PURE__ */
|
|
14407
|
+
/* @__PURE__ */ jsxs33("div", { className: "truncate", children: [
|
|
14408
|
+
/* @__PURE__ */ jsx50(
|
|
13879
14409
|
"h2",
|
|
13880
14410
|
{
|
|
13881
14411
|
className: "text-lg font-semibold truncate",
|
|
@@ -13883,12 +14413,29 @@ function Chat({
|
|
|
13883
14413
|
children: assistantTitle
|
|
13884
14414
|
}
|
|
13885
14415
|
),
|
|
13886
|
-
/* @__PURE__ */
|
|
14416
|
+
/* @__PURE__ */ jsx50("p", { className: "text-xs text-muted-foreground", children: t("chat.statusOnline") })
|
|
13887
14417
|
] })
|
|
13888
14418
|
] }),
|
|
13889
|
-
/* @__PURE__ */
|
|
13890
|
-
/* @__PURE__ */
|
|
13891
|
-
/* @__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(
|
|
13892
14439
|
"button",
|
|
13893
14440
|
{
|
|
13894
14441
|
type: "button",
|
|
@@ -13899,14 +14446,14 @@ function Chat({
|
|
|
13899
14446
|
"transition-colors duration-150"
|
|
13900
14447
|
),
|
|
13901
14448
|
"aria-label": t("settings.open"),
|
|
13902
|
-
children: /* @__PURE__ */
|
|
14449
|
+
children: /* @__PURE__ */ jsx50(Settings2, { size: 16 })
|
|
13903
14450
|
}
|
|
13904
14451
|
) }) }),
|
|
13905
|
-
/* @__PURE__ */
|
|
14452
|
+
/* @__PURE__ */ jsx50(TooltipContent, { side: "bottom", children: t("settings.open") })
|
|
13906
14453
|
] }),
|
|
13907
|
-
history?.enabled !== false && /* @__PURE__ */
|
|
13908
|
-
/* @__PURE__ */
|
|
13909
|
-
/* @__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(
|
|
13910
14457
|
"button",
|
|
13911
14458
|
{
|
|
13912
14459
|
type: "button",
|
|
@@ -13919,12 +14466,12 @@ function Chat({
|
|
|
13919
14466
|
"disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed"
|
|
13920
14467
|
),
|
|
13921
14468
|
"aria-label": t("history.newThread"),
|
|
13922
|
-
children: /* @__PURE__ */
|
|
14469
|
+
children: /* @__PURE__ */ jsx50(Pencil4, { size: 16 })
|
|
13923
14470
|
}
|
|
13924
14471
|
) }) }),
|
|
13925
|
-
/* @__PURE__ */
|
|
14472
|
+
/* @__PURE__ */ jsx50(TooltipContent, { side: "bottom", children: t("history.newThread") })
|
|
13926
14473
|
] }),
|
|
13927
|
-
/* @__PURE__ */
|
|
14474
|
+
/* @__PURE__ */ jsx50(
|
|
13928
14475
|
HistorySidebar,
|
|
13929
14476
|
{
|
|
13930
14477
|
threads,
|
|
@@ -13939,18 +14486,18 @@ function Chat({
|
|
|
13939
14486
|
] })
|
|
13940
14487
|
] })
|
|
13941
14488
|
] }),
|
|
13942
|
-
/* @__PURE__ */
|
|
13943
|
-
errorMessage && /* @__PURE__ */
|
|
13944
|
-
historyError && /* @__PURE__ */
|
|
13945
|
-
showMissingConfig && /* @__PURE__ */
|
|
13946
|
-
isHistoryLoading && /* @__PURE__ */
|
|
13947
|
-
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(
|
|
13948
14495
|
StartScreen,
|
|
13949
14496
|
{
|
|
13950
14497
|
startScreen,
|
|
13951
14498
|
onPromptClick: handlePromptClick
|
|
13952
14499
|
}
|
|
13953
|
-
) : /* @__PURE__ */
|
|
14500
|
+
) : /* @__PURE__ */ jsxs33("div", { className: "space-y-4", children: [
|
|
13954
14501
|
messages.map((message, index) => {
|
|
13955
14502
|
const messageType = String(message.type);
|
|
13956
14503
|
const isAssistantMessage = messageType === "assistant" || messageType === "ai";
|
|
@@ -13983,7 +14530,7 @@ function Chat({
|
|
|
13983
14530
|
if (!isAssistantMessage && !hasPlainRenderableContent && !hasHumanAttachments && humanRuntimeCapabilityOptions.length === 0 && humanReferences.length === 0) {
|
|
13984
14531
|
return null;
|
|
13985
14532
|
}
|
|
13986
|
-
return /* @__PURE__ */
|
|
14533
|
+
return /* @__PURE__ */ jsx50(
|
|
13987
14534
|
"div",
|
|
13988
14535
|
{
|
|
13989
14536
|
className: cn(
|
|
@@ -13991,8 +14538,8 @@ function Chat({
|
|
|
13991
14538
|
message.type === "human" ? "justify-end" : "justify-start -ml-1"
|
|
13992
14539
|
// AI messages: slightly closer to left
|
|
13993
14540
|
),
|
|
13994
|
-
children: /* @__PURE__ */
|
|
13995
|
-
/* @__PURE__ */
|
|
14541
|
+
children: /* @__PURE__ */ jsxs33("div", { className: "flex flex-col px-3 overflow-hidden", children: [
|
|
14542
|
+
/* @__PURE__ */ jsx50(
|
|
13996
14543
|
"div",
|
|
13997
14544
|
{
|
|
13998
14545
|
...canQuoteMessage ? {
|
|
@@ -14004,7 +14551,7 @@ function Chat({
|
|
|
14004
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"
|
|
14005
14552
|
// AI messages: use chat-specific foreground color
|
|
14006
14553
|
),
|
|
14007
|
-
children: isAssistantMessage ? /* @__PURE__ */
|
|
14554
|
+
children: isAssistantMessage ? /* @__PURE__ */ jsx50(
|
|
14008
14555
|
AssistantMessage,
|
|
14009
14556
|
{
|
|
14010
14557
|
message: {
|
|
@@ -14023,25 +14570,25 @@ function Chat({
|
|
|
14023
14570
|
organizationId: stream.organizationId,
|
|
14024
14571
|
apiUrl: stream.apiUrl
|
|
14025
14572
|
}
|
|
14026
|
-
) : /* @__PURE__ */
|
|
14027
|
-
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(
|
|
14028
14575
|
"span",
|
|
14029
14576
|
{
|
|
14030
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",
|
|
14031
14578
|
children: [
|
|
14032
|
-
/* @__PURE__ */
|
|
14579
|
+
/* @__PURE__ */ jsx50(
|
|
14033
14580
|
RuntimeCapabilityIcon,
|
|
14034
14581
|
{
|
|
14035
14582
|
option,
|
|
14036
14583
|
variant: "chip"
|
|
14037
14584
|
}
|
|
14038
14585
|
),
|
|
14039
|
-
/* @__PURE__ */
|
|
14586
|
+
/* @__PURE__ */ jsx50("span", { className: "max-w-[9rem] truncate", children: option.label })
|
|
14040
14587
|
]
|
|
14041
14588
|
},
|
|
14042
14589
|
`${option.type}:${option.id}`
|
|
14043
14590
|
)) }),
|
|
14044
|
-
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(
|
|
14045
14592
|
ReferenceChip,
|
|
14046
14593
|
{
|
|
14047
14594
|
reference,
|
|
@@ -14049,29 +14596,29 @@ function Chat({
|
|
|
14049
14596
|
},
|
|
14050
14597
|
getReferenceKey(reference)
|
|
14051
14598
|
)) }),
|
|
14052
|
-
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(
|
|
14053
14600
|
"div",
|
|
14054
14601
|
{
|
|
14055
14602
|
className: "flex items-center gap-1.5 rounded-md bg-primary-foreground/20 px-2 py-1 text-xs",
|
|
14056
14603
|
children: [
|
|
14057
|
-
/* @__PURE__ */
|
|
14058
|
-
/* @__PURE__ */
|
|
14604
|
+
/* @__PURE__ */ jsx50(FileText3, { size: 12 }),
|
|
14605
|
+
/* @__PURE__ */ jsx50("span", { className: "max-w-[100px] truncate", children: file.originalName })
|
|
14059
14606
|
]
|
|
14060
14607
|
},
|
|
14061
14608
|
fileIndex
|
|
14062
14609
|
)) }),
|
|
14063
|
-
Array.isArray(message.content) ? message.content.map((part, partIndex) => /* @__PURE__ */
|
|
14610
|
+
Array.isArray(message.content) ? message.content.map((part, partIndex) => /* @__PURE__ */ jsx50(
|
|
14064
14611
|
"p",
|
|
14065
14612
|
{
|
|
14066
14613
|
className: "wrap-break-word text-sm leading-relaxed",
|
|
14067
14614
|
children: formatMessageContent(part)
|
|
14068
14615
|
},
|
|
14069
14616
|
`${part.type}-${partIndex}`
|
|
14070
|
-
)) : /* @__PURE__ */
|
|
14617
|
+
)) : /* @__PURE__ */ jsx50("span", { className: "wrap-break-word text-sm leading-relaxed", children: formatMessageContent(message.content) })
|
|
14071
14618
|
] })
|
|
14072
14619
|
}
|
|
14073
14620
|
),
|
|
14074
|
-
/* @__PURE__ */
|
|
14621
|
+
/* @__PURE__ */ jsx50(
|
|
14075
14622
|
MessageActions,
|
|
14076
14623
|
{
|
|
14077
14624
|
content: messageContent,
|
|
@@ -14107,7 +14654,7 @@ function Chat({
|
|
|
14107
14654
|
stream.isLoading,
|
|
14108
14655
|
{ now: streamingNow }
|
|
14109
14656
|
);
|
|
14110
|
-
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(
|
|
14111
14658
|
AssistantStreamingIndicator,
|
|
14112
14659
|
{
|
|
14113
14660
|
status: fallbackStreamingStatus ?? "loading"
|
|
@@ -14116,7 +14663,7 @@ function Chat({
|
|
|
14116
14663
|
})()
|
|
14117
14664
|
] })
|
|
14118
14665
|
] }),
|
|
14119
|
-
!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(
|
|
14120
14667
|
Button,
|
|
14121
14668
|
{
|
|
14122
14669
|
type: "button",
|
|
@@ -14129,10 +14676,10 @@ function Chat({
|
|
|
14129
14676
|
onClick: () => scrollToBottom(true, true),
|
|
14130
14677
|
"aria-label": t("chat.scrollToBottom"),
|
|
14131
14678
|
title: t("chat.scrollToBottom"),
|
|
14132
|
-
children: /* @__PURE__ */
|
|
14679
|
+
children: /* @__PURE__ */ jsx50(ArrowDown2, { size: 16 })
|
|
14133
14680
|
}
|
|
14134
14681
|
) }),
|
|
14135
|
-
quoteSelection && /* @__PURE__ */
|
|
14682
|
+
quoteSelection && /* @__PURE__ */ jsx50(
|
|
14136
14683
|
"div",
|
|
14137
14684
|
{
|
|
14138
14685
|
className: "pointer-events-none fixed z-50",
|
|
@@ -14141,7 +14688,7 @@ function Chat({
|
|
|
14141
14688
|
left: `${quoteSelection.left}px`,
|
|
14142
14689
|
transform: "translateX(-50%)"
|
|
14143
14690
|
},
|
|
14144
|
-
children: /* @__PURE__ */
|
|
14691
|
+
children: /* @__PURE__ */ jsxs33(
|
|
14145
14692
|
Button,
|
|
14146
14693
|
{
|
|
14147
14694
|
type: "button",
|
|
@@ -14153,16 +14700,16 @@ function Chat({
|
|
|
14153
14700
|
"aria-label": t("composer.quoteSelection"),
|
|
14154
14701
|
title: t("composer.quoteSelection"),
|
|
14155
14702
|
children: [
|
|
14156
|
-
/* @__PURE__ */
|
|
14703
|
+
/* @__PURE__ */ jsx50(Quote, { size: 14 }),
|
|
14157
14704
|
t("composer.quoteSelection")
|
|
14158
14705
|
]
|
|
14159
14706
|
}
|
|
14160
14707
|
)
|
|
14161
14708
|
}
|
|
14162
14709
|
),
|
|
14163
|
-
/* @__PURE__ */
|
|
14164
|
-
threadErrorMessage && /* @__PURE__ */
|
|
14165
|
-
/* @__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(
|
|
14166
14713
|
"input",
|
|
14167
14714
|
{
|
|
14168
14715
|
ref: fileInputRef,
|
|
@@ -14173,7 +14720,7 @@ function Chat({
|
|
|
14173
14720
|
className: "hidden"
|
|
14174
14721
|
}
|
|
14175
14722
|
),
|
|
14176
|
-
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(
|
|
14177
14724
|
"div",
|
|
14178
14725
|
{
|
|
14179
14726
|
className: cn(
|
|
@@ -14181,16 +14728,16 @@ function Chat({
|
|
|
14181
14728
|
item.status === "error" ? "bg-destructive/10 border border-destructive/30" : "bg-muted"
|
|
14182
14729
|
),
|
|
14183
14730
|
children: [
|
|
14184
|
-
item.status === "uploading" && /* @__PURE__ */
|
|
14731
|
+
item.status === "uploading" && /* @__PURE__ */ jsx50(
|
|
14185
14732
|
Loader26,
|
|
14186
14733
|
{
|
|
14187
14734
|
size: 14,
|
|
14188
14735
|
className: "animate-spin text-muted-foreground"
|
|
14189
14736
|
}
|
|
14190
14737
|
),
|
|
14191
|
-
item.status === "success" && /* @__PURE__ */
|
|
14192
|
-
item.status === "error" && /* @__PURE__ */
|
|
14193
|
-
/* @__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(
|
|
14194
14741
|
"span",
|
|
14195
14742
|
{
|
|
14196
14743
|
className: cn(
|
|
@@ -14200,17 +14747,17 @@ function Chat({
|
|
|
14200
14747
|
children: item.file.name
|
|
14201
14748
|
}
|
|
14202
14749
|
),
|
|
14203
|
-
item.status === "error" && /* @__PURE__ */
|
|
14750
|
+
item.status === "error" && /* @__PURE__ */ jsx50(
|
|
14204
14751
|
"button",
|
|
14205
14752
|
{
|
|
14206
14753
|
type: "button",
|
|
14207
14754
|
onClick: () => handleRetryUpload(item.localId),
|
|
14208
14755
|
className: "ml-1 rounded-full p-0.5 text-destructive hover:bg-destructive/20",
|
|
14209
14756
|
title: t("chat.retryUpload"),
|
|
14210
|
-
children: /* @__PURE__ */
|
|
14757
|
+
children: /* @__PURE__ */ jsx50(RefreshCw2, { size: 12 })
|
|
14211
14758
|
}
|
|
14212
14759
|
),
|
|
14213
|
-
/* @__PURE__ */
|
|
14760
|
+
/* @__PURE__ */ jsx50(
|
|
14214
14761
|
"button",
|
|
14215
14762
|
{
|
|
14216
14763
|
type: "button",
|
|
@@ -14219,14 +14766,14 @@ function Chat({
|
|
|
14219
14766
|
"ml-1 rounded-full p-0.5",
|
|
14220
14767
|
item.status === "error" ? "text-destructive hover:bg-destructive/20" : "hover:bg-muted-foreground/20"
|
|
14221
14768
|
),
|
|
14222
|
-
children: /* @__PURE__ */
|
|
14769
|
+
children: /* @__PURE__ */ jsx50(X5, { size: 12 })
|
|
14223
14770
|
}
|
|
14224
14771
|
)
|
|
14225
14772
|
]
|
|
14226
14773
|
},
|
|
14227
14774
|
item.localId
|
|
14228
14775
|
)) }),
|
|
14229
|
-
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(
|
|
14230
14777
|
ReferenceChip,
|
|
14231
14778
|
{
|
|
14232
14779
|
reference,
|
|
@@ -14240,16 +14787,16 @@ function Chat({
|
|
|
14240
14787
|
},
|
|
14241
14788
|
getReferenceKey(reference)
|
|
14242
14789
|
)) }),
|
|
14243
|
-
detachedRunRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */
|
|
14244
|
-
/* @__PURE__ */
|
|
14245
|
-
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(
|
|
14246
14793
|
"span",
|
|
14247
14794
|
{
|
|
14248
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",
|
|
14249
14796
|
children: [
|
|
14250
|
-
/* @__PURE__ */
|
|
14251
|
-
/* @__PURE__ */
|
|
14252
|
-
/* @__PURE__ */
|
|
14797
|
+
/* @__PURE__ */ jsx50(RuntimeCapabilityIcon, { option, variant: "chip" }),
|
|
14798
|
+
/* @__PURE__ */ jsx50("span", { className: "max-w-40 truncate", children: option.label }),
|
|
14799
|
+
/* @__PURE__ */ jsx50(
|
|
14253
14800
|
"button",
|
|
14254
14801
|
{
|
|
14255
14802
|
type: "button",
|
|
@@ -14257,7 +14804,7 @@ function Chat({
|
|
|
14257
14804
|
className: "rounded-full p-0.5 hover:bg-primary/15",
|
|
14258
14805
|
title: t("composer.capabilities.removeRunCapability"),
|
|
14259
14806
|
"aria-label": t("composer.capabilities.removeRunCapability"),
|
|
14260
|
-
children: /* @__PURE__ */
|
|
14807
|
+
children: /* @__PURE__ */ jsx50(X5, { size: 11 })
|
|
14261
14808
|
}
|
|
14262
14809
|
)
|
|
14263
14810
|
]
|
|
@@ -14265,7 +14812,7 @@ function Chat({
|
|
|
14265
14812
|
`${option.type}:${option.id}`
|
|
14266
14813
|
))
|
|
14267
14814
|
] }),
|
|
14268
|
-
/* @__PURE__ */
|
|
14815
|
+
/* @__PURE__ */ jsx50(
|
|
14269
14816
|
PendingRuntimeServices,
|
|
14270
14817
|
{
|
|
14271
14818
|
state: stream.runtimeActivities.sandboxServices,
|
|
@@ -14274,7 +14821,7 @@ function Chat({
|
|
|
14274
14821
|
className: hasPendingTodos || hasPendingFollowUps ? "mb-2" : void 0
|
|
14275
14822
|
}
|
|
14276
14823
|
),
|
|
14277
|
-
/* @__PURE__ */
|
|
14824
|
+
/* @__PURE__ */ jsx50(
|
|
14278
14825
|
PendingTodos,
|
|
14279
14826
|
{
|
|
14280
14827
|
snapshot: stream.todos,
|
|
@@ -14282,7 +14829,7 @@ function Chat({
|
|
|
14282
14829
|
className: hasPendingFollowUps ? "mb-2" : void 0
|
|
14283
14830
|
}
|
|
14284
14831
|
),
|
|
14285
|
-
/* @__PURE__ */
|
|
14832
|
+
/* @__PURE__ */ jsx50(
|
|
14286
14833
|
PendingFollowUps,
|
|
14287
14834
|
{
|
|
14288
14835
|
items: pendingFollowUps,
|
|
@@ -14297,7 +14844,7 @@ function Chat({
|
|
|
14297
14844
|
attachToComposer: true
|
|
14298
14845
|
}
|
|
14299
14846
|
),
|
|
14300
|
-
/* @__PURE__ */
|
|
14847
|
+
/* @__PURE__ */ jsx50(
|
|
14301
14848
|
RequestUserInputPanel,
|
|
14302
14849
|
{
|
|
14303
14850
|
request: stream.pendingRequestUserInput,
|
|
@@ -14306,7 +14853,7 @@ function Chat({
|
|
|
14306
14853
|
attachToComposer: true
|
|
14307
14854
|
}
|
|
14308
14855
|
),
|
|
14309
|
-
/* @__PURE__ */
|
|
14856
|
+
/* @__PURE__ */ jsx50(
|
|
14310
14857
|
HITLApprovalPanel,
|
|
14311
14858
|
{
|
|
14312
14859
|
request: stream.pendingHITLRequest,
|
|
@@ -14315,7 +14862,7 @@ function Chat({
|
|
|
14315
14862
|
attachToComposer: true
|
|
14316
14863
|
}
|
|
14317
14864
|
),
|
|
14318
|
-
runtimeCapabilityPalette && /* @__PURE__ */
|
|
14865
|
+
runtimeCapabilityPalette && /* @__PURE__ */ jsx50(
|
|
14319
14866
|
SlashPalette,
|
|
14320
14867
|
{
|
|
14321
14868
|
palette: runtimeCapabilityPalette,
|
|
@@ -14329,7 +14876,7 @@ function Chat({
|
|
|
14329
14876
|
onSelect: selectSlashPaletteOption
|
|
14330
14877
|
}
|
|
14331
14878
|
),
|
|
14332
|
-
/* @__PURE__ */
|
|
14879
|
+
/* @__PURE__ */ jsx50("form", { className: "flex items-end", onSubmit: handleSubmit, children: /* @__PURE__ */ jsxs33(
|
|
14333
14880
|
"div",
|
|
14334
14881
|
{
|
|
14335
14882
|
"data-slot": "composer-input-shell",
|
|
@@ -14343,7 +14890,7 @@ function Chat({
|
|
|
14343
14890
|
composerInputRoundedClass
|
|
14344
14891
|
),
|
|
14345
14892
|
children: [
|
|
14346
|
-
/* @__PURE__ */
|
|
14893
|
+
/* @__PURE__ */ jsx50(
|
|
14347
14894
|
"div",
|
|
14348
14895
|
{
|
|
14349
14896
|
ref: composerInputRef,
|
|
@@ -14365,7 +14912,7 @@ function Chat({
|
|
|
14365
14912
|
(missingConfig || isHistoryLoading || hasPendingInteractiveRequest) && "cursor-not-allowed opacity-50"
|
|
14366
14913
|
),
|
|
14367
14914
|
children: renderedComposerParts.map(
|
|
14368
|
-
(part, index) => part.type === "text" ? /* @__PURE__ */
|
|
14915
|
+
(part, index) => part.type === "text" ? /* @__PURE__ */ jsx50(React45.Fragment, { children: part.text }, `text-${index}`) : /* @__PURE__ */ jsxs33(
|
|
14369
14916
|
"span",
|
|
14370
14917
|
{
|
|
14371
14918
|
"data-composer-capability-key": part.key,
|
|
@@ -14374,14 +14921,14 @@ function Chat({
|
|
|
14374
14921
|
contentEditable: false,
|
|
14375
14922
|
className: "mx-0.5 inline-flex max-w-[14rem] select-none items-center gap-1 text-sm font-semibold text-primary align-baseline",
|
|
14376
14923
|
children: [
|
|
14377
|
-
/* @__PURE__ */
|
|
14924
|
+
/* @__PURE__ */ jsx50(
|
|
14378
14925
|
RuntimeCapabilityIcon,
|
|
14379
14926
|
{
|
|
14380
14927
|
option: part.capability,
|
|
14381
14928
|
variant: "chip"
|
|
14382
14929
|
}
|
|
14383
14930
|
),
|
|
14384
|
-
/* @__PURE__ */
|
|
14931
|
+
/* @__PURE__ */ jsx50("span", { className: "truncate", children: part.capability.label })
|
|
14385
14932
|
]
|
|
14386
14933
|
},
|
|
14387
14934
|
part.key
|
|
@@ -14390,14 +14937,14 @@ function Chat({
|
|
|
14390
14937
|
},
|
|
14391
14938
|
composerDomVersion
|
|
14392
14939
|
),
|
|
14393
|
-
/* @__PURE__ */
|
|
14940
|
+
/* @__PURE__ */ jsxs33(
|
|
14394
14941
|
"div",
|
|
14395
14942
|
{
|
|
14396
14943
|
"data-slot": "composer-action-bar",
|
|
14397
14944
|
className: "pointer-events-none absolute inset-x-1.5 bottom-1 flex min-h-10 items-center justify-between gap-2",
|
|
14398
14945
|
children: [
|
|
14399
|
-
/* @__PURE__ */
|
|
14400
|
-
/* @__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(
|
|
14401
14948
|
ComposerMenu,
|
|
14402
14949
|
{
|
|
14403
14950
|
composer,
|
|
@@ -14412,20 +14959,20 @@ function Chat({
|
|
|
14412
14959
|
disabled: missingConfig || isHistoryLoading || hasPendingInteractiveRequest
|
|
14413
14960
|
}
|
|
14414
14961
|
) }),
|
|
14415
|
-
selectedTool && /* @__PURE__ */
|
|
14416
|
-
/* @__PURE__ */
|
|
14417
|
-
/* @__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(
|
|
14418
14965
|
"button",
|
|
14419
14966
|
{
|
|
14420
14967
|
type: "button",
|
|
14421
14968
|
onClick: () => setSelectedTool(null),
|
|
14422
14969
|
className: "shrink-0 rounded-full p-0.5 text-primary/70 hover:bg-primary/10 hover:text-primary",
|
|
14423
|
-
children: /* @__PURE__ */
|
|
14970
|
+
children: /* @__PURE__ */ jsx50(X5, { size: 12 })
|
|
14424
14971
|
}
|
|
14425
14972
|
)
|
|
14426
14973
|
] })
|
|
14427
14974
|
] }),
|
|
14428
|
-
/* @__PURE__ */
|
|
14975
|
+
/* @__PURE__ */ jsx50("div", { className: "pointer-events-auto shrink-0", children: /* @__PURE__ */ jsx50(
|
|
14429
14976
|
SendButton,
|
|
14430
14977
|
{
|
|
14431
14978
|
disabled: isSendDisabled,
|
|
@@ -14452,7 +14999,7 @@ function Chat({
|
|
|
14452
14999
|
]
|
|
14453
15000
|
}
|
|
14454
15001
|
) }),
|
|
14455
|
-
disclaimer?.text && /* @__PURE__ */
|
|
15002
|
+
disclaimer?.text && /* @__PURE__ */ jsx50(
|
|
14456
15003
|
"p",
|
|
14457
15004
|
{
|
|
14458
15005
|
className: cn(
|
|
@@ -14462,12 +15009,12 @@ function Chat({
|
|
|
14462
15009
|
children: disclaimer.text
|
|
14463
15010
|
}
|
|
14464
15011
|
),
|
|
14465
|
-
/* @__PURE__ */
|
|
14466
|
-
/* @__PURE__ */
|
|
14467
|
-
/* @__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" })
|
|
14468
15015
|
] })
|
|
14469
15016
|
] }),
|
|
14470
|
-
/* @__PURE__ */
|
|
15017
|
+
/* @__PURE__ */ jsx50(
|
|
14471
15018
|
SettingsSheet,
|
|
14472
15019
|
{
|
|
14473
15020
|
open: petSettingsOpen,
|
|
@@ -14477,17 +15024,17 @@ function Chat({
|
|
|
14477
15024
|
onSave: savePetLocalSettings
|
|
14478
15025
|
}
|
|
14479
15026
|
),
|
|
14480
|
-
/* @__PURE__ */
|
|
15027
|
+
/* @__PURE__ */ jsx50(PetBridge, { pet: effectivePet, state: petAutoState })
|
|
14481
15028
|
]
|
|
14482
15029
|
}
|
|
14483
15030
|
);
|
|
14484
15031
|
}
|
|
14485
15032
|
|
|
14486
15033
|
// src/components/ui/separator.tsx
|
|
14487
|
-
import * as
|
|
14488
|
-
import { jsx as
|
|
14489
|
-
var Separator =
|
|
14490
|
-
({ 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(
|
|
14491
15038
|
"div",
|
|
14492
15039
|
{
|
|
14493
15040
|
ref,
|