@xpert-ai/chatkit-ui 0.4.11 → 0.5.0
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-D3JA5kg6.js → _baseUniq-DZ29Zn3d.js} +1 -1
- package/dist/app/assets/{abap-U3trMbvh.js → abap-C2XHVzwK.js} +1 -1
- package/dist/app/assets/{abnf-Bl4asd8k.js → abnf-BRgIHjm_.js} +1 -1
- package/dist/app/assets/{actionscript-D8gfKfJD.js → actionscript-Na7e2q4S.js} +1 -1
- package/dist/app/assets/{ada-DdH41xZz.js → ada-B3G_-Qxw.js} +1 -1
- package/dist/app/assets/{agda-CRS5ewL6.js → agda-DyBjQLTn.js} +1 -1
- package/dist/app/assets/{al-6ay2Ap_a.js → al-hwnvMZ7U.js} +1 -1
- package/dist/app/assets/{antlr4-1_hBGW-a.js → antlr4-DofwnXN-.js} +1 -1
- package/dist/app/assets/{apacheconf-CZxoTH8B.js → apacheconf-DLYYFJ_B.js} +1 -1
- package/dist/app/assets/{apex-CrTOQiOq.js → apex-CRz1U2uJ.js} +1 -1
- package/dist/app/assets/{apl-W2lGuttD.js → apl-Ceqm0neE.js} +1 -1
- package/dist/app/assets/{applescript-b_jfORvY.js → applescript-Bs7gU1Lu.js} +1 -1
- package/dist/app/assets/{aql-DcttT6A-.js → aql-KuNsuj_e.js} +1 -1
- package/dist/app/assets/{arc-CcWnzmyO.js → arc-B5EsoCiF.js} +1 -1
- package/dist/app/assets/{architectureDiagram-Q4EWVU46-BzsxtvCr.js → architectureDiagram-Q4EWVU46-DQ1dXSAq.js} +1 -1
- package/dist/app/assets/{arduino-DcmjPx9R.js → arduino-w_r5Lwsb.js} +1 -1
- package/dist/app/assets/{arff-DdTCsnLN.js → arff-CC0uRII_.js} +1 -1
- package/dist/app/assets/{asciidoc-C3Zw8KHv.js → asciidoc-DzzZo2AN.js} +1 -1
- package/dist/app/assets/{asm6502-Cl6X60ew.js → asm6502-C2S6WXRd.js} +1 -1
- package/dist/app/assets/{asmatmel-4TiHBMZ0.js → asmatmel-DPA5Hvij.js} +1 -1
- package/dist/app/assets/{aspnet-BAcaJr0W.js → aspnet-BA-O1KsD.js} +1 -1
- package/dist/app/assets/{autohotkey-DU4MbEO6.js → autohotkey-Csuel7vh.js} +1 -1
- package/dist/app/assets/{autoit-DNUFW1WT.js → autoit-BQcXidfQ.js} +1 -1
- package/dist/app/assets/{avisynth-Dj1xCW-P.js → avisynth-BUUjVUhV.js} +1 -1
- package/dist/app/assets/{avro-idl-BUuuPK0F.js → avro-idl-DDZYzg-n.js} +1 -1
- package/dist/app/assets/{bash-Car3l6Qf.js → bash-Dv5rOrkL.js} +1 -1
- package/dist/app/assets/{basic-Dz2vmq9w.js → basic-Ci_TsmQa.js} +1 -1
- package/dist/app/assets/{batch-DYOkuO24.js → batch-hJIZKcMr.js} +1 -1
- package/dist/app/assets/{bbcode-BTogT5Ke.js → bbcode-Cxou6342.js} +1 -1
- package/dist/app/assets/{bicep-gKyzTSH1.js → bicep-BmwgrTYi.js} +1 -1
- package/dist/app/assets/{birb-D1xh9nGK.js → birb-BO-P1uNN.js} +1 -1
- package/dist/app/assets/{bison-y3F6JBTg.js → bison-5dqBU6We.js} +1 -1
- package/dist/app/assets/{blockDiagram-DXYQGD6D-wp5YgjZR.js → blockDiagram-DXYQGD6D-CRbLcVto.js} +1 -1
- package/dist/app/assets/{bnf-CvdKGJcO.js → bnf-BTkxH_YF.js} +1 -1
- package/dist/app/assets/{brainfuck-zxUjJDmK.js → brainfuck-BHb8FGIY.js} +1 -1
- package/dist/app/assets/{brightscript-E2VTIZaD.js → brightscript-D2hbLBL8.js} +1 -1
- package/dist/app/assets/{bro-Bf9FPsHP.js → bro-Cub5LU5k.js} +1 -1
- package/dist/app/assets/{bsl-BTf78jgi.js → bsl-dFxafjy6.js} +1 -1
- package/dist/app/assets/{c-E6pl-2PD.js → c-DrrM9Rom.js} +1 -1
- package/dist/app/assets/{c4Diagram-AHTNJAMY-BFh75I1O.js → c4Diagram-AHTNJAMY-DYvNLmTQ.js} +1 -1
- package/dist/app/assets/{cfscript-BU29FYfv.js → cfscript-OQ4kaUc4.js} +1 -1
- package/dist/app/assets/{chaiscript-D2Mla472.js → chaiscript-C4LE5jyL.js} +1 -1
- package/dist/app/assets/channel-DJ2gm0Ia.js +1 -0
- package/dist/app/assets/{chunk-4BX2VUAB-D-Payniv.js → chunk-4BX2VUAB-BhXWPSzw.js} +1 -1
- package/dist/app/assets/{chunk-4TB4RGXK-Bsata7j8.js → chunk-4TB4RGXK-C3Jij7F2.js} +1 -1
- package/dist/app/assets/{chunk-55IACEB6-DURW_8ZU.js → chunk-55IACEB6-BQQm8tgd.js} +1 -1
- package/dist/app/assets/{chunk-EDXVE4YY-DUechSa6.js → chunk-EDXVE4YY-CrgVQJaf.js} +1 -1
- package/dist/app/assets/{chunk-FMBD7UC4-CKF0xhys.js → chunk-FMBD7UC4-DHemcwzb.js} +1 -1
- package/dist/app/assets/{chunk-OYMX7WX6-ddmRWT15.js → chunk-OYMX7WX6-PvghOgZf.js} +1 -1
- package/dist/app/assets/{chunk-QZHKN3VN-DDobBULn.js → chunk-QZHKN3VN-BmHh1xu4.js} +1 -1
- package/dist/app/assets/{chunk-YZCP3GAM-ll1E1L_E.js → chunk-YZCP3GAM-CL5qbuJu.js} +1 -1
- package/dist/app/assets/{cil-DOsNtjkv.js → cil-CZh67bKP.js} +1 -1
- package/dist/app/assets/classDiagram-6PBFFD2Q-DEiZ8yVf.js +1 -0
- package/dist/app/assets/classDiagram-v2-HSJHXN6E-DEiZ8yVf.js +1 -0
- package/dist/app/assets/{clike-dVQK0iCE.js → clike-BTu-jlbg.js} +1 -1
- package/dist/app/assets/{clojure-_I7oUYLh.js → clojure-CWuIqmnC.js} +1 -1
- package/dist/app/assets/clone-DHhyVjHM.js +1 -0
- package/dist/app/assets/{cmake-VLeg6CIA.js → cmake-C_DmsR2l.js} +1 -1
- package/dist/app/assets/{cobol-CXrTAELN.js → cobol-D9rN6yOu.js} +1 -1
- package/dist/app/assets/{coffeescript-D3PuU-yU.js → coffeescript-CjNp1OoD.js} +1 -1
- package/dist/app/assets/{concurnas-Bq5Sn-8p.js → concurnas-Dbzvtjw7.js} +1 -1
- package/dist/app/assets/{coq-DRNw2I4c.js → coq-Dnplsn_p.js} +1 -1
- package/dist/app/assets/{core-sRD64d7H.js → core-DaIicPjZ.js} +1 -1
- package/dist/app/assets/{cose-bilkent-S5V4N54A-uleqFww7.js → cose-bilkent-S5V4N54A-CZYD9QL5.js} +1 -1
- package/dist/app/assets/{cpp-BDi4JlwY.js → cpp-B2tMtmdT.js} +1 -1
- package/dist/app/assets/{crystal-BhcbrMpD.js → crystal-B85xRApU.js} +1 -1
- package/dist/app/assets/{csharp-Cw8JnLSL.js → csharp-DlzgHPw-.js} +1 -1
- package/dist/app/assets/{cshtml-DXOu3MO1.js → cshtml-BB0Doc4I.js} +1 -1
- package/dist/app/assets/{csp-hJziNvFM.js → csp-B7zReT9J.js} +1 -1
- package/dist/app/assets/{css-DTw2TWVx.js → css-4X-hqGp9.js} +1 -1
- package/dist/app/assets/{css-extras-PKQV57Zr.js → css-extras-oA4te4Gm.js} +1 -1
- package/dist/app/assets/{csv-DxeK1pCZ.js → csv-Bx5fzmN2.js} +1 -1
- package/dist/app/assets/{cypher-B7sxi8sn.js → cypher-BmtvnF6J.js} +1 -1
- package/dist/app/assets/{d-VOENt14s.js → d-DNdNlmb_.js} +1 -1
- package/dist/app/assets/{dagre-KV5264BT-F8PHo6-o.js → dagre-KV5264BT-tRMzEfFX.js} +1 -1
- package/dist/app/assets/{dart-C6P3kCs3.js → dart-C_L8tLMH.js} +1 -1
- package/dist/app/assets/{dataweave-zcqXRaeA.js → dataweave-Cm6nicVK.js} +1 -1
- package/dist/app/assets/{dax-C5_rBzHq.js → dax-DA7Z9u0C.js} +1 -1
- package/dist/app/assets/{dhall-Bx3A89qP.js → dhall-B-ooKBMW.js} +1 -1
- package/dist/app/assets/{diagram-5BDNPKRD-BJ6gx1Gb.js → diagram-5BDNPKRD-DktplagK.js} +1 -1
- package/dist/app/assets/{diagram-G4DWMVQ6-4TsobmGQ.js → diagram-G4DWMVQ6-DdeNwu6D.js} +1 -1
- package/dist/app/assets/{diagram-MMDJMWI5-C15cfaVx.js → diagram-MMDJMWI5-B8Rx76tI.js} +1 -1
- package/dist/app/assets/{diagram-TYMM5635-C4QWM_wV.js → diagram-TYMM5635-CpLKhoLD.js} +1 -1
- package/dist/app/assets/{diff-DIp53C-C.js → diff-CkU9PezU.js} +1 -1
- package/dist/app/assets/{django-C8OufmY4.js → django-BUpxsuR3.js} +1 -1
- package/dist/app/assets/{dns-zone-file-BynM2b-W.js → dns-zone-file-BcxW9-ye.js} +1 -1
- package/dist/app/assets/{docker-CHYID_Vv.js → docker-BgfhoWeo.js} +1 -1
- package/dist/app/assets/{dot-CxRj9_e0.js → dot-DYd0jWq7.js} +1 -1
- package/dist/app/assets/{ebnf-DX9131Gx.js → ebnf-CwAUS4GI.js} +1 -1
- package/dist/app/assets/{editorconfig-D4jacbLb.js → editorconfig-2Z1t0uLG.js} +1 -1
- package/dist/app/assets/{eiffel-ChlDTIQd.js → eiffel-CQA7xyaa.js} +1 -1
- package/dist/app/assets/{ejs-DMwwVwMt.js → ejs-D7rnVfcE.js} +1 -1
- package/dist/app/assets/{elixir-BQqiT3Sk.js → elixir-Asp7SxP7.js} +1 -1
- package/dist/app/assets/{elm-pfx4TW8i.js → elm-DxK8Ddgp.js} +1 -1
- package/dist/app/assets/{erDiagram-SMLLAGMA-BkNAnp-O.js → erDiagram-SMLLAGMA-K49WP4n-.js} +1 -1
- package/dist/app/assets/{erb-6Zc-tMAk.js → erb-DEBeuDPE.js} +1 -1
- package/dist/app/assets/{erlang-NGXc_i-u.js → erlang-D7htIZK8.js} +1 -1
- package/dist/app/assets/{etlua-eDkjyVnU.js → etlua-BlGs_4lF.js} +1 -1
- package/dist/app/assets/{excel-formula-7XJSUddh.js → excel-formula-CK3hePG9.js} +1 -1
- package/dist/app/assets/{factor-BDm_BSrr.js → factor-DnsbG8KN.js} +1 -1
- package/dist/app/assets/{false-CmPeUbjY.js → false-DrfPLSzU.js} +1 -1
- package/dist/app/assets/{firestore-security-rules-DHkZlm67.js → firestore-security-rules-BkdAFCbP.js} +1 -1
- package/dist/app/assets/{flow-C-a8u5C0.js → flow-DT5PiBFI.js} +1 -1
- package/dist/app/assets/{flowDiagram-DWJPFMVM-Dos2R6DF.js → flowDiagram-DWJPFMVM-BL7NBe0y.js} +1 -1
- package/dist/app/assets/{fortran-DgmvqnEK.js → fortran-C6gqnbyi.js} +1 -1
- package/dist/app/assets/{fsharp-TKADo8lI.js → fsharp-Dh93ZDo3.js} +1 -1
- package/dist/app/assets/{ftl-BmLn54KU.js → ftl-D1k6v3ab.js} +1 -1
- package/dist/app/assets/{ganttDiagram-T4ZO3ILL-DaVRJ0Uz.js → ganttDiagram-T4ZO3ILL-DPQxB5fd.js} +1 -1
- package/dist/app/assets/{gap-Bjsk63TZ.js → gap-s7duXtyc.js} +1 -1
- package/dist/app/assets/{gcode-1WjVfVzX.js → gcode-b0diTpBu.js} +1 -1
- package/dist/app/assets/{gdscript-DciRg-5W.js → gdscript-BRXpwYiP.js} +1 -1
- package/dist/app/assets/{gedcom-DFjhwBQZ.js → gedcom-CxxdqLGd.js} +1 -1
- package/dist/app/assets/{gherkin-CO-3f6VP.js → gherkin-DmiP4iOs.js} +1 -1
- package/dist/app/assets/{git-JidzCe0C.js → git-WeZBm9Mv.js} +1 -1
- package/dist/app/assets/{gitGraphDiagram-UUTBAWPF-BDm3Pi5R.js → gitGraphDiagram-UUTBAWPF-CTtL-lsS.js} +1 -1
- package/dist/app/assets/{glsl-DDTjG0bk.js → glsl-Cr2KgyEy.js} +1 -1
- package/dist/app/assets/{gml-k6Q_j5IU.js → gml-CBHBkSzU.js} +1 -1
- package/dist/app/assets/{gn-CJsI82tl.js → gn-BvwxoVKq.js} +1 -1
- package/dist/app/assets/{go-C-knydKg.js → go-P-kvLVn4.js} +1 -1
- package/dist/app/assets/{go-module-CfZylmWG.js → go-module-BQkXLsXM.js} +1 -1
- package/dist/app/assets/{graph-CX9fPkqi.js → graph-CI975tbR.js} +1 -1
- package/dist/app/assets/{graphql-DNzt2Vv1.js → graphql-Bi_8Gw_o.js} +1 -1
- package/dist/app/assets/{groovy-BtP_mAne.js → groovy-C2iTFQHO.js} +1 -1
- package/dist/app/assets/{haml-CexsUymU.js → haml-D3zK6VZi.js} +1 -1
- package/dist/app/assets/{handlebars-Co1eX_hJ.js → handlebars-BKuiwczX.js} +1 -1
- package/dist/app/assets/{haskell-PQ0sv3zH.js → haskell-xU8uPK_M.js} +1 -1
- package/dist/app/assets/{haxe-CUwllgrP.js → haxe-4El-3Qf3.js} +1 -1
- package/dist/app/assets/{hcl-Mhayh0kN.js → hcl-BymQT6w3.js} +1 -1
- package/dist/app/assets/{hlsl-CxQjFTxz.js → hlsl-GYYug2rT.js} +1 -1
- package/dist/app/assets/{hoon-DHelY60I.js → hoon-BTr-IN7W.js} +1 -1
- package/dist/app/assets/{hpkp-CNOmVbEe.js → hpkp-EeenN1ik.js} +1 -1
- package/dist/app/assets/{hsts-J3H51YU7.js → hsts-BiJ8liXW.js} +1 -1
- package/dist/app/assets/{http-BBPS6mp1.js → http-cZfx3iY-.js} +1 -1
- package/dist/app/assets/{ichigojam-WoI4Sjvh.js → ichigojam-DaqnPAmo.js} +1 -1
- package/dist/app/assets/{icon-Cxqt5frF.js → icon-8foEYlVm.js} +1 -1
- package/dist/app/assets/{icu-message-format-CbNr2X1z.js → icu-message-format-2efOSn2z.js} +1 -1
- package/dist/app/assets/{idris-B_uYD37d.js → idris-Ci-VjtRz.js} +1 -1
- package/dist/app/assets/{iecst-DBH5ZBla.js → iecst-D7pXnPu5.js} +1 -1
- package/dist/app/assets/{ignore-e11AExB3.js → ignore-ZDiwlUHg.js} +1 -1
- package/dist/app/assets/index-ByEJy9Db.css +1 -0
- package/dist/app/assets/index-Dhjcgkd2.js +783 -0
- package/dist/app/assets/{infoDiagram-42DDH7IO-C6vGng8S.js → infoDiagram-42DDH7IO-qsFulf8a.js} +1 -1
- package/dist/app/assets/{inform7-BuBdwiiY.js → inform7-D-AQ1yUh.js} +1 -1
- package/dist/app/assets/{ini-CZG2vXy_.js → ini-D7xEf_ZJ.js} +1 -1
- package/dist/app/assets/{io-CTkwXIPH.js → io-Du75HCBk.js} +1 -1
- package/dist/app/assets/{ishikawaDiagram-UXIWVN3A-B1in37bc.js → ishikawaDiagram-UXIWVN3A-CCPYtAiV.js} +1 -1
- package/dist/app/assets/{j-DuEjM6Bj.js → j-CyLiy40E.js} +1 -1
- package/dist/app/assets/{java-BlZmoU8I.js → java-BORZa_1c.js} +1 -1
- package/dist/app/assets/{javadoc-C2k6A4-n.js → javadoc-Bg7a55z8.js} +1 -1
- package/dist/app/assets/{javadoclike-kK2hIzbB.js → javadoclike-BPMyp7rY.js} +1 -1
- package/dist/app/assets/{javascript-BoS5KR_7.js → javascript-CvWtFfS6.js} +1 -1
- package/dist/app/assets/{javastacktrace-LrtuAnj1.js → javastacktrace-Q7q4zODA.js} +1 -1
- package/dist/app/assets/{jexl-BLuWwkDx.js → jexl-isz4nFgK.js} +1 -1
- package/dist/app/assets/{jolie-CwQmCAzP.js → jolie-BGE0_bMK.js} +1 -1
- package/dist/app/assets/{journeyDiagram-VCZTEJTY-BaS3mXyF.js → journeyDiagram-VCZTEJTY-Dp-PzTkw.js} +1 -1
- package/dist/app/assets/{jq-BEXhHNOY.js → jq-ldbHw_4O.js} +1 -1
- package/dist/app/assets/{js-extras-Ct8_w3lG.js → js-extras-CZ3jMEZ9.js} +1 -1
- package/dist/app/assets/{js-templates-BkILqbLu.js → js-templates-Bl6rBjHO.js} +1 -1
- package/dist/app/assets/{jsdoc-CoMibHem.js → jsdoc-BRJHyrn7.js} +1 -1
- package/dist/app/assets/{json-CY_RB4MI.js → json-D1VZFKhS.js} +1 -1
- package/dist/app/assets/{json5-Dj8cRnNr.js → json5-i4Qi4QyC.js} +1 -1
- package/dist/app/assets/{jsonp-P7RxrUXF.js → jsonp-ByovSToR.js} +1 -1
- package/dist/app/assets/{jsstacktrace-BNUg_CVa.js → jsstacktrace-C-Y77IDg.js} +1 -1
- package/dist/app/assets/{jsx-CEVEgFxG.js → jsx-xNRr77R1.js} +1 -1
- package/dist/app/assets/{julia-DfDHC1h7.js → julia-6uXZNxti.js} +1 -1
- package/dist/app/assets/{kanban-definition-6JOO6SKY-CD7tPba2.js → kanban-definition-6JOO6SKY-CBVxt2iH.js} +1 -1
- package/dist/app/assets/{keepalived-oFPT0tbW.js → keepalived-mOJyA6AP.js} +1 -1
- package/dist/app/assets/{keyman-C57wO1cD.js → keyman-GEyQtFOQ.js} +1 -1
- package/dist/app/assets/{kotlin-ZOXm9fam.js → kotlin-CsWRFQ5h.js} +1 -1
- package/dist/app/assets/{kumir-Bnsvckx9.js → kumir-B9N9ffP8.js} +1 -1
- package/dist/app/assets/{kusto-jXKPAUmp.js → kusto-CxczcDbO.js} +1 -1
- package/dist/app/assets/{latex-CMqvt8Q2.js → latex-DmsW1eIj.js} +1 -1
- package/dist/app/assets/{latte-BZeQRR6X.js → latte-DE3LvfPo.js} +1 -1
- package/dist/app/assets/{layout-D1Cr86UF.js → layout-4qbeMAUn.js} +1 -1
- package/dist/app/assets/{less-DzlT6rR0.js → less-BKQSUnqi.js} +1 -1
- package/dist/app/assets/{lilypond-Bhy1kxEo.js → lilypond-Cr-QFNrw.js} +1 -1
- package/dist/app/assets/{linear-CYv9ZVDs.js → linear-BjkDab05.js} +1 -1
- package/dist/app/assets/{liquid-a0kLlmeN.js → liquid-CXgMPhuC.js} +1 -1
- package/dist/app/assets/{lisp-48BMMQcI.js → lisp-CiumAVOR.js} +1 -1
- package/dist/app/assets/{livescript-DE5TQT-Y.js → livescript-C5krFvrG.js} +1 -1
- package/dist/app/assets/{llvm-DYLeeTIC.js → llvm-D9T7-zdJ.js} +1 -1
- package/dist/app/assets/{log-BN0LG1yL.js → log-Cm0ilIBB.js} +1 -1
- package/dist/app/assets/{lolcode-CYCvRp7b.js → lolcode-DDrZRfXj.js} +1 -1
- package/dist/app/assets/{lua-CqLmWD7C.js → lua-BANtDeRn.js} +1 -1
- package/dist/app/assets/{magma-Bke0ceyc.js → magma-CJhO9aNE.js} +1 -1
- package/dist/app/assets/{makefile-DBlcQubt.js → makefile-BO5ac4zj.js} +1 -1
- package/dist/app/assets/{markdown-BH45bEmz.js → markdown-Cis11uLI.js} +1 -1
- package/dist/app/assets/{markup-DmFxGmf3.js → markup-B5C4aWCw.js} +1 -1
- package/dist/app/assets/{markup-templating-B_q0uBR_.js → markup-templating-ifL9oso1.js} +1 -1
- package/dist/app/assets/{matlab-BvTng_-n.js → matlab-D_bSkjl3.js} +1 -1
- package/dist/app/assets/{maxscript-EAjZrtH-.js → maxscript-B4w_NGUt.js} +1 -1
- package/dist/app/assets/{mel-B31GmaYN.js → mel-BQtDUDSl.js} +1 -1
- package/dist/app/assets/{mermaid-Bbo9oxye.js → mermaid-D6c0G_Kx.js} +1 -1
- package/dist/app/assets/{min-C1erP2ys.js → min-BTss1J89.js} +1 -1
- package/dist/app/assets/{mindmap-definition-QFDTVHPH-DoDM_kwT.js → mindmap-definition-QFDTVHPH-B_EzN4dO.js} +1 -1
- package/dist/app/assets/{mizar-CA6MYAa-.js → mizar-uXdg4VbY.js} +1 -1
- package/dist/app/assets/{mongodb-DBUwhD50.js → mongodb-BRh2n0N8.js} +1 -1
- package/dist/app/assets/{monkey-W8cNL4gi.js → monkey-Cj_Ypcjz.js} +1 -1
- package/dist/app/assets/{moonscript-DlXhfU4k.js → moonscript-BS5TYpAD.js} +1 -1
- package/dist/app/assets/{n1ql-Dd4Dcmn4.js → n1ql-h-GwG1VD.js} +1 -1
- package/dist/app/assets/{n4js-BJwReVRf.js → n4js-DwOp8-gQ.js} +1 -1
- package/dist/app/assets/{nand2tetris-hdl-DeAovU0i.js → nand2tetris-hdl-BYIWbTW0.js} +1 -1
- package/dist/app/assets/{naniscript-B5DfcucH.js → naniscript-Bqj2-zvD.js} +1 -1
- package/dist/app/assets/{nasm-B2p6UrEt.js → nasm-Cjpbazs7.js} +1 -1
- package/dist/app/assets/{neon-LRGEn3Kl.js → neon-KZ8m5CNH.js} +1 -1
- package/dist/app/assets/{nevod-DA521y4e.js → nevod-BFQPDhdA.js} +1 -1
- package/dist/app/assets/{nginx-DkBE6sdh.js → nginx-byNomVlc.js} +1 -1
- package/dist/app/assets/{nim-BwHhtLL4.js → nim-B3RxwmW3.js} +1 -1
- package/dist/app/assets/{nix-DEjXGklZ.js → nix-q6I64S2d.js} +1 -1
- package/dist/app/assets/{nsis-CvAF9MTd.js → nsis-BEb5YQRW.js} +1 -1
- package/dist/app/assets/{objectivec-BnL4g9NC.js → objectivec-CO0KFJa0.js} +1 -1
- package/dist/app/assets/{ocaml-eNTexkzn.js → ocaml-CCIbkxZU.js} +1 -1
- package/dist/app/assets/{opencl-D1mGywOY.js → opencl-erGBsqyl.js} +1 -1
- package/dist/app/assets/{openqasm-lFdkM6pg.js → openqasm-oy9eJafq.js} +1 -1
- package/dist/app/assets/{oz-DHvmEwQV.js → oz-kUlT5hOx.js} +1 -1
- package/dist/app/assets/{parigp-es3NjzpJ.js → parigp-B4F0kO7T.js} +1 -1
- package/dist/app/assets/{parser-Bak-ak7k.js → parser-Pd03v03H.js} +1 -1
- package/dist/app/assets/{pascal-DJr5JSGs.js → pascal-D7VtaOR_.js} +1 -1
- package/dist/app/assets/{pascaligo-ClJZy1ED.js → pascaligo-BsoDDLnG.js} +1 -1
- package/dist/app/assets/{pcaxis-Cq269eOX.js → pcaxis-6eIt2uWr.js} +1 -1
- package/dist/app/assets/{peoplecode-CyL_NE7O.js → peoplecode-Cj_HuMnX.js} +1 -1
- package/dist/app/assets/{perl-DXU8D9bf.js → perl-DG8o_cRj.js} +1 -1
- package/dist/app/assets/{php-D7BV8qZw.js → php-C9JJgi6K.js} +1 -1
- package/dist/app/assets/{php-extras-DOPW1PzN.js → php-extras-CS96ORuL.js} +1 -1
- package/dist/app/assets/{phpdoc-CRtNn35u.js → phpdoc-D7WjEhRt.js} +1 -1
- package/dist/app/assets/{pieDiagram-DEJITSTG-sozKWzq0.js → pieDiagram-DEJITSTG-CQNSiGOh.js} +1 -1
- package/dist/app/assets/{plsql-BMvjxqWu.js → plsql-UvgqM4c9.js} +1 -1
- package/dist/app/assets/{powerquery-672I_RiA.js → powerquery-BHsnbXJn.js} +1 -1
- package/dist/app/assets/{powershell-Bbhz0xjs.js → powershell-BCEkYY4m.js} +1 -1
- package/dist/app/assets/{processing-onwQ_mg1.js → processing-uq51tijW.js} +1 -1
- package/dist/app/assets/{prolog-R0mnr85o.js → prolog-CKPVWHOP.js} +1 -1
- package/dist/app/assets/{promql-Cpdica46.js → promql-pFZavJG1.js} +1 -1
- package/dist/app/assets/{properties-DHo8PbRa.js → properties-wZDMFu9m.js} +1 -1
- package/dist/app/assets/{protobuf-DkjPAzxf.js → protobuf-Do_aI6XD.js} +1 -1
- package/dist/app/assets/{psl-bLvkZS_A.js → psl-CSX8r7cg.js} +1 -1
- package/dist/app/assets/{pug-ByCsGE0M.js → pug-BiFwujbn.js} +1 -1
- package/dist/app/assets/{puppet-Bln8m9q9.js → puppet-rhkG_gac.js} +1 -1
- package/dist/app/assets/{pure-ClPohX0Q.js → pure-B5TYQW6V.js} +1 -1
- package/dist/app/assets/{purebasic-K5G6Cxnt.js → purebasic-BQqqckgl.js} +1 -1
- package/dist/app/assets/{purescript-BvwLUX-O.js → purescript-Dnl9fMXr.js} +1 -1
- package/dist/app/assets/{q-zX6rqsIp.js → q-BPkM67H-.js} +1 -1
- package/dist/app/assets/{qml-CklZzPNb.js → qml-DmOkE1eK.js} +1 -1
- package/dist/app/assets/{qore-B9lXXujC.js → qore-DJdczB4h.js} +1 -1
- package/dist/app/assets/{qsharp-x147BCXH.js → qsharp-D8Wt_9UU.js} +1 -1
- package/dist/app/assets/{quadrantDiagram-34T5L4WZ-B-6ATLiH.js → quadrantDiagram-34T5L4WZ-D5Wa-k-R.js} +1 -1
- package/dist/app/assets/{r-Axvo4Zd_.js → r-CvFeUrC2.js} +1 -1
- package/dist/app/assets/{racket-xW0BNq3A.js → racket-DIch2le7.js} +1 -1
- package/dist/app/assets/{reason-f5QENJ-q.js → reason-_HeCCQOa.js} +1 -1
- package/dist/app/assets/{regex-BpaxF7jU.js → regex-DrK9U1Ss.js} +1 -1
- package/dist/app/assets/{rego-BUom_JrJ.js → rego-Dyt9SLQw.js} +1 -1
- package/dist/app/assets/{renpy-CJyvxC3b.js → renpy-UBuAzST9.js} +1 -1
- package/dist/app/assets/{requirementDiagram-MS252O5E-CYxoCRf9.js → requirementDiagram-MS252O5E-ChjFgy6d.js} +1 -1
- package/dist/app/assets/{rest-B4ukFYPn.js → rest-Bs9aeFEk.js} +1 -1
- package/dist/app/assets/{rip-B4q_Vw7R.js → rip-BB_KYuIC.js} +1 -1
- package/dist/app/assets/{roboconf-CtkjsQy6.js → roboconf-D0WukcOW.js} +1 -1
- package/dist/app/assets/{robotframework-DNz8f1Ip.js → robotframework-CMvhhw54.js} +1 -1
- package/dist/app/assets/{ruby-rJz8oHeT.js → ruby-pFemCbil.js} +1 -1
- package/dist/app/assets/{rust-Cqf9gv1-.js → rust-DF3EqX1S.js} +1 -1
- package/dist/app/assets/{sankeyDiagram-XADWPNL6-DdDztt4E.js → sankeyDiagram-XADWPNL6-CiPoMK5i.js} +1 -1
- package/dist/app/assets/{sas-EnB4FWaC.js → sas-9TwwSQms.js} +1 -1
- package/dist/app/assets/{sass-DZUC6NF8.js → sass-DEyn20Ei.js} +1 -1
- package/dist/app/assets/{scala-DUd3GTdg.js → scala-lTobuDNu.js} +1 -1
- package/dist/app/assets/{scheme-BiPREGfN.js → scheme-CyFmrRXG.js} +1 -1
- package/dist/app/assets/{scss-gvdTHnI9.js → scss-BNUU2T1-.js} +1 -1
- package/dist/app/assets/{sequenceDiagram-FGHM5R23-lyt-X7gd.js → sequenceDiagram-FGHM5R23-DkvmNOiZ.js} +1 -1
- package/dist/app/assets/{shell-session-BOZ-lbqx.js → shell-session-BUz5JKa0.js} +1 -1
- package/dist/app/assets/{smali-BRGQxjkp.js → smali-D_voRLcR.js} +1 -1
- package/dist/app/assets/{smalltalk-4xLJEhv1.js → smalltalk-CZzT0fXG.js} +1 -1
- package/dist/app/assets/{smarty-HC6iTXED.js → smarty-CC8W-4yi.js} +1 -1
- package/dist/app/assets/{sml-aSisqwwP.js → sml-DEtchvlm.js} +1 -1
- package/dist/app/assets/{solidity-wi6bpO7H.js → solidity-CJP_at0Y.js} +1 -1
- package/dist/app/assets/{solution-file-BiKyTt1v.js → solution-file-DZ3yhRgr.js} +1 -1
- package/dist/app/assets/{soy-B5zGlrys.js → soy-2QgpQcNT.js} +1 -1
- package/dist/app/assets/{sparql-DknctEWY.js → sparql-C70trGFM.js} +1 -1
- package/dist/app/assets/{splunk-spl-uHY5PLUO.js → splunk-spl-DgAqkvL6.js} +1 -1
- package/dist/app/assets/{sqf-C_xrVS5o.js → sqf-CKHCoq-s.js} +1 -1
- package/dist/app/assets/{sql-BPenyVf5.js → sql-B4p393Uq.js} +1 -1
- package/dist/app/assets/{squirrel-DADHl-33.js → squirrel-QUc5dcEe.js} +1 -1
- package/dist/app/assets/{stan-DrWoR2TQ.js → stan-WQYnn83z.js} +1 -1
- package/dist/app/assets/{stateDiagram-FHFEXIEX-CZaq-pRy.js → stateDiagram-FHFEXIEX-Dv7vjL3_.js} +1 -1
- package/dist/app/assets/stateDiagram-v2-QKLJ7IA2-fPoLgwEW.js +1 -0
- package/dist/app/assets/{stylus-BteIttv6.js → stylus-CULsnqIg.js} +1 -1
- package/dist/app/assets/{swift-CID0lx8z.js → swift-hxmM6-_8.js} +1 -1
- package/dist/app/assets/{systemd-BfSaVXI_.js → systemd-DpNpRzK5.js} +1 -1
- package/dist/app/assets/{t4-cs-BnGkiA9f.js → t4-cs-nfrB5Coj.js} +1 -1
- package/dist/app/assets/{t4-templating-DU7VnNhm.js → t4-templating-CVCf3znz.js} +1 -1
- package/dist/app/assets/{t4-vb-DqrbsRf8.js → t4-vb-B16OrZVJ.js} +1 -1
- package/dist/app/assets/{tap-4N6JZhAV.js → tap-DvU0tybQ.js} +1 -1
- package/dist/app/assets/{tcl-DAdjH7wF.js → tcl-Bl_-JovV.js} +1 -1
- package/dist/app/assets/{textile-Du9JitF-.js → textile-Dr1eH9-d.js} +1 -1
- package/dist/app/assets/{timeline-definition-GMOUNBTQ-CdXHfEQv.js → timeline-definition-GMOUNBTQ-CucseErE.js} +1 -1
- package/dist/app/assets/{toml-B1OC92l7.js → toml-DAe_bMWw.js} +1 -1
- package/dist/app/assets/{tremor-CcXF5xRR.js → tremor-CVQ4rfT2.js} +1 -1
- package/dist/app/assets/{tt2-CbRAm8Dv.js → tt2-LJMAC-gQ.js} +1 -1
- package/dist/app/assets/{turtle-BYM3wDgF.js → turtle-BBJqFhgY.js} +1 -1
- package/dist/app/assets/{twig-jMTWKrUr.js → twig-DU8fAKzZ.js} +1 -1
- package/dist/app/assets/{typescript-BUWfHro-.js → typescript-DM8-YkbH.js} +1 -1
- package/dist/app/assets/{typoscript-BYuR5WoR.js → typoscript-Bt5ybkfj.js} +1 -1
- package/dist/app/assets/{unrealscript-D0Ks49Es.js → unrealscript-bcN0JVAK.js} +1 -1
- package/dist/app/assets/{uorazor-BJa2k0kx.js → uorazor-CwW5To5r.js} +1 -1
- package/dist/app/assets/{uri-BC41d-Kc.js → uri-BM8ENuK7.js} +1 -1
- package/dist/app/assets/{v-pMjd7J8c.js → v-4qq2l5aK.js} +1 -1
- package/dist/app/assets/{vala-Cc2iyU85.js → vala-A1mREfzh.js} +1 -1
- package/dist/app/assets/{vbnet-Cw4YKA4r.js → vbnet-BF1HxRbX.js} +1 -1
- package/dist/app/assets/{velocity-DgoH540V.js → velocity-hZs35ylH.js} +1 -1
- package/dist/app/assets/{vennDiagram-DHZGUBPP-BGQ4WYyA.js → vennDiagram-DHZGUBPP-Dn1AeSpS.js} +1 -1
- package/dist/app/assets/{verilog-B3IpJw7p.js → verilog-CHyy5vok.js} +1 -1
- package/dist/app/assets/{vhdl-Bp_kvSRI.js → vhdl-BQMwaEIW.js} +1 -1
- package/dist/app/assets/{vim-vIMCVl5h.js → vim-hjq04YG0.js} +1 -1
- package/dist/app/assets/{visual-basic-BDowvLdG.js → visual-basic-8epcuO4j.js} +1 -1
- package/dist/app/assets/{wardley-RL74JXVD-Q35_vT4f.js → wardley-RL74JXVD-BMkTxHhP.js} +1 -1
- package/dist/app/assets/{wardleyDiagram-NUSXRM2D-tiJkvEP3.js → wardleyDiagram-NUSXRM2D-D8sBZ-rS.js} +1 -1
- package/dist/app/assets/{warpscript-CGawrQhB.js → warpscript-Ds6lgQqp.js} +1 -1
- package/dist/app/assets/{wasm-DioreXvc.js → wasm-jqUJwbVA.js} +1 -1
- package/dist/app/assets/{web-idl-Cl19lMMv.js → web-idl-T-Nf9lcj.js} +1 -1
- package/dist/app/assets/{wiki-fhUrXEuf.js → wiki-CP-RFXYT.js} +1 -1
- package/dist/app/assets/{wolfram-BBdTj5xJ.js → wolfram-B7o1VN3S.js} +1 -1
- package/dist/app/assets/{wren-DyGar7gV.js → wren-rTRlHg2G.js} +1 -1
- package/dist/app/assets/{xeora-NACaryDq.js → xeora-DKORNXS1.js} +1 -1
- package/dist/app/assets/{xml-doc-Deba7Hms.js → xml-doc-CvhjVdpl.js} +1 -1
- package/dist/app/assets/{xojo-BDayHUxW.js → xojo-BOISBO0y.js} +1 -1
- package/dist/app/assets/{xquery-BUHudJSq.js → xquery-B71HpPrq.js} +1 -1
- package/dist/app/assets/{xychartDiagram-5P7HB3ND-lPbACL4f.js → xychartDiagram-5P7HB3ND-BpNT2hU1.js} +1 -1
- package/dist/app/assets/{yaml-Mc4-fPw6.js → yaml-CnAA7buj.js} +1 -1
- package/dist/app/assets/{yang-D4m2oyuH.js → yang-B7WmrVZq.js} +1 -1
- package/dist/app/assets/{zig-B87WilJ7.js → zig-CIQnioFn.js} +1 -1
- package/dist/app/index.html +2 -2
- package/dist/index.cjs +1178 -864
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1139 -822
- package/package.json +3 -3
- package/dist/app/assets/channel-Dza7FWEy.js +0 -1
- package/dist/app/assets/classDiagram-6PBFFD2Q-hqaQDDNp.js +0 -1
- package/dist/app/assets/classDiagram-v2-HSJHXN6E-hqaQDDNp.js +0 -1
- package/dist/app/assets/clone-QKEFKOuT.js +0 -1
- package/dist/app/assets/index-Bz1k_vD4.js +0 -762
- package/dist/app/assets/index-CtioO_Xd.css +0 -1
- package/dist/app/assets/stateDiagram-v2-QKLJ7IA2-CjL5rpeW.js +0 -1
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// src/components/chat.tsx
|
|
2
|
-
import * as
|
|
2
|
+
import * as React56 from "react";
|
|
3
3
|
import {
|
|
4
4
|
ArrowDown as ArrowDown2,
|
|
5
5
|
ChevronDown as ChevronDown5,
|
|
6
6
|
FileText as FileText5,
|
|
7
|
-
ImageIcon,
|
|
8
|
-
Loader2 as
|
|
7
|
+
ImageIcon as ImageIcon2,
|
|
8
|
+
Loader2 as Loader212,
|
|
9
9
|
Minus,
|
|
10
10
|
Pause,
|
|
11
11
|
Pencil as Pencil4,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
Settings as Settings2,
|
|
15
15
|
Target as Target3,
|
|
16
16
|
Trash2 as Trash23,
|
|
17
|
-
X as
|
|
17
|
+
X as X10
|
|
18
18
|
} from "lucide-react";
|
|
19
19
|
import { CHATKIT_TASK_SUMMARY_OPEN_RESOURCE_EFFECT } from "@xpert-ai/chatkit-types";
|
|
20
20
|
|
|
@@ -2555,6 +2555,19 @@ var en_US_default = {
|
|
|
2555
2555
|
copy: "Copy",
|
|
2556
2556
|
copied: "Copied",
|
|
2557
2557
|
separator: ", ",
|
|
2558
|
+
attachments: {
|
|
2559
|
+
imageTitle: "Image {{index}}",
|
|
2560
|
+
loading: "Loading {{title}}",
|
|
2561
|
+
unavailable: "Preview unavailable",
|
|
2562
|
+
retry: "Retry",
|
|
2563
|
+
open: "Open {{title}}",
|
|
2564
|
+
close: "Close image preview",
|
|
2565
|
+
modelDetail: "Model detail: {{detail}}",
|
|
2566
|
+
sources: {
|
|
2567
|
+
"knowledge-document": "Knowledge document",
|
|
2568
|
+
sandbox: "Sandbox"
|
|
2569
|
+
}
|
|
2570
|
+
},
|
|
2558
2571
|
shell: {
|
|
2559
2572
|
success: "Success",
|
|
2560
2573
|
running: "Running",
|
|
@@ -3025,6 +3038,19 @@ var zh_CN_default = {
|
|
|
3025
3038
|
copy: "\u590D\u5236",
|
|
3026
3039
|
copied: "\u5DF2\u590D\u5236",
|
|
3027
3040
|
separator: "\uFF0C",
|
|
3041
|
+
attachments: {
|
|
3042
|
+
imageTitle: "\u56FE\u7247 {{index}}",
|
|
3043
|
+
loading: "\u6B63\u5728\u52A0\u8F7D{{title}}",
|
|
3044
|
+
unavailable: "\u56FE\u7247\u9884\u89C8\u4E0D\u53EF\u7528",
|
|
3045
|
+
retry: "\u91CD\u8BD5",
|
|
3046
|
+
open: "\u67E5\u770B{{title}}",
|
|
3047
|
+
close: "\u5173\u95ED\u56FE\u7247\u9884\u89C8",
|
|
3048
|
+
modelDetail: "\u6A21\u578B\u6E05\u6670\u5EA6\uFF1A{{detail}}",
|
|
3049
|
+
sources: {
|
|
3050
|
+
"knowledge-document": "\u77E5\u8BC6\u6587\u6863",
|
|
3051
|
+
sandbox: "\u6C99\u7BB1"
|
|
3052
|
+
}
|
|
3053
|
+
},
|
|
3028
3054
|
shell: {
|
|
3029
3055
|
success: "\u6210\u529F",
|
|
3030
3056
|
running: "\u8FD0\u884C\u4E2D",
|
|
@@ -8831,8 +8857,8 @@ function useSlashCommands({
|
|
|
8831
8857
|
}
|
|
8832
8858
|
|
|
8833
8859
|
// src/components/thread/messages/ai.tsx
|
|
8834
|
-
import * as
|
|
8835
|
-
import { ChevronDown as ChevronDown4, Clock3 as Clock32, Loader2 as
|
|
8860
|
+
import * as React38 from "react";
|
|
8861
|
+
import { ChevronDown as ChevronDown4, Clock3 as Clock32, Loader2 as Loader29 } from "lucide-react";
|
|
8836
8862
|
|
|
8837
8863
|
// src/lib/agent-run-render-tree.ts
|
|
8838
8864
|
function isTextContent(content) {
|
|
@@ -11341,7 +11367,7 @@ function hasComponentMessageRendererDetails(renderer, content, data) {
|
|
|
11341
11367
|
}
|
|
11342
11368
|
|
|
11343
11369
|
// src/components/thread/messages/tool-component-group.tsx
|
|
11344
|
-
import * as
|
|
11370
|
+
import * as React35 from "react";
|
|
11345
11371
|
import {
|
|
11346
11372
|
BookOpen,
|
|
11347
11373
|
Brain as Brain3,
|
|
@@ -11353,7 +11379,7 @@ import {
|
|
|
11353
11379
|
Copy as Copy2,
|
|
11354
11380
|
FileText as FileText4,
|
|
11355
11381
|
Files,
|
|
11356
|
-
Loader2 as
|
|
11382
|
+
Loader2 as Loader27,
|
|
11357
11383
|
ListTodo as ListTodo2,
|
|
11358
11384
|
Network,
|
|
11359
11385
|
Repeat2,
|
|
@@ -11363,6 +11389,72 @@ import {
|
|
|
11363
11389
|
XCircle as XCircle3
|
|
11364
11390
|
} from "lucide-react";
|
|
11365
11391
|
|
|
11392
|
+
// src/lib/tool-output-attachments.ts
|
|
11393
|
+
import {
|
|
11394
|
+
TOOL_OUTPUT_PRESENTATION_TYPE,
|
|
11395
|
+
TOOL_OUTPUT_PRESENTATION_VERSION
|
|
11396
|
+
} from "@xpert-ai/chatkit-types";
|
|
11397
|
+
import { z } from "zod";
|
|
11398
|
+
var boundedId = z.string().trim().min(1).max(256);
|
|
11399
|
+
var boundedLabel = z.string().trim().min(1).max(500);
|
|
11400
|
+
var toolOutputImageAnchorsSchema = z.object({
|
|
11401
|
+
knowledgeDocumentId: boundedId.optional(),
|
|
11402
|
+
page: z.number().int().positive().max(1e6).optional(),
|
|
11403
|
+
chunkId: boundedId.optional(),
|
|
11404
|
+
sourceBlockIds: z.array(boundedId).max(100).optional(),
|
|
11405
|
+
visualAssetId: boundedId.optional()
|
|
11406
|
+
}).strict();
|
|
11407
|
+
var toolOutputImageAttachmentSchema = z.object({
|
|
11408
|
+
type: z.literal("image"),
|
|
11409
|
+
artifactId: boundedId,
|
|
11410
|
+
artifactVersionId: boundedId,
|
|
11411
|
+
sha256: z.string().regex(/^[a-f0-9]{64}$/i),
|
|
11412
|
+
mimeType: z.enum(["image/png", "image/jpeg", "image/webp"]),
|
|
11413
|
+
width: z.number().int().positive().max(1e5).optional(),
|
|
11414
|
+
height: z.number().int().positive().max(1e5).optional(),
|
|
11415
|
+
title: boundedLabel.optional(),
|
|
11416
|
+
alt: boundedLabel.optional(),
|
|
11417
|
+
source: z.enum(["knowledge-document", "sandbox"]),
|
|
11418
|
+
modelDetail: z.enum(["auto", "low", "high"]),
|
|
11419
|
+
anchors: toolOutputImageAnchorsSchema.optional()
|
|
11420
|
+
}).strict();
|
|
11421
|
+
var toolOutputPresentationSchema = z.object({
|
|
11422
|
+
type: z.literal(TOOL_OUTPUT_PRESENTATION_TYPE),
|
|
11423
|
+
version: z.literal(TOOL_OUTPUT_PRESENTATION_VERSION),
|
|
11424
|
+
attachments: z.array(toolOutputImageAttachmentSchema).min(1).max(20)
|
|
11425
|
+
}).strict();
|
|
11426
|
+
var toolOutputAttachmentPreviewSchema = z.object({
|
|
11427
|
+
previewUrl: z.string().url(),
|
|
11428
|
+
expiresAt: z.string().optional()
|
|
11429
|
+
}).strict().superRefine((preview, context) => {
|
|
11430
|
+
const protocol = new URL(preview.previewUrl).protocol;
|
|
11431
|
+
if (protocol !== "https:" && protocol !== "http:") {
|
|
11432
|
+
context.addIssue({
|
|
11433
|
+
code: "custom",
|
|
11434
|
+
message: "Tool-output previews must use an HTTP(S) URL.",
|
|
11435
|
+
path: ["previewUrl"]
|
|
11436
|
+
});
|
|
11437
|
+
}
|
|
11438
|
+
if (preview.expiresAt && Number.isNaN(Date.parse(preview.expiresAt))) {
|
|
11439
|
+
context.addIssue({
|
|
11440
|
+
code: "custom",
|
|
11441
|
+
message: "Tool-output preview expiry must be an ISO date string.",
|
|
11442
|
+
path: ["expiresAt"]
|
|
11443
|
+
});
|
|
11444
|
+
}
|
|
11445
|
+
});
|
|
11446
|
+
function parseToolOutputPresentation(value) {
|
|
11447
|
+
const result = toolOutputPresentationSchema.safeParse(value);
|
|
11448
|
+
return result.success ? result.data : null;
|
|
11449
|
+
}
|
|
11450
|
+
function parseToolOutputAttachmentPreview(value) {
|
|
11451
|
+
const result = toolOutputAttachmentPreviewSchema.safeParse(value);
|
|
11452
|
+
return result.success ? result.data : null;
|
|
11453
|
+
}
|
|
11454
|
+
function toolOutputAttachmentKey(attachment) {
|
|
11455
|
+
return `${attachment.artifactId}:${attachment.artifactVersionId}:${attachment.sha256}`;
|
|
11456
|
+
}
|
|
11457
|
+
|
|
11366
11458
|
// src/components/thread/messages/sandbox-shell-tool-call.tsx
|
|
11367
11459
|
import * as React33 from "react";
|
|
11368
11460
|
import { Check as Check3, Copy } from "lucide-react";
|
|
@@ -11602,8 +11694,221 @@ function SandboxShellToolCallCard({ data }) {
|
|
|
11602
11694
|
);
|
|
11603
11695
|
}
|
|
11604
11696
|
|
|
11605
|
-
// src/components/thread/messages/tool-
|
|
11697
|
+
// src/components/thread/messages/tool-output-attachments.tsx
|
|
11698
|
+
import * as React34 from "react";
|
|
11699
|
+
import * as Dialog2 from "@radix-ui/react-dialog";
|
|
11700
|
+
import { ImageIcon, Loader2 as Loader26, RefreshCw as RefreshCw3, X as X7 } from "lucide-react";
|
|
11606
11701
|
import { jsx as jsx39, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
11702
|
+
function useToolOutputAttachmentPreview(request) {
|
|
11703
|
+
const parentMessenger = React34.useContext(ParentMessengerContext);
|
|
11704
|
+
const [attempt, setAttempt] = React34.useState(0);
|
|
11705
|
+
const [state, setState] = React34.useState({
|
|
11706
|
+
status: "loading"
|
|
11707
|
+
});
|
|
11708
|
+
const attachmentKey = toolOutputAttachmentKey(request.attachment);
|
|
11709
|
+
React34.useEffect(() => {
|
|
11710
|
+
if (!parentMessenger?.isParentAvailable) {
|
|
11711
|
+
setState({ status: "error" });
|
|
11712
|
+
return;
|
|
11713
|
+
}
|
|
11714
|
+
let cancelled = false;
|
|
11715
|
+
let refreshTimer = null;
|
|
11716
|
+
setState({ status: "loading" });
|
|
11717
|
+
void parentMessenger.sendCommand("onToolOutputAttachmentPreview", request).then((response) => {
|
|
11718
|
+
if (cancelled) return;
|
|
11719
|
+
const preview = parseToolOutputAttachmentPreview(response);
|
|
11720
|
+
if (!preview) {
|
|
11721
|
+
setState({ status: "error" });
|
|
11722
|
+
return;
|
|
11723
|
+
}
|
|
11724
|
+
if (preview.expiresAt) {
|
|
11725
|
+
const remainingLifetime = Date.parse(preview.expiresAt) - Date.now();
|
|
11726
|
+
if (remainingLifetime <= 0) {
|
|
11727
|
+
setState({ status: "error" });
|
|
11728
|
+
return;
|
|
11729
|
+
}
|
|
11730
|
+
refreshTimer = window.setTimeout(
|
|
11731
|
+
() => setAttempt((current) => current + 1),
|
|
11732
|
+
Math.max(1e3, Math.floor(remainingLifetime * 0.8))
|
|
11733
|
+
);
|
|
11734
|
+
}
|
|
11735
|
+
setState({ status: "success", previewUrl: preview.previewUrl });
|
|
11736
|
+
}).catch(() => {
|
|
11737
|
+
if (!cancelled) setState({ status: "error" });
|
|
11738
|
+
});
|
|
11739
|
+
return () => {
|
|
11740
|
+
cancelled = true;
|
|
11741
|
+
if (refreshTimer !== null) window.clearTimeout(refreshTimer);
|
|
11742
|
+
};
|
|
11743
|
+
}, [attachmentKey, attempt, parentMessenger, request]);
|
|
11744
|
+
return {
|
|
11745
|
+
state,
|
|
11746
|
+
fail: () => setState({ status: "error" }),
|
|
11747
|
+
retry: () => setAttempt((current) => current + 1)
|
|
11748
|
+
};
|
|
11749
|
+
}
|
|
11750
|
+
function attachmentTitle(attachment, fallback) {
|
|
11751
|
+
return attachment.title ?? attachment.alt ?? (attachment.anchors?.page ? `${fallback} \xB7 ${attachment.anchors.page}` : fallback);
|
|
11752
|
+
}
|
|
11753
|
+
function ToolOutputImageAttachmentCard({
|
|
11754
|
+
attachment,
|
|
11755
|
+
index,
|
|
11756
|
+
toolCallId,
|
|
11757
|
+
executionId
|
|
11758
|
+
}) {
|
|
11759
|
+
const { t } = useChatkitTranslation();
|
|
11760
|
+
const request = React34.useMemo(
|
|
11761
|
+
() => ({ attachment, toolCallId, executionId }),
|
|
11762
|
+
[attachment, executionId, toolCallId]
|
|
11763
|
+
);
|
|
11764
|
+
const { state, fail, retry } = useToolOutputAttachmentPreview(request);
|
|
11765
|
+
const fallbackTitle = t("message.toolGroup.attachments.imageTitle", {
|
|
11766
|
+
index: index + 1
|
|
11767
|
+
});
|
|
11768
|
+
const title = attachmentTitle(attachment, fallbackTitle);
|
|
11769
|
+
const dimensions = attachment.width && attachment.height ? `${attachment.width} \xD7 ${attachment.height}` : null;
|
|
11770
|
+
const sourceLabel = t(
|
|
11771
|
+
`message.toolGroup.attachments.sources.${attachment.source}`
|
|
11772
|
+
);
|
|
11773
|
+
const description = [
|
|
11774
|
+
sourceLabel,
|
|
11775
|
+
dimensions,
|
|
11776
|
+
t("message.toolGroup.attachments.modelDetail", {
|
|
11777
|
+
detail: attachment.modelDetail
|
|
11778
|
+
})
|
|
11779
|
+
].filter(Boolean).join(" \xB7 ");
|
|
11780
|
+
if (state.status === "loading") {
|
|
11781
|
+
return /* @__PURE__ */ jsx39(
|
|
11782
|
+
"div",
|
|
11783
|
+
{
|
|
11784
|
+
className: "flex aspect-video min-w-0 items-center justify-center rounded-lg border border-border bg-background",
|
|
11785
|
+
"aria-label": t("message.toolGroup.attachments.loading", { title }),
|
|
11786
|
+
children: /* @__PURE__ */ jsx39(
|
|
11787
|
+
Loader26,
|
|
11788
|
+
{
|
|
11789
|
+
className: "h-5 w-5 animate-spin text-muted-foreground",
|
|
11790
|
+
"aria-hidden": "true"
|
|
11791
|
+
}
|
|
11792
|
+
)
|
|
11793
|
+
}
|
|
11794
|
+
);
|
|
11795
|
+
}
|
|
11796
|
+
if (state.status === "error") {
|
|
11797
|
+
return /* @__PURE__ */ jsxs26("div", { className: "flex aspect-video min-w-0 flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-border bg-background px-3 text-center", children: [
|
|
11798
|
+
/* @__PURE__ */ jsx39(
|
|
11799
|
+
ImageIcon,
|
|
11800
|
+
{
|
|
11801
|
+
className: "h-5 w-5 text-muted-foreground",
|
|
11802
|
+
"aria-hidden": "true"
|
|
11803
|
+
}
|
|
11804
|
+
),
|
|
11805
|
+
/* @__PURE__ */ jsx39("span", { className: "line-clamp-2 text-[11px] text-muted-foreground", children: t("message.toolGroup.attachments.unavailable") }),
|
|
11806
|
+
/* @__PURE__ */ jsxs26(
|
|
11807
|
+
"button",
|
|
11808
|
+
{
|
|
11809
|
+
type: "button",
|
|
11810
|
+
className: "inline-flex h-7 items-center gap-1 rounded-md px-2 text-[11px] font-medium text-foreground transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
|
|
11811
|
+
onClick: retry,
|
|
11812
|
+
children: [
|
|
11813
|
+
/* @__PURE__ */ jsx39(RefreshCw3, { className: "h-3 w-3", "aria-hidden": "true" }),
|
|
11814
|
+
t("message.toolGroup.attachments.retry")
|
|
11815
|
+
]
|
|
11816
|
+
}
|
|
11817
|
+
)
|
|
11818
|
+
] });
|
|
11819
|
+
}
|
|
11820
|
+
return /* @__PURE__ */ jsxs26(Dialog2.Root, { children: [
|
|
11821
|
+
/* @__PURE__ */ jsx39(Dialog2.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs26(
|
|
11822
|
+
"button",
|
|
11823
|
+
{
|
|
11824
|
+
type: "button",
|
|
11825
|
+
className: "group relative aspect-video min-w-0 overflow-hidden rounded-lg border border-border bg-background text-left shadow-sm transition hover:border-ring/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
|
|
11826
|
+
"aria-label": t("message.toolGroup.attachments.open", { title }),
|
|
11827
|
+
children: [
|
|
11828
|
+
/* @__PURE__ */ jsx39(
|
|
11829
|
+
"img",
|
|
11830
|
+
{
|
|
11831
|
+
className: "h-full w-full object-cover transition-transform group-hover:scale-[1.02]",
|
|
11832
|
+
src: state.previewUrl,
|
|
11833
|
+
alt: attachment.alt ?? title,
|
|
11834
|
+
loading: "lazy",
|
|
11835
|
+
referrerPolicy: "no-referrer",
|
|
11836
|
+
onError: fail
|
|
11837
|
+
}
|
|
11838
|
+
),
|
|
11839
|
+
/* @__PURE__ */ jsxs26("span", { className: "absolute inset-x-0 bottom-0 bg-black/65 px-2 py-1.5 text-[11px] font-medium leading-4 text-white", children: [
|
|
11840
|
+
/* @__PURE__ */ jsx39("span", { className: "line-clamp-1", children: title }),
|
|
11841
|
+
/* @__PURE__ */ jsx39("span", { className: "block truncate text-white/70", children: description })
|
|
11842
|
+
] })
|
|
11843
|
+
]
|
|
11844
|
+
}
|
|
11845
|
+
) }),
|
|
11846
|
+
/* @__PURE__ */ jsxs26(Dialog2.Portal, { children: [
|
|
11847
|
+
/* @__PURE__ */ jsx39(Dialog2.Overlay, { className: "fixed inset-0 z-[80] bg-black/80 data-[state=closed]:animate-out data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0" }),
|
|
11848
|
+
/* @__PURE__ */ jsxs26(
|
|
11849
|
+
Dialog2.Content,
|
|
11850
|
+
{
|
|
11851
|
+
className: cn(
|
|
11852
|
+
"fixed left-1/2 top-1/2 z-[81] flex max-h-[92vh] w-[min(92vw,1200px)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-border bg-background shadow-2xl",
|
|
11853
|
+
"focus:outline-none data-[state=closed]:animate-out data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95"
|
|
11854
|
+
),
|
|
11855
|
+
children: [
|
|
11856
|
+
/* @__PURE__ */ jsxs26("div", { className: "flex min-w-0 items-start justify-between gap-3 border-b border-border px-4 py-3", children: [
|
|
11857
|
+
/* @__PURE__ */ jsxs26("div", { className: "min-w-0", children: [
|
|
11858
|
+
/* @__PURE__ */ jsx39(Dialog2.Title, { className: "truncate text-sm font-semibold text-foreground", children: title }),
|
|
11859
|
+
/* @__PURE__ */ jsx39(Dialog2.Description, { className: "mt-0.5 text-xs text-muted-foreground", children: description })
|
|
11860
|
+
] }),
|
|
11861
|
+
/* @__PURE__ */ jsx39(
|
|
11862
|
+
Dialog2.Close,
|
|
11863
|
+
{
|
|
11864
|
+
className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
|
|
11865
|
+
"aria-label": t("message.toolGroup.attachments.close"),
|
|
11866
|
+
children: /* @__PURE__ */ jsx39(X7, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
11867
|
+
}
|
|
11868
|
+
)
|
|
11869
|
+
] }),
|
|
11870
|
+
/* @__PURE__ */ jsx39("div", { className: "min-h-0 flex-1 overflow-auto bg-black/95 p-4", children: /* @__PURE__ */ jsx39(
|
|
11871
|
+
"img",
|
|
11872
|
+
{
|
|
11873
|
+
className: "mx-auto h-auto max-h-[calc(92vh-6rem)] max-w-full object-contain",
|
|
11874
|
+
src: state.previewUrl,
|
|
11875
|
+
alt: attachment.alt ?? title,
|
|
11876
|
+
referrerPolicy: "no-referrer",
|
|
11877
|
+
onError: fail
|
|
11878
|
+
}
|
|
11879
|
+
) })
|
|
11880
|
+
]
|
|
11881
|
+
}
|
|
11882
|
+
)
|
|
11883
|
+
] })
|
|
11884
|
+
] });
|
|
11885
|
+
}
|
|
11886
|
+
function ToolOutputAttachments({
|
|
11887
|
+
presentation,
|
|
11888
|
+
toolCallId,
|
|
11889
|
+
executionId
|
|
11890
|
+
}) {
|
|
11891
|
+
return /* @__PURE__ */ jsx39(
|
|
11892
|
+
"div",
|
|
11893
|
+
{
|
|
11894
|
+
className: "grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3",
|
|
11895
|
+
"data-testid": "tool-output-attachments",
|
|
11896
|
+
children: presentation.attachments.map((attachment, index) => /* @__PURE__ */ jsx39(
|
|
11897
|
+
ToolOutputImageAttachmentCard,
|
|
11898
|
+
{
|
|
11899
|
+
attachment,
|
|
11900
|
+
index,
|
|
11901
|
+
toolCallId,
|
|
11902
|
+
executionId
|
|
11903
|
+
},
|
|
11904
|
+
toolOutputAttachmentKey(attachment)
|
|
11905
|
+
))
|
|
11906
|
+
}
|
|
11907
|
+
);
|
|
11908
|
+
}
|
|
11909
|
+
|
|
11910
|
+
// src/components/thread/messages/tool-component-group.tsx
|
|
11911
|
+
import { Fragment as Fragment7, jsx as jsx40, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
11607
11912
|
var toolStatusConfig = {
|
|
11608
11913
|
success: {
|
|
11609
11914
|
iconClass: "border-green-500 text-green-700",
|
|
@@ -11615,7 +11920,7 @@ var toolStatusConfig = {
|
|
|
11615
11920
|
},
|
|
11616
11921
|
running: {
|
|
11617
11922
|
iconClass: "border-blue-500 text-blue-700",
|
|
11618
|
-
icon:
|
|
11923
|
+
icon: Loader27
|
|
11619
11924
|
}
|
|
11620
11925
|
};
|
|
11621
11926
|
var TOOL_GROUP_CATEGORY_ORDER = [
|
|
@@ -11709,10 +12014,10 @@ function formatStepDuration2(durationMs) {
|
|
|
11709
12014
|
return `${minutes}m ${seconds}s`;
|
|
11710
12015
|
}
|
|
11711
12016
|
function useFrozenTimestamp(shouldFreeze) {
|
|
11712
|
-
const [frozenAt, setFrozenAt] =
|
|
12017
|
+
const [frozenAt, setFrozenAt] = React35.useState(
|
|
11713
12018
|
() => shouldFreeze ? Date.now() : null
|
|
11714
12019
|
);
|
|
11715
|
-
|
|
12020
|
+
React35.useEffect(() => {
|
|
11716
12021
|
if (shouldFreeze) {
|
|
11717
12022
|
setFrozenAt((current) => current ?? Date.now());
|
|
11718
12023
|
return;
|
|
@@ -11722,12 +12027,12 @@ function useFrozenTimestamp(shouldFreeze) {
|
|
|
11722
12027
|
return frozenAt;
|
|
11723
12028
|
}
|
|
11724
12029
|
function useToolStepDurationLabel(data, options) {
|
|
11725
|
-
const [durationNow, setDurationNow] =
|
|
12030
|
+
const [durationNow, setDurationNow] = React35.useState(() => Date.now());
|
|
11726
12031
|
const createdAt = parseStepDate(data.created_date);
|
|
11727
12032
|
const explicitEndedAt = parseStepDate(data.end_date);
|
|
11728
12033
|
const status = options?.status ?? data.status;
|
|
11729
12034
|
const endedAt = explicitEndedAt ?? (status !== "running" ? options?.fallbackEndedAt ?? null : null);
|
|
11730
|
-
|
|
12035
|
+
React35.useEffect(() => {
|
|
11731
12036
|
if (status !== "running" || createdAt === null || endedAt !== null) {
|
|
11732
12037
|
return;
|
|
11733
12038
|
}
|
|
@@ -11794,7 +12099,8 @@ function classifyToolToken(value) {
|
|
|
11794
12099
|
return "commands";
|
|
11795
12100
|
}
|
|
11796
12101
|
if (normalized.includes("list")) return "lists";
|
|
11797
|
-
if (normalized.includes("task") || normalized.includes("todo"))
|
|
12102
|
+
if (normalized.includes("task") || normalized.includes("todo"))
|
|
12103
|
+
return "tasks";
|
|
11798
12104
|
if (normalized.includes("knowledge") || normalized.includes("retriever")) {
|
|
11799
12105
|
return "knowledges";
|
|
11800
12106
|
}
|
|
@@ -11806,11 +12112,14 @@ function getToolGroupCategory(content) {
|
|
|
11806
12112
|
return classifyToolToken(data.type) ?? classifyToolToken(data.tool) ?? classifyToolToken(data.title) ?? classifyToolToken(data.message) ?? "tools";
|
|
11807
12113
|
}
|
|
11808
12114
|
function getToolGroupCategoryCounts(items) {
|
|
11809
|
-
return items.reduce(
|
|
11810
|
-
|
|
11811
|
-
|
|
11812
|
-
|
|
11813
|
-
|
|
12115
|
+
return items.reduce(
|
|
12116
|
+
(counts, item) => {
|
|
12117
|
+
const category = getToolGroupCategory(item);
|
|
12118
|
+
counts[category] = (counts[category] ?? 0) + 1;
|
|
12119
|
+
return counts;
|
|
12120
|
+
},
|
|
12121
|
+
{}
|
|
12122
|
+
);
|
|
11814
12123
|
}
|
|
11815
12124
|
function getToolActivityLabel(content, language, statusOverride) {
|
|
11816
12125
|
const data = getToolStepData(content);
|
|
@@ -11915,8 +12224,8 @@ function shouldUseToolsetAvatar(toolset) {
|
|
|
11915
12224
|
}
|
|
11916
12225
|
function useToolsetAvatar(toolsetId, enabled, apiUrl) {
|
|
11917
12226
|
const avatarUrl = enabled ? createToolsetAvatarUrl(toolsetId, apiUrl) : null;
|
|
11918
|
-
const [avatar, setAvatar] =
|
|
11919
|
-
|
|
12227
|
+
const [avatar, setAvatar] = React35.useState(null);
|
|
12228
|
+
React35.useEffect(() => {
|
|
11920
12229
|
if (!avatarUrl) {
|
|
11921
12230
|
setAvatar(null);
|
|
11922
12231
|
return;
|
|
@@ -11948,7 +12257,7 @@ function ToolAvatarIcon({
|
|
|
11948
12257
|
className
|
|
11949
12258
|
}) {
|
|
11950
12259
|
if (avatar.url) {
|
|
11951
|
-
return /* @__PURE__ */
|
|
12260
|
+
return /* @__PURE__ */ jsx40(
|
|
11952
12261
|
"img",
|
|
11953
12262
|
{
|
|
11954
12263
|
alt: "",
|
|
@@ -11961,7 +12270,7 @@ function ToolAvatarIcon({
|
|
|
11961
12270
|
}
|
|
11962
12271
|
const emoji = unicodeFromUnified2(avatar.emoji?.unified);
|
|
11963
12272
|
if (emoji) {
|
|
11964
|
-
return /* @__PURE__ */
|
|
12273
|
+
return /* @__PURE__ */ jsx40(
|
|
11965
12274
|
"span",
|
|
11966
12275
|
{
|
|
11967
12276
|
"aria-hidden": "true",
|
|
@@ -11976,7 +12285,7 @@ function ToolAvatarIcon({
|
|
|
11976
12285
|
}
|
|
11977
12286
|
);
|
|
11978
12287
|
}
|
|
11979
|
-
return /* @__PURE__ */
|
|
12288
|
+
return /* @__PURE__ */ jsx40(
|
|
11980
12289
|
CircleHelp,
|
|
11981
12290
|
{
|
|
11982
12291
|
className,
|
|
@@ -12033,18 +12342,14 @@ function ToolStepIcon({
|
|
|
12033
12342
|
apiUrl
|
|
12034
12343
|
}) {
|
|
12035
12344
|
const usesToolsetAvatar = shouldUseToolsetAvatar(data.toolset);
|
|
12036
|
-
const avatar = useToolsetAvatar(
|
|
12037
|
-
data.toolset_id,
|
|
12038
|
-
usesToolsetAvatar,
|
|
12039
|
-
apiUrl
|
|
12040
|
-
);
|
|
12345
|
+
const avatar = useToolsetAvatar(data.toolset_id, usesToolsetAvatar, apiUrl);
|
|
12041
12346
|
const iconUrl = createToolsetIconUrl(data.toolset, organizationId, apiUrl);
|
|
12042
|
-
const [failedIconUrl, setFailedIconUrl] =
|
|
12043
|
-
|
|
12347
|
+
const [failedIconUrl, setFailedIconUrl] = React35.useState(null);
|
|
12348
|
+
React35.useEffect(() => {
|
|
12044
12349
|
setFailedIconUrl(null);
|
|
12045
12350
|
}, [iconUrl]);
|
|
12046
12351
|
if (avatar) {
|
|
12047
|
-
return /* @__PURE__ */
|
|
12352
|
+
return /* @__PURE__ */ jsx40(
|
|
12048
12353
|
ToolAvatarIcon,
|
|
12049
12354
|
{
|
|
12050
12355
|
avatar,
|
|
@@ -12054,7 +12359,7 @@ function ToolStepIcon({
|
|
|
12054
12359
|
);
|
|
12055
12360
|
}
|
|
12056
12361
|
if (iconUrl && failedIconUrl !== iconUrl) {
|
|
12057
|
-
return /* @__PURE__ */
|
|
12362
|
+
return /* @__PURE__ */ jsx40(
|
|
12058
12363
|
"img",
|
|
12059
12364
|
{
|
|
12060
12365
|
alt: "",
|
|
@@ -12068,7 +12373,7 @@ function ToolStepIcon({
|
|
|
12068
12373
|
}
|
|
12069
12374
|
const TypeIcon = getStepTypeIcon(data.type);
|
|
12070
12375
|
if (TypeIcon) {
|
|
12071
|
-
return /* @__PURE__ */
|
|
12376
|
+
return /* @__PURE__ */ jsx40(
|
|
12072
12377
|
TypeIcon,
|
|
12073
12378
|
{
|
|
12074
12379
|
className,
|
|
@@ -12079,7 +12384,7 @@ function ToolStepIcon({
|
|
|
12079
12384
|
}
|
|
12080
12385
|
const ToolsetIcon = getKnownToolsetIcon(data.toolset);
|
|
12081
12386
|
if (ToolsetIcon) {
|
|
12082
|
-
return /* @__PURE__ */
|
|
12387
|
+
return /* @__PURE__ */ jsx40(
|
|
12083
12388
|
ToolsetIcon,
|
|
12084
12389
|
{
|
|
12085
12390
|
className,
|
|
@@ -12089,7 +12394,7 @@ function ToolStepIcon({
|
|
|
12089
12394
|
);
|
|
12090
12395
|
}
|
|
12091
12396
|
if (usesToolsetAvatar) {
|
|
12092
|
-
return /* @__PURE__ */
|
|
12397
|
+
return /* @__PURE__ */ jsx40(
|
|
12093
12398
|
CircleHelp,
|
|
12094
12399
|
{
|
|
12095
12400
|
className,
|
|
@@ -12098,7 +12403,7 @@ function ToolStepIcon({
|
|
|
12098
12403
|
}
|
|
12099
12404
|
);
|
|
12100
12405
|
}
|
|
12101
|
-
return /* @__PURE__ */
|
|
12406
|
+
return /* @__PURE__ */ jsx40(
|
|
12102
12407
|
CircleHelp,
|
|
12103
12408
|
{
|
|
12104
12409
|
className,
|
|
@@ -12112,15 +12417,15 @@ function ToolCallCopyButton({
|
|
|
12112
12417
|
className
|
|
12113
12418
|
}) {
|
|
12114
12419
|
const { t } = useChatkitTranslation();
|
|
12115
|
-
const [isCopied, setIsCopied] =
|
|
12116
|
-
const resetTimeoutRef =
|
|
12117
|
-
const clearResetTimeout =
|
|
12420
|
+
const [isCopied, setIsCopied] = React35.useState(false);
|
|
12421
|
+
const resetTimeoutRef = React35.useRef(null);
|
|
12422
|
+
const clearResetTimeout = React35.useCallback(() => {
|
|
12118
12423
|
if (resetTimeoutRef.current === null) return;
|
|
12119
12424
|
window.clearTimeout(resetTimeoutRef.current);
|
|
12120
12425
|
resetTimeoutRef.current = null;
|
|
12121
12426
|
}, []);
|
|
12122
|
-
|
|
12123
|
-
const handleCopy =
|
|
12427
|
+
React35.useEffect(() => clearResetTimeout, [clearResetTimeout]);
|
|
12428
|
+
const handleCopy = React35.useCallback(() => {
|
|
12124
12429
|
if (typeof navigator === "undefined" || !navigator.clipboard) return;
|
|
12125
12430
|
void navigator.clipboard.writeText(value).then(() => {
|
|
12126
12431
|
setIsCopied(true);
|
|
@@ -12132,7 +12437,7 @@ function ToolCallCopyButton({
|
|
|
12132
12437
|
}).catch(() => void 0);
|
|
12133
12438
|
}, [clearResetTimeout, value]);
|
|
12134
12439
|
const label = isCopied ? t("message.toolGroup.copied") : t("message.toolGroup.copy");
|
|
12135
|
-
return /* @__PURE__ */
|
|
12440
|
+
return /* @__PURE__ */ jsx40(
|
|
12136
12441
|
"button",
|
|
12137
12442
|
{
|
|
12138
12443
|
type: "button",
|
|
@@ -12143,7 +12448,7 @@ function ToolCallCopyButton({
|
|
|
12143
12448
|
"aria-label": label,
|
|
12144
12449
|
title: label,
|
|
12145
12450
|
onClick: handleCopy,
|
|
12146
|
-
children: isCopied ? /* @__PURE__ */
|
|
12451
|
+
children: isCopied ? /* @__PURE__ */ jsx40(Check4, { className: "h-3.5 w-3.5", "aria-hidden": "true" }) : /* @__PURE__ */ jsx40(Copy2, { className: "h-3.5 w-3.5", "aria-hidden": "true" })
|
|
12147
12452
|
}
|
|
12148
12453
|
);
|
|
12149
12454
|
}
|
|
@@ -12154,69 +12459,89 @@ function ToolCallValueBlock({
|
|
|
12154
12459
|
const { t } = useChatkitTranslation();
|
|
12155
12460
|
const detected = detectJsonValue(value);
|
|
12156
12461
|
if (detected.kind === "text") {
|
|
12157
|
-
return /* @__PURE__ */
|
|
12158
|
-
/* @__PURE__ */
|
|
12159
|
-
/* @__PURE__ */
|
|
12462
|
+
return /* @__PURE__ */ jsxs27("div", { className: "min-w-0 space-y-1", children: [
|
|
12463
|
+
/* @__PURE__ */ jsx40("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx40(ToolCallCopyButton, { value: detected.text }) }),
|
|
12464
|
+
/* @__PURE__ */ jsx40(PlainTextBlock, { value: detected.text, destructive })
|
|
12160
12465
|
] });
|
|
12161
12466
|
}
|
|
12162
|
-
return /* @__PURE__ */
|
|
12163
|
-
/* @__PURE__ */
|
|
12164
|
-
/* @__PURE__ */
|
|
12467
|
+
return /* @__PURE__ */ jsxs27(Tabs, { defaultValue: "tree", className: "min-w-0", children: [
|
|
12468
|
+
/* @__PURE__ */ jsxs27("div", { className: "mb-2 flex min-w-0 items-center justify-between gap-2", children: [
|
|
12469
|
+
/* @__PURE__ */ jsxs27("span", { className: "min-w-0 truncate text-[11px] text-muted-foreground", children: [
|
|
12165
12470
|
t("message.toolGroup.jsonTitle"),
|
|
12166
|
-
" \xB7
|
|
12471
|
+
" \xB7",
|
|
12472
|
+
" ",
|
|
12167
12473
|
getJsonValueSummary(detected.value)
|
|
12168
12474
|
] }),
|
|
12169
|
-
/* @__PURE__ */
|
|
12170
|
-
/* @__PURE__ */
|
|
12171
|
-
/* @__PURE__ */
|
|
12172
|
-
/* @__PURE__ */
|
|
12173
|
-
/* @__PURE__ */
|
|
12475
|
+
/* @__PURE__ */ jsxs27("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
12476
|
+
/* @__PURE__ */ jsx40(ToolCallCopyButton, { value: detected.raw }),
|
|
12477
|
+
/* @__PURE__ */ jsxs27(TabsList, { className: "rounded-md p-0.5", children: [
|
|
12478
|
+
/* @__PURE__ */ jsx40(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "tree", children: t("message.toolGroup.jsonTree") }),
|
|
12479
|
+
/* @__PURE__ */ jsx40(TabsTrigger, { className: "px-2 py-0.5 text-[11px]", value: "raw", children: t("message.toolGroup.jsonRaw") })
|
|
12174
12480
|
] })
|
|
12175
12481
|
] })
|
|
12176
12482
|
] }),
|
|
12177
|
-
/* @__PURE__ */
|
|
12178
|
-
/* @__PURE__ */
|
|
12483
|
+
/* @__PURE__ */ jsx40(TabsContent, { value: "tree", className: "mt-0", children: /* @__PURE__ */ jsx40(JsonTreeView, { value: detected.value }) }),
|
|
12484
|
+
/* @__PURE__ */ jsx40(TabsContent, { value: "raw", className: "mt-0", children: /* @__PURE__ */ jsx40(RawJsonBlock, { raw: detected.raw }) })
|
|
12179
12485
|
] });
|
|
12180
12486
|
}
|
|
12181
|
-
function DefaultToolCallOutput({
|
|
12487
|
+
function DefaultToolCallOutput({
|
|
12488
|
+
content,
|
|
12489
|
+
data
|
|
12490
|
+
}) {
|
|
12182
12491
|
const { t } = useChatkitTranslation();
|
|
12183
|
-
const
|
|
12492
|
+
const presentation = parseToolOutputPresentation(data.artifact);
|
|
12493
|
+
const output = data.output ?? (presentation ? null : data.artifact) ?? null;
|
|
12184
12494
|
const error = data.error ?? null;
|
|
12185
12495
|
if (error) {
|
|
12186
|
-
return /* @__PURE__ */
|
|
12187
|
-
/* @__PURE__ */
|
|
12188
|
-
/* @__PURE__ */
|
|
12496
|
+
return /* @__PURE__ */ jsxs27("div", { className: "space-y-1", children: [
|
|
12497
|
+
/* @__PURE__ */ jsx40("div", { className: "text-[11px] font-medium text-destructive", children: t("message.toolGroup.errorTitle") }),
|
|
12498
|
+
/* @__PURE__ */ jsx40(ToolCallValueBlock, { value: error, destructive: true })
|
|
12189
12499
|
] });
|
|
12190
12500
|
}
|
|
12191
|
-
if (output === null) return null;
|
|
12192
|
-
return /* @__PURE__ */
|
|
12193
|
-
/* @__PURE__ */
|
|
12194
|
-
/* @__PURE__ */
|
|
12501
|
+
if (output === null && !presentation) return null;
|
|
12502
|
+
return /* @__PURE__ */ jsxs27("div", { className: "space-y-2", children: [
|
|
12503
|
+
/* @__PURE__ */ jsx40("div", { className: "text-[11px] font-medium text-muted-foreground", children: t("message.toolGroup.outputTitle") }),
|
|
12504
|
+
presentation ? /* @__PURE__ */ jsx40(
|
|
12505
|
+
ToolOutputAttachments,
|
|
12506
|
+
{
|
|
12507
|
+
presentation,
|
|
12508
|
+
toolCallId: content.id,
|
|
12509
|
+
executionId: content.executionId
|
|
12510
|
+
}
|
|
12511
|
+
) : null,
|
|
12512
|
+
output !== null ? /* @__PURE__ */ jsx40(ToolCallValueBlock, { value: output }) : null
|
|
12195
12513
|
] });
|
|
12196
12514
|
}
|
|
12197
12515
|
function ToolCallDetails({ content }) {
|
|
12198
|
-
const { t } = useChatkitTranslation();
|
|
12516
|
+
const { i18n: i18n2, t } = useChatkitTranslation();
|
|
12199
12517
|
const data = getToolStepData(content);
|
|
12200
12518
|
if (isSandboxShellStep(data)) {
|
|
12201
|
-
return /* @__PURE__ */
|
|
12519
|
+
return /* @__PURE__ */ jsx40("div", { className: "ml-2 mt-1", children: /* @__PURE__ */ jsx40(SandboxShellToolCallCard, { data }) });
|
|
12202
12520
|
}
|
|
12203
12521
|
const renderer = getComponentMessageRenderer(content, data);
|
|
12204
12522
|
const hasCustomDetails = data.error === void 0 && hasComponentMessageRendererDetails(renderer, content, data);
|
|
12205
12523
|
const CustomDetailsRenderer = hasCustomDetails ? renderer?.renderDetails : void 0;
|
|
12206
12524
|
if (CustomDetailsRenderer) {
|
|
12207
|
-
return /* @__PURE__ */
|
|
12525
|
+
return /* @__PURE__ */ jsx40("div", { className: "ml-6 mt-1 max-h-60 overflow-auto rounded-md bg-muted/30 text-xs text-muted-foreground", children: /* @__PURE__ */ jsx40(CustomDetailsRenderer, { content, data }) });
|
|
12208
12526
|
}
|
|
12209
12527
|
const OutputRenderer = getToolCallOutputRenderer(data);
|
|
12528
|
+
const toolName = resolveLocalizedText(data.tool, i18n2.language);
|
|
12210
12529
|
const hasInput = data.input !== void 0 && data.input !== null;
|
|
12211
|
-
const hasOutput = data.error !== void 0 || data.output !== void 0;
|
|
12530
|
+
const hasOutput = data.error !== void 0 || data.output !== void 0 || data.artifact !== void 0;
|
|
12212
12531
|
if (!hasInput && !hasOutput) return null;
|
|
12213
|
-
return /* @__PURE__ */
|
|
12214
|
-
hasInput && /* @__PURE__ */
|
|
12215
|
-
/* @__PURE__ */
|
|
12216
|
-
|
|
12532
|
+
return /* @__PURE__ */ jsxs27("div", { className: "ml-6 mt-1 max-h-60 overflow-auto rounded-md bg-muted/30 px-3 py-2 text-xs text-muted-foreground", children: [
|
|
12533
|
+
hasInput && /* @__PURE__ */ jsxs27("div", { className: "space-y-1", children: [
|
|
12534
|
+
/* @__PURE__ */ jsxs27("div", { className: "flex min-w-0 items-baseline gap-1 text-[11px] font-medium text-muted-foreground", children: [
|
|
12535
|
+
toolName ? /* @__PURE__ */ jsxs27(Fragment7, { children: [
|
|
12536
|
+
/* @__PURE__ */ jsx40("span", { className: "min-w-0 break-all font-mono text-foreground/80", children: toolName }),
|
|
12537
|
+
/* @__PURE__ */ jsx40("span", { "aria-hidden": "true", children: "\xB7" })
|
|
12538
|
+
] }) : null,
|
|
12539
|
+
/* @__PURE__ */ jsx40("span", { className: "shrink-0", children: t("message.toolGroup.inputTitle") })
|
|
12540
|
+
] }),
|
|
12541
|
+
/* @__PURE__ */ jsx40(ToolCallValueBlock, { value: data.input })
|
|
12217
12542
|
] }),
|
|
12218
|
-
hasInput && hasOutput ? /* @__PURE__ */
|
|
12219
|
-
hasOutput ? /* @__PURE__ */
|
|
12543
|
+
hasInput && hasOutput ? /* @__PURE__ */ jsx40("div", { className: "h-2" }) : null,
|
|
12544
|
+
hasOutput ? /* @__PURE__ */ jsx40(OutputRenderer, { content, data }) : null
|
|
12220
12545
|
] });
|
|
12221
12546
|
}
|
|
12222
12547
|
function areToolCallRowPropsEqual(previous, next) {
|
|
@@ -12233,11 +12558,11 @@ function ToolCallRowContent({
|
|
|
12233
12558
|
const status = getEffectiveToolStepStatus(data, isThreadRunning);
|
|
12234
12559
|
const hasError = status === "fail" || Boolean(data.error);
|
|
12235
12560
|
const isSandboxShell = isSandboxShellStep(data);
|
|
12236
|
-
const detailsId =
|
|
12561
|
+
const detailsId = React35.useId();
|
|
12237
12562
|
const renderer = getComponentMessageRenderer(content, data);
|
|
12238
12563
|
const label = isSandboxShell ? getSandboxShellActivityLabel(data, status, i18n2.language, t) : renderer?.getTitle?.(content, data, i18n2.language) ?? getToolActivityLabel(content, i18n2.language, status);
|
|
12239
12564
|
const hasCustomDetails = data.error === void 0 && hasComponentMessageRendererDetails(renderer, content, data);
|
|
12240
|
-
const hasDetails = isSandboxShell || data.input !== void 0 || data.error !== void 0 || data.output !== void 0 || hasCustomDetails;
|
|
12565
|
+
const hasDetails = isSandboxShell || data.input !== void 0 || data.error !== void 0 || data.output !== void 0 || data.artifact !== void 0 || hasCustomDetails;
|
|
12241
12566
|
const fallbackEndedAt = useFrozenTimestamp(
|
|
12242
12567
|
data.status === "running" && status === "fail"
|
|
12243
12568
|
);
|
|
@@ -12245,14 +12570,14 @@ function ToolCallRowContent({
|
|
|
12245
12570
|
status,
|
|
12246
12571
|
fallbackEndedAt
|
|
12247
12572
|
});
|
|
12248
|
-
const [isExpanded, setIsExpanded] =
|
|
12249
|
-
|
|
12250
|
-
if (status === "running" && data.output !== void 0) {
|
|
12573
|
+
const [isExpanded, setIsExpanded] = React35.useState(false);
|
|
12574
|
+
React35.useEffect(() => {
|
|
12575
|
+
if (status === "running" && (data.output !== void 0 || data.artifact !== void 0)) {
|
|
12251
12576
|
setIsExpanded(true);
|
|
12252
12577
|
}
|
|
12253
|
-
}, [data.output, status]);
|
|
12254
|
-
return /* @__PURE__ */
|
|
12255
|
-
/* @__PURE__ */
|
|
12578
|
+
}, [data.artifact, data.output, status]);
|
|
12579
|
+
return /* @__PURE__ */ jsxs27("li", { className: "ck-tool-call-row-enter min-w-0", children: [
|
|
12580
|
+
/* @__PURE__ */ jsxs27(
|
|
12256
12581
|
"button",
|
|
12257
12582
|
{
|
|
12258
12583
|
type: "button",
|
|
@@ -12269,7 +12594,7 @@ function ToolCallRowContent({
|
|
|
12269
12594
|
if (hasDetails) setIsExpanded((prev) => !prev);
|
|
12270
12595
|
},
|
|
12271
12596
|
children: [
|
|
12272
|
-
status ? /* @__PURE__ */
|
|
12597
|
+
status ? /* @__PURE__ */ jsx40(
|
|
12273
12598
|
ToolStepIcon,
|
|
12274
12599
|
{
|
|
12275
12600
|
data,
|
|
@@ -12280,8 +12605,8 @@ function ToolCallRowContent({
|
|
|
12280
12605
|
hasError && !isSandboxShell ? "text-destructive" : "text-muted-foreground"
|
|
12281
12606
|
)
|
|
12282
12607
|
}
|
|
12283
|
-
) : /* @__PURE__ */
|
|
12284
|
-
/* @__PURE__ */
|
|
12608
|
+
) : /* @__PURE__ */ jsx40("span", { className: "h-3.5 w-3.5 shrink-0", "aria-hidden": "true" }),
|
|
12609
|
+
/* @__PURE__ */ jsx40(
|
|
12285
12610
|
"span",
|
|
12286
12611
|
{
|
|
12287
12612
|
className: cn(
|
|
@@ -12292,8 +12617,8 @@ function ToolCallRowContent({
|
|
|
12292
12617
|
children: label
|
|
12293
12618
|
}
|
|
12294
12619
|
),
|
|
12295
|
-
durationLabel ? /* @__PURE__ */
|
|
12296
|
-
hasDetails ? /* @__PURE__ */
|
|
12620
|
+
durationLabel ? /* @__PURE__ */ jsx40("span", { className: "shrink-0 text-[11px] tabular-nums text-muted-foreground/80", children: durationLabel }) : null,
|
|
12621
|
+
hasDetails ? /* @__PURE__ */ jsx40(
|
|
12297
12622
|
ChevronRight7,
|
|
12298
12623
|
{
|
|
12299
12624
|
"aria-hidden": "true",
|
|
@@ -12306,10 +12631,10 @@ function ToolCallRowContent({
|
|
|
12306
12631
|
]
|
|
12307
12632
|
}
|
|
12308
12633
|
),
|
|
12309
|
-
hasDetails && isExpanded ? /* @__PURE__ */
|
|
12634
|
+
hasDetails && isExpanded ? /* @__PURE__ */ jsx40("div", { id: detailsId, children: /* @__PURE__ */ jsx40(ToolCallDetails, { content }) }) : null
|
|
12310
12635
|
] });
|
|
12311
12636
|
}
|
|
12312
|
-
var ToolCallRow =
|
|
12637
|
+
var ToolCallRow = React35.memo(ToolCallRowContent, areToolCallRowPropsEqual);
|
|
12313
12638
|
ToolCallRow.displayName = "ToolCallRow";
|
|
12314
12639
|
function ToolComponentGroup({
|
|
12315
12640
|
items,
|
|
@@ -12319,8 +12644,8 @@ function ToolComponentGroup({
|
|
|
12319
12644
|
apiUrl
|
|
12320
12645
|
}) {
|
|
12321
12646
|
const { t } = useChatkitTranslation();
|
|
12322
|
-
const contentId =
|
|
12323
|
-
const [isExpanded, setIsExpanded] =
|
|
12647
|
+
const contentId = React35.useId();
|
|
12648
|
+
const [isExpanded, setIsExpanded] = React35.useState(!hasFollowingItem);
|
|
12324
12649
|
const categoryCounts = getToolGroupCategoryCounts(items);
|
|
12325
12650
|
const categorySummary = TOOL_GROUP_CATEGORY_ORDER.flatMap((category) => {
|
|
12326
12651
|
const count = categoryCounts[category] ?? 0;
|
|
@@ -12335,11 +12660,11 @@ function ToolComponentGroup({
|
|
|
12335
12660
|
const summary = `${t("message.toolGroup.status.success")} ${categorySummary}`;
|
|
12336
12661
|
const config = toolStatusConfig.success;
|
|
12337
12662
|
const StatusIcon = config.icon;
|
|
12338
|
-
|
|
12663
|
+
React35.useEffect(() => {
|
|
12339
12664
|
setIsExpanded(!hasFollowingItem);
|
|
12340
12665
|
}, [hasFollowingItem]);
|
|
12341
|
-
return /* @__PURE__ */
|
|
12342
|
-
/* @__PURE__ */
|
|
12666
|
+
return /* @__PURE__ */ jsxs27("div", { className: "px-1 py-1", children: [
|
|
12667
|
+
/* @__PURE__ */ jsxs27(
|
|
12343
12668
|
"button",
|
|
12344
12669
|
{
|
|
12345
12670
|
type: "button",
|
|
@@ -12348,19 +12673,11 @@ function ToolComponentGroup({
|
|
|
12348
12673
|
"aria-controls": contentId,
|
|
12349
12674
|
onClick: () => setIsExpanded((prev) => !prev),
|
|
12350
12675
|
children: [
|
|
12351
|
-
/* @__PURE__ */
|
|
12352
|
-
/* @__PURE__ */
|
|
12353
|
-
|
|
12354
|
-
{
|
|
12355
|
-
className: cn(
|
|
12356
|
-
"h-4 w-4 shrink-0",
|
|
12357
|
-
config.iconClass
|
|
12358
|
-
)
|
|
12359
|
-
}
|
|
12360
|
-
),
|
|
12361
|
-
/* @__PURE__ */ jsx39("span", { className: "truncate", children: summary })
|
|
12676
|
+
/* @__PURE__ */ jsxs27("div", { className: "flex min-w-0 items-center gap-2 text-sm font-medium text-muted-foreground", children: [
|
|
12677
|
+
/* @__PURE__ */ jsx40(StatusIcon, { className: cn("h-4 w-4 shrink-0", config.iconClass) }),
|
|
12678
|
+
/* @__PURE__ */ jsx40("span", { className: "truncate", children: summary })
|
|
12362
12679
|
] }),
|
|
12363
|
-
/* @__PURE__ */
|
|
12680
|
+
/* @__PURE__ */ jsx40(
|
|
12364
12681
|
ChevronRight7,
|
|
12365
12682
|
{
|
|
12366
12683
|
"aria-hidden": "true",
|
|
@@ -12373,7 +12690,7 @@ function ToolComponentGroup({
|
|
|
12373
12690
|
]
|
|
12374
12691
|
}
|
|
12375
12692
|
),
|
|
12376
|
-
isExpanded && /* @__PURE__ */
|
|
12693
|
+
isExpanded && /* @__PURE__ */ jsx40("ul", { id: contentId, className: "mt-2 space-y-1.5 overflow-y-auto pr-1", children: items.map((item, index) => /* @__PURE__ */ jsx40(
|
|
12377
12694
|
ToolCallRow,
|
|
12378
12695
|
{
|
|
12379
12696
|
content: item,
|
|
@@ -12393,7 +12710,7 @@ import {
|
|
|
12393
12710
|
REQUEST_USER_INPUT_TOOL_NAME as REQUEST_USER_INPUT_TOOL_NAME2
|
|
12394
12711
|
} from "@xpert-ai/chatkit-types";
|
|
12395
12712
|
import { CheckCircle2 as CheckCircle24 } from "lucide-react";
|
|
12396
|
-
import { jsx as
|
|
12713
|
+
import { jsx as jsx41, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
12397
12714
|
function isRecord4(value) {
|
|
12398
12715
|
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
12399
12716
|
}
|
|
@@ -12505,7 +12822,7 @@ function RequestUserInputResultCard({
|
|
|
12505
12822
|
className
|
|
12506
12823
|
}) {
|
|
12507
12824
|
const { t } = useChatkitTranslation();
|
|
12508
|
-
return /* @__PURE__ */
|
|
12825
|
+
return /* @__PURE__ */ jsxs28(
|
|
12509
12826
|
"section",
|
|
12510
12827
|
{
|
|
12511
12828
|
"aria-label": t("message.requestUserInputResult.title"),
|
|
@@ -12514,23 +12831,23 @@ function RequestUserInputResultCard({
|
|
|
12514
12831
|
className
|
|
12515
12832
|
),
|
|
12516
12833
|
children: [
|
|
12517
|
-
/* @__PURE__ */
|
|
12518
|
-
/* @__PURE__ */
|
|
12519
|
-
/* @__PURE__ */
|
|
12834
|
+
/* @__PURE__ */ jsxs28("div", { className: "mb-2 flex items-center gap-2 text-sm font-semibold text-foreground", children: [
|
|
12835
|
+
/* @__PURE__ */ jsx41(CheckCircle24, { className: "h-4 w-4 text-primary" }),
|
|
12836
|
+
/* @__PURE__ */ jsx41("span", { children: t("message.requestUserInputResult.title") })
|
|
12520
12837
|
] }),
|
|
12521
|
-
/* @__PURE__ */
|
|
12838
|
+
/* @__PURE__ */ jsx41("div", { className: "space-y-2", children: result.answers.map((answer, index) => /* @__PURE__ */ jsxs28(
|
|
12522
12839
|
"div",
|
|
12523
12840
|
{
|
|
12524
12841
|
className: "rounded-md bg-background/70 px-2.5 py-2",
|
|
12525
12842
|
children: [
|
|
12526
|
-
/* @__PURE__ */
|
|
12527
|
-
/* @__PURE__ */
|
|
12528
|
-
/* @__PURE__ */
|
|
12529
|
-
/* @__PURE__ */
|
|
12843
|
+
/* @__PURE__ */ jsx41("div", { className: "text-xs font-medium leading-5 text-muted-foreground", children: answer.question }),
|
|
12844
|
+
/* @__PURE__ */ jsxs28("div", { className: "mt-0.5 flex min-w-0 flex-wrap items-center gap-1.5", children: [
|
|
12845
|
+
/* @__PURE__ */ jsx41("span", { className: "min-w-0 wrap-break-word text-sm font-semibold text-foreground", children: answer.label ?? answer.value }),
|
|
12846
|
+
/* @__PURE__ */ jsx41("span", { className: "rounded-full bg-muted px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground", children: t(
|
|
12530
12847
|
answer.type === "other" ? "message.requestUserInputResult.other" : "message.requestUserInputResult.option"
|
|
12531
12848
|
) })
|
|
12532
12849
|
] }),
|
|
12533
|
-
answer.description ? /* @__PURE__ */
|
|
12850
|
+
answer.description ? /* @__PURE__ */ jsx41("div", { className: "mt-1 text-xs leading-5 text-muted-foreground", children: answer.description }) : null
|
|
12534
12851
|
]
|
|
12535
12852
|
},
|
|
12536
12853
|
`${answer.id}-${index}`
|
|
@@ -12541,23 +12858,23 @@ function RequestUserInputResultCard({
|
|
|
12541
12858
|
}
|
|
12542
12859
|
|
|
12543
12860
|
// src/components/thread/messages/widget.tsx
|
|
12544
|
-
import { useEffect as
|
|
12861
|
+
import { useEffect as useEffect18, useMemo as useMemo13, useState as useState20 } from "react";
|
|
12545
12862
|
import {
|
|
12546
12863
|
A2UIRenderer,
|
|
12547
12864
|
SurfaceRenderer,
|
|
12548
12865
|
useA2UI
|
|
12549
12866
|
} from "@xpert-ai/a2ui-react";
|
|
12550
|
-
import { jsx as
|
|
12867
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
12551
12868
|
function WidgetMessage({ messageId, data }) {
|
|
12552
12869
|
const widgets = Array.isArray(data.widgets) ? data.widgets : [];
|
|
12553
12870
|
if (widgets.length === 0) return null;
|
|
12554
12871
|
const baseSurfaceId = `widget-${messageId}`;
|
|
12555
|
-
return /* @__PURE__ */
|
|
12872
|
+
return /* @__PURE__ */ jsx42("div", { className: "space-y-3", children: widgets.map((widget, index) => {
|
|
12556
12873
|
const config = widget?.config;
|
|
12557
12874
|
const messages = Array.isArray(widget?.messages) ? widget.messages : [];
|
|
12558
12875
|
const surfaceId = widgets.length > 1 ? `${baseSurfaceId}-${index}` : baseSurfaceId;
|
|
12559
12876
|
if (messages.length > 0) {
|
|
12560
|
-
return /* @__PURE__ */
|
|
12877
|
+
return /* @__PURE__ */ jsx42(
|
|
12561
12878
|
FlatWidgetSurface,
|
|
12562
12879
|
{
|
|
12563
12880
|
messages,
|
|
@@ -12569,7 +12886,7 @@ function WidgetMessage({ messageId, data }) {
|
|
|
12569
12886
|
if (!hasLegacySurface(config)) {
|
|
12570
12887
|
return null;
|
|
12571
12888
|
}
|
|
12572
|
-
return /* @__PURE__ */
|
|
12889
|
+
return /* @__PURE__ */ jsx42(
|
|
12573
12890
|
SurfaceRenderer,
|
|
12574
12891
|
{
|
|
12575
12892
|
surfaceId,
|
|
@@ -12584,12 +12901,12 @@ function FlatWidgetSurface({
|
|
|
12584
12901
|
surfaceId
|
|
12585
12902
|
}) {
|
|
12586
12903
|
const { processMessages } = useA2UI();
|
|
12587
|
-
const [renderError, setRenderError] =
|
|
12588
|
-
const normalizedMessages =
|
|
12904
|
+
const [renderError, setRenderError] = useState20(false);
|
|
12905
|
+
const normalizedMessages = useMemo13(
|
|
12589
12906
|
() => normalizeFlatWidgetMessages(messages, surfaceId),
|
|
12590
12907
|
[messages, surfaceId]
|
|
12591
12908
|
);
|
|
12592
|
-
|
|
12909
|
+
useEffect18(() => {
|
|
12593
12910
|
if (normalizedMessages.length === 0) return;
|
|
12594
12911
|
setRenderError(false);
|
|
12595
12912
|
try {
|
|
@@ -12607,12 +12924,12 @@ function FlatWidgetSurface({
|
|
|
12607
12924
|
};
|
|
12608
12925
|
}, [normalizedMessages, processMessages, surfaceId]);
|
|
12609
12926
|
if (renderError) {
|
|
12610
|
-
return /* @__PURE__ */
|
|
12927
|
+
return /* @__PURE__ */ jsx42(WidgetRenderErrorFallback, {});
|
|
12611
12928
|
}
|
|
12612
|
-
return /* @__PURE__ */
|
|
12929
|
+
return /* @__PURE__ */ jsx42(A2UIRenderer, { surfaceId });
|
|
12613
12930
|
}
|
|
12614
12931
|
function WidgetRenderErrorFallback() {
|
|
12615
|
-
return /* @__PURE__ */
|
|
12932
|
+
return /* @__PURE__ */ jsx42(
|
|
12616
12933
|
"div",
|
|
12617
12934
|
{
|
|
12618
12935
|
role: "alert",
|
|
@@ -12882,12 +13199,12 @@ function hasLegacySurface(surface) {
|
|
|
12882
13199
|
}
|
|
12883
13200
|
|
|
12884
13201
|
// src/components/thread/messages/mcp-app.tsx
|
|
12885
|
-
import * as
|
|
13202
|
+
import * as React37 from "react";
|
|
12886
13203
|
import {
|
|
12887
13204
|
resolveLocalizedText as resolveLocalizedText3
|
|
12888
13205
|
} from "@xpert-ai/chatkit-types";
|
|
12889
|
-
import { AlertCircle as AlertCircle2, Loader2 as
|
|
12890
|
-
import { jsx as
|
|
13206
|
+
import { AlertCircle as AlertCircle2, Loader2 as Loader28 } from "lucide-react";
|
|
13207
|
+
import { jsx as jsx43, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
12891
13208
|
var EMPTY_INPUT_SCHEMA = {
|
|
12892
13209
|
type: "object",
|
|
12893
13210
|
properties: {}
|
|
@@ -13473,18 +13790,18 @@ function McpAppMessage({
|
|
|
13473
13790
|
isLoading: streamIsLoading,
|
|
13474
13791
|
submit
|
|
13475
13792
|
} = useStreamContext();
|
|
13476
|
-
const iframeRef =
|
|
13477
|
-
const containerRef =
|
|
13478
|
-
const initializedRef =
|
|
13479
|
-
const sentInitialResultRef =
|
|
13480
|
-
const modelContextRef =
|
|
13481
|
-
const [resource, setResource] =
|
|
13482
|
-
const [runtimeAppInstanceToken, setRuntimeAppInstanceToken] =
|
|
13483
|
-
const [srcDoc, setSrcDoc] =
|
|
13484
|
-
const [height, setHeight] =
|
|
13485
|
-
const [error, setError] =
|
|
13486
|
-
const [isLoading, setIsLoading] =
|
|
13487
|
-
const resourceUrl =
|
|
13793
|
+
const iframeRef = React37.useRef(null);
|
|
13794
|
+
const containerRef = React37.useRef(null);
|
|
13795
|
+
const initializedRef = React37.useRef(false);
|
|
13796
|
+
const sentInitialResultRef = React37.useRef(false);
|
|
13797
|
+
const modelContextRef = React37.useRef(null);
|
|
13798
|
+
const [resource, setResource] = React37.useState(null);
|
|
13799
|
+
const [runtimeAppInstanceToken, setRuntimeAppInstanceToken] = React37.useState(data.appInstanceToken);
|
|
13800
|
+
const [srcDoc, setSrcDoc] = React37.useState(null);
|
|
13801
|
+
const [height, setHeight] = React37.useState(420);
|
|
13802
|
+
const [error, setError] = React37.useState(null);
|
|
13803
|
+
const [isLoading, setIsLoading] = React37.useState(true);
|
|
13804
|
+
const resourceUrl = React37.useMemo(
|
|
13488
13805
|
() => buildXpertApiUrl(
|
|
13489
13806
|
apiUrl,
|
|
13490
13807
|
buildMcpAppEndpointPath(data, "resource", {
|
|
@@ -13493,7 +13810,7 @@ function McpAppMessage({
|
|
|
13493
13810
|
),
|
|
13494
13811
|
[apiUrl, data, messageId]
|
|
13495
13812
|
);
|
|
13496
|
-
const rpcUrl =
|
|
13813
|
+
const rpcUrl = React37.useMemo(
|
|
13497
13814
|
() => buildXpertApiUrl(
|
|
13498
13815
|
apiUrl,
|
|
13499
13816
|
buildMcpAppEndpointPath(data, "rpc", {
|
|
@@ -13503,10 +13820,10 @@ function McpAppMessage({
|
|
|
13503
13820
|
),
|
|
13504
13821
|
[apiUrl, data, messageId, runtimeAppInstanceToken]
|
|
13505
13822
|
);
|
|
13506
|
-
const postToApp =
|
|
13823
|
+
const postToApp = React37.useCallback((message) => {
|
|
13507
13824
|
iframeRef.current?.contentWindow?.postMessage(message, "*");
|
|
13508
13825
|
}, []);
|
|
13509
|
-
const callHostRpc =
|
|
13826
|
+
const callHostRpc = React37.useCallback(
|
|
13510
13827
|
async (request) => {
|
|
13511
13828
|
const response = await authenticatedFetch(rpcUrl, {
|
|
13512
13829
|
method: "POST",
|
|
@@ -13527,7 +13844,7 @@ function McpAppMessage({
|
|
|
13527
13844
|
},
|
|
13528
13845
|
[authenticatedFetch, rpcUrl]
|
|
13529
13846
|
);
|
|
13530
|
-
const sendInitialToolNotifications =
|
|
13847
|
+
const sendInitialToolNotifications = React37.useCallback(() => {
|
|
13531
13848
|
if (!initializedRef.current || sentInitialResultRef.current || !resource) {
|
|
13532
13849
|
return;
|
|
13533
13850
|
}
|
|
@@ -13554,7 +13871,7 @@ function McpAppMessage({
|
|
|
13554
13871
|
}
|
|
13555
13872
|
});
|
|
13556
13873
|
}, [data.toolCallId, data.toolName, postToApp, resource]);
|
|
13557
|
-
|
|
13874
|
+
React37.useEffect(() => {
|
|
13558
13875
|
const controller = new AbortController();
|
|
13559
13876
|
initializedRef.current = false;
|
|
13560
13877
|
sentInitialResultRef.current = false;
|
|
@@ -13612,10 +13929,10 @@ function McpAppMessage({
|
|
|
13612
13929
|
i18n2.language,
|
|
13613
13930
|
resourceUrl
|
|
13614
13931
|
]);
|
|
13615
|
-
|
|
13932
|
+
React37.useEffect(() => {
|
|
13616
13933
|
sendInitialToolNotifications();
|
|
13617
13934
|
}, [sendInitialToolNotifications]);
|
|
13618
|
-
|
|
13935
|
+
React37.useEffect(() => {
|
|
13619
13936
|
const handleMessage = async (event) => {
|
|
13620
13937
|
if (event.source !== iframeRef.current?.contentWindow) {
|
|
13621
13938
|
return;
|
|
@@ -13808,11 +14125,11 @@ function McpAppMessage({
|
|
|
13808
14125
|
submit
|
|
13809
14126
|
]);
|
|
13810
14127
|
const iframePermissions = resource?.permissions ?? data.permissions;
|
|
13811
|
-
const iframeAllow =
|
|
14128
|
+
const iframeAllow = React37.useMemo(
|
|
13812
14129
|
() => buildIframeAllow(iframePermissions),
|
|
13813
14130
|
[iframePermissions]
|
|
13814
14131
|
);
|
|
13815
|
-
const sandbox =
|
|
14132
|
+
const sandbox = React37.useMemo(() => buildSandboxAttribute(), []);
|
|
13816
14133
|
const prefersBorder = resource?.prefersBorder ?? data.prefersBorder ?? true;
|
|
13817
14134
|
const displayTitle = resolveLocalizedText3(resource?.title ?? data.title, i18n2.language) ?? data.toolName;
|
|
13818
14135
|
const displayDescription = resolveLocalizedText3(
|
|
@@ -13820,7 +14137,7 @@ function McpAppMessage({
|
|
|
13820
14137
|
i18n2.language
|
|
13821
14138
|
);
|
|
13822
14139
|
const displayIcon = resource?.icon ?? data.icon;
|
|
13823
|
-
return /* @__PURE__ */
|
|
14140
|
+
return /* @__PURE__ */ jsxs29(
|
|
13824
14141
|
"div",
|
|
13825
14142
|
{
|
|
13826
14143
|
ref: containerRef,
|
|
@@ -13830,9 +14147,9 @@ function McpAppMessage({
|
|
|
13830
14147
|
className
|
|
13831
14148
|
),
|
|
13832
14149
|
children: [
|
|
13833
|
-
/* @__PURE__ */
|
|
13834
|
-
/* @__PURE__ */
|
|
13835
|
-
displayIcon ? /* @__PURE__ */
|
|
14150
|
+
/* @__PURE__ */ jsxs29("div", { className: "flex min-h-10 items-center justify-between gap-3 border-b px-3 py-2", children: [
|
|
14151
|
+
/* @__PURE__ */ jsxs29("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
14152
|
+
displayIcon ? /* @__PURE__ */ jsx43(
|
|
13836
14153
|
IconDefinitionRenderer,
|
|
13837
14154
|
{
|
|
13838
14155
|
icon: displayIcon,
|
|
@@ -13841,20 +14158,20 @@ function McpAppMessage({
|
|
|
13841
14158
|
decorative: true
|
|
13842
14159
|
}
|
|
13843
14160
|
) : null,
|
|
13844
|
-
/* @__PURE__ */
|
|
13845
|
-
/* @__PURE__ */
|
|
13846
|
-
/* @__PURE__ */
|
|
14161
|
+
/* @__PURE__ */ jsxs29("div", { className: "min-w-0", children: [
|
|
14162
|
+
/* @__PURE__ */ jsx43("div", { className: "truncate text-sm font-medium", children: displayTitle }),
|
|
14163
|
+
/* @__PURE__ */ jsx43("div", { className: "truncate text-[11px] text-muted-foreground", children: displayDescription ?? data.resourceUri })
|
|
13847
14164
|
] })
|
|
13848
14165
|
] }),
|
|
13849
|
-
/* @__PURE__ */
|
|
14166
|
+
/* @__PURE__ */ jsx43(Badge, { variant: "secondary", className: "shrink-0 rounded-md", children: "MCP App" })
|
|
13850
14167
|
] }),
|
|
13851
|
-
isLoading ? /* @__PURE__ */
|
|
13852
|
-
/* @__PURE__ */
|
|
13853
|
-
/* @__PURE__ */
|
|
13854
|
-
] }) : error ? /* @__PURE__ */
|
|
13855
|
-
/* @__PURE__ */
|
|
13856
|
-
/* @__PURE__ */
|
|
13857
|
-
] }) : srcDoc ? /* @__PURE__ */
|
|
14168
|
+
isLoading ? /* @__PURE__ */ jsxs29("div", { className: "flex h-40 items-center justify-center gap-2 text-sm text-muted-foreground", children: [
|
|
14169
|
+
/* @__PURE__ */ jsx43(Loader28, { className: "h-4 w-4 animate-spin" }),
|
|
14170
|
+
/* @__PURE__ */ jsx43("span", { children: i18n2.t("message.mcpApp.loading") })
|
|
14171
|
+
] }) : error ? /* @__PURE__ */ jsxs29("div", { className: "flex h-40 items-center justify-center gap-2 px-4 text-sm text-destructive", children: [
|
|
14172
|
+
/* @__PURE__ */ jsx43(AlertCircle2, { className: "h-4 w-4 shrink-0" }),
|
|
14173
|
+
/* @__PURE__ */ jsx43("span", { className: "min-w-0 break-words", children: error })
|
|
14174
|
+
] }) : srcDoc ? /* @__PURE__ */ jsx43(
|
|
13858
14175
|
"iframe",
|
|
13859
14176
|
{
|
|
13860
14177
|
ref: iframeRef,
|
|
@@ -13873,7 +14190,7 @@ function McpAppMessage({
|
|
|
13873
14190
|
}
|
|
13874
14191
|
|
|
13875
14192
|
// src/components/thread/messages/ai.tsx
|
|
13876
|
-
import { jsx as
|
|
14193
|
+
import { jsx as jsx44, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
13877
14194
|
var assistantMessageStackClassName = "space-y-3 in-data-[density=compact]:space-y-2 in-data-[density=spacious]:space-y-4";
|
|
13878
14195
|
function isTextContent3(content) {
|
|
13879
14196
|
return content.type === "text";
|
|
@@ -13915,11 +14232,11 @@ function ReasoningBlock({
|
|
|
13915
14232
|
}) {
|
|
13916
14233
|
const blocks = reasoning.filter((item) => item.text?.trim());
|
|
13917
14234
|
if (blocks.length === 0) return null;
|
|
13918
|
-
return /* @__PURE__ */
|
|
14235
|
+
return /* @__PURE__ */ jsx44("div", { className: "space-y-2", children: blocks.map((item, index) => /* @__PURE__ */ jsx44(
|
|
13919
14236
|
"div",
|
|
13920
14237
|
{
|
|
13921
14238
|
className: "rounded-lg border bg-muted/40 p-3 text-xs text-muted-foreground",
|
|
13922
|
-
children: /* @__PURE__ */
|
|
14239
|
+
children: /* @__PURE__ */ jsx44("p", { className: "whitespace-pre-wrap wrap-break-word leading-relaxed", children: item.text })
|
|
13923
14240
|
},
|
|
13924
14241
|
item.id ?? `reasoning-${index}`
|
|
13925
14242
|
)) });
|
|
@@ -13927,12 +14244,12 @@ function ReasoningBlock({
|
|
|
13927
14244
|
function ImageBlock({ content }) {
|
|
13928
14245
|
const imageUrl = typeof content.image_url === "string" ? content.image_url : typeof content.image_url?.url === "string" ? content.image_url.url : null;
|
|
13929
14246
|
if (!imageUrl) {
|
|
13930
|
-
return /* @__PURE__ */
|
|
13931
|
-
/* @__PURE__ */
|
|
13932
|
-
/* @__PURE__ */
|
|
14247
|
+
return /* @__PURE__ */ jsxs30(Card, { children: [
|
|
14248
|
+
/* @__PURE__ */ jsx44(CardHeader, { className: "space-y-1", children: /* @__PURE__ */ jsx44(CardTitle, { className: "text-sm", children: "Image" }) }),
|
|
14249
|
+
/* @__PURE__ */ jsx44(CardContent, { className: "text-xs text-muted-foreground", children: safeJson3(content) })
|
|
13933
14250
|
] });
|
|
13934
14251
|
}
|
|
13935
|
-
return /* @__PURE__ */
|
|
14252
|
+
return /* @__PURE__ */ jsx44("figure", { className: "overflow-hidden rounded-lg border bg-background", children: /* @__PURE__ */ jsx44(
|
|
13936
14253
|
"img",
|
|
13937
14254
|
{
|
|
13938
14255
|
src: imageUrl,
|
|
@@ -13942,12 +14259,12 @@ function ImageBlock({ content }) {
|
|
|
13942
14259
|
) });
|
|
13943
14260
|
}
|
|
13944
14261
|
function MemoryBlock({ content }) {
|
|
13945
|
-
return /* @__PURE__ */
|
|
13946
|
-
/* @__PURE__ */
|
|
13947
|
-
/* @__PURE__ */
|
|
13948
|
-
/* @__PURE__ */
|
|
14262
|
+
return /* @__PURE__ */ jsxs30(Card, { children: [
|
|
14263
|
+
/* @__PURE__ */ jsxs30(CardHeader, { className: "flex flex-row items-center justify-between gap-2", children: [
|
|
14264
|
+
/* @__PURE__ */ jsx44(CardTitle, { className: "text-sm", children: "Memory" }),
|
|
14265
|
+
/* @__PURE__ */ jsx44(Badge, { variant: "secondary", children: "Memory" })
|
|
13949
14266
|
] }),
|
|
13950
|
-
/* @__PURE__ */
|
|
14267
|
+
/* @__PURE__ */ jsx44(CardContent, { className: "text-xs text-muted-foreground", children: /* @__PURE__ */ jsx44("pre", { className: "whitespace-pre-wrap wrap-break-word", children: safeJson3(content.data ?? []) }) })
|
|
13951
14268
|
] });
|
|
13952
14269
|
}
|
|
13953
14270
|
function parseStepDate2(value) {
|
|
@@ -13981,11 +14298,11 @@ function formatStepDuration3(durationMs) {
|
|
|
13981
14298
|
}
|
|
13982
14299
|
function ComponentBlock({ content }) {
|
|
13983
14300
|
const { i18n: i18n2 } = useChatkitTranslation();
|
|
13984
|
-
const [isExpanded, setIsExpanded] =
|
|
13985
|
-
const contentRef =
|
|
13986
|
-
const shouldAutoScrollRef =
|
|
13987
|
-
const previousScrollTopRef =
|
|
13988
|
-
const [durationNow, setDurationNow] =
|
|
14301
|
+
const [isExpanded, setIsExpanded] = React38.useState(false);
|
|
14302
|
+
const contentRef = React38.useRef(null);
|
|
14303
|
+
const shouldAutoScrollRef = React38.useRef(true);
|
|
14304
|
+
const previousScrollTopRef = React38.useRef(0);
|
|
14305
|
+
const [durationNow, setDurationNow] = React38.useState(() => Date.now());
|
|
13989
14306
|
const data = getToolStepData(content);
|
|
13990
14307
|
const category = data.category ?? "Component";
|
|
13991
14308
|
const title = getToolActivityLabel(content, i18n2.language);
|
|
@@ -13999,10 +14316,10 @@ function ComponentBlock({ content }) {
|
|
|
13999
14316
|
const endedAt = parseStepDate2(data.end_date);
|
|
14000
14317
|
const durationMs = createdAt === null ? null : Math.max(0, (endedAt ?? durationNow) - createdAt);
|
|
14001
14318
|
const durationLabel = durationMs === null ? null : formatStepDuration3(durationMs);
|
|
14002
|
-
|
|
14319
|
+
React38.useEffect(() => {
|
|
14003
14320
|
if (status === "running" && output !== null) setIsExpanded(true);
|
|
14004
14321
|
}, [status, output]);
|
|
14005
|
-
|
|
14322
|
+
React38.useEffect(() => {
|
|
14006
14323
|
if (status !== "running" || createdAt === null || endedAt !== null) {
|
|
14007
14324
|
return;
|
|
14008
14325
|
}
|
|
@@ -14014,7 +14331,7 @@ function ComponentBlock({ content }) {
|
|
|
14014
14331
|
window.clearInterval(timer);
|
|
14015
14332
|
};
|
|
14016
14333
|
}, [createdAt, endedAt, status]);
|
|
14017
|
-
|
|
14334
|
+
React38.useEffect(() => {
|
|
14018
14335
|
const element = contentRef.current;
|
|
14019
14336
|
if (!element) return;
|
|
14020
14337
|
previousScrollTopRef.current = element.scrollTop;
|
|
@@ -14036,7 +14353,7 @@ function ComponentBlock({ content }) {
|
|
|
14036
14353
|
element.removeEventListener("scroll", updateAutoScrollState);
|
|
14037
14354
|
};
|
|
14038
14355
|
}, [isExpanded]);
|
|
14039
|
-
|
|
14356
|
+
React38.useEffect(() => {
|
|
14040
14357
|
if (status !== "running") {
|
|
14041
14358
|
shouldAutoScrollRef.current = true;
|
|
14042
14359
|
return;
|
|
@@ -14049,15 +14366,15 @@ function ComponentBlock({ content }) {
|
|
|
14049
14366
|
}, [isExpanded, output, status]);
|
|
14050
14367
|
const config = status ? toolStatusConfig[status] : null;
|
|
14051
14368
|
const StatusIcon = config?.icon;
|
|
14052
|
-
return /* @__PURE__ */
|
|
14053
|
-
/* @__PURE__ */
|
|
14369
|
+
return /* @__PURE__ */ jsxs30(Card, { children: [
|
|
14370
|
+
/* @__PURE__ */ jsxs30(
|
|
14054
14371
|
CardHeader,
|
|
14055
14372
|
{
|
|
14056
14373
|
className: "flex flex-row items-center justify-between gap-2 px-2 py-1 cursor-pointer",
|
|
14057
14374
|
onClick: () => setIsExpanded(!isExpanded),
|
|
14058
14375
|
children: [
|
|
14059
|
-
/* @__PURE__ */
|
|
14060
|
-
status && StatusIcon && /* @__PURE__ */
|
|
14376
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex items-center space-x-1 flex-1 min-w-0", children: [
|
|
14377
|
+
status && StatusIcon && /* @__PURE__ */ jsx44(
|
|
14061
14378
|
StatusIcon,
|
|
14062
14379
|
{
|
|
14063
14380
|
className: cn(
|
|
@@ -14067,20 +14384,20 @@ function ComponentBlock({ content }) {
|
|
|
14067
14384
|
)
|
|
14068
14385
|
}
|
|
14069
14386
|
),
|
|
14070
|
-
/* @__PURE__ */
|
|
14387
|
+
/* @__PURE__ */ jsx44(CardTitle, { className: "text-sm truncate", children: title })
|
|
14071
14388
|
] }),
|
|
14072
|
-
/* @__PURE__ */
|
|
14073
|
-
durationLabel && /* @__PURE__ */
|
|
14074
|
-
/* @__PURE__ */
|
|
14075
|
-
/* @__PURE__ */
|
|
14389
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex flex-wrap items-center gap-2 shrink-0", children: [
|
|
14390
|
+
durationLabel && /* @__PURE__ */ jsxs30("div", { className: "inline-flex items-center gap-1 text-[11px] text-muted-foreground tabular-nums", children: [
|
|
14391
|
+
/* @__PURE__ */ jsx44(Clock32, { className: "h-3 w-3" }),
|
|
14392
|
+
/* @__PURE__ */ jsx44("span", { children: durationLabel })
|
|
14076
14393
|
] }),
|
|
14077
|
-
/* @__PURE__ */
|
|
14078
|
-
/* @__PURE__ */
|
|
14394
|
+
/* @__PURE__ */ jsx44(Badge, { variant: "secondary", className: "rounded-lg px-1.5", children: category }),
|
|
14395
|
+
/* @__PURE__ */ jsx44(
|
|
14079
14396
|
"button",
|
|
14080
14397
|
{
|
|
14081
14398
|
className: "text-muted-foreground hover:text-foreground transition-colors",
|
|
14082
14399
|
"aria-label": isExpanded ? "Collapse" : "Expand",
|
|
14083
|
-
children: /* @__PURE__ */
|
|
14400
|
+
children: /* @__PURE__ */ jsx44(
|
|
14084
14401
|
ChevronDown4,
|
|
14085
14402
|
{
|
|
14086
14403
|
className: cn(
|
|
@@ -14095,53 +14412,53 @@ function ComponentBlock({ content }) {
|
|
|
14095
14412
|
]
|
|
14096
14413
|
}
|
|
14097
14414
|
),
|
|
14098
|
-
isExpanded && /* @__PURE__ */
|
|
14415
|
+
isExpanded && /* @__PURE__ */ jsxs30(
|
|
14099
14416
|
CardContent,
|
|
14100
14417
|
{
|
|
14101
14418
|
ref: contentRef,
|
|
14102
14419
|
className: "text-xs text-muted-foreground max-h-60 overflow-auto",
|
|
14103
14420
|
children: [
|
|
14104
|
-
data.input && /* @__PURE__ */
|
|
14105
|
-
error ? /* @__PURE__ */
|
|
14421
|
+
data.input && /* @__PURE__ */ jsx44("pre", { className: "whitespace-pre-wrap wrap-break-word", children: formatDisplayValue3(data.input) }),
|
|
14422
|
+
error ? /* @__PURE__ */ jsx44("pre", { className: "whitespace-pre-wrap wrap-break-word text-destructive", children: formatDisplayValue3(error) }) : hasOutput && /* @__PURE__ */ jsx44("pre", { className: "whitespace-pre-wrap wrap-break-word", children: formatDisplayValue3(fallback) })
|
|
14106
14423
|
]
|
|
14107
14424
|
}
|
|
14108
14425
|
)
|
|
14109
14426
|
] });
|
|
14110
14427
|
}
|
|
14111
14428
|
function UnknownBlock({ content }) {
|
|
14112
|
-
return /* @__PURE__ */
|
|
14113
|
-
/* @__PURE__ */
|
|
14114
|
-
/* @__PURE__ */
|
|
14115
|
-
/* @__PURE__ */
|
|
14429
|
+
return /* @__PURE__ */ jsxs30(Card, { children: [
|
|
14430
|
+
/* @__PURE__ */ jsxs30(CardHeader, { className: "flex flex-row items-center justify-between gap-2", children: [
|
|
14431
|
+
/* @__PURE__ */ jsx44(CardTitle, { className: "text-sm", children: "Assistant Content" }),
|
|
14432
|
+
/* @__PURE__ */ jsx44(Badge, { variant: "outline", children: content.type ?? "unknown" })
|
|
14116
14433
|
] }),
|
|
14117
|
-
/* @__PURE__ */
|
|
14434
|
+
/* @__PURE__ */ jsx44(CardContent, { className: "text-xs text-muted-foreground", children: /* @__PURE__ */ jsx44("pre", { className: "whitespace-pre-wrap break-words", children: safeJson3(content) }) })
|
|
14118
14435
|
] });
|
|
14119
14436
|
}
|
|
14120
14437
|
function renderContentItem(content, index, message, lookupMessages, options) {
|
|
14121
14438
|
const messageId = message.id;
|
|
14122
14439
|
const textClassName = options?.isAgentOutput ? "text-sm [&_.markdown-content_p]:!leading-6" : void 0;
|
|
14123
14440
|
if (typeof content === "string") {
|
|
14124
|
-
return /* @__PURE__ */
|
|
14441
|
+
return /* @__PURE__ */ jsx44("div", { className: textClassName, children: /* @__PURE__ */ jsx44(MarkdownText, { children: content }) }, `text-${index}`);
|
|
14125
14442
|
}
|
|
14126
14443
|
if (isThreadContextUsageRenderArtifact(content)) {
|
|
14127
14444
|
return null;
|
|
14128
14445
|
}
|
|
14129
14446
|
if (isTextContent3(content)) {
|
|
14130
|
-
return /* @__PURE__ */
|
|
14447
|
+
return /* @__PURE__ */ jsx44("div", { className: textClassName, children: /* @__PURE__ */ jsx44(MarkdownText, { children: content.text }) }, content.id ?? `text-${index}`);
|
|
14131
14448
|
}
|
|
14132
14449
|
if (isReasoningContent3(content)) {
|
|
14133
|
-
return /* @__PURE__ */
|
|
14450
|
+
return /* @__PURE__ */ jsx44("div", { children: /* @__PURE__ */ jsx44(ReasoningBlock, { reasoning: [content] }) }, content.id ?? `reasoning-${index}`);
|
|
14134
14451
|
}
|
|
14135
14452
|
if (isImageContent(content)) {
|
|
14136
|
-
return /* @__PURE__ */
|
|
14453
|
+
return /* @__PURE__ */ jsx44("div", { children: /* @__PURE__ */ jsx44(ImageBlock, { content }) }, content.id ?? `image-${index}`);
|
|
14137
14454
|
}
|
|
14138
14455
|
if (isComponentContent3(content)) {
|
|
14139
14456
|
if (isContextCompressionComponent(content)) {
|
|
14140
|
-
return /* @__PURE__ */
|
|
14457
|
+
return /* @__PURE__ */ jsx44(
|
|
14141
14458
|
"div",
|
|
14142
14459
|
{
|
|
14143
14460
|
className: "w-full",
|
|
14144
|
-
children: /* @__PURE__ */
|
|
14461
|
+
children: /* @__PURE__ */ jsx44(ContextCompressionMessage, { content })
|
|
14145
14462
|
},
|
|
14146
14463
|
content.id ?? `context-compression-${index}`
|
|
14147
14464
|
);
|
|
@@ -14151,16 +14468,16 @@ function renderContentItem(content, index, message, lookupMessages, options) {
|
|
|
14151
14468
|
lookupMessages
|
|
14152
14469
|
);
|
|
14153
14470
|
if (requestUserInputResult) {
|
|
14154
|
-
return /* @__PURE__ */
|
|
14471
|
+
return /* @__PURE__ */ jsx44("div", { children: /* @__PURE__ */ jsx44(RequestUserInputResultCard, { result: requestUserInputResult }) }, content.id ?? `request-user-input-result-${index}`);
|
|
14155
14472
|
}
|
|
14156
14473
|
if (isWidgetComponent2(content)) {
|
|
14157
|
-
return /* @__PURE__ */
|
|
14474
|
+
return /* @__PURE__ */ jsx44("div", { children: /* @__PURE__ */ jsx44(WidgetMessage, { messageId, data: content.data }) }, content.id ?? `widget-${index}`);
|
|
14158
14475
|
}
|
|
14159
14476
|
if (isMcpAppComponent(content)) {
|
|
14160
|
-
return /* @__PURE__ */
|
|
14477
|
+
return /* @__PURE__ */ jsx44("div", { children: /* @__PURE__ */ jsx44(McpAppMessage, { messageId, data: content.data }) }, content.id ?? `mcp-app-${index}`);
|
|
14161
14478
|
}
|
|
14162
14479
|
if (getComponentMessagePresentation(content, getToolStepData(content)) === "grouped-step") {
|
|
14163
|
-
return /* @__PURE__ */
|
|
14480
|
+
return /* @__PURE__ */ jsx44("div", { children: /* @__PURE__ */ jsx44(
|
|
14164
14481
|
ToolComponentGroup,
|
|
14165
14482
|
{
|
|
14166
14483
|
items: [content],
|
|
@@ -14171,15 +14488,15 @@ function renderContentItem(content, index, message, lookupMessages, options) {
|
|
|
14171
14488
|
}
|
|
14172
14489
|
) }, content.id ?? `component-group-${index}`);
|
|
14173
14490
|
}
|
|
14174
|
-
return /* @__PURE__ */
|
|
14491
|
+
return /* @__PURE__ */ jsx44("div", { children: /* @__PURE__ */ jsx44(ComponentBlock, { content }) }, content.id ?? `component-${index}`);
|
|
14175
14492
|
}
|
|
14176
14493
|
if (isMemoryContent(content)) {
|
|
14177
|
-
return /* @__PURE__ */
|
|
14494
|
+
return /* @__PURE__ */ jsx44("div", { children: /* @__PURE__ */ jsx44(MemoryBlock, { content }) }, content.id ?? `memory-${index}`);
|
|
14178
14495
|
}
|
|
14179
14496
|
if (isAgentEventContent(content)) {
|
|
14180
|
-
return /* @__PURE__ */
|
|
14497
|
+
return /* @__PURE__ */ jsx44("div", { children: /* @__PURE__ */ jsx44(AgentEventRow, { content }) }, content.id ?? `agent-event-${index}`);
|
|
14181
14498
|
}
|
|
14182
|
-
return /* @__PURE__ */
|
|
14499
|
+
return /* @__PURE__ */ jsx44("div", { children: /* @__PURE__ */ jsx44(UnknownBlock, { content }) }, content.id ?? `unknown-${index}`);
|
|
14183
14500
|
}
|
|
14184
14501
|
function renderContentUnit(unit, message, lookupMessages, hasFollowingItem, options) {
|
|
14185
14502
|
if (unit.type === "item") {
|
|
@@ -14190,7 +14507,7 @@ function renderContentUnit(unit, message, lookupMessages, hasFollowingItem, opti
|
|
|
14190
14507
|
isAgentOutput: options?.isAgentOutput
|
|
14191
14508
|
});
|
|
14192
14509
|
}
|
|
14193
|
-
return /* @__PURE__ */
|
|
14510
|
+
return /* @__PURE__ */ jsx44("div", { children: /* @__PURE__ */ jsx44(
|
|
14194
14511
|
ToolComponentGroup,
|
|
14195
14512
|
{
|
|
14196
14513
|
items: unit.items,
|
|
@@ -14227,7 +14544,7 @@ function renderAssistantRenderUnits(units, message, lookupMessages, options, dep
|
|
|
14227
14544
|
const batch = entryBatch;
|
|
14228
14545
|
entryBatch = [];
|
|
14229
14546
|
rendered.push(
|
|
14230
|
-
/* @__PURE__ */
|
|
14547
|
+
/* @__PURE__ */ jsx44(React38.Fragment, { children: renderEntryBatch(batch, message, lookupMessages, hasFollowingItem, {
|
|
14231
14548
|
...options,
|
|
14232
14549
|
isAgentOutput: depth > 0
|
|
14233
14550
|
}) }, `entries-${batch[0]?.order ?? rendered.length}`)
|
|
@@ -14244,7 +14561,7 @@ function renderAssistantRenderUnits(units, message, lookupMessages, options, dep
|
|
|
14244
14561
|
}
|
|
14245
14562
|
flushEntries(true);
|
|
14246
14563
|
rendered.push(
|
|
14247
|
-
/* @__PURE__ */
|
|
14564
|
+
/* @__PURE__ */ jsx44(
|
|
14248
14565
|
AgentRunGroup,
|
|
14249
14566
|
{
|
|
14250
14567
|
node: unit.node,
|
|
@@ -14269,7 +14586,7 @@ function renderContent(message, lookupMessages, options) {
|
|
|
14269
14586
|
message
|
|
14270
14587
|
);
|
|
14271
14588
|
if (renderTree.hasAgentRuns) {
|
|
14272
|
-
return /* @__PURE__ */
|
|
14589
|
+
return /* @__PURE__ */ jsx44("div", { className: assistantMessageStackClassName, children: renderAssistantRenderUnits(
|
|
14273
14590
|
renderTree.units,
|
|
14274
14591
|
message,
|
|
14275
14592
|
lookupMessages,
|
|
@@ -14279,13 +14596,13 @@ function renderContent(message, lookupMessages, options) {
|
|
|
14279
14596
|
const content = message.content;
|
|
14280
14597
|
if (typeof content === "string") {
|
|
14281
14598
|
if (!content.trim()) return null;
|
|
14282
|
-
return /* @__PURE__ */
|
|
14599
|
+
return /* @__PURE__ */ jsx44(MarkdownText, { children: content });
|
|
14283
14600
|
}
|
|
14284
14601
|
if (!Array.isArray(content) || content.length === 0) return null;
|
|
14285
14602
|
const renderUnits = buildToolComponentRenderUnits(content, {
|
|
14286
14603
|
shouldGroupComponent: (item) => getRequestUserInputResultCardData(item, lookupMessages) === null && !isMcpAppComponent(item)
|
|
14287
14604
|
});
|
|
14288
|
-
return /* @__PURE__ */
|
|
14605
|
+
return /* @__PURE__ */ jsx44("div", { className: "space-y-3", children: renderUnits.map(
|
|
14289
14606
|
(unit, index) => renderContentUnit(
|
|
14290
14607
|
unit,
|
|
14291
14608
|
message,
|
|
@@ -14305,7 +14622,7 @@ function AssistantStreamingIndicator({
|
|
|
14305
14622
|
thinking: t("message.thinking"),
|
|
14306
14623
|
answering: t("message.answering")
|
|
14307
14624
|
};
|
|
14308
|
-
return /* @__PURE__ */
|
|
14625
|
+
return /* @__PURE__ */ jsxs30(
|
|
14309
14626
|
"div",
|
|
14310
14627
|
{
|
|
14311
14628
|
className: cn(
|
|
@@ -14313,18 +14630,18 @@ function AssistantStreamingIndicator({
|
|
|
14313
14630
|
className
|
|
14314
14631
|
),
|
|
14315
14632
|
children: [
|
|
14316
|
-
status === "loading" && /* @__PURE__ */
|
|
14317
|
-
status === "thinking" && /* @__PURE__ */
|
|
14318
|
-
/* @__PURE__ */
|
|
14319
|
-
/* @__PURE__ */
|
|
14320
|
-
/* @__PURE__ */
|
|
14633
|
+
status === "loading" && /* @__PURE__ */ jsx44(Loader29, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
14634
|
+
status === "thinking" && /* @__PURE__ */ jsxs30("div", { className: "flex items-end gap-1", "aria-hidden": "true", children: [
|
|
14635
|
+
/* @__PURE__ */ jsx44("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:-0.3s]" }),
|
|
14636
|
+
/* @__PURE__ */ jsx44("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:-0.15s]" }),
|
|
14637
|
+
/* @__PURE__ */ jsx44("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce" })
|
|
14321
14638
|
] }),
|
|
14322
|
-
status === "answering" && /* @__PURE__ */
|
|
14323
|
-
/* @__PURE__ */
|
|
14324
|
-
/* @__PURE__ */
|
|
14325
|
-
/* @__PURE__ */
|
|
14639
|
+
status === "answering" && /* @__PURE__ */ jsxs30("div", { className: "flex items-end gap-1", "aria-hidden": "true", children: [
|
|
14640
|
+
/* @__PURE__ */ jsx44("span", { className: "h-2 w-0.5 rounded-full bg-current animate-pulse [animation-delay:-0.25s]" }),
|
|
14641
|
+
/* @__PURE__ */ jsx44("span", { className: "h-3 w-0.5 rounded-full bg-current animate-pulse [animation-delay:-0.1s]" }),
|
|
14642
|
+
/* @__PURE__ */ jsx44("span", { className: "h-2.5 w-0.5 rounded-full bg-current animate-pulse" })
|
|
14326
14643
|
] }),
|
|
14327
|
-
/* @__PURE__ */
|
|
14644
|
+
/* @__PURE__ */ jsx44("span", { children: labelMap[status] })
|
|
14328
14645
|
]
|
|
14329
14646
|
}
|
|
14330
14647
|
);
|
|
@@ -14350,56 +14667,56 @@ function AssistantMessage({
|
|
|
14350
14667
|
const resolvedStreamingStatus = streamingStatus ?? getAssistantStreamingStatus(message, isStreaming);
|
|
14351
14668
|
const lookupMessages = messages?.length ? messages : [message];
|
|
14352
14669
|
const inlinePetState = resolvedStreamingStatus ? getInlinePetState(resolvedStreamingStatus) : null;
|
|
14353
|
-
const inlinePet = inlinePetState ? /* @__PURE__ */
|
|
14670
|
+
const inlinePet = inlinePetState ? /* @__PURE__ */ jsx44(InlinePetStatus, { pet, state: inlinePetState }) : null;
|
|
14354
14671
|
const answerNode = renderContent(message, lookupMessages, {
|
|
14355
14672
|
isThreadRunning,
|
|
14356
14673
|
organizationId,
|
|
14357
14674
|
apiUrl
|
|
14358
14675
|
});
|
|
14359
|
-
const reasoningNode = hasReasoning ? /* @__PURE__ */
|
|
14676
|
+
const reasoningNode = hasReasoning ? /* @__PURE__ */ jsx44(ReasoningBlock, { reasoning: rootReasoning ?? [] }) : null;
|
|
14360
14677
|
if (!hasContent && !hasReasoning && !resolvedStreamingStatus) return null;
|
|
14361
14678
|
const streamingClass = isStreaming ? "streaming-active" : "";
|
|
14362
14679
|
if (!hasContent && !hasReasoning && resolvedStreamingStatus) {
|
|
14363
|
-
return /* @__PURE__ */
|
|
14680
|
+
return /* @__PURE__ */ jsx44("div", { className: cn("space-y-3", streamingClass, className), children: /* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-2", children: [
|
|
14364
14681
|
inlinePet,
|
|
14365
|
-
/* @__PURE__ */
|
|
14682
|
+
/* @__PURE__ */ jsx44(AssistantStreamingIndicator, { status: resolvedStreamingStatus })
|
|
14366
14683
|
] }) });
|
|
14367
14684
|
}
|
|
14368
14685
|
if (hasContent && hasReasoning) {
|
|
14369
|
-
return /* @__PURE__ */
|
|
14370
|
-
/* @__PURE__ */
|
|
14686
|
+
return /* @__PURE__ */ jsxs30("div", { className: cn("space-y-3", streamingClass, className), children: [
|
|
14687
|
+
/* @__PURE__ */ jsxs30(
|
|
14371
14688
|
Tabs,
|
|
14372
14689
|
{
|
|
14373
14690
|
defaultValue: message.status === "reasoning" ? "reasoning" : "answer",
|
|
14374
14691
|
className: "w-full",
|
|
14375
14692
|
children: [
|
|
14376
|
-
/* @__PURE__ */
|
|
14693
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-2", children: [
|
|
14377
14694
|
inlinePet,
|
|
14378
|
-
/* @__PURE__ */
|
|
14379
|
-
/* @__PURE__ */
|
|
14380
|
-
/* @__PURE__ */
|
|
14695
|
+
/* @__PURE__ */ jsxs30(TabsList, { className: "", children: [
|
|
14696
|
+
/* @__PURE__ */ jsx44(TabsTrigger, { value: "answer", children: t("message.answer") }),
|
|
14697
|
+
/* @__PURE__ */ jsx44(TabsTrigger, { value: "reasoning", children: t("message.reasoning") })
|
|
14381
14698
|
] })
|
|
14382
14699
|
] }),
|
|
14383
|
-
/* @__PURE__ */
|
|
14384
|
-
/* @__PURE__ */
|
|
14700
|
+
/* @__PURE__ */ jsx44(TabsContent, { value: "answer", className: "space-y-3", children: answerNode }),
|
|
14701
|
+
/* @__PURE__ */ jsx44(TabsContent, { value: "reasoning", className: "space-y-3", children: reasoningNode })
|
|
14385
14702
|
]
|
|
14386
14703
|
}
|
|
14387
14704
|
),
|
|
14388
|
-
resolvedStreamingStatus ? /* @__PURE__ */
|
|
14705
|
+
resolvedStreamingStatus ? /* @__PURE__ */ jsx44(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) : null
|
|
14389
14706
|
] });
|
|
14390
14707
|
}
|
|
14391
|
-
return /* @__PURE__ */
|
|
14708
|
+
return /* @__PURE__ */ jsxs30("div", { className: cn("space-y-3", streamingClass, className), children: [
|
|
14392
14709
|
hasReasoning ? reasoningNode : answerNode,
|
|
14393
|
-
resolvedStreamingStatus ? /* @__PURE__ */
|
|
14710
|
+
resolvedStreamingStatus ? /* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-2", children: [
|
|
14394
14711
|
inlinePet,
|
|
14395
|
-
/* @__PURE__ */
|
|
14712
|
+
/* @__PURE__ */ jsx44(AssistantStreamingIndicator, { status: resolvedStreamingStatus })
|
|
14396
14713
|
] }) : null
|
|
14397
14714
|
] });
|
|
14398
14715
|
}
|
|
14399
14716
|
|
|
14400
14717
|
// src/components/thread/MessageNavigator.tsx
|
|
14401
|
-
import * as
|
|
14402
|
-
import { jsx as
|
|
14718
|
+
import * as React39 from "react";
|
|
14719
|
+
import { jsx as jsx45, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
14403
14720
|
var ACTIVE_OFFSET_PX = 12;
|
|
14404
14721
|
function getMarkerWidthClass(index, active, interactionIndex) {
|
|
14405
14722
|
if (interactionIndex >= 0) {
|
|
@@ -14446,17 +14763,17 @@ function MessageNavigator({
|
|
|
14446
14763
|
label,
|
|
14447
14764
|
tagsOverflowLabel
|
|
14448
14765
|
}) {
|
|
14449
|
-
const [hoveredId, setHoveredId] =
|
|
14450
|
-
const [focusedId, setFocusedId] =
|
|
14451
|
-
const [activeId, setActiveId] =
|
|
14452
|
-
const updateActiveItem =
|
|
14766
|
+
const [hoveredId, setHoveredId] = React39.useState(null);
|
|
14767
|
+
const [focusedId, setFocusedId] = React39.useState(null);
|
|
14768
|
+
const [activeId, setActiveId] = React39.useState(null);
|
|
14769
|
+
const updateActiveItem = React39.useCallback(() => {
|
|
14453
14770
|
const viewport = viewportRef.current;
|
|
14454
14771
|
setActiveId(resolveActiveItemId(items, viewport, getAnchor));
|
|
14455
14772
|
}, [getAnchor, items, viewportRef]);
|
|
14456
|
-
|
|
14773
|
+
React39.useLayoutEffect(() => {
|
|
14457
14774
|
updateActiveItem();
|
|
14458
14775
|
}, [updateActiveItem]);
|
|
14459
|
-
|
|
14776
|
+
React39.useEffect(() => {
|
|
14460
14777
|
const viewport = viewportRef.current;
|
|
14461
14778
|
if (!viewport) return;
|
|
14462
14779
|
let frame = null;
|
|
@@ -14480,7 +14797,7 @@ function MessageNavigator({
|
|
|
14480
14797
|
resizeObserver?.disconnect();
|
|
14481
14798
|
};
|
|
14482
14799
|
}, [updateActiveItem, viewportRef]);
|
|
14483
|
-
const handleNavigate =
|
|
14800
|
+
const handleNavigate = React39.useCallback(
|
|
14484
14801
|
(item) => {
|
|
14485
14802
|
const viewport = viewportRef.current;
|
|
14486
14803
|
const anchor = getAnchor(item);
|
|
@@ -14494,7 +14811,7 @@ function MessageNavigator({
|
|
|
14494
14811
|
if (items.length === 0) return null;
|
|
14495
14812
|
const interactionId = focusedId ?? hoveredId;
|
|
14496
14813
|
const interactionIndex = interactionId ? items.findIndex((item) => item.id === interactionId) : -1;
|
|
14497
|
-
return /* @__PURE__ */
|
|
14814
|
+
return /* @__PURE__ */ jsx45(
|
|
14498
14815
|
"nav",
|
|
14499
14816
|
{
|
|
14500
14817
|
"aria-label": label,
|
|
@@ -14503,11 +14820,11 @@ function MessageNavigator({
|
|
|
14503
14820
|
className
|
|
14504
14821
|
),
|
|
14505
14822
|
"data-slot": "chatkit-message-navigator",
|
|
14506
|
-
children: /* @__PURE__ */
|
|
14823
|
+
children: /* @__PURE__ */ jsx45("div", { className: "group/nav relative h-[calc(100vh-9rem)] w-12", children: /* @__PURE__ */ jsx45("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) => {
|
|
14507
14824
|
const isActive = item.id === activeId;
|
|
14508
14825
|
const isPreviewed = item.id === hoveredId || item.id === focusedId;
|
|
14509
|
-
return /* @__PURE__ */
|
|
14510
|
-
/* @__PURE__ */
|
|
14826
|
+
return /* @__PURE__ */ jsxs31("div", { className: "relative h-3.5 w-10 shrink-0", children: [
|
|
14827
|
+
/* @__PURE__ */ jsx45(
|
|
14511
14828
|
"button",
|
|
14512
14829
|
{
|
|
14513
14830
|
type: "button",
|
|
@@ -14522,7 +14839,7 @@ function MessageNavigator({
|
|
|
14522
14839
|
onMouseLeave: () => setHoveredId((id) => id === item.id ? null : id),
|
|
14523
14840
|
onFocus: () => setFocusedId(item.id),
|
|
14524
14841
|
onBlur: () => setFocusedId((id) => id === item.id ? null : id),
|
|
14525
|
-
children: /* @__PURE__ */
|
|
14842
|
+
children: /* @__PURE__ */ jsx45(
|
|
14526
14843
|
"span",
|
|
14527
14844
|
{
|
|
14528
14845
|
className: cn(
|
|
@@ -14536,7 +14853,7 @@ function MessageNavigator({
|
|
|
14536
14853
|
)
|
|
14537
14854
|
}
|
|
14538
14855
|
),
|
|
14539
|
-
isPreviewed && /* @__PURE__ */
|
|
14856
|
+
isPreviewed && /* @__PURE__ */ jsxs31(
|
|
14540
14857
|
"div",
|
|
14541
14858
|
{
|
|
14542
14859
|
className: cn(
|
|
@@ -14544,10 +14861,10 @@ function MessageNavigator({
|
|
|
14544
14861
|
"rounded-lg border border-border bg-background/95 p-3 text-left shadow-xl backdrop-blur"
|
|
14545
14862
|
),
|
|
14546
14863
|
children: [
|
|
14547
|
-
/* @__PURE__ */
|
|
14548
|
-
/* @__PURE__ */
|
|
14549
|
-
item.tags.length > 0 && /* @__PURE__ */
|
|
14550
|
-
item.tags.slice(0, 3).map((tag) => /* @__PURE__ */
|
|
14864
|
+
/* @__PURE__ */ jsx45("div", { className: "mb-1 truncate text-sm font-medium text-foreground", children: item.title }),
|
|
14865
|
+
/* @__PURE__ */ jsx45("div", { className: "line-clamp-2 text-sm leading-5 text-muted-foreground", children: item.preview }),
|
|
14866
|
+
item.tags.length > 0 && /* @__PURE__ */ jsxs31("div", { className: "mt-2 flex flex-wrap gap-1.5", children: [
|
|
14867
|
+
item.tags.slice(0, 3).map((tag) => /* @__PURE__ */ jsx45(
|
|
14551
14868
|
"span",
|
|
14552
14869
|
{
|
|
14553
14870
|
className: "max-w-[8rem] truncate rounded-md bg-muted px-1.5 py-0.5 text-[11px] leading-4 text-muted-foreground",
|
|
@@ -14555,7 +14872,7 @@ function MessageNavigator({
|
|
|
14555
14872
|
},
|
|
14556
14873
|
tag
|
|
14557
14874
|
)),
|
|
14558
|
-
item.tags.length > 3 && /* @__PURE__ */
|
|
14875
|
+
item.tags.length > 3 && /* @__PURE__ */ jsx45("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) })
|
|
14559
14876
|
] })
|
|
14560
14877
|
]
|
|
14561
14878
|
}
|
|
@@ -14567,9 +14884,9 @@ function MessageNavigator({
|
|
|
14567
14884
|
}
|
|
14568
14885
|
|
|
14569
14886
|
// src/components/thread/MessageActions.tsx
|
|
14570
|
-
import * as
|
|
14571
|
-
import { Check as Check5, Copy as Copy3, RefreshCw as
|
|
14572
|
-
import { jsx as
|
|
14887
|
+
import * as React40 from "react";
|
|
14888
|
+
import { Check as Check5, Copy as Copy3, RefreshCw as RefreshCw4 } from "lucide-react";
|
|
14889
|
+
import { jsx as jsx46, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
14573
14890
|
function MessageActions({
|
|
14574
14891
|
content,
|
|
14575
14892
|
isAssistant = false,
|
|
@@ -14578,7 +14895,7 @@ function MessageActions({
|
|
|
14578
14895
|
className
|
|
14579
14896
|
}) {
|
|
14580
14897
|
const { t } = useChatkitTranslation();
|
|
14581
|
-
const [copied, setCopied] =
|
|
14898
|
+
const [copied, setCopied] = React40.useState(false);
|
|
14582
14899
|
const handleCopy = async () => {
|
|
14583
14900
|
try {
|
|
14584
14901
|
await navigator.clipboard.writeText(content);
|
|
@@ -14591,7 +14908,7 @@ function MessageActions({
|
|
|
14591
14908
|
if (isStreaming) {
|
|
14592
14909
|
return null;
|
|
14593
14910
|
}
|
|
14594
|
-
return /* @__PURE__ */
|
|
14911
|
+
return /* @__PURE__ */ jsxs32(
|
|
14595
14912
|
"div",
|
|
14596
14913
|
{
|
|
14597
14914
|
className: cn(
|
|
@@ -14599,7 +14916,7 @@ function MessageActions({
|
|
|
14599
14916
|
className
|
|
14600
14917
|
),
|
|
14601
14918
|
children: [
|
|
14602
|
-
/* @__PURE__ */
|
|
14919
|
+
/* @__PURE__ */ jsx46(
|
|
14603
14920
|
"button",
|
|
14604
14921
|
{
|
|
14605
14922
|
type: "button",
|
|
@@ -14609,17 +14926,17 @@ function MessageActions({
|
|
|
14609
14926
|
copied && "text-green-500"
|
|
14610
14927
|
),
|
|
14611
14928
|
title: copied ? t("messageActions.copied") : t("messageActions.copy"),
|
|
14612
|
-
children: copied ? /* @__PURE__ */
|
|
14929
|
+
children: copied ? /* @__PURE__ */ jsx46(Check5, { size: 14 }) : /* @__PURE__ */ jsx46(Copy3, { size: 14 })
|
|
14613
14930
|
}
|
|
14614
14931
|
),
|
|
14615
|
-
isAssistant && onRetry && /* @__PURE__ */
|
|
14932
|
+
isAssistant && onRetry && /* @__PURE__ */ jsx46(
|
|
14616
14933
|
"button",
|
|
14617
14934
|
{
|
|
14618
14935
|
type: "button",
|
|
14619
14936
|
onClick: onRetry,
|
|
14620
14937
|
className: "p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",
|
|
14621
14938
|
title: t("messageActions.regenerate"),
|
|
14622
|
-
children: /* @__PURE__ */
|
|
14939
|
+
children: /* @__PURE__ */ jsx46(RefreshCw4, { size: 14 })
|
|
14623
14940
|
}
|
|
14624
14941
|
)
|
|
14625
14942
|
]
|
|
@@ -14640,18 +14957,18 @@ import {
|
|
|
14640
14957
|
Sparkles as Sparkles3,
|
|
14641
14958
|
Zap
|
|
14642
14959
|
} from "lucide-react";
|
|
14643
|
-
import { jsx as
|
|
14960
|
+
import { jsx as jsx47, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
14644
14961
|
function getIconComponent2(icon) {
|
|
14645
14962
|
const iconMap = {
|
|
14646
|
-
"circle-question": /* @__PURE__ */
|
|
14647
|
-
"lightbulb": /* @__PURE__ */
|
|
14648
|
-
"sparkle": /* @__PURE__ */
|
|
14649
|
-
"write": /* @__PURE__ */
|
|
14650
|
-
"search": /* @__PURE__ */
|
|
14651
|
-
"globe": /* @__PURE__ */
|
|
14652
|
-
"book-open": /* @__PURE__ */
|
|
14653
|
-
"compass": /* @__PURE__ */
|
|
14654
|
-
"bolt": /* @__PURE__ */
|
|
14963
|
+
"circle-question": /* @__PURE__ */ jsx47(HelpCircle, { size: 20 }),
|
|
14964
|
+
"lightbulb": /* @__PURE__ */ jsx47(Lightbulb2, { size: 20 }),
|
|
14965
|
+
"sparkle": /* @__PURE__ */ jsx47(Sparkles3, { size: 20 }),
|
|
14966
|
+
"write": /* @__PURE__ */ jsx47(Pencil3, { size: 20 }),
|
|
14967
|
+
"search": /* @__PURE__ */ jsx47(Search3, { size: 20 }),
|
|
14968
|
+
"globe": /* @__PURE__ */ jsx47(Globe2, { size: 20 }),
|
|
14969
|
+
"book-open": /* @__PURE__ */ jsx47(BookOpen2, { size: 20 }),
|
|
14970
|
+
"compass": /* @__PURE__ */ jsx47(Compass, { size: 20 }),
|
|
14971
|
+
"bolt": /* @__PURE__ */ jsx47(Zap, { size: 20 })
|
|
14655
14972
|
};
|
|
14656
14973
|
return icon ? iconMap[icon] || iconMap["sparkle"] : iconMap["sparkle"];
|
|
14657
14974
|
}
|
|
@@ -14667,7 +14984,7 @@ function StartScreen({
|
|
|
14667
14984
|
const greeting = startScreen?.greeting ?? t("startScreen.greeting");
|
|
14668
14985
|
const prompts = startScreen?.prompts ?? [];
|
|
14669
14986
|
const editPromptLabel = t("startScreen.editPrompt");
|
|
14670
|
-
return /* @__PURE__ */
|
|
14987
|
+
return /* @__PURE__ */ jsxs33(
|
|
14671
14988
|
"div",
|
|
14672
14989
|
{
|
|
14673
14990
|
className: cn(
|
|
@@ -14675,8 +14992,8 @@ function StartScreen({
|
|
|
14675
14992
|
className
|
|
14676
14993
|
),
|
|
14677
14994
|
children: [
|
|
14678
|
-
/* @__PURE__ */
|
|
14679
|
-
prompts.length > 0 && /* @__PURE__ */
|
|
14995
|
+
/* @__PURE__ */ jsx47("div", { className: "mb-8 text-center", children: /* @__PURE__ */ jsx47("h2", { className: "text-2xl font-semibold text-foreground mb-2", children: greeting }) }),
|
|
14996
|
+
prompts.length > 0 && /* @__PURE__ */ jsx47("div", { className: "w-full max-w-2xl", children: /* @__PURE__ */ jsx47("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: prompts.map((item, index) => /* @__PURE__ */ jsxs33(
|
|
14680
14997
|
"div",
|
|
14681
14998
|
{
|
|
14682
14999
|
className: cn(
|
|
@@ -14685,23 +15002,23 @@ function StartScreen({
|
|
|
14685
15002
|
"focus-within:ring-2 focus-within:ring-primary/20"
|
|
14686
15003
|
),
|
|
14687
15004
|
children: [
|
|
14688
|
-
/* @__PURE__ */
|
|
15005
|
+
/* @__PURE__ */ jsxs33(
|
|
14689
15006
|
"button",
|
|
14690
15007
|
{
|
|
14691
15008
|
type: "button",
|
|
14692
15009
|
disabled: promptSendDisabled,
|
|
14693
15010
|
onClick: () => onPromptClick?.(item.prompt),
|
|
14694
15011
|
className: cn(
|
|
14695
|
-
"flex min-w-0 flex-1 items-center gap-3 p-4 text-left",
|
|
15012
|
+
"flex min-w-0 flex-1 items-center gap-3 p-4 text-left overflow-hidden",
|
|
14696
15013
|
"focus:outline-none disabled:cursor-not-allowed disabled:opacity-50"
|
|
14697
15014
|
),
|
|
14698
15015
|
children: [
|
|
14699
|
-
/* @__PURE__ */
|
|
14700
|
-
/* @__PURE__ */
|
|
15016
|
+
/* @__PURE__ */ jsx47("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary", children: getIconComponent2(item.icon) }),
|
|
15017
|
+
/* @__PURE__ */ jsx47("div", { className: "text-sm font-medium text-foreground line-clamp-3 overflow-hidden", title: item.label, children: item.label })
|
|
14701
15018
|
]
|
|
14702
15019
|
}
|
|
14703
15020
|
),
|
|
14704
|
-
/* @__PURE__ */
|
|
15021
|
+
/* @__PURE__ */ jsx47(
|
|
14705
15022
|
"button",
|
|
14706
15023
|
{
|
|
14707
15024
|
type: "button",
|
|
@@ -14714,7 +15031,7 @@ function StartScreen({
|
|
|
14714
15031
|
"rounded-r-xl transition-colors hover:bg-muted hover:text-foreground",
|
|
14715
15032
|
"focus:outline-none disabled:cursor-not-allowed disabled:opacity-50"
|
|
14716
15033
|
),
|
|
14717
|
-
children: /* @__PURE__ */
|
|
15034
|
+
children: /* @__PURE__ */ jsx47(Pencil3, { size: 16 })
|
|
14718
15035
|
}
|
|
14719
15036
|
)
|
|
14720
15037
|
]
|
|
@@ -14727,7 +15044,7 @@ function StartScreen({
|
|
|
14727
15044
|
}
|
|
14728
15045
|
|
|
14729
15046
|
// src/hooks/useThreads.ts
|
|
14730
|
-
import * as
|
|
15047
|
+
import * as React42 from "react";
|
|
14731
15048
|
var DEFAULT_LIMIT = 50;
|
|
14732
15049
|
var getThreadTitle = (threadRecord) => {
|
|
14733
15050
|
const title = threadRecord.title?.trim();
|
|
@@ -14780,16 +15097,16 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
14780
15097
|
isLoading: isStreamLoading,
|
|
14781
15098
|
error: streamError
|
|
14782
15099
|
} = useStreamContext();
|
|
14783
|
-
const [threadRecords, setThreadRecords] =
|
|
14784
|
-
const [isLoading, setIsLoading] =
|
|
14785
|
-
const [error, setError] =
|
|
14786
|
-
const upsertThreadRecord =
|
|
15100
|
+
const [threadRecords, setThreadRecords] = React42.useState([]);
|
|
15101
|
+
const [isLoading, setIsLoading] = React42.useState(false);
|
|
15102
|
+
const [error, setError] = React42.useState(null);
|
|
15103
|
+
const upsertThreadRecord = React42.useCallback((threadRecord) => {
|
|
14787
15104
|
setThreadRecords((prev) => {
|
|
14788
15105
|
const next = prev.filter((item) => item.id !== threadRecord.id);
|
|
14789
15106
|
return sortThreadRecords([threadRecord, ...next]);
|
|
14790
15107
|
});
|
|
14791
15108
|
}, []);
|
|
14792
|
-
const refreshThreads =
|
|
15109
|
+
const refreshThreads = React42.useCallback(async () => {
|
|
14793
15110
|
setIsLoading(true);
|
|
14794
15111
|
setError(null);
|
|
14795
15112
|
try {
|
|
@@ -14805,7 +15122,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
14805
15122
|
setIsLoading(false);
|
|
14806
15123
|
}
|
|
14807
15124
|
}, [client, limit, assistantId]);
|
|
14808
|
-
const createThread =
|
|
15125
|
+
const createThread = React42.useCallback(
|
|
14809
15126
|
async (input) => {
|
|
14810
15127
|
setError(null);
|
|
14811
15128
|
const payload = {};
|
|
@@ -14819,7 +15136,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
14819
15136
|
},
|
|
14820
15137
|
[client, upsertThreadRecord]
|
|
14821
15138
|
);
|
|
14822
|
-
const updateThread =
|
|
15139
|
+
const updateThread = React42.useCallback(
|
|
14823
15140
|
async (recordId, payload) => {
|
|
14824
15141
|
setError(null);
|
|
14825
15142
|
const updated = await client.conversations.update(recordId, payload);
|
|
@@ -14828,7 +15145,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
14828
15145
|
},
|
|
14829
15146
|
[client, upsertThreadRecord]
|
|
14830
15147
|
);
|
|
14831
|
-
const deleteThread =
|
|
15148
|
+
const deleteThread = React42.useCallback(
|
|
14832
15149
|
async (recordId) => {
|
|
14833
15150
|
setError(null);
|
|
14834
15151
|
await client.conversations.delete(recordId);
|
|
@@ -14836,11 +15153,11 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
14836
15153
|
},
|
|
14837
15154
|
[client]
|
|
14838
15155
|
);
|
|
14839
|
-
|
|
15156
|
+
React42.useEffect(() => {
|
|
14840
15157
|
if (!isReady) return;
|
|
14841
15158
|
void refreshThreads();
|
|
14842
15159
|
}, [refreshThreads, isReady]);
|
|
14843
|
-
|
|
15160
|
+
React42.useEffect(() => {
|
|
14844
15161
|
if (!threadId || !isStreamLoading) return;
|
|
14845
15162
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
14846
15163
|
const busyStatus = "busy";
|
|
@@ -14861,7 +15178,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
14861
15178
|
return changed ? sortThreadRecords(next) : prev;
|
|
14862
15179
|
});
|
|
14863
15180
|
}, [threadId, isStreamLoading]);
|
|
14864
|
-
|
|
15181
|
+
React42.useEffect(() => {
|
|
14865
15182
|
const message = getErrorMessage2(streamError)?.trim();
|
|
14866
15183
|
if (!threadId || !message) return;
|
|
14867
15184
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -14883,7 +15200,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
14883
15200
|
return changed ? sortThreadRecords(next) : prev;
|
|
14884
15201
|
});
|
|
14885
15202
|
}, [threadId, streamError]);
|
|
14886
|
-
|
|
15203
|
+
React42.useEffect(() => {
|
|
14887
15204
|
if (!isReady || !threadId || isStreamLoading) return;
|
|
14888
15205
|
let cancelled = false;
|
|
14889
15206
|
void client.conversations.search({ where: { threadId }, limit: 1 }).then((result) => {
|
|
@@ -14897,7 +15214,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
14897
15214
|
cancelled = true;
|
|
14898
15215
|
};
|
|
14899
15216
|
}, [client, threadId, upsertThreadRecord, isReady, isStreamLoading]);
|
|
14900
|
-
const threads =
|
|
15217
|
+
const threads = React42.useMemo(
|
|
14901
15218
|
() => threadRecords.map((threadRecord) => toThreadItem(threadRecord)),
|
|
14902
15219
|
[threadRecords]
|
|
14903
15220
|
);
|
|
@@ -14914,10 +15231,10 @@ function useThreads(limit = DEFAULT_LIMIT) {
|
|
|
14914
15231
|
}
|
|
14915
15232
|
|
|
14916
15233
|
// src/components/thread/context-usage-indicator.tsx
|
|
14917
|
-
import * as
|
|
15234
|
+
import * as React43 from "react";
|
|
14918
15235
|
|
|
14919
15236
|
// src/components/ui/progress-circle.tsx
|
|
14920
|
-
import { jsx as
|
|
15237
|
+
import { jsx as jsx48, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
14921
15238
|
function clamp2(input, a, b) {
|
|
14922
15239
|
return Math.max(Math.min(input, Math.max(a, b)), Math.min(a, b));
|
|
14923
15240
|
}
|
|
@@ -14940,7 +15257,7 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
|
|
|
14940
15257
|
return (
|
|
14941
15258
|
// biome-ignore lint/a11y/useFocusableInteractive: false positive (progress + progressbar are not focusable interactives)
|
|
14942
15259
|
// biome-ignore lint/nursery/useAriaPropsSupportedByRole: biome rule at odds with mdn docs (presumed nursary bug with rule)
|
|
14943
|
-
/* @__PURE__ */
|
|
15260
|
+
/* @__PURE__ */ jsxs34(
|
|
14944
15261
|
"svg",
|
|
14945
15262
|
{
|
|
14946
15263
|
role: "progressbar",
|
|
@@ -14951,8 +15268,8 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
|
|
|
14951
15268
|
"aria-valuemax": 100,
|
|
14952
15269
|
...restSvgProps,
|
|
14953
15270
|
children: [
|
|
14954
|
-
/* @__PURE__ */
|
|
14955
|
-
/* @__PURE__ */
|
|
15271
|
+
/* @__PURE__ */ jsx48("circle", { ...commonParams, className: "stroke-current/25" }),
|
|
15272
|
+
/* @__PURE__ */ jsx48(
|
|
14956
15273
|
"circle",
|
|
14957
15274
|
{
|
|
14958
15275
|
...commonParams,
|
|
@@ -14971,7 +15288,7 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
|
|
|
14971
15288
|
};
|
|
14972
15289
|
|
|
14973
15290
|
// src/components/thread/context-usage-indicator.tsx
|
|
14974
|
-
import { jsx as
|
|
15291
|
+
import { jsx as jsx49, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
14975
15292
|
var kNumberFormatter = new Intl.NumberFormat("en-US", {
|
|
14976
15293
|
minimumFractionDigits: 0,
|
|
14977
15294
|
maximumFractionDigits: 1
|
|
@@ -15004,21 +15321,21 @@ function ContextUsageIndicator({
|
|
|
15004
15321
|
}) {
|
|
15005
15322
|
const { t } = useChatkitTranslation();
|
|
15006
15323
|
const stream = useStreamContext();
|
|
15007
|
-
const [maxContextSize, setMaxContextSize] =
|
|
15008
|
-
const [usedContextSize, setUsedContextSize] =
|
|
15009
|
-
const [assistantAgentKey, setAssistantAgentKey] =
|
|
15010
|
-
const latestRealtimeUsageRef =
|
|
15324
|
+
const [maxContextSize, setMaxContextSize] = React43.useState(null);
|
|
15325
|
+
const [usedContextSize, setUsedContextSize] = React43.useState(null);
|
|
15326
|
+
const [assistantAgentKey, setAssistantAgentKey] = React43.useState(null);
|
|
15327
|
+
const latestRealtimeUsageRef = React43.useRef({
|
|
15011
15328
|
threadId: null,
|
|
15012
15329
|
agentKey: null,
|
|
15013
15330
|
usedTokens: null
|
|
15014
15331
|
});
|
|
15015
|
-
const realtimeUsage =
|
|
15332
|
+
const realtimeUsage = React43.useMemo(
|
|
15016
15333
|
() => getThreadContextUsage(stream.contextUsageByAgentKey, assistantAgentKey),
|
|
15017
15334
|
[assistantAgentKey, stream.contextUsageByAgentKey]
|
|
15018
15335
|
);
|
|
15019
15336
|
const realtimeUsedContextSize = getThreadContextUsageTotalTokens(realtimeUsage);
|
|
15020
15337
|
const hasApiConfiguration = Boolean(stream.apiUrl?.trim() && stream.apiKey?.trim());
|
|
15021
|
-
|
|
15338
|
+
React43.useEffect(() => {
|
|
15022
15339
|
if (!hasApiConfiguration || !stream.client || !stream.assistantId) {
|
|
15023
15340
|
setMaxContextSize(null);
|
|
15024
15341
|
setAssistantAgentKey(null);
|
|
@@ -15038,18 +15355,18 @@ function ContextUsageIndicator({
|
|
|
15038
15355
|
cancelled = true;
|
|
15039
15356
|
};
|
|
15040
15357
|
}, [hasApiConfiguration, stream.client, stream.assistantId]);
|
|
15041
|
-
|
|
15358
|
+
React43.useEffect(() => {
|
|
15042
15359
|
latestRealtimeUsageRef.current = {
|
|
15043
15360
|
threadId: stream.threadId ?? null,
|
|
15044
15361
|
agentKey: assistantAgentKey,
|
|
15045
15362
|
usedTokens: realtimeUsedContextSize
|
|
15046
15363
|
};
|
|
15047
15364
|
}, [assistantAgentKey, realtimeUsedContextSize, stream.threadId]);
|
|
15048
|
-
|
|
15365
|
+
React43.useEffect(() => {
|
|
15049
15366
|
if (realtimeUsedContextSize == null) return;
|
|
15050
15367
|
setUsedContextSize(realtimeUsedContextSize);
|
|
15051
15368
|
}, [realtimeUsedContextSize]);
|
|
15052
|
-
|
|
15369
|
+
React43.useEffect(() => {
|
|
15053
15370
|
if (!hasApiConfiguration || !stream.client) {
|
|
15054
15371
|
setUsedContextSize(null);
|
|
15055
15372
|
return;
|
|
@@ -15115,8 +15432,8 @@ function ContextUsageIndicator({
|
|
|
15115
15432
|
});
|
|
15116
15433
|
const usageLabelWithSuffix = usageLabel.endsWith(":") ? usageLabel : `${usageLabel}:`;
|
|
15117
15434
|
const progressClassName = percent >= 90 ? "text-destructive" : percent >= 75 ? "text-amber-500" : "text-primary dark:text-zinc-300";
|
|
15118
|
-
return /* @__PURE__ */
|
|
15119
|
-
/* @__PURE__ */
|
|
15435
|
+
return /* @__PURE__ */ jsxs35(Tooltip, { children: [
|
|
15436
|
+
/* @__PURE__ */ jsx49(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx49(
|
|
15120
15437
|
"button",
|
|
15121
15438
|
{
|
|
15122
15439
|
type: "button",
|
|
@@ -15125,31 +15442,31 @@ function ContextUsageIndicator({
|
|
|
15125
15442
|
className
|
|
15126
15443
|
),
|
|
15127
15444
|
"aria-label": `${usageLabelWithSuffix} ${usageFullLabel}. ${usageTokensLabel}`,
|
|
15128
|
-
children: /* @__PURE__ */
|
|
15445
|
+
children: /* @__PURE__ */ jsx49(ProgressCircle, { value: percent, className: cn("size-3.5", progressClassName) })
|
|
15129
15446
|
}
|
|
15130
15447
|
) }),
|
|
15131
|
-
/* @__PURE__ */
|
|
15132
|
-
/* @__PURE__ */
|
|
15133
|
-
/* @__PURE__ */
|
|
15134
|
-
/* @__PURE__ */
|
|
15448
|
+
/* @__PURE__ */ jsxs35(TooltipContent, { side: "top", sideOffset: 6, className: "space-y-0.5 px-3 py-2 text-center", children: [
|
|
15449
|
+
/* @__PURE__ */ jsx49("div", { className: "text-primary-foreground/70", children: usageLabelWithSuffix }),
|
|
15450
|
+
/* @__PURE__ */ jsx49("div", { className: "font-medium text-primary-foreground/80", children: usageFullLabel }),
|
|
15451
|
+
/* @__PURE__ */ jsx49("div", { className: "text-sm font-semibold", children: usageTokensLabel })
|
|
15135
15452
|
] })
|
|
15136
15453
|
] });
|
|
15137
15454
|
}
|
|
15138
15455
|
|
|
15139
15456
|
// src/components/pet/PetBridge.tsx
|
|
15140
|
-
import * as
|
|
15457
|
+
import * as React44 from "react";
|
|
15141
15458
|
import { normalizePetOptions as normalizePetOptions2 } from "@xpert-ai/chatkit-types";
|
|
15142
15459
|
function PetBridge({ pet, state }) {
|
|
15143
15460
|
const parentMessenger = useParentMessenger();
|
|
15144
15461
|
const sendEvent = parentMessenger?.sendEvent;
|
|
15145
|
-
const options =
|
|
15146
|
-
|
|
15462
|
+
const options = React44.useMemo(() => normalizePetOptions2(pet), [pet]);
|
|
15463
|
+
React44.useEffect(() => {
|
|
15147
15464
|
if (!sendEvent) {
|
|
15148
15465
|
return;
|
|
15149
15466
|
}
|
|
15150
15467
|
sendEvent("pet_options_change", { pet: pet ?? null });
|
|
15151
15468
|
}, [sendEvent, pet]);
|
|
15152
|
-
|
|
15469
|
+
React44.useEffect(() => {
|
|
15153
15470
|
if (!sendEvent || !options) {
|
|
15154
15471
|
return;
|
|
15155
15472
|
}
|
|
@@ -15159,15 +15476,15 @@ function PetBridge({ pet, state }) {
|
|
|
15159
15476
|
}
|
|
15160
15477
|
|
|
15161
15478
|
// src/components/settings/SettingsSheet.tsx
|
|
15162
|
-
import * as
|
|
15479
|
+
import * as React51 from "react";
|
|
15163
15480
|
import { PawPrint, Settings } from "lucide-react";
|
|
15164
15481
|
|
|
15165
15482
|
// src/components/ui/input.tsx
|
|
15166
|
-
import * as
|
|
15167
|
-
import { jsx as
|
|
15168
|
-
var Input =
|
|
15483
|
+
import * as React45 from "react";
|
|
15484
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
15485
|
+
var Input = React45.forwardRef(
|
|
15169
15486
|
({ className, type, ...props }, ref) => {
|
|
15170
|
-
return /* @__PURE__ */
|
|
15487
|
+
return /* @__PURE__ */ jsx50(
|
|
15171
15488
|
"input",
|
|
15172
15489
|
{
|
|
15173
15490
|
ref,
|
|
@@ -15187,17 +15504,17 @@ Input.displayName = "Input";
|
|
|
15187
15504
|
import "react";
|
|
15188
15505
|
import { Select as SelectPrimitive } from "radix-ui";
|
|
15189
15506
|
import { ChevronDownIcon as ChevronDownIcon2, CheckIcon as CheckIcon4, ChevronUpIcon } from "lucide-react";
|
|
15190
|
-
import { jsx as
|
|
15507
|
+
import { jsx as jsx51, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
15191
15508
|
function Select({
|
|
15192
15509
|
...props
|
|
15193
15510
|
}) {
|
|
15194
|
-
return /* @__PURE__ */
|
|
15511
|
+
return /* @__PURE__ */ jsx51(SelectPrimitive.Root, { "data-slot": "select", ...props });
|
|
15195
15512
|
}
|
|
15196
15513
|
function SelectGroup({
|
|
15197
15514
|
className,
|
|
15198
15515
|
...props
|
|
15199
15516
|
}) {
|
|
15200
|
-
return /* @__PURE__ */
|
|
15517
|
+
return /* @__PURE__ */ jsx51(
|
|
15201
15518
|
SelectPrimitive.Group,
|
|
15202
15519
|
{
|
|
15203
15520
|
"data-slot": "select-group",
|
|
@@ -15209,7 +15526,7 @@ function SelectGroup({
|
|
|
15209
15526
|
function SelectValue({
|
|
15210
15527
|
...props
|
|
15211
15528
|
}) {
|
|
15212
|
-
return /* @__PURE__ */
|
|
15529
|
+
return /* @__PURE__ */ jsx51(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
|
|
15213
15530
|
}
|
|
15214
15531
|
function SelectTrigger({
|
|
15215
15532
|
className,
|
|
@@ -15217,7 +15534,7 @@ function SelectTrigger({
|
|
|
15217
15534
|
children,
|
|
15218
15535
|
...props
|
|
15219
15536
|
}) {
|
|
15220
|
-
return /* @__PURE__ */
|
|
15537
|
+
return /* @__PURE__ */ jsxs36(
|
|
15221
15538
|
SelectPrimitive.Trigger,
|
|
15222
15539
|
{
|
|
15223
15540
|
"data-slot": "select-trigger",
|
|
@@ -15229,7 +15546,7 @@ function SelectTrigger({
|
|
|
15229
15546
|
...props,
|
|
15230
15547
|
children: [
|
|
15231
15548
|
children,
|
|
15232
|
-
/* @__PURE__ */
|
|
15549
|
+
/* @__PURE__ */ jsx51(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx51(ChevronDownIcon2, { className: "pointer-events-none size-4 text-muted-foreground" }) })
|
|
15233
15550
|
]
|
|
15234
15551
|
}
|
|
15235
15552
|
);
|
|
@@ -15241,7 +15558,7 @@ function SelectContent({
|
|
|
15241
15558
|
align = "center",
|
|
15242
15559
|
...props
|
|
15243
15560
|
}) {
|
|
15244
|
-
return /* @__PURE__ */
|
|
15561
|
+
return /* @__PURE__ */ jsx51(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs36(
|
|
15245
15562
|
SelectPrimitive.Content,
|
|
15246
15563
|
{
|
|
15247
15564
|
"data-slot": "select-content",
|
|
@@ -15251,8 +15568,8 @@ function SelectContent({
|
|
|
15251
15568
|
align,
|
|
15252
15569
|
...props,
|
|
15253
15570
|
children: [
|
|
15254
|
-
/* @__PURE__ */
|
|
15255
|
-
/* @__PURE__ */
|
|
15571
|
+
/* @__PURE__ */ jsx51(SelectScrollUpButton, {}),
|
|
15572
|
+
/* @__PURE__ */ jsx51(
|
|
15256
15573
|
SelectPrimitive.Viewport,
|
|
15257
15574
|
{
|
|
15258
15575
|
"data-position": position,
|
|
@@ -15263,7 +15580,7 @@ function SelectContent({
|
|
|
15263
15580
|
children
|
|
15264
15581
|
}
|
|
15265
15582
|
),
|
|
15266
|
-
/* @__PURE__ */
|
|
15583
|
+
/* @__PURE__ */ jsx51(SelectScrollDownButton, {})
|
|
15267
15584
|
]
|
|
15268
15585
|
}
|
|
15269
15586
|
) });
|
|
@@ -15273,7 +15590,7 @@ function SelectItem({
|
|
|
15273
15590
|
children,
|
|
15274
15591
|
...props
|
|
15275
15592
|
}) {
|
|
15276
|
-
return /* @__PURE__ */
|
|
15593
|
+
return /* @__PURE__ */ jsxs36(
|
|
15277
15594
|
SelectPrimitive.Item,
|
|
15278
15595
|
{
|
|
15279
15596
|
"data-slot": "select-item",
|
|
@@ -15283,8 +15600,8 @@ function SelectItem({
|
|
|
15283
15600
|
),
|
|
15284
15601
|
...props,
|
|
15285
15602
|
children: [
|
|
15286
|
-
/* @__PURE__ */
|
|
15287
|
-
/* @__PURE__ */
|
|
15603
|
+
/* @__PURE__ */ jsx51("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ jsx51(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx51(CheckIcon4, { className: "pointer-events-none" }) }) }),
|
|
15604
|
+
/* @__PURE__ */ jsx51(SelectPrimitive.ItemText, { children })
|
|
15288
15605
|
]
|
|
15289
15606
|
}
|
|
15290
15607
|
);
|
|
@@ -15293,7 +15610,7 @@ function SelectScrollUpButton({
|
|
|
15293
15610
|
className,
|
|
15294
15611
|
...props
|
|
15295
15612
|
}) {
|
|
15296
|
-
return /* @__PURE__ */
|
|
15613
|
+
return /* @__PURE__ */ jsx51(
|
|
15297
15614
|
SelectPrimitive.ScrollUpButton,
|
|
15298
15615
|
{
|
|
15299
15616
|
"data-slot": "select-scroll-up-button",
|
|
@@ -15302,7 +15619,7 @@ function SelectScrollUpButton({
|
|
|
15302
15619
|
className
|
|
15303
15620
|
),
|
|
15304
15621
|
...props,
|
|
15305
|
-
children: /* @__PURE__ */
|
|
15622
|
+
children: /* @__PURE__ */ jsx51(
|
|
15306
15623
|
ChevronUpIcon,
|
|
15307
15624
|
{}
|
|
15308
15625
|
)
|
|
@@ -15313,7 +15630,7 @@ function SelectScrollDownButton({
|
|
|
15313
15630
|
className,
|
|
15314
15631
|
...props
|
|
15315
15632
|
}) {
|
|
15316
|
-
return /* @__PURE__ */
|
|
15633
|
+
return /* @__PURE__ */ jsx51(
|
|
15317
15634
|
SelectPrimitive.ScrollDownButton,
|
|
15318
15635
|
{
|
|
15319
15636
|
"data-slot": "select-scroll-down-button",
|
|
@@ -15322,7 +15639,7 @@ function SelectScrollDownButton({
|
|
|
15322
15639
|
className
|
|
15323
15640
|
),
|
|
15324
15641
|
...props,
|
|
15325
|
-
children: /* @__PURE__ */
|
|
15642
|
+
children: /* @__PURE__ */ jsx51(
|
|
15326
15643
|
ChevronDownIcon2,
|
|
15327
15644
|
{}
|
|
15328
15645
|
)
|
|
@@ -15331,9 +15648,9 @@ function SelectScrollDownButton({
|
|
|
15331
15648
|
}
|
|
15332
15649
|
|
|
15333
15650
|
// src/components/ui/slider.tsx
|
|
15334
|
-
import * as
|
|
15651
|
+
import * as React47 from "react";
|
|
15335
15652
|
import { Slider as SliderPrimitive } from "radix-ui";
|
|
15336
|
-
import { jsx as
|
|
15653
|
+
import { jsx as jsx52, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
15337
15654
|
function Slider({
|
|
15338
15655
|
className,
|
|
15339
15656
|
defaultValue,
|
|
@@ -15342,11 +15659,11 @@ function Slider({
|
|
|
15342
15659
|
max = 100,
|
|
15343
15660
|
...props
|
|
15344
15661
|
}) {
|
|
15345
|
-
const _values =
|
|
15662
|
+
const _values = React47.useMemo(
|
|
15346
15663
|
() => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
|
|
15347
15664
|
[value, defaultValue, min, max]
|
|
15348
15665
|
);
|
|
15349
|
-
return /* @__PURE__ */
|
|
15666
|
+
return /* @__PURE__ */ jsxs37(
|
|
15350
15667
|
SliderPrimitive.Root,
|
|
15351
15668
|
{
|
|
15352
15669
|
"data-slot": "slider",
|
|
@@ -15360,12 +15677,12 @@ function Slider({
|
|
|
15360
15677
|
),
|
|
15361
15678
|
...props,
|
|
15362
15679
|
children: [
|
|
15363
|
-
/* @__PURE__ */
|
|
15680
|
+
/* @__PURE__ */ jsx52(
|
|
15364
15681
|
SliderPrimitive.Track,
|
|
15365
15682
|
{
|
|
15366
15683
|
"data-slot": "slider-track",
|
|
15367
15684
|
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",
|
|
15368
|
-
children: /* @__PURE__ */
|
|
15685
|
+
children: /* @__PURE__ */ jsx52(
|
|
15369
15686
|
SliderPrimitive.Range,
|
|
15370
15687
|
{
|
|
15371
15688
|
"data-slot": "slider-range",
|
|
@@ -15374,7 +15691,7 @@ function Slider({
|
|
|
15374
15691
|
)
|
|
15375
15692
|
}
|
|
15376
15693
|
),
|
|
15377
|
-
Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */
|
|
15694
|
+
Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */ jsx52(
|
|
15378
15695
|
SliderPrimitive.Thumb,
|
|
15379
15696
|
{
|
|
15380
15697
|
"data-slot": "slider-thumb",
|
|
@@ -15388,7 +15705,7 @@ function Slider({
|
|
|
15388
15705
|
}
|
|
15389
15706
|
|
|
15390
15707
|
// src/components/ui/toggle-group.tsx
|
|
15391
|
-
import * as
|
|
15708
|
+
import * as React49 from "react";
|
|
15392
15709
|
import "class-variance-authority";
|
|
15393
15710
|
import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui";
|
|
15394
15711
|
|
|
@@ -15396,7 +15713,7 @@ import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui";
|
|
|
15396
15713
|
import "react";
|
|
15397
15714
|
import { cva as cva2 } from "class-variance-authority";
|
|
15398
15715
|
import { Toggle as TogglePrimitive } from "radix-ui";
|
|
15399
|
-
import { jsx as
|
|
15716
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
15400
15717
|
var toggleVariants = cva2(
|
|
15401
15718
|
"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",
|
|
15402
15719
|
{
|
|
@@ -15419,8 +15736,8 @@ var toggleVariants = cva2(
|
|
|
15419
15736
|
);
|
|
15420
15737
|
|
|
15421
15738
|
// src/components/ui/toggle-group.tsx
|
|
15422
|
-
import { jsx as
|
|
15423
|
-
var ToggleGroupContext =
|
|
15739
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
15740
|
+
var ToggleGroupContext = React49.createContext({
|
|
15424
15741
|
size: "default",
|
|
15425
15742
|
variant: "default",
|
|
15426
15743
|
spacing: 0,
|
|
@@ -15435,7 +15752,7 @@ function ToggleGroup({
|
|
|
15435
15752
|
children,
|
|
15436
15753
|
...props
|
|
15437
15754
|
}) {
|
|
15438
|
-
return /* @__PURE__ */
|
|
15755
|
+
return /* @__PURE__ */ jsx54(
|
|
15439
15756
|
ToggleGroupPrimitive.Root,
|
|
15440
15757
|
{
|
|
15441
15758
|
"data-slot": "toggle-group",
|
|
@@ -15449,7 +15766,7 @@ function ToggleGroup({
|
|
|
15449
15766
|
className
|
|
15450
15767
|
),
|
|
15451
15768
|
...props,
|
|
15452
|
-
children: /* @__PURE__ */
|
|
15769
|
+
children: /* @__PURE__ */ jsx54(
|
|
15453
15770
|
ToggleGroupContext.Provider,
|
|
15454
15771
|
{
|
|
15455
15772
|
value: { variant, size: size2, spacing, orientation },
|
|
@@ -15466,8 +15783,8 @@ function ToggleGroupItem({
|
|
|
15466
15783
|
size: size2 = "default",
|
|
15467
15784
|
...props
|
|
15468
15785
|
}) {
|
|
15469
|
-
const context =
|
|
15470
|
-
return /* @__PURE__ */
|
|
15786
|
+
const context = React49.useContext(ToggleGroupContext);
|
|
15787
|
+
return /* @__PURE__ */ jsx54(
|
|
15471
15788
|
ToggleGroupPrimitive.Item,
|
|
15472
15789
|
{
|
|
15473
15790
|
"data-slot": "toggle-group-item",
|
|
@@ -15707,7 +16024,7 @@ import {
|
|
|
15707
16024
|
} from "@xpert-ai/chatkit-types";
|
|
15708
16025
|
|
|
15709
16026
|
// src/components/pet/PetPreview.tsx
|
|
15710
|
-
import { jsx as
|
|
16027
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
15711
16028
|
function escapeCssUrl2(value) {
|
|
15712
16029
|
return value.replace(/["\\]/g, "\\$&");
|
|
15713
16030
|
}
|
|
@@ -15715,7 +16032,7 @@ function PetPreview({ src, label, className }) {
|
|
|
15715
16032
|
const scale = 0.13;
|
|
15716
16033
|
const width = petSpriteAtlas.cellWidth;
|
|
15717
16034
|
const height = petSpriteAtlas.cellHeight;
|
|
15718
|
-
return /* @__PURE__ */
|
|
16035
|
+
return /* @__PURE__ */ jsx55(
|
|
15719
16036
|
"span",
|
|
15720
16037
|
{
|
|
15721
16038
|
className: cn(
|
|
@@ -15724,7 +16041,7 @@ function PetPreview({ src, label, className }) {
|
|
|
15724
16041
|
),
|
|
15725
16042
|
"aria-hidden": "true",
|
|
15726
16043
|
title: label,
|
|
15727
|
-
children: /* @__PURE__ */
|
|
16044
|
+
children: /* @__PURE__ */ jsx55(
|
|
15728
16045
|
"span",
|
|
15729
16046
|
{
|
|
15730
16047
|
className: "absolute left-1/2 top-1/2 block",
|
|
@@ -15746,7 +16063,7 @@ function PetPreview({ src, label, className }) {
|
|
|
15746
16063
|
}
|
|
15747
16064
|
|
|
15748
16065
|
// src/components/settings/SettingsSheet.tsx
|
|
15749
|
-
import { jsx as
|
|
16066
|
+
import { jsx as jsx56, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
15750
16067
|
var CHARACTER_TYPES2 = [
|
|
15751
16068
|
"builtin",
|
|
15752
16069
|
"atlas"
|
|
@@ -15762,13 +16079,13 @@ function SettingsSheet({
|
|
|
15762
16079
|
onSave
|
|
15763
16080
|
}) {
|
|
15764
16081
|
const { t } = useChatkitTranslation();
|
|
15765
|
-
const [draft, setDraft] =
|
|
15766
|
-
|
|
16082
|
+
const [draft, setDraft] = React51.useState(settings);
|
|
16083
|
+
React51.useEffect(() => {
|
|
15767
16084
|
if (open) {
|
|
15768
16085
|
setDraft(petRequired ? { ...settings, enabled: true } : settings);
|
|
15769
16086
|
}
|
|
15770
16087
|
}, [open, petRequired, settings]);
|
|
15771
|
-
const updateDraft =
|
|
16088
|
+
const updateDraft = React51.useCallback(
|
|
15772
16089
|
(patch) => {
|
|
15773
16090
|
setDraft((previous) => ({ ...previous, ...patch }));
|
|
15774
16091
|
},
|
|
@@ -15786,23 +16103,23 @@ function SettingsSheet({
|
|
|
15786
16103
|
defaultValue: selectedBuiltinPet.label
|
|
15787
16104
|
}
|
|
15788
16105
|
);
|
|
15789
|
-
return /* @__PURE__ */
|
|
15790
|
-
/* @__PURE__ */
|
|
15791
|
-
/* @__PURE__ */
|
|
15792
|
-
/* @__PURE__ */
|
|
16106
|
+
return /* @__PURE__ */ jsx56(Sheet, { open, onOpenChange, children: /* @__PURE__ */ jsxs38(SheetContent, { side: "right", className: "w-[min(92vw,26rem)] overflow-y-auto", children: [
|
|
16107
|
+
/* @__PURE__ */ jsx56(SheetHeader, { children: /* @__PURE__ */ jsxs38("div", { className: "flex items-center gap-2", children: [
|
|
16108
|
+
/* @__PURE__ */ jsx56("span", { className: "flex h-8 w-8 items-center justify-center rounded-md bg-primary/10 text-primary", children: /* @__PURE__ */ jsx56(Settings, { size: 16 }) }),
|
|
16109
|
+
/* @__PURE__ */ jsx56(SheetTitle, { children: t("settings.title") })
|
|
15793
16110
|
] }) }),
|
|
15794
|
-
/* @__PURE__ */
|
|
15795
|
-
/* @__PURE__ */
|
|
15796
|
-
/* @__PURE__ */
|
|
15797
|
-
/* @__PURE__ */
|
|
15798
|
-
/* @__PURE__ */
|
|
16111
|
+
/* @__PURE__ */ jsxs38("form", { className: "mt-6 space-y-5", onSubmit: handleSubmit, children: [
|
|
16112
|
+
/* @__PURE__ */ jsxs38("section", { className: "space-y-5", children: [
|
|
16113
|
+
/* @__PURE__ */ jsxs38("div", { className: "flex items-center gap-2", children: [
|
|
16114
|
+
/* @__PURE__ */ jsx56("span", { className: "flex h-7 w-7 items-center justify-center rounded-md bg-muted text-muted-foreground", children: /* @__PURE__ */ jsx56(PawPrint, { size: 15 }) }),
|
|
16115
|
+
/* @__PURE__ */ jsx56("h3", { className: "text-sm font-semibold", children: t("pet.settings.title") })
|
|
15799
16116
|
] }),
|
|
15800
|
-
/* @__PURE__ */
|
|
15801
|
-
/* @__PURE__ */
|
|
15802
|
-
/* @__PURE__ */
|
|
15803
|
-
petRequired && /* @__PURE__ */
|
|
16117
|
+
/* @__PURE__ */ jsxs38("label", { className: "flex items-center justify-between gap-4 rounded-md border border-border px-3 py-2", children: [
|
|
16118
|
+
/* @__PURE__ */ jsxs38("span", { className: "min-w-0", children: [
|
|
16119
|
+
/* @__PURE__ */ jsx56("span", { className: "block text-sm font-medium", children: t("pet.settings.enabled") }),
|
|
16120
|
+
petRequired && /* @__PURE__ */ jsx56("span", { className: "mt-0.5 block text-xs text-muted-foreground", children: t("pet.settings.requiredHint") })
|
|
15804
16121
|
] }),
|
|
15805
|
-
/* @__PURE__ */
|
|
16122
|
+
/* @__PURE__ */ jsx56(
|
|
15806
16123
|
"button",
|
|
15807
16124
|
{
|
|
15808
16125
|
type: "button",
|
|
@@ -15815,7 +16132,7 @@ function SettingsSheet({
|
|
|
15815
16132
|
draft.enabled ? "bg-primary" : "bg-muted-foreground/20",
|
|
15816
16133
|
petRequired ? "cursor-not-allowed opacity-70" : ""
|
|
15817
16134
|
].join(" "),
|
|
15818
|
-
children: /* @__PURE__ */
|
|
16135
|
+
children: /* @__PURE__ */ jsx56(
|
|
15819
16136
|
"span",
|
|
15820
16137
|
{
|
|
15821
16138
|
className: [
|
|
@@ -15828,9 +16145,9 @@ function SettingsSheet({
|
|
|
15828
16145
|
)
|
|
15829
16146
|
] })
|
|
15830
16147
|
] }),
|
|
15831
|
-
/* @__PURE__ */
|
|
15832
|
-
/* @__PURE__ */
|
|
15833
|
-
/* @__PURE__ */
|
|
16148
|
+
/* @__PURE__ */ jsxs38("div", { className: "space-y-2", children: [
|
|
16149
|
+
/* @__PURE__ */ jsx56("span", { id: "chatkit-pet-type-label", className: "text-sm font-medium", children: t("pet.settings.characterType") }),
|
|
16150
|
+
/* @__PURE__ */ jsx56(
|
|
15834
16151
|
ToggleGroup,
|
|
15835
16152
|
{
|
|
15836
16153
|
id: "chatkit-pet-type",
|
|
@@ -15845,7 +16162,7 @@ function SettingsSheet({
|
|
|
15845
16162
|
variant: "outline",
|
|
15846
16163
|
spacing: 2,
|
|
15847
16164
|
className: "!w-full",
|
|
15848
|
-
children: CHARACTER_TYPES2.map((type) => /* @__PURE__ */
|
|
16165
|
+
children: CHARACTER_TYPES2.map((type) => /* @__PURE__ */ jsx56(
|
|
15849
16166
|
ToggleGroupItem,
|
|
15850
16167
|
{
|
|
15851
16168
|
value: type,
|
|
@@ -15857,8 +16174,8 @@ function SettingsSheet({
|
|
|
15857
16174
|
}
|
|
15858
16175
|
)
|
|
15859
16176
|
] }),
|
|
15860
|
-
draft.characterType === "builtin" && /* @__PURE__ */
|
|
15861
|
-
/* @__PURE__ */
|
|
16177
|
+
draft.characterType === "builtin" && /* @__PURE__ */ jsxs38("div", { className: "space-y-2", children: [
|
|
16178
|
+
/* @__PURE__ */ jsx56(
|
|
15862
16179
|
"label",
|
|
15863
16180
|
{
|
|
15864
16181
|
htmlFor: "chatkit-pet-builtin",
|
|
@@ -15866,7 +16183,7 @@ function SettingsSheet({
|
|
|
15866
16183
|
children: t("pet.settings.builtin")
|
|
15867
16184
|
}
|
|
15868
16185
|
),
|
|
15869
|
-
/* @__PURE__ */
|
|
16186
|
+
/* @__PURE__ */ jsxs38(
|
|
15870
16187
|
Select,
|
|
15871
16188
|
{
|
|
15872
16189
|
value: selectedBuiltinPet.id,
|
|
@@ -15877,26 +16194,26 @@ function SettingsSheet({
|
|
|
15877
16194
|
}
|
|
15878
16195
|
},
|
|
15879
16196
|
children: [
|
|
15880
|
-
/* @__PURE__ */
|
|
16197
|
+
/* @__PURE__ */ jsx56(
|
|
15881
16198
|
SelectTrigger,
|
|
15882
16199
|
{
|
|
15883
16200
|
id: "chatkit-pet-builtin",
|
|
15884
16201
|
className: "min-h-12 w-full px-3 py-2",
|
|
15885
|
-
children: /* @__PURE__ */
|
|
16202
|
+
children: /* @__PURE__ */ jsx56(SelectValue, { placeholder: selectedBuiltinPetLabel })
|
|
15886
16203
|
}
|
|
15887
16204
|
),
|
|
15888
|
-
/* @__PURE__ */
|
|
16205
|
+
/* @__PURE__ */ jsx56(SelectContent, { className: "w-[var(--radix-select-trigger-width)]", children: /* @__PURE__ */ jsx56(SelectGroup, { children: INCLUDED_PET_OPTIONS.map((pet) => {
|
|
15889
16206
|
const label = t(`pet.settings.builtins.${pet.id}`, {
|
|
15890
16207
|
defaultValue: pet.label
|
|
15891
16208
|
});
|
|
15892
|
-
return /* @__PURE__ */
|
|
16209
|
+
return /* @__PURE__ */ jsx56(
|
|
15893
16210
|
SelectItem,
|
|
15894
16211
|
{
|
|
15895
16212
|
value: pet.id,
|
|
15896
16213
|
className: "min-h-10 py-1.5 pl-2 pr-8",
|
|
15897
|
-
children: /* @__PURE__ */
|
|
15898
|
-
/* @__PURE__ */
|
|
15899
|
-
/* @__PURE__ */
|
|
16214
|
+
children: /* @__PURE__ */ jsxs38("span", { className: "flex min-w-0 items-center gap-2", children: [
|
|
16215
|
+
/* @__PURE__ */ jsx56(PetPreview, { src: pet.previewSrc, label }),
|
|
16216
|
+
/* @__PURE__ */ jsx56("span", { className: "min-w-0 truncate", children: label })
|
|
15900
16217
|
] })
|
|
15901
16218
|
},
|
|
15902
16219
|
pet.id
|
|
@@ -15906,8 +16223,8 @@ function SettingsSheet({
|
|
|
15906
16223
|
}
|
|
15907
16224
|
)
|
|
15908
16225
|
] }),
|
|
15909
|
-
draft.characterType === "atlas" && /* @__PURE__ */
|
|
15910
|
-
/* @__PURE__ */
|
|
16226
|
+
draft.characterType === "atlas" && /* @__PURE__ */ jsxs38("div", { className: "space-y-2", children: [
|
|
16227
|
+
/* @__PURE__ */ jsx56(
|
|
15911
16228
|
"label",
|
|
15912
16229
|
{
|
|
15913
16230
|
className: "text-sm font-medium",
|
|
@@ -15915,7 +16232,7 @@ function SettingsSheet({
|
|
|
15915
16232
|
children: t("pet.settings.atlasUrl")
|
|
15916
16233
|
}
|
|
15917
16234
|
),
|
|
15918
|
-
/* @__PURE__ */
|
|
16235
|
+
/* @__PURE__ */ jsx56(
|
|
15919
16236
|
Input,
|
|
15920
16237
|
{
|
|
15921
16238
|
id: "chatkit-pet-atlas",
|
|
@@ -15925,15 +16242,15 @@ function SettingsSheet({
|
|
|
15925
16242
|
}
|
|
15926
16243
|
)
|
|
15927
16244
|
] }),
|
|
15928
|
-
/* @__PURE__ */
|
|
15929
|
-
/* @__PURE__ */
|
|
15930
|
-
/* @__PURE__ */
|
|
15931
|
-
/* @__PURE__ */
|
|
16245
|
+
/* @__PURE__ */ jsxs38("div", { className: "space-y-2", children: [
|
|
16246
|
+
/* @__PURE__ */ jsxs38("div", { className: "flex items-center justify-between gap-4", children: [
|
|
16247
|
+
/* @__PURE__ */ jsx56("label", { className: "text-sm font-medium", htmlFor: "chatkit-pet-scale", children: t("pet.settings.scale") }),
|
|
16248
|
+
/* @__PURE__ */ jsxs38("span", { className: "text-xs tabular-nums text-muted-foreground", children: [
|
|
15932
16249
|
draft.scale.toFixed(2),
|
|
15933
16250
|
"x"
|
|
15934
16251
|
] })
|
|
15935
16252
|
] }),
|
|
15936
|
-
/* @__PURE__ */
|
|
16253
|
+
/* @__PURE__ */ jsx56(
|
|
15937
16254
|
Slider,
|
|
15938
16255
|
{
|
|
15939
16256
|
id: "chatkit-pet-scale",
|
|
@@ -15947,8 +16264,8 @@ function SettingsSheet({
|
|
|
15947
16264
|
}
|
|
15948
16265
|
)
|
|
15949
16266
|
] }),
|
|
15950
|
-
/* @__PURE__ */
|
|
15951
|
-
/* @__PURE__ */
|
|
16267
|
+
/* @__PURE__ */ jsxs38("label", { className: "flex items-center gap-2 text-sm", children: [
|
|
16268
|
+
/* @__PURE__ */ jsx56(
|
|
15952
16269
|
"input",
|
|
15953
16270
|
{
|
|
15954
16271
|
type: "checkbox",
|
|
@@ -15959,8 +16276,8 @@ function SettingsSheet({
|
|
|
15959
16276
|
),
|
|
15960
16277
|
t("pet.settings.draggable")
|
|
15961
16278
|
] }),
|
|
15962
|
-
/* @__PURE__ */
|
|
15963
|
-
/* @__PURE__ */
|
|
16279
|
+
/* @__PURE__ */ jsxs38("label", { className: "flex items-center gap-2 text-sm", children: [
|
|
16280
|
+
/* @__PURE__ */ jsx56(
|
|
15964
16281
|
"input",
|
|
15965
16282
|
{
|
|
15966
16283
|
type: "checkbox",
|
|
@@ -15971,8 +16288,8 @@ function SettingsSheet({
|
|
|
15971
16288
|
),
|
|
15972
16289
|
t("pet.settings.persistPosition")
|
|
15973
16290
|
] }),
|
|
15974
|
-
/* @__PURE__ */
|
|
15975
|
-
/* @__PURE__ */
|
|
16291
|
+
/* @__PURE__ */ jsxs38("div", { className: "flex justify-end gap-2 pt-2", children: [
|
|
16292
|
+
/* @__PURE__ */ jsx56(
|
|
15976
16293
|
Button,
|
|
15977
16294
|
{
|
|
15978
16295
|
type: "button",
|
|
@@ -15981,7 +16298,7 @@ function SettingsSheet({
|
|
|
15981
16298
|
children: t("pet.settings.cancel")
|
|
15982
16299
|
}
|
|
15983
16300
|
),
|
|
15984
|
-
/* @__PURE__ */
|
|
16301
|
+
/* @__PURE__ */ jsx56(Button, { type: "submit", children: t("pet.settings.save") })
|
|
15985
16302
|
] })
|
|
15986
16303
|
] })
|
|
15987
16304
|
] }) });
|
|
@@ -16608,21 +16925,21 @@ function findDomPointForComposerOffset(root, offset) {
|
|
|
16608
16925
|
}
|
|
16609
16926
|
|
|
16610
16927
|
// src/workbench/WorkbenchShell.tsx
|
|
16611
|
-
import * as
|
|
16928
|
+
import * as React52 from "react";
|
|
16612
16929
|
import {
|
|
16613
16930
|
ASSISTANT_CHAT_SEND_MESSAGE_COMMAND,
|
|
16614
16931
|
ASSISTANT_CONTEXT_SET_COMMAND
|
|
16615
16932
|
} from "@xpert-ai/xpert-sdk";
|
|
16616
16933
|
import {
|
|
16617
|
-
Loader2 as
|
|
16934
|
+
Loader2 as Loader210,
|
|
16618
16935
|
Maximize2,
|
|
16619
16936
|
Minimize2,
|
|
16620
16937
|
PanelRight,
|
|
16621
16938
|
RotateCcw,
|
|
16622
|
-
X as
|
|
16939
|
+
X as X8
|
|
16623
16940
|
} from "lucide-react";
|
|
16624
|
-
import { Fragment as
|
|
16625
|
-
var WorkbenchContext =
|
|
16941
|
+
import { Fragment as Fragment9, jsx as jsx57, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
16942
|
+
var WorkbenchContext = React52.createContext({
|
|
16626
16943
|
enabled: false,
|
|
16627
16944
|
open: false,
|
|
16628
16945
|
loading: false,
|
|
@@ -16630,7 +16947,7 @@ var WorkbenchContext = React51.createContext({
|
|
|
16630
16947
|
toggle: () => void 0
|
|
16631
16948
|
});
|
|
16632
16949
|
function useWorkbench() {
|
|
16633
|
-
return
|
|
16950
|
+
return React52.useContext(WorkbenchContext);
|
|
16634
16951
|
}
|
|
16635
16952
|
function WorkbenchToggleButton() {
|
|
16636
16953
|
const workbench = useWorkbench();
|
|
@@ -16638,8 +16955,8 @@ function WorkbenchToggleButton() {
|
|
|
16638
16955
|
if (!workbench.enabled || workbench.open) return null;
|
|
16639
16956
|
const label = t("workbench.open");
|
|
16640
16957
|
const tooltip = workbench.disabledReason ?? label;
|
|
16641
|
-
return /* @__PURE__ */
|
|
16642
|
-
/* @__PURE__ */
|
|
16958
|
+
return /* @__PURE__ */ jsxs39(Tooltip, { children: [
|
|
16959
|
+
/* @__PURE__ */ jsx57(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx57("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ jsx57(
|
|
16643
16960
|
"button",
|
|
16644
16961
|
{
|
|
16645
16962
|
type: "button",
|
|
@@ -16652,17 +16969,17 @@ function WorkbenchToggleButton() {
|
|
|
16652
16969
|
),
|
|
16653
16970
|
"aria-label": label,
|
|
16654
16971
|
"aria-expanded": false,
|
|
16655
|
-
children: workbench.loading ? /* @__PURE__ */
|
|
16972
|
+
children: workbench.loading ? /* @__PURE__ */ jsx57(Loader210, { size: 16, className: "animate-spin" }) : /* @__PURE__ */ jsx57(PanelRight, { size: 16 })
|
|
16656
16973
|
}
|
|
16657
16974
|
) }) }),
|
|
16658
|
-
/* @__PURE__ */
|
|
16975
|
+
/* @__PURE__ */ jsx57(TooltipContent, { side: "bottom", children: tooltip })
|
|
16659
16976
|
] });
|
|
16660
16977
|
}
|
|
16661
16978
|
|
|
16662
16979
|
// src/components/chat/runtime-capabilities.tsx
|
|
16663
|
-
import * as
|
|
16664
|
-
import { X as
|
|
16665
|
-
import { jsx as
|
|
16980
|
+
import * as React53 from "react";
|
|
16981
|
+
import { X as X9 } from "lucide-react";
|
|
16982
|
+
import { jsx as jsx58, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
16666
16983
|
function createComposerCapabilityInsertionParts(options) {
|
|
16667
16984
|
return options.flatMap((option) => [
|
|
16668
16985
|
createComposerCapabilityPart(option, createMessageId()),
|
|
@@ -16735,29 +17052,29 @@ function useRuntimeCapabilitiesState({
|
|
|
16735
17052
|
disabled,
|
|
16736
17053
|
composerParts
|
|
16737
17054
|
}) {
|
|
16738
|
-
const [runtimeCapabilities, setRuntimeCapabilities] =
|
|
16739
|
-
const [runtimeCapabilitiesReady, setRuntimeCapabilitiesReady] =
|
|
16740
|
-
const [sessionRuntimeCapabilities, setSessionRuntimeCapabilities] =
|
|
17055
|
+
const [runtimeCapabilities, setRuntimeCapabilities] = React53.useState(null);
|
|
17056
|
+
const [runtimeCapabilitiesReady, setRuntimeCapabilitiesReady] = React53.useState(false);
|
|
17057
|
+
const [sessionRuntimeCapabilities, setSessionRuntimeCapabilities] = React53.useState(
|
|
16741
17058
|
() => createEmptyRuntimeCapabilitiesSelection()
|
|
16742
17059
|
);
|
|
16743
|
-
const [runRuntimeCapabilities, setRunRuntimeCapabilities] =
|
|
17060
|
+
const [runRuntimeCapabilities, setRunRuntimeCapabilities] = React53.useState(
|
|
16744
17061
|
() => createEmptyRuntimeCapabilitiesSelection()
|
|
16745
17062
|
);
|
|
16746
|
-
const [runtimeCapabilityPalette, setRuntimeCapabilityPalette] =
|
|
16747
|
-
const runtimeCapabilityPreferenceLoadRef =
|
|
16748
|
-
const pendingExternalRuntimeCapabilitiesRef =
|
|
16749
|
-
const runtimeCapabilityOptions =
|
|
17063
|
+
const [runtimeCapabilityPalette, setRuntimeCapabilityPalette] = React53.useState(null);
|
|
17064
|
+
const runtimeCapabilityPreferenceLoadRef = React53.useRef(0);
|
|
17065
|
+
const pendingExternalRuntimeCapabilitiesRef = React53.useRef(null);
|
|
17066
|
+
const runtimeCapabilityOptions = React53.useMemo(
|
|
16750
17067
|
() => getRuntimeCapabilityOptions(runtimeCapabilities),
|
|
16751
17068
|
[runtimeCapabilities]
|
|
16752
17069
|
);
|
|
16753
|
-
const effectiveSessionRuntimeCapabilities =
|
|
17070
|
+
const effectiveSessionRuntimeCapabilities = React53.useMemo(
|
|
16754
17071
|
() => runtimeCapabilitiesReady && runtimeCapabilities ? mergeRuntimeCapabilitiesSelections(
|
|
16755
17072
|
runtimeCapabilities,
|
|
16756
17073
|
sessionRuntimeCapabilities
|
|
16757
17074
|
) : null,
|
|
16758
17075
|
[runtimeCapabilities, runtimeCapabilitiesReady, sessionRuntimeCapabilities]
|
|
16759
17076
|
);
|
|
16760
|
-
const runRuntimeCapabilityOptions =
|
|
17077
|
+
const runRuntimeCapabilityOptions = React53.useMemo(
|
|
16761
17078
|
() => runtimeCapabilityOptions.filter(
|
|
16762
17079
|
(option) => isRuntimeCapabilitySelected(
|
|
16763
17080
|
runRuntimeCapabilities,
|
|
@@ -16767,11 +17084,11 @@ function useRuntimeCapabilitiesState({
|
|
|
16767
17084
|
),
|
|
16768
17085
|
[runRuntimeCapabilities, runtimeCapabilityOptions]
|
|
16769
17086
|
);
|
|
16770
|
-
const composerRuntimeCapabilitySelectionKeys =
|
|
17087
|
+
const composerRuntimeCapabilitySelectionKeys = React53.useMemo(
|
|
16771
17088
|
() => getComposerCapabilitySelectionKeys(composerParts),
|
|
16772
17089
|
[composerParts]
|
|
16773
17090
|
);
|
|
16774
|
-
const detachedRunRuntimeCapabilityOptions =
|
|
17091
|
+
const detachedRunRuntimeCapabilityOptions = React53.useMemo(
|
|
16775
17092
|
() => runRuntimeCapabilityOptions.filter(
|
|
16776
17093
|
(option) => !composerRuntimeCapabilitySelectionKeys.has(
|
|
16777
17094
|
getRuntimeCapabilityOptionKey(option)
|
|
@@ -16779,7 +17096,7 @@ function useRuntimeCapabilitiesState({
|
|
|
16779
17096
|
),
|
|
16780
17097
|
[composerRuntimeCapabilitySelectionKeys, runRuntimeCapabilityOptions]
|
|
16781
17098
|
);
|
|
16782
|
-
const persistSessionRuntimeCapabilities =
|
|
17099
|
+
const persistSessionRuntimeCapabilities = React53.useCallback(
|
|
16783
17100
|
async (nextThreadId, selection) => {
|
|
16784
17101
|
if (!runtimeCapabilities || !selection || !client) {
|
|
16785
17102
|
return;
|
|
@@ -16804,7 +17121,7 @@ function useRuntimeCapabilitiesState({
|
|
|
16804
17121
|
},
|
|
16805
17122
|
[client, runtimeCapabilities]
|
|
16806
17123
|
);
|
|
16807
|
-
const applyExternalRuntimeCapabilities =
|
|
17124
|
+
const applyExternalRuntimeCapabilities = React53.useCallback(
|
|
16808
17125
|
(selection) => {
|
|
16809
17126
|
pendingExternalRuntimeCapabilitiesRef.current = selection;
|
|
16810
17127
|
setRunRuntimeCapabilities(() => {
|
|
@@ -16825,7 +17142,7 @@ function useRuntimeCapabilitiesState({
|
|
|
16825
17142
|
},
|
|
16826
17143
|
[runtimeCapabilities]
|
|
16827
17144
|
);
|
|
16828
|
-
const handleSessionRuntimeCapabilityToggle =
|
|
17145
|
+
const handleSessionRuntimeCapabilityToggle = React53.useCallback(
|
|
16829
17146
|
(type, id, selected) => {
|
|
16830
17147
|
setSessionRuntimeCapabilities((previous) => {
|
|
16831
17148
|
const nextSelection = toggleRuntimeCapabilitySelection(
|
|
@@ -16846,7 +17163,7 @@ function useRuntimeCapabilitiesState({
|
|
|
16846
17163
|
},
|
|
16847
17164
|
[persistSessionRuntimeCapabilities, threadId]
|
|
16848
17165
|
);
|
|
16849
|
-
const addRunRuntimeCapabilities =
|
|
17166
|
+
const addRunRuntimeCapabilities = React53.useCallback(
|
|
16850
17167
|
(selection) => {
|
|
16851
17168
|
setRunRuntimeCapabilities(
|
|
16852
17169
|
(previous) => runtimeCapabilities ? mergeRuntimeCapabilitiesSelections(
|
|
@@ -16858,13 +17175,13 @@ function useRuntimeCapabilitiesState({
|
|
|
16858
17175
|
},
|
|
16859
17176
|
[runtimeCapabilities]
|
|
16860
17177
|
);
|
|
16861
|
-
const resetRunRuntimeCapabilities =
|
|
17178
|
+
const resetRunRuntimeCapabilities = React53.useCallback(() => {
|
|
16862
17179
|
setRunRuntimeCapabilities(
|
|
16863
17180
|
createEmptyRuntimeCapabilitiesSelection(runtimeCapabilities)
|
|
16864
17181
|
);
|
|
16865
17182
|
setRuntimeCapabilityPalette(null);
|
|
16866
17183
|
}, [runtimeCapabilities]);
|
|
16867
|
-
const getRuntimeCapabilitiesForSubmit =
|
|
17184
|
+
const getRuntimeCapabilitiesForSubmit = React53.useCallback(
|
|
16868
17185
|
(recommended) => {
|
|
16869
17186
|
const recommendedRuntimeCapabilitiesForSubmit = recommended && runtimeCapabilities && runtimeCapabilitiesReady ? mergeRuntimeCapabilitiesSelections(
|
|
16870
17187
|
runtimeCapabilities,
|
|
@@ -16895,7 +17212,7 @@ function useRuntimeCapabilitiesState({
|
|
|
16895
17212
|
runtimeCapabilityOptions
|
|
16896
17213
|
]
|
|
16897
17214
|
);
|
|
16898
|
-
const getRuntimeCapabilitiesForCommand =
|
|
17215
|
+
const getRuntimeCapabilitiesForCommand = React53.useCallback(
|
|
16899
17216
|
(recommended) => runtimeCapabilities && runtimeCapabilitiesReady ? createRuntimeCapabilitiesForSubmit({
|
|
16900
17217
|
capabilities: runtimeCapabilities,
|
|
16901
17218
|
available: effectiveSessionRuntimeCapabilities,
|
|
@@ -16907,7 +17224,7 @@ function useRuntimeCapabilitiesState({
|
|
|
16907
17224
|
runtimeCapabilitiesReady
|
|
16908
17225
|
]
|
|
16909
17226
|
);
|
|
16910
|
-
|
|
17227
|
+
React53.useEffect(() => {
|
|
16911
17228
|
if (disabled || !client || !assistantId) {
|
|
16912
17229
|
pendingExternalRuntimeCapabilitiesRef.current = null;
|
|
16913
17230
|
setRuntimeCapabilities(null);
|
|
@@ -16955,7 +17272,7 @@ function useRuntimeCapabilitiesState({
|
|
|
16955
17272
|
});
|
|
16956
17273
|
return () => controller.abort();
|
|
16957
17274
|
}, [assistantId, client, disabled]);
|
|
16958
|
-
|
|
17275
|
+
React53.useEffect(() => {
|
|
16959
17276
|
const emptyRunSelection = createEmptyRuntimeCapabilitiesSelection(runtimeCapabilities);
|
|
16960
17277
|
const pendingExternalSelection = pendingExternalRuntimeCapabilitiesRef.current;
|
|
16961
17278
|
if (pendingExternalSelection && runtimeCapabilities) {
|
|
@@ -17047,8 +17364,8 @@ function useRuntimeCapabilityComposerActions({
|
|
|
17047
17364
|
commitComposerParts,
|
|
17048
17365
|
focusComposerAt
|
|
17049
17366
|
}) {
|
|
17050
|
-
const pendingExternalRuntimeCapabilityInsertRef =
|
|
17051
|
-
const insertExternalRuntimeCapabilities =
|
|
17367
|
+
const pendingExternalRuntimeCapabilityInsertRef = React53.useRef(null);
|
|
17368
|
+
const insertExternalRuntimeCapabilities = React53.useCallback(
|
|
17052
17369
|
(selection, options) => {
|
|
17053
17370
|
applyExternalRuntimeCapabilities(selection);
|
|
17054
17371
|
if (!selection) {
|
|
@@ -17103,7 +17420,7 @@ function useRuntimeCapabilityComposerActions({
|
|
|
17103
17420
|
setRuntimeCapabilityPalette
|
|
17104
17421
|
]
|
|
17105
17422
|
);
|
|
17106
|
-
const applyComposerValueRuntimeCapabilities =
|
|
17423
|
+
const applyComposerValueRuntimeCapabilities = React53.useCallback(
|
|
17107
17424
|
(payload, options) => {
|
|
17108
17425
|
const runtimeCapabilitiesPayload = isRuntimeCapabilitiesSelection(
|
|
17109
17426
|
payload.runtimeCapabilities
|
|
@@ -17119,7 +17436,7 @@ function useRuntimeCapabilityComposerActions({
|
|
|
17119
17436
|
},
|
|
17120
17437
|
[applyExternalRuntimeCapabilities, insertExternalRuntimeCapabilities]
|
|
17121
17438
|
);
|
|
17122
|
-
const updateRuntimeCapabilityPalette =
|
|
17439
|
+
const updateRuntimeCapabilityPalette = React53.useCallback(
|
|
17123
17440
|
(parts, selectionStart) => {
|
|
17124
17441
|
const input = composerInputRef.current;
|
|
17125
17442
|
const editingText = getComposerEditingText(parts);
|
|
@@ -17131,7 +17448,7 @@ function useRuntimeCapabilityComposerActions({
|
|
|
17131
17448
|
},
|
|
17132
17449
|
[composerInputRef, setRuntimeCapabilityPalette]
|
|
17133
17450
|
);
|
|
17134
|
-
const removeRunRuntimeCapability =
|
|
17451
|
+
const removeRunRuntimeCapability = React53.useCallback(
|
|
17135
17452
|
(option) => {
|
|
17136
17453
|
setRunRuntimeCapabilities(
|
|
17137
17454
|
(previous) => toggleRuntimeCapabilitySelection(
|
|
@@ -17151,7 +17468,7 @@ function useRuntimeCapabilityComposerActions({
|
|
|
17151
17468
|
},
|
|
17152
17469
|
[commitComposerParts, composerPartsRef, setRunRuntimeCapabilities]
|
|
17153
17470
|
);
|
|
17154
|
-
const insertComposerCapabilityToken =
|
|
17471
|
+
const insertComposerCapabilityToken = React53.useCallback(
|
|
17155
17472
|
(capability, range) => {
|
|
17156
17473
|
const replacementParts = createComposerCapabilityInsertionParts([
|
|
17157
17474
|
capability
|
|
@@ -17192,7 +17509,7 @@ function useRuntimeCapabilityComposerActions({
|
|
|
17192
17509
|
setRuntimeCapabilityPalette
|
|
17193
17510
|
]
|
|
17194
17511
|
);
|
|
17195
|
-
|
|
17512
|
+
React53.useEffect(() => {
|
|
17196
17513
|
if (!runtimeCapabilitiesReady || !runtimeCapabilities) {
|
|
17197
17514
|
return;
|
|
17198
17515
|
}
|
|
@@ -17222,16 +17539,16 @@ function HumanRuntimeCapabilityChips({
|
|
|
17222
17539
|
if (options.length === 0) {
|
|
17223
17540
|
return null;
|
|
17224
17541
|
}
|
|
17225
|
-
return /* @__PURE__ */
|
|
17542
|
+
return /* @__PURE__ */ jsx58("div", { className: "mb-2 flex flex-wrap gap-1.5", children: options.map((option) => {
|
|
17226
17543
|
const color = option.type === "skill" ? void 0 : getRuntimeCapabilityColor(option);
|
|
17227
|
-
return /* @__PURE__ */
|
|
17544
|
+
return /* @__PURE__ */ jsxs40(
|
|
17228
17545
|
"span",
|
|
17229
17546
|
{
|
|
17230
17547
|
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",
|
|
17231
17548
|
style: color ? { color } : void 0,
|
|
17232
17549
|
children: [
|
|
17233
|
-
/* @__PURE__ */
|
|
17234
|
-
/* @__PURE__ */
|
|
17550
|
+
/* @__PURE__ */ jsx58(RuntimeCapabilityIcon, { option, variant: "chip" }),
|
|
17551
|
+
/* @__PURE__ */ jsx58("span", { className: "max-w-[9rem] truncate", children: option.label })
|
|
17235
17552
|
]
|
|
17236
17553
|
},
|
|
17237
17554
|
`${option.type}:${option.id}`
|
|
@@ -17247,19 +17564,19 @@ function DetachedRunRuntimeCapabilities({
|
|
|
17247
17564
|
if (options.length === 0) {
|
|
17248
17565
|
return null;
|
|
17249
17566
|
}
|
|
17250
|
-
return /* @__PURE__ */
|
|
17251
|
-
/* @__PURE__ */
|
|
17567
|
+
return /* @__PURE__ */ jsxs40("div", { className: "mb-2 flex flex-wrap items-center gap-2", children: [
|
|
17568
|
+
/* @__PURE__ */ jsx58("span", { className: "text-xs text-muted-foreground", children: runOnlyLabel }),
|
|
17252
17569
|
options.map((option) => {
|
|
17253
17570
|
const color = getRuntimeCapabilityColor(option);
|
|
17254
|
-
return /* @__PURE__ */
|
|
17571
|
+
return /* @__PURE__ */ jsxs40(
|
|
17255
17572
|
"span",
|
|
17256
17573
|
{
|
|
17257
17574
|
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",
|
|
17258
17575
|
style: color ? { color } : void 0,
|
|
17259
17576
|
children: [
|
|
17260
|
-
/* @__PURE__ */
|
|
17261
|
-
/* @__PURE__ */
|
|
17262
|
-
/* @__PURE__ */
|
|
17577
|
+
/* @__PURE__ */ jsx58(RuntimeCapabilityIcon, { option, variant: "chip" }),
|
|
17578
|
+
/* @__PURE__ */ jsx58("span", { className: "max-w-40 truncate", children: option.label }),
|
|
17579
|
+
/* @__PURE__ */ jsx58(
|
|
17263
17580
|
"button",
|
|
17264
17581
|
{
|
|
17265
17582
|
type: "button",
|
|
@@ -17267,7 +17584,7 @@ function DetachedRunRuntimeCapabilities({
|
|
|
17267
17584
|
className: "rounded-full p-0.5 hover:bg-primary/15",
|
|
17268
17585
|
title: removeLabel,
|
|
17269
17586
|
"aria-label": removeLabel,
|
|
17270
|
-
children: /* @__PURE__ */
|
|
17587
|
+
children: /* @__PURE__ */ jsx58(X9, { size: 11 })
|
|
17271
17588
|
}
|
|
17272
17589
|
)
|
|
17273
17590
|
]
|
|
@@ -17281,7 +17598,7 @@ function ComposerCapabilityToken({
|
|
|
17281
17598
|
part
|
|
17282
17599
|
}) {
|
|
17283
17600
|
const color = getRuntimeCapabilityColor(part.capability);
|
|
17284
|
-
return /* @__PURE__ */
|
|
17601
|
+
return /* @__PURE__ */ jsxs40(
|
|
17285
17602
|
"span",
|
|
17286
17603
|
{
|
|
17287
17604
|
"data-composer-capability-key": part.key,
|
|
@@ -17291,8 +17608,8 @@ function ComposerCapabilityToken({
|
|
|
17291
17608
|
className: "mx-0.5 inline-flex max-w-[14rem] select-none items-center gap-1 text-sm font-semibold text-primary align-baseline",
|
|
17292
17609
|
style: color ? { color } : void 0,
|
|
17293
17610
|
children: [
|
|
17294
|
-
/* @__PURE__ */
|
|
17295
|
-
/* @__PURE__ */
|
|
17611
|
+
/* @__PURE__ */ jsx58(RuntimeCapabilityIcon, { option: part.capability, variant: "chip" }),
|
|
17612
|
+
/* @__PURE__ */ jsx58("span", { className: "truncate", children: part.capability.label })
|
|
17296
17613
|
]
|
|
17297
17614
|
},
|
|
17298
17615
|
part.key
|
|
@@ -17552,30 +17869,30 @@ function buildMessageNavigationItems(messages, options) {
|
|
|
17552
17869
|
}
|
|
17553
17870
|
|
|
17554
17871
|
// src/hooks/useTaskSummary.ts
|
|
17555
|
-
import * as
|
|
17872
|
+
import * as React54 from "react";
|
|
17556
17873
|
function useTaskSummary({
|
|
17557
17874
|
enabled,
|
|
17558
17875
|
conversationId,
|
|
17559
17876
|
client,
|
|
17560
17877
|
live
|
|
17561
17878
|
}) {
|
|
17562
|
-
const [loaded, setLoaded] =
|
|
17563
|
-
const [historySections, setHistorySections] =
|
|
17564
|
-
const [historySectionsConversationId, setHistorySectionsConversationId] =
|
|
17565
|
-
const [loadingSections, setLoadingSections] =
|
|
17566
|
-
const [error, setError] =
|
|
17567
|
-
const [retryVersion, setRetryVersion] =
|
|
17568
|
-
const requestVersionRef =
|
|
17569
|
-
const conversationIdRef =
|
|
17570
|
-
const sectionControllersRef =
|
|
17879
|
+
const [loaded, setLoaded] = React54.useState(null);
|
|
17880
|
+
const [historySections, setHistorySections] = React54.useState({});
|
|
17881
|
+
const [historySectionsConversationId, setHistorySectionsConversationId] = React54.useState(null);
|
|
17882
|
+
const [loadingSections, setLoadingSections] = React54.useState({});
|
|
17883
|
+
const [error, setError] = React54.useState(null);
|
|
17884
|
+
const [retryVersion, setRetryVersion] = React54.useState(0);
|
|
17885
|
+
const requestVersionRef = React54.useRef(0);
|
|
17886
|
+
const conversationIdRef = React54.useRef(conversationId);
|
|
17887
|
+
const sectionControllersRef = React54.useRef(
|
|
17571
17888
|
/* @__PURE__ */ new Map()
|
|
17572
17889
|
);
|
|
17573
17890
|
conversationIdRef.current = conversationId;
|
|
17574
|
-
const abortSectionRequests =
|
|
17891
|
+
const abortSectionRequests = React54.useCallback(() => {
|
|
17575
17892
|
sectionControllersRef.current.forEach((controller) => controller.abort());
|
|
17576
17893
|
sectionControllersRef.current.clear();
|
|
17577
17894
|
}, []);
|
|
17578
|
-
|
|
17895
|
+
React54.useEffect(() => {
|
|
17579
17896
|
abortSectionRequests();
|
|
17580
17897
|
setHistorySections({});
|
|
17581
17898
|
setHistorySectionsConversationId(conversationId);
|
|
@@ -17604,11 +17921,11 @@ function useTaskSummary({
|
|
|
17604
17921
|
};
|
|
17605
17922
|
}, [abortSectionRequests, client, conversationId, enabled, retryVersion]);
|
|
17606
17923
|
const snapshot = loaded?.conversationId === conversationId ? loaded.snapshot : null;
|
|
17607
|
-
const activeHistorySections =
|
|
17924
|
+
const activeHistorySections = React54.useMemo(
|
|
17608
17925
|
() => historySectionsConversationId === conversationId ? historySections : {},
|
|
17609
17926
|
[conversationId, historySections, historySectionsConversationId]
|
|
17610
17927
|
);
|
|
17611
|
-
const loadSection =
|
|
17928
|
+
const loadSection = React54.useCallback(
|
|
17612
17929
|
async (section) => {
|
|
17613
17930
|
if (!enabled || !conversationId || loadingSections[section]) {
|
|
17614
17931
|
return;
|
|
@@ -17668,7 +17985,7 @@ function useTaskSummary({
|
|
|
17668
17985
|
}
|
|
17669
17986
|
|
|
17670
17987
|
// src/components/task-summary/TaskSummary.tsx
|
|
17671
|
-
import * as
|
|
17988
|
+
import * as React55 from "react";
|
|
17672
17989
|
import {
|
|
17673
17990
|
Bot as Bot4,
|
|
17674
17991
|
BookOpen as BookOpen3,
|
|
@@ -17677,12 +17994,12 @@ import {
|
|
|
17677
17994
|
ExternalLink,
|
|
17678
17995
|
FileOutput,
|
|
17679
17996
|
ListChecks as ListChecks3,
|
|
17680
|
-
Loader2 as
|
|
17997
|
+
Loader2 as Loader211,
|
|
17681
17998
|
PlayCircle,
|
|
17682
17999
|
RotateCcw as RotateCcw2,
|
|
17683
18000
|
Target as Target2
|
|
17684
18001
|
} from "lucide-react";
|
|
17685
|
-
import { jsx as
|
|
18002
|
+
import { jsx as jsx59, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
17686
18003
|
var PREVIEW_SIZE = 3;
|
|
17687
18004
|
function TaskSummaryTrigger({
|
|
17688
18005
|
displayMode = "popover",
|
|
@@ -17691,9 +18008,9 @@ function TaskSummaryTrigger({
|
|
|
17691
18008
|
...props
|
|
17692
18009
|
}) {
|
|
17693
18010
|
const { t } = useChatkitTranslation();
|
|
17694
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
18011
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React55.useState(false);
|
|
17695
18012
|
const open = controlledOpen ?? uncontrolledOpen;
|
|
17696
|
-
const setOpen =
|
|
18013
|
+
const setOpen = React55.useCallback(
|
|
17697
18014
|
(nextOpen) => {
|
|
17698
18015
|
if (controlledOpen === void 0) {
|
|
17699
18016
|
setUncontrolledOpen(nextOpen);
|
|
@@ -17702,7 +18019,7 @@ function TaskSummaryTrigger({
|
|
|
17702
18019
|
},
|
|
17703
18020
|
[controlledOpen, onOpenChange]
|
|
17704
18021
|
);
|
|
17705
|
-
const triggerButton = /* @__PURE__ */
|
|
18022
|
+
const triggerButton = /* @__PURE__ */ jsx59(
|
|
17706
18023
|
"button",
|
|
17707
18024
|
{
|
|
17708
18025
|
type: "button",
|
|
@@ -17710,28 +18027,28 @@ function TaskSummaryTrigger({
|
|
|
17710
18027
|
"aria-label": t("taskSummary.open"),
|
|
17711
18028
|
"aria-expanded": open,
|
|
17712
18029
|
onClick: displayMode === "docked" ? () => setOpen(!open) : void 0,
|
|
17713
|
-
children: /* @__PURE__ */
|
|
18030
|
+
children: /* @__PURE__ */ jsx59(ListChecks3, { size: 16 })
|
|
17714
18031
|
}
|
|
17715
18032
|
);
|
|
17716
18033
|
if (displayMode === "docked") {
|
|
17717
|
-
return /* @__PURE__ */
|
|
17718
|
-
/* @__PURE__ */
|
|
17719
|
-
/* @__PURE__ */
|
|
18034
|
+
return /* @__PURE__ */ jsxs41(Tooltip, { children: [
|
|
18035
|
+
/* @__PURE__ */ jsx59(TooltipTrigger, { asChild: true, children: triggerButton }),
|
|
18036
|
+
/* @__PURE__ */ jsx59(TooltipContent, { side: "bottom", children: t("taskSummary.open") })
|
|
17720
18037
|
] });
|
|
17721
18038
|
}
|
|
17722
|
-
return /* @__PURE__ */
|
|
17723
|
-
/* @__PURE__ */
|
|
17724
|
-
/* @__PURE__ */
|
|
17725
|
-
/* @__PURE__ */
|
|
18039
|
+
return /* @__PURE__ */ jsxs41(Popover, { open, onOpenChange: setOpen, children: [
|
|
18040
|
+
/* @__PURE__ */ jsxs41(Tooltip, { children: [
|
|
18041
|
+
/* @__PURE__ */ jsx59(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx59(PopoverTrigger, { asChild: true, children: triggerButton }) }),
|
|
18042
|
+
/* @__PURE__ */ jsx59(TooltipContent, { side: "bottom", children: t("taskSummary.open") })
|
|
17726
18043
|
] }),
|
|
17727
|
-
/* @__PURE__ */
|
|
18044
|
+
/* @__PURE__ */ jsx59(
|
|
17728
18045
|
PopoverContent,
|
|
17729
18046
|
{
|
|
17730
18047
|
align: "end",
|
|
17731
18048
|
sideOffset: 8,
|
|
17732
18049
|
className: "w-[min(20rem,calc(100vw-2rem))] max-h-[min(44rem,calc(100vh-5rem))] overflow-y-auto rounded-2xl border-border/70 bg-popover p-0 shadow-lg",
|
|
17733
18050
|
"aria-label": t("taskSummary.title"),
|
|
17734
|
-
children: /* @__PURE__ */
|
|
18051
|
+
children: /* @__PURE__ */ jsx59(TaskSummaryContent, { ...props })
|
|
17735
18052
|
}
|
|
17736
18053
|
)
|
|
17737
18054
|
] });
|
|
@@ -17741,7 +18058,7 @@ function TaskSummaryPanel({
|
|
|
17741
18058
|
...props
|
|
17742
18059
|
}) {
|
|
17743
18060
|
const { t } = useChatkitTranslation();
|
|
17744
|
-
return /* @__PURE__ */
|
|
18061
|
+
return /* @__PURE__ */ jsx59(
|
|
17745
18062
|
"aside",
|
|
17746
18063
|
{
|
|
17747
18064
|
"data-slot": "task-summary-panel",
|
|
@@ -17750,7 +18067,7 @@ function TaskSummaryPanel({
|
|
|
17750
18067
|
"h-fit max-h-full overflow-y-auto rounded-2xl border border-border/70 bg-popover text-popover-foreground shadow-lg",
|
|
17751
18068
|
className
|
|
17752
18069
|
),
|
|
17753
|
-
children: /* @__PURE__ */
|
|
18070
|
+
children: /* @__PURE__ */ jsx59(TaskSummaryContent, { ...props })
|
|
17754
18071
|
}
|
|
17755
18072
|
);
|
|
17756
18073
|
}
|
|
@@ -17766,7 +18083,7 @@ function TaskSummaryContent({
|
|
|
17766
18083
|
onOpenResource
|
|
17767
18084
|
}) {
|
|
17768
18085
|
const { t } = useChatkitTranslation();
|
|
17769
|
-
const [expanded, setExpanded] =
|
|
18086
|
+
const [expanded, setExpanded] = React55.useState({});
|
|
17770
18087
|
const hasTask = Boolean(
|
|
17771
18088
|
summary.goal || summary.plan || summary.todos?.items.length
|
|
17772
18089
|
);
|
|
@@ -17798,7 +18115,7 @@ function TaskSummaryContent({
|
|
|
17798
18115
|
if (total2 <= PREVIEW_SIZE && !expanded[section]) return null;
|
|
17799
18116
|
const loading = loadingSections[section];
|
|
17800
18117
|
const canLoadMore = Boolean(expanded[section]) && loadedSectionCounts[section] < total2;
|
|
17801
|
-
return /* @__PURE__ */
|
|
18118
|
+
return /* @__PURE__ */ jsxs41(
|
|
17802
18119
|
"button",
|
|
17803
18120
|
{
|
|
17804
18121
|
type: "button",
|
|
@@ -17806,41 +18123,41 @@ function TaskSummaryContent({
|
|
|
17806
18123
|
disabled: loading,
|
|
17807
18124
|
onClick: () => canLoadMore ? void onLoadSection(section) : toggleSection(section),
|
|
17808
18125
|
children: [
|
|
17809
|
-
loading && /* @__PURE__ */
|
|
17810
|
-
!loading && /* @__PURE__ */
|
|
18126
|
+
loading && /* @__PURE__ */ jsx59(Loader211, { className: "size-3 animate-spin" }),
|
|
18127
|
+
!loading && /* @__PURE__ */ jsx59(ListChecks3, { className: "size-3.5" }),
|
|
17811
18128
|
canLoadMore ? t("taskSummary.loadMore") : expanded[section] ? t("taskSummary.collapse") : t("taskSummary.viewAll", { count: total2 })
|
|
17812
18129
|
]
|
|
17813
18130
|
}
|
|
17814
18131
|
);
|
|
17815
18132
|
};
|
|
17816
|
-
return /* @__PURE__ */
|
|
17817
|
-
Boolean(historyError) && /* @__PURE__ */
|
|
17818
|
-
/* @__PURE__ */
|
|
17819
|
-
/* @__PURE__ */
|
|
18133
|
+
return /* @__PURE__ */ jsxs41("div", { className: "divide-y divide-border/70", children: [
|
|
18134
|
+
Boolean(historyError) && /* @__PURE__ */ jsxs41("div", { className: "m-3 flex items-start justify-between gap-3 rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-2 text-xs text-destructive", children: [
|
|
18135
|
+
/* @__PURE__ */ jsx59("span", { children: t("taskSummary.historyError") }),
|
|
18136
|
+
/* @__PURE__ */ jsxs41(
|
|
17820
18137
|
"button",
|
|
17821
18138
|
{
|
|
17822
18139
|
type: "button",
|
|
17823
18140
|
className: "inline-flex shrink-0 items-center gap-1 font-medium hover:underline",
|
|
17824
18141
|
onClick: onRetryHistory,
|
|
17825
18142
|
children: [
|
|
17826
|
-
/* @__PURE__ */
|
|
18143
|
+
/* @__PURE__ */ jsx59(RotateCcw2, { className: "size-3" }),
|
|
17827
18144
|
t("taskSummary.retry")
|
|
17828
18145
|
]
|
|
17829
18146
|
}
|
|
17830
18147
|
)
|
|
17831
18148
|
] }),
|
|
17832
|
-
/* @__PURE__ */
|
|
18149
|
+
/* @__PURE__ */ jsxs41(
|
|
17833
18150
|
SummarySection,
|
|
17834
18151
|
{
|
|
17835
18152
|
title: t("taskSummary.sections.outputs"),
|
|
17836
18153
|
children: [
|
|
17837
|
-
summary.outputs.length === 0 ? /* @__PURE__ */
|
|
18154
|
+
summary.outputs.length === 0 ? /* @__PURE__ */ jsx59(SummaryPrompt, { onClick: onFocusComposer, children: t("taskSummary.createOutput") }) : sectionItems("outputs", summary.outputs).map((item) => /* @__PURE__ */ jsx59(
|
|
17838
18155
|
SummaryButton,
|
|
17839
18156
|
{
|
|
17840
18157
|
title: item.title,
|
|
17841
18158
|
description: item.description ?? item.status,
|
|
17842
|
-
leading: /* @__PURE__ */
|
|
17843
|
-
trailing: item.resource && item.resource.type !== "message" ? /* @__PURE__ */
|
|
18159
|
+
leading: /* @__PURE__ */ jsx59(FileOutput, { className: "size-4" }),
|
|
18160
|
+
trailing: item.resource && item.resource.type !== "message" ? /* @__PURE__ */ jsx59(ExternalLink, { className: "size-3.5" }) : void 0,
|
|
17844
18161
|
onClick: () => openSummaryItem(item.resource, item.messageId, item.title)
|
|
17845
18162
|
},
|
|
17846
18163
|
item.id
|
|
@@ -17849,18 +18166,18 @@ function TaskSummaryContent({
|
|
|
17849
18166
|
]
|
|
17850
18167
|
}
|
|
17851
18168
|
),
|
|
17852
|
-
/* @__PURE__ */
|
|
18169
|
+
/* @__PURE__ */ jsxs41(
|
|
17853
18170
|
SummarySection,
|
|
17854
18171
|
{
|
|
17855
18172
|
title: t("taskSummary.sections.sources"),
|
|
17856
18173
|
children: [
|
|
17857
|
-
sectionItems("sources", summary.sources).map((item) => /* @__PURE__ */
|
|
18174
|
+
sectionItems("sources", summary.sources).map((item) => /* @__PURE__ */ jsx59(
|
|
17858
18175
|
SummaryButton,
|
|
17859
18176
|
{
|
|
17860
18177
|
title: item.title,
|
|
17861
18178
|
description: item.description,
|
|
17862
|
-
leading: /* @__PURE__ */
|
|
17863
|
-
trailing: item.resource && item.resource.type !== "message" ? /* @__PURE__ */
|
|
18179
|
+
leading: /* @__PURE__ */ jsx59(BookOpen3, { className: "size-4" }),
|
|
18180
|
+
trailing: item.resource && item.resource.type !== "message" ? /* @__PURE__ */ jsx59(ExternalLink, { className: "size-3.5" }) : void 0,
|
|
17864
18181
|
onClick: () => openSummaryItem(item.resource, item.messageId, item.title)
|
|
17865
18182
|
},
|
|
17866
18183
|
item.id
|
|
@@ -17869,67 +18186,67 @@ function TaskSummaryContent({
|
|
|
17869
18186
|
]
|
|
17870
18187
|
}
|
|
17871
18188
|
),
|
|
17872
|
-
hasTask && /* @__PURE__ */
|
|
17873
|
-
summary.goal && /* @__PURE__ */
|
|
18189
|
+
hasTask && /* @__PURE__ */ jsxs41(SummarySection, { title: t("taskSummary.sections.task"), children: [
|
|
18190
|
+
summary.goal && /* @__PURE__ */ jsx59(
|
|
17874
18191
|
SummaryButton,
|
|
17875
18192
|
{
|
|
17876
18193
|
title: summary.goal.objective,
|
|
17877
18194
|
description: summary.goal.status,
|
|
17878
|
-
leading: /* @__PURE__ */
|
|
18195
|
+
leading: /* @__PURE__ */ jsx59(Target2, { className: "size-4" }),
|
|
17879
18196
|
onClick: onFocusComposer
|
|
17880
18197
|
}
|
|
17881
18198
|
),
|
|
17882
|
-
summary.plan && /* @__PURE__ */
|
|
18199
|
+
summary.plan && /* @__PURE__ */ jsx59(
|
|
17883
18200
|
SummaryButton,
|
|
17884
18201
|
{
|
|
17885
18202
|
title: summary.plan.title,
|
|
17886
18203
|
description: summary.plan.excerpt,
|
|
17887
|
-
leading: /* @__PURE__ */
|
|
18204
|
+
leading: /* @__PURE__ */ jsx59(ListChecks3, { className: "size-4" }),
|
|
17888
18205
|
onClick: () => summary.plan?.messageId ? onNavigateMessage(summary.plan.messageId) : onFocusComposer()
|
|
17889
18206
|
}
|
|
17890
18207
|
),
|
|
17891
|
-
(summary.todos?.items ?? []).slice(0, PREVIEW_SIZE).map((todo) => /* @__PURE__ */
|
|
18208
|
+
(summary.todos?.items ?? []).slice(0, PREVIEW_SIZE).map((todo) => /* @__PURE__ */ jsx59(
|
|
17892
18209
|
SummaryButton,
|
|
17893
18210
|
{
|
|
17894
18211
|
title: todo.content,
|
|
17895
18212
|
description: t(`taskSummary.status.${todo.status}`),
|
|
17896
|
-
leading: todo.status === "completed" ? /* @__PURE__ */
|
|
18213
|
+
leading: todo.status === "completed" ? /* @__PURE__ */ jsx59(CheckCircle25, { className: "size-4 text-muted-foreground" }) : /* @__PURE__ */ jsx59(CircleEllipsis, { className: "size-4 text-muted-foreground" }),
|
|
17897
18214
|
onClick: () => summary.todos?.messageId ? onNavigateMessage(summary.todos.messageId) : onFocusComposer()
|
|
17898
18215
|
},
|
|
17899
18216
|
todo.id
|
|
17900
18217
|
))
|
|
17901
18218
|
] }),
|
|
17902
|
-
summary.running.length > 0 && /* @__PURE__ */
|
|
18219
|
+
summary.running.length > 0 && /* @__PURE__ */ jsx59(SummarySection, { title: t("taskSummary.sections.running"), children: summary.running.slice(0, PREVIEW_SIZE).map((item) => /* @__PURE__ */ jsx59(
|
|
17903
18220
|
SummaryButton,
|
|
17904
18221
|
{
|
|
17905
18222
|
title: item.title,
|
|
17906
18223
|
description: item.description ?? item.status,
|
|
17907
|
-
leading: /* @__PURE__ */
|
|
17908
|
-
trailing: item.resource ? /* @__PURE__ */
|
|
18224
|
+
leading: /* @__PURE__ */ jsx59(PlayCircle, { className: "size-4" }),
|
|
18225
|
+
trailing: item.resource ? /* @__PURE__ */ jsx59(ExternalLink, { className: "size-3.5" }) : void 0,
|
|
17909
18226
|
onClick: () => item.resource && onOpenResource(item.resource, void 0, item.title)
|
|
17910
18227
|
},
|
|
17911
18228
|
item.id
|
|
17912
18229
|
)) }),
|
|
17913
|
-
summary.agents.length > 0 && /* @__PURE__ */
|
|
17914
|
-
sectionItems("agents", summary.agents).map((item) => /* @__PURE__ */
|
|
18230
|
+
summary.agents.length > 0 && /* @__PURE__ */ jsxs41(SummarySection, { title: t("taskSummary.sections.agents"), children: [
|
|
18231
|
+
sectionItems("agents", summary.agents).map((item) => /* @__PURE__ */ jsx59(
|
|
17915
18232
|
SummaryButton,
|
|
17916
18233
|
{
|
|
17917
18234
|
title: item.title,
|
|
17918
18235
|
description: [item.status, formatElapsed(item.elapsedTime)].filter(Boolean).join(" \xB7 "),
|
|
17919
|
-
leading: /* @__PURE__ */
|
|
18236
|
+
leading: /* @__PURE__ */ jsx59(Bot4, { className: "size-4" }),
|
|
17920
18237
|
onClick: () => item.messageId ? onNavigateMessage(item.messageId) : onFocusComposer()
|
|
17921
18238
|
},
|
|
17922
18239
|
item.id
|
|
17923
18240
|
)),
|
|
17924
18241
|
sectionAction("agents", summary.totals.agents)
|
|
17925
18242
|
] }),
|
|
17926
|
-
summary.pending.length > 0 && /* @__PURE__ */
|
|
17927
|
-
sectionItems("pending", summary.pending).map((item) => /* @__PURE__ */
|
|
18243
|
+
summary.pending.length > 0 && /* @__PURE__ */ jsxs41(SummarySection, { title: t("taskSummary.sections.pending"), children: [
|
|
18244
|
+
sectionItems("pending", summary.pending).map((item) => /* @__PURE__ */ jsx59(
|
|
17928
18245
|
SummaryButton,
|
|
17929
18246
|
{
|
|
17930
18247
|
title: item.title,
|
|
17931
18248
|
description: item.description,
|
|
17932
|
-
leading: /* @__PURE__ */
|
|
18249
|
+
leading: /* @__PURE__ */ jsx59(CircleEllipsis, { className: "size-4" }),
|
|
17933
18250
|
onClick: () => item.messageId ? onNavigateMessage(item.messageId) : onFocusComposer()
|
|
17934
18251
|
},
|
|
17935
18252
|
item.id
|
|
@@ -17942,16 +18259,16 @@ function SummarySection({
|
|
|
17942
18259
|
title,
|
|
17943
18260
|
children
|
|
17944
18261
|
}) {
|
|
17945
|
-
return /* @__PURE__ */
|
|
17946
|
-
/* @__PURE__ */
|
|
17947
|
-
/* @__PURE__ */
|
|
18262
|
+
return /* @__PURE__ */ jsxs41("section", { "aria-label": title, className: "px-4 py-3", children: [
|
|
18263
|
+
/* @__PURE__ */ jsx59("div", { className: "flex min-h-7 items-center justify-between gap-3", children: /* @__PURE__ */ jsx59("h3", { className: "text-sm font-medium text-muted-foreground", children: title }) }),
|
|
18264
|
+
/* @__PURE__ */ jsx59("div", { className: "mt-1 space-y-0.5", children })
|
|
17948
18265
|
] });
|
|
17949
18266
|
}
|
|
17950
18267
|
function SummaryPrompt({
|
|
17951
18268
|
children,
|
|
17952
18269
|
onClick
|
|
17953
18270
|
}) {
|
|
17954
|
-
return /* @__PURE__ */
|
|
18271
|
+
return /* @__PURE__ */ jsx59(
|
|
17955
18272
|
"button",
|
|
17956
18273
|
{
|
|
17957
18274
|
type: "button",
|
|
@@ -17968,7 +18285,7 @@ function SummaryButton({
|
|
|
17968
18285
|
trailing,
|
|
17969
18286
|
onClick
|
|
17970
18287
|
}) {
|
|
17971
|
-
return /* @__PURE__ */
|
|
18288
|
+
return /* @__PURE__ */ jsxs41(
|
|
17972
18289
|
"button",
|
|
17973
18290
|
{
|
|
17974
18291
|
type: "button",
|
|
@@ -17980,12 +18297,12 @@ function SummaryButton({
|
|
|
17980
18297
|
!onClick && "cursor-default"
|
|
17981
18298
|
),
|
|
17982
18299
|
children: [
|
|
17983
|
-
leading && /* @__PURE__ */
|
|
17984
|
-
/* @__PURE__ */
|
|
17985
|
-
/* @__PURE__ */
|
|
17986
|
-
description && /* @__PURE__ */
|
|
18300
|
+
leading && /* @__PURE__ */ jsx59("span", { className: "mt-0.5 shrink-0 text-muted-foreground", children: leading }),
|
|
18301
|
+
/* @__PURE__ */ jsxs41("span", { className: "min-w-0 flex-1", children: [
|
|
18302
|
+
/* @__PURE__ */ jsx59("span", { className: "block truncate text-sm font-medium leading-5 text-foreground", children: title }),
|
|
18303
|
+
description && /* @__PURE__ */ jsx59("span", { className: "mt-0.5 block line-clamp-2 text-xs text-muted-foreground", children: description })
|
|
17987
18304
|
] }),
|
|
17988
|
-
trailing && /* @__PURE__ */
|
|
18305
|
+
trailing && /* @__PURE__ */ jsx59("span", { className: "mt-0.5 text-muted-foreground", children: trailing })
|
|
17989
18306
|
]
|
|
17990
18307
|
}
|
|
17991
18308
|
);
|
|
@@ -17997,7 +18314,7 @@ function formatElapsed(value) {
|
|
|
17997
18314
|
}
|
|
17998
18315
|
|
|
17999
18316
|
// src/components/chat.tsx
|
|
18000
|
-
import { Fragment as
|
|
18317
|
+
import { Fragment as Fragment11, jsx as jsx60, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
18001
18318
|
var defaultApiUrl2 = import.meta.env.VITE_XPERTAI_API_URL;
|
|
18002
18319
|
var COMPOSER_INPUT_MAX_HEIGHT = 128;
|
|
18003
18320
|
var LONG_TEXT_REFERENCE_THRESHOLD = 5e3;
|
|
@@ -18103,8 +18420,8 @@ function ReferenceChip({
|
|
|
18103
18420
|
}) {
|
|
18104
18421
|
const metaLine = getReferenceMetaLine(reference);
|
|
18105
18422
|
const isComposer = variant === "composer";
|
|
18106
|
-
const Icon = reference.type === "quote" ? Quote : reference.type === "image" ?
|
|
18107
|
-
return /* @__PURE__ */
|
|
18423
|
+
const Icon = reference.type === "quote" ? Quote : reference.type === "image" ? ImageIcon2 : FileText5;
|
|
18424
|
+
return /* @__PURE__ */ jsxs42(
|
|
18108
18425
|
"div",
|
|
18109
18426
|
{
|
|
18110
18427
|
className: cn(
|
|
@@ -18113,7 +18430,7 @@ function ReferenceChip({
|
|
|
18113
18430
|
),
|
|
18114
18431
|
title: getReferenceTitle(reference),
|
|
18115
18432
|
children: [
|
|
18116
|
-
/* @__PURE__ */
|
|
18433
|
+
/* @__PURE__ */ jsx60(
|
|
18117
18434
|
Icon,
|
|
18118
18435
|
{
|
|
18119
18436
|
size: isComposer ? 14 : 12,
|
|
@@ -18123,8 +18440,8 @@ function ReferenceChip({
|
|
|
18123
18440
|
)
|
|
18124
18441
|
}
|
|
18125
18442
|
),
|
|
18126
|
-
/* @__PURE__ */
|
|
18127
|
-
/* @__PURE__ */
|
|
18443
|
+
/* @__PURE__ */ jsxs42("div", { className: "min-w-0 flex-1", children: [
|
|
18444
|
+
/* @__PURE__ */ jsx60(
|
|
18128
18445
|
"div",
|
|
18129
18446
|
{
|
|
18130
18447
|
className: cn(
|
|
@@ -18134,7 +18451,7 @@ function ReferenceChip({
|
|
|
18134
18451
|
children: getReferenceLabel(reference)
|
|
18135
18452
|
}
|
|
18136
18453
|
),
|
|
18137
|
-
metaLine && /* @__PURE__ */
|
|
18454
|
+
metaLine && /* @__PURE__ */ jsx60(
|
|
18138
18455
|
"div",
|
|
18139
18456
|
{
|
|
18140
18457
|
className: cn(
|
|
@@ -18145,7 +18462,7 @@ function ReferenceChip({
|
|
|
18145
18462
|
}
|
|
18146
18463
|
)
|
|
18147
18464
|
] }),
|
|
18148
|
-
onRemove && removeLabel && /* @__PURE__ */
|
|
18465
|
+
onRemove && removeLabel && /* @__PURE__ */ jsx60(
|
|
18149
18466
|
"button",
|
|
18150
18467
|
{
|
|
18151
18468
|
type: "button",
|
|
@@ -18156,7 +18473,7 @@ function ReferenceChip({
|
|
|
18156
18473
|
),
|
|
18157
18474
|
title: removeLabel,
|
|
18158
18475
|
"aria-label": removeLabel,
|
|
18159
|
-
children: /* @__PURE__ */
|
|
18476
|
+
children: /* @__PURE__ */ jsx60(X10, { size: 12 })
|
|
18160
18477
|
}
|
|
18161
18478
|
)
|
|
18162
18479
|
]
|
|
@@ -18187,7 +18504,7 @@ function Chat({
|
|
|
18187
18504
|
clientSecret: effectiveClientSecret
|
|
18188
18505
|
});
|
|
18189
18506
|
const missingConfig = Boolean(missingConfigKind);
|
|
18190
|
-
const missingConfigShortMessage =
|
|
18507
|
+
const missingConfigShortMessage = React56.useMemo(() => {
|
|
18191
18508
|
switch (missingConfigKind) {
|
|
18192
18509
|
case "apiUrl":
|
|
18193
18510
|
return t("chat.missingApiUrlShort");
|
|
@@ -18199,7 +18516,7 @@ function Chat({
|
|
|
18199
18516
|
return t("chat.missingConfigShort");
|
|
18200
18517
|
}
|
|
18201
18518
|
}, [missingConfigKind, t]);
|
|
18202
|
-
const missingConfigDetailMessage =
|
|
18519
|
+
const missingConfigDetailMessage = React56.useMemo(() => {
|
|
18203
18520
|
switch (missingConfigKind) {
|
|
18204
18521
|
case "apiUrl":
|
|
18205
18522
|
return t("chat.missingApiUrlDetail");
|
|
@@ -18211,26 +18528,26 @@ function Chat({
|
|
|
18211
18528
|
return t("chat.missingConfigDetail");
|
|
18212
18529
|
}
|
|
18213
18530
|
}, [missingConfigKind, t]);
|
|
18214
|
-
const [isHistoryLoading, setIsHistoryLoading] =
|
|
18215
|
-
const [historyError, setHistoryError] =
|
|
18216
|
-
const [assistantName, setAssistantName] =
|
|
18217
|
-
const [assistantAvatar, setAssistantAvatar] =
|
|
18218
|
-
const [threadGoal, setThreadGoal] =
|
|
18219
|
-
const [goalError, setGoalError] =
|
|
18220
|
-
const [isGoalLoading, setIsGoalLoading] =
|
|
18221
|
-
const [isGoalPanelOpen, setIsGoalPanelOpen] =
|
|
18222
|
-
const [isGoalObjectiveExpanded, setIsGoalObjectiveExpanded] =
|
|
18223
|
-
const [goalElapsedStartedAt, setGoalElapsedStartedAt] =
|
|
18531
|
+
const [isHistoryLoading, setIsHistoryLoading] = React56.useState(false);
|
|
18532
|
+
const [historyError, setHistoryError] = React56.useState(null);
|
|
18533
|
+
const [assistantName, setAssistantName] = React56.useState(null);
|
|
18534
|
+
const [assistantAvatar, setAssistantAvatar] = React56.useState(null);
|
|
18535
|
+
const [threadGoal, setThreadGoal] = React56.useState(null);
|
|
18536
|
+
const [goalError, setGoalError] = React56.useState(null);
|
|
18537
|
+
const [isGoalLoading, setIsGoalLoading] = React56.useState(false);
|
|
18538
|
+
const [isGoalPanelOpen, setIsGoalPanelOpen] = React56.useState(false);
|
|
18539
|
+
const [isGoalObjectiveExpanded, setIsGoalObjectiveExpanded] = React56.useState(false);
|
|
18540
|
+
const [goalElapsedStartedAt, setGoalElapsedStartedAt] = React56.useState(null);
|
|
18224
18541
|
const LOADING_DOTS_MIN_DURATION = 800;
|
|
18225
18542
|
const STREAMING_STATUS_REFRESH_MS = 250;
|
|
18226
|
-
const [showLoadingDots, setShowLoadingDots] =
|
|
18227
|
-
const [streamingNow, setStreamingNow] =
|
|
18228
|
-
const loadingStartTimeRef =
|
|
18229
|
-
const lastStreamOutputAtRef =
|
|
18230
|
-
|
|
18543
|
+
const [showLoadingDots, setShowLoadingDots] = React56.useState(false);
|
|
18544
|
+
const [streamingNow, setStreamingNow] = React56.useState(() => Date.now());
|
|
18545
|
+
const loadingStartTimeRef = React56.useRef(null);
|
|
18546
|
+
const lastStreamOutputAtRef = React56.useRef(null);
|
|
18547
|
+
React56.useEffect(() => {
|
|
18231
18548
|
setStream(stream);
|
|
18232
18549
|
}, [setStream, stream]);
|
|
18233
|
-
|
|
18550
|
+
React56.useEffect(() => {
|
|
18234
18551
|
if (stream.isLoading) {
|
|
18235
18552
|
if (!loadingStartTimeRef.current) {
|
|
18236
18553
|
loadingStartTimeRef.current = Date.now();
|
|
@@ -18253,7 +18570,7 @@ function Chat({
|
|
|
18253
18570
|
}
|
|
18254
18571
|
}
|
|
18255
18572
|
}, [stream.isLoading]);
|
|
18256
|
-
|
|
18573
|
+
React56.useEffect(() => {
|
|
18257
18574
|
if (!stream.isLoading) {
|
|
18258
18575
|
lastStreamOutputAtRef.current = null;
|
|
18259
18576
|
setStreamingNow(Date.now());
|
|
@@ -18263,7 +18580,7 @@ function Chat({
|
|
|
18263
18580
|
lastStreamOutputAtRef.current = now;
|
|
18264
18581
|
setStreamingNow(now);
|
|
18265
18582
|
}, [stream.messages, stream.isLoading]);
|
|
18266
|
-
|
|
18583
|
+
React56.useEffect(() => {
|
|
18267
18584
|
if (!stream.isLoading) {
|
|
18268
18585
|
return;
|
|
18269
18586
|
}
|
|
@@ -18272,7 +18589,7 @@ function Chat({
|
|
|
18272
18589
|
}, STREAMING_STATUS_REFRESH_MS);
|
|
18273
18590
|
return () => window.clearInterval(timer);
|
|
18274
18591
|
}, [stream.isLoading]);
|
|
18275
|
-
|
|
18592
|
+
React56.useEffect(() => {
|
|
18276
18593
|
if (threadGoal?.status === "active" && stream.isLoading) {
|
|
18277
18594
|
setGoalElapsedStartedAt(Date.now());
|
|
18278
18595
|
return;
|
|
@@ -18284,55 +18601,55 @@ function Chat({
|
|
|
18284
18601
|
threadGoal?.id,
|
|
18285
18602
|
threadGoal?.status
|
|
18286
18603
|
]);
|
|
18287
|
-
|
|
18604
|
+
React56.useEffect(() => {
|
|
18288
18605
|
setIsGoalObjectiveExpanded(false);
|
|
18289
18606
|
}, [threadGoal?.id]);
|
|
18290
|
-
const [composerParts, setComposerParts] =
|
|
18291
|
-
const [renderedComposerParts, setRenderedComposerParts] =
|
|
18292
|
-
const [composerDomVersion, setComposerDomVersion] =
|
|
18293
|
-
const [selectedTool, setSelectedTool] =
|
|
18607
|
+
const [composerParts, setComposerParts] = React56.useState([]);
|
|
18608
|
+
const [renderedComposerParts, setRenderedComposerParts] = React56.useState([]);
|
|
18609
|
+
const [composerDomVersion, setComposerDomVersion] = React56.useState(0);
|
|
18610
|
+
const [selectedTool, setSelectedTool] = React56.useState(
|
|
18294
18611
|
null
|
|
18295
18612
|
);
|
|
18296
|
-
const [planModeEnabled, setPlanModeEnabled] =
|
|
18297
|
-
const [petSettingsOpen, setPetSettingsOpen] =
|
|
18298
|
-
const [petLocalSettings, setPetLocalSettings] =
|
|
18299
|
-
const [attachmentState, setAttachmentState] =
|
|
18613
|
+
const [planModeEnabled, setPlanModeEnabled] = React56.useState(false);
|
|
18614
|
+
const [petSettingsOpen, setPetSettingsOpen] = React56.useState(false);
|
|
18615
|
+
const [petLocalSettings, setPetLocalSettings] = React56.useState(() => readPetLocalSettings());
|
|
18616
|
+
const [attachmentState, setAttachmentState] = React56.useState({
|
|
18300
18617
|
uploadedFiles: [],
|
|
18301
18618
|
hasUploadingFiles: false,
|
|
18302
18619
|
hasParsingFiles: false
|
|
18303
18620
|
});
|
|
18304
|
-
const [references, setReferences] =
|
|
18305
|
-
const [isUploadingReferenceImages, setIsUploadingReferenceImages] =
|
|
18306
|
-
const [quoteSelection, setQuoteSelection] =
|
|
18307
|
-
const [isAtBottom, setIsAtBottom] =
|
|
18308
|
-
const [hasUpdatesBelow, setHasUpdatesBelow] =
|
|
18621
|
+
const [references, setReferences] = React56.useState([]);
|
|
18622
|
+
const [isUploadingReferenceImages, setIsUploadingReferenceImages] = React56.useState(false);
|
|
18623
|
+
const [quoteSelection, setQuoteSelection] = React56.useState(null);
|
|
18624
|
+
const [isAtBottom, setIsAtBottom] = React56.useState(true);
|
|
18625
|
+
const [hasUpdatesBelow, setHasUpdatesBelow] = React56.useState(false);
|
|
18309
18626
|
const {
|
|
18310
18627
|
threads,
|
|
18311
18628
|
deleteThread,
|
|
18312
18629
|
refreshThreads,
|
|
18313
18630
|
isLoading: isThreadsLoading
|
|
18314
18631
|
} = useThreads();
|
|
18315
|
-
const viewportRef =
|
|
18316
|
-
const chatColumnRef =
|
|
18317
|
-
const messageNavigationAnchorsRef =
|
|
18632
|
+
const viewportRef = React56.useRef(null);
|
|
18633
|
+
const chatColumnRef = React56.useRef(null);
|
|
18634
|
+
const messageNavigationAnchorsRef = React56.useRef(
|
|
18318
18635
|
/* @__PURE__ */ new Map()
|
|
18319
18636
|
);
|
|
18320
|
-
const attachmentsRef =
|
|
18321
|
-
const composerInputRef =
|
|
18322
|
-
const slashPaletteRef =
|
|
18323
|
-
const slashPaletteOptionRefs =
|
|
18637
|
+
const attachmentsRef = React56.useRef(null);
|
|
18638
|
+
const composerInputRef = React56.useRef(null);
|
|
18639
|
+
const slashPaletteRef = React56.useRef(null);
|
|
18640
|
+
const slashPaletteOptionRefs = React56.useRef(
|
|
18324
18641
|
[]
|
|
18325
18642
|
);
|
|
18326
|
-
const composerPartsRef =
|
|
18327
|
-
const pendingComposerCaretOffsetRef =
|
|
18328
|
-
const shouldAutoScrollRef =
|
|
18329
|
-
const forceFollowRef =
|
|
18330
|
-
const previousMessageCountRef =
|
|
18331
|
-
const previousScrollTopRef =
|
|
18332
|
-
const isPrependingHistoryMessagesRef =
|
|
18333
|
-
const autoScrollFrameRef =
|
|
18334
|
-
const isPointerDownRef =
|
|
18335
|
-
const lastTouchYRef =
|
|
18643
|
+
const composerPartsRef = React56.useRef([]);
|
|
18644
|
+
const pendingComposerCaretOffsetRef = React56.useRef(null);
|
|
18645
|
+
const shouldAutoScrollRef = React56.useRef(true);
|
|
18646
|
+
const forceFollowRef = React56.useRef(false);
|
|
18647
|
+
const previousMessageCountRef = React56.useRef(0);
|
|
18648
|
+
const previousScrollTopRef = React56.useRef(0);
|
|
18649
|
+
const isPrependingHistoryMessagesRef = React56.useRef(false);
|
|
18650
|
+
const autoScrollFrameRef = React56.useRef(null);
|
|
18651
|
+
const isPointerDownRef = React56.useRef(false);
|
|
18652
|
+
const lastTouchYRef = React56.useRef(null);
|
|
18336
18653
|
const {
|
|
18337
18654
|
runtimeCapabilities,
|
|
18338
18655
|
runtimeCapabilitiesReady,
|
|
@@ -18361,24 +18678,24 @@ function Chat({
|
|
|
18361
18678
|
const resolvedPlaceholder = placeholder ?? t("chat.placeholder");
|
|
18362
18679
|
const assistantTitle = assistantName || resolvedTitle;
|
|
18363
18680
|
const petRequired = options?.displayMode === "pet";
|
|
18364
|
-
const basePetSettings =
|
|
18681
|
+
const basePetSettings = React56.useMemo(
|
|
18365
18682
|
() => derivePetLocalSettings(options?.pet),
|
|
18366
18683
|
[options?.pet]
|
|
18367
18684
|
);
|
|
18368
|
-
const displayedPetSettings =
|
|
18685
|
+
const displayedPetSettings = React56.useMemo(
|
|
18369
18686
|
() => ({
|
|
18370
18687
|
...petLocalSettings ?? basePetSettings,
|
|
18371
18688
|
...petRequired ? { enabled: true } : {}
|
|
18372
18689
|
}),
|
|
18373
18690
|
[basePetSettings, petLocalSettings, petRequired]
|
|
18374
18691
|
);
|
|
18375
|
-
const effectivePet =
|
|
18692
|
+
const effectivePet = React56.useMemo(() => {
|
|
18376
18693
|
if (petRequired || petLocalSettings) {
|
|
18377
18694
|
return buildPetOptionsFromLocalSettings(displayedPetSettings);
|
|
18378
18695
|
}
|
|
18379
18696
|
return options?.pet ?? null;
|
|
18380
18697
|
}, [displayedPetSettings, options?.pet, petLocalSettings, petRequired]);
|
|
18381
|
-
const savePetLocalSettings =
|
|
18698
|
+
const savePetLocalSettings = React56.useCallback(
|
|
18382
18699
|
(settings) => {
|
|
18383
18700
|
const nextSettings = petRequired ? { ...settings, enabled: true } : settings;
|
|
18384
18701
|
setPetLocalSettings(nextSettings);
|
|
@@ -18386,7 +18703,7 @@ function Chat({
|
|
|
18386
18703
|
},
|
|
18387
18704
|
[petRequired]
|
|
18388
18705
|
);
|
|
18389
|
-
const handlePetCommand =
|
|
18706
|
+
const handlePetCommand = React56.useCallback(
|
|
18390
18707
|
(mode) => {
|
|
18391
18708
|
if (mode === "settings") {
|
|
18392
18709
|
setPetSettingsOpen(true);
|
|
@@ -18408,11 +18725,11 @@ function Chat({
|
|
|
18408
18725
|
[displayedPetSettings, effectivePet, petRequired, savePetLocalSettings]
|
|
18409
18726
|
);
|
|
18410
18727
|
const inputPlaceholder = selectedTool?.placeholderOverride ?? composer?.placeholder ?? resolvedPlaceholder;
|
|
18411
|
-
const messages =
|
|
18728
|
+
const messages = React56.useMemo(
|
|
18412
18729
|
() => stream.messages ?? [],
|
|
18413
18730
|
[stream.messages]
|
|
18414
18731
|
);
|
|
18415
|
-
const messageNavigationLabels =
|
|
18732
|
+
const messageNavigationLabels = React56.useMemo(
|
|
18416
18733
|
() => ({
|
|
18417
18734
|
user: t("chat.youLabel"),
|
|
18418
18735
|
assistant: assistantTitle,
|
|
@@ -18431,7 +18748,7 @@ function Chat({
|
|
|
18431
18748
|
}),
|
|
18432
18749
|
[assistantTitle, t]
|
|
18433
18750
|
);
|
|
18434
|
-
const messageNavigationItems =
|
|
18751
|
+
const messageNavigationItems = React56.useMemo(
|
|
18435
18752
|
() => messageNavigationEnabled ? buildMessageNavigationItems(
|
|
18436
18753
|
messages,
|
|
18437
18754
|
{
|
|
@@ -18454,7 +18771,7 @@ function Chat({
|
|
|
18454
18771
|
historyMessagePagination?.isLoadingMore
|
|
18455
18772
|
);
|
|
18456
18773
|
const canLoadMoreMessages = Boolean(historyMessagePagination?.hasMore);
|
|
18457
|
-
const draft =
|
|
18774
|
+
const draft = React56.useMemo(
|
|
18458
18775
|
() => getComposerPlainText(composerParts),
|
|
18459
18776
|
[composerParts]
|
|
18460
18777
|
);
|
|
@@ -18468,7 +18785,7 @@ function Chat({
|
|
|
18468
18785
|
isEmpty: isComposerInputEmpty,
|
|
18469
18786
|
isStacked: isComposerStacked
|
|
18470
18787
|
});
|
|
18471
|
-
const pendingFollowUps =
|
|
18788
|
+
const pendingFollowUps = React56.useMemo(
|
|
18472
18789
|
() => sortVisiblePendingFollowUps(stream.pendingFollowUps ?? []),
|
|
18473
18790
|
[stream.pendingFollowUps]
|
|
18474
18791
|
);
|
|
@@ -18477,7 +18794,7 @@ function Chat({
|
|
|
18477
18794
|
const hasPendingHITLRequest = Boolean(stream.pendingHITLRequest);
|
|
18478
18795
|
const hasPendingInteractiveRequest = hasPendingRequestUserInput || hasPendingHITLRequest;
|
|
18479
18796
|
const hasPendingTodos = Boolean(stream.todos?.items.length);
|
|
18480
|
-
const goalAdapter =
|
|
18797
|
+
const goalAdapter = React56.useMemo(() => {
|
|
18481
18798
|
if (isGoalAdapter(options?.goal)) {
|
|
18482
18799
|
return options.goal;
|
|
18483
18800
|
}
|
|
@@ -18490,10 +18807,10 @@ function Chat({
|
|
|
18490
18807
|
"goal"
|
|
18491
18808
|
);
|
|
18492
18809
|
const showGoalStatus = goalCommandAvailable && !hasCompletedGoal && (Boolean(goalError) || threadGoal?.status === "active" && stream.isLoading);
|
|
18493
|
-
const clearQuoteSelection =
|
|
18810
|
+
const clearQuoteSelection = React56.useCallback(() => {
|
|
18494
18811
|
setQuoteSelection(null);
|
|
18495
18812
|
}, []);
|
|
18496
|
-
const commitComposerParts =
|
|
18813
|
+
const commitComposerParts = React56.useCallback(
|
|
18497
18814
|
(nextParts, options2) => {
|
|
18498
18815
|
const normalized = normalizeComposerParts(nextParts);
|
|
18499
18816
|
const previous = composerPartsRef.current;
|
|
@@ -18523,7 +18840,7 @@ function Chat({
|
|
|
18523
18840
|
},
|
|
18524
18841
|
[setRunRuntimeCapabilities]
|
|
18525
18842
|
);
|
|
18526
|
-
const setComposerText =
|
|
18843
|
+
const setComposerText = React56.useCallback(
|
|
18527
18844
|
(text, caretOffset = text.length) => {
|
|
18528
18845
|
commitComposerParts(createComposerTextParts(text), {
|
|
18529
18846
|
caretOffset,
|
|
@@ -18533,7 +18850,7 @@ function Chat({
|
|
|
18533
18850
|
},
|
|
18534
18851
|
[commitComposerParts]
|
|
18535
18852
|
);
|
|
18536
|
-
const focusComposerAt =
|
|
18853
|
+
const focusComposerAt = React56.useCallback((position) => {
|
|
18537
18854
|
const nextPosition = position ?? getComposerEditingLength(composerPartsRef.current);
|
|
18538
18855
|
pendingComposerCaretOffsetRef.current = nextPosition;
|
|
18539
18856
|
requestAnimationFrame(() => {
|
|
@@ -18562,7 +18879,7 @@ function Chat({
|
|
|
18562
18879
|
focusComposerAt
|
|
18563
18880
|
});
|
|
18564
18881
|
const parentMessenger = useParentMessenger({
|
|
18565
|
-
onSetComposerValue:
|
|
18882
|
+
onSetComposerValue: React56.useCallback(
|
|
18566
18883
|
(payload) => {
|
|
18567
18884
|
if (!payload) {
|
|
18568
18885
|
return;
|
|
@@ -18590,16 +18907,16 @@ function Chat({
|
|
|
18590
18907
|
},
|
|
18591
18908
|
[applyComposerValueRuntimeCapabilities, composer?.tools, setComposerText]
|
|
18592
18909
|
),
|
|
18593
|
-
onSetRuntimeCapabilities:
|
|
18910
|
+
onSetRuntimeCapabilities: React56.useCallback(
|
|
18594
18911
|
(selection) => {
|
|
18595
18912
|
applyExternalRuntimeCapabilities(selection);
|
|
18596
18913
|
},
|
|
18597
18914
|
[applyExternalRuntimeCapabilities]
|
|
18598
18915
|
),
|
|
18599
|
-
onFocusComposer:
|
|
18916
|
+
onFocusComposer: React56.useCallback(() => {
|
|
18600
18917
|
composerInputRef.current?.focus();
|
|
18601
18918
|
}, []),
|
|
18602
|
-
onSetPetEnabled:
|
|
18919
|
+
onSetPetEnabled: React56.useCallback(
|
|
18603
18920
|
(enabled) => {
|
|
18604
18921
|
if (petRequired) {
|
|
18605
18922
|
return;
|
|
@@ -18613,10 +18930,10 @@ function Chat({
|
|
|
18613
18930
|
)
|
|
18614
18931
|
});
|
|
18615
18932
|
const canMinimizeToPet = parentMessenger?.isParentAvailable === true && isPetEnabled(effectivePet);
|
|
18616
|
-
const handleMinimizeToPet =
|
|
18933
|
+
const handleMinimizeToPet = React56.useCallback(() => {
|
|
18617
18934
|
parentMessenger?.sendEvent("chat_minimize_change", { minimized: true });
|
|
18618
18935
|
}, [parentMessenger]);
|
|
18619
|
-
const syncQuoteSelection =
|
|
18936
|
+
const syncQuoteSelection = React56.useCallback(() => {
|
|
18620
18937
|
if (typeof window === "undefined") {
|
|
18621
18938
|
clearQuoteSelection();
|
|
18622
18939
|
return;
|
|
@@ -18661,23 +18978,23 @@ function Chat({
|
|
|
18661
18978
|
left
|
|
18662
18979
|
});
|
|
18663
18980
|
}, [clearQuoteSelection]);
|
|
18664
|
-
const cancelPendingAutoScroll =
|
|
18981
|
+
const cancelPendingAutoScroll = React56.useCallback(() => {
|
|
18665
18982
|
if (autoScrollFrameRef.current !== null) {
|
|
18666
18983
|
cancelAnimationFrame(autoScrollFrameRef.current);
|
|
18667
18984
|
autoScrollFrameRef.current = null;
|
|
18668
18985
|
}
|
|
18669
18986
|
}, []);
|
|
18670
|
-
const disableAutoFollow =
|
|
18987
|
+
const disableAutoFollow = React56.useCallback(() => {
|
|
18671
18988
|
forceFollowRef.current = false;
|
|
18672
18989
|
shouldAutoScrollRef.current = false;
|
|
18673
18990
|
cancelPendingAutoScroll();
|
|
18674
18991
|
}, [cancelPendingAutoScroll]);
|
|
18675
|
-
const enableAutoFollow =
|
|
18992
|
+
const enableAutoFollow = React56.useCallback(() => {
|
|
18676
18993
|
forceFollowRef.current = true;
|
|
18677
18994
|
shouldAutoScrollRef.current = true;
|
|
18678
18995
|
setHasUpdatesBelow(false);
|
|
18679
18996
|
}, []);
|
|
18680
|
-
const scrollToBottom =
|
|
18997
|
+
const scrollToBottom = React56.useCallback(
|
|
18681
18998
|
(smooth = false, force = false) => {
|
|
18682
18999
|
if (force) {
|
|
18683
19000
|
enableAutoFollow();
|
|
@@ -18704,7 +19021,7 @@ function Chat({
|
|
|
18704
19021
|
},
|
|
18705
19022
|
[cancelPendingAutoScroll, enableAutoFollow]
|
|
18706
19023
|
);
|
|
18707
|
-
const setMessageNavigationAnchor =
|
|
19024
|
+
const setMessageNavigationAnchor = React56.useCallback(
|
|
18708
19025
|
(id, node) => {
|
|
18709
19026
|
if (node) {
|
|
18710
19027
|
messageNavigationAnchorsRef.current.set(id, node);
|
|
@@ -18714,22 +19031,22 @@ function Chat({
|
|
|
18714
19031
|
},
|
|
18715
19032
|
[]
|
|
18716
19033
|
);
|
|
18717
|
-
const getMessageNavigationAnchor =
|
|
19034
|
+
const getMessageNavigationAnchor = React56.useCallback(
|
|
18718
19035
|
(item) => messageNavigationAnchorsRef.current.get(item.id) ?? null,
|
|
18719
19036
|
[]
|
|
18720
19037
|
);
|
|
18721
|
-
const handleMessageNavigationNavigate =
|
|
19038
|
+
const handleMessageNavigationNavigate = React56.useCallback(() => {
|
|
18722
19039
|
disableAutoFollow();
|
|
18723
19040
|
clearQuoteSelection();
|
|
18724
19041
|
}, [clearQuoteSelection, disableAutoFollow]);
|
|
18725
19042
|
const taskSummaryEnabled = options?.taskSummary?.enabled === true;
|
|
18726
19043
|
const taskSummaryConversationId = stream.conversationId ?? null;
|
|
18727
|
-
const [taskSummaryDocked, setTaskSummaryDocked] =
|
|
18728
|
-
const [taskSummaryOpen, setTaskSummaryOpen] =
|
|
18729
|
-
const manuallyClosedTaskSummaryConversationIdsRef =
|
|
19044
|
+
const [taskSummaryDocked, setTaskSummaryDocked] = React56.useState(false);
|
|
19045
|
+
const [taskSummaryOpen, setTaskSummaryOpen] = React56.useState(false);
|
|
19046
|
+
const manuallyClosedTaskSummaryConversationIdsRef = React56.useRef(
|
|
18730
19047
|
/* @__PURE__ */ new Set()
|
|
18731
19048
|
);
|
|
18732
|
-
const liveTaskSummaryPending =
|
|
19049
|
+
const liveTaskSummaryPending = React56.useMemo(() => {
|
|
18733
19050
|
const followUps = pendingFollowUps.map((item) => ({
|
|
18734
19051
|
id: `follow-up:${item.id}`,
|
|
18735
19052
|
kind: "follow_up",
|
|
@@ -18764,7 +19081,7 @@ function Chat({
|
|
|
18764
19081
|
stream.pendingRequestUserInput,
|
|
18765
19082
|
t
|
|
18766
19083
|
]);
|
|
18767
|
-
const liveTaskSummaryRunning =
|
|
19084
|
+
const liveTaskSummaryRunning = React56.useMemo(
|
|
18768
19085
|
() => stream.runtimeActivities.sandboxServices.services.filter(
|
|
18769
19086
|
(service) => service.status === "starting" || service.status === "running" || service.status === "stopping"
|
|
18770
19087
|
).map((service) => ({
|
|
@@ -18781,7 +19098,7 @@ function Chat({
|
|
|
18781
19098
|
})),
|
|
18782
19099
|
[stream.runtimeActivities.sandboxServices.services]
|
|
18783
19100
|
);
|
|
18784
|
-
const taskSummaryAgentNames =
|
|
19101
|
+
const taskSummaryAgentNames = React56.useMemo(() => {
|
|
18785
19102
|
const names = /* @__PURE__ */ new Map();
|
|
18786
19103
|
runtimeCapabilityOptions.forEach((option) => {
|
|
18787
19104
|
if (option.type !== "subAgent") return;
|
|
@@ -18793,7 +19110,7 @@ function Chat({
|
|
|
18793
19110
|
});
|
|
18794
19111
|
return names;
|
|
18795
19112
|
}, [runtimeCapabilityOptions]);
|
|
18796
|
-
const liveTaskSummary =
|
|
19113
|
+
const liveTaskSummary = React56.useMemo(
|
|
18797
19114
|
() => collectLiveTaskSummary({
|
|
18798
19115
|
messages: messages.map(
|
|
18799
19116
|
(message) => ({
|
|
@@ -18830,7 +19147,7 @@ function Chat({
|
|
|
18830
19147
|
client: stream.client,
|
|
18831
19148
|
live: liveTaskSummary
|
|
18832
19149
|
});
|
|
18833
|
-
const navigateToTaskSummaryMessage =
|
|
19150
|
+
const navigateToTaskSummaryMessage = React56.useCallback(
|
|
18834
19151
|
async (messageId) => {
|
|
18835
19152
|
try {
|
|
18836
19153
|
let anchor = messageNavigationAnchorsRef.current.get(messageId);
|
|
@@ -18854,7 +19171,7 @@ function Chat({
|
|
|
18854
19171
|
},
|
|
18855
19172
|
[clearQuoteSelection, disableAutoFollow, stream]
|
|
18856
19173
|
);
|
|
18857
|
-
const openTaskSummaryResource =
|
|
19174
|
+
const openTaskSummaryResource = React56.useCallback(
|
|
18858
19175
|
(resource, messageId, resourceTitle) => {
|
|
18859
19176
|
const data = {
|
|
18860
19177
|
resource,
|
|
@@ -18872,7 +19189,7 @@ function Chat({
|
|
|
18872
19189
|
},
|
|
18873
19190
|
[parentMessenger, taskSummaryConversationId]
|
|
18874
19191
|
);
|
|
18875
|
-
|
|
19192
|
+
React56.useEffect(() => {
|
|
18876
19193
|
const viewport = viewportRef.current;
|
|
18877
19194
|
if (!viewport) return;
|
|
18878
19195
|
previousScrollTopRef.current = viewport.scrollTop;
|
|
@@ -18953,14 +19270,14 @@ function Chat({
|
|
|
18953
19270
|
window.removeEventListener("pointercancel", stopPointerTracking);
|
|
18954
19271
|
};
|
|
18955
19272
|
}, [cancelPendingAutoScroll, disableAutoFollow]);
|
|
18956
|
-
|
|
19273
|
+
React56.useEffect(() => {
|
|
18957
19274
|
shouldAutoScrollRef.current = true;
|
|
18958
19275
|
forceFollowRef.current = false;
|
|
18959
19276
|
previousScrollTopRef.current = 0;
|
|
18960
19277
|
setIsAtBottom(true);
|
|
18961
19278
|
setHasUpdatesBelow(false);
|
|
18962
19279
|
}, [stream.threadId]);
|
|
18963
|
-
|
|
19280
|
+
React56.useEffect(() => {
|
|
18964
19281
|
const messageCountChanged = messages.length !== previousMessageCountRef.current;
|
|
18965
19282
|
previousMessageCountRef.current = messages.length;
|
|
18966
19283
|
if (isPrependingHistoryMessagesRef.current) {
|
|
@@ -18982,7 +19299,7 @@ function Chat({
|
|
|
18982
19299
|
const isSubmissionBlocked = hasPendingInteractiveRequest || missingConfig || isHistoryLoading || hasUploadingFiles || isUploadingReferenceImages;
|
|
18983
19300
|
const isSendDisabled = !trimmedDraft && !hasReferences || isSubmissionBlocked;
|
|
18984
19301
|
const isPromptEditDisabled = hasPendingInteractiveRequest || missingConfig || isHistoryLoading;
|
|
18985
|
-
const resizeComposerInput =
|
|
19302
|
+
const resizeComposerInput = React56.useCallback(() => {
|
|
18986
19303
|
const input = composerInputRef.current;
|
|
18987
19304
|
if (!input) {
|
|
18988
19305
|
return;
|
|
@@ -18990,7 +19307,7 @@ function Chat({
|
|
|
18990
19307
|
input.style.maxHeight = `${COMPOSER_INPUT_MAX_HEIGHT}px`;
|
|
18991
19308
|
input.style.overflowY = input.scrollHeight > COMPOSER_INPUT_MAX_HEIGHT ? "auto" : "hidden";
|
|
18992
19309
|
}, []);
|
|
18993
|
-
|
|
19310
|
+
React56.useLayoutEffect(() => {
|
|
18994
19311
|
composerPartsRef.current = composerParts;
|
|
18995
19312
|
resizeComposerInput();
|
|
18996
19313
|
const caretOffset = pendingComposerCaretOffsetRef.current;
|
|
@@ -19002,13 +19319,13 @@ function Chat({
|
|
|
19002
19319
|
}
|
|
19003
19320
|
}
|
|
19004
19321
|
}, [composerDomVersion, composerParts, resizeComposerInput]);
|
|
19005
|
-
|
|
19322
|
+
React56.useEffect(() => {
|
|
19006
19323
|
document.addEventListener("selectionchange", syncQuoteSelection);
|
|
19007
19324
|
return () => {
|
|
19008
19325
|
document.removeEventListener("selectionchange", syncQuoteSelection);
|
|
19009
19326
|
};
|
|
19010
19327
|
}, [syncQuoteSelection]);
|
|
19011
|
-
|
|
19328
|
+
React56.useEffect(() => {
|
|
19012
19329
|
const viewport = viewportRef.current;
|
|
19013
19330
|
if (!viewport) {
|
|
19014
19331
|
return;
|
|
@@ -19025,14 +19342,14 @@ function Chat({
|
|
|
19025
19342
|
window.removeEventListener("resize", handleViewportScroll);
|
|
19026
19343
|
};
|
|
19027
19344
|
}, [clearQuoteSelection]);
|
|
19028
|
-
|
|
19345
|
+
React56.useEffect(() => {
|
|
19029
19346
|
clearQuoteSelection();
|
|
19030
19347
|
}, [messages.length, stream.threadId, clearQuoteSelection]);
|
|
19031
|
-
|
|
19348
|
+
React56.useEffect(() => {
|
|
19032
19349
|
if (missingConfig) return;
|
|
19033
19350
|
void refreshThreads();
|
|
19034
19351
|
}, [missingConfig, refreshThreads]);
|
|
19035
|
-
|
|
19352
|
+
React56.useEffect(() => {
|
|
19036
19353
|
if (missingConfig || !stream.client || !stream.assistantId) {
|
|
19037
19354
|
setAssistantName(null);
|
|
19038
19355
|
setAssistantAvatar(null);
|
|
@@ -19055,10 +19372,10 @@ function Chat({
|
|
|
19055
19372
|
cancelled = true;
|
|
19056
19373
|
};
|
|
19057
19374
|
}, [missingConfig, stream.client, stream.assistantId]);
|
|
19058
|
-
|
|
19375
|
+
React56.useEffect(() => {
|
|
19059
19376
|
setThreadGoal(stream.threadGoal);
|
|
19060
19377
|
}, [stream.threadGoal]);
|
|
19061
|
-
|
|
19378
|
+
React56.useEffect(() => {
|
|
19062
19379
|
const threadId = stream.threadId?.trim();
|
|
19063
19380
|
if (!threadId || !goalCommandAvailable) {
|
|
19064
19381
|
setThreadGoal(null);
|
|
@@ -19099,7 +19416,7 @@ function Chat({
|
|
|
19099
19416
|
return () => controller.abort();
|
|
19100
19417
|
}, [goalAdapter, goalCommandAvailable, stream.threadId]);
|
|
19101
19418
|
const uploadedFiles = attachmentState.uploadedFiles;
|
|
19102
|
-
const syncComposerInputFromElement =
|
|
19419
|
+
const syncComposerInputFromElement = React56.useCallback(
|
|
19103
19420
|
(input) => {
|
|
19104
19421
|
const previousCapabilities = getComposerCapabilityPartMap(
|
|
19105
19422
|
composerPartsRef.current
|
|
@@ -19117,25 +19434,25 @@ function Chat({
|
|
|
19117
19434
|
},
|
|
19118
19435
|
[commitComposerParts, updateRuntimeCapabilityPalette]
|
|
19119
19436
|
);
|
|
19120
|
-
const handleComposerInput =
|
|
19437
|
+
const handleComposerInput = React56.useCallback(
|
|
19121
19438
|
(event) => {
|
|
19122
19439
|
syncComposerInputFromElement(event.currentTarget);
|
|
19123
19440
|
},
|
|
19124
19441
|
[syncComposerInputFromElement]
|
|
19125
19442
|
);
|
|
19126
|
-
const handleComposerCompositionEnd =
|
|
19443
|
+
const handleComposerCompositionEnd = React56.useCallback(
|
|
19127
19444
|
(event) => {
|
|
19128
19445
|
syncComposerInputFromElement(event.currentTarget);
|
|
19129
19446
|
},
|
|
19130
19447
|
[syncComposerInputFromElement]
|
|
19131
19448
|
);
|
|
19132
|
-
const handleComposerSelect =
|
|
19449
|
+
const handleComposerSelect = React56.useCallback(() => {
|
|
19133
19450
|
updateRuntimeCapabilityPalette(
|
|
19134
19451
|
composerPartsRef.current,
|
|
19135
19452
|
composerInputRef.current ? getComposerSelectionOffset(composerInputRef.current) : void 0
|
|
19136
19453
|
);
|
|
19137
19454
|
}, [updateRuntimeCapabilityPalette]);
|
|
19138
|
-
const submitDraft =
|
|
19455
|
+
const submitDraft = React56.useCallback(
|
|
19139
19456
|
(submitOptions = {}) => {
|
|
19140
19457
|
if (isSubmissionBlocked) return;
|
|
19141
19458
|
const contentToSubmit = (submitOptions.inputText ?? trimmedDraft).trim();
|
|
@@ -19241,7 +19558,7 @@ function Chat({
|
|
|
19241
19558
|
t
|
|
19242
19559
|
]
|
|
19243
19560
|
);
|
|
19244
|
-
const handleGoalCommand =
|
|
19561
|
+
const handleGoalCommand = React56.useCallback(
|
|
19245
19562
|
async ({
|
|
19246
19563
|
args,
|
|
19247
19564
|
commandSource,
|
|
@@ -19347,7 +19664,7 @@ function Chat({
|
|
|
19347
19664
|
t
|
|
19348
19665
|
]
|
|
19349
19666
|
);
|
|
19350
|
-
const handleGoalPanelOpenChange =
|
|
19667
|
+
const handleGoalPanelOpenChange = React56.useCallback((open) => {
|
|
19351
19668
|
setIsGoalPanelOpen(open);
|
|
19352
19669
|
}, []);
|
|
19353
19670
|
const {
|
|
@@ -19391,7 +19708,7 @@ function Chat({
|
|
|
19391
19708
|
plugin: t("composer.slashCommands.empty.loadingCapabilities"),
|
|
19392
19709
|
subAgent: t("composer.slashCommands.empty.loadingCapabilities")
|
|
19393
19710
|
};
|
|
19394
|
-
|
|
19711
|
+
React56.useEffect(() => {
|
|
19395
19712
|
if (!runtimeCapabilityPalette) {
|
|
19396
19713
|
return;
|
|
19397
19714
|
}
|
|
@@ -19410,7 +19727,7 @@ function Chat({
|
|
|
19410
19727
|
);
|
|
19411
19728
|
}
|
|
19412
19729
|
}, [slashPaletteOptions.length, runtimeCapabilityPalette]);
|
|
19413
|
-
|
|
19730
|
+
React56.useLayoutEffect(() => {
|
|
19414
19731
|
if (!runtimeCapabilityPalette) {
|
|
19415
19732
|
return;
|
|
19416
19733
|
}
|
|
@@ -19427,7 +19744,7 @@ function Chat({
|
|
|
19427
19744
|
container.scrollTop += optionRect.bottom - containerRect.bottom;
|
|
19428
19745
|
}
|
|
19429
19746
|
}, [runtimeCapabilityPalette, slashPaletteOptions.length]);
|
|
19430
|
-
const submitGoalModeDraft =
|
|
19747
|
+
const submitGoalModeDraft = React56.useCallback(() => {
|
|
19431
19748
|
const objective = getComposerPlainText(composerPartsRef.current).trim();
|
|
19432
19749
|
if (!isGoalModeOpen || !goalCommandAvailable || !objective) {
|
|
19433
19750
|
return false;
|
|
@@ -19465,7 +19782,7 @@ function Chat({
|
|
|
19465
19782
|
}
|
|
19466
19783
|
submitDraft();
|
|
19467
19784
|
};
|
|
19468
|
-
const handleEditPendingFollowUp =
|
|
19785
|
+
const handleEditPendingFollowUp = React56.useCallback(
|
|
19469
19786
|
(id) => {
|
|
19470
19787
|
const item = pendingFollowUps.find(
|
|
19471
19788
|
(entry) => entry.id === id && entry.mode === "queue"
|
|
@@ -19492,7 +19809,7 @@ function Chat({
|
|
|
19492
19809
|
},
|
|
19493
19810
|
[pendingFollowUps, setComposerText, stream]
|
|
19494
19811
|
);
|
|
19495
|
-
const handleQuoteSelection =
|
|
19812
|
+
const handleQuoteSelection = React56.useCallback(() => {
|
|
19496
19813
|
if (!quoteSelection) {
|
|
19497
19814
|
return;
|
|
19498
19815
|
}
|
|
@@ -19508,7 +19825,7 @@ function Chat({
|
|
|
19508
19825
|
const handleAttachmentClick = () => {
|
|
19509
19826
|
attachmentsRef.current?.openFilePicker();
|
|
19510
19827
|
};
|
|
19511
|
-
const uploadContextFile =
|
|
19828
|
+
const uploadContextFile = React56.useCallback(
|
|
19512
19829
|
(file) => {
|
|
19513
19830
|
const formData = new FormData();
|
|
19514
19831
|
formData.append("file", file, file.name || "upload");
|
|
@@ -19527,13 +19844,13 @@ function Chat({
|
|
|
19527
19844
|
},
|
|
19528
19845
|
[stream.assistantId, stream.client, stream.threadId]
|
|
19529
19846
|
);
|
|
19530
|
-
const getContextFileStatus =
|
|
19847
|
+
const getContextFileStatus = React56.useCallback(
|
|
19531
19848
|
(fileId) => stream.client.contexts.fetch(`/files/${fileId}/status`, {
|
|
19532
19849
|
method: "GET"
|
|
19533
19850
|
}),
|
|
19534
19851
|
[stream.client]
|
|
19535
19852
|
);
|
|
19536
|
-
const deleteContextFile =
|
|
19853
|
+
const deleteContextFile = React56.useCallback(
|
|
19537
19854
|
(storageFileId) => stream.client.contexts.deleteFile(storageFileId),
|
|
19538
19855
|
[stream.client]
|
|
19539
19856
|
);
|
|
@@ -19641,7 +19958,7 @@ function Chat({
|
|
|
19641
19958
|
}
|
|
19642
19959
|
submitDraft();
|
|
19643
19960
|
};
|
|
19644
|
-
const handleComposerPaste =
|
|
19961
|
+
const handleComposerPaste = React56.useCallback(
|
|
19645
19962
|
(event) => {
|
|
19646
19963
|
const clipboardData = event.clipboardData;
|
|
19647
19964
|
if (!clipboardData) {
|
|
@@ -19743,13 +20060,13 @@ function Chat({
|
|
|
19743
20060
|
const handleToolSelect = (tool) => {
|
|
19744
20061
|
setSelectedTool((prev) => prev?.id === tool.id ? null : tool);
|
|
19745
20062
|
};
|
|
19746
|
-
const handlePromptClick =
|
|
20063
|
+
const handlePromptClick = React56.useCallback(
|
|
19747
20064
|
(prompt) => {
|
|
19748
20065
|
submitDraft({ inputText: prompt, displayText: prompt });
|
|
19749
20066
|
},
|
|
19750
20067
|
[submitDraft]
|
|
19751
20068
|
);
|
|
19752
|
-
const handlePromptEdit =
|
|
20069
|
+
const handlePromptEdit = React56.useCallback(
|
|
19753
20070
|
(prompt) => {
|
|
19754
20071
|
if (isPromptEditDisabled) return;
|
|
19755
20072
|
setComposerText(prompt, prompt.length);
|
|
@@ -19758,7 +20075,7 @@ function Chat({
|
|
|
19758
20075
|
},
|
|
19759
20076
|
[focusComposerAt, isPromptEditDisabled, setComposerText]
|
|
19760
20077
|
);
|
|
19761
|
-
const loadConversationMessages =
|
|
20078
|
+
const loadConversationMessages = React56.useCallback(
|
|
19762
20079
|
async (recordId) => {
|
|
19763
20080
|
if (missingConfig) {
|
|
19764
20081
|
setHistoryError(missingConfigShortMessage);
|
|
@@ -19779,7 +20096,7 @@ function Chat({
|
|
|
19779
20096
|
},
|
|
19780
20097
|
[missingConfig, missingConfigShortMessage, stream, t]
|
|
19781
20098
|
);
|
|
19782
|
-
const handleLoadMoreMessages =
|
|
20099
|
+
const handleLoadMoreMessages = React56.useCallback(async () => {
|
|
19783
20100
|
if (!canLoadMoreMessages || isLoadingMoreMessages) {
|
|
19784
20101
|
return;
|
|
19785
20102
|
}
|
|
@@ -19888,19 +20205,19 @@ function Chat({
|
|
|
19888
20205
|
};
|
|
19889
20206
|
const acceptMimes = composer?.attachments?.accept ? Object.entries(composer.attachments.accept).map(([mime, exts]) => [mime, ...exts.map((e) => `.${e}`)].join(",")).join(",") : void 0;
|
|
19890
20207
|
const canUploadDroppedFiles = composer?.attachments?.enabled === true && !missingConfig && !isHistoryLoading && !hasPendingInteractiveRequest;
|
|
19891
|
-
const handleDroppedFiles =
|
|
20208
|
+
const handleDroppedFiles = React56.useCallback((files) => {
|
|
19892
20209
|
return attachmentsRef.current?.queueFiles(files) ?? false;
|
|
19893
20210
|
}, []);
|
|
19894
|
-
const currentThread =
|
|
20211
|
+
const currentThread = React56.useMemo(
|
|
19895
20212
|
() => threads.find((item) => item.id === stream.threadId),
|
|
19896
20213
|
[threads, stream.threadId]
|
|
19897
20214
|
);
|
|
19898
|
-
const assistantStatusText =
|
|
20215
|
+
const assistantStatusText = React56.useMemo(() => {
|
|
19899
20216
|
if (!stream.threadId) return t("chat.statusOnline");
|
|
19900
20217
|
return currentThread?.title?.trim() || t("chat.statusOnline");
|
|
19901
20218
|
}, [currentThread?.title, stream.threadId, t]);
|
|
19902
20219
|
const streamErrorMessage = stream.error instanceof Error ? stream.error.message : void 0;
|
|
19903
|
-
const threadErrorMessage =
|
|
20220
|
+
const threadErrorMessage = React56.useMemo(() => {
|
|
19904
20221
|
if (streamErrorMessage?.trim()) return streamErrorMessage.trim();
|
|
19905
20222
|
if (currentThread?.status !== "error") return void 0;
|
|
19906
20223
|
const message = currentThread.error?.trim();
|
|
@@ -19931,13 +20248,13 @@ function Chat({
|
|
|
19931
20248
|
fallbackTitle: t("history.threadFallback")
|
|
19932
20249
|
});
|
|
19933
20250
|
const layoutMaxWidth = options?.layout?.maxWidth;
|
|
19934
|
-
const chatColumnStyle =
|
|
20251
|
+
const chatColumnStyle = React56.useMemo(() => {
|
|
19935
20252
|
if (layoutMaxWidth === void 0 || layoutMaxWidth === null || layoutMaxWidth === "") {
|
|
19936
20253
|
return void 0;
|
|
19937
20254
|
}
|
|
19938
20255
|
return { maxWidth: layoutMaxWidth };
|
|
19939
20256
|
}, [layoutMaxWidth]);
|
|
19940
|
-
|
|
20257
|
+
React56.useLayoutEffect(() => {
|
|
19941
20258
|
if (!taskSummaryEnabled) {
|
|
19942
20259
|
setTaskSummaryDocked(false);
|
|
19943
20260
|
return;
|
|
@@ -19972,7 +20289,7 @@ function Chat({
|
|
|
19972
20289
|
const taskSummaryAvailable = Boolean(
|
|
19973
20290
|
taskSummaryEnabled && stream.threadId && taskSummaryConversationId
|
|
19974
20291
|
);
|
|
19975
|
-
const handleTaskSummaryOpenChange =
|
|
20292
|
+
const handleTaskSummaryOpenChange = React56.useCallback(
|
|
19976
20293
|
(open) => {
|
|
19977
20294
|
setTaskSummaryOpen(open);
|
|
19978
20295
|
if (!taskSummaryConversationId) return;
|
|
@@ -19988,12 +20305,12 @@ function Chat({
|
|
|
19988
20305
|
},
|
|
19989
20306
|
[taskSummaryConversationId]
|
|
19990
20307
|
);
|
|
19991
|
-
|
|
20308
|
+
React56.useEffect(() => {
|
|
19992
20309
|
if (!taskSummaryDocked) {
|
|
19993
20310
|
setTaskSummaryOpen(false);
|
|
19994
20311
|
}
|
|
19995
20312
|
}, [taskSummaryDocked]);
|
|
19996
|
-
|
|
20313
|
+
React56.useEffect(() => {
|
|
19997
20314
|
if (!taskSummaryDocked || !taskSummaryAvailable || !taskSummaryConversationId || manuallyClosedTaskSummaryConversationIdsRef.current.has(
|
|
19998
20315
|
taskSummaryConversationId
|
|
19999
20316
|
)) {
|
|
@@ -20014,13 +20331,13 @@ function Chat({
|
|
|
20014
20331
|
onFocusComposer: () => focusComposerAt(),
|
|
20015
20332
|
onOpenResource: openTaskSummaryResource
|
|
20016
20333
|
};
|
|
20017
|
-
return /* @__PURE__ */
|
|
20334
|
+
return /* @__PURE__ */ jsxs42(
|
|
20018
20335
|
"div",
|
|
20019
20336
|
{
|
|
20020
20337
|
className: "relative flex h-full w-full min-w-0 bg-background",
|
|
20021
20338
|
"data-task-summary-layout": taskSummaryDocked ? "docked" : "popover",
|
|
20022
20339
|
children: [
|
|
20023
|
-
/* @__PURE__ */
|
|
20340
|
+
/* @__PURE__ */ jsxs42(
|
|
20024
20341
|
UploadDroppedFiles,
|
|
20025
20342
|
{
|
|
20026
20343
|
ref: viewportRef,
|
|
@@ -20035,7 +20352,7 @@ function Chat({
|
|
|
20035
20352
|
className
|
|
20036
20353
|
),
|
|
20037
20354
|
children: [
|
|
20038
|
-
/* @__PURE__ */
|
|
20355
|
+
/* @__PURE__ */ jsxs42(
|
|
20039
20356
|
"div",
|
|
20040
20357
|
{
|
|
20041
20358
|
ref: chatColumnRef,
|
|
@@ -20043,9 +20360,9 @@ function Chat({
|
|
|
20043
20360
|
className: "mx-auto flex w-full items-center justify-between border-b p-2 sticky top-0 z-10 bg-background",
|
|
20044
20361
|
style: chatColumnStyle,
|
|
20045
20362
|
children: [
|
|
20046
|
-
/* @__PURE__ */
|
|
20047
|
-
/* @__PURE__ */
|
|
20048
|
-
/* @__PURE__ */
|
|
20363
|
+
/* @__PURE__ */ jsxs42("div", { className: "flex min-w-0 items-center gap-3 overflow-hidden", children: [
|
|
20364
|
+
/* @__PURE__ */ jsxs42("div", { className: "relative shrink-0", children: [
|
|
20365
|
+
/* @__PURE__ */ jsx60(
|
|
20049
20366
|
ChatkitAvatar,
|
|
20050
20367
|
{
|
|
20051
20368
|
avatar: assistantAvatar,
|
|
@@ -20053,10 +20370,10 @@ function Chat({
|
|
|
20053
20370
|
label: assistantTitle
|
|
20054
20371
|
}
|
|
20055
20372
|
),
|
|
20056
|
-
/* @__PURE__ */
|
|
20373
|
+
/* @__PURE__ */ jsx60("span", { className: "absolute bottom-0 right-0 h-2.5 w-2.5 rounded-full border-2 border-background bg-green-500" })
|
|
20057
20374
|
] }),
|
|
20058
|
-
/* @__PURE__ */
|
|
20059
|
-
/* @__PURE__ */
|
|
20375
|
+
/* @__PURE__ */ jsxs42("div", { className: "min-w-0", children: [
|
|
20376
|
+
/* @__PURE__ */ jsx60(
|
|
20060
20377
|
"h2",
|
|
20061
20378
|
{
|
|
20062
20379
|
className: "text-lg font-semibold truncate",
|
|
@@ -20064,7 +20381,7 @@ function Chat({
|
|
|
20064
20381
|
children: assistantTitle
|
|
20065
20382
|
}
|
|
20066
20383
|
),
|
|
20067
|
-
/* @__PURE__ */
|
|
20384
|
+
/* @__PURE__ */ jsx60(
|
|
20068
20385
|
"p",
|
|
20069
20386
|
{
|
|
20070
20387
|
className: "truncate text-xs text-muted-foreground",
|
|
@@ -20074,8 +20391,8 @@ function Chat({
|
|
|
20074
20391
|
)
|
|
20075
20392
|
] })
|
|
20076
20393
|
] }),
|
|
20077
|
-
/* @__PURE__ */
|
|
20078
|
-
taskSummaryAvailable && /* @__PURE__ */
|
|
20394
|
+
/* @__PURE__ */ jsxs42("div", { className: "flex items-center gap-1", children: [
|
|
20395
|
+
taskSummaryAvailable && /* @__PURE__ */ jsx60(
|
|
20079
20396
|
TaskSummaryTrigger,
|
|
20080
20397
|
{
|
|
20081
20398
|
...taskSummaryProps,
|
|
@@ -20084,9 +20401,9 @@ function Chat({
|
|
|
20084
20401
|
onOpenChange: handleTaskSummaryOpenChange
|
|
20085
20402
|
}
|
|
20086
20403
|
),
|
|
20087
|
-
/* @__PURE__ */
|
|
20088
|
-
canMinimizeToPet && /* @__PURE__ */
|
|
20089
|
-
/* @__PURE__ */
|
|
20404
|
+
/* @__PURE__ */ jsx60(WorkbenchToggleButton, {}),
|
|
20405
|
+
canMinimizeToPet && /* @__PURE__ */ jsxs42(Tooltip, { children: [
|
|
20406
|
+
/* @__PURE__ */ jsx60(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx60("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ jsx60(
|
|
20090
20407
|
"button",
|
|
20091
20408
|
{
|
|
20092
20409
|
type: "button",
|
|
@@ -20097,13 +20414,13 @@ function Chat({
|
|
|
20097
20414
|
"transition-colors duration-150"
|
|
20098
20415
|
),
|
|
20099
20416
|
"aria-label": t("chat.minimizeToPet"),
|
|
20100
|
-
children: /* @__PURE__ */
|
|
20417
|
+
children: /* @__PURE__ */ jsx60(Minus, { size: 16 })
|
|
20101
20418
|
}
|
|
20102
20419
|
) }) }),
|
|
20103
|
-
/* @__PURE__ */
|
|
20420
|
+
/* @__PURE__ */ jsx60(TooltipContent, { side: "bottom", children: t("chat.minimizeToPet") })
|
|
20104
20421
|
] }),
|
|
20105
|
-
/* @__PURE__ */
|
|
20106
|
-
/* @__PURE__ */
|
|
20422
|
+
/* @__PURE__ */ jsxs42(Tooltip, { children: [
|
|
20423
|
+
/* @__PURE__ */ jsx60(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx60("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ jsx60(
|
|
20107
20424
|
"button",
|
|
20108
20425
|
{
|
|
20109
20426
|
type: "button",
|
|
@@ -20114,14 +20431,14 @@ function Chat({
|
|
|
20114
20431
|
"transition-colors duration-150"
|
|
20115
20432
|
),
|
|
20116
20433
|
"aria-label": t("settings.open"),
|
|
20117
|
-
children: /* @__PURE__ */
|
|
20434
|
+
children: /* @__PURE__ */ jsx60(Settings2, { size: 16 })
|
|
20118
20435
|
}
|
|
20119
20436
|
) }) }),
|
|
20120
|
-
/* @__PURE__ */
|
|
20437
|
+
/* @__PURE__ */ jsx60(TooltipContent, { side: "bottom", children: t("settings.open") })
|
|
20121
20438
|
] }),
|
|
20122
|
-
history?.enabled !== false && /* @__PURE__ */
|
|
20123
|
-
/* @__PURE__ */
|
|
20124
|
-
/* @__PURE__ */
|
|
20439
|
+
history?.enabled !== false && /* @__PURE__ */ jsxs42(Fragment11, { children: [
|
|
20440
|
+
/* @__PURE__ */ jsxs42(Tooltip, { children: [
|
|
20441
|
+
/* @__PURE__ */ jsx60(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx60("span", { className: "inline-flex h-8 w-8", children: /* @__PURE__ */ jsx60(
|
|
20125
20442
|
"button",
|
|
20126
20443
|
{
|
|
20127
20444
|
type: "button",
|
|
@@ -20134,12 +20451,12 @@ function Chat({
|
|
|
20134
20451
|
"disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed"
|
|
20135
20452
|
),
|
|
20136
20453
|
"aria-label": t("history.newThread"),
|
|
20137
|
-
children: /* @__PURE__ */
|
|
20454
|
+
children: /* @__PURE__ */ jsx60(Pencil4, { size: 16 })
|
|
20138
20455
|
}
|
|
20139
20456
|
) }) }),
|
|
20140
|
-
/* @__PURE__ */
|
|
20457
|
+
/* @__PURE__ */ jsx60(TooltipContent, { side: "bottom", children: t("history.newThread") })
|
|
20141
20458
|
] }),
|
|
20142
|
-
/* @__PURE__ */
|
|
20459
|
+
/* @__PURE__ */ jsx60(
|
|
20143
20460
|
HistorySidebar,
|
|
20144
20461
|
{
|
|
20145
20462
|
threads,
|
|
@@ -20158,7 +20475,7 @@ function Chat({
|
|
|
20158
20475
|
]
|
|
20159
20476
|
}
|
|
20160
20477
|
),
|
|
20161
|
-
showMessageNavigation && /* @__PURE__ */
|
|
20478
|
+
showMessageNavigation && /* @__PURE__ */ jsx60(
|
|
20162
20479
|
MessageNavigator,
|
|
20163
20480
|
{
|
|
20164
20481
|
items: messageNavigationItems,
|
|
@@ -20169,18 +20486,18 @@ function Chat({
|
|
|
20169
20486
|
tagsOverflowLabel: (count) => t("message.navigation.moreTags", { count })
|
|
20170
20487
|
}
|
|
20171
20488
|
),
|
|
20172
|
-
/* @__PURE__ */
|
|
20489
|
+
/* @__PURE__ */ jsxs42(
|
|
20173
20490
|
"div",
|
|
20174
20491
|
{
|
|
20175
20492
|
"data-slot": "chatkit-chat-content",
|
|
20176
20493
|
className: "mx-auto w-full flex-1 p-4",
|
|
20177
20494
|
style: chatColumnStyle,
|
|
20178
20495
|
children: [
|
|
20179
|
-
errorMessage && /* @__PURE__ */
|
|
20180
|
-
historyError && /* @__PURE__ */
|
|
20181
|
-
showMissingConfig && /* @__PURE__ */
|
|
20182
|
-
isHistoryLoading && /* @__PURE__ */
|
|
20183
|
-
messages.length === 0 && !canLoadMoreMessages ? /* @__PURE__ */
|
|
20496
|
+
errorMessage && /* @__PURE__ */ jsx60("div", { className: "mb-4 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive", children: errorMessage }),
|
|
20497
|
+
historyError && /* @__PURE__ */ jsx60("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: historyError }),
|
|
20498
|
+
showMissingConfig && /* @__PURE__ */ jsx60("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: missingConfigDetailMessage }),
|
|
20499
|
+
isHistoryLoading && /* @__PURE__ */ jsx60("div", { className: "mb-4 rounded-lg border border-muted px-3 py-2 text-sm text-muted-foreground", children: t("chat.loadingThread") }),
|
|
20500
|
+
messages.length === 0 && !canLoadMoreMessages ? /* @__PURE__ */ jsx60(
|
|
20184
20501
|
StartScreen,
|
|
20185
20502
|
{
|
|
20186
20503
|
startScreen,
|
|
@@ -20189,10 +20506,10 @@ function Chat({
|
|
|
20189
20506
|
promptSendDisabled: isSubmissionBlocked,
|
|
20190
20507
|
promptEditDisabled: isPromptEditDisabled
|
|
20191
20508
|
}
|
|
20192
|
-
) : /* @__PURE__ */
|
|
20193
|
-
canLoadMoreMessages && /* @__PURE__ */
|
|
20194
|
-
/* @__PURE__ */
|
|
20195
|
-
/* @__PURE__ */
|
|
20509
|
+
) : /* @__PURE__ */ jsxs42("div", { className: "space-y-4", children: [
|
|
20510
|
+
canLoadMoreMessages && /* @__PURE__ */ jsxs42("div", { className: "flex items-center gap-3 py-1", children: [
|
|
20511
|
+
/* @__PURE__ */ jsx60("div", { className: "h-px min-w-8 flex-1 bg-border" }),
|
|
20512
|
+
/* @__PURE__ */ jsx60(
|
|
20196
20513
|
Button,
|
|
20197
20514
|
{
|
|
20198
20515
|
type: "button",
|
|
@@ -20204,7 +20521,7 @@ function Chat({
|
|
|
20204
20521
|
children: isLoadingMoreMessages ? t("chat.loadingMoreMessages") : t("chat.loadMoreMessages")
|
|
20205
20522
|
}
|
|
20206
20523
|
),
|
|
20207
|
-
/* @__PURE__ */
|
|
20524
|
+
/* @__PURE__ */ jsx60("div", { className: "h-px min-w-8 flex-1 bg-border" })
|
|
20208
20525
|
] }),
|
|
20209
20526
|
messages.map((message, index) => {
|
|
20210
20527
|
const messageType = String(message.type);
|
|
@@ -20248,7 +20565,7 @@ function Chat({
|
|
|
20248
20565
|
if (!isAssistantMessage && !hasPlainRenderableContent && !hasHumanAttachments && humanRuntimeCapabilityOptions.length === 0 && humanReferences.length === 0) {
|
|
20249
20566
|
return null;
|
|
20250
20567
|
}
|
|
20251
|
-
return /* @__PURE__ */
|
|
20568
|
+
return /* @__PURE__ */ jsx60(
|
|
20252
20569
|
"div",
|
|
20253
20570
|
{
|
|
20254
20571
|
ref: (node) => setMessageNavigationAnchor(messageNavigationId, node),
|
|
@@ -20258,7 +20575,7 @@ function Chat({
|
|
|
20258
20575
|
message.type === "human" ? "justify-end" : "justify-start -ml-1"
|
|
20259
20576
|
// AI messages: slightly closer to left
|
|
20260
20577
|
),
|
|
20261
|
-
children: /* @__PURE__ */
|
|
20578
|
+
children: /* @__PURE__ */ jsxs42(
|
|
20262
20579
|
"div",
|
|
20263
20580
|
{
|
|
20264
20581
|
className: cn(
|
|
@@ -20266,7 +20583,7 @@ function Chat({
|
|
|
20266
20583
|
isAssistantMessage && "min-w-0 flex-1"
|
|
20267
20584
|
),
|
|
20268
20585
|
children: [
|
|
20269
|
-
/* @__PURE__ */
|
|
20586
|
+
/* @__PURE__ */ jsx60(
|
|
20270
20587
|
"div",
|
|
20271
20588
|
{
|
|
20272
20589
|
...canQuoteMessage ? {
|
|
@@ -20278,7 +20595,7 @@ function Chat({
|
|
|
20278
20595
|
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"
|
|
20279
20596
|
// AI messages: use chat-specific foreground color
|
|
20280
20597
|
),
|
|
20281
|
-
children: isAssistantMessage ? /* @__PURE__ */
|
|
20598
|
+
children: isAssistantMessage ? /* @__PURE__ */ jsx60(
|
|
20282
20599
|
AssistantMessage,
|
|
20283
20600
|
{
|
|
20284
20601
|
message: {
|
|
@@ -20298,14 +20615,14 @@ function Chat({
|
|
|
20298
20615
|
apiUrl: stream.apiUrl,
|
|
20299
20616
|
pet: effectivePet
|
|
20300
20617
|
}
|
|
20301
|
-
) : /* @__PURE__ */
|
|
20302
|
-
message.type === "human" && humanRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */
|
|
20618
|
+
) : /* @__PURE__ */ jsxs42(Fragment11, { children: [
|
|
20619
|
+
message.type === "human" && humanRuntimeCapabilityOptions.length > 0 && /* @__PURE__ */ jsx60(
|
|
20303
20620
|
HumanRuntimeCapabilityChips,
|
|
20304
20621
|
{
|
|
20305
20622
|
options: humanRuntimeCapabilityOptions
|
|
20306
20623
|
}
|
|
20307
20624
|
),
|
|
20308
|
-
message.type === "human" && humanReferences.length > 0 && /* @__PURE__ */
|
|
20625
|
+
message.type === "human" && humanReferences.length > 0 && /* @__PURE__ */ jsx60("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanReferences.map((reference) => /* @__PURE__ */ jsx60(
|
|
20309
20626
|
ReferenceChip,
|
|
20310
20627
|
{
|
|
20311
20628
|
reference,
|
|
@@ -20313,29 +20630,29 @@ function Chat({
|
|
|
20313
20630
|
},
|
|
20314
20631
|
getReferenceKey(reference)
|
|
20315
20632
|
)) }),
|
|
20316
|
-
message.type === "human" && humanAttachments.length > 0 && /* @__PURE__ */
|
|
20633
|
+
message.type === "human" && humanAttachments.length > 0 && /* @__PURE__ */ jsx60("div", { className: "flex flex-wrap gap-1.5 mb-2", children: humanAttachments.map((file, fileIndex) => /* @__PURE__ */ jsxs42(
|
|
20317
20634
|
"div",
|
|
20318
20635
|
{
|
|
20319
20636
|
className: "flex items-center gap-1.5 rounded-md bg-primary-foreground/20 px-2 py-1 text-xs",
|
|
20320
20637
|
children: [
|
|
20321
|
-
/* @__PURE__ */
|
|
20322
|
-
/* @__PURE__ */
|
|
20638
|
+
/* @__PURE__ */ jsx60(FileText5, { size: 12 }),
|
|
20639
|
+
/* @__PURE__ */ jsx60("span", { className: "max-w-[100px] truncate", children: file.originalName ?? file.id })
|
|
20323
20640
|
]
|
|
20324
20641
|
},
|
|
20325
20642
|
fileIndex
|
|
20326
20643
|
)) }),
|
|
20327
|
-
Array.isArray(message.content) ? message.content.map((part, partIndex) => /* @__PURE__ */
|
|
20644
|
+
Array.isArray(message.content) ? message.content.map((part, partIndex) => /* @__PURE__ */ jsx60(
|
|
20328
20645
|
"p",
|
|
20329
20646
|
{
|
|
20330
20647
|
className: "wrap-break-word text-sm leading-relaxed",
|
|
20331
20648
|
children: formatMessageContent(part)
|
|
20332
20649
|
},
|
|
20333
20650
|
`${part.type}-${partIndex}`
|
|
20334
|
-
)) : /* @__PURE__ */
|
|
20651
|
+
)) : /* @__PURE__ */ jsx60("span", { className: "wrap-break-word text-sm leading-relaxed", children: formatMessageContent(message.content) })
|
|
20335
20652
|
] })
|
|
20336
20653
|
}
|
|
20337
20654
|
),
|
|
20338
|
-
/* @__PURE__ */
|
|
20655
|
+
/* @__PURE__ */ jsx60(
|
|
20339
20656
|
MessageActions,
|
|
20340
20657
|
{
|
|
20341
20658
|
content: messageContent,
|
|
@@ -20373,7 +20690,7 @@ function Chat({
|
|
|
20373
20690
|
stream.isLoading,
|
|
20374
20691
|
{ now: streamingNow }
|
|
20375
20692
|
);
|
|
20376
|
-
return /* @__PURE__ */
|
|
20693
|
+
return /* @__PURE__ */ jsx60("div", { className: "flex justify-start gap-3 -ml-2", children: /* @__PURE__ */ jsx60("div", { className: "max-w-full rounded-2xl py-2.5", children: /* @__PURE__ */ jsx60(
|
|
20377
20694
|
AssistantStreamingIndicator,
|
|
20378
20695
|
{
|
|
20379
20696
|
status: fallbackStreamingStatus ?? "loading"
|
|
@@ -20384,7 +20701,7 @@ function Chat({
|
|
|
20384
20701
|
]
|
|
20385
20702
|
}
|
|
20386
20703
|
),
|
|
20387
|
-
!isAtBottom && messages.length > 0 && /* @__PURE__ */
|
|
20704
|
+
!isAtBottom && messages.length > 0 && /* @__PURE__ */ jsx60("div", { className: "sticky bottom-20 z-20 flex justify-center px-4 pointer-events-none", children: /* @__PURE__ */ jsx60(
|
|
20388
20705
|
Button,
|
|
20389
20706
|
{
|
|
20390
20707
|
type: "button",
|
|
@@ -20397,10 +20714,10 @@ function Chat({
|
|
|
20397
20714
|
onClick: () => scrollToBottom(true, true),
|
|
20398
20715
|
"aria-label": t("chat.scrollToBottom"),
|
|
20399
20716
|
title: t("chat.scrollToBottom"),
|
|
20400
|
-
children: /* @__PURE__ */
|
|
20717
|
+
children: /* @__PURE__ */ jsx60(ArrowDown2, { size: 16 })
|
|
20401
20718
|
}
|
|
20402
20719
|
) }),
|
|
20403
|
-
quoteSelection && /* @__PURE__ */
|
|
20720
|
+
quoteSelection && /* @__PURE__ */ jsx60(
|
|
20404
20721
|
"div",
|
|
20405
20722
|
{
|
|
20406
20723
|
className: "pointer-events-none fixed z-50",
|
|
@@ -20409,7 +20726,7 @@ function Chat({
|
|
|
20409
20726
|
left: `${quoteSelection.left}px`,
|
|
20410
20727
|
transform: "translateX(-50%)"
|
|
20411
20728
|
},
|
|
20412
|
-
children: /* @__PURE__ */
|
|
20729
|
+
children: /* @__PURE__ */ jsxs42(
|
|
20413
20730
|
Button,
|
|
20414
20731
|
{
|
|
20415
20732
|
type: "button",
|
|
@@ -20421,22 +20738,22 @@ function Chat({
|
|
|
20421
20738
|
"aria-label": t("composer.quoteSelection"),
|
|
20422
20739
|
title: t("composer.quoteSelection"),
|
|
20423
20740
|
children: [
|
|
20424
|
-
/* @__PURE__ */
|
|
20741
|
+
/* @__PURE__ */ jsx60(Quote, { size: 14 }),
|
|
20425
20742
|
t("composer.quoteSelection")
|
|
20426
20743
|
]
|
|
20427
20744
|
}
|
|
20428
20745
|
)
|
|
20429
20746
|
}
|
|
20430
20747
|
),
|
|
20431
|
-
/* @__PURE__ */
|
|
20748
|
+
/* @__PURE__ */ jsxs42(
|
|
20432
20749
|
"div",
|
|
20433
20750
|
{
|
|
20434
20751
|
"data-slot": "chatkit-chat-composer",
|
|
20435
20752
|
className: "mx-auto w-full p-2 sticky bottom-0 z-10 bg-background",
|
|
20436
20753
|
style: chatColumnStyle,
|
|
20437
20754
|
children: [
|
|
20438
|
-
threadErrorMessage && /* @__PURE__ */
|
|
20439
|
-
/* @__PURE__ */
|
|
20755
|
+
threadErrorMessage && /* @__PURE__ */ jsx60("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 }),
|
|
20756
|
+
/* @__PURE__ */ jsx60(
|
|
20440
20757
|
ChatAttachments,
|
|
20441
20758
|
{
|
|
20442
20759
|
ref: attachmentsRef,
|
|
@@ -20450,7 +20767,7 @@ function Chat({
|
|
|
20450
20767
|
onStateChange: setAttachmentState
|
|
20451
20768
|
}
|
|
20452
20769
|
),
|
|
20453
|
-
references.length > 0 && /* @__PURE__ */
|
|
20770
|
+
references.length > 0 && /* @__PURE__ */ jsx60("div", { className: "mb-3 flex flex-wrap gap-2", children: references.map((reference) => /* @__PURE__ */ jsx60(
|
|
20454
20771
|
ReferenceChip,
|
|
20455
20772
|
{
|
|
20456
20773
|
reference,
|
|
@@ -20464,7 +20781,7 @@ function Chat({
|
|
|
20464
20781
|
},
|
|
20465
20782
|
getReferenceKey(reference)
|
|
20466
20783
|
)) }),
|
|
20467
|
-
/* @__PURE__ */
|
|
20784
|
+
/* @__PURE__ */ jsx60(
|
|
20468
20785
|
DetachedRunRuntimeCapabilities,
|
|
20469
20786
|
{
|
|
20470
20787
|
options: detachedRunRuntimeCapabilityOptions,
|
|
@@ -20473,7 +20790,7 @@ function Chat({
|
|
|
20473
20790
|
onRemove: removeRunRuntimeCapability
|
|
20474
20791
|
}
|
|
20475
20792
|
),
|
|
20476
|
-
showGoalStatus && /* @__PURE__ */
|
|
20793
|
+
showGoalStatus && /* @__PURE__ */ jsxs42(
|
|
20477
20794
|
"div",
|
|
20478
20795
|
{
|
|
20479
20796
|
className: cn(
|
|
@@ -20481,7 +20798,7 @@ function Chat({
|
|
|
20481
20798
|
isGoalObjectiveExpanded ? "items-start" : "items-center"
|
|
20482
20799
|
),
|
|
20483
20800
|
children: [
|
|
20484
|
-
/* @__PURE__ */
|
|
20801
|
+
/* @__PURE__ */ jsx60(
|
|
20485
20802
|
Target3,
|
|
20486
20803
|
{
|
|
20487
20804
|
className: cn(
|
|
@@ -20490,13 +20807,13 @@ function Chat({
|
|
|
20490
20807
|
)
|
|
20491
20808
|
}
|
|
20492
20809
|
),
|
|
20493
|
-
/* @__PURE__ */
|
|
20494
|
-
/* @__PURE__ */
|
|
20495
|
-
/* @__PURE__ */
|
|
20496
|
-
threadGoal && /* @__PURE__ */
|
|
20497
|
-
isGoalLoading && /* @__PURE__ */
|
|
20810
|
+
/* @__PURE__ */ jsxs42("div", { className: "min-w-0 flex-1", children: [
|
|
20811
|
+
/* @__PURE__ */ jsxs42("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
20812
|
+
/* @__PURE__ */ jsx60("span", { className: "font-medium", children: t("chat.goal.label") }),
|
|
20813
|
+
threadGoal && /* @__PURE__ */ jsx60("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}`) }),
|
|
20814
|
+
isGoalLoading && /* @__PURE__ */ jsx60(Loader212, { className: "size-3 animate-spin text-muted-foreground" })
|
|
20498
20815
|
] }),
|
|
20499
|
-
/* @__PURE__ */
|
|
20816
|
+
/* @__PURE__ */ jsx60(
|
|
20500
20817
|
"div",
|
|
20501
20818
|
{
|
|
20502
20819
|
className: cn(
|
|
@@ -20506,13 +20823,13 @@ function Chat({
|
|
|
20506
20823
|
children: goalError || threadGoal?.objective
|
|
20507
20824
|
}
|
|
20508
20825
|
),
|
|
20509
|
-
threadGoal && /* @__PURE__ */
|
|
20826
|
+
threadGoal && /* @__PURE__ */ jsx60("div", { className: "mt-1 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-muted-foreground", children: /* @__PURE__ */ jsx60("span", { children: t("chat.goal.elapsed", {
|
|
20510
20827
|
elapsed: formatGoalElapsed(displayedGoalElapsedSeconds)
|
|
20511
20828
|
}) }) })
|
|
20512
20829
|
] }),
|
|
20513
|
-
threadGoal && /* @__PURE__ */
|
|
20514
|
-
/* @__PURE__ */
|
|
20515
|
-
/* @__PURE__ */
|
|
20830
|
+
threadGoal && /* @__PURE__ */ jsxs42("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
20831
|
+
/* @__PURE__ */ jsxs42(Tooltip, { children: [
|
|
20832
|
+
/* @__PURE__ */ jsx60(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx60(
|
|
20516
20833
|
Button,
|
|
20517
20834
|
{
|
|
20518
20835
|
type: "button",
|
|
@@ -20523,13 +20840,13 @@ function Chat({
|
|
|
20523
20840
|
const prefix = "/goal edit ";
|
|
20524
20841
|
setComposerText(`${prefix}${threadGoal.objective}`);
|
|
20525
20842
|
},
|
|
20526
|
-
children: /* @__PURE__ */
|
|
20843
|
+
children: /* @__PURE__ */ jsx60(Pencil4, { className: "size-3" })
|
|
20527
20844
|
}
|
|
20528
20845
|
) }),
|
|
20529
|
-
/* @__PURE__ */
|
|
20846
|
+
/* @__PURE__ */ jsx60(TooltipContent, { children: t("chat.goal.edit") })
|
|
20530
20847
|
] }),
|
|
20531
|
-
/* @__PURE__ */
|
|
20532
|
-
/* @__PURE__ */
|
|
20848
|
+
/* @__PURE__ */ jsxs42(Tooltip, { children: [
|
|
20849
|
+
/* @__PURE__ */ jsx60(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx60(
|
|
20533
20850
|
Button,
|
|
20534
20851
|
{
|
|
20535
20852
|
type: "button",
|
|
@@ -20545,13 +20862,13 @@ function Chat({
|
|
|
20545
20862
|
executionType: "insert_invocation"
|
|
20546
20863
|
}
|
|
20547
20864
|
}),
|
|
20548
|
-
children: threadGoal.status === "paused" ? /* @__PURE__ */
|
|
20865
|
+
children: threadGoal.status === "paused" ? /* @__PURE__ */ jsx60(Play, { className: "size-3" }) : /* @__PURE__ */ jsx60(Pause, { className: "size-3" })
|
|
20549
20866
|
}
|
|
20550
20867
|
) }),
|
|
20551
|
-
/* @__PURE__ */
|
|
20868
|
+
/* @__PURE__ */ jsx60(TooltipContent, { children: threadGoal.status === "paused" ? t("chat.goal.resume") : t("chat.goal.pause") })
|
|
20552
20869
|
] }),
|
|
20553
|
-
/* @__PURE__ */
|
|
20554
|
-
/* @__PURE__ */
|
|
20870
|
+
/* @__PURE__ */ jsxs42(Tooltip, { children: [
|
|
20871
|
+
/* @__PURE__ */ jsx60(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx60(
|
|
20555
20872
|
Button,
|
|
20556
20873
|
{
|
|
20557
20874
|
type: "button",
|
|
@@ -20567,13 +20884,13 @@ function Chat({
|
|
|
20567
20884
|
executionType: "insert_invocation"
|
|
20568
20885
|
}
|
|
20569
20886
|
}),
|
|
20570
|
-
children: /* @__PURE__ */
|
|
20887
|
+
children: /* @__PURE__ */ jsx60(Trash23, { className: "size-3" })
|
|
20571
20888
|
}
|
|
20572
20889
|
) }),
|
|
20573
|
-
/* @__PURE__ */
|
|
20890
|
+
/* @__PURE__ */ jsx60(TooltipContent, { children: t("chat.goal.clear") })
|
|
20574
20891
|
] }),
|
|
20575
|
-
threadGoal.objective && !goalError && /* @__PURE__ */
|
|
20576
|
-
/* @__PURE__ */
|
|
20892
|
+
threadGoal.objective && !goalError && /* @__PURE__ */ jsxs42(Tooltip, { children: [
|
|
20893
|
+
/* @__PURE__ */ jsx60(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx60(
|
|
20577
20894
|
Button,
|
|
20578
20895
|
{
|
|
20579
20896
|
type: "button",
|
|
@@ -20582,7 +20899,7 @@ function Chat({
|
|
|
20582
20899
|
"aria-expanded": isGoalObjectiveExpanded,
|
|
20583
20900
|
"aria-label": isGoalObjectiveExpanded ? t("chat.goal.collapseObjective") : t("chat.goal.expandObjective"),
|
|
20584
20901
|
onClick: () => setIsGoalObjectiveExpanded((expanded) => !expanded),
|
|
20585
|
-
children: /* @__PURE__ */
|
|
20902
|
+
children: /* @__PURE__ */ jsx60(
|
|
20586
20903
|
ChevronDown5,
|
|
20587
20904
|
{
|
|
20588
20905
|
className: cn(
|
|
@@ -20593,13 +20910,13 @@ function Chat({
|
|
|
20593
20910
|
)
|
|
20594
20911
|
}
|
|
20595
20912
|
) }),
|
|
20596
|
-
/* @__PURE__ */
|
|
20913
|
+
/* @__PURE__ */ jsx60(TooltipContent, { children: isGoalObjectiveExpanded ? t("chat.goal.collapseObjective") : t("chat.goal.expandObjective") })
|
|
20597
20914
|
] })
|
|
20598
20915
|
] })
|
|
20599
20916
|
]
|
|
20600
20917
|
}
|
|
20601
20918
|
),
|
|
20602
|
-
/* @__PURE__ */
|
|
20919
|
+
/* @__PURE__ */ jsx60(
|
|
20603
20920
|
PendingRuntimeServices,
|
|
20604
20921
|
{
|
|
20605
20922
|
state: stream.runtimeActivities.sandboxServices,
|
|
@@ -20608,7 +20925,7 @@ function Chat({
|
|
|
20608
20925
|
className: hasPendingTodos || hasPendingFollowUps ? "mb-2" : void 0
|
|
20609
20926
|
}
|
|
20610
20927
|
),
|
|
20611
|
-
/* @__PURE__ */
|
|
20928
|
+
/* @__PURE__ */ jsx60(
|
|
20612
20929
|
PendingTodos,
|
|
20613
20930
|
{
|
|
20614
20931
|
snapshot: stream.todos,
|
|
@@ -20616,7 +20933,7 @@ function Chat({
|
|
|
20616
20933
|
className: hasPendingFollowUps ? "mb-2" : void 0
|
|
20617
20934
|
}
|
|
20618
20935
|
),
|
|
20619
|
-
/* @__PURE__ */
|
|
20936
|
+
/* @__PURE__ */ jsx60(
|
|
20620
20937
|
PendingFollowUps,
|
|
20621
20938
|
{
|
|
20622
20939
|
items: pendingFollowUps,
|
|
@@ -20629,7 +20946,7 @@ function Chat({
|
|
|
20629
20946
|
attachToComposer: true
|
|
20630
20947
|
}
|
|
20631
20948
|
),
|
|
20632
|
-
/* @__PURE__ */
|
|
20949
|
+
/* @__PURE__ */ jsx60(
|
|
20633
20950
|
RequestUserInputPanel,
|
|
20634
20951
|
{
|
|
20635
20952
|
request: stream.pendingRequestUserInput,
|
|
@@ -20638,7 +20955,7 @@ function Chat({
|
|
|
20638
20955
|
attachToComposer: true
|
|
20639
20956
|
}
|
|
20640
20957
|
),
|
|
20641
|
-
/* @__PURE__ */
|
|
20958
|
+
/* @__PURE__ */ jsx60(
|
|
20642
20959
|
HITLApprovalPanel,
|
|
20643
20960
|
{
|
|
20644
20961
|
request: stream.pendingHITLRequest,
|
|
@@ -20647,7 +20964,7 @@ function Chat({
|
|
|
20647
20964
|
attachToComposer: true
|
|
20648
20965
|
}
|
|
20649
20966
|
),
|
|
20650
|
-
runtimeCapabilityPalette && /* @__PURE__ */
|
|
20967
|
+
runtimeCapabilityPalette && /* @__PURE__ */ jsx60(
|
|
20651
20968
|
SlashPalette,
|
|
20652
20969
|
{
|
|
20653
20970
|
palette: runtimeCapabilityPalette,
|
|
@@ -20661,7 +20978,7 @@ function Chat({
|
|
|
20661
20978
|
onSelect: selectSlashPaletteOption
|
|
20662
20979
|
}
|
|
20663
20980
|
),
|
|
20664
|
-
/* @__PURE__ */
|
|
20981
|
+
/* @__PURE__ */ jsx60("form", { className: "flex items-end", onSubmit: handleSubmit, children: /* @__PURE__ */ jsxs42(
|
|
20665
20982
|
"div",
|
|
20666
20983
|
{
|
|
20667
20984
|
"data-slot": "composer-input-shell",
|
|
@@ -20675,7 +20992,7 @@ function Chat({
|
|
|
20675
20992
|
composerInputRoundedClass
|
|
20676
20993
|
),
|
|
20677
20994
|
children: [
|
|
20678
|
-
/* @__PURE__ */
|
|
20995
|
+
/* @__PURE__ */ jsx60(
|
|
20679
20996
|
"div",
|
|
20680
20997
|
{
|
|
20681
20998
|
ref: composerInputRef,
|
|
@@ -20697,19 +21014,19 @@ function Chat({
|
|
|
20697
21014
|
(missingConfig || isHistoryLoading || hasPendingInteractiveRequest) && "cursor-not-allowed opacity-50"
|
|
20698
21015
|
),
|
|
20699
21016
|
children: renderedComposerParts.map(
|
|
20700
|
-
(part, index) => part.type === "text" ? /* @__PURE__ */
|
|
21017
|
+
(part, index) => part.type === "text" ? /* @__PURE__ */ jsx60(React56.Fragment, { children: part.text }, `text-${index}`) : /* @__PURE__ */ jsx60(ComposerCapabilityToken, { part }, part.key)
|
|
20701
21018
|
)
|
|
20702
21019
|
},
|
|
20703
21020
|
composerDomVersion
|
|
20704
21021
|
),
|
|
20705
|
-
/* @__PURE__ */
|
|
21022
|
+
/* @__PURE__ */ jsxs42(
|
|
20706
21023
|
"div",
|
|
20707
21024
|
{
|
|
20708
21025
|
"data-slot": "composer-action-bar",
|
|
20709
21026
|
className: "pointer-events-none absolute inset-x-1.5 bottom-1 flex min-h-10 items-center justify-between gap-2",
|
|
20710
21027
|
children: [
|
|
20711
|
-
/* @__PURE__ */
|
|
20712
|
-
/* @__PURE__ */
|
|
21028
|
+
/* @__PURE__ */ jsxs42("div", { className: "pointer-events-none flex min-w-0 flex-1 items-center gap-1.5", children: [
|
|
21029
|
+
/* @__PURE__ */ jsx60("div", { className: "pointer-events-auto flex shrink-0 items-center gap-1.5", children: /* @__PURE__ */ jsx60(
|
|
20713
21030
|
ComposerMenu,
|
|
20714
21031
|
{
|
|
20715
21032
|
composer,
|
|
@@ -20727,20 +21044,20 @@ function Chat({
|
|
|
20727
21044
|
disabled: missingConfig || isHistoryLoading || hasPendingInteractiveRequest
|
|
20728
21045
|
}
|
|
20729
21046
|
) }),
|
|
20730
|
-
selectedTool && /* @__PURE__ */
|
|
20731
|
-
/* @__PURE__ */
|
|
20732
|
-
/* @__PURE__ */
|
|
21047
|
+
selectedTool && /* @__PURE__ */ jsxs42("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: [
|
|
21048
|
+
/* @__PURE__ */ jsx60("span", { className: "truncate", children: selectedTool.shortLabel ?? selectedTool.label }),
|
|
21049
|
+
/* @__PURE__ */ jsx60(
|
|
20733
21050
|
"button",
|
|
20734
21051
|
{
|
|
20735
21052
|
type: "button",
|
|
20736
21053
|
onClick: () => setSelectedTool(null),
|
|
20737
21054
|
className: "shrink-0 rounded-full p-0.5 text-primary/70 hover:bg-primary/10 hover:text-primary",
|
|
20738
|
-
children: /* @__PURE__ */
|
|
21055
|
+
children: /* @__PURE__ */ jsx60(X10, { size: 12 })
|
|
20739
21056
|
}
|
|
20740
21057
|
)
|
|
20741
21058
|
] })
|
|
20742
21059
|
] }),
|
|
20743
|
-
/* @__PURE__ */
|
|
21060
|
+
/* @__PURE__ */ jsx60("div", { className: "pointer-events-auto shrink-0", children: /* @__PURE__ */ jsx60(
|
|
20744
21061
|
SendButton,
|
|
20745
21062
|
{
|
|
20746
21063
|
disabled: isSendDisabled,
|
|
@@ -20763,7 +21080,7 @@ function Chat({
|
|
|
20763
21080
|
]
|
|
20764
21081
|
}
|
|
20765
21082
|
) }),
|
|
20766
|
-
disclaimer?.text && /* @__PURE__ */
|
|
21083
|
+
disclaimer?.text && /* @__PURE__ */ jsx60(
|
|
20767
21084
|
"p",
|
|
20768
21085
|
{
|
|
20769
21086
|
className: cn(
|
|
@@ -20773,14 +21090,14 @@ function Chat({
|
|
|
20773
21090
|
children: disclaimer.text
|
|
20774
21091
|
}
|
|
20775
21092
|
),
|
|
20776
|
-
/* @__PURE__ */
|
|
20777
|
-
/* @__PURE__ */
|
|
20778
|
-
/* @__PURE__ */
|
|
21093
|
+
/* @__PURE__ */ jsxs42("div", { className: "mt-2 flex items-center justify-center gap-2 text-xs text-muted-foreground", children: [
|
|
21094
|
+
/* @__PURE__ */ jsx60("span", { children: t("chat.poweredBy") }),
|
|
21095
|
+
/* @__PURE__ */ jsx60(ContextUsageIndicator, { className: "absolute right-4" })
|
|
20779
21096
|
] })
|
|
20780
21097
|
]
|
|
20781
21098
|
}
|
|
20782
21099
|
),
|
|
20783
|
-
/* @__PURE__ */
|
|
21100
|
+
/* @__PURE__ */ jsx60(
|
|
20784
21101
|
SettingsSheet,
|
|
20785
21102
|
{
|
|
20786
21103
|
open: petSettingsOpen,
|
|
@@ -20790,11 +21107,11 @@ function Chat({
|
|
|
20790
21107
|
onSave: savePetLocalSettings
|
|
20791
21108
|
}
|
|
20792
21109
|
),
|
|
20793
|
-
/* @__PURE__ */
|
|
21110
|
+
/* @__PURE__ */ jsx60(PetBridge, { pet: effectivePet, state: petAutoState })
|
|
20794
21111
|
]
|
|
20795
21112
|
}
|
|
20796
21113
|
),
|
|
20797
|
-
taskSummaryAvailable && taskSummaryDocked && taskSummaryOpen && /* @__PURE__ */
|
|
21114
|
+
taskSummaryAvailable && taskSummaryDocked && taskSummaryOpen && /* @__PURE__ */ jsx60("div", { className: "pointer-events-none absolute right-5 top-3 z-20 max-h-[calc(100%-1.5rem)] w-80", children: /* @__PURE__ */ jsx60(
|
|
20798
21115
|
TaskSummaryPanel,
|
|
20799
21116
|
{
|
|
20800
21117
|
...taskSummaryProps,
|
|
@@ -20807,10 +21124,10 @@ function Chat({
|
|
|
20807
21124
|
}
|
|
20808
21125
|
|
|
20809
21126
|
// src/components/ui/separator.tsx
|
|
20810
|
-
import * as
|
|
20811
|
-
import { jsx as
|
|
20812
|
-
var Separator =
|
|
20813
|
-
({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */
|
|
21127
|
+
import * as React57 from "react";
|
|
21128
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
21129
|
+
var Separator = React57.forwardRef(
|
|
21130
|
+
({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */ jsx61(
|
|
20814
21131
|
"div",
|
|
20815
21132
|
{
|
|
20816
21133
|
ref,
|