@mcp-use/inspector 0.18.9-canary.0 → 0.18.9
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/client/index.js +43 -43
- package/dist/web/assets/{1c-CmybTtrn.js → 1c-CLxqeB8M.js} +1 -1
- package/dist/web/assets/{abnf-0lCGjkvU.js → abnf-BAMyIhu2.js} +1 -1
- package/dist/web/assets/{accesslog-B2FjO8F9.js → accesslog-dkOhB9yb.js} +1 -1
- package/dist/web/assets/{actionscript-N6kuB9_0.js → actionscript-Bot5jY3F.js} +1 -1
- package/dist/web/assets/{ada-D6bEz7Gn.js → ada-DVGp4Cxs.js} +1 -1
- package/dist/web/assets/{angelscript-DRJRdJ1Z.js → angelscript-BsRgEcej.js} +1 -1
- package/dist/web/assets/{apache-CFCY4tkC.js → apache-Cxlm4eJ-.js} +1 -1
- package/dist/web/assets/{applescript-D80NkLw-.js → applescript-afhHpumr.js} +1 -1
- package/dist/web/assets/{arcade-DIqlhgXd.js → arcade-CgvokW1Q.js} +1 -1
- package/dist/web/assets/{arduino-C9hlpMX-.js → arduino-KvCFSaJ-.js} +1 -1
- package/dist/web/assets/{armasm-BPB-y7CR.js → armasm-BYi4-bRr.js} +1 -1
- package/dist/web/assets/{asciidoc-CVcdheEX.js → asciidoc-D2ztEPWn.js} +1 -1
- package/dist/web/assets/{aspectj-B-JLtT2q.js → aspectj-C_gj8MiZ.js} +1 -1
- package/dist/web/assets/{autohotkey-D4U44iBV.js → autohotkey-BmGMepGt.js} +1 -1
- package/dist/web/assets/{autoit-DBXJj1-s.js → autoit-BWpVeTVE.js} +1 -1
- package/dist/web/assets/{avrasm-basuaVJQ.js → avrasm-BwM6yLuy.js} +1 -1
- package/dist/web/assets/{awk-vm07EeXA.js → awk-Bc5Iaq6L.js} +1 -1
- package/dist/web/assets/{axapta-DYJSDqnC.js → axapta-CQnSMcu0.js} +1 -1
- package/dist/web/assets/{bash-CevIOKOe.js → bash-nAVRkVV_.js} +1 -1
- package/dist/web/assets/{basic-rU1A3vbr.js → basic-DNIDflJm.js} +1 -1
- package/dist/web/assets/{bnf-DR63OqM5.js → bnf-C2LviGRf.js} +1 -1
- package/dist/web/assets/{brainfuck-CA9FZWZz.js → brainfuck-BqmO4zf2.js} +1 -1
- package/dist/web/assets/{browser-BPXJ3c2F.js → browser-74oXgNn8.js} +3 -3
- package/dist/web/assets/{c-DVir1pVF.js → c-C2g09a5e.js} +1 -1
- package/dist/web/assets/{c-like-CE8wxAQ5.js → c-like-DeaIQfda.js} +1 -1
- package/dist/web/assets/{cal-XXsEtkOM.js → cal-DO0Lf7RY.js} +1 -1
- package/dist/web/assets/{capnproto-DXpaxIxC.js → capnproto-Bxpzspue.js} +1 -1
- package/dist/web/assets/{ceylon-CdTwVsPo.js → ceylon-CotwXTNz.js} +1 -1
- package/dist/web/assets/{clean-CbrYB3Rs.js → clean-CNXi1oRD.js} +1 -1
- package/dist/web/assets/{client-Df3g4LG4.js → client-CPcfUEPp.js} +1 -1
- package/dist/web/assets/{clojure-BqOLR-t3.js → clojure-CQyiQ0Yj.js} +1 -1
- package/dist/web/assets/{clojure-repl-DXq57AK_.js → clojure-repl-fUv2acS1.js} +1 -1
- package/dist/web/assets/{cmake-CuW8CxTK.js → cmake-Ceb5-r5F.js} +1 -1
- package/dist/web/assets/{coffeescript-Bq77nME_.js → coffeescript-HL3yisbA.js} +1 -1
- package/dist/web/assets/{coq--DWO5y75.js → coq-CFcSKZLh.js} +1 -1
- package/dist/web/assets/{core-OpJNmuY7.js → core-DAPq3hDX.js} +1 -1
- package/dist/web/assets/{cos-CQkGqyYZ.js → cos-nWxDz_He.js} +1 -1
- package/dist/web/assets/{cpp-BVSZP4v0.js → cpp-Bc10eb3F.js} +1 -1
- package/dist/web/assets/{crmsh-NgaprBql.js → crmsh-vuGmRMs-.js} +1 -1
- package/dist/web/assets/{crystal-D0-tybzb.js → crystal-V-kfJNtk.js} +1 -1
- package/dist/web/assets/{csharp-DHIZ6C8F.js → csharp-DjihDoUf.js} +1 -1
- package/dist/web/assets/{csp-pTzAspXQ.js → csp-C-Ng9jQm.js} +1 -1
- package/dist/web/assets/{css-Bzud2koz.js → css--1ozVs7q.js} +1 -1
- package/dist/web/assets/{d-DjUfwBl0.js → d-DD3uOqjT.js} +1 -1
- package/dist/web/assets/{dart-tVnH564X.js → dart-Xas4W4Jw.js} +1 -1
- package/dist/web/assets/{delphi-Cjdvu1Mh.js → delphi-B-_apk9b.js} +1 -1
- package/dist/web/assets/{diff-CQHJOySz.js → diff-DnDu5meZ.js} +1 -1
- package/dist/web/assets/{display-A5IEINAP-qRAq_9MW.js → display-A5IEINAP-BoThkrNQ.js} +2 -2
- package/dist/web/assets/{django-3lGa2HNd.js → django-Cz0RxXup.js} +1 -1
- package/dist/web/assets/{dns-D3LhtSye.js → dns-xv2Ry-ey.js} +1 -1
- package/dist/web/assets/{dockerfile-Dqpzd32x.js → dockerfile-CiaDmX0W.js} +1 -1
- package/dist/web/assets/{dos-Bek11Xze.js → dos-CFhX0vBe.js} +1 -1
- package/dist/web/assets/{dsconfig-CFHHa2AC.js → dsconfig-ef0iv2n2.js} +1 -1
- package/dist/web/assets/{dts-C2c7-4T0.js → dts-DHEwaYfS.js} +1 -1
- package/dist/web/assets/{dust-I2gkPXtw.js → dust-FFlFQfvR.js} +1 -1
- package/dist/web/assets/{ebnf-BqW2-5VY.js → ebnf-Ck7qYvZI.js} +1 -1
- package/dist/web/assets/{elixir-DgNHqdEt.js → elixir-CK-PyMnm.js} +1 -1
- package/dist/web/assets/{elm-ZSSBQnue.js → elm-oypjHKOV.js} +1 -1
- package/dist/web/assets/{embeddings-B2cL9tmd.js → embeddings-BCCRUz2i.js} +1 -1
- package/dist/web/assets/{erb-AyGF6F98.js → erb-DpmTWK_8.js} +1 -1
- package/dist/web/assets/{erlang-D1FWCspK.js → erlang-BAQb9REd.js} +1 -1
- package/dist/web/assets/{erlang-repl-F2ybEkJb.js → erlang-repl-CUFEvA88.js} +1 -1
- package/dist/web/assets/{excel-CsXVfyFj.js → excel-B88YtyRZ.js} +1 -1
- package/dist/web/assets/{fix-BRfxxHLT.js → fix-DItskGc3.js} +1 -1
- package/dist/web/assets/{flix-f15DqiA8.js → flix-C9cfreow.js} +1 -1
- package/dist/web/assets/{fortran-BzI0cVED.js → fortran-Ch_U4C_f.js} +1 -1
- package/dist/web/assets/{fsharp-BNdjzTBO.js → fsharp-BWfAwTE9.js} +1 -1
- package/dist/web/assets/{gams-DmtP-UJK.js → gams-Ce515NcI.js} +1 -1
- package/dist/web/assets/{gauss-DxnPnapI.js → gauss-Bk2O9za3.js} +1 -1
- package/dist/web/assets/{gcode-DZDQEo7M.js → gcode-CWRqzaRU.js} +1 -1
- package/dist/web/assets/{gherkin-DXWYqT4S.js → gherkin-CspSy7IX.js} +1 -1
- package/dist/web/assets/{glsl-B4SBGW2G.js → glsl-DGKaoOaI.js} +1 -1
- package/dist/web/assets/{gml-gXM8AN-D.js → gml-B5N2XYtZ.js} +1 -1
- package/dist/web/assets/{go-BcVhbMNX.js → go-CWx21Iog.js} +1 -1
- package/dist/web/assets/{golo-Dg8v_TrW.js → golo-FJ2YWuU-.js} +1 -1
- package/dist/web/assets/{gradle-5lBZtppi.js → gradle-D4UO1l55.js} +1 -1
- package/dist/web/assets/{groovy-Dxu0ppzH.js → groovy-BodgULpW.js} +1 -1
- package/dist/web/assets/{haml-yYvJz54e.js → haml-TBlufCNG.js} +1 -1
- package/dist/web/assets/{handlebars-cQBNGRnU.js → handlebars-BVoEA5Nn.js} +1 -1
- package/dist/web/assets/{haskell-Ixxcv9pQ.js → haskell-CvKJOBr8.js} +1 -1
- package/dist/web/assets/{haxe-Dt3zx0fd.js → haxe-DtINP5BW.js} +1 -1
- package/dist/web/assets/{hsp-vh9A3q1F.js → hsp-Bh9fsrRr.js} +1 -1
- package/dist/web/assets/{htmlbars-DLjHhMjA.js → htmlbars-DIFs1hxN.js} +1 -1
- package/dist/web/assets/{http-BEPLCDao.js → http-F4Hr2rtI.js} +1 -1
- package/dist/web/assets/{hy-ClmRC_tn.js → hy-BCNhlo_g.js} +1 -1
- package/dist/web/assets/{index-BfwbEUMf.js → index-BCx_hbJZ.js} +1 -1
- package/dist/web/assets/{index-CXCCdym3.js → index-BRnQqFNi.js} +1 -1
- package/dist/web/assets/{index-DXhycZ1X.js → index-C-lCB0fL.js} +1 -1
- package/dist/web/assets/{index-CCJJaDxb.js → index-CD_ljDun.js} +9 -9
- package/dist/web/assets/{index-bWKo_5Wt.js → index-DMa0lxRx.js} +1 -1
- package/dist/web/assets/{index-CQNCCPjC.js → index-DgNcFyAg.js} +1 -1
- package/dist/web/assets/{index-B7eS-Oz-.js → index-POfTybe0.js} +1 -1
- package/dist/web/assets/{index-CPgWs6yL.js → index-sPok37Sg.js} +1 -1
- package/dist/web/assets/{inform7-DZEPPYZ3.js → inform7-qM1BL-Ib.js} +1 -1
- package/dist/web/assets/{ini-DNWshF1w.js → ini-DZSt8buZ.js} +1 -1
- package/dist/web/assets/{irpf90-D4-YET_E.js → irpf90-R3QpiYae.js} +1 -1
- package/dist/web/assets/{isbl-dieKpB4b.js → isbl-DFVyoUSU.js} +1 -1
- package/dist/web/assets/{java-whY7RnCg.js → java-heOrtayf.js} +1 -1
- package/dist/web/assets/{javascript-DS9MTkg3.js → javascript-BzOHDxfe.js} +1 -1
- package/dist/web/assets/{jboss-cli-gW749YEO.js → jboss-cli-CQF9a1Yd.js} +1 -1
- package/dist/web/assets/{json-Bqf3E9Oi.js → json-B-9Vpwh6.js} +1 -1
- package/dist/web/assets/{julia-BNs07fY7.js → julia-CIUBPkiv.js} +1 -1
- package/dist/web/assets/{julia-repl-4i2dS8eE.js → julia-repl--nkcdKR1.js} +1 -1
- package/dist/web/assets/{kotlin-cRltwNKP.js → kotlin-BzqUWFqo.js} +1 -1
- package/dist/web/assets/{lasso-C3t1XQ4Z.js → lasso-CAaOdXVI.js} +1 -1
- package/dist/web/assets/{latex-6oxVZW_l.js → latex-DnnaWnA4.js} +1 -1
- package/dist/web/assets/{ldif-CWcjFBWI.js → ldif-4iKQR8oF.js} +1 -1
- package/dist/web/assets/{leaf-5LFLGE4z.js → leaf-Bh7ouR7v.js} +1 -1
- package/dist/web/assets/{less-D5N81h5a.js → less-Dcea-FTK.js} +1 -1
- package/dist/web/assets/{lisp-CHhlvVaQ.js → lisp-DuIBsGp2.js} +1 -1
- package/dist/web/assets/{livecodeserver-_u-xqShh.js → livecodeserver-DO1xknm9.js} +1 -1
- package/dist/web/assets/{livescript-B2A4wBQF.js → livescript-CLfNYJHX.js} +1 -1
- package/dist/web/assets/{llms-COnSt-Zg.js → llms-Cnj9KbyY.js} +1 -1
- package/dist/web/assets/{llvm-CIGu3u1y.js → llvm-D8iJBmsE.js} +1 -1
- package/dist/web/assets/{lsl-CE-rpP2S.js → lsl-BS3iaX9u.js} +1 -1
- package/dist/web/assets/{lua-Gfg9l8Ck.js → lua-gwu2dgbU.js} +1 -1
- package/dist/web/assets/{makefile-CgT62pur.js → makefile-BZUlPomk.js} +1 -1
- package/dist/web/assets/{markdown-DRZxXdSz.js → markdown-nKZtxmjM.js} +1 -1
- package/dist/web/assets/{mathematica-DOqoPZFy.js → mathematica-xpyH_STR.js} +1 -1
- package/dist/web/assets/{matlab-CZWaf9pN.js → matlab-CMqP2M5T.js} +1 -1
- package/dist/web/assets/{maxima-C2PzeEdX.js → maxima-CdWH3WRg.js} +1 -1
- package/dist/web/assets/{mel-BotKPm-t.js → mel-DHXpqVP-.js} +1 -1
- package/dist/web/assets/{mercury-CyyPM64A.js → mercury-Bvg_9Mf4.js} +1 -1
- package/dist/web/assets/{mipsasm-Bku8poms.js → mipsasm-_4q5VfWr.js} +1 -1
- package/dist/web/assets/{mizar-SEq4X-4h.js → mizar-C7gOtgay.js} +1 -1
- package/dist/web/assets/{mojolicious-DXCIvr6E.js → mojolicious-CwTJkPTg.js} +1 -1
- package/dist/web/assets/{monkey-DImv-JdW.js → monkey-JFYOfchc.js} +1 -1
- package/dist/web/assets/{moonscript-J8xlBbco.js → moonscript-Bck0wuBW.js} +1 -1
- package/dist/web/assets/{n1ql-BHMM_iUN.js → n1ql-C2r4M7hW.js} +1 -1
- package/dist/web/assets/{nginx-Cct1EE-C.js → nginx-CWhS9bIu.js} +1 -1
- package/dist/web/assets/{nim-cpC5EpzI.js → nim-DqtdiBSk.js} +1 -1
- package/dist/web/assets/{nix-CkWIsm2q.js → nix-B-fcae6f.js} +1 -1
- package/dist/web/assets/{node-repl-iwzqJdHN.js → node-repl-DoVyr56j.js} +1 -1
- package/dist/web/assets/{nsis-Z_zycUGg.js → nsis-DNfzwEuN.js} +1 -1
- package/dist/web/assets/{objectivec-AWBUcxJF.js → objectivec-BQHla-z-.js} +1 -1
- package/dist/web/assets/{ocaml-DKNmlwiS.js → ocaml-Bg9xISlg.js} +1 -1
- package/dist/web/assets/{openscad-Clurbol2.js → openscad-B_n-GhfP.js} +1 -1
- package/dist/web/assets/{oxygene-BKUGvyxZ.js → oxygene-BkrmeLAT.js} +1 -1
- package/dist/web/assets/{parser3-DrBjqMu1.js → parser3-CuOsisSB.js} +1 -1
- package/dist/web/assets/{perl-BRacdOTP.js → perl-CVzRsZzy.js} +1 -1
- package/dist/web/assets/{pf-CIsZaTfb.js → pf-B_Rh_zbR.js} +1 -1
- package/dist/web/assets/{pgsql-DhMlVRag.js → pgsql-bcMG5c2R.js} +1 -1
- package/dist/web/assets/{php-BrKbzWZi.js → php-BHIjU0kY.js} +1 -1
- package/dist/web/assets/{php-template-WuIxkihv.js → php-template-D5eAxN1t.js} +1 -1
- package/dist/web/assets/{plaintext-D4i3kgFv.js → plaintext-C4Wg13Mh.js} +1 -1
- package/dist/web/assets/{pony-Bcjk_KlC.js → pony-Qzr1s_B5.js} +1 -1
- package/dist/web/assets/{powershell-DEgTsskM.js → powershell-DHDGLKFz.js} +1 -1
- package/dist/web/assets/{processing-B4OWT0rd.js → processing-BAHzsHr-.js} +1 -1
- package/dist/web/assets/{profile-Dik4Q9OL.js → profile-CxvioeH3.js} +1 -1
- package/dist/web/assets/{prolog-BPPEy5hS.js → prolog-Si-9ctqg.js} +1 -1
- package/dist/web/assets/{properties-BjYoUbRt.js → properties-m_3dxXJx.js} +1 -1
- package/dist/web/assets/{protobuf-AkxBEYoS.js → protobuf-k7OErUOA.js} +1 -1
- package/dist/web/assets/{puppet-CUTocchd.js → puppet-BRuuf1x2.js} +1 -1
- package/dist/web/assets/{purebasic-DpuNmDpv.js → purebasic-rSAjKdif.js} +1 -1
- package/dist/web/assets/{python-Djzt4Zra.js → python-Bw5QCI7k.js} +1 -1
- package/dist/web/assets/{python-repl-Ds6LSz96.js → python-repl-DaBizoem.js} +1 -1
- package/dist/web/assets/{q-C_10h1NV.js → q-YDb5SLZ7.js} +1 -1
- package/dist/web/assets/{qml-Cv_E8vhg.js → qml-aM6AdtYh.js} +1 -1
- package/dist/web/assets/{r-BDr3VNts.js → r-C16rlfGl.js} +1 -1
- package/dist/web/assets/{reasonml-DMFFOILm.js → reasonml-Cd7T_yCH.js} +1 -1
- package/dist/web/assets/{rib-O6EIA3-3.js → rib-l00VcShJ.js} +1 -1
- package/dist/web/assets/{roboconf-DmYhXD7g.js → roboconf-DIy5ekop.js} +1 -1
- package/dist/web/assets/{routeros-lI4qeBD1.js → routeros-BOMOP8E7.js} +1 -1
- package/dist/web/assets/{rsl-BqJBzs9N.js → rsl-loyIMOxx.js} +1 -1
- package/dist/web/assets/{ruby-DlQYkAiH.js → ruby-BPqNxiDm.js} +1 -1
- package/dist/web/assets/{ruleslanguage-B7W8OdVf.js → ruleslanguage-Gms7AaoX.js} +1 -1
- package/dist/web/assets/{rust-BOvNDuKj.js → rust-Bbpy-GLS.js} +1 -1
- package/dist/web/assets/{sas-BgZk43QC.js → sas-607wKomz.js} +1 -1
- package/dist/web/assets/{scala-QoV0e-z0.js → scala-Ewfmw7-A.js} +1 -1
- package/dist/web/assets/{scheme-Df6Nekag.js → scheme-yb6d3G4a.js} +1 -1
- package/dist/web/assets/{scilab-B_zmJejA.js → scilab-Cdla8s7M.js} +1 -1
- package/dist/web/assets/{scss-DeQSvatD.js → scss-DI-zv5m6.js} +1 -1
- package/dist/web/assets/{shell-Y-zNjqwf.js → shell-ryQiOzsR.js} +1 -1
- package/dist/web/assets/{smali-CFxASnbZ.js → smali-Bnv3RUwR.js} +1 -1
- package/dist/web/assets/{smalltalk-DsNrn71Z.js → smalltalk-pTGpOSbB.js} +1 -1
- package/dist/web/assets/{sml-BgoJiUw2.js → sml-Cxox0kdt.js} +1 -1
- package/dist/web/assets/{sqf-i1SZHDuy.js → sqf-Ba0bNrlO.js} +1 -1
- package/dist/web/assets/{sql-Cvs-BpNc.js → sql-B00-j6pL.js} +1 -1
- package/dist/web/assets/{sql_more-BIzTLt5o.js → sql_more-CHE7ctzP.js} +1 -1
- package/dist/web/assets/{stan-DLgLhThL.js → stan-BlCcmUfs.js} +1 -1
- package/dist/web/assets/{stata-C-qe8R1-.js → stata-BjK4lK-D.js} +1 -1
- package/dist/web/assets/{step21-BRAxbdPy.js → step21-DYftAXUC.js} +1 -1
- package/dist/web/assets/{stylus-Ba1M7z4W.js → stylus-I8UYxLbZ.js} +1 -1
- package/dist/web/assets/{subunit-B7rW0dev.js → subunit-lGOKOQp3.js} +1 -1
- package/dist/web/assets/{swift-CsmksHGK.js → swift-CeSqgcDb.js} +1 -1
- package/dist/web/assets/{taggerscript-DzGrF-6n.js → taggerscript-9jZ0cfvH.js} +1 -1
- package/dist/web/assets/{tap-pb65xe4Y.js → tap-pSN2j3s1.js} +1 -1
- package/dist/web/assets/{tcl-BM9Rra5f.js → tcl-eOZGQDaC.js} +1 -1
- package/dist/web/assets/{thrift-DQXsV3uC.js → thrift-Da42ouWZ.js} +1 -1
- package/dist/web/assets/{tp-D7fl7DZu.js → tp-HYYcgKhP.js} +1 -1
- package/dist/web/assets/{twig-BQZh-FXR.js → twig-DwNj1mST.js} +1 -1
- package/dist/web/assets/{typescript-BFwXM7Dt.js → typescript-Cv2GJylu.js} +1 -1
- package/dist/web/assets/{vala-Db4dl7l-.js → vala-Cml0yxQg.js} +1 -1
- package/dist/web/assets/{vbnet-r8izjbkE.js → vbnet-B-X9SylV.js} +1 -1
- package/dist/web/assets/{vbscript-D-l9UoHR.js → vbscript-2ohZ4WWq.js} +1 -1
- package/dist/web/assets/{vbscript-html-BOwKDLIm.js → vbscript-html-DnUx8-7l.js} +1 -1
- package/dist/web/assets/{verilog-EeOrgZcr.js → verilog-BTtm2Vt6.js} +1 -1
- package/dist/web/assets/{vhdl-DcwaJdji.js → vhdl-DTQ-WTKq.js} +1 -1
- package/dist/web/assets/{vim-CR6p3DfM.js → vim-Dv_aw2DH.js} +1 -1
- package/dist/web/assets/{x86asm-TPwpkK_Q.js → x86asm-ClFCLi0H.js} +1 -1
- package/dist/web/assets/{xl-CV4waFLz.js → xl-Cq_3qzcZ.js} +1 -1
- package/dist/web/assets/{xml-ClaNEjm-.js → xml-gIr-nDim.js} +1 -1
- package/dist/web/assets/{xquery-CEUjS6yv.js → xquery-zQ6LM8st.js} +1 -1
- package/dist/web/assets/{yaml-CfJg3OIC.js → yaml-DQqXL3xh.js} +1 -1
- package/dist/web/assets/{zephir-be9U_i0U.js → zephir-t4L8sy-8.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +2 -2
package/dist/client/index.js
CHANGED
|
@@ -20586,7 +20586,7 @@ var init_module = __esm({
|
|
|
20586
20586
|
}
|
|
20587
20587
|
});
|
|
20588
20588
|
|
|
20589
|
-
// ../mcp-use/dist/chunk-
|
|
20589
|
+
// ../mcp-use/dist/chunk-W2R33JUG.js
|
|
20590
20590
|
function getPackageVersion2() {
|
|
20591
20591
|
return VERSION;
|
|
20592
20592
|
}
|
|
@@ -20748,12 +20748,12 @@ function setTelemetrySource(source) {
|
|
|
20748
20748
|
Tel.getInstance().setSource(source);
|
|
20749
20749
|
}
|
|
20750
20750
|
var VERSION, _a7, BaseTelemetryEvent, _a8, MCPAgentExecutionEvent, _a9, ServerRunEvent, _a10, ServerInitializeEvent, _a11, ServerToolCallEvent, _a12, ServerResourceCallEvent, _a13, ServerPromptCallEvent, _a14, ServerContextEvent, _a15, MCPClientInitEvent, _a16, ConnectorInitEvent, _a17, ClientAddServerEvent, _a18, ClientRemoveServerEvent, USER_ID_STORAGE_KEY, cachedEnvironment, _a19, Telemetry2, Tel;
|
|
20751
|
-
var
|
|
20752
|
-
"../mcp-use/dist/chunk-
|
|
20751
|
+
var init_chunk_W2R33JUG = __esm({
|
|
20752
|
+
"../mcp-use/dist/chunk-W2R33JUG.js"() {
|
|
20753
20753
|
"use strict";
|
|
20754
20754
|
init_chunk_U7F22OTV();
|
|
20755
20755
|
init_chunk_3GQAWCBQ();
|
|
20756
|
-
VERSION = "1.17.4
|
|
20756
|
+
VERSION = "1.17.4";
|
|
20757
20757
|
__name(getPackageVersion2, "getPackageVersion");
|
|
20758
20758
|
BaseTelemetryEvent = (_a7 = class {
|
|
20759
20759
|
}, __name(_a7, "BaseTelemetryEvent"), _a7);
|
|
@@ -26833,17 +26833,17 @@ var init_langfuse_VYQJPN6D = __esm({
|
|
|
26833
26833
|
}
|
|
26834
26834
|
});
|
|
26835
26835
|
|
|
26836
|
-
// ../mcp-use/dist/chunk-
|
|
26836
|
+
// ../mcp-use/dist/chunk-QJEOEB5U.js
|
|
26837
26837
|
import {
|
|
26838
26838
|
CreateMessageRequestSchema,
|
|
26839
26839
|
ElicitRequestSchema,
|
|
26840
26840
|
ListRootsRequestSchema
|
|
26841
26841
|
} from "@modelcontextprotocol/sdk/types.js";
|
|
26842
26842
|
var _a20, BaseConnector;
|
|
26843
|
-
var
|
|
26844
|
-
"../mcp-use/dist/chunk-
|
|
26843
|
+
var init_chunk_QJEOEB5U = __esm({
|
|
26844
|
+
"../mcp-use/dist/chunk-QJEOEB5U.js"() {
|
|
26845
26845
|
"use strict";
|
|
26846
|
-
|
|
26846
|
+
init_chunk_W2R33JUG();
|
|
26847
26847
|
init_chunk_U7F22OTV();
|
|
26848
26848
|
init_chunk_3GQAWCBQ();
|
|
26849
26849
|
BaseConnector = (_a20 = class {
|
|
@@ -27343,12 +27343,12 @@ var init_chunk_PDRYIFI4 = __esm({
|
|
|
27343
27343
|
}
|
|
27344
27344
|
});
|
|
27345
27345
|
|
|
27346
|
-
// ../mcp-use/dist/chunk-
|
|
27346
|
+
// ../mcp-use/dist/chunk-WZTYZQGV.js
|
|
27347
27347
|
var _a21, CodeModeConnector;
|
|
27348
|
-
var
|
|
27349
|
-
"../mcp-use/dist/chunk-
|
|
27348
|
+
var init_chunk_WZTYZQGV = __esm({
|
|
27349
|
+
"../mcp-use/dist/chunk-WZTYZQGV.js"() {
|
|
27350
27350
|
"use strict";
|
|
27351
|
-
|
|
27351
|
+
init_chunk_QJEOEB5U();
|
|
27352
27352
|
init_chunk_3GQAWCBQ();
|
|
27353
27353
|
CodeModeConnector = (_a21 = class extends BaseConnector {
|
|
27354
27354
|
constructor(client) {
|
|
@@ -27454,7 +27454,7 @@ var init_chunk_2GR4WIQH = __esm({
|
|
|
27454
27454
|
}
|
|
27455
27455
|
});
|
|
27456
27456
|
|
|
27457
|
-
// ../mcp-use/dist/chunk-
|
|
27457
|
+
// ../mcp-use/dist/chunk-XZHX3U76.js
|
|
27458
27458
|
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
27459
27459
|
import {
|
|
27460
27460
|
StreamableHTTPClientTransport,
|
|
@@ -27462,11 +27462,11 @@ import {
|
|
|
27462
27462
|
} from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
27463
27463
|
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
|
|
27464
27464
|
var _a22, MCPSession, _a23, BaseMCPClient, _a24, ConnectionManager, _a25, SseConnectionManager, _a26, HttpConnector;
|
|
27465
|
-
var
|
|
27466
|
-
"../mcp-use/dist/chunk-
|
|
27465
|
+
var init_chunk_XZHX3U76 = __esm({
|
|
27466
|
+
"../mcp-use/dist/chunk-XZHX3U76.js"() {
|
|
27467
27467
|
"use strict";
|
|
27468
|
-
|
|
27469
|
-
|
|
27468
|
+
init_chunk_QJEOEB5U();
|
|
27469
|
+
init_chunk_W2R33JUG();
|
|
27470
27470
|
init_chunk_U7F22OTV();
|
|
27471
27471
|
init_chunk_3GQAWCBQ();
|
|
27472
27472
|
MCPSession = (_a22 = class {
|
|
@@ -48359,7 +48359,7 @@ var init_dist3 = __esm({
|
|
|
48359
48359
|
}
|
|
48360
48360
|
});
|
|
48361
48361
|
|
|
48362
|
-
// ../mcp-use/dist/chunk-
|
|
48362
|
+
// ../mcp-use/dist/chunk-OFPBVZ55.js
|
|
48363
48363
|
import { Client as Client2 } from "@modelcontextprotocol/sdk/client/index.js";
|
|
48364
48364
|
import process22 from "process";
|
|
48365
48365
|
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
@@ -48460,13 +48460,13 @@ function createConnectorFromConfig(serverConfig, connectorOptions) {
|
|
|
48460
48460
|
throw new Error("Cannot determine connector type from config");
|
|
48461
48461
|
}
|
|
48462
48462
|
var _a29, BaseCodeExecutor, _a30, E2BCodeExecutor, vm, vmCheckAttempted, _a31, VMCodeExecutor, _a32, StdioConnectionManager, _a33, StdioConnector, _a34, MCPClient;
|
|
48463
|
-
var
|
|
48464
|
-
"../mcp-use/dist/chunk-
|
|
48463
|
+
var init_chunk_OFPBVZ55 = __esm({
|
|
48464
|
+
"../mcp-use/dist/chunk-OFPBVZ55.js"() {
|
|
48465
48465
|
"use strict";
|
|
48466
|
-
|
|
48467
|
-
|
|
48468
|
-
|
|
48469
|
-
|
|
48466
|
+
init_chunk_WZTYZQGV();
|
|
48467
|
+
init_chunk_XZHX3U76();
|
|
48468
|
+
init_chunk_QJEOEB5U();
|
|
48469
|
+
init_chunk_W2R33JUG();
|
|
48470
48470
|
init_chunk_U7F22OTV();
|
|
48471
48471
|
init_chunk_3GQAWCBQ();
|
|
48472
48472
|
init_fs();
|
|
@@ -49662,11 +49662,11 @@ __export(client_exports, {
|
|
|
49662
49662
|
var init_client = __esm({
|
|
49663
49663
|
"../mcp-use/dist/src/client.js"() {
|
|
49664
49664
|
"use strict";
|
|
49665
|
-
|
|
49666
|
-
|
|
49667
|
-
|
|
49668
|
-
|
|
49669
|
-
|
|
49665
|
+
init_chunk_OFPBVZ55();
|
|
49666
|
+
init_chunk_WZTYZQGV();
|
|
49667
|
+
init_chunk_XZHX3U76();
|
|
49668
|
+
init_chunk_QJEOEB5U();
|
|
49669
|
+
init_chunk_W2R33JUG();
|
|
49670
49670
|
init_chunk_U7F22OTV();
|
|
49671
49671
|
init_chunk_3GQAWCBQ();
|
|
49672
49672
|
}
|
|
@@ -94260,7 +94260,7 @@ var init_display_A5IEINAP = __esm({
|
|
|
94260
94260
|
}
|
|
94261
94261
|
});
|
|
94262
94262
|
|
|
94263
|
-
// ../mcp-use/dist/chunk-
|
|
94263
|
+
// ../mcp-use/dist/chunk-5BEQOYGG.js
|
|
94264
94264
|
import { StructuredTool } from "@langchain/core/tools";
|
|
94265
94265
|
import { StructuredTool as StructuredTool2 } from "@langchain/core/tools";
|
|
94266
94266
|
import {
|
|
@@ -94485,11 +94485,11 @@ function normalizeRunOptions(queryOrOptions, maxSteps, manageConnector, external
|
|
|
94485
94485
|
};
|
|
94486
94486
|
}
|
|
94487
94487
|
var _a35, MCPServerTool, PresentActiveServerSchema, _a36, AcquireActiveMCPServerTool, _a37, AddMCPServerFromConfigTool, ConnectMCPServerSchema, _a38, ConnectMCPServerTool, EnumerateServersSchema, _a39, ListMCPServersTool, ReleaseConnectionSchema, _a40, ReleaseMCPServerConnectionTool, _a41, ServerManager, _a42, ObservabilityManager, API_CHATS_ENDPOINT, API_CHAT_EXECUTE_ENDPOINT, _a43, RemoteAgent, PROVIDER_CONFIG, DEFAULT_SYSTEM_PROMPT_TEMPLATE, SERVER_MANAGER_SYSTEM_PROMPT_TEMPLATE, _a44, MCPAgent;
|
|
94488
|
-
var
|
|
94489
|
-
"../mcp-use/dist/chunk-
|
|
94488
|
+
var init_chunk_5BEQOYGG = __esm({
|
|
94489
|
+
"../mcp-use/dist/chunk-5BEQOYGG.js"() {
|
|
94490
94490
|
"use strict";
|
|
94491
94491
|
init_chunk_WBQU7Z5T();
|
|
94492
|
-
|
|
94492
|
+
init_chunk_W2R33JUG();
|
|
94493
94493
|
init_chunk_U7F22OTV();
|
|
94494
94494
|
init_chunk_3GQAWCBQ();
|
|
94495
94495
|
init_zod();
|
|
@@ -96845,13 +96845,13 @@ ${formatPrompt}`
|
|
|
96845
96845
|
}
|
|
96846
96846
|
});
|
|
96847
96847
|
|
|
96848
|
-
// ../mcp-use/dist/chunk-
|
|
96848
|
+
// ../mcp-use/dist/chunk-7PULB2NC.js
|
|
96849
96849
|
var _a45, BrowserMCPClient;
|
|
96850
|
-
var
|
|
96851
|
-
"../mcp-use/dist/chunk-
|
|
96850
|
+
var init_chunk_7PULB2NC = __esm({
|
|
96851
|
+
"../mcp-use/dist/chunk-7PULB2NC.js"() {
|
|
96852
96852
|
"use strict";
|
|
96853
|
-
|
|
96854
|
-
|
|
96853
|
+
init_chunk_XZHX3U76();
|
|
96854
|
+
init_chunk_W2R33JUG();
|
|
96855
96855
|
init_chunk_U7F22OTV();
|
|
96856
96856
|
init_chunk_3GQAWCBQ();
|
|
96857
96857
|
BrowserMCPClient = (_a45 = class extends BaseMCPClient {
|
|
@@ -97690,13 +97690,13 @@ var init_browser = __esm({
|
|
|
97690
97690
|
"../mcp-use/dist/src/browser.js"() {
|
|
97691
97691
|
"use strict";
|
|
97692
97692
|
init_chunk_LGDFGYRL();
|
|
97693
|
-
|
|
97693
|
+
init_chunk_5BEQOYGG();
|
|
97694
97694
|
init_chunk_WASAQFUY();
|
|
97695
97695
|
init_chunk_WBQU7Z5T();
|
|
97696
|
-
|
|
97697
|
-
|
|
97698
|
-
|
|
97699
|
-
|
|
97696
|
+
init_chunk_7PULB2NC();
|
|
97697
|
+
init_chunk_XZHX3U76();
|
|
97698
|
+
init_chunk_QJEOEB5U();
|
|
97699
|
+
init_chunk_W2R33JUG();
|
|
97700
97700
|
init_chunk_U7F22OTV();
|
|
97701
97701
|
init_chunk_CYK6J4CZ();
|
|
97702
97702
|
init_chunk_3GQAWCBQ();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as f}from"./index-
|
|
1
|
+
import{r as f}from"./index-CD_ljDun.js";import{r as s}from"./1c-DOTL_Doy.js";function i(t,n){for(var o=0;o<n.length;o++){const e=n[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const c=Object.getOwnPropertyDescriptor(e,r);c&&Object.defineProperty(t,r,c.get?c:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var a=s();const p=f(a),_=i({__proto__:null,default:p},[a]);export{_};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s}from"./index-
|
|
1
|
+
import{r as s}from"./index-CD_ljDun.js";import{r as i}from"./abnf-BjLV93yi.js";function c(t,a){for(var o=0;o<a.length;o++){const e=a[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const n=Object.getOwnPropertyDescriptor(e,r);n&&Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var f=i();const p=s(f),l=c({__proto__:null,default:p},[f]);export{l as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n}from"./index-
|
|
1
|
+
import{r as n}from"./index-CD_ljDun.js";import{r as f}from"./accesslog-GJv3YBrF.js";function l(t,c){for(var o=0;o<c.length;o++){const e=c[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const s=Object.getOwnPropertyDescriptor(e,r);s&&Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var a=f();const g=n(a),u=l({__proto__:null,default:g},[a]);export{u as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a}from"./index-
|
|
1
|
+
import{r as a}from"./index-CD_ljDun.js";import{r as s}from"./actionscript-DoqfywO9.js";function p(e,c){for(var o=0;o<c.length;o++){const t=c[o];if(typeof t!="string"&&!Array.isArray(t)){for(const r in t)if(r!=="default"&&!(r in e)){const i=Object.getOwnPropertyDescriptor(t,r);i&&Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:()=>t[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var n=s();const f=a(n),g=p({__proto__:null,default:f},[n]);export{g as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s}from"./index-
|
|
1
|
+
import{r as s}from"./index-CD_ljDun.js";import{r as i}from"./ada-RUsuGPJi.js";function c(t,n){for(var o=0;o<n.length;o++){const e=n[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const a=Object.getOwnPropertyDescriptor(e,r);a&&Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var f=i();const p=s(f),l=c({__proto__:null,default:p},[f]);export{l as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i}from"./index-
|
|
1
|
+
import{r as i}from"./index-CD_ljDun.js";import{r as c}from"./angelscript-BdZ1b0rs.js";function p(t,a){for(var o=0;o<a.length;o++){const e=a[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const n=Object.getOwnPropertyDescriptor(e,r);n&&Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var s=c();const f=i(s),u=p({__proto__:null,default:f},[s]);export{u as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as p}from"./index-
|
|
1
|
+
import{r as p}from"./index-CD_ljDun.js";import{r as f}from"./apache-CsbpFlqC.js";function s(t,c){for(var o=0;o<c.length;o++){const e=c[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const a=Object.getOwnPropertyDescriptor(e,r);a&&Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var n=f();const i=p(n),g=s({__proto__:null,default:i},[n]);export{g as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i}from"./index-
|
|
1
|
+
import{r as i}from"./index-CD_ljDun.js";import{r as c}from"./applescript-kY8OmlKB.js";function n(t,a){for(var o=0;o<a.length;o++){const e=a[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const p=Object.getOwnPropertyDescriptor(e,r);p&&Object.defineProperty(t,r,p.get?p:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var s=c();const f=i(s),g=n({__proto__:null,default:f},[s]);export{g as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as f}from"./index-
|
|
1
|
+
import{r as f}from"./index-CD_ljDun.js";import{r as s}from"./arcade-BmMgc7_g.js";function i(t,c){for(var o=0;o<c.length;o++){const e=c[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const a=Object.getOwnPropertyDescriptor(e,r);a&&Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var n=s();const p=f(n),l=i({__proto__:null,default:p},[n]);export{l as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as f}from"./index-
|
|
1
|
+
import{r as f}from"./index-CD_ljDun.js";import{r as s}from"./arduino-pNuu6z4_.js";function u(t,a){for(var o=0;o<a.length;o++){const r=a[o];if(typeof r!="string"&&!Array.isArray(r)){for(const e in r)if(e!=="default"&&!(e in t)){const n=Object.getOwnPropertyDescriptor(r,e);n&&Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>r[e]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var i=s();const c=f(i),l=u({__proto__:null,default:c},[i]);export{l as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n}from"./index-
|
|
1
|
+
import{r as n}from"./index-CD_ljDun.js";import{r as f}from"./armasm-nKvy_iDO.js";function i(t,s){for(var o=0;o<s.length;o++){const r=s[o];if(typeof r!="string"&&!Array.isArray(r)){for(const e in r)if(e!=="default"&&!(e in t)){const a=Object.getOwnPropertyDescriptor(r,e);a&&Object.defineProperty(t,e,a.get?a:{enumerable:!0,get:()=>r[e]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var m=f();const c=n(m),l=i({__proto__:null,default:c},[m]);export{l as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s}from"./index-
|
|
1
|
+
import{r as s}from"./index-CD_ljDun.js";import{r as n}from"./asciidoc-B_fy0kBa.js";function f(t,c){for(var o=0;o<c.length;o++){const e=c[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const i=Object.getOwnPropertyDescriptor(e,r);i&&Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var a=n();const p=s(a),l=f({__proto__:null,default:p},[a]);export{l as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n}from"./index-
|
|
1
|
+
import{r as n}from"./index-CD_ljDun.js";import{r as p}from"./aspectj-DvN9ZbSj.js";function f(r,s){for(var o=0;o<s.length;o++){const e=s[o];if(typeof e!="string"&&!Array.isArray(e)){for(const t in e)if(t!=="default"&&!(t in r)){const a=Object.getOwnPropertyDescriptor(e,t);a&&Object.defineProperty(r,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var c=p();const i=n(c),g=f({__proto__:null,default:i},[c]);export{g as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s}from"./index-
|
|
1
|
+
import{r as s}from"./index-CD_ljDun.js";import{r as u}from"./autohotkey-CZG2ssCb.js";function i(r,n){for(var o=0;o<n.length;o++){const e=n[o];if(typeof e!="string"&&!Array.isArray(e)){for(const t in e)if(t!=="default"&&!(t in r)){const a=Object.getOwnPropertyDescriptor(e,t);a&&Object.defineProperty(r,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var f=u();const c=s(f),l=i({__proto__:null,default:c},[f]);export{l as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as f}from"./index-
|
|
1
|
+
import{r as f}from"./index-CD_ljDun.js";import{r as s}from"./autoit-DXMOl7Fd.js";function u(r,i){for(var o=0;o<i.length;o++){const t=i[o];if(typeof t!="string"&&!Array.isArray(t)){for(const e in t)if(e!=="default"&&!(e in r)){const a=Object.getOwnPropertyDescriptor(t,e);a&&Object.defineProperty(r,e,a.get?a:{enumerable:!0,get:()=>t[e]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var n=s();const c=f(n),g=u({__proto__:null,default:c},[n]);export{g as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as f}from"./index-
|
|
1
|
+
import{r as f}from"./index-CD_ljDun.js";import{r as i}from"./avrasm-Ba2EQvoc.js";function c(t,s){for(var o=0;o<s.length;o++){const r=s[o];if(typeof r!="string"&&!Array.isArray(r)){for(const e in r)if(e!=="default"&&!(e in t)){const a=Object.getOwnPropertyDescriptor(r,e);a&&Object.defineProperty(t,e,a.get?a:{enumerable:!0,get:()=>r[e]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var n=i();const m=f(n),l=c({__proto__:null,default:m},[n]);export{l as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s}from"./index-
|
|
1
|
+
import{r as s}from"./index-CD_ljDun.js";import{r as i}from"./awk-Cb-RiGP0.js";function c(t,n){for(var o=0;o<n.length;o++){const e=n[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const a=Object.getOwnPropertyDescriptor(e,r);a&&Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var f=i();const p=s(f),g=c({__proto__:null,default:p},[f]);export{g as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as f}from"./index-
|
|
1
|
+
import{r as f}from"./index-CD_ljDun.js";import{r as s}from"./axapta-J1eBZbig.js";function i(r,n){for(var a=0;a<n.length;a++){const e=n[a];if(typeof e!="string"&&!Array.isArray(e)){for(const t in e)if(t!=="default"&&!(t in r)){const o=Object.getOwnPropertyDescriptor(e,t);o&&Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var p=s();const c=f(p),g=i({__proto__:null,default:c},[p]);export{g as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as f}from"./index-
|
|
1
|
+
import{r as f}from"./index-CD_ljDun.js";import{r as i}from"./bash-CN_VnC_Q.js";function c(t,s){for(var o=0;o<s.length;o++){const e=s[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const a=Object.getOwnPropertyDescriptor(e,r);a&&Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var n=i();const p=f(n),l=c({__proto__:null,default:p},[n]);export{l as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c}from"./index-
|
|
1
|
+
import{r as c}from"./index-CD_ljDun.js";import{r as n}from"./basic-Bug0UzDW.js";function f(t,s){for(var o=0;o<s.length;o++){const e=s[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const a=Object.getOwnPropertyDescriptor(e,r);a&&Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var i=n();const p=c(i),l=f({__proto__:null,default:p},[i]);export{l as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s}from"./index-
|
|
1
|
+
import{r as s}from"./index-CD_ljDun.js";import{r as i}from"./bnf-DZMdTSN9.js";function c(t,f){for(var o=0;o<f.length;o++){const e=f[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const n=Object.getOwnPropertyDescriptor(e,r);n&&Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var a=i();const p=s(a),l=c({__proto__:null,default:p},[a]);export{l as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i}from"./index-
|
|
1
|
+
import{r as i}from"./index-CD_ljDun.js";import{r as c}from"./brainfuck-BYywhCpy.js";function s(t,a){for(var o=0;o<a.length;o++){const r=a[o];if(typeof r!="string"&&!Array.isArray(r)){for(const e in r)if(e!=="default"&&!(e in t)){const n=Object.getOwnPropertyDescriptor(r,e);n&&Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>r[e]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var f=c();const u=i(f),l=s({__proto__:null,default:u},[f]);export{l as b};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/client-
|
|
2
|
-
import{du as Tc,dv as Zs,dw as Ec,t as R,c4 as y,d5 as re,dc as Rr,dx as ve,dy as zr,da as Hr,d7 as xc,de as Mc,d6 as Ac,dz as Ic,cT as Re,e as mn,dA as Pc,dB as Tn,A as He,dC as vs,n as X,cF as hn,cD as se,bQ as P,ce as ae,j as Oc,C as Nc,dD as Rc,z as jo,c$ as xi,dE as oe,cH as En,dF as _n,bT as Mi,bP as Ue,dG as Qs,bO as Me,bR as Ss,bS as Qt,cM as mr,dH as $c,dI as jc,dJ as Lc,dK as Dc,dL as Fc,dM as Uc,dN as Vc,dO as Bc,dP as zc,dQ as Hc,dR as Wc,dS as Gc,dT as Kc,dU as Jc,dV as qc,dW as Yc,dX as Xc,dY as Zc,dZ as Qc,d_ as eu,bY as tu,d$ as nu,e0 as ru,e1 as su,p as vn,m as $e,bZ as it,cQ as en,e2 as ou,bU as iu,d0 as Lo,cR as au,e3 as Do,e4 as Fo,e5 as gr,e6 as bt,d8 as eo,cA as Cs,cz as ks,cC as lu,cg as cu,cv as to,cB as no,cq as te,cy as nt,o as K,e7 as Le,e8 as Ai,b as ro,l as j,e9 as uu,ea as hu,eb as du,cf as Ii,cw as fu,x as pu,cU as mu,T as gu,ec as Ln,ed as De,s as ie,ee as Pi,ef as tn,eg as xn,eh as yu,ei as Ke,ej as _t,ek as z,cx as wu,f as so,cE as bu,a as _u,el as Oi,em as Dn,en as gt,eo as vu,dp as Su,dm as Cu,dl as ku,ep as Tu,c2 as Eu,eq as Wr,er as Uo,u as nn,dj as Yn}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/client-CPcfUEPp.js","assets/index-CD_ljDun.js","assets/index-B5sDlIm8.css","assets/display-A5IEINAP-BoThkrNQ.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{du as Tc,dv as Zs,dw as Ec,t as R,c4 as y,d5 as re,dc as Rr,dx as ve,dy as zr,da as Hr,d7 as xc,de as Mc,d6 as Ac,dz as Ic,cT as Re,e as mn,dA as Pc,dB as Tn,A as He,dC as vs,n as X,cF as hn,cD as se,bQ as P,ce as ae,j as Oc,C as Nc,dD as Rc,z as jo,c$ as xi,dE as oe,cH as En,dF as _n,bT as Mi,bP as Ue,dG as Qs,bO as Me,bR as Ss,bS as Qt,cM as mr,dH as $c,dI as jc,dJ as Lc,dK as Dc,dL as Fc,dM as Uc,dN as Vc,dO as Bc,dP as zc,dQ as Hc,dR as Wc,dS as Gc,dT as Kc,dU as Jc,dV as qc,dW as Yc,dX as Xc,dY as Zc,dZ as Qc,d_ as eu,bY as tu,d$ as nu,e0 as ru,e1 as su,p as vn,m as $e,bZ as it,cQ as en,e2 as ou,bU as iu,d0 as Lo,cR as au,e3 as Do,e4 as Fo,e5 as gr,e6 as bt,d8 as eo,cA as Cs,cz as ks,cC as lu,cg as cu,cv as to,cB as no,cq as te,cy as nt,o as K,e7 as Le,e8 as Ai,b as ro,l as j,e9 as uu,ea as hu,eb as du,cf as Ii,cw as fu,x as pu,cU as mu,T as gu,ec as Ln,ed as De,s as ie,ee as Pi,ef as tn,eg as xn,eh as yu,ei as Ke,ej as _t,ek as z,cx as wu,f as so,cE as bu,a as _u,el as Oi,em as Dn,en as gt,eo as vu,dp as Su,dm as Cu,dl as ku,ep as Tu,c2 as Eu,eq as Wr,er as Uo,u as nn,dj as Yn}from"./index-CD_ljDun.js";import{b_ as xy,es as My,c3 as Ay,c6 as Iy,et as Py,eu as Oy,c5 as Ny,c3 as Ry,ev as $y,ew as jy,ex as Ly,ex as Dy}from"./index-CD_ljDun.js";import{a as Xn,S as $r,b as xu,t as Ni,T as Mu,D as Au}from"./index-BCx_hbJZ.js";import{h as Fn,s as Ri,g as $i,d as Iu,l as Pu,m as Ou,I as Nu,C as Ru,n as $u,t as ju,o as Lu,p as Du,q as Fu,r as Uu,u as Vu,v as Bu,w as zu,x as Hu,y as Wu,z as Gu,R as Ku,A as Vo,e as Ju}from"./index-DgNcFyAg.js";import{E as ji,a as qu,e as Yu}from"./embeddings-BCCRUz2i.js";import{L as Li,o as Xu,l as Zu}from"./llms-Cnj9KbyY.js";var Gr,zn,Kr=0,Jr=0;function Qu(t,e,n){var r=0,s=e||new Array(16);t=t||{};var o=t.node,i=t.clockseq;if(t._v6||(o||(o=Gr),i==null&&(i=zn)),o==null||i==null){var a=t.random||(t.rng||Tc)();o==null&&(o=[a[0],a[1],a[2],a[3],a[4],a[5]],!Gr&&!t._v6&&(o[0]|=1,Gr=o)),i==null&&(i=(a[6]<<8|a[7])&16383,zn===void 0&&!t._v6&&(zn=i))}var l=t.msecs!==void 0?t.msecs:Date.now(),c=t.nsecs!==void 0?t.nsecs:Jr+1,u=l-Kr+(c-Jr)/1e4;if(u<0&&t.clockseq===void 0&&(i=i+1&16383),(u<0||l>Kr)&&t.nsecs===void 0&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Kr=l,Jr=c,zn=i,l+=122192928e5;var d=((l&268435455)*1e4+c)%4294967296;s[r++]=d>>>24&255,s[r++]=d>>>16&255,s[r++]=d>>>8&255,s[r++]=d&255;var h=l/4294967296*1e4&268435455;s[r++]=h>>>8&255,s[r++]=h&255,s[r++]=h>>>24&15|16,s[r++]=h>>>16&255,s[r++]=i>>>8|128,s[r++]=i&255;for(var f=0;f<6;++f)s[r+f]=o[f];return e||Zs(s)}function eh(t){var e=typeof t=="string"?Ec(t):t,n=th(e);return typeof t=="string"?Zs(n):n}function th(t,e=!1){return Uint8Array.of((t[6]&15)<<4|t[7]>>4&15,(t[7]&15)<<4|(t[4]&240)>>4,(t[4]&15)<<4|(t[5]&240)>>4,(t[5]&15)<<4|(t[0]&240)>>4,(t[0]&15)<<4|(t[1]&240)>>4,(t[1]&15)<<4|(t[2]&240)>>4,96|t[2]&15,t[3],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function Bo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function zo(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Bo(Object(n),!0).forEach(function(r){nh(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Bo(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function nh(t,e,n){return(e=rh(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function rh(t){var e=sh(t,"string");return typeof e=="symbol"?e:e+""}function sh(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function oh(t={},e,n=0){var r=Qu(zo(zo({},t),{},{_v6:!0}),new Uint8Array(16));return r=eh(r),Zs(r)}async function*ih(t){for await(const e of t)if(e.event==="on_chat_model_stream"&&e.data?.chunk?.text){const n=e.data.chunk.text;typeof n=="string"&&n.length>0&&(yield n)}}R(ih,"streamEventsToAISDK");function ah(t){return new ReadableStream({async start(e){try{for await(const n of t)e.enqueue(n);e.close()}catch(n){e.error(n)}}})}R(ah,"createReadableStreamFromGenerator");async function*lh(t){for await(const e of t)switch(e.event){case"on_chat_model_stream":if(e.data?.chunk?.text){const n=e.data.chunk.text;typeof n=="string"&&n.length>0&&(yield n)}break;case"on_tool_start":yield`
|
|
3
3
|
🔧 Using tool: ${e.name}
|
|
4
4
|
`;break;case"on_tool_end":yield`
|
|
5
5
|
✅ Tool completed: ${e.name}
|
|
@@ -387,7 +387,7 @@ You can then use these server-specific tools in subsequent steps.
|
|
|
387
387
|
Here are the tools *currently* available to you (this list includes server management tools and will
|
|
388
388
|
change when you connect to a server):
|
|
389
389
|
{tool_descriptions}
|
|
390
|
-
`;function pr(t,e,n,r,s,o){if(typeof t=="object"&&t!==null){const i=t;return{query:i.prompt,maxSteps:i.maxSteps,manageConnector:i.manageConnector,externalHistory:i.externalHistory,outputSchema:i.schema,signal:i.signal}}return{query:t,maxSteps:e,manageConnector:n,externalHistory:r,outputSchema:s,signal:o}}R(pr,"normalizeRunOptions");var Zt,ky=(Zt=class{static getPackageVersion(){return Eu()}llm;client;connectors;maxSteps;autoInitialize;memoryEnabled;disallowedTools;additionalTools;toolsUsedNames=[];useServerManager;verbose;observe;systemPrompt;systemPromptTemplateOverride;additionalInstructions;_initialized=!1;conversationHistory=[];_agentExecutor=null;sessions={};systemMessage=null;_tools=[];adapter;serverManager=null;telemetry;modelProvider;modelName;observabilityManager;callbacks=[];metadata={};tags=[];isRemote=!1;remoteAgent=null;isSimplifiedMode=!1;llmString;llmConfig;mcpServersConfig;clientOwnedByAgent=!1;constructor(e){if(e.agentId){this.isRemote=!0,this.remoteAgent=new ly({agentId:e.agentId,apiKey:e.apiKey,baseUrl:e.baseUrl}),this.maxSteps=e.maxSteps??5,this.memoryEnabled=e.memoryEnabled??!0,this.autoInitialize=e.autoInitialize??!1,this.verbose=e.verbose??!1,this.observe=e.observe??!0,this.connectors=[],this.disallowedTools=[],this.additionalTools=[],this.useServerManager=!1,this.adapter=new xt,this.telemetry=Wr.getInstance(),this.modelProvider="remote",this.modelName="remote-agent",this.observabilityManager=new ki({customCallbacks:e.callbacks,agentId:e.agentId}),this.callbacks=[];return}if(!e.llm)throw new Error("llm is required for local execution. For remote execution, provide agentId instead.");if(typeof e.llm=="string"){if(this.isSimplifiedMode=!0,this.llmString=e.llm,this.llmConfig=e.llmConfig,this.mcpServersConfig=e.mcpServers,!this.mcpServersConfig||Object.keys(this.mcpServersConfig).length===0)throw new Error("Simplified mode requires 'mcpServers' configuration. Provide an object with server configurations, e.g., { filesystem: { command: 'npx', args: [...] } }");this.llm=void 0,this.client=void 0,this.clientOwnedByAgent=!0,this.connectors=[],y.info(`🎯 Simplified mode enabled: LLM will be created from '${this.llmString}'`)}else if(this.isSimplifiedMode=!1,this.llm=e.llm,this.client=e.client,this.connectors=e.connectors??[],this.clientOwnedByAgent=!1,!this.client&&this.connectors.length===0)throw new Error("Explicit mode requires either 'client' or at least one 'connector'. Alternatively, use simplified mode with 'llm' as a string and 'mcpServers' config.");if(this.maxSteps=e.maxSteps??5,this.autoInitialize=e.autoInitialize??!1,this.memoryEnabled=e.memoryEnabled??!0,this.systemPrompt=e.systemPrompt??null,this.systemPromptTemplateOverride=e.systemPromptTemplate??null,this.additionalInstructions=e.additionalInstructions??null,this.disallowedTools=e.disallowedTools??[],this.additionalTools=e.additionalTools??[],this.toolsUsedNames=e.toolsUsedNames??[],this.useServerManager=e.useServerManager??!1,this.verbose=e.verbose??!1,this.observe=e.observe??!0,this.isSimplifiedMode)this.adapter=e.adapter??new xt(this.disallowedTools),this.telemetry=Wr.getInstance(),this.modelProvider="unknown",this.modelName="unknown";else{if(this.useServerManager){if(!this.client)throw new Error("'client' must be provided when 'useServerManager' is true.");this.adapter=e.adapter??new xt(this.disallowedTools),this.serverManager=e.serverManagerFactory?.(this.client)??new Ci(this.client,this.adapter)}else this.adapter=e.adapter??new xt(this.disallowedTools);if(this.telemetry=Wr.getInstance(),this.llm){const[r,s]=Uo(this.llm);this.modelProvider=r,this.modelName=s}else this.modelProvider="unknown",this.modelName="unknown"}this.observabilityManager=new ki({customCallbacks:e.callbacks,verbose:this.verbose,observe:this.observe,agentId:e.agentId,metadataProvider:R(()=>this.getMetadata(),"metadataProvider"),tagsProvider:R(()=>this.getTags(),"tagsProvider")}),Object.defineProperty(this,"agentExecutor",{get:R(()=>this._agentExecutor,"get"),configurable:!0}),Object.defineProperty(this,"tools",{get:R(()=>this._tools,"get"),configurable:!0}),Object.defineProperty(this,"initialized",{get:R(()=>this._initialized,"get"),configurable:!0})}async initialize(){if(this.isRemote){this._initialized=!0;return}if(y.info("🚀 Initializing MCP agent and connecting to services..."),this.isSimplifiedMode){if(y.info("🎯 Simplified mode: Creating client and LLM from configuration..."),this.mcpServersConfig){y.info(`Creating MCPClient with ${Object.keys(this.mcpServersConfig).length} server(s)...`);const{MCPClient:r}=await nn(async()=>{const{MCPClient:s}=await import("./client-Df3g4LG4.js");return{MCPClient:s}},__vite__mapDeps([0,1,2]));this.client=new r({mcpServers:this.mcpServersConfig}),y.info("✅ MCPClient created successfully")}if(this.llmString){y.info(`Creating LLM from string: ${this.llmString}...`);try{this.llm=await vc(this.llmString,this.llmConfig),y.info("✅ LLM created successfully");const[r,s]=Uo(this.llm);this.modelProvider=r,this.modelName=s}catch(r){throw new Error(`Failed to create LLM from string '${this.llmString}': ${r?.message||r}`)}}if(this.useServerManager){if(!this.client)throw new Error("'client' must be available when 'useServerManager' is true.");this.serverManager=new Ci(this.client,this.adapter)}}this.callbacks=await this.observabilityManager.getCallbacks();const e=await this.observabilityManager.getHandlerNames();if(e.length>0&&y.info(`📊 Observability enabled with: ${e.join(", ")}`),this.useServerManager&&this.serverManager){await this.serverManager.initialize();const r=this.serverManager.tools;this._tools=r,this._tools.push(...this.additionalTools),y.info(`🔧 Server manager mode active with ${r.length} management tools`),await this.createSystemMessageFromTools(this._tools)}else{if(this.client){if(this.sessions=this.client.getAllActiveSessions(),y.info(`🔌 Found ${Object.keys(this.sessions).length} existing sessions`),Object.keys(this.sessions).filter(s=>s!=="code_mode").length===0&&(y.info("🔄 No active sessions found, creating new ones..."),this.sessions=await this.client.createAllSessions(),y.info(`✅ Created ${Object.keys(this.sessions).length} new sessions`)),this.client.codeMode){const s=this.sessions.code_mode;if(s)this._tools=await this.adapter.createToolsFromConnectors([s.connector]),y.info(`🛠️ Created ${this._tools.length} code mode tools`);else throw new Error("Code mode enabled but code_mode session not found")}else{const s=await this.adapter.createToolsFromConnectors(Object.values(this.sessions).map(a=>a.connector)),o=await this.adapter.createResourcesFromConnectors(Object.values(this.sessions).map(a=>a.connector)),i=await this.adapter.createPromptsFromConnectors(Object.values(this.sessions).map(a=>a.connector));this._tools=[...s,...o,...i],y.info(`🛠️ Created ${this._tools.length} LangChain items from client: ${s.length} tools, ${o.length} resources, ${i.length} prompts`)}this._tools.push(...this.additionalTools)}else{y.info(`🔗 Connecting to ${this.connectors.length} direct connectors...`);for(const i of this.connectors)i.isClientConnected||await i.connect();const r=await this.adapter.createToolsFromConnectors(this.connectors),s=await this.adapter.createResourcesFromConnectors(this.connectors),o=await this.adapter.createPromptsFromConnectors(this.connectors);this._tools=[...r,...s,...o],this._tools.push(...this.additionalTools),y.info(`🛠️ Created ${this._tools.length} LangChain items from connectors: ${r.length} tools, ${s.length} resources, ${o.length} prompts`)}y.info(`🧰 Found ${this._tools.length} tools across all connectors`),await this.createSystemMessageFromTools(this._tools)}this._agentExecutor=this.createAgent(),this._initialized=!0;const n=this.getMCPServerInfo();Object.keys(n).length>0&&(this.setMetadata(n),y.debug(`MCP server info added to metadata: ${JSON.stringify(n)}`)),y.info("✨ Agent initialization complete")}async createSystemMessageFromTools(e){const n=this.systemPromptTemplateOverride??hy;this.systemMessage=kc(e,n,dy,this.useServerManager,this.disallowedTools,this.systemPrompt??void 0,this.additionalInstructions??void 0),this.memoryEnabled&&(this.conversationHistory=[this.systemMessage,...this.conversationHistory.filter(r=>!(r instanceof oe))])}createAgent(){if(!this.llm)throw new Error("LLM is required to create agent");const e=this.systemMessage?.content??"You are a helpful assistant.",n=this._tools.map(o=>o.name);y.info(`🧠 Agent ready with tools: ${n.join(", ")}`);const r=[gc({runLimit:this.maxSteps})],s=Yl({model:this.llm,tools:this._tools,systemPrompt:e,middleware:r});return y.debug(`Created agent with max_steps=${this.maxSteps} (via ModelCallLimitMiddleware) and ${this.callbacks.length} callbacks`),s}getConversationHistory(){return[...this.conversationHistory]}clearConversationHistory(){this.conversationHistory=this.memoryEnabled&&this.systemMessage?[this.systemMessage]:[]}addToHistory(e){this.memoryEnabled&&this.conversationHistory.push(e)}getSystemMessage(){return this.systemMessage}setSystemMessage(e){this.systemMessage=new oe(e),this.memoryEnabled&&(this.conversationHistory=this.conversationHistory.filter(n=>!(n instanceof oe)),this.conversationHistory.unshift(this.systemMessage)),this._initialized&&this._tools.length&&(this._agentExecutor=this.createAgent(),y.debug("Agent recreated with new system message"))}setDisallowedTools(e){this.disallowedTools=e,this.adapter=new xt(this.disallowedTools),this._initialized&&y.debug("Agent already initialized. Changes will take effect on next initialization.")}getDisallowedTools(){return this.disallowedTools}setMetadata(e){const n=this.sanitizeMetadata(e);this.metadata={...this.metadata,...n},y.debug(`Metadata set: ${JSON.stringify(this.metadata)}`)}getMetadata(){return{...this.metadata}}setTags(e){const n=this.sanitizeTags(e);this.tags=[...new Set([...this.tags,...n])],y.debug(`Tags set: ${JSON.stringify(this.tags)}`)}getTags(){return[...this.tags]}sanitizeMetadata(e){const n={};for(const[r,s]of Object.entries(e)){if(typeof r!="string"||r.length===0){y.warn(`Invalid metadata key: ${r}. Skipping.`);continue}const o=r.replace(/[^\w-]/g,"_");if(s==null)n[o]=s;else if(typeof s=="string"||typeof s=="number"||typeof s=="boolean")n[o]=s;else if(Array.isArray(s)){const i=s.filter(a=>typeof a=="string"||typeof a=="number"||typeof a=="boolean");i.length>0&&(n[o]=i)}else if(typeof s=="object")try{const i=JSON.stringify(s);i.length>1e3?(y.warn(`Metadata value for key '${o}' is too large. Truncating.`),n[o]=`${i.substring(0,1e3)}...`):n[o]=s}catch(i){y.warn(`Failed to serialize metadata value for key '${o}': ${i}. Skipping.`)}else y.warn(`Unsupported metadata value type for key '${o}': ${typeof s}. Skipping.`)}return n}sanitizeTags(e){return e.filter(n=>typeof n=="string"&&n.length>0).map(n=>n.replace(/[^\w:-]/g,"_")).filter(n=>n.length<=50)}getMCPServerInfo(){const e={};try{if(this.client){const n=this.client.getServerNames();e.mcp_servers_count=n.length,e.mcp_server_names=n;const r={};for(const s of n)try{const o=this.client.getServerConfig(s);if(o){let i="unknown";o.command?i="command":o.url?i="http":o.ws_url&&(i="websocket"),r[s]={type:i,has_args:!!o.args,has_env:!!o.env,has_headers:!!o.headers,url:o.url||null,command:o.command||null}}}catch(o){y.warn(`Failed to get config for server '${s}': ${o}`),r[s]={type:"error",error:"config_unavailable"}}e.mcp_server_configs=r}else this.connectors&&this.connectors.length>0&&(e.mcp_servers_count=this.connectors.length,e.mcp_server_names=this.connectors.map(n=>n.publicIdentifier),e.mcp_server_types=this.connectors.map(n=>n.constructor.name))}catch(n){y.warn(`Failed to collect MCP server info: ${n}`),e.error="collection_failed"}return e}_normalizeOutput(e){try{if(typeof e=="string")return e;if(e&&typeof e=="object"&&"content"in e)return this._normalizeOutput(e.content);if(Array.isArray(e)){const n=[];for(const r of e)if(typeof r=="object"&&r!==null)"text"in r&&typeof r.text=="string"?n.push(r.text):"content"in r?n.push(this._normalizeOutput(r.content)):n.push(String(r));else{const s=r&&typeof r=="object"&&"text"in r?r.text:null;if(typeof s=="string")n.push(s);else{const o=r&&typeof r=="object"&&"content"in r?r.content:r;n.push(this._normalizeOutput(o))}}return n.join("")}return String(e)}catch{return String(e)}}_isAIMessageLike(e){if(e instanceof P)return!0;if(typeof e!="object"||e===null)return!1;const n=e;if(typeof n.getType=="function")try{const r=n.getType();if(r==="ai"||r==="assistant")return!0}catch{}if(typeof n._getType=="function")try{const r=n._getType();if(r==="ai"||r==="assistant")return!0}catch{}return"type"in n?n.type==="ai"||n.type==="assistant":"role"in n?n.role==="ai"||n.role==="assistant":!1}_messageHasToolCalls(e){return typeof e=="object"&&e!==null&&"tool_calls"in e&&Array.isArray(e.tool_calls)?e.tool_calls.length>0:!1}_isHumanMessageLike(e){if(e instanceof se)return!0;if(typeof e!="object"||e===null)return!1;const n=e;if(typeof n.getType=="function")try{const r=n.getType();if(r==="human"||r==="user")return!0}catch{}return"type"in n&&(n.type==="human"||n.type==="user")||"role"in n&&(n.role==="human"||n.role==="user")}_isToolMessageLike(e){if(e instanceof j)return!0;if(typeof e!="object"||e===null)return!1;const n=e;if(typeof n.getType=="function")try{if(n.getType()==="tool")return!0}catch{}return"type"in n&&n.type==="tool"}_getMessageContent(e){if(e instanceof P||e&&typeof e=="object"&&"content"in e)return e.content}async _consumeAndReturn(e){for(;;){const{done:n,value:r}=await e.next();if(n)return r}}async run(e,n,r,s,o,i){const{query:a,maxSteps:l,manageConnector:c,externalHistory:u,outputSchema:d,signal:h}=pr(e,n,r,s,o,i);if(this.isRemote&&this.remoteAgent)return this.remoteAgent.run(a,l,c,u,d);const f=this.stream(a,l,c,u,d,h);return this._consumeAndReturn(f)}async*stream(e,n,r=!0,s,o,i){const{query:a,maxSteps:l,manageConnector:c,externalHistory:u,outputSchema:d,signal:h}=pr(e,n,r,s,o,i);if(this.isRemote&&this.remoteAgent)return await this.remoteAgent.run(a,l,c,u,d);let f=!1;const m=Date.now();let p=!1,C=null,k=0;try{if(c&&!this._initialized?(await this.initialize(),f=!0):!this._initialized&&this.autoInitialize&&(await this.initialize(),f=!0),!this._agentExecutor)throw new Error("MCP agent failed to initialize");if(this.useServerManager&&this.serverManager){const b=this.serverManager.tools,E=new Set(b.map(x=>x.name)),S=new Set(this._tools.map(x=>x.name));(E.size!==S.size||[...E].some(x=>!S.has(x)))&&(y.info(`🔄 Tools changed before execution, updating agent. New tools: ${[...E].join(", ")}`),this._tools=b,this._tools.push(...this.additionalTools),await this.createSystemMessageFromTools(this._tools),this._agentExecutor=this.createAgent())}const T=u??this.conversationHistory,_=[];for(const b of T)(this._isHumanMessageLike(b)||this._isAIMessageLike(b)||this._isToolMessageLike(b))&&_.push(b);const g=a.length>50?`${a.slice(0,50).replace(/\n/g," ")}...`:a.replace(/\n/g," ");y.info(`💬 Received query: '${g}'`),y.info("🏁 Starting agent execution");const v=3;let M=0;const w=[..._,new se(a)];for(;M<=v;){const b={messages:w};let E=!1;const S=await this._agentExecutor.stream(b,{streamMode:"updates",callbacks:this.callbacks,metadata:this.getMetadata(),tags:this.getTags(),runName:this.metadata.trace_name||"mcp-use-agent",recursionLimit:this.maxSteps*3,...this.metadata.session_id&&{sessionId:this.metadata.session_id},...h&&{signal:h}});for await(const x of S){if(h?.aborted)break;for(const[I,O]of Object.entries(x))if(y.debug(`📦 Node '${I}' output: ${JSON.stringify(O)}`),O&&typeof O=="object"&&"messages"in O){let F=O.messages;Array.isArray(F)||(F=[F]);for(const ce of F)w.includes(ce)||w.push(ce);for(const ce of F){if("tool_calls"in ce&&Array.isArray(ce.tool_calls)&&ce.tool_calls.length>0)for(const Ie of ce.tool_calls){const we=Ie.name||"unknown",ht=Ie.args||{};this.toolsUsedNames.push(we),k++;let Je=JSON.stringify(ht);Je.length>100&&(Je=`${Je.slice(0,97)}...`),y.info(`🔧 Tool call: ${we} with input: ${Je}`),yield{action:{tool:we,toolInput:ht,log:`Calling tool ${we}`},observation:""}}if(this._isToolMessageLike(ce)){const Ie=ce.content;let we=String(Ie);if(we.length>100&&(we=`${we.slice(0,97)}...`),we=we.replace(/\n/g," "),y.info(`📄 Tool result: ${we}`),this.useServerManager&&this.serverManager){const ht=this.serverManager.tools,Je=new Set(ht.map(fn=>fn.name)),$o=new Set(this._tools.map(fn=>fn.name));if(Je.size!==$o.size||[...Je].some(fn=>!$o.has(fn))){y.info(`🔄 Tools changed during execution. New tools: ${[...Je].join(", ")}`),this._tools=ht,this._tools.push(...this.additionalTools),await this.createSystemMessageFromTools(this._tools),this._agentExecutor=this.createAgent(),E=!0,M++,y.info(`🔃 Restarting execution with updated tools (restart ${M}/${v})`);break}}}this._isAIMessageLike(ce)&&!this._messageHasToolCalls(ce)&&(C=this._normalizeOutput(this._getMessageContent(ce)),y.info("✅ Agent finished with output"))}if(E)break}if(E)break}if(!E)break;if(M>v){y.warn(`⚠️ Max restarts (${v}) reached. Continuing with current tools.`);break}}if(this.memoryEnabled){const b=w.slice(_.length);for(const E of b)this.addToHistory(E)}if(d&&C)try{y.info("🔧 Attempting structured output...");const b=await this._attemptStructuredOutput(C,this.llm,d);return this.memoryEnabled&&this.addToHistory(new P(`Structured result: ${JSON.stringify(b)}`)),y.info("✅ Structured output successful"),p=!0,b}catch(b){throw y.error(`❌ Structured output failed: ${b}`),new Error(`Failed to generate structured output: ${b instanceof Error?b.message:String(b)}`)}return y.info(`🎉 Agent execution complete in ${((Date.now()-m)/1e3).toFixed(2)} seconds`),p=!0,C||"No output generated"}catch(T){throw y.error(`❌ Error running query: ${T}`),f&&c&&(y.info("🧹 Cleaning up resources after error"),await this.close()),T}finally{const T=Date.now()-m;let _=0;this.client?_=Object.keys(this.client.getAllActiveSessions()).length:this.connectors&&(_=this.connectors.length);const g=this.memoryEnabled?this.conversationHistory.length:0,v=this._tools||[];await this.telemetry.trackAgentExecution({executionMethod:"stream",query:a,success:p,modelProvider:this.modelProvider,modelName:this.modelName,serverCount:_,serverIdentifiers:this.connectors.map(M=>M.publicIdentifier),totalToolsAvailable:v.length,toolsAvailableNames:v.map(M=>M.name),maxStepsConfigured:this.maxSteps,memoryEnabled:this.memoryEnabled,useServerManager:this.useServerManager,maxStepsUsed:l??null,manageConnector:c??!0,externalHistoryUsed:u!==void 0,stepsTaken:k,toolsUsedCount:this.toolsUsedNames.length,toolsUsedNames:this.toolsUsedNames,response:C||"",executionTimeMs:T,errorType:p?null:"execution_error",conversationHistoryLength:g}),c&&!this.client&&f&&(y.info("🧹 Closing agent after stream completion"),await this.close())}}async flush(){this.isRemote&&this.remoteAgent||(y.debug("Flushing observability traces..."),await this.observabilityManager.flush())}async close(){if(this.isRemote&&this.remoteAgent){await this.remoteAgent.close();return}y.info("🔌 Closing MCPAgent resources…"),await this.observabilityManager.shutdown();try{if(this._agentExecutor=null,this._tools=[],this.client)this.clientOwnedByAgent?(y.info("🔄 Closing internally-created client (simplified mode) and cleaning up resources"),await this.client.close(),this.sessions={},this.client=void 0):(y.info("🔄 Closing client and cleaning up resources"),await this.client.close(),this.sessions={});else for(const e of this.connectors)y.info("🔄 Disconnecting connector"),await e.disconnect();this.isSimplifiedMode&&this.llm&&(y.debug("🔄 Clearing LLM reference (simplified mode)"),this.llm=void 0),"connectorToolMap"in this.adapter&&(this.adapter=new xt)}finally{this._initialized=!1,y.info("👋 Agent closed successfully")}}async*prettyStreamEvents(e,n,r=!0,s,o){const{prettyStreamEvents:i}=await nn(async()=>{const{prettyStreamEvents:l}=await import("./display-A5IEINAP-qRAq_9MW.js");return{prettyStreamEvents:l}},__vite__mapDeps([3,1,2])),a="";for await(const l of i(this.streamEvents(e,n,r,s,o)))yield;return a}async*streamEvents(e,n,r=!0,s,o,i){const a=pr(e,n,r,s,o,i);let{query:l}=a;const{maxSteps:c,manageConnector:u,externalHistory:d,outputSchema:h,signal:f}=a;let m=!1;const p=Date.now();let C=!1,k=0,T=0,_="";h&&(l=this._enhanceQueryWithSchema(l,h));try{u&&!this._initialized?(await this.initialize(),m=!0):!this._initialized&&this.autoInitialize&&(await this.initialize(),m=!0);const g=this._agentExecutor;if(!g)throw new Error("MCP agent failed to initialize");this.maxSteps=c??this.maxSteps;const v=typeof l=="string"&&l.length>50?`${l.slice(0,50).replace(/\n/g," ")}...`:typeof l=="string"?l.replace(/\n/g," "):String(l);y.info(`💬 Received query for streamEvents: '${v}'`),this.memoryEnabled&&(y.info(`🔄 Adding user message to history: ${v}`),this.addToHistory(new se({content:l})));const M=d??this.conversationHistory,w=[];for(const S of M)this._isHumanMessageLike(S)||this._isAIMessageLike(S)||this._isToolMessageLike(S)?w.push(S):y.info(`⚠️ Skipped message of type: ${S.constructor?.name||typeof S}`);const b=[...w,new se(l)];y.info("callbacks",this.callbacks);const E=g.streamEvents({messages:b},{streamMode:"messages",version:"v2",callbacks:this.callbacks,metadata:this.getMetadata(),tags:this.getTags(),runName:this.metadata.trace_name||"mcp-use-agent",recursionLimit:this.maxSteps*3,...this.metadata.session_id&&{sessionId:this.metadata.session_id},...f&&{signal:f}});for await(const S of E){if(f?.aborted)break;if(k++,!(!S||typeof S!="object")){if(S.event==="on_chat_model_stream"&&S.data?.chunk?.content&&(T+=S.data.chunk.content.length),S.event==="on_chat_model_stream"&&S.data?.chunk){const x=S.data.chunk;if(x.content){_||(_="");const I=this._normalizeOutput(x.content);_+=I,y.debug(`📝 Accumulated response length: ${_.length}`)}}if(yield S,S.event==="on_chain_end"&&S.data?.output&&!_){const x=S.data.output;Array.isArray(x)&&x.length>0&&x[0]?.text?_=x[0].text:typeof x=="string"?_=x:x&&typeof x=="object"&&"output"in x&&(_=x.output)}}}if(h&&_){y.info("🔧 Attempting structured output conversion...");try{let S=!1,x=null,I=null;this._attemptStructuredOutput(_,this.llm,h).then(F=>(S=!0,x=F,F)).catch(F=>{throw S=!0,I=F,F});let O=0;for(;!S;)await new Promise(F=>setTimeout(F,2e3)),S||(O++,yield{event:"on_structured_output_progress",data:{message:`Converting to structured output... (${O*2}s)`,elapsed:O*2}});if(I)throw I;x&&(yield{event:"on_structured_output",data:{output:x}},this.memoryEnabled&&this.addToHistory(new P(`Structured result: ${JSON.stringify(x)}`)),y.info("✅ Structured output successful"))}catch(S){y.warn(`⚠️ Structured output failed: ${S}`),yield{event:"on_structured_output_error",data:{error:S instanceof Error?S.message:String(S)}}}}else this.memoryEnabled&&_&&this.addToHistory(new P(_));console.log(`
|
|
390
|
+
`;function pr(t,e,n,r,s,o){if(typeof t=="object"&&t!==null){const i=t;return{query:i.prompt,maxSteps:i.maxSteps,manageConnector:i.manageConnector,externalHistory:i.externalHistory,outputSchema:i.schema,signal:i.signal}}return{query:t,maxSteps:e,manageConnector:n,externalHistory:r,outputSchema:s,signal:o}}R(pr,"normalizeRunOptions");var Zt,ky=(Zt=class{static getPackageVersion(){return Eu()}llm;client;connectors;maxSteps;autoInitialize;memoryEnabled;disallowedTools;additionalTools;toolsUsedNames=[];useServerManager;verbose;observe;systemPrompt;systemPromptTemplateOverride;additionalInstructions;_initialized=!1;conversationHistory=[];_agentExecutor=null;sessions={};systemMessage=null;_tools=[];adapter;serverManager=null;telemetry;modelProvider;modelName;observabilityManager;callbacks=[];metadata={};tags=[];isRemote=!1;remoteAgent=null;isSimplifiedMode=!1;llmString;llmConfig;mcpServersConfig;clientOwnedByAgent=!1;constructor(e){if(e.agentId){this.isRemote=!0,this.remoteAgent=new ly({agentId:e.agentId,apiKey:e.apiKey,baseUrl:e.baseUrl}),this.maxSteps=e.maxSteps??5,this.memoryEnabled=e.memoryEnabled??!0,this.autoInitialize=e.autoInitialize??!1,this.verbose=e.verbose??!1,this.observe=e.observe??!0,this.connectors=[],this.disallowedTools=[],this.additionalTools=[],this.useServerManager=!1,this.adapter=new xt,this.telemetry=Wr.getInstance(),this.modelProvider="remote",this.modelName="remote-agent",this.observabilityManager=new ki({customCallbacks:e.callbacks,agentId:e.agentId}),this.callbacks=[];return}if(!e.llm)throw new Error("llm is required for local execution. For remote execution, provide agentId instead.");if(typeof e.llm=="string"){if(this.isSimplifiedMode=!0,this.llmString=e.llm,this.llmConfig=e.llmConfig,this.mcpServersConfig=e.mcpServers,!this.mcpServersConfig||Object.keys(this.mcpServersConfig).length===0)throw new Error("Simplified mode requires 'mcpServers' configuration. Provide an object with server configurations, e.g., { filesystem: { command: 'npx', args: [...] } }");this.llm=void 0,this.client=void 0,this.clientOwnedByAgent=!0,this.connectors=[],y.info(`🎯 Simplified mode enabled: LLM will be created from '${this.llmString}'`)}else if(this.isSimplifiedMode=!1,this.llm=e.llm,this.client=e.client,this.connectors=e.connectors??[],this.clientOwnedByAgent=!1,!this.client&&this.connectors.length===0)throw new Error("Explicit mode requires either 'client' or at least one 'connector'. Alternatively, use simplified mode with 'llm' as a string and 'mcpServers' config.");if(this.maxSteps=e.maxSteps??5,this.autoInitialize=e.autoInitialize??!1,this.memoryEnabled=e.memoryEnabled??!0,this.systemPrompt=e.systemPrompt??null,this.systemPromptTemplateOverride=e.systemPromptTemplate??null,this.additionalInstructions=e.additionalInstructions??null,this.disallowedTools=e.disallowedTools??[],this.additionalTools=e.additionalTools??[],this.toolsUsedNames=e.toolsUsedNames??[],this.useServerManager=e.useServerManager??!1,this.verbose=e.verbose??!1,this.observe=e.observe??!0,this.isSimplifiedMode)this.adapter=e.adapter??new xt(this.disallowedTools),this.telemetry=Wr.getInstance(),this.modelProvider="unknown",this.modelName="unknown";else{if(this.useServerManager){if(!this.client)throw new Error("'client' must be provided when 'useServerManager' is true.");this.adapter=e.adapter??new xt(this.disallowedTools),this.serverManager=e.serverManagerFactory?.(this.client)??new Ci(this.client,this.adapter)}else this.adapter=e.adapter??new xt(this.disallowedTools);if(this.telemetry=Wr.getInstance(),this.llm){const[r,s]=Uo(this.llm);this.modelProvider=r,this.modelName=s}else this.modelProvider="unknown",this.modelName="unknown"}this.observabilityManager=new ki({customCallbacks:e.callbacks,verbose:this.verbose,observe:this.observe,agentId:e.agentId,metadataProvider:R(()=>this.getMetadata(),"metadataProvider"),tagsProvider:R(()=>this.getTags(),"tagsProvider")}),Object.defineProperty(this,"agentExecutor",{get:R(()=>this._agentExecutor,"get"),configurable:!0}),Object.defineProperty(this,"tools",{get:R(()=>this._tools,"get"),configurable:!0}),Object.defineProperty(this,"initialized",{get:R(()=>this._initialized,"get"),configurable:!0})}async initialize(){if(this.isRemote){this._initialized=!0;return}if(y.info("🚀 Initializing MCP agent and connecting to services..."),this.isSimplifiedMode){if(y.info("🎯 Simplified mode: Creating client and LLM from configuration..."),this.mcpServersConfig){y.info(`Creating MCPClient with ${Object.keys(this.mcpServersConfig).length} server(s)...`);const{MCPClient:r}=await nn(async()=>{const{MCPClient:s}=await import("./client-CPcfUEPp.js");return{MCPClient:s}},__vite__mapDeps([0,1,2]));this.client=new r({mcpServers:this.mcpServersConfig}),y.info("✅ MCPClient created successfully")}if(this.llmString){y.info(`Creating LLM from string: ${this.llmString}...`);try{this.llm=await vc(this.llmString,this.llmConfig),y.info("✅ LLM created successfully");const[r,s]=Uo(this.llm);this.modelProvider=r,this.modelName=s}catch(r){throw new Error(`Failed to create LLM from string '${this.llmString}': ${r?.message||r}`)}}if(this.useServerManager){if(!this.client)throw new Error("'client' must be available when 'useServerManager' is true.");this.serverManager=new Ci(this.client,this.adapter)}}this.callbacks=await this.observabilityManager.getCallbacks();const e=await this.observabilityManager.getHandlerNames();if(e.length>0&&y.info(`📊 Observability enabled with: ${e.join(", ")}`),this.useServerManager&&this.serverManager){await this.serverManager.initialize();const r=this.serverManager.tools;this._tools=r,this._tools.push(...this.additionalTools),y.info(`🔧 Server manager mode active with ${r.length} management tools`),await this.createSystemMessageFromTools(this._tools)}else{if(this.client){if(this.sessions=this.client.getAllActiveSessions(),y.info(`🔌 Found ${Object.keys(this.sessions).length} existing sessions`),Object.keys(this.sessions).filter(s=>s!=="code_mode").length===0&&(y.info("🔄 No active sessions found, creating new ones..."),this.sessions=await this.client.createAllSessions(),y.info(`✅ Created ${Object.keys(this.sessions).length} new sessions`)),this.client.codeMode){const s=this.sessions.code_mode;if(s)this._tools=await this.adapter.createToolsFromConnectors([s.connector]),y.info(`🛠️ Created ${this._tools.length} code mode tools`);else throw new Error("Code mode enabled but code_mode session not found")}else{const s=await this.adapter.createToolsFromConnectors(Object.values(this.sessions).map(a=>a.connector)),o=await this.adapter.createResourcesFromConnectors(Object.values(this.sessions).map(a=>a.connector)),i=await this.adapter.createPromptsFromConnectors(Object.values(this.sessions).map(a=>a.connector));this._tools=[...s,...o,...i],y.info(`🛠️ Created ${this._tools.length} LangChain items from client: ${s.length} tools, ${o.length} resources, ${i.length} prompts`)}this._tools.push(...this.additionalTools)}else{y.info(`🔗 Connecting to ${this.connectors.length} direct connectors...`);for(const i of this.connectors)i.isClientConnected||await i.connect();const r=await this.adapter.createToolsFromConnectors(this.connectors),s=await this.adapter.createResourcesFromConnectors(this.connectors),o=await this.adapter.createPromptsFromConnectors(this.connectors);this._tools=[...r,...s,...o],this._tools.push(...this.additionalTools),y.info(`🛠️ Created ${this._tools.length} LangChain items from connectors: ${r.length} tools, ${s.length} resources, ${o.length} prompts`)}y.info(`🧰 Found ${this._tools.length} tools across all connectors`),await this.createSystemMessageFromTools(this._tools)}this._agentExecutor=this.createAgent(),this._initialized=!0;const n=this.getMCPServerInfo();Object.keys(n).length>0&&(this.setMetadata(n),y.debug(`MCP server info added to metadata: ${JSON.stringify(n)}`)),y.info("✨ Agent initialization complete")}async createSystemMessageFromTools(e){const n=this.systemPromptTemplateOverride??hy;this.systemMessage=kc(e,n,dy,this.useServerManager,this.disallowedTools,this.systemPrompt??void 0,this.additionalInstructions??void 0),this.memoryEnabled&&(this.conversationHistory=[this.systemMessage,...this.conversationHistory.filter(r=>!(r instanceof oe))])}createAgent(){if(!this.llm)throw new Error("LLM is required to create agent");const e=this.systemMessage?.content??"You are a helpful assistant.",n=this._tools.map(o=>o.name);y.info(`🧠 Agent ready with tools: ${n.join(", ")}`);const r=[gc({runLimit:this.maxSteps})],s=Yl({model:this.llm,tools:this._tools,systemPrompt:e,middleware:r});return y.debug(`Created agent with max_steps=${this.maxSteps} (via ModelCallLimitMiddleware) and ${this.callbacks.length} callbacks`),s}getConversationHistory(){return[...this.conversationHistory]}clearConversationHistory(){this.conversationHistory=this.memoryEnabled&&this.systemMessage?[this.systemMessage]:[]}addToHistory(e){this.memoryEnabled&&this.conversationHistory.push(e)}getSystemMessage(){return this.systemMessage}setSystemMessage(e){this.systemMessage=new oe(e),this.memoryEnabled&&(this.conversationHistory=this.conversationHistory.filter(n=>!(n instanceof oe)),this.conversationHistory.unshift(this.systemMessage)),this._initialized&&this._tools.length&&(this._agentExecutor=this.createAgent(),y.debug("Agent recreated with new system message"))}setDisallowedTools(e){this.disallowedTools=e,this.adapter=new xt(this.disallowedTools),this._initialized&&y.debug("Agent already initialized. Changes will take effect on next initialization.")}getDisallowedTools(){return this.disallowedTools}setMetadata(e){const n=this.sanitizeMetadata(e);this.metadata={...this.metadata,...n},y.debug(`Metadata set: ${JSON.stringify(this.metadata)}`)}getMetadata(){return{...this.metadata}}setTags(e){const n=this.sanitizeTags(e);this.tags=[...new Set([...this.tags,...n])],y.debug(`Tags set: ${JSON.stringify(this.tags)}`)}getTags(){return[...this.tags]}sanitizeMetadata(e){const n={};for(const[r,s]of Object.entries(e)){if(typeof r!="string"||r.length===0){y.warn(`Invalid metadata key: ${r}. Skipping.`);continue}const o=r.replace(/[^\w-]/g,"_");if(s==null)n[o]=s;else if(typeof s=="string"||typeof s=="number"||typeof s=="boolean")n[o]=s;else if(Array.isArray(s)){const i=s.filter(a=>typeof a=="string"||typeof a=="number"||typeof a=="boolean");i.length>0&&(n[o]=i)}else if(typeof s=="object")try{const i=JSON.stringify(s);i.length>1e3?(y.warn(`Metadata value for key '${o}' is too large. Truncating.`),n[o]=`${i.substring(0,1e3)}...`):n[o]=s}catch(i){y.warn(`Failed to serialize metadata value for key '${o}': ${i}. Skipping.`)}else y.warn(`Unsupported metadata value type for key '${o}': ${typeof s}. Skipping.`)}return n}sanitizeTags(e){return e.filter(n=>typeof n=="string"&&n.length>0).map(n=>n.replace(/[^\w:-]/g,"_")).filter(n=>n.length<=50)}getMCPServerInfo(){const e={};try{if(this.client){const n=this.client.getServerNames();e.mcp_servers_count=n.length,e.mcp_server_names=n;const r={};for(const s of n)try{const o=this.client.getServerConfig(s);if(o){let i="unknown";o.command?i="command":o.url?i="http":o.ws_url&&(i="websocket"),r[s]={type:i,has_args:!!o.args,has_env:!!o.env,has_headers:!!o.headers,url:o.url||null,command:o.command||null}}}catch(o){y.warn(`Failed to get config for server '${s}': ${o}`),r[s]={type:"error",error:"config_unavailable"}}e.mcp_server_configs=r}else this.connectors&&this.connectors.length>0&&(e.mcp_servers_count=this.connectors.length,e.mcp_server_names=this.connectors.map(n=>n.publicIdentifier),e.mcp_server_types=this.connectors.map(n=>n.constructor.name))}catch(n){y.warn(`Failed to collect MCP server info: ${n}`),e.error="collection_failed"}return e}_normalizeOutput(e){try{if(typeof e=="string")return e;if(e&&typeof e=="object"&&"content"in e)return this._normalizeOutput(e.content);if(Array.isArray(e)){const n=[];for(const r of e)if(typeof r=="object"&&r!==null)"text"in r&&typeof r.text=="string"?n.push(r.text):"content"in r?n.push(this._normalizeOutput(r.content)):n.push(String(r));else{const s=r&&typeof r=="object"&&"text"in r?r.text:null;if(typeof s=="string")n.push(s);else{const o=r&&typeof r=="object"&&"content"in r?r.content:r;n.push(this._normalizeOutput(o))}}return n.join("")}return String(e)}catch{return String(e)}}_isAIMessageLike(e){if(e instanceof P)return!0;if(typeof e!="object"||e===null)return!1;const n=e;if(typeof n.getType=="function")try{const r=n.getType();if(r==="ai"||r==="assistant")return!0}catch{}if(typeof n._getType=="function")try{const r=n._getType();if(r==="ai"||r==="assistant")return!0}catch{}return"type"in n?n.type==="ai"||n.type==="assistant":"role"in n?n.role==="ai"||n.role==="assistant":!1}_messageHasToolCalls(e){return typeof e=="object"&&e!==null&&"tool_calls"in e&&Array.isArray(e.tool_calls)?e.tool_calls.length>0:!1}_isHumanMessageLike(e){if(e instanceof se)return!0;if(typeof e!="object"||e===null)return!1;const n=e;if(typeof n.getType=="function")try{const r=n.getType();if(r==="human"||r==="user")return!0}catch{}return"type"in n&&(n.type==="human"||n.type==="user")||"role"in n&&(n.role==="human"||n.role==="user")}_isToolMessageLike(e){if(e instanceof j)return!0;if(typeof e!="object"||e===null)return!1;const n=e;if(typeof n.getType=="function")try{if(n.getType()==="tool")return!0}catch{}return"type"in n&&n.type==="tool"}_getMessageContent(e){if(e instanceof P||e&&typeof e=="object"&&"content"in e)return e.content}async _consumeAndReturn(e){for(;;){const{done:n,value:r}=await e.next();if(n)return r}}async run(e,n,r,s,o,i){const{query:a,maxSteps:l,manageConnector:c,externalHistory:u,outputSchema:d,signal:h}=pr(e,n,r,s,o,i);if(this.isRemote&&this.remoteAgent)return this.remoteAgent.run(a,l,c,u,d);const f=this.stream(a,l,c,u,d,h);return this._consumeAndReturn(f)}async*stream(e,n,r=!0,s,o,i){const{query:a,maxSteps:l,manageConnector:c,externalHistory:u,outputSchema:d,signal:h}=pr(e,n,r,s,o,i);if(this.isRemote&&this.remoteAgent)return await this.remoteAgent.run(a,l,c,u,d);let f=!1;const m=Date.now();let p=!1,C=null,k=0;try{if(c&&!this._initialized?(await this.initialize(),f=!0):!this._initialized&&this.autoInitialize&&(await this.initialize(),f=!0),!this._agentExecutor)throw new Error("MCP agent failed to initialize");if(this.useServerManager&&this.serverManager){const b=this.serverManager.tools,E=new Set(b.map(x=>x.name)),S=new Set(this._tools.map(x=>x.name));(E.size!==S.size||[...E].some(x=>!S.has(x)))&&(y.info(`🔄 Tools changed before execution, updating agent. New tools: ${[...E].join(", ")}`),this._tools=b,this._tools.push(...this.additionalTools),await this.createSystemMessageFromTools(this._tools),this._agentExecutor=this.createAgent())}const T=u??this.conversationHistory,_=[];for(const b of T)(this._isHumanMessageLike(b)||this._isAIMessageLike(b)||this._isToolMessageLike(b))&&_.push(b);const g=a.length>50?`${a.slice(0,50).replace(/\n/g," ")}...`:a.replace(/\n/g," ");y.info(`💬 Received query: '${g}'`),y.info("🏁 Starting agent execution");const v=3;let M=0;const w=[..._,new se(a)];for(;M<=v;){const b={messages:w};let E=!1;const S=await this._agentExecutor.stream(b,{streamMode:"updates",callbacks:this.callbacks,metadata:this.getMetadata(),tags:this.getTags(),runName:this.metadata.trace_name||"mcp-use-agent",recursionLimit:this.maxSteps*3,...this.metadata.session_id&&{sessionId:this.metadata.session_id},...h&&{signal:h}});for await(const x of S){if(h?.aborted)break;for(const[I,O]of Object.entries(x))if(y.debug(`📦 Node '${I}' output: ${JSON.stringify(O)}`),O&&typeof O=="object"&&"messages"in O){let F=O.messages;Array.isArray(F)||(F=[F]);for(const ce of F)w.includes(ce)||w.push(ce);for(const ce of F){if("tool_calls"in ce&&Array.isArray(ce.tool_calls)&&ce.tool_calls.length>0)for(const Ie of ce.tool_calls){const we=Ie.name||"unknown",ht=Ie.args||{};this.toolsUsedNames.push(we),k++;let Je=JSON.stringify(ht);Je.length>100&&(Je=`${Je.slice(0,97)}...`),y.info(`🔧 Tool call: ${we} with input: ${Je}`),yield{action:{tool:we,toolInput:ht,log:`Calling tool ${we}`},observation:""}}if(this._isToolMessageLike(ce)){const Ie=ce.content;let we=String(Ie);if(we.length>100&&(we=`${we.slice(0,97)}...`),we=we.replace(/\n/g," "),y.info(`📄 Tool result: ${we}`),this.useServerManager&&this.serverManager){const ht=this.serverManager.tools,Je=new Set(ht.map(fn=>fn.name)),$o=new Set(this._tools.map(fn=>fn.name));if(Je.size!==$o.size||[...Je].some(fn=>!$o.has(fn))){y.info(`🔄 Tools changed during execution. New tools: ${[...Je].join(", ")}`),this._tools=ht,this._tools.push(...this.additionalTools),await this.createSystemMessageFromTools(this._tools),this._agentExecutor=this.createAgent(),E=!0,M++,y.info(`🔃 Restarting execution with updated tools (restart ${M}/${v})`);break}}}this._isAIMessageLike(ce)&&!this._messageHasToolCalls(ce)&&(C=this._normalizeOutput(this._getMessageContent(ce)),y.info("✅ Agent finished with output"))}if(E)break}if(E)break}if(!E)break;if(M>v){y.warn(`⚠️ Max restarts (${v}) reached. Continuing with current tools.`);break}}if(this.memoryEnabled){const b=w.slice(_.length);for(const E of b)this.addToHistory(E)}if(d&&C)try{y.info("🔧 Attempting structured output...");const b=await this._attemptStructuredOutput(C,this.llm,d);return this.memoryEnabled&&this.addToHistory(new P(`Structured result: ${JSON.stringify(b)}`)),y.info("✅ Structured output successful"),p=!0,b}catch(b){throw y.error(`❌ Structured output failed: ${b}`),new Error(`Failed to generate structured output: ${b instanceof Error?b.message:String(b)}`)}return y.info(`🎉 Agent execution complete in ${((Date.now()-m)/1e3).toFixed(2)} seconds`),p=!0,C||"No output generated"}catch(T){throw y.error(`❌ Error running query: ${T}`),f&&c&&(y.info("🧹 Cleaning up resources after error"),await this.close()),T}finally{const T=Date.now()-m;let _=0;this.client?_=Object.keys(this.client.getAllActiveSessions()).length:this.connectors&&(_=this.connectors.length);const g=this.memoryEnabled?this.conversationHistory.length:0,v=this._tools||[];await this.telemetry.trackAgentExecution({executionMethod:"stream",query:a,success:p,modelProvider:this.modelProvider,modelName:this.modelName,serverCount:_,serverIdentifiers:this.connectors.map(M=>M.publicIdentifier),totalToolsAvailable:v.length,toolsAvailableNames:v.map(M=>M.name),maxStepsConfigured:this.maxSteps,memoryEnabled:this.memoryEnabled,useServerManager:this.useServerManager,maxStepsUsed:l??null,manageConnector:c??!0,externalHistoryUsed:u!==void 0,stepsTaken:k,toolsUsedCount:this.toolsUsedNames.length,toolsUsedNames:this.toolsUsedNames,response:C||"",executionTimeMs:T,errorType:p?null:"execution_error",conversationHistoryLength:g}),c&&!this.client&&f&&(y.info("🧹 Closing agent after stream completion"),await this.close())}}async flush(){this.isRemote&&this.remoteAgent||(y.debug("Flushing observability traces..."),await this.observabilityManager.flush())}async close(){if(this.isRemote&&this.remoteAgent){await this.remoteAgent.close();return}y.info("🔌 Closing MCPAgent resources…"),await this.observabilityManager.shutdown();try{if(this._agentExecutor=null,this._tools=[],this.client)this.clientOwnedByAgent?(y.info("🔄 Closing internally-created client (simplified mode) and cleaning up resources"),await this.client.close(),this.sessions={},this.client=void 0):(y.info("🔄 Closing client and cleaning up resources"),await this.client.close(),this.sessions={});else for(const e of this.connectors)y.info("🔄 Disconnecting connector"),await e.disconnect();this.isSimplifiedMode&&this.llm&&(y.debug("🔄 Clearing LLM reference (simplified mode)"),this.llm=void 0),"connectorToolMap"in this.adapter&&(this.adapter=new xt)}finally{this._initialized=!1,y.info("👋 Agent closed successfully")}}async*prettyStreamEvents(e,n,r=!0,s,o){const{prettyStreamEvents:i}=await nn(async()=>{const{prettyStreamEvents:l}=await import("./display-A5IEINAP-BoThkrNQ.js");return{prettyStreamEvents:l}},__vite__mapDeps([3,1,2])),a="";for await(const l of i(this.streamEvents(e,n,r,s,o)))yield;return a}async*streamEvents(e,n,r=!0,s,o,i){const a=pr(e,n,r,s,o,i);let{query:l}=a;const{maxSteps:c,manageConnector:u,externalHistory:d,outputSchema:h,signal:f}=a;let m=!1;const p=Date.now();let C=!1,k=0,T=0,_="";h&&(l=this._enhanceQueryWithSchema(l,h));try{u&&!this._initialized?(await this.initialize(),m=!0):!this._initialized&&this.autoInitialize&&(await this.initialize(),m=!0);const g=this._agentExecutor;if(!g)throw new Error("MCP agent failed to initialize");this.maxSteps=c??this.maxSteps;const v=typeof l=="string"&&l.length>50?`${l.slice(0,50).replace(/\n/g," ")}...`:typeof l=="string"?l.replace(/\n/g," "):String(l);y.info(`💬 Received query for streamEvents: '${v}'`),this.memoryEnabled&&(y.info(`🔄 Adding user message to history: ${v}`),this.addToHistory(new se({content:l})));const M=d??this.conversationHistory,w=[];for(const S of M)this._isHumanMessageLike(S)||this._isAIMessageLike(S)||this._isToolMessageLike(S)?w.push(S):y.info(`⚠️ Skipped message of type: ${S.constructor?.name||typeof S}`);const b=[...w,new se(l)];y.info("callbacks",this.callbacks);const E=g.streamEvents({messages:b},{streamMode:"messages",version:"v2",callbacks:this.callbacks,metadata:this.getMetadata(),tags:this.getTags(),runName:this.metadata.trace_name||"mcp-use-agent",recursionLimit:this.maxSteps*3,...this.metadata.session_id&&{sessionId:this.metadata.session_id},...f&&{signal:f}});for await(const S of E){if(f?.aborted)break;if(k++,!(!S||typeof S!="object")){if(S.event==="on_chat_model_stream"&&S.data?.chunk?.content&&(T+=S.data.chunk.content.length),S.event==="on_chat_model_stream"&&S.data?.chunk){const x=S.data.chunk;if(x.content){_||(_="");const I=this._normalizeOutput(x.content);_+=I,y.debug(`📝 Accumulated response length: ${_.length}`)}}if(yield S,S.event==="on_chain_end"&&S.data?.output&&!_){const x=S.data.output;Array.isArray(x)&&x.length>0&&x[0]?.text?_=x[0].text:typeof x=="string"?_=x:x&&typeof x=="object"&&"output"in x&&(_=x.output)}}}if(h&&_){y.info("🔧 Attempting structured output conversion...");try{let S=!1,x=null,I=null;this._attemptStructuredOutput(_,this.llm,h).then(F=>(S=!0,x=F,F)).catch(F=>{throw S=!0,I=F,F});let O=0;for(;!S;)await new Promise(F=>setTimeout(F,2e3)),S||(O++,yield{event:"on_structured_output_progress",data:{message:`Converting to structured output... (${O*2}s)`,elapsed:O*2}});if(I)throw I;x&&(yield{event:"on_structured_output",data:{output:x}},this.memoryEnabled&&this.addToHistory(new P(`Structured result: ${JSON.stringify(x)}`)),y.info("✅ Structured output successful"))}catch(S){y.warn(`⚠️ Structured output failed: ${S}`),yield{event:"on_structured_output_error",data:{error:S instanceof Error?S.message:String(S)}}}}else this.memoryEnabled&&_&&this.addToHistory(new P(_));console.log(`
|
|
391
391
|
|
|
392
392
|
`),y.info(`🎉 StreamEvents complete - ${k} events emitted`),C=!0}catch(g){throw y.error(`❌ Error during streamEvents: ${g}`),m&&u&&(y.info("🧹 Cleaning up resources after initialization error in streamEvents"),await this.close()),g}finally{const g=Date.now()-p;let v=0;this.client?v=Object.keys(this.client.getAllActiveSessions()).length:this.connectors&&(v=this.connectors.length);const M=this.memoryEnabled?this.conversationHistory.length:0;await this.telemetry.trackAgentExecution({executionMethod:"streamEvents",query:l,success:C,modelProvider:this.modelProvider,modelName:this.modelName,serverCount:v,serverIdentifiers:this.connectors.map(w=>w.publicIdentifier),totalToolsAvailable:this._tools.length,toolsAvailableNames:this._tools.map(w=>w.name),maxStepsConfigured:this.maxSteps,memoryEnabled:this.memoryEnabled,useServerManager:this.useServerManager,maxStepsUsed:c??null,manageConnector:u??!0,externalHistoryUsed:d!==void 0,response:`[STREAMED RESPONSE - ${T} chars]`,executionTimeMs:g,errorType:C?null:"streaming_error",conversationHistoryLength:M}),u&&!this.client&&m&&(y.info("🧹 Closing agent after streamEvents completion"),await this.close())}}async _attemptStructuredOutput(e,n,r){y.info(`🔄 Attempting structured output with schema: ${JSON.stringify(r,null,2)}`),y.info(`🔄 Raw result: ${JSON.stringify(e,null,2)}`);let s=null,o="";if(y.debug(`🔄 Structured output requested, schema: ${JSON.stringify(Yn(r),null,2)}`),n&&"withStructuredOutput"in n&&typeof n.withStructuredOutput=="function")s=n.withStructuredOutput(r);else if(n)s=n;else throw new Error("LLM is required for structured output");const i=Yn(r),{$schema:a,additionalProperties:l,...c}=i;o=JSON.stringify(c,null,2),y.info(`🔄 Schema description: ${o}`);let u="";typeof e=="string"?u=e:e&&typeof e=="object"&&(u=JSON.stringify(e)),y.info("rawResult",e),u||(u=JSON.stringify(e));const d=3;let h="";for(let f=1;f<=d;f++){y.info(`🔄 Structured output attempt ${f}/${d}`);let m=`
|
|
393
393
|
Please format the following information according to the EXACT schema specified below.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as f}from"./index-
|
|
1
|
+
import{r as f}from"./index-CD_ljDun.js";import{r as s}from"./c-DkSi4Vcz.js";function i(t,n){for(var o=0;o<n.length;o++){const e=n[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const c=Object.getOwnPropertyDescriptor(e,r);c&&Object.defineProperty(t,r,c.get?c:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var a=s();const p=f(a),g=i({__proto__:null,default:p},[a]);export{g as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a}from"./index-
|
|
1
|
+
import{r as a}from"./index-CD_ljDun.js";import{r as f}from"./c-like-BLVencsc.js";function s(t,c){for(var o=0;o<c.length;o++){const e=c[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const i=Object.getOwnPropertyDescriptor(e,r);i&&Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var n=f();const p=a(n),g=s({__proto__:null,default:p},[n]);export{g as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as f}from"./index-
|
|
1
|
+
import{r as f}from"./index-CD_ljDun.js";import{r as s}from"./cal-Bok_ig3y.js";function l(t,c){for(var o=0;o<c.length;o++){const e=c[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const a=Object.getOwnPropertyDescriptor(e,r);a&&Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var n=s();const i=f(n),g=l({__proto__:null,default:i},[n]);export{g as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c}from"./index-
|
|
1
|
+
import{r as c}from"./index-CD_ljDun.js";import{r as f}from"./capnproto-uQZ1jOWw.js";function s(t,p){for(var o=0;o<p.length;o++){const r=p[o];if(typeof r!="string"&&!Array.isArray(r)){for(const e in r)if(e!=="default"&&!(e in t)){const n=Object.getOwnPropertyDescriptor(r,e);n&&Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>r[e]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var a=f();const i=c(a),g=s({__proto__:null,default:i},[a]);export{g as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as f}from"./index-
|
|
1
|
+
import{r as f}from"./index-CD_ljDun.js";import{r as s}from"./ceylon-CLrvJLwU.js";function l(t,c){for(var o=0;o<c.length;o++){const e=c[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const n=Object.getOwnPropertyDescriptor(e,r);n&&Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var a=s();const i=f(a),y=l({__proto__:null,default:i},[a]);export{y as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as f}from"./index-
|
|
1
|
+
import{r as f}from"./index-CD_ljDun.js";import{r as s}from"./clean-jkCpP5TC.js";function l(t,a){for(var o=0;o<a.length;o++){const e=a[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const n=Object.getOwnPropertyDescriptor(e,r);n&&Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var c=s();const i=f(c),g=l({__proto__:null,default:i},[c]);export{g as c};
|