@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.cjs
CHANGED
|
@@ -988,7 +988,7 @@ var useStreamContext = () => {
|
|
|
988
988
|
};
|
|
989
989
|
|
|
990
990
|
// src/components/composer/ComposerMenu.tsx
|
|
991
|
-
var
|
|
991
|
+
var React9 = __toESM(require("react"), 1);
|
|
992
992
|
var import_lucide_react2 = require("lucide-react");
|
|
993
993
|
|
|
994
994
|
// src/components/ui/button.tsx
|
|
@@ -1255,12 +1255,9 @@ function DropdownMenuCheckboxItem({
|
|
|
1255
1255
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1256
1256
|
"span",
|
|
1257
1257
|
{
|
|
1258
|
-
className: "pointer-events-none absolute right-2 flex items-center justify-center",
|
|
1258
|
+
className: "pointer-events-none absolute right-2 flex h-5 w-5 items-center justify-center",
|
|
1259
1259
|
"data-slot": "dropdown-menu-checkbox-item-indicator",
|
|
1260
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_radix_ui.DropdownMenu.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1261
|
-
import_lucide_react.CheckIcon,
|
|
1262
|
-
{}
|
|
1263
|
-
) })
|
|
1260
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_radix_ui.DropdownMenu.ItemIndicator, { className: "flex h-5 w-5 items-center justify-center rounded-full shadow-sm ring-1 ring-primary/25", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react.CheckIcon, { className: "size-3.5 stroke-[3]" }) })
|
|
1264
1261
|
}
|
|
1265
1262
|
),
|
|
1266
1263
|
children
|
|
@@ -1369,9 +1366,19 @@ var en_US_default = {
|
|
|
1369
1366
|
title: "Skills & Plugins",
|
|
1370
1367
|
skills: "Skills",
|
|
1371
1368
|
plugins: "Plugins",
|
|
1369
|
+
subAgents: "Sub-agents",
|
|
1372
1370
|
runOnly: "This run",
|
|
1373
1371
|
removeRunCapability: "Remove capability",
|
|
1374
|
-
emptySearch: "No matching skills or
|
|
1372
|
+
emptySearch: "No matching skills, plugins, or sub-agents",
|
|
1373
|
+
agent: "Agent",
|
|
1374
|
+
xpertAgent: "Xpert",
|
|
1375
|
+
agentDetails: "Agent details",
|
|
1376
|
+
type: "Type",
|
|
1377
|
+
identifier: "ID",
|
|
1378
|
+
inputs: "Inputs",
|
|
1379
|
+
tools: "Tools",
|
|
1380
|
+
toolsets: "Toolsets",
|
|
1381
|
+
knowledge: "Knowledge"
|
|
1375
1382
|
},
|
|
1376
1383
|
planModeActive: "Plan",
|
|
1377
1384
|
disablePlanMode: "Turn off plan mode",
|
|
@@ -1557,9 +1564,19 @@ var zh_CN_default = {
|
|
|
1557
1564
|
title: "\u6280\u80FD\u548C\u63D2\u4EF6",
|
|
1558
1565
|
skills: "\u6280\u80FD",
|
|
1559
1566
|
plugins: "\u63D2\u4EF6",
|
|
1567
|
+
subAgents: "\u5B50\u667A\u80FD\u4F53",
|
|
1560
1568
|
runOnly: "\u672C\u6B21\u8FD0\u884C",
|
|
1561
1569
|
removeRunCapability: "\u79FB\u9664\u80FD\u529B",
|
|
1562
|
-
emptySearch: "\u6CA1\u6709\u5339\u914D\u7684
|
|
1570
|
+
emptySearch: "\u6CA1\u6709\u5339\u914D\u7684\u6280\u80FD\u3001\u63D2\u4EF6\u6216\u5B50\u667A\u80FD\u4F53",
|
|
1571
|
+
agent: "\u667A\u80FD\u4F53",
|
|
1572
|
+
xpertAgent: "Xpert",
|
|
1573
|
+
agentDetails: "\u667A\u80FD\u4F53\u8BE6\u60C5",
|
|
1574
|
+
type: "\u7C7B\u578B",
|
|
1575
|
+
identifier: "ID",
|
|
1576
|
+
inputs: "\u8F93\u5165",
|
|
1577
|
+
tools: "\u5DE5\u5177",
|
|
1578
|
+
toolsets: "\u5DE5\u5177\u96C6",
|
|
1579
|
+
knowledge: "\u77E5\u8BC6\u5E93"
|
|
1563
1580
|
},
|
|
1564
1581
|
planModeActive: "\u8BA1\u5212",
|
|
1565
1582
|
disablePlanMode: "\u5173\u95ED\u8BA1\u5212\u6A21\u5F0F",
|
|
@@ -2092,6 +2109,9 @@ function createEmptyRuntimeCapabilitiesSelection(capabilities) {
|
|
|
2092
2109
|
},
|
|
2093
2110
|
plugins: {
|
|
2094
2111
|
nodeKeys: []
|
|
2112
|
+
},
|
|
2113
|
+
subAgents: {
|
|
2114
|
+
nodeKeys: []
|
|
2095
2115
|
}
|
|
2096
2116
|
};
|
|
2097
2117
|
}
|
|
@@ -2107,6 +2127,9 @@ function createDefaultRuntimeCapabilitiesSelection(capabilities) {
|
|
|
2107
2127
|
},
|
|
2108
2128
|
plugins: {
|
|
2109
2129
|
nodeKeys: []
|
|
2130
|
+
},
|
|
2131
|
+
subAgents: {
|
|
2132
|
+
nodeKeys: []
|
|
2110
2133
|
}
|
|
2111
2134
|
};
|
|
2112
2135
|
}
|
|
@@ -2124,22 +2147,38 @@ function mergeRuntimeCapabilitiesSelections(capabilities, ...selections) {
|
|
|
2124
2147
|
nodeKeys: uniqueStrings(
|
|
2125
2148
|
selections.flatMap((selection) => selection?.plugins.nodeKeys ?? [])
|
|
2126
2149
|
)
|
|
2150
|
+
},
|
|
2151
|
+
subAgents: {
|
|
2152
|
+
nodeKeys: uniqueStrings(
|
|
2153
|
+
selections.flatMap((selection) => selection?.subAgents?.nodeKeys ?? [])
|
|
2154
|
+
)
|
|
2127
2155
|
}
|
|
2128
2156
|
};
|
|
2129
2157
|
}
|
|
2130
2158
|
function toggleRuntimeCapabilitySelection(selection, type, id, selected) {
|
|
2131
|
-
const ids = type === "skill" ? selection.skills.ids : selection.plugins.nodeKeys;
|
|
2159
|
+
const ids = type === "skill" ? selection.skills.ids : type === "plugin" ? selection.plugins.nodeKeys : selection.subAgents?.nodeKeys ?? [];
|
|
2132
2160
|
const shouldSelect = selected ?? !ids.includes(id);
|
|
2133
2161
|
const nextIds = shouldSelect ? uniqueStrings([...ids, id]) : ids.filter((item) => item !== id);
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2162
|
+
if (type === "skill") {
|
|
2163
|
+
return {
|
|
2164
|
+
...selection,
|
|
2165
|
+
skills: {
|
|
2166
|
+
...selection.skills,
|
|
2167
|
+
ids: nextIds
|
|
2168
|
+
}
|
|
2169
|
+
};
|
|
2170
|
+
}
|
|
2171
|
+
if (type === "plugin") {
|
|
2172
|
+
return {
|
|
2173
|
+
...selection,
|
|
2174
|
+
plugins: {
|
|
2175
|
+
nodeKeys: nextIds
|
|
2176
|
+
}
|
|
2177
|
+
};
|
|
2178
|
+
}
|
|
2179
|
+
return {
|
|
2141
2180
|
...selection,
|
|
2142
|
-
|
|
2181
|
+
subAgents: {
|
|
2143
2182
|
nodeKeys: nextIds
|
|
2144
2183
|
}
|
|
2145
2184
|
};
|
|
@@ -2162,26 +2201,231 @@ function getRuntimeCapabilityOptions(capabilities) {
|
|
|
2162
2201
|
label: capability.label,
|
|
2163
2202
|
description: capability.description ?? capability.provider,
|
|
2164
2203
|
capability
|
|
2204
|
+
})),
|
|
2205
|
+
...(capabilities.subAgents ?? []).map((capability) => ({
|
|
2206
|
+
type: "subAgent",
|
|
2207
|
+
id: capability.nodeKey,
|
|
2208
|
+
label: capability.label,
|
|
2209
|
+
description: capability.description ?? capability.name,
|
|
2210
|
+
capability
|
|
2165
2211
|
}))
|
|
2166
2212
|
];
|
|
2167
2213
|
}
|
|
2168
2214
|
function isRuntimeCapabilitySelected(selection, type, id) {
|
|
2169
|
-
|
|
2215
|
+
if (type === "skill") {
|
|
2216
|
+
return selection.skills.ids.includes(id);
|
|
2217
|
+
}
|
|
2218
|
+
if (type === "plugin") {
|
|
2219
|
+
return selection.plugins.nodeKeys.includes(id);
|
|
2220
|
+
}
|
|
2221
|
+
return selection.subAgents?.nodeKeys.includes(id) ?? false;
|
|
2170
2222
|
}
|
|
2171
2223
|
|
|
2172
|
-
// src/components/
|
|
2224
|
+
// src/components/ui/tooltip.tsx
|
|
2225
|
+
var React6 = require("react");
|
|
2226
|
+
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"), 1);
|
|
2173
2227
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
2228
|
+
function TooltipProvider({
|
|
2229
|
+
delayDuration = 0,
|
|
2230
|
+
...props
|
|
2231
|
+
}) {
|
|
2232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2233
|
+
TooltipPrimitive.Provider,
|
|
2234
|
+
{
|
|
2235
|
+
"data-slot": "tooltip-provider",
|
|
2236
|
+
delayDuration,
|
|
2237
|
+
...props
|
|
2238
|
+
}
|
|
2239
|
+
);
|
|
2240
|
+
}
|
|
2241
|
+
function Tooltip({
|
|
2242
|
+
...props
|
|
2243
|
+
}) {
|
|
2244
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2245
|
+
TooltipPrimitive.Root,
|
|
2246
|
+
{
|
|
2247
|
+
"data-slot": "tooltip",
|
|
2248
|
+
...props
|
|
2249
|
+
}
|
|
2250
|
+
) });
|
|
2251
|
+
}
|
|
2252
|
+
function TooltipTrigger({
|
|
2253
|
+
...props
|
|
2254
|
+
}) {
|
|
2255
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2256
|
+
TooltipPrimitive.Trigger,
|
|
2257
|
+
{
|
|
2258
|
+
"data-slot": "tooltip-trigger",
|
|
2259
|
+
...props
|
|
2260
|
+
}
|
|
2261
|
+
);
|
|
2262
|
+
}
|
|
2263
|
+
function TooltipContent({
|
|
2264
|
+
className,
|
|
2265
|
+
sideOffset = 0,
|
|
2266
|
+
hideArrow = false,
|
|
2267
|
+
children,
|
|
2268
|
+
...props
|
|
2269
|
+
}) {
|
|
2270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
2271
|
+
TooltipPrimitive.Content,
|
|
2272
|
+
{
|
|
2273
|
+
"data-slot": "tooltip-content",
|
|
2274
|
+
sideOffset,
|
|
2275
|
+
className: cn(
|
|
2276
|
+
"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",
|
|
2277
|
+
className
|
|
2278
|
+
),
|
|
2279
|
+
...props,
|
|
2280
|
+
children: [
|
|
2281
|
+
children,
|
|
2282
|
+
!hideArrow ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TooltipPrimitive.Arrow, { className: "bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" }) : null
|
|
2283
|
+
]
|
|
2284
|
+
}
|
|
2285
|
+
) });
|
|
2286
|
+
}
|
|
2287
|
+
|
|
2288
|
+
// src/components/ui/chatkit-avatar.tsx
|
|
2289
|
+
var React8 = require("react");
|
|
2290
|
+
|
|
2291
|
+
// src/components/ui/avatar.tsx
|
|
2292
|
+
var React7 = __toESM(require("react"), 1);
|
|
2293
|
+
var AvatarPrimitive = __toESM(require("@radix-ui/react-avatar"), 1);
|
|
2294
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
2295
|
+
var Avatar = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2296
|
+
AvatarPrimitive.Root,
|
|
2297
|
+
{
|
|
2298
|
+
ref,
|
|
2299
|
+
className: cn(
|
|
2300
|
+
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
|
2301
|
+
className
|
|
2302
|
+
),
|
|
2303
|
+
...props
|
|
2304
|
+
}
|
|
2305
|
+
));
|
|
2306
|
+
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
2307
|
+
var AvatarImage = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2308
|
+
AvatarPrimitive.Image,
|
|
2309
|
+
{
|
|
2310
|
+
ref,
|
|
2311
|
+
className: cn("aspect-square h-full w-full", className),
|
|
2312
|
+
...props
|
|
2313
|
+
}
|
|
2314
|
+
));
|
|
2315
|
+
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
2316
|
+
var AvatarFallback = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2317
|
+
AvatarPrimitive.Fallback,
|
|
2318
|
+
{
|
|
2319
|
+
ref,
|
|
2320
|
+
className: cn(
|
|
2321
|
+
"flex h-full w-full items-center justify-center rounded-full bg-muted",
|
|
2322
|
+
className
|
|
2323
|
+
),
|
|
2324
|
+
...props
|
|
2325
|
+
}
|
|
2326
|
+
));
|
|
2327
|
+
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
2328
|
+
|
|
2329
|
+
// src/components/ui/chatkit-avatar.tsx
|
|
2330
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
2331
|
+
function asRecord(value) {
|
|
2332
|
+
return value && typeof value === "object" ? value : null;
|
|
2333
|
+
}
|
|
2334
|
+
function getNonEmptyString(value) {
|
|
2335
|
+
if (typeof value !== "string") return void 0;
|
|
2336
|
+
const normalized = value.trim();
|
|
2337
|
+
return normalized || void 0;
|
|
2338
|
+
}
|
|
2339
|
+
function unicodeFromUnified(unified) {
|
|
2340
|
+
const normalized = getNonEmptyString(unified);
|
|
2341
|
+
if (!normalized) return void 0;
|
|
2342
|
+
try {
|
|
2343
|
+
return normalized.split("-").map((hex) => String.fromCodePoint(Number.parseInt(hex, 16))).join("");
|
|
2344
|
+
} catch {
|
|
2345
|
+
return void 0;
|
|
2346
|
+
}
|
|
2347
|
+
}
|
|
2348
|
+
function getEmojiCharacter(avatar) {
|
|
2349
|
+
return unicodeFromUnified(avatar?.emoji?.unified);
|
|
2350
|
+
}
|
|
2351
|
+
function getAvatarFallback(label) {
|
|
2352
|
+
return label.trim().charAt(0).toUpperCase() || "A";
|
|
2353
|
+
}
|
|
2354
|
+
function normalizeChatkitAvatar(rawAvatar) {
|
|
2355
|
+
if (typeof rawAvatar === "string") {
|
|
2356
|
+
const url = getNonEmptyString(rawAvatar);
|
|
2357
|
+
return url ? { url } : null;
|
|
2358
|
+
}
|
|
2359
|
+
const avatarRecord = asRecord(rawAvatar);
|
|
2360
|
+
if (!avatarRecord) return null;
|
|
2361
|
+
const emojiRecord = asRecord(avatarRecord.emoji);
|
|
2362
|
+
const avatar = {
|
|
2363
|
+
background: getNonEmptyString(avatarRecord.background),
|
|
2364
|
+
url: getNonEmptyString(avatarRecord.url),
|
|
2365
|
+
useNotoColor: Boolean(avatarRecord.useNotoColor)
|
|
2366
|
+
};
|
|
2367
|
+
if (emojiRecord) {
|
|
2368
|
+
avatar.emoji = {
|
|
2369
|
+
colons: getNonEmptyString(emojiRecord.colons),
|
|
2370
|
+
id: getNonEmptyString(emojiRecord.id),
|
|
2371
|
+
unified: getNonEmptyString(emojiRecord.unified)
|
|
2372
|
+
};
|
|
2373
|
+
}
|
|
2374
|
+
return avatar.url || avatar.background || avatar.emoji?.id || avatar.emoji?.unified ? avatar : null;
|
|
2375
|
+
}
|
|
2376
|
+
function extractAssistantAvatar(assistant) {
|
|
2377
|
+
const assistantRecord = asRecord(assistant);
|
|
2378
|
+
const metadata = asRecord(assistant.metadata);
|
|
2379
|
+
const rawAvatar = assistantRecord?.avatar ?? metadata?.avatar;
|
|
2380
|
+
const avatar = normalizeChatkitAvatar(rawAvatar);
|
|
2381
|
+
if (avatar) return avatar;
|
|
2382
|
+
const metadataAvatar = getNonEmptyString(metadata?.avatarUrl) ?? getNonEmptyString(metadata?.avatar_url);
|
|
2383
|
+
return metadataAvatar ? { url: metadataAvatar } : null;
|
|
2384
|
+
}
|
|
2385
|
+
function ChatkitAvatar({
|
|
2386
|
+
avatar,
|
|
2387
|
+
className,
|
|
2388
|
+
fallback,
|
|
2389
|
+
fallbackClassName,
|
|
2390
|
+
imageClassName,
|
|
2391
|
+
label,
|
|
2392
|
+
style,
|
|
2393
|
+
...props
|
|
2394
|
+
}) {
|
|
2395
|
+
const { theme } = useTheme();
|
|
2396
|
+
const emojiCharacter = getEmojiCharacter(avatar);
|
|
2397
|
+
const fallbackText = fallback || getAvatarFallback(label);
|
|
2398
|
+
const roundedClass = getRoundedClass(theme.radius);
|
|
2399
|
+
const emojiStyle = avatar?.useNotoColor ? { fontFamily: '"Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", sans-serif' } : void 0;
|
|
2400
|
+
const fallbackStyle = {
|
|
2401
|
+
...avatar?.background ? { background: avatar.background } : {}
|
|
2402
|
+
};
|
|
2403
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Avatar, { className: cn(roundedClass, className), style, ...props, children: [
|
|
2404
|
+
avatar?.url ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(AvatarImage, { className: imageClassName, src: avatar.url, alt: label }) : null,
|
|
2405
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2406
|
+
AvatarFallback,
|
|
2407
|
+
{
|
|
2408
|
+
className: cn(roundedClass, "text-sm font-medium text-foreground", fallbackClassName),
|
|
2409
|
+
style: fallbackStyle,
|
|
2410
|
+
children: emojiCharacter ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-[1.1em] leading-none", style: emojiStyle, children: emojiCharacter }) : fallbackText
|
|
2411
|
+
}
|
|
2412
|
+
)
|
|
2413
|
+
] });
|
|
2414
|
+
}
|
|
2415
|
+
|
|
2416
|
+
// src/components/composer/ComposerMenu.tsx
|
|
2417
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
2174
2418
|
function getIconComponent(icon) {
|
|
2175
2419
|
const iconMap = {
|
|
2176
|
-
plus: /* @__PURE__ */ (0,
|
|
2177
|
-
document: /* @__PURE__ */ (0,
|
|
2178
|
-
write: /* @__PURE__ */ (0,
|
|
2179
|
-
sparkle: /* @__PURE__ */ (0,
|
|
2180
|
-
lightbulb: /* @__PURE__ */ (0,
|
|
2181
|
-
"settings-slider": /* @__PURE__ */ (0,
|
|
2182
|
-
search: /* @__PURE__ */ (0,
|
|
2183
|
-
globe: /* @__PURE__ */ (0,
|
|
2184
|
-
images: /* @__PURE__ */ (0,
|
|
2420
|
+
plus: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react2.Plus, { size: 16 }),
|
|
2421
|
+
document: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react2.FileText, { size: 16 }),
|
|
2422
|
+
write: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react2.Pencil, { size: 16 }),
|
|
2423
|
+
sparkle: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react2.Sparkles, { size: 16 }),
|
|
2424
|
+
lightbulb: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react2.Lightbulb, { size: 16 }),
|
|
2425
|
+
"settings-slider": /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react2.SlidersHorizontal, { size: 16 }),
|
|
2426
|
+
search: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react2.Search, { size: 16 }),
|
|
2427
|
+
globe: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react2.Globe, { size: 16 }),
|
|
2428
|
+
images: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react2.Images, { size: 16 })
|
|
2185
2429
|
};
|
|
2186
2430
|
return iconMap[icon] || iconMap["sparkle"];
|
|
2187
2431
|
}
|
|
@@ -2198,21 +2442,23 @@ function ComposerMenu({
|
|
|
2198
2442
|
disabled = false
|
|
2199
2443
|
}) {
|
|
2200
2444
|
const { t } = useChatkitTranslation();
|
|
2201
|
-
const [open, setOpen] =
|
|
2202
|
-
const [activePanel, setActivePanel] =
|
|
2445
|
+
const [open, setOpen] = React9.useState(false);
|
|
2446
|
+
const [activePanel, setActivePanel] = React9.useState(
|
|
2203
2447
|
null
|
|
2204
2448
|
);
|
|
2205
|
-
const [collisionBoundary, setCollisionBoundary] =
|
|
2206
|
-
const triggerRef =
|
|
2449
|
+
const [collisionBoundary, setCollisionBoundary] = React9.useState();
|
|
2450
|
+
const triggerRef = React9.useRef(null);
|
|
2207
2451
|
const { theme } = useTheme();
|
|
2208
2452
|
const roundedClass = getRoundedClass(theme.radius);
|
|
2209
2453
|
const attachmentsEnabled = composer?.attachments?.enabled ?? false;
|
|
2210
2454
|
const tools = composer?.tools ?? [];
|
|
2211
2455
|
const skills = runtimeCapabilities?.skills ?? [];
|
|
2212
2456
|
const plugins = runtimeCapabilities?.plugins ?? [];
|
|
2213
|
-
const
|
|
2457
|
+
const subAgents = runtimeCapabilities?.subAgents ?? [];
|
|
2458
|
+
const hasRuntimeCapabilities = skills.length > 0 || plugins.length > 0 || subAgents.length > 0;
|
|
2214
2459
|
const selectedSkillCount = selectedRuntimeCapabilities?.skills.ids.length ?? 0;
|
|
2215
2460
|
const selectedPluginCount = selectedRuntimeCapabilities?.plugins.nodeKeys.length ?? 0;
|
|
2461
|
+
const selectedSubAgentCount = selectedRuntimeCapabilities?.subAgents?.nodeKeys.length ?? 0;
|
|
2216
2462
|
const handleAttachmentClick = () => {
|
|
2217
2463
|
onAttachmentClick?.();
|
|
2218
2464
|
};
|
|
@@ -2237,10 +2483,136 @@ function ComposerMenu({
|
|
|
2237
2483
|
collisionBoundary,
|
|
2238
2484
|
collisionPadding: 8
|
|
2239
2485
|
};
|
|
2486
|
+
const getCapabilityFallbackIcon = (type) => {
|
|
2487
|
+
if (type === "skill") return import_lucide_react2.Brain;
|
|
2488
|
+
if (type === "plugin") return import_lucide_react2.Plug;
|
|
2489
|
+
return import_lucide_react2.Bot;
|
|
2490
|
+
};
|
|
2491
|
+
const getParameterLabels = (subAgent) => (subAgent.parameters ?? []).map((parameter) => {
|
|
2492
|
+
if (!parameter || typeof parameter !== "object") return null;
|
|
2493
|
+
const record = parameter;
|
|
2494
|
+
return typeof record.title === "string" && record.title.trim() || typeof record.name === "string" && record.name.trim() || null;
|
|
2495
|
+
}).filter((value) => Boolean(value));
|
|
2496
|
+
const renderDetailPills = (label, values) => {
|
|
2497
|
+
if (!values?.length) return null;
|
|
2498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-1", children: [
|
|
2499
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "text-[11px] font-medium uppercase text-muted-foreground", children: label }),
|
|
2500
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-wrap gap-1", children: [
|
|
2501
|
+
values.slice(0, 6).map((value) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2502
|
+
"span",
|
|
2503
|
+
{
|
|
2504
|
+
className: "max-w-full truncate rounded-md bg-muted px-1.5 py-0.5 text-[11px] text-foreground",
|
|
2505
|
+
children: value
|
|
2506
|
+
},
|
|
2507
|
+
value
|
|
2508
|
+
)),
|
|
2509
|
+
values.length > 6 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "rounded-md bg-muted px-1.5 py-0.5 text-[11px] text-muted-foreground", children: [
|
|
2510
|
+
"+",
|
|
2511
|
+
values.length - 6
|
|
2512
|
+
] })
|
|
2513
|
+
] })
|
|
2514
|
+
] });
|
|
2515
|
+
};
|
|
2516
|
+
const renderSubAgentInfoButton = (subAgent) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Tooltip, { children: [
|
|
2517
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2518
|
+
"button",
|
|
2519
|
+
{
|
|
2520
|
+
type: "button",
|
|
2521
|
+
"aria-label": t("composer.capabilities.agentDetails"),
|
|
2522
|
+
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",
|
|
2523
|
+
"data-slot": "runtime-sub-agent-info-trigger",
|
|
2524
|
+
onClick: (event) => event.stopPropagation(),
|
|
2525
|
+
onPointerDown: (event) => event.stopPropagation(),
|
|
2526
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react2.Info, { size: 14 })
|
|
2527
|
+
}
|
|
2528
|
+
) }),
|
|
2529
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2530
|
+
TooltipContent,
|
|
2531
|
+
{
|
|
2532
|
+
side: "top",
|
|
2533
|
+
align: "center",
|
|
2534
|
+
sideOffset: 8,
|
|
2535
|
+
hideArrow: true,
|
|
2536
|
+
className: "bg-transparent p-0 text-popover-foreground shadow-none",
|
|
2537
|
+
children: renderSubAgentDetailCard(subAgent)
|
|
2538
|
+
}
|
|
2539
|
+
)
|
|
2540
|
+
] });
|
|
2541
|
+
const renderSubAgentDetailCard = (subAgent) => {
|
|
2542
|
+
const parameterLabels = getParameterLabels(subAgent);
|
|
2543
|
+
const agentKind = subAgent.type === "xpert" ? t("composer.capabilities.xpertAgent") : t("composer.capabilities.agent");
|
|
2544
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2545
|
+
"div",
|
|
2546
|
+
{
|
|
2547
|
+
"data-slot": "runtime-sub-agent-detail-card",
|
|
2548
|
+
className: "pointer-events-none w-80 space-y-3 rounded-lg border border-border bg-popover p-3 text-popover-foreground shadow-lg",
|
|
2549
|
+
children: [
|
|
2550
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-start gap-3", children: [
|
|
2551
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2552
|
+
ChatkitAvatar,
|
|
2553
|
+
{
|
|
2554
|
+
avatar: normalizeChatkitAvatar(subAgent.avatar),
|
|
2555
|
+
label: subAgent.label,
|
|
2556
|
+
className: "h-9 w-9 shrink-0",
|
|
2557
|
+
fallbackClassName: "text-xs"
|
|
2558
|
+
}
|
|
2559
|
+
),
|
|
2560
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
2561
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "truncate text-sm font-medium", children: subAgent.label }),
|
|
2562
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "truncate text-xs text-muted-foreground", children: subAgent.name ?? agentKind })
|
|
2563
|
+
] })
|
|
2564
|
+
] }),
|
|
2565
|
+
subAgent.description && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "line-clamp-4 text-xs leading-5 text-muted-foreground", children: subAgent.description }),
|
|
2566
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "grid grid-cols-2 gap-2 text-xs", children: [
|
|
2567
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rounded-md bg-muted px-2 py-1", children: [
|
|
2568
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "block text-[11px] text-muted-foreground", children: t("composer.capabilities.type") }),
|
|
2569
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "font-medium", children: agentKind })
|
|
2570
|
+
] }),
|
|
2571
|
+
(subAgent.agentKey || subAgent.xpertId) && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "rounded-md bg-muted px-2 py-1", children: [
|
|
2572
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "block text-[11px] text-muted-foreground", children: t("composer.capabilities.identifier") }),
|
|
2573
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "block truncate font-mono text-[11px]", children: subAgent.agentKey ?? subAgent.xpertId })
|
|
2574
|
+
] })
|
|
2575
|
+
] }),
|
|
2576
|
+
renderDetailPills(t("composer.capabilities.inputs"), parameterLabels),
|
|
2577
|
+
renderDetailPills(
|
|
2578
|
+
t("composer.capabilities.tools"),
|
|
2579
|
+
subAgent.toolNames
|
|
2580
|
+
),
|
|
2581
|
+
renderDetailPills(
|
|
2582
|
+
t("composer.capabilities.toolsets"),
|
|
2583
|
+
subAgent.toolsetNames
|
|
2584
|
+
),
|
|
2585
|
+
renderDetailPills(
|
|
2586
|
+
t("composer.capabilities.knowledge"),
|
|
2587
|
+
subAgent.knowledgebaseNames
|
|
2588
|
+
)
|
|
2589
|
+
]
|
|
2590
|
+
}
|
|
2591
|
+
);
|
|
2592
|
+
};
|
|
2240
2593
|
const renderCapabilityRow = (type, item) => {
|
|
2241
2594
|
const selected = selectedRuntimeCapabilities ? isRuntimeCapabilitySelected(selectedRuntimeCapabilities, type, item.id) : false;
|
|
2242
|
-
const Icon = type
|
|
2243
|
-
|
|
2595
|
+
const Icon = getCapabilityFallbackIcon(type);
|
|
2596
|
+
const icon = type === "subAgent" && item.subAgent ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2597
|
+
ChatkitAvatar,
|
|
2598
|
+
{
|
|
2599
|
+
avatar: normalizeChatkitAvatar(item.subAgent.avatar),
|
|
2600
|
+
label: item.subAgent.label,
|
|
2601
|
+
className: "h-6 w-6",
|
|
2602
|
+
fallbackClassName: "text-[10px]",
|
|
2603
|
+
imageClassName: "object-cover",
|
|
2604
|
+
"data-slot": "runtime-sub-agent-avatar"
|
|
2605
|
+
}
|
|
2606
|
+
) : item.icon ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2607
|
+
IconDefinitionRenderer,
|
|
2608
|
+
{
|
|
2609
|
+
icon: item.icon,
|
|
2610
|
+
size: 24,
|
|
2611
|
+
dataSlot: "runtime-capability-meta-icon",
|
|
2612
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Icon, { size: 16 })
|
|
2613
|
+
}
|
|
2614
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Icon, { size: 16 });
|
|
2615
|
+
const row = /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2244
2616
|
DropdownMenuCheckboxItem,
|
|
2245
2617
|
{
|
|
2246
2618
|
checked: selected,
|
|
@@ -2252,29 +2624,47 @@ function ComposerMenu({
|
|
|
2252
2624
|
selected && "bg-muted"
|
|
2253
2625
|
),
|
|
2254
2626
|
children: [
|
|
2255
|
-
/* @__PURE__ */ (0,
|
|
2256
|
-
|
|
2257
|
-
{
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
fallback: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { size: 16 })
|
|
2262
|
-
}
|
|
2263
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { size: 16 }) }),
|
|
2264
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "min-w-0 flex-1 text-left", children: [
|
|
2265
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "block truncate", children: item.label }),
|
|
2266
|
-
(item.description || item.fallbackDescription) && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "block truncate text-xs text-muted-foreground", children: item.description ?? item.fallbackDescription })
|
|
2267
|
-
] })
|
|
2627
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center text-muted-foreground", children: icon }),
|
|
2628
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "min-w-0 flex-1 text-left", children: [
|
|
2629
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "block truncate", children: item.label }),
|
|
2630
|
+
(item.description || item.fallbackDescription) && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "block truncate text-xs text-muted-foreground", children: item.description ?? item.fallbackDescription })
|
|
2631
|
+
] }),
|
|
2632
|
+
type === "subAgent" && item.subAgent ? renderSubAgentInfoButton(item.subAgent) : null
|
|
2268
2633
|
]
|
|
2269
2634
|
},
|
|
2270
2635
|
item.id
|
|
2271
2636
|
);
|
|
2637
|
+
return row;
|
|
2272
2638
|
};
|
|
2273
2639
|
const renderCapabilityPanel = (panel) => {
|
|
2274
|
-
const
|
|
2275
|
-
const
|
|
2276
|
-
|
|
2277
|
-
|
|
2640
|
+
const title = panel === "skills" ? t("composer.capabilities.skills") : panel === "plugins" ? t("composer.capabilities.plugins") : t("composer.capabilities.subAgents");
|
|
2641
|
+
const rows = panel === "skills" ? skills.map(
|
|
2642
|
+
(skill) => renderCapabilityRow("skill", {
|
|
2643
|
+
id: skill.id,
|
|
2644
|
+
label: skill.label,
|
|
2645
|
+
description: skill.description,
|
|
2646
|
+
fallbackDescription: skill.repositoryName,
|
|
2647
|
+
icon: skill.meta?.icon
|
|
2648
|
+
})
|
|
2649
|
+
) : panel === "plugins" ? plugins.map(
|
|
2650
|
+
(plugin) => renderCapabilityRow("plugin", {
|
|
2651
|
+
id: plugin.nodeKey,
|
|
2652
|
+
label: plugin.label,
|
|
2653
|
+
description: plugin.description,
|
|
2654
|
+
fallbackDescription: plugin.provider,
|
|
2655
|
+
icon: plugin.meta?.icon
|
|
2656
|
+
})
|
|
2657
|
+
) : subAgents.map(
|
|
2658
|
+
(subAgent) => renderCapabilityRow("subAgent", {
|
|
2659
|
+
id: subAgent.nodeKey,
|
|
2660
|
+
label: subAgent.label,
|
|
2661
|
+
description: subAgent.description,
|
|
2662
|
+
fallbackDescription: subAgent.name,
|
|
2663
|
+
subAgent
|
|
2664
|
+
})
|
|
2665
|
+
);
|
|
2666
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
2667
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2278
2668
|
DropdownMenuItem,
|
|
2279
2669
|
{
|
|
2280
2670
|
onSelect: (event) => {
|
|
@@ -2283,33 +2673,17 @@ function ComposerMenu({
|
|
|
2283
2673
|
},
|
|
2284
2674
|
className: cn("gap-3 px-3 py-2", roundedClass),
|
|
2285
2675
|
children: [
|
|
2286
|
-
/* @__PURE__ */ (0,
|
|
2287
|
-
/* @__PURE__ */ (0,
|
|
2676
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "flex h-6 w-6 items-center justify-center text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react2.ArrowLeft, { size: 16 }) }),
|
|
2677
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "min-w-0 flex-1 text-left", children: title })
|
|
2288
2678
|
]
|
|
2289
2679
|
}
|
|
2290
2680
|
),
|
|
2291
|
-
/* @__PURE__ */ (0,
|
|
2292
|
-
|
|
2293
|
-
(skill) => renderCapabilityRow("skill", {
|
|
2294
|
-
id: skill.id,
|
|
2295
|
-
label: skill.label,
|
|
2296
|
-
description: skill.description,
|
|
2297
|
-
fallbackDescription: skill.repositoryName,
|
|
2298
|
-
icon: skill.meta?.icon
|
|
2299
|
-
})
|
|
2300
|
-
) : plugins.map(
|
|
2301
|
-
(plugin) => renderCapabilityRow("plugin", {
|
|
2302
|
-
id: plugin.nodeKey,
|
|
2303
|
-
label: plugin.label,
|
|
2304
|
-
description: plugin.description,
|
|
2305
|
-
fallbackDescription: plugin.provider,
|
|
2306
|
-
icon: plugin.meta?.icon
|
|
2307
|
-
})
|
|
2308
|
-
)
|
|
2681
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DropdownMenuSeparator, {}),
|
|
2682
|
+
rows
|
|
2309
2683
|
] });
|
|
2310
2684
|
};
|
|
2311
|
-
return /* @__PURE__ */ (0,
|
|
2312
|
-
/* @__PURE__ */ (0,
|
|
2685
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(DropdownMenu, { open, onOpenChange: handleOpenChange, children: [
|
|
2686
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2313
2687
|
Button,
|
|
2314
2688
|
{
|
|
2315
2689
|
ref: triggerRef,
|
|
@@ -2323,12 +2697,12 @@ function ComposerMenu({
|
|
|
2323
2697
|
open && "bg-muted"
|
|
2324
2698
|
),
|
|
2325
2699
|
children: [
|
|
2326
|
-
/* @__PURE__ */ (0,
|
|
2327
|
-
/* @__PURE__ */ (0,
|
|
2700
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react2.Plus, { size: 18 }),
|
|
2701
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "sr-only", children: t("composer.openMenu") })
|
|
2328
2702
|
]
|
|
2329
2703
|
}
|
|
2330
2704
|
) }),
|
|
2331
|
-
/* @__PURE__ */ (0,
|
|
2705
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2332
2706
|
DropdownMenuContent,
|
|
2333
2707
|
{
|
|
2334
2708
|
align: "start",
|
|
@@ -2339,22 +2713,22 @@ function ComposerMenu({
|
|
|
2339
2713
|
activePanel ? "w-80 min-w-72" : "w-72",
|
|
2340
2714
|
roundedClass
|
|
2341
2715
|
),
|
|
2342
|
-
children: activePanel ? renderCapabilityPanel(activePanel) : /* @__PURE__ */ (0,
|
|
2343
|
-
attachmentsEnabled && /* @__PURE__ */ (0,
|
|
2344
|
-
/* @__PURE__ */ (0,
|
|
2716
|
+
children: activePanel ? renderCapabilityPanel(activePanel) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
2717
|
+
attachmentsEnabled && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
2718
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2345
2719
|
DropdownMenuItem,
|
|
2346
2720
|
{
|
|
2347
2721
|
onSelect: handleAttachmentClick,
|
|
2348
2722
|
className: cn("gap-3 px-3 py-2", roundedClass),
|
|
2349
2723
|
children: [
|
|
2350
|
-
/* @__PURE__ */ (0,
|
|
2351
|
-
/* @__PURE__ */ (0,
|
|
2724
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "flex h-6 w-6 items-center justify-center text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react2.Paperclip, { size: 16 }) }),
|
|
2725
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: t("composer.addAttachment") })
|
|
2352
2726
|
]
|
|
2353
2727
|
}
|
|
2354
2728
|
),
|
|
2355
|
-
/* @__PURE__ */ (0,
|
|
2729
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DropdownMenuSeparator, {})
|
|
2356
2730
|
] }),
|
|
2357
|
-
/* @__PURE__ */ (0,
|
|
2731
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2358
2732
|
DropdownMenuItem,
|
|
2359
2733
|
{
|
|
2360
2734
|
role: "switch",
|
|
@@ -2369,9 +2743,9 @@ function ComposerMenu({
|
|
|
2369
2743
|
planModeEnabled && "bg-muted"
|
|
2370
2744
|
),
|
|
2371
2745
|
children: [
|
|
2372
|
-
/* @__PURE__ */ (0,
|
|
2373
|
-
/* @__PURE__ */ (0,
|
|
2374
|
-
/* @__PURE__ */ (0,
|
|
2746
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "flex h-6 w-6 items-center justify-center text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react2.ListChecks, { size: 16 }) }),
|
|
2747
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "min-w-0 flex-1 text-left", children: t("composer.planMode") }),
|
|
2748
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2375
2749
|
"span",
|
|
2376
2750
|
{
|
|
2377
2751
|
className: cn(
|
|
@@ -2379,7 +2753,7 @@ function ComposerMenu({
|
|
|
2379
2753
|
planModeEnabled ? "bg-primary" : "bg-muted-foreground/20"
|
|
2380
2754
|
),
|
|
2381
2755
|
"aria-hidden": "true",
|
|
2382
|
-
children: /* @__PURE__ */ (0,
|
|
2756
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2383
2757
|
"span",
|
|
2384
2758
|
{
|
|
2385
2759
|
className: cn(
|
|
@@ -2393,9 +2767,9 @@ function ComposerMenu({
|
|
|
2393
2767
|
]
|
|
2394
2768
|
}
|
|
2395
2769
|
),
|
|
2396
|
-
hasRuntimeCapabilities && /* @__PURE__ */ (0,
|
|
2397
|
-
/* @__PURE__ */ (0,
|
|
2398
|
-
skills.length > 0 && /* @__PURE__ */ (0,
|
|
2770
|
+
hasRuntimeCapabilities && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
2771
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DropdownMenuSeparator, {}),
|
|
2772
|
+
skills.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2399
2773
|
DropdownMenuItem,
|
|
2400
2774
|
{
|
|
2401
2775
|
onSelect: (event) => {
|
|
@@ -2404,14 +2778,14 @@ function ComposerMenu({
|
|
|
2404
2778
|
},
|
|
2405
2779
|
className: cn("gap-3 px-3 py-2", roundedClass),
|
|
2406
2780
|
children: [
|
|
2407
|
-
/* @__PURE__ */ (0,
|
|
2408
|
-
/* @__PURE__ */ (0,
|
|
2409
|
-
selectedSkillCount > 0 && /* @__PURE__ */ (0,
|
|
2410
|
-
/* @__PURE__ */ (0,
|
|
2781
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "flex h-6 w-6 items-center justify-center text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react2.Brain, { size: 16 }) }),
|
|
2782
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "min-w-0 flex-1 text-left", children: t("composer.capabilities.skills") }),
|
|
2783
|
+
selectedSkillCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "rounded-full bg-primary/10 px-1.5 py-0.5 text-xs font-medium text-primary", children: selectedSkillCount }),
|
|
2784
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react2.ChevronRight, { size: 16, className: "text-muted-foreground" })
|
|
2411
2785
|
]
|
|
2412
2786
|
}
|
|
2413
2787
|
),
|
|
2414
|
-
plugins.length > 0 && /* @__PURE__ */ (0,
|
|
2788
|
+
plugins.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2415
2789
|
DropdownMenuItem,
|
|
2416
2790
|
{
|
|
2417
2791
|
onSelect: (event) => {
|
|
@@ -2420,16 +2794,32 @@ function ComposerMenu({
|
|
|
2420
2794
|
},
|
|
2421
2795
|
className: cn("gap-3 px-3 py-2", roundedClass),
|
|
2422
2796
|
children: [
|
|
2423
|
-
/* @__PURE__ */ (0,
|
|
2424
|
-
/* @__PURE__ */ (0,
|
|
2425
|
-
selectedPluginCount > 0 && /* @__PURE__ */ (0,
|
|
2426
|
-
/* @__PURE__ */ (0,
|
|
2797
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "flex h-6 w-6 items-center justify-center text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react2.Plug, { size: 16 }) }),
|
|
2798
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "min-w-0 flex-1 text-left", children: t("composer.capabilities.plugins") }),
|
|
2799
|
+
selectedPluginCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "rounded-full bg-primary/10 px-1.5 py-0.5 text-xs font-medium text-primary", children: selectedPluginCount }),
|
|
2800
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react2.ChevronRight, { size: 16, className: "text-muted-foreground" })
|
|
2801
|
+
]
|
|
2802
|
+
}
|
|
2803
|
+
),
|
|
2804
|
+
subAgents.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2805
|
+
DropdownMenuItem,
|
|
2806
|
+
{
|
|
2807
|
+
onSelect: (event) => {
|
|
2808
|
+
event.preventDefault();
|
|
2809
|
+
setActivePanel("subAgents");
|
|
2810
|
+
},
|
|
2811
|
+
className: cn("gap-3 px-3 py-2", roundedClass),
|
|
2812
|
+
children: [
|
|
2813
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "flex h-6 w-6 items-center justify-center text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react2.Bot, { size: 16 }) }),
|
|
2814
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "min-w-0 flex-1 text-left", children: t("composer.capabilities.subAgents") }),
|
|
2815
|
+
selectedSubAgentCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "rounded-full bg-primary/10 px-1.5 py-0.5 text-xs font-medium text-primary", children: selectedSubAgentCount }),
|
|
2816
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react2.ChevronRight, { size: 16, className: "text-muted-foreground" })
|
|
2427
2817
|
]
|
|
2428
2818
|
}
|
|
2429
2819
|
)
|
|
2430
2820
|
] }),
|
|
2431
|
-
tools.length > 0 && /* @__PURE__ */ (0,
|
|
2432
|
-
tools.map((tool) => /* @__PURE__ */ (0,
|
|
2821
|
+
tools.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DropdownMenuSeparator, {}),
|
|
2822
|
+
tools.map((tool) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2433
2823
|
DropdownMenuItem,
|
|
2434
2824
|
{
|
|
2435
2825
|
onSelect: () => handleToolSelect(tool),
|
|
@@ -2439,8 +2829,8 @@ function ComposerMenu({
|
|
|
2439
2829
|
selectedTool?.id === tool.id && "bg-muted"
|
|
2440
2830
|
),
|
|
2441
2831
|
children: [
|
|
2442
|
-
/* @__PURE__ */ (0,
|
|
2443
|
-
/* @__PURE__ */ (0,
|
|
2832
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "flex h-6 w-6 items-center justify-center text-muted-foreground", children: getIconComponent(tool.icon) }),
|
|
2833
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: tool.label })
|
|
2444
2834
|
]
|
|
2445
2835
|
},
|
|
2446
2836
|
tool.id
|
|
@@ -2448,7 +2838,7 @@ function ComposerMenu({
|
|
|
2448
2838
|
] })
|
|
2449
2839
|
}
|
|
2450
2840
|
),
|
|
2451
|
-
planModeEnabled && /* @__PURE__ */ (0,
|
|
2841
|
+
planModeEnabled && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2452
2842
|
"button",
|
|
2453
2843
|
{
|
|
2454
2844
|
type: "button",
|
|
@@ -2460,8 +2850,8 @@ function ComposerMenu({
|
|
|
2460
2850
|
roundedClass
|
|
2461
2851
|
),
|
|
2462
2852
|
children: [
|
|
2463
|
-
/* @__PURE__ */ (0,
|
|
2464
|
-
/* @__PURE__ */ (0,
|
|
2853
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "relative inline-flex h-4 w-4 items-center justify-center", children: [
|
|
2854
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2465
2855
|
import_lucide_react2.ListChecks,
|
|
2466
2856
|
{
|
|
2467
2857
|
"data-slot": "plan-mode-indicator-icon",
|
|
@@ -2469,7 +2859,7 @@ function ComposerMenu({
|
|
|
2469
2859
|
className: "absolute transition-all duration-150 group-hover:scale-75 group-hover:opacity-0"
|
|
2470
2860
|
}
|
|
2471
2861
|
),
|
|
2472
|
-
/* @__PURE__ */ (0,
|
|
2862
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2473
2863
|
import_lucide_react2.X,
|
|
2474
2864
|
{
|
|
2475
2865
|
"data-slot": "plan-mode-remove-icon",
|
|
@@ -2478,7 +2868,7 @@ function ComposerMenu({
|
|
|
2478
2868
|
}
|
|
2479
2869
|
)
|
|
2480
2870
|
] }),
|
|
2481
|
-
/* @__PURE__ */ (0,
|
|
2871
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: t("composer.planModeActive") })
|
|
2482
2872
|
]
|
|
2483
2873
|
}
|
|
2484
2874
|
)
|
|
@@ -2487,73 +2877,7 @@ function ComposerMenu({
|
|
|
2487
2877
|
|
|
2488
2878
|
// src/components/composer/SendButton.tsx
|
|
2489
2879
|
var import_lucide_react3 = require("lucide-react");
|
|
2490
|
-
|
|
2491
|
-
// src/components/ui/tooltip.tsx
|
|
2492
|
-
var React7 = require("react");
|
|
2493
|
-
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"), 1);
|
|
2494
|
-
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
2495
|
-
function TooltipProvider({
|
|
2496
|
-
delayDuration = 0,
|
|
2497
|
-
...props
|
|
2498
|
-
}) {
|
|
2499
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2500
|
-
TooltipPrimitive.Provider,
|
|
2501
|
-
{
|
|
2502
|
-
"data-slot": "tooltip-provider",
|
|
2503
|
-
delayDuration,
|
|
2504
|
-
...props
|
|
2505
|
-
}
|
|
2506
|
-
);
|
|
2507
|
-
}
|
|
2508
|
-
function Tooltip({
|
|
2509
|
-
...props
|
|
2510
|
-
}) {
|
|
2511
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2512
|
-
TooltipPrimitive.Root,
|
|
2513
|
-
{
|
|
2514
|
-
"data-slot": "tooltip",
|
|
2515
|
-
...props
|
|
2516
|
-
}
|
|
2517
|
-
) });
|
|
2518
|
-
}
|
|
2519
|
-
function TooltipTrigger({
|
|
2520
|
-
...props
|
|
2521
|
-
}) {
|
|
2522
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2523
|
-
TooltipPrimitive.Trigger,
|
|
2524
|
-
{
|
|
2525
|
-
"data-slot": "tooltip-trigger",
|
|
2526
|
-
...props
|
|
2527
|
-
}
|
|
2528
|
-
);
|
|
2529
|
-
}
|
|
2530
|
-
function TooltipContent({
|
|
2531
|
-
className,
|
|
2532
|
-
sideOffset = 0,
|
|
2533
|
-
hideArrow = false,
|
|
2534
|
-
children,
|
|
2535
|
-
...props
|
|
2536
|
-
}) {
|
|
2537
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
2538
|
-
TooltipPrimitive.Content,
|
|
2539
|
-
{
|
|
2540
|
-
"data-slot": "tooltip-content",
|
|
2541
|
-
sideOffset,
|
|
2542
|
-
className: cn(
|
|
2543
|
-
"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",
|
|
2544
|
-
className
|
|
2545
|
-
),
|
|
2546
|
-
...props,
|
|
2547
|
-
children: [
|
|
2548
|
-
children,
|
|
2549
|
-
!hideArrow ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TooltipPrimitive.Arrow, { className: "bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" }) : null
|
|
2550
|
-
]
|
|
2551
|
-
}
|
|
2552
|
-
) });
|
|
2553
|
-
}
|
|
2554
|
-
|
|
2555
|
-
// src/components/composer/SendButton.tsx
|
|
2556
|
-
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
2880
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
2557
2881
|
function SendButton({
|
|
2558
2882
|
disabled = false,
|
|
2559
2883
|
isLoading = false,
|
|
@@ -2566,7 +2890,7 @@ function SendButton({
|
|
|
2566
2890
|
const { theme } = useTheme();
|
|
2567
2891
|
const roundedClass = getRoundedClass(theme.radius);
|
|
2568
2892
|
if (showStop) {
|
|
2569
|
-
return /* @__PURE__ */ (0,
|
|
2893
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2570
2894
|
"button",
|
|
2571
2895
|
{
|
|
2572
2896
|
type: "button",
|
|
@@ -2579,11 +2903,11 @@ function SendButton({
|
|
|
2579
2903
|
"hover:scale-105 active:scale-95"
|
|
2580
2904
|
),
|
|
2581
2905
|
"aria-label": stopLabel,
|
|
2582
|
-
children: /* @__PURE__ */ (0,
|
|
2906
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react3.Square, { size: 14, fill: "currentColor", stroke: "currentColor", strokeWidth: 0 })
|
|
2583
2907
|
}
|
|
2584
2908
|
);
|
|
2585
2909
|
}
|
|
2586
|
-
const button = /* @__PURE__ */ (0,
|
|
2910
|
+
const button = /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2587
2911
|
"button",
|
|
2588
2912
|
{
|
|
2589
2913
|
type: "submit",
|
|
@@ -2597,15 +2921,15 @@ function SendButton({
|
|
|
2597
2921
|
"disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:scale-100"
|
|
2598
2922
|
),
|
|
2599
2923
|
"aria-label": sendLabel,
|
|
2600
|
-
children: /* @__PURE__ */ (0,
|
|
2924
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react3.ArrowUp, { size: 18, strokeWidth: 2.5 })
|
|
2601
2925
|
}
|
|
2602
2926
|
);
|
|
2603
2927
|
if (!shortcuts?.length || disabled) {
|
|
2604
2928
|
return button;
|
|
2605
2929
|
}
|
|
2606
|
-
return /* @__PURE__ */ (0,
|
|
2607
|
-
/* @__PURE__ */ (0,
|
|
2608
|
-
/* @__PURE__ */ (0,
|
|
2930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Tooltip, { children: [
|
|
2931
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TooltipTrigger, { asChild: true, children: button }),
|
|
2932
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2609
2933
|
TooltipContent,
|
|
2610
2934
|
{
|
|
2611
2935
|
side: "top",
|
|
@@ -2615,13 +2939,13 @@ function SendButton({
|
|
|
2615
2939
|
"min-w-36 border border-border/70 bg-background px-3 py-2 text-foreground shadow-lg",
|
|
2616
2940
|
roundedClass
|
|
2617
2941
|
),
|
|
2618
|
-
children: /* @__PURE__ */ (0,
|
|
2942
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "space-y-1", children: shortcuts.map((shortcut) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
2619
2943
|
"div",
|
|
2620
2944
|
{
|
|
2621
2945
|
className: "flex items-center justify-between gap-4 text-sm",
|
|
2622
2946
|
children: [
|
|
2623
|
-
/* @__PURE__ */ (0,
|
|
2624
|
-
/* @__PURE__ */ (0,
|
|
2947
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "font-medium", children: shortcut.label }),
|
|
2948
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("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 })
|
|
2625
2949
|
]
|
|
2626
2950
|
},
|
|
2627
2951
|
`${shortcut.label}-${shortcut.keys}`
|
|
@@ -2632,28 +2956,28 @@ function SendButton({
|
|
|
2632
2956
|
}
|
|
2633
2957
|
|
|
2634
2958
|
// src/components/history/HistorySidebar.tsx
|
|
2635
|
-
var
|
|
2959
|
+
var React12 = __toESM(require("react"), 1);
|
|
2636
2960
|
var import_lucide_react5 = require("lucide-react");
|
|
2637
2961
|
|
|
2638
2962
|
// src/components/ui/scroll-area.tsx
|
|
2639
|
-
var
|
|
2963
|
+
var React10 = __toESM(require("react"), 1);
|
|
2640
2964
|
var ScrollAreaPrimitive = __toESM(require("@radix-ui/react-scroll-area"), 1);
|
|
2641
|
-
var
|
|
2642
|
-
var ScrollArea =
|
|
2965
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
2966
|
+
var ScrollArea = React10.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2643
2967
|
ScrollAreaPrimitive.Root,
|
|
2644
2968
|
{
|
|
2645
2969
|
ref,
|
|
2646
2970
|
className: cn("relative overflow-hidden", className),
|
|
2647
2971
|
...props,
|
|
2648
2972
|
children: [
|
|
2649
|
-
/* @__PURE__ */ (0,
|
|
2650
|
-
/* @__PURE__ */ (0,
|
|
2651
|
-
/* @__PURE__ */ (0,
|
|
2973
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ScrollAreaPrimitive.Viewport, { className: "h-full w-full rounded-[inherit]", children }),
|
|
2974
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ScrollBar, {}),
|
|
2975
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ScrollAreaPrimitive.Corner, {})
|
|
2652
2976
|
]
|
|
2653
2977
|
}
|
|
2654
2978
|
));
|
|
2655
2979
|
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
2656
|
-
var ScrollBar =
|
|
2980
|
+
var ScrollBar = React10.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2657
2981
|
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
2658
2982
|
{
|
|
2659
2983
|
ref,
|
|
@@ -2665,30 +2989,30 @@ var ScrollBar = React8.forwardRef(({ className, orientation = "vertical", ...pro
|
|
|
2665
2989
|
className
|
|
2666
2990
|
),
|
|
2667
2991
|
...props,
|
|
2668
|
-
children: /* @__PURE__ */ (0,
|
|
2992
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
|
|
2669
2993
|
}
|
|
2670
2994
|
));
|
|
2671
2995
|
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
2672
2996
|
|
|
2673
2997
|
// src/components/ui/sheet.tsx
|
|
2674
|
-
var
|
|
2998
|
+
var React11 = require("react");
|
|
2675
2999
|
var import_lucide_react4 = require("lucide-react");
|
|
2676
3000
|
var SheetPrimitive = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
2677
|
-
var
|
|
3001
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
2678
3002
|
function Sheet({ ...props }) {
|
|
2679
|
-
return /* @__PURE__ */ (0,
|
|
3003
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SheetPrimitive.Root, { ...props });
|
|
2680
3004
|
}
|
|
2681
3005
|
function SheetTrigger({ ...props }) {
|
|
2682
|
-
return /* @__PURE__ */ (0,
|
|
3006
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SheetPrimitive.Trigger, { ...props });
|
|
2683
3007
|
}
|
|
2684
3008
|
function SheetPortal({ ...props }) {
|
|
2685
|
-
return /* @__PURE__ */ (0,
|
|
3009
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SheetPrimitive.Portal, { ...props });
|
|
2686
3010
|
}
|
|
2687
3011
|
function SheetOverlay({
|
|
2688
3012
|
className,
|
|
2689
3013
|
...props
|
|
2690
3014
|
}) {
|
|
2691
|
-
return /* @__PURE__ */ (0,
|
|
3015
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2692
3016
|
SheetPrimitive.Overlay,
|
|
2693
3017
|
{
|
|
2694
3018
|
className: cn(
|
|
@@ -2712,9 +3036,9 @@ function SheetContent({
|
|
|
2712
3036
|
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",
|
|
2713
3037
|
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"
|
|
2714
3038
|
};
|
|
2715
|
-
return /* @__PURE__ */ (0,
|
|
2716
|
-
/* @__PURE__ */ (0,
|
|
2717
|
-
/* @__PURE__ */ (0,
|
|
3039
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(SheetPortal, { children: [
|
|
3040
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SheetOverlay, {}),
|
|
3041
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
2718
3042
|
SheetPrimitive.Content,
|
|
2719
3043
|
{
|
|
2720
3044
|
className: cn(
|
|
@@ -2725,9 +3049,9 @@ function SheetContent({
|
|
|
2725
3049
|
...props,
|
|
2726
3050
|
children: [
|
|
2727
3051
|
children,
|
|
2728
|
-
/* @__PURE__ */ (0,
|
|
2729
|
-
/* @__PURE__ */ (0,
|
|
2730
|
-
/* @__PURE__ */ (0,
|
|
3052
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(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: [
|
|
3053
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react4.X, { size: 16 }),
|
|
3054
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "sr-only", children: t("sheet.close") })
|
|
2731
3055
|
] })
|
|
2732
3056
|
]
|
|
2733
3057
|
}
|
|
@@ -2738,7 +3062,7 @@ function SheetHeader({
|
|
|
2738
3062
|
className,
|
|
2739
3063
|
...props
|
|
2740
3064
|
}) {
|
|
2741
|
-
return /* @__PURE__ */ (0,
|
|
3065
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2742
3066
|
"div",
|
|
2743
3067
|
{
|
|
2744
3068
|
className: cn(
|
|
@@ -2753,7 +3077,7 @@ function SheetTitle({
|
|
|
2753
3077
|
className,
|
|
2754
3078
|
...props
|
|
2755
3079
|
}) {
|
|
2756
|
-
return /* @__PURE__ */ (0,
|
|
3080
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2757
3081
|
SheetPrimitive.Title,
|
|
2758
3082
|
{
|
|
2759
3083
|
className: cn("text-lg font-semibold text-foreground", className),
|
|
@@ -2763,7 +3087,7 @@ function SheetTitle({
|
|
|
2763
3087
|
}
|
|
2764
3088
|
|
|
2765
3089
|
// src/components/history/HistorySidebar.tsx
|
|
2766
|
-
var
|
|
3090
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2767
3091
|
function HistorySidebar({
|
|
2768
3092
|
threads = [],
|
|
2769
3093
|
currentThreadId,
|
|
@@ -2774,7 +3098,7 @@ function HistorySidebar({
|
|
|
2774
3098
|
disabled = false
|
|
2775
3099
|
}) {
|
|
2776
3100
|
const { t } = useChatkitTranslation();
|
|
2777
|
-
const [open, setOpen] =
|
|
3101
|
+
const [open, setOpen] = React12.useState(false);
|
|
2778
3102
|
const handleNewThread = () => {
|
|
2779
3103
|
onNewThread?.();
|
|
2780
3104
|
setOpen(false);
|
|
@@ -2783,9 +3107,9 @@ function HistorySidebar({
|
|
|
2783
3107
|
onSelectThread?.(id);
|
|
2784
3108
|
setOpen(false);
|
|
2785
3109
|
};
|
|
2786
|
-
return /* @__PURE__ */ (0,
|
|
2787
|
-
/* @__PURE__ */ (0,
|
|
2788
|
-
/* @__PURE__ */ (0,
|
|
3110
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Sheet, { open, onOpenChange: setOpen, children: [
|
|
3111
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Tooltip, { children: [
|
|
3112
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SheetTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2789
3113
|
Button,
|
|
2790
3114
|
{
|
|
2791
3115
|
variant: "ghost",
|
|
@@ -2794,28 +3118,28 @@ function HistorySidebar({
|
|
|
2794
3118
|
className: "h-8 w-8 cursor-pointer",
|
|
2795
3119
|
"aria-label": t("history.threadHistory"),
|
|
2796
3120
|
children: [
|
|
2797
|
-
/* @__PURE__ */ (0,
|
|
2798
|
-
/* @__PURE__ */ (0,
|
|
3121
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react5.History, { size: 16 }),
|
|
3122
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "sr-only", children: t("history.threadHistory") })
|
|
2799
3123
|
]
|
|
2800
3124
|
}
|
|
2801
3125
|
) }) }) }),
|
|
2802
|
-
/* @__PURE__ */ (0,
|
|
3126
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TooltipContent, { side: "bottom", children: t("history.threadHistory") })
|
|
2803
3127
|
] }),
|
|
2804
|
-
/* @__PURE__ */ (0,
|
|
2805
|
-
/* @__PURE__ */ (0,
|
|
2806
|
-
/* @__PURE__ */ (0,
|
|
3128
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(SheetContent, { side: "right", className: "w-80 p-0", children: [
|
|
3129
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SheetHeader, { className: "border-b p-4", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SheetTitle, { children: t("history.title") }) }),
|
|
3130
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "p-4", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2807
3131
|
Button,
|
|
2808
3132
|
{
|
|
2809
3133
|
onClick: handleNewThread,
|
|
2810
3134
|
className: "w-full justify-start gap-2",
|
|
2811
3135
|
variant: "secondary",
|
|
2812
3136
|
children: [
|
|
2813
|
-
/* @__PURE__ */ (0,
|
|
3137
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react5.PlusCircle, { size: 16 }),
|
|
2814
3138
|
t("history.newThread")
|
|
2815
3139
|
]
|
|
2816
3140
|
}
|
|
2817
3141
|
) }),
|
|
2818
|
-
/* @__PURE__ */ (0,
|
|
3142
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ScrollArea, { className: "h-[calc(100vh-140px)]", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "px-4 pb-4", children: threads.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "py-8 text-center text-sm text-muted-foreground", children: t("history.empty") }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "space-y-1", children: threads.map((thread) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2819
3143
|
"div",
|
|
2820
3144
|
{
|
|
2821
3145
|
className: cn(
|
|
@@ -2825,9 +3149,9 @@ function HistorySidebar({
|
|
|
2825
3149
|
),
|
|
2826
3150
|
onClick: () => handleSelectThread(thread.id),
|
|
2827
3151
|
children: [
|
|
2828
|
-
/* @__PURE__ */ (0,
|
|
2829
|
-
/* @__PURE__ */ (0,
|
|
2830
|
-
showDelete && onDeleteThread && /* @__PURE__ */ (0,
|
|
3152
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react5.MessageSquare, { size: 16 }) }),
|
|
3153
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "flex-1 truncate", children: thread.title }),
|
|
3154
|
+
showDelete && onDeleteThread && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2831
3155
|
"button",
|
|
2832
3156
|
{
|
|
2833
3157
|
type: "button",
|
|
@@ -2836,7 +3160,7 @@ function HistorySidebar({
|
|
|
2836
3160
|
onDeleteThread(thread.id);
|
|
2837
3161
|
},
|
|
2838
3162
|
className: "opacity-0 group-hover:opacity-100 p-1 rounded hover:bg-destructive/10 hover:text-destructive transition-all",
|
|
2839
|
-
children: /* @__PURE__ */ (0,
|
|
3163
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react5.Trash2, { size: 14 })
|
|
2840
3164
|
}
|
|
2841
3165
|
)
|
|
2842
3166
|
]
|
|
@@ -2848,22 +3172,22 @@ function HistorySidebar({
|
|
|
2848
3172
|
}
|
|
2849
3173
|
|
|
2850
3174
|
// src/components/composer/pending-follow-ups.tsx
|
|
2851
|
-
var
|
|
3175
|
+
var React14 = __toESM(require("react"), 1);
|
|
2852
3176
|
var import_lucide_react6 = require("lucide-react");
|
|
2853
3177
|
|
|
2854
3178
|
// src/components/ui/popover.tsx
|
|
2855
|
-
var
|
|
3179
|
+
var React13 = require("react");
|
|
2856
3180
|
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"), 1);
|
|
2857
|
-
var
|
|
3181
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2858
3182
|
function Popover({
|
|
2859
3183
|
...props
|
|
2860
3184
|
}) {
|
|
2861
|
-
return /* @__PURE__ */ (0,
|
|
3185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
|
|
2862
3186
|
}
|
|
2863
3187
|
function PopoverTrigger({
|
|
2864
3188
|
...props
|
|
2865
3189
|
}) {
|
|
2866
|
-
return /* @__PURE__ */ (0,
|
|
3190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
2867
3191
|
}
|
|
2868
3192
|
function PopoverContent({
|
|
2869
3193
|
className,
|
|
@@ -2871,7 +3195,7 @@ function PopoverContent({
|
|
|
2871
3195
|
sideOffset = 4,
|
|
2872
3196
|
...props
|
|
2873
3197
|
}) {
|
|
2874
|
-
return /* @__PURE__ */ (0,
|
|
3198
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(PopoverPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2875
3199
|
PopoverPrimitive.Content,
|
|
2876
3200
|
{
|
|
2877
3201
|
"data-slot": "popover-content",
|
|
@@ -2887,7 +3211,7 @@ function PopoverContent({
|
|
|
2887
3211
|
}
|
|
2888
3212
|
|
|
2889
3213
|
// src/components/composer/pending-follow-ups.tsx
|
|
2890
|
-
var
|
|
3214
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2891
3215
|
function getPendingFollowUpText(item, referencedContentFallback) {
|
|
2892
3216
|
const text = item.request?.input?.input?.trim() ?? "";
|
|
2893
3217
|
if (text) {
|
|
@@ -2932,9 +3256,9 @@ function PendingFollowUps({
|
|
|
2932
3256
|
const { t } = useChatkitTranslation();
|
|
2933
3257
|
const rounded = useRoundedClasses();
|
|
2934
3258
|
const referencedContentFallback = t("chat.referencedContentOnly");
|
|
2935
|
-
const [isSettingsOpen, setIsSettingsOpen] =
|
|
2936
|
-
const [openMenuId, setOpenMenuId] =
|
|
2937
|
-
|
|
3259
|
+
const [isSettingsOpen, setIsSettingsOpen] = React14.useState(false);
|
|
3260
|
+
const [openMenuId, setOpenMenuId] = React14.useState(null);
|
|
3261
|
+
React14.useEffect(() => {
|
|
2938
3262
|
if (items.length === 0 && isSettingsOpen) {
|
|
2939
3263
|
setIsSettingsOpen(false);
|
|
2940
3264
|
}
|
|
@@ -2945,7 +3269,7 @@ function PendingFollowUps({
|
|
|
2945
3269
|
if (items.length === 0) {
|
|
2946
3270
|
return null;
|
|
2947
3271
|
}
|
|
2948
|
-
return /* @__PURE__ */ (0,
|
|
3272
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2949
3273
|
"div",
|
|
2950
3274
|
{
|
|
2951
3275
|
className: cn(
|
|
@@ -2954,11 +3278,11 @@ function PendingFollowUps({
|
|
|
2954
3278
|
attachToComposer ? rounded.top : rounded.panel,
|
|
2955
3279
|
className
|
|
2956
3280
|
),
|
|
2957
|
-
children: /* @__PURE__ */ (0,
|
|
2958
|
-
/* @__PURE__ */ (0,
|
|
2959
|
-
/* @__PURE__ */ (0,
|
|
2960
|
-
/* @__PURE__ */ (0,
|
|
2961
|
-
/* @__PURE__ */ (0,
|
|
3281
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "space-y-1", children: [
|
|
3282
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center justify-between gap-3", children: [
|
|
3283
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "text-xs font-medium text-foreground", children: t("chat.followUps.pending") }),
|
|
3284
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Tooltip, { children: [
|
|
3285
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2962
3286
|
"button",
|
|
2963
3287
|
{
|
|
2964
3288
|
type: "button",
|
|
@@ -2972,15 +3296,15 @@ function PendingFollowUps({
|
|
|
2972
3296
|
"aria-expanded": isSettingsOpen,
|
|
2973
3297
|
"aria-controls": "follow-ups-settings-panel",
|
|
2974
3298
|
children: [
|
|
2975
|
-
/* @__PURE__ */ (0,
|
|
2976
|
-
/* @__PURE__ */ (0,
|
|
3299
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react6.SlidersHorizontal, { className: "h-3.5 w-3.5" }),
|
|
3300
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "sr-only", children: t("chat.followUps.settings") })
|
|
2977
3301
|
]
|
|
2978
3302
|
}
|
|
2979
3303
|
) }),
|
|
2980
|
-
/* @__PURE__ */ (0,
|
|
3304
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(TooltipContent, { side: "top", children: t("chat.followUps.settings") })
|
|
2981
3305
|
] })
|
|
2982
3306
|
] }),
|
|
2983
|
-
isSettingsOpen && /* @__PURE__ */ (0,
|
|
3307
|
+
isSettingsOpen && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2984
3308
|
"div",
|
|
2985
3309
|
{
|
|
2986
3310
|
id: "follow-ups-settings-panel",
|
|
@@ -2988,20 +3312,20 @@ function PendingFollowUps({
|
|
|
2988
3312
|
"border border-border/70 bg-muted/20 px-3 py-2",
|
|
2989
3313
|
rounded.panel
|
|
2990
3314
|
),
|
|
2991
|
-
children: /* @__PURE__ */ (0,
|
|
2992
|
-
/* @__PURE__ */ (0,
|
|
2993
|
-
/* @__PURE__ */ (0,
|
|
2994
|
-
/* @__PURE__ */ (0,
|
|
3315
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center justify-between gap-3", children: [
|
|
3316
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "min-w-0", children: [
|
|
3317
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "text-xs font-medium text-foreground", children: t("chat.followUps.label") }),
|
|
3318
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "text-[11px] text-muted-foreground", children: isLoading ? t("chat.followUps.activeHint") : t("chat.followUps.idleHint") })
|
|
2995
3319
|
] }),
|
|
2996
|
-
/* @__PURE__ */ (0,
|
|
3320
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2997
3321
|
"div",
|
|
2998
3322
|
{
|
|
2999
3323
|
className: cn(
|
|
3000
3324
|
"inline-flex shrink-0 border border-border bg-background p-1",
|
|
3001
3325
|
rounded.control
|
|
3002
3326
|
),
|
|
3003
|
-
children: ["queue", "steer"].map((behavior) => /* @__PURE__ */ (0,
|
|
3004
|
-
/* @__PURE__ */ (0,
|
|
3327
|
+
children: ["queue", "steer"].map((behavior) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Tooltip, { children: [
|
|
3328
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3005
3329
|
"button",
|
|
3006
3330
|
{
|
|
3007
3331
|
type: "button",
|
|
@@ -3017,7 +3341,7 @@ function PendingFollowUps({
|
|
|
3017
3341
|
children: behavior === "queue" ? t("chat.followUps.queue") : t("chat.followUps.steer")
|
|
3018
3342
|
}
|
|
3019
3343
|
) }),
|
|
3020
|
-
/* @__PURE__ */ (0,
|
|
3344
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(TooltipContent, { side: "top", children: behavior === "queue" ? t("chat.followUps.queueHint") : t("chat.followUps.steerHint") })
|
|
3021
3345
|
] }, behavior))
|
|
3022
3346
|
}
|
|
3023
3347
|
)
|
|
@@ -3026,18 +3350,18 @@ function PendingFollowUps({
|
|
|
3026
3350
|
),
|
|
3027
3351
|
items.map((item) => {
|
|
3028
3352
|
const canSendItemNow = item.mode === "queue" && canSendNow(item.id);
|
|
3029
|
-
return /* @__PURE__ */ (0,
|
|
3353
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3030
3354
|
"div",
|
|
3031
3355
|
{
|
|
3032
3356
|
className: cn(
|
|
3033
3357
|
"border border-border/50 bg-muted/15 px-2 py-1",
|
|
3034
3358
|
rounded.panel
|
|
3035
3359
|
),
|
|
3036
|
-
children: /* @__PURE__ */ (0,
|
|
3037
|
-
/* @__PURE__ */ (0,
|
|
3038
|
-
/* @__PURE__ */ (0,
|
|
3039
|
-
/* @__PURE__ */ (0,
|
|
3040
|
-
/* @__PURE__ */ (0,
|
|
3360
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-start gap-2.5", children: [
|
|
3361
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react6.CornerDownLeft, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
3362
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
3363
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-start gap-2", children: [
|
|
3364
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3041
3365
|
"div",
|
|
3042
3366
|
{
|
|
3043
3367
|
className: "truncate text-[13px] leading-5 text-foreground",
|
|
@@ -3051,8 +3375,8 @@ function PendingFollowUps({
|
|
|
3051
3375
|
)
|
|
3052
3376
|
}
|
|
3053
3377
|
) }),
|
|
3054
|
-
/* @__PURE__ */ (0,
|
|
3055
|
-
item.mode === "queue" && isLoading && /* @__PURE__ */ (0,
|
|
3378
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
3379
|
+
item.mode === "queue" && isLoading && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3056
3380
|
"button",
|
|
3057
3381
|
{
|
|
3058
3382
|
type: "button",
|
|
@@ -3066,7 +3390,7 @@ function PendingFollowUps({
|
|
|
3066
3390
|
children: t("chat.followUps.steerAction")
|
|
3067
3391
|
}
|
|
3068
3392
|
),
|
|
3069
|
-
canSendItemNow && /* @__PURE__ */ (0,
|
|
3393
|
+
canSendItemNow && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3070
3394
|
"button",
|
|
3071
3395
|
{
|
|
3072
3396
|
type: "button",
|
|
@@ -3080,7 +3404,7 @@ function PendingFollowUps({
|
|
|
3080
3404
|
children: t("chat.followUps.sendNow")
|
|
3081
3405
|
}
|
|
3082
3406
|
),
|
|
3083
|
-
item.mode === "queue" && /* @__PURE__ */ (0,
|
|
3407
|
+
item.mode === "queue" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3084
3408
|
"button",
|
|
3085
3409
|
{
|
|
3086
3410
|
type: "button",
|
|
@@ -3091,16 +3415,16 @@ function PendingFollowUps({
|
|
|
3091
3415
|
),
|
|
3092
3416
|
"aria-label": t("chat.followUps.remove"),
|
|
3093
3417
|
title: t("chat.followUps.remove"),
|
|
3094
|
-
children: /* @__PURE__ */ (0,
|
|
3418
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react6.Trash2, { size: 13 })
|
|
3095
3419
|
}
|
|
3096
3420
|
),
|
|
3097
|
-
item.mode === "queue" && /* @__PURE__ */ (0,
|
|
3421
|
+
item.mode === "queue" && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
3098
3422
|
Popover,
|
|
3099
3423
|
{
|
|
3100
3424
|
open: openMenuId === item.id,
|
|
3101
3425
|
onOpenChange: (open) => setOpenMenuId(open ? item.id : null),
|
|
3102
3426
|
children: [
|
|
3103
|
-
/* @__PURE__ */ (0,
|
|
3427
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3104
3428
|
"button",
|
|
3105
3429
|
{
|
|
3106
3430
|
type: "button",
|
|
@@ -3110,10 +3434,10 @@ function PendingFollowUps({
|
|
|
3110
3434
|
),
|
|
3111
3435
|
"aria-label": t("chat.followUps.more"),
|
|
3112
3436
|
title: t("chat.followUps.more"),
|
|
3113
|
-
children: /* @__PURE__ */ (0,
|
|
3437
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react6.Ellipsis, { size: 13 })
|
|
3114
3438
|
}
|
|
3115
3439
|
) }),
|
|
3116
|
-
/* @__PURE__ */ (0,
|
|
3440
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3117
3441
|
PopoverContent,
|
|
3118
3442
|
{
|
|
3119
3443
|
align: "end",
|
|
@@ -3122,8 +3446,8 @@ function PendingFollowUps({
|
|
|
3122
3446
|
"w-52 border-border/70 bg-background p-1.5",
|
|
3123
3447
|
rounded.panel
|
|
3124
3448
|
),
|
|
3125
|
-
children: /* @__PURE__ */ (0,
|
|
3126
|
-
/* @__PURE__ */ (0,
|
|
3449
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
3450
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
3127
3451
|
"button",
|
|
3128
3452
|
{
|
|
3129
3453
|
type: "button",
|
|
@@ -3136,12 +3460,12 @@ function PendingFollowUps({
|
|
|
3136
3460
|
rounded.control
|
|
3137
3461
|
),
|
|
3138
3462
|
children: [
|
|
3139
|
-
/* @__PURE__ */ (0,
|
|
3140
|
-
/* @__PURE__ */ (0,
|
|
3463
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react6.PencilLine, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
3464
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: t("chat.followUps.edit") })
|
|
3141
3465
|
]
|
|
3142
3466
|
}
|
|
3143
3467
|
),
|
|
3144
|
-
/* @__PURE__ */ (0,
|
|
3468
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
3145
3469
|
"button",
|
|
3146
3470
|
{
|
|
3147
3471
|
type: "button",
|
|
@@ -3154,8 +3478,8 @@ function PendingFollowUps({
|
|
|
3154
3478
|
rounded.control
|
|
3155
3479
|
),
|
|
3156
3480
|
children: [
|
|
3157
|
-
/* @__PURE__ */ (0,
|
|
3158
|
-
/* @__PURE__ */ (0,
|
|
3481
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react6.CornerDownLeft, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
3482
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: t("chat.followUps.turnOffQueueing") })
|
|
3159
3483
|
]
|
|
3160
3484
|
}
|
|
3161
3485
|
)
|
|
@@ -3167,9 +3491,9 @@ function PendingFollowUps({
|
|
|
3167
3491
|
)
|
|
3168
3492
|
] })
|
|
3169
3493
|
] }),
|
|
3170
|
-
/* @__PURE__ */ (0,
|
|
3171
|
-
/* @__PURE__ */ (0,
|
|
3172
|
-
/* @__PURE__ */ (0,
|
|
3494
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center gap-1.5 text-[10px] leading-4 text-muted-foreground", children: [
|
|
3495
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react6.Info, { className: "h-3 w-3 shrink-0" }),
|
|
3496
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "truncate", children: item.mode === "queue" ? canSendItemNow ? t("chat.followUps.manualQueueHint") : t("chat.followUps.queueHint") : t("chat.followUps.steerHint") })
|
|
3173
3497
|
] })
|
|
3174
3498
|
] })
|
|
3175
3499
|
] })
|
|
@@ -3183,9 +3507,9 @@ function PendingFollowUps({
|
|
|
3183
3507
|
}
|
|
3184
3508
|
|
|
3185
3509
|
// src/components/composer/pending-todos.tsx
|
|
3186
|
-
var
|
|
3510
|
+
var React15 = __toESM(require("react"), 1);
|
|
3187
3511
|
var import_lucide_react7 = require("lucide-react");
|
|
3188
|
-
var
|
|
3512
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
3189
3513
|
function useRoundedClasses2() {
|
|
3190
3514
|
const { theme } = useTheme();
|
|
3191
3515
|
return {
|
|
@@ -3200,12 +3524,12 @@ function useRoundedClasses2() {
|
|
|
3200
3524
|
}
|
|
3201
3525
|
function TodoStatusIcon({ status }) {
|
|
3202
3526
|
if (status === "completed") {
|
|
3203
|
-
return /* @__PURE__ */ (0,
|
|
3527
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.CheckCircle2, { className: "mt-1 h-4 w-4 shrink-0 text-emerald-600" });
|
|
3204
3528
|
}
|
|
3205
3529
|
if (status === "in_progress") {
|
|
3206
|
-
return /* @__PURE__ */ (0,
|
|
3530
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.CircleDashed, { className: "mt-1 h-4 w-4 shrink-0 text-foreground/70" });
|
|
3207
3531
|
}
|
|
3208
|
-
return /* @__PURE__ */ (0,
|
|
3532
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.Circle, { className: "mt-1 h-4 w-4 shrink-0 text-muted-foreground" });
|
|
3209
3533
|
}
|
|
3210
3534
|
function PendingTodos({
|
|
3211
3535
|
snapshot,
|
|
@@ -3214,16 +3538,16 @@ function PendingTodos({
|
|
|
3214
3538
|
}) {
|
|
3215
3539
|
const { t } = useChatkitTranslation();
|
|
3216
3540
|
const rounded = useRoundedClasses2();
|
|
3217
|
-
const listId =
|
|
3218
|
-
const [isCollapsed, setIsCollapsed] =
|
|
3219
|
-
|
|
3541
|
+
const listId = React15.useId();
|
|
3542
|
+
const [isCollapsed, setIsCollapsed] = React15.useState(false);
|
|
3543
|
+
React15.useEffect(() => {
|
|
3220
3544
|
setIsCollapsed(false);
|
|
3221
3545
|
}, [snapshot?.componentId]);
|
|
3222
3546
|
if (!snapshot || snapshot.items.length === 0) {
|
|
3223
3547
|
return null;
|
|
3224
3548
|
}
|
|
3225
3549
|
const completedCount = countCompletedTodos(snapshot.items);
|
|
3226
|
-
return /* @__PURE__ */ (0,
|
|
3550
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
3227
3551
|
"div",
|
|
3228
3552
|
{
|
|
3229
3553
|
"aria-live": "polite",
|
|
@@ -3234,7 +3558,7 @@ function PendingTodos({
|
|
|
3234
3558
|
className
|
|
3235
3559
|
),
|
|
3236
3560
|
children: [
|
|
3237
|
-
/* @__PURE__ */ (0,
|
|
3561
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
3238
3562
|
"button",
|
|
3239
3563
|
{
|
|
3240
3564
|
type: "button",
|
|
@@ -3243,14 +3567,14 @@ function PendingTodos({
|
|
|
3243
3567
|
"aria-controls": listId,
|
|
3244
3568
|
onClick: () => setIsCollapsed((prev) => !prev),
|
|
3245
3569
|
children: [
|
|
3246
|
-
/* @__PURE__ */ (0,
|
|
3247
|
-
/* @__PURE__ */ (0,
|
|
3248
|
-
/* @__PURE__ */ (0,
|
|
3570
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex min-w-0 items-center gap-2 text-sm font-medium text-foreground", children: [
|
|
3571
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.ListTodo, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
|
|
3572
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "truncate", children: t("chat.todos.summary", {
|
|
3249
3573
|
total: snapshot.items.length,
|
|
3250
3574
|
completed: completedCount
|
|
3251
3575
|
}) })
|
|
3252
3576
|
] }),
|
|
3253
|
-
/* @__PURE__ */ (0,
|
|
3577
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex items-center shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3254
3578
|
import_lucide_react7.ChevronDown,
|
|
3255
3579
|
{
|
|
3256
3580
|
className: cn(
|
|
@@ -3262,13 +3586,13 @@ function PendingTodos({
|
|
|
3262
3586
|
]
|
|
3263
3587
|
}
|
|
3264
3588
|
),
|
|
3265
|
-
!isCollapsed && /* @__PURE__ */ (0,
|
|
3589
|
+
!isCollapsed && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("ol", { id: listId, className: "mt-3 space-y-2.5", children: snapshot.items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
3266
3590
|
"li",
|
|
3267
3591
|
{
|
|
3268
3592
|
className: "grid min-w-0 grid-cols-[16px_24px_minmax(0,1fr)] items-start gap-2 overflow-hidden",
|
|
3269
3593
|
children: [
|
|
3270
|
-
/* @__PURE__ */ (0,
|
|
3271
|
-
/* @__PURE__ */ (0,
|
|
3594
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TodoStatusIcon, { status: item.status }),
|
|
3595
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
3272
3596
|
"span",
|
|
3273
3597
|
{
|
|
3274
3598
|
className: cn(
|
|
@@ -3281,7 +3605,7 @@ function PendingTodos({
|
|
|
3281
3605
|
]
|
|
3282
3606
|
}
|
|
3283
3607
|
),
|
|
3284
|
-
/* @__PURE__ */ (0,
|
|
3608
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3285
3609
|
"span",
|
|
3286
3610
|
{
|
|
3287
3611
|
title: item.content,
|
|
@@ -3302,9 +3626,9 @@ function PendingTodos({
|
|
|
3302
3626
|
}
|
|
3303
3627
|
|
|
3304
3628
|
// src/components/composer/request-user-input-panel.tsx
|
|
3305
|
-
var
|
|
3629
|
+
var React16 = __toESM(require("react"), 1);
|
|
3306
3630
|
var import_lucide_react8 = require("lucide-react");
|
|
3307
|
-
var
|
|
3631
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
3308
3632
|
var emptyQuestions = [];
|
|
3309
3633
|
function useRoundedClasses3() {
|
|
3310
3634
|
const { theme } = useTheme();
|
|
@@ -3430,21 +3754,21 @@ function RequestUserInputPanel({
|
|
|
3430
3754
|
}) {
|
|
3431
3755
|
const { t } = useChatkitTranslation();
|
|
3432
3756
|
const rounded = useRoundedClasses3();
|
|
3433
|
-
const [drafts, setDrafts] =
|
|
3434
|
-
const [currentQuestionIndex, setCurrentQuestionIndex] =
|
|
3435
|
-
const otherInputRef =
|
|
3757
|
+
const [drafts, setDrafts] = React16.useState({});
|
|
3758
|
+
const [currentQuestionIndex, setCurrentQuestionIndex] = React16.useState(0);
|
|
3759
|
+
const otherInputRef = React16.useRef(null);
|
|
3436
3760
|
const questions = request?.params.questions ?? emptyQuestions;
|
|
3437
|
-
|
|
3761
|
+
React16.useEffect(() => {
|
|
3438
3762
|
setDrafts({});
|
|
3439
3763
|
setCurrentQuestionIndex(0);
|
|
3440
3764
|
}, [request?.id]);
|
|
3441
|
-
|
|
3765
|
+
React16.useEffect(() => {
|
|
3442
3766
|
if (questions.length === 0) return;
|
|
3443
3767
|
setCurrentQuestionIndex(
|
|
3444
3768
|
(index) => Math.min(Math.max(index, 0), questions.length - 1)
|
|
3445
3769
|
);
|
|
3446
3770
|
}, [questions.length]);
|
|
3447
|
-
const setQuestionDraft =
|
|
3771
|
+
const setQuestionDraft = React16.useCallback(
|
|
3448
3772
|
(questionId, draft) => {
|
|
3449
3773
|
setDrafts((previous) => ({
|
|
3450
3774
|
...previous,
|
|
@@ -3453,10 +3777,10 @@ function RequestUserInputPanel({
|
|
|
3453
3777
|
},
|
|
3454
3778
|
[]
|
|
3455
3779
|
);
|
|
3456
|
-
const focusOtherInput =
|
|
3780
|
+
const focusOtherInput = React16.useCallback(() => {
|
|
3457
3781
|
window.setTimeout(() => otherInputRef.current?.focus(), 0);
|
|
3458
3782
|
}, []);
|
|
3459
|
-
const selectOption =
|
|
3783
|
+
const selectOption = React16.useCallback(
|
|
3460
3784
|
(question, optionIndex) => {
|
|
3461
3785
|
const previousDraft = drafts[question.id];
|
|
3462
3786
|
setQuestionDraft(question.id, {
|
|
@@ -3467,7 +3791,7 @@ function RequestUserInputPanel({
|
|
|
3467
3791
|
},
|
|
3468
3792
|
[drafts, setQuestionDraft]
|
|
3469
3793
|
);
|
|
3470
|
-
const selectOther =
|
|
3794
|
+
const selectOther = React16.useCallback(
|
|
3471
3795
|
(question, otherText2) => {
|
|
3472
3796
|
const previousDraft = drafts[question.id];
|
|
3473
3797
|
setQuestionDraft(question.id, {
|
|
@@ -3478,7 +3802,7 @@ function RequestUserInputPanel({
|
|
|
3478
3802
|
},
|
|
3479
3803
|
[drafts, focusOtherInput, setQuestionDraft]
|
|
3480
3804
|
);
|
|
3481
|
-
const goToQuestion =
|
|
3805
|
+
const goToQuestion = React16.useCallback(
|
|
3482
3806
|
(index) => {
|
|
3483
3807
|
if (questions.length === 0) return;
|
|
3484
3808
|
setCurrentQuestionIndex(
|
|
@@ -3487,7 +3811,7 @@ function RequestUserInputPanel({
|
|
|
3487
3811
|
},
|
|
3488
3812
|
[questions.length]
|
|
3489
3813
|
);
|
|
3490
|
-
const answers =
|
|
3814
|
+
const answers = React16.useMemo(
|
|
3491
3815
|
() => questions.map((question) => getAnswerForQuestion(question, drafts[question.id])).filter((answer) => Boolean(answer)),
|
|
3492
3816
|
[drafts, questions]
|
|
3493
3817
|
);
|
|
@@ -3496,11 +3820,11 @@ function RequestUserInputPanel({
|
|
|
3496
3820
|
const currentDraft = currentQuestion ? drafts[currentQuestion.id] : void 0;
|
|
3497
3821
|
const currentAnswer = currentQuestion ? getAnswerForQuestion(currentQuestion, currentDraft) : null;
|
|
3498
3822
|
const isLastQuestion = currentQuestionIndex === questions.length - 1;
|
|
3499
|
-
const buildAnswersFromDrafts =
|
|
3823
|
+
const buildAnswersFromDrafts = React16.useCallback(
|
|
3500
3824
|
(nextDrafts) => questions.map((question) => getAnswerForQuestion(question, nextDrafts[question.id])).filter((answer) => Boolean(answer)),
|
|
3501
3825
|
[questions]
|
|
3502
3826
|
);
|
|
3503
|
-
const submitOrFocusFirstMissing =
|
|
3827
|
+
const submitOrFocusFirstMissing = React16.useCallback(
|
|
3504
3828
|
(nextDrafts) => {
|
|
3505
3829
|
const nextAnswers = buildAnswersFromDrafts(nextDrafts);
|
|
3506
3830
|
if (nextAnswers.length === questions.length) {
|
|
@@ -3516,7 +3840,7 @@ function RequestUserInputPanel({
|
|
|
3516
3840
|
},
|
|
3517
3841
|
[buildAnswersFromDrafts, goToQuestion, onSubmit, questions]
|
|
3518
3842
|
);
|
|
3519
|
-
const activateOption =
|
|
3843
|
+
const activateOption = React16.useCallback(
|
|
3520
3844
|
(question, optionIndex) => {
|
|
3521
3845
|
const previousDraft = drafts[question.id];
|
|
3522
3846
|
const nextDrafts = {
|
|
@@ -3542,7 +3866,7 @@ function RequestUserInputPanel({
|
|
|
3542
3866
|
submitOrFocusFirstMissing
|
|
3543
3867
|
]
|
|
3544
3868
|
);
|
|
3545
|
-
const chooseChoiceByIndex =
|
|
3869
|
+
const chooseChoiceByIndex = React16.useCallback(
|
|
3546
3870
|
(choiceIndex) => {
|
|
3547
3871
|
if (!currentQuestion) return;
|
|
3548
3872
|
if (choiceIndex < 0) return;
|
|
@@ -3556,7 +3880,7 @@ function RequestUserInputPanel({
|
|
|
3556
3880
|
},
|
|
3557
3881
|
[currentQuestion, selectOption, selectOther]
|
|
3558
3882
|
);
|
|
3559
|
-
const moveCurrentChoice =
|
|
3883
|
+
const moveCurrentChoice = React16.useCallback(
|
|
3560
3884
|
(direction) => {
|
|
3561
3885
|
if (!currentQuestion) return;
|
|
3562
3886
|
const choiceCount = currentQuestion.options.length + 1;
|
|
@@ -3566,7 +3890,7 @@ function RequestUserInputPanel({
|
|
|
3566
3890
|
},
|
|
3567
3891
|
[chooseChoiceByIndex, currentDraft, currentQuestion]
|
|
3568
3892
|
);
|
|
3569
|
-
const handleContinue =
|
|
3893
|
+
const handleContinue = React16.useCallback(() => {
|
|
3570
3894
|
if (!currentAnswer) return;
|
|
3571
3895
|
if (!isLastQuestion) {
|
|
3572
3896
|
goToQuestion(currentQuestionIndex + 1);
|
|
@@ -3593,7 +3917,7 @@ function RequestUserInputPanel({
|
|
|
3593
3917
|
onSubmit,
|
|
3594
3918
|
questions
|
|
3595
3919
|
]);
|
|
3596
|
-
|
|
3920
|
+
React16.useEffect(() => {
|
|
3597
3921
|
if (!request) return;
|
|
3598
3922
|
const handleKeyDown = (event) => {
|
|
3599
3923
|
if (event.isComposing) return;
|
|
@@ -3668,7 +3992,7 @@ function RequestUserInputPanel({
|
|
|
3668
3992
|
}));
|
|
3669
3993
|
};
|
|
3670
3994
|
const otherText = currentDraft?.otherText ?? "";
|
|
3671
|
-
return /* @__PURE__ */ (0,
|
|
3995
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
3672
3996
|
"section",
|
|
3673
3997
|
{
|
|
3674
3998
|
"aria-label": t("composer.requestUserInput.title"),
|
|
@@ -3681,9 +4005,9 @@ function RequestUserInputPanel({
|
|
|
3681
4005
|
className
|
|
3682
4006
|
),
|
|
3683
4007
|
children: [
|
|
3684
|
-
/* @__PURE__ */ (0,
|
|
3685
|
-
/* @__PURE__ */ (0,
|
|
3686
|
-
/* @__PURE__ */ (0,
|
|
4008
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
|
|
4009
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "min-w-0", children: [
|
|
4010
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3687
4011
|
"div",
|
|
3688
4012
|
{
|
|
3689
4013
|
className: cn(
|
|
@@ -3693,7 +4017,7 @@ function RequestUserInputPanel({
|
|
|
3693
4017
|
children: currentQuestion.header
|
|
3694
4018
|
}
|
|
3695
4019
|
),
|
|
3696
|
-
/* @__PURE__ */ (0,
|
|
4020
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3697
4021
|
"h3",
|
|
3698
4022
|
{
|
|
3699
4023
|
className: cn(
|
|
@@ -3704,7 +4028,7 @@ function RequestUserInputPanel({
|
|
|
3704
4028
|
}
|
|
3705
4029
|
)
|
|
3706
4030
|
] }),
|
|
3707
|
-
questions.length > 1 ? /* @__PURE__ */ (0,
|
|
4031
|
+
questions.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
3708
4032
|
"div",
|
|
3709
4033
|
{
|
|
3710
4034
|
className: cn(
|
|
@@ -3712,7 +4036,7 @@ function RequestUserInputPanel({
|
|
|
3712
4036
|
rounded.density.pager
|
|
3713
4037
|
),
|
|
3714
4038
|
children: [
|
|
3715
|
-
/* @__PURE__ */ (0,
|
|
4039
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3716
4040
|
"button",
|
|
3717
4041
|
{
|
|
3718
4042
|
type: "button",
|
|
@@ -3723,14 +4047,14 @@ function RequestUserInputPanel({
|
|
|
3723
4047
|
rounded.density.pagerButton
|
|
3724
4048
|
),
|
|
3725
4049
|
"aria-label": t("composer.requestUserInput.previousQuestion"),
|
|
3726
|
-
children: /* @__PURE__ */ (0,
|
|
4050
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.ChevronLeft, { className: rounded.density.pagerIcon })
|
|
3727
4051
|
}
|
|
3728
4052
|
),
|
|
3729
|
-
/* @__PURE__ */ (0,
|
|
4053
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "min-w-12 text-center", children: t("composer.requestUserInput.questionProgress", {
|
|
3730
4054
|
current: currentQuestionIndex + 1,
|
|
3731
4055
|
total: questions.length
|
|
3732
4056
|
}) }),
|
|
3733
|
-
/* @__PURE__ */ (0,
|
|
4057
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3734
4058
|
"button",
|
|
3735
4059
|
{
|
|
3736
4060
|
type: "button",
|
|
@@ -3741,18 +4065,18 @@ function RequestUserInputPanel({
|
|
|
3741
4065
|
rounded.density.pagerButton
|
|
3742
4066
|
),
|
|
3743
4067
|
"aria-label": t("composer.requestUserInput.nextQuestion"),
|
|
3744
|
-
children: /* @__PURE__ */ (0,
|
|
4068
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.ChevronRight, { className: rounded.density.pagerIcon })
|
|
3745
4069
|
}
|
|
3746
4070
|
)
|
|
3747
4071
|
]
|
|
3748
4072
|
}
|
|
3749
4073
|
) : null
|
|
3750
4074
|
] }),
|
|
3751
|
-
/* @__PURE__ */ (0,
|
|
4075
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: rounded.density.choices, children: [
|
|
3752
4076
|
currentQuestion.options.map((option, optionIndex) => {
|
|
3753
4077
|
const selected = currentDraft?.type === "option" && currentDraft.optionIndex === optionIndex;
|
|
3754
4078
|
const parsedLabel = parseRecommendedLabel(option.label);
|
|
3755
|
-
return /* @__PURE__ */ (0,
|
|
4079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
3756
4080
|
"div",
|
|
3757
4081
|
{
|
|
3758
4082
|
role: "button",
|
|
@@ -3774,20 +4098,20 @@ function RequestUserInputPanel({
|
|
|
3774
4098
|
selected ? "bg-muted text-foreground" : "text-foreground/90 hover:bg-muted/55"
|
|
3775
4099
|
),
|
|
3776
4100
|
children: [
|
|
3777
|
-
/* @__PURE__ */ (0,
|
|
4101
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "text-sm font-semibold text-muted-foreground", children: [
|
|
3778
4102
|
optionIndex + 1,
|
|
3779
4103
|
"."
|
|
3780
4104
|
] }),
|
|
3781
|
-
/* @__PURE__ */ (0,
|
|
3782
|
-
/* @__PURE__ */ (0,
|
|
3783
|
-
parsedLabel.recommended ? /* @__PURE__ */ (0,
|
|
3784
|
-
/* @__PURE__ */ (0,
|
|
4105
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "min-w-0", children: [
|
|
4106
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "inline min-w-0 text-sm font-semibold leading-5", children: parsedLabel.label }),
|
|
4107
|
+
parsedLabel.recommended ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "ml-1.5 inline-flex items-center gap-1 text-sm font-semibold text-primary", children: [
|
|
4108
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Check, { className: "h-3.5 w-3.5" }),
|
|
3785
4109
|
"(",
|
|
3786
4110
|
t("composer.requestUserInput.recommended"),
|
|
3787
4111
|
")"
|
|
3788
4112
|
] }) : null,
|
|
3789
|
-
option.description ? /* @__PURE__ */ (0,
|
|
3790
|
-
/* @__PURE__ */ (0,
|
|
4113
|
+
option.description ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Tooltip, { children: [
|
|
4114
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3791
4115
|
"button",
|
|
3792
4116
|
{
|
|
3793
4117
|
type: "button",
|
|
@@ -3799,10 +4123,10 @@ function RequestUserInputPanel({
|
|
|
3799
4123
|
"aria-label": t("composer.requestUserInput.optionInfo", {
|
|
3800
4124
|
label: parsedLabel.label
|
|
3801
4125
|
}),
|
|
3802
|
-
children: /* @__PURE__ */ (0,
|
|
4126
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Info, { className: "h-3.5 w-3.5" })
|
|
3803
4127
|
}
|
|
3804
4128
|
) }),
|
|
3805
|
-
/* @__PURE__ */ (0,
|
|
4129
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3806
4130
|
TooltipContent,
|
|
3807
4131
|
{
|
|
3808
4132
|
side: "top",
|
|
@@ -3813,15 +4137,15 @@ function RequestUserInputPanel({
|
|
|
3813
4137
|
)
|
|
3814
4138
|
] }) : null
|
|
3815
4139
|
] }),
|
|
3816
|
-
/* @__PURE__ */ (0,
|
|
4140
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "flex items-center justify-end text-muted-foreground", children: selected ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
3817
4141
|
"span",
|
|
3818
4142
|
{
|
|
3819
4143
|
"data-slot": "request-user-input-option-keyboard-hint",
|
|
3820
4144
|
"aria-hidden": "true",
|
|
3821
4145
|
className: "flex items-center gap-0.5",
|
|
3822
4146
|
children: [
|
|
3823
|
-
/* @__PURE__ */ (0,
|
|
3824
|
-
/* @__PURE__ */ (0,
|
|
4147
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.ArrowUp, { className: "h-4 w-4 opacity-45" }),
|
|
4148
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.ArrowDown, { className: "h-4 w-4 opacity-45" })
|
|
3825
4149
|
]
|
|
3826
4150
|
}
|
|
3827
4151
|
) : null })
|
|
@@ -3830,7 +4154,7 @@ function RequestUserInputPanel({
|
|
|
3830
4154
|
`${currentQuestion.id}-${optionIndex}`
|
|
3831
4155
|
);
|
|
3832
4156
|
}),
|
|
3833
|
-
/* @__PURE__ */ (0,
|
|
4157
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
3834
4158
|
"label",
|
|
3835
4159
|
{
|
|
3836
4160
|
className: cn(
|
|
@@ -3840,11 +4164,11 @@ function RequestUserInputPanel({
|
|
|
3840
4164
|
currentDraft?.type === "other" ? "bg-muted text-foreground" : "hover:bg-muted/55"
|
|
3841
4165
|
),
|
|
3842
4166
|
children: [
|
|
3843
|
-
/* @__PURE__ */ (0,
|
|
4167
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "text-sm font-semibold text-muted-foreground", children: [
|
|
3844
4168
|
currentQuestion.options.length + 1,
|
|
3845
4169
|
"."
|
|
3846
4170
|
] }),
|
|
3847
|
-
/* @__PURE__ */ (0,
|
|
4171
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "grid min-w-0 grid-cols-[auto_minmax(0,1fr)] items-center gap-3", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3848
4172
|
"input",
|
|
3849
4173
|
{
|
|
3850
4174
|
ref: otherInputRef,
|
|
@@ -3862,7 +4186,7 @@ function RequestUserInputPanel({
|
|
|
3862
4186
|
}
|
|
3863
4187
|
)
|
|
3864
4188
|
] }),
|
|
3865
|
-
/* @__PURE__ */ (0,
|
|
4189
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
3866
4190
|
"div",
|
|
3867
4191
|
{
|
|
3868
4192
|
className: cn(
|
|
@@ -3870,7 +4194,7 @@ function RequestUserInputPanel({
|
|
|
3870
4194
|
rounded.density.footer
|
|
3871
4195
|
),
|
|
3872
4196
|
children: [
|
|
3873
|
-
onDismiss ? /* @__PURE__ */ (0,
|
|
4197
|
+
onDismiss ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
3874
4198
|
"button",
|
|
3875
4199
|
{
|
|
3876
4200
|
type: "button",
|
|
@@ -3881,11 +4205,11 @@ function RequestUserInputPanel({
|
|
|
3881
4205
|
),
|
|
3882
4206
|
children: [
|
|
3883
4207
|
t("composer.requestUserInput.dismiss"),
|
|
3884
|
-
/* @__PURE__ */ (0,
|
|
4208
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("kbd", { className: "rounded-full bg-muted px-2 py-1 text-xs font-semibold text-muted-foreground", children: "ESC" })
|
|
3885
4209
|
]
|
|
3886
4210
|
}
|
|
3887
4211
|
) : null,
|
|
3888
|
-
/* @__PURE__ */ (0,
|
|
4212
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
3889
4213
|
"button",
|
|
3890
4214
|
{
|
|
3891
4215
|
type: "button",
|
|
@@ -3899,14 +4223,14 @@ function RequestUserInputPanel({
|
|
|
3899
4223
|
),
|
|
3900
4224
|
children: [
|
|
3901
4225
|
t("composer.requestUserInput.continue"),
|
|
3902
|
-
/* @__PURE__ */ (0,
|
|
4226
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3903
4227
|
"span",
|
|
3904
4228
|
{
|
|
3905
4229
|
className: cn(
|
|
3906
4230
|
"inline-flex items-center justify-center rounded-full bg-background/20",
|
|
3907
4231
|
rounded.density.continueIcon
|
|
3908
4232
|
),
|
|
3909
|
-
children: /* @__PURE__ */ (0,
|
|
4233
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.CornerDownLeft, { className: "h-3.5 w-3.5" })
|
|
3910
4234
|
}
|
|
3911
4235
|
)
|
|
3912
4236
|
]
|
|
@@ -3921,30 +4245,30 @@ function RequestUserInputPanel({
|
|
|
3921
4245
|
}
|
|
3922
4246
|
|
|
3923
4247
|
// src/components/thread/messages/ai.tsx
|
|
3924
|
-
var
|
|
4248
|
+
var React23 = __toESM(require("react"), 1);
|
|
3925
4249
|
var import_lucide_react13 = require("lucide-react");
|
|
3926
4250
|
|
|
3927
4251
|
// src/components/ui/badge.tsx
|
|
3928
|
-
var
|
|
3929
|
-
var
|
|
4252
|
+
var React17 = __toESM(require("react"), 1);
|
|
4253
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
3930
4254
|
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";
|
|
3931
4255
|
var variants = {
|
|
3932
4256
|
default: "bg-primary text-primary-foreground",
|
|
3933
4257
|
secondary: "bg-secondary text-secondary-foreground",
|
|
3934
4258
|
outline: "border-input text-foreground"
|
|
3935
4259
|
};
|
|
3936
|
-
var Badge =
|
|
4260
|
+
var Badge = React17.forwardRef(
|
|
3937
4261
|
({ className, variant = "default", ...props }, ref) => {
|
|
3938
|
-
return /* @__PURE__ */ (0,
|
|
4262
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { ref, className: cn(base, variants[variant], className), ...props });
|
|
3939
4263
|
}
|
|
3940
4264
|
);
|
|
3941
4265
|
Badge.displayName = "Badge";
|
|
3942
4266
|
|
|
3943
4267
|
// src/components/ui/card.tsx
|
|
3944
|
-
var
|
|
3945
|
-
var
|
|
3946
|
-
var Card =
|
|
3947
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
4268
|
+
var React18 = __toESM(require("react"), 1);
|
|
4269
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
4270
|
+
var Card = React18.forwardRef(
|
|
4271
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3948
4272
|
"div",
|
|
3949
4273
|
{
|
|
3950
4274
|
ref,
|
|
@@ -3957,45 +4281,45 @@ var Card = React16.forwardRef(
|
|
|
3957
4281
|
)
|
|
3958
4282
|
);
|
|
3959
4283
|
Card.displayName = "Card";
|
|
3960
|
-
var CardHeader =
|
|
3961
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
4284
|
+
var CardHeader = React18.forwardRef(
|
|
4285
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { ref, className: cn("flex flex-col gap-1.5 px-6 pt-6", className), ...props })
|
|
3962
4286
|
);
|
|
3963
4287
|
CardHeader.displayName = "CardHeader";
|
|
3964
|
-
var CardTitle =
|
|
4288
|
+
var CardTitle = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h3", { ref, className: cn("text-lg font-semibold leading-tight", className), ...props }));
|
|
3965
4289
|
CardTitle.displayName = "CardTitle";
|
|
3966
|
-
var CardDescription =
|
|
4290
|
+
var CardDescription = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { ref, className: cn("text-sm text-muted-foreground", className), ...props }));
|
|
3967
4291
|
CardDescription.displayName = "CardDescription";
|
|
3968
|
-
var CardContent =
|
|
3969
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
4292
|
+
var CardContent = React18.forwardRef(
|
|
4293
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { ref, className: cn("px-6 pb-6", className), ...props })
|
|
3970
4294
|
);
|
|
3971
4295
|
CardContent.displayName = "CardContent";
|
|
3972
|
-
var CardFooter =
|
|
3973
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
4296
|
+
var CardFooter = React18.forwardRef(
|
|
4297
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { ref, className: cn("flex items-center px-6 pb-6", className), ...props })
|
|
3974
4298
|
);
|
|
3975
4299
|
CardFooter.displayName = "CardFooter";
|
|
3976
|
-
var CardAction =
|
|
3977
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
4300
|
+
var CardAction = React18.forwardRef(
|
|
4301
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { ref, className: cn("ml-auto flex items-center", className), ...props })
|
|
3978
4302
|
);
|
|
3979
4303
|
CardAction.displayName = "CardAction";
|
|
3980
4304
|
|
|
3981
4305
|
// src/components/ui/tabs.tsx
|
|
3982
|
-
var
|
|
3983
|
-
var
|
|
3984
|
-
var TabsContext =
|
|
4306
|
+
var React19 = __toESM(require("react"), 1);
|
|
4307
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
4308
|
+
var TabsContext = React19.createContext(null);
|
|
3985
4309
|
function Tabs({ className, defaultValue, value, onValueChange, ...props }) {
|
|
3986
|
-
const [internalValue, setInternalValue] =
|
|
4310
|
+
const [internalValue, setInternalValue] = React19.useState(defaultValue ?? "");
|
|
3987
4311
|
const activeValue = value ?? internalValue;
|
|
3988
|
-
const setValue =
|
|
4312
|
+
const setValue = React19.useCallback(
|
|
3989
4313
|
(nextValue) => {
|
|
3990
4314
|
if (value === void 0) setInternalValue(nextValue);
|
|
3991
4315
|
onValueChange?.(nextValue);
|
|
3992
4316
|
},
|
|
3993
4317
|
[onValueChange, value]
|
|
3994
4318
|
);
|
|
3995
|
-
return /* @__PURE__ */ (0,
|
|
4319
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TabsContext.Provider, { value: { value: activeValue, setValue }, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: cn("w-full", className), ...props }) });
|
|
3996
4320
|
}
|
|
3997
|
-
var TabsList =
|
|
3998
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
4321
|
+
var TabsList = React19.forwardRef(
|
|
4322
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3999
4323
|
"div",
|
|
4000
4324
|
{
|
|
4001
4325
|
ref,
|
|
@@ -4009,14 +4333,14 @@ var TabsList = React17.forwardRef(
|
|
|
4009
4333
|
)
|
|
4010
4334
|
);
|
|
4011
4335
|
TabsList.displayName = "TabsList";
|
|
4012
|
-
var TabsTrigger =
|
|
4336
|
+
var TabsTrigger = React19.forwardRef(
|
|
4013
4337
|
({ className, value, onClick, ...props }, ref) => {
|
|
4014
|
-
const context =
|
|
4338
|
+
const context = React19.useContext(TabsContext);
|
|
4015
4339
|
if (!context) {
|
|
4016
4340
|
throw new Error("TabsTrigger must be used within Tabs");
|
|
4017
4341
|
}
|
|
4018
4342
|
const isActive = context.value === value;
|
|
4019
|
-
return /* @__PURE__ */ (0,
|
|
4343
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4020
4344
|
"button",
|
|
4021
4345
|
{
|
|
4022
4346
|
ref,
|
|
@@ -4038,14 +4362,14 @@ var TabsTrigger = React17.forwardRef(
|
|
|
4038
4362
|
}
|
|
4039
4363
|
);
|
|
4040
4364
|
TabsTrigger.displayName = "TabsTrigger";
|
|
4041
|
-
var TabsContent =
|
|
4365
|
+
var TabsContent = React19.forwardRef(
|
|
4042
4366
|
({ className, value, ...props }, ref) => {
|
|
4043
|
-
const context =
|
|
4367
|
+
const context = React19.useContext(TabsContext);
|
|
4044
4368
|
if (!context) {
|
|
4045
4369
|
throw new Error("TabsContent must be used within Tabs");
|
|
4046
4370
|
}
|
|
4047
4371
|
if (context.value !== value) return null;
|
|
4048
|
-
return /* @__PURE__ */ (0,
|
|
4372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4049
4373
|
"div",
|
|
4050
4374
|
{
|
|
4051
4375
|
ref,
|
|
@@ -4075,7 +4399,7 @@ var import_tsx = __toESM(require("react-syntax-highlighter/dist/esm/languages/pr
|
|
|
4075
4399
|
var import_python = __toESM(require("react-syntax-highlighter/dist/esm/languages/prism/python"), 1);
|
|
4076
4400
|
var import_prism = require("react-syntax-highlighter/dist/cjs/styles/prism");
|
|
4077
4401
|
var import_react4 = require("react");
|
|
4078
|
-
var
|
|
4402
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
4079
4403
|
import_react_syntax_highlighter.PrismAsyncLight.registerLanguage("js", import_tsx.default);
|
|
4080
4404
|
import_react_syntax_highlighter.PrismAsyncLight.registerLanguage("jsx", import_tsx.default);
|
|
4081
4405
|
import_react_syntax_highlighter.PrismAsyncLight.registerLanguage("ts", import_tsx.default);
|
|
@@ -4086,7 +4410,7 @@ var SyntaxHighlighter = ({
|
|
|
4086
4410
|
language,
|
|
4087
4411
|
className
|
|
4088
4412
|
}) => {
|
|
4089
|
-
return /* @__PURE__ */ (0,
|
|
4413
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4090
4414
|
import_react_syntax_highlighter.PrismAsyncLight,
|
|
4091
4415
|
{
|
|
4092
4416
|
language,
|
|
@@ -4107,14 +4431,14 @@ var SyntaxHighlighter = ({
|
|
|
4107
4431
|
var Dialog = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
4108
4432
|
var import_mermaid = __toESM(require("mermaid"), 1);
|
|
4109
4433
|
var import_lucide_react9 = require("lucide-react");
|
|
4110
|
-
var
|
|
4434
|
+
var React20 = __toESM(require("react"), 1);
|
|
4111
4435
|
|
|
4112
4436
|
// src/components/thread/tooltip-icon-button.tsx
|
|
4113
4437
|
var import_react5 = require("react");
|
|
4114
|
-
var
|
|
4438
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
4115
4439
|
var TooltipIconButton = (0, import_react5.forwardRef)(({ children, tooltip, side = "bottom", className, ...rest }, ref) => {
|
|
4116
|
-
return /* @__PURE__ */ (0,
|
|
4117
|
-
/* @__PURE__ */ (0,
|
|
4440
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Tooltip, { children: [
|
|
4441
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4118
4442
|
Button,
|
|
4119
4443
|
{
|
|
4120
4444
|
variant: "ghost",
|
|
@@ -4124,17 +4448,17 @@ var TooltipIconButton = (0, import_react5.forwardRef)(({ children, tooltip, side
|
|
|
4124
4448
|
ref,
|
|
4125
4449
|
children: [
|
|
4126
4450
|
children,
|
|
4127
|
-
/* @__PURE__ */ (0,
|
|
4451
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "sr-only", children: tooltip })
|
|
4128
4452
|
]
|
|
4129
4453
|
}
|
|
4130
4454
|
) }),
|
|
4131
|
-
/* @__PURE__ */ (0,
|
|
4455
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TooltipContent, { side, children: tooltip })
|
|
4132
4456
|
] }) });
|
|
4133
4457
|
});
|
|
4134
4458
|
TooltipIconButton.displayName = "TooltipIconButton";
|
|
4135
4459
|
|
|
4136
4460
|
// src/components/thread/mermaid-block.tsx
|
|
4137
|
-
var
|
|
4461
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
4138
4462
|
var HEX_COLOR_PATTERN = /^#([\da-f]{3,8})$/i;
|
|
4139
4463
|
var MERMAID_DIRECTIVE_PATTERN = /%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi;
|
|
4140
4464
|
var MERMAID_FRONTMATTER_PATTERN = /^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s;
|
|
@@ -4382,24 +4706,24 @@ function MermaidPreviewDialog({
|
|
|
4382
4706
|
svgMarkup,
|
|
4383
4707
|
title
|
|
4384
4708
|
}) {
|
|
4385
|
-
return /* @__PURE__ */ (0,
|
|
4386
|
-
/* @__PURE__ */ (0,
|
|
4387
|
-
/* @__PURE__ */ (0,
|
|
4388
|
-
/* @__PURE__ */ (0,
|
|
4389
|
-
/* @__PURE__ */ (0,
|
|
4390
|
-
/* @__PURE__ */ (0,
|
|
4709
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Dialog.Root, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Dialog.Portal, { children: [
|
|
4710
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(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" }),
|
|
4711
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(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: [
|
|
4712
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center justify-between gap-4 border-b border-border px-5 py-4", children: [
|
|
4713
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Dialog.Title, { className: "text-base font-semibold text-foreground", children: title }),
|
|
4714
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Dialog.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
4391
4715
|
"button",
|
|
4392
4716
|
{
|
|
4393
4717
|
type: "button",
|
|
4394
4718
|
className: "inline-flex size-10 items-center justify-center rounded-full border border-border bg-card text-muted-foreground transition-colors hover:text-foreground",
|
|
4395
4719
|
children: [
|
|
4396
|
-
/* @__PURE__ */ (0,
|
|
4397
|
-
/* @__PURE__ */ (0,
|
|
4720
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react9.X, { className: "size-4" }),
|
|
4721
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "sr-only", children: closeLabel })
|
|
4398
4722
|
]
|
|
4399
4723
|
}
|
|
4400
4724
|
) })
|
|
4401
4725
|
] }),
|
|
4402
|
-
/* @__PURE__ */ (0,
|
|
4726
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex-1 overflow-auto bg-card p-6", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4403
4727
|
"div",
|
|
4404
4728
|
{
|
|
4405
4729
|
"data-slot": "mermaid-preview",
|
|
@@ -4413,24 +4737,24 @@ function MermaidPreviewDialog({
|
|
|
4413
4737
|
function MermaidBlock({ code }) {
|
|
4414
4738
|
const { t } = useChatkitTranslation();
|
|
4415
4739
|
const { theme, isDarkMode } = useTheme();
|
|
4416
|
-
const containerRef =
|
|
4417
|
-
const renderHostRef =
|
|
4418
|
-
const renderSequenceRef =
|
|
4419
|
-
const copyResetTimeoutRef =
|
|
4420
|
-
const diagramId =
|
|
4421
|
-
const [activeTab, setActiveTab] =
|
|
4422
|
-
const [isCopied, setIsCopied] =
|
|
4423
|
-
const [isPreviewOpen, setIsPreviewOpen] =
|
|
4424
|
-
const [isRendering, setIsRendering] =
|
|
4425
|
-
const [renderError, setRenderError] =
|
|
4426
|
-
const [svgMarkup, setSvgMarkup] =
|
|
4427
|
-
const normalizedCode =
|
|
4428
|
-
const clearCopyResetTimeout =
|
|
4740
|
+
const containerRef = React20.useRef(null);
|
|
4741
|
+
const renderHostRef = React20.useRef(null);
|
|
4742
|
+
const renderSequenceRef = React20.useRef(0);
|
|
4743
|
+
const copyResetTimeoutRef = React20.useRef(null);
|
|
4744
|
+
const diagramId = React20.useId().replace(/:/g, "");
|
|
4745
|
+
const [activeTab, setActiveTab] = React20.useState("diagram");
|
|
4746
|
+
const [isCopied, setIsCopied] = React20.useState(false);
|
|
4747
|
+
const [isPreviewOpen, setIsPreviewOpen] = React20.useState(false);
|
|
4748
|
+
const [isRendering, setIsRendering] = React20.useState(true);
|
|
4749
|
+
const [renderError, setRenderError] = React20.useState(null);
|
|
4750
|
+
const [svgMarkup, setSvgMarkup] = React20.useState(null);
|
|
4751
|
+
const normalizedCode = React20.useMemo(() => normalizeMermaidCode(code), [code]);
|
|
4752
|
+
const clearCopyResetTimeout = React20.useCallback(() => {
|
|
4429
4753
|
if (copyResetTimeoutRef.current === null) return;
|
|
4430
4754
|
window.clearTimeout(copyResetTimeoutRef.current);
|
|
4431
4755
|
copyResetTimeoutRef.current = null;
|
|
4432
4756
|
}, []);
|
|
4433
|
-
|
|
4757
|
+
React20.useEffect(() => {
|
|
4434
4758
|
let isActive = true;
|
|
4435
4759
|
async function runRender() {
|
|
4436
4760
|
const container = containerRef.current;
|
|
@@ -4468,17 +4792,17 @@ function MermaidBlock({ code }) {
|
|
|
4468
4792
|
}
|
|
4469
4793
|
};
|
|
4470
4794
|
}, [diagramId, isDarkMode, normalizedCode, theme]);
|
|
4471
|
-
|
|
4795
|
+
React20.useEffect(() => {
|
|
4472
4796
|
clearCopyResetTimeout();
|
|
4473
4797
|
setIsCopied(false);
|
|
4474
4798
|
}, [activeTab, clearCopyResetTimeout, code]);
|
|
4475
|
-
|
|
4799
|
+
React20.useEffect(
|
|
4476
4800
|
() => () => {
|
|
4477
4801
|
clearCopyResetTimeout();
|
|
4478
4802
|
},
|
|
4479
4803
|
[clearCopyResetTimeout]
|
|
4480
4804
|
);
|
|
4481
|
-
const handleDownload =
|
|
4805
|
+
const handleDownload = React20.useCallback(() => {
|
|
4482
4806
|
if (!svgMarkup) return;
|
|
4483
4807
|
const blob = new Blob([svgMarkup], {
|
|
4484
4808
|
type: "image/svg+xml;charset=utf-8"
|
|
@@ -4492,7 +4816,7 @@ function MermaidBlock({ code }) {
|
|
|
4492
4816
|
anchor.remove();
|
|
4493
4817
|
window.URL.revokeObjectURL(url);
|
|
4494
4818
|
}, [diagramId, svgMarkup]);
|
|
4495
|
-
const handleCopyCode =
|
|
4819
|
+
const handleCopyCode = React20.useCallback(() => {
|
|
4496
4820
|
if (!code || isCopied) return;
|
|
4497
4821
|
navigator.clipboard.writeText(code).then(() => {
|
|
4498
4822
|
setIsCopied(true);
|
|
@@ -4506,21 +4830,21 @@ function MermaidBlock({ code }) {
|
|
|
4506
4830
|
}, [clearCopyResetTimeout, code, isCopied]);
|
|
4507
4831
|
const hasRenderedDiagram = svgMarkup !== null && !renderError;
|
|
4508
4832
|
const statusMessage = isRendering ? t("markdown.mermaid.rendering") : t("markdown.mermaid.failed");
|
|
4509
|
-
return /* @__PURE__ */ (0,
|
|
4510
|
-
/* @__PURE__ */ (0,
|
|
4833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
4834
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4511
4835
|
Tabs,
|
|
4512
4836
|
{
|
|
4513
4837
|
className: "w-full",
|
|
4514
4838
|
onValueChange: (value) => setActiveTab(value),
|
|
4515
4839
|
value: activeTab,
|
|
4516
|
-
children: /* @__PURE__ */ (0,
|
|
4840
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
4517
4841
|
"div",
|
|
4518
4842
|
{
|
|
4519
4843
|
ref: containerRef,
|
|
4520
4844
|
"data-slot": "mermaid-block",
|
|
4521
4845
|
className: "relative overflow-hidden text-card-foreground",
|
|
4522
4846
|
children: [
|
|
4523
|
-
/* @__PURE__ */ (0,
|
|
4847
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4524
4848
|
"div",
|
|
4525
4849
|
{
|
|
4526
4850
|
ref: renderHostRef,
|
|
@@ -4529,62 +4853,62 @@ function MermaidBlock({ code }) {
|
|
|
4529
4853
|
"data-slot": "mermaid-render-host"
|
|
4530
4854
|
}
|
|
4531
4855
|
),
|
|
4532
|
-
/* @__PURE__ */ (0,
|
|
4533
|
-
/* @__PURE__ */ (0,
|
|
4534
|
-
/* @__PURE__ */ (0,
|
|
4535
|
-
/* @__PURE__ */ (0,
|
|
4856
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-wrap items-center justify-between gap-3 px-4 py-3", children: [
|
|
4857
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex min-w-0 items-center gap-3", children: [
|
|
4858
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "inline-flex size-9 shrink-0 items-center justify-center rounded-full bg-muted text-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react9.Code2Icon, { className: "size-4" }) }),
|
|
4859
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "truncate text-base font-semibold text-foreground", children: t("markdown.mermaid.title") })
|
|
4536
4860
|
] }),
|
|
4537
|
-
/* @__PURE__ */ (0,
|
|
4538
|
-
/* @__PURE__ */ (0,
|
|
4539
|
-
activeTab === "diagram" && hasRenderedDiagram ? /* @__PURE__ */ (0,
|
|
4861
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
4862
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
4863
|
+
activeTab === "diagram" && hasRenderedDiagram ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4540
4864
|
TooltipIconButton,
|
|
4541
4865
|
{
|
|
4542
4866
|
onClick: handleDownload,
|
|
4543
4867
|
tooltip: t("markdown.mermaid.download"),
|
|
4544
|
-
children: /* @__PURE__ */ (0,
|
|
4868
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react9.DownloadIcon, { className: "size-4" })
|
|
4545
4869
|
}
|
|
4546
4870
|
) : null,
|
|
4547
|
-
activeTab === "diagram" && hasRenderedDiagram ? /* @__PURE__ */ (0,
|
|
4871
|
+
activeTab === "diagram" && hasRenderedDiagram ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4548
4872
|
TooltipIconButton,
|
|
4549
4873
|
{
|
|
4550
4874
|
onClick: () => setIsPreviewOpen(true),
|
|
4551
4875
|
tooltip: t("markdown.mermaid.fullScreen"),
|
|
4552
|
-
children: /* @__PURE__ */ (0,
|
|
4876
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react9.ExpandIcon, { className: "size-4" })
|
|
4553
4877
|
}
|
|
4554
4878
|
) : null,
|
|
4555
|
-
activeTab === "code" ? /* @__PURE__ */ (0,
|
|
4879
|
+
activeTab === "code" ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4556
4880
|
TooltipIconButton,
|
|
4557
4881
|
{
|
|
4558
4882
|
onClick: handleCopyCode,
|
|
4559
4883
|
tooltip: t("markdown.copy"),
|
|
4560
|
-
children: isCopied ? /* @__PURE__ */ (0,
|
|
4884
|
+
children: isCopied ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react9.CheckIcon, { className: "size-4" }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react9.CopyIcon, { className: "size-4" })
|
|
4561
4885
|
}
|
|
4562
4886
|
) : null
|
|
4563
4887
|
] }),
|
|
4564
|
-
/* @__PURE__ */ (0,
|
|
4565
|
-
/* @__PURE__ */ (0,
|
|
4566
|
-
/* @__PURE__ */ (0,
|
|
4888
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(TabsList, { children: [
|
|
4889
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TabsTrigger, { value: "diagram", children: t("markdown.mermaid.diagram") }),
|
|
4890
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TabsTrigger, { value: "code", children: t("markdown.mermaid.code") })
|
|
4567
4891
|
] })
|
|
4568
4892
|
] })
|
|
4569
4893
|
] }),
|
|
4570
|
-
/* @__PURE__ */ (0,
|
|
4571
|
-
renderError ? /* @__PURE__ */ (0,
|
|
4572
|
-
/* @__PURE__ */ (0,
|
|
4894
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "border-t border-border pt-4", children: [
|
|
4895
|
+
renderError ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { role: "alert", className: "mb-4 text-sm font-medium text-destructive", children: t("markdown.mermaid.failed") }) : null,
|
|
4896
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TabsContent, { value: "diagram", className: "mt-0 space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4573
4897
|
"div",
|
|
4574
4898
|
{
|
|
4575
4899
|
className: cn(
|
|
4576
4900
|
"relative overflow-auto rounded-[calc(var(--radius)+0.5rem)] border border-border bg-background p-4",
|
|
4577
4901
|
hasRenderedDiagram ? "[&_svg]:mx-auto [&_svg]:h-auto [&_svg]:w-full [&_svg]:max-w-none" : "min-h-[14rem]"
|
|
4578
4902
|
),
|
|
4579
|
-
children: hasRenderedDiagram ? /* @__PURE__ */ (0,
|
|
4903
|
+
children: hasRenderedDiagram ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4580
4904
|
"div",
|
|
4581
4905
|
{
|
|
4582
4906
|
"data-slot": "mermaid-diagram",
|
|
4583
4907
|
dangerouslySetInnerHTML: { __html: svgMarkup }
|
|
4584
4908
|
}
|
|
4585
|
-
) : /* @__PURE__ */ (0,
|
|
4586
|
-
isRendering ? /* @__PURE__ */ (0,
|
|
4587
|
-
/* @__PURE__ */ (0,
|
|
4909
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex min-h-[12rem] flex-col items-center justify-center gap-3 text-center text-muted-foreground", children: [
|
|
4910
|
+
isRendering ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react9.Loader2, { className: "size-5 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react9.TriangleAlert, { className: "size-5 text-destructive" }),
|
|
4911
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4588
4912
|
"p",
|
|
4589
4913
|
{
|
|
4590
4914
|
className: cn("text-sm font-medium", !isRendering && "text-destructive"),
|
|
@@ -4595,12 +4919,12 @@ function MermaidBlock({ code }) {
|
|
|
4595
4919
|
] })
|
|
4596
4920
|
}
|
|
4597
4921
|
) }),
|
|
4598
|
-
/* @__PURE__ */ (0,
|
|
4922
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TabsContent, { value: "code", className: "mt-0", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4599
4923
|
"pre",
|
|
4600
4924
|
{
|
|
4601
4925
|
"data-slot": "mermaid-code",
|
|
4602
4926
|
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",
|
|
4603
|
-
children: /* @__PURE__ */ (0,
|
|
4927
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("code", { className: "block whitespace-pre font-mono", children: code })
|
|
4604
4928
|
}
|
|
4605
4929
|
) })
|
|
4606
4930
|
] })
|
|
@@ -4609,7 +4933,7 @@ function MermaidBlock({ code }) {
|
|
|
4609
4933
|
)
|
|
4610
4934
|
}
|
|
4611
4935
|
),
|
|
4612
|
-
svgMarkup ? /* @__PURE__ */ (0,
|
|
4936
|
+
svgMarkup ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4613
4937
|
MermaidPreviewDialog,
|
|
4614
4938
|
{
|
|
4615
4939
|
closeLabel: t("sheet.close"),
|
|
@@ -4624,7 +4948,7 @@ function MermaidBlock({ code }) {
|
|
|
4624
4948
|
|
|
4625
4949
|
// src/components/thread/markdown-text.tsx
|
|
4626
4950
|
var import_katex_min = require("katex/dist/katex.min.css");
|
|
4627
|
-
var
|
|
4951
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
4628
4952
|
var markdownTableMinWidth = "max(7rem, calc(8rem * var(--density-spacing, 1)))";
|
|
4629
4953
|
var markdownTableCellPaddingInline = "calc(var(--density-padding, 1rem) * 1.25)";
|
|
4630
4954
|
var markdownTableCellPaddingBlock = "max(0.5rem, calc(var(--density-padding, 1rem) * 0.75))";
|
|
@@ -4729,7 +5053,7 @@ var splitProposedPlanSegments = (markdown) => {
|
|
|
4729
5053
|
return segments;
|
|
4730
5054
|
};
|
|
4731
5055
|
function MarkdownContent({ children }) {
|
|
4732
|
-
return /* @__PURE__ */ (0,
|
|
5056
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4733
5057
|
import_react_markdown.default,
|
|
4734
5058
|
{
|
|
4735
5059
|
remarkPlugins: [import_remark_gfm.default, import_remark_math.default],
|
|
@@ -4752,7 +5076,7 @@ function PlanCard({ children }) {
|
|
|
4752
5076
|
const onDownload = () => {
|
|
4753
5077
|
downloadMarkdown(planMarkdown);
|
|
4754
5078
|
};
|
|
4755
|
-
return /* @__PURE__ */ (0,
|
|
5079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
4756
5080
|
"section",
|
|
4757
5081
|
{
|
|
4758
5082
|
"data-slot": "markdown-plan-card",
|
|
@@ -4760,28 +5084,28 @@ function PlanCard({ children }) {
|
|
|
4760
5084
|
"relative my-5 max-w-4xl overflow-hidden rounded-2xl border border-border bg-muted/25 shadow-lg"
|
|
4761
5085
|
),
|
|
4762
5086
|
children: [
|
|
4763
|
-
/* @__PURE__ */ (0,
|
|
5087
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
4764
5088
|
"div",
|
|
4765
5089
|
{
|
|
4766
5090
|
"data-slot": "markdown-plan-card-header",
|
|
4767
5091
|
className: "flex items-center justify-between gap-3 bg-background/80 px-4 py-3",
|
|
4768
5092
|
children: [
|
|
4769
|
-
/* @__PURE__ */ (0,
|
|
4770
|
-
/* @__PURE__ */ (0,
|
|
4771
|
-
/* @__PURE__ */ (0,
|
|
5093
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
5094
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "inline-flex size-8 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react10.ListChecksIcon, { className: "size-4" }) }),
|
|
5095
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h2", { className: "truncate text-base font-semibold text-foreground", children: t("markdown.plan.title") })
|
|
4772
5096
|
] }),
|
|
4773
|
-
/* @__PURE__ */ (0,
|
|
4774
|
-
/* @__PURE__ */ (0,
|
|
5097
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
5098
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4775
5099
|
TooltipIconButton,
|
|
4776
5100
|
{
|
|
4777
5101
|
type: "button",
|
|
4778
5102
|
tooltip: t("markdown.plan.download"),
|
|
4779
5103
|
onClick: onDownload,
|
|
4780
5104
|
className: "text-muted-foreground hover:text-foreground",
|
|
4781
|
-
children: /* @__PURE__ */ (0,
|
|
5105
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react10.DownloadIcon, { className: "size-4" })
|
|
4782
5106
|
}
|
|
4783
5107
|
),
|
|
4784
|
-
/* @__PURE__ */ (0,
|
|
5108
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
4785
5109
|
TooltipIconButton,
|
|
4786
5110
|
{
|
|
4787
5111
|
type: "button",
|
|
@@ -4789,12 +5113,12 @@ function PlanCard({ children }) {
|
|
|
4789
5113
|
onClick: onCopy,
|
|
4790
5114
|
className: "text-muted-foreground hover:text-foreground",
|
|
4791
5115
|
children: [
|
|
4792
|
-
!isCopied && /* @__PURE__ */ (0,
|
|
4793
|
-
isCopied && /* @__PURE__ */ (0,
|
|
5116
|
+
!isCopied && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react10.CopyIcon, { className: "size-4" }),
|
|
5117
|
+
isCopied && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react10.CheckIcon, { className: "size-4" })
|
|
4794
5118
|
]
|
|
4795
5119
|
}
|
|
4796
5120
|
),
|
|
4797
|
-
/* @__PURE__ */ (0,
|
|
5121
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4798
5122
|
TooltipIconButton,
|
|
4799
5123
|
{
|
|
4800
5124
|
type: "button",
|
|
@@ -4803,7 +5127,7 @@ function PlanCard({ children }) {
|
|
|
4803
5127
|
"aria-controls": contentId,
|
|
4804
5128
|
onClick: () => setIsExpanded((previous) => !previous),
|
|
4805
5129
|
className: "text-muted-foreground hover:text-foreground",
|
|
4806
|
-
children: /* @__PURE__ */ (0,
|
|
5130
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4807
5131
|
import_lucide_react10.ChevronDownIcon,
|
|
4808
5132
|
{
|
|
4809
5133
|
className: cn(
|
|
@@ -4818,7 +5142,7 @@ function PlanCard({ children }) {
|
|
|
4818
5142
|
]
|
|
4819
5143
|
}
|
|
4820
5144
|
),
|
|
4821
|
-
/* @__PURE__ */ (0,
|
|
5145
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4822
5146
|
"div",
|
|
4823
5147
|
{
|
|
4824
5148
|
id: contentId,
|
|
@@ -4828,10 +5152,10 @@ function PlanCard({ children }) {
|
|
|
4828
5152
|
"relative w-full px-4 py-3 transition-[max-height] duration-300 ease-in-out",
|
|
4829
5153
|
isExpanded ? "max-h-[80vh] overflow-auto" : "max-h-[200px] overflow-hidden"
|
|
4830
5154
|
),
|
|
4831
|
-
children: /* @__PURE__ */ (0,
|
|
5155
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(MarkdownContent, { children: planMarkdown })
|
|
4832
5156
|
}
|
|
4833
5157
|
),
|
|
4834
|
-
!isExpanded && /* @__PURE__ */ (0,
|
|
5158
|
+
!isExpanded && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("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__ */ (0, import_jsx_runtime25.jsx)(
|
|
4835
5159
|
"button",
|
|
4836
5160
|
{
|
|
4837
5161
|
type: "button",
|
|
@@ -4866,16 +5190,16 @@ var CodeHeader = ({ language, code }) => {
|
|
|
4866
5190
|
if (!code || isCopied) return;
|
|
4867
5191
|
copyToClipboard(code);
|
|
4868
5192
|
};
|
|
4869
|
-
return /* @__PURE__ */ (0,
|
|
4870
|
-
/* @__PURE__ */ (0,
|
|
4871
|
-
/* @__PURE__ */ (0,
|
|
4872
|
-
!isCopied && /* @__PURE__ */ (0,
|
|
4873
|
-
isCopied && /* @__PURE__ */ (0,
|
|
5193
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("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: [
|
|
5194
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "lowercase [&>span]:text-xs", children: language }),
|
|
5195
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(TooltipIconButton, { tooltip: t("markdown.copy"), onClick: onCopy, children: [
|
|
5196
|
+
!isCopied && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react10.CopyIcon, {}),
|
|
5197
|
+
isCopied && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react10.CheckIcon, {})
|
|
4874
5198
|
] })
|
|
4875
5199
|
] });
|
|
4876
5200
|
};
|
|
4877
5201
|
var defaultComponents = {
|
|
4878
|
-
h1: ({ className, ...props }) => /* @__PURE__ */ (0,
|
|
5202
|
+
h1: ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4879
5203
|
"h1",
|
|
4880
5204
|
{
|
|
4881
5205
|
className: cn(
|
|
@@ -4885,7 +5209,7 @@ var defaultComponents = {
|
|
|
4885
5209
|
...stripMarkdownNode(props)
|
|
4886
5210
|
}
|
|
4887
5211
|
),
|
|
4888
|
-
h2: ({ className, ...props }) => /* @__PURE__ */ (0,
|
|
5212
|
+
h2: ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4889
5213
|
"h2",
|
|
4890
5214
|
{
|
|
4891
5215
|
className: cn(
|
|
@@ -4895,7 +5219,7 @@ var defaultComponents = {
|
|
|
4895
5219
|
...stripMarkdownNode(props)
|
|
4896
5220
|
}
|
|
4897
5221
|
),
|
|
4898
|
-
h3: ({ className, ...props }) => /* @__PURE__ */ (0,
|
|
5222
|
+
h3: ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4899
5223
|
"h3",
|
|
4900
5224
|
{
|
|
4901
5225
|
className: cn(
|
|
@@ -4905,7 +5229,7 @@ var defaultComponents = {
|
|
|
4905
5229
|
...stripMarkdownNode(props)
|
|
4906
5230
|
}
|
|
4907
5231
|
),
|
|
4908
|
-
h4: ({ className, ...props }) => /* @__PURE__ */ (0,
|
|
5232
|
+
h4: ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4909
5233
|
"h4",
|
|
4910
5234
|
{
|
|
4911
5235
|
className: cn(
|
|
@@ -4915,7 +5239,7 @@ var defaultComponents = {
|
|
|
4915
5239
|
...stripMarkdownNode(props)
|
|
4916
5240
|
}
|
|
4917
5241
|
),
|
|
4918
|
-
h5: ({ className, ...props }) => /* @__PURE__ */ (0,
|
|
5242
|
+
h5: ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4919
5243
|
"h5",
|
|
4920
5244
|
{
|
|
4921
5245
|
className: cn(
|
|
@@ -4925,21 +5249,21 @@ var defaultComponents = {
|
|
|
4925
5249
|
...stripMarkdownNode(props)
|
|
4926
5250
|
}
|
|
4927
5251
|
),
|
|
4928
|
-
h6: ({ className, ...props }) => /* @__PURE__ */ (0,
|
|
5252
|
+
h6: ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4929
5253
|
"h6",
|
|
4930
5254
|
{
|
|
4931
5255
|
className: cn("my-4 font-semibold first:mt-0 last:mb-0", className),
|
|
4932
5256
|
...stripMarkdownNode(props)
|
|
4933
5257
|
}
|
|
4934
5258
|
),
|
|
4935
|
-
p: ({ className, ...props }) => /* @__PURE__ */ (0,
|
|
5259
|
+
p: ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4936
5260
|
"p",
|
|
4937
5261
|
{
|
|
4938
5262
|
className: cn("mt-5 mb-5 leading-7 first:mt-0 last:mb-0", className),
|
|
4939
5263
|
...stripMarkdownNode(props)
|
|
4940
5264
|
}
|
|
4941
5265
|
),
|
|
4942
|
-
a: ({ className, ...props }) => /* @__PURE__ */ (0,
|
|
5266
|
+
a: ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4943
5267
|
"a",
|
|
4944
5268
|
{
|
|
4945
5269
|
className: cn(
|
|
@@ -4951,7 +5275,7 @@ var defaultComponents = {
|
|
|
4951
5275
|
...stripMarkdownNode(props)
|
|
4952
5276
|
}
|
|
4953
5277
|
),
|
|
4954
|
-
blockquote: ({ className, ...props }) => /* @__PURE__ */ (0,
|
|
5278
|
+
blockquote: ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4955
5279
|
"blockquote",
|
|
4956
5280
|
{
|
|
4957
5281
|
className: cn(
|
|
@@ -4961,14 +5285,14 @@ var defaultComponents = {
|
|
|
4961
5285
|
...stripMarkdownNode(props)
|
|
4962
5286
|
}
|
|
4963
5287
|
),
|
|
4964
|
-
ul: ({ className, ...props }) => /* @__PURE__ */ (0,
|
|
5288
|
+
ul: ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4965
5289
|
"ul",
|
|
4966
5290
|
{
|
|
4967
5291
|
className: cn("my-5 list-outside list-disc pl-6 [&>li]:mt-2", className),
|
|
4968
5292
|
...stripMarkdownNode(props)
|
|
4969
5293
|
}
|
|
4970
5294
|
),
|
|
4971
|
-
ol: ({ className, ...props }) => /* @__PURE__ */ (0,
|
|
5295
|
+
ol: ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4972
5296
|
"ol",
|
|
4973
5297
|
{
|
|
4974
5298
|
className: cn(
|
|
@@ -4978,19 +5302,19 @@ var defaultComponents = {
|
|
|
4978
5302
|
...stripMarkdownNode(props)
|
|
4979
5303
|
}
|
|
4980
5304
|
),
|
|
4981
|
-
hr: ({ className, ...props }) => /* @__PURE__ */ (0,
|
|
5305
|
+
hr: ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4982
5306
|
"hr",
|
|
4983
5307
|
{
|
|
4984
5308
|
className: cn("my-5 border-b", className),
|
|
4985
5309
|
...stripMarkdownNode(props)
|
|
4986
5310
|
}
|
|
4987
5311
|
),
|
|
4988
|
-
table: ({ className, style, ...props }) => /* @__PURE__ */ (0,
|
|
5312
|
+
table: ({ className, style, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4989
5313
|
"div",
|
|
4990
5314
|
{
|
|
4991
5315
|
"data-slot": "markdown-table-container",
|
|
4992
5316
|
className: "my-5 max-w-full overflow-x-auto rounded-xl border border-border bg-background",
|
|
4993
|
-
children: /* @__PURE__ */ (0,
|
|
5317
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4994
5318
|
"table",
|
|
4995
5319
|
{
|
|
4996
5320
|
className: cn(
|
|
@@ -5006,7 +5330,7 @@ var defaultComponents = {
|
|
|
5006
5330
|
)
|
|
5007
5331
|
}
|
|
5008
5332
|
),
|
|
5009
|
-
th: ({ className, style, ...props }) => /* @__PURE__ */ (0,
|
|
5333
|
+
th: ({ className, style, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
5010
5334
|
"th",
|
|
5011
5335
|
{
|
|
5012
5336
|
className: cn(
|
|
@@ -5022,7 +5346,7 @@ var defaultComponents = {
|
|
|
5022
5346
|
...stripMarkdownNode(props)
|
|
5023
5347
|
}
|
|
5024
5348
|
),
|
|
5025
|
-
td: ({ className, style, ...props }) => /* @__PURE__ */ (0,
|
|
5349
|
+
td: ({ className, style, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
5026
5350
|
"td",
|
|
5027
5351
|
{
|
|
5028
5352
|
className: cn(
|
|
@@ -5038,7 +5362,7 @@ var defaultComponents = {
|
|
|
5038
5362
|
...stripMarkdownNode(props)
|
|
5039
5363
|
}
|
|
5040
5364
|
),
|
|
5041
|
-
tr: ({ className, ...props }) => /* @__PURE__ */ (0,
|
|
5365
|
+
tr: ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
5042
5366
|
"tr",
|
|
5043
5367
|
{
|
|
5044
5368
|
className: cn(
|
|
@@ -5048,14 +5372,14 @@ var defaultComponents = {
|
|
|
5048
5372
|
...stripMarkdownNode(props)
|
|
5049
5373
|
}
|
|
5050
5374
|
),
|
|
5051
|
-
sup: ({ className, ...props }) => /* @__PURE__ */ (0,
|
|
5375
|
+
sup: ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
5052
5376
|
"sup",
|
|
5053
5377
|
{
|
|
5054
5378
|
className: cn("[&>a]:text-xs [&>a]:no-underline", className),
|
|
5055
5379
|
...stripMarkdownNode(props)
|
|
5056
5380
|
}
|
|
5057
5381
|
),
|
|
5058
|
-
pre: ({ className, children }) => import_react6.Children.toArray(children).length === 1 && (isMermaidBlockChild(import_react6.Children.toArray(children)[0]) || isMermaidCodeElement(import_react6.Children.toArray(children)[0])) ? /* @__PURE__ */ (0,
|
|
5382
|
+
pre: ({ className, children }) => import_react6.Children.toArray(children).length === 1 && (isMermaidBlockChild(import_react6.Children.toArray(children)[0]) || isMermaidCodeElement(import_react6.Children.toArray(children)[0])) ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_jsx_runtime25.Fragment, { children }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
5059
5383
|
"div",
|
|
5060
5384
|
{
|
|
5061
5385
|
className: cn(
|
|
@@ -5078,15 +5402,15 @@ var defaultComponents = {
|
|
|
5078
5402
|
const language = match[1];
|
|
5079
5403
|
const normalizedCode = code.replace(/\n$/, "");
|
|
5080
5404
|
if (language === "mermaid") {
|
|
5081
|
-
return /* @__PURE__ */ (0,
|
|
5405
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(MermaidBlock, { code: normalizedCode });
|
|
5082
5406
|
}
|
|
5083
|
-
return /* @__PURE__ */ (0,
|
|
5084
|
-
/* @__PURE__ */ (0,
|
|
5085
|
-
/* @__PURE__ */ (0,
|
|
5407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
5408
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(CodeHeader, { language, code: normalizedCode }),
|
|
5409
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SyntaxHighlighter, { language, className, children: normalizedCode })
|
|
5086
5410
|
] });
|
|
5087
5411
|
}
|
|
5088
5412
|
if (isBlockCode) {
|
|
5089
|
-
return /* @__PURE__ */ (0,
|
|
5413
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
5090
5414
|
"code",
|
|
5091
5415
|
{
|
|
5092
5416
|
className: cn(
|
|
@@ -5098,7 +5422,7 @@ var defaultComponents = {
|
|
|
5098
5422
|
}
|
|
5099
5423
|
);
|
|
5100
5424
|
}
|
|
5101
|
-
return /* @__PURE__ */ (0,
|
|
5425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
5102
5426
|
"code",
|
|
5103
5427
|
{
|
|
5104
5428
|
className: cn(
|
|
@@ -5117,14 +5441,14 @@ var defaultComponents = {
|
|
|
5117
5441
|
}
|
|
5118
5442
|
};
|
|
5119
5443
|
var MarkdownTextImpl = ({ children }) => {
|
|
5120
|
-
return /* @__PURE__ */ (0,
|
|
5121
|
-
(segment, index) => segment.type === "plan" ? /* @__PURE__ */ (0,
|
|
5444
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "markdown-content", children: splitProposedPlanSegments(children).map(
|
|
5445
|
+
(segment, index) => segment.type === "plan" ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(PlanCard, { children: segment.content }, index) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(MarkdownContent, { children: segment.content }, index)
|
|
5122
5446
|
) });
|
|
5123
5447
|
};
|
|
5124
5448
|
var MarkdownText = (0, import_react6.memo)(MarkdownTextImpl);
|
|
5125
5449
|
|
|
5126
5450
|
// src/components/thread/messages/tool-component-group.tsx
|
|
5127
|
-
var
|
|
5451
|
+
var React21 = __toESM(require("react"), 1);
|
|
5128
5452
|
var import_lucide_react11 = require("lucide-react");
|
|
5129
5453
|
|
|
5130
5454
|
// src/i18n/localized-text.ts
|
|
@@ -5177,7 +5501,7 @@ function resolveLocalizedText(value, language) {
|
|
|
5177
5501
|
}
|
|
5178
5502
|
|
|
5179
5503
|
// src/components/thread/messages/tool-component-group.tsx
|
|
5180
|
-
var
|
|
5504
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
5181
5505
|
var toolStatusConfig = {
|
|
5182
5506
|
success: {
|
|
5183
5507
|
iconClass: "border-green-500 text-green-700",
|
|
@@ -5269,11 +5593,11 @@ function formatStepDuration(durationMs) {
|
|
|
5269
5593
|
return `${minutes}m ${seconds}s`;
|
|
5270
5594
|
}
|
|
5271
5595
|
function useToolStepDurationLabel(data) {
|
|
5272
|
-
const [durationNow, setDurationNow] =
|
|
5596
|
+
const [durationNow, setDurationNow] = React21.useState(() => Date.now());
|
|
5273
5597
|
const createdAt = parseStepDate(data.created_date);
|
|
5274
5598
|
const endedAt = parseStepDate(data.end_date);
|
|
5275
5599
|
const status = data.status;
|
|
5276
|
-
|
|
5600
|
+
React21.useEffect(() => {
|
|
5277
5601
|
if (status !== "running" || createdAt === null || endedAt !== null) {
|
|
5278
5602
|
return;
|
|
5279
5603
|
}
|
|
@@ -5479,14 +5803,14 @@ function JsonTreeNode({
|
|
|
5479
5803
|
const isArray = Array.isArray(value);
|
|
5480
5804
|
const isObject = isJsonObjectValue(value);
|
|
5481
5805
|
const isExpandable = isArray || isObject;
|
|
5482
|
-
const [isExpanded, setIsExpanded] =
|
|
5806
|
+
const [isExpanded, setIsExpanded] = React21.useState(depth < 2);
|
|
5483
5807
|
if (!isExpandable) {
|
|
5484
|
-
return /* @__PURE__ */ (0,
|
|
5485
|
-
label ? /* @__PURE__ */ (0,
|
|
5808
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex min-w-0 gap-2 leading-6", children: [
|
|
5809
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { className: "shrink-0 font-medium text-foreground/80", children: [
|
|
5486
5810
|
label,
|
|
5487
5811
|
":"
|
|
5488
5812
|
] }) : null,
|
|
5489
|
-
/* @__PURE__ */ (0,
|
|
5813
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
5490
5814
|
"span",
|
|
5491
5815
|
{
|
|
5492
5816
|
className: cn(
|
|
@@ -5500,8 +5824,8 @@ function JsonTreeNode({
|
|
|
5500
5824
|
}
|
|
5501
5825
|
const entries = isArray ? value.map((item, index) => [String(index), item]) : Object.entries(value);
|
|
5502
5826
|
const summary = isArray ? `Array(${value.length})` : `Object(${entries.length})`;
|
|
5503
|
-
return /* @__PURE__ */ (0,
|
|
5504
|
-
/* @__PURE__ */ (0,
|
|
5827
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "min-w-0", children: [
|
|
5828
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
5505
5829
|
"button",
|
|
5506
5830
|
{
|
|
5507
5831
|
type: "button",
|
|
@@ -5509,7 +5833,7 @@ function JsonTreeNode({
|
|
|
5509
5833
|
"aria-expanded": isExpanded,
|
|
5510
5834
|
onClick: () => setIsExpanded((prev) => !prev),
|
|
5511
5835
|
children: [
|
|
5512
|
-
/* @__PURE__ */ (0,
|
|
5836
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
5513
5837
|
import_lucide_react11.ChevronRight,
|
|
5514
5838
|
{
|
|
5515
5839
|
"aria-hidden": "true",
|
|
@@ -5519,15 +5843,15 @@ function JsonTreeNode({
|
|
|
5519
5843
|
)
|
|
5520
5844
|
}
|
|
5521
5845
|
),
|
|
5522
|
-
label ? /* @__PURE__ */ (0,
|
|
5846
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { className: "min-w-0 truncate font-medium text-foreground/80", children: [
|
|
5523
5847
|
label,
|
|
5524
5848
|
":"
|
|
5525
5849
|
] }) : null,
|
|
5526
|
-
/* @__PURE__ */ (0,
|
|
5850
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "shrink-0 text-muted-foreground", children: summary })
|
|
5527
5851
|
]
|
|
5528
5852
|
}
|
|
5529
5853
|
),
|
|
5530
|
-
isExpanded ? /* @__PURE__ */ (0,
|
|
5854
|
+
isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "ml-4 border-l border-border/70 pl-3", children: entries.map(([entryLabel, entryValue]) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
5531
5855
|
JsonTreeNode,
|
|
5532
5856
|
{
|
|
5533
5857
|
label: entryLabel,
|
|
@@ -5539,13 +5863,13 @@ function JsonTreeNode({
|
|
|
5539
5863
|
] });
|
|
5540
5864
|
}
|
|
5541
5865
|
function JsonTreeView({ value }) {
|
|
5542
|
-
return /* @__PURE__ */ (0,
|
|
5866
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "min-w-0 font-mono text-[11px]", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(JsonTreeNode, { value }) });
|
|
5543
5867
|
}
|
|
5544
5868
|
function RawJsonBlock({ raw }) {
|
|
5545
|
-
return /* @__PURE__ */ (0,
|
|
5869
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("pre", { className: "whitespace-pre-wrap wrap-break-word font-mono text-[11px]", children: raw });
|
|
5546
5870
|
}
|
|
5547
5871
|
function PlainTextBlock({ value, destructive = false }) {
|
|
5548
|
-
return /* @__PURE__ */ (0,
|
|
5872
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
5549
5873
|
"pre",
|
|
5550
5874
|
{
|
|
5551
5875
|
className: cn(
|
|
@@ -5558,15 +5882,15 @@ function PlainTextBlock({ value, destructive = false }) {
|
|
|
5558
5882
|
}
|
|
5559
5883
|
function ToolCallCopyButton({ value }) {
|
|
5560
5884
|
const { t } = useChatkitTranslation();
|
|
5561
|
-
const [isCopied, setIsCopied] =
|
|
5562
|
-
const resetTimeoutRef =
|
|
5563
|
-
const clearResetTimeout =
|
|
5885
|
+
const [isCopied, setIsCopied] = React21.useState(false);
|
|
5886
|
+
const resetTimeoutRef = React21.useRef(null);
|
|
5887
|
+
const clearResetTimeout = React21.useCallback(() => {
|
|
5564
5888
|
if (resetTimeoutRef.current === null) return;
|
|
5565
5889
|
window.clearTimeout(resetTimeoutRef.current);
|
|
5566
5890
|
resetTimeoutRef.current = null;
|
|
5567
5891
|
}, []);
|
|
5568
|
-
|
|
5569
|
-
const handleCopy =
|
|
5892
|
+
React21.useEffect(() => clearResetTimeout, [clearResetTimeout]);
|
|
5893
|
+
const handleCopy = React21.useCallback(() => {
|
|
5570
5894
|
if (typeof navigator === "undefined" || !navigator.clipboard) return;
|
|
5571
5895
|
void navigator.clipboard.writeText(value).then(() => {
|
|
5572
5896
|
setIsCopied(true);
|
|
@@ -5578,7 +5902,7 @@ function ToolCallCopyButton({ value }) {
|
|
|
5578
5902
|
}).catch(() => void 0);
|
|
5579
5903
|
}, [clearResetTimeout, value]);
|
|
5580
5904
|
const label = isCopied ? t("message.toolGroup.copied") : t("message.toolGroup.copy");
|
|
5581
|
-
return /* @__PURE__ */ (0,
|
|
5905
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
5582
5906
|
"button",
|
|
5583
5907
|
{
|
|
5584
5908
|
type: "button",
|
|
@@ -5586,7 +5910,7 @@ function ToolCallCopyButton({ value }) {
|
|
|
5586
5910
|
"aria-label": label,
|
|
5587
5911
|
title: label,
|
|
5588
5912
|
onClick: handleCopy,
|
|
5589
|
-
children: isCopied ? /* @__PURE__ */ (0,
|
|
5913
|
+
children: isCopied ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react11.Check, { className: "h-3.5 w-3.5", "aria-hidden": "true" }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react11.Copy, { className: "h-3.5 w-3.5", "aria-hidden": "true" })
|
|
5590
5914
|
}
|
|
5591
5915
|
);
|
|
5592
5916
|
}
|
|
@@ -5597,28 +5921,28 @@ function ToolCallValueBlock({
|
|
|
5597
5921
|
const { t } = useChatkitTranslation();
|
|
5598
5922
|
const detected = detectJsonValue(value);
|
|
5599
5923
|
if (detected.kind === "text") {
|
|
5600
|
-
return /* @__PURE__ */ (0,
|
|
5601
|
-
/* @__PURE__ */ (0,
|
|
5602
|
-
/* @__PURE__ */ (0,
|
|
5924
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "min-w-0 space-y-1", children: [
|
|
5925
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ToolCallCopyButton, { value: detected.text }) }),
|
|
5926
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(PlainTextBlock, { value: detected.text, destructive })
|
|
5603
5927
|
] });
|
|
5604
5928
|
}
|
|
5605
|
-
return /* @__PURE__ */ (0,
|
|
5606
|
-
/* @__PURE__ */ (0,
|
|
5607
|
-
/* @__PURE__ */ (0,
|
|
5929
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Tabs, { defaultValue: "tree", className: "min-w-0", children: [
|
|
5930
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "mb-2 flex min-w-0 items-center justify-between gap-2", children: [
|
|
5931
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { className: "min-w-0 truncate text-[11px] text-muted-foreground", children: [
|
|
5608
5932
|
t("message.toolGroup.jsonTitle"),
|
|
5609
5933
|
" \xB7 ",
|
|
5610
5934
|
getJsonValueSummary(detected.value)
|
|
5611
5935
|
] }),
|
|
5612
|
-
/* @__PURE__ */ (0,
|
|
5613
|
-
/* @__PURE__ */ (0,
|
|
5614
|
-
/* @__PURE__ */ (0,
|
|
5615
|
-
/* @__PURE__ */ (0,
|
|
5616
|
-
/* @__PURE__ */ (0,
|
|
5936
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
5937
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ToolCallCopyButton, { value: detected.raw }),
|
|
5938
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(TabsList, { className: "rounded-md p-0.5", children: [
|
|
5939
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "tree", children: t("message.toolGroup.jsonTree") }),
|
|
5940
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "raw", children: t("message.toolGroup.jsonRaw") })
|
|
5617
5941
|
] })
|
|
5618
5942
|
] })
|
|
5619
5943
|
] }),
|
|
5620
|
-
/* @__PURE__ */ (0,
|
|
5621
|
-
/* @__PURE__ */ (0,
|
|
5944
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TabsContent, { value: "tree", className: "mt-0", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(JsonTreeView, { value: detected.value }) }),
|
|
5945
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TabsContent, { value: "raw", className: "mt-0", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(RawJsonBlock, { raw: detected.raw }) })
|
|
5622
5946
|
] });
|
|
5623
5947
|
}
|
|
5624
5948
|
function DefaultToolCallOutput({ data }) {
|
|
@@ -5626,15 +5950,15 @@ function DefaultToolCallOutput({ data }) {
|
|
|
5626
5950
|
const output = data.output ?? null;
|
|
5627
5951
|
const error = data.error ?? null;
|
|
5628
5952
|
if (error) {
|
|
5629
|
-
return /* @__PURE__ */ (0,
|
|
5630
|
-
/* @__PURE__ */ (0,
|
|
5631
|
-
/* @__PURE__ */ (0,
|
|
5953
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "space-y-1", children: [
|
|
5954
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "text-[11px] font-medium text-destructive", children: t("message.toolGroup.errorTitle") }),
|
|
5955
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ToolCallValueBlock, { value: error, destructive: true })
|
|
5632
5956
|
] });
|
|
5633
5957
|
}
|
|
5634
5958
|
if (output === null) return null;
|
|
5635
|
-
return /* @__PURE__ */ (0,
|
|
5636
|
-
/* @__PURE__ */ (0,
|
|
5637
|
-
/* @__PURE__ */ (0,
|
|
5959
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "space-y-1", children: [
|
|
5960
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.toolGroup.outputTitle") }),
|
|
5961
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ToolCallValueBlock, { value: output })
|
|
5638
5962
|
] });
|
|
5639
5963
|
}
|
|
5640
5964
|
function ToolCallDetails({ content }) {
|
|
@@ -5644,13 +5968,13 @@ function ToolCallDetails({ content }) {
|
|
|
5644
5968
|
const hasInput = data.input !== void 0 && data.input !== null;
|
|
5645
5969
|
const hasOutput = data.error !== void 0 || data.output !== void 0;
|
|
5646
5970
|
if (!hasInput && !hasOutput) return null;
|
|
5647
|
-
return /* @__PURE__ */ (0,
|
|
5648
|
-
hasInput && /* @__PURE__ */ (0,
|
|
5649
|
-
/* @__PURE__ */ (0,
|
|
5650
|
-
/* @__PURE__ */ (0,
|
|
5971
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "ml-6 mt-1 max-h-60 overflow-auto rounded-md bg-muted/30 px-3 py-2 text-xs text-muted-foreground", children: [
|
|
5972
|
+
hasInput && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "space-y-1", children: [
|
|
5973
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.toolGroup.inputTitle") }),
|
|
5974
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ToolCallValueBlock, { value: data.input })
|
|
5651
5975
|
] }),
|
|
5652
|
-
hasInput && hasOutput ? /* @__PURE__ */ (0,
|
|
5653
|
-
hasOutput ? /* @__PURE__ */ (0,
|
|
5976
|
+
hasInput && hasOutput ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "h-2" }) : null,
|
|
5977
|
+
hasOutput ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(OutputRenderer, { content, data }) : null
|
|
5654
5978
|
] });
|
|
5655
5979
|
}
|
|
5656
5980
|
function ToolCallRow({ content }) {
|
|
@@ -5661,17 +5985,17 @@ function ToolCallRow({ content }) {
|
|
|
5661
5985
|
const ItemStatusIcon = itemConfig?.icon;
|
|
5662
5986
|
const hasError = status === "fail" || Boolean(data.error);
|
|
5663
5987
|
const label = getToolActivityLabel(content, i18n2.language);
|
|
5664
|
-
const detailsId =
|
|
5988
|
+
const detailsId = React21.useId();
|
|
5665
5989
|
const hasDetails = data.input !== void 0 || data.error !== void 0 || data.output !== void 0;
|
|
5666
5990
|
const durationLabel = useToolStepDurationLabel(data);
|
|
5667
|
-
const [isExpanded, setIsExpanded] =
|
|
5668
|
-
|
|
5991
|
+
const [isExpanded, setIsExpanded] = React21.useState(false);
|
|
5992
|
+
React21.useEffect(() => {
|
|
5669
5993
|
if (status === "running" && data.output !== void 0) {
|
|
5670
5994
|
setIsExpanded(true);
|
|
5671
5995
|
}
|
|
5672
5996
|
}, [data.output, status]);
|
|
5673
|
-
return /* @__PURE__ */ (0,
|
|
5674
|
-
/* @__PURE__ */ (0,
|
|
5997
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("li", { className: "min-w-0", children: [
|
|
5998
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
5675
5999
|
"button",
|
|
5676
6000
|
{
|
|
5677
6001
|
type: "button",
|
|
@@ -5687,7 +6011,7 @@ function ToolCallRow({ content }) {
|
|
|
5687
6011
|
if (hasDetails) setIsExpanded((prev) => !prev);
|
|
5688
6012
|
},
|
|
5689
6013
|
children: [
|
|
5690
|
-
ItemStatusIcon ? /* @__PURE__ */ (0,
|
|
6014
|
+
ItemStatusIcon ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
5691
6015
|
ItemStatusIcon,
|
|
5692
6016
|
{
|
|
5693
6017
|
className: cn(
|
|
@@ -5696,10 +6020,10 @@ function ToolCallRow({ content }) {
|
|
|
5696
6020
|
status === "running" && "animate-spin"
|
|
5697
6021
|
)
|
|
5698
6022
|
}
|
|
5699
|
-
) : /* @__PURE__ */ (0,
|
|
5700
|
-
/* @__PURE__ */ (0,
|
|
5701
|
-
durationLabel ? /* @__PURE__ */ (0,
|
|
5702
|
-
hasDetails ? /* @__PURE__ */ (0,
|
|
6023
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "h-3.5 w-3.5 shrink-0", "aria-hidden": "true" }),
|
|
6024
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "min-w-0 flex-1 truncate", title: label, children: label }),
|
|
6025
|
+
durationLabel ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "shrink-0 text-[11px] tabular-nums text-muted-foreground/80", children: durationLabel }) : null,
|
|
6026
|
+
hasDetails ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
5703
6027
|
import_lucide_react11.ChevronRight,
|
|
5704
6028
|
{
|
|
5705
6029
|
"aria-hidden": "true",
|
|
@@ -5712,7 +6036,7 @@ function ToolCallRow({ content }) {
|
|
|
5712
6036
|
]
|
|
5713
6037
|
}
|
|
5714
6038
|
),
|
|
5715
|
-
hasDetails && isExpanded ? /* @__PURE__ */ (0,
|
|
6039
|
+
hasDetails && isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { id: detailsId, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ToolCallDetails, { content }) }) : null
|
|
5716
6040
|
] });
|
|
5717
6041
|
}
|
|
5718
6042
|
function ToolComponentGroup({
|
|
@@ -5720,9 +6044,9 @@ function ToolComponentGroup({
|
|
|
5720
6044
|
hasFollowingItem
|
|
5721
6045
|
}) {
|
|
5722
6046
|
const { t } = useChatkitTranslation();
|
|
5723
|
-
const contentId =
|
|
6047
|
+
const contentId = React21.useId();
|
|
5724
6048
|
const groupStatus = getToolGroupDisplayStatus(items);
|
|
5725
|
-
const [isExpanded, setIsExpanded] =
|
|
6049
|
+
const [isExpanded, setIsExpanded] = React21.useState(!hasFollowingItem);
|
|
5726
6050
|
const categoryCounts = getToolGroupCategoryCounts(items);
|
|
5727
6051
|
const categorySummary = TOOL_GROUP_CATEGORY_ORDER.flatMap((category) => {
|
|
5728
6052
|
const count = categoryCounts[category] ?? 0;
|
|
@@ -5737,11 +6061,11 @@ function ToolComponentGroup({
|
|
|
5737
6061
|
const summary = `${t(`message.toolGroup.status.${groupStatus}`)} ${categorySummary}`;
|
|
5738
6062
|
const config = toolStatusConfig[groupStatus];
|
|
5739
6063
|
const StatusIcon = config.icon;
|
|
5740
|
-
|
|
6064
|
+
React21.useEffect(() => {
|
|
5741
6065
|
setIsExpanded(!hasFollowingItem);
|
|
5742
6066
|
}, [hasFollowingItem, items.length]);
|
|
5743
|
-
return /* @__PURE__ */ (0,
|
|
5744
|
-
/* @__PURE__ */ (0,
|
|
6067
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "px-1 py-1", children: [
|
|
6068
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
5745
6069
|
"button",
|
|
5746
6070
|
{
|
|
5747
6071
|
type: "button",
|
|
@@ -5750,8 +6074,8 @@ function ToolComponentGroup({
|
|
|
5750
6074
|
"aria-controls": contentId,
|
|
5751
6075
|
onClick: () => setIsExpanded((prev) => !prev),
|
|
5752
6076
|
children: [
|
|
5753
|
-
/* @__PURE__ */ (0,
|
|
5754
|
-
/* @__PURE__ */ (0,
|
|
6077
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex min-w-0 items-center gap-2 text-sm font-medium text-muted-foreground", children: [
|
|
6078
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
5755
6079
|
StatusIcon,
|
|
5756
6080
|
{
|
|
5757
6081
|
className: cn(
|
|
@@ -5760,9 +6084,9 @@ function ToolComponentGroup({
|
|
|
5760
6084
|
)
|
|
5761
6085
|
}
|
|
5762
6086
|
),
|
|
5763
|
-
/* @__PURE__ */ (0,
|
|
6087
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "truncate", children: summary })
|
|
5764
6088
|
] }),
|
|
5765
|
-
/* @__PURE__ */ (0,
|
|
6089
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
5766
6090
|
import_lucide_react11.ChevronRight,
|
|
5767
6091
|
{
|
|
5768
6092
|
"aria-hidden": "true",
|
|
@@ -5775,15 +6099,15 @@ function ToolComponentGroup({
|
|
|
5775
6099
|
]
|
|
5776
6100
|
}
|
|
5777
6101
|
),
|
|
5778
|
-
isExpanded && /* @__PURE__ */ (0,
|
|
6102
|
+
isExpanded && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("ul", { id: contentId, className: "mt-2 max-h-[200px] space-y-1.5 overflow-y-auto pr-1", children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ToolCallRow, { content: item }, item.id ?? `tool-item-${index}`)) })
|
|
5779
6103
|
] });
|
|
5780
6104
|
}
|
|
5781
6105
|
|
|
5782
6106
|
// src/components/thread/messages/request-user-input-result-card.tsx
|
|
5783
|
-
var
|
|
6107
|
+
var React22 = require("react");
|
|
5784
6108
|
var import_chatkit_types4 = require("@xpert-ai/chatkit-types");
|
|
5785
6109
|
var import_lucide_react12 = require("lucide-react");
|
|
5786
|
-
var
|
|
6110
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
5787
6111
|
function isRecord2(value) {
|
|
5788
6112
|
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
5789
6113
|
}
|
|
@@ -5895,7 +6219,7 @@ function RequestUserInputResultCard({
|
|
|
5895
6219
|
className
|
|
5896
6220
|
}) {
|
|
5897
6221
|
const { t } = useChatkitTranslation();
|
|
5898
|
-
return /* @__PURE__ */ (0,
|
|
6222
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
5899
6223
|
"section",
|
|
5900
6224
|
{
|
|
5901
6225
|
"aria-label": t("message.requestUserInputResult.title"),
|
|
@@ -5904,23 +6228,23 @@ function RequestUserInputResultCard({
|
|
|
5904
6228
|
className
|
|
5905
6229
|
),
|
|
5906
6230
|
children: [
|
|
5907
|
-
/* @__PURE__ */ (0,
|
|
5908
|
-
/* @__PURE__ */ (0,
|
|
5909
|
-
/* @__PURE__ */ (0,
|
|
6231
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "mb-2 flex items-center gap-2 text-sm font-semibold text-foreground", children: [
|
|
6232
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react12.CheckCircle2, { className: "h-4 w-4 text-primary" }),
|
|
6233
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: t("message.requestUserInputResult.title") })
|
|
5910
6234
|
] }),
|
|
5911
|
-
/* @__PURE__ */ (0,
|
|
6235
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "space-y-2", children: result.answers.map((answer, index) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
5912
6236
|
"div",
|
|
5913
6237
|
{
|
|
5914
6238
|
className: "rounded-md bg-background/70 px-2.5 py-2",
|
|
5915
6239
|
children: [
|
|
5916
|
-
/* @__PURE__ */ (0,
|
|
5917
|
-
/* @__PURE__ */ (0,
|
|
5918
|
-
/* @__PURE__ */ (0,
|
|
5919
|
-
/* @__PURE__ */ (0,
|
|
6240
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "text-xs font-medium leading-5 text-muted-foreground", children: answer.question }),
|
|
6241
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "mt-0.5 flex min-w-0 flex-wrap items-center gap-1.5", children: [
|
|
6242
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "min-w-0 wrap-break-word text-sm font-semibold text-foreground", children: answer.label ?? answer.value }),
|
|
6243
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "rounded-full bg-muted px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground", children: t(
|
|
5920
6244
|
answer.type === "other" ? "message.requestUserInputResult.other" : "message.requestUserInputResult.option"
|
|
5921
6245
|
) })
|
|
5922
6246
|
] }),
|
|
5923
|
-
answer.description ? /* @__PURE__ */ (0,
|
|
6247
|
+
answer.description ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "mt-1 text-xs leading-5 text-muted-foreground", children: answer.description }) : null
|
|
5924
6248
|
]
|
|
5925
6249
|
},
|
|
5926
6250
|
`${answer.id}-${index}`
|
|
@@ -5932,18 +6256,18 @@ function RequestUserInputResultCard({
|
|
|
5932
6256
|
|
|
5933
6257
|
// src/components/thread/messages/widget.tsx
|
|
5934
6258
|
var import_a2ui_react = require("@xpert-ai/a2ui-react");
|
|
5935
|
-
var
|
|
6259
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
5936
6260
|
function WidgetMessage({ messageId, data }) {
|
|
5937
6261
|
const widgets = Array.isArray(data.widgets) ? data.widgets : [];
|
|
5938
6262
|
if (widgets.length === 0) return null;
|
|
5939
6263
|
const baseSurfaceId = `widget-${messageId}`;
|
|
5940
|
-
return /* @__PURE__ */ (0,
|
|
6264
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "space-y-3", children: widgets.map((widget, index) => {
|
|
5941
6265
|
const config = widget?.config;
|
|
5942
6266
|
if (!config || typeof config !== "object") {
|
|
5943
6267
|
return null;
|
|
5944
6268
|
}
|
|
5945
6269
|
const surfaceId = widgets.length > 1 ? `${baseSurfaceId}-${index}` : baseSurfaceId;
|
|
5946
|
-
return /* @__PURE__ */ (0,
|
|
6270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5947
6271
|
import_a2ui_react.SurfaceRenderer,
|
|
5948
6272
|
{
|
|
5949
6273
|
surfaceId,
|
|
@@ -5955,7 +6279,7 @@ function WidgetMessage({ messageId, data }) {
|
|
|
5955
6279
|
}
|
|
5956
6280
|
|
|
5957
6281
|
// src/components/thread/messages/ai.tsx
|
|
5958
|
-
var
|
|
6282
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
5959
6283
|
function isTextContent2(content) {
|
|
5960
6284
|
return content.type === "text";
|
|
5961
6285
|
}
|
|
@@ -5988,11 +6312,11 @@ function formatDisplayValue2(value) {
|
|
|
5988
6312
|
function ReasoningBlock({ reasoning }) {
|
|
5989
6313
|
const blocks = reasoning.filter((item) => item.text?.trim());
|
|
5990
6314
|
if (blocks.length === 0) return null;
|
|
5991
|
-
return /* @__PURE__ */ (0,
|
|
6315
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "space-y-2", children: blocks.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5992
6316
|
"div",
|
|
5993
6317
|
{
|
|
5994
6318
|
className: "rounded-lg border bg-muted/40 p-3 text-xs text-muted-foreground",
|
|
5995
|
-
children: /* @__PURE__ */ (0,
|
|
6319
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "whitespace-pre-wrap wrap-break-word leading-relaxed", children: item.text })
|
|
5996
6320
|
},
|
|
5997
6321
|
item.id ?? `reasoning-${index}`
|
|
5998
6322
|
)) });
|
|
@@ -6000,20 +6324,20 @@ function ReasoningBlock({ reasoning }) {
|
|
|
6000
6324
|
function ImageBlock({ content }) {
|
|
6001
6325
|
const imageUrl = typeof content.image_url === "string" ? content.image_url : typeof content.image_url?.url === "string" ? content.image_url.url : null;
|
|
6002
6326
|
if (!imageUrl) {
|
|
6003
|
-
return /* @__PURE__ */ (0,
|
|
6004
|
-
/* @__PURE__ */ (0,
|
|
6005
|
-
/* @__PURE__ */ (0,
|
|
6327
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Card, { children: [
|
|
6328
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CardHeader, { className: "space-y-1", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CardTitle, { className: "text-sm", children: "Image" }) }),
|
|
6329
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CardContent, { className: "text-xs text-muted-foreground", children: safeJson2(content) })
|
|
6006
6330
|
] });
|
|
6007
6331
|
}
|
|
6008
|
-
return /* @__PURE__ */ (0,
|
|
6332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("figure", { className: "overflow-hidden rounded-lg border bg-background", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("img", { src: imageUrl, alt: "Assistant output", className: "h-auto w-full object-cover" }) });
|
|
6009
6333
|
}
|
|
6010
6334
|
function MemoryBlock({ content }) {
|
|
6011
|
-
return /* @__PURE__ */ (0,
|
|
6012
|
-
/* @__PURE__ */ (0,
|
|
6013
|
-
/* @__PURE__ */ (0,
|
|
6014
|
-
/* @__PURE__ */ (0,
|
|
6335
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Card, { children: [
|
|
6336
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(CardHeader, { className: "flex flex-row items-center justify-between gap-2", children: [
|
|
6337
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CardTitle, { className: "text-sm", children: "Memory" }),
|
|
6338
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Badge, { variant: "secondary", children: "Memory" })
|
|
6015
6339
|
] }),
|
|
6016
|
-
/* @__PURE__ */ (0,
|
|
6340
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CardContent, { className: "text-xs text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("pre", { className: "whitespace-pre-wrap wrap-break-word", children: safeJson2(content.data ?? []) }) })
|
|
6017
6341
|
] });
|
|
6018
6342
|
}
|
|
6019
6343
|
function parseStepDate2(value) {
|
|
@@ -6047,11 +6371,11 @@ function formatStepDuration2(durationMs) {
|
|
|
6047
6371
|
}
|
|
6048
6372
|
function ComponentBlock({ content }) {
|
|
6049
6373
|
const { i18n: i18n2 } = useChatkitTranslation();
|
|
6050
|
-
const [isExpanded, setIsExpanded] =
|
|
6051
|
-
const contentRef =
|
|
6052
|
-
const shouldAutoScrollRef =
|
|
6053
|
-
const previousScrollTopRef =
|
|
6054
|
-
const [durationNow, setDurationNow] =
|
|
6374
|
+
const [isExpanded, setIsExpanded] = React23.useState(false);
|
|
6375
|
+
const contentRef = React23.useRef(null);
|
|
6376
|
+
const shouldAutoScrollRef = React23.useRef(true);
|
|
6377
|
+
const previousScrollTopRef = React23.useRef(0);
|
|
6378
|
+
const [durationNow, setDurationNow] = React23.useState(() => Date.now());
|
|
6055
6379
|
const data = getToolStepData(content);
|
|
6056
6380
|
const category = data.category ?? "Component";
|
|
6057
6381
|
const title = getToolActivityLabel(content, i18n2.language);
|
|
@@ -6065,10 +6389,10 @@ function ComponentBlock({ content }) {
|
|
|
6065
6389
|
const endedAt = parseStepDate2(data.end_date);
|
|
6066
6390
|
const durationMs = createdAt === null ? null : Math.max(0, (endedAt ?? durationNow) - createdAt);
|
|
6067
6391
|
const durationLabel = durationMs === null ? null : formatStepDuration2(durationMs);
|
|
6068
|
-
|
|
6392
|
+
React23.useEffect(() => {
|
|
6069
6393
|
if (status === "running" && output !== null) setIsExpanded(true);
|
|
6070
6394
|
}, [status, output]);
|
|
6071
|
-
|
|
6395
|
+
React23.useEffect(() => {
|
|
6072
6396
|
if (status !== "running" || createdAt === null || endedAt !== null) {
|
|
6073
6397
|
return;
|
|
6074
6398
|
}
|
|
@@ -6080,7 +6404,7 @@ function ComponentBlock({ content }) {
|
|
|
6080
6404
|
window.clearInterval(timer);
|
|
6081
6405
|
};
|
|
6082
6406
|
}, [createdAt, endedAt, status]);
|
|
6083
|
-
|
|
6407
|
+
React23.useEffect(() => {
|
|
6084
6408
|
const element = contentRef.current;
|
|
6085
6409
|
if (!element) return;
|
|
6086
6410
|
previousScrollTopRef.current = element.scrollTop;
|
|
@@ -6100,7 +6424,7 @@ function ComponentBlock({ content }) {
|
|
|
6100
6424
|
element.removeEventListener("scroll", updateAutoScrollState);
|
|
6101
6425
|
};
|
|
6102
6426
|
}, [isExpanded]);
|
|
6103
|
-
|
|
6427
|
+
React23.useEffect(() => {
|
|
6104
6428
|
if (status !== "running") {
|
|
6105
6429
|
shouldAutoScrollRef.current = true;
|
|
6106
6430
|
return;
|
|
@@ -6113,24 +6437,24 @@ function ComponentBlock({ content }) {
|
|
|
6113
6437
|
}, [isExpanded, output, status]);
|
|
6114
6438
|
const config = status ? toolStatusConfig[status] : null;
|
|
6115
6439
|
const StatusIcon = config?.icon;
|
|
6116
|
-
return /* @__PURE__ */ (0,
|
|
6117
|
-
/* @__PURE__ */ (0,
|
|
6118
|
-
/* @__PURE__ */ (0,
|
|
6119
|
-
status && StatusIcon && /* @__PURE__ */ (0,
|
|
6120
|
-
/* @__PURE__ */ (0,
|
|
6440
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Card, { children: [
|
|
6441
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(CardHeader, { className: "flex flex-row items-center justify-between gap-2 px-2 py-1 cursor-pointer", onClick: () => setIsExpanded(!isExpanded), children: [
|
|
6442
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex items-center space-x-1 flex-1 min-w-0", children: [
|
|
6443
|
+
status && StatusIcon && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(StatusIcon, { className: cn("h-4 w-4", config?.iconClass, status === "running" && "animate-spin") }),
|
|
6444
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CardTitle, { className: "text-sm truncate", children: title })
|
|
6121
6445
|
] }),
|
|
6122
|
-
/* @__PURE__ */ (0,
|
|
6123
|
-
durationLabel && /* @__PURE__ */ (0,
|
|
6124
|
-
/* @__PURE__ */ (0,
|
|
6125
|
-
/* @__PURE__ */ (0,
|
|
6446
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex flex-wrap items-center gap-2 shrink-0", children: [
|
|
6447
|
+
durationLabel && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "inline-flex items-center gap-1 text-[11px] text-muted-foreground tabular-nums", children: [
|
|
6448
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react13.Clock3, { className: "h-3 w-3" }),
|
|
6449
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { children: durationLabel })
|
|
6126
6450
|
] }),
|
|
6127
|
-
/* @__PURE__ */ (0,
|
|
6128
|
-
/* @__PURE__ */ (0,
|
|
6451
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Badge, { variant: "secondary", className: "rounded-lg px-1.5", children: category }),
|
|
6452
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
6129
6453
|
"button",
|
|
6130
6454
|
{
|
|
6131
6455
|
className: "text-muted-foreground hover:text-foreground transition-colors",
|
|
6132
6456
|
"aria-label": isExpanded ? "Collapse" : "Expand",
|
|
6133
|
-
children: /* @__PURE__ */ (0,
|
|
6457
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
6134
6458
|
import_lucide_react13.ChevronDown,
|
|
6135
6459
|
{
|
|
6136
6460
|
className: cn("h-4 w-4 transition-transform", isExpanded && "rotate-180")
|
|
@@ -6140,34 +6464,34 @@ function ComponentBlock({ content }) {
|
|
|
6140
6464
|
)
|
|
6141
6465
|
] })
|
|
6142
6466
|
] }),
|
|
6143
|
-
isExpanded && /* @__PURE__ */ (0,
|
|
6144
|
-
data.input && /* @__PURE__ */ (0,
|
|
6145
|
-
error ? /* @__PURE__ */ (0,
|
|
6467
|
+
isExpanded && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(CardContent, { ref: contentRef, className: "text-xs text-muted-foreground max-h-60 overflow-auto", children: [
|
|
6468
|
+
data.input && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("pre", { className: "whitespace-pre-wrap wrap-break-word", children: formatDisplayValue2(data.input) }),
|
|
6469
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("pre", { className: "whitespace-pre-wrap wrap-break-word text-destructive", children: formatDisplayValue2(error) }) : hasOutput && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("pre", { className: "whitespace-pre-wrap wrap-break-word", children: formatDisplayValue2(fallback) })
|
|
6146
6470
|
] })
|
|
6147
6471
|
] });
|
|
6148
6472
|
}
|
|
6149
6473
|
function UnknownBlock({ content }) {
|
|
6150
|
-
return /* @__PURE__ */ (0,
|
|
6151
|
-
/* @__PURE__ */ (0,
|
|
6152
|
-
/* @__PURE__ */ (0,
|
|
6153
|
-
/* @__PURE__ */ (0,
|
|
6474
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Card, { children: [
|
|
6475
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(CardHeader, { className: "flex flex-row items-center justify-between gap-2", children: [
|
|
6476
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CardTitle, { className: "text-sm", children: "Assistant Content" }),
|
|
6477
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Badge, { variant: "outline", children: content.type ?? "unknown" })
|
|
6154
6478
|
] }),
|
|
6155
|
-
/* @__PURE__ */ (0,
|
|
6479
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CardContent, { className: "text-xs text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("pre", { className: "whitespace-pre-wrap break-words", children: safeJson2(content) }) })
|
|
6156
6480
|
] });
|
|
6157
6481
|
}
|
|
6158
6482
|
function renderContentItem(content, index, message, lookupMessages) {
|
|
6159
6483
|
const messageId = message.id;
|
|
6160
6484
|
if (typeof content === "string") {
|
|
6161
|
-
return /* @__PURE__ */ (0,
|
|
6485
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(MarkdownText, { children: content }) }, `text-${index}`);
|
|
6162
6486
|
}
|
|
6163
6487
|
if (isTextContent2(content)) {
|
|
6164
|
-
return /* @__PURE__ */ (0,
|
|
6488
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(MarkdownText, { children: content.text }) }, content.id ?? `text-${index}`);
|
|
6165
6489
|
}
|
|
6166
6490
|
if (isReasoningContent2(content)) {
|
|
6167
|
-
return /* @__PURE__ */ (0,
|
|
6491
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ReasoningBlock, { reasoning: [content] }) }, content.id ?? `reasoning-${index}`);
|
|
6168
6492
|
}
|
|
6169
6493
|
if (isImageContent(content)) {
|
|
6170
|
-
return /* @__PURE__ */ (0,
|
|
6494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ImageBlock, { content }) }, content.id ?? `image-${index}`);
|
|
6171
6495
|
}
|
|
6172
6496
|
if (isComponentContent2(content)) {
|
|
6173
6497
|
const requestUserInputResult = getRequestUserInputResultCardData(
|
|
@@ -6175,26 +6499,26 @@ function renderContentItem(content, index, message, lookupMessages) {
|
|
|
6175
6499
|
lookupMessages
|
|
6176
6500
|
);
|
|
6177
6501
|
if (requestUserInputResult) {
|
|
6178
|
-
return /* @__PURE__ */ (0,
|
|
6502
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(RequestUserInputResultCard, { result: requestUserInputResult }) }, content.id ?? `request-user-input-result-${index}`);
|
|
6179
6503
|
}
|
|
6180
6504
|
if (isWidgetComponent2(content)) {
|
|
6181
|
-
return /* @__PURE__ */ (0,
|
|
6505
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(WidgetMessage, { messageId, data: content.data }) }, content.id ?? `widget-${index}`);
|
|
6182
6506
|
}
|
|
6183
|
-
return /* @__PURE__ */ (0,
|
|
6507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ComponentBlock, { content }) }, content.id ?? `component-${index}`);
|
|
6184
6508
|
}
|
|
6185
6509
|
if (isMemoryContent(content)) {
|
|
6186
|
-
return /* @__PURE__ */ (0,
|
|
6510
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(MemoryBlock, { content }) }, content.id ?? `memory-${index}`);
|
|
6187
6511
|
}
|
|
6188
|
-
return /* @__PURE__ */ (0,
|
|
6512
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(UnknownBlock, { content }) }, content.id ?? `unknown-${index}`);
|
|
6189
6513
|
}
|
|
6190
6514
|
function renderContentUnit(unit, message, lookupMessages, hasFollowingItem) {
|
|
6191
6515
|
if (unit.type === "item") {
|
|
6192
6516
|
return renderContentItem(unit.item, unit.index, message, lookupMessages);
|
|
6193
6517
|
}
|
|
6194
|
-
return /* @__PURE__ */ (0,
|
|
6518
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
6195
6519
|
"div",
|
|
6196
6520
|
{
|
|
6197
|
-
children: /* @__PURE__ */ (0,
|
|
6521
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolComponentGroup, { items: unit.items, hasFollowingItem })
|
|
6198
6522
|
},
|
|
6199
6523
|
`tool-group-${unit.startIndex}-${unit.items[0]?.id ?? "tool"}-${unit.items.length}`
|
|
6200
6524
|
);
|
|
@@ -6203,13 +6527,13 @@ function renderContent(message, lookupMessages) {
|
|
|
6203
6527
|
const content = message.content;
|
|
6204
6528
|
if (typeof content === "string") {
|
|
6205
6529
|
if (!content.trim()) return null;
|
|
6206
|
-
return /* @__PURE__ */ (0,
|
|
6530
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(MarkdownText, { children: content });
|
|
6207
6531
|
}
|
|
6208
6532
|
if (!Array.isArray(content) || content.length === 0) return null;
|
|
6209
6533
|
const renderUnits = buildToolComponentRenderUnits(content, {
|
|
6210
6534
|
shouldGroupComponent: (item) => getRequestUserInputResultCardData(item, lookupMessages) === null
|
|
6211
6535
|
});
|
|
6212
|
-
return /* @__PURE__ */ (0,
|
|
6536
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "space-y-3", children: renderUnits.map(
|
|
6213
6537
|
(unit, index) => renderContentUnit(
|
|
6214
6538
|
unit,
|
|
6215
6539
|
message,
|
|
@@ -6228,19 +6552,19 @@ function AssistantStreamingIndicator({
|
|
|
6228
6552
|
thinking: t("message.thinking"),
|
|
6229
6553
|
answering: t("message.answering")
|
|
6230
6554
|
};
|
|
6231
|
-
return /* @__PURE__ */ (0,
|
|
6232
|
-
status === "loading" && /* @__PURE__ */ (0,
|
|
6233
|
-
status === "thinking" && /* @__PURE__ */ (0,
|
|
6234
|
-
/* @__PURE__ */ (0,
|
|
6235
|
-
/* @__PURE__ */ (0,
|
|
6236
|
-
/* @__PURE__ */ (0,
|
|
6555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: cn("flex items-center gap-2 text-xs text-muted-foreground", className), children: [
|
|
6556
|
+
status === "loading" && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react13.Loader2, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
6557
|
+
status === "thinking" && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex items-end gap-1", "aria-hidden": "true", children: [
|
|
6558
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:-0.3s]" }),
|
|
6559
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:-0.15s]" }),
|
|
6560
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce" })
|
|
6237
6561
|
] }),
|
|
6238
|
-
status === "answering" && /* @__PURE__ */ (0,
|
|
6239
|
-
/* @__PURE__ */ (0,
|
|
6240
|
-
/* @__PURE__ */ (0,
|
|
6241
|
-
/* @__PURE__ */ (0,
|
|
6562
|
+
status === "answering" && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex items-end gap-1", "aria-hidden": "true", children: [
|
|
6563
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "h-2 w-0.5 rounded-full bg-current animate-pulse [animation-delay:-0.25s]" }),
|
|
6564
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "h-3 w-0.5 rounded-full bg-current animate-pulse [animation-delay:-0.1s]" }),
|
|
6565
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "h-2.5 w-0.5 rounded-full bg-current animate-pulse" })
|
|
6242
6566
|
] }),
|
|
6243
|
-
/* @__PURE__ */ (0,
|
|
6567
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { children: labelMap[status] })
|
|
6244
6568
|
] });
|
|
6245
6569
|
}
|
|
6246
6570
|
function AssistantMessage({
|
|
@@ -6256,42 +6580,42 @@ function AssistantMessage({
|
|
|
6256
6580
|
const resolvedStreamingStatus = streamingStatus ?? getAssistantStreamingStatus(message, isStreaming);
|
|
6257
6581
|
const lookupMessages = messages?.length ? messages : [message];
|
|
6258
6582
|
const answerNode = renderContent(message, lookupMessages);
|
|
6259
|
-
const reasoningNode = hasReasoning ? /* @__PURE__ */ (0,
|
|
6583
|
+
const reasoningNode = hasReasoning ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ReasoningBlock, { reasoning: message.reasoning ?? [] }) : null;
|
|
6260
6584
|
if (!hasRenderableAssistantMessage(message) && !resolvedStreamingStatus) return null;
|
|
6261
6585
|
const streamingClass = isStreaming ? "streaming-active" : "";
|
|
6262
6586
|
if (!hasRenderableAssistantMessage(message) && resolvedStreamingStatus) {
|
|
6263
|
-
return /* @__PURE__ */ (0,
|
|
6587
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: cn("space-y-3", streamingClass, className), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) });
|
|
6264
6588
|
}
|
|
6265
6589
|
if (hasContent && hasReasoning) {
|
|
6266
|
-
return /* @__PURE__ */ (0,
|
|
6267
|
-
/* @__PURE__ */ (0,
|
|
6590
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: cn("space-y-3", streamingClass, className), children: [
|
|
6591
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
6268
6592
|
Tabs,
|
|
6269
6593
|
{
|
|
6270
6594
|
defaultValue: message.status === "reasoning" ? "reasoning" : "answer",
|
|
6271
6595
|
className: "w-full",
|
|
6272
6596
|
children: [
|
|
6273
|
-
/* @__PURE__ */ (0,
|
|
6274
|
-
/* @__PURE__ */ (0,
|
|
6275
|
-
/* @__PURE__ */ (0,
|
|
6597
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(TabsList, { className: "", children: [
|
|
6598
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TabsTrigger, { value: "answer", children: t("message.answer") }),
|
|
6599
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TabsTrigger, { value: "reasoning", children: t("message.reasoning") })
|
|
6276
6600
|
] }),
|
|
6277
|
-
/* @__PURE__ */ (0,
|
|
6278
|
-
/* @__PURE__ */ (0,
|
|
6601
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TabsContent, { value: "answer", className: "space-y-3", children: answerNode }),
|
|
6602
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TabsContent, { value: "reasoning", className: "space-y-3", children: reasoningNode })
|
|
6279
6603
|
]
|
|
6280
6604
|
}
|
|
6281
6605
|
),
|
|
6282
|
-
resolvedStreamingStatus ? /* @__PURE__ */ (0,
|
|
6606
|
+
resolvedStreamingStatus ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) : null
|
|
6283
6607
|
] });
|
|
6284
6608
|
}
|
|
6285
|
-
return /* @__PURE__ */ (0,
|
|
6609
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: cn("space-y-3", streamingClass, className), children: [
|
|
6286
6610
|
hasReasoning ? reasoningNode : answerNode,
|
|
6287
|
-
resolvedStreamingStatus ? /* @__PURE__ */ (0,
|
|
6611
|
+
resolvedStreamingStatus ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) : null
|
|
6288
6612
|
] });
|
|
6289
6613
|
}
|
|
6290
6614
|
|
|
6291
6615
|
// src/components/thread/MessageActions.tsx
|
|
6292
|
-
var
|
|
6616
|
+
var React24 = __toESM(require("react"), 1);
|
|
6293
6617
|
var import_lucide_react14 = require("lucide-react");
|
|
6294
|
-
var
|
|
6618
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
6295
6619
|
function MessageActions({
|
|
6296
6620
|
content,
|
|
6297
6621
|
isAssistant = false,
|
|
@@ -6300,7 +6624,7 @@ function MessageActions({
|
|
|
6300
6624
|
className
|
|
6301
6625
|
}) {
|
|
6302
6626
|
const { t } = useChatkitTranslation();
|
|
6303
|
-
const [copied, setCopied] =
|
|
6627
|
+
const [copied, setCopied] = React24.useState(false);
|
|
6304
6628
|
const handleCopy = async () => {
|
|
6305
6629
|
try {
|
|
6306
6630
|
await navigator.clipboard.writeText(content);
|
|
@@ -6313,7 +6637,7 @@ function MessageActions({
|
|
|
6313
6637
|
if (isStreaming) {
|
|
6314
6638
|
return null;
|
|
6315
6639
|
}
|
|
6316
|
-
return /* @__PURE__ */ (0,
|
|
6640
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
6317
6641
|
"div",
|
|
6318
6642
|
{
|
|
6319
6643
|
className: cn(
|
|
@@ -6321,7 +6645,7 @@ function MessageActions({
|
|
|
6321
6645
|
className
|
|
6322
6646
|
),
|
|
6323
6647
|
children: [
|
|
6324
|
-
/* @__PURE__ */ (0,
|
|
6648
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
6325
6649
|
"button",
|
|
6326
6650
|
{
|
|
6327
6651
|
type: "button",
|
|
@@ -6331,17 +6655,17 @@ function MessageActions({
|
|
|
6331
6655
|
copied && "text-green-500"
|
|
6332
6656
|
),
|
|
6333
6657
|
title: copied ? t("messageActions.copied") : t("messageActions.copy"),
|
|
6334
|
-
children: copied ? /* @__PURE__ */ (0,
|
|
6658
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react14.Check, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react14.Copy, { size: 14 })
|
|
6335
6659
|
}
|
|
6336
6660
|
),
|
|
6337
|
-
isAssistant && onRetry && /* @__PURE__ */ (0,
|
|
6661
|
+
isAssistant && onRetry && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
6338
6662
|
"button",
|
|
6339
6663
|
{
|
|
6340
6664
|
type: "button",
|
|
6341
6665
|
onClick: onRetry,
|
|
6342
6666
|
className: "p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",
|
|
6343
6667
|
title: t("messageActions.regenerate"),
|
|
6344
|
-
children: /* @__PURE__ */ (0,
|
|
6668
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react14.RefreshCw, { size: 14 })
|
|
6345
6669
|
}
|
|
6346
6670
|
)
|
|
6347
6671
|
]
|
|
@@ -6350,20 +6674,20 @@ function MessageActions({
|
|
|
6350
6674
|
}
|
|
6351
6675
|
|
|
6352
6676
|
// src/components/thread/StartScreen.tsx
|
|
6353
|
-
var
|
|
6677
|
+
var React25 = require("react");
|
|
6354
6678
|
var import_lucide_react15 = require("lucide-react");
|
|
6355
|
-
var
|
|
6679
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
6356
6680
|
function getIconComponent2(icon) {
|
|
6357
6681
|
const iconMap = {
|
|
6358
|
-
"circle-question": /* @__PURE__ */ (0,
|
|
6359
|
-
"lightbulb": /* @__PURE__ */ (0,
|
|
6360
|
-
"sparkle": /* @__PURE__ */ (0,
|
|
6361
|
-
"write": /* @__PURE__ */ (0,
|
|
6362
|
-
"search": /* @__PURE__ */ (0,
|
|
6363
|
-
"globe": /* @__PURE__ */ (0,
|
|
6364
|
-
"book-open": /* @__PURE__ */ (0,
|
|
6365
|
-
"compass": /* @__PURE__ */ (0,
|
|
6366
|
-
"bolt": /* @__PURE__ */ (0,
|
|
6682
|
+
"circle-question": /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react15.HelpCircle, { size: 20 }),
|
|
6683
|
+
"lightbulb": /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react15.Lightbulb, { size: 20 }),
|
|
6684
|
+
"sparkle": /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react15.Sparkles, { size: 20 }),
|
|
6685
|
+
"write": /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react15.Pencil, { size: 20 }),
|
|
6686
|
+
"search": /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react15.Search, { size: 20 }),
|
|
6687
|
+
"globe": /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react15.Globe, { size: 20 }),
|
|
6688
|
+
"book-open": /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react15.BookOpen, { size: 20 }),
|
|
6689
|
+
"compass": /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react15.Compass, { size: 20 }),
|
|
6690
|
+
"bolt": /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react15.Zap, { size: 20 })
|
|
6367
6691
|
};
|
|
6368
6692
|
return icon ? iconMap[icon] || iconMap["sparkle"] : iconMap["sparkle"];
|
|
6369
6693
|
}
|
|
@@ -6371,9 +6695,9 @@ function StartScreen({ startScreen, onPromptClick, className }) {
|
|
|
6371
6695
|
const { t } = useChatkitTranslation();
|
|
6372
6696
|
const greeting = startScreen?.greeting ?? t("startScreen.greeting");
|
|
6373
6697
|
const prompts = startScreen?.prompts ?? [];
|
|
6374
|
-
return /* @__PURE__ */ (0,
|
|
6375
|
-
/* @__PURE__ */ (0,
|
|
6376
|
-
prompts.length > 0 && /* @__PURE__ */ (0,
|
|
6698
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: cn("flex flex-col items-center justify-center py-12 px-4", className), children: [
|
|
6699
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "mb-8 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("h2", { className: "text-2xl font-semibold text-foreground mb-2", children: greeting }) }),
|
|
6700
|
+
prompts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "w-full max-w-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: prompts.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
6377
6701
|
"button",
|
|
6378
6702
|
{
|
|
6379
6703
|
type: "button",
|
|
@@ -6384,8 +6708,8 @@ function StartScreen({ startScreen, onPromptClick, className }) {
|
|
|
6384
6708
|
"focus:outline-none focus:ring-2 focus:ring-primary/20"
|
|
6385
6709
|
),
|
|
6386
6710
|
children: [
|
|
6387
|
-
/* @__PURE__ */ (0,
|
|
6388
|
-
/* @__PURE__ */ (0,
|
|
6711
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary", children: getIconComponent2(item.icon) }),
|
|
6712
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-sm font-medium text-foreground", children: item.label })
|
|
6389
6713
|
]
|
|
6390
6714
|
},
|
|
6391
6715
|
`prompt-${index}`
|
|
@@ -6393,134 +6717,6 @@ function StartScreen({ startScreen, onPromptClick, className }) {
|
|
|
6393
6717
|
] });
|
|
6394
6718
|
}
|
|
6395
6719
|
|
|
6396
|
-
// src/components/ui/chatkit-avatar.tsx
|
|
6397
|
-
var React25 = require("react");
|
|
6398
|
-
|
|
6399
|
-
// src/components/ui/avatar.tsx
|
|
6400
|
-
var React24 = __toESM(require("react"), 1);
|
|
6401
|
-
var AvatarPrimitive = __toESM(require("@radix-ui/react-avatar"), 1);
|
|
6402
|
-
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
6403
|
-
var Avatar = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
6404
|
-
AvatarPrimitive.Root,
|
|
6405
|
-
{
|
|
6406
|
-
ref,
|
|
6407
|
-
className: cn(
|
|
6408
|
-
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
|
6409
|
-
className
|
|
6410
|
-
),
|
|
6411
|
-
...props
|
|
6412
|
-
}
|
|
6413
|
-
));
|
|
6414
|
-
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
6415
|
-
var AvatarImage = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
6416
|
-
AvatarPrimitive.Image,
|
|
6417
|
-
{
|
|
6418
|
-
ref,
|
|
6419
|
-
className: cn("aspect-square h-full w-full", className),
|
|
6420
|
-
...props
|
|
6421
|
-
}
|
|
6422
|
-
));
|
|
6423
|
-
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
6424
|
-
var AvatarFallback = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
6425
|
-
AvatarPrimitive.Fallback,
|
|
6426
|
-
{
|
|
6427
|
-
ref,
|
|
6428
|
-
className: cn(
|
|
6429
|
-
"flex h-full w-full items-center justify-center rounded-full bg-muted",
|
|
6430
|
-
className
|
|
6431
|
-
),
|
|
6432
|
-
...props
|
|
6433
|
-
}
|
|
6434
|
-
));
|
|
6435
|
-
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
6436
|
-
|
|
6437
|
-
// src/components/ui/chatkit-avatar.tsx
|
|
6438
|
-
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
6439
|
-
function asRecord(value) {
|
|
6440
|
-
return value && typeof value === "object" ? value : null;
|
|
6441
|
-
}
|
|
6442
|
-
function getNonEmptyString(value) {
|
|
6443
|
-
if (typeof value !== "string") return void 0;
|
|
6444
|
-
const normalized = value.trim();
|
|
6445
|
-
return normalized || void 0;
|
|
6446
|
-
}
|
|
6447
|
-
function unicodeFromUnified(unified) {
|
|
6448
|
-
const normalized = getNonEmptyString(unified);
|
|
6449
|
-
if (!normalized) return void 0;
|
|
6450
|
-
try {
|
|
6451
|
-
return normalized.split("-").map((hex) => String.fromCodePoint(Number.parseInt(hex, 16))).join("");
|
|
6452
|
-
} catch {
|
|
6453
|
-
return void 0;
|
|
6454
|
-
}
|
|
6455
|
-
}
|
|
6456
|
-
function getEmojiCharacter(avatar) {
|
|
6457
|
-
return unicodeFromUnified(avatar?.emoji?.unified);
|
|
6458
|
-
}
|
|
6459
|
-
function getAvatarFallback(label) {
|
|
6460
|
-
return label.trim().charAt(0).toUpperCase() || "A";
|
|
6461
|
-
}
|
|
6462
|
-
function normalizeChatkitAvatar(rawAvatar) {
|
|
6463
|
-
if (typeof rawAvatar === "string") {
|
|
6464
|
-
const url = getNonEmptyString(rawAvatar);
|
|
6465
|
-
return url ? { url } : null;
|
|
6466
|
-
}
|
|
6467
|
-
const avatarRecord = asRecord(rawAvatar);
|
|
6468
|
-
if (!avatarRecord) return null;
|
|
6469
|
-
const emojiRecord = asRecord(avatarRecord.emoji);
|
|
6470
|
-
const avatar = {
|
|
6471
|
-
background: getNonEmptyString(avatarRecord.background),
|
|
6472
|
-
url: getNonEmptyString(avatarRecord.url),
|
|
6473
|
-
useNotoColor: Boolean(avatarRecord.useNotoColor)
|
|
6474
|
-
};
|
|
6475
|
-
if (emojiRecord) {
|
|
6476
|
-
avatar.emoji = {
|
|
6477
|
-
colons: getNonEmptyString(emojiRecord.colons),
|
|
6478
|
-
id: getNonEmptyString(emojiRecord.id),
|
|
6479
|
-
unified: getNonEmptyString(emojiRecord.unified)
|
|
6480
|
-
};
|
|
6481
|
-
}
|
|
6482
|
-
return avatar.url || avatar.background || avatar.emoji?.id || avatar.emoji?.unified ? avatar : null;
|
|
6483
|
-
}
|
|
6484
|
-
function extractAssistantAvatar(assistant) {
|
|
6485
|
-
const assistantRecord = asRecord(assistant);
|
|
6486
|
-
const metadata = asRecord(assistant.metadata);
|
|
6487
|
-
const rawAvatar = assistantRecord?.avatar ?? metadata?.avatar;
|
|
6488
|
-
const avatar = normalizeChatkitAvatar(rawAvatar);
|
|
6489
|
-
if (avatar) return avatar;
|
|
6490
|
-
const metadataAvatar = getNonEmptyString(metadata?.avatarUrl) ?? getNonEmptyString(metadata?.avatar_url);
|
|
6491
|
-
return metadataAvatar ? { url: metadataAvatar } : null;
|
|
6492
|
-
}
|
|
6493
|
-
function ChatkitAvatar({
|
|
6494
|
-
avatar,
|
|
6495
|
-
className,
|
|
6496
|
-
fallback,
|
|
6497
|
-
fallbackClassName,
|
|
6498
|
-
imageClassName,
|
|
6499
|
-
label,
|
|
6500
|
-
style,
|
|
6501
|
-
...props
|
|
6502
|
-
}) {
|
|
6503
|
-
const { theme } = useTheme();
|
|
6504
|
-
const emojiCharacter = getEmojiCharacter(avatar);
|
|
6505
|
-
const fallbackText = fallback || getAvatarFallback(label);
|
|
6506
|
-
const roundedClass = getRoundedClass(theme.radius);
|
|
6507
|
-
const emojiStyle = avatar?.useNotoColor ? { fontFamily: '"Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", sans-serif' } : void 0;
|
|
6508
|
-
const fallbackStyle = {
|
|
6509
|
-
...avatar?.background ? { background: avatar.background } : {}
|
|
6510
|
-
};
|
|
6511
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Avatar, { className: cn(roundedClass, className), style, ...props, children: [
|
|
6512
|
-
avatar?.url ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AvatarImage, { className: imageClassName, src: avatar.url, alt: label }) : null,
|
|
6513
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
6514
|
-
AvatarFallback,
|
|
6515
|
-
{
|
|
6516
|
-
className: cn(roundedClass, "text-sm font-medium text-foreground", fallbackClassName),
|
|
6517
|
-
style: fallbackStyle,
|
|
6518
|
-
children: emojiCharacter ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-[1.1em] leading-none", style: emojiStyle, children: emojiCharacter }) : fallbackText
|
|
6519
|
-
}
|
|
6520
|
-
)
|
|
6521
|
-
] });
|
|
6522
|
-
}
|
|
6523
|
-
|
|
6524
6720
|
// src/hooks/useThreads.ts
|
|
6525
6721
|
var React26 = __toESM(require("react"), 1);
|
|
6526
6722
|
var DEFAULT_LIMIT = 50;
|
|
@@ -6892,9 +7088,174 @@ function ContextUsageIndicator({
|
|
|
6892
7088
|
] });
|
|
6893
7089
|
}
|
|
6894
7090
|
|
|
7091
|
+
// src/lib/conversation-runtime-capabilities.ts
|
|
7092
|
+
var emptyMissingRuntimeCapabilityReferences = {
|
|
7093
|
+
skillIds: [],
|
|
7094
|
+
pluginNodeKeys: [],
|
|
7095
|
+
subAgentNodeKeys: []
|
|
7096
|
+
};
|
|
7097
|
+
function getConversationOptions(conversation) {
|
|
7098
|
+
return conversation?.options ?? null;
|
|
7099
|
+
}
|
|
7100
|
+
function wait(ms) {
|
|
7101
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
7102
|
+
}
|
|
7103
|
+
function splitByAvailability(values, availableValues) {
|
|
7104
|
+
const available = new Set(availableValues);
|
|
7105
|
+
const found = [];
|
|
7106
|
+
const missing = [];
|
|
7107
|
+
for (const value of values) {
|
|
7108
|
+
if (available.has(value)) {
|
|
7109
|
+
found.push(value);
|
|
7110
|
+
} else {
|
|
7111
|
+
missing.push(value);
|
|
7112
|
+
}
|
|
7113
|
+
}
|
|
7114
|
+
return { found, missing };
|
|
7115
|
+
}
|
|
7116
|
+
function hasMissingRuntimeCapabilityReferences(missing) {
|
|
7117
|
+
return missing.skillIds.length > 0 || missing.pluginNodeKeys.length > 0 || missing.subAgentNodeKeys.length > 0;
|
|
7118
|
+
}
|
|
7119
|
+
function getRuntimeCapabilitiesSelectionAvailability(selection, capabilities) {
|
|
7120
|
+
const skillIds = splitByAvailability(
|
|
7121
|
+
selection.skills.ids,
|
|
7122
|
+
capabilities.skills.map((skill) => skill.id)
|
|
7123
|
+
);
|
|
7124
|
+
const pluginNodeKeys = splitByAvailability(
|
|
7125
|
+
selection.plugins.nodeKeys,
|
|
7126
|
+
capabilities.plugins.map((plugin) => plugin.nodeKey)
|
|
7127
|
+
);
|
|
7128
|
+
const subAgentNodeKeys = splitByAvailability(
|
|
7129
|
+
selection.subAgents?.nodeKeys ?? [],
|
|
7130
|
+
capabilities.subAgents?.map((subAgent) => subAgent.nodeKey) ?? []
|
|
7131
|
+
);
|
|
7132
|
+
return {
|
|
7133
|
+
selection: {
|
|
7134
|
+
mode: "allowlist",
|
|
7135
|
+
skills: {
|
|
7136
|
+
...selection.skills.workspaceId ? { workspaceId: selection.skills.workspaceId } : {},
|
|
7137
|
+
ids: skillIds.found
|
|
7138
|
+
},
|
|
7139
|
+
plugins: {
|
|
7140
|
+
nodeKeys: pluginNodeKeys.found
|
|
7141
|
+
},
|
|
7142
|
+
subAgents: {
|
|
7143
|
+
nodeKeys: subAgentNodeKeys.found
|
|
7144
|
+
}
|
|
7145
|
+
},
|
|
7146
|
+
missing: {
|
|
7147
|
+
skillIds: skillIds.missing,
|
|
7148
|
+
pluginNodeKeys: pluginNodeKeys.missing,
|
|
7149
|
+
subAgentNodeKeys: subAgentNodeKeys.missing
|
|
7150
|
+
}
|
|
7151
|
+
};
|
|
7152
|
+
}
|
|
7153
|
+
async function findConversationByThreadId(client, threadId) {
|
|
7154
|
+
const normalizedThreadId = threadId.trim();
|
|
7155
|
+
if (!normalizedThreadId) {
|
|
7156
|
+
return null;
|
|
7157
|
+
}
|
|
7158
|
+
const result = await client.conversations.search({
|
|
7159
|
+
where: { threadId: normalizedThreadId },
|
|
7160
|
+
limit: 1
|
|
7161
|
+
});
|
|
7162
|
+
return result.items?.[0] ?? null;
|
|
7163
|
+
}
|
|
7164
|
+
async function findConversationByThreadIdWithRetry(client, threadId) {
|
|
7165
|
+
for (let attempt = 0; attempt < 5; attempt += 1) {
|
|
7166
|
+
const conversation = await findConversationByThreadId(client, threadId);
|
|
7167
|
+
if (conversation?.id) {
|
|
7168
|
+
return conversation;
|
|
7169
|
+
}
|
|
7170
|
+
if (attempt < 4) {
|
|
7171
|
+
await wait(250);
|
|
7172
|
+
}
|
|
7173
|
+
}
|
|
7174
|
+
return null;
|
|
7175
|
+
}
|
|
7176
|
+
async function loadConversationRuntimeCapabilities({
|
|
7177
|
+
client,
|
|
7178
|
+
threadId,
|
|
7179
|
+
capabilities
|
|
7180
|
+
}) {
|
|
7181
|
+
const conversation = await findConversationByThreadId(client, threadId);
|
|
7182
|
+
const persistedSelection = getConversationOptions(conversation)?.runtimeCapabilities ?? null;
|
|
7183
|
+
if (!persistedSelection) {
|
|
7184
|
+
return {
|
|
7185
|
+
conversation,
|
|
7186
|
+
selection: null,
|
|
7187
|
+
missing: emptyMissingRuntimeCapabilityReferences
|
|
7188
|
+
};
|
|
7189
|
+
}
|
|
7190
|
+
const availability = getRuntimeCapabilitiesSelectionAvailability(
|
|
7191
|
+
persistedSelection,
|
|
7192
|
+
capabilities
|
|
7193
|
+
);
|
|
7194
|
+
return {
|
|
7195
|
+
conversation,
|
|
7196
|
+
...availability
|
|
7197
|
+
};
|
|
7198
|
+
}
|
|
7199
|
+
async function persistConversationRuntimeCapabilities({
|
|
7200
|
+
client,
|
|
7201
|
+
threadId,
|
|
7202
|
+
capabilities,
|
|
7203
|
+
selection
|
|
7204
|
+
}) {
|
|
7205
|
+
const availability = getRuntimeCapabilitiesSelectionAvailability(
|
|
7206
|
+
selection,
|
|
7207
|
+
capabilities
|
|
7208
|
+
);
|
|
7209
|
+
const conversation = await findConversationByThreadIdWithRetry(
|
|
7210
|
+
client,
|
|
7211
|
+
threadId
|
|
7212
|
+
);
|
|
7213
|
+
if (!conversation?.id) {
|
|
7214
|
+
return {
|
|
7215
|
+
conversation,
|
|
7216
|
+
...availability,
|
|
7217
|
+
updated: false
|
|
7218
|
+
};
|
|
7219
|
+
}
|
|
7220
|
+
await client.conversations.update(conversation.id, {
|
|
7221
|
+
options: {
|
|
7222
|
+
...conversation.options ?? {},
|
|
7223
|
+
runtimeCapabilities: availability.selection
|
|
7224
|
+
}
|
|
7225
|
+
});
|
|
7226
|
+
return {
|
|
7227
|
+
conversation,
|
|
7228
|
+
...availability,
|
|
7229
|
+
updated: true
|
|
7230
|
+
};
|
|
7231
|
+
}
|
|
7232
|
+
|
|
6895
7233
|
// src/components/chat.tsx
|
|
6896
7234
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
6897
7235
|
var import_meta2 = {};
|
|
7236
|
+
function RuntimeCapabilityIcon({
|
|
7237
|
+
option,
|
|
7238
|
+
variant
|
|
7239
|
+
}) {
|
|
7240
|
+
const iconSize = variant === "chip" ? 12 : 16;
|
|
7241
|
+
if (option.type === "skill") {
|
|
7242
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react16.Brain, { size: iconSize });
|
|
7243
|
+
}
|
|
7244
|
+
if (option.type === "plugin") {
|
|
7245
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react16.Plug, { size: iconSize });
|
|
7246
|
+
}
|
|
7247
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
7248
|
+
ChatkitAvatar,
|
|
7249
|
+
{
|
|
7250
|
+
avatar: normalizeChatkitAvatar(option.capability.avatar),
|
|
7251
|
+
label: option.label,
|
|
7252
|
+
className: variant === "chip" ? "h-4 w-4" : "h-6 w-6",
|
|
7253
|
+
fallbackClassName: variant === "chip" ? "text-[9px]" : "text-[10px]",
|
|
7254
|
+
imageClassName: "object-cover",
|
|
7255
|
+
"data-slot": "runtime-sub-agent-avatar"
|
|
7256
|
+
}
|
|
7257
|
+
);
|
|
7258
|
+
}
|
|
6898
7259
|
var defaultApiUrl2 = import_meta2.env.VITE_XPERTAI_API_URL;
|
|
6899
7260
|
var COMPOSER_INPUT_MAX_HEIGHT = 128;
|
|
6900
7261
|
var LONG_TEXT_REFERENCE_THRESHOLD = 5e3;
|
|
@@ -6931,6 +7292,15 @@ function getHttpStatus(error) {
|
|
|
6931
7292
|
const status = error.status;
|
|
6932
7293
|
return typeof status === "number" ? status : null;
|
|
6933
7294
|
}
|
|
7295
|
+
function warnMissingRuntimeCapabilityReferences(action, missing) {
|
|
7296
|
+
if (!hasMissingRuntimeCapabilityReferences(missing)) {
|
|
7297
|
+
return;
|
|
7298
|
+
}
|
|
7299
|
+
console.warn(
|
|
7300
|
+
`[Chat] Runtime capabilities ${action} include unavailable references:`,
|
|
7301
|
+
missing
|
|
7302
|
+
);
|
|
7303
|
+
}
|
|
6934
7304
|
async function readImageDimensions(file) {
|
|
6935
7305
|
if (typeof window === "undefined" || typeof URL === "undefined") {
|
|
6936
7306
|
return {};
|
|
@@ -7186,6 +7556,7 @@ function Chat({
|
|
|
7186
7556
|
const autoScrollFrameRef = React28.useRef(null);
|
|
7187
7557
|
const isPointerDownRef = React28.useRef(false);
|
|
7188
7558
|
const lastTouchYRef = React28.useRef(null);
|
|
7559
|
+
const runtimeCapabilityPreferenceLoadRef = React28.useRef(0);
|
|
7189
7560
|
const resolvedTitle = title ?? t("chat.title");
|
|
7190
7561
|
const resolvedPlaceholder = placeholder ?? t("chat.placeholder");
|
|
7191
7562
|
const inputPlaceholder = selectedTool?.placeholderOverride ?? composer?.placeholder ?? resolvedPlaceholder;
|
|
@@ -7262,6 +7633,31 @@ function Chat({
|
|
|
7262
7633
|
runtimeCapabilityOptions,
|
|
7263
7634
|
runtimeCapabilityPalette
|
|
7264
7635
|
]);
|
|
7636
|
+
const persistSessionRuntimeCapabilities = React28.useCallback(
|
|
7637
|
+
async (threadId, selection) => {
|
|
7638
|
+
if (!runtimeCapabilities || !selection) {
|
|
7639
|
+
return;
|
|
7640
|
+
}
|
|
7641
|
+
try {
|
|
7642
|
+
const result = await persistConversationRuntimeCapabilities({
|
|
7643
|
+
client: stream.client,
|
|
7644
|
+
threadId,
|
|
7645
|
+
capabilities: runtimeCapabilities,
|
|
7646
|
+
selection
|
|
7647
|
+
});
|
|
7648
|
+
warnMissingRuntimeCapabilityReferences(
|
|
7649
|
+
"persisted selection",
|
|
7650
|
+
result.missing
|
|
7651
|
+
);
|
|
7652
|
+
} catch (error) {
|
|
7653
|
+
console.warn(
|
|
7654
|
+
"[Chat] Failed to persist runtime capabilities selection:",
|
|
7655
|
+
error
|
|
7656
|
+
);
|
|
7657
|
+
}
|
|
7658
|
+
},
|
|
7659
|
+
[runtimeCapabilities, stream.client]
|
|
7660
|
+
);
|
|
7265
7661
|
const clearQuoteSelection = React28.useCallback(() => {
|
|
7266
7662
|
setQuoteSelection(null);
|
|
7267
7663
|
}, []);
|
|
@@ -7632,14 +8028,55 @@ function Chat({
|
|
|
7632
8028
|
return () => controller.abort();
|
|
7633
8029
|
}, [missingConfig, stream.client, stream.assistantId]);
|
|
7634
8030
|
React28.useEffect(() => {
|
|
7635
|
-
setSessionRuntimeCapabilities(
|
|
7636
|
-
createDefaultRuntimeCapabilitiesSelection(runtimeCapabilities)
|
|
7637
|
-
);
|
|
7638
8031
|
setRunRuntimeCapabilities(
|
|
7639
8032
|
createEmptyRuntimeCapabilitiesSelection(runtimeCapabilities)
|
|
7640
8033
|
);
|
|
7641
8034
|
setRuntimeCapabilityPalette(null);
|
|
7642
|
-
|
|
8035
|
+
if (!runtimeCapabilitiesReady || !runtimeCapabilities) {
|
|
8036
|
+
setSessionRuntimeCapabilities(
|
|
8037
|
+
createEmptyRuntimeCapabilitiesSelection(runtimeCapabilities)
|
|
8038
|
+
);
|
|
8039
|
+
return;
|
|
8040
|
+
}
|
|
8041
|
+
const defaultSelection = createDefaultRuntimeCapabilitiesSelection(runtimeCapabilities);
|
|
8042
|
+
const threadId = stream.threadId?.trim();
|
|
8043
|
+
if (!threadId) {
|
|
8044
|
+
setSessionRuntimeCapabilities(defaultSelection);
|
|
8045
|
+
return;
|
|
8046
|
+
}
|
|
8047
|
+
let cancelled = false;
|
|
8048
|
+
const requestId = runtimeCapabilityPreferenceLoadRef.current + 1;
|
|
8049
|
+
runtimeCapabilityPreferenceLoadRef.current = requestId;
|
|
8050
|
+
setSessionRuntimeCapabilities(defaultSelection);
|
|
8051
|
+
void loadConversationRuntimeCapabilities({
|
|
8052
|
+
client: stream.client,
|
|
8053
|
+
threadId,
|
|
8054
|
+
capabilities: runtimeCapabilities
|
|
8055
|
+
}).then(({ selection, missing }) => {
|
|
8056
|
+
if (cancelled || runtimeCapabilityPreferenceLoadRef.current !== requestId) {
|
|
8057
|
+
return;
|
|
8058
|
+
}
|
|
8059
|
+
warnMissingRuntimeCapabilityReferences("loaded selection", missing);
|
|
8060
|
+
setSessionRuntimeCapabilities(selection ?? defaultSelection);
|
|
8061
|
+
}).catch((error) => {
|
|
8062
|
+
if (cancelled || runtimeCapabilityPreferenceLoadRef.current !== requestId) {
|
|
8063
|
+
return;
|
|
8064
|
+
}
|
|
8065
|
+
console.warn(
|
|
8066
|
+
"[Chat] Failed to load persisted runtime capabilities selection:",
|
|
8067
|
+
error
|
|
8068
|
+
);
|
|
8069
|
+
setSessionRuntimeCapabilities(defaultSelection);
|
|
8070
|
+
});
|
|
8071
|
+
return () => {
|
|
8072
|
+
cancelled = true;
|
|
8073
|
+
};
|
|
8074
|
+
}, [
|
|
8075
|
+
runtimeCapabilities,
|
|
8076
|
+
runtimeCapabilitiesReady,
|
|
8077
|
+
stream.client,
|
|
8078
|
+
stream.threadId
|
|
8079
|
+
]);
|
|
7643
8080
|
React28.useEffect(() => {
|
|
7644
8081
|
if (!runtimeCapabilityPalette) {
|
|
7645
8082
|
return;
|
|
@@ -7669,30 +8106,46 @@ function Chat({
|
|
|
7669
8106
|
}));
|
|
7670
8107
|
const handleSessionRuntimeCapabilityToggle = React28.useCallback(
|
|
7671
8108
|
(type, id, selected) => {
|
|
7672
|
-
setSessionRuntimeCapabilities(
|
|
7673
|
-
|
|
8109
|
+
setSessionRuntimeCapabilities((previous) => {
|
|
8110
|
+
const nextSelection = toggleRuntimeCapabilitySelection(
|
|
8111
|
+
previous,
|
|
8112
|
+
type,
|
|
8113
|
+
id,
|
|
8114
|
+
selected
|
|
8115
|
+
);
|
|
8116
|
+
const threadId = stream.threadId?.trim();
|
|
8117
|
+
if (threadId) {
|
|
8118
|
+
void persistSessionRuntimeCapabilities(threadId, nextSelection);
|
|
8119
|
+
}
|
|
8120
|
+
return nextSelection;
|
|
8121
|
+
});
|
|
8122
|
+
},
|
|
8123
|
+
[persistSessionRuntimeCapabilities, stream.threadId]
|
|
8124
|
+
);
|
|
8125
|
+
const updateRuntimeCapabilityPalette = React28.useCallback(
|
|
8126
|
+
(value, selectionStart) => {
|
|
8127
|
+
const input = composerInputRef.current;
|
|
8128
|
+
const nextPalette = resolveRuntimeCapabilityPalette(
|
|
8129
|
+
value,
|
|
8130
|
+
typeof selectionStart === "number" ? selectionStart : input?.selectionStart
|
|
7674
8131
|
);
|
|
8132
|
+
setRuntimeCapabilityPalette(nextPalette);
|
|
7675
8133
|
},
|
|
7676
8134
|
[]
|
|
7677
8135
|
);
|
|
7678
|
-
const updateRuntimeCapabilityPalette = React28.useCallback((value) => {
|
|
7679
|
-
const input = composerInputRef.current;
|
|
7680
|
-
const nextPalette = resolveRuntimeCapabilityPalette(
|
|
7681
|
-
value,
|
|
7682
|
-
input?.selectionStart
|
|
7683
|
-
);
|
|
7684
|
-
setRuntimeCapabilityPalette(nextPalette);
|
|
7685
|
-
}, []);
|
|
7686
8136
|
const handleComposerChange = React28.useCallback(
|
|
7687
8137
|
(event) => {
|
|
7688
8138
|
const nextValue = event.target.value;
|
|
7689
8139
|
setDraft(nextValue);
|
|
7690
|
-
updateRuntimeCapabilityPalette(nextValue);
|
|
8140
|
+
updateRuntimeCapabilityPalette(nextValue, event.target.selectionStart);
|
|
7691
8141
|
},
|
|
7692
8142
|
[updateRuntimeCapabilityPalette]
|
|
7693
8143
|
);
|
|
7694
8144
|
const handleComposerSelect = React28.useCallback(() => {
|
|
7695
|
-
updateRuntimeCapabilityPalette(
|
|
8145
|
+
updateRuntimeCapabilityPalette(
|
|
8146
|
+
draft,
|
|
8147
|
+
composerInputRef.current?.selectionStart
|
|
8148
|
+
);
|
|
7696
8149
|
}, [draft, updateRuntimeCapabilityPalette]);
|
|
7697
8150
|
const selectRunRuntimeCapability = React28.useCallback(
|
|
7698
8151
|
(option) => {
|
|
@@ -7776,6 +8229,8 @@ function Chat({
|
|
|
7776
8229
|
defaults: options?.request,
|
|
7777
8230
|
humanInput: inputPayload
|
|
7778
8231
|
});
|
|
8232
|
+
const sessionRuntimeCapabilitiesForPersistence = effectiveSessionRuntimeCapabilities;
|
|
8233
|
+
const shouldPersistSessionRuntimeCapabilities = !!sessionRuntimeCapabilitiesForPersistence && !stream.threadId && !nextFollowUpMode;
|
|
7779
8234
|
stream.submit(
|
|
7780
8235
|
{
|
|
7781
8236
|
input: inputPayload,
|
|
@@ -7785,6 +8240,12 @@ function Chat({
|
|
|
7785
8240
|
...nextFollowUpMode ? { followUpMode: nextFollowUpMode } : {},
|
|
7786
8241
|
...requestOptions.context ? { context: requestOptions.context } : {},
|
|
7787
8242
|
...requestOptions.config ? { config: requestOptions.config } : {},
|
|
8243
|
+
...shouldPersistSessionRuntimeCapabilities ? {
|
|
8244
|
+
onThreadResolved: (threadId) => persistSessionRuntimeCapabilities(
|
|
8245
|
+
threadId,
|
|
8246
|
+
sessionRuntimeCapabilitiesForPersistence
|
|
8247
|
+
)
|
|
8248
|
+
} : {},
|
|
7788
8249
|
...!nextFollowUpMode ? {
|
|
7789
8250
|
optimisticValues: (prev) => {
|
|
7790
8251
|
const prevMessages = prev?.messages ?? [];
|
|
@@ -7806,8 +8267,10 @@ function Chat({
|
|
|
7806
8267
|
},
|
|
7807
8268
|
[
|
|
7808
8269
|
effectiveRuntimeCapabilitiesForSubmit,
|
|
8270
|
+
effectiveSessionRuntimeCapabilities,
|
|
7809
8271
|
isSendDisabled,
|
|
7810
8272
|
options?.request,
|
|
8273
|
+
persistSessionRuntimeCapabilities,
|
|
7811
8274
|
references,
|
|
7812
8275
|
runtimeCapabilities,
|
|
7813
8276
|
scrollToBottom,
|
|
@@ -8107,6 +8570,8 @@ function Chat({
|
|
|
8107
8570
|
defaults: options?.request,
|
|
8108
8571
|
humanInput: inputPayload
|
|
8109
8572
|
});
|
|
8573
|
+
const sessionRuntimeCapabilitiesForPersistence = effectiveSessionRuntimeCapabilities;
|
|
8574
|
+
const shouldPersistSessionRuntimeCapabilities = !!sessionRuntimeCapabilitiesForPersistence && !stream.threadId && !nextFollowUpMode;
|
|
8110
8575
|
stream.submit(
|
|
8111
8576
|
{
|
|
8112
8577
|
input: inputPayload,
|
|
@@ -8116,6 +8581,12 @@ function Chat({
|
|
|
8116
8581
|
...nextFollowUpMode ? { followUpMode: nextFollowUpMode } : {},
|
|
8117
8582
|
...requestOptions.context ? { context: requestOptions.context } : {},
|
|
8118
8583
|
...requestOptions.config ? { config: requestOptions.config } : {},
|
|
8584
|
+
...shouldPersistSessionRuntimeCapabilities ? {
|
|
8585
|
+
onThreadResolved: (threadId) => persistSessionRuntimeCapabilities(
|
|
8586
|
+
threadId,
|
|
8587
|
+
sessionRuntimeCapabilitiesForPersistence
|
|
8588
|
+
)
|
|
8589
|
+
} : {},
|
|
8119
8590
|
...!nextFollowUpMode ? {
|
|
8120
8591
|
optimisticValues: (prev) => {
|
|
8121
8592
|
const prevMessages = prev?.messages ?? [];
|
|
@@ -8574,7 +9045,7 @@ function Chat({
|
|
|
8574
9045
|
{
|
|
8575
9046
|
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",
|
|
8576
9047
|
children: [
|
|
8577
|
-
|
|
9048
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(RuntimeCapabilityIcon, { option, variant: "chip" }),
|
|
8578
9049
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "max-w-40 truncate", children: option.label }),
|
|
8579
9050
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
8580
9051
|
"button",
|
|
@@ -8644,7 +9115,7 @@ function Chat({
|
|
|
8644
9115
|
index === runtimeCapabilityPalette.activeIndex && "bg-muted"
|
|
8645
9116
|
),
|
|
8646
9117
|
children: [
|
|
8647
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center text-muted-foreground", children:
|
|
9118
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(RuntimeCapabilityIcon, { option, variant: "list" }) }),
|
|
8648
9119
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "min-w-0 flex-1", children: [
|
|
8649
9120
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "block truncate", children: option.label }),
|
|
8650
9121
|
option.description && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "block truncate text-xs text-muted-foreground", children: option.description })
|