@xpert-ai/chatkit-ui 0.2.3 → 0.2.4
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-DzQ0SA2v.js → _baseUniq-DCHOaIXd.js} +1 -1
- package/dist/app/assets/{abap-DR8eps8p.js → abap-DYFKFjsN.js} +1 -1
- package/dist/app/assets/{abnf-CBLr9nM8.js → abnf-zH5ls3se.js} +1 -1
- package/dist/app/assets/{actionscript-DhvXdi4A.js → actionscript-CV98T-eF.js} +1 -1
- package/dist/app/assets/{ada-16MqtewL.js → ada-DUb5CQbw.js} +1 -1
- package/dist/app/assets/{agda-BTBRIOUM.js → agda-CvO1T8H-.js} +1 -1
- package/dist/app/assets/{al-BOex15of.js → al-D79a9PAZ.js} +1 -1
- package/dist/app/assets/{antlr4-CSUao1vy.js → antlr4-G_8ouN_I.js} +1 -1
- package/dist/app/assets/{apacheconf-DqlfH1Dz.js → apacheconf-BFg3ExMT.js} +1 -1
- package/dist/app/assets/{apex-DLYw9qDO.js → apex-9eHj7hVs.js} +1 -1
- package/dist/app/assets/{apl-OwgUQI-a.js → apl-DsD5l_Xq.js} +1 -1
- package/dist/app/assets/{applescript-BVtPJ3-1.js → applescript-DYBvJjEH.js} +1 -1
- package/dist/app/assets/{aql-D2XdkUsh.js → aql-BbBmRYHx.js} +1 -1
- package/dist/app/assets/{arc-B11jg60S.js → arc-C75AQsaV.js} +1 -1
- package/dist/app/assets/{architectureDiagram-Q4EWVU46-Dh-x5cZ2.js → architectureDiagram-Q4EWVU46-CMp0SSVM.js} +1 -1
- package/dist/app/assets/{arduino-DVApw0vW.js → arduino-nywAmrBj.js} +1 -1
- package/dist/app/assets/{arff-DAszzWcY.js → arff-BzKdnQU5.js} +1 -1
- package/dist/app/assets/{asciidoc-CNeYi52F.js → asciidoc-C1iRod-G.js} +1 -1
- package/dist/app/assets/{asm6502-Dhz7ZSIs.js → asm6502-D-Fihw_0.js} +1 -1
- package/dist/app/assets/{asmatmel-i1fAAaqo.js → asmatmel-CB4Q9gMz.js} +1 -1
- package/dist/app/assets/{aspnet-DQAa2TVV.js → aspnet-SRoKRzBw.js} +1 -1
- package/dist/app/assets/{autohotkey-A9gtkr8t.js → autohotkey-C_fb5yEt.js} +1 -1
- package/dist/app/assets/{autoit-GvuMgaCZ.js → autoit-CFZCBmZA.js} +1 -1
- package/dist/app/assets/{avisynth-cVPp3_N3.js → avisynth-DKfM5uxE.js} +1 -1
- package/dist/app/assets/{avro-idl-Bz4yO6ZW.js → avro-idl-D74Am7ta.js} +1 -1
- package/dist/app/assets/{bash-BIJeTo-w.js → bash-Cal6jyV6.js} +1 -1
- package/dist/app/assets/{basic-DOzgrCVL.js → basic-CNf4k-nm.js} +1 -1
- package/dist/app/assets/{batch-_E9ZnFfc.js → batch-DY3ZQ6G-.js} +1 -1
- package/dist/app/assets/{bbcode-CA_lFpGl.js → bbcode-9YM2xWBz.js} +1 -1
- package/dist/app/assets/{bicep-CLBFeDBV.js → bicep-Berqk4wf.js} +1 -1
- package/dist/app/assets/{birb-B1Itss7Y.js → birb-rpV4F7RD.js} +1 -1
- package/dist/app/assets/{bison-DF5I7qes.js → bison-D5xZCggb.js} +1 -1
- package/dist/app/assets/{blockDiagram-DXYQGD6D-BlIgOJ9q.js → blockDiagram-DXYQGD6D-oJf3CyoN.js} +1 -1
- package/dist/app/assets/{bnf-Dxq1fVox.js → bnf-B-i8TNtu.js} +1 -1
- package/dist/app/assets/{brainfuck-DNhbtBiY.js → brainfuck-SJM1Fopl.js} +1 -1
- package/dist/app/assets/{brightscript-58YXM0yt.js → brightscript-Cz8Vr8hW.js} +1 -1
- package/dist/app/assets/{bro-Bf3vveUf.js → bro-kB0j5nTH.js} +1 -1
- package/dist/app/assets/{bsl-CspQJ60y.js → bsl-C1hOw3RD.js} +1 -1
- package/dist/app/assets/{c-CJNr6Ka2.js → c-B2c7pJKh.js} +1 -1
- package/dist/app/assets/{c4Diagram-AHTNJAMY-D-Gbsa2E.js → c4Diagram-AHTNJAMY-D9-KG4WK.js} +1 -1
- package/dist/app/assets/{cfscript-CYRXgv8J.js → cfscript-CzfngAPR.js} +1 -1
- package/dist/app/assets/{chaiscript-DeKmYs_R.js → chaiscript-C_qqC7TS.js} +1 -1
- package/dist/app/assets/channel-D-o_Hr5V.js +1 -0
- package/dist/app/assets/{chunk-4BX2VUAB-MX8ZFd1E.js → chunk-4BX2VUAB-BS2jWwUY.js} +1 -1
- package/dist/app/assets/{chunk-4TB4RGXK-DPvVA8rl.js → chunk-4TB4RGXK-DgXTj1Uf.js} +1 -1
- package/dist/app/assets/{chunk-55IACEB6-Cr5vY6Jq.js → chunk-55IACEB6-BDzaN3lg.js} +1 -1
- package/dist/app/assets/{chunk-EDXVE4YY-BysDjS79.js → chunk-EDXVE4YY-DrzDcbYI.js} +1 -1
- package/dist/app/assets/{chunk-FMBD7UC4-BmkFUoNv.js → chunk-FMBD7UC4-VkOaTv37.js} +1 -1
- package/dist/app/assets/{chunk-OYMX7WX6-DYW7vEWD.js → chunk-OYMX7WX6-Bhw0ZcHi.js} +1 -1
- package/dist/app/assets/{chunk-QZHKN3VN-DHpvF0CD.js → chunk-QZHKN3VN-BWzUFeuc.js} +1 -1
- package/dist/app/assets/{chunk-YZCP3GAM-BD5TWb58.js → chunk-YZCP3GAM-CO9OlxPm.js} +1 -1
- package/dist/app/assets/{cil-DfgHGr_0.js → cil-CrZSDG5m.js} +1 -1
- package/dist/app/assets/classDiagram-6PBFFD2Q-ijDxKGrA.js +1 -0
- package/dist/app/assets/classDiagram-v2-HSJHXN6E-ijDxKGrA.js +1 -0
- package/dist/app/assets/{clike-DiAQPSJx.js → clike-Ng4JM0Pu.js} +1 -1
- package/dist/app/assets/{clojure-CzRd0TyK.js → clojure-DQbgMmPD.js} +1 -1
- package/dist/app/assets/clone-Bqf7ME8s.js +1 -0
- package/dist/app/assets/{cmake-Di4YPRGV.js → cmake-DLVNd6fm.js} +1 -1
- package/dist/app/assets/{cobol-C4wUmbmP.js → cobol-6iRlThNg.js} +1 -1
- package/dist/app/assets/{coffeescript-C5ITEnPe.js → coffeescript-B_qC-e4P.js} +1 -1
- package/dist/app/assets/{concurnas-x1X14lNV.js → concurnas-DL--yQS8.js} +1 -1
- package/dist/app/assets/{coq-BBY91RAn.js → coq-BpWBqfZR.js} +1 -1
- package/dist/app/assets/{core-CO9WyBrQ.js → core-Dr9jOv_1.js} +1 -1
- package/dist/app/assets/{cose-bilkent-S5V4N54A-CHLf33P6.js → cose-bilkent-S5V4N54A-Do4xRj7A.js} +1 -1
- package/dist/app/assets/{cpp-WDK6aBQO.js → cpp-TTGiXxds.js} +1 -1
- package/dist/app/assets/{crystal-CecYQEE2.js → crystal-CL7Fr0R0.js} +1 -1
- package/dist/app/assets/{csharp-CypBMJQG.js → csharp-WTqH2gf0.js} +1 -1
- package/dist/app/assets/{cshtml-D9JfqVQb.js → cshtml-DZBbDi4b.js} +1 -1
- package/dist/app/assets/{csp-B9uPuoq2.js → csp-B6F4tUnj.js} +1 -1
- package/dist/app/assets/{css-5_22DRPt.js → css-7Y4UnI8j.js} +1 -1
- package/dist/app/assets/{css-extras-BXrw8FX5.js → css-extras-BsfnxUXj.js} +1 -1
- package/dist/app/assets/{csv-C42TKQ1u.js → csv-6iVQM8Ry.js} +1 -1
- package/dist/app/assets/{cypher-CXsIeZHb.js → cypher-CAw4P4D4.js} +1 -1
- package/dist/app/assets/{d-C6EUXFFa.js → d-BfY7brqT.js} +1 -1
- package/dist/app/assets/{dagre-KV5264BT-DT4yTlX3.js → dagre-KV5264BT-Cuho0mQq.js} +1 -1
- package/dist/app/assets/{dart-Cn40XGfT.js → dart-CKFUtMTd.js} +1 -1
- package/dist/app/assets/{dataweave-BCEdEmV6.js → dataweave-BYhpJ_4c.js} +1 -1
- package/dist/app/assets/{dax-DQJs8HsJ.js → dax-DnPQI4c_.js} +1 -1
- package/dist/app/assets/{dhall-BeBLMQCU.js → dhall-DWuBCzWw.js} +1 -1
- package/dist/app/assets/{diagram-5BDNPKRD-DZfKvy59.js → diagram-5BDNPKRD-ByDGi5qC.js} +1 -1
- package/dist/app/assets/{diagram-G4DWMVQ6-DQPEni6t.js → diagram-G4DWMVQ6-DQNEEqUC.js} +1 -1
- package/dist/app/assets/{diagram-MMDJMWI5-Bwe5Uki4.js → diagram-MMDJMWI5-BO-ooUPy.js} +1 -1
- package/dist/app/assets/{diagram-TYMM5635-BUfRZNS0.js → diagram-TYMM5635-jpOCdQ8E.js} +1 -1
- package/dist/app/assets/{diff-BLmUVYWj.js → diff-D-1vQM8S.js} +1 -1
- package/dist/app/assets/{django-DFQjTU_C.js → django-DU4tmXKz.js} +1 -1
- package/dist/app/assets/{dns-zone-file-BSBHrpmE.js → dns-zone-file-DaWto_nq.js} +1 -1
- package/dist/app/assets/{docker-C0-Zu3eq.js → docker-Ik2CnNE1.js} +1 -1
- package/dist/app/assets/{dot-BBadEBkR.js → dot-DQjqFt6e.js} +1 -1
- package/dist/app/assets/{ebnf-MMlpI_EZ.js → ebnf-BHVyACux.js} +1 -1
- package/dist/app/assets/{editorconfig-CZX1R6p3.js → editorconfig-b6Bb62sq.js} +1 -1
- package/dist/app/assets/{eiffel-DFM671l9.js → eiffel-hHt5ATQw.js} +1 -1
- package/dist/app/assets/{ejs-DAS1q__0.js → ejs-D6HBsHnX.js} +1 -1
- package/dist/app/assets/{elixir-YslAVjQl.js → elixir-CRgh7aqC.js} +1 -1
- package/dist/app/assets/{elm-B2VQvIpo.js → elm-Ddnpl41i.js} +1 -1
- package/dist/app/assets/{erDiagram-SMLLAGMA-CZ2a8lxh.js → erDiagram-SMLLAGMA-dytGhnT9.js} +1 -1
- package/dist/app/assets/{erb-ChvVsnHQ.js → erb-Bx54p7Zs.js} +1 -1
- package/dist/app/assets/{erlang-DL9xxOwA.js → erlang-clBiynHW.js} +1 -1
- package/dist/app/assets/{etlua-DhysrEbs.js → etlua-Dt0ivN__.js} +1 -1
- package/dist/app/assets/{excel-formula-CZZ5R2JA.js → excel-formula-F9U8SuzA.js} +1 -1
- package/dist/app/assets/{factor-jhnkZuVK.js → factor-DoLXkt-t.js} +1 -1
- package/dist/app/assets/{false-Dv_wG72f.js → false-QNTISwlM.js} +1 -1
- package/dist/app/assets/{firestore-security-rules-t0nFWkqQ.js → firestore-security-rules-R44oZYns.js} +1 -1
- package/dist/app/assets/{flow-C7ulbaOY.js → flow-ClYmRLFv.js} +1 -1
- package/dist/app/assets/{flowDiagram-DWJPFMVM-CrpCHmJq.js → flowDiagram-DWJPFMVM-DX8gzT2Y.js} +1 -1
- package/dist/app/assets/{fortran-B8z2x2oi.js → fortran-BisBnhlh.js} +1 -1
- package/dist/app/assets/{fsharp-Ba28Tkek.js → fsharp-DVRmLH6U.js} +1 -1
- package/dist/app/assets/{ftl-BZ1IbNLj.js → ftl-CfUCvbrK.js} +1 -1
- package/dist/app/assets/{ganttDiagram-T4ZO3ILL-B3Z_csg_.js → ganttDiagram-T4ZO3ILL-969UcfDu.js} +1 -1
- package/dist/app/assets/{gap-B3t7yCZG.js → gap-tik2h6BA.js} +1 -1
- package/dist/app/assets/{gcode-DFVfERQ2.js → gcode-B8dHdHUe.js} +1 -1
- package/dist/app/assets/{gdscript-CqdEvUjn.js → gdscript-Bk2Hc6AL.js} +1 -1
- package/dist/app/assets/{gedcom-C9diVbA9.js → gedcom-C5zi3PfH.js} +1 -1
- package/dist/app/assets/{gherkin-BlR3PN7e.js → gherkin-bs38lN55.js} +1 -1
- package/dist/app/assets/{git-Cjxdisrq.js → git-DJqaSHyR.js} +1 -1
- package/dist/app/assets/{gitGraphDiagram-UUTBAWPF-B3z3hAtB.js → gitGraphDiagram-UUTBAWPF-D_gJDnlT.js} +1 -1
- package/dist/app/assets/{glsl-DTHX9nHp.js → glsl-CW471Xag.js} +1 -1
- package/dist/app/assets/{gml-CRR7Ph2X.js → gml-CLFjREMP.js} +1 -1
- package/dist/app/assets/{gn-GTG2QsZC.js → gn-rVVgWmkA.js} +1 -1
- package/dist/app/assets/{go-tOmxZMpz.js → go-BTKfIo0J.js} +1 -1
- package/dist/app/assets/{go-module-BBQCjG8Y.js → go-module-QpXoQ-pO.js} +1 -1
- package/dist/app/assets/{graph-BcIAkwDX.js → graph-BI43yyK8.js} +1 -1
- package/dist/app/assets/{graphql-B-C3ep4p.js → graphql-SsnI0uQj.js} +1 -1
- package/dist/app/assets/{groovy-Cnmw1n-J.js → groovy-bdYEBds3.js} +1 -1
- package/dist/app/assets/{haml-Dr_EAxxL.js → haml-DxpGSv_U.js} +1 -1
- package/dist/app/assets/{handlebars-CuBeiows.js → handlebars-4VDYlzAe.js} +1 -1
- package/dist/app/assets/{haskell-4BlJr0ez.js → haskell-BByxjCTh.js} +1 -1
- package/dist/app/assets/{haxe-BN-tu2wO.js → haxe-DVuFuVFN.js} +1 -1
- package/dist/app/assets/{hcl-Cprh_ahQ.js → hcl-Cz72nNVE.js} +1 -1
- package/dist/app/assets/{hlsl-JCJdPBMR.js → hlsl-BBqcewVV.js} +1 -1
- package/dist/app/assets/{hoon-iplBI-EZ.js → hoon-n12ysYoQ.js} +1 -1
- package/dist/app/assets/{hpkp-DNucyB-F.js → hpkp-BTxS2_zs.js} +1 -1
- package/dist/app/assets/{hsts-X48MRVks.js → hsts-C6lDSyQ5.js} +1 -1
- package/dist/app/assets/{http-DMf3JD0c.js → http--YpnO3-q.js} +1 -1
- package/dist/app/assets/{ichigojam-A3mheAFx.js → ichigojam-JwX9GkUD.js} +1 -1
- package/dist/app/assets/{icon-B9Im5nq2.js → icon-BAhnrKR4.js} +1 -1
- package/dist/app/assets/{icu-message-format-DATRDFfp.js → icu-message-format-JdDEaXvU.js} +1 -1
- package/dist/app/assets/{idris-CbWamNvZ.js → idris-DAWaJC2V.js} +1 -1
- package/dist/app/assets/{iecst-DZNm9Mw9.js → iecst-DHRCsH04.js} +1 -1
- package/dist/app/assets/{ignore-hVhXaxhq.js → ignore-0sDn2yik.js} +1 -1
- package/dist/app/assets/{index-Cz5CeQBn.js → index-D8ozx_tP.js} +167 -167
- package/dist/app/assets/index-DK8Q12J8.css +1 -0
- package/dist/app/assets/{infoDiagram-42DDH7IO-BFTvidbU.js → infoDiagram-42DDH7IO-Dg9Fd0ty.js} +1 -1
- package/dist/app/assets/{inform7-BFwb1JBF.js → inform7-D0af-YYR.js} +1 -1
- package/dist/app/assets/{ini-BGOvqj52.js → ini-CVlD06CI.js} +1 -1
- package/dist/app/assets/{io-DmFujWtX.js → io-DnWyrkbx.js} +1 -1
- package/dist/app/assets/{ishikawaDiagram-UXIWVN3A-rw4oZldP.js → ishikawaDiagram-UXIWVN3A-fHwsNA44.js} +1 -1
- package/dist/app/assets/{j-L04eGgbe.js → j-C8SpfnMw.js} +1 -1
- package/dist/app/assets/{java-DtR2dfTe.js → java-BWkZTW6j.js} +1 -1
- package/dist/app/assets/{javadoc-BL0Un04A.js → javadoc-C8qnQOTO.js} +1 -1
- package/dist/app/assets/{javadoclike-CGvGCJP8.js → javadoclike-bX_OVek-.js} +1 -1
- package/dist/app/assets/{javascript-_VOBXqTy.js → javascript-V3ibTpyL.js} +1 -1
- package/dist/app/assets/{javastacktrace-CXMuurBY.js → javastacktrace-BCZc50Tu.js} +1 -1
- package/dist/app/assets/{jexl-DmddlcpL.js → jexl-tAxBTDKw.js} +1 -1
- package/dist/app/assets/{jolie-B9TLYr2t.js → jolie-Dff9fsgf.js} +1 -1
- package/dist/app/assets/{journeyDiagram-VCZTEJTY-DvIyQ46V.js → journeyDiagram-VCZTEJTY-cwNvl3pH.js} +1 -1
- package/dist/app/assets/{jq-Did4MnkY.js → jq-xzayTOJp.js} +1 -1
- package/dist/app/assets/{js-extras-B9x9O8JT.js → js-extras-Du3PEq5P.js} +1 -1
- package/dist/app/assets/{js-templates-BBDK5hFZ.js → js-templates-CU7Nzbz3.js} +1 -1
- package/dist/app/assets/{jsdoc-BEir3g06.js → jsdoc-CEMFzTRv.js} +1 -1
- package/dist/app/assets/{json-CdIthXIR.js → json-Btilzupb.js} +1 -1
- package/dist/app/assets/{json5-C94MM90k.js → json5-wzRgp8BP.js} +1 -1
- package/dist/app/assets/{jsonp-Ui49JQJT.js → jsonp-Cdz_ZVi-.js} +1 -1
- package/dist/app/assets/{jsstacktrace-GS5zfLmt.js → jsstacktrace-DfJsAKhL.js} +1 -1
- package/dist/app/assets/{jsx-JqHBZpRM.js → jsx-BAq23oeN.js} +1 -1
- package/dist/app/assets/{julia-CgHdwLVO.js → julia--lqnnI7n.js} +1 -1
- package/dist/app/assets/{kanban-definition-6JOO6SKY-Ca6QO1Tg.js → kanban-definition-6JOO6SKY-BGaRNaGv.js} +1 -1
- package/dist/app/assets/{keepalived-Bmgj_rLw.js → keepalived-Adel5-Qs.js} +1 -1
- package/dist/app/assets/{keyman-CiwNhuuQ.js → keyman-1ng1tgos.js} +1 -1
- package/dist/app/assets/{kotlin-CcL0JifW.js → kotlin-ClyqEjbK.js} +1 -1
- package/dist/app/assets/{kumir-fVhhLR_P.js → kumir-BbQwMuq3.js} +1 -1
- package/dist/app/assets/{kusto-C3rhIoMz.js → kusto-B2tea2D_.js} +1 -1
- package/dist/app/assets/{latex-CABNiVFe.js → latex-BhbvZO_z.js} +1 -1
- package/dist/app/assets/{latte-CG2RZA9M.js → latte-CY_W9Xsj.js} +1 -1
- package/dist/app/assets/{layout-tcAskzqL.js → layout-DoLJJFhB.js} +1 -1
- package/dist/app/assets/{less-BOcIT7wH.js → less-CXTtnkP_.js} +1 -1
- package/dist/app/assets/{lilypond-DTbYoNo8.js → lilypond-DyFFxXMT.js} +1 -1
- package/dist/app/assets/{linear-CPrcCcCv.js → linear-_7YKVwLH.js} +1 -1
- package/dist/app/assets/{liquid-BCZO7m44.js → liquid-DbQWxgrK.js} +1 -1
- package/dist/app/assets/{lisp-BMXVvohv.js → lisp-BLvOxZau.js} +1 -1
- package/dist/app/assets/{livescript-CKeufav4.js → livescript-Bse_tVbP.js} +1 -1
- package/dist/app/assets/{llvm-UpF1VMr2.js → llvm-BJAAZGCr.js} +1 -1
- package/dist/app/assets/{log-fhyqj0K-.js → log-C2rDCiGU.js} +1 -1
- package/dist/app/assets/{lolcode-bIhV1fJY.js → lolcode-CByKXEzE.js} +1 -1
- package/dist/app/assets/{lua-0dHcPlfB.js → lua-BvHUEw4v.js} +1 -1
- package/dist/app/assets/{magma-BfPOMrKo.js → magma-BCXhvfqF.js} +1 -1
- package/dist/app/assets/{makefile-BYCOV-TN.js → makefile-CWon8mM-.js} +1 -1
- package/dist/app/assets/{markdown-DydBMIKl.js → markdown-Dxpi7dY0.js} +1 -1
- package/dist/app/assets/{markup-OM8UDBkj.js → markup-D95ro_TO.js} +1 -1
- package/dist/app/assets/{markup-templating-DEBEGvrR.js → markup-templating-DVUrCSk3.js} +1 -1
- package/dist/app/assets/{matlab-BCJ80Tnf.js → matlab-DDSAyZYZ.js} +1 -1
- package/dist/app/assets/{maxscript-CzOcvVMH.js → maxscript-CGp2lRJy.js} +1 -1
- package/dist/app/assets/{mel-DOrlXdWC.js → mel-ADkoma2O.js} +1 -1
- package/dist/app/assets/{mermaid-DJJu3LoI.js → mermaid-CxxPvzCG.js} +1 -1
- package/dist/app/assets/{min-x5PC5TQi.js → min-B0Pw9MZp.js} +1 -1
- package/dist/app/assets/{mindmap-definition-QFDTVHPH-D5GjC84m.js → mindmap-definition-QFDTVHPH-CkMNRcm7.js} +1 -1
- package/dist/app/assets/{mizar-DKXhcb11.js → mizar-C77TCrrK.js} +1 -1
- package/dist/app/assets/{mongodb-D2ZD10nu.js → mongodb-C2gyOHOO.js} +1 -1
- package/dist/app/assets/{monkey-ChB2nzXX.js → monkey-D74zotHv.js} +1 -1
- package/dist/app/assets/{moonscript-BKX9jE1e.js → moonscript-VoK1SBcN.js} +1 -1
- package/dist/app/assets/{n1ql-Chij5VbU.js → n1ql-DgI6FuFX.js} +1 -1
- package/dist/app/assets/{n4js-DqbQeqTU.js → n4js-C8ivjj-D.js} +1 -1
- package/dist/app/assets/{nand2tetris-hdl-BzSasv5V.js → nand2tetris-hdl-B8Hflzvo.js} +1 -1
- package/dist/app/assets/{naniscript-Dj2es8JV.js → naniscript-CQkQ8u-X.js} +1 -1
- package/dist/app/assets/{nasm-DavV44Vw.js → nasm-Bnmvd9g7.js} +1 -1
- package/dist/app/assets/{neon-Bt0TPF0U.js → neon-CwnTV7d_.js} +1 -1
- package/dist/app/assets/{nevod-CFmZEjsi.js → nevod-rFyceSaQ.js} +1 -1
- package/dist/app/assets/{nginx-Cik6tEjs.js → nginx-D5EgJyz8.js} +1 -1
- package/dist/app/assets/{nim-DRGeW9W1.js → nim-DmQ6I0wo.js} +1 -1
- package/dist/app/assets/{nix-r2P1wiJ3.js → nix-CE5G7cYy.js} +1 -1
- package/dist/app/assets/{nsis-pPoQr9g9.js → nsis-r9uy5rHS.js} +1 -1
- package/dist/app/assets/{objectivec-DEexrj85.js → objectivec-sUdU_McQ.js} +1 -1
- package/dist/app/assets/{ocaml-iLqIp1ZC.js → ocaml-DWlolY1r.js} +1 -1
- package/dist/app/assets/{opencl-Doo2Ss-U.js → opencl-BDJ-0tlk.js} +1 -1
- package/dist/app/assets/{openqasm-B-QrzDQF.js → openqasm-zKe3UqSB.js} +1 -1
- package/dist/app/assets/{oz-CCj_NNI6.js → oz-B599cB9D.js} +1 -1
- package/dist/app/assets/{parigp-Dh_rUWOK.js → parigp-DG1qWUmz.js} +1 -1
- package/dist/app/assets/{parser-DPXB3k37.js → parser-KP6l7Bkd.js} +1 -1
- package/dist/app/assets/{pascal-CfE_kEYg.js → pascal-DSqfIoj5.js} +1 -1
- package/dist/app/assets/{pascaligo-BaDJ_qJQ.js → pascaligo-yEDqvqMa.js} +1 -1
- package/dist/app/assets/{pcaxis-BaOJX8Uk.js → pcaxis-DZAv9j5Y.js} +1 -1
- package/dist/app/assets/{peoplecode-Dsk1xDE3.js → peoplecode-BkiTUgql.js} +1 -1
- package/dist/app/assets/{perl-DVXh0HWG.js → perl-BAuWk_AF.js} +1 -1
- package/dist/app/assets/{php-Br80FZc4.js → php-UOiURTkh.js} +1 -1
- package/dist/app/assets/{php-extras-_5YytZdT.js → php-extras-zXOBYsrh.js} +1 -1
- package/dist/app/assets/{phpdoc-DzJkTT0C.js → phpdoc-DrrOu-n3.js} +1 -1
- package/dist/app/assets/{pieDiagram-DEJITSTG-CLjkToC2.js → pieDiagram-DEJITSTG-BU4w3g0E.js} +1 -1
- package/dist/app/assets/{plsql-D0x1b7EK.js → plsql-DDvV5DJ6.js} +1 -1
- package/dist/app/assets/{powerquery-mE2QS59A.js → powerquery-eNDfhopw.js} +1 -1
- package/dist/app/assets/{powershell-DsIgo8ch.js → powershell-BOfebGK1.js} +1 -1
- package/dist/app/assets/{processing-CNQPhOxV.js → processing-COFYxXge.js} +1 -1
- package/dist/app/assets/{prolog-QVBL5psW.js → prolog-CygHrnIb.js} +1 -1
- package/dist/app/assets/{promql-D2BQ9J5X.js → promql-C_XT_ils.js} +1 -1
- package/dist/app/assets/{properties-DBHe8deM.js → properties-CQqv7rf9.js} +1 -1
- package/dist/app/assets/{protobuf-k4ob3_Fp.js → protobuf-NGDRoSo-.js} +1 -1
- package/dist/app/assets/{psl-DfubCZCd.js → psl-D7TvafoS.js} +1 -1
- package/dist/app/assets/{pug-CpkcB7mN.js → pug-II5FPelG.js} +1 -1
- package/dist/app/assets/{puppet-BsHTAyXm.js → puppet-BiJusNfn.js} +1 -1
- package/dist/app/assets/{pure-DPfMdTqM.js → pure-BKob3SEe.js} +1 -1
- package/dist/app/assets/{purebasic-Czo3021X.js → purebasic-C5LD2vVd.js} +1 -1
- package/dist/app/assets/{purescript-sHVCgaFR.js → purescript-DodP4X5h.js} +1 -1
- package/dist/app/assets/{q-v830Ng6r.js → q-BxbM98Fa.js} +1 -1
- package/dist/app/assets/{qml-4yaQXADl.js → qml-BTNHrTM5.js} +1 -1
- package/dist/app/assets/{qore-lDT-8iVP.js → qore-sdhJQoiA.js} +1 -1
- package/dist/app/assets/{qsharp-DW558eJI.js → qsharp-BM6eXnTQ.js} +1 -1
- package/dist/app/assets/{quadrantDiagram-34T5L4WZ-DmQ3vZoa.js → quadrantDiagram-34T5L4WZ-vBZtzCUg.js} +1 -1
- package/dist/app/assets/{r-DX9BfvW5.js → r-DFY0BtID.js} +1 -1
- package/dist/app/assets/{racket-C1dNiyi0.js → racket-bjVYdisc.js} +1 -1
- package/dist/app/assets/{reason-DIGSk4zT.js → reason-FlYtN8tB.js} +1 -1
- package/dist/app/assets/{regex-fu04T65Z.js → regex-M006VPak.js} +1 -1
- package/dist/app/assets/{rego-0hfkM-96.js → rego-C1BBwEH3.js} +1 -1
- package/dist/app/assets/{renpy-DWpObIPV.js → renpy-5f2fgUFB.js} +1 -1
- package/dist/app/assets/{requirementDiagram-MS252O5E-VML74gi8.js → requirementDiagram-MS252O5E-3k0Gx5lL.js} +1 -1
- package/dist/app/assets/{rest-EH2LxiRd.js → rest-BBBu0aG_.js} +1 -1
- package/dist/app/assets/{rip-0_c-t2FH.js → rip-Dv9oasfQ.js} +1 -1
- package/dist/app/assets/{roboconf-CUlfx6zA.js → roboconf-D_myJZUv.js} +1 -1
- package/dist/app/assets/{robotframework-DGq7_FcS.js → robotframework-rFlovfJ9.js} +1 -1
- package/dist/app/assets/{ruby-CDlwLofm.js → ruby-Bgc7Vw2_.js} +1 -1
- package/dist/app/assets/{rust-BIz9N9QT.js → rust-D4b-R14I.js} +1 -1
- package/dist/app/assets/{sankeyDiagram-XADWPNL6-CBNokzPM.js → sankeyDiagram-XADWPNL6-t0gGkSyZ.js} +1 -1
- package/dist/app/assets/{sas-DoHNY-V2.js → sas-pbrRNiWx.js} +1 -1
- package/dist/app/assets/{sass-DhJfJTuP.js → sass-D4M97AFb.js} +1 -1
- package/dist/app/assets/{scala-BRiFxUr7.js → scala-Ctrgfwrv.js} +1 -1
- package/dist/app/assets/{scheme-Y_IiH8AR.js → scheme-CrdhEtzS.js} +1 -1
- package/dist/app/assets/{scss-BSqh_3sF.js → scss-f1K_dFZB.js} +1 -1
- package/dist/app/assets/{sequenceDiagram-FGHM5R23-C25_OPti.js → sequenceDiagram-FGHM5R23-BA0riz8q.js} +1 -1
- package/dist/app/assets/{shell-session-L8mJuEa-.js → shell-session-uEVbRpm7.js} +1 -1
- package/dist/app/assets/{smali-CFIadkcU.js → smali-idhiSdRV.js} +1 -1
- package/dist/app/assets/{smalltalk-IlHX6nzs.js → smalltalk-BWtbyLoB.js} +1 -1
- package/dist/app/assets/{smarty-quZXiB48.js → smarty-C4SR0Dll.js} +1 -1
- package/dist/app/assets/{sml-BFnCJO2C.js → sml-yHsAc_xb.js} +1 -1
- package/dist/app/assets/{solidity-CkqU-KPK.js → solidity-B_ulpRxg.js} +1 -1
- package/dist/app/assets/{solution-file-Be-7szOe.js → solution-file-BF-cuPoO.js} +1 -1
- package/dist/app/assets/{soy-Dln_g-JO.js → soy-DoKdokZ4.js} +1 -1
- package/dist/app/assets/{sparql-DGLK9xgR.js → sparql-B6Tp3lOm.js} +1 -1
- package/dist/app/assets/{splunk-spl-DMGMi63f.js → splunk-spl-D9P8bZEE.js} +1 -1
- package/dist/app/assets/{sqf-D84Umqzn.js → sqf-B3R6BeUm.js} +1 -1
- package/dist/app/assets/{sql-DnbrSIsr.js → sql-JLORE-fM.js} +1 -1
- package/dist/app/assets/{squirrel-CkQIKklo.js → squirrel-BjJHWR4u.js} +1 -1
- package/dist/app/assets/{stan-BvtK3ekA.js → stan-C69vsFsF.js} +1 -1
- package/dist/app/assets/{stateDiagram-FHFEXIEX-VvSdFgD8.js → stateDiagram-FHFEXIEX-CwejF2ca.js} +1 -1
- package/dist/app/assets/stateDiagram-v2-QKLJ7IA2-_MwgZRrJ.js +1 -0
- package/dist/app/assets/{stylus-4K0taMYs.js → stylus-CMDXpCvd.js} +1 -1
- package/dist/app/assets/{swift-Ud1For_y.js → swift-DDFH45FM.js} +1 -1
- package/dist/app/assets/{systemd-Bs0MjdAL.js → systemd-BPxDX4du.js} +1 -1
- package/dist/app/assets/{t4-cs-CSf-ggDI.js → t4-cs-CEUt1ZUh.js} +1 -1
- package/dist/app/assets/{t4-templating-flfc0mDD.js → t4-templating-Cy-XTzOn.js} +1 -1
- package/dist/app/assets/{t4-vb-CK4hzxF3.js → t4-vb-Cn8yaRpE.js} +1 -1
- package/dist/app/assets/{tap-zQmao4UI.js → tap-C5KGmPzO.js} +1 -1
- package/dist/app/assets/{tcl-Ctj7xC4v.js → tcl-CmvEB-rE.js} +1 -1
- package/dist/app/assets/{textile-CSj34XS_.js → textile-BWJ0c_2I.js} +1 -1
- package/dist/app/assets/{timeline-definition-GMOUNBTQ-DzuHgoqK.js → timeline-definition-GMOUNBTQ-Bshw-jbJ.js} +1 -1
- package/dist/app/assets/{toml-Bst0_ndm.js → toml-Cl0aWiWi.js} +1 -1
- package/dist/app/assets/{tremor-CjxWXPTa.js → tremor-CseYtS_9.js} +1 -1
- package/dist/app/assets/{tt2-BDdighAF.js → tt2-BTKTVwFH.js} +1 -1
- package/dist/app/assets/{turtle-iwQOFidh.js → turtle-Bf5fhahy.js} +1 -1
- package/dist/app/assets/{twig-C5Xchozf.js → twig-CDlf9qp4.js} +1 -1
- package/dist/app/assets/{typescript-C2UBDB1Z.js → typescript-Vnsxz9UF.js} +1 -1
- package/dist/app/assets/{typoscript-BjBdI_o_.js → typoscript-BR_5FnLs.js} +1 -1
- package/dist/app/assets/{unrealscript-DmlxgIr2.js → unrealscript-BHy8SghN.js} +1 -1
- package/dist/app/assets/{uorazor-C_MIEl5P.js → uorazor-C9ritvHP.js} +1 -1
- package/dist/app/assets/{uri-C8meY3pd.js → uri-Bkl_4BLH.js} +1 -1
- package/dist/app/assets/{v-Cd7nzzre.js → v-DfAFS4qG.js} +1 -1
- package/dist/app/assets/{vala-BisYugr3.js → vala-BuVZ6PBL.js} +1 -1
- package/dist/app/assets/{vbnet-pe3mMXaF.js → vbnet-DyDDe_jV.js} +1 -1
- package/dist/app/assets/{velocity-DmTfdKTx.js → velocity-AoyjMNrO.js} +1 -1
- package/dist/app/assets/{vennDiagram-DHZGUBPP-Cpmt_zfD.js → vennDiagram-DHZGUBPP-DHhHGlca.js} +1 -1
- package/dist/app/assets/{verilog-B3u77-Bf.js → verilog-B2TKQ7xk.js} +1 -1
- package/dist/app/assets/{vhdl-TrBDG5Ki.js → vhdl-BplcweRd.js} +1 -1
- package/dist/app/assets/{vim-BQY2KLI8.js → vim-BSJSaAJT.js} +1 -1
- package/dist/app/assets/{visual-basic-C1QRM0HH.js → visual-basic-P4GqkrCX.js} +1 -1
- package/dist/app/assets/{wardley-RL74JXVD-DNaRL_A3.js → wardley-RL74JXVD-C6rkkrpU.js} +1 -1
- package/dist/app/assets/{wardleyDiagram-NUSXRM2D-BBLIkrSK.js → wardleyDiagram-NUSXRM2D-BjnOSUEc.js} +1 -1
- package/dist/app/assets/{warpscript-nQvBlOii.js → warpscript-B72YYJ2U.js} +1 -1
- package/dist/app/assets/{wasm-D5W-KZGZ.js → wasm-Bg4wwAut.js} +1 -1
- package/dist/app/assets/{web-idl-D5y9v5_9.js → web-idl-B9OadQZV.js} +1 -1
- package/dist/app/assets/{wiki-DCsi16K8.js → wiki-By-zl8YP.js} +1 -1
- package/dist/app/assets/{wolfram-y8OBS3se.js → wolfram-CElN0iOy.js} +1 -1
- package/dist/app/assets/{wren-BEEArJCB.js → wren-BrX-zluW.js} +1 -1
- package/dist/app/assets/{xeora-CpNfqT78.js → xeora-C4ncqHzC.js} +1 -1
- package/dist/app/assets/{xml-doc-CZyHXdZ4.js → xml-doc-BjIEGzdw.js} +1 -1
- package/dist/app/assets/{xojo-oOSiZNU8.js → xojo-KHoyAQYS.js} +1 -1
- package/dist/app/assets/{xquery-C00Ra1i_.js → xquery-BOZrPhVd.js} +1 -1
- package/dist/app/assets/{xychartDiagram-5P7HB3ND-CE0E3slp.js → xychartDiagram-5P7HB3ND-DnqG7oNj.js} +1 -1
- package/dist/app/assets/{yaml-DWCkrUAG.js → yaml-VLnSP71f.js} +1 -1
- package/dist/app/assets/{yang-CT8D_BuI.js → yang-B7r33xr6.js} +1 -1
- package/dist/app/assets/{zig-BfS-2hTl.js → zig-m9z4Naca.js} +1 -1
- package/dist/app/index.html +2 -2
- package/dist/index.cjs +1302 -831
- package/dist/index.js +1304 -831
- package/package.json +3 -3
- package/dist/app/assets/channel-B1FDRsGR.js +0 -1
- package/dist/app/assets/classDiagram-6PBFFD2Q-CbI8ArXA.js +0 -1
- package/dist/app/assets/classDiagram-v2-HSJHXN6E-CbI8ArXA.js +0 -1
- package/dist/app/assets/clone-DDwdfaI4.js +0 -1
- package/dist/app/assets/index-PIYQMdv9.css +0 -1
- package/dist/app/assets/stateDiagram-v2-QKLJ7IA2-BATidffF.js +0 -1
package/dist/index.js
CHANGED
|
@@ -959,14 +959,16 @@ var useStreamContext = () => {
|
|
|
959
959
|
};
|
|
960
960
|
|
|
961
961
|
// src/components/composer/ComposerMenu.tsx
|
|
962
|
-
import * as
|
|
962
|
+
import * as React9 from "react";
|
|
963
963
|
import {
|
|
964
964
|
ArrowLeft,
|
|
965
|
+
Bot,
|
|
965
966
|
Brain,
|
|
966
967
|
ChevronRight,
|
|
967
968
|
FileText,
|
|
968
969
|
Globe,
|
|
969
970
|
Images,
|
|
971
|
+
Info,
|
|
970
972
|
Lightbulb,
|
|
971
973
|
ListChecks,
|
|
972
974
|
Paperclip,
|
|
@@ -1243,12 +1245,9 @@ function DropdownMenuCheckboxItem({
|
|
|
1243
1245
|
/* @__PURE__ */ jsx5(
|
|
1244
1246
|
"span",
|
|
1245
1247
|
{
|
|
1246
|
-
className: "pointer-events-none absolute right-2 flex items-center justify-center",
|
|
1248
|
+
className: "pointer-events-none absolute right-2 flex h-5 w-5 items-center justify-center",
|
|
1247
1249
|
"data-slot": "dropdown-menu-checkbox-item-indicator",
|
|
1248
|
-
children: /* @__PURE__ */ jsx5(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx5(
|
|
1249
|
-
CheckIcon,
|
|
1250
|
-
{}
|
|
1251
|
-
) })
|
|
1250
|
+
children: /* @__PURE__ */ jsx5(DropdownMenuPrimitive.ItemIndicator, { className: "flex h-5 w-5 items-center justify-center rounded-full shadow-sm ring-1 ring-primary/25", children: /* @__PURE__ */ jsx5(CheckIcon, { className: "size-3.5 stroke-[3]" }) })
|
|
1252
1251
|
}
|
|
1253
1252
|
),
|
|
1254
1253
|
children
|
|
@@ -1357,9 +1356,19 @@ var en_US_default = {
|
|
|
1357
1356
|
title: "Skills & Plugins",
|
|
1358
1357
|
skills: "Skills",
|
|
1359
1358
|
plugins: "Plugins",
|
|
1359
|
+
subAgents: "Sub-agents",
|
|
1360
1360
|
runOnly: "This run",
|
|
1361
1361
|
removeRunCapability: "Remove capability",
|
|
1362
|
-
emptySearch: "No matching skills or
|
|
1362
|
+
emptySearch: "No matching skills, plugins, or sub-agents",
|
|
1363
|
+
agent: "Agent",
|
|
1364
|
+
xpertAgent: "Xpert",
|
|
1365
|
+
agentDetails: "Agent details",
|
|
1366
|
+
type: "Type",
|
|
1367
|
+
identifier: "ID",
|
|
1368
|
+
inputs: "Inputs",
|
|
1369
|
+
tools: "Tools",
|
|
1370
|
+
toolsets: "Toolsets",
|
|
1371
|
+
knowledge: "Knowledge"
|
|
1363
1372
|
},
|
|
1364
1373
|
planModeActive: "Plan",
|
|
1365
1374
|
disablePlanMode: "Turn off plan mode",
|
|
@@ -1545,9 +1554,19 @@ var zh_CN_default = {
|
|
|
1545
1554
|
title: "\u6280\u80FD\u548C\u63D2\u4EF6",
|
|
1546
1555
|
skills: "\u6280\u80FD",
|
|
1547
1556
|
plugins: "\u63D2\u4EF6",
|
|
1557
|
+
subAgents: "\u5B50\u667A\u80FD\u4F53",
|
|
1548
1558
|
runOnly: "\u672C\u6B21\u8FD0\u884C",
|
|
1549
1559
|
removeRunCapability: "\u79FB\u9664\u80FD\u529B",
|
|
1550
|
-
emptySearch: "\u6CA1\u6709\u5339\u914D\u7684
|
|
1560
|
+
emptySearch: "\u6CA1\u6709\u5339\u914D\u7684\u6280\u80FD\u3001\u63D2\u4EF6\u6216\u5B50\u667A\u80FD\u4F53",
|
|
1561
|
+
agent: "\u667A\u80FD\u4F53",
|
|
1562
|
+
xpertAgent: "Xpert",
|
|
1563
|
+
agentDetails: "\u667A\u80FD\u4F53\u8BE6\u60C5",
|
|
1564
|
+
type: "\u7C7B\u578B",
|
|
1565
|
+
identifier: "ID",
|
|
1566
|
+
inputs: "\u8F93\u5165",
|
|
1567
|
+
tools: "\u5DE5\u5177",
|
|
1568
|
+
toolsets: "\u5DE5\u5177\u96C6",
|
|
1569
|
+
knowledge: "\u77E5\u8BC6\u5E93"
|
|
1551
1570
|
},
|
|
1552
1571
|
planModeActive: "\u8BA1\u5212",
|
|
1553
1572
|
disablePlanMode: "\u5173\u95ED\u8BA1\u5212\u6A21\u5F0F",
|
|
@@ -2080,6 +2099,9 @@ function createEmptyRuntimeCapabilitiesSelection(capabilities) {
|
|
|
2080
2099
|
},
|
|
2081
2100
|
plugins: {
|
|
2082
2101
|
nodeKeys: []
|
|
2102
|
+
},
|
|
2103
|
+
subAgents: {
|
|
2104
|
+
nodeKeys: []
|
|
2083
2105
|
}
|
|
2084
2106
|
};
|
|
2085
2107
|
}
|
|
@@ -2095,6 +2117,9 @@ function createDefaultRuntimeCapabilitiesSelection(capabilities) {
|
|
|
2095
2117
|
},
|
|
2096
2118
|
plugins: {
|
|
2097
2119
|
nodeKeys: []
|
|
2120
|
+
},
|
|
2121
|
+
subAgents: {
|
|
2122
|
+
nodeKeys: []
|
|
2098
2123
|
}
|
|
2099
2124
|
};
|
|
2100
2125
|
}
|
|
@@ -2112,22 +2137,38 @@ function mergeRuntimeCapabilitiesSelections(capabilities, ...selections) {
|
|
|
2112
2137
|
nodeKeys: uniqueStrings(
|
|
2113
2138
|
selections.flatMap((selection) => selection?.plugins.nodeKeys ?? [])
|
|
2114
2139
|
)
|
|
2140
|
+
},
|
|
2141
|
+
subAgents: {
|
|
2142
|
+
nodeKeys: uniqueStrings(
|
|
2143
|
+
selections.flatMap((selection) => selection?.subAgents?.nodeKeys ?? [])
|
|
2144
|
+
)
|
|
2115
2145
|
}
|
|
2116
2146
|
};
|
|
2117
2147
|
}
|
|
2118
2148
|
function toggleRuntimeCapabilitySelection(selection, type, id, selected) {
|
|
2119
|
-
const ids = type === "skill" ? selection.skills.ids : selection.plugins.nodeKeys;
|
|
2149
|
+
const ids = type === "skill" ? selection.skills.ids : type === "plugin" ? selection.plugins.nodeKeys : selection.subAgents?.nodeKeys ?? [];
|
|
2120
2150
|
const shouldSelect = selected ?? !ids.includes(id);
|
|
2121
2151
|
const nextIds = shouldSelect ? uniqueStrings([...ids, id]) : ids.filter((item) => item !== id);
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2152
|
+
if (type === "skill") {
|
|
2153
|
+
return {
|
|
2154
|
+
...selection,
|
|
2155
|
+
skills: {
|
|
2156
|
+
...selection.skills,
|
|
2157
|
+
ids: nextIds
|
|
2158
|
+
}
|
|
2159
|
+
};
|
|
2160
|
+
}
|
|
2161
|
+
if (type === "plugin") {
|
|
2162
|
+
return {
|
|
2163
|
+
...selection,
|
|
2164
|
+
plugins: {
|
|
2165
|
+
nodeKeys: nextIds
|
|
2166
|
+
}
|
|
2167
|
+
};
|
|
2168
|
+
}
|
|
2169
|
+
return {
|
|
2129
2170
|
...selection,
|
|
2130
|
-
|
|
2171
|
+
subAgents: {
|
|
2131
2172
|
nodeKeys: nextIds
|
|
2132
2173
|
}
|
|
2133
2174
|
};
|
|
@@ -2150,26 +2191,231 @@ function getRuntimeCapabilityOptions(capabilities) {
|
|
|
2150
2191
|
label: capability.label,
|
|
2151
2192
|
description: capability.description ?? capability.provider,
|
|
2152
2193
|
capability
|
|
2194
|
+
})),
|
|
2195
|
+
...(capabilities.subAgents ?? []).map((capability) => ({
|
|
2196
|
+
type: "subAgent",
|
|
2197
|
+
id: capability.nodeKey,
|
|
2198
|
+
label: capability.label,
|
|
2199
|
+
description: capability.description ?? capability.name,
|
|
2200
|
+
capability
|
|
2153
2201
|
}))
|
|
2154
2202
|
];
|
|
2155
2203
|
}
|
|
2156
2204
|
function isRuntimeCapabilitySelected(selection, type, id) {
|
|
2157
|
-
|
|
2205
|
+
if (type === "skill") {
|
|
2206
|
+
return selection.skills.ids.includes(id);
|
|
2207
|
+
}
|
|
2208
|
+
if (type === "plugin") {
|
|
2209
|
+
return selection.plugins.nodeKeys.includes(id);
|
|
2210
|
+
}
|
|
2211
|
+
return selection.subAgents?.nodeKeys.includes(id) ?? false;
|
|
2212
|
+
}
|
|
2213
|
+
|
|
2214
|
+
// src/components/ui/tooltip.tsx
|
|
2215
|
+
import "react";
|
|
2216
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
2217
|
+
import { jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
2218
|
+
function TooltipProvider({
|
|
2219
|
+
delayDuration = 0,
|
|
2220
|
+
...props
|
|
2221
|
+
}) {
|
|
2222
|
+
return /* @__PURE__ */ jsx7(
|
|
2223
|
+
TooltipPrimitive.Provider,
|
|
2224
|
+
{
|
|
2225
|
+
"data-slot": "tooltip-provider",
|
|
2226
|
+
delayDuration,
|
|
2227
|
+
...props
|
|
2228
|
+
}
|
|
2229
|
+
);
|
|
2230
|
+
}
|
|
2231
|
+
function Tooltip({
|
|
2232
|
+
...props
|
|
2233
|
+
}) {
|
|
2234
|
+
return /* @__PURE__ */ jsx7(TooltipProvider, { children: /* @__PURE__ */ jsx7(
|
|
2235
|
+
TooltipPrimitive.Root,
|
|
2236
|
+
{
|
|
2237
|
+
"data-slot": "tooltip",
|
|
2238
|
+
...props
|
|
2239
|
+
}
|
|
2240
|
+
) });
|
|
2241
|
+
}
|
|
2242
|
+
function TooltipTrigger({
|
|
2243
|
+
...props
|
|
2244
|
+
}) {
|
|
2245
|
+
return /* @__PURE__ */ jsx7(
|
|
2246
|
+
TooltipPrimitive.Trigger,
|
|
2247
|
+
{
|
|
2248
|
+
"data-slot": "tooltip-trigger",
|
|
2249
|
+
...props
|
|
2250
|
+
}
|
|
2251
|
+
);
|
|
2252
|
+
}
|
|
2253
|
+
function TooltipContent({
|
|
2254
|
+
className,
|
|
2255
|
+
sideOffset = 0,
|
|
2256
|
+
hideArrow = false,
|
|
2257
|
+
children,
|
|
2258
|
+
...props
|
|
2259
|
+
}) {
|
|
2260
|
+
return /* @__PURE__ */ jsx7(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs2(
|
|
2261
|
+
TooltipPrimitive.Content,
|
|
2262
|
+
{
|
|
2263
|
+
"data-slot": "tooltip-content",
|
|
2264
|
+
sideOffset,
|
|
2265
|
+
className: cn(
|
|
2266
|
+
"bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit rounded-md px-3 py-1.5 text-xs text-balance",
|
|
2267
|
+
className
|
|
2268
|
+
),
|
|
2269
|
+
...props,
|
|
2270
|
+
children: [
|
|
2271
|
+
children,
|
|
2272
|
+
!hideArrow ? /* @__PURE__ */ jsx7(TooltipPrimitive.Arrow, { className: "bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" }) : null
|
|
2273
|
+
]
|
|
2274
|
+
}
|
|
2275
|
+
) });
|
|
2276
|
+
}
|
|
2277
|
+
|
|
2278
|
+
// src/components/ui/chatkit-avatar.tsx
|
|
2279
|
+
import "react";
|
|
2280
|
+
|
|
2281
|
+
// src/components/ui/avatar.tsx
|
|
2282
|
+
import * as React7 from "react";
|
|
2283
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
2284
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
2285
|
+
var Avatar = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
2286
|
+
AvatarPrimitive.Root,
|
|
2287
|
+
{
|
|
2288
|
+
ref,
|
|
2289
|
+
className: cn(
|
|
2290
|
+
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
|
2291
|
+
className
|
|
2292
|
+
),
|
|
2293
|
+
...props
|
|
2294
|
+
}
|
|
2295
|
+
));
|
|
2296
|
+
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
2297
|
+
var AvatarImage = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
2298
|
+
AvatarPrimitive.Image,
|
|
2299
|
+
{
|
|
2300
|
+
ref,
|
|
2301
|
+
className: cn("aspect-square h-full w-full", className),
|
|
2302
|
+
...props
|
|
2303
|
+
}
|
|
2304
|
+
));
|
|
2305
|
+
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
2306
|
+
var AvatarFallback = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
2307
|
+
AvatarPrimitive.Fallback,
|
|
2308
|
+
{
|
|
2309
|
+
ref,
|
|
2310
|
+
className: cn(
|
|
2311
|
+
"flex h-full w-full items-center justify-center rounded-full bg-muted",
|
|
2312
|
+
className
|
|
2313
|
+
),
|
|
2314
|
+
...props
|
|
2315
|
+
}
|
|
2316
|
+
));
|
|
2317
|
+
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
2318
|
+
|
|
2319
|
+
// src/components/ui/chatkit-avatar.tsx
|
|
2320
|
+
import { jsx as jsx9, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
2321
|
+
function asRecord(value) {
|
|
2322
|
+
return value && typeof value === "object" ? value : null;
|
|
2323
|
+
}
|
|
2324
|
+
function getNonEmptyString(value) {
|
|
2325
|
+
if (typeof value !== "string") return void 0;
|
|
2326
|
+
const normalized = value.trim();
|
|
2327
|
+
return normalized || void 0;
|
|
2328
|
+
}
|
|
2329
|
+
function unicodeFromUnified(unified) {
|
|
2330
|
+
const normalized = getNonEmptyString(unified);
|
|
2331
|
+
if (!normalized) return void 0;
|
|
2332
|
+
try {
|
|
2333
|
+
return normalized.split("-").map((hex) => String.fromCodePoint(Number.parseInt(hex, 16))).join("");
|
|
2334
|
+
} catch {
|
|
2335
|
+
return void 0;
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2338
|
+
function getEmojiCharacter(avatar) {
|
|
2339
|
+
return unicodeFromUnified(avatar?.emoji?.unified);
|
|
2340
|
+
}
|
|
2341
|
+
function getAvatarFallback(label) {
|
|
2342
|
+
return label.trim().charAt(0).toUpperCase() || "A";
|
|
2343
|
+
}
|
|
2344
|
+
function normalizeChatkitAvatar(rawAvatar) {
|
|
2345
|
+
if (typeof rawAvatar === "string") {
|
|
2346
|
+
const url = getNonEmptyString(rawAvatar);
|
|
2347
|
+
return url ? { url } : null;
|
|
2348
|
+
}
|
|
2349
|
+
const avatarRecord = asRecord(rawAvatar);
|
|
2350
|
+
if (!avatarRecord) return null;
|
|
2351
|
+
const emojiRecord = asRecord(avatarRecord.emoji);
|
|
2352
|
+
const avatar = {
|
|
2353
|
+
background: getNonEmptyString(avatarRecord.background),
|
|
2354
|
+
url: getNonEmptyString(avatarRecord.url),
|
|
2355
|
+
useNotoColor: Boolean(avatarRecord.useNotoColor)
|
|
2356
|
+
};
|
|
2357
|
+
if (emojiRecord) {
|
|
2358
|
+
avatar.emoji = {
|
|
2359
|
+
colons: getNonEmptyString(emojiRecord.colons),
|
|
2360
|
+
id: getNonEmptyString(emojiRecord.id),
|
|
2361
|
+
unified: getNonEmptyString(emojiRecord.unified)
|
|
2362
|
+
};
|
|
2363
|
+
}
|
|
2364
|
+
return avatar.url || avatar.background || avatar.emoji?.id || avatar.emoji?.unified ? avatar : null;
|
|
2365
|
+
}
|
|
2366
|
+
function extractAssistantAvatar(assistant) {
|
|
2367
|
+
const assistantRecord = asRecord(assistant);
|
|
2368
|
+
const metadata = asRecord(assistant.metadata);
|
|
2369
|
+
const rawAvatar = assistantRecord?.avatar ?? metadata?.avatar;
|
|
2370
|
+
const avatar = normalizeChatkitAvatar(rawAvatar);
|
|
2371
|
+
if (avatar) return avatar;
|
|
2372
|
+
const metadataAvatar = getNonEmptyString(metadata?.avatarUrl) ?? getNonEmptyString(metadata?.avatar_url);
|
|
2373
|
+
return metadataAvatar ? { url: metadataAvatar } : null;
|
|
2374
|
+
}
|
|
2375
|
+
function ChatkitAvatar({
|
|
2376
|
+
avatar,
|
|
2377
|
+
className,
|
|
2378
|
+
fallback,
|
|
2379
|
+
fallbackClassName,
|
|
2380
|
+
imageClassName,
|
|
2381
|
+
label,
|
|
2382
|
+
style,
|
|
2383
|
+
...props
|
|
2384
|
+
}) {
|
|
2385
|
+
const { theme } = useTheme();
|
|
2386
|
+
const emojiCharacter = getEmojiCharacter(avatar);
|
|
2387
|
+
const fallbackText = fallback || getAvatarFallback(label);
|
|
2388
|
+
const roundedClass = getRoundedClass(theme.radius);
|
|
2389
|
+
const emojiStyle = avatar?.useNotoColor ? { fontFamily: '"Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", sans-serif' } : void 0;
|
|
2390
|
+
const fallbackStyle = {
|
|
2391
|
+
...avatar?.background ? { background: avatar.background } : {}
|
|
2392
|
+
};
|
|
2393
|
+
return /* @__PURE__ */ jsxs3(Avatar, { className: cn(roundedClass, className), style, ...props, children: [
|
|
2394
|
+
avatar?.url ? /* @__PURE__ */ jsx9(AvatarImage, { className: imageClassName, src: avatar.url, alt: label }) : null,
|
|
2395
|
+
/* @__PURE__ */ jsx9(
|
|
2396
|
+
AvatarFallback,
|
|
2397
|
+
{
|
|
2398
|
+
className: cn(roundedClass, "text-sm font-medium text-foreground", fallbackClassName),
|
|
2399
|
+
style: fallbackStyle,
|
|
2400
|
+
children: emojiCharacter ? /* @__PURE__ */ jsx9("span", { className: "text-[1.1em] leading-none", style: emojiStyle, children: emojiCharacter }) : fallbackText
|
|
2401
|
+
}
|
|
2402
|
+
)
|
|
2403
|
+
] });
|
|
2158
2404
|
}
|
|
2159
2405
|
|
|
2160
2406
|
// src/components/composer/ComposerMenu.tsx
|
|
2161
|
-
import { Fragment, jsx as
|
|
2407
|
+
import { Fragment, jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
2162
2408
|
function getIconComponent(icon) {
|
|
2163
2409
|
const iconMap = {
|
|
2164
|
-
plus: /* @__PURE__ */
|
|
2165
|
-
document: /* @__PURE__ */
|
|
2166
|
-
write: /* @__PURE__ */
|
|
2167
|
-
sparkle: /* @__PURE__ */
|
|
2168
|
-
lightbulb: /* @__PURE__ */
|
|
2169
|
-
"settings-slider": /* @__PURE__ */
|
|
2170
|
-
search: /* @__PURE__ */
|
|
2171
|
-
globe: /* @__PURE__ */
|
|
2172
|
-
images: /* @__PURE__ */
|
|
2410
|
+
plus: /* @__PURE__ */ jsx10(Plus, { size: 16 }),
|
|
2411
|
+
document: /* @__PURE__ */ jsx10(FileText, { size: 16 }),
|
|
2412
|
+
write: /* @__PURE__ */ jsx10(Pencil, { size: 16 }),
|
|
2413
|
+
sparkle: /* @__PURE__ */ jsx10(Sparkles, { size: 16 }),
|
|
2414
|
+
lightbulb: /* @__PURE__ */ jsx10(Lightbulb, { size: 16 }),
|
|
2415
|
+
"settings-slider": /* @__PURE__ */ jsx10(SlidersHorizontal, { size: 16 }),
|
|
2416
|
+
search: /* @__PURE__ */ jsx10(Search, { size: 16 }),
|
|
2417
|
+
globe: /* @__PURE__ */ jsx10(Globe, { size: 16 }),
|
|
2418
|
+
images: /* @__PURE__ */ jsx10(Images, { size: 16 })
|
|
2173
2419
|
};
|
|
2174
2420
|
return iconMap[icon] || iconMap["sparkle"];
|
|
2175
2421
|
}
|
|
@@ -2186,21 +2432,23 @@ function ComposerMenu({
|
|
|
2186
2432
|
disabled = false
|
|
2187
2433
|
}) {
|
|
2188
2434
|
const { t } = useChatkitTranslation();
|
|
2189
|
-
const [open, setOpen] =
|
|
2190
|
-
const [activePanel, setActivePanel] =
|
|
2435
|
+
const [open, setOpen] = React9.useState(false);
|
|
2436
|
+
const [activePanel, setActivePanel] = React9.useState(
|
|
2191
2437
|
null
|
|
2192
2438
|
);
|
|
2193
|
-
const [collisionBoundary, setCollisionBoundary] =
|
|
2194
|
-
const triggerRef =
|
|
2439
|
+
const [collisionBoundary, setCollisionBoundary] = React9.useState();
|
|
2440
|
+
const triggerRef = React9.useRef(null);
|
|
2195
2441
|
const { theme } = useTheme();
|
|
2196
2442
|
const roundedClass = getRoundedClass(theme.radius);
|
|
2197
2443
|
const attachmentsEnabled = composer?.attachments?.enabled ?? false;
|
|
2198
2444
|
const tools = composer?.tools ?? [];
|
|
2199
2445
|
const skills = runtimeCapabilities?.skills ?? [];
|
|
2200
2446
|
const plugins = runtimeCapabilities?.plugins ?? [];
|
|
2201
|
-
const
|
|
2447
|
+
const subAgents = runtimeCapabilities?.subAgents ?? [];
|
|
2448
|
+
const hasRuntimeCapabilities = skills.length > 0 || plugins.length > 0 || subAgents.length > 0;
|
|
2202
2449
|
const selectedSkillCount = selectedRuntimeCapabilities?.skills.ids.length ?? 0;
|
|
2203
2450
|
const selectedPluginCount = selectedRuntimeCapabilities?.plugins.nodeKeys.length ?? 0;
|
|
2451
|
+
const selectedSubAgentCount = selectedRuntimeCapabilities?.subAgents?.nodeKeys.length ?? 0;
|
|
2204
2452
|
const handleAttachmentClick = () => {
|
|
2205
2453
|
onAttachmentClick?.();
|
|
2206
2454
|
};
|
|
@@ -2225,10 +2473,136 @@ function ComposerMenu({
|
|
|
2225
2473
|
collisionBoundary,
|
|
2226
2474
|
collisionPadding: 8
|
|
2227
2475
|
};
|
|
2476
|
+
const getCapabilityFallbackIcon = (type) => {
|
|
2477
|
+
if (type === "skill") return Brain;
|
|
2478
|
+
if (type === "plugin") return Plug;
|
|
2479
|
+
return Bot;
|
|
2480
|
+
};
|
|
2481
|
+
const getParameterLabels = (subAgent) => (subAgent.parameters ?? []).map((parameter) => {
|
|
2482
|
+
if (!parameter || typeof parameter !== "object") return null;
|
|
2483
|
+
const record = parameter;
|
|
2484
|
+
return typeof record.title === "string" && record.title.trim() || typeof record.name === "string" && record.name.trim() || null;
|
|
2485
|
+
}).filter((value) => Boolean(value));
|
|
2486
|
+
const renderDetailPills = (label, values) => {
|
|
2487
|
+
if (!values?.length) return null;
|
|
2488
|
+
return /* @__PURE__ */ jsxs4("div", { className: "space-y-1", children: [
|
|
2489
|
+
/* @__PURE__ */ jsx10("div", { className: "text-[11px] font-medium uppercase text-muted-foreground", children: label }),
|
|
2490
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex flex-wrap gap-1", children: [
|
|
2491
|
+
values.slice(0, 6).map((value) => /* @__PURE__ */ jsx10(
|
|
2492
|
+
"span",
|
|
2493
|
+
{
|
|
2494
|
+
className: "max-w-full truncate rounded-md bg-muted px-1.5 py-0.5 text-[11px] text-foreground",
|
|
2495
|
+
children: value
|
|
2496
|
+
},
|
|
2497
|
+
value
|
|
2498
|
+
)),
|
|
2499
|
+
values.length > 6 && /* @__PURE__ */ jsxs4("span", { className: "rounded-md bg-muted px-1.5 py-0.5 text-[11px] text-muted-foreground", children: [
|
|
2500
|
+
"+",
|
|
2501
|
+
values.length - 6
|
|
2502
|
+
] })
|
|
2503
|
+
] })
|
|
2504
|
+
] });
|
|
2505
|
+
};
|
|
2506
|
+
const renderSubAgentInfoButton = (subAgent) => /* @__PURE__ */ jsxs4(Tooltip, { children: [
|
|
2507
|
+
/* @__PURE__ */ jsx10(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx10(
|
|
2508
|
+
"button",
|
|
2509
|
+
{
|
|
2510
|
+
type: "button",
|
|
2511
|
+
"aria-label": t("composer.capabilities.agentDetails"),
|
|
2512
|
+
className: "mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
2513
|
+
"data-slot": "runtime-sub-agent-info-trigger",
|
|
2514
|
+
onClick: (event) => event.stopPropagation(),
|
|
2515
|
+
onPointerDown: (event) => event.stopPropagation(),
|
|
2516
|
+
children: /* @__PURE__ */ jsx10(Info, { size: 14 })
|
|
2517
|
+
}
|
|
2518
|
+
) }),
|
|
2519
|
+
/* @__PURE__ */ jsx10(
|
|
2520
|
+
TooltipContent,
|
|
2521
|
+
{
|
|
2522
|
+
side: "top",
|
|
2523
|
+
align: "center",
|
|
2524
|
+
sideOffset: 8,
|
|
2525
|
+
hideArrow: true,
|
|
2526
|
+
className: "bg-transparent p-0 text-popover-foreground shadow-none",
|
|
2527
|
+
children: renderSubAgentDetailCard(subAgent)
|
|
2528
|
+
}
|
|
2529
|
+
)
|
|
2530
|
+
] });
|
|
2531
|
+
const renderSubAgentDetailCard = (subAgent) => {
|
|
2532
|
+
const parameterLabels = getParameterLabels(subAgent);
|
|
2533
|
+
const agentKind = subAgent.type === "xpert" ? t("composer.capabilities.xpertAgent") : t("composer.capabilities.agent");
|
|
2534
|
+
return /* @__PURE__ */ jsxs4(
|
|
2535
|
+
"div",
|
|
2536
|
+
{
|
|
2537
|
+
"data-slot": "runtime-sub-agent-detail-card",
|
|
2538
|
+
className: "pointer-events-none w-80 space-y-3 rounded-lg border border-border bg-popover p-3 text-popover-foreground shadow-lg",
|
|
2539
|
+
children: [
|
|
2540
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-start gap-3", children: [
|
|
2541
|
+
/* @__PURE__ */ jsx10(
|
|
2542
|
+
ChatkitAvatar,
|
|
2543
|
+
{
|
|
2544
|
+
avatar: normalizeChatkitAvatar(subAgent.avatar),
|
|
2545
|
+
label: subAgent.label,
|
|
2546
|
+
className: "h-9 w-9 shrink-0",
|
|
2547
|
+
fallbackClassName: "text-xs"
|
|
2548
|
+
}
|
|
2549
|
+
),
|
|
2550
|
+
/* @__PURE__ */ jsxs4("div", { className: "min-w-0 flex-1", children: [
|
|
2551
|
+
/* @__PURE__ */ jsx10("div", { className: "truncate text-sm font-medium", children: subAgent.label }),
|
|
2552
|
+
/* @__PURE__ */ jsx10("div", { className: "truncate text-xs text-muted-foreground", children: subAgent.name ?? agentKind })
|
|
2553
|
+
] })
|
|
2554
|
+
] }),
|
|
2555
|
+
subAgent.description && /* @__PURE__ */ jsx10("div", { className: "line-clamp-4 text-xs leading-5 text-muted-foreground", children: subAgent.description }),
|
|
2556
|
+
/* @__PURE__ */ jsxs4("div", { className: "grid grid-cols-2 gap-2 text-xs", children: [
|
|
2557
|
+
/* @__PURE__ */ jsxs4("div", { className: "rounded-md bg-muted px-2 py-1", children: [
|
|
2558
|
+
/* @__PURE__ */ jsx10("span", { className: "block text-[11px] text-muted-foreground", children: t("composer.capabilities.type") }),
|
|
2559
|
+
/* @__PURE__ */ jsx10("span", { className: "font-medium", children: agentKind })
|
|
2560
|
+
] }),
|
|
2561
|
+
(subAgent.agentKey || subAgent.xpertId) && /* @__PURE__ */ jsxs4("div", { className: "rounded-md bg-muted px-2 py-1", children: [
|
|
2562
|
+
/* @__PURE__ */ jsx10("span", { className: "block text-[11px] text-muted-foreground", children: t("composer.capabilities.identifier") }),
|
|
2563
|
+
/* @__PURE__ */ jsx10("span", { className: "block truncate font-mono text-[11px]", children: subAgent.agentKey ?? subAgent.xpertId })
|
|
2564
|
+
] })
|
|
2565
|
+
] }),
|
|
2566
|
+
renderDetailPills(t("composer.capabilities.inputs"), parameterLabels),
|
|
2567
|
+
renderDetailPills(
|
|
2568
|
+
t("composer.capabilities.tools"),
|
|
2569
|
+
subAgent.toolNames
|
|
2570
|
+
),
|
|
2571
|
+
renderDetailPills(
|
|
2572
|
+
t("composer.capabilities.toolsets"),
|
|
2573
|
+
subAgent.toolsetNames
|
|
2574
|
+
),
|
|
2575
|
+
renderDetailPills(
|
|
2576
|
+
t("composer.capabilities.knowledge"),
|
|
2577
|
+
subAgent.knowledgebaseNames
|
|
2578
|
+
)
|
|
2579
|
+
]
|
|
2580
|
+
}
|
|
2581
|
+
);
|
|
2582
|
+
};
|
|
2228
2583
|
const renderCapabilityRow = (type, item) => {
|
|
2229
2584
|
const selected = selectedRuntimeCapabilities ? isRuntimeCapabilitySelected(selectedRuntimeCapabilities, type, item.id) : false;
|
|
2230
|
-
const Icon = type
|
|
2231
|
-
|
|
2585
|
+
const Icon = getCapabilityFallbackIcon(type);
|
|
2586
|
+
const icon = type === "subAgent" && item.subAgent ? /* @__PURE__ */ jsx10(
|
|
2587
|
+
ChatkitAvatar,
|
|
2588
|
+
{
|
|
2589
|
+
avatar: normalizeChatkitAvatar(item.subAgent.avatar),
|
|
2590
|
+
label: item.subAgent.label,
|
|
2591
|
+
className: "h-6 w-6",
|
|
2592
|
+
fallbackClassName: "text-[10px]",
|
|
2593
|
+
imageClassName: "object-cover",
|
|
2594
|
+
"data-slot": "runtime-sub-agent-avatar"
|
|
2595
|
+
}
|
|
2596
|
+
) : item.icon ? /* @__PURE__ */ jsx10(
|
|
2597
|
+
IconDefinitionRenderer,
|
|
2598
|
+
{
|
|
2599
|
+
icon: item.icon,
|
|
2600
|
+
size: 24,
|
|
2601
|
+
dataSlot: "runtime-capability-meta-icon",
|
|
2602
|
+
fallback: /* @__PURE__ */ jsx10(Icon, { size: 16 })
|
|
2603
|
+
}
|
|
2604
|
+
) : /* @__PURE__ */ jsx10(Icon, { size: 16 });
|
|
2605
|
+
const row = /* @__PURE__ */ jsxs4(
|
|
2232
2606
|
DropdownMenuCheckboxItem,
|
|
2233
2607
|
{
|
|
2234
2608
|
checked: selected,
|
|
@@ -2240,29 +2614,47 @@ function ComposerMenu({
|
|
|
2240
2614
|
selected && "bg-muted"
|
|
2241
2615
|
),
|
|
2242
2616
|
children: [
|
|
2243
|
-
/* @__PURE__ */
|
|
2244
|
-
|
|
2245
|
-
{
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
fallback: /* @__PURE__ */ jsx7(Icon, { size: 16 })
|
|
2250
|
-
}
|
|
2251
|
-
) : /* @__PURE__ */ jsx7(Icon, { size: 16 }) }),
|
|
2252
|
-
/* @__PURE__ */ jsxs2("span", { className: "min-w-0 flex-1 text-left", children: [
|
|
2253
|
-
/* @__PURE__ */ jsx7("span", { className: "block truncate", children: item.label }),
|
|
2254
|
-
(item.description || item.fallbackDescription) && /* @__PURE__ */ jsx7("span", { className: "block truncate text-xs text-muted-foreground", children: item.description ?? item.fallbackDescription })
|
|
2255
|
-
] })
|
|
2617
|
+
/* @__PURE__ */ jsx10("span", { className: "mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center text-muted-foreground", children: icon }),
|
|
2618
|
+
/* @__PURE__ */ jsxs4("span", { className: "min-w-0 flex-1 text-left", children: [
|
|
2619
|
+
/* @__PURE__ */ jsx10("span", { className: "block truncate", children: item.label }),
|
|
2620
|
+
(item.description || item.fallbackDescription) && /* @__PURE__ */ jsx10("span", { className: "block truncate text-xs text-muted-foreground", children: item.description ?? item.fallbackDescription })
|
|
2621
|
+
] }),
|
|
2622
|
+
type === "subAgent" && item.subAgent ? renderSubAgentInfoButton(item.subAgent) : null
|
|
2256
2623
|
]
|
|
2257
2624
|
},
|
|
2258
2625
|
item.id
|
|
2259
2626
|
);
|
|
2627
|
+
return row;
|
|
2260
2628
|
};
|
|
2261
2629
|
const renderCapabilityPanel = (panel) => {
|
|
2262
|
-
const
|
|
2263
|
-
const
|
|
2264
|
-
|
|
2265
|
-
|
|
2630
|
+
const title = panel === "skills" ? t("composer.capabilities.skills") : panel === "plugins" ? t("composer.capabilities.plugins") : t("composer.capabilities.subAgents");
|
|
2631
|
+
const rows = panel === "skills" ? skills.map(
|
|
2632
|
+
(skill) => renderCapabilityRow("skill", {
|
|
2633
|
+
id: skill.id,
|
|
2634
|
+
label: skill.label,
|
|
2635
|
+
description: skill.description,
|
|
2636
|
+
fallbackDescription: skill.repositoryName,
|
|
2637
|
+
icon: skill.meta?.icon
|
|
2638
|
+
})
|
|
2639
|
+
) : panel === "plugins" ? plugins.map(
|
|
2640
|
+
(plugin) => renderCapabilityRow("plugin", {
|
|
2641
|
+
id: plugin.nodeKey,
|
|
2642
|
+
label: plugin.label,
|
|
2643
|
+
description: plugin.description,
|
|
2644
|
+
fallbackDescription: plugin.provider,
|
|
2645
|
+
icon: plugin.meta?.icon
|
|
2646
|
+
})
|
|
2647
|
+
) : subAgents.map(
|
|
2648
|
+
(subAgent) => renderCapabilityRow("subAgent", {
|
|
2649
|
+
id: subAgent.nodeKey,
|
|
2650
|
+
label: subAgent.label,
|
|
2651
|
+
description: subAgent.description,
|
|
2652
|
+
fallbackDescription: subAgent.name,
|
|
2653
|
+
subAgent
|
|
2654
|
+
})
|
|
2655
|
+
);
|
|
2656
|
+
return /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
2657
|
+
/* @__PURE__ */ jsxs4(
|
|
2266
2658
|
DropdownMenuItem,
|
|
2267
2659
|
{
|
|
2268
2660
|
onSelect: (event) => {
|
|
@@ -2271,33 +2663,17 @@ function ComposerMenu({
|
|
|
2271
2663
|
},
|
|
2272
2664
|
className: cn("gap-3 px-3 py-2", roundedClass),
|
|
2273
2665
|
children: [
|
|
2274
|
-
/* @__PURE__ */
|
|
2275
|
-
/* @__PURE__ */
|
|
2666
|
+
/* @__PURE__ */ jsx10("span", { className: "flex h-6 w-6 items-center justify-center text-muted-foreground", children: /* @__PURE__ */ jsx10(ArrowLeft, { size: 16 }) }),
|
|
2667
|
+
/* @__PURE__ */ jsx10("span", { className: "min-w-0 flex-1 text-left", children: title })
|
|
2276
2668
|
]
|
|
2277
2669
|
}
|
|
2278
2670
|
),
|
|
2279
|
-
/* @__PURE__ */
|
|
2280
|
-
|
|
2281
|
-
(skill) => renderCapabilityRow("skill", {
|
|
2282
|
-
id: skill.id,
|
|
2283
|
-
label: skill.label,
|
|
2284
|
-
description: skill.description,
|
|
2285
|
-
fallbackDescription: skill.repositoryName,
|
|
2286
|
-
icon: skill.meta?.icon
|
|
2287
|
-
})
|
|
2288
|
-
) : plugins.map(
|
|
2289
|
-
(plugin) => renderCapabilityRow("plugin", {
|
|
2290
|
-
id: plugin.nodeKey,
|
|
2291
|
-
label: plugin.label,
|
|
2292
|
-
description: plugin.description,
|
|
2293
|
-
fallbackDescription: plugin.provider,
|
|
2294
|
-
icon: plugin.meta?.icon
|
|
2295
|
-
})
|
|
2296
|
-
)
|
|
2671
|
+
/* @__PURE__ */ jsx10(DropdownMenuSeparator, {}),
|
|
2672
|
+
rows
|
|
2297
2673
|
] });
|
|
2298
2674
|
};
|
|
2299
|
-
return /* @__PURE__ */
|
|
2300
|
-
/* @__PURE__ */
|
|
2675
|
+
return /* @__PURE__ */ jsxs4(DropdownMenu, { open, onOpenChange: handleOpenChange, children: [
|
|
2676
|
+
/* @__PURE__ */ jsx10(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs4(
|
|
2301
2677
|
Button,
|
|
2302
2678
|
{
|
|
2303
2679
|
ref: triggerRef,
|
|
@@ -2311,12 +2687,12 @@ function ComposerMenu({
|
|
|
2311
2687
|
open && "bg-muted"
|
|
2312
2688
|
),
|
|
2313
2689
|
children: [
|
|
2314
|
-
/* @__PURE__ */
|
|
2315
|
-
/* @__PURE__ */
|
|
2690
|
+
/* @__PURE__ */ jsx10(Plus, { size: 18 }),
|
|
2691
|
+
/* @__PURE__ */ jsx10("span", { className: "sr-only", children: t("composer.openMenu") })
|
|
2316
2692
|
]
|
|
2317
2693
|
}
|
|
2318
2694
|
) }),
|
|
2319
|
-
/* @__PURE__ */
|
|
2695
|
+
/* @__PURE__ */ jsx10(
|
|
2320
2696
|
DropdownMenuContent,
|
|
2321
2697
|
{
|
|
2322
2698
|
align: "start",
|
|
@@ -2327,22 +2703,22 @@ function ComposerMenu({
|
|
|
2327
2703
|
activePanel ? "w-80 min-w-72" : "w-72",
|
|
2328
2704
|
roundedClass
|
|
2329
2705
|
),
|
|
2330
|
-
children: activePanel ? renderCapabilityPanel(activePanel) : /* @__PURE__ */
|
|
2331
|
-
attachmentsEnabled && /* @__PURE__ */
|
|
2332
|
-
/* @__PURE__ */
|
|
2706
|
+
children: activePanel ? renderCapabilityPanel(activePanel) : /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
2707
|
+
attachmentsEnabled && /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
2708
|
+
/* @__PURE__ */ jsxs4(
|
|
2333
2709
|
DropdownMenuItem,
|
|
2334
2710
|
{
|
|
2335
2711
|
onSelect: handleAttachmentClick,
|
|
2336
2712
|
className: cn("gap-3 px-3 py-2", roundedClass),
|
|
2337
2713
|
children: [
|
|
2338
|
-
/* @__PURE__ */
|
|
2339
|
-
/* @__PURE__ */
|
|
2714
|
+
/* @__PURE__ */ jsx10("span", { className: "flex h-6 w-6 items-center justify-center text-muted-foreground", children: /* @__PURE__ */ jsx10(Paperclip, { size: 16 }) }),
|
|
2715
|
+
/* @__PURE__ */ jsx10("span", { children: t("composer.addAttachment") })
|
|
2340
2716
|
]
|
|
2341
2717
|
}
|
|
2342
2718
|
),
|
|
2343
|
-
/* @__PURE__ */
|
|
2719
|
+
/* @__PURE__ */ jsx10(DropdownMenuSeparator, {})
|
|
2344
2720
|
] }),
|
|
2345
|
-
/* @__PURE__ */
|
|
2721
|
+
/* @__PURE__ */ jsxs4(
|
|
2346
2722
|
DropdownMenuItem,
|
|
2347
2723
|
{
|
|
2348
2724
|
role: "switch",
|
|
@@ -2357,9 +2733,9 @@ function ComposerMenu({
|
|
|
2357
2733
|
planModeEnabled && "bg-muted"
|
|
2358
2734
|
),
|
|
2359
2735
|
children: [
|
|
2360
|
-
/* @__PURE__ */
|
|
2361
|
-
/* @__PURE__ */
|
|
2362
|
-
/* @__PURE__ */
|
|
2736
|
+
/* @__PURE__ */ jsx10("span", { className: "flex h-6 w-6 items-center justify-center text-muted-foreground", children: /* @__PURE__ */ jsx10(ListChecks, { size: 16 }) }),
|
|
2737
|
+
/* @__PURE__ */ jsx10("span", { className: "min-w-0 flex-1 text-left", children: t("composer.planMode") }),
|
|
2738
|
+
/* @__PURE__ */ jsx10(
|
|
2363
2739
|
"span",
|
|
2364
2740
|
{
|
|
2365
2741
|
className: cn(
|
|
@@ -2367,7 +2743,7 @@ function ComposerMenu({
|
|
|
2367
2743
|
planModeEnabled ? "bg-primary" : "bg-muted-foreground/20"
|
|
2368
2744
|
),
|
|
2369
2745
|
"aria-hidden": "true",
|
|
2370
|
-
children: /* @__PURE__ */
|
|
2746
|
+
children: /* @__PURE__ */ jsx10(
|
|
2371
2747
|
"span",
|
|
2372
2748
|
{
|
|
2373
2749
|
className: cn(
|
|
@@ -2381,9 +2757,9 @@ function ComposerMenu({
|
|
|
2381
2757
|
]
|
|
2382
2758
|
}
|
|
2383
2759
|
),
|
|
2384
|
-
hasRuntimeCapabilities && /* @__PURE__ */
|
|
2385
|
-
/* @__PURE__ */
|
|
2386
|
-
skills.length > 0 && /* @__PURE__ */
|
|
2760
|
+
hasRuntimeCapabilities && /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
2761
|
+
/* @__PURE__ */ jsx10(DropdownMenuSeparator, {}),
|
|
2762
|
+
skills.length > 0 && /* @__PURE__ */ jsxs4(
|
|
2387
2763
|
DropdownMenuItem,
|
|
2388
2764
|
{
|
|
2389
2765
|
onSelect: (event) => {
|
|
@@ -2392,14 +2768,14 @@ function ComposerMenu({
|
|
|
2392
2768
|
},
|
|
2393
2769
|
className: cn("gap-3 px-3 py-2", roundedClass),
|
|
2394
2770
|
children: [
|
|
2395
|
-
/* @__PURE__ */
|
|
2396
|
-
/* @__PURE__ */
|
|
2397
|
-
selectedSkillCount > 0 && /* @__PURE__ */
|
|
2398
|
-
/* @__PURE__ */
|
|
2771
|
+
/* @__PURE__ */ jsx10("span", { className: "flex h-6 w-6 items-center justify-center text-muted-foreground", children: /* @__PURE__ */ jsx10(Brain, { size: 16 }) }),
|
|
2772
|
+
/* @__PURE__ */ jsx10("span", { className: "min-w-0 flex-1 text-left", children: t("composer.capabilities.skills") }),
|
|
2773
|
+
selectedSkillCount > 0 && /* @__PURE__ */ jsx10("span", { className: "rounded-full bg-primary/10 px-1.5 py-0.5 text-xs font-medium text-primary", children: selectedSkillCount }),
|
|
2774
|
+
/* @__PURE__ */ jsx10(ChevronRight, { size: 16, className: "text-muted-foreground" })
|
|
2399
2775
|
]
|
|
2400
2776
|
}
|
|
2401
2777
|
),
|
|
2402
|
-
plugins.length > 0 && /* @__PURE__ */
|
|
2778
|
+
plugins.length > 0 && /* @__PURE__ */ jsxs4(
|
|
2403
2779
|
DropdownMenuItem,
|
|
2404
2780
|
{
|
|
2405
2781
|
onSelect: (event) => {
|
|
@@ -2408,16 +2784,32 @@ function ComposerMenu({
|
|
|
2408
2784
|
},
|
|
2409
2785
|
className: cn("gap-3 px-3 py-2", roundedClass),
|
|
2410
2786
|
children: [
|
|
2411
|
-
/* @__PURE__ */
|
|
2412
|
-
/* @__PURE__ */
|
|
2413
|
-
selectedPluginCount > 0 && /* @__PURE__ */
|
|
2414
|
-
/* @__PURE__ */
|
|
2787
|
+
/* @__PURE__ */ jsx10("span", { className: "flex h-6 w-6 items-center justify-center text-muted-foreground", children: /* @__PURE__ */ jsx10(Plug, { size: 16 }) }),
|
|
2788
|
+
/* @__PURE__ */ jsx10("span", { className: "min-w-0 flex-1 text-left", children: t("composer.capabilities.plugins") }),
|
|
2789
|
+
selectedPluginCount > 0 && /* @__PURE__ */ jsx10("span", { className: "rounded-full bg-primary/10 px-1.5 py-0.5 text-xs font-medium text-primary", children: selectedPluginCount }),
|
|
2790
|
+
/* @__PURE__ */ jsx10(ChevronRight, { size: 16, className: "text-muted-foreground" })
|
|
2791
|
+
]
|
|
2792
|
+
}
|
|
2793
|
+
),
|
|
2794
|
+
subAgents.length > 0 && /* @__PURE__ */ jsxs4(
|
|
2795
|
+
DropdownMenuItem,
|
|
2796
|
+
{
|
|
2797
|
+
onSelect: (event) => {
|
|
2798
|
+
event.preventDefault();
|
|
2799
|
+
setActivePanel("subAgents");
|
|
2800
|
+
},
|
|
2801
|
+
className: cn("gap-3 px-3 py-2", roundedClass),
|
|
2802
|
+
children: [
|
|
2803
|
+
/* @__PURE__ */ jsx10("span", { className: "flex h-6 w-6 items-center justify-center text-muted-foreground", children: /* @__PURE__ */ jsx10(Bot, { size: 16 }) }),
|
|
2804
|
+
/* @__PURE__ */ jsx10("span", { className: "min-w-0 flex-1 text-left", children: t("composer.capabilities.subAgents") }),
|
|
2805
|
+
selectedSubAgentCount > 0 && /* @__PURE__ */ jsx10("span", { className: "rounded-full bg-primary/10 px-1.5 py-0.5 text-xs font-medium text-primary", children: selectedSubAgentCount }),
|
|
2806
|
+
/* @__PURE__ */ jsx10(ChevronRight, { size: 16, className: "text-muted-foreground" })
|
|
2415
2807
|
]
|
|
2416
2808
|
}
|
|
2417
2809
|
)
|
|
2418
2810
|
] }),
|
|
2419
|
-
tools.length > 0 && /* @__PURE__ */
|
|
2420
|
-
tools.map((tool) => /* @__PURE__ */
|
|
2811
|
+
tools.length > 0 && /* @__PURE__ */ jsx10(DropdownMenuSeparator, {}),
|
|
2812
|
+
tools.map((tool) => /* @__PURE__ */ jsxs4(
|
|
2421
2813
|
DropdownMenuItem,
|
|
2422
2814
|
{
|
|
2423
2815
|
onSelect: () => handleToolSelect(tool),
|
|
@@ -2427,8 +2819,8 @@ function ComposerMenu({
|
|
|
2427
2819
|
selectedTool?.id === tool.id && "bg-muted"
|
|
2428
2820
|
),
|
|
2429
2821
|
children: [
|
|
2430
|
-
/* @__PURE__ */
|
|
2431
|
-
/* @__PURE__ */
|
|
2822
|
+
/* @__PURE__ */ jsx10("span", { className: "flex h-6 w-6 items-center justify-center text-muted-foreground", children: getIconComponent(tool.icon) }),
|
|
2823
|
+
/* @__PURE__ */ jsx10("span", { children: tool.label })
|
|
2432
2824
|
]
|
|
2433
2825
|
},
|
|
2434
2826
|
tool.id
|
|
@@ -2436,7 +2828,7 @@ function ComposerMenu({
|
|
|
2436
2828
|
] })
|
|
2437
2829
|
}
|
|
2438
2830
|
),
|
|
2439
|
-
planModeEnabled && /* @__PURE__ */
|
|
2831
|
+
planModeEnabled && /* @__PURE__ */ jsxs4(
|
|
2440
2832
|
"button",
|
|
2441
2833
|
{
|
|
2442
2834
|
type: "button",
|
|
@@ -2448,8 +2840,8 @@ function ComposerMenu({
|
|
|
2448
2840
|
roundedClass
|
|
2449
2841
|
),
|
|
2450
2842
|
children: [
|
|
2451
|
-
/* @__PURE__ */
|
|
2452
|
-
/* @__PURE__ */
|
|
2843
|
+
/* @__PURE__ */ jsxs4("span", { className: "relative inline-flex h-4 w-4 items-center justify-center", children: [
|
|
2844
|
+
/* @__PURE__ */ jsx10(
|
|
2453
2845
|
ListChecks,
|
|
2454
2846
|
{
|
|
2455
2847
|
"data-slot": "plan-mode-indicator-icon",
|
|
@@ -2457,7 +2849,7 @@ function ComposerMenu({
|
|
|
2457
2849
|
className: "absolute transition-all duration-150 group-hover:scale-75 group-hover:opacity-0"
|
|
2458
2850
|
}
|
|
2459
2851
|
),
|
|
2460
|
-
/* @__PURE__ */
|
|
2852
|
+
/* @__PURE__ */ jsx10(
|
|
2461
2853
|
X,
|
|
2462
2854
|
{
|
|
2463
2855
|
"data-slot": "plan-mode-remove-icon",
|
|
@@ -2466,7 +2858,7 @@ function ComposerMenu({
|
|
|
2466
2858
|
}
|
|
2467
2859
|
)
|
|
2468
2860
|
] }),
|
|
2469
|
-
/* @__PURE__ */
|
|
2861
|
+
/* @__PURE__ */ jsx10("span", { children: t("composer.planModeActive") })
|
|
2470
2862
|
]
|
|
2471
2863
|
}
|
|
2472
2864
|
)
|
|
@@ -2475,73 +2867,7 @@ function ComposerMenu({
|
|
|
2475
2867
|
|
|
2476
2868
|
// src/components/composer/SendButton.tsx
|
|
2477
2869
|
import { ArrowUp, Square } from "lucide-react";
|
|
2478
|
-
|
|
2479
|
-
// src/components/ui/tooltip.tsx
|
|
2480
|
-
import "react";
|
|
2481
|
-
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
2482
|
-
import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
2483
|
-
function TooltipProvider({
|
|
2484
|
-
delayDuration = 0,
|
|
2485
|
-
...props
|
|
2486
|
-
}) {
|
|
2487
|
-
return /* @__PURE__ */ jsx8(
|
|
2488
|
-
TooltipPrimitive.Provider,
|
|
2489
|
-
{
|
|
2490
|
-
"data-slot": "tooltip-provider",
|
|
2491
|
-
delayDuration,
|
|
2492
|
-
...props
|
|
2493
|
-
}
|
|
2494
|
-
);
|
|
2495
|
-
}
|
|
2496
|
-
function Tooltip({
|
|
2497
|
-
...props
|
|
2498
|
-
}) {
|
|
2499
|
-
return /* @__PURE__ */ jsx8(TooltipProvider, { children: /* @__PURE__ */ jsx8(
|
|
2500
|
-
TooltipPrimitive.Root,
|
|
2501
|
-
{
|
|
2502
|
-
"data-slot": "tooltip",
|
|
2503
|
-
...props
|
|
2504
|
-
}
|
|
2505
|
-
) });
|
|
2506
|
-
}
|
|
2507
|
-
function TooltipTrigger({
|
|
2508
|
-
...props
|
|
2509
|
-
}) {
|
|
2510
|
-
return /* @__PURE__ */ jsx8(
|
|
2511
|
-
TooltipPrimitive.Trigger,
|
|
2512
|
-
{
|
|
2513
|
-
"data-slot": "tooltip-trigger",
|
|
2514
|
-
...props
|
|
2515
|
-
}
|
|
2516
|
-
);
|
|
2517
|
-
}
|
|
2518
|
-
function TooltipContent({
|
|
2519
|
-
className,
|
|
2520
|
-
sideOffset = 0,
|
|
2521
|
-
hideArrow = false,
|
|
2522
|
-
children,
|
|
2523
|
-
...props
|
|
2524
|
-
}) {
|
|
2525
|
-
return /* @__PURE__ */ jsx8(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs3(
|
|
2526
|
-
TooltipPrimitive.Content,
|
|
2527
|
-
{
|
|
2528
|
-
"data-slot": "tooltip-content",
|
|
2529
|
-
sideOffset,
|
|
2530
|
-
className: cn(
|
|
2531
|
-
"bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit rounded-md px-3 py-1.5 text-xs text-balance",
|
|
2532
|
-
className
|
|
2533
|
-
),
|
|
2534
|
-
...props,
|
|
2535
|
-
children: [
|
|
2536
|
-
children,
|
|
2537
|
-
!hideArrow ? /* @__PURE__ */ jsx8(TooltipPrimitive.Arrow, { className: "bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" }) : null
|
|
2538
|
-
]
|
|
2539
|
-
}
|
|
2540
|
-
) });
|
|
2541
|
-
}
|
|
2542
|
-
|
|
2543
|
-
// src/components/composer/SendButton.tsx
|
|
2544
|
-
import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
2870
|
+
import { jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2545
2871
|
function SendButton({
|
|
2546
2872
|
disabled = false,
|
|
2547
2873
|
isLoading = false,
|
|
@@ -2554,7 +2880,7 @@ function SendButton({
|
|
|
2554
2880
|
const { theme } = useTheme();
|
|
2555
2881
|
const roundedClass = getRoundedClass(theme.radius);
|
|
2556
2882
|
if (showStop) {
|
|
2557
|
-
return /* @__PURE__ */
|
|
2883
|
+
return /* @__PURE__ */ jsx11(
|
|
2558
2884
|
"button",
|
|
2559
2885
|
{
|
|
2560
2886
|
type: "button",
|
|
@@ -2567,11 +2893,11 @@ function SendButton({
|
|
|
2567
2893
|
"hover:scale-105 active:scale-95"
|
|
2568
2894
|
),
|
|
2569
2895
|
"aria-label": stopLabel,
|
|
2570
|
-
children: /* @__PURE__ */
|
|
2896
|
+
children: /* @__PURE__ */ jsx11(Square, { size: 14, fill: "currentColor", stroke: "currentColor", strokeWidth: 0 })
|
|
2571
2897
|
}
|
|
2572
2898
|
);
|
|
2573
2899
|
}
|
|
2574
|
-
const button = /* @__PURE__ */
|
|
2900
|
+
const button = /* @__PURE__ */ jsx11(
|
|
2575
2901
|
"button",
|
|
2576
2902
|
{
|
|
2577
2903
|
type: "submit",
|
|
@@ -2585,15 +2911,15 @@ function SendButton({
|
|
|
2585
2911
|
"disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:scale-100"
|
|
2586
2912
|
),
|
|
2587
2913
|
"aria-label": sendLabel,
|
|
2588
|
-
children: /* @__PURE__ */
|
|
2914
|
+
children: /* @__PURE__ */ jsx11(ArrowUp, { size: 18, strokeWidth: 2.5 })
|
|
2589
2915
|
}
|
|
2590
2916
|
);
|
|
2591
2917
|
if (!shortcuts?.length || disabled) {
|
|
2592
2918
|
return button;
|
|
2593
2919
|
}
|
|
2594
|
-
return /* @__PURE__ */
|
|
2595
|
-
/* @__PURE__ */
|
|
2596
|
-
/* @__PURE__ */
|
|
2920
|
+
return /* @__PURE__ */ jsxs5(Tooltip, { children: [
|
|
2921
|
+
/* @__PURE__ */ jsx11(TooltipTrigger, { asChild: true, children: button }),
|
|
2922
|
+
/* @__PURE__ */ jsx11(
|
|
2597
2923
|
TooltipContent,
|
|
2598
2924
|
{
|
|
2599
2925
|
side: "top",
|
|
@@ -2603,13 +2929,13 @@ function SendButton({
|
|
|
2603
2929
|
"min-w-36 border border-border/70 bg-background px-3 py-2 text-foreground shadow-lg",
|
|
2604
2930
|
roundedClass
|
|
2605
2931
|
),
|
|
2606
|
-
children: /* @__PURE__ */
|
|
2932
|
+
children: /* @__PURE__ */ jsx11("div", { className: "space-y-1", children: shortcuts.map((shortcut) => /* @__PURE__ */ jsxs5(
|
|
2607
2933
|
"div",
|
|
2608
2934
|
{
|
|
2609
2935
|
className: "flex items-center justify-between gap-4 text-sm",
|
|
2610
2936
|
children: [
|
|
2611
|
-
/* @__PURE__ */
|
|
2612
|
-
/* @__PURE__ */
|
|
2937
|
+
/* @__PURE__ */ jsx11("span", { className: "font-medium", children: shortcut.label }),
|
|
2938
|
+
/* @__PURE__ */ jsx11("kbd", { className: "inline-flex min-w-16 items-center justify-center rounded-full bg-muted px-2.5 py-0.5 text-xs font-medium text-muted-foreground", children: shortcut.keys })
|
|
2613
2939
|
]
|
|
2614
2940
|
},
|
|
2615
2941
|
`${shortcut.label}-${shortcut.keys}`
|
|
@@ -2620,28 +2946,28 @@ function SendButton({
|
|
|
2620
2946
|
}
|
|
2621
2947
|
|
|
2622
2948
|
// src/components/history/HistorySidebar.tsx
|
|
2623
|
-
import * as
|
|
2949
|
+
import * as React12 from "react";
|
|
2624
2950
|
import { History, MessageSquare, PlusCircle, Trash2 } from "lucide-react";
|
|
2625
2951
|
|
|
2626
2952
|
// src/components/ui/scroll-area.tsx
|
|
2627
|
-
import * as
|
|
2953
|
+
import * as React10 from "react";
|
|
2628
2954
|
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
2629
|
-
import { jsx as
|
|
2630
|
-
var ScrollArea =
|
|
2955
|
+
import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2956
|
+
var ScrollArea = React10.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs6(
|
|
2631
2957
|
ScrollAreaPrimitive.Root,
|
|
2632
2958
|
{
|
|
2633
2959
|
ref,
|
|
2634
2960
|
className: cn("relative overflow-hidden", className),
|
|
2635
2961
|
...props,
|
|
2636
2962
|
children: [
|
|
2637
|
-
/* @__PURE__ */
|
|
2638
|
-
/* @__PURE__ */
|
|
2639
|
-
/* @__PURE__ */
|
|
2963
|
+
/* @__PURE__ */ jsx12(ScrollAreaPrimitive.Viewport, { className: "h-full w-full rounded-[inherit]", children }),
|
|
2964
|
+
/* @__PURE__ */ jsx12(ScrollBar, {}),
|
|
2965
|
+
/* @__PURE__ */ jsx12(ScrollAreaPrimitive.Corner, {})
|
|
2640
2966
|
]
|
|
2641
2967
|
}
|
|
2642
2968
|
));
|
|
2643
2969
|
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
2644
|
-
var ScrollBar =
|
|
2970
|
+
var ScrollBar = React10.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsx12(
|
|
2645
2971
|
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
2646
2972
|
{
|
|
2647
2973
|
ref,
|
|
@@ -2653,7 +2979,7 @@ var ScrollBar = React8.forwardRef(({ className, orientation = "vertical", ...pro
|
|
|
2653
2979
|
className
|
|
2654
2980
|
),
|
|
2655
2981
|
...props,
|
|
2656
|
-
children: /* @__PURE__ */
|
|
2982
|
+
children: /* @__PURE__ */ jsx12(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
|
|
2657
2983
|
}
|
|
2658
2984
|
));
|
|
2659
2985
|
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
@@ -2662,21 +2988,21 @@ ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
|
2662
2988
|
import "react";
|
|
2663
2989
|
import { X as X2 } from "lucide-react";
|
|
2664
2990
|
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
2665
|
-
import { jsx as
|
|
2991
|
+
import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2666
2992
|
function Sheet({ ...props }) {
|
|
2667
|
-
return /* @__PURE__ */
|
|
2993
|
+
return /* @__PURE__ */ jsx13(SheetPrimitive.Root, { ...props });
|
|
2668
2994
|
}
|
|
2669
2995
|
function SheetTrigger({ ...props }) {
|
|
2670
|
-
return /* @__PURE__ */
|
|
2996
|
+
return /* @__PURE__ */ jsx13(SheetPrimitive.Trigger, { ...props });
|
|
2671
2997
|
}
|
|
2672
2998
|
function SheetPortal({ ...props }) {
|
|
2673
|
-
return /* @__PURE__ */
|
|
2999
|
+
return /* @__PURE__ */ jsx13(SheetPrimitive.Portal, { ...props });
|
|
2674
3000
|
}
|
|
2675
3001
|
function SheetOverlay({
|
|
2676
3002
|
className,
|
|
2677
3003
|
...props
|
|
2678
3004
|
}) {
|
|
2679
|
-
return /* @__PURE__ */
|
|
3005
|
+
return /* @__PURE__ */ jsx13(
|
|
2680
3006
|
SheetPrimitive.Overlay,
|
|
2681
3007
|
{
|
|
2682
3008
|
className: cn(
|
|
@@ -2700,9 +3026,9 @@ function SheetContent({
|
|
|
2700
3026
|
left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
|
|
2701
3027
|
right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"
|
|
2702
3028
|
};
|
|
2703
|
-
return /* @__PURE__ */
|
|
2704
|
-
/* @__PURE__ */
|
|
2705
|
-
/* @__PURE__ */
|
|
3029
|
+
return /* @__PURE__ */ jsxs7(SheetPortal, { children: [
|
|
3030
|
+
/* @__PURE__ */ jsx13(SheetOverlay, {}),
|
|
3031
|
+
/* @__PURE__ */ jsxs7(
|
|
2706
3032
|
SheetPrimitive.Content,
|
|
2707
3033
|
{
|
|
2708
3034
|
className: cn(
|
|
@@ -2713,9 +3039,9 @@ function SheetContent({
|
|
|
2713
3039
|
...props,
|
|
2714
3040
|
children: [
|
|
2715
3041
|
children,
|
|
2716
|
-
/* @__PURE__ */
|
|
2717
|
-
/* @__PURE__ */
|
|
2718
|
-
/* @__PURE__ */
|
|
3042
|
+
/* @__PURE__ */ jsxs7(SheetPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
|
|
3043
|
+
/* @__PURE__ */ jsx13(X2, { size: 16 }),
|
|
3044
|
+
/* @__PURE__ */ jsx13("span", { className: "sr-only", children: t("sheet.close") })
|
|
2719
3045
|
] })
|
|
2720
3046
|
]
|
|
2721
3047
|
}
|
|
@@ -2726,7 +3052,7 @@ function SheetHeader({
|
|
|
2726
3052
|
className,
|
|
2727
3053
|
...props
|
|
2728
3054
|
}) {
|
|
2729
|
-
return /* @__PURE__ */
|
|
3055
|
+
return /* @__PURE__ */ jsx13(
|
|
2730
3056
|
"div",
|
|
2731
3057
|
{
|
|
2732
3058
|
className: cn(
|
|
@@ -2741,7 +3067,7 @@ function SheetTitle({
|
|
|
2741
3067
|
className,
|
|
2742
3068
|
...props
|
|
2743
3069
|
}) {
|
|
2744
|
-
return /* @__PURE__ */
|
|
3070
|
+
return /* @__PURE__ */ jsx13(
|
|
2745
3071
|
SheetPrimitive.Title,
|
|
2746
3072
|
{
|
|
2747
3073
|
className: cn("text-lg font-semibold text-foreground", className),
|
|
@@ -2751,7 +3077,7 @@ function SheetTitle({
|
|
|
2751
3077
|
}
|
|
2752
3078
|
|
|
2753
3079
|
// src/components/history/HistorySidebar.tsx
|
|
2754
|
-
import { jsx as
|
|
3080
|
+
import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2755
3081
|
function HistorySidebar({
|
|
2756
3082
|
threads = [],
|
|
2757
3083
|
currentThreadId,
|
|
@@ -2762,7 +3088,7 @@ function HistorySidebar({
|
|
|
2762
3088
|
disabled = false
|
|
2763
3089
|
}) {
|
|
2764
3090
|
const { t } = useChatkitTranslation();
|
|
2765
|
-
const [open, setOpen] =
|
|
3091
|
+
const [open, setOpen] = React12.useState(false);
|
|
2766
3092
|
const handleNewThread = () => {
|
|
2767
3093
|
onNewThread?.();
|
|
2768
3094
|
setOpen(false);
|
|
@@ -2771,9 +3097,9 @@ function HistorySidebar({
|
|
|
2771
3097
|
onSelectThread?.(id);
|
|
2772
3098
|
setOpen(false);
|
|
2773
3099
|
};
|
|
2774
|
-
return /* @__PURE__ */
|
|
2775
|
-
/* @__PURE__ */
|
|
2776
|
-
/* @__PURE__ */
|
|
3100
|
+
return /* @__PURE__ */ jsxs8(Sheet, { open, onOpenChange: setOpen, children: [
|
|
3101
|
+
/* @__PURE__ */ jsxs8(Tooltip, { children: [
|
|
3102
|
+
/* @__PURE__ */ jsx14(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx14("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ jsx14(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsxs8(
|
|
2777
3103
|
Button,
|
|
2778
3104
|
{
|
|
2779
3105
|
variant: "ghost",
|
|
@@ -2782,28 +3108,28 @@ function HistorySidebar({
|
|
|
2782
3108
|
className: "h-8 w-8 cursor-pointer",
|
|
2783
3109
|
"aria-label": t("history.threadHistory"),
|
|
2784
3110
|
children: [
|
|
2785
|
-
/* @__PURE__ */
|
|
2786
|
-
/* @__PURE__ */
|
|
3111
|
+
/* @__PURE__ */ jsx14(History, { size: 16 }),
|
|
3112
|
+
/* @__PURE__ */ jsx14("span", { className: "sr-only", children: t("history.threadHistory") })
|
|
2787
3113
|
]
|
|
2788
3114
|
}
|
|
2789
3115
|
) }) }) }),
|
|
2790
|
-
/* @__PURE__ */
|
|
3116
|
+
/* @__PURE__ */ jsx14(TooltipContent, { side: "bottom", children: t("history.threadHistory") })
|
|
2791
3117
|
] }),
|
|
2792
|
-
/* @__PURE__ */
|
|
2793
|
-
/* @__PURE__ */
|
|
2794
|
-
/* @__PURE__ */
|
|
3118
|
+
/* @__PURE__ */ jsxs8(SheetContent, { side: "right", className: "w-80 p-0", children: [
|
|
3119
|
+
/* @__PURE__ */ jsx14(SheetHeader, { className: "border-b p-4", children: /* @__PURE__ */ jsx14(SheetTitle, { children: t("history.title") }) }),
|
|
3120
|
+
/* @__PURE__ */ jsx14("div", { className: "p-4", children: /* @__PURE__ */ jsxs8(
|
|
2795
3121
|
Button,
|
|
2796
3122
|
{
|
|
2797
3123
|
onClick: handleNewThread,
|
|
2798
3124
|
className: "w-full justify-start gap-2",
|
|
2799
3125
|
variant: "secondary",
|
|
2800
3126
|
children: [
|
|
2801
|
-
/* @__PURE__ */
|
|
3127
|
+
/* @__PURE__ */ jsx14(PlusCircle, { size: 16 }),
|
|
2802
3128
|
t("history.newThread")
|
|
2803
3129
|
]
|
|
2804
3130
|
}
|
|
2805
3131
|
) }),
|
|
2806
|
-
/* @__PURE__ */
|
|
3132
|
+
/* @__PURE__ */ jsx14(ScrollArea, { className: "h-[calc(100vh-140px)]", children: /* @__PURE__ */ jsx14("div", { className: "px-4 pb-4", children: threads.length === 0 ? /* @__PURE__ */ jsx14("div", { className: "py-8 text-center text-sm text-muted-foreground", children: t("history.empty") }) : /* @__PURE__ */ jsx14("div", { className: "space-y-1", children: threads.map((thread) => /* @__PURE__ */ jsxs8(
|
|
2807
3133
|
"div",
|
|
2808
3134
|
{
|
|
2809
3135
|
className: cn(
|
|
@@ -2813,9 +3139,9 @@ function HistorySidebar({
|
|
|
2813
3139
|
),
|
|
2814
3140
|
onClick: () => handleSelectThread(thread.id),
|
|
2815
3141
|
children: [
|
|
2816
|
-
/* @__PURE__ */
|
|
2817
|
-
/* @__PURE__ */
|
|
2818
|
-
showDelete && onDeleteThread && /* @__PURE__ */
|
|
3142
|
+
/* @__PURE__ */ jsx14("span", { className: "text-muted-foreground", children: /* @__PURE__ */ jsx14(MessageSquare, { size: 16 }) }),
|
|
3143
|
+
/* @__PURE__ */ jsx14("span", { className: "flex-1 truncate", children: thread.title }),
|
|
3144
|
+
showDelete && onDeleteThread && /* @__PURE__ */ jsx14(
|
|
2819
3145
|
"button",
|
|
2820
3146
|
{
|
|
2821
3147
|
type: "button",
|
|
@@ -2824,7 +3150,7 @@ function HistorySidebar({
|
|
|
2824
3150
|
onDeleteThread(thread.id);
|
|
2825
3151
|
},
|
|
2826
3152
|
className: "opacity-0 group-hover:opacity-100 p-1 rounded hover:bg-destructive/10 hover:text-destructive transition-all",
|
|
2827
|
-
children: /* @__PURE__ */
|
|
3153
|
+
children: /* @__PURE__ */ jsx14(Trash2, { size: 14 })
|
|
2828
3154
|
}
|
|
2829
3155
|
)
|
|
2830
3156
|
]
|
|
@@ -2836,11 +3162,11 @@ function HistorySidebar({
|
|
|
2836
3162
|
}
|
|
2837
3163
|
|
|
2838
3164
|
// src/components/composer/pending-follow-ups.tsx
|
|
2839
|
-
import * as
|
|
3165
|
+
import * as React14 from "react";
|
|
2840
3166
|
import {
|
|
2841
3167
|
CornerDownLeft,
|
|
2842
3168
|
Ellipsis,
|
|
2843
|
-
Info,
|
|
3169
|
+
Info as Info2,
|
|
2844
3170
|
PencilLine,
|
|
2845
3171
|
SlidersHorizontal as SlidersHorizontal2,
|
|
2846
3172
|
Trash2 as Trash22
|
|
@@ -2849,16 +3175,16 @@ import {
|
|
|
2849
3175
|
// src/components/ui/popover.tsx
|
|
2850
3176
|
import "react";
|
|
2851
3177
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
2852
|
-
import { jsx as
|
|
3178
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
2853
3179
|
function Popover({
|
|
2854
3180
|
...props
|
|
2855
3181
|
}) {
|
|
2856
|
-
return /* @__PURE__ */
|
|
3182
|
+
return /* @__PURE__ */ jsx15(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
|
|
2857
3183
|
}
|
|
2858
3184
|
function PopoverTrigger({
|
|
2859
3185
|
...props
|
|
2860
3186
|
}) {
|
|
2861
|
-
return /* @__PURE__ */
|
|
3187
|
+
return /* @__PURE__ */ jsx15(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
2862
3188
|
}
|
|
2863
3189
|
function PopoverContent({
|
|
2864
3190
|
className,
|
|
@@ -2866,7 +3192,7 @@ function PopoverContent({
|
|
|
2866
3192
|
sideOffset = 4,
|
|
2867
3193
|
...props
|
|
2868
3194
|
}) {
|
|
2869
|
-
return /* @__PURE__ */
|
|
3195
|
+
return /* @__PURE__ */ jsx15(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx15(
|
|
2870
3196
|
PopoverPrimitive.Content,
|
|
2871
3197
|
{
|
|
2872
3198
|
"data-slot": "popover-content",
|
|
@@ -2882,7 +3208,7 @@ function PopoverContent({
|
|
|
2882
3208
|
}
|
|
2883
3209
|
|
|
2884
3210
|
// src/components/composer/pending-follow-ups.tsx
|
|
2885
|
-
import { jsx as
|
|
3211
|
+
import { jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2886
3212
|
function getPendingFollowUpText(item, referencedContentFallback) {
|
|
2887
3213
|
const text = item.request?.input?.input?.trim() ?? "";
|
|
2888
3214
|
if (text) {
|
|
@@ -2927,9 +3253,9 @@ function PendingFollowUps({
|
|
|
2927
3253
|
const { t } = useChatkitTranslation();
|
|
2928
3254
|
const rounded = useRoundedClasses();
|
|
2929
3255
|
const referencedContentFallback = t("chat.referencedContentOnly");
|
|
2930
|
-
const [isSettingsOpen, setIsSettingsOpen] =
|
|
2931
|
-
const [openMenuId, setOpenMenuId] =
|
|
2932
|
-
|
|
3256
|
+
const [isSettingsOpen, setIsSettingsOpen] = React14.useState(false);
|
|
3257
|
+
const [openMenuId, setOpenMenuId] = React14.useState(null);
|
|
3258
|
+
React14.useEffect(() => {
|
|
2933
3259
|
if (items.length === 0 && isSettingsOpen) {
|
|
2934
3260
|
setIsSettingsOpen(false);
|
|
2935
3261
|
}
|
|
@@ -2940,7 +3266,7 @@ function PendingFollowUps({
|
|
|
2940
3266
|
if (items.length === 0) {
|
|
2941
3267
|
return null;
|
|
2942
3268
|
}
|
|
2943
|
-
return /* @__PURE__ */
|
|
3269
|
+
return /* @__PURE__ */ jsx16(
|
|
2944
3270
|
"div",
|
|
2945
3271
|
{
|
|
2946
3272
|
className: cn(
|
|
@@ -2949,11 +3275,11 @@ function PendingFollowUps({
|
|
|
2949
3275
|
attachToComposer ? rounded.top : rounded.panel,
|
|
2950
3276
|
className
|
|
2951
3277
|
),
|
|
2952
|
-
children: /* @__PURE__ */
|
|
2953
|
-
/* @__PURE__ */
|
|
2954
|
-
/* @__PURE__ */
|
|
2955
|
-
/* @__PURE__ */
|
|
2956
|
-
/* @__PURE__ */
|
|
3278
|
+
children: /* @__PURE__ */ jsxs9("div", { className: "space-y-1", children: [
|
|
3279
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex items-center justify-between gap-3", children: [
|
|
3280
|
+
/* @__PURE__ */ jsx16("div", { className: "text-xs font-medium text-foreground", children: t("chat.followUps.pending") }),
|
|
3281
|
+
/* @__PURE__ */ jsxs9(Tooltip, { children: [
|
|
3282
|
+
/* @__PURE__ */ jsx16(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs9(
|
|
2957
3283
|
"button",
|
|
2958
3284
|
{
|
|
2959
3285
|
type: "button",
|
|
@@ -2967,15 +3293,15 @@ function PendingFollowUps({
|
|
|
2967
3293
|
"aria-expanded": isSettingsOpen,
|
|
2968
3294
|
"aria-controls": "follow-ups-settings-panel",
|
|
2969
3295
|
children: [
|
|
2970
|
-
/* @__PURE__ */
|
|
2971
|
-
/* @__PURE__ */
|
|
3296
|
+
/* @__PURE__ */ jsx16(SlidersHorizontal2, { className: "h-3.5 w-3.5" }),
|
|
3297
|
+
/* @__PURE__ */ jsx16("span", { className: "sr-only", children: t("chat.followUps.settings") })
|
|
2972
3298
|
]
|
|
2973
3299
|
}
|
|
2974
3300
|
) }),
|
|
2975
|
-
/* @__PURE__ */
|
|
3301
|
+
/* @__PURE__ */ jsx16(TooltipContent, { side: "top", children: t("chat.followUps.settings") })
|
|
2976
3302
|
] })
|
|
2977
3303
|
] }),
|
|
2978
|
-
isSettingsOpen && /* @__PURE__ */
|
|
3304
|
+
isSettingsOpen && /* @__PURE__ */ jsx16(
|
|
2979
3305
|
"div",
|
|
2980
3306
|
{
|
|
2981
3307
|
id: "follow-ups-settings-panel",
|
|
@@ -2983,20 +3309,20 @@ function PendingFollowUps({
|
|
|
2983
3309
|
"border border-border/70 bg-muted/20 px-3 py-2",
|
|
2984
3310
|
rounded.panel
|
|
2985
3311
|
),
|
|
2986
|
-
children: /* @__PURE__ */
|
|
2987
|
-
/* @__PURE__ */
|
|
2988
|
-
/* @__PURE__ */
|
|
2989
|
-
/* @__PURE__ */
|
|
3312
|
+
children: /* @__PURE__ */ jsxs9("div", { className: "flex items-center justify-between gap-3", children: [
|
|
3313
|
+
/* @__PURE__ */ jsxs9("div", { className: "min-w-0", children: [
|
|
3314
|
+
/* @__PURE__ */ jsx16("div", { className: "text-xs font-medium text-foreground", children: t("chat.followUps.label") }),
|
|
3315
|
+
/* @__PURE__ */ jsx16("div", { className: "text-[11px] text-muted-foreground", children: isLoading ? t("chat.followUps.activeHint") : t("chat.followUps.idleHint") })
|
|
2990
3316
|
] }),
|
|
2991
|
-
/* @__PURE__ */
|
|
3317
|
+
/* @__PURE__ */ jsx16(
|
|
2992
3318
|
"div",
|
|
2993
3319
|
{
|
|
2994
3320
|
className: cn(
|
|
2995
3321
|
"inline-flex shrink-0 border border-border bg-background p-1",
|
|
2996
3322
|
rounded.control
|
|
2997
3323
|
),
|
|
2998
|
-
children: ["queue", "steer"].map((behavior) => /* @__PURE__ */
|
|
2999
|
-
/* @__PURE__ */
|
|
3324
|
+
children: ["queue", "steer"].map((behavior) => /* @__PURE__ */ jsxs9(Tooltip, { children: [
|
|
3325
|
+
/* @__PURE__ */ jsx16(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx16(
|
|
3000
3326
|
"button",
|
|
3001
3327
|
{
|
|
3002
3328
|
type: "button",
|
|
@@ -3012,7 +3338,7 @@ function PendingFollowUps({
|
|
|
3012
3338
|
children: behavior === "queue" ? t("chat.followUps.queue") : t("chat.followUps.steer")
|
|
3013
3339
|
}
|
|
3014
3340
|
) }),
|
|
3015
|
-
/* @__PURE__ */
|
|
3341
|
+
/* @__PURE__ */ jsx16(TooltipContent, { side: "top", children: behavior === "queue" ? t("chat.followUps.queueHint") : t("chat.followUps.steerHint") })
|
|
3016
3342
|
] }, behavior))
|
|
3017
3343
|
}
|
|
3018
3344
|
)
|
|
@@ -3021,18 +3347,18 @@ function PendingFollowUps({
|
|
|
3021
3347
|
),
|
|
3022
3348
|
items.map((item) => {
|
|
3023
3349
|
const canSendItemNow = item.mode === "queue" && canSendNow(item.id);
|
|
3024
|
-
return /* @__PURE__ */
|
|
3350
|
+
return /* @__PURE__ */ jsx16(
|
|
3025
3351
|
"div",
|
|
3026
3352
|
{
|
|
3027
3353
|
className: cn(
|
|
3028
3354
|
"border border-border/50 bg-muted/15 px-2 py-1",
|
|
3029
3355
|
rounded.panel
|
|
3030
3356
|
),
|
|
3031
|
-
children: /* @__PURE__ */
|
|
3032
|
-
/* @__PURE__ */
|
|
3033
|
-
/* @__PURE__ */
|
|
3034
|
-
/* @__PURE__ */
|
|
3035
|
-
/* @__PURE__ */
|
|
3357
|
+
children: /* @__PURE__ */ jsxs9("div", { className: "flex items-start gap-2.5", children: [
|
|
3358
|
+
/* @__PURE__ */ jsx16(CornerDownLeft, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
3359
|
+
/* @__PURE__ */ jsxs9("div", { className: "min-w-0 flex-1", children: [
|
|
3360
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex items-start gap-2", children: [
|
|
3361
|
+
/* @__PURE__ */ jsx16("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsx16(
|
|
3036
3362
|
"div",
|
|
3037
3363
|
{
|
|
3038
3364
|
className: "truncate text-[13px] leading-5 text-foreground",
|
|
@@ -3046,8 +3372,8 @@ function PendingFollowUps({
|
|
|
3046
3372
|
)
|
|
3047
3373
|
}
|
|
3048
3374
|
) }),
|
|
3049
|
-
/* @__PURE__ */
|
|
3050
|
-
item.mode === "queue" && isLoading && /* @__PURE__ */
|
|
3375
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
3376
|
+
item.mode === "queue" && isLoading && /* @__PURE__ */ jsx16(
|
|
3051
3377
|
"button",
|
|
3052
3378
|
{
|
|
3053
3379
|
type: "button",
|
|
@@ -3061,7 +3387,7 @@ function PendingFollowUps({
|
|
|
3061
3387
|
children: t("chat.followUps.steerAction")
|
|
3062
3388
|
}
|
|
3063
3389
|
),
|
|
3064
|
-
canSendItemNow && /* @__PURE__ */
|
|
3390
|
+
canSendItemNow && /* @__PURE__ */ jsx16(
|
|
3065
3391
|
"button",
|
|
3066
3392
|
{
|
|
3067
3393
|
type: "button",
|
|
@@ -3075,7 +3401,7 @@ function PendingFollowUps({
|
|
|
3075
3401
|
children: t("chat.followUps.sendNow")
|
|
3076
3402
|
}
|
|
3077
3403
|
),
|
|
3078
|
-
item.mode === "queue" && /* @__PURE__ */
|
|
3404
|
+
item.mode === "queue" && /* @__PURE__ */ jsx16(
|
|
3079
3405
|
"button",
|
|
3080
3406
|
{
|
|
3081
3407
|
type: "button",
|
|
@@ -3086,16 +3412,16 @@ function PendingFollowUps({
|
|
|
3086
3412
|
),
|
|
3087
3413
|
"aria-label": t("chat.followUps.remove"),
|
|
3088
3414
|
title: t("chat.followUps.remove"),
|
|
3089
|
-
children: /* @__PURE__ */
|
|
3415
|
+
children: /* @__PURE__ */ jsx16(Trash22, { size: 13 })
|
|
3090
3416
|
}
|
|
3091
3417
|
),
|
|
3092
|
-
item.mode === "queue" && /* @__PURE__ */
|
|
3418
|
+
item.mode === "queue" && /* @__PURE__ */ jsxs9(
|
|
3093
3419
|
Popover,
|
|
3094
3420
|
{
|
|
3095
3421
|
open: openMenuId === item.id,
|
|
3096
3422
|
onOpenChange: (open) => setOpenMenuId(open ? item.id : null),
|
|
3097
3423
|
children: [
|
|
3098
|
-
/* @__PURE__ */
|
|
3424
|
+
/* @__PURE__ */ jsx16(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx16(
|
|
3099
3425
|
"button",
|
|
3100
3426
|
{
|
|
3101
3427
|
type: "button",
|
|
@@ -3105,10 +3431,10 @@ function PendingFollowUps({
|
|
|
3105
3431
|
),
|
|
3106
3432
|
"aria-label": t("chat.followUps.more"),
|
|
3107
3433
|
title: t("chat.followUps.more"),
|
|
3108
|
-
children: /* @__PURE__ */
|
|
3434
|
+
children: /* @__PURE__ */ jsx16(Ellipsis, { size: 13 })
|
|
3109
3435
|
}
|
|
3110
3436
|
) }),
|
|
3111
|
-
/* @__PURE__ */
|
|
3437
|
+
/* @__PURE__ */ jsx16(
|
|
3112
3438
|
PopoverContent,
|
|
3113
3439
|
{
|
|
3114
3440
|
align: "end",
|
|
@@ -3117,8 +3443,8 @@ function PendingFollowUps({
|
|
|
3117
3443
|
"w-52 border-border/70 bg-background p-1.5",
|
|
3118
3444
|
rounded.panel
|
|
3119
3445
|
),
|
|
3120
|
-
children: /* @__PURE__ */
|
|
3121
|
-
/* @__PURE__ */
|
|
3446
|
+
children: /* @__PURE__ */ jsxs9("div", { className: "flex flex-col gap-1", children: [
|
|
3447
|
+
/* @__PURE__ */ jsxs9(
|
|
3122
3448
|
"button",
|
|
3123
3449
|
{
|
|
3124
3450
|
type: "button",
|
|
@@ -3131,12 +3457,12 @@ function PendingFollowUps({
|
|
|
3131
3457
|
rounded.control
|
|
3132
3458
|
),
|
|
3133
3459
|
children: [
|
|
3134
|
-
/* @__PURE__ */
|
|
3135
|
-
/* @__PURE__ */
|
|
3460
|
+
/* @__PURE__ */ jsx16(PencilLine, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
3461
|
+
/* @__PURE__ */ jsx16("span", { children: t("chat.followUps.edit") })
|
|
3136
3462
|
]
|
|
3137
3463
|
}
|
|
3138
3464
|
),
|
|
3139
|
-
/* @__PURE__ */
|
|
3465
|
+
/* @__PURE__ */ jsxs9(
|
|
3140
3466
|
"button",
|
|
3141
3467
|
{
|
|
3142
3468
|
type: "button",
|
|
@@ -3149,8 +3475,8 @@ function PendingFollowUps({
|
|
|
3149
3475
|
rounded.control
|
|
3150
3476
|
),
|
|
3151
3477
|
children: [
|
|
3152
|
-
/* @__PURE__ */
|
|
3153
|
-
/* @__PURE__ */
|
|
3478
|
+
/* @__PURE__ */ jsx16(CornerDownLeft, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
3479
|
+
/* @__PURE__ */ jsx16("span", { children: t("chat.followUps.turnOffQueueing") })
|
|
3154
3480
|
]
|
|
3155
3481
|
}
|
|
3156
3482
|
)
|
|
@@ -3162,9 +3488,9 @@ function PendingFollowUps({
|
|
|
3162
3488
|
)
|
|
3163
3489
|
] })
|
|
3164
3490
|
] }),
|
|
3165
|
-
/* @__PURE__ */
|
|
3166
|
-
/* @__PURE__ */
|
|
3167
|
-
/* @__PURE__ */
|
|
3491
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-1.5 text-[10px] leading-4 text-muted-foreground", children: [
|
|
3492
|
+
/* @__PURE__ */ jsx16(Info2, { className: "h-3 w-3 shrink-0" }),
|
|
3493
|
+
/* @__PURE__ */ jsx16("span", { className: "truncate", children: item.mode === "queue" ? canSendItemNow ? t("chat.followUps.manualQueueHint") : t("chat.followUps.queueHint") : t("chat.followUps.steerHint") })
|
|
3168
3494
|
] })
|
|
3169
3495
|
] })
|
|
3170
3496
|
] })
|
|
@@ -3178,7 +3504,7 @@ function PendingFollowUps({
|
|
|
3178
3504
|
}
|
|
3179
3505
|
|
|
3180
3506
|
// src/components/composer/pending-todos.tsx
|
|
3181
|
-
import * as
|
|
3507
|
+
import * as React15 from "react";
|
|
3182
3508
|
import {
|
|
3183
3509
|
CheckCircle2,
|
|
3184
3510
|
ChevronDown,
|
|
@@ -3186,7 +3512,7 @@ import {
|
|
|
3186
3512
|
CircleDashed,
|
|
3187
3513
|
ListTodo
|
|
3188
3514
|
} from "lucide-react";
|
|
3189
|
-
import { jsx as
|
|
3515
|
+
import { jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3190
3516
|
function useRoundedClasses2() {
|
|
3191
3517
|
const { theme } = useTheme();
|
|
3192
3518
|
return {
|
|
@@ -3201,12 +3527,12 @@ function useRoundedClasses2() {
|
|
|
3201
3527
|
}
|
|
3202
3528
|
function TodoStatusIcon({ status }) {
|
|
3203
3529
|
if (status === "completed") {
|
|
3204
|
-
return /* @__PURE__ */
|
|
3530
|
+
return /* @__PURE__ */ jsx17(CheckCircle2, { className: "mt-1 h-4 w-4 shrink-0 text-emerald-600" });
|
|
3205
3531
|
}
|
|
3206
3532
|
if (status === "in_progress") {
|
|
3207
|
-
return /* @__PURE__ */
|
|
3533
|
+
return /* @__PURE__ */ jsx17(CircleDashed, { className: "mt-1 h-4 w-4 shrink-0 text-foreground/70" });
|
|
3208
3534
|
}
|
|
3209
|
-
return /* @__PURE__ */
|
|
3535
|
+
return /* @__PURE__ */ jsx17(Circle, { className: "mt-1 h-4 w-4 shrink-0 text-muted-foreground" });
|
|
3210
3536
|
}
|
|
3211
3537
|
function PendingTodos({
|
|
3212
3538
|
snapshot,
|
|
@@ -3215,16 +3541,16 @@ function PendingTodos({
|
|
|
3215
3541
|
}) {
|
|
3216
3542
|
const { t } = useChatkitTranslation();
|
|
3217
3543
|
const rounded = useRoundedClasses2();
|
|
3218
|
-
const listId =
|
|
3219
|
-
const [isCollapsed, setIsCollapsed] =
|
|
3220
|
-
|
|
3544
|
+
const listId = React15.useId();
|
|
3545
|
+
const [isCollapsed, setIsCollapsed] = React15.useState(false);
|
|
3546
|
+
React15.useEffect(() => {
|
|
3221
3547
|
setIsCollapsed(false);
|
|
3222
3548
|
}, [snapshot?.componentId]);
|
|
3223
3549
|
if (!snapshot || snapshot.items.length === 0) {
|
|
3224
3550
|
return null;
|
|
3225
3551
|
}
|
|
3226
3552
|
const completedCount = countCompletedTodos(snapshot.items);
|
|
3227
|
-
return /* @__PURE__ */
|
|
3553
|
+
return /* @__PURE__ */ jsxs10(
|
|
3228
3554
|
"div",
|
|
3229
3555
|
{
|
|
3230
3556
|
"aria-live": "polite",
|
|
@@ -3235,7 +3561,7 @@ function PendingTodos({
|
|
|
3235
3561
|
className
|
|
3236
3562
|
),
|
|
3237
3563
|
children: [
|
|
3238
|
-
/* @__PURE__ */
|
|
3564
|
+
/* @__PURE__ */ jsxs10(
|
|
3239
3565
|
"button",
|
|
3240
3566
|
{
|
|
3241
3567
|
type: "button",
|
|
@@ -3244,14 +3570,14 @@ function PendingTodos({
|
|
|
3244
3570
|
"aria-controls": listId,
|
|
3245
3571
|
onClick: () => setIsCollapsed((prev) => !prev),
|
|
3246
3572
|
children: [
|
|
3247
|
-
/* @__PURE__ */
|
|
3248
|
-
/* @__PURE__ */
|
|
3249
|
-
/* @__PURE__ */
|
|
3573
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex min-w-0 items-center gap-2 text-sm font-medium text-foreground", children: [
|
|
3574
|
+
/* @__PURE__ */ jsx17(ListTodo, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
|
|
3575
|
+
/* @__PURE__ */ jsx17("span", { className: "truncate", children: t("chat.todos.summary", {
|
|
3250
3576
|
total: snapshot.items.length,
|
|
3251
3577
|
completed: completedCount
|
|
3252
3578
|
}) })
|
|
3253
3579
|
] }),
|
|
3254
|
-
/* @__PURE__ */
|
|
3580
|
+
/* @__PURE__ */ jsx17("div", { className: "flex items-center shrink-0", children: /* @__PURE__ */ jsx17(
|
|
3255
3581
|
ChevronDown,
|
|
3256
3582
|
{
|
|
3257
3583
|
className: cn(
|
|
@@ -3263,13 +3589,13 @@ function PendingTodos({
|
|
|
3263
3589
|
]
|
|
3264
3590
|
}
|
|
3265
3591
|
),
|
|
3266
|
-
!isCollapsed && /* @__PURE__ */
|
|
3592
|
+
!isCollapsed && /* @__PURE__ */ jsx17("ol", { id: listId, className: "mt-3 space-y-2.5", children: snapshot.items.map((item, index) => /* @__PURE__ */ jsxs10(
|
|
3267
3593
|
"li",
|
|
3268
3594
|
{
|
|
3269
3595
|
className: "grid min-w-0 grid-cols-[16px_24px_minmax(0,1fr)] items-start gap-2 overflow-hidden",
|
|
3270
3596
|
children: [
|
|
3271
|
-
/* @__PURE__ */
|
|
3272
|
-
/* @__PURE__ */
|
|
3597
|
+
/* @__PURE__ */ jsx17(TodoStatusIcon, { status: item.status }),
|
|
3598
|
+
/* @__PURE__ */ jsxs10(
|
|
3273
3599
|
"span",
|
|
3274
3600
|
{
|
|
3275
3601
|
className: cn(
|
|
@@ -3282,7 +3608,7 @@ function PendingTodos({
|
|
|
3282
3608
|
]
|
|
3283
3609
|
}
|
|
3284
3610
|
),
|
|
3285
|
-
/* @__PURE__ */
|
|
3611
|
+
/* @__PURE__ */ jsx17(
|
|
3286
3612
|
"span",
|
|
3287
3613
|
{
|
|
3288
3614
|
title: item.content,
|
|
@@ -3303,7 +3629,7 @@ function PendingTodos({
|
|
|
3303
3629
|
}
|
|
3304
3630
|
|
|
3305
3631
|
// src/components/composer/request-user-input-panel.tsx
|
|
3306
|
-
import * as
|
|
3632
|
+
import * as React16 from "react";
|
|
3307
3633
|
import {
|
|
3308
3634
|
ArrowDown,
|
|
3309
3635
|
ArrowUp as ArrowUp2,
|
|
@@ -3311,9 +3637,9 @@ import {
|
|
|
3311
3637
|
ChevronLeft,
|
|
3312
3638
|
ChevronRight as ChevronRight2,
|
|
3313
3639
|
CornerDownLeft as CornerDownLeft2,
|
|
3314
|
-
Info as
|
|
3640
|
+
Info as Info3
|
|
3315
3641
|
} from "lucide-react";
|
|
3316
|
-
import { jsx as
|
|
3642
|
+
import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3317
3643
|
var emptyQuestions = [];
|
|
3318
3644
|
function useRoundedClasses3() {
|
|
3319
3645
|
const { theme } = useTheme();
|
|
@@ -3439,21 +3765,21 @@ function RequestUserInputPanel({
|
|
|
3439
3765
|
}) {
|
|
3440
3766
|
const { t } = useChatkitTranslation();
|
|
3441
3767
|
const rounded = useRoundedClasses3();
|
|
3442
|
-
const [drafts, setDrafts] =
|
|
3443
|
-
const [currentQuestionIndex, setCurrentQuestionIndex] =
|
|
3444
|
-
const otherInputRef =
|
|
3768
|
+
const [drafts, setDrafts] = React16.useState({});
|
|
3769
|
+
const [currentQuestionIndex, setCurrentQuestionIndex] = React16.useState(0);
|
|
3770
|
+
const otherInputRef = React16.useRef(null);
|
|
3445
3771
|
const questions = request?.params.questions ?? emptyQuestions;
|
|
3446
|
-
|
|
3772
|
+
React16.useEffect(() => {
|
|
3447
3773
|
setDrafts({});
|
|
3448
3774
|
setCurrentQuestionIndex(0);
|
|
3449
3775
|
}, [request?.id]);
|
|
3450
|
-
|
|
3776
|
+
React16.useEffect(() => {
|
|
3451
3777
|
if (questions.length === 0) return;
|
|
3452
3778
|
setCurrentQuestionIndex(
|
|
3453
3779
|
(index) => Math.min(Math.max(index, 0), questions.length - 1)
|
|
3454
3780
|
);
|
|
3455
3781
|
}, [questions.length]);
|
|
3456
|
-
const setQuestionDraft =
|
|
3782
|
+
const setQuestionDraft = React16.useCallback(
|
|
3457
3783
|
(questionId, draft) => {
|
|
3458
3784
|
setDrafts((previous) => ({
|
|
3459
3785
|
...previous,
|
|
@@ -3462,10 +3788,10 @@ function RequestUserInputPanel({
|
|
|
3462
3788
|
},
|
|
3463
3789
|
[]
|
|
3464
3790
|
);
|
|
3465
|
-
const focusOtherInput =
|
|
3791
|
+
const focusOtherInput = React16.useCallback(() => {
|
|
3466
3792
|
window.setTimeout(() => otherInputRef.current?.focus(), 0);
|
|
3467
3793
|
}, []);
|
|
3468
|
-
const selectOption =
|
|
3794
|
+
const selectOption = React16.useCallback(
|
|
3469
3795
|
(question, optionIndex) => {
|
|
3470
3796
|
const previousDraft = drafts[question.id];
|
|
3471
3797
|
setQuestionDraft(question.id, {
|
|
@@ -3476,7 +3802,7 @@ function RequestUserInputPanel({
|
|
|
3476
3802
|
},
|
|
3477
3803
|
[drafts, setQuestionDraft]
|
|
3478
3804
|
);
|
|
3479
|
-
const selectOther =
|
|
3805
|
+
const selectOther = React16.useCallback(
|
|
3480
3806
|
(question, otherText2) => {
|
|
3481
3807
|
const previousDraft = drafts[question.id];
|
|
3482
3808
|
setQuestionDraft(question.id, {
|
|
@@ -3487,7 +3813,7 @@ function RequestUserInputPanel({
|
|
|
3487
3813
|
},
|
|
3488
3814
|
[drafts, focusOtherInput, setQuestionDraft]
|
|
3489
3815
|
);
|
|
3490
|
-
const goToQuestion =
|
|
3816
|
+
const goToQuestion = React16.useCallback(
|
|
3491
3817
|
(index) => {
|
|
3492
3818
|
if (questions.length === 0) return;
|
|
3493
3819
|
setCurrentQuestionIndex(
|
|
@@ -3496,7 +3822,7 @@ function RequestUserInputPanel({
|
|
|
3496
3822
|
},
|
|
3497
3823
|
[questions.length]
|
|
3498
3824
|
);
|
|
3499
|
-
const answers =
|
|
3825
|
+
const answers = React16.useMemo(
|
|
3500
3826
|
() => questions.map((question) => getAnswerForQuestion(question, drafts[question.id])).filter((answer) => Boolean(answer)),
|
|
3501
3827
|
[drafts, questions]
|
|
3502
3828
|
);
|
|
@@ -3505,11 +3831,11 @@ function RequestUserInputPanel({
|
|
|
3505
3831
|
const currentDraft = currentQuestion ? drafts[currentQuestion.id] : void 0;
|
|
3506
3832
|
const currentAnswer = currentQuestion ? getAnswerForQuestion(currentQuestion, currentDraft) : null;
|
|
3507
3833
|
const isLastQuestion = currentQuestionIndex === questions.length - 1;
|
|
3508
|
-
const buildAnswersFromDrafts =
|
|
3834
|
+
const buildAnswersFromDrafts = React16.useCallback(
|
|
3509
3835
|
(nextDrafts) => questions.map((question) => getAnswerForQuestion(question, nextDrafts[question.id])).filter((answer) => Boolean(answer)),
|
|
3510
3836
|
[questions]
|
|
3511
3837
|
);
|
|
3512
|
-
const submitOrFocusFirstMissing =
|
|
3838
|
+
const submitOrFocusFirstMissing = React16.useCallback(
|
|
3513
3839
|
(nextDrafts) => {
|
|
3514
3840
|
const nextAnswers = buildAnswersFromDrafts(nextDrafts);
|
|
3515
3841
|
if (nextAnswers.length === questions.length) {
|
|
@@ -3525,7 +3851,7 @@ function RequestUserInputPanel({
|
|
|
3525
3851
|
},
|
|
3526
3852
|
[buildAnswersFromDrafts, goToQuestion, onSubmit, questions]
|
|
3527
3853
|
);
|
|
3528
|
-
const activateOption =
|
|
3854
|
+
const activateOption = React16.useCallback(
|
|
3529
3855
|
(question, optionIndex) => {
|
|
3530
3856
|
const previousDraft = drafts[question.id];
|
|
3531
3857
|
const nextDrafts = {
|
|
@@ -3551,7 +3877,7 @@ function RequestUserInputPanel({
|
|
|
3551
3877
|
submitOrFocusFirstMissing
|
|
3552
3878
|
]
|
|
3553
3879
|
);
|
|
3554
|
-
const chooseChoiceByIndex =
|
|
3880
|
+
const chooseChoiceByIndex = React16.useCallback(
|
|
3555
3881
|
(choiceIndex) => {
|
|
3556
3882
|
if (!currentQuestion) return;
|
|
3557
3883
|
if (choiceIndex < 0) return;
|
|
@@ -3565,7 +3891,7 @@ function RequestUserInputPanel({
|
|
|
3565
3891
|
},
|
|
3566
3892
|
[currentQuestion, selectOption, selectOther]
|
|
3567
3893
|
);
|
|
3568
|
-
const moveCurrentChoice =
|
|
3894
|
+
const moveCurrentChoice = React16.useCallback(
|
|
3569
3895
|
(direction) => {
|
|
3570
3896
|
if (!currentQuestion) return;
|
|
3571
3897
|
const choiceCount = currentQuestion.options.length + 1;
|
|
@@ -3575,7 +3901,7 @@ function RequestUserInputPanel({
|
|
|
3575
3901
|
},
|
|
3576
3902
|
[chooseChoiceByIndex, currentDraft, currentQuestion]
|
|
3577
3903
|
);
|
|
3578
|
-
const handleContinue =
|
|
3904
|
+
const handleContinue = React16.useCallback(() => {
|
|
3579
3905
|
if (!currentAnswer) return;
|
|
3580
3906
|
if (!isLastQuestion) {
|
|
3581
3907
|
goToQuestion(currentQuestionIndex + 1);
|
|
@@ -3602,7 +3928,7 @@ function RequestUserInputPanel({
|
|
|
3602
3928
|
onSubmit,
|
|
3603
3929
|
questions
|
|
3604
3930
|
]);
|
|
3605
|
-
|
|
3931
|
+
React16.useEffect(() => {
|
|
3606
3932
|
if (!request) return;
|
|
3607
3933
|
const handleKeyDown = (event) => {
|
|
3608
3934
|
if (event.isComposing) return;
|
|
@@ -3677,7 +4003,7 @@ function RequestUserInputPanel({
|
|
|
3677
4003
|
}));
|
|
3678
4004
|
};
|
|
3679
4005
|
const otherText = currentDraft?.otherText ?? "";
|
|
3680
|
-
return /* @__PURE__ */
|
|
4006
|
+
return /* @__PURE__ */ jsxs11(
|
|
3681
4007
|
"section",
|
|
3682
4008
|
{
|
|
3683
4009
|
"aria-label": t("composer.requestUserInput.title"),
|
|
@@ -3690,9 +4016,9 @@ function RequestUserInputPanel({
|
|
|
3690
4016
|
className
|
|
3691
4017
|
),
|
|
3692
4018
|
children: [
|
|
3693
|
-
/* @__PURE__ */
|
|
3694
|
-
/* @__PURE__ */
|
|
3695
|
-
/* @__PURE__ */
|
|
4019
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-start justify-between gap-3", children: [
|
|
4020
|
+
/* @__PURE__ */ jsxs11("div", { className: "min-w-0", children: [
|
|
4021
|
+
/* @__PURE__ */ jsx18(
|
|
3696
4022
|
"div",
|
|
3697
4023
|
{
|
|
3698
4024
|
className: cn(
|
|
@@ -3702,7 +4028,7 @@ function RequestUserInputPanel({
|
|
|
3702
4028
|
children: currentQuestion.header
|
|
3703
4029
|
}
|
|
3704
4030
|
),
|
|
3705
|
-
/* @__PURE__ */
|
|
4031
|
+
/* @__PURE__ */ jsx18(
|
|
3706
4032
|
"h3",
|
|
3707
4033
|
{
|
|
3708
4034
|
className: cn(
|
|
@@ -3713,7 +4039,7 @@ function RequestUserInputPanel({
|
|
|
3713
4039
|
}
|
|
3714
4040
|
)
|
|
3715
4041
|
] }),
|
|
3716
|
-
questions.length > 1 ? /* @__PURE__ */
|
|
4042
|
+
questions.length > 1 ? /* @__PURE__ */ jsxs11(
|
|
3717
4043
|
"div",
|
|
3718
4044
|
{
|
|
3719
4045
|
className: cn(
|
|
@@ -3721,7 +4047,7 @@ function RequestUserInputPanel({
|
|
|
3721
4047
|
rounded.density.pager
|
|
3722
4048
|
),
|
|
3723
4049
|
children: [
|
|
3724
|
-
/* @__PURE__ */
|
|
4050
|
+
/* @__PURE__ */ jsx18(
|
|
3725
4051
|
"button",
|
|
3726
4052
|
{
|
|
3727
4053
|
type: "button",
|
|
@@ -3732,14 +4058,14 @@ function RequestUserInputPanel({
|
|
|
3732
4058
|
rounded.density.pagerButton
|
|
3733
4059
|
),
|
|
3734
4060
|
"aria-label": t("composer.requestUserInput.previousQuestion"),
|
|
3735
|
-
children: /* @__PURE__ */
|
|
4061
|
+
children: /* @__PURE__ */ jsx18(ChevronLeft, { className: rounded.density.pagerIcon })
|
|
3736
4062
|
}
|
|
3737
4063
|
),
|
|
3738
|
-
/* @__PURE__ */
|
|
4064
|
+
/* @__PURE__ */ jsx18("span", { className: "min-w-12 text-center", children: t("composer.requestUserInput.questionProgress", {
|
|
3739
4065
|
current: currentQuestionIndex + 1,
|
|
3740
4066
|
total: questions.length
|
|
3741
4067
|
}) }),
|
|
3742
|
-
/* @__PURE__ */
|
|
4068
|
+
/* @__PURE__ */ jsx18(
|
|
3743
4069
|
"button",
|
|
3744
4070
|
{
|
|
3745
4071
|
type: "button",
|
|
@@ -3750,18 +4076,18 @@ function RequestUserInputPanel({
|
|
|
3750
4076
|
rounded.density.pagerButton
|
|
3751
4077
|
),
|
|
3752
4078
|
"aria-label": t("composer.requestUserInput.nextQuestion"),
|
|
3753
|
-
children: /* @__PURE__ */
|
|
4079
|
+
children: /* @__PURE__ */ jsx18(ChevronRight2, { className: rounded.density.pagerIcon })
|
|
3754
4080
|
}
|
|
3755
4081
|
)
|
|
3756
4082
|
]
|
|
3757
4083
|
}
|
|
3758
4084
|
) : null
|
|
3759
4085
|
] }),
|
|
3760
|
-
/* @__PURE__ */
|
|
4086
|
+
/* @__PURE__ */ jsxs11("div", { className: rounded.density.choices, children: [
|
|
3761
4087
|
currentQuestion.options.map((option, optionIndex) => {
|
|
3762
4088
|
const selected = currentDraft?.type === "option" && currentDraft.optionIndex === optionIndex;
|
|
3763
4089
|
const parsedLabel = parseRecommendedLabel(option.label);
|
|
3764
|
-
return /* @__PURE__ */
|
|
4090
|
+
return /* @__PURE__ */ jsxs11(
|
|
3765
4091
|
"div",
|
|
3766
4092
|
{
|
|
3767
4093
|
role: "button",
|
|
@@ -3783,20 +4109,20 @@ function RequestUserInputPanel({
|
|
|
3783
4109
|
selected ? "bg-muted text-foreground" : "text-foreground/90 hover:bg-muted/55"
|
|
3784
4110
|
),
|
|
3785
4111
|
children: [
|
|
3786
|
-
/* @__PURE__ */
|
|
4112
|
+
/* @__PURE__ */ jsxs11("span", { className: "text-sm font-semibold text-muted-foreground", children: [
|
|
3787
4113
|
optionIndex + 1,
|
|
3788
4114
|
"."
|
|
3789
4115
|
] }),
|
|
3790
|
-
/* @__PURE__ */
|
|
3791
|
-
/* @__PURE__ */
|
|
3792
|
-
parsedLabel.recommended ? /* @__PURE__ */
|
|
3793
|
-
/* @__PURE__ */
|
|
4116
|
+
/* @__PURE__ */ jsxs11("span", { className: "min-w-0", children: [
|
|
4117
|
+
/* @__PURE__ */ jsx18("span", { className: "inline min-w-0 text-sm font-semibold leading-5", children: parsedLabel.label }),
|
|
4118
|
+
parsedLabel.recommended ? /* @__PURE__ */ jsxs11("span", { className: "ml-1.5 inline-flex items-center gap-1 text-sm font-semibold text-primary", children: [
|
|
4119
|
+
/* @__PURE__ */ jsx18(Check, { className: "h-3.5 w-3.5" }),
|
|
3794
4120
|
"(",
|
|
3795
4121
|
t("composer.requestUserInput.recommended"),
|
|
3796
4122
|
")"
|
|
3797
4123
|
] }) : null,
|
|
3798
|
-
option.description ? /* @__PURE__ */
|
|
3799
|
-
/* @__PURE__ */
|
|
4124
|
+
option.description ? /* @__PURE__ */ jsxs11(Tooltip, { children: [
|
|
4125
|
+
/* @__PURE__ */ jsx18(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx18(
|
|
3800
4126
|
"button",
|
|
3801
4127
|
{
|
|
3802
4128
|
type: "button",
|
|
@@ -3808,10 +4134,10 @@ function RequestUserInputPanel({
|
|
|
3808
4134
|
"aria-label": t("composer.requestUserInput.optionInfo", {
|
|
3809
4135
|
label: parsedLabel.label
|
|
3810
4136
|
}),
|
|
3811
|
-
children: /* @__PURE__ */
|
|
4137
|
+
children: /* @__PURE__ */ jsx18(Info3, { className: "h-3.5 w-3.5" })
|
|
3812
4138
|
}
|
|
3813
4139
|
) }),
|
|
3814
|
-
/* @__PURE__ */
|
|
4140
|
+
/* @__PURE__ */ jsx18(
|
|
3815
4141
|
TooltipContent,
|
|
3816
4142
|
{
|
|
3817
4143
|
side: "top",
|
|
@@ -3822,15 +4148,15 @@ function RequestUserInputPanel({
|
|
|
3822
4148
|
)
|
|
3823
4149
|
] }) : null
|
|
3824
4150
|
] }),
|
|
3825
|
-
/* @__PURE__ */
|
|
4151
|
+
/* @__PURE__ */ jsx18("span", { className: "flex items-center justify-end text-muted-foreground", children: selected ? /* @__PURE__ */ jsxs11(
|
|
3826
4152
|
"span",
|
|
3827
4153
|
{
|
|
3828
4154
|
"data-slot": "request-user-input-option-keyboard-hint",
|
|
3829
4155
|
"aria-hidden": "true",
|
|
3830
4156
|
className: "flex items-center gap-0.5",
|
|
3831
4157
|
children: [
|
|
3832
|
-
/* @__PURE__ */
|
|
3833
|
-
/* @__PURE__ */
|
|
4158
|
+
/* @__PURE__ */ jsx18(ArrowUp2, { className: "h-4 w-4 opacity-45" }),
|
|
4159
|
+
/* @__PURE__ */ jsx18(ArrowDown, { className: "h-4 w-4 opacity-45" })
|
|
3834
4160
|
]
|
|
3835
4161
|
}
|
|
3836
4162
|
) : null })
|
|
@@ -3839,7 +4165,7 @@ function RequestUserInputPanel({
|
|
|
3839
4165
|
`${currentQuestion.id}-${optionIndex}`
|
|
3840
4166
|
);
|
|
3841
4167
|
}),
|
|
3842
|
-
/* @__PURE__ */
|
|
4168
|
+
/* @__PURE__ */ jsxs11(
|
|
3843
4169
|
"label",
|
|
3844
4170
|
{
|
|
3845
4171
|
className: cn(
|
|
@@ -3849,11 +4175,11 @@ function RequestUserInputPanel({
|
|
|
3849
4175
|
currentDraft?.type === "other" ? "bg-muted text-foreground" : "hover:bg-muted/55"
|
|
3850
4176
|
),
|
|
3851
4177
|
children: [
|
|
3852
|
-
/* @__PURE__ */
|
|
4178
|
+
/* @__PURE__ */ jsxs11("span", { className: "text-sm font-semibold text-muted-foreground", children: [
|
|
3853
4179
|
currentQuestion.options.length + 1,
|
|
3854
4180
|
"."
|
|
3855
4181
|
] }),
|
|
3856
|
-
/* @__PURE__ */
|
|
4182
|
+
/* @__PURE__ */ jsx18("span", { className: "grid min-w-0 grid-cols-[auto_minmax(0,1fr)] items-center gap-3", children: /* @__PURE__ */ jsx18(
|
|
3857
4183
|
"input",
|
|
3858
4184
|
{
|
|
3859
4185
|
ref: otherInputRef,
|
|
@@ -3871,7 +4197,7 @@ function RequestUserInputPanel({
|
|
|
3871
4197
|
}
|
|
3872
4198
|
)
|
|
3873
4199
|
] }),
|
|
3874
|
-
/* @__PURE__ */
|
|
4200
|
+
/* @__PURE__ */ jsxs11(
|
|
3875
4201
|
"div",
|
|
3876
4202
|
{
|
|
3877
4203
|
className: cn(
|
|
@@ -3879,7 +4205,7 @@ function RequestUserInputPanel({
|
|
|
3879
4205
|
rounded.density.footer
|
|
3880
4206
|
),
|
|
3881
4207
|
children: [
|
|
3882
|
-
onDismiss ? /* @__PURE__ */
|
|
4208
|
+
onDismiss ? /* @__PURE__ */ jsxs11(
|
|
3883
4209
|
"button",
|
|
3884
4210
|
{
|
|
3885
4211
|
type: "button",
|
|
@@ -3890,11 +4216,11 @@ function RequestUserInputPanel({
|
|
|
3890
4216
|
),
|
|
3891
4217
|
children: [
|
|
3892
4218
|
t("composer.requestUserInput.dismiss"),
|
|
3893
|
-
/* @__PURE__ */
|
|
4219
|
+
/* @__PURE__ */ jsx18("kbd", { className: "rounded-full bg-muted px-2 py-1 text-xs font-semibold text-muted-foreground", children: "ESC" })
|
|
3894
4220
|
]
|
|
3895
4221
|
}
|
|
3896
4222
|
) : null,
|
|
3897
|
-
/* @__PURE__ */
|
|
4223
|
+
/* @__PURE__ */ jsxs11(
|
|
3898
4224
|
"button",
|
|
3899
4225
|
{
|
|
3900
4226
|
type: "button",
|
|
@@ -3908,14 +4234,14 @@ function RequestUserInputPanel({
|
|
|
3908
4234
|
),
|
|
3909
4235
|
children: [
|
|
3910
4236
|
t("composer.requestUserInput.continue"),
|
|
3911
|
-
/* @__PURE__ */
|
|
4237
|
+
/* @__PURE__ */ jsx18(
|
|
3912
4238
|
"span",
|
|
3913
4239
|
{
|
|
3914
4240
|
className: cn(
|
|
3915
4241
|
"inline-flex items-center justify-center rounded-full bg-background/20",
|
|
3916
4242
|
rounded.density.continueIcon
|
|
3917
4243
|
),
|
|
3918
|
-
children: /* @__PURE__ */
|
|
4244
|
+
children: /* @__PURE__ */ jsx18(CornerDownLeft2, { className: "h-3.5 w-3.5" })
|
|
3919
4245
|
}
|
|
3920
4246
|
)
|
|
3921
4247
|
]
|
|
@@ -3930,7 +4256,7 @@ function RequestUserInputPanel({
|
|
|
3930
4256
|
}
|
|
3931
4257
|
|
|
3932
4258
|
// src/components/thread/messages/ai.tsx
|
|
3933
|
-
import * as
|
|
4259
|
+
import * as React23 from "react";
|
|
3934
4260
|
import {
|
|
3935
4261
|
ChevronDown as ChevronDown2,
|
|
3936
4262
|
Clock3,
|
|
@@ -3938,26 +4264,26 @@ import {
|
|
|
3938
4264
|
} from "lucide-react";
|
|
3939
4265
|
|
|
3940
4266
|
// src/components/ui/badge.tsx
|
|
3941
|
-
import * as
|
|
3942
|
-
import { jsx as
|
|
4267
|
+
import * as React17 from "react";
|
|
4268
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
3943
4269
|
var base = "inline-flex items-center rounded-full border border-transparent px-2.5 py-0.5 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background";
|
|
3944
4270
|
var variants = {
|
|
3945
4271
|
default: "bg-primary text-primary-foreground",
|
|
3946
4272
|
secondary: "bg-secondary text-secondary-foreground",
|
|
3947
4273
|
outline: "border-input text-foreground"
|
|
3948
4274
|
};
|
|
3949
|
-
var Badge =
|
|
4275
|
+
var Badge = React17.forwardRef(
|
|
3950
4276
|
({ className, variant = "default", ...props }, ref) => {
|
|
3951
|
-
return /* @__PURE__ */
|
|
4277
|
+
return /* @__PURE__ */ jsx19("span", { ref, className: cn(base, variants[variant], className), ...props });
|
|
3952
4278
|
}
|
|
3953
4279
|
);
|
|
3954
4280
|
Badge.displayName = "Badge";
|
|
3955
4281
|
|
|
3956
4282
|
// src/components/ui/card.tsx
|
|
3957
|
-
import * as
|
|
3958
|
-
import { jsx as
|
|
3959
|
-
var Card =
|
|
3960
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
4283
|
+
import * as React18 from "react";
|
|
4284
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
4285
|
+
var Card = React18.forwardRef(
|
|
4286
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
|
|
3961
4287
|
"div",
|
|
3962
4288
|
{
|
|
3963
4289
|
ref,
|
|
@@ -3970,45 +4296,45 @@ var Card = React16.forwardRef(
|
|
|
3970
4296
|
)
|
|
3971
4297
|
);
|
|
3972
4298
|
Card.displayName = "Card";
|
|
3973
|
-
var CardHeader =
|
|
3974
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
4299
|
+
var CardHeader = React18.forwardRef(
|
|
4300
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx20("div", { ref, className: cn("flex flex-col gap-1.5 px-6 pt-6", className), ...props })
|
|
3975
4301
|
);
|
|
3976
4302
|
CardHeader.displayName = "CardHeader";
|
|
3977
|
-
var CardTitle =
|
|
4303
|
+
var CardTitle = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20("h3", { ref, className: cn("text-lg font-semibold leading-tight", className), ...props }));
|
|
3978
4304
|
CardTitle.displayName = "CardTitle";
|
|
3979
|
-
var CardDescription =
|
|
4305
|
+
var CardDescription = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20("p", { ref, className: cn("text-sm text-muted-foreground", className), ...props }));
|
|
3980
4306
|
CardDescription.displayName = "CardDescription";
|
|
3981
|
-
var CardContent =
|
|
3982
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
4307
|
+
var CardContent = React18.forwardRef(
|
|
4308
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx20("div", { ref, className: cn("px-6 pb-6", className), ...props })
|
|
3983
4309
|
);
|
|
3984
4310
|
CardContent.displayName = "CardContent";
|
|
3985
|
-
var CardFooter =
|
|
3986
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
4311
|
+
var CardFooter = React18.forwardRef(
|
|
4312
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx20("div", { ref, className: cn("flex items-center px-6 pb-6", className), ...props })
|
|
3987
4313
|
);
|
|
3988
4314
|
CardFooter.displayName = "CardFooter";
|
|
3989
|
-
var CardAction =
|
|
3990
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
4315
|
+
var CardAction = React18.forwardRef(
|
|
4316
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx20("div", { ref, className: cn("ml-auto flex items-center", className), ...props })
|
|
3991
4317
|
);
|
|
3992
4318
|
CardAction.displayName = "CardAction";
|
|
3993
4319
|
|
|
3994
4320
|
// src/components/ui/tabs.tsx
|
|
3995
|
-
import * as
|
|
3996
|
-
import { jsx as
|
|
3997
|
-
var TabsContext =
|
|
4321
|
+
import * as React19 from "react";
|
|
4322
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
4323
|
+
var TabsContext = React19.createContext(null);
|
|
3998
4324
|
function Tabs({ className, defaultValue, value, onValueChange, ...props }) {
|
|
3999
|
-
const [internalValue, setInternalValue] =
|
|
4325
|
+
const [internalValue, setInternalValue] = React19.useState(defaultValue ?? "");
|
|
4000
4326
|
const activeValue = value ?? internalValue;
|
|
4001
|
-
const setValue =
|
|
4327
|
+
const setValue = React19.useCallback(
|
|
4002
4328
|
(nextValue) => {
|
|
4003
4329
|
if (value === void 0) setInternalValue(nextValue);
|
|
4004
4330
|
onValueChange?.(nextValue);
|
|
4005
4331
|
},
|
|
4006
4332
|
[onValueChange, value]
|
|
4007
4333
|
);
|
|
4008
|
-
return /* @__PURE__ */
|
|
4334
|
+
return /* @__PURE__ */ jsx21(TabsContext.Provider, { value: { value: activeValue, setValue }, children: /* @__PURE__ */ jsx21("div", { className: cn("w-full", className), ...props }) });
|
|
4009
4335
|
}
|
|
4010
|
-
var TabsList =
|
|
4011
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
4336
|
+
var TabsList = React19.forwardRef(
|
|
4337
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx21(
|
|
4012
4338
|
"div",
|
|
4013
4339
|
{
|
|
4014
4340
|
ref,
|
|
@@ -4022,14 +4348,14 @@ var TabsList = React17.forwardRef(
|
|
|
4022
4348
|
)
|
|
4023
4349
|
);
|
|
4024
4350
|
TabsList.displayName = "TabsList";
|
|
4025
|
-
var TabsTrigger =
|
|
4351
|
+
var TabsTrigger = React19.forwardRef(
|
|
4026
4352
|
({ className, value, onClick, ...props }, ref) => {
|
|
4027
|
-
const context =
|
|
4353
|
+
const context = React19.useContext(TabsContext);
|
|
4028
4354
|
if (!context) {
|
|
4029
4355
|
throw new Error("TabsTrigger must be used within Tabs");
|
|
4030
4356
|
}
|
|
4031
4357
|
const isActive = context.value === value;
|
|
4032
|
-
return /* @__PURE__ */
|
|
4358
|
+
return /* @__PURE__ */ jsx21(
|
|
4033
4359
|
"button",
|
|
4034
4360
|
{
|
|
4035
4361
|
ref,
|
|
@@ -4051,14 +4377,14 @@ var TabsTrigger = React17.forwardRef(
|
|
|
4051
4377
|
}
|
|
4052
4378
|
);
|
|
4053
4379
|
TabsTrigger.displayName = "TabsTrigger";
|
|
4054
|
-
var TabsContent =
|
|
4380
|
+
var TabsContent = React19.forwardRef(
|
|
4055
4381
|
({ className, value, ...props }, ref) => {
|
|
4056
|
-
const context =
|
|
4382
|
+
const context = React19.useContext(TabsContext);
|
|
4057
4383
|
if (!context) {
|
|
4058
4384
|
throw new Error("TabsContent must be used within Tabs");
|
|
4059
4385
|
}
|
|
4060
4386
|
if (context.value !== value) return null;
|
|
4061
|
-
return /* @__PURE__ */
|
|
4387
|
+
return /* @__PURE__ */ jsx21(
|
|
4062
4388
|
"div",
|
|
4063
4389
|
{
|
|
4064
4390
|
ref,
|
|
@@ -4094,7 +4420,7 @@ import tsx from "react-syntax-highlighter/dist/esm/languages/prism/tsx";
|
|
|
4094
4420
|
import python from "react-syntax-highlighter/dist/esm/languages/prism/python";
|
|
4095
4421
|
import { coldarkDark } from "react-syntax-highlighter/dist/cjs/styles/prism";
|
|
4096
4422
|
import "react";
|
|
4097
|
-
import { jsx as
|
|
4423
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
4098
4424
|
SyntaxHighlighterPrism.registerLanguage("js", tsx);
|
|
4099
4425
|
SyntaxHighlighterPrism.registerLanguage("jsx", tsx);
|
|
4100
4426
|
SyntaxHighlighterPrism.registerLanguage("ts", tsx);
|
|
@@ -4105,7 +4431,7 @@ var SyntaxHighlighter = ({
|
|
|
4105
4431
|
language,
|
|
4106
4432
|
className
|
|
4107
4433
|
}) => {
|
|
4108
|
-
return /* @__PURE__ */
|
|
4434
|
+
return /* @__PURE__ */ jsx22(
|
|
4109
4435
|
SyntaxHighlighterPrism,
|
|
4110
4436
|
{
|
|
4111
4437
|
language,
|
|
@@ -4135,14 +4461,14 @@ import {
|
|
|
4135
4461
|
TriangleAlert,
|
|
4136
4462
|
X as X3
|
|
4137
4463
|
} from "lucide-react";
|
|
4138
|
-
import * as
|
|
4464
|
+
import * as React20 from "react";
|
|
4139
4465
|
|
|
4140
4466
|
// src/components/thread/tooltip-icon-button.tsx
|
|
4141
|
-
import { forwardRef as
|
|
4142
|
-
import { jsx as
|
|
4143
|
-
var TooltipIconButton =
|
|
4144
|
-
return /* @__PURE__ */
|
|
4145
|
-
/* @__PURE__ */
|
|
4467
|
+
import { forwardRef as forwardRef6 } from "react";
|
|
4468
|
+
import { jsx as jsx23, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
4469
|
+
var TooltipIconButton = forwardRef6(({ children, tooltip, side = "bottom", className, ...rest }, ref) => {
|
|
4470
|
+
return /* @__PURE__ */ jsx23(TooltipProvider, { children: /* @__PURE__ */ jsxs12(Tooltip, { children: [
|
|
4471
|
+
/* @__PURE__ */ jsx23(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs12(
|
|
4146
4472
|
Button,
|
|
4147
4473
|
{
|
|
4148
4474
|
variant: "ghost",
|
|
@@ -4152,17 +4478,17 @@ var TooltipIconButton = forwardRef5(({ children, tooltip, side = "bottom", class
|
|
|
4152
4478
|
ref,
|
|
4153
4479
|
children: [
|
|
4154
4480
|
children,
|
|
4155
|
-
/* @__PURE__ */
|
|
4481
|
+
/* @__PURE__ */ jsx23("span", { className: "sr-only", children: tooltip })
|
|
4156
4482
|
]
|
|
4157
4483
|
}
|
|
4158
4484
|
) }),
|
|
4159
|
-
/* @__PURE__ */
|
|
4485
|
+
/* @__PURE__ */ jsx23(TooltipContent, { side, children: tooltip })
|
|
4160
4486
|
] }) });
|
|
4161
4487
|
});
|
|
4162
4488
|
TooltipIconButton.displayName = "TooltipIconButton";
|
|
4163
4489
|
|
|
4164
4490
|
// src/components/thread/mermaid-block.tsx
|
|
4165
|
-
import { Fragment as Fragment2, jsx as
|
|
4491
|
+
import { Fragment as Fragment2, jsx as jsx24, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
4166
4492
|
var HEX_COLOR_PATTERN = /^#([\da-f]{3,8})$/i;
|
|
4167
4493
|
var MERMAID_DIRECTIVE_PATTERN = /%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi;
|
|
4168
4494
|
var MERMAID_FRONTMATTER_PATTERN = /^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s;
|
|
@@ -4410,24 +4736,24 @@ function MermaidPreviewDialog({
|
|
|
4410
4736
|
svgMarkup,
|
|
4411
4737
|
title
|
|
4412
4738
|
}) {
|
|
4413
|
-
return /* @__PURE__ */
|
|
4414
|
-
/* @__PURE__ */
|
|
4415
|
-
/* @__PURE__ */
|
|
4416
|
-
/* @__PURE__ */
|
|
4417
|
-
/* @__PURE__ */
|
|
4418
|
-
/* @__PURE__ */
|
|
4739
|
+
return /* @__PURE__ */ jsx24(Dialog.Root, { open, onOpenChange, children: /* @__PURE__ */ jsxs13(Dialog.Portal, { children: [
|
|
4740
|
+
/* @__PURE__ */ jsx24(Dialog.Overlay, { className: "fixed inset-0 z-50 bg-black/60 backdrop-blur-sm data-[state=closed]:animate-out data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0" }),
|
|
4741
|
+
/* @__PURE__ */ jsxs13(Dialog.Content, { className: "fixed inset-[5vh] z-50 flex flex-col overflow-hidden rounded-3xl border border-border bg-background shadow-2xl outline-none data-[state=closed]:animate-out data-[state=open]:animate-in data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95", children: [
|
|
4742
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-between gap-4 border-b border-border px-5 py-4", children: [
|
|
4743
|
+
/* @__PURE__ */ jsx24(Dialog.Title, { className: "text-base font-semibold text-foreground", children: title }),
|
|
4744
|
+
/* @__PURE__ */ jsx24(Dialog.Close, { asChild: true, children: /* @__PURE__ */ jsxs13(
|
|
4419
4745
|
"button",
|
|
4420
4746
|
{
|
|
4421
4747
|
type: "button",
|
|
4422
4748
|
className: "inline-flex size-10 items-center justify-center rounded-full border border-border bg-card text-muted-foreground transition-colors hover:text-foreground",
|
|
4423
4749
|
children: [
|
|
4424
|
-
/* @__PURE__ */
|
|
4425
|
-
/* @__PURE__ */
|
|
4750
|
+
/* @__PURE__ */ jsx24(X3, { className: "size-4" }),
|
|
4751
|
+
/* @__PURE__ */ jsx24("span", { className: "sr-only", children: closeLabel })
|
|
4426
4752
|
]
|
|
4427
4753
|
}
|
|
4428
4754
|
) })
|
|
4429
4755
|
] }),
|
|
4430
|
-
/* @__PURE__ */
|
|
4756
|
+
/* @__PURE__ */ jsx24("div", { className: "flex-1 overflow-auto bg-card p-6", children: /* @__PURE__ */ jsx24(
|
|
4431
4757
|
"div",
|
|
4432
4758
|
{
|
|
4433
4759
|
"data-slot": "mermaid-preview",
|
|
@@ -4441,24 +4767,24 @@ function MermaidPreviewDialog({
|
|
|
4441
4767
|
function MermaidBlock({ code }) {
|
|
4442
4768
|
const { t } = useChatkitTranslation();
|
|
4443
4769
|
const { theme, isDarkMode } = useTheme();
|
|
4444
|
-
const containerRef =
|
|
4445
|
-
const renderHostRef =
|
|
4446
|
-
const renderSequenceRef =
|
|
4447
|
-
const copyResetTimeoutRef =
|
|
4448
|
-
const diagramId =
|
|
4449
|
-
const [activeTab, setActiveTab] =
|
|
4450
|
-
const [isCopied, setIsCopied] =
|
|
4451
|
-
const [isPreviewOpen, setIsPreviewOpen] =
|
|
4452
|
-
const [isRendering, setIsRendering] =
|
|
4453
|
-
const [renderError, setRenderError] =
|
|
4454
|
-
const [svgMarkup, setSvgMarkup] =
|
|
4455
|
-
const normalizedCode =
|
|
4456
|
-
const clearCopyResetTimeout =
|
|
4770
|
+
const containerRef = React20.useRef(null);
|
|
4771
|
+
const renderHostRef = React20.useRef(null);
|
|
4772
|
+
const renderSequenceRef = React20.useRef(0);
|
|
4773
|
+
const copyResetTimeoutRef = React20.useRef(null);
|
|
4774
|
+
const diagramId = React20.useId().replace(/:/g, "");
|
|
4775
|
+
const [activeTab, setActiveTab] = React20.useState("diagram");
|
|
4776
|
+
const [isCopied, setIsCopied] = React20.useState(false);
|
|
4777
|
+
const [isPreviewOpen, setIsPreviewOpen] = React20.useState(false);
|
|
4778
|
+
const [isRendering, setIsRendering] = React20.useState(true);
|
|
4779
|
+
const [renderError, setRenderError] = React20.useState(null);
|
|
4780
|
+
const [svgMarkup, setSvgMarkup] = React20.useState(null);
|
|
4781
|
+
const normalizedCode = React20.useMemo(() => normalizeMermaidCode(code), [code]);
|
|
4782
|
+
const clearCopyResetTimeout = React20.useCallback(() => {
|
|
4457
4783
|
if (copyResetTimeoutRef.current === null) return;
|
|
4458
4784
|
window.clearTimeout(copyResetTimeoutRef.current);
|
|
4459
4785
|
copyResetTimeoutRef.current = null;
|
|
4460
4786
|
}, []);
|
|
4461
|
-
|
|
4787
|
+
React20.useEffect(() => {
|
|
4462
4788
|
let isActive = true;
|
|
4463
4789
|
async function runRender() {
|
|
4464
4790
|
const container = containerRef.current;
|
|
@@ -4496,17 +4822,17 @@ function MermaidBlock({ code }) {
|
|
|
4496
4822
|
}
|
|
4497
4823
|
};
|
|
4498
4824
|
}, [diagramId, isDarkMode, normalizedCode, theme]);
|
|
4499
|
-
|
|
4825
|
+
React20.useEffect(() => {
|
|
4500
4826
|
clearCopyResetTimeout();
|
|
4501
4827
|
setIsCopied(false);
|
|
4502
4828
|
}, [activeTab, clearCopyResetTimeout, code]);
|
|
4503
|
-
|
|
4829
|
+
React20.useEffect(
|
|
4504
4830
|
() => () => {
|
|
4505
4831
|
clearCopyResetTimeout();
|
|
4506
4832
|
},
|
|
4507
4833
|
[clearCopyResetTimeout]
|
|
4508
4834
|
);
|
|
4509
|
-
const handleDownload =
|
|
4835
|
+
const handleDownload = React20.useCallback(() => {
|
|
4510
4836
|
if (!svgMarkup) return;
|
|
4511
4837
|
const blob = new Blob([svgMarkup], {
|
|
4512
4838
|
type: "image/svg+xml;charset=utf-8"
|
|
@@ -4520,7 +4846,7 @@ function MermaidBlock({ code }) {
|
|
|
4520
4846
|
anchor.remove();
|
|
4521
4847
|
window.URL.revokeObjectURL(url);
|
|
4522
4848
|
}, [diagramId, svgMarkup]);
|
|
4523
|
-
const handleCopyCode =
|
|
4849
|
+
const handleCopyCode = React20.useCallback(() => {
|
|
4524
4850
|
if (!code || isCopied) return;
|
|
4525
4851
|
navigator.clipboard.writeText(code).then(() => {
|
|
4526
4852
|
setIsCopied(true);
|
|
@@ -4534,21 +4860,21 @@ function MermaidBlock({ code }) {
|
|
|
4534
4860
|
}, [clearCopyResetTimeout, code, isCopied]);
|
|
4535
4861
|
const hasRenderedDiagram = svgMarkup !== null && !renderError;
|
|
4536
4862
|
const statusMessage = isRendering ? t("markdown.mermaid.rendering") : t("markdown.mermaid.failed");
|
|
4537
|
-
return /* @__PURE__ */
|
|
4538
|
-
/* @__PURE__ */
|
|
4863
|
+
return /* @__PURE__ */ jsxs13(Fragment2, { children: [
|
|
4864
|
+
/* @__PURE__ */ jsx24(
|
|
4539
4865
|
Tabs,
|
|
4540
4866
|
{
|
|
4541
4867
|
className: "w-full",
|
|
4542
4868
|
onValueChange: (value) => setActiveTab(value),
|
|
4543
4869
|
value: activeTab,
|
|
4544
|
-
children: /* @__PURE__ */
|
|
4870
|
+
children: /* @__PURE__ */ jsxs13(
|
|
4545
4871
|
"div",
|
|
4546
4872
|
{
|
|
4547
4873
|
ref: containerRef,
|
|
4548
4874
|
"data-slot": "mermaid-block",
|
|
4549
4875
|
className: "relative overflow-hidden text-card-foreground",
|
|
4550
4876
|
children: [
|
|
4551
|
-
/* @__PURE__ */
|
|
4877
|
+
/* @__PURE__ */ jsx24(
|
|
4552
4878
|
"div",
|
|
4553
4879
|
{
|
|
4554
4880
|
ref: renderHostRef,
|
|
@@ -4557,62 +4883,62 @@ function MermaidBlock({ code }) {
|
|
|
4557
4883
|
"data-slot": "mermaid-render-host"
|
|
4558
4884
|
}
|
|
4559
4885
|
),
|
|
4560
|
-
/* @__PURE__ */
|
|
4561
|
-
/* @__PURE__ */
|
|
4562
|
-
/* @__PURE__ */
|
|
4563
|
-
/* @__PURE__ */
|
|
4886
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex flex-wrap items-center justify-between gap-3 px-4 py-3", children: [
|
|
4887
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex min-w-0 items-center gap-3", children: [
|
|
4888
|
+
/* @__PURE__ */ jsx24("span", { className: "inline-flex size-9 shrink-0 items-center justify-center rounded-full bg-muted text-foreground", children: /* @__PURE__ */ jsx24(Code2Icon, { className: "size-4" }) }),
|
|
4889
|
+
/* @__PURE__ */ jsx24("span", { className: "truncate text-base font-semibold text-foreground", children: t("markdown.mermaid.title") })
|
|
4564
4890
|
] }),
|
|
4565
|
-
/* @__PURE__ */
|
|
4566
|
-
/* @__PURE__ */
|
|
4567
|
-
activeTab === "diagram" && hasRenderedDiagram ? /* @__PURE__ */
|
|
4891
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
4892
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-1", children: [
|
|
4893
|
+
activeTab === "diagram" && hasRenderedDiagram ? /* @__PURE__ */ jsx24(
|
|
4568
4894
|
TooltipIconButton,
|
|
4569
4895
|
{
|
|
4570
4896
|
onClick: handleDownload,
|
|
4571
4897
|
tooltip: t("markdown.mermaid.download"),
|
|
4572
|
-
children: /* @__PURE__ */
|
|
4898
|
+
children: /* @__PURE__ */ jsx24(DownloadIcon, { className: "size-4" })
|
|
4573
4899
|
}
|
|
4574
4900
|
) : null,
|
|
4575
|
-
activeTab === "diagram" && hasRenderedDiagram ? /* @__PURE__ */
|
|
4901
|
+
activeTab === "diagram" && hasRenderedDiagram ? /* @__PURE__ */ jsx24(
|
|
4576
4902
|
TooltipIconButton,
|
|
4577
4903
|
{
|
|
4578
4904
|
onClick: () => setIsPreviewOpen(true),
|
|
4579
4905
|
tooltip: t("markdown.mermaid.fullScreen"),
|
|
4580
|
-
children: /* @__PURE__ */
|
|
4906
|
+
children: /* @__PURE__ */ jsx24(ExpandIcon, { className: "size-4" })
|
|
4581
4907
|
}
|
|
4582
4908
|
) : null,
|
|
4583
|
-
activeTab === "code" ? /* @__PURE__ */
|
|
4909
|
+
activeTab === "code" ? /* @__PURE__ */ jsx24(
|
|
4584
4910
|
TooltipIconButton,
|
|
4585
4911
|
{
|
|
4586
4912
|
onClick: handleCopyCode,
|
|
4587
4913
|
tooltip: t("markdown.copy"),
|
|
4588
|
-
children: isCopied ? /* @__PURE__ */
|
|
4914
|
+
children: isCopied ? /* @__PURE__ */ jsx24(CheckIcon2, { className: "size-4" }) : /* @__PURE__ */ jsx24(CopyIcon, { className: "size-4" })
|
|
4589
4915
|
}
|
|
4590
4916
|
) : null
|
|
4591
4917
|
] }),
|
|
4592
|
-
/* @__PURE__ */
|
|
4593
|
-
/* @__PURE__ */
|
|
4594
|
-
/* @__PURE__ */
|
|
4918
|
+
/* @__PURE__ */ jsxs13(TabsList, { children: [
|
|
4919
|
+
/* @__PURE__ */ jsx24(TabsTrigger, { value: "diagram", children: t("markdown.mermaid.diagram") }),
|
|
4920
|
+
/* @__PURE__ */ jsx24(TabsTrigger, { value: "code", children: t("markdown.mermaid.code") })
|
|
4595
4921
|
] })
|
|
4596
4922
|
] })
|
|
4597
4923
|
] }),
|
|
4598
|
-
/* @__PURE__ */
|
|
4599
|
-
renderError ? /* @__PURE__ */
|
|
4600
|
-
/* @__PURE__ */
|
|
4924
|
+
/* @__PURE__ */ jsxs13("div", { className: "border-t border-border pt-4", children: [
|
|
4925
|
+
renderError ? /* @__PURE__ */ jsx24("p", { role: "alert", className: "mb-4 text-sm font-medium text-destructive", children: t("markdown.mermaid.failed") }) : null,
|
|
4926
|
+
/* @__PURE__ */ jsx24(TabsContent, { value: "diagram", className: "mt-0 space-y-4", children: /* @__PURE__ */ jsx24(
|
|
4601
4927
|
"div",
|
|
4602
4928
|
{
|
|
4603
4929
|
className: cn(
|
|
4604
4930
|
"relative overflow-auto rounded-[calc(var(--radius)+0.5rem)] border border-border bg-background p-4",
|
|
4605
4931
|
hasRenderedDiagram ? "[&_svg]:mx-auto [&_svg]:h-auto [&_svg]:w-full [&_svg]:max-w-none" : "min-h-[14rem]"
|
|
4606
4932
|
),
|
|
4607
|
-
children: hasRenderedDiagram ? /* @__PURE__ */
|
|
4933
|
+
children: hasRenderedDiagram ? /* @__PURE__ */ jsx24(
|
|
4608
4934
|
"div",
|
|
4609
4935
|
{
|
|
4610
4936
|
"data-slot": "mermaid-diagram",
|
|
4611
4937
|
dangerouslySetInnerHTML: { __html: svgMarkup }
|
|
4612
4938
|
}
|
|
4613
|
-
) : /* @__PURE__ */
|
|
4614
|
-
isRendering ? /* @__PURE__ */
|
|
4615
|
-
/* @__PURE__ */
|
|
4939
|
+
) : /* @__PURE__ */ jsxs13("div", { className: "flex min-h-[12rem] flex-col items-center justify-center gap-3 text-center text-muted-foreground", children: [
|
|
4940
|
+
isRendering ? /* @__PURE__ */ jsx24(Loader2, { className: "size-5 animate-spin" }) : /* @__PURE__ */ jsx24(TriangleAlert, { className: "size-5 text-destructive" }),
|
|
4941
|
+
/* @__PURE__ */ jsx24(
|
|
4616
4942
|
"p",
|
|
4617
4943
|
{
|
|
4618
4944
|
className: cn("text-sm font-medium", !isRendering && "text-destructive"),
|
|
@@ -4623,12 +4949,12 @@ function MermaidBlock({ code }) {
|
|
|
4623
4949
|
] })
|
|
4624
4950
|
}
|
|
4625
4951
|
) }),
|
|
4626
|
-
/* @__PURE__ */
|
|
4952
|
+
/* @__PURE__ */ jsx24(TabsContent, { value: "code", className: "mt-0", children: /* @__PURE__ */ jsx24(
|
|
4627
4953
|
"pre",
|
|
4628
4954
|
{
|
|
4629
4955
|
"data-slot": "mermaid-code",
|
|
4630
4956
|
className: "overflow-x-auto rounded-[calc(var(--radius)+0.5rem)] border border-border bg-zinc-950 px-4 py-4 text-sm text-zinc-50",
|
|
4631
|
-
children: /* @__PURE__ */
|
|
4957
|
+
children: /* @__PURE__ */ jsx24("code", { className: "block whitespace-pre font-mono", children: code })
|
|
4632
4958
|
}
|
|
4633
4959
|
) })
|
|
4634
4960
|
] })
|
|
@@ -4637,7 +4963,7 @@ function MermaidBlock({ code }) {
|
|
|
4637
4963
|
)
|
|
4638
4964
|
}
|
|
4639
4965
|
),
|
|
4640
|
-
svgMarkup ? /* @__PURE__ */
|
|
4966
|
+
svgMarkup ? /* @__PURE__ */ jsx24(
|
|
4641
4967
|
MermaidPreviewDialog,
|
|
4642
4968
|
{
|
|
4643
4969
|
closeLabel: t("sheet.close"),
|
|
@@ -4652,7 +4978,7 @@ function MermaidBlock({ code }) {
|
|
|
4652
4978
|
|
|
4653
4979
|
// src/components/thread/markdown-text.tsx
|
|
4654
4980
|
import "katex/dist/katex.min.css";
|
|
4655
|
-
import { Fragment as Fragment3, jsx as
|
|
4981
|
+
import { Fragment as Fragment3, jsx as jsx25, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
4656
4982
|
var markdownTableMinWidth = "max(7rem, calc(8rem * var(--density-spacing, 1)))";
|
|
4657
4983
|
var markdownTableCellPaddingInline = "calc(var(--density-padding, 1rem) * 1.25)";
|
|
4658
4984
|
var markdownTableCellPaddingBlock = "max(0.5rem, calc(var(--density-padding, 1rem) * 0.75))";
|
|
@@ -4757,7 +5083,7 @@ var splitProposedPlanSegments = (markdown) => {
|
|
|
4757
5083
|
return segments;
|
|
4758
5084
|
};
|
|
4759
5085
|
function MarkdownContent({ children }) {
|
|
4760
|
-
return /* @__PURE__ */
|
|
5086
|
+
return /* @__PURE__ */ jsx25(
|
|
4761
5087
|
ReactMarkdown,
|
|
4762
5088
|
{
|
|
4763
5089
|
remarkPlugins: [remarkGfm, remarkMath],
|
|
@@ -4780,7 +5106,7 @@ function PlanCard({ children }) {
|
|
|
4780
5106
|
const onDownload = () => {
|
|
4781
5107
|
downloadMarkdown(planMarkdown);
|
|
4782
5108
|
};
|
|
4783
|
-
return /* @__PURE__ */
|
|
5109
|
+
return /* @__PURE__ */ jsxs14(
|
|
4784
5110
|
"section",
|
|
4785
5111
|
{
|
|
4786
5112
|
"data-slot": "markdown-plan-card",
|
|
@@ -4788,28 +5114,28 @@ function PlanCard({ children }) {
|
|
|
4788
5114
|
"relative my-5 max-w-4xl overflow-hidden rounded-2xl border border-border bg-muted/25 shadow-lg"
|
|
4789
5115
|
),
|
|
4790
5116
|
children: [
|
|
4791
|
-
/* @__PURE__ */
|
|
5117
|
+
/* @__PURE__ */ jsxs14(
|
|
4792
5118
|
"div",
|
|
4793
5119
|
{
|
|
4794
5120
|
"data-slot": "markdown-plan-card-header",
|
|
4795
5121
|
className: "flex items-center justify-between gap-3 bg-background/80 px-4 py-3",
|
|
4796
5122
|
children: [
|
|
4797
|
-
/* @__PURE__ */
|
|
4798
|
-
/* @__PURE__ */
|
|
4799
|
-
/* @__PURE__ */
|
|
5123
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
5124
|
+
/* @__PURE__ */ jsx25("span", { className: "inline-flex size-8 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary", children: /* @__PURE__ */ jsx25(ListChecksIcon, { className: "size-4" }) }),
|
|
5125
|
+
/* @__PURE__ */ jsx25("h2", { className: "truncate text-base font-semibold text-foreground", children: t("markdown.plan.title") })
|
|
4800
5126
|
] }),
|
|
4801
|
-
/* @__PURE__ */
|
|
4802
|
-
/* @__PURE__ */
|
|
5127
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
5128
|
+
/* @__PURE__ */ jsx25(
|
|
4803
5129
|
TooltipIconButton,
|
|
4804
5130
|
{
|
|
4805
5131
|
type: "button",
|
|
4806
5132
|
tooltip: t("markdown.plan.download"),
|
|
4807
5133
|
onClick: onDownload,
|
|
4808
5134
|
className: "text-muted-foreground hover:text-foreground",
|
|
4809
|
-
children: /* @__PURE__ */
|
|
5135
|
+
children: /* @__PURE__ */ jsx25(DownloadIcon2, { className: "size-4" })
|
|
4810
5136
|
}
|
|
4811
5137
|
),
|
|
4812
|
-
/* @__PURE__ */
|
|
5138
|
+
/* @__PURE__ */ jsxs14(
|
|
4813
5139
|
TooltipIconButton,
|
|
4814
5140
|
{
|
|
4815
5141
|
type: "button",
|
|
@@ -4817,12 +5143,12 @@ function PlanCard({ children }) {
|
|
|
4817
5143
|
onClick: onCopy,
|
|
4818
5144
|
className: "text-muted-foreground hover:text-foreground",
|
|
4819
5145
|
children: [
|
|
4820
|
-
!isCopied && /* @__PURE__ */
|
|
4821
|
-
isCopied && /* @__PURE__ */
|
|
5146
|
+
!isCopied && /* @__PURE__ */ jsx25(CopyIcon2, { className: "size-4" }),
|
|
5147
|
+
isCopied && /* @__PURE__ */ jsx25(CheckIcon3, { className: "size-4" })
|
|
4822
5148
|
]
|
|
4823
5149
|
}
|
|
4824
5150
|
),
|
|
4825
|
-
/* @__PURE__ */
|
|
5151
|
+
/* @__PURE__ */ jsx25(
|
|
4826
5152
|
TooltipIconButton,
|
|
4827
5153
|
{
|
|
4828
5154
|
type: "button",
|
|
@@ -4831,7 +5157,7 @@ function PlanCard({ children }) {
|
|
|
4831
5157
|
"aria-controls": contentId,
|
|
4832
5158
|
onClick: () => setIsExpanded((previous) => !previous),
|
|
4833
5159
|
className: "text-muted-foreground hover:text-foreground",
|
|
4834
|
-
children: /* @__PURE__ */
|
|
5160
|
+
children: /* @__PURE__ */ jsx25(
|
|
4835
5161
|
ChevronDownIcon,
|
|
4836
5162
|
{
|
|
4837
5163
|
className: cn(
|
|
@@ -4846,7 +5172,7 @@ function PlanCard({ children }) {
|
|
|
4846
5172
|
]
|
|
4847
5173
|
}
|
|
4848
5174
|
),
|
|
4849
|
-
/* @__PURE__ */
|
|
5175
|
+
/* @__PURE__ */ jsx25(
|
|
4850
5176
|
"div",
|
|
4851
5177
|
{
|
|
4852
5178
|
id: contentId,
|
|
@@ -4856,10 +5182,10 @@ function PlanCard({ children }) {
|
|
|
4856
5182
|
"relative w-full px-4 py-3 transition-[max-height] duration-300 ease-in-out",
|
|
4857
5183
|
isExpanded ? "max-h-[80vh] overflow-auto" : "max-h-[200px] overflow-hidden"
|
|
4858
5184
|
),
|
|
4859
|
-
children: /* @__PURE__ */
|
|
5185
|
+
children: /* @__PURE__ */ jsx25(MarkdownContent, { children: planMarkdown })
|
|
4860
5186
|
}
|
|
4861
5187
|
),
|
|
4862
|
-
!isExpanded && /* @__PURE__ */
|
|
5188
|
+
!isExpanded && /* @__PURE__ */ jsx25("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 flex h-32 items-end justify-center bg-gradient-to-b from-background/0 via-background/80 to-background/95 pb-6", children: /* @__PURE__ */ jsx25(
|
|
4863
5189
|
"button",
|
|
4864
5190
|
{
|
|
4865
5191
|
type: "button",
|
|
@@ -4894,16 +5220,16 @@ var CodeHeader = ({ language, code }) => {
|
|
|
4894
5220
|
if (!code || isCopied) return;
|
|
4895
5221
|
copyToClipboard(code);
|
|
4896
5222
|
};
|
|
4897
|
-
return /* @__PURE__ */
|
|
4898
|
-
/* @__PURE__ */
|
|
4899
|
-
/* @__PURE__ */
|
|
4900
|
-
!isCopied && /* @__PURE__ */
|
|
4901
|
-
isCopied && /* @__PURE__ */
|
|
5223
|
+
return /* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-between gap-4 rounded-t-lg bg-zinc-900 px-4 py-2 text-sm font-semibold text-white", children: [
|
|
5224
|
+
/* @__PURE__ */ jsx25("span", { className: "lowercase [&>span]:text-xs", children: language }),
|
|
5225
|
+
/* @__PURE__ */ jsxs14(TooltipIconButton, { tooltip: t("markdown.copy"), onClick: onCopy, children: [
|
|
5226
|
+
!isCopied && /* @__PURE__ */ jsx25(CopyIcon2, {}),
|
|
5227
|
+
isCopied && /* @__PURE__ */ jsx25(CheckIcon3, {})
|
|
4902
5228
|
] })
|
|
4903
5229
|
] });
|
|
4904
5230
|
};
|
|
4905
5231
|
var defaultComponents = {
|
|
4906
|
-
h1: ({ className, ...props }) => /* @__PURE__ */
|
|
5232
|
+
h1: ({ className, ...props }) => /* @__PURE__ */ jsx25(
|
|
4907
5233
|
"h1",
|
|
4908
5234
|
{
|
|
4909
5235
|
className: cn(
|
|
@@ -4913,7 +5239,7 @@ var defaultComponents = {
|
|
|
4913
5239
|
...stripMarkdownNode(props)
|
|
4914
5240
|
}
|
|
4915
5241
|
),
|
|
4916
|
-
h2: ({ className, ...props }) => /* @__PURE__ */
|
|
5242
|
+
h2: ({ className, ...props }) => /* @__PURE__ */ jsx25(
|
|
4917
5243
|
"h2",
|
|
4918
5244
|
{
|
|
4919
5245
|
className: cn(
|
|
@@ -4923,7 +5249,7 @@ var defaultComponents = {
|
|
|
4923
5249
|
...stripMarkdownNode(props)
|
|
4924
5250
|
}
|
|
4925
5251
|
),
|
|
4926
|
-
h3: ({ className, ...props }) => /* @__PURE__ */
|
|
5252
|
+
h3: ({ className, ...props }) => /* @__PURE__ */ jsx25(
|
|
4927
5253
|
"h3",
|
|
4928
5254
|
{
|
|
4929
5255
|
className: cn(
|
|
@@ -4933,7 +5259,7 @@ var defaultComponents = {
|
|
|
4933
5259
|
...stripMarkdownNode(props)
|
|
4934
5260
|
}
|
|
4935
5261
|
),
|
|
4936
|
-
h4: ({ className, ...props }) => /* @__PURE__ */
|
|
5262
|
+
h4: ({ className, ...props }) => /* @__PURE__ */ jsx25(
|
|
4937
5263
|
"h4",
|
|
4938
5264
|
{
|
|
4939
5265
|
className: cn(
|
|
@@ -4943,7 +5269,7 @@ var defaultComponents = {
|
|
|
4943
5269
|
...stripMarkdownNode(props)
|
|
4944
5270
|
}
|
|
4945
5271
|
),
|
|
4946
|
-
h5: ({ className, ...props }) => /* @__PURE__ */
|
|
5272
|
+
h5: ({ className, ...props }) => /* @__PURE__ */ jsx25(
|
|
4947
5273
|
"h5",
|
|
4948
5274
|
{
|
|
4949
5275
|
className: cn(
|
|
@@ -4953,21 +5279,21 @@ var defaultComponents = {
|
|
|
4953
5279
|
...stripMarkdownNode(props)
|
|
4954
5280
|
}
|
|
4955
5281
|
),
|
|
4956
|
-
h6: ({ className, ...props }) => /* @__PURE__ */
|
|
5282
|
+
h6: ({ className, ...props }) => /* @__PURE__ */ jsx25(
|
|
4957
5283
|
"h6",
|
|
4958
5284
|
{
|
|
4959
5285
|
className: cn("my-4 font-semibold first:mt-0 last:mb-0", className),
|
|
4960
5286
|
...stripMarkdownNode(props)
|
|
4961
5287
|
}
|
|
4962
5288
|
),
|
|
4963
|
-
p: ({ className, ...props }) => /* @__PURE__ */
|
|
5289
|
+
p: ({ className, ...props }) => /* @__PURE__ */ jsx25(
|
|
4964
5290
|
"p",
|
|
4965
5291
|
{
|
|
4966
5292
|
className: cn("mt-5 mb-5 leading-7 first:mt-0 last:mb-0", className),
|
|
4967
5293
|
...stripMarkdownNode(props)
|
|
4968
5294
|
}
|
|
4969
5295
|
),
|
|
4970
|
-
a: ({ className, ...props }) => /* @__PURE__ */
|
|
5296
|
+
a: ({ className, ...props }) => /* @__PURE__ */ jsx25(
|
|
4971
5297
|
"a",
|
|
4972
5298
|
{
|
|
4973
5299
|
className: cn(
|
|
@@ -4979,7 +5305,7 @@ var defaultComponents = {
|
|
|
4979
5305
|
...stripMarkdownNode(props)
|
|
4980
5306
|
}
|
|
4981
5307
|
),
|
|
4982
|
-
blockquote: ({ className, ...props }) => /* @__PURE__ */
|
|
5308
|
+
blockquote: ({ className, ...props }) => /* @__PURE__ */ jsx25(
|
|
4983
5309
|
"blockquote",
|
|
4984
5310
|
{
|
|
4985
5311
|
className: cn(
|
|
@@ -4989,14 +5315,14 @@ var defaultComponents = {
|
|
|
4989
5315
|
...stripMarkdownNode(props)
|
|
4990
5316
|
}
|
|
4991
5317
|
),
|
|
4992
|
-
ul: ({ className, ...props }) => /* @__PURE__ */
|
|
5318
|
+
ul: ({ className, ...props }) => /* @__PURE__ */ jsx25(
|
|
4993
5319
|
"ul",
|
|
4994
5320
|
{
|
|
4995
5321
|
className: cn("my-5 list-outside list-disc pl-6 [&>li]:mt-2", className),
|
|
4996
5322
|
...stripMarkdownNode(props)
|
|
4997
5323
|
}
|
|
4998
5324
|
),
|
|
4999
|
-
ol: ({ className, ...props }) => /* @__PURE__ */
|
|
5325
|
+
ol: ({ className, ...props }) => /* @__PURE__ */ jsx25(
|
|
5000
5326
|
"ol",
|
|
5001
5327
|
{
|
|
5002
5328
|
className: cn(
|
|
@@ -5006,19 +5332,19 @@ var defaultComponents = {
|
|
|
5006
5332
|
...stripMarkdownNode(props)
|
|
5007
5333
|
}
|
|
5008
5334
|
),
|
|
5009
|
-
hr: ({ className, ...props }) => /* @__PURE__ */
|
|
5335
|
+
hr: ({ className, ...props }) => /* @__PURE__ */ jsx25(
|
|
5010
5336
|
"hr",
|
|
5011
5337
|
{
|
|
5012
5338
|
className: cn("my-5 border-b", className),
|
|
5013
5339
|
...stripMarkdownNode(props)
|
|
5014
5340
|
}
|
|
5015
5341
|
),
|
|
5016
|
-
table: ({ className, style, ...props }) => /* @__PURE__ */
|
|
5342
|
+
table: ({ className, style, ...props }) => /* @__PURE__ */ jsx25(
|
|
5017
5343
|
"div",
|
|
5018
5344
|
{
|
|
5019
5345
|
"data-slot": "markdown-table-container",
|
|
5020
5346
|
className: "my-5 max-w-full overflow-x-auto rounded-xl border border-border bg-background",
|
|
5021
|
-
children: /* @__PURE__ */
|
|
5347
|
+
children: /* @__PURE__ */ jsx25(
|
|
5022
5348
|
"table",
|
|
5023
5349
|
{
|
|
5024
5350
|
className: cn(
|
|
@@ -5034,7 +5360,7 @@ var defaultComponents = {
|
|
|
5034
5360
|
)
|
|
5035
5361
|
}
|
|
5036
5362
|
),
|
|
5037
|
-
th: ({ className, style, ...props }) => /* @__PURE__ */
|
|
5363
|
+
th: ({ className, style, ...props }) => /* @__PURE__ */ jsx25(
|
|
5038
5364
|
"th",
|
|
5039
5365
|
{
|
|
5040
5366
|
className: cn(
|
|
@@ -5050,7 +5376,7 @@ var defaultComponents = {
|
|
|
5050
5376
|
...stripMarkdownNode(props)
|
|
5051
5377
|
}
|
|
5052
5378
|
),
|
|
5053
|
-
td: ({ className, style, ...props }) => /* @__PURE__ */
|
|
5379
|
+
td: ({ className, style, ...props }) => /* @__PURE__ */ jsx25(
|
|
5054
5380
|
"td",
|
|
5055
5381
|
{
|
|
5056
5382
|
className: cn(
|
|
@@ -5066,7 +5392,7 @@ var defaultComponents = {
|
|
|
5066
5392
|
...stripMarkdownNode(props)
|
|
5067
5393
|
}
|
|
5068
5394
|
),
|
|
5069
|
-
tr: ({ className, ...props }) => /* @__PURE__ */
|
|
5395
|
+
tr: ({ className, ...props }) => /* @__PURE__ */ jsx25(
|
|
5070
5396
|
"tr",
|
|
5071
5397
|
{
|
|
5072
5398
|
className: cn(
|
|
@@ -5076,14 +5402,14 @@ var defaultComponents = {
|
|
|
5076
5402
|
...stripMarkdownNode(props)
|
|
5077
5403
|
}
|
|
5078
5404
|
),
|
|
5079
|
-
sup: ({ className, ...props }) => /* @__PURE__ */
|
|
5405
|
+
sup: ({ className, ...props }) => /* @__PURE__ */ jsx25(
|
|
5080
5406
|
"sup",
|
|
5081
5407
|
{
|
|
5082
5408
|
className: cn("[&>a]:text-xs [&>a]:no-underline", className),
|
|
5083
5409
|
...stripMarkdownNode(props)
|
|
5084
5410
|
}
|
|
5085
5411
|
),
|
|
5086
|
-
pre: ({ className, children }) => Children.toArray(children).length === 1 && (isMermaidBlockChild(Children.toArray(children)[0]) || isMermaidCodeElement(Children.toArray(children)[0])) ? /* @__PURE__ */
|
|
5412
|
+
pre: ({ className, children }) => Children.toArray(children).length === 1 && (isMermaidBlockChild(Children.toArray(children)[0]) || isMermaidCodeElement(Children.toArray(children)[0])) ? /* @__PURE__ */ jsx25(Fragment3, { children }) : /* @__PURE__ */ jsx25(
|
|
5087
5413
|
"div",
|
|
5088
5414
|
{
|
|
5089
5415
|
className: cn(
|
|
@@ -5106,15 +5432,15 @@ var defaultComponents = {
|
|
|
5106
5432
|
const language = match[1];
|
|
5107
5433
|
const normalizedCode = code.replace(/\n$/, "");
|
|
5108
5434
|
if (language === "mermaid") {
|
|
5109
|
-
return /* @__PURE__ */
|
|
5435
|
+
return /* @__PURE__ */ jsx25(MermaidBlock, { code: normalizedCode });
|
|
5110
5436
|
}
|
|
5111
|
-
return /* @__PURE__ */
|
|
5112
|
-
/* @__PURE__ */
|
|
5113
|
-
/* @__PURE__ */
|
|
5437
|
+
return /* @__PURE__ */ jsxs14(Fragment3, { children: [
|
|
5438
|
+
/* @__PURE__ */ jsx25(CodeHeader, { language, code: normalizedCode }),
|
|
5439
|
+
/* @__PURE__ */ jsx25(SyntaxHighlighter, { language, className, children: normalizedCode })
|
|
5114
5440
|
] });
|
|
5115
5441
|
}
|
|
5116
5442
|
if (isBlockCode) {
|
|
5117
|
-
return /* @__PURE__ */
|
|
5443
|
+
return /* @__PURE__ */ jsx25(
|
|
5118
5444
|
"code",
|
|
5119
5445
|
{
|
|
5120
5446
|
className: cn(
|
|
@@ -5126,7 +5452,7 @@ var defaultComponents = {
|
|
|
5126
5452
|
}
|
|
5127
5453
|
);
|
|
5128
5454
|
}
|
|
5129
|
-
return /* @__PURE__ */
|
|
5455
|
+
return /* @__PURE__ */ jsx25(
|
|
5130
5456
|
"code",
|
|
5131
5457
|
{
|
|
5132
5458
|
className: cn(
|
|
@@ -5145,14 +5471,14 @@ var defaultComponents = {
|
|
|
5145
5471
|
}
|
|
5146
5472
|
};
|
|
5147
5473
|
var MarkdownTextImpl = ({ children }) => {
|
|
5148
|
-
return /* @__PURE__ */
|
|
5149
|
-
(segment, index) => segment.type === "plan" ? /* @__PURE__ */
|
|
5474
|
+
return /* @__PURE__ */ jsx25("div", { className: "markdown-content", children: splitProposedPlanSegments(children).map(
|
|
5475
|
+
(segment, index) => segment.type === "plan" ? /* @__PURE__ */ jsx25(PlanCard, { children: segment.content }, index) : /* @__PURE__ */ jsx25(MarkdownContent, { children: segment.content }, index)
|
|
5150
5476
|
) });
|
|
5151
5477
|
};
|
|
5152
5478
|
var MarkdownText = memo(MarkdownTextImpl);
|
|
5153
5479
|
|
|
5154
5480
|
// src/components/thread/messages/tool-component-group.tsx
|
|
5155
|
-
import * as
|
|
5481
|
+
import * as React21 from "react";
|
|
5156
5482
|
import {
|
|
5157
5483
|
Check as Check2,
|
|
5158
5484
|
CheckCircle2 as CheckCircle22,
|
|
@@ -5212,7 +5538,7 @@ function resolveLocalizedText(value, language) {
|
|
|
5212
5538
|
}
|
|
5213
5539
|
|
|
5214
5540
|
// src/components/thread/messages/tool-component-group.tsx
|
|
5215
|
-
import { jsx as
|
|
5541
|
+
import { jsx as jsx26, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
5216
5542
|
var toolStatusConfig = {
|
|
5217
5543
|
success: {
|
|
5218
5544
|
iconClass: "border-green-500 text-green-700",
|
|
@@ -5304,11 +5630,11 @@ function formatStepDuration(durationMs) {
|
|
|
5304
5630
|
return `${minutes}m ${seconds}s`;
|
|
5305
5631
|
}
|
|
5306
5632
|
function useToolStepDurationLabel(data) {
|
|
5307
|
-
const [durationNow, setDurationNow] =
|
|
5633
|
+
const [durationNow, setDurationNow] = React21.useState(() => Date.now());
|
|
5308
5634
|
const createdAt = parseStepDate(data.created_date);
|
|
5309
5635
|
const endedAt = parseStepDate(data.end_date);
|
|
5310
5636
|
const status = data.status;
|
|
5311
|
-
|
|
5637
|
+
React21.useEffect(() => {
|
|
5312
5638
|
if (status !== "running" || createdAt === null || endedAt !== null) {
|
|
5313
5639
|
return;
|
|
5314
5640
|
}
|
|
@@ -5514,14 +5840,14 @@ function JsonTreeNode({
|
|
|
5514
5840
|
const isArray = Array.isArray(value);
|
|
5515
5841
|
const isObject = isJsonObjectValue(value);
|
|
5516
5842
|
const isExpandable = isArray || isObject;
|
|
5517
|
-
const [isExpanded, setIsExpanded] =
|
|
5843
|
+
const [isExpanded, setIsExpanded] = React21.useState(depth < 2);
|
|
5518
5844
|
if (!isExpandable) {
|
|
5519
|
-
return /* @__PURE__ */
|
|
5520
|
-
label ? /* @__PURE__ */
|
|
5845
|
+
return /* @__PURE__ */ jsxs15("div", { className: "flex min-w-0 gap-2 leading-6", children: [
|
|
5846
|
+
label ? /* @__PURE__ */ jsxs15("span", { className: "shrink-0 font-medium text-foreground/80", children: [
|
|
5521
5847
|
label,
|
|
5522
5848
|
":"
|
|
5523
5849
|
] }) : null,
|
|
5524
|
-
/* @__PURE__ */
|
|
5850
|
+
/* @__PURE__ */ jsx26(
|
|
5525
5851
|
"span",
|
|
5526
5852
|
{
|
|
5527
5853
|
className: cn(
|
|
@@ -5535,8 +5861,8 @@ function JsonTreeNode({
|
|
|
5535
5861
|
}
|
|
5536
5862
|
const entries = isArray ? value.map((item, index) => [String(index), item]) : Object.entries(value);
|
|
5537
5863
|
const summary = isArray ? `Array(${value.length})` : `Object(${entries.length})`;
|
|
5538
|
-
return /* @__PURE__ */
|
|
5539
|
-
/* @__PURE__ */
|
|
5864
|
+
return /* @__PURE__ */ jsxs15("div", { className: "min-w-0", children: [
|
|
5865
|
+
/* @__PURE__ */ jsxs15(
|
|
5540
5866
|
"button",
|
|
5541
5867
|
{
|
|
5542
5868
|
type: "button",
|
|
@@ -5544,7 +5870,7 @@ function JsonTreeNode({
|
|
|
5544
5870
|
"aria-expanded": isExpanded,
|
|
5545
5871
|
onClick: () => setIsExpanded((prev) => !prev),
|
|
5546
5872
|
children: [
|
|
5547
|
-
/* @__PURE__ */
|
|
5873
|
+
/* @__PURE__ */ jsx26(
|
|
5548
5874
|
ChevronRight3,
|
|
5549
5875
|
{
|
|
5550
5876
|
"aria-hidden": "true",
|
|
@@ -5554,15 +5880,15 @@ function JsonTreeNode({
|
|
|
5554
5880
|
)
|
|
5555
5881
|
}
|
|
5556
5882
|
),
|
|
5557
|
-
label ? /* @__PURE__ */
|
|
5883
|
+
label ? /* @__PURE__ */ jsxs15("span", { className: "min-w-0 truncate font-medium text-foreground/80", children: [
|
|
5558
5884
|
label,
|
|
5559
5885
|
":"
|
|
5560
5886
|
] }) : null,
|
|
5561
|
-
/* @__PURE__ */
|
|
5887
|
+
/* @__PURE__ */ jsx26("span", { className: "shrink-0 text-muted-foreground", children: summary })
|
|
5562
5888
|
]
|
|
5563
5889
|
}
|
|
5564
5890
|
),
|
|
5565
|
-
isExpanded ? /* @__PURE__ */
|
|
5891
|
+
isExpanded ? /* @__PURE__ */ jsx26("div", { className: "ml-4 border-l border-border/70 pl-3", children: entries.map(([entryLabel, entryValue]) => /* @__PURE__ */ jsx26(
|
|
5566
5892
|
JsonTreeNode,
|
|
5567
5893
|
{
|
|
5568
5894
|
label: entryLabel,
|
|
@@ -5574,13 +5900,13 @@ function JsonTreeNode({
|
|
|
5574
5900
|
] });
|
|
5575
5901
|
}
|
|
5576
5902
|
function JsonTreeView({ value }) {
|
|
5577
|
-
return /* @__PURE__ */
|
|
5903
|
+
return /* @__PURE__ */ jsx26("div", { className: "min-w-0 font-mono text-[11px]", children: /* @__PURE__ */ jsx26(JsonTreeNode, { value }) });
|
|
5578
5904
|
}
|
|
5579
5905
|
function RawJsonBlock({ raw }) {
|
|
5580
|
-
return /* @__PURE__ */
|
|
5906
|
+
return /* @__PURE__ */ jsx26("pre", { className: "whitespace-pre-wrap wrap-break-word font-mono text-[11px]", children: raw });
|
|
5581
5907
|
}
|
|
5582
5908
|
function PlainTextBlock({ value, destructive = false }) {
|
|
5583
|
-
return /* @__PURE__ */
|
|
5909
|
+
return /* @__PURE__ */ jsx26(
|
|
5584
5910
|
"pre",
|
|
5585
5911
|
{
|
|
5586
5912
|
className: cn(
|
|
@@ -5593,15 +5919,15 @@ function PlainTextBlock({ value, destructive = false }) {
|
|
|
5593
5919
|
}
|
|
5594
5920
|
function ToolCallCopyButton({ value }) {
|
|
5595
5921
|
const { t } = useChatkitTranslation();
|
|
5596
|
-
const [isCopied, setIsCopied] =
|
|
5597
|
-
const resetTimeoutRef =
|
|
5598
|
-
const clearResetTimeout =
|
|
5922
|
+
const [isCopied, setIsCopied] = React21.useState(false);
|
|
5923
|
+
const resetTimeoutRef = React21.useRef(null);
|
|
5924
|
+
const clearResetTimeout = React21.useCallback(() => {
|
|
5599
5925
|
if (resetTimeoutRef.current === null) return;
|
|
5600
5926
|
window.clearTimeout(resetTimeoutRef.current);
|
|
5601
5927
|
resetTimeoutRef.current = null;
|
|
5602
5928
|
}, []);
|
|
5603
|
-
|
|
5604
|
-
const handleCopy =
|
|
5929
|
+
React21.useEffect(() => clearResetTimeout, [clearResetTimeout]);
|
|
5930
|
+
const handleCopy = React21.useCallback(() => {
|
|
5605
5931
|
if (typeof navigator === "undefined" || !navigator.clipboard) return;
|
|
5606
5932
|
void navigator.clipboard.writeText(value).then(() => {
|
|
5607
5933
|
setIsCopied(true);
|
|
@@ -5613,7 +5939,7 @@ function ToolCallCopyButton({ value }) {
|
|
|
5613
5939
|
}).catch(() => void 0);
|
|
5614
5940
|
}, [clearResetTimeout, value]);
|
|
5615
5941
|
const label = isCopied ? t("message.toolGroup.copied") : t("message.toolGroup.copy");
|
|
5616
|
-
return /* @__PURE__ */
|
|
5942
|
+
return /* @__PURE__ */ jsx26(
|
|
5617
5943
|
"button",
|
|
5618
5944
|
{
|
|
5619
5945
|
type: "button",
|
|
@@ -5621,7 +5947,7 @@ function ToolCallCopyButton({ value }) {
|
|
|
5621
5947
|
"aria-label": label,
|
|
5622
5948
|
title: label,
|
|
5623
5949
|
onClick: handleCopy,
|
|
5624
|
-
children: isCopied ? /* @__PURE__ */
|
|
5950
|
+
children: isCopied ? /* @__PURE__ */ jsx26(Check2, { className: "h-3.5 w-3.5", "aria-hidden": "true" }) : /* @__PURE__ */ jsx26(Copy, { className: "h-3.5 w-3.5", "aria-hidden": "true" })
|
|
5625
5951
|
}
|
|
5626
5952
|
);
|
|
5627
5953
|
}
|
|
@@ -5632,28 +5958,28 @@ function ToolCallValueBlock({
|
|
|
5632
5958
|
const { t } = useChatkitTranslation();
|
|
5633
5959
|
const detected = detectJsonValue(value);
|
|
5634
5960
|
if (detected.kind === "text") {
|
|
5635
|
-
return /* @__PURE__ */
|
|
5636
|
-
/* @__PURE__ */
|
|
5637
|
-
/* @__PURE__ */
|
|
5961
|
+
return /* @__PURE__ */ jsxs15("div", { className: "min-w-0 space-y-1", children: [
|
|
5962
|
+
/* @__PURE__ */ jsx26("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx26(ToolCallCopyButton, { value: detected.text }) }),
|
|
5963
|
+
/* @__PURE__ */ jsx26(PlainTextBlock, { value: detected.text, destructive })
|
|
5638
5964
|
] });
|
|
5639
5965
|
}
|
|
5640
|
-
return /* @__PURE__ */
|
|
5641
|
-
/* @__PURE__ */
|
|
5642
|
-
/* @__PURE__ */
|
|
5966
|
+
return /* @__PURE__ */ jsxs15(Tabs, { defaultValue: "tree", className: "min-w-0", children: [
|
|
5967
|
+
/* @__PURE__ */ jsxs15("div", { className: "mb-2 flex min-w-0 items-center justify-between gap-2", children: [
|
|
5968
|
+
/* @__PURE__ */ jsxs15("span", { className: "min-w-0 truncate text-[11px] text-muted-foreground", children: [
|
|
5643
5969
|
t("message.toolGroup.jsonTitle"),
|
|
5644
5970
|
" \xB7 ",
|
|
5645
5971
|
getJsonValueSummary(detected.value)
|
|
5646
5972
|
] }),
|
|
5647
|
-
/* @__PURE__ */
|
|
5648
|
-
/* @__PURE__ */
|
|
5649
|
-
/* @__PURE__ */
|
|
5650
|
-
/* @__PURE__ */
|
|
5651
|
-
/* @__PURE__ */
|
|
5973
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
5974
|
+
/* @__PURE__ */ jsx26(ToolCallCopyButton, { value: detected.raw }),
|
|
5975
|
+
/* @__PURE__ */ jsxs15(TabsList, { className: "rounded-md p-0.5", children: [
|
|
5976
|
+
/* @__PURE__ */ jsx26(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "tree", children: t("message.toolGroup.jsonTree") }),
|
|
5977
|
+
/* @__PURE__ */ jsx26(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "raw", children: t("message.toolGroup.jsonRaw") })
|
|
5652
5978
|
] })
|
|
5653
5979
|
] })
|
|
5654
5980
|
] }),
|
|
5655
|
-
/* @__PURE__ */
|
|
5656
|
-
/* @__PURE__ */
|
|
5981
|
+
/* @__PURE__ */ jsx26(TabsContent, { value: "tree", className: "mt-0", children: /* @__PURE__ */ jsx26(JsonTreeView, { value: detected.value }) }),
|
|
5982
|
+
/* @__PURE__ */ jsx26(TabsContent, { value: "raw", className: "mt-0", children: /* @__PURE__ */ jsx26(RawJsonBlock, { raw: detected.raw }) })
|
|
5657
5983
|
] });
|
|
5658
5984
|
}
|
|
5659
5985
|
function DefaultToolCallOutput({ data }) {
|
|
@@ -5661,15 +5987,15 @@ function DefaultToolCallOutput({ data }) {
|
|
|
5661
5987
|
const output = data.output ?? null;
|
|
5662
5988
|
const error = data.error ?? null;
|
|
5663
5989
|
if (error) {
|
|
5664
|
-
return /* @__PURE__ */
|
|
5665
|
-
/* @__PURE__ */
|
|
5666
|
-
/* @__PURE__ */
|
|
5990
|
+
return /* @__PURE__ */ jsxs15("div", { className: "space-y-1", children: [
|
|
5991
|
+
/* @__PURE__ */ jsx26("div", { className: "text-[11px] font-medium text-destructive", children: t("message.toolGroup.errorTitle") }),
|
|
5992
|
+
/* @__PURE__ */ jsx26(ToolCallValueBlock, { value: error, destructive: true })
|
|
5667
5993
|
] });
|
|
5668
5994
|
}
|
|
5669
5995
|
if (output === null) return null;
|
|
5670
|
-
return /* @__PURE__ */
|
|
5671
|
-
/* @__PURE__ */
|
|
5672
|
-
/* @__PURE__ */
|
|
5996
|
+
return /* @__PURE__ */ jsxs15("div", { className: "space-y-1", children: [
|
|
5997
|
+
/* @__PURE__ */ jsx26("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.toolGroup.outputTitle") }),
|
|
5998
|
+
/* @__PURE__ */ jsx26(ToolCallValueBlock, { value: output })
|
|
5673
5999
|
] });
|
|
5674
6000
|
}
|
|
5675
6001
|
function ToolCallDetails({ content }) {
|
|
@@ -5679,13 +6005,13 @@ function ToolCallDetails({ content }) {
|
|
|
5679
6005
|
const hasInput = data.input !== void 0 && data.input !== null;
|
|
5680
6006
|
const hasOutput = data.error !== void 0 || data.output !== void 0;
|
|
5681
6007
|
if (!hasInput && !hasOutput) return null;
|
|
5682
|
-
return /* @__PURE__ */
|
|
5683
|
-
hasInput && /* @__PURE__ */
|
|
5684
|
-
/* @__PURE__ */
|
|
5685
|
-
/* @__PURE__ */
|
|
6008
|
+
return /* @__PURE__ */ jsxs15("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: [
|
|
6009
|
+
hasInput && /* @__PURE__ */ jsxs15("div", { className: "space-y-1", children: [
|
|
6010
|
+
/* @__PURE__ */ jsx26("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.toolGroup.inputTitle") }),
|
|
6011
|
+
/* @__PURE__ */ jsx26(ToolCallValueBlock, { value: data.input })
|
|
5686
6012
|
] }),
|
|
5687
|
-
hasInput && hasOutput ? /* @__PURE__ */
|
|
5688
|
-
hasOutput ? /* @__PURE__ */
|
|
6013
|
+
hasInput && hasOutput ? /* @__PURE__ */ jsx26("div", { className: "h-2" }) : null,
|
|
6014
|
+
hasOutput ? /* @__PURE__ */ jsx26(OutputRenderer, { content, data }) : null
|
|
5689
6015
|
] });
|
|
5690
6016
|
}
|
|
5691
6017
|
function ToolCallRow({ content }) {
|
|
@@ -5696,17 +6022,17 @@ function ToolCallRow({ content }) {
|
|
|
5696
6022
|
const ItemStatusIcon = itemConfig?.icon;
|
|
5697
6023
|
const hasError = status === "fail" || Boolean(data.error);
|
|
5698
6024
|
const label = getToolActivityLabel(content, i18n2.language);
|
|
5699
|
-
const detailsId =
|
|
6025
|
+
const detailsId = React21.useId();
|
|
5700
6026
|
const hasDetails = data.input !== void 0 || data.error !== void 0 || data.output !== void 0;
|
|
5701
6027
|
const durationLabel = useToolStepDurationLabel(data);
|
|
5702
|
-
const [isExpanded, setIsExpanded] =
|
|
5703
|
-
|
|
6028
|
+
const [isExpanded, setIsExpanded] = React21.useState(false);
|
|
6029
|
+
React21.useEffect(() => {
|
|
5704
6030
|
if (status === "running" && data.output !== void 0) {
|
|
5705
6031
|
setIsExpanded(true);
|
|
5706
6032
|
}
|
|
5707
6033
|
}, [data.output, status]);
|
|
5708
|
-
return /* @__PURE__ */
|
|
5709
|
-
/* @__PURE__ */
|
|
6034
|
+
return /* @__PURE__ */ jsxs15("li", { className: "min-w-0", children: [
|
|
6035
|
+
/* @__PURE__ */ jsxs15(
|
|
5710
6036
|
"button",
|
|
5711
6037
|
{
|
|
5712
6038
|
type: "button",
|
|
@@ -5722,7 +6048,7 @@ function ToolCallRow({ content }) {
|
|
|
5722
6048
|
if (hasDetails) setIsExpanded((prev) => !prev);
|
|
5723
6049
|
},
|
|
5724
6050
|
children: [
|
|
5725
|
-
ItemStatusIcon ? /* @__PURE__ */
|
|
6051
|
+
ItemStatusIcon ? /* @__PURE__ */ jsx26(
|
|
5726
6052
|
ItemStatusIcon,
|
|
5727
6053
|
{
|
|
5728
6054
|
className: cn(
|
|
@@ -5731,10 +6057,10 @@ function ToolCallRow({ content }) {
|
|
|
5731
6057
|
status === "running" && "animate-spin"
|
|
5732
6058
|
)
|
|
5733
6059
|
}
|
|
5734
|
-
) : /* @__PURE__ */
|
|
5735
|
-
/* @__PURE__ */
|
|
5736
|
-
durationLabel ? /* @__PURE__ */
|
|
5737
|
-
hasDetails ? /* @__PURE__ */
|
|
6060
|
+
) : /* @__PURE__ */ jsx26("span", { className: "h-3.5 w-3.5 shrink-0", "aria-hidden": "true" }),
|
|
6061
|
+
/* @__PURE__ */ jsx26("span", { className: "min-w-0 flex-1 truncate", title: label, children: label }),
|
|
6062
|
+
durationLabel ? /* @__PURE__ */ jsx26("span", { className: "shrink-0 text-[11px] tabular-nums text-muted-foreground/80", children: durationLabel }) : null,
|
|
6063
|
+
hasDetails ? /* @__PURE__ */ jsx26(
|
|
5738
6064
|
ChevronRight3,
|
|
5739
6065
|
{
|
|
5740
6066
|
"aria-hidden": "true",
|
|
@@ -5747,7 +6073,7 @@ function ToolCallRow({ content }) {
|
|
|
5747
6073
|
]
|
|
5748
6074
|
}
|
|
5749
6075
|
),
|
|
5750
|
-
hasDetails && isExpanded ? /* @__PURE__ */
|
|
6076
|
+
hasDetails && isExpanded ? /* @__PURE__ */ jsx26("div", { id: detailsId, children: /* @__PURE__ */ jsx26(ToolCallDetails, { content }) }) : null
|
|
5751
6077
|
] });
|
|
5752
6078
|
}
|
|
5753
6079
|
function ToolComponentGroup({
|
|
@@ -5755,9 +6081,9 @@ function ToolComponentGroup({
|
|
|
5755
6081
|
hasFollowingItem
|
|
5756
6082
|
}) {
|
|
5757
6083
|
const { t } = useChatkitTranslation();
|
|
5758
|
-
const contentId =
|
|
6084
|
+
const contentId = React21.useId();
|
|
5759
6085
|
const groupStatus = getToolGroupDisplayStatus(items);
|
|
5760
|
-
const [isExpanded, setIsExpanded] =
|
|
6086
|
+
const [isExpanded, setIsExpanded] = React21.useState(!hasFollowingItem);
|
|
5761
6087
|
const categoryCounts = getToolGroupCategoryCounts(items);
|
|
5762
6088
|
const categorySummary = TOOL_GROUP_CATEGORY_ORDER.flatMap((category) => {
|
|
5763
6089
|
const count = categoryCounts[category] ?? 0;
|
|
@@ -5772,11 +6098,11 @@ function ToolComponentGroup({
|
|
|
5772
6098
|
const summary = `${t(`message.toolGroup.status.${groupStatus}`)} ${categorySummary}`;
|
|
5773
6099
|
const config = toolStatusConfig[groupStatus];
|
|
5774
6100
|
const StatusIcon = config.icon;
|
|
5775
|
-
|
|
6101
|
+
React21.useEffect(() => {
|
|
5776
6102
|
setIsExpanded(!hasFollowingItem);
|
|
5777
6103
|
}, [hasFollowingItem, items.length]);
|
|
5778
|
-
return /* @__PURE__ */
|
|
5779
|
-
/* @__PURE__ */
|
|
6104
|
+
return /* @__PURE__ */ jsxs15("div", { className: "px-1 py-1", children: [
|
|
6105
|
+
/* @__PURE__ */ jsxs15(
|
|
5780
6106
|
"button",
|
|
5781
6107
|
{
|
|
5782
6108
|
type: "button",
|
|
@@ -5785,8 +6111,8 @@ function ToolComponentGroup({
|
|
|
5785
6111
|
"aria-controls": contentId,
|
|
5786
6112
|
onClick: () => setIsExpanded((prev) => !prev),
|
|
5787
6113
|
children: [
|
|
5788
|
-
/* @__PURE__ */
|
|
5789
|
-
/* @__PURE__ */
|
|
6114
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex min-w-0 items-center gap-2 text-sm font-medium text-muted-foreground", children: [
|
|
6115
|
+
/* @__PURE__ */ jsx26(
|
|
5790
6116
|
StatusIcon,
|
|
5791
6117
|
{
|
|
5792
6118
|
className: cn(
|
|
@@ -5795,9 +6121,9 @@ function ToolComponentGroup({
|
|
|
5795
6121
|
)
|
|
5796
6122
|
}
|
|
5797
6123
|
),
|
|
5798
|
-
/* @__PURE__ */
|
|
6124
|
+
/* @__PURE__ */ jsx26("span", { className: "truncate", children: summary })
|
|
5799
6125
|
] }),
|
|
5800
|
-
/* @__PURE__ */
|
|
6126
|
+
/* @__PURE__ */ jsx26(
|
|
5801
6127
|
ChevronRight3,
|
|
5802
6128
|
{
|
|
5803
6129
|
"aria-hidden": "true",
|
|
@@ -5810,7 +6136,7 @@ function ToolComponentGroup({
|
|
|
5810
6136
|
]
|
|
5811
6137
|
}
|
|
5812
6138
|
),
|
|
5813
|
-
isExpanded && /* @__PURE__ */
|
|
6139
|
+
isExpanded && /* @__PURE__ */ jsx26("ul", { id: contentId, className: "mt-2 max-h-[200px] space-y-1.5 overflow-y-auto pr-1", children: items.map((item, index) => /* @__PURE__ */ jsx26(ToolCallRow, { content: item }, item.id ?? `tool-item-${index}`)) })
|
|
5814
6140
|
] });
|
|
5815
6141
|
}
|
|
5816
6142
|
|
|
@@ -5821,7 +6147,7 @@ import {
|
|
|
5821
6147
|
REQUEST_USER_INPUT_TOOL_NAME as REQUEST_USER_INPUT_TOOL_NAME2
|
|
5822
6148
|
} from "@xpert-ai/chatkit-types";
|
|
5823
6149
|
import { CheckCircle2 as CheckCircle23 } from "lucide-react";
|
|
5824
|
-
import { jsx as
|
|
6150
|
+
import { jsx as jsx27, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
5825
6151
|
function isRecord2(value) {
|
|
5826
6152
|
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
5827
6153
|
}
|
|
@@ -5933,7 +6259,7 @@ function RequestUserInputResultCard({
|
|
|
5933
6259
|
className
|
|
5934
6260
|
}) {
|
|
5935
6261
|
const { t } = useChatkitTranslation();
|
|
5936
|
-
return /* @__PURE__ */
|
|
6262
|
+
return /* @__PURE__ */ jsxs16(
|
|
5937
6263
|
"section",
|
|
5938
6264
|
{
|
|
5939
6265
|
"aria-label": t("message.requestUserInputResult.title"),
|
|
@@ -5942,23 +6268,23 @@ function RequestUserInputResultCard({
|
|
|
5942
6268
|
className
|
|
5943
6269
|
),
|
|
5944
6270
|
children: [
|
|
5945
|
-
/* @__PURE__ */
|
|
5946
|
-
/* @__PURE__ */
|
|
5947
|
-
/* @__PURE__ */
|
|
6271
|
+
/* @__PURE__ */ jsxs16("div", { className: "mb-2 flex items-center gap-2 text-sm font-semibold text-foreground", children: [
|
|
6272
|
+
/* @__PURE__ */ jsx27(CheckCircle23, { className: "h-4 w-4 text-primary" }),
|
|
6273
|
+
/* @__PURE__ */ jsx27("span", { children: t("message.requestUserInputResult.title") })
|
|
5948
6274
|
] }),
|
|
5949
|
-
/* @__PURE__ */
|
|
6275
|
+
/* @__PURE__ */ jsx27("div", { className: "space-y-2", children: result.answers.map((answer, index) => /* @__PURE__ */ jsxs16(
|
|
5950
6276
|
"div",
|
|
5951
6277
|
{
|
|
5952
6278
|
className: "rounded-md bg-background/70 px-2.5 py-2",
|
|
5953
6279
|
children: [
|
|
5954
|
-
/* @__PURE__ */
|
|
5955
|
-
/* @__PURE__ */
|
|
5956
|
-
/* @__PURE__ */
|
|
5957
|
-
/* @__PURE__ */
|
|
6280
|
+
/* @__PURE__ */ jsx27("div", { className: "text-xs font-medium leading-5 text-muted-foreground", children: answer.question }),
|
|
6281
|
+
/* @__PURE__ */ jsxs16("div", { className: "mt-0.5 flex min-w-0 flex-wrap items-center gap-1.5", children: [
|
|
6282
|
+
/* @__PURE__ */ jsx27("span", { className: "min-w-0 wrap-break-word text-sm font-semibold text-foreground", children: answer.label ?? answer.value }),
|
|
6283
|
+
/* @__PURE__ */ jsx27("span", { className: "rounded-full bg-muted px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground", children: t(
|
|
5958
6284
|
answer.type === "other" ? "message.requestUserInputResult.other" : "message.requestUserInputResult.option"
|
|
5959
6285
|
) })
|
|
5960
6286
|
] }),
|
|
5961
|
-
answer.description ? /* @__PURE__ */
|
|
6287
|
+
answer.description ? /* @__PURE__ */ jsx27("div", { className: "mt-1 text-xs leading-5 text-muted-foreground", children: answer.description }) : null
|
|
5962
6288
|
]
|
|
5963
6289
|
},
|
|
5964
6290
|
`${answer.id}-${index}`
|
|
@@ -5970,18 +6296,18 @@ function RequestUserInputResultCard({
|
|
|
5970
6296
|
|
|
5971
6297
|
// src/components/thread/messages/widget.tsx
|
|
5972
6298
|
import { SurfaceRenderer } from "@xpert-ai/a2ui-react";
|
|
5973
|
-
import { jsx as
|
|
6299
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
5974
6300
|
function WidgetMessage({ messageId, data }) {
|
|
5975
6301
|
const widgets = Array.isArray(data.widgets) ? data.widgets : [];
|
|
5976
6302
|
if (widgets.length === 0) return null;
|
|
5977
6303
|
const baseSurfaceId = `widget-${messageId}`;
|
|
5978
|
-
return /* @__PURE__ */
|
|
6304
|
+
return /* @__PURE__ */ jsx28("div", { className: "space-y-3", children: widgets.map((widget, index) => {
|
|
5979
6305
|
const config = widget?.config;
|
|
5980
6306
|
if (!config || typeof config !== "object") {
|
|
5981
6307
|
return null;
|
|
5982
6308
|
}
|
|
5983
6309
|
const surfaceId = widgets.length > 1 ? `${baseSurfaceId}-${index}` : baseSurfaceId;
|
|
5984
|
-
return /* @__PURE__ */
|
|
6310
|
+
return /* @__PURE__ */ jsx28(
|
|
5985
6311
|
SurfaceRenderer,
|
|
5986
6312
|
{
|
|
5987
6313
|
surfaceId,
|
|
@@ -5993,7 +6319,7 @@ function WidgetMessage({ messageId, data }) {
|
|
|
5993
6319
|
}
|
|
5994
6320
|
|
|
5995
6321
|
// src/components/thread/messages/ai.tsx
|
|
5996
|
-
import { jsx as
|
|
6322
|
+
import { jsx as jsx29, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
5997
6323
|
function isTextContent2(content) {
|
|
5998
6324
|
return content.type === "text";
|
|
5999
6325
|
}
|
|
@@ -6026,11 +6352,11 @@ function formatDisplayValue2(value) {
|
|
|
6026
6352
|
function ReasoningBlock({ reasoning }) {
|
|
6027
6353
|
const blocks = reasoning.filter((item) => item.text?.trim());
|
|
6028
6354
|
if (blocks.length === 0) return null;
|
|
6029
|
-
return /* @__PURE__ */
|
|
6355
|
+
return /* @__PURE__ */ jsx29("div", { className: "space-y-2", children: blocks.map((item, index) => /* @__PURE__ */ jsx29(
|
|
6030
6356
|
"div",
|
|
6031
6357
|
{
|
|
6032
6358
|
className: "rounded-lg border bg-muted/40 p-3 text-xs text-muted-foreground",
|
|
6033
|
-
children: /* @__PURE__ */
|
|
6359
|
+
children: /* @__PURE__ */ jsx29("p", { className: "whitespace-pre-wrap wrap-break-word leading-relaxed", children: item.text })
|
|
6034
6360
|
},
|
|
6035
6361
|
item.id ?? `reasoning-${index}`
|
|
6036
6362
|
)) });
|
|
@@ -6038,20 +6364,20 @@ function ReasoningBlock({ reasoning }) {
|
|
|
6038
6364
|
function ImageBlock({ content }) {
|
|
6039
6365
|
const imageUrl = typeof content.image_url === "string" ? content.image_url : typeof content.image_url?.url === "string" ? content.image_url.url : null;
|
|
6040
6366
|
if (!imageUrl) {
|
|
6041
|
-
return /* @__PURE__ */
|
|
6042
|
-
/* @__PURE__ */
|
|
6043
|
-
/* @__PURE__ */
|
|
6367
|
+
return /* @__PURE__ */ jsxs17(Card, { children: [
|
|
6368
|
+
/* @__PURE__ */ jsx29(CardHeader, { className: "space-y-1", children: /* @__PURE__ */ jsx29(CardTitle, { className: "text-sm", children: "Image" }) }),
|
|
6369
|
+
/* @__PURE__ */ jsx29(CardContent, { className: "text-xs text-muted-foreground", children: safeJson2(content) })
|
|
6044
6370
|
] });
|
|
6045
6371
|
}
|
|
6046
|
-
return /* @__PURE__ */
|
|
6372
|
+
return /* @__PURE__ */ jsx29("figure", { className: "overflow-hidden rounded-lg border bg-background", children: /* @__PURE__ */ jsx29("img", { src: imageUrl, alt: "Assistant output", className: "h-auto w-full object-cover" }) });
|
|
6047
6373
|
}
|
|
6048
6374
|
function MemoryBlock({ content }) {
|
|
6049
|
-
return /* @__PURE__ */
|
|
6050
|
-
/* @__PURE__ */
|
|
6051
|
-
/* @__PURE__ */
|
|
6052
|
-
/* @__PURE__ */
|
|
6375
|
+
return /* @__PURE__ */ jsxs17(Card, { children: [
|
|
6376
|
+
/* @__PURE__ */ jsxs17(CardHeader, { className: "flex flex-row items-center justify-between gap-2", children: [
|
|
6377
|
+
/* @__PURE__ */ jsx29(CardTitle, { className: "text-sm", children: "Memory" }),
|
|
6378
|
+
/* @__PURE__ */ jsx29(Badge, { variant: "secondary", children: "Memory" })
|
|
6053
6379
|
] }),
|
|
6054
|
-
/* @__PURE__ */
|
|
6380
|
+
/* @__PURE__ */ jsx29(CardContent, { className: "text-xs text-muted-foreground", children: /* @__PURE__ */ jsx29("pre", { className: "whitespace-pre-wrap wrap-break-word", children: safeJson2(content.data ?? []) }) })
|
|
6055
6381
|
] });
|
|
6056
6382
|
}
|
|
6057
6383
|
function parseStepDate2(value) {
|
|
@@ -6085,11 +6411,11 @@ function formatStepDuration2(durationMs) {
|
|
|
6085
6411
|
}
|
|
6086
6412
|
function ComponentBlock({ content }) {
|
|
6087
6413
|
const { i18n: i18n2 } = useChatkitTranslation();
|
|
6088
|
-
const [isExpanded, setIsExpanded] =
|
|
6089
|
-
const contentRef =
|
|
6090
|
-
const shouldAutoScrollRef =
|
|
6091
|
-
const previousScrollTopRef =
|
|
6092
|
-
const [durationNow, setDurationNow] =
|
|
6414
|
+
const [isExpanded, setIsExpanded] = React23.useState(false);
|
|
6415
|
+
const contentRef = React23.useRef(null);
|
|
6416
|
+
const shouldAutoScrollRef = React23.useRef(true);
|
|
6417
|
+
const previousScrollTopRef = React23.useRef(0);
|
|
6418
|
+
const [durationNow, setDurationNow] = React23.useState(() => Date.now());
|
|
6093
6419
|
const data = getToolStepData(content);
|
|
6094
6420
|
const category = data.category ?? "Component";
|
|
6095
6421
|
const title = getToolActivityLabel(content, i18n2.language);
|
|
@@ -6103,10 +6429,10 @@ function ComponentBlock({ content }) {
|
|
|
6103
6429
|
const endedAt = parseStepDate2(data.end_date);
|
|
6104
6430
|
const durationMs = createdAt === null ? null : Math.max(0, (endedAt ?? durationNow) - createdAt);
|
|
6105
6431
|
const durationLabel = durationMs === null ? null : formatStepDuration2(durationMs);
|
|
6106
|
-
|
|
6432
|
+
React23.useEffect(() => {
|
|
6107
6433
|
if (status === "running" && output !== null) setIsExpanded(true);
|
|
6108
6434
|
}, [status, output]);
|
|
6109
|
-
|
|
6435
|
+
React23.useEffect(() => {
|
|
6110
6436
|
if (status !== "running" || createdAt === null || endedAt !== null) {
|
|
6111
6437
|
return;
|
|
6112
6438
|
}
|
|
@@ -6118,7 +6444,7 @@ function ComponentBlock({ content }) {
|
|
|
6118
6444
|
window.clearInterval(timer);
|
|
6119
6445
|
};
|
|
6120
6446
|
}, [createdAt, endedAt, status]);
|
|
6121
|
-
|
|
6447
|
+
React23.useEffect(() => {
|
|
6122
6448
|
const element = contentRef.current;
|
|
6123
6449
|
if (!element) return;
|
|
6124
6450
|
previousScrollTopRef.current = element.scrollTop;
|
|
@@ -6138,7 +6464,7 @@ function ComponentBlock({ content }) {
|
|
|
6138
6464
|
element.removeEventListener("scroll", updateAutoScrollState);
|
|
6139
6465
|
};
|
|
6140
6466
|
}, [isExpanded]);
|
|
6141
|
-
|
|
6467
|
+
React23.useEffect(() => {
|
|
6142
6468
|
if (status !== "running") {
|
|
6143
6469
|
shouldAutoScrollRef.current = true;
|
|
6144
6470
|
return;
|
|
@@ -6151,24 +6477,24 @@ function ComponentBlock({ content }) {
|
|
|
6151
6477
|
}, [isExpanded, output, status]);
|
|
6152
6478
|
const config = status ? toolStatusConfig[status] : null;
|
|
6153
6479
|
const StatusIcon = config?.icon;
|
|
6154
|
-
return /* @__PURE__ */
|
|
6155
|
-
/* @__PURE__ */
|
|
6156
|
-
/* @__PURE__ */
|
|
6157
|
-
status && StatusIcon && /* @__PURE__ */
|
|
6158
|
-
/* @__PURE__ */
|
|
6480
|
+
return /* @__PURE__ */ jsxs17(Card, { children: [
|
|
6481
|
+
/* @__PURE__ */ jsxs17(CardHeader, { className: "flex flex-row items-center justify-between gap-2 px-2 py-1 cursor-pointer", onClick: () => setIsExpanded(!isExpanded), children: [
|
|
6482
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex items-center space-x-1 flex-1 min-w-0", children: [
|
|
6483
|
+
status && StatusIcon && /* @__PURE__ */ jsx29(StatusIcon, { className: cn("h-4 w-4", config?.iconClass, status === "running" && "animate-spin") }),
|
|
6484
|
+
/* @__PURE__ */ jsx29(CardTitle, { className: "text-sm truncate", children: title })
|
|
6159
6485
|
] }),
|
|
6160
|
-
/* @__PURE__ */
|
|
6161
|
-
durationLabel && /* @__PURE__ */
|
|
6162
|
-
/* @__PURE__ */
|
|
6163
|
-
/* @__PURE__ */
|
|
6486
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex flex-wrap items-center gap-2 shrink-0", children: [
|
|
6487
|
+
durationLabel && /* @__PURE__ */ jsxs17("div", { className: "inline-flex items-center gap-1 text-[11px] text-muted-foreground tabular-nums", children: [
|
|
6488
|
+
/* @__PURE__ */ jsx29(Clock3, { className: "h-3 w-3" }),
|
|
6489
|
+
/* @__PURE__ */ jsx29("span", { children: durationLabel })
|
|
6164
6490
|
] }),
|
|
6165
|
-
/* @__PURE__ */
|
|
6166
|
-
/* @__PURE__ */
|
|
6491
|
+
/* @__PURE__ */ jsx29(Badge, { variant: "secondary", className: "rounded-lg px-1.5", children: category }),
|
|
6492
|
+
/* @__PURE__ */ jsx29(
|
|
6167
6493
|
"button",
|
|
6168
6494
|
{
|
|
6169
6495
|
className: "text-muted-foreground hover:text-foreground transition-colors",
|
|
6170
6496
|
"aria-label": isExpanded ? "Collapse" : "Expand",
|
|
6171
|
-
children: /* @__PURE__ */
|
|
6497
|
+
children: /* @__PURE__ */ jsx29(
|
|
6172
6498
|
ChevronDown2,
|
|
6173
6499
|
{
|
|
6174
6500
|
className: cn("h-4 w-4 transition-transform", isExpanded && "rotate-180")
|
|
@@ -6178,34 +6504,34 @@ function ComponentBlock({ content }) {
|
|
|
6178
6504
|
)
|
|
6179
6505
|
] })
|
|
6180
6506
|
] }),
|
|
6181
|
-
isExpanded && /* @__PURE__ */
|
|
6182
|
-
data.input && /* @__PURE__ */
|
|
6183
|
-
error ? /* @__PURE__ */
|
|
6507
|
+
isExpanded && /* @__PURE__ */ jsxs17(CardContent, { ref: contentRef, className: "text-xs text-muted-foreground max-h-60 overflow-auto", children: [
|
|
6508
|
+
data.input && /* @__PURE__ */ jsx29("pre", { className: "whitespace-pre-wrap wrap-break-word", children: formatDisplayValue2(data.input) }),
|
|
6509
|
+
error ? /* @__PURE__ */ jsx29("pre", { className: "whitespace-pre-wrap wrap-break-word text-destructive", children: formatDisplayValue2(error) }) : hasOutput && /* @__PURE__ */ jsx29("pre", { className: "whitespace-pre-wrap wrap-break-word", children: formatDisplayValue2(fallback) })
|
|
6184
6510
|
] })
|
|
6185
6511
|
] });
|
|
6186
6512
|
}
|
|
6187
6513
|
function UnknownBlock({ content }) {
|
|
6188
|
-
return /* @__PURE__ */
|
|
6189
|
-
/* @__PURE__ */
|
|
6190
|
-
/* @__PURE__ */
|
|
6191
|
-
/* @__PURE__ */
|
|
6514
|
+
return /* @__PURE__ */ jsxs17(Card, { children: [
|
|
6515
|
+
/* @__PURE__ */ jsxs17(CardHeader, { className: "flex flex-row items-center justify-between gap-2", children: [
|
|
6516
|
+
/* @__PURE__ */ jsx29(CardTitle, { className: "text-sm", children: "Assistant Content" }),
|
|
6517
|
+
/* @__PURE__ */ jsx29(Badge, { variant: "outline", children: content.type ?? "unknown" })
|
|
6192
6518
|
] }),
|
|
6193
|
-
/* @__PURE__ */
|
|
6519
|
+
/* @__PURE__ */ jsx29(CardContent, { className: "text-xs text-muted-foreground", children: /* @__PURE__ */ jsx29("pre", { className: "whitespace-pre-wrap break-words", children: safeJson2(content) }) })
|
|
6194
6520
|
] });
|
|
6195
6521
|
}
|
|
6196
6522
|
function renderContentItem(content, index, message, lookupMessages) {
|
|
6197
6523
|
const messageId = message.id;
|
|
6198
6524
|
if (typeof content === "string") {
|
|
6199
|
-
return /* @__PURE__ */
|
|
6525
|
+
return /* @__PURE__ */ jsx29("div", { children: /* @__PURE__ */ jsx29(MarkdownText, { children: content }) }, `text-${index}`);
|
|
6200
6526
|
}
|
|
6201
6527
|
if (isTextContent2(content)) {
|
|
6202
|
-
return /* @__PURE__ */
|
|
6528
|
+
return /* @__PURE__ */ jsx29("div", { children: /* @__PURE__ */ jsx29(MarkdownText, { children: content.text }) }, content.id ?? `text-${index}`);
|
|
6203
6529
|
}
|
|
6204
6530
|
if (isReasoningContent2(content)) {
|
|
6205
|
-
return /* @__PURE__ */
|
|
6531
|
+
return /* @__PURE__ */ jsx29("div", { children: /* @__PURE__ */ jsx29(ReasoningBlock, { reasoning: [content] }) }, content.id ?? `reasoning-${index}`);
|
|
6206
6532
|
}
|
|
6207
6533
|
if (isImageContent(content)) {
|
|
6208
|
-
return /* @__PURE__ */
|
|
6534
|
+
return /* @__PURE__ */ jsx29("div", { children: /* @__PURE__ */ jsx29(ImageBlock, { content }) }, content.id ?? `image-${index}`);
|
|
6209
6535
|
}
|
|
6210
6536
|
if (isComponentContent2(content)) {
|
|
6211
6537
|
const requestUserInputResult = getRequestUserInputResultCardData(
|
|
@@ -6213,26 +6539,26 @@ function renderContentItem(content, index, message, lookupMessages) {
|
|
|
6213
6539
|
lookupMessages
|
|
6214
6540
|
);
|
|
6215
6541
|
if (requestUserInputResult) {
|
|
6216
|
-
return /* @__PURE__ */
|
|
6542
|
+
return /* @__PURE__ */ jsx29("div", { children: /* @__PURE__ */ jsx29(RequestUserInputResultCard, { result: requestUserInputResult }) }, content.id ?? `request-user-input-result-${index}`);
|
|
6217
6543
|
}
|
|
6218
6544
|
if (isWidgetComponent2(content)) {
|
|
6219
|
-
return /* @__PURE__ */
|
|
6545
|
+
return /* @__PURE__ */ jsx29("div", { children: /* @__PURE__ */ jsx29(WidgetMessage, { messageId, data: content.data }) }, content.id ?? `widget-${index}`);
|
|
6220
6546
|
}
|
|
6221
|
-
return /* @__PURE__ */
|
|
6547
|
+
return /* @__PURE__ */ jsx29("div", { children: /* @__PURE__ */ jsx29(ComponentBlock, { content }) }, content.id ?? `component-${index}`);
|
|
6222
6548
|
}
|
|
6223
6549
|
if (isMemoryContent(content)) {
|
|
6224
|
-
return /* @__PURE__ */
|
|
6550
|
+
return /* @__PURE__ */ jsx29("div", { children: /* @__PURE__ */ jsx29(MemoryBlock, { content }) }, content.id ?? `memory-${index}`);
|
|
6225
6551
|
}
|
|
6226
|
-
return /* @__PURE__ */
|
|
6552
|
+
return /* @__PURE__ */ jsx29("div", { children: /* @__PURE__ */ jsx29(UnknownBlock, { content }) }, content.id ?? `unknown-${index}`);
|
|
6227
6553
|
}
|
|
6228
6554
|
function renderContentUnit(unit, message, lookupMessages, hasFollowingItem) {
|
|
6229
6555
|
if (unit.type === "item") {
|
|
6230
6556
|
return renderContentItem(unit.item, unit.index, message, lookupMessages);
|
|
6231
6557
|
}
|
|
6232
|
-
return /* @__PURE__ */
|
|
6558
|
+
return /* @__PURE__ */ jsx29(
|
|
6233
6559
|
"div",
|
|
6234
6560
|
{
|
|
6235
|
-
children: /* @__PURE__ */
|
|
6561
|
+
children: /* @__PURE__ */ jsx29(ToolComponentGroup, { items: unit.items, hasFollowingItem })
|
|
6236
6562
|
},
|
|
6237
6563
|
`tool-group-${unit.startIndex}-${unit.items[0]?.id ?? "tool"}-${unit.items.length}`
|
|
6238
6564
|
);
|
|
@@ -6241,13 +6567,13 @@ function renderContent(message, lookupMessages) {
|
|
|
6241
6567
|
const content = message.content;
|
|
6242
6568
|
if (typeof content === "string") {
|
|
6243
6569
|
if (!content.trim()) return null;
|
|
6244
|
-
return /* @__PURE__ */
|
|
6570
|
+
return /* @__PURE__ */ jsx29(MarkdownText, { children: content });
|
|
6245
6571
|
}
|
|
6246
6572
|
if (!Array.isArray(content) || content.length === 0) return null;
|
|
6247
6573
|
const renderUnits = buildToolComponentRenderUnits(content, {
|
|
6248
6574
|
shouldGroupComponent: (item) => getRequestUserInputResultCardData(item, lookupMessages) === null
|
|
6249
6575
|
});
|
|
6250
|
-
return /* @__PURE__ */
|
|
6576
|
+
return /* @__PURE__ */ jsx29("div", { className: "space-y-3", children: renderUnits.map(
|
|
6251
6577
|
(unit, index) => renderContentUnit(
|
|
6252
6578
|
unit,
|
|
6253
6579
|
message,
|
|
@@ -6266,19 +6592,19 @@ function AssistantStreamingIndicator({
|
|
|
6266
6592
|
thinking: t("message.thinking"),
|
|
6267
6593
|
answering: t("message.answering")
|
|
6268
6594
|
};
|
|
6269
|
-
return /* @__PURE__ */
|
|
6270
|
-
status === "loading" && /* @__PURE__ */
|
|
6271
|
-
status === "thinking" && /* @__PURE__ */
|
|
6272
|
-
/* @__PURE__ */
|
|
6273
|
-
/* @__PURE__ */
|
|
6274
|
-
/* @__PURE__ */
|
|
6595
|
+
return /* @__PURE__ */ jsxs17("div", { className: cn("flex items-center gap-2 text-xs text-muted-foreground", className), children: [
|
|
6596
|
+
status === "loading" && /* @__PURE__ */ jsx29(Loader23, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
6597
|
+
status === "thinking" && /* @__PURE__ */ jsxs17("div", { className: "flex items-end gap-1", "aria-hidden": "true", children: [
|
|
6598
|
+
/* @__PURE__ */ jsx29("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:-0.3s]" }),
|
|
6599
|
+
/* @__PURE__ */ jsx29("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:-0.15s]" }),
|
|
6600
|
+
/* @__PURE__ */ jsx29("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce" })
|
|
6275
6601
|
] }),
|
|
6276
|
-
status === "answering" && /* @__PURE__ */
|
|
6277
|
-
/* @__PURE__ */
|
|
6278
|
-
/* @__PURE__ */
|
|
6279
|
-
/* @__PURE__ */
|
|
6602
|
+
status === "answering" && /* @__PURE__ */ jsxs17("div", { className: "flex items-end gap-1", "aria-hidden": "true", children: [
|
|
6603
|
+
/* @__PURE__ */ jsx29("span", { className: "h-2 w-0.5 rounded-full bg-current animate-pulse [animation-delay:-0.25s]" }),
|
|
6604
|
+
/* @__PURE__ */ jsx29("span", { className: "h-3 w-0.5 rounded-full bg-current animate-pulse [animation-delay:-0.1s]" }),
|
|
6605
|
+
/* @__PURE__ */ jsx29("span", { className: "h-2.5 w-0.5 rounded-full bg-current animate-pulse" })
|
|
6280
6606
|
] }),
|
|
6281
|
-
/* @__PURE__ */
|
|
6607
|
+
/* @__PURE__ */ jsx29("span", { children: labelMap[status] })
|
|
6282
6608
|
] });
|
|
6283
6609
|
}
|
|
6284
6610
|
function AssistantMessage({
|
|
@@ -6294,42 +6620,42 @@ function AssistantMessage({
|
|
|
6294
6620
|
const resolvedStreamingStatus = streamingStatus ?? getAssistantStreamingStatus(message, isStreaming);
|
|
6295
6621
|
const lookupMessages = messages?.length ? messages : [message];
|
|
6296
6622
|
const answerNode = renderContent(message, lookupMessages);
|
|
6297
|
-
const reasoningNode = hasReasoning ? /* @__PURE__ */
|
|
6623
|
+
const reasoningNode = hasReasoning ? /* @__PURE__ */ jsx29(ReasoningBlock, { reasoning: message.reasoning ?? [] }) : null;
|
|
6298
6624
|
if (!hasRenderableAssistantMessage(message) && !resolvedStreamingStatus) return null;
|
|
6299
6625
|
const streamingClass = isStreaming ? "streaming-active" : "";
|
|
6300
6626
|
if (!hasRenderableAssistantMessage(message) && resolvedStreamingStatus) {
|
|
6301
|
-
return /* @__PURE__ */
|
|
6627
|
+
return /* @__PURE__ */ jsx29("div", { className: cn("space-y-3", streamingClass, className), children: /* @__PURE__ */ jsx29(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) });
|
|
6302
6628
|
}
|
|
6303
6629
|
if (hasContent && hasReasoning) {
|
|
6304
|
-
return /* @__PURE__ */
|
|
6305
|
-
/* @__PURE__ */
|
|
6630
|
+
return /* @__PURE__ */ jsxs17("div", { className: cn("space-y-3", streamingClass, className), children: [
|
|
6631
|
+
/* @__PURE__ */ jsxs17(
|
|
6306
6632
|
Tabs,
|
|
6307
6633
|
{
|
|
6308
6634
|
defaultValue: message.status === "reasoning" ? "reasoning" : "answer",
|
|
6309
6635
|
className: "w-full",
|
|
6310
6636
|
children: [
|
|
6311
|
-
/* @__PURE__ */
|
|
6312
|
-
/* @__PURE__ */
|
|
6313
|
-
/* @__PURE__ */
|
|
6637
|
+
/* @__PURE__ */ jsxs17(TabsList, { className: "", children: [
|
|
6638
|
+
/* @__PURE__ */ jsx29(TabsTrigger, { value: "answer", children: t("message.answer") }),
|
|
6639
|
+
/* @__PURE__ */ jsx29(TabsTrigger, { value: "reasoning", children: t("message.reasoning") })
|
|
6314
6640
|
] }),
|
|
6315
|
-
/* @__PURE__ */
|
|
6316
|
-
/* @__PURE__ */
|
|
6641
|
+
/* @__PURE__ */ jsx29(TabsContent, { value: "answer", className: "space-y-3", children: answerNode }),
|
|
6642
|
+
/* @__PURE__ */ jsx29(TabsContent, { value: "reasoning", className: "space-y-3", children: reasoningNode })
|
|
6317
6643
|
]
|
|
6318
6644
|
}
|
|
6319
6645
|
),
|
|
6320
|
-
resolvedStreamingStatus ? /* @__PURE__ */
|
|
6646
|
+
resolvedStreamingStatus ? /* @__PURE__ */ jsx29(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) : null
|
|
6321
6647
|
] });
|
|
6322
6648
|
}
|
|
6323
|
-
return /* @__PURE__ */
|
|
6649
|
+
return /* @__PURE__ */ jsxs17("div", { className: cn("space-y-3", streamingClass, className), children: [
|
|
6324
6650
|
hasReasoning ? reasoningNode : answerNode,
|
|
6325
|
-
resolvedStreamingStatus ? /* @__PURE__ */
|
|
6651
|
+
resolvedStreamingStatus ? /* @__PURE__ */ jsx29(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) : null
|
|
6326
6652
|
] });
|
|
6327
6653
|
}
|
|
6328
6654
|
|
|
6329
6655
|
// src/components/thread/MessageActions.tsx
|
|
6330
|
-
import * as
|
|
6656
|
+
import * as React24 from "react";
|
|
6331
6657
|
import { Check as Check3, Copy as Copy2, RefreshCw } from "lucide-react";
|
|
6332
|
-
import { jsx as
|
|
6658
|
+
import { jsx as jsx30, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
6333
6659
|
function MessageActions({
|
|
6334
6660
|
content,
|
|
6335
6661
|
isAssistant = false,
|
|
@@ -6338,7 +6664,7 @@ function MessageActions({
|
|
|
6338
6664
|
className
|
|
6339
6665
|
}) {
|
|
6340
6666
|
const { t } = useChatkitTranslation();
|
|
6341
|
-
const [copied, setCopied] =
|
|
6667
|
+
const [copied, setCopied] = React24.useState(false);
|
|
6342
6668
|
const handleCopy = async () => {
|
|
6343
6669
|
try {
|
|
6344
6670
|
await navigator.clipboard.writeText(content);
|
|
@@ -6351,7 +6677,7 @@ function MessageActions({
|
|
|
6351
6677
|
if (isStreaming) {
|
|
6352
6678
|
return null;
|
|
6353
6679
|
}
|
|
6354
|
-
return /* @__PURE__ */
|
|
6680
|
+
return /* @__PURE__ */ jsxs18(
|
|
6355
6681
|
"div",
|
|
6356
6682
|
{
|
|
6357
6683
|
className: cn(
|
|
@@ -6359,7 +6685,7 @@ function MessageActions({
|
|
|
6359
6685
|
className
|
|
6360
6686
|
),
|
|
6361
6687
|
children: [
|
|
6362
|
-
/* @__PURE__ */
|
|
6688
|
+
/* @__PURE__ */ jsx30(
|
|
6363
6689
|
"button",
|
|
6364
6690
|
{
|
|
6365
6691
|
type: "button",
|
|
@@ -6369,17 +6695,17 @@ function MessageActions({
|
|
|
6369
6695
|
copied && "text-green-500"
|
|
6370
6696
|
),
|
|
6371
6697
|
title: copied ? t("messageActions.copied") : t("messageActions.copy"),
|
|
6372
|
-
children: copied ? /* @__PURE__ */
|
|
6698
|
+
children: copied ? /* @__PURE__ */ jsx30(Check3, { size: 14 }) : /* @__PURE__ */ jsx30(Copy2, { size: 14 })
|
|
6373
6699
|
}
|
|
6374
6700
|
),
|
|
6375
|
-
isAssistant && onRetry && /* @__PURE__ */
|
|
6701
|
+
isAssistant && onRetry && /* @__PURE__ */ jsx30(
|
|
6376
6702
|
"button",
|
|
6377
6703
|
{
|
|
6378
6704
|
type: "button",
|
|
6379
6705
|
onClick: onRetry,
|
|
6380
6706
|
className: "p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",
|
|
6381
6707
|
title: t("messageActions.regenerate"),
|
|
6382
|
-
children: /* @__PURE__ */
|
|
6708
|
+
children: /* @__PURE__ */ jsx30(RefreshCw, { size: 14 })
|
|
6383
6709
|
}
|
|
6384
6710
|
)
|
|
6385
6711
|
]
|
|
@@ -6400,18 +6726,18 @@ import {
|
|
|
6400
6726
|
Sparkles as Sparkles2,
|
|
6401
6727
|
Zap
|
|
6402
6728
|
} from "lucide-react";
|
|
6403
|
-
import { jsx as
|
|
6729
|
+
import { jsx as jsx31, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
6404
6730
|
function getIconComponent2(icon) {
|
|
6405
6731
|
const iconMap = {
|
|
6406
|
-
"circle-question": /* @__PURE__ */
|
|
6407
|
-
"lightbulb": /* @__PURE__ */
|
|
6408
|
-
"sparkle": /* @__PURE__ */
|
|
6409
|
-
"write": /* @__PURE__ */
|
|
6410
|
-
"search": /* @__PURE__ */
|
|
6411
|
-
"globe": /* @__PURE__ */
|
|
6412
|
-
"book-open": /* @__PURE__ */
|
|
6413
|
-
"compass": /* @__PURE__ */
|
|
6414
|
-
"bolt": /* @__PURE__ */
|
|
6732
|
+
"circle-question": /* @__PURE__ */ jsx31(HelpCircle, { size: 20 }),
|
|
6733
|
+
"lightbulb": /* @__PURE__ */ jsx31(Lightbulb2, { size: 20 }),
|
|
6734
|
+
"sparkle": /* @__PURE__ */ jsx31(Sparkles2, { size: 20 }),
|
|
6735
|
+
"write": /* @__PURE__ */ jsx31(Pencil2, { size: 20 }),
|
|
6736
|
+
"search": /* @__PURE__ */ jsx31(Search2, { size: 20 }),
|
|
6737
|
+
"globe": /* @__PURE__ */ jsx31(Globe2, { size: 20 }),
|
|
6738
|
+
"book-open": /* @__PURE__ */ jsx31(BookOpen, { size: 20 }),
|
|
6739
|
+
"compass": /* @__PURE__ */ jsx31(Compass, { size: 20 }),
|
|
6740
|
+
"bolt": /* @__PURE__ */ jsx31(Zap, { size: 20 })
|
|
6415
6741
|
};
|
|
6416
6742
|
return icon ? iconMap[icon] || iconMap["sparkle"] : iconMap["sparkle"];
|
|
6417
6743
|
}
|
|
@@ -6419,9 +6745,9 @@ function StartScreen({ startScreen, onPromptClick, className }) {
|
|
|
6419
6745
|
const { t } = useChatkitTranslation();
|
|
6420
6746
|
const greeting = startScreen?.greeting ?? t("startScreen.greeting");
|
|
6421
6747
|
const prompts = startScreen?.prompts ?? [];
|
|
6422
|
-
return /* @__PURE__ */
|
|
6423
|
-
/* @__PURE__ */
|
|
6424
|
-
prompts.length > 0 && /* @__PURE__ */
|
|
6748
|
+
return /* @__PURE__ */ jsxs19("div", { className: cn("flex flex-col items-center justify-center py-12 px-4", className), children: [
|
|
6749
|
+
/* @__PURE__ */ jsx31("div", { className: "mb-8 text-center", children: /* @__PURE__ */ jsx31("h2", { className: "text-2xl font-semibold text-foreground mb-2", children: greeting }) }),
|
|
6750
|
+
prompts.length > 0 && /* @__PURE__ */ jsx31("div", { className: "w-full max-w-2xl", children: /* @__PURE__ */ jsx31("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: prompts.map((item, index) => /* @__PURE__ */ jsxs19(
|
|
6425
6751
|
"button",
|
|
6426
6752
|
{
|
|
6427
6753
|
type: "button",
|
|
@@ -6432,8 +6758,8 @@ function StartScreen({ startScreen, onPromptClick, className }) {
|
|
|
6432
6758
|
"focus:outline-none focus:ring-2 focus:ring-primary/20"
|
|
6433
6759
|
),
|
|
6434
6760
|
children: [
|
|
6435
|
-
/* @__PURE__ */
|
|
6436
|
-
/* @__PURE__ */
|
|
6761
|
+
/* @__PURE__ */ jsx31("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary", children: getIconComponent2(item.icon) }),
|
|
6762
|
+
/* @__PURE__ */ jsx31("span", { className: "text-sm font-medium text-foreground", children: item.label })
|
|
6437
6763
|
]
|
|
6438
6764
|
},
|
|
6439
6765
|
`prompt-${index}`
|
|
@@ -6441,134 +6767,6 @@ function StartScreen({ startScreen, onPromptClick, className }) {
|
|
|
6441
6767
|
] });
|
|
6442
6768
|
}
|
|
6443
6769
|
|
|
6444
|
-
// src/components/ui/chatkit-avatar.tsx
|
|
6445
|
-
import "react";
|
|
6446
|
-
|
|
6447
|
-
// src/components/ui/avatar.tsx
|
|
6448
|
-
import * as React24 from "react";
|
|
6449
|
-
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
6450
|
-
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
6451
|
-
var Avatar = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx30(
|
|
6452
|
-
AvatarPrimitive.Root,
|
|
6453
|
-
{
|
|
6454
|
-
ref,
|
|
6455
|
-
className: cn(
|
|
6456
|
-
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
|
6457
|
-
className
|
|
6458
|
-
),
|
|
6459
|
-
...props
|
|
6460
|
-
}
|
|
6461
|
-
));
|
|
6462
|
-
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
6463
|
-
var AvatarImage = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx30(
|
|
6464
|
-
AvatarPrimitive.Image,
|
|
6465
|
-
{
|
|
6466
|
-
ref,
|
|
6467
|
-
className: cn("aspect-square h-full w-full", className),
|
|
6468
|
-
...props
|
|
6469
|
-
}
|
|
6470
|
-
));
|
|
6471
|
-
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
6472
|
-
var AvatarFallback = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx30(
|
|
6473
|
-
AvatarPrimitive.Fallback,
|
|
6474
|
-
{
|
|
6475
|
-
ref,
|
|
6476
|
-
className: cn(
|
|
6477
|
-
"flex h-full w-full items-center justify-center rounded-full bg-muted",
|
|
6478
|
-
className
|
|
6479
|
-
),
|
|
6480
|
-
...props
|
|
6481
|
-
}
|
|
6482
|
-
));
|
|
6483
|
-
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
6484
|
-
|
|
6485
|
-
// src/components/ui/chatkit-avatar.tsx
|
|
6486
|
-
import { jsx as jsx31, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
6487
|
-
function asRecord(value) {
|
|
6488
|
-
return value && typeof value === "object" ? value : null;
|
|
6489
|
-
}
|
|
6490
|
-
function getNonEmptyString(value) {
|
|
6491
|
-
if (typeof value !== "string") return void 0;
|
|
6492
|
-
const normalized = value.trim();
|
|
6493
|
-
return normalized || void 0;
|
|
6494
|
-
}
|
|
6495
|
-
function unicodeFromUnified(unified) {
|
|
6496
|
-
const normalized = getNonEmptyString(unified);
|
|
6497
|
-
if (!normalized) return void 0;
|
|
6498
|
-
try {
|
|
6499
|
-
return normalized.split("-").map((hex) => String.fromCodePoint(Number.parseInt(hex, 16))).join("");
|
|
6500
|
-
} catch {
|
|
6501
|
-
return void 0;
|
|
6502
|
-
}
|
|
6503
|
-
}
|
|
6504
|
-
function getEmojiCharacter(avatar) {
|
|
6505
|
-
return unicodeFromUnified(avatar?.emoji?.unified);
|
|
6506
|
-
}
|
|
6507
|
-
function getAvatarFallback(label) {
|
|
6508
|
-
return label.trim().charAt(0).toUpperCase() || "A";
|
|
6509
|
-
}
|
|
6510
|
-
function normalizeChatkitAvatar(rawAvatar) {
|
|
6511
|
-
if (typeof rawAvatar === "string") {
|
|
6512
|
-
const url = getNonEmptyString(rawAvatar);
|
|
6513
|
-
return url ? { url } : null;
|
|
6514
|
-
}
|
|
6515
|
-
const avatarRecord = asRecord(rawAvatar);
|
|
6516
|
-
if (!avatarRecord) return null;
|
|
6517
|
-
const emojiRecord = asRecord(avatarRecord.emoji);
|
|
6518
|
-
const avatar = {
|
|
6519
|
-
background: getNonEmptyString(avatarRecord.background),
|
|
6520
|
-
url: getNonEmptyString(avatarRecord.url),
|
|
6521
|
-
useNotoColor: Boolean(avatarRecord.useNotoColor)
|
|
6522
|
-
};
|
|
6523
|
-
if (emojiRecord) {
|
|
6524
|
-
avatar.emoji = {
|
|
6525
|
-
colons: getNonEmptyString(emojiRecord.colons),
|
|
6526
|
-
id: getNonEmptyString(emojiRecord.id),
|
|
6527
|
-
unified: getNonEmptyString(emojiRecord.unified)
|
|
6528
|
-
};
|
|
6529
|
-
}
|
|
6530
|
-
return avatar.url || avatar.background || avatar.emoji?.id || avatar.emoji?.unified ? avatar : null;
|
|
6531
|
-
}
|
|
6532
|
-
function extractAssistantAvatar(assistant) {
|
|
6533
|
-
const assistantRecord = asRecord(assistant);
|
|
6534
|
-
const metadata = asRecord(assistant.metadata);
|
|
6535
|
-
const rawAvatar = assistantRecord?.avatar ?? metadata?.avatar;
|
|
6536
|
-
const avatar = normalizeChatkitAvatar(rawAvatar);
|
|
6537
|
-
if (avatar) return avatar;
|
|
6538
|
-
const metadataAvatar = getNonEmptyString(metadata?.avatarUrl) ?? getNonEmptyString(metadata?.avatar_url);
|
|
6539
|
-
return metadataAvatar ? { url: metadataAvatar } : null;
|
|
6540
|
-
}
|
|
6541
|
-
function ChatkitAvatar({
|
|
6542
|
-
avatar,
|
|
6543
|
-
className,
|
|
6544
|
-
fallback,
|
|
6545
|
-
fallbackClassName,
|
|
6546
|
-
imageClassName,
|
|
6547
|
-
label,
|
|
6548
|
-
style,
|
|
6549
|
-
...props
|
|
6550
|
-
}) {
|
|
6551
|
-
const { theme } = useTheme();
|
|
6552
|
-
const emojiCharacter = getEmojiCharacter(avatar);
|
|
6553
|
-
const fallbackText = fallback || getAvatarFallback(label);
|
|
6554
|
-
const roundedClass = getRoundedClass(theme.radius);
|
|
6555
|
-
const emojiStyle = avatar?.useNotoColor ? { fontFamily: '"Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", sans-serif' } : void 0;
|
|
6556
|
-
const fallbackStyle = {
|
|
6557
|
-
...avatar?.background ? { background: avatar.background } : {}
|
|
6558
|
-
};
|
|
6559
|
-
return /* @__PURE__ */ jsxs19(Avatar, { className: cn(roundedClass, className), style, ...props, children: [
|
|
6560
|
-
avatar?.url ? /* @__PURE__ */ jsx31(AvatarImage, { className: imageClassName, src: avatar.url, alt: label }) : null,
|
|
6561
|
-
/* @__PURE__ */ jsx31(
|
|
6562
|
-
AvatarFallback,
|
|
6563
|
-
{
|
|
6564
|
-
className: cn(roundedClass, "text-sm font-medium text-foreground", fallbackClassName),
|
|
6565
|
-
style: fallbackStyle,
|
|
6566
|
-
children: emojiCharacter ? /* @__PURE__ */ jsx31("span", { className: "text-[1.1em] leading-none", style: emojiStyle, children: emojiCharacter }) : fallbackText
|
|
6567
|
-
}
|
|
6568
|
-
)
|
|
6569
|
-
] });
|
|
6570
|
-
}
|
|
6571
|
-
|
|
6572
6770
|
// src/hooks/useThreads.ts
|
|
6573
6771
|
import * as React26 from "react";
|
|
6574
6772
|
var DEFAULT_LIMIT = 50;
|
|
@@ -6940,8 +7138,173 @@ function ContextUsageIndicator({
|
|
|
6940
7138
|
] });
|
|
6941
7139
|
}
|
|
6942
7140
|
|
|
7141
|
+
// src/lib/conversation-runtime-capabilities.ts
|
|
7142
|
+
var emptyMissingRuntimeCapabilityReferences = {
|
|
7143
|
+
skillIds: [],
|
|
7144
|
+
pluginNodeKeys: [],
|
|
7145
|
+
subAgentNodeKeys: []
|
|
7146
|
+
};
|
|
7147
|
+
function getConversationOptions(conversation) {
|
|
7148
|
+
return conversation?.options ?? null;
|
|
7149
|
+
}
|
|
7150
|
+
function wait(ms) {
|
|
7151
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
7152
|
+
}
|
|
7153
|
+
function splitByAvailability(values, availableValues) {
|
|
7154
|
+
const available = new Set(availableValues);
|
|
7155
|
+
const found = [];
|
|
7156
|
+
const missing = [];
|
|
7157
|
+
for (const value of values) {
|
|
7158
|
+
if (available.has(value)) {
|
|
7159
|
+
found.push(value);
|
|
7160
|
+
} else {
|
|
7161
|
+
missing.push(value);
|
|
7162
|
+
}
|
|
7163
|
+
}
|
|
7164
|
+
return { found, missing };
|
|
7165
|
+
}
|
|
7166
|
+
function hasMissingRuntimeCapabilityReferences(missing) {
|
|
7167
|
+
return missing.skillIds.length > 0 || missing.pluginNodeKeys.length > 0 || missing.subAgentNodeKeys.length > 0;
|
|
7168
|
+
}
|
|
7169
|
+
function getRuntimeCapabilitiesSelectionAvailability(selection, capabilities) {
|
|
7170
|
+
const skillIds = splitByAvailability(
|
|
7171
|
+
selection.skills.ids,
|
|
7172
|
+
capabilities.skills.map((skill) => skill.id)
|
|
7173
|
+
);
|
|
7174
|
+
const pluginNodeKeys = splitByAvailability(
|
|
7175
|
+
selection.plugins.nodeKeys,
|
|
7176
|
+
capabilities.plugins.map((plugin) => plugin.nodeKey)
|
|
7177
|
+
);
|
|
7178
|
+
const subAgentNodeKeys = splitByAvailability(
|
|
7179
|
+
selection.subAgents?.nodeKeys ?? [],
|
|
7180
|
+
capabilities.subAgents?.map((subAgent) => subAgent.nodeKey) ?? []
|
|
7181
|
+
);
|
|
7182
|
+
return {
|
|
7183
|
+
selection: {
|
|
7184
|
+
mode: "allowlist",
|
|
7185
|
+
skills: {
|
|
7186
|
+
...selection.skills.workspaceId ? { workspaceId: selection.skills.workspaceId } : {},
|
|
7187
|
+
ids: skillIds.found
|
|
7188
|
+
},
|
|
7189
|
+
plugins: {
|
|
7190
|
+
nodeKeys: pluginNodeKeys.found
|
|
7191
|
+
},
|
|
7192
|
+
subAgents: {
|
|
7193
|
+
nodeKeys: subAgentNodeKeys.found
|
|
7194
|
+
}
|
|
7195
|
+
},
|
|
7196
|
+
missing: {
|
|
7197
|
+
skillIds: skillIds.missing,
|
|
7198
|
+
pluginNodeKeys: pluginNodeKeys.missing,
|
|
7199
|
+
subAgentNodeKeys: subAgentNodeKeys.missing
|
|
7200
|
+
}
|
|
7201
|
+
};
|
|
7202
|
+
}
|
|
7203
|
+
async function findConversationByThreadId(client, threadId) {
|
|
7204
|
+
const normalizedThreadId = threadId.trim();
|
|
7205
|
+
if (!normalizedThreadId) {
|
|
7206
|
+
return null;
|
|
7207
|
+
}
|
|
7208
|
+
const result = await client.conversations.search({
|
|
7209
|
+
where: { threadId: normalizedThreadId },
|
|
7210
|
+
limit: 1
|
|
7211
|
+
});
|
|
7212
|
+
return result.items?.[0] ?? null;
|
|
7213
|
+
}
|
|
7214
|
+
async function findConversationByThreadIdWithRetry(client, threadId) {
|
|
7215
|
+
for (let attempt = 0; attempt < 5; attempt += 1) {
|
|
7216
|
+
const conversation = await findConversationByThreadId(client, threadId);
|
|
7217
|
+
if (conversation?.id) {
|
|
7218
|
+
return conversation;
|
|
7219
|
+
}
|
|
7220
|
+
if (attempt < 4) {
|
|
7221
|
+
await wait(250);
|
|
7222
|
+
}
|
|
7223
|
+
}
|
|
7224
|
+
return null;
|
|
7225
|
+
}
|
|
7226
|
+
async function loadConversationRuntimeCapabilities({
|
|
7227
|
+
client,
|
|
7228
|
+
threadId,
|
|
7229
|
+
capabilities
|
|
7230
|
+
}) {
|
|
7231
|
+
const conversation = await findConversationByThreadId(client, threadId);
|
|
7232
|
+
const persistedSelection = getConversationOptions(conversation)?.runtimeCapabilities ?? null;
|
|
7233
|
+
if (!persistedSelection) {
|
|
7234
|
+
return {
|
|
7235
|
+
conversation,
|
|
7236
|
+
selection: null,
|
|
7237
|
+
missing: emptyMissingRuntimeCapabilityReferences
|
|
7238
|
+
};
|
|
7239
|
+
}
|
|
7240
|
+
const availability = getRuntimeCapabilitiesSelectionAvailability(
|
|
7241
|
+
persistedSelection,
|
|
7242
|
+
capabilities
|
|
7243
|
+
);
|
|
7244
|
+
return {
|
|
7245
|
+
conversation,
|
|
7246
|
+
...availability
|
|
7247
|
+
};
|
|
7248
|
+
}
|
|
7249
|
+
async function persistConversationRuntimeCapabilities({
|
|
7250
|
+
client,
|
|
7251
|
+
threadId,
|
|
7252
|
+
capabilities,
|
|
7253
|
+
selection
|
|
7254
|
+
}) {
|
|
7255
|
+
const availability = getRuntimeCapabilitiesSelectionAvailability(
|
|
7256
|
+
selection,
|
|
7257
|
+
capabilities
|
|
7258
|
+
);
|
|
7259
|
+
const conversation = await findConversationByThreadIdWithRetry(
|
|
7260
|
+
client,
|
|
7261
|
+
threadId
|
|
7262
|
+
);
|
|
7263
|
+
if (!conversation?.id) {
|
|
7264
|
+
return {
|
|
7265
|
+
conversation,
|
|
7266
|
+
...availability,
|
|
7267
|
+
updated: false
|
|
7268
|
+
};
|
|
7269
|
+
}
|
|
7270
|
+
await client.conversations.update(conversation.id, {
|
|
7271
|
+
options: {
|
|
7272
|
+
...conversation.options ?? {},
|
|
7273
|
+
runtimeCapabilities: availability.selection
|
|
7274
|
+
}
|
|
7275
|
+
});
|
|
7276
|
+
return {
|
|
7277
|
+
conversation,
|
|
7278
|
+
...availability,
|
|
7279
|
+
updated: true
|
|
7280
|
+
};
|
|
7281
|
+
}
|
|
7282
|
+
|
|
6943
7283
|
// src/components/chat.tsx
|
|
6944
7284
|
import { Fragment as Fragment4, jsx as jsx34, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
7285
|
+
function RuntimeCapabilityIcon({
|
|
7286
|
+
option,
|
|
7287
|
+
variant
|
|
7288
|
+
}) {
|
|
7289
|
+
const iconSize = variant === "chip" ? 12 : 16;
|
|
7290
|
+
if (option.type === "skill") {
|
|
7291
|
+
return /* @__PURE__ */ jsx34(Brain2, { size: iconSize });
|
|
7292
|
+
}
|
|
7293
|
+
if (option.type === "plugin") {
|
|
7294
|
+
return /* @__PURE__ */ jsx34(Plug2, { size: iconSize });
|
|
7295
|
+
}
|
|
7296
|
+
return /* @__PURE__ */ jsx34(
|
|
7297
|
+
ChatkitAvatar,
|
|
7298
|
+
{
|
|
7299
|
+
avatar: normalizeChatkitAvatar(option.capability.avatar),
|
|
7300
|
+
label: option.label,
|
|
7301
|
+
className: variant === "chip" ? "h-4 w-4" : "h-6 w-6",
|
|
7302
|
+
fallbackClassName: variant === "chip" ? "text-[9px]" : "text-[10px]",
|
|
7303
|
+
imageClassName: "object-cover",
|
|
7304
|
+
"data-slot": "runtime-sub-agent-avatar"
|
|
7305
|
+
}
|
|
7306
|
+
);
|
|
7307
|
+
}
|
|
6945
7308
|
var defaultApiUrl2 = import.meta.env.VITE_XPERTAI_API_URL;
|
|
6946
7309
|
var COMPOSER_INPUT_MAX_HEIGHT = 128;
|
|
6947
7310
|
var LONG_TEXT_REFERENCE_THRESHOLD = 5e3;
|
|
@@ -6978,6 +7341,15 @@ function getHttpStatus(error) {
|
|
|
6978
7341
|
const status = error.status;
|
|
6979
7342
|
return typeof status === "number" ? status : null;
|
|
6980
7343
|
}
|
|
7344
|
+
function warnMissingRuntimeCapabilityReferences(action, missing) {
|
|
7345
|
+
if (!hasMissingRuntimeCapabilityReferences(missing)) {
|
|
7346
|
+
return;
|
|
7347
|
+
}
|
|
7348
|
+
console.warn(
|
|
7349
|
+
`[Chat] Runtime capabilities ${action} include unavailable references:`,
|
|
7350
|
+
missing
|
|
7351
|
+
);
|
|
7352
|
+
}
|
|
6981
7353
|
async function readImageDimensions(file) {
|
|
6982
7354
|
if (typeof window === "undefined" || typeof URL === "undefined") {
|
|
6983
7355
|
return {};
|
|
@@ -7233,6 +7605,7 @@ function Chat({
|
|
|
7233
7605
|
const autoScrollFrameRef = React28.useRef(null);
|
|
7234
7606
|
const isPointerDownRef = React28.useRef(false);
|
|
7235
7607
|
const lastTouchYRef = React28.useRef(null);
|
|
7608
|
+
const runtimeCapabilityPreferenceLoadRef = React28.useRef(0);
|
|
7236
7609
|
const resolvedTitle = title ?? t("chat.title");
|
|
7237
7610
|
const resolvedPlaceholder = placeholder ?? t("chat.placeholder");
|
|
7238
7611
|
const inputPlaceholder = selectedTool?.placeholderOverride ?? composer?.placeholder ?? resolvedPlaceholder;
|
|
@@ -7309,6 +7682,31 @@ function Chat({
|
|
|
7309
7682
|
runtimeCapabilityOptions,
|
|
7310
7683
|
runtimeCapabilityPalette
|
|
7311
7684
|
]);
|
|
7685
|
+
const persistSessionRuntimeCapabilities = React28.useCallback(
|
|
7686
|
+
async (threadId, selection) => {
|
|
7687
|
+
if (!runtimeCapabilities || !selection) {
|
|
7688
|
+
return;
|
|
7689
|
+
}
|
|
7690
|
+
try {
|
|
7691
|
+
const result = await persistConversationRuntimeCapabilities({
|
|
7692
|
+
client: stream.client,
|
|
7693
|
+
threadId,
|
|
7694
|
+
capabilities: runtimeCapabilities,
|
|
7695
|
+
selection
|
|
7696
|
+
});
|
|
7697
|
+
warnMissingRuntimeCapabilityReferences(
|
|
7698
|
+
"persisted selection",
|
|
7699
|
+
result.missing
|
|
7700
|
+
);
|
|
7701
|
+
} catch (error) {
|
|
7702
|
+
console.warn(
|
|
7703
|
+
"[Chat] Failed to persist runtime capabilities selection:",
|
|
7704
|
+
error
|
|
7705
|
+
);
|
|
7706
|
+
}
|
|
7707
|
+
},
|
|
7708
|
+
[runtimeCapabilities, stream.client]
|
|
7709
|
+
);
|
|
7312
7710
|
const clearQuoteSelection = React28.useCallback(() => {
|
|
7313
7711
|
setQuoteSelection(null);
|
|
7314
7712
|
}, []);
|
|
@@ -7679,14 +8077,55 @@ function Chat({
|
|
|
7679
8077
|
return () => controller.abort();
|
|
7680
8078
|
}, [missingConfig, stream.client, stream.assistantId]);
|
|
7681
8079
|
React28.useEffect(() => {
|
|
7682
|
-
setSessionRuntimeCapabilities(
|
|
7683
|
-
createDefaultRuntimeCapabilitiesSelection(runtimeCapabilities)
|
|
7684
|
-
);
|
|
7685
8080
|
setRunRuntimeCapabilities(
|
|
7686
8081
|
createEmptyRuntimeCapabilitiesSelection(runtimeCapabilities)
|
|
7687
8082
|
);
|
|
7688
8083
|
setRuntimeCapabilityPalette(null);
|
|
7689
|
-
|
|
8084
|
+
if (!runtimeCapabilitiesReady || !runtimeCapabilities) {
|
|
8085
|
+
setSessionRuntimeCapabilities(
|
|
8086
|
+
createEmptyRuntimeCapabilitiesSelection(runtimeCapabilities)
|
|
8087
|
+
);
|
|
8088
|
+
return;
|
|
8089
|
+
}
|
|
8090
|
+
const defaultSelection = createDefaultRuntimeCapabilitiesSelection(runtimeCapabilities);
|
|
8091
|
+
const threadId = stream.threadId?.trim();
|
|
8092
|
+
if (!threadId) {
|
|
8093
|
+
setSessionRuntimeCapabilities(defaultSelection);
|
|
8094
|
+
return;
|
|
8095
|
+
}
|
|
8096
|
+
let cancelled = false;
|
|
8097
|
+
const requestId = runtimeCapabilityPreferenceLoadRef.current + 1;
|
|
8098
|
+
runtimeCapabilityPreferenceLoadRef.current = requestId;
|
|
8099
|
+
setSessionRuntimeCapabilities(defaultSelection);
|
|
8100
|
+
void loadConversationRuntimeCapabilities({
|
|
8101
|
+
client: stream.client,
|
|
8102
|
+
threadId,
|
|
8103
|
+
capabilities: runtimeCapabilities
|
|
8104
|
+
}).then(({ selection, missing }) => {
|
|
8105
|
+
if (cancelled || runtimeCapabilityPreferenceLoadRef.current !== requestId) {
|
|
8106
|
+
return;
|
|
8107
|
+
}
|
|
8108
|
+
warnMissingRuntimeCapabilityReferences("loaded selection", missing);
|
|
8109
|
+
setSessionRuntimeCapabilities(selection ?? defaultSelection);
|
|
8110
|
+
}).catch((error) => {
|
|
8111
|
+
if (cancelled || runtimeCapabilityPreferenceLoadRef.current !== requestId) {
|
|
8112
|
+
return;
|
|
8113
|
+
}
|
|
8114
|
+
console.warn(
|
|
8115
|
+
"[Chat] Failed to load persisted runtime capabilities selection:",
|
|
8116
|
+
error
|
|
8117
|
+
);
|
|
8118
|
+
setSessionRuntimeCapabilities(defaultSelection);
|
|
8119
|
+
});
|
|
8120
|
+
return () => {
|
|
8121
|
+
cancelled = true;
|
|
8122
|
+
};
|
|
8123
|
+
}, [
|
|
8124
|
+
runtimeCapabilities,
|
|
8125
|
+
runtimeCapabilitiesReady,
|
|
8126
|
+
stream.client,
|
|
8127
|
+
stream.threadId
|
|
8128
|
+
]);
|
|
7690
8129
|
React28.useEffect(() => {
|
|
7691
8130
|
if (!runtimeCapabilityPalette) {
|
|
7692
8131
|
return;
|
|
@@ -7716,30 +8155,46 @@ function Chat({
|
|
|
7716
8155
|
}));
|
|
7717
8156
|
const handleSessionRuntimeCapabilityToggle = React28.useCallback(
|
|
7718
8157
|
(type, id, selected) => {
|
|
7719
|
-
setSessionRuntimeCapabilities(
|
|
7720
|
-
|
|
8158
|
+
setSessionRuntimeCapabilities((previous) => {
|
|
8159
|
+
const nextSelection = toggleRuntimeCapabilitySelection(
|
|
8160
|
+
previous,
|
|
8161
|
+
type,
|
|
8162
|
+
id,
|
|
8163
|
+
selected
|
|
8164
|
+
);
|
|
8165
|
+
const threadId = stream.threadId?.trim();
|
|
8166
|
+
if (threadId) {
|
|
8167
|
+
void persistSessionRuntimeCapabilities(threadId, nextSelection);
|
|
8168
|
+
}
|
|
8169
|
+
return nextSelection;
|
|
8170
|
+
});
|
|
8171
|
+
},
|
|
8172
|
+
[persistSessionRuntimeCapabilities, stream.threadId]
|
|
8173
|
+
);
|
|
8174
|
+
const updateRuntimeCapabilityPalette = React28.useCallback(
|
|
8175
|
+
(value, selectionStart) => {
|
|
8176
|
+
const input = composerInputRef.current;
|
|
8177
|
+
const nextPalette = resolveRuntimeCapabilityPalette(
|
|
8178
|
+
value,
|
|
8179
|
+
typeof selectionStart === "number" ? selectionStart : input?.selectionStart
|
|
7721
8180
|
);
|
|
8181
|
+
setRuntimeCapabilityPalette(nextPalette);
|
|
7722
8182
|
},
|
|
7723
8183
|
[]
|
|
7724
8184
|
);
|
|
7725
|
-
const updateRuntimeCapabilityPalette = React28.useCallback((value) => {
|
|
7726
|
-
const input = composerInputRef.current;
|
|
7727
|
-
const nextPalette = resolveRuntimeCapabilityPalette(
|
|
7728
|
-
value,
|
|
7729
|
-
input?.selectionStart
|
|
7730
|
-
);
|
|
7731
|
-
setRuntimeCapabilityPalette(nextPalette);
|
|
7732
|
-
}, []);
|
|
7733
8185
|
const handleComposerChange = React28.useCallback(
|
|
7734
8186
|
(event) => {
|
|
7735
8187
|
const nextValue = event.target.value;
|
|
7736
8188
|
setDraft(nextValue);
|
|
7737
|
-
updateRuntimeCapabilityPalette(nextValue);
|
|
8189
|
+
updateRuntimeCapabilityPalette(nextValue, event.target.selectionStart);
|
|
7738
8190
|
},
|
|
7739
8191
|
[updateRuntimeCapabilityPalette]
|
|
7740
8192
|
);
|
|
7741
8193
|
const handleComposerSelect = React28.useCallback(() => {
|
|
7742
|
-
updateRuntimeCapabilityPalette(
|
|
8194
|
+
updateRuntimeCapabilityPalette(
|
|
8195
|
+
draft,
|
|
8196
|
+
composerInputRef.current?.selectionStart
|
|
8197
|
+
);
|
|
7743
8198
|
}, [draft, updateRuntimeCapabilityPalette]);
|
|
7744
8199
|
const selectRunRuntimeCapability = React28.useCallback(
|
|
7745
8200
|
(option) => {
|
|
@@ -7823,6 +8278,8 @@ function Chat({
|
|
|
7823
8278
|
defaults: options?.request,
|
|
7824
8279
|
humanInput: inputPayload
|
|
7825
8280
|
});
|
|
8281
|
+
const sessionRuntimeCapabilitiesForPersistence = effectiveSessionRuntimeCapabilities;
|
|
8282
|
+
const shouldPersistSessionRuntimeCapabilities = !!sessionRuntimeCapabilitiesForPersistence && !stream.threadId && !nextFollowUpMode;
|
|
7826
8283
|
stream.submit(
|
|
7827
8284
|
{
|
|
7828
8285
|
input: inputPayload,
|
|
@@ -7832,6 +8289,12 @@ function Chat({
|
|
|
7832
8289
|
...nextFollowUpMode ? { followUpMode: nextFollowUpMode } : {},
|
|
7833
8290
|
...requestOptions.context ? { context: requestOptions.context } : {},
|
|
7834
8291
|
...requestOptions.config ? { config: requestOptions.config } : {},
|
|
8292
|
+
...shouldPersistSessionRuntimeCapabilities ? {
|
|
8293
|
+
onThreadResolved: (threadId) => persistSessionRuntimeCapabilities(
|
|
8294
|
+
threadId,
|
|
8295
|
+
sessionRuntimeCapabilitiesForPersistence
|
|
8296
|
+
)
|
|
8297
|
+
} : {},
|
|
7835
8298
|
...!nextFollowUpMode ? {
|
|
7836
8299
|
optimisticValues: (prev) => {
|
|
7837
8300
|
const prevMessages = prev?.messages ?? [];
|
|
@@ -7853,8 +8316,10 @@ function Chat({
|
|
|
7853
8316
|
},
|
|
7854
8317
|
[
|
|
7855
8318
|
effectiveRuntimeCapabilitiesForSubmit,
|
|
8319
|
+
effectiveSessionRuntimeCapabilities,
|
|
7856
8320
|
isSendDisabled,
|
|
7857
8321
|
options?.request,
|
|
8322
|
+
persistSessionRuntimeCapabilities,
|
|
7858
8323
|
references,
|
|
7859
8324
|
runtimeCapabilities,
|
|
7860
8325
|
scrollToBottom,
|
|
@@ -8154,6 +8619,8 @@ function Chat({
|
|
|
8154
8619
|
defaults: options?.request,
|
|
8155
8620
|
humanInput: inputPayload
|
|
8156
8621
|
});
|
|
8622
|
+
const sessionRuntimeCapabilitiesForPersistence = effectiveSessionRuntimeCapabilities;
|
|
8623
|
+
const shouldPersistSessionRuntimeCapabilities = !!sessionRuntimeCapabilitiesForPersistence && !stream.threadId && !nextFollowUpMode;
|
|
8157
8624
|
stream.submit(
|
|
8158
8625
|
{
|
|
8159
8626
|
input: inputPayload,
|
|
@@ -8163,6 +8630,12 @@ function Chat({
|
|
|
8163
8630
|
...nextFollowUpMode ? { followUpMode: nextFollowUpMode } : {},
|
|
8164
8631
|
...requestOptions.context ? { context: requestOptions.context } : {},
|
|
8165
8632
|
...requestOptions.config ? { config: requestOptions.config } : {},
|
|
8633
|
+
...shouldPersistSessionRuntimeCapabilities ? {
|
|
8634
|
+
onThreadResolved: (threadId) => persistSessionRuntimeCapabilities(
|
|
8635
|
+
threadId,
|
|
8636
|
+
sessionRuntimeCapabilitiesForPersistence
|
|
8637
|
+
)
|
|
8638
|
+
} : {},
|
|
8166
8639
|
...!nextFollowUpMode ? {
|
|
8167
8640
|
optimisticValues: (prev) => {
|
|
8168
8641
|
const prevMessages = prev?.messages ?? [];
|
|
@@ -8621,7 +9094,7 @@ function Chat({
|
|
|
8621
9094
|
{
|
|
8622
9095
|
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",
|
|
8623
9096
|
children: [
|
|
8624
|
-
|
|
9097
|
+
/* @__PURE__ */ jsx34(RuntimeCapabilityIcon, { option, variant: "chip" }),
|
|
8625
9098
|
/* @__PURE__ */ jsx34("span", { className: "max-w-40 truncate", children: option.label }),
|
|
8626
9099
|
/* @__PURE__ */ jsx34(
|
|
8627
9100
|
"button",
|
|
@@ -8691,7 +9164,7 @@ function Chat({
|
|
|
8691
9164
|
index === runtimeCapabilityPalette.activeIndex && "bg-muted"
|
|
8692
9165
|
),
|
|
8693
9166
|
children: [
|
|
8694
|
-
/* @__PURE__ */ jsx34("span", { className: "mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center text-muted-foreground", children:
|
|
9167
|
+
/* @__PURE__ */ jsx34("span", { className: "mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center text-muted-foreground", children: /* @__PURE__ */ jsx34(RuntimeCapabilityIcon, { option, variant: "list" }) }),
|
|
8695
9168
|
/* @__PURE__ */ jsxs22("span", { className: "min-w-0 flex-1", children: [
|
|
8696
9169
|
/* @__PURE__ */ jsx34("span", { className: "block truncate", children: option.label }),
|
|
8697
9170
|
option.description && /* @__PURE__ */ jsx34("span", { className: "block truncate text-xs text-muted-foreground", children: option.description })
|