@xpert-ai/chatkit-ui 0.4.3 → 0.4.5
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-DUmeJXMF.js → _baseUniq-Co-XCsnp.js} +1 -1
- package/dist/app/assets/{abap-CAHc26jT.js → abap--D_Kn6xP.js} +1 -1
- package/dist/app/assets/{abnf-CVkfvAG7.js → abnf-D5WYHs_l.js} +1 -1
- package/dist/app/assets/{actionscript-BEzJB7WT.js → actionscript-DsVXzf-F.js} +1 -1
- package/dist/app/assets/{ada-DFt4d8s0.js → ada-Cvy4GD3X.js} +1 -1
- package/dist/app/assets/{agda-Dgk-d8Ej.js → agda-DsLk_pDK.js} +1 -1
- package/dist/app/assets/{al-CgIwrIi7.js → al-BeEwAGNu.js} +1 -1
- package/dist/app/assets/{antlr4-v8CVE7fu.js → antlr4-BPDPs4mt.js} +1 -1
- package/dist/app/assets/{apacheconf-DJRGF6BS.js → apacheconf-DDa4MsSo.js} +1 -1
- package/dist/app/assets/{apex-uUgU4D2N.js → apex-IXxIiz3T.js} +1 -1
- package/dist/app/assets/{apl-QLgjdSly.js → apl-_Xuh93xL.js} +1 -1
- package/dist/app/assets/{applescript-BFVeekYt.js → applescript-zF-7HGIh.js} +1 -1
- package/dist/app/assets/{aql-mHS01Klr.js → aql-qapLE7vo.js} +1 -1
- package/dist/app/assets/{arc-CuZh5y_d.js → arc-R6XS2pBf.js} +1 -1
- package/dist/app/assets/{architectureDiagram-Q4EWVU46-Cp-oqFuq.js → architectureDiagram-Q4EWVU46-6z2emAH2.js} +1 -1
- package/dist/app/assets/{arduino-D3yikoHI.js → arduino-2NlbDC0E.js} +1 -1
- package/dist/app/assets/{arff-Bzp22yLm.js → arff-15Fx0kni.js} +1 -1
- package/dist/app/assets/{asciidoc-DyMmgwzJ.js → asciidoc-IGRk8vb3.js} +1 -1
- package/dist/app/assets/{asm6502-B80D95Jm.js → asm6502-lyM25DlO.js} +1 -1
- package/dist/app/assets/{asmatmel-D7eDDNLW.js → asmatmel-DGRiY6RP.js} +1 -1
- package/dist/app/assets/{aspnet-DP6URAXF.js → aspnet-DRHt5RUL.js} +1 -1
- package/dist/app/assets/{autohotkey-CkErJpFg.js → autohotkey-DNI_3d2u.js} +1 -1
- package/dist/app/assets/{autoit-BdpOTPpv.js → autoit-Tn0WXTkZ.js} +1 -1
- package/dist/app/assets/{avisynth-Dmhp2heE.js → avisynth-DZrXIifS.js} +1 -1
- package/dist/app/assets/{avro-idl-DUhKaWgN.js → avro-idl-DvnfR4q7.js} +1 -1
- package/dist/app/assets/{bash-BivYb6BT.js → bash-bqRZI_pO.js} +1 -1
- package/dist/app/assets/{basic-D-8b5r6a.js → basic-BaebTlRT.js} +1 -1
- package/dist/app/assets/{batch-BgMIK1_X.js → batch-PcmijW6C.js} +1 -1
- package/dist/app/assets/{bbcode-DVoSXbR6.js → bbcode-6XIsStWc.js} +1 -1
- package/dist/app/assets/{bicep-DAyvfnBb.js → bicep-CtazMCUu.js} +1 -1
- package/dist/app/assets/{birb-MciDoImB.js → birb-Bb-Z2Uoh.js} +1 -1
- package/dist/app/assets/{bison-MfDz2wSW.js → bison-DMpTitx0.js} +1 -1
- package/dist/app/assets/{blockDiagram-DXYQGD6D-D6fzklHs.js → blockDiagram-DXYQGD6D-4zGz8PX5.js} +1 -1
- package/dist/app/assets/{bnf-NfFrR8D5.js → bnf-BgCmtG9K.js} +1 -1
- package/dist/app/assets/{brainfuck-ClI8X4SF.js → brainfuck-ZV2E8Tsx.js} +1 -1
- package/dist/app/assets/{brightscript-zS1iu4vq.js → brightscript-BcUAceb3.js} +1 -1
- package/dist/app/assets/{bro-DljtPq2D.js → bro-CJMO1xO5.js} +1 -1
- package/dist/app/assets/{bsl-hhgsw8vw.js → bsl-BUH4KORj.js} +1 -1
- package/dist/app/assets/{c-DrpFfWnr.js → c-jtWYEsXA.js} +1 -1
- package/dist/app/assets/{c4Diagram-AHTNJAMY-DFqBpiK8.js → c4Diagram-AHTNJAMY-BWtNBZjf.js} +1 -1
- package/dist/app/assets/{cfscript-DDb6Lyf6.js → cfscript-BRsXWjhc.js} +1 -1
- package/dist/app/assets/{chaiscript-DF48gGB2.js → chaiscript-Cyvk1xer.js} +1 -1
- package/dist/app/assets/channel-e2pCq0KM.js +1 -0
- package/dist/app/assets/{chunk-4BX2VUAB-B12wPqT-.js → chunk-4BX2VUAB-Cci3cX0w.js} +1 -1
- package/dist/app/assets/{chunk-4TB4RGXK-DvBRV7Wa.js → chunk-4TB4RGXK-Cc2Mhdt_.js} +1 -1
- package/dist/app/assets/{chunk-55IACEB6-DYYpJnIt.js → chunk-55IACEB6-BCuokoIJ.js} +1 -1
- package/dist/app/assets/{chunk-EDXVE4YY-C_cgU5oo.js → chunk-EDXVE4YY-BniMDhnr.js} +1 -1
- package/dist/app/assets/{chunk-FMBD7UC4-B3gAIARW.js → chunk-FMBD7UC4-BZgeDsZW.js} +1 -1
- package/dist/app/assets/{chunk-OYMX7WX6-DfeuAq49.js → chunk-OYMX7WX6-DNtQg1UI.js} +1 -1
- package/dist/app/assets/{chunk-QZHKN3VN-B_q1wkHk.js → chunk-QZHKN3VN-CYOkyP3f.js} +1 -1
- package/dist/app/assets/{chunk-YZCP3GAM-BI51-5Xl.js → chunk-YZCP3GAM-DrNq3DSp.js} +1 -1
- package/dist/app/assets/{cil-5e3EFNQ-.js → cil-xB1Wcx8v.js} +1 -1
- package/dist/app/assets/classDiagram-6PBFFD2Q-DHVJ7GQ2.js +1 -0
- package/dist/app/assets/classDiagram-v2-HSJHXN6E-DHVJ7GQ2.js +1 -0
- package/dist/app/assets/{clike-CGm019RU.js → clike-Bys-F0y3.js} +1 -1
- package/dist/app/assets/{clojure-EUxmeflx.js → clojure-X2Ur1GCR.js} +1 -1
- package/dist/app/assets/clone-CepWRlEk.js +1 -0
- package/dist/app/assets/{cmake-Cx_TgZnP.js → cmake-BV05wnad.js} +1 -1
- package/dist/app/assets/{cobol-BthqexLq.js → cobol-DmbS5Ovj.js} +1 -1
- package/dist/app/assets/{coffeescript-Gvi0WUl9.js → coffeescript-NB44yUqU.js} +1 -1
- package/dist/app/assets/{concurnas-DIsKiUcY.js → concurnas-DRly0Ymz.js} +1 -1
- package/dist/app/assets/{coq-Cbm4LAk7.js → coq-5BMX0a02.js} +1 -1
- package/dist/app/assets/{core-DbOl2YVH.js → core-BDQ00Bae.js} +1 -1
- package/dist/app/assets/{cose-bilkent-S5V4N54A-tDz06OBa.js → cose-bilkent-S5V4N54A-C5sw6sBK.js} +1 -1
- package/dist/app/assets/{cpp-DvM1W1M3.js → cpp-DGTd--nV.js} +1 -1
- package/dist/app/assets/{crystal-Cgeclk0-.js → crystal-04-7jCUz.js} +1 -1
- package/dist/app/assets/{csharp-DLajxlCH.js → csharp-BekrIY2o.js} +1 -1
- package/dist/app/assets/{cshtml-D4WJuQ28.js → cshtml-DRaoghIv.js} +1 -1
- package/dist/app/assets/{csp-DlOt0mll.js → csp-9-yRddNx.js} +1 -1
- package/dist/app/assets/{css-BzsDxt7h.js → css-CAtlVqs0.js} +1 -1
- package/dist/app/assets/{css-extras-yKv4-OYr.js → css-extras-CWVDDT-t.js} +1 -1
- package/dist/app/assets/{csv-Bv1CB32G.js → csv-Dg-zB1qs.js} +1 -1
- package/dist/app/assets/{cypher-p1eqx6Jt.js → cypher-4IbDZc8Y.js} +1 -1
- package/dist/app/assets/{d-Beqwk42F.js → d-B7r6CIW_.js} +1 -1
- package/dist/app/assets/{dagre-KV5264BT-Bva9KEQ3.js → dagre-KV5264BT-Aa6ga6Tg.js} +1 -1
- package/dist/app/assets/{dart-DGUIre7b.js → dart-33q2tN5Y.js} +1 -1
- package/dist/app/assets/{dataweave-BKEvzZhX.js → dataweave-_KZXrqme.js} +1 -1
- package/dist/app/assets/{dax-7DSfOdOt.js → dax-bZvO9T2D.js} +1 -1
- package/dist/app/assets/{dhall-D96qT6GR.js → dhall-CMmS_d1I.js} +1 -1
- package/dist/app/assets/{diagram-5BDNPKRD-BLdVEgIg.js → diagram-5BDNPKRD-CWOgCaWs.js} +1 -1
- package/dist/app/assets/{diagram-G4DWMVQ6-B1mGc4DZ.js → diagram-G4DWMVQ6-pXmi3PKB.js} +1 -1
- package/dist/app/assets/{diagram-MMDJMWI5-BCbX9vwv.js → diagram-MMDJMWI5-D6L1aAmr.js} +1 -1
- package/dist/app/assets/{diagram-TYMM5635-BbiM5rwX.js → diagram-TYMM5635-Bnbk8hJL.js} +1 -1
- package/dist/app/assets/{diff-BJy0ijGD.js → diff-BMnhXRfO.js} +1 -1
- package/dist/app/assets/{django-CA3Li7Xc.js → django-CwyRKLji.js} +1 -1
- package/dist/app/assets/{dns-zone-file-CQ5FJ0e2.js → dns-zone-file-CH2YmErm.js} +1 -1
- package/dist/app/assets/{docker-C_jKEoBB.js → docker-CMu6fCBm.js} +1 -1
- package/dist/app/assets/{dot-UuhFwEC4.js → dot-DbQdbB35.js} +1 -1
- package/dist/app/assets/{ebnf-v-JYoSll.js → ebnf-Dv8o3Xd5.js} +1 -1
- package/dist/app/assets/{editorconfig-Be3ygJWd.js → editorconfig-DGpNYUTF.js} +1 -1
- package/dist/app/assets/{eiffel-wc_Ly8vK.js → eiffel-DlwnHLpb.js} +1 -1
- package/dist/app/assets/{ejs-DkUkLWO_.js → ejs-CnitBaIQ.js} +1 -1
- package/dist/app/assets/{elixir-D4YWMnOb.js → elixir-BwncS48q.js} +1 -1
- package/dist/app/assets/{elm-DvpgkmZw.js → elm-DIeTEpXB.js} +1 -1
- package/dist/app/assets/{erDiagram-SMLLAGMA-DeYRxjbM.js → erDiagram-SMLLAGMA-DCVTOQcd.js} +1 -1
- package/dist/app/assets/{erb-BrK-PMgA.js → erb-DLShoXNV.js} +1 -1
- package/dist/app/assets/{erlang-BYb5M5Pb.js → erlang-CymPR6rz.js} +1 -1
- package/dist/app/assets/{etlua-Bhe3IDc-.js → etlua-DnGxLY3M.js} +1 -1
- package/dist/app/assets/{excel-formula-jODZlBfX.js → excel-formula-BH7DFVmw.js} +1 -1
- package/dist/app/assets/{factor-BKsD6d0K.js → factor-Bh-cxy91.js} +1 -1
- package/dist/app/assets/{false-CcGNJYns.js → false-Bbvyie5f.js} +1 -1
- package/dist/app/assets/{firestore-security-rules-5vyxJaeJ.js → firestore-security-rules-C1Z4GDy7.js} +1 -1
- package/dist/app/assets/{flow-NU1izkCa.js → flow-CEb_LmQm.js} +1 -1
- package/dist/app/assets/{flowDiagram-DWJPFMVM-Bj0SYU-k.js → flowDiagram-DWJPFMVM-t4rWU0cl.js} +1 -1
- package/dist/app/assets/{fortran-DCGTQjju.js → fortran-BNasWrrZ.js} +1 -1
- package/dist/app/assets/{fsharp-DNhO6FM-.js → fsharp-BsCVJk6E.js} +1 -1
- package/dist/app/assets/{ftl-P_p2wyPG.js → ftl-jRCUJODD.js} +1 -1
- package/dist/app/assets/{ganttDiagram-T4ZO3ILL-Dv-WNsgb.js → ganttDiagram-T4ZO3ILL-CIt95e25.js} +1 -1
- package/dist/app/assets/{gap-DgF9ZGYZ.js → gap-BNZC8mW7.js} +1 -1
- package/dist/app/assets/{gcode-CMhuYhvh.js → gcode-Dm32zQCL.js} +1 -1
- package/dist/app/assets/{gdscript-BaNvmSXL.js → gdscript-nnhWLrN6.js} +1 -1
- package/dist/app/assets/{gedcom-BLjWW8zc.js → gedcom-CK-ySXEa.js} +1 -1
- package/dist/app/assets/{gherkin-BxsMbJgE.js → gherkin--zbB3aYH.js} +1 -1
- package/dist/app/assets/{git-C3JKKGbu.js → git-DiWVe3eJ.js} +1 -1
- package/dist/app/assets/{gitGraphDiagram-UUTBAWPF-antOmae7.js → gitGraphDiagram-UUTBAWPF-SzhkWrKD.js} +1 -1
- package/dist/app/assets/{glsl-Dy963NrS.js → glsl-D1fReIPw.js} +1 -1
- package/dist/app/assets/{gml-RHKUDQYR.js → gml-BDyUxEuB.js} +1 -1
- package/dist/app/assets/{gn-B5wX0kjQ.js → gn-y9O1wUj9.js} +1 -1
- package/dist/app/assets/{go-BO0hAT1N.js → go-BluFqfDq.js} +1 -1
- package/dist/app/assets/{go-module-C2Fr-9ms.js → go-module-DZRzQTXf.js} +1 -1
- package/dist/app/assets/{graph-DLqezY1N.js → graph-CqvHVXoE.js} +1 -1
- package/dist/app/assets/{graphql-D58aRI9g.js → graphql-W2OnfZNH.js} +1 -1
- package/dist/app/assets/{groovy-IGpaqhY4.js → groovy-CJ1kbbBa.js} +1 -1
- package/dist/app/assets/{haml-C2z2yhSa.js → haml-CrhrA9XY.js} +1 -1
- package/dist/app/assets/{handlebars-BobMlUhh.js → handlebars-EgGfXI7t.js} +1 -1
- package/dist/app/assets/{haskell-nIuVVanU.js → haskell-Bj5MfGGI.js} +1 -1
- package/dist/app/assets/{haxe-D5efufya.js → haxe-BdDpk8xR.js} +1 -1
- package/dist/app/assets/{hcl-D9KAZKAO.js → hcl-D9OwvylQ.js} +1 -1
- package/dist/app/assets/{hlsl-BFWBj6lA.js → hlsl-562nbzk6.js} +1 -1
- package/dist/app/assets/{hoon-B5vc2PPa.js → hoon-BqdgVrcr.js} +1 -1
- package/dist/app/assets/{hpkp-X9Vy-aP4.js → hpkp-EH8H3Hom.js} +1 -1
- package/dist/app/assets/{hsts-BTHtjxYA.js → hsts-QIGmRf78.js} +1 -1
- package/dist/app/assets/{http-D93SJiT9.js → http-CzfjEVlY.js} +1 -1
- package/dist/app/assets/{ichigojam-DFGOLrmf.js → ichigojam-D98a8BcA.js} +1 -1
- package/dist/app/assets/{icon-BsJxVaoC.js → icon-DBD-5k6c.js} +1 -1
- package/dist/app/assets/{icu-message-format-C0hqHQFf.js → icu-message-format-BYT71AMs.js} +1 -1
- package/dist/app/assets/{idris-D_XFEa4Y.js → idris-B7zJwyc1.js} +1 -1
- package/dist/app/assets/{iecst-BBDx_Apd.js → iecst-SesII_E4.js} +1 -1
- package/dist/app/assets/{ignore-5mrYyBCy.js → ignore-B6Rk10df.js} +1 -1
- package/dist/app/assets/index-CmKBuFcH.css +1 -0
- package/dist/app/assets/{index-OJL54NcI.js → index-DH__JuG8.js} +196 -196
- package/dist/app/assets/{infoDiagram-42DDH7IO-DHNCTrQo.js → infoDiagram-42DDH7IO-B_FQWO4F.js} +1 -1
- package/dist/app/assets/{inform7-D_BK4Whb.js → inform7-h2cFjWGx.js} +1 -1
- package/dist/app/assets/{ini-DHL1U3zm.js → ini-BS51ySt6.js} +1 -1
- package/dist/app/assets/{io-Bw7TS_7w.js → io-B4AFlnDh.js} +1 -1
- package/dist/app/assets/{ishikawaDiagram-UXIWVN3A-CjewUobx.js → ishikawaDiagram-UXIWVN3A-1rRuzx1s.js} +1 -1
- package/dist/app/assets/{j-DfX-jMbV.js → j-Drz8g_1M.js} +1 -1
- package/dist/app/assets/{java-BldkMImw.js → java-DCpfLevZ.js} +1 -1
- package/dist/app/assets/{javadoc-6dOM24mQ.js → javadoc-DXIzKQcq.js} +1 -1
- package/dist/app/assets/{javadoclike-BHmZlS5e.js → javadoclike-C8SmsTQv.js} +1 -1
- package/dist/app/assets/{javascript-FvrzCcvc.js → javascript-uumTubEW.js} +1 -1
- package/dist/app/assets/{javastacktrace-Byn0DB0K.js → javastacktrace-B-eU9XLD.js} +1 -1
- package/dist/app/assets/{jexl-CB5kP-Am.js → jexl-D4977EKW.js} +1 -1
- package/dist/app/assets/{jolie-C7Q5mImX.js → jolie-DLawqTad.js} +1 -1
- package/dist/app/assets/{journeyDiagram-VCZTEJTY-DD8qNzmh.js → journeyDiagram-VCZTEJTY-DrQg892C.js} +1 -1
- package/dist/app/assets/{jq-C9deMLmZ.js → jq-Cm1vS58Z.js} +1 -1
- package/dist/app/assets/{js-extras-Brhyk9ef.js → js-extras-RCYpP2to.js} +1 -1
- package/dist/app/assets/{js-templates-DhpXMSuF.js → js-templates-767pf_M_.js} +1 -1
- package/dist/app/assets/{jsdoc-BEesq6va.js → jsdoc-DTvTCxfG.js} +1 -1
- package/dist/app/assets/{json-CRGHFhSS.js → json-Dy-V79-1.js} +1 -1
- package/dist/app/assets/{json5-CbPQgQz7.js → json5-BEmUoI2s.js} +1 -1
- package/dist/app/assets/{jsonp-BBjDy5AO.js → jsonp-Box0_wdw.js} +1 -1
- package/dist/app/assets/{jsstacktrace-CcOPcdH3.js → jsstacktrace-D4k7LJFI.js} +1 -1
- package/dist/app/assets/{jsx-DRgBFrjX.js → jsx-UHXI_vWR.js} +1 -1
- package/dist/app/assets/{julia-DAe7WbG-.js → julia-DNluswh2.js} +1 -1
- package/dist/app/assets/{kanban-definition-6JOO6SKY-DgTSO2X8.js → kanban-definition-6JOO6SKY-DCoBgIKn.js} +1 -1
- package/dist/app/assets/{keepalived-COsmSeDV.js → keepalived-cL1_TOGJ.js} +1 -1
- package/dist/app/assets/{keyman-Biz_0q7B.js → keyman-CgmsT3ZD.js} +1 -1
- package/dist/app/assets/{kotlin-C3V8Z8W0.js → kotlin-B-7C62fR.js} +1 -1
- package/dist/app/assets/{kumir-clIi7e8-.js → kumir-BmZSzZs3.js} +1 -1
- package/dist/app/assets/{kusto-BhEtzjY8.js → kusto-Bd4bditr.js} +1 -1
- package/dist/app/assets/{latex-kWox6R5Q.js → latex-B6Yn44p1.js} +1 -1
- package/dist/app/assets/{latte-C8Xd4YKa.js → latte-D_VkuuMY.js} +1 -1
- package/dist/app/assets/{layout-CD5_V8sq.js → layout-CuQBqeJF.js} +1 -1
- package/dist/app/assets/{less-8ceLguvR.js → less-CNL3ODIy.js} +1 -1
- package/dist/app/assets/{lilypond-CfYHEM-K.js → lilypond-Bvambxk4.js} +1 -1
- package/dist/app/assets/{linear-B5jHFagM.js → linear-BFLcIrl3.js} +1 -1
- package/dist/app/assets/{liquid-BJ6eYcfk.js → liquid-B-rCvqgj.js} +1 -1
- package/dist/app/assets/{lisp--smLUoul.js → lisp-DAPeLOCL.js} +1 -1
- package/dist/app/assets/{livescript-BBflhyer.js → livescript-DhdAKU5C.js} +1 -1
- package/dist/app/assets/{llvm-Stc38VbV.js → llvm-CZUCpwhn.js} +1 -1
- package/dist/app/assets/{log-Dl9NGCxx.js → log-DWq76M48.js} +1 -1
- package/dist/app/assets/{lolcode-7yqzBped.js → lolcode-Cpeb2C7M.js} +1 -1
- package/dist/app/assets/{lua-BEWp6yVC.js → lua-VuQhfB0e.js} +1 -1
- package/dist/app/assets/{magma-a1ZYdqHu.js → magma-C6-R8Pis.js} +1 -1
- package/dist/app/assets/{makefile-QpxduTfi.js → makefile-C8sXNjev.js} +1 -1
- package/dist/app/assets/{markdown-Dr9rg3gd.js → markdown-Dr_2eVkJ.js} +1 -1
- package/dist/app/assets/{markup-DWdbcYGh.js → markup-DYRaVR0L.js} +1 -1
- package/dist/app/assets/{markup-templating-BduvWqLe.js → markup-templating-Clq2Wdtu.js} +1 -1
- package/dist/app/assets/{matlab-C9LyN81W.js → matlab-N7ULHzkN.js} +1 -1
- package/dist/app/assets/{maxscript-BMf24IEz.js → maxscript-C_UH_c0Y.js} +1 -1
- package/dist/app/assets/{mel-C_j2S2hb.js → mel-biAclKO6.js} +1 -1
- package/dist/app/assets/{mermaid-G8stp4Fu.js → mermaid-cA3X8ng1.js} +1 -1
- package/dist/app/assets/{min-BGvlJ2dI.js → min-DNXX2fdQ.js} +1 -1
- package/dist/app/assets/{mindmap-definition-QFDTVHPH-Dxkf-h1G.js → mindmap-definition-QFDTVHPH-B3hDdQGV.js} +1 -1
- package/dist/app/assets/{mizar-J5U-ieUu.js → mizar-DkeIuoWx.js} +1 -1
- package/dist/app/assets/{mongodb-DsLKEq_k.js → mongodb-CZtDL2oy.js} +1 -1
- package/dist/app/assets/{monkey-lZP0TIai.js → monkey-B7rkJ-YN.js} +1 -1
- package/dist/app/assets/{moonscript-OiCHzZ6_.js → moonscript-BrAkE7P-.js} +1 -1
- package/dist/app/assets/{n1ql-C6sbE8_e.js → n1ql-CAwurqwa.js} +1 -1
- package/dist/app/assets/{n4js-BpPLTwi3.js → n4js-CQMx2F8M.js} +1 -1
- package/dist/app/assets/{nand2tetris-hdl-BONzgEmL.js → nand2tetris-hdl-C_WH3v-f.js} +1 -1
- package/dist/app/assets/{naniscript-DmYZ1vD6.js → naniscript-BIg6AoSC.js} +1 -1
- package/dist/app/assets/{nasm-BfiJTfj8.js → nasm-JWQkVK3O.js} +1 -1
- package/dist/app/assets/{neon-CM742PO-.js → neon-CCu-JZXF.js} +1 -1
- package/dist/app/assets/{nevod-Dlk8fgIJ.js → nevod-DQ_tL5xo.js} +1 -1
- package/dist/app/assets/{nginx-BZ-0DFHd.js → nginx-CE0GIB_t.js} +1 -1
- package/dist/app/assets/{nim-CU13w-pb.js → nim-BQkGgHx1.js} +1 -1
- package/dist/app/assets/{nix-DKrd4S8j.js → nix-DjPqNtXA.js} +1 -1
- package/dist/app/assets/{nsis-B6Grq7ob.js → nsis-B0wDo6fc.js} +1 -1
- package/dist/app/assets/{objectivec-Dbl3oSVf.js → objectivec-BOWTft_L.js} +1 -1
- package/dist/app/assets/{ocaml-Dp6vkH1l.js → ocaml-rGGzL-J8.js} +1 -1
- package/dist/app/assets/{opencl-BGEl-B5f.js → opencl-7DwawK0u.js} +1 -1
- package/dist/app/assets/{openqasm-CBrpfqoP.js → openqasm-BoZmVcpe.js} +1 -1
- package/dist/app/assets/{oz-Bcy_Q3m9.js → oz-k8zQh74U.js} +1 -1
- package/dist/app/assets/{parigp-C8xRJQCD.js → parigp-DOF_5XSw.js} +1 -1
- package/dist/app/assets/{parser-Cey9DM6y.js → parser-Bn3oD8Fj.js} +1 -1
- package/dist/app/assets/{pascal-l6HUvzh7.js → pascal-BMod2MBu.js} +1 -1
- package/dist/app/assets/{pascaligo-B0R2oVyK.js → pascaligo-VMBK85nU.js} +1 -1
- package/dist/app/assets/{pcaxis-B7gTfCp3.js → pcaxis-DtO95BO9.js} +1 -1
- package/dist/app/assets/{peoplecode-BrynhEhk.js → peoplecode-B6669Uht.js} +1 -1
- package/dist/app/assets/{perl-DGnem1ta.js → perl-BWa2t7hE.js} +1 -1
- package/dist/app/assets/{php-ymrnn-Sa.js → php-D1EHwdfc.js} +1 -1
- package/dist/app/assets/{php-extras-UxJ7EW_B.js → php-extras-BkzLJdMh.js} +1 -1
- package/dist/app/assets/{phpdoc-D9_wAKK9.js → phpdoc-Cjl8GbI3.js} +1 -1
- package/dist/app/assets/{pieDiagram-DEJITSTG-DQU88qux.js → pieDiagram-DEJITSTG-BOQDZEsp.js} +1 -1
- package/dist/app/assets/{plsql-DAA7FuKL.js → plsql-C9d_4ASZ.js} +1 -1
- package/dist/app/assets/{powerquery-iAxKW4DJ.js → powerquery-B8dvsoEG.js} +1 -1
- package/dist/app/assets/{powershell-CWnnAMh5.js → powershell-B_E5Ls3m.js} +1 -1
- package/dist/app/assets/{processing-Fx5vM2Rk.js → processing-JtrZ9RaV.js} +1 -1
- package/dist/app/assets/{prolog-MDMz_07H.js → prolog-CqFUVRIw.js} +1 -1
- package/dist/app/assets/{promql-pDapTiOR.js → promql-CAbgJv1n.js} +1 -1
- package/dist/app/assets/{properties-Cq5vAXr4.js → properties-BngV24FT.js} +1 -1
- package/dist/app/assets/{protobuf-BSKn03IB.js → protobuf-Bi9iRUiu.js} +1 -1
- package/dist/app/assets/{psl-DJWnJ0aZ.js → psl-pDjrt0B9.js} +1 -1
- package/dist/app/assets/{pug-6thMZc-l.js → pug-DioknANs.js} +1 -1
- package/dist/app/assets/{puppet-DcBfOA0r.js → puppet-ML2ON0Nh.js} +1 -1
- package/dist/app/assets/{pure-BMCCjO23.js → pure-DhCM2LcO.js} +1 -1
- package/dist/app/assets/{purebasic-DUfq0bVz.js → purebasic-BBRpNPNK.js} +1 -1
- package/dist/app/assets/{purescript-Bmj-jbV7.js → purescript-BCyPbnZA.js} +1 -1
- package/dist/app/assets/{q-o6FC2Oci.js → q-AswilSny.js} +1 -1
- package/dist/app/assets/{qml-CaBbPt0f.js → qml-CmAUtWqC.js} +1 -1
- package/dist/app/assets/{qore-C0fJNj2s.js → qore-Bv9pFdiR.js} +1 -1
- package/dist/app/assets/{qsharp-nrwk7Iu2.js → qsharp-48tPx5Mz.js} +1 -1
- package/dist/app/assets/{quadrantDiagram-34T5L4WZ-DQQGChO4.js → quadrantDiagram-34T5L4WZ-xfjbVVZu.js} +1 -1
- package/dist/app/assets/{r-s3d67ipT.js → r-D7-cDDS_.js} +1 -1
- package/dist/app/assets/{racket-CvnxUTxS.js → racket-rfJjsp9a.js} +1 -1
- package/dist/app/assets/{reason-abnvbDHw.js → reason-DBC0zi5i.js} +1 -1
- package/dist/app/assets/{regex-Dyp7nyFE.js → regex-DnBFBfKd.js} +1 -1
- package/dist/app/assets/{rego-D9o_M1Kt.js → rego-B4yEjn-8.js} +1 -1
- package/dist/app/assets/{renpy-P-s55mrw.js → renpy-D_4quYLX.js} +1 -1
- package/dist/app/assets/{requirementDiagram-MS252O5E-CQyaMifY.js → requirementDiagram-MS252O5E-ykcp6OKq.js} +1 -1
- package/dist/app/assets/{rest-CJGNsPIO.js → rest-DE5aTQbn.js} +1 -1
- package/dist/app/assets/{rip--_Kjyshk.js → rip-nLkeQy-_.js} +1 -1
- package/dist/app/assets/{roboconf-CzO4IdEr.js → roboconf-fk8WiTzj.js} +1 -1
- package/dist/app/assets/{robotframework-CqMBjau5.js → robotframework-CT4iaIxT.js} +1 -1
- package/dist/app/assets/{ruby-CcbP52GS.js → ruby-cQyytj4i.js} +1 -1
- package/dist/app/assets/{rust-BDcJmAdg.js → rust-CWJm_bSY.js} +1 -1
- package/dist/app/assets/{sankeyDiagram-XADWPNL6-BR5ykQyP.js → sankeyDiagram-XADWPNL6-Bhogh-O-.js} +1 -1
- package/dist/app/assets/{sas-6ZRrxGY4.js → sas-DoRGa1wg.js} +1 -1
- package/dist/app/assets/{sass-LQWASCzx.js → sass-LYaBIZKs.js} +1 -1
- package/dist/app/assets/{scala-dLVC34jC.js → scala-BZjhJr8S.js} +1 -1
- package/dist/app/assets/{scheme-ljjM-kw4.js → scheme-D01CiDze.js} +1 -1
- package/dist/app/assets/{scss-BjZr9V6H.js → scss-Da6GwvfN.js} +1 -1
- package/dist/app/assets/{sequenceDiagram-FGHM5R23-C_CfyMdO.js → sequenceDiagram-FGHM5R23-ecYbruEX.js} +1 -1
- package/dist/app/assets/{shell-session-DN7Q5cOF.js → shell-session-g6FrqTiP.js} +1 -1
- package/dist/app/assets/{smali-BSUZr7sT.js → smali-BSpX36tk.js} +1 -1
- package/dist/app/assets/{smalltalk-DNUcII1j.js → smalltalk-Bq_Gsc0F.js} +1 -1
- package/dist/app/assets/{smarty-w3V8wJ8q.js → smarty-D3fU2RbY.js} +1 -1
- package/dist/app/assets/{sml-DSoVmt8E.js → sml-TZkjEgtP.js} +1 -1
- package/dist/app/assets/{solidity-r-lFr53c.js → solidity-DLkuvBc2.js} +1 -1
- package/dist/app/assets/{solution-file-BE-32cJO.js → solution-file-BqI5xPXQ.js} +1 -1
- package/dist/app/assets/{soy-BH05VIly.js → soy-BCG5CQr6.js} +1 -1
- package/dist/app/assets/{sparql-BmZSbo8m.js → sparql-DQQsm_l4.js} +1 -1
- package/dist/app/assets/{splunk-spl-BBtbm42X.js → splunk-spl-bY7_uYjh.js} +1 -1
- package/dist/app/assets/{sqf-2G5YaT6f.js → sqf-BZo7hu6i.js} +1 -1
- package/dist/app/assets/{sql-BhZO3kQ8.js → sql-DqFLgmXx.js} +1 -1
- package/dist/app/assets/{squirrel-6NG1h2a_.js → squirrel-CiX2EfEw.js} +1 -1
- package/dist/app/assets/{stan-DlLgeY1f.js → stan-CMhpMP7k.js} +1 -1
- package/dist/app/assets/{stateDiagram-FHFEXIEX-BK6LRJ_J.js → stateDiagram-FHFEXIEX-v9Gsby_c.js} +1 -1
- package/dist/app/assets/stateDiagram-v2-QKLJ7IA2-2pX5wx_N.js +1 -0
- package/dist/app/assets/{stylus-9MANoABX.js → stylus-CenUxfuN.js} +1 -1
- package/dist/app/assets/{swift-rgVRgAqK.js → swift-BVjGHQuG.js} +1 -1
- package/dist/app/assets/{systemd-DH306ton.js → systemd-CpOXAdLf.js} +1 -1
- package/dist/app/assets/{t4-cs-CqAUhraT.js → t4-cs-CS9lJ-K0.js} +1 -1
- package/dist/app/assets/{t4-templating-CdnkPXAS.js → t4-templating-hj-TNDsq.js} +1 -1
- package/dist/app/assets/{t4-vb-BGXI99pE.js → t4-vb-Ck7mu1gJ.js} +1 -1
- package/dist/app/assets/{tap-BAZJNbLK.js → tap-DaH9gaoq.js} +1 -1
- package/dist/app/assets/{tcl-BOEKRtOp.js → tcl-DNIWr75O.js} +1 -1
- package/dist/app/assets/{textile-D7X0Sgyn.js → textile-Bv4nPa6s.js} +1 -1
- package/dist/app/assets/{timeline-definition-GMOUNBTQ-B_LU5nDM.js → timeline-definition-GMOUNBTQ-D6n0S-ku.js} +1 -1
- package/dist/app/assets/{toml-CfzGw53h.js → toml-DF3HfhqH.js} +1 -1
- package/dist/app/assets/{tremor-DYByk7ar.js → tremor-Bvh1Y6zY.js} +1 -1
- package/dist/app/assets/{tt2-CNCaPxhQ.js → tt2-Dv5tLBlM.js} +1 -1
- package/dist/app/assets/{turtle-Bzs_at2N.js → turtle-DkLAfnik.js} +1 -1
- package/dist/app/assets/{twig-o2S4KNvE.js → twig-S_GHUqZa.js} +1 -1
- package/dist/app/assets/{typescript-OnTd0yu3.js → typescript-Cu71LnVi.js} +1 -1
- package/dist/app/assets/{typoscript-CSmcWd5z.js → typoscript-CtN4Jy8Z.js} +1 -1
- package/dist/app/assets/{unrealscript-cdAqsg1H.js → unrealscript-BRjPcrs6.js} +1 -1
- package/dist/app/assets/{uorazor-It80EI2m.js → uorazor-D4ckTG59.js} +1 -1
- package/dist/app/assets/{uri-DsMi8rd7.js → uri-DQCryf4S.js} +1 -1
- package/dist/app/assets/{v-B_-3T97Y.js → v-Bx-_iyUf.js} +1 -1
- package/dist/app/assets/{vala-Bege32x4.js → vala-C-8psoRf.js} +1 -1
- package/dist/app/assets/{vbnet-DxWsZHmf.js → vbnet-Do4mtB7R.js} +1 -1
- package/dist/app/assets/{velocity-D8j2-t5T.js → velocity-Drww5v_3.js} +1 -1
- package/dist/app/assets/{vennDiagram-DHZGUBPP-DfQHyCke.js → vennDiagram-DHZGUBPP-tW8wVSRe.js} +1 -1
- package/dist/app/assets/{verilog-BOdg-tSC.js → verilog-B8pepi-H.js} +1 -1
- package/dist/app/assets/{vhdl-Ce-nebP4.js → vhdl-CuO3hi8I.js} +1 -1
- package/dist/app/assets/{vim-Xv1PHa_E.js → vim-DSsNung_.js} +1 -1
- package/dist/app/assets/{visual-basic-Dxm3bTj4.js → visual-basic-CZIqY5t6.js} +1 -1
- package/dist/app/assets/{wardley-RL74JXVD-B6u0ieiH.js → wardley-RL74JXVD-D7c8EbFm.js} +1 -1
- package/dist/app/assets/{wardleyDiagram-NUSXRM2D-DFue6QoQ.js → wardleyDiagram-NUSXRM2D-Br8nJ8eB.js} +1 -1
- package/dist/app/assets/{warpscript-CXGTE5kB.js → warpscript-DxQu8-1N.js} +1 -1
- package/dist/app/assets/{wasm-DkO34hDs.js → wasm-TvYG9PxF.js} +1 -1
- package/dist/app/assets/{web-idl-BPq5ywx_.js → web-idl-Cz41qHgE.js} +1 -1
- package/dist/app/assets/{wiki-DPqgO5Yt.js → wiki-Dpvt1md3.js} +1 -1
- package/dist/app/assets/{wolfram-BUOqMX2F.js → wolfram-Bg7HPXEQ.js} +1 -1
- package/dist/app/assets/{wren-KDTDLR_P.js → wren-D5Yecsqj.js} +1 -1
- package/dist/app/assets/{xeora-tlwdZtLE.js → xeora-Cg-n24u9.js} +1 -1
- package/dist/app/assets/{xml-doc-mP74j5_p.js → xml-doc-Eti4SXoM.js} +1 -1
- package/dist/app/assets/{xojo-C9Z4cCIr.js → xojo-DhQBW3jL.js} +1 -1
- package/dist/app/assets/{xquery-CNxehrYO.js → xquery-DrnMYyrL.js} +1 -1
- package/dist/app/assets/{xychartDiagram-5P7HB3ND-B_zEnzIh.js → xychartDiagram-5P7HB3ND-D0kV7MNO.js} +1 -1
- package/dist/app/assets/{yaml-CYOcRzsc.js → yaml-DiOrjhia.js} +1 -1
- package/dist/app/assets/{yang-CdXyvG4d.js → yang-B38xE-H2.js} +1 -1
- package/dist/app/assets/{zig-DisfpEah.js → zig-C7oerdaD.js} +1 -1
- package/dist/app/index.html +2 -2
- package/dist/index.cjs +1021 -443
- package/dist/index.js +1019 -440
- package/package.json +3 -3
- package/dist/app/assets/channel-DFkA7Odq.js +0 -1
- package/dist/app/assets/classDiagram-6PBFFD2Q-BhcMxOX3.js +0 -1
- package/dist/app/assets/classDiagram-v2-HSJHXN6E-BhcMxOX3.js +0 -1
- package/dist/app/assets/clone-D0zp_cmi.js +0 -1
- package/dist/app/assets/index-s5_akYUB.css +0 -1
- package/dist/app/assets/stateDiagram-v2-QKLJ7IA2-kcyyVi9f.js +0 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/components/chat.tsx
|
|
2
|
-
import * as
|
|
2
|
+
import * as React50 from "react";
|
|
3
3
|
import {
|
|
4
4
|
ArrowDown as ArrowDown2,
|
|
5
5
|
ChevronDown as ChevronDown5,
|
|
@@ -1680,6 +1680,21 @@ var en_US_default = {
|
|
|
1680
1680
|
loading: "Loading",
|
|
1681
1681
|
thinking: "Thinking",
|
|
1682
1682
|
answering: "Answering",
|
|
1683
|
+
navigation: {
|
|
1684
|
+
label: "Message navigation",
|
|
1685
|
+
system: "System",
|
|
1686
|
+
tool: "Tool",
|
|
1687
|
+
event: "Event",
|
|
1688
|
+
message: "Message",
|
|
1689
|
+
image: "Image",
|
|
1690
|
+
memory: "Memory",
|
|
1691
|
+
widget: "Widget",
|
|
1692
|
+
mcpApp: "MCP App",
|
|
1693
|
+
attachment: "Attachment",
|
|
1694
|
+
reference: "Reference",
|
|
1695
|
+
capability: "Capability",
|
|
1696
|
+
moreTags: "+{{count}}"
|
|
1697
|
+
},
|
|
1683
1698
|
mcpApp: {
|
|
1684
1699
|
loading: "Loading MCP App"
|
|
1685
1700
|
},
|
|
@@ -2073,6 +2088,21 @@ var zh_CN_default = {
|
|
|
2073
2088
|
loading: "\u6B63\u5728\u52A0\u8F7D",
|
|
2074
2089
|
thinking: "\u6B63\u5728\u601D\u8003",
|
|
2075
2090
|
answering: "\u6B63\u5728\u751F\u6210",
|
|
2091
|
+
navigation: {
|
|
2092
|
+
label: "\u6D88\u606F\u5BFC\u822A",
|
|
2093
|
+
system: "\u7CFB\u7EDF",
|
|
2094
|
+
tool: "\u5DE5\u5177",
|
|
2095
|
+
event: "\u4E8B\u4EF6",
|
|
2096
|
+
message: "\u6D88\u606F",
|
|
2097
|
+
image: "\u56FE\u7247",
|
|
2098
|
+
memory: "\u8BB0\u5FC6",
|
|
2099
|
+
widget: "\u7EC4\u4EF6",
|
|
2100
|
+
mcpApp: "MCP App",
|
|
2101
|
+
attachment: "\u9644\u4EF6",
|
|
2102
|
+
reference: "\u5F15\u7528",
|
|
2103
|
+
capability: "\u80FD\u529B",
|
|
2104
|
+
moreTags: "+{{count}}"
|
|
2105
|
+
},
|
|
2076
2106
|
mcpApp: {
|
|
2077
2107
|
loading: "\u6B63\u5728\u52A0\u8F7D MCP App"
|
|
2078
2108
|
},
|
|
@@ -8178,7 +8208,7 @@ var TabsContent = React28.forwardRef(
|
|
|
8178
8208
|
TabsContent.displayName = "TabsContent";
|
|
8179
8209
|
|
|
8180
8210
|
// src/components/thread/markdown-text.tsx
|
|
8181
|
-
import ReactMarkdown from "react-markdown";
|
|
8211
|
+
import ReactMarkdown, { defaultUrlTransform } from "react-markdown";
|
|
8182
8212
|
import remarkGfm from "remark-gfm";
|
|
8183
8213
|
import rehypeKatex from "rehype-katex";
|
|
8184
8214
|
import remarkMath from "remark-math";
|
|
@@ -8186,6 +8216,7 @@ import {
|
|
|
8186
8216
|
Children,
|
|
8187
8217
|
isValidElement,
|
|
8188
8218
|
memo,
|
|
8219
|
+
useContext as useContext5,
|
|
8189
8220
|
useId as useId4,
|
|
8190
8221
|
useState as useState14
|
|
8191
8222
|
} from "react";
|
|
@@ -8766,11 +8797,78 @@ var proposedPlanOpenPattern = /^\s*<proposed_plan>\s*$/;
|
|
|
8766
8797
|
var proposedPlanClosePattern = /^\s*<\/proposed_plan>\s*$/;
|
|
8767
8798
|
var markdownFencePattern = /^ {0,3}(`{3,}|~{3,})/;
|
|
8768
8799
|
var planMarkdownFencePattern = /^\s*(`{3,}|~{3,})[ \t]*(?:markdown|md)[^\n]*\r?\n([\s\S]*?)\r?\n\1[ \t]*\s*$/i;
|
|
8800
|
+
var knowledgebaseCitationEffectName = "knowledgebase.open_citation";
|
|
8769
8801
|
var stripMarkdownNode = (props) => {
|
|
8770
8802
|
const elementProps = { ...props };
|
|
8771
8803
|
delete elementProps.node;
|
|
8772
8804
|
return elementProps;
|
|
8773
8805
|
};
|
|
8806
|
+
var parseKnowledgebaseCitationHref = (href) => {
|
|
8807
|
+
if (typeof href !== "string" || !href.trim()) {
|
|
8808
|
+
return null;
|
|
8809
|
+
}
|
|
8810
|
+
try {
|
|
8811
|
+
const url = new URL(href);
|
|
8812
|
+
if (url.protocol !== "xpert:" || url.hostname !== "knowledgebase" || url.pathname !== "/chunk") {
|
|
8813
|
+
return null;
|
|
8814
|
+
}
|
|
8815
|
+
const documentId = url.searchParams.get("documentId")?.trim();
|
|
8816
|
+
if (!documentId) {
|
|
8817
|
+
return null;
|
|
8818
|
+
}
|
|
8819
|
+
const knowledgebaseId = url.searchParams.get("knowledgebaseId")?.trim();
|
|
8820
|
+
const chunkId = url.searchParams.get("chunkId")?.trim();
|
|
8821
|
+
const documentName = url.searchParams.get("documentName")?.trim();
|
|
8822
|
+
return {
|
|
8823
|
+
documentId,
|
|
8824
|
+
citationUrl: href,
|
|
8825
|
+
...knowledgebaseId ? { knowledgebaseId } : {},
|
|
8826
|
+
...chunkId ? { chunkId } : {},
|
|
8827
|
+
...documentName ? { documentName } : {}
|
|
8828
|
+
};
|
|
8829
|
+
} catch {
|
|
8830
|
+
return null;
|
|
8831
|
+
}
|
|
8832
|
+
};
|
|
8833
|
+
var markdownUrlTransform = (value) => parseKnowledgebaseCitationHref(value) ? value : defaultUrlTransform(value);
|
|
8834
|
+
function MarkdownAnchor({
|
|
8835
|
+
className,
|
|
8836
|
+
href,
|
|
8837
|
+
onClick,
|
|
8838
|
+
...props
|
|
8839
|
+
}) {
|
|
8840
|
+
const parentMessenger = useContext5(ParentMessengerContext);
|
|
8841
|
+
const citationTarget = parseKnowledgebaseCitationHref(href);
|
|
8842
|
+
const anchorProps = stripMarkdownNode(props);
|
|
8843
|
+
return /* @__PURE__ */ jsx32(
|
|
8844
|
+
"a",
|
|
8845
|
+
{
|
|
8846
|
+
className: cn(
|
|
8847
|
+
citationTarget ? "text-muted-foreground text-[0.85em] underline decoration-dotted underline-offset-4 transition-colors hover:text-primary" : "text-primary font-medium underline underline-offset-4",
|
|
8848
|
+
className
|
|
8849
|
+
),
|
|
8850
|
+
href,
|
|
8851
|
+
target: citationTarget ? void 0 : "_blank",
|
|
8852
|
+
rel: citationTarget ? void 0 : "noopener noreferrer",
|
|
8853
|
+
"data-knowledgebase-citation": citationTarget ? "true" : void 0,
|
|
8854
|
+
onClick: (event) => {
|
|
8855
|
+
onClick?.(event);
|
|
8856
|
+
if (!citationTarget || event.defaultPrevented) {
|
|
8857
|
+
return;
|
|
8858
|
+
}
|
|
8859
|
+
event.preventDefault();
|
|
8860
|
+
parentMessenger?.sendEvent("public_event", [
|
|
8861
|
+
"effect",
|
|
8862
|
+
{
|
|
8863
|
+
name: knowledgebaseCitationEffectName,
|
|
8864
|
+
data: citationTarget
|
|
8865
|
+
}
|
|
8866
|
+
]);
|
|
8867
|
+
},
|
|
8868
|
+
...anchorProps
|
|
8869
|
+
}
|
|
8870
|
+
);
|
|
8871
|
+
}
|
|
8774
8872
|
var getTextContent = (children) => Children.toArray(children).map((child) => {
|
|
8775
8873
|
if (typeof child === "string" || typeof child === "number") {
|
|
8776
8874
|
return String(child);
|
|
@@ -8865,6 +8963,7 @@ function MarkdownContent({ children }) {
|
|
|
8865
8963
|
{
|
|
8866
8964
|
remarkPlugins: [remarkGfm, remarkMath],
|
|
8867
8965
|
rehypePlugins: [rehypeKatex],
|
|
8966
|
+
urlTransform: markdownUrlTransform,
|
|
8868
8967
|
components: defaultComponents,
|
|
8869
8968
|
children
|
|
8870
8969
|
}
|
|
@@ -9070,18 +9169,7 @@ var defaultComponents = {
|
|
|
9070
9169
|
...stripMarkdownNode(props)
|
|
9071
9170
|
}
|
|
9072
9171
|
),
|
|
9073
|
-
a:
|
|
9074
|
-
"a",
|
|
9075
|
-
{
|
|
9076
|
-
className: cn(
|
|
9077
|
-
"text-primary font-medium underline underline-offset-4",
|
|
9078
|
-
className
|
|
9079
|
-
),
|
|
9080
|
-
target: "_blank",
|
|
9081
|
-
rel: "noopener noreferrer",
|
|
9082
|
-
...stripMarkdownNode(props)
|
|
9083
|
-
}
|
|
9084
|
-
),
|
|
9172
|
+
a: MarkdownAnchor,
|
|
9085
9173
|
blockquote: ({ className, ...props }) => /* @__PURE__ */ jsx32(
|
|
9086
9174
|
"blockquote",
|
|
9087
9175
|
{
|
|
@@ -13168,10 +13256,179 @@ function AssistantMessage({
|
|
|
13168
13256
|
] });
|
|
13169
13257
|
}
|
|
13170
13258
|
|
|
13171
|
-
// src/components/thread/
|
|
13259
|
+
// src/components/thread/MessageNavigator.tsx
|
|
13172
13260
|
import * as React37 from "react";
|
|
13173
|
-
import { Check as Check5, Copy as Copy3, RefreshCw as RefreshCw2 } from "lucide-react";
|
|
13174
13261
|
import { jsx as jsx43, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
13262
|
+
var ACTIVE_OFFSET_PX = 12;
|
|
13263
|
+
function getMarkerWidthClass(index, active, interactionIndex) {
|
|
13264
|
+
if (interactionIndex >= 0) {
|
|
13265
|
+
const distance = Math.abs(index - interactionIndex);
|
|
13266
|
+
if (distance === 0) return "w-7";
|
|
13267
|
+
if (distance === 1) return "w-5";
|
|
13268
|
+
if (distance === 2) return "w-3.5";
|
|
13269
|
+
return "w-2";
|
|
13270
|
+
}
|
|
13271
|
+
return active ? "w-5" : "w-2";
|
|
13272
|
+
}
|
|
13273
|
+
function getAnchorTop(viewport, anchor) {
|
|
13274
|
+
return anchor.offsetTop - viewport.offsetTop;
|
|
13275
|
+
}
|
|
13276
|
+
function resolveActiveItemId(items, viewport, getAnchor) {
|
|
13277
|
+
if (!viewport || items.length === 0) return null;
|
|
13278
|
+
const targetTop = viewport.scrollTop + ACTIVE_OFFSET_PX;
|
|
13279
|
+
let activeId = items[0]?.id ?? null;
|
|
13280
|
+
for (const item of items) {
|
|
13281
|
+
const anchor = getAnchor(item);
|
|
13282
|
+
if (!anchor) continue;
|
|
13283
|
+
if (getAnchorTop(viewport, anchor) <= targetTop) {
|
|
13284
|
+
activeId = item.id;
|
|
13285
|
+
continue;
|
|
13286
|
+
}
|
|
13287
|
+
break;
|
|
13288
|
+
}
|
|
13289
|
+
return activeId;
|
|
13290
|
+
}
|
|
13291
|
+
function scrollToAnchor(viewport, anchor) {
|
|
13292
|
+
const top = Math.max(0, getAnchorTop(viewport, anchor) - ACTIVE_OFFSET_PX);
|
|
13293
|
+
if (typeof viewport.scrollTo === "function") {
|
|
13294
|
+
viewport.scrollTo({ top, behavior: "smooth" });
|
|
13295
|
+
return;
|
|
13296
|
+
}
|
|
13297
|
+
viewport.scrollTop = top;
|
|
13298
|
+
}
|
|
13299
|
+
function MessageNavigator({
|
|
13300
|
+
items,
|
|
13301
|
+
viewportRef,
|
|
13302
|
+
getAnchor,
|
|
13303
|
+
onNavigate,
|
|
13304
|
+
className,
|
|
13305
|
+
label,
|
|
13306
|
+
tagsOverflowLabel
|
|
13307
|
+
}) {
|
|
13308
|
+
const [hoveredId, setHoveredId] = React37.useState(null);
|
|
13309
|
+
const [focusedId, setFocusedId] = React37.useState(null);
|
|
13310
|
+
const [activeId, setActiveId] = React37.useState(null);
|
|
13311
|
+
const updateActiveItem = React37.useCallback(() => {
|
|
13312
|
+
const viewport = viewportRef.current;
|
|
13313
|
+
setActiveId(resolveActiveItemId(items, viewport, getAnchor));
|
|
13314
|
+
}, [getAnchor, items, viewportRef]);
|
|
13315
|
+
React37.useLayoutEffect(() => {
|
|
13316
|
+
updateActiveItem();
|
|
13317
|
+
}, [updateActiveItem]);
|
|
13318
|
+
React37.useEffect(() => {
|
|
13319
|
+
const viewport = viewportRef.current;
|
|
13320
|
+
if (!viewport) return;
|
|
13321
|
+
let frame = null;
|
|
13322
|
+
const scheduleUpdate = () => {
|
|
13323
|
+
if (frame !== null) return;
|
|
13324
|
+
frame = requestAnimationFrame(() => {
|
|
13325
|
+
frame = null;
|
|
13326
|
+
updateActiveItem();
|
|
13327
|
+
});
|
|
13328
|
+
};
|
|
13329
|
+
viewport.addEventListener("scroll", scheduleUpdate, { passive: true });
|
|
13330
|
+
window.addEventListener("resize", scheduleUpdate, { passive: true });
|
|
13331
|
+
const resizeObserver = typeof ResizeObserver !== "undefined" ? new ResizeObserver(scheduleUpdate) : null;
|
|
13332
|
+
resizeObserver?.observe(viewport);
|
|
13333
|
+
return () => {
|
|
13334
|
+
if (frame !== null) {
|
|
13335
|
+
cancelAnimationFrame(frame);
|
|
13336
|
+
}
|
|
13337
|
+
viewport.removeEventListener("scroll", scheduleUpdate);
|
|
13338
|
+
window.removeEventListener("resize", scheduleUpdate);
|
|
13339
|
+
resizeObserver?.disconnect();
|
|
13340
|
+
};
|
|
13341
|
+
}, [updateActiveItem, viewportRef]);
|
|
13342
|
+
const handleNavigate = React37.useCallback(
|
|
13343
|
+
(item) => {
|
|
13344
|
+
const viewport = viewportRef.current;
|
|
13345
|
+
const anchor = getAnchor(item);
|
|
13346
|
+
if (!viewport || !anchor) return;
|
|
13347
|
+
onNavigate?.();
|
|
13348
|
+
scrollToAnchor(viewport, anchor);
|
|
13349
|
+
setActiveId(item.id);
|
|
13350
|
+
},
|
|
13351
|
+
[getAnchor, onNavigate, viewportRef]
|
|
13352
|
+
);
|
|
13353
|
+
if (items.length === 0) return null;
|
|
13354
|
+
const interactionId = focusedId ?? hoveredId;
|
|
13355
|
+
const interactionIndex = interactionId ? items.findIndex((item) => item.id === interactionId) : -1;
|
|
13356
|
+
return /* @__PURE__ */ jsx43(
|
|
13357
|
+
"nav",
|
|
13358
|
+
{
|
|
13359
|
+
"aria-label": label,
|
|
13360
|
+
className: cn(
|
|
13361
|
+
"pointer-events-none sticky top-16 z-20 hidden h-0 w-0 shrink-0 self-start md:block",
|
|
13362
|
+
className
|
|
13363
|
+
),
|
|
13364
|
+
"data-slot": "chatkit-message-navigator",
|
|
13365
|
+
children: /* @__PURE__ */ jsx43("div", { className: "group/nav relative h-[calc(100vh-9rem)] w-12", children: /* @__PURE__ */ jsx43("div", { className: "absolute left-2 top-1/2 flex max-h-full w-10 -translate-y-1/2 flex-col gap-0.5 py-1", children: items.map((item, index) => {
|
|
13366
|
+
const isActive = item.id === activeId;
|
|
13367
|
+
const isPreviewed = item.id === hoveredId || item.id === focusedId;
|
|
13368
|
+
return /* @__PURE__ */ jsxs30("div", { className: "relative h-3.5 w-10 shrink-0", children: [
|
|
13369
|
+
/* @__PURE__ */ jsx43(
|
|
13370
|
+
"button",
|
|
13371
|
+
{
|
|
13372
|
+
type: "button",
|
|
13373
|
+
"aria-label": `${item.title}: ${item.preview}`,
|
|
13374
|
+
"aria-current": isActive ? "location" : void 0,
|
|
13375
|
+
className: cn(
|
|
13376
|
+
"pointer-events-auto flex h-3.5 w-10 items-center justify-start rounded-sm outline-none",
|
|
13377
|
+
"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"
|
|
13378
|
+
),
|
|
13379
|
+
onClick: () => handleNavigate(item),
|
|
13380
|
+
onMouseEnter: () => setHoveredId(item.id),
|
|
13381
|
+
onMouseLeave: () => setHoveredId((id) => id === item.id ? null : id),
|
|
13382
|
+
onFocus: () => setFocusedId(item.id),
|
|
13383
|
+
onBlur: () => setFocusedId((id) => id === item.id ? null : id),
|
|
13384
|
+
children: /* @__PURE__ */ jsx43(
|
|
13385
|
+
"span",
|
|
13386
|
+
{
|
|
13387
|
+
className: cn(
|
|
13388
|
+
"block h-0.5 rounded-full bg-muted-foreground/25 transition-all duration-150",
|
|
13389
|
+
getMarkerWidthClass(index, isActive, interactionIndex),
|
|
13390
|
+
isActive && "bg-foreground",
|
|
13391
|
+
isPreviewed && "bg-foreground",
|
|
13392
|
+
interactionIndex >= 0 && !isActive && !isPreviewed && "bg-muted-foreground/35"
|
|
13393
|
+
)
|
|
13394
|
+
}
|
|
13395
|
+
)
|
|
13396
|
+
}
|
|
13397
|
+
),
|
|
13398
|
+
isPreviewed && /* @__PURE__ */ jsxs30(
|
|
13399
|
+
"div",
|
|
13400
|
+
{
|
|
13401
|
+
className: cn(
|
|
13402
|
+
"pointer-events-none absolute left-9 top-1/2 z-30 w-80 max-w-[min(20rem,calc(100vw-6rem))] -translate-y-1/2",
|
|
13403
|
+
"rounded-lg border border-border bg-background/95 p-3 text-left shadow-xl backdrop-blur"
|
|
13404
|
+
),
|
|
13405
|
+
children: [
|
|
13406
|
+
/* @__PURE__ */ jsx43("div", { className: "mb-1 truncate text-sm font-medium text-foreground", children: item.title }),
|
|
13407
|
+
/* @__PURE__ */ jsx43("div", { className: "line-clamp-2 text-sm leading-5 text-muted-foreground", children: item.preview }),
|
|
13408
|
+
item.tags.length > 0 && /* @__PURE__ */ jsxs30("div", { className: "mt-2 flex flex-wrap gap-1.5", children: [
|
|
13409
|
+
item.tags.slice(0, 3).map((tag) => /* @__PURE__ */ jsx43(
|
|
13410
|
+
"span",
|
|
13411
|
+
{
|
|
13412
|
+
className: "max-w-[8rem] truncate rounded-md bg-muted px-1.5 py-0.5 text-[11px] leading-4 text-muted-foreground",
|
|
13413
|
+
children: tag
|
|
13414
|
+
},
|
|
13415
|
+
tag
|
|
13416
|
+
)),
|
|
13417
|
+
item.tags.length > 3 && /* @__PURE__ */ jsx43("span", { className: "rounded-md bg-muted px-1.5 py-0.5 text-[11px] leading-4 text-muted-foreground", children: tagsOverflowLabel(item.tags.length - 3) })
|
|
13418
|
+
] })
|
|
13419
|
+
]
|
|
13420
|
+
}
|
|
13421
|
+
)
|
|
13422
|
+
] }, item.id);
|
|
13423
|
+
}) }) })
|
|
13424
|
+
}
|
|
13425
|
+
);
|
|
13426
|
+
}
|
|
13427
|
+
|
|
13428
|
+
// src/components/thread/MessageActions.tsx
|
|
13429
|
+
import * as React38 from "react";
|
|
13430
|
+
import { Check as Check5, Copy as Copy3, RefreshCw as RefreshCw2 } from "lucide-react";
|
|
13431
|
+
import { jsx as jsx44, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
13175
13432
|
function MessageActions({
|
|
13176
13433
|
content,
|
|
13177
13434
|
isAssistant = false,
|
|
@@ -13180,7 +13437,7 @@ function MessageActions({
|
|
|
13180
13437
|
className
|
|
13181
13438
|
}) {
|
|
13182
13439
|
const { t } = useChatkitTranslation();
|
|
13183
|
-
const [copied, setCopied] =
|
|
13440
|
+
const [copied, setCopied] = React38.useState(false);
|
|
13184
13441
|
const handleCopy = async () => {
|
|
13185
13442
|
try {
|
|
13186
13443
|
await navigator.clipboard.writeText(content);
|
|
@@ -13193,7 +13450,7 @@ function MessageActions({
|
|
|
13193
13450
|
if (isStreaming) {
|
|
13194
13451
|
return null;
|
|
13195
13452
|
}
|
|
13196
|
-
return /* @__PURE__ */
|
|
13453
|
+
return /* @__PURE__ */ jsxs31(
|
|
13197
13454
|
"div",
|
|
13198
13455
|
{
|
|
13199
13456
|
className: cn(
|
|
@@ -13201,7 +13458,7 @@ function MessageActions({
|
|
|
13201
13458
|
className
|
|
13202
13459
|
),
|
|
13203
13460
|
children: [
|
|
13204
|
-
/* @__PURE__ */
|
|
13461
|
+
/* @__PURE__ */ jsx44(
|
|
13205
13462
|
"button",
|
|
13206
13463
|
{
|
|
13207
13464
|
type: "button",
|
|
@@ -13211,17 +13468,17 @@ function MessageActions({
|
|
|
13211
13468
|
copied && "text-green-500"
|
|
13212
13469
|
),
|
|
13213
13470
|
title: copied ? t("messageActions.copied") : t("messageActions.copy"),
|
|
13214
|
-
children: copied ? /* @__PURE__ */
|
|
13471
|
+
children: copied ? /* @__PURE__ */ jsx44(Check5, { size: 14 }) : /* @__PURE__ */ jsx44(Copy3, { size: 14 })
|
|
13215
13472
|
}
|
|
13216
13473
|
),
|
|
13217
|
-
isAssistant && onRetry && /* @__PURE__ */
|
|
13474
|
+
isAssistant && onRetry && /* @__PURE__ */ jsx44(
|
|
13218
13475
|
"button",
|
|
13219
13476
|
{
|
|
13220
13477
|
type: "button",
|
|
13221
13478
|
onClick: onRetry,
|
|
13222
13479
|
className: "p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",
|
|
13223
13480
|
title: t("messageActions.regenerate"),
|
|
13224
|
-
children: /* @__PURE__ */
|
|
13481
|
+
children: /* @__PURE__ */ jsx44(RefreshCw2, { size: 14 })
|
|
13225
13482
|
}
|
|
13226
13483
|
)
|
|
13227
13484
|
]
|
|
@@ -13242,18 +13499,18 @@ import {
|
|
|
13242
13499
|
Sparkles as Sparkles3,
|
|
13243
13500
|
Zap
|
|
13244
13501
|
} from "lucide-react";
|
|
13245
|
-
import { jsx as
|
|
13502
|
+
import { jsx as jsx45, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
13246
13503
|
function getIconComponent2(icon) {
|
|
13247
13504
|
const iconMap = {
|
|
13248
|
-
"circle-question": /* @__PURE__ */
|
|
13249
|
-
"lightbulb": /* @__PURE__ */
|
|
13250
|
-
"sparkle": /* @__PURE__ */
|
|
13251
|
-
"write": /* @__PURE__ */
|
|
13252
|
-
"search": /* @__PURE__ */
|
|
13253
|
-
"globe": /* @__PURE__ */
|
|
13254
|
-
"book-open": /* @__PURE__ */
|
|
13255
|
-
"compass": /* @__PURE__ */
|
|
13256
|
-
"bolt": /* @__PURE__ */
|
|
13505
|
+
"circle-question": /* @__PURE__ */ jsx45(HelpCircle, { size: 20 }),
|
|
13506
|
+
"lightbulb": /* @__PURE__ */ jsx45(Lightbulb2, { size: 20 }),
|
|
13507
|
+
"sparkle": /* @__PURE__ */ jsx45(Sparkles3, { size: 20 }),
|
|
13508
|
+
"write": /* @__PURE__ */ jsx45(Pencil3, { size: 20 }),
|
|
13509
|
+
"search": /* @__PURE__ */ jsx45(Search3, { size: 20 }),
|
|
13510
|
+
"globe": /* @__PURE__ */ jsx45(Globe2, { size: 20 }),
|
|
13511
|
+
"book-open": /* @__PURE__ */ jsx45(BookOpen2, { size: 20 }),
|
|
13512
|
+
"compass": /* @__PURE__ */ jsx45(Compass, { size: 20 }),
|
|
13513
|
+
"bolt": /* @__PURE__ */ jsx45(Zap, { size: 20 })
|
|
13257
13514
|
};
|
|
13258
13515
|
return icon ? iconMap[icon] || iconMap["sparkle"] : iconMap["sparkle"];
|
|
13259
13516
|
}
|
|
@@ -13269,7 +13526,7 @@ function StartScreen({
|
|
|
13269
13526
|
const greeting = startScreen?.greeting ?? t("startScreen.greeting");
|
|
13270
13527
|
const prompts = startScreen?.prompts ?? [];
|
|
13271
13528
|
const editPromptLabel = t("startScreen.editPrompt");
|
|
13272
|
-
return /* @__PURE__ */
|
|
13529
|
+
return /* @__PURE__ */ jsxs32(
|
|
13273
13530
|
"div",
|
|
13274
13531
|
{
|
|
13275
13532
|
className: cn(
|
|
@@ -13277,8 +13534,8 @@ function StartScreen({
|
|
|
13277
13534
|
className
|
|
13278
13535
|
),
|
|
13279
13536
|
children: [
|
|
13280
|
-
/* @__PURE__ */
|
|
13281
|
-
prompts.length > 0 && /* @__PURE__ */
|
|
13537
|
+
/* @__PURE__ */ jsx45("div", { className: "mb-8 text-center", children: /* @__PURE__ */ jsx45("h2", { className: "text-2xl font-semibold text-foreground mb-2", children: greeting }) }),
|
|
13538
|
+
prompts.length > 0 && /* @__PURE__ */ jsx45("div", { className: "w-full max-w-2xl", children: /* @__PURE__ */ jsx45("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: prompts.map((item, index) => /* @__PURE__ */ jsxs32(
|
|
13282
13539
|
"div",
|
|
13283
13540
|
{
|
|
13284
13541
|
className: cn(
|
|
@@ -13287,7 +13544,7 @@ function StartScreen({
|
|
|
13287
13544
|
"focus-within:ring-2 focus-within:ring-primary/20"
|
|
13288
13545
|
),
|
|
13289
13546
|
children: [
|
|
13290
|
-
/* @__PURE__ */
|
|
13547
|
+
/* @__PURE__ */ jsxs32(
|
|
13291
13548
|
"button",
|
|
13292
13549
|
{
|
|
13293
13550
|
type: "button",
|
|
@@ -13298,12 +13555,12 @@ function StartScreen({
|
|
|
13298
13555
|
"focus:outline-none disabled:cursor-not-allowed disabled:opacity-50"
|
|
13299
13556
|
),
|
|
13300
13557
|
children: [
|
|
13301
|
-
/* @__PURE__ */
|
|
13302
|
-
/* @__PURE__ */
|
|
13558
|
+
/* @__PURE__ */ jsx45("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary", children: getIconComponent2(item.icon) }),
|
|
13559
|
+
/* @__PURE__ */ jsx45("span", { className: "text-sm font-medium text-foreground", children: item.label })
|
|
13303
13560
|
]
|
|
13304
13561
|
}
|
|
13305
13562
|
),
|
|
13306
|
-
/* @__PURE__ */
|
|
13563
|
+
/* @__PURE__ */ jsx45(
|
|
13307
13564
|
"button",
|
|
13308
13565
|
{
|
|
13309
13566
|
type: "button",
|
|
@@ -13316,7 +13573,7 @@ function StartScreen({
|
|
|
13316
13573
|
"rounded-r-xl transition-colors hover:bg-muted hover:text-foreground",
|
|
13317
13574
|
"focus:outline-none disabled:cursor-not-allowed disabled:opacity-50"
|
|
13318
13575
|
),
|
|
13319
|
-
children: /* @__PURE__ */
|
|
13576
|
+
children: /* @__PURE__ */ jsx45(Pencil3, { size: 16 })
|
|
13320
13577
|
}
|
|
13321
13578
|
)
|
|
13322
13579
|
]
|
|
@@ -13329,7 +13586,7 @@ function StartScreen({
|
|
|
13329
13586
|
}
|
|
13330
13587
|
|
|
13331
13588
|
// src/hooks/useThreads.ts
|
|
13332
|
-
import * as
|
|
13589
|
+
import * as React40 from "react";
|
|
13333
13590
|
var DEFAULT_LIMIT = 50;
|
|
13334
13591
|
var getThreadTitle = (threadRecord) => {
|
|
13335
13592
|
const title = threadRecord.title?.trim();
|
|
@@ -13382,16 +13639,16 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
13382
13639
|
isLoading: isStreamLoading,
|
|
13383
13640
|
error: streamError
|
|
13384
13641
|
} = useStreamContext();
|
|
13385
|
-
const [threadRecords, setThreadRecords] =
|
|
13386
|
-
const [isLoading, setIsLoading] =
|
|
13387
|
-
const [error, setError] =
|
|
13388
|
-
const upsertThreadRecord =
|
|
13642
|
+
const [threadRecords, setThreadRecords] = React40.useState([]);
|
|
13643
|
+
const [isLoading, setIsLoading] = React40.useState(false);
|
|
13644
|
+
const [error, setError] = React40.useState(null);
|
|
13645
|
+
const upsertThreadRecord = React40.useCallback((threadRecord) => {
|
|
13389
13646
|
setThreadRecords((prev) => {
|
|
13390
13647
|
const next = prev.filter((item) => item.id !== threadRecord.id);
|
|
13391
13648
|
return sortThreadRecords([threadRecord, ...next]);
|
|
13392
13649
|
});
|
|
13393
13650
|
}, []);
|
|
13394
|
-
const refreshThreads =
|
|
13651
|
+
const refreshThreads = React40.useCallback(async () => {
|
|
13395
13652
|
setIsLoading(true);
|
|
13396
13653
|
setError(null);
|
|
13397
13654
|
try {
|
|
@@ -13407,7 +13664,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
13407
13664
|
setIsLoading(false);
|
|
13408
13665
|
}
|
|
13409
13666
|
}, [client, limit, assistantId]);
|
|
13410
|
-
const createThread =
|
|
13667
|
+
const createThread = React40.useCallback(
|
|
13411
13668
|
async (input) => {
|
|
13412
13669
|
setError(null);
|
|
13413
13670
|
const payload = {};
|
|
@@ -13421,7 +13678,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
13421
13678
|
},
|
|
13422
13679
|
[client, upsertThreadRecord]
|
|
13423
13680
|
);
|
|
13424
|
-
const updateThread =
|
|
13681
|
+
const updateThread = React40.useCallback(
|
|
13425
13682
|
async (recordId, payload) => {
|
|
13426
13683
|
setError(null);
|
|
13427
13684
|
const updated = await client.conversations.update(recordId, payload);
|
|
@@ -13430,7 +13687,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
13430
13687
|
},
|
|
13431
13688
|
[client, upsertThreadRecord]
|
|
13432
13689
|
);
|
|
13433
|
-
const deleteThread =
|
|
13690
|
+
const deleteThread = React40.useCallback(
|
|
13434
13691
|
async (recordId) => {
|
|
13435
13692
|
setError(null);
|
|
13436
13693
|
await client.conversations.delete(recordId);
|
|
@@ -13438,11 +13695,11 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
13438
13695
|
},
|
|
13439
13696
|
[client]
|
|
13440
13697
|
);
|
|
13441
|
-
|
|
13698
|
+
React40.useEffect(() => {
|
|
13442
13699
|
if (!isReady) return;
|
|
13443
13700
|
void refreshThreads();
|
|
13444
13701
|
}, [refreshThreads, isReady]);
|
|
13445
|
-
|
|
13702
|
+
React40.useEffect(() => {
|
|
13446
13703
|
if (!threadId || !isStreamLoading) return;
|
|
13447
13704
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
13448
13705
|
const busyStatus = "busy";
|
|
@@ -13463,7 +13720,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
13463
13720
|
return changed ? sortThreadRecords(next) : prev;
|
|
13464
13721
|
});
|
|
13465
13722
|
}, [threadId, isStreamLoading]);
|
|
13466
|
-
|
|
13723
|
+
React40.useEffect(() => {
|
|
13467
13724
|
const message = getErrorMessage2(streamError)?.trim();
|
|
13468
13725
|
if (!threadId || !message) return;
|
|
13469
13726
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -13485,7 +13742,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
13485
13742
|
return changed ? sortThreadRecords(next) : prev;
|
|
13486
13743
|
});
|
|
13487
13744
|
}, [threadId, streamError]);
|
|
13488
|
-
|
|
13745
|
+
React40.useEffect(() => {
|
|
13489
13746
|
if (!isReady || !threadId || isStreamLoading) return;
|
|
13490
13747
|
let cancelled = false;
|
|
13491
13748
|
void client.conversations.search({ where: { threadId }, limit: 1 }).then((result) => {
|
|
@@ -13499,7 +13756,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
13499
13756
|
cancelled = true;
|
|
13500
13757
|
};
|
|
13501
13758
|
}, [client, threadId, upsertThreadRecord, isReady, isStreamLoading]);
|
|
13502
|
-
const threads =
|
|
13759
|
+
const threads = React40.useMemo(
|
|
13503
13760
|
() => threadRecords.map((threadRecord) => toThreadItem(threadRecord)),
|
|
13504
13761
|
[threadRecords]
|
|
13505
13762
|
);
|
|
@@ -13516,10 +13773,10 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
13516
13773
|
}
|
|
13517
13774
|
|
|
13518
13775
|
// src/components/thread/context-usage-indicator.tsx
|
|
13519
|
-
import * as
|
|
13776
|
+
import * as React41 from "react";
|
|
13520
13777
|
|
|
13521
13778
|
// src/components/ui/progress-circle.tsx
|
|
13522
|
-
import { jsx as
|
|
13779
|
+
import { jsx as jsx46, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
13523
13780
|
function clamp2(input, a, b) {
|
|
13524
13781
|
return Math.max(Math.min(input, Math.max(a, b)), Math.min(a, b));
|
|
13525
13782
|
}
|
|
@@ -13542,7 +13799,7 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
|
|
|
13542
13799
|
return (
|
|
13543
13800
|
// biome-ignore lint/a11y/useFocusableInteractive: false positive (progress + progressbar are not focusable interactives)
|
|
13544
13801
|
// biome-ignore lint/nursery/useAriaPropsSupportedByRole: biome rule at odds with mdn docs (presumed nursary bug with rule)
|
|
13545
|
-
/* @__PURE__ */
|
|
13802
|
+
/* @__PURE__ */ jsxs33(
|
|
13546
13803
|
"svg",
|
|
13547
13804
|
{
|
|
13548
13805
|
role: "progressbar",
|
|
@@ -13553,8 +13810,8 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
|
|
|
13553
13810
|
"aria-valuemax": 100,
|
|
13554
13811
|
...restSvgProps,
|
|
13555
13812
|
children: [
|
|
13556
|
-
/* @__PURE__ */
|
|
13557
|
-
/* @__PURE__ */
|
|
13813
|
+
/* @__PURE__ */ jsx46("circle", { ...commonParams, className: "stroke-current/25" }),
|
|
13814
|
+
/* @__PURE__ */ jsx46(
|
|
13558
13815
|
"circle",
|
|
13559
13816
|
{
|
|
13560
13817
|
...commonParams,
|
|
@@ -13573,7 +13830,7 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
|
|
|
13573
13830
|
};
|
|
13574
13831
|
|
|
13575
13832
|
// src/components/thread/context-usage-indicator.tsx
|
|
13576
|
-
import { jsx as
|
|
13833
|
+
import { jsx as jsx47, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
13577
13834
|
var kNumberFormatter = new Intl.NumberFormat("en-US", {
|
|
13578
13835
|
minimumFractionDigits: 0,
|
|
13579
13836
|
maximumFractionDigits: 1
|
|
@@ -13606,21 +13863,21 @@ function ContextUsageIndicator({
|
|
|
13606
13863
|
}) {
|
|
13607
13864
|
const { t } = useChatkitTranslation();
|
|
13608
13865
|
const stream = useStreamContext();
|
|
13609
|
-
const [maxContextSize, setMaxContextSize] =
|
|
13610
|
-
const [usedContextSize, setUsedContextSize] =
|
|
13611
|
-
const [assistantAgentKey, setAssistantAgentKey] =
|
|
13612
|
-
const latestRealtimeUsageRef =
|
|
13866
|
+
const [maxContextSize, setMaxContextSize] = React41.useState(null);
|
|
13867
|
+
const [usedContextSize, setUsedContextSize] = React41.useState(null);
|
|
13868
|
+
const [assistantAgentKey, setAssistantAgentKey] = React41.useState(null);
|
|
13869
|
+
const latestRealtimeUsageRef = React41.useRef({
|
|
13613
13870
|
threadId: null,
|
|
13614
13871
|
agentKey: null,
|
|
13615
13872
|
usedTokens: null
|
|
13616
13873
|
});
|
|
13617
|
-
const realtimeUsage =
|
|
13874
|
+
const realtimeUsage = React41.useMemo(
|
|
13618
13875
|
() => getThreadContextUsage(stream.contextUsageByAgentKey, assistantAgentKey),
|
|
13619
13876
|
[assistantAgentKey, stream.contextUsageByAgentKey]
|
|
13620
13877
|
);
|
|
13621
13878
|
const realtimeUsedContextSize = getThreadContextUsageTotalTokens(realtimeUsage);
|
|
13622
13879
|
const hasApiConfiguration = Boolean(stream.apiUrl?.trim() && stream.apiKey?.trim());
|
|
13623
|
-
|
|
13880
|
+
React41.useEffect(() => {
|
|
13624
13881
|
if (!hasApiConfiguration || !stream.client || !stream.assistantId) {
|
|
13625
13882
|
setMaxContextSize(null);
|
|
13626
13883
|
setAssistantAgentKey(null);
|
|
@@ -13640,18 +13897,18 @@ function ContextUsageIndicator({
|
|
|
13640
13897
|
cancelled = true;
|
|
13641
13898
|
};
|
|
13642
13899
|
}, [hasApiConfiguration, stream.client, stream.assistantId]);
|
|
13643
|
-
|
|
13900
|
+
React41.useEffect(() => {
|
|
13644
13901
|
latestRealtimeUsageRef.current = {
|
|
13645
13902
|
threadId: stream.threadId ?? null,
|
|
13646
13903
|
agentKey: assistantAgentKey,
|
|
13647
13904
|
usedTokens: realtimeUsedContextSize
|
|
13648
13905
|
};
|
|
13649
13906
|
}, [assistantAgentKey, realtimeUsedContextSize, stream.threadId]);
|
|
13650
|
-
|
|
13907
|
+
React41.useEffect(() => {
|
|
13651
13908
|
if (realtimeUsedContextSize == null) return;
|
|
13652
13909
|
setUsedContextSize(realtimeUsedContextSize);
|
|
13653
13910
|
}, [realtimeUsedContextSize]);
|
|
13654
|
-
|
|
13911
|
+
React41.useEffect(() => {
|
|
13655
13912
|
if (!hasApiConfiguration || !stream.client) {
|
|
13656
13913
|
setUsedContextSize(null);
|
|
13657
13914
|
return;
|
|
@@ -13717,8 +13974,8 @@ function ContextUsageIndicator({
|
|
|
13717
13974
|
});
|
|
13718
13975
|
const usageLabelWithSuffix = usageLabel.endsWith(":") ? usageLabel : `${usageLabel}:`;
|
|
13719
13976
|
const progressClassName = percent >= 90 ? "text-destructive" : percent >= 75 ? "text-amber-500" : "text-primary dark:text-zinc-300";
|
|
13720
|
-
return /* @__PURE__ */
|
|
13721
|
-
/* @__PURE__ */
|
|
13977
|
+
return /* @__PURE__ */ jsxs34(Tooltip, { children: [
|
|
13978
|
+
/* @__PURE__ */ jsx47(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx47(
|
|
13722
13979
|
"button",
|
|
13723
13980
|
{
|
|
13724
13981
|
type: "button",
|
|
@@ -13727,31 +13984,31 @@ function ContextUsageIndicator({
|
|
|
13727
13984
|
className
|
|
13728
13985
|
),
|
|
13729
13986
|
"aria-label": `${usageLabelWithSuffix} ${usageFullLabel}. ${usageTokensLabel}`,
|
|
13730
|
-
children: /* @__PURE__ */
|
|
13987
|
+
children: /* @__PURE__ */ jsx47(ProgressCircle, { value: percent, className: cn("size-3.5", progressClassName) })
|
|
13731
13988
|
}
|
|
13732
13989
|
) }),
|
|
13733
|
-
/* @__PURE__ */
|
|
13734
|
-
/* @__PURE__ */
|
|
13735
|
-
/* @__PURE__ */
|
|
13736
|
-
/* @__PURE__ */
|
|
13990
|
+
/* @__PURE__ */ jsxs34(TooltipContent, { side: "top", sideOffset: 6, className: "space-y-0.5 px-3 py-2 text-center", children: [
|
|
13991
|
+
/* @__PURE__ */ jsx47("div", { className: "text-primary-foreground/70", children: usageLabelWithSuffix }),
|
|
13992
|
+
/* @__PURE__ */ jsx47("div", { className: "font-medium text-primary-foreground/80", children: usageFullLabel }),
|
|
13993
|
+
/* @__PURE__ */ jsx47("div", { className: "text-sm font-semibold", children: usageTokensLabel })
|
|
13737
13994
|
] })
|
|
13738
13995
|
] });
|
|
13739
13996
|
}
|
|
13740
13997
|
|
|
13741
13998
|
// src/components/pet/PetBridge.tsx
|
|
13742
|
-
import * as
|
|
13999
|
+
import * as React42 from "react";
|
|
13743
14000
|
import { normalizePetOptions } from "@xpert-ai/chatkit-types";
|
|
13744
14001
|
function PetBridge({ pet, state }) {
|
|
13745
14002
|
const parentMessenger = useParentMessenger();
|
|
13746
14003
|
const sendEvent = parentMessenger?.sendEvent;
|
|
13747
|
-
const options =
|
|
13748
|
-
|
|
14004
|
+
const options = React42.useMemo(() => normalizePetOptions(pet), [pet]);
|
|
14005
|
+
React42.useEffect(() => {
|
|
13749
14006
|
if (!sendEvent) {
|
|
13750
14007
|
return;
|
|
13751
14008
|
}
|
|
13752
14009
|
sendEvent("pet_options_change", { pet: pet ?? null });
|
|
13753
14010
|
}, [sendEvent, pet]);
|
|
13754
|
-
|
|
14011
|
+
React42.useEffect(() => {
|
|
13755
14012
|
if (!sendEvent || !options) {
|
|
13756
14013
|
return;
|
|
13757
14014
|
}
|
|
@@ -13761,15 +14018,15 @@ function PetBridge({ pet, state }) {
|
|
|
13761
14018
|
}
|
|
13762
14019
|
|
|
13763
14020
|
// src/components/settings/SettingsSheet.tsx
|
|
13764
|
-
import * as
|
|
14021
|
+
import * as React49 from "react";
|
|
13765
14022
|
import { PawPrint, Settings } from "lucide-react";
|
|
13766
14023
|
|
|
13767
14024
|
// src/components/ui/input.tsx
|
|
13768
|
-
import * as
|
|
13769
|
-
import { jsx as
|
|
13770
|
-
var Input =
|
|
14025
|
+
import * as React43 from "react";
|
|
14026
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
14027
|
+
var Input = React43.forwardRef(
|
|
13771
14028
|
({ className, type, ...props }, ref) => {
|
|
13772
|
-
return /* @__PURE__ */
|
|
14029
|
+
return /* @__PURE__ */ jsx48(
|
|
13773
14030
|
"input",
|
|
13774
14031
|
{
|
|
13775
14032
|
ref,
|
|
@@ -13789,17 +14046,17 @@ Input.displayName = "Input";
|
|
|
13789
14046
|
import "react";
|
|
13790
14047
|
import { Select as SelectPrimitive } from "radix-ui";
|
|
13791
14048
|
import { ChevronDownIcon as ChevronDownIcon2, CheckIcon as CheckIcon4, ChevronUpIcon } from "lucide-react";
|
|
13792
|
-
import { jsx as
|
|
14049
|
+
import { jsx as jsx49, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
13793
14050
|
function Select({
|
|
13794
14051
|
...props
|
|
13795
14052
|
}) {
|
|
13796
|
-
return /* @__PURE__ */
|
|
14053
|
+
return /* @__PURE__ */ jsx49(SelectPrimitive.Root, { "data-slot": "select", ...props });
|
|
13797
14054
|
}
|
|
13798
14055
|
function SelectGroup({
|
|
13799
14056
|
className,
|
|
13800
14057
|
...props
|
|
13801
14058
|
}) {
|
|
13802
|
-
return /* @__PURE__ */
|
|
14059
|
+
return /* @__PURE__ */ jsx49(
|
|
13803
14060
|
SelectPrimitive.Group,
|
|
13804
14061
|
{
|
|
13805
14062
|
"data-slot": "select-group",
|
|
@@ -13811,7 +14068,7 @@ function SelectGroup({
|
|
|
13811
14068
|
function SelectValue({
|
|
13812
14069
|
...props
|
|
13813
14070
|
}) {
|
|
13814
|
-
return /* @__PURE__ */
|
|
14071
|
+
return /* @__PURE__ */ jsx49(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
|
|
13815
14072
|
}
|
|
13816
14073
|
function SelectTrigger({
|
|
13817
14074
|
className,
|
|
@@ -13819,7 +14076,7 @@ function SelectTrigger({
|
|
|
13819
14076
|
children,
|
|
13820
14077
|
...props
|
|
13821
14078
|
}) {
|
|
13822
|
-
return /* @__PURE__ */
|
|
14079
|
+
return /* @__PURE__ */ jsxs35(
|
|
13823
14080
|
SelectPrimitive.Trigger,
|
|
13824
14081
|
{
|
|
13825
14082
|
"data-slot": "select-trigger",
|
|
@@ -13831,7 +14088,7 @@ function SelectTrigger({
|
|
|
13831
14088
|
...props,
|
|
13832
14089
|
children: [
|
|
13833
14090
|
children,
|
|
13834
|
-
/* @__PURE__ */
|
|
14091
|
+
/* @__PURE__ */ jsx49(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx49(ChevronDownIcon2, { className: "pointer-events-none size-4 text-muted-foreground" }) })
|
|
13835
14092
|
]
|
|
13836
14093
|
}
|
|
13837
14094
|
);
|
|
@@ -13843,7 +14100,7 @@ function SelectContent({
|
|
|
13843
14100
|
align = "center",
|
|
13844
14101
|
...props
|
|
13845
14102
|
}) {
|
|
13846
|
-
return /* @__PURE__ */
|
|
14103
|
+
return /* @__PURE__ */ jsx49(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs35(
|
|
13847
14104
|
SelectPrimitive.Content,
|
|
13848
14105
|
{
|
|
13849
14106
|
"data-slot": "select-content",
|
|
@@ -13853,8 +14110,8 @@ function SelectContent({
|
|
|
13853
14110
|
align,
|
|
13854
14111
|
...props,
|
|
13855
14112
|
children: [
|
|
13856
|
-
/* @__PURE__ */
|
|
13857
|
-
/* @__PURE__ */
|
|
14113
|
+
/* @__PURE__ */ jsx49(SelectScrollUpButton, {}),
|
|
14114
|
+
/* @__PURE__ */ jsx49(
|
|
13858
14115
|
SelectPrimitive.Viewport,
|
|
13859
14116
|
{
|
|
13860
14117
|
"data-position": position,
|
|
@@ -13865,7 +14122,7 @@ function SelectContent({
|
|
|
13865
14122
|
children
|
|
13866
14123
|
}
|
|
13867
14124
|
),
|
|
13868
|
-
/* @__PURE__ */
|
|
14125
|
+
/* @__PURE__ */ jsx49(SelectScrollDownButton, {})
|
|
13869
14126
|
]
|
|
13870
14127
|
}
|
|
13871
14128
|
) });
|
|
@@ -13875,7 +14132,7 @@ function SelectItem({
|
|
|
13875
14132
|
children,
|
|
13876
14133
|
...props
|
|
13877
14134
|
}) {
|
|
13878
|
-
return /* @__PURE__ */
|
|
14135
|
+
return /* @__PURE__ */ jsxs35(
|
|
13879
14136
|
SelectPrimitive.Item,
|
|
13880
14137
|
{
|
|
13881
14138
|
"data-slot": "select-item",
|
|
@@ -13885,8 +14142,8 @@ function SelectItem({
|
|
|
13885
14142
|
),
|
|
13886
14143
|
...props,
|
|
13887
14144
|
children: [
|
|
13888
|
-
/* @__PURE__ */
|
|
13889
|
-
/* @__PURE__ */
|
|
14145
|
+
/* @__PURE__ */ jsx49("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ jsx49(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx49(CheckIcon4, { className: "pointer-events-none" }) }) }),
|
|
14146
|
+
/* @__PURE__ */ jsx49(SelectPrimitive.ItemText, { children })
|
|
13890
14147
|
]
|
|
13891
14148
|
}
|
|
13892
14149
|
);
|
|
@@ -13895,7 +14152,7 @@ function SelectScrollUpButton({
|
|
|
13895
14152
|
className,
|
|
13896
14153
|
...props
|
|
13897
14154
|
}) {
|
|
13898
|
-
return /* @__PURE__ */
|
|
14155
|
+
return /* @__PURE__ */ jsx49(
|
|
13899
14156
|
SelectPrimitive.ScrollUpButton,
|
|
13900
14157
|
{
|
|
13901
14158
|
"data-slot": "select-scroll-up-button",
|
|
@@ -13904,7 +14161,7 @@ function SelectScrollUpButton({
|
|
|
13904
14161
|
className
|
|
13905
14162
|
),
|
|
13906
14163
|
...props,
|
|
13907
|
-
children: /* @__PURE__ */
|
|
14164
|
+
children: /* @__PURE__ */ jsx49(
|
|
13908
14165
|
ChevronUpIcon,
|
|
13909
14166
|
{}
|
|
13910
14167
|
)
|
|
@@ -13915,7 +14172,7 @@ function SelectScrollDownButton({
|
|
|
13915
14172
|
className,
|
|
13916
14173
|
...props
|
|
13917
14174
|
}) {
|
|
13918
|
-
return /* @__PURE__ */
|
|
14175
|
+
return /* @__PURE__ */ jsx49(
|
|
13919
14176
|
SelectPrimitive.ScrollDownButton,
|
|
13920
14177
|
{
|
|
13921
14178
|
"data-slot": "select-scroll-down-button",
|
|
@@ -13924,7 +14181,7 @@ function SelectScrollDownButton({
|
|
|
13924
14181
|
className
|
|
13925
14182
|
),
|
|
13926
14183
|
...props,
|
|
13927
|
-
children: /* @__PURE__ */
|
|
14184
|
+
children: /* @__PURE__ */ jsx49(
|
|
13928
14185
|
ChevronDownIcon2,
|
|
13929
14186
|
{}
|
|
13930
14187
|
)
|
|
@@ -13933,9 +14190,9 @@ function SelectScrollDownButton({
|
|
|
13933
14190
|
}
|
|
13934
14191
|
|
|
13935
14192
|
// src/components/ui/slider.tsx
|
|
13936
|
-
import * as
|
|
14193
|
+
import * as React45 from "react";
|
|
13937
14194
|
import { Slider as SliderPrimitive } from "radix-ui";
|
|
13938
|
-
import { jsx as
|
|
14195
|
+
import { jsx as jsx50, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
13939
14196
|
function Slider({
|
|
13940
14197
|
className,
|
|
13941
14198
|
defaultValue,
|
|
@@ -13944,11 +14201,11 @@ function Slider({
|
|
|
13944
14201
|
max = 100,
|
|
13945
14202
|
...props
|
|
13946
14203
|
}) {
|
|
13947
|
-
const _values =
|
|
14204
|
+
const _values = React45.useMemo(
|
|
13948
14205
|
() => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
|
|
13949
14206
|
[value, defaultValue, min, max]
|
|
13950
14207
|
);
|
|
13951
|
-
return /* @__PURE__ */
|
|
14208
|
+
return /* @__PURE__ */ jsxs36(
|
|
13952
14209
|
SliderPrimitive.Root,
|
|
13953
14210
|
{
|
|
13954
14211
|
"data-slot": "slider",
|
|
@@ -13962,12 +14219,12 @@ function Slider({
|
|
|
13962
14219
|
),
|
|
13963
14220
|
...props,
|
|
13964
14221
|
children: [
|
|
13965
|
-
/* @__PURE__ */
|
|
14222
|
+
/* @__PURE__ */ jsx50(
|
|
13966
14223
|
SliderPrimitive.Track,
|
|
13967
14224
|
{
|
|
13968
14225
|
"data-slot": "slider-track",
|
|
13969
14226
|
className: "relative grow overflow-hidden rounded-full bg-muted data-horizontal:h-1 data-horizontal:w-full data-vertical:h-full data-vertical:w-1",
|
|
13970
|
-
children: /* @__PURE__ */
|
|
14227
|
+
children: /* @__PURE__ */ jsx50(
|
|
13971
14228
|
SliderPrimitive.Range,
|
|
13972
14229
|
{
|
|
13973
14230
|
"data-slot": "slider-range",
|
|
@@ -13976,7 +14233,7 @@ function Slider({
|
|
|
13976
14233
|
)
|
|
13977
14234
|
}
|
|
13978
14235
|
),
|
|
13979
|
-
Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */
|
|
14236
|
+
Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */ jsx50(
|
|
13980
14237
|
SliderPrimitive.Thumb,
|
|
13981
14238
|
{
|
|
13982
14239
|
"data-slot": "slider-thumb",
|
|
@@ -13990,7 +14247,7 @@ function Slider({
|
|
|
13990
14247
|
}
|
|
13991
14248
|
|
|
13992
14249
|
// src/components/ui/toggle-group.tsx
|
|
13993
|
-
import * as
|
|
14250
|
+
import * as React47 from "react";
|
|
13994
14251
|
import "class-variance-authority";
|
|
13995
14252
|
import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui";
|
|
13996
14253
|
|
|
@@ -13998,7 +14255,7 @@ import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui";
|
|
|
13998
14255
|
import "react";
|
|
13999
14256
|
import { cva as cva2 } from "class-variance-authority";
|
|
14000
14257
|
import { Toggle as TogglePrimitive } from "radix-ui";
|
|
14001
|
-
import { jsx as
|
|
14258
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
14002
14259
|
var toggleVariants = cva2(
|
|
14003
14260
|
"group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
14004
14261
|
{
|
|
@@ -14021,8 +14278,8 @@ var toggleVariants = cva2(
|
|
|
14021
14278
|
);
|
|
14022
14279
|
|
|
14023
14280
|
// src/components/ui/toggle-group.tsx
|
|
14024
|
-
import { jsx as
|
|
14025
|
-
var ToggleGroupContext =
|
|
14281
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
14282
|
+
var ToggleGroupContext = React47.createContext({
|
|
14026
14283
|
size: "default",
|
|
14027
14284
|
variant: "default",
|
|
14028
14285
|
spacing: 0,
|
|
@@ -14037,7 +14294,7 @@ function ToggleGroup({
|
|
|
14037
14294
|
children,
|
|
14038
14295
|
...props
|
|
14039
14296
|
}) {
|
|
14040
|
-
return /* @__PURE__ */
|
|
14297
|
+
return /* @__PURE__ */ jsx52(
|
|
14041
14298
|
ToggleGroupPrimitive.Root,
|
|
14042
14299
|
{
|
|
14043
14300
|
"data-slot": "toggle-group",
|
|
@@ -14051,7 +14308,7 @@ function ToggleGroup({
|
|
|
14051
14308
|
className
|
|
14052
14309
|
),
|
|
14053
14310
|
...props,
|
|
14054
|
-
children: /* @__PURE__ */
|
|
14311
|
+
children: /* @__PURE__ */ jsx52(
|
|
14055
14312
|
ToggleGroupContext.Provider,
|
|
14056
14313
|
{
|
|
14057
14314
|
value: { variant, size: size2, spacing, orientation },
|
|
@@ -14068,8 +14325,8 @@ function ToggleGroupItem({
|
|
|
14068
14325
|
size: size2 = "default",
|
|
14069
14326
|
...props
|
|
14070
14327
|
}) {
|
|
14071
|
-
const context =
|
|
14072
|
-
return /* @__PURE__ */
|
|
14328
|
+
const context = React47.useContext(ToggleGroupContext);
|
|
14329
|
+
return /* @__PURE__ */ jsx52(
|
|
14073
14330
|
ToggleGroupPrimitive.Item,
|
|
14074
14331
|
{
|
|
14075
14332
|
"data-slot": "toggle-group-item",
|
|
@@ -14309,7 +14566,7 @@ import {
|
|
|
14309
14566
|
} from "@xpert-ai/chatkit-types";
|
|
14310
14567
|
|
|
14311
14568
|
// src/components/pet/PetPreview.tsx
|
|
14312
|
-
import { jsx as
|
|
14569
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
14313
14570
|
function escapeCssUrl(value) {
|
|
14314
14571
|
return value.replace(/["\\]/g, "\\$&");
|
|
14315
14572
|
}
|
|
@@ -14317,7 +14574,7 @@ function PetPreview({ src, label, className }) {
|
|
|
14317
14574
|
const scale = 0.13;
|
|
14318
14575
|
const width = petSpriteAtlas.cellWidth;
|
|
14319
14576
|
const height = petSpriteAtlas.cellHeight;
|
|
14320
|
-
return /* @__PURE__ */
|
|
14577
|
+
return /* @__PURE__ */ jsx53(
|
|
14321
14578
|
"span",
|
|
14322
14579
|
{
|
|
14323
14580
|
className: cn(
|
|
@@ -14326,7 +14583,7 @@ function PetPreview({ src, label, className }) {
|
|
|
14326
14583
|
),
|
|
14327
14584
|
"aria-hidden": "true",
|
|
14328
14585
|
title: label,
|
|
14329
|
-
children: /* @__PURE__ */
|
|
14586
|
+
children: /* @__PURE__ */ jsx53(
|
|
14330
14587
|
"span",
|
|
14331
14588
|
{
|
|
14332
14589
|
className: "absolute left-1/2 top-1/2 block",
|
|
@@ -14348,7 +14605,7 @@ function PetPreview({ src, label, className }) {
|
|
|
14348
14605
|
}
|
|
14349
14606
|
|
|
14350
14607
|
// src/components/settings/SettingsSheet.tsx
|
|
14351
|
-
import { jsx as
|
|
14608
|
+
import { jsx as jsx54, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
14352
14609
|
var CHARACTER_TYPES2 = [
|
|
14353
14610
|
"builtin",
|
|
14354
14611
|
"atlas"
|
|
@@ -14364,13 +14621,13 @@ function SettingsSheet({
|
|
|
14364
14621
|
onSave
|
|
14365
14622
|
}) {
|
|
14366
14623
|
const { t } = useChatkitTranslation();
|
|
14367
|
-
const [draft, setDraft] =
|
|
14368
|
-
|
|
14624
|
+
const [draft, setDraft] = React49.useState(settings);
|
|
14625
|
+
React49.useEffect(() => {
|
|
14369
14626
|
if (open) {
|
|
14370
14627
|
setDraft(petRequired ? { ...settings, enabled: true } : settings);
|
|
14371
14628
|
}
|
|
14372
14629
|
}, [open, petRequired, settings]);
|
|
14373
|
-
const updateDraft =
|
|
14630
|
+
const updateDraft = React49.useCallback(
|
|
14374
14631
|
(patch) => {
|
|
14375
14632
|
setDraft((previous) => ({ ...previous, ...patch }));
|
|
14376
14633
|
},
|
|
@@ -14388,23 +14645,23 @@ function SettingsSheet({
|
|
|
14388
14645
|
defaultValue: selectedBuiltinPet.label
|
|
14389
14646
|
}
|
|
14390
14647
|
);
|
|
14391
|
-
return /* @__PURE__ */
|
|
14392
|
-
/* @__PURE__ */
|
|
14393
|
-
/* @__PURE__ */
|
|
14394
|
-
/* @__PURE__ */
|
|
14648
|
+
return /* @__PURE__ */ jsx54(Sheet, { open, onOpenChange, children: /* @__PURE__ */ jsxs37(SheetContent, { side: "right", className: "w-[min(92vw,26rem)] overflow-y-auto", children: [
|
|
14649
|
+
/* @__PURE__ */ jsx54(SheetHeader, { children: /* @__PURE__ */ jsxs37("div", { className: "flex items-center gap-2", children: [
|
|
14650
|
+
/* @__PURE__ */ jsx54("span", { className: "flex h-8 w-8 items-center justify-center rounded-md bg-primary/10 text-primary", children: /* @__PURE__ */ jsx54(Settings, { size: 16 }) }),
|
|
14651
|
+
/* @__PURE__ */ jsx54(SheetTitle, { children: t("settings.title") })
|
|
14395
14652
|
] }) }),
|
|
14396
|
-
/* @__PURE__ */
|
|
14397
|
-
/* @__PURE__ */
|
|
14398
|
-
/* @__PURE__ */
|
|
14399
|
-
/* @__PURE__ */
|
|
14400
|
-
/* @__PURE__ */
|
|
14653
|
+
/* @__PURE__ */ jsxs37("form", { className: "mt-6 space-y-5", onSubmit: handleSubmit, children: [
|
|
14654
|
+
/* @__PURE__ */ jsxs37("section", { className: "space-y-5", children: [
|
|
14655
|
+
/* @__PURE__ */ jsxs37("div", { className: "flex items-center gap-2", children: [
|
|
14656
|
+
/* @__PURE__ */ jsx54("span", { className: "flex h-7 w-7 items-center justify-center rounded-md bg-muted text-muted-foreground", children: /* @__PURE__ */ jsx54(PawPrint, { size: 15 }) }),
|
|
14657
|
+
/* @__PURE__ */ jsx54("h3", { className: "text-sm font-semibold", children: t("pet.settings.title") })
|
|
14401
14658
|
] }),
|
|
14402
|
-
/* @__PURE__ */
|
|
14403
|
-
/* @__PURE__ */
|
|
14404
|
-
/* @__PURE__ */
|
|
14405
|
-
petRequired && /* @__PURE__ */
|
|
14659
|
+
/* @__PURE__ */ jsxs37("label", { className: "flex items-center justify-between gap-4 rounded-md border border-border px-3 py-2", children: [
|
|
14660
|
+
/* @__PURE__ */ jsxs37("span", { className: "min-w-0", children: [
|
|
14661
|
+
/* @__PURE__ */ jsx54("span", { className: "block text-sm font-medium", children: t("pet.settings.enabled") }),
|
|
14662
|
+
petRequired && /* @__PURE__ */ jsx54("span", { className: "mt-0.5 block text-xs text-muted-foreground", children: t("pet.settings.requiredHint") })
|
|
14406
14663
|
] }),
|
|
14407
|
-
/* @__PURE__ */
|
|
14664
|
+
/* @__PURE__ */ jsx54(
|
|
14408
14665
|
"button",
|
|
14409
14666
|
{
|
|
14410
14667
|
type: "button",
|
|
@@ -14417,7 +14674,7 @@ function SettingsSheet({
|
|
|
14417
14674
|
draft.enabled ? "bg-primary" : "bg-muted-foreground/20",
|
|
14418
14675
|
petRequired ? "cursor-not-allowed opacity-70" : ""
|
|
14419
14676
|
].join(" "),
|
|
14420
|
-
children: /* @__PURE__ */
|
|
14677
|
+
children: /* @__PURE__ */ jsx54(
|
|
14421
14678
|
"span",
|
|
14422
14679
|
{
|
|
14423
14680
|
className: [
|
|
@@ -14430,9 +14687,9 @@ function SettingsSheet({
|
|
|
14430
14687
|
)
|
|
14431
14688
|
] })
|
|
14432
14689
|
] }),
|
|
14433
|
-
/* @__PURE__ */
|
|
14434
|
-
/* @__PURE__ */
|
|
14435
|
-
/* @__PURE__ */
|
|
14690
|
+
/* @__PURE__ */ jsxs37("div", { className: "space-y-2", children: [
|
|
14691
|
+
/* @__PURE__ */ jsx54("span", { id: "chatkit-pet-type-label", className: "text-sm font-medium", children: t("pet.settings.characterType") }),
|
|
14692
|
+
/* @__PURE__ */ jsx54(
|
|
14436
14693
|
ToggleGroup,
|
|
14437
14694
|
{
|
|
14438
14695
|
id: "chatkit-pet-type",
|
|
@@ -14447,7 +14704,7 @@ function SettingsSheet({
|
|
|
14447
14704
|
variant: "outline",
|
|
14448
14705
|
spacing: 2,
|
|
14449
14706
|
className: "!w-full",
|
|
14450
|
-
children: CHARACTER_TYPES2.map((type) => /* @__PURE__ */
|
|
14707
|
+
children: CHARACTER_TYPES2.map((type) => /* @__PURE__ */ jsx54(
|
|
14451
14708
|
ToggleGroupItem,
|
|
14452
14709
|
{
|
|
14453
14710
|
value: type,
|
|
@@ -14459,8 +14716,8 @@ function SettingsSheet({
|
|
|
14459
14716
|
}
|
|
14460
14717
|
)
|
|
14461
14718
|
] }),
|
|
14462
|
-
draft.characterType === "builtin" && /* @__PURE__ */
|
|
14463
|
-
/* @__PURE__ */
|
|
14719
|
+
draft.characterType === "builtin" && /* @__PURE__ */ jsxs37("div", { className: "space-y-2", children: [
|
|
14720
|
+
/* @__PURE__ */ jsx54(
|
|
14464
14721
|
"label",
|
|
14465
14722
|
{
|
|
14466
14723
|
htmlFor: "chatkit-pet-builtin",
|
|
@@ -14468,7 +14725,7 @@ function SettingsSheet({
|
|
|
14468
14725
|
children: t("pet.settings.builtin")
|
|
14469
14726
|
}
|
|
14470
14727
|
),
|
|
14471
|
-
/* @__PURE__ */
|
|
14728
|
+
/* @__PURE__ */ jsxs37(
|
|
14472
14729
|
Select,
|
|
14473
14730
|
{
|
|
14474
14731
|
value: selectedBuiltinPet.id,
|
|
@@ -14479,26 +14736,26 @@ function SettingsSheet({
|
|
|
14479
14736
|
}
|
|
14480
14737
|
},
|
|
14481
14738
|
children: [
|
|
14482
|
-
/* @__PURE__ */
|
|
14739
|
+
/* @__PURE__ */ jsx54(
|
|
14483
14740
|
SelectTrigger,
|
|
14484
14741
|
{
|
|
14485
14742
|
id: "chatkit-pet-builtin",
|
|
14486
14743
|
className: "min-h-12 w-full px-3 py-2",
|
|
14487
|
-
children: /* @__PURE__ */
|
|
14744
|
+
children: /* @__PURE__ */ jsx54(SelectValue, { placeholder: selectedBuiltinPetLabel })
|
|
14488
14745
|
}
|
|
14489
14746
|
),
|
|
14490
|
-
/* @__PURE__ */
|
|
14747
|
+
/* @__PURE__ */ jsx54(SelectContent, { className: "w-[var(--radix-select-trigger-width)]", children: /* @__PURE__ */ jsx54(SelectGroup, { children: INCLUDED_PET_OPTIONS.map((pet) => {
|
|
14491
14748
|
const label = t(`pet.settings.builtins.${pet.id}`, {
|
|
14492
14749
|
defaultValue: pet.label
|
|
14493
14750
|
});
|
|
14494
|
-
return /* @__PURE__ */
|
|
14751
|
+
return /* @__PURE__ */ jsx54(
|
|
14495
14752
|
SelectItem,
|
|
14496
14753
|
{
|
|
14497
14754
|
value: pet.id,
|
|
14498
14755
|
className: "min-h-10 py-1.5 pl-2 pr-8",
|
|
14499
|
-
children: /* @__PURE__ */
|
|
14500
|
-
/* @__PURE__ */
|
|
14501
|
-
/* @__PURE__ */
|
|
14756
|
+
children: /* @__PURE__ */ jsxs37("span", { className: "flex min-w-0 items-center gap-2", children: [
|
|
14757
|
+
/* @__PURE__ */ jsx54(PetPreview, { src: pet.previewSrc, label }),
|
|
14758
|
+
/* @__PURE__ */ jsx54("span", { className: "min-w-0 truncate", children: label })
|
|
14502
14759
|
] })
|
|
14503
14760
|
},
|
|
14504
14761
|
pet.id
|
|
@@ -14508,8 +14765,8 @@ function SettingsSheet({
|
|
|
14508
14765
|
}
|
|
14509
14766
|
)
|
|
14510
14767
|
] }),
|
|
14511
|
-
draft.characterType === "atlas" && /* @__PURE__ */
|
|
14512
|
-
/* @__PURE__ */
|
|
14768
|
+
draft.characterType === "atlas" && /* @__PURE__ */ jsxs37("div", { className: "space-y-2", children: [
|
|
14769
|
+
/* @__PURE__ */ jsx54(
|
|
14513
14770
|
"label",
|
|
14514
14771
|
{
|
|
14515
14772
|
className: "text-sm font-medium",
|
|
@@ -14517,7 +14774,7 @@ function SettingsSheet({
|
|
|
14517
14774
|
children: t("pet.settings.atlasUrl")
|
|
14518
14775
|
}
|
|
14519
14776
|
),
|
|
14520
|
-
/* @__PURE__ */
|
|
14777
|
+
/* @__PURE__ */ jsx54(
|
|
14521
14778
|
Input,
|
|
14522
14779
|
{
|
|
14523
14780
|
id: "chatkit-pet-atlas",
|
|
@@ -14527,15 +14784,15 @@ function SettingsSheet({
|
|
|
14527
14784
|
}
|
|
14528
14785
|
)
|
|
14529
14786
|
] }),
|
|
14530
|
-
/* @__PURE__ */
|
|
14531
|
-
/* @__PURE__ */
|
|
14532
|
-
/* @__PURE__ */
|
|
14533
|
-
/* @__PURE__ */
|
|
14787
|
+
/* @__PURE__ */ jsxs37("div", { className: "space-y-2", children: [
|
|
14788
|
+
/* @__PURE__ */ jsxs37("div", { className: "flex items-center justify-between gap-4", children: [
|
|
14789
|
+
/* @__PURE__ */ jsx54("label", { className: "text-sm font-medium", htmlFor: "chatkit-pet-scale", children: t("pet.settings.scale") }),
|
|
14790
|
+
/* @__PURE__ */ jsxs37("span", { className: "text-xs tabular-nums text-muted-foreground", children: [
|
|
14534
14791
|
draft.scale.toFixed(2),
|
|
14535
14792
|
"x"
|
|
14536
14793
|
] })
|
|
14537
14794
|
] }),
|
|
14538
|
-
/* @__PURE__ */
|
|
14795
|
+
/* @__PURE__ */ jsx54(
|
|
14539
14796
|
Slider,
|
|
14540
14797
|
{
|
|
14541
14798
|
id: "chatkit-pet-scale",
|
|
@@ -14549,8 +14806,8 @@ function SettingsSheet({
|
|
|
14549
14806
|
}
|
|
14550
14807
|
)
|
|
14551
14808
|
] }),
|
|
14552
|
-
/* @__PURE__ */
|
|
14553
|
-
/* @__PURE__ */
|
|
14809
|
+
/* @__PURE__ */ jsxs37("label", { className: "flex items-center gap-2 text-sm", children: [
|
|
14810
|
+
/* @__PURE__ */ jsx54(
|
|
14554
14811
|
"input",
|
|
14555
14812
|
{
|
|
14556
14813
|
type: "checkbox",
|
|
@@ -14561,8 +14818,8 @@ function SettingsSheet({
|
|
|
14561
14818
|
),
|
|
14562
14819
|
t("pet.settings.draggable")
|
|
14563
14820
|
] }),
|
|
14564
|
-
/* @__PURE__ */
|
|
14565
|
-
/* @__PURE__ */
|
|
14821
|
+
/* @__PURE__ */ jsxs37("label", { className: "flex items-center gap-2 text-sm", children: [
|
|
14822
|
+
/* @__PURE__ */ jsx54(
|
|
14566
14823
|
"input",
|
|
14567
14824
|
{
|
|
14568
14825
|
type: "checkbox",
|
|
@@ -14573,8 +14830,8 @@ function SettingsSheet({
|
|
|
14573
14830
|
),
|
|
14574
14831
|
t("pet.settings.persistPosition")
|
|
14575
14832
|
] }),
|
|
14576
|
-
/* @__PURE__ */
|
|
14577
|
-
/* @__PURE__ */
|
|
14833
|
+
/* @__PURE__ */ jsxs37("div", { className: "flex justify-end gap-2 pt-2", children: [
|
|
14834
|
+
/* @__PURE__ */ jsx54(
|
|
14578
14835
|
Button,
|
|
14579
14836
|
{
|
|
14580
14837
|
type: "button",
|
|
@@ -14583,7 +14840,7 @@ function SettingsSheet({
|
|
|
14583
14840
|
children: t("pet.settings.cancel")
|
|
14584
14841
|
}
|
|
14585
14842
|
),
|
|
14586
|
-
/* @__PURE__ */
|
|
14843
|
+
/* @__PURE__ */ jsx54(Button, { type: "submit", children: t("pet.settings.save") })
|
|
14587
14844
|
] })
|
|
14588
14845
|
] })
|
|
14589
14846
|
] }) });
|
|
@@ -15209,8 +15466,260 @@ function findDomPointForComposerOffset(root, offset) {
|
|
|
15209
15466
|
return result ?? { node: lastNode, offset: lastOffset };
|
|
15210
15467
|
}
|
|
15211
15468
|
|
|
15469
|
+
// src/lib/message-navigation.ts
|
|
15470
|
+
var MESSAGE_NAVIGATION_MIN_ITEMS = 3;
|
|
15471
|
+
var MAX_PREVIEW_LENGTH = 180;
|
|
15472
|
+
var MAX_TAG_LENGTH = 40;
|
|
15473
|
+
function isRecord6(value) {
|
|
15474
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
15475
|
+
}
|
|
15476
|
+
function readString4(value) {
|
|
15477
|
+
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
15478
|
+
}
|
|
15479
|
+
function normalizeWhitespace(value) {
|
|
15480
|
+
return value.replace(/\s+/g, " ").trim();
|
|
15481
|
+
}
|
|
15482
|
+
function truncate(value, maxLength) {
|
|
15483
|
+
const normalized = normalizeWhitespace(value);
|
|
15484
|
+
if (normalized.length <= maxLength) return normalized;
|
|
15485
|
+
return `${normalized.slice(0, Math.max(0, maxLength - 1)).trimEnd()}...`;
|
|
15486
|
+
}
|
|
15487
|
+
function pushText(draft, value) {
|
|
15488
|
+
const text = readString4(value);
|
|
15489
|
+
if (text) draft.text.push(text);
|
|
15490
|
+
}
|
|
15491
|
+
function pushTag(draft, value) {
|
|
15492
|
+
const tag = readString4(value);
|
|
15493
|
+
if (!tag) return;
|
|
15494
|
+
const normalized = truncate(tag, MAX_TAG_LENGTH);
|
|
15495
|
+
if (!draft.tags.includes(normalized)) {
|
|
15496
|
+
draft.tags.push(normalized);
|
|
15497
|
+
}
|
|
15498
|
+
}
|
|
15499
|
+
function mergeTags(...tagGroups) {
|
|
15500
|
+
const tags = [];
|
|
15501
|
+
for (const group of tagGroups) {
|
|
15502
|
+
for (const tag of group) {
|
|
15503
|
+
if (!tags.includes(tag)) tags.push(tag);
|
|
15504
|
+
}
|
|
15505
|
+
}
|
|
15506
|
+
return tags;
|
|
15507
|
+
}
|
|
15508
|
+
function getMessageNavigationItemId(message, index) {
|
|
15509
|
+
const messageId = readString4(message.id);
|
|
15510
|
+
if (messageId) return messageId;
|
|
15511
|
+
const type = readString4(message.type) ?? "message";
|
|
15512
|
+
return `${type}-${index}`;
|
|
15513
|
+
}
|
|
15514
|
+
function getMessageNavigationRole(type) {
|
|
15515
|
+
const normalized = readString4(type)?.toLowerCase();
|
|
15516
|
+
if (normalized === "human" || normalized === "user") return "user";
|
|
15517
|
+
if (normalized === "ai" || normalized === "assistant") return "assistant";
|
|
15518
|
+
if (normalized === "system") return "system";
|
|
15519
|
+
if (normalized === "tool") return "tool";
|
|
15520
|
+
if (normalized === "event") return "event";
|
|
15521
|
+
return "message";
|
|
15522
|
+
}
|
|
15523
|
+
function isTextContent4(content) {
|
|
15524
|
+
return content.type === "text";
|
|
15525
|
+
}
|
|
15526
|
+
function isReasoningContent4(content) {
|
|
15527
|
+
return content.type === "reasoning";
|
|
15528
|
+
}
|
|
15529
|
+
function isComponentContent4(content) {
|
|
15530
|
+
return content.type === "component";
|
|
15531
|
+
}
|
|
15532
|
+
function isMemoryContent2(content) {
|
|
15533
|
+
return content.type === "memory";
|
|
15534
|
+
}
|
|
15535
|
+
function isWidgetComponent3(content) {
|
|
15536
|
+
const data = content.data;
|
|
15537
|
+
return data?.type === "Widget" && Array.isArray(data.widgets);
|
|
15538
|
+
}
|
|
15539
|
+
function isMcpAppComponent2(content) {
|
|
15540
|
+
const data = content.data;
|
|
15541
|
+
return data?.type === "McpApp" && typeof data.appInstanceId === "string";
|
|
15542
|
+
}
|
|
15543
|
+
function collectWidgetContent(draft, content, labels) {
|
|
15544
|
+
const names = content.data.widgets.map((widget) => readString4(widget.name)).filter((name) => Boolean(name));
|
|
15545
|
+
if (names.length === 0) {
|
|
15546
|
+
pushTag(draft, labels.widget);
|
|
15547
|
+
return;
|
|
15548
|
+
}
|
|
15549
|
+
for (const name of names) {
|
|
15550
|
+
pushTag(draft, name);
|
|
15551
|
+
}
|
|
15552
|
+
}
|
|
15553
|
+
function collectMcpAppContent(draft, content, labels, language) {
|
|
15554
|
+
const title = readString4(resolveLocalizedText(content.data.title, language)) ?? readString4(content.data.toolName) ?? labels.mcpApp;
|
|
15555
|
+
pushTag(draft, title);
|
|
15556
|
+
pushText(draft, resolveLocalizedText(content.data.description, language));
|
|
15557
|
+
}
|
|
15558
|
+
function collectComponentContent(draft, content, labels, language, options) {
|
|
15559
|
+
if (isWidgetComponent3(content)) {
|
|
15560
|
+
collectWidgetContent(draft, content, labels);
|
|
15561
|
+
return;
|
|
15562
|
+
}
|
|
15563
|
+
if (isMcpAppComponent2(content)) {
|
|
15564
|
+
collectMcpAppContent(draft, content, labels, language);
|
|
15565
|
+
return;
|
|
15566
|
+
}
|
|
15567
|
+
const data = getToolStepData(content);
|
|
15568
|
+
pushTag(
|
|
15569
|
+
draft,
|
|
15570
|
+
resolveLocalizedText(data.message, language) ?? getToolActivityLabel(content, language)
|
|
15571
|
+
);
|
|
15572
|
+
if (options.includeComponentText !== false) {
|
|
15573
|
+
pushText(draft, resolveLocalizedText(data.message, language));
|
|
15574
|
+
pushText(draft, resolveLocalizedText(data.title, language));
|
|
15575
|
+
pushText(draft, resolveLocalizedText(data.tool, language));
|
|
15576
|
+
pushText(draft, resolveLocalizedText(data.type, language));
|
|
15577
|
+
}
|
|
15578
|
+
}
|
|
15579
|
+
function collectContentItem(draft, item, labels, language, options) {
|
|
15580
|
+
if (item === void 0 || isThreadContextUsageRenderArtifact(item)) return;
|
|
15581
|
+
if (typeof item === "string") {
|
|
15582
|
+
pushText(draft, item);
|
|
15583
|
+
return;
|
|
15584
|
+
}
|
|
15585
|
+
if (isTextContent4(item) || isReasoningContent4(item)) {
|
|
15586
|
+
pushText(draft, item.text);
|
|
15587
|
+
if (isReasoningContent4(item)) pushTag(draft, labels.reasoning);
|
|
15588
|
+
return;
|
|
15589
|
+
}
|
|
15590
|
+
if (item.type === "image_url") {
|
|
15591
|
+
pushTag(draft, labels.image);
|
|
15592
|
+
return;
|
|
15593
|
+
}
|
|
15594
|
+
if (isComponentContent4(item)) {
|
|
15595
|
+
collectComponentContent(draft, item, labels, language, options);
|
|
15596
|
+
return;
|
|
15597
|
+
}
|
|
15598
|
+
if (isMemoryContent2(item)) {
|
|
15599
|
+
pushTag(draft, labels.memory);
|
|
15600
|
+
}
|
|
15601
|
+
}
|
|
15602
|
+
function collectContent(draft, content, labels, language, options = {}) {
|
|
15603
|
+
if (typeof content === "string") {
|
|
15604
|
+
pushText(draft, content);
|
|
15605
|
+
return;
|
|
15606
|
+
}
|
|
15607
|
+
if (!Array.isArray(content)) {
|
|
15608
|
+
return;
|
|
15609
|
+
}
|
|
15610
|
+
for (const item of content) {
|
|
15611
|
+
collectContentItem(
|
|
15612
|
+
draft,
|
|
15613
|
+
item,
|
|
15614
|
+
labels,
|
|
15615
|
+
language,
|
|
15616
|
+
options
|
|
15617
|
+
);
|
|
15618
|
+
}
|
|
15619
|
+
}
|
|
15620
|
+
function collectReasoning(draft, reasoning, labels) {
|
|
15621
|
+
if (!Array.isArray(reasoning)) return;
|
|
15622
|
+
for (const item of reasoning) {
|
|
15623
|
+
if (!isRecord6(item)) continue;
|
|
15624
|
+
pushText(draft, item.text);
|
|
15625
|
+
if (readString4(item.text)) pushTag(draft, labels.reasoning);
|
|
15626
|
+
}
|
|
15627
|
+
}
|
|
15628
|
+
function collectFiles(draft, value, fallbackLabel) {
|
|
15629
|
+
if (!Array.isArray(value)) return;
|
|
15630
|
+
for (const file of value) {
|
|
15631
|
+
if (!isRecord6(file)) continue;
|
|
15632
|
+
pushTag(
|
|
15633
|
+
draft,
|
|
15634
|
+
file.originalName ?? file.name ?? file.fileName ?? file.id ?? fallbackLabel
|
|
15635
|
+
);
|
|
15636
|
+
}
|
|
15637
|
+
}
|
|
15638
|
+
function collectReferences(draft, value) {
|
|
15639
|
+
for (const reference of normalizeReferences(value)) {
|
|
15640
|
+
pushTag(draft, getReferenceLabel(reference));
|
|
15641
|
+
}
|
|
15642
|
+
}
|
|
15643
|
+
function collectRuntimeCapabilities(draft, value) {
|
|
15644
|
+
if (!Array.isArray(value)) return;
|
|
15645
|
+
for (const option of value) {
|
|
15646
|
+
if (!isRecord6(option)) continue;
|
|
15647
|
+
pushTag(draft, option.label ?? option.id ?? option.type);
|
|
15648
|
+
}
|
|
15649
|
+
}
|
|
15650
|
+
function getTitle(role, labels, assistantTitle) {
|
|
15651
|
+
if (role === "assistant" && assistantTitle?.trim()) {
|
|
15652
|
+
return assistantTitle.trim();
|
|
15653
|
+
}
|
|
15654
|
+
return labels[role];
|
|
15655
|
+
}
|
|
15656
|
+
function buildMessageNavigationItemSummary(message, index, options, collectOptions = {}) {
|
|
15657
|
+
const role = getMessageNavigationRole(message.type);
|
|
15658
|
+
const draft = {
|
|
15659
|
+
text: [],
|
|
15660
|
+
tags: []
|
|
15661
|
+
};
|
|
15662
|
+
const language = options.language ?? "en-US";
|
|
15663
|
+
const labels = options.labels;
|
|
15664
|
+
if (role === "user") {
|
|
15665
|
+
pushText(draft, message.submittedInput);
|
|
15666
|
+
}
|
|
15667
|
+
collectContent(draft, message.content, labels, language, collectOptions);
|
|
15668
|
+
collectReasoning(draft, message.reasoning, labels);
|
|
15669
|
+
collectFiles(draft, message.fileAssets, labels.attachment);
|
|
15670
|
+
collectFiles(draft, message.attachments, labels.attachment);
|
|
15671
|
+
collectReferences(draft, message.references);
|
|
15672
|
+
collectRuntimeCapabilities(draft, message.runtimeCapabilityOptions);
|
|
15673
|
+
const text = draft.text.map(normalizeWhitespace).filter(Boolean).join(" ");
|
|
15674
|
+
const preview = truncate(text, MAX_PREVIEW_LENGTH) || draft.tags.slice(0, 2).join(" \xB7 ");
|
|
15675
|
+
if (!preview && draft.tags.length === 0) {
|
|
15676
|
+
return null;
|
|
15677
|
+
}
|
|
15678
|
+
const messageId = readString4(message.id) ?? void 0;
|
|
15679
|
+
return {
|
|
15680
|
+
id: getMessageNavigationItemId(message, index),
|
|
15681
|
+
...messageId ? { messageId } : {},
|
|
15682
|
+
index,
|
|
15683
|
+
role,
|
|
15684
|
+
title: getTitle(role, labels, options.assistantTitle),
|
|
15685
|
+
preview,
|
|
15686
|
+
tags: draft.tags
|
|
15687
|
+
};
|
|
15688
|
+
}
|
|
15689
|
+
function buildMessageNavigationItems(messages, options) {
|
|
15690
|
+
const items = [];
|
|
15691
|
+
let pendingUser = null;
|
|
15692
|
+
messages.forEach((message, messageIndex) => {
|
|
15693
|
+
const item = buildMessageNavigationItemSummary(
|
|
15694
|
+
message,
|
|
15695
|
+
messageIndex,
|
|
15696
|
+
options,
|
|
15697
|
+
{ includeComponentText: false }
|
|
15698
|
+
);
|
|
15699
|
+
if (!item) return;
|
|
15700
|
+
if (item.role === "user") {
|
|
15701
|
+
pendingUser = { item };
|
|
15702
|
+
return;
|
|
15703
|
+
}
|
|
15704
|
+
if (item.role !== "assistant" || !pendingUser) {
|
|
15705
|
+
return;
|
|
15706
|
+
}
|
|
15707
|
+
items.push({
|
|
15708
|
+
id: pendingUser.item.id,
|
|
15709
|
+
...pendingUser.item.messageId ? { messageId: pendingUser.item.messageId } : {},
|
|
15710
|
+
index: items.length,
|
|
15711
|
+
role: "user",
|
|
15712
|
+
title: pendingUser.item.preview,
|
|
15713
|
+
preview: item.preview,
|
|
15714
|
+
tags: mergeTags(item.tags, pendingUser.item.tags)
|
|
15715
|
+
});
|
|
15716
|
+
pendingUser = null;
|
|
15717
|
+
});
|
|
15718
|
+
return items;
|
|
15719
|
+
}
|
|
15720
|
+
|
|
15212
15721
|
// src/components/chat.tsx
|
|
15213
|
-
import { Fragment as Fragment9, jsx as
|
|
15722
|
+
import { Fragment as Fragment9, jsx as jsx55, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
15214
15723
|
var defaultApiUrl2 = import.meta.env.VITE_XPERTAI_API_URL;
|
|
15215
15724
|
var COMPOSER_INPUT_MAX_HEIGHT = 128;
|
|
15216
15725
|
var LONG_TEXT_REFERENCE_THRESHOLD = 5e3;
|
|
@@ -15355,7 +15864,7 @@ function ReferenceChip({
|
|
|
15355
15864
|
const metaLine = getReferenceMetaLine(reference);
|
|
15356
15865
|
const isComposer = variant === "composer";
|
|
15357
15866
|
const Icon = reference.type === "quote" ? Quote : reference.type === "image" ? ImageIcon : FileText5;
|
|
15358
|
-
return /* @__PURE__ */
|
|
15867
|
+
return /* @__PURE__ */ jsxs38(
|
|
15359
15868
|
"div",
|
|
15360
15869
|
{
|
|
15361
15870
|
className: cn(
|
|
@@ -15364,7 +15873,7 @@ function ReferenceChip({
|
|
|
15364
15873
|
),
|
|
15365
15874
|
title: getReferenceTitle(reference),
|
|
15366
15875
|
children: [
|
|
15367
|
-
/* @__PURE__ */
|
|
15876
|
+
/* @__PURE__ */ jsx55(
|
|
15368
15877
|
Icon,
|
|
15369
15878
|
{
|
|
15370
15879
|
size: isComposer ? 14 : 12,
|
|
@@ -15374,8 +15883,8 @@ function ReferenceChip({
|
|
|
15374
15883
|
)
|
|
15375
15884
|
}
|
|
15376
15885
|
),
|
|
15377
|
-
/* @__PURE__ */
|
|
15378
|
-
/* @__PURE__ */
|
|
15886
|
+
/* @__PURE__ */ jsxs38("div", { className: "min-w-0 flex-1", children: [
|
|
15887
|
+
/* @__PURE__ */ jsx55(
|
|
15379
15888
|
"div",
|
|
15380
15889
|
{
|
|
15381
15890
|
className: cn(
|
|
@@ -15385,7 +15894,7 @@ function ReferenceChip({
|
|
|
15385
15894
|
children: getReferenceLabel(reference)
|
|
15386
15895
|
}
|
|
15387
15896
|
),
|
|
15388
|
-
metaLine && /* @__PURE__ */
|
|
15897
|
+
metaLine && /* @__PURE__ */ jsx55(
|
|
15389
15898
|
"div",
|
|
15390
15899
|
{
|
|
15391
15900
|
className: cn(
|
|
@@ -15396,7 +15905,7 @@ function ReferenceChip({
|
|
|
15396
15905
|
}
|
|
15397
15906
|
)
|
|
15398
15907
|
] }),
|
|
15399
|
-
onRemove && removeLabel && /* @__PURE__ */
|
|
15908
|
+
onRemove && removeLabel && /* @__PURE__ */ jsx55(
|
|
15400
15909
|
"button",
|
|
15401
15910
|
{
|
|
15402
15911
|
type: "button",
|
|
@@ -15407,7 +15916,7 @@ function ReferenceChip({
|
|
|
15407
15916
|
),
|
|
15408
15917
|
title: removeLabel,
|
|
15409
15918
|
"aria-label": removeLabel,
|
|
15410
|
-
children: /* @__PURE__ */
|
|
15919
|
+
children: /* @__PURE__ */ jsx55(X6, { size: 12 })
|
|
15411
15920
|
}
|
|
15412
15921
|
)
|
|
15413
15922
|
]
|
|
@@ -15422,35 +15931,36 @@ function Chat({
|
|
|
15422
15931
|
clientSecret = "",
|
|
15423
15932
|
isClientSecretInitializing = false
|
|
15424
15933
|
}) {
|
|
15425
|
-
const { t } = useChatkitTranslation();
|
|
15934
|
+
const { t, i18n: i18n2 } = useChatkitTranslation();
|
|
15426
15935
|
const composer = options?.composer;
|
|
15427
15936
|
const startScreen = options?.startScreen;
|
|
15428
15937
|
const history = options?.history;
|
|
15429
15938
|
const disclaimer = options?.disclaimer;
|
|
15430
15939
|
const apiUrl = options?.api?.apiUrl || defaultApiUrl2;
|
|
15940
|
+
const messageNavigationEnabled = options?.messageNavigation?.enabled !== false;
|
|
15431
15941
|
const { setStream } = useStreamManager();
|
|
15432
15942
|
const stream = useStreamContext();
|
|
15433
15943
|
const { theme } = useTheme();
|
|
15434
|
-
const [isHistoryLoading, setIsHistoryLoading] =
|
|
15435
|
-
const [historyError, setHistoryError] =
|
|
15436
|
-
const [assistantName, setAssistantName] =
|
|
15437
|
-
const [assistantAvatar, setAssistantAvatar] =
|
|
15438
|
-
const [threadGoal, setThreadGoal] =
|
|
15439
|
-
const [goalError, setGoalError] =
|
|
15440
|
-
const [isGoalLoading, setIsGoalLoading] =
|
|
15441
|
-
const [isGoalPanelOpen, setIsGoalPanelOpen] =
|
|
15442
|
-
const [isGoalObjectiveExpanded, setIsGoalObjectiveExpanded] =
|
|
15443
|
-
const [goalElapsedStartedAt, setGoalElapsedStartedAt] =
|
|
15944
|
+
const [isHistoryLoading, setIsHistoryLoading] = React50.useState(false);
|
|
15945
|
+
const [historyError, setHistoryError] = React50.useState(null);
|
|
15946
|
+
const [assistantName, setAssistantName] = React50.useState(null);
|
|
15947
|
+
const [assistantAvatar, setAssistantAvatar] = React50.useState(null);
|
|
15948
|
+
const [threadGoal, setThreadGoal] = React50.useState(null);
|
|
15949
|
+
const [goalError, setGoalError] = React50.useState(null);
|
|
15950
|
+
const [isGoalLoading, setIsGoalLoading] = React50.useState(false);
|
|
15951
|
+
const [isGoalPanelOpen, setIsGoalPanelOpen] = React50.useState(false);
|
|
15952
|
+
const [isGoalObjectiveExpanded, setIsGoalObjectiveExpanded] = React50.useState(false);
|
|
15953
|
+
const [goalElapsedStartedAt, setGoalElapsedStartedAt] = React50.useState(null);
|
|
15444
15954
|
const LOADING_DOTS_MIN_DURATION = 800;
|
|
15445
15955
|
const STREAMING_STATUS_REFRESH_MS = 250;
|
|
15446
|
-
const [showLoadingDots, setShowLoadingDots] =
|
|
15447
|
-
const [streamingNow, setStreamingNow] =
|
|
15448
|
-
const loadingStartTimeRef =
|
|
15449
|
-
const lastStreamOutputAtRef =
|
|
15450
|
-
|
|
15956
|
+
const [showLoadingDots, setShowLoadingDots] = React50.useState(false);
|
|
15957
|
+
const [streamingNow, setStreamingNow] = React50.useState(() => Date.now());
|
|
15958
|
+
const loadingStartTimeRef = React50.useRef(null);
|
|
15959
|
+
const lastStreamOutputAtRef = React50.useRef(null);
|
|
15960
|
+
React50.useEffect(() => {
|
|
15451
15961
|
setStream(stream);
|
|
15452
15962
|
}, [setStream, stream]);
|
|
15453
|
-
|
|
15963
|
+
React50.useEffect(() => {
|
|
15454
15964
|
if (stream.isLoading) {
|
|
15455
15965
|
if (!loadingStartTimeRef.current) {
|
|
15456
15966
|
loadingStartTimeRef.current = Date.now();
|
|
@@ -15473,7 +15983,7 @@ function Chat({
|
|
|
15473
15983
|
}
|
|
15474
15984
|
}
|
|
15475
15985
|
}, [stream.isLoading]);
|
|
15476
|
-
|
|
15986
|
+
React50.useEffect(() => {
|
|
15477
15987
|
if (!stream.isLoading) {
|
|
15478
15988
|
lastStreamOutputAtRef.current = null;
|
|
15479
15989
|
setStreamingNow(Date.now());
|
|
@@ -15483,7 +15993,7 @@ function Chat({
|
|
|
15483
15993
|
lastStreamOutputAtRef.current = now;
|
|
15484
15994
|
setStreamingNow(now);
|
|
15485
15995
|
}, [stream.messages, stream.isLoading]);
|
|
15486
|
-
|
|
15996
|
+
React50.useEffect(() => {
|
|
15487
15997
|
if (!stream.isLoading) {
|
|
15488
15998
|
return;
|
|
15489
15999
|
}
|
|
@@ -15492,7 +16002,7 @@ function Chat({
|
|
|
15492
16002
|
}, STREAMING_STATUS_REFRESH_MS);
|
|
15493
16003
|
return () => window.clearInterval(timer);
|
|
15494
16004
|
}, [stream.isLoading]);
|
|
15495
|
-
|
|
16005
|
+
React50.useEffect(() => {
|
|
15496
16006
|
if (threadGoal?.status === "active" && stream.isLoading) {
|
|
15497
16007
|
setGoalElapsedStartedAt(Date.now());
|
|
15498
16008
|
return;
|
|
@@ -15504,82 +16014,86 @@ function Chat({
|
|
|
15504
16014
|
threadGoal?.id,
|
|
15505
16015
|
threadGoal?.status
|
|
15506
16016
|
]);
|
|
15507
|
-
|
|
16017
|
+
React50.useEffect(() => {
|
|
15508
16018
|
setIsGoalObjectiveExpanded(false);
|
|
15509
16019
|
}, [threadGoal?.id]);
|
|
15510
|
-
const [composerParts, setComposerParts] =
|
|
15511
|
-
const [renderedComposerParts, setRenderedComposerParts] =
|
|
15512
|
-
const [composerDomVersion, setComposerDomVersion] =
|
|
15513
|
-
const [selectedTool, setSelectedTool] =
|
|
16020
|
+
const [composerParts, setComposerParts] = React50.useState([]);
|
|
16021
|
+
const [renderedComposerParts, setRenderedComposerParts] = React50.useState([]);
|
|
16022
|
+
const [composerDomVersion, setComposerDomVersion] = React50.useState(0);
|
|
16023
|
+
const [selectedTool, setSelectedTool] = React50.useState(
|
|
15514
16024
|
null
|
|
15515
16025
|
);
|
|
15516
|
-
const [planModeEnabled, setPlanModeEnabled] =
|
|
15517
|
-
const [petSettingsOpen, setPetSettingsOpen] =
|
|
15518
|
-
const [petLocalSettings, setPetLocalSettings] =
|
|
15519
|
-
const [runtimeCapabilities, setRuntimeCapabilities] =
|
|
15520
|
-
const [runtimeCapabilitiesReady, setRuntimeCapabilitiesReady] =
|
|
15521
|
-
const [sessionRuntimeCapabilities, setSessionRuntimeCapabilities] =
|
|
16026
|
+
const [planModeEnabled, setPlanModeEnabled] = React50.useState(false);
|
|
16027
|
+
const [petSettingsOpen, setPetSettingsOpen] = React50.useState(false);
|
|
16028
|
+
const [petLocalSettings, setPetLocalSettings] = React50.useState(() => readPetLocalSettings());
|
|
16029
|
+
const [runtimeCapabilities, setRuntimeCapabilities] = React50.useState(null);
|
|
16030
|
+
const [runtimeCapabilitiesReady, setRuntimeCapabilitiesReady] = React50.useState(false);
|
|
16031
|
+
const [sessionRuntimeCapabilities, setSessionRuntimeCapabilities] = React50.useState(
|
|
15522
16032
|
() => createEmptyRuntimeCapabilitiesSelection()
|
|
15523
16033
|
);
|
|
15524
|
-
const [runRuntimeCapabilities, setRunRuntimeCapabilities] =
|
|
16034
|
+
const [runRuntimeCapabilities, setRunRuntimeCapabilities] = React50.useState(
|
|
15525
16035
|
() => createEmptyRuntimeCapabilitiesSelection()
|
|
15526
16036
|
);
|
|
15527
|
-
const [runtimeCapabilityPalette, setRuntimeCapabilityPalette] =
|
|
15528
|
-
const [attachmentState, setAttachmentState] =
|
|
16037
|
+
const [runtimeCapabilityPalette, setRuntimeCapabilityPalette] = React50.useState(null);
|
|
16038
|
+
const [attachmentState, setAttachmentState] = React50.useState({
|
|
15529
16039
|
uploadedFiles: [],
|
|
15530
16040
|
hasUploadingFiles: false,
|
|
15531
16041
|
hasParsingFiles: false
|
|
15532
16042
|
});
|
|
15533
|
-
const [references, setReferences] =
|
|
15534
|
-
const [isUploadingReferenceImages, setIsUploadingReferenceImages] =
|
|
15535
|
-
const [quoteSelection, setQuoteSelection] =
|
|
15536
|
-
const [isAtBottom, setIsAtBottom] =
|
|
15537
|
-
const [hasUpdatesBelow, setHasUpdatesBelow] =
|
|
16043
|
+
const [references, setReferences] = React50.useState([]);
|
|
16044
|
+
const [isUploadingReferenceImages, setIsUploadingReferenceImages] = React50.useState(false);
|
|
16045
|
+
const [quoteSelection, setQuoteSelection] = React50.useState(null);
|
|
16046
|
+
const [isAtBottom, setIsAtBottom] = React50.useState(true);
|
|
16047
|
+
const [hasUpdatesBelow, setHasUpdatesBelow] = React50.useState(false);
|
|
15538
16048
|
const {
|
|
15539
16049
|
threads,
|
|
15540
16050
|
deleteThread,
|
|
15541
16051
|
refreshThreads,
|
|
15542
16052
|
isLoading: isThreadsLoading
|
|
15543
16053
|
} = useThreads();
|
|
15544
|
-
const viewportRef =
|
|
15545
|
-
const
|
|
15546
|
-
|
|
15547
|
-
|
|
15548
|
-
const
|
|
16054
|
+
const viewportRef = React50.useRef(null);
|
|
16055
|
+
const messageNavigationAnchorsRef = React50.useRef(
|
|
16056
|
+
/* @__PURE__ */ new Map()
|
|
16057
|
+
);
|
|
16058
|
+
const attachmentsRef = React50.useRef(null);
|
|
16059
|
+
const composerInputRef = React50.useRef(null);
|
|
16060
|
+
const slashPaletteRef = React50.useRef(null);
|
|
16061
|
+
const slashPaletteOptionRefs = React50.useRef(
|
|
15549
16062
|
[]
|
|
15550
16063
|
);
|
|
15551
|
-
const composerPartsRef =
|
|
15552
|
-
const pendingComposerCaretOffsetRef =
|
|
15553
|
-
const shouldAutoScrollRef =
|
|
15554
|
-
const forceFollowRef =
|
|
15555
|
-
const previousMessageCountRef =
|
|
15556
|
-
const previousScrollTopRef =
|
|
15557
|
-
const isPrependingHistoryMessagesRef =
|
|
15558
|
-
const autoScrollFrameRef =
|
|
15559
|
-
const isPointerDownRef =
|
|
15560
|
-
const lastTouchYRef =
|
|
15561
|
-
const runtimeCapabilityPreferenceLoadRef =
|
|
16064
|
+
const composerPartsRef = React50.useRef([]);
|
|
16065
|
+
const pendingComposerCaretOffsetRef = React50.useRef(null);
|
|
16066
|
+
const shouldAutoScrollRef = React50.useRef(true);
|
|
16067
|
+
const forceFollowRef = React50.useRef(false);
|
|
16068
|
+
const previousMessageCountRef = React50.useRef(0);
|
|
16069
|
+
const previousScrollTopRef = React50.useRef(0);
|
|
16070
|
+
const isPrependingHistoryMessagesRef = React50.useRef(false);
|
|
16071
|
+
const autoScrollFrameRef = React50.useRef(null);
|
|
16072
|
+
const isPointerDownRef = React50.useRef(false);
|
|
16073
|
+
const lastTouchYRef = React50.useRef(null);
|
|
16074
|
+
const runtimeCapabilityPreferenceLoadRef = React50.useRef(0);
|
|
15562
16075
|
const resolvedTitle = title ?? t("chat.title");
|
|
15563
16076
|
const resolvedPlaceholder = placeholder ?? t("chat.placeholder");
|
|
16077
|
+
const assistantTitle = assistantName || resolvedTitle;
|
|
15564
16078
|
const petRequired = options?.displayMode === "pet";
|
|
15565
|
-
const basePetSettings =
|
|
16079
|
+
const basePetSettings = React50.useMemo(
|
|
15566
16080
|
() => derivePetLocalSettings(options?.pet),
|
|
15567
16081
|
[options?.pet]
|
|
15568
16082
|
);
|
|
15569
|
-
const displayedPetSettings =
|
|
16083
|
+
const displayedPetSettings = React50.useMemo(
|
|
15570
16084
|
() => ({
|
|
15571
16085
|
...petLocalSettings ?? basePetSettings,
|
|
15572
16086
|
...petRequired ? { enabled: true } : {}
|
|
15573
16087
|
}),
|
|
15574
16088
|
[basePetSettings, petLocalSettings, petRequired]
|
|
15575
16089
|
);
|
|
15576
|
-
const effectivePet =
|
|
16090
|
+
const effectivePet = React50.useMemo(() => {
|
|
15577
16091
|
if (petRequired || petLocalSettings) {
|
|
15578
16092
|
return buildPetOptionsFromLocalSettings(displayedPetSettings);
|
|
15579
16093
|
}
|
|
15580
16094
|
return options?.pet ?? null;
|
|
15581
16095
|
}, [displayedPetSettings, options?.pet, petLocalSettings, petRequired]);
|
|
15582
|
-
const savePetLocalSettings =
|
|
16096
|
+
const savePetLocalSettings = React50.useCallback(
|
|
15583
16097
|
(settings) => {
|
|
15584
16098
|
const nextSettings = petRequired ? { ...settings, enabled: true } : settings;
|
|
15585
16099
|
setPetLocalSettings(nextSettings);
|
|
@@ -15587,7 +16101,7 @@ function Chat({
|
|
|
15587
16101
|
},
|
|
15588
16102
|
[petRequired]
|
|
15589
16103
|
);
|
|
15590
|
-
const handlePetCommand =
|
|
16104
|
+
const handlePetCommand = React50.useCallback(
|
|
15591
16105
|
(mode) => {
|
|
15592
16106
|
if (mode === "settings") {
|
|
15593
16107
|
setPetSettingsOpen(true);
|
|
@@ -15609,16 +16123,53 @@ function Chat({
|
|
|
15609
16123
|
[displayedPetSettings, effectivePet, petRequired, savePetLocalSettings]
|
|
15610
16124
|
);
|
|
15611
16125
|
const inputPlaceholder = selectedTool?.placeholderOverride ?? composer?.placeholder ?? resolvedPlaceholder;
|
|
15612
|
-
const messages =
|
|
16126
|
+
const messages = React50.useMemo(
|
|
15613
16127
|
() => stream.messages ?? [],
|
|
15614
16128
|
[stream.messages]
|
|
15615
16129
|
);
|
|
16130
|
+
const messageNavigationLabels = React50.useMemo(
|
|
16131
|
+
() => ({
|
|
16132
|
+
user: t("chat.youLabel"),
|
|
16133
|
+
assistant: assistantTitle,
|
|
16134
|
+
system: t("message.navigation.system"),
|
|
16135
|
+
tool: t("message.navigation.tool"),
|
|
16136
|
+
event: t("message.navigation.event"),
|
|
16137
|
+
message: t("message.navigation.message"),
|
|
16138
|
+
image: t("message.navigation.image"),
|
|
16139
|
+
memory: t("message.navigation.memory"),
|
|
16140
|
+
widget: t("message.navigation.widget"),
|
|
16141
|
+
mcpApp: t("message.navigation.mcpApp"),
|
|
16142
|
+
attachment: t("message.navigation.attachment"),
|
|
16143
|
+
reference: t("message.navigation.reference"),
|
|
16144
|
+
capability: t("message.navigation.capability"),
|
|
16145
|
+
reasoning: t("message.reasoning")
|
|
16146
|
+
}),
|
|
16147
|
+
[assistantTitle, t]
|
|
16148
|
+
);
|
|
16149
|
+
const messageNavigationItems = React50.useMemo(
|
|
16150
|
+
() => messageNavigationEnabled ? buildMessageNavigationItems(
|
|
16151
|
+
messages,
|
|
16152
|
+
{
|
|
16153
|
+
labels: messageNavigationLabels,
|
|
16154
|
+
language: i18n2.language,
|
|
16155
|
+
assistantTitle
|
|
16156
|
+
}
|
|
16157
|
+
) : [],
|
|
16158
|
+
[
|
|
16159
|
+
assistantTitle,
|
|
16160
|
+
i18n2.language,
|
|
16161
|
+
messageNavigationEnabled,
|
|
16162
|
+
messageNavigationLabels,
|
|
16163
|
+
messages
|
|
16164
|
+
]
|
|
16165
|
+
);
|
|
16166
|
+
const showMessageNavigation = messageNavigationItems.length >= MESSAGE_NAVIGATION_MIN_ITEMS;
|
|
15616
16167
|
const historyMessagePagination = stream.historyMessagePagination;
|
|
15617
16168
|
const isLoadingMoreMessages = Boolean(
|
|
15618
16169
|
historyMessagePagination?.isLoadingMore
|
|
15619
16170
|
);
|
|
15620
16171
|
const canLoadMoreMessages = Boolean(historyMessagePagination?.hasMore);
|
|
15621
|
-
const draft =
|
|
16172
|
+
const draft = React50.useMemo(
|
|
15622
16173
|
() => getComposerPlainText(composerParts),
|
|
15623
16174
|
[composerParts]
|
|
15624
16175
|
);
|
|
@@ -15632,7 +16183,7 @@ function Chat({
|
|
|
15632
16183
|
isEmpty: isComposerInputEmpty,
|
|
15633
16184
|
isStacked: isComposerStacked
|
|
15634
16185
|
});
|
|
15635
|
-
const pendingFollowUps =
|
|
16186
|
+
const pendingFollowUps = React50.useMemo(
|
|
15636
16187
|
() => sortVisiblePendingFollowUps(stream.pendingFollowUps ?? []),
|
|
15637
16188
|
[stream.pendingFollowUps]
|
|
15638
16189
|
);
|
|
@@ -15641,21 +16192,18 @@ function Chat({
|
|
|
15641
16192
|
const hasPendingHITLRequest = Boolean(stream.pendingHITLRequest);
|
|
15642
16193
|
const hasPendingInteractiveRequest = hasPendingRequestUserInput || hasPendingHITLRequest;
|
|
15643
16194
|
const hasPendingTodos = Boolean(stream.todos?.items.length);
|
|
15644
|
-
const runtimeCapabilityOptions =
|
|
16195
|
+
const runtimeCapabilityOptions = React50.useMemo(
|
|
15645
16196
|
() => getRuntimeCapabilityOptions(runtimeCapabilities),
|
|
15646
16197
|
[runtimeCapabilities]
|
|
15647
16198
|
);
|
|
15648
|
-
const goalAdapter =
|
|
15649
|
-
()
|
|
15650
|
-
|
|
15651
|
-
|
|
15652
|
-
|
|
15653
|
-
|
|
15654
|
-
},
|
|
15655
|
-
[options?.goal, stream.client]
|
|
15656
|
-
);
|
|
16199
|
+
const goalAdapter = React50.useMemo(() => {
|
|
16200
|
+
if (isGoalAdapter(options?.goal)) {
|
|
16201
|
+
return options.goal;
|
|
16202
|
+
}
|
|
16203
|
+
return supportsXpertThreadGoalAdapter(stream.client) ? createXpertThreadGoalAdapter(stream.client) : null;
|
|
16204
|
+
}, [options?.goal, stream.client]);
|
|
15657
16205
|
const displayedGoalElapsedSeconds = threadGoal ? (threadGoal.elapsedSeconds ?? 0) + (goalElapsedStartedAt ? Math.max(0, Math.floor((streamingNow - goalElapsedStartedAt) / 1e3)) : 0) : 0;
|
|
15658
|
-
const effectiveSessionRuntimeCapabilities =
|
|
16206
|
+
const effectiveSessionRuntimeCapabilities = React50.useMemo(
|
|
15659
16207
|
() => runtimeCapabilitiesReady && runtimeCapabilities ? mergeRuntimeCapabilitiesSelections(
|
|
15660
16208
|
runtimeCapabilities,
|
|
15661
16209
|
sessionRuntimeCapabilities
|
|
@@ -15668,7 +16216,7 @@ function Chat({
|
|
|
15668
16216
|
"goal"
|
|
15669
16217
|
);
|
|
15670
16218
|
const showGoalStatus = goalCommandAvailable && !hasCompletedGoal && (Boolean(goalError) || threadGoal?.status === "active" && stream.isLoading);
|
|
15671
|
-
const runRuntimeCapabilityOptions =
|
|
16219
|
+
const runRuntimeCapabilityOptions = React50.useMemo(
|
|
15672
16220
|
() => runtimeCapabilityOptions.filter(
|
|
15673
16221
|
(option) => isRuntimeCapabilitySelected(
|
|
15674
16222
|
runRuntimeCapabilities,
|
|
@@ -15678,11 +16226,11 @@ function Chat({
|
|
|
15678
16226
|
),
|
|
15679
16227
|
[runRuntimeCapabilities, runtimeCapabilityOptions]
|
|
15680
16228
|
);
|
|
15681
|
-
const composerRuntimeCapabilitySelectionKeys =
|
|
16229
|
+
const composerRuntimeCapabilitySelectionKeys = React50.useMemo(
|
|
15682
16230
|
() => getComposerCapabilitySelectionKeys(composerParts),
|
|
15683
16231
|
[composerParts]
|
|
15684
16232
|
);
|
|
15685
|
-
const detachedRunRuntimeCapabilityOptions =
|
|
16233
|
+
const detachedRunRuntimeCapabilityOptions = React50.useMemo(
|
|
15686
16234
|
() => runRuntimeCapabilityOptions.filter(
|
|
15687
16235
|
(option) => !composerRuntimeCapabilitySelectionKeys.has(
|
|
15688
16236
|
getRuntimeCapabilityOptionKey(option)
|
|
@@ -15690,7 +16238,7 @@ function Chat({
|
|
|
15690
16238
|
),
|
|
15691
16239
|
[composerRuntimeCapabilitySelectionKeys, runRuntimeCapabilityOptions]
|
|
15692
16240
|
);
|
|
15693
|
-
const persistSessionRuntimeCapabilities =
|
|
16241
|
+
const persistSessionRuntimeCapabilities = React50.useCallback(
|
|
15694
16242
|
async (threadId, selection) => {
|
|
15695
16243
|
if (!runtimeCapabilities || !selection) {
|
|
15696
16244
|
return;
|
|
@@ -15715,10 +16263,10 @@ function Chat({
|
|
|
15715
16263
|
},
|
|
15716
16264
|
[runtimeCapabilities, stream.client]
|
|
15717
16265
|
);
|
|
15718
|
-
const clearQuoteSelection =
|
|
16266
|
+
const clearQuoteSelection = React50.useCallback(() => {
|
|
15719
16267
|
setQuoteSelection(null);
|
|
15720
16268
|
}, []);
|
|
15721
|
-
const commitComposerParts =
|
|
16269
|
+
const commitComposerParts = React50.useCallback(
|
|
15722
16270
|
(nextParts, options2) => {
|
|
15723
16271
|
const normalized = normalizeComposerParts(nextParts);
|
|
15724
16272
|
const previous = composerPartsRef.current;
|
|
@@ -15754,7 +16302,7 @@ function Chat({
|
|
|
15754
16302
|
},
|
|
15755
16303
|
[]
|
|
15756
16304
|
);
|
|
15757
|
-
const setComposerText =
|
|
16305
|
+
const setComposerText = React50.useCallback(
|
|
15758
16306
|
(text, caretOffset = text.length) => {
|
|
15759
16307
|
commitComposerParts(createComposerTextParts(text), {
|
|
15760
16308
|
caretOffset,
|
|
@@ -15764,7 +16312,7 @@ function Chat({
|
|
|
15764
16312
|
},
|
|
15765
16313
|
[commitComposerParts]
|
|
15766
16314
|
);
|
|
15767
|
-
const focusComposerAt =
|
|
16315
|
+
const focusComposerAt = React50.useCallback((position) => {
|
|
15768
16316
|
const nextPosition = position ?? getComposerEditingLength(composerPartsRef.current);
|
|
15769
16317
|
pendingComposerCaretOffsetRef.current = nextPosition;
|
|
15770
16318
|
requestAnimationFrame(() => {
|
|
@@ -15776,7 +16324,7 @@ function Chat({
|
|
|
15776
16324
|
});
|
|
15777
16325
|
}, []);
|
|
15778
16326
|
const parentMessenger = useParentMessenger({
|
|
15779
|
-
onSetComposerValue:
|
|
16327
|
+
onSetComposerValue: React50.useCallback(
|
|
15780
16328
|
(payload) => {
|
|
15781
16329
|
if (!payload) {
|
|
15782
16330
|
return;
|
|
@@ -15799,10 +16347,10 @@ function Chat({
|
|
|
15799
16347
|
},
|
|
15800
16348
|
[composer?.tools, setComposerText]
|
|
15801
16349
|
),
|
|
15802
|
-
onFocusComposer:
|
|
16350
|
+
onFocusComposer: React50.useCallback(() => {
|
|
15803
16351
|
composerInputRef.current?.focus();
|
|
15804
16352
|
}, []),
|
|
15805
|
-
onSetPetEnabled:
|
|
16353
|
+
onSetPetEnabled: React50.useCallback(
|
|
15806
16354
|
(enabled) => {
|
|
15807
16355
|
if (petRequired) {
|
|
15808
16356
|
return;
|
|
@@ -15816,10 +16364,10 @@ function Chat({
|
|
|
15816
16364
|
)
|
|
15817
16365
|
});
|
|
15818
16366
|
const canMinimizeToPet = parentMessenger?.isParentAvailable === true && isPetEnabled(effectivePet);
|
|
15819
|
-
const handleMinimizeToPet =
|
|
16367
|
+
const handleMinimizeToPet = React50.useCallback(() => {
|
|
15820
16368
|
parentMessenger?.sendEvent("chat_minimize_change", { minimized: true });
|
|
15821
16369
|
}, [parentMessenger]);
|
|
15822
|
-
const syncQuoteSelection =
|
|
16370
|
+
const syncQuoteSelection = React50.useCallback(() => {
|
|
15823
16371
|
if (typeof window === "undefined") {
|
|
15824
16372
|
clearQuoteSelection();
|
|
15825
16373
|
return;
|
|
@@ -15864,23 +16412,23 @@ function Chat({
|
|
|
15864
16412
|
left
|
|
15865
16413
|
});
|
|
15866
16414
|
}, [clearQuoteSelection]);
|
|
15867
|
-
const cancelPendingAutoScroll =
|
|
16415
|
+
const cancelPendingAutoScroll = React50.useCallback(() => {
|
|
15868
16416
|
if (autoScrollFrameRef.current !== null) {
|
|
15869
16417
|
cancelAnimationFrame(autoScrollFrameRef.current);
|
|
15870
16418
|
autoScrollFrameRef.current = null;
|
|
15871
16419
|
}
|
|
15872
16420
|
}, []);
|
|
15873
|
-
const disableAutoFollow =
|
|
16421
|
+
const disableAutoFollow = React50.useCallback(() => {
|
|
15874
16422
|
forceFollowRef.current = false;
|
|
15875
16423
|
shouldAutoScrollRef.current = false;
|
|
15876
16424
|
cancelPendingAutoScroll();
|
|
15877
16425
|
}, [cancelPendingAutoScroll]);
|
|
15878
|
-
const enableAutoFollow =
|
|
16426
|
+
const enableAutoFollow = React50.useCallback(() => {
|
|
15879
16427
|
forceFollowRef.current = true;
|
|
15880
16428
|
shouldAutoScrollRef.current = true;
|
|
15881
16429
|
setHasUpdatesBelow(false);
|
|
15882
16430
|
}, []);
|
|
15883
|
-
const scrollToBottom =
|
|
16431
|
+
const scrollToBottom = React50.useCallback(
|
|
15884
16432
|
(smooth = false, force = false) => {
|
|
15885
16433
|
if (force) {
|
|
15886
16434
|
enableAutoFollow();
|
|
@@ -15907,7 +16455,25 @@ function Chat({
|
|
|
15907
16455
|
},
|
|
15908
16456
|
[cancelPendingAutoScroll, enableAutoFollow]
|
|
15909
16457
|
);
|
|
15910
|
-
|
|
16458
|
+
const setMessageNavigationAnchor = React50.useCallback(
|
|
16459
|
+
(id, node) => {
|
|
16460
|
+
if (node) {
|
|
16461
|
+
messageNavigationAnchorsRef.current.set(id, node);
|
|
16462
|
+
return;
|
|
16463
|
+
}
|
|
16464
|
+
messageNavigationAnchorsRef.current.delete(id);
|
|
16465
|
+
},
|
|
16466
|
+
[]
|
|
16467
|
+
);
|
|
16468
|
+
const getMessageNavigationAnchor = React50.useCallback(
|
|
16469
|
+
(item) => messageNavigationAnchorsRef.current.get(item.id) ?? null,
|
|
16470
|
+
[]
|
|
16471
|
+
);
|
|
16472
|
+
const handleMessageNavigationNavigate = React50.useCallback(() => {
|
|
16473
|
+
disableAutoFollow();
|
|
16474
|
+
clearQuoteSelection();
|
|
16475
|
+
}, [clearQuoteSelection, disableAutoFollow]);
|
|
16476
|
+
React50.useEffect(() => {
|
|
15911
16477
|
const viewport = viewportRef.current;
|
|
15912
16478
|
if (!viewport) return;
|
|
15913
16479
|
previousScrollTopRef.current = viewport.scrollTop;
|
|
@@ -15988,14 +16554,14 @@ function Chat({
|
|
|
15988
16554
|
window.removeEventListener("pointercancel", stopPointerTracking);
|
|
15989
16555
|
};
|
|
15990
16556
|
}, [cancelPendingAutoScroll, disableAutoFollow]);
|
|
15991
|
-
|
|
16557
|
+
React50.useEffect(() => {
|
|
15992
16558
|
shouldAutoScrollRef.current = true;
|
|
15993
16559
|
forceFollowRef.current = false;
|
|
15994
16560
|
previousScrollTopRef.current = 0;
|
|
15995
16561
|
setIsAtBottom(true);
|
|
15996
16562
|
setHasUpdatesBelow(false);
|
|
15997
16563
|
}, [stream.threadId]);
|
|
15998
|
-
|
|
16564
|
+
React50.useEffect(() => {
|
|
15999
16565
|
const messageCountChanged = messages.length !== previousMessageCountRef.current;
|
|
16000
16566
|
previousMessageCountRef.current = messages.length;
|
|
16001
16567
|
if (isPrependingHistoryMessagesRef.current) {
|
|
@@ -16018,7 +16584,7 @@ function Chat({
|
|
|
16018
16584
|
clientSecret: effectiveClientSecret
|
|
16019
16585
|
});
|
|
16020
16586
|
const missingConfig = Boolean(missingConfigKind);
|
|
16021
|
-
const missingConfigShortMessage =
|
|
16587
|
+
const missingConfigShortMessage = React50.useMemo(() => {
|
|
16022
16588
|
switch (missingConfigKind) {
|
|
16023
16589
|
case "apiUrl":
|
|
16024
16590
|
return t("chat.missingApiUrlShort");
|
|
@@ -16030,7 +16596,7 @@ function Chat({
|
|
|
16030
16596
|
return t("chat.missingConfigShort");
|
|
16031
16597
|
}
|
|
16032
16598
|
}, [missingConfigKind, t]);
|
|
16033
|
-
const missingConfigDetailMessage =
|
|
16599
|
+
const missingConfigDetailMessage = React50.useMemo(() => {
|
|
16034
16600
|
switch (missingConfigKind) {
|
|
16035
16601
|
case "apiUrl":
|
|
16036
16602
|
return t("chat.missingApiUrlDetail");
|
|
@@ -16047,7 +16613,7 @@ function Chat({
|
|
|
16047
16613
|
const isSubmissionBlocked = hasPendingInteractiveRequest || missingConfig || isHistoryLoading || hasUploadingFiles || isUploadingReferenceImages;
|
|
16048
16614
|
const isSendDisabled = !trimmedDraft && !hasReferences || isSubmissionBlocked;
|
|
16049
16615
|
const isPromptEditDisabled = hasPendingInteractiveRequest || missingConfig || isHistoryLoading;
|
|
16050
|
-
const resizeComposerInput =
|
|
16616
|
+
const resizeComposerInput = React50.useCallback(() => {
|
|
16051
16617
|
const input = composerInputRef.current;
|
|
16052
16618
|
if (!input) {
|
|
16053
16619
|
return;
|
|
@@ -16055,7 +16621,7 @@ function Chat({
|
|
|
16055
16621
|
input.style.maxHeight = `${COMPOSER_INPUT_MAX_HEIGHT}px`;
|
|
16056
16622
|
input.style.overflowY = input.scrollHeight > COMPOSER_INPUT_MAX_HEIGHT ? "auto" : "hidden";
|
|
16057
16623
|
}, []);
|
|
16058
|
-
|
|
16624
|
+
React50.useLayoutEffect(() => {
|
|
16059
16625
|
composerPartsRef.current = composerParts;
|
|
16060
16626
|
resizeComposerInput();
|
|
16061
16627
|
const caretOffset = pendingComposerCaretOffsetRef.current;
|
|
@@ -16067,13 +16633,13 @@ function Chat({
|
|
|
16067
16633
|
}
|
|
16068
16634
|
}
|
|
16069
16635
|
}, [composerDomVersion, composerParts, resizeComposerInput]);
|
|
16070
|
-
|
|
16636
|
+
React50.useEffect(() => {
|
|
16071
16637
|
document.addEventListener("selectionchange", syncQuoteSelection);
|
|
16072
16638
|
return () => {
|
|
16073
16639
|
document.removeEventListener("selectionchange", syncQuoteSelection);
|
|
16074
16640
|
};
|
|
16075
16641
|
}, [syncQuoteSelection]);
|
|
16076
|
-
|
|
16642
|
+
React50.useEffect(() => {
|
|
16077
16643
|
const viewport = viewportRef.current;
|
|
16078
16644
|
if (!viewport) {
|
|
16079
16645
|
return;
|
|
@@ -16090,14 +16656,14 @@ function Chat({
|
|
|
16090
16656
|
window.removeEventListener("resize", handleViewportScroll);
|
|
16091
16657
|
};
|
|
16092
16658
|
}, [clearQuoteSelection]);
|
|
16093
|
-
|
|
16659
|
+
React50.useEffect(() => {
|
|
16094
16660
|
clearQuoteSelection();
|
|
16095
16661
|
}, [messages.length, stream.threadId, clearQuoteSelection]);
|
|
16096
|
-
|
|
16662
|
+
React50.useEffect(() => {
|
|
16097
16663
|
if (missingConfig) return;
|
|
16098
16664
|
void refreshThreads();
|
|
16099
16665
|
}, [missingConfig, refreshThreads]);
|
|
16100
|
-
|
|
16666
|
+
React50.useEffect(() => {
|
|
16101
16667
|
if (missingConfig || !stream.client || !stream.assistantId) {
|
|
16102
16668
|
setAssistantName(null);
|
|
16103
16669
|
setAssistantAvatar(null);
|
|
@@ -16120,7 +16686,7 @@ function Chat({
|
|
|
16120
16686
|
cancelled = true;
|
|
16121
16687
|
};
|
|
16122
16688
|
}, [missingConfig, stream.client, stream.assistantId]);
|
|
16123
|
-
|
|
16689
|
+
React50.useEffect(() => {
|
|
16124
16690
|
if (missingConfig || !stream.client || !stream.assistantId) {
|
|
16125
16691
|
setRuntimeCapabilities(null);
|
|
16126
16692
|
setRuntimeCapabilitiesReady(false);
|
|
@@ -16167,7 +16733,7 @@ function Chat({
|
|
|
16167
16733
|
});
|
|
16168
16734
|
return () => controller.abort();
|
|
16169
16735
|
}, [missingConfig, stream.client, stream.assistantId]);
|
|
16170
|
-
|
|
16736
|
+
React50.useEffect(() => {
|
|
16171
16737
|
setRunRuntimeCapabilities(
|
|
16172
16738
|
createEmptyRuntimeCapabilitiesSelection(runtimeCapabilities)
|
|
16173
16739
|
);
|
|
@@ -16216,10 +16782,10 @@ function Chat({
|
|
|
16216
16782
|
stream.client,
|
|
16217
16783
|
stream.threadId
|
|
16218
16784
|
]);
|
|
16219
|
-
|
|
16785
|
+
React50.useEffect(() => {
|
|
16220
16786
|
setThreadGoal(stream.threadGoal);
|
|
16221
16787
|
}, [stream.threadGoal]);
|
|
16222
|
-
|
|
16788
|
+
React50.useEffect(() => {
|
|
16223
16789
|
const threadId = stream.threadId?.trim();
|
|
16224
16790
|
if (!threadId || !goalCommandAvailable) {
|
|
16225
16791
|
setThreadGoal(null);
|
|
@@ -16260,7 +16826,7 @@ function Chat({
|
|
|
16260
16826
|
return () => controller.abort();
|
|
16261
16827
|
}, [goalAdapter, goalCommandAvailable, stream.threadId]);
|
|
16262
16828
|
const uploadedFiles = attachmentState.uploadedFiles;
|
|
16263
|
-
const handleSessionRuntimeCapabilityToggle =
|
|
16829
|
+
const handleSessionRuntimeCapabilityToggle = React50.useCallback(
|
|
16264
16830
|
(type, id, selected) => {
|
|
16265
16831
|
setSessionRuntimeCapabilities((previous) => {
|
|
16266
16832
|
const nextSelection = toggleRuntimeCapabilitySelection(
|
|
@@ -16278,7 +16844,7 @@ function Chat({
|
|
|
16278
16844
|
},
|
|
16279
16845
|
[persistSessionRuntimeCapabilities, stream.threadId]
|
|
16280
16846
|
);
|
|
16281
|
-
const updateRuntimeCapabilityPalette =
|
|
16847
|
+
const updateRuntimeCapabilityPalette = React50.useCallback(
|
|
16282
16848
|
(parts, selectionStart) => {
|
|
16283
16849
|
const input = composerInputRef.current;
|
|
16284
16850
|
const editingText = getComposerEditingText(parts);
|
|
@@ -16290,7 +16856,7 @@ function Chat({
|
|
|
16290
16856
|
},
|
|
16291
16857
|
[]
|
|
16292
16858
|
);
|
|
16293
|
-
const syncComposerInputFromElement =
|
|
16859
|
+
const syncComposerInputFromElement = React50.useCallback(
|
|
16294
16860
|
(input) => {
|
|
16295
16861
|
const previousCapabilities = getComposerCapabilityPartMap(
|
|
16296
16862
|
composerPartsRef.current
|
|
@@ -16308,25 +16874,25 @@ function Chat({
|
|
|
16308
16874
|
},
|
|
16309
16875
|
[commitComposerParts, updateRuntimeCapabilityPalette]
|
|
16310
16876
|
);
|
|
16311
|
-
const handleComposerInput =
|
|
16877
|
+
const handleComposerInput = React50.useCallback(
|
|
16312
16878
|
(event) => {
|
|
16313
16879
|
syncComposerInputFromElement(event.currentTarget);
|
|
16314
16880
|
},
|
|
16315
16881
|
[syncComposerInputFromElement]
|
|
16316
16882
|
);
|
|
16317
|
-
const handleComposerCompositionEnd =
|
|
16883
|
+
const handleComposerCompositionEnd = React50.useCallback(
|
|
16318
16884
|
(event) => {
|
|
16319
16885
|
syncComposerInputFromElement(event.currentTarget);
|
|
16320
16886
|
},
|
|
16321
16887
|
[syncComposerInputFromElement]
|
|
16322
16888
|
);
|
|
16323
|
-
const handleComposerSelect =
|
|
16889
|
+
const handleComposerSelect = React50.useCallback(() => {
|
|
16324
16890
|
updateRuntimeCapabilityPalette(
|
|
16325
16891
|
composerPartsRef.current,
|
|
16326
16892
|
composerInputRef.current ? getComposerSelectionOffset(composerInputRef.current) : void 0
|
|
16327
16893
|
);
|
|
16328
16894
|
}, [updateRuntimeCapabilityPalette]);
|
|
16329
|
-
const removeRunRuntimeCapability =
|
|
16895
|
+
const removeRunRuntimeCapability = React50.useCallback(
|
|
16330
16896
|
(option) => {
|
|
16331
16897
|
setRunRuntimeCapabilities(
|
|
16332
16898
|
(previous) => toggleRuntimeCapabilitySelection(
|
|
@@ -16346,7 +16912,7 @@ function Chat({
|
|
|
16346
16912
|
},
|
|
16347
16913
|
[commitComposerParts]
|
|
16348
16914
|
);
|
|
16349
|
-
const submitDraft =
|
|
16915
|
+
const submitDraft = React50.useCallback(
|
|
16350
16916
|
(submitOptions = {}) => {
|
|
16351
16917
|
if (isSubmissionBlocked) return;
|
|
16352
16918
|
const contentToSubmit = (submitOptions.inputText ?? trimmedDraft).trim();
|
|
@@ -16469,7 +17035,7 @@ function Chat({
|
|
|
16469
17035
|
t
|
|
16470
17036
|
]
|
|
16471
17037
|
);
|
|
16472
|
-
const handleGoalCommand =
|
|
17038
|
+
const handleGoalCommand = React50.useCallback(
|
|
16473
17039
|
async ({
|
|
16474
17040
|
args,
|
|
16475
17041
|
commandSource,
|
|
@@ -16581,13 +17147,10 @@ function Chat({
|
|
|
16581
17147
|
t
|
|
16582
17148
|
]
|
|
16583
17149
|
);
|
|
16584
|
-
const handleGoalPanelOpenChange =
|
|
16585
|
-
(open)
|
|
16586
|
-
|
|
16587
|
-
|
|
16588
|
-
[]
|
|
16589
|
-
);
|
|
16590
|
-
const addRunRuntimeCapabilities = React49.useCallback(
|
|
17150
|
+
const handleGoalPanelOpenChange = React50.useCallback((open) => {
|
|
17151
|
+
setIsGoalPanelOpen(open);
|
|
17152
|
+
}, []);
|
|
17153
|
+
const addRunRuntimeCapabilities = React50.useCallback(
|
|
16591
17154
|
(selection) => {
|
|
16592
17155
|
setRunRuntimeCapabilities(
|
|
16593
17156
|
(previous) => runtimeCapabilities ? mergeRuntimeCapabilitiesSelections(
|
|
@@ -16599,7 +17162,7 @@ function Chat({
|
|
|
16599
17162
|
},
|
|
16600
17163
|
[runtimeCapabilities]
|
|
16601
17164
|
);
|
|
16602
|
-
const insertComposerCapabilityToken =
|
|
17165
|
+
const insertComposerCapabilityToken = React50.useCallback(
|
|
16603
17166
|
(capability, range) => {
|
|
16604
17167
|
const token = createComposerCapabilityPart(capability, createMessageId());
|
|
16605
17168
|
const currentParts = composerPartsRef.current;
|
|
@@ -16672,7 +17235,7 @@ function Chat({
|
|
|
16672
17235
|
plugin: t("composer.slashCommands.empty.loadingCapabilities"),
|
|
16673
17236
|
subAgent: t("composer.slashCommands.empty.loadingCapabilities")
|
|
16674
17237
|
};
|
|
16675
|
-
|
|
17238
|
+
React50.useEffect(() => {
|
|
16676
17239
|
if (!runtimeCapabilityPalette) {
|
|
16677
17240
|
return;
|
|
16678
17241
|
}
|
|
@@ -16691,7 +17254,7 @@ function Chat({
|
|
|
16691
17254
|
);
|
|
16692
17255
|
}
|
|
16693
17256
|
}, [slashPaletteOptions.length, runtimeCapabilityPalette]);
|
|
16694
|
-
|
|
17257
|
+
React50.useLayoutEffect(() => {
|
|
16695
17258
|
if (!runtimeCapabilityPalette) {
|
|
16696
17259
|
return;
|
|
16697
17260
|
}
|
|
@@ -16708,7 +17271,7 @@ function Chat({
|
|
|
16708
17271
|
container.scrollTop += optionRect.bottom - containerRect.bottom;
|
|
16709
17272
|
}
|
|
16710
17273
|
}, [runtimeCapabilityPalette, slashPaletteOptions.length]);
|
|
16711
|
-
const submitGoalModeDraft =
|
|
17274
|
+
const submitGoalModeDraft = React50.useCallback(() => {
|
|
16712
17275
|
const objective = getComposerPlainText(composerPartsRef.current).trim();
|
|
16713
17276
|
if (!isGoalModeOpen || !goalCommandAvailable || !objective) {
|
|
16714
17277
|
return false;
|
|
@@ -16746,7 +17309,7 @@ function Chat({
|
|
|
16746
17309
|
}
|
|
16747
17310
|
submitDraft();
|
|
16748
17311
|
};
|
|
16749
|
-
const handleEditPendingFollowUp =
|
|
17312
|
+
const handleEditPendingFollowUp = React50.useCallback(
|
|
16750
17313
|
(id) => {
|
|
16751
17314
|
const item = pendingFollowUps.find(
|
|
16752
17315
|
(entry) => entry.id === id && entry.mode === "queue"
|
|
@@ -16773,7 +17336,7 @@ function Chat({
|
|
|
16773
17336
|
},
|
|
16774
17337
|
[pendingFollowUps, setComposerText, stream]
|
|
16775
17338
|
);
|
|
16776
|
-
const handleQuoteSelection =
|
|
17339
|
+
const handleQuoteSelection = React50.useCallback(() => {
|
|
16777
17340
|
if (!quoteSelection) {
|
|
16778
17341
|
return;
|
|
16779
17342
|
}
|
|
@@ -16789,7 +17352,7 @@ function Chat({
|
|
|
16789
17352
|
const handleAttachmentClick = () => {
|
|
16790
17353
|
attachmentsRef.current?.openFilePicker();
|
|
16791
17354
|
};
|
|
16792
|
-
const uploadContextFile =
|
|
17355
|
+
const uploadContextFile = React50.useCallback(
|
|
16793
17356
|
(file) => {
|
|
16794
17357
|
const formData = new FormData();
|
|
16795
17358
|
formData.append("file", file, file.name || "upload");
|
|
@@ -16808,13 +17371,13 @@ function Chat({
|
|
|
16808
17371
|
},
|
|
16809
17372
|
[stream.assistantId, stream.client, stream.threadId]
|
|
16810
17373
|
);
|
|
16811
|
-
const getContextFileStatus =
|
|
17374
|
+
const getContextFileStatus = React50.useCallback(
|
|
16812
17375
|
(fileId) => stream.client.contexts.fetch(`/files/${fileId}/status`, {
|
|
16813
17376
|
method: "GET"
|
|
16814
17377
|
}),
|
|
16815
17378
|
[stream.client]
|
|
16816
17379
|
);
|
|
16817
|
-
const deleteContextFile =
|
|
17380
|
+
const deleteContextFile = React50.useCallback(
|
|
16818
17381
|
(storageFileId) => stream.client.contexts.deleteFile(storageFileId),
|
|
16819
17382
|
[stream.client]
|
|
16820
17383
|
);
|
|
@@ -16922,7 +17485,7 @@ function Chat({
|
|
|
16922
17485
|
}
|
|
16923
17486
|
submitDraft();
|
|
16924
17487
|
};
|
|
16925
|
-
const handleComposerPaste =
|
|
17488
|
+
const handleComposerPaste = React50.useCallback(
|
|
16926
17489
|
(event) => {
|
|
16927
17490
|
const clipboardData = event.clipboardData;
|
|
16928
17491
|
if (!clipboardData) {
|
|
@@ -17024,13 +17587,13 @@ function Chat({
|
|
|
17024
17587
|
const handleToolSelect = (tool) => {
|
|
17025
17588
|
setSelectedTool((prev) => prev?.id === tool.id ? null : tool);
|
|
17026
17589
|
};
|
|
17027
|
-
const handlePromptClick =
|
|
17590
|
+
const handlePromptClick = React50.useCallback(
|
|
17028
17591
|
(prompt) => {
|
|
17029
17592
|
submitDraft({ inputText: prompt, displayText: prompt });
|
|
17030
17593
|
},
|
|
17031
17594
|
[submitDraft]
|
|
17032
17595
|
);
|
|
17033
|
-
const handlePromptEdit =
|
|
17596
|
+
const handlePromptEdit = React50.useCallback(
|
|
17034
17597
|
(prompt) => {
|
|
17035
17598
|
if (isPromptEditDisabled) return;
|
|
17036
17599
|
setComposerText(prompt, prompt.length);
|
|
@@ -17039,7 +17602,7 @@ function Chat({
|
|
|
17039
17602
|
},
|
|
17040
17603
|
[focusComposerAt, isPromptEditDisabled, setComposerText]
|
|
17041
17604
|
);
|
|
17042
|
-
const loadConversationMessages =
|
|
17605
|
+
const loadConversationMessages = React50.useCallback(
|
|
17043
17606
|
async (recordId) => {
|
|
17044
17607
|
if (missingConfig) {
|
|
17045
17608
|
setHistoryError(missingConfigShortMessage);
|
|
@@ -17060,7 +17623,7 @@ function Chat({
|
|
|
17060
17623
|
},
|
|
17061
17624
|
[missingConfig, missingConfigShortMessage, stream, t]
|
|
17062
17625
|
);
|
|
17063
|
-
const handleLoadMoreMessages =
|
|
17626
|
+
const handleLoadMoreMessages = React50.useCallback(async () => {
|
|
17064
17627
|
if (!canLoadMoreMessages || isLoadingMoreMessages) {
|
|
17065
17628
|
return;
|
|
17066
17629
|
}
|
|
@@ -17169,15 +17732,15 @@ function Chat({
|
|
|
17169
17732
|
};
|
|
17170
17733
|
const acceptMimes = composer?.attachments?.accept ? Object.entries(composer.attachments.accept).map(([mime, exts]) => [mime, ...exts.map((e) => `.${e}`)].join(",")).join(",") : void 0;
|
|
17171
17734
|
const canUploadDroppedFiles = composer?.attachments?.enabled === true && !missingConfig && !isHistoryLoading && !hasPendingInteractiveRequest;
|
|
17172
|
-
const handleDroppedFiles =
|
|
17735
|
+
const handleDroppedFiles = React50.useCallback((files) => {
|
|
17173
17736
|
return attachmentsRef.current?.queueFiles(files) ?? false;
|
|
17174
17737
|
}, []);
|
|
17175
|
-
const currentThread =
|
|
17738
|
+
const currentThread = React50.useMemo(
|
|
17176
17739
|
() => threads.find((item) => item.id === stream.threadId),
|
|
17177
17740
|
[threads, stream.threadId]
|
|
17178
17741
|
);
|
|
17179
17742
|
const streamErrorMessage = stream.error instanceof Error ? stream.error.message : void 0;
|
|
17180
|
-
const threadErrorMessage =
|
|
17743
|
+
const threadErrorMessage = React50.useMemo(() => {
|
|
17181
17744
|
if (streamErrorMessage?.trim()) return streamErrorMessage.trim();
|
|
17182
17745
|
if (currentThread?.status !== "error") return void 0;
|
|
17183
17746
|
const message = currentThread.error?.trim();
|
|
@@ -17207,15 +17770,14 @@ function Chat({
|
|
|
17207
17770
|
historyMessageLoadVersion: stream.historyMessageLoadVersion ?? 0,
|
|
17208
17771
|
fallbackTitle: t("history.threadFallback")
|
|
17209
17772
|
});
|
|
17210
|
-
const assistantTitle = assistantName || resolvedTitle;
|
|
17211
17773
|
const layoutMaxWidth = options?.layout?.maxWidth;
|
|
17212
|
-
const chatColumnStyle =
|
|
17774
|
+
const chatColumnStyle = React50.useMemo(() => {
|
|
17213
17775
|
if (layoutMaxWidth === void 0 || layoutMaxWidth === null || layoutMaxWidth === "") {
|
|
17214
17776
|
return void 0;
|
|
17215
17777
|
}
|
|
17216
17778
|
return { maxWidth: layoutMaxWidth };
|
|
17217
17779
|
}, [layoutMaxWidth]);
|
|
17218
|
-
return /* @__PURE__ */
|
|
17780
|
+
return /* @__PURE__ */ jsxs38(
|
|
17219
17781
|
UploadDroppedFiles,
|
|
17220
17782
|
{
|
|
17221
17783
|
ref: viewportRef,
|
|
@@ -17230,16 +17792,16 @@ function Chat({
|
|
|
17230
17792
|
className
|
|
17231
17793
|
),
|
|
17232
17794
|
children: [
|
|
17233
|
-
/* @__PURE__ */
|
|
17795
|
+
/* @__PURE__ */ jsxs38(
|
|
17234
17796
|
"div",
|
|
17235
17797
|
{
|
|
17236
17798
|
"data-slot": "chatkit-chat-header",
|
|
17237
17799
|
className: "mx-auto flex w-full items-center justify-between border-b p-2 sticky top-0 z-10 bg-background",
|
|
17238
17800
|
style: chatColumnStyle,
|
|
17239
17801
|
children: [
|
|
17240
|
-
/* @__PURE__ */
|
|
17241
|
-
/* @__PURE__ */
|
|
17242
|
-
/* @__PURE__ */
|
|
17802
|
+
/* @__PURE__ */ jsxs38("div", { className: "flex items-center gap-3 overflow-hidden", children: [
|
|
17803
|
+
/* @__PURE__ */ jsxs38("div", { className: "relative shrink-0", children: [
|
|
17804
|
+
/* @__PURE__ */ jsx55(
|
|
17243
17805
|
ChatkitAvatar,
|
|
17244
17806
|
{
|
|
17245
17807
|
avatar: assistantAvatar,
|
|
@@ -17247,10 +17809,10 @@ function Chat({
|
|
|
17247
17809
|
label: assistantTitle
|
|
17248
17810
|
}
|
|
17249
17811
|
),
|
|
17250
|
-
/* @__PURE__ */
|
|
17812
|
+
/* @__PURE__ */ jsx55("span", { className: "absolute bottom-0 right-0 h-2.5 w-2.5 rounded-full border-2 border-background bg-green-500" })
|
|
17251
17813
|
] }),
|
|
17252
|
-
/* @__PURE__ */
|
|
17253
|
-
/* @__PURE__ */
|
|
17814
|
+
/* @__PURE__ */ jsxs38("div", { className: "truncate", children: [
|
|
17815
|
+
/* @__PURE__ */ jsx55(
|
|
17254
17816
|
"h2",
|
|
17255
17817
|
{
|
|
17256
17818
|
className: "text-lg font-semibold truncate",
|
|
@@ -17258,12 +17820,12 @@ function Chat({
|
|
|
17258
17820
|
children: assistantTitle
|
|
17259
17821
|
}
|
|
17260
17822
|
),
|
|
17261
|
-
/* @__PURE__ */
|
|
17823
|
+
/* @__PURE__ */ jsx55("p", { className: "text-xs text-muted-foreground", children: t("chat.statusOnline") })
|
|
17262
17824
|
] })
|
|
17263
17825
|
] }),
|
|
17264
|
-
/* @__PURE__ */
|
|
17265
|
-
canMinimizeToPet && /* @__PURE__ */
|
|
17266
|
-
/* @__PURE__ */
|
|
17826
|
+
/* @__PURE__ */ jsxs38("div", { className: "flex items-center gap-1", children: [
|
|
17827
|
+
canMinimizeToPet && /* @__PURE__ */ jsxs38(Tooltip, { children: [
|
|
17828
|
+
/* @__PURE__ */ jsx55(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx55("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ jsx55(
|
|
17267
17829
|
"button",
|
|
17268
17830
|
{
|
|
17269
17831
|
type: "button",
|
|
@@ -17274,13 +17836,13 @@ function Chat({
|
|
|
17274
17836
|
"transition-colors duration-150"
|
|
17275
17837
|
),
|
|
17276
17838
|
"aria-label": t("chat.minimizeToPet"),
|
|
17277
|
-
children: /* @__PURE__ */
|
|
17839
|
+
children: /* @__PURE__ */ jsx55(Minus, { size: 16 })
|
|
17278
17840
|
}
|
|
17279
17841
|
) }) }),
|
|
17280
|
-
/* @__PURE__ */
|
|
17842
|
+
/* @__PURE__ */ jsx55(TooltipContent, { side: "bottom", children: t("chat.minimizeToPet") })
|
|
17281
17843
|
] }),
|
|
17282
|
-
/* @__PURE__ */
|
|
17283
|
-
/* @__PURE__ */
|
|
17844
|
+
/* @__PURE__ */ jsxs38(Tooltip, { children: [
|
|
17845
|
+
/* @__PURE__ */ jsx55(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx55("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ jsx55(
|
|
17284
17846
|
"button",
|
|
17285
17847
|
{
|
|
17286
17848
|
type: "button",
|
|
@@ -17291,14 +17853,14 @@ function Chat({
|
|
|
17291
17853
|
"transition-colors duration-150"
|
|
17292
17854
|
),
|
|
17293
17855
|
"aria-label": t("settings.open"),
|
|
17294
|
-
children: /* @__PURE__ */
|
|
17856
|
+
children: /* @__PURE__ */ jsx55(Settings2, { size: 16 })
|
|
17295
17857
|
}
|
|
17296
17858
|
) }) }),
|
|
17297
|
-
/* @__PURE__ */
|
|
17859
|
+
/* @__PURE__ */ jsx55(TooltipContent, { side: "bottom", children: t("settings.open") })
|
|
17298
17860
|
] }),
|
|
17299
|
-
history?.enabled !== false && /* @__PURE__ */
|
|
17300
|
-
/* @__PURE__ */
|
|
17301
|
-
/* @__PURE__ */
|
|
17861
|
+
history?.enabled !== false && /* @__PURE__ */ jsxs38(Fragment9, { children: [
|
|
17862
|
+
/* @__PURE__ */ jsxs38(Tooltip, { children: [
|
|
17863
|
+
/* @__PURE__ */ jsx55(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx55("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ jsx55(
|
|
17302
17864
|
"button",
|
|
17303
17865
|
{
|
|
17304
17866
|
type: "button",
|
|
@@ -17311,12 +17873,12 @@ function Chat({
|
|
|
17311
17873
|
"disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed"
|
|
17312
17874
|
),
|
|
17313
17875
|
"aria-label": t("history.newThread"),
|
|
17314
|
-
children: /* @__PURE__ */
|
|
17876
|
+
children: /* @__PURE__ */ jsx55(Pencil4, { size: 16 })
|
|
17315
17877
|
}
|
|
17316
17878
|
) }) }),
|
|
17317
|
-
/* @__PURE__ */
|
|
17879
|
+
/* @__PURE__ */ jsx55(TooltipContent, { side: "bottom", children: t("history.newThread") })
|
|
17318
17880
|
] }),
|
|
17319
|
-
/* @__PURE__ */
|
|
17881
|
+
/* @__PURE__ */ jsx55(
|
|
17320
17882
|
HistorySidebar,
|
|
17321
17883
|
{
|
|
17322
17884
|
threads,
|
|
@@ -17333,18 +17895,29 @@ function Chat({
|
|
|
17333
17895
|
]
|
|
17334
17896
|
}
|
|
17335
17897
|
),
|
|
17336
|
-
/* @__PURE__ */
|
|
17898
|
+
showMessageNavigation && /* @__PURE__ */ jsx55(
|
|
17899
|
+
MessageNavigator,
|
|
17900
|
+
{
|
|
17901
|
+
items: messageNavigationItems,
|
|
17902
|
+
viewportRef,
|
|
17903
|
+
getAnchor: getMessageNavigationAnchor,
|
|
17904
|
+
onNavigate: handleMessageNavigationNavigate,
|
|
17905
|
+
label: t("message.navigation.label"),
|
|
17906
|
+
tagsOverflowLabel: (count) => t("message.navigation.moreTags", { count })
|
|
17907
|
+
}
|
|
17908
|
+
),
|
|
17909
|
+
/* @__PURE__ */ jsxs38(
|
|
17337
17910
|
"div",
|
|
17338
17911
|
{
|
|
17339
17912
|
"data-slot": "chatkit-chat-content",
|
|
17340
17913
|
className: "mx-auto w-full flex-1 p-4",
|
|
17341
17914
|
style: chatColumnStyle,
|
|
17342
17915
|
children: [
|
|
17343
|
-
errorMessage && /* @__PURE__ */
|
|
17344
|
-
historyError && /* @__PURE__ */
|
|
17345
|
-
showMissingConfig && /* @__PURE__ */
|
|
17346
|
-
isHistoryLoading && /* @__PURE__ */
|
|
17347
|
-
messages.length === 0 && !canLoadMoreMessages ? /* @__PURE__ */
|
|
17916
|
+
errorMessage && /* @__PURE__ */ jsx55("div", { className: "mb-4 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive", children: errorMessage }),
|
|
17917
|
+
historyError && /* @__PURE__ */ jsx55("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: historyError }),
|
|
17918
|
+
showMissingConfig && /* @__PURE__ */ jsx55("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: missingConfigDetailMessage }),
|
|
17919
|
+
isHistoryLoading && /* @__PURE__ */ jsx55("div", { className: "mb-4 rounded-lg border border-muted px-3 py-2 text-sm text-muted-foreground", children: t("chat.loadingThread") }),
|
|
17920
|
+
messages.length === 0 && !canLoadMoreMessages ? /* @__PURE__ */ jsx55(
|
|
17348
17921
|
StartScreen,
|
|
17349
17922
|
{
|
|
17350
17923
|
startScreen,
|
|
@@ -17353,10 +17926,10 @@ function Chat({
|
|
|
17353
17926
|
promptSendDisabled: isSubmissionBlocked,
|
|
17354
17927
|
promptEditDisabled: isPromptEditDisabled
|
|
17355
17928
|
}
|
|
17356
|
-
) : /* @__PURE__ */
|
|
17357
|
-
canLoadMoreMessages && /* @__PURE__ */
|
|
17358
|
-
/* @__PURE__ */
|
|
17359
|
-
/* @__PURE__ */
|
|
17929
|
+
) : /* @__PURE__ */ jsxs38("div", { className: "space-y-4", children: [
|
|
17930
|
+
canLoadMoreMessages && /* @__PURE__ */ jsxs38("div", { className: "flex items-center gap-3 py-1", children: [
|
|
17931
|
+
/* @__PURE__ */ jsx55("div", { className: "h-px min-w-8 flex-1 bg-border" }),
|
|
17932
|
+
/* @__PURE__ */ jsx55(
|
|
17360
17933
|
Button,
|
|
17361
17934
|
{
|
|
17362
17935
|
type: "button",
|
|
@@ -17368,7 +17941,7 @@ function Chat({
|
|
|
17368
17941
|
children: isLoadingMoreMessages ? t("chat.loadingMoreMessages") : t("chat.loadMoreMessages")
|
|
17369
17942
|
}
|
|
17370
17943
|
),
|
|
17371
|
-
/* @__PURE__ */
|
|
17944
|
+
/* @__PURE__ */ jsx55("div", { className: "h-px min-w-8 flex-1 bg-border" })
|
|
17372
17945
|
] }),
|
|
17373
17946
|
messages.map((message, index) => {
|
|
17374
17947
|
const messageType = String(message.type);
|
|
@@ -17402,18 +17975,24 @@ function Chat({
|
|
|
17402
17975
|
const hasHumanAttachments = message.type === "human" && humanAttachments.length > 0;
|
|
17403
17976
|
const canQuoteMessage = message.type === "human" || isAssistantMessage;
|
|
17404
17977
|
const quoteSource = message.type === "human" ? t("chat.youLabel") : assistantTitle;
|
|
17978
|
+
const messageNavigationId = getMessageNavigationItemId(
|
|
17979
|
+
message,
|
|
17980
|
+
index
|
|
17981
|
+
);
|
|
17405
17982
|
if (!isAssistantMessage && !hasPlainRenderableContent && !hasHumanAttachments && humanRuntimeCapabilityOptions.length === 0 && humanReferences.length === 0) {
|
|
17406
17983
|
return null;
|
|
17407
17984
|
}
|
|
17408
|
-
return /* @__PURE__ */
|
|
17985
|
+
return /* @__PURE__ */ jsx55(
|
|
17409
17986
|
"div",
|
|
17410
17987
|
{
|
|
17988
|
+
ref: (node) => setMessageNavigationAnchor(messageNavigationId, node),
|
|
17989
|
+
"data-message-navigation-id": messageNavigationId,
|
|
17411
17990
|
className: cn(
|
|
17412
17991
|
"group flex gap-3",
|
|
17413
17992
|
message.type === "human" ? "justify-end" : "justify-start -ml-1"
|
|
17414
17993
|
// AI messages: slightly closer to left
|
|
17415
17994
|
),
|
|
17416
|
-
children: /* @__PURE__ */
|
|
17995
|
+
children: /* @__PURE__ */ jsxs38(
|
|
17417
17996
|
"div",
|
|
17418
17997
|
{
|
|
17419
17998
|
className: cn(
|
|
@@ -17421,7 +18000,7 @@ function Chat({
|
|
|
17421
18000
|
isAssistantMessage && "min-w-0 flex-1"
|
|
17422
18001
|
),
|
|
17423
18002
|
children: [
|
|
17424
|
-
/* @__PURE__ */
|
|
18003
|
+
/* @__PURE__ */ jsx55(
|
|
17425
18004
|
"div",
|
|
17426
18005
|
{
|
|
17427
18006
|
...canQuoteMessage ? {
|
|
@@ -17433,7 +18012,7 @@ function Chat({
|
|
|
17433
18012
|
message.type === "human" ? "bg-primary text-primary-foreground px-4 py-2.5" : message.type === "system" ? "bg-muted text-muted-foreground text-xs px-4 py-2.5" : "py-1 text-chat-foreground"
|
|
17434
18013
|
// AI messages: use chat-specific foreground color
|
|
17435
18014
|
),
|
|
17436
|
-
children: isAssistantMessage ? /* @__PURE__ */
|
|
18015
|
+
children: isAssistantMessage ? /* @__PURE__ */ jsx55(
|
|
17437
18016
|
AssistantMessage,
|
|
17438
18017
|
{
|
|
17439
18018
|
message: {
|
|
@@ -17452,25 +18031,25 @@ function Chat({
|
|
|
17452
18031
|
organizationId: stream.organizationId,
|
|
17453
18032
|
apiUrl: stream.apiUrl
|
|
17454
18033
|
}
|
|
17455
|
-
) : /* @__PURE__ */
|
|
17456
|
-
message.type === "human" && humanRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */
|
|
18034
|
+
) : /* @__PURE__ */ jsxs38(Fragment9, { children: [
|
|
18035
|
+
message.type === "human" && humanRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ jsx55("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanRuntimeCapabilityOptions.map((option) => /* @__PURE__ */ jsxs38(
|
|
17457
18036
|
"span",
|
|
17458
18037
|
{
|
|
17459
18038
|
className: "inline-flex max-w-full items-center gap-1 rounded-md bg-primary-foreground/20 px-2 py-1 text-xs font-medium text-primary-foreground",
|
|
17460
18039
|
children: [
|
|
17461
|
-
/* @__PURE__ */
|
|
18040
|
+
/* @__PURE__ */ jsx55(
|
|
17462
18041
|
RuntimeCapabilityIcon,
|
|
17463
18042
|
{
|
|
17464
18043
|
option,
|
|
17465
18044
|
variant: "chip"
|
|
17466
18045
|
}
|
|
17467
18046
|
),
|
|
17468
|
-
/* @__PURE__ */
|
|
18047
|
+
/* @__PURE__ */ jsx55("span", { className: "max-w-[9rem] truncate", children: option.label })
|
|
17469
18048
|
]
|
|
17470
18049
|
},
|
|
17471
18050
|
`${option.type}:${option.id}`
|
|
17472
18051
|
)) }),
|
|
17473
|
-
message.type === "human" && humanReferences.length > 0 && /* @__PURE__ */
|
|
18052
|
+
message.type === "human" && humanReferences.length > 0 && /* @__PURE__ */ jsx55("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanReferences.map((reference) => /* @__PURE__ */ jsx55(
|
|
17474
18053
|
ReferenceChip,
|
|
17475
18054
|
{
|
|
17476
18055
|
reference,
|
|
@@ -17478,29 +18057,29 @@ function Chat({
|
|
|
17478
18057
|
},
|
|
17479
18058
|
getReferenceKey(reference)
|
|
17480
18059
|
)) }),
|
|
17481
|
-
message.type === "human" && humanAttachments.length > 0 && /* @__PURE__ */
|
|
18060
|
+
message.type === "human" && humanAttachments.length > 0 && /* @__PURE__ */ jsx55("div", { className: "flex flex-wrap gap-1.5 mb-2", children: humanAttachments.map((file, fileIndex) => /* @__PURE__ */ jsxs38(
|
|
17482
18061
|
"div",
|
|
17483
18062
|
{
|
|
17484
18063
|
className: "flex items-center gap-1.5 rounded-md bg-primary-foreground/20 px-2 py-1 text-xs",
|
|
17485
18064
|
children: [
|
|
17486
|
-
/* @__PURE__ */
|
|
17487
|
-
/* @__PURE__ */
|
|
18065
|
+
/* @__PURE__ */ jsx55(FileText5, { size: 12 }),
|
|
18066
|
+
/* @__PURE__ */ jsx55("span", { className: "max-w-[100px] truncate", children: file.originalName ?? file.id })
|
|
17488
18067
|
]
|
|
17489
18068
|
},
|
|
17490
18069
|
fileIndex
|
|
17491
18070
|
)) }),
|
|
17492
|
-
Array.isArray(message.content) ? message.content.map((part, partIndex) => /* @__PURE__ */
|
|
18071
|
+
Array.isArray(message.content) ? message.content.map((part, partIndex) => /* @__PURE__ */ jsx55(
|
|
17493
18072
|
"p",
|
|
17494
18073
|
{
|
|
17495
18074
|
className: "wrap-break-word text-sm leading-relaxed",
|
|
17496
18075
|
children: formatMessageContent(part)
|
|
17497
18076
|
},
|
|
17498
18077
|
`${part.type}-${partIndex}`
|
|
17499
|
-
)) : /* @__PURE__ */
|
|
18078
|
+
)) : /* @__PURE__ */ jsx55("span", { className: "wrap-break-word text-sm leading-relaxed", children: formatMessageContent(message.content) })
|
|
17500
18079
|
] })
|
|
17501
18080
|
}
|
|
17502
18081
|
),
|
|
17503
|
-
/* @__PURE__ */
|
|
18082
|
+
/* @__PURE__ */ jsx55(
|
|
17504
18083
|
MessageActions,
|
|
17505
18084
|
{
|
|
17506
18085
|
content: messageContent,
|
|
@@ -17538,7 +18117,7 @@ function Chat({
|
|
|
17538
18117
|
stream.isLoading,
|
|
17539
18118
|
{ now: streamingNow }
|
|
17540
18119
|
);
|
|
17541
|
-
return /* @__PURE__ */
|
|
18120
|
+
return /* @__PURE__ */ jsx55("div", { className: "flex justify-start gap-3 -ml-2", children: /* @__PURE__ */ jsx55("div", { className: "max-w-full rounded-2xl py-2.5", children: /* @__PURE__ */ jsx55(
|
|
17542
18121
|
AssistantStreamingIndicator,
|
|
17543
18122
|
{
|
|
17544
18123
|
status: fallbackStreamingStatus ?? "loading"
|
|
@@ -17549,7 +18128,7 @@ function Chat({
|
|
|
17549
18128
|
]
|
|
17550
18129
|
}
|
|
17551
18130
|
),
|
|
17552
|
-
!isAtBottom && messages.length > 0 && /* @__PURE__ */
|
|
18131
|
+
!isAtBottom && messages.length > 0 && /* @__PURE__ */ jsx55("div", { className: "sticky bottom-20 z-20 flex justify-center px-4 pointer-events-none", children: /* @__PURE__ */ jsx55(
|
|
17553
18132
|
Button,
|
|
17554
18133
|
{
|
|
17555
18134
|
type: "button",
|
|
@@ -17562,10 +18141,10 @@ function Chat({
|
|
|
17562
18141
|
onClick: () => scrollToBottom(true, true),
|
|
17563
18142
|
"aria-label": t("chat.scrollToBottom"),
|
|
17564
18143
|
title: t("chat.scrollToBottom"),
|
|
17565
|
-
children: /* @__PURE__ */
|
|
18144
|
+
children: /* @__PURE__ */ jsx55(ArrowDown2, { size: 16 })
|
|
17566
18145
|
}
|
|
17567
18146
|
) }),
|
|
17568
|
-
quoteSelection && /* @__PURE__ */
|
|
18147
|
+
quoteSelection && /* @__PURE__ */ jsx55(
|
|
17569
18148
|
"div",
|
|
17570
18149
|
{
|
|
17571
18150
|
className: "pointer-events-none fixed z-50",
|
|
@@ -17574,7 +18153,7 @@ function Chat({
|
|
|
17574
18153
|
left: `${quoteSelection.left}px`,
|
|
17575
18154
|
transform: "translateX(-50%)"
|
|
17576
18155
|
},
|
|
17577
|
-
children: /* @__PURE__ */
|
|
18156
|
+
children: /* @__PURE__ */ jsxs38(
|
|
17578
18157
|
Button,
|
|
17579
18158
|
{
|
|
17580
18159
|
type: "button",
|
|
@@ -17586,22 +18165,22 @@ function Chat({
|
|
|
17586
18165
|
"aria-label": t("composer.quoteSelection"),
|
|
17587
18166
|
title: t("composer.quoteSelection"),
|
|
17588
18167
|
children: [
|
|
17589
|
-
/* @__PURE__ */
|
|
18168
|
+
/* @__PURE__ */ jsx55(Quote, { size: 14 }),
|
|
17590
18169
|
t("composer.quoteSelection")
|
|
17591
18170
|
]
|
|
17592
18171
|
}
|
|
17593
18172
|
)
|
|
17594
18173
|
}
|
|
17595
18174
|
),
|
|
17596
|
-
/* @__PURE__ */
|
|
18175
|
+
/* @__PURE__ */ jsxs38(
|
|
17597
18176
|
"div",
|
|
17598
18177
|
{
|
|
17599
18178
|
"data-slot": "chatkit-chat-composer",
|
|
17600
18179
|
className: "mx-auto w-full p-2 sticky bottom-0 z-10 bg-background",
|
|
17601
18180
|
style: chatColumnStyle,
|
|
17602
18181
|
children: [
|
|
17603
|
-
threadErrorMessage && /* @__PURE__ */
|
|
17604
|
-
/* @__PURE__ */
|
|
18182
|
+
threadErrorMessage && /* @__PURE__ */ jsx55("div", { className: "mb-3 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive overflow-auto", children: threadErrorMessage }),
|
|
18183
|
+
/* @__PURE__ */ jsx55(
|
|
17605
18184
|
ChatAttachments,
|
|
17606
18185
|
{
|
|
17607
18186
|
ref: attachmentsRef,
|
|
@@ -17615,7 +18194,7 @@ function Chat({
|
|
|
17615
18194
|
onStateChange: setAttachmentState
|
|
17616
18195
|
}
|
|
17617
18196
|
),
|
|
17618
|
-
references.length > 0 && /* @__PURE__ */
|
|
18197
|
+
references.length > 0 && /* @__PURE__ */ jsx55("div", { className: "mb-3 flex flex-wrap gap-2", children: references.map((reference) => /* @__PURE__ */ jsx55(
|
|
17619
18198
|
ReferenceChip,
|
|
17620
18199
|
{
|
|
17621
18200
|
reference,
|
|
@@ -17629,16 +18208,16 @@ function Chat({
|
|
|
17629
18208
|
},
|
|
17630
18209
|
getReferenceKey(reference)
|
|
17631
18210
|
)) }),
|
|
17632
|
-
detachedRunRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */
|
|
17633
|
-
/* @__PURE__ */
|
|
17634
|
-
detachedRunRuntimeCapabilityOptions.map((option) => /* @__PURE__ */
|
|
18211
|
+
detachedRunRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ jsxs38("div", { className: "mb-2 flex flex-wrap items-center gap-2", children: [
|
|
18212
|
+
/* @__PURE__ */ jsx55("span", { className: "text-xs text-muted-foreground", children: t("composer.capabilities.runOnly") }),
|
|
18213
|
+
detachedRunRuntimeCapabilityOptions.map((option) => /* @__PURE__ */ jsxs38(
|
|
17635
18214
|
"span",
|
|
17636
18215
|
{
|
|
17637
18216
|
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",
|
|
17638
18217
|
children: [
|
|
17639
|
-
/* @__PURE__ */
|
|
17640
|
-
/* @__PURE__ */
|
|
17641
|
-
/* @__PURE__ */
|
|
18218
|
+
/* @__PURE__ */ jsx55(RuntimeCapabilityIcon, { option, variant: "chip" }),
|
|
18219
|
+
/* @__PURE__ */ jsx55("span", { className: "max-w-40 truncate", children: option.label }),
|
|
18220
|
+
/* @__PURE__ */ jsx55(
|
|
17642
18221
|
"button",
|
|
17643
18222
|
{
|
|
17644
18223
|
type: "button",
|
|
@@ -17646,7 +18225,7 @@ function Chat({
|
|
|
17646
18225
|
className: "rounded-full p-0.5 hover:bg-primary/15",
|
|
17647
18226
|
title: t("composer.capabilities.removeRunCapability"),
|
|
17648
18227
|
"aria-label": t("composer.capabilities.removeRunCapability"),
|
|
17649
|
-
children: /* @__PURE__ */
|
|
18228
|
+
children: /* @__PURE__ */ jsx55(X6, { size: 11 })
|
|
17650
18229
|
}
|
|
17651
18230
|
)
|
|
17652
18231
|
]
|
|
@@ -17654,7 +18233,7 @@ function Chat({
|
|
|
17654
18233
|
`${option.type}:${option.id}`
|
|
17655
18234
|
))
|
|
17656
18235
|
] }),
|
|
17657
|
-
showGoalStatus && /* @__PURE__ */
|
|
18236
|
+
showGoalStatus && /* @__PURE__ */ jsxs38(
|
|
17658
18237
|
"div",
|
|
17659
18238
|
{
|
|
17660
18239
|
className: cn(
|
|
@@ -17662,7 +18241,7 @@ function Chat({
|
|
|
17662
18241
|
isGoalObjectiveExpanded ? "items-start" : "items-center"
|
|
17663
18242
|
),
|
|
17664
18243
|
children: [
|
|
17665
|
-
/* @__PURE__ */
|
|
18244
|
+
/* @__PURE__ */ jsx55(
|
|
17666
18245
|
Target2,
|
|
17667
18246
|
{
|
|
17668
18247
|
className: cn(
|
|
@@ -17671,13 +18250,13 @@ function Chat({
|
|
|
17671
18250
|
)
|
|
17672
18251
|
}
|
|
17673
18252
|
),
|
|
17674
|
-
/* @__PURE__ */
|
|
17675
|
-
/* @__PURE__ */
|
|
17676
|
-
/* @__PURE__ */
|
|
17677
|
-
threadGoal && /* @__PURE__ */
|
|
17678
|
-
isGoalLoading && /* @__PURE__ */
|
|
18253
|
+
/* @__PURE__ */ jsxs38("div", { className: "min-w-0 flex-1", children: [
|
|
18254
|
+
/* @__PURE__ */ jsxs38("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
18255
|
+
/* @__PURE__ */ jsx55("span", { className: "font-medium", children: t("chat.goal.label") }),
|
|
18256
|
+
threadGoal && /* @__PURE__ */ jsx55("span", { className: "shrink-0 rounded-md bg-muted px-1.5 py-0.5 text-[11px] text-muted-foreground", children: t(`chat.goal.status.${threadGoal.status}`) }),
|
|
18257
|
+
isGoalLoading && /* @__PURE__ */ jsx55(Loader29, { className: "size-3 animate-spin text-muted-foreground" })
|
|
17679
18258
|
] }),
|
|
17680
|
-
/* @__PURE__ */
|
|
18259
|
+
/* @__PURE__ */ jsx55(
|
|
17681
18260
|
"div",
|
|
17682
18261
|
{
|
|
17683
18262
|
className: cn(
|
|
@@ -17687,13 +18266,13 @@ function Chat({
|
|
|
17687
18266
|
children: goalError || threadGoal?.objective
|
|
17688
18267
|
}
|
|
17689
18268
|
),
|
|
17690
|
-
threadGoal && /* @__PURE__ */
|
|
18269
|
+
threadGoal && /* @__PURE__ */ jsx55("div", { className: "mt-1 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-muted-foreground", children: /* @__PURE__ */ jsx55("span", { children: t("chat.goal.elapsed", {
|
|
17691
18270
|
elapsed: formatGoalElapsed(displayedGoalElapsedSeconds)
|
|
17692
18271
|
}) }) })
|
|
17693
18272
|
] }),
|
|
17694
|
-
threadGoal && /* @__PURE__ */
|
|
17695
|
-
/* @__PURE__ */
|
|
17696
|
-
/* @__PURE__ */
|
|
18273
|
+
threadGoal && /* @__PURE__ */ jsxs38("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
18274
|
+
/* @__PURE__ */ jsxs38(Tooltip, { children: [
|
|
18275
|
+
/* @__PURE__ */ jsx55(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx55(
|
|
17697
18276
|
Button,
|
|
17698
18277
|
{
|
|
17699
18278
|
type: "button",
|
|
@@ -17704,13 +18283,13 @@ function Chat({
|
|
|
17704
18283
|
const prefix = "/goal edit ";
|
|
17705
18284
|
setComposerText(`${prefix}${threadGoal.objective}`);
|
|
17706
18285
|
},
|
|
17707
|
-
children: /* @__PURE__ */
|
|
18286
|
+
children: /* @__PURE__ */ jsx55(Pencil4, { className: "size-3" })
|
|
17708
18287
|
}
|
|
17709
18288
|
) }),
|
|
17710
|
-
/* @__PURE__ */
|
|
18289
|
+
/* @__PURE__ */ jsx55(TooltipContent, { children: t("chat.goal.edit") })
|
|
17711
18290
|
] }),
|
|
17712
|
-
/* @__PURE__ */
|
|
17713
|
-
/* @__PURE__ */
|
|
18291
|
+
/* @__PURE__ */ jsxs38(Tooltip, { children: [
|
|
18292
|
+
/* @__PURE__ */ jsx55(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx55(
|
|
17714
18293
|
Button,
|
|
17715
18294
|
{
|
|
17716
18295
|
type: "button",
|
|
@@ -17726,13 +18305,13 @@ function Chat({
|
|
|
17726
18305
|
executionType: "insert_invocation"
|
|
17727
18306
|
}
|
|
17728
18307
|
}),
|
|
17729
|
-
children: threadGoal.status === "paused" ? /* @__PURE__ */
|
|
18308
|
+
children: threadGoal.status === "paused" ? /* @__PURE__ */ jsx55(Play, { className: "size-3" }) : /* @__PURE__ */ jsx55(Pause, { className: "size-3" })
|
|
17730
18309
|
}
|
|
17731
18310
|
) }),
|
|
17732
|
-
/* @__PURE__ */
|
|
18311
|
+
/* @__PURE__ */ jsx55(TooltipContent, { children: threadGoal.status === "paused" ? t("chat.goal.resume") : t("chat.goal.pause") })
|
|
17733
18312
|
] }),
|
|
17734
|
-
/* @__PURE__ */
|
|
17735
|
-
/* @__PURE__ */
|
|
18313
|
+
/* @__PURE__ */ jsxs38(Tooltip, { children: [
|
|
18314
|
+
/* @__PURE__ */ jsx55(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx55(
|
|
17736
18315
|
Button,
|
|
17737
18316
|
{
|
|
17738
18317
|
type: "button",
|
|
@@ -17748,13 +18327,13 @@ function Chat({
|
|
|
17748
18327
|
executionType: "insert_invocation"
|
|
17749
18328
|
}
|
|
17750
18329
|
}),
|
|
17751
|
-
children: /* @__PURE__ */
|
|
18330
|
+
children: /* @__PURE__ */ jsx55(Trash23, { className: "size-3" })
|
|
17752
18331
|
}
|
|
17753
18332
|
) }),
|
|
17754
|
-
/* @__PURE__ */
|
|
18333
|
+
/* @__PURE__ */ jsx55(TooltipContent, { children: t("chat.goal.clear") })
|
|
17755
18334
|
] }),
|
|
17756
|
-
threadGoal.objective && !goalError && /* @__PURE__ */
|
|
17757
|
-
/* @__PURE__ */
|
|
18335
|
+
threadGoal.objective && !goalError && /* @__PURE__ */ jsxs38(Tooltip, { children: [
|
|
18336
|
+
/* @__PURE__ */ jsx55(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx55(
|
|
17758
18337
|
Button,
|
|
17759
18338
|
{
|
|
17760
18339
|
type: "button",
|
|
@@ -17763,7 +18342,7 @@ function Chat({
|
|
|
17763
18342
|
"aria-expanded": isGoalObjectiveExpanded,
|
|
17764
18343
|
"aria-label": isGoalObjectiveExpanded ? t("chat.goal.collapseObjective") : t("chat.goal.expandObjective"),
|
|
17765
18344
|
onClick: () => setIsGoalObjectiveExpanded((expanded) => !expanded),
|
|
17766
|
-
children: /* @__PURE__ */
|
|
18345
|
+
children: /* @__PURE__ */ jsx55(
|
|
17767
18346
|
ChevronDown5,
|
|
17768
18347
|
{
|
|
17769
18348
|
className: cn(
|
|
@@ -17774,13 +18353,13 @@ function Chat({
|
|
|
17774
18353
|
)
|
|
17775
18354
|
}
|
|
17776
18355
|
) }),
|
|
17777
|
-
/* @__PURE__ */
|
|
18356
|
+
/* @__PURE__ */ jsx55(TooltipContent, { children: isGoalObjectiveExpanded ? t("chat.goal.collapseObjective") : t("chat.goal.expandObjective") })
|
|
17778
18357
|
] })
|
|
17779
18358
|
] })
|
|
17780
18359
|
]
|
|
17781
18360
|
}
|
|
17782
18361
|
),
|
|
17783
|
-
/* @__PURE__ */
|
|
18362
|
+
/* @__PURE__ */ jsx55(
|
|
17784
18363
|
PendingRuntimeServices,
|
|
17785
18364
|
{
|
|
17786
18365
|
state: stream.runtimeActivities.sandboxServices,
|
|
@@ -17789,7 +18368,7 @@ function Chat({
|
|
|
17789
18368
|
className: hasPendingTodos || hasPendingFollowUps ? "mb-2" : void 0
|
|
17790
18369
|
}
|
|
17791
18370
|
),
|
|
17792
|
-
/* @__PURE__ */
|
|
18371
|
+
/* @__PURE__ */ jsx55(
|
|
17793
18372
|
PendingTodos,
|
|
17794
18373
|
{
|
|
17795
18374
|
snapshot: stream.todos,
|
|
@@ -17797,7 +18376,7 @@ function Chat({
|
|
|
17797
18376
|
className: hasPendingFollowUps ? "mb-2" : void 0
|
|
17798
18377
|
}
|
|
17799
18378
|
),
|
|
17800
|
-
/* @__PURE__ */
|
|
18379
|
+
/* @__PURE__ */ jsx55(
|
|
17801
18380
|
PendingFollowUps,
|
|
17802
18381
|
{
|
|
17803
18382
|
items: pendingFollowUps,
|
|
@@ -17810,7 +18389,7 @@ function Chat({
|
|
|
17810
18389
|
attachToComposer: true
|
|
17811
18390
|
}
|
|
17812
18391
|
),
|
|
17813
|
-
/* @__PURE__ */
|
|
18392
|
+
/* @__PURE__ */ jsx55(
|
|
17814
18393
|
RequestUserInputPanel,
|
|
17815
18394
|
{
|
|
17816
18395
|
request: stream.pendingRequestUserInput,
|
|
@@ -17819,7 +18398,7 @@ function Chat({
|
|
|
17819
18398
|
attachToComposer: true
|
|
17820
18399
|
}
|
|
17821
18400
|
),
|
|
17822
|
-
/* @__PURE__ */
|
|
18401
|
+
/* @__PURE__ */ jsx55(
|
|
17823
18402
|
HITLApprovalPanel,
|
|
17824
18403
|
{
|
|
17825
18404
|
request: stream.pendingHITLRequest,
|
|
@@ -17828,7 +18407,7 @@ function Chat({
|
|
|
17828
18407
|
attachToComposer: true
|
|
17829
18408
|
}
|
|
17830
18409
|
),
|
|
17831
|
-
runtimeCapabilityPalette && /* @__PURE__ */
|
|
18410
|
+
runtimeCapabilityPalette && /* @__PURE__ */ jsx55(
|
|
17832
18411
|
SlashPalette,
|
|
17833
18412
|
{
|
|
17834
18413
|
palette: runtimeCapabilityPalette,
|
|
@@ -17842,7 +18421,7 @@ function Chat({
|
|
|
17842
18421
|
onSelect: selectSlashPaletteOption
|
|
17843
18422
|
}
|
|
17844
18423
|
),
|
|
17845
|
-
/* @__PURE__ */
|
|
18424
|
+
/* @__PURE__ */ jsx55("form", { className: "flex items-end", onSubmit: handleSubmit, children: /* @__PURE__ */ jsxs38(
|
|
17846
18425
|
"div",
|
|
17847
18426
|
{
|
|
17848
18427
|
"data-slot": "composer-input-shell",
|
|
@@ -17856,7 +18435,7 @@ function Chat({
|
|
|
17856
18435
|
composerInputRoundedClass
|
|
17857
18436
|
),
|
|
17858
18437
|
children: [
|
|
17859
|
-
/* @__PURE__ */
|
|
18438
|
+
/* @__PURE__ */ jsx55(
|
|
17860
18439
|
"div",
|
|
17861
18440
|
{
|
|
17862
18441
|
ref: composerInputRef,
|
|
@@ -17878,7 +18457,7 @@ function Chat({
|
|
|
17878
18457
|
(missingConfig || isHistoryLoading || hasPendingInteractiveRequest) && "cursor-not-allowed opacity-50"
|
|
17879
18458
|
),
|
|
17880
18459
|
children: renderedComposerParts.map(
|
|
17881
|
-
(part, index) => part.type === "text" ? /* @__PURE__ */
|
|
18460
|
+
(part, index) => part.type === "text" ? /* @__PURE__ */ jsx55(React50.Fragment, { children: part.text }, `text-${index}`) : /* @__PURE__ */ jsxs38(
|
|
17882
18461
|
"span",
|
|
17883
18462
|
{
|
|
17884
18463
|
"data-composer-capability-key": part.key,
|
|
@@ -17887,14 +18466,14 @@ function Chat({
|
|
|
17887
18466
|
contentEditable: false,
|
|
17888
18467
|
className: "mx-0.5 inline-flex max-w-[14rem] select-none items-center gap-1 text-sm font-semibold text-primary align-baseline",
|
|
17889
18468
|
children: [
|
|
17890
|
-
/* @__PURE__ */
|
|
18469
|
+
/* @__PURE__ */ jsx55(
|
|
17891
18470
|
RuntimeCapabilityIcon,
|
|
17892
18471
|
{
|
|
17893
18472
|
option: part.capability,
|
|
17894
18473
|
variant: "chip"
|
|
17895
18474
|
}
|
|
17896
18475
|
),
|
|
17897
|
-
/* @__PURE__ */
|
|
18476
|
+
/* @__PURE__ */ jsx55("span", { className: "truncate", children: part.capability.label })
|
|
17898
18477
|
]
|
|
17899
18478
|
},
|
|
17900
18479
|
part.key
|
|
@@ -17903,14 +18482,14 @@ function Chat({
|
|
|
17903
18482
|
},
|
|
17904
18483
|
composerDomVersion
|
|
17905
18484
|
),
|
|
17906
|
-
/* @__PURE__ */
|
|
18485
|
+
/* @__PURE__ */ jsxs38(
|
|
17907
18486
|
"div",
|
|
17908
18487
|
{
|
|
17909
18488
|
"data-slot": "composer-action-bar",
|
|
17910
18489
|
className: "pointer-events-none absolute inset-x-1.5 bottom-1 flex min-h-10 items-center justify-between gap-2",
|
|
17911
18490
|
children: [
|
|
17912
|
-
/* @__PURE__ */
|
|
17913
|
-
/* @__PURE__ */
|
|
18491
|
+
/* @__PURE__ */ jsxs38("div", { className: "pointer-events-none flex min-w-0 flex-1 items-center gap-1.5", children: [
|
|
18492
|
+
/* @__PURE__ */ jsx55("div", { className: "pointer-events-auto flex shrink-0 items-center gap-1.5", children: /* @__PURE__ */ jsx55(
|
|
17914
18493
|
ComposerMenu,
|
|
17915
18494
|
{
|
|
17916
18495
|
composer,
|
|
@@ -17928,20 +18507,20 @@ function Chat({
|
|
|
17928
18507
|
disabled: missingConfig || isHistoryLoading || hasPendingInteractiveRequest
|
|
17929
18508
|
}
|
|
17930
18509
|
) }),
|
|
17931
|
-
selectedTool && /* @__PURE__ */
|
|
17932
|
-
/* @__PURE__ */
|
|
17933
|
-
/* @__PURE__ */
|
|
18510
|
+
selectedTool && /* @__PURE__ */ jsxs38("span", { className: "pointer-events-auto inline-flex h-8 min-w-0 max-w-[14rem] shrink items-center gap-1.5 rounded-full bg-primary/10 px-2 text-xs font-medium text-primary transition-all duration-200", children: [
|
|
18511
|
+
/* @__PURE__ */ jsx55("span", { className: "truncate", children: selectedTool.shortLabel ?? selectedTool.label }),
|
|
18512
|
+
/* @__PURE__ */ jsx55(
|
|
17934
18513
|
"button",
|
|
17935
18514
|
{
|
|
17936
18515
|
type: "button",
|
|
17937
18516
|
onClick: () => setSelectedTool(null),
|
|
17938
18517
|
className: "shrink-0 rounded-full p-0.5 text-primary/70 hover:bg-primary/10 hover:text-primary",
|
|
17939
|
-
children: /* @__PURE__ */
|
|
18518
|
+
children: /* @__PURE__ */ jsx55(X6, { size: 12 })
|
|
17940
18519
|
}
|
|
17941
18520
|
)
|
|
17942
18521
|
] })
|
|
17943
18522
|
] }),
|
|
17944
|
-
/* @__PURE__ */
|
|
18523
|
+
/* @__PURE__ */ jsx55("div", { className: "pointer-events-auto shrink-0", children: /* @__PURE__ */ jsx55(
|
|
17945
18524
|
SendButton,
|
|
17946
18525
|
{
|
|
17947
18526
|
disabled: isSendDisabled,
|
|
@@ -17964,7 +18543,7 @@ function Chat({
|
|
|
17964
18543
|
]
|
|
17965
18544
|
}
|
|
17966
18545
|
) }),
|
|
17967
|
-
disclaimer?.text && /* @__PURE__ */
|
|
18546
|
+
disclaimer?.text && /* @__PURE__ */ jsx55(
|
|
17968
18547
|
"p",
|
|
17969
18548
|
{
|
|
17970
18549
|
className: cn(
|
|
@@ -17974,14 +18553,14 @@ function Chat({
|
|
|
17974
18553
|
children: disclaimer.text
|
|
17975
18554
|
}
|
|
17976
18555
|
),
|
|
17977
|
-
/* @__PURE__ */
|
|
17978
|
-
/* @__PURE__ */
|
|
17979
|
-
/* @__PURE__ */
|
|
18556
|
+
/* @__PURE__ */ jsxs38("div", { className: "mt-2 flex items-center justify-center gap-2 text-xs text-muted-foreground", children: [
|
|
18557
|
+
/* @__PURE__ */ jsx55("span", { children: t("chat.poweredBy") }),
|
|
18558
|
+
/* @__PURE__ */ jsx55(ContextUsageIndicator, { className: "absolute right-4" })
|
|
17980
18559
|
] })
|
|
17981
18560
|
]
|
|
17982
18561
|
}
|
|
17983
18562
|
),
|
|
17984
|
-
/* @__PURE__ */
|
|
18563
|
+
/* @__PURE__ */ jsx55(
|
|
17985
18564
|
SettingsSheet,
|
|
17986
18565
|
{
|
|
17987
18566
|
open: petSettingsOpen,
|
|
@@ -17991,17 +18570,17 @@ function Chat({
|
|
|
17991
18570
|
onSave: savePetLocalSettings
|
|
17992
18571
|
}
|
|
17993
18572
|
),
|
|
17994
|
-
/* @__PURE__ */
|
|
18573
|
+
/* @__PURE__ */ jsx55(PetBridge, { pet: effectivePet, state: petAutoState })
|
|
17995
18574
|
]
|
|
17996
18575
|
}
|
|
17997
18576
|
);
|
|
17998
18577
|
}
|
|
17999
18578
|
|
|
18000
18579
|
// src/components/ui/separator.tsx
|
|
18001
|
-
import * as
|
|
18002
|
-
import { jsx as
|
|
18003
|
-
var Separator =
|
|
18004
|
-
({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */
|
|
18580
|
+
import * as React51 from "react";
|
|
18581
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
18582
|
+
var Separator = React51.forwardRef(
|
|
18583
|
+
({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */ jsx56(
|
|
18005
18584
|
"div",
|
|
18006
18585
|
{
|
|
18007
18586
|
ref,
|