@cc-monitoring/proxy-core 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -35
- package/dist/cli/commands/doc.d.ts +4 -0
- package/dist/cli/commands/doc.js +31 -0
- package/dist/cli/index.js +7 -0
- package/dist/config/index.js +2 -1
- package/dist/config/schema.d.ts +48 -0
- package/dist/config/schema.js +11 -1
- package/dist/parsers/docx-loader.d.ts +5 -0
- package/dist/parsers/docx-loader.js +15 -0
- package/dist/parsers/index.d.ts +3 -0
- package/dist/parsers/index.js +10 -0
- package/dist/parsers/md-loader.d.ts +5 -0
- package/dist/parsers/md-loader.js +13 -0
- package/dist/parsers/registry.d.ts +8 -0
- package/dist/parsers/registry.js +32 -0
- package/dist/parsers/types.d.ts +4 -0
- package/dist/parsers/types.js +1 -0
- package/dist/parsers/xlsx-loader.d.ts +5 -0
- package/dist/parsers/xlsx-loader.js +34 -0
- package/dist/server/__tests__/providers-route.test.js +4 -3
- package/dist/server/__tests__/proxy.test.js +11 -1
- package/dist/server/chat-route.d.ts +3 -0
- package/dist/server/chat-route.js +401 -0
- package/dist/server/claude-settings-route.d.ts +2 -0
- package/dist/server/claude-settings-route.js +76 -0
- package/dist/server/data-push.d.ts +3 -1
- package/dist/server/data-push.js +10 -3
- package/dist/server/docs-route.d.ts +2 -0
- package/dist/server/docs-route.js +63 -0
- package/dist/server/index.js +4 -0
- package/dist/server/mcp-route.d.ts +2 -0
- package/dist/server/mcp-route.js +161 -0
- package/dist/server/proxy.d.ts +4 -1
- package/dist/server/proxy.js +289 -128
- package/dist/server/ui-route.js +123 -46
- package/dist/tools/mcp-bridge.d.ts +13 -0
- package/dist/tools/mcp-bridge.js +36 -0
- package/dist/tools/registry.js +10 -4
- package/dist/ui/assets/{1c-CgVqmGt6.js → 1c-KmWe8RWs.js} +1 -1
- package/dist/ui/assets/{abnf-JPM4b6fj.js → abnf-BKQ6qIuo.js} +1 -1
- package/dist/ui/assets/{abnfDiagram-VRR7QNED-DJkd8PHl.js → abnfDiagram-VRR7QNED-CkRuDPu1.js} +1 -1
- package/dist/ui/assets/{accesslog-CLIMhXWi.js → accesslog-DD9H5Ktc.js} +1 -1
- package/dist/ui/assets/{actionscript-DqniQGld.js → actionscript-CAjf2Qtd.js} +1 -1
- package/dist/ui/assets/{ada-2BFfY7fF.js → ada-BXkXW16O.js} +1 -1
- package/dist/ui/assets/{angelscript-C47qRqcs.js → angelscript-BxT7o0Up.js} +1 -1
- package/dist/ui/assets/{apache-DP-LC5-h.js → apache-C5z_tmVm.js} +1 -1
- package/dist/ui/assets/{applescript-BB0gk3HQ.js → applescript-DdIxl8rr.js} +1 -1
- package/dist/ui/assets/{arc-D8wRCC4D.js → arc-hSdFaqKn.js} +1 -1
- package/dist/ui/assets/{arcade-1R6g1VPm.js → arcade-D5m0roat.js} +1 -1
- package/dist/ui/assets/{architectureDiagram-ZJ3FMSHR-CbHhHV9v.js → architectureDiagram-ZJ3FMSHR-DOSHSqzf.js} +1 -1
- package/dist/ui/assets/{arduino-B8YryK0R.js → arduino-FDap8kq-.js} +1 -1
- package/dist/ui/assets/{armasm-CYdj7mzR.js → armasm-Kzp-Jr1v.js} +1 -1
- package/dist/ui/assets/{asciidoc-bZ11zz6i.js → asciidoc-DbGMW3EE.js} +1 -1
- package/dist/ui/assets/{aspectj-D5WPU-RQ.js → aspectj-CVYMmBCO.js} +1 -1
- package/dist/ui/assets/{autohotkey-70tZvCLL.js → autohotkey-9PmBGTPd.js} +1 -1
- package/dist/ui/assets/{autoit-CX2GaaHP.js → autoit-B4F86jgh.js} +1 -1
- package/dist/ui/assets/{avrasm-C154El0d.js → avrasm-CSzv2eHX.js} +1 -1
- package/dist/ui/assets/{awk-DdXKOeux.js → awk-CjsvYvZE.js} +1 -1
- package/dist/ui/assets/{axapta-CwLwkXST.js → axapta-BVgMoNRY.js} +1 -1
- package/dist/ui/assets/{bash-Uu61S1nB.js → bash-IeBjW3pt.js} +1 -1
- package/dist/ui/assets/{basic-CeiAWoiF.js → basic-BTFJfmV1.js} +1 -1
- package/dist/ui/assets/{blockDiagram-677ZJIJ3-DcvhphUd.js → blockDiagram-677ZJIJ3-DLw3Bbhf.js} +1 -1
- package/dist/ui/assets/{bnf-B5KF61QW.js → bnf-rCkeRYk0.js} +1 -1
- package/dist/ui/assets/{brainfuck-CP0Y7_VW.js → brainfuck-DBHuB3uZ.js} +1 -1
- package/dist/ui/assets/{coq-D-WTlq_d.js → c-C95V0zHL.js} +1 -1
- package/dist/ui/assets/{c-like-DXr53gS6.js → c-like-CK1xGeX_.js} +1 -1
- package/dist/ui/assets/{c4Diagram-LMCZKHZV-Cn017lmJ.js → c4Diagram-LMCZKHZV-cqY51yJw.js} +1 -1
- package/dist/ui/assets/{cal-7ld1j-Wh.js → cal-BxGPpEZK.js} +1 -1
- package/dist/ui/assets/{capnproto-DrddNBCZ.js → capnproto-Bo2fgXF9.js} +1 -1
- package/dist/ui/assets/{ceylon-XPuE6IIL.js → ceylon-C4Bb4pNB.js} +1 -1
- package/dist/ui/assets/channel-D9Y4iN1l.js +1 -0
- package/dist/ui/assets/{chunk-2Q5K7J3B-BoX3IESS.js → chunk-2Q5K7J3B-CGTiTBmo.js} +1 -1
- package/dist/ui/assets/{chunk-32BRIVSS-C300ACzq.js → chunk-32BRIVSS-DWagYBp9.js} +1 -1
- package/dist/ui/assets/{chunk-5VM5RSS4-MtSkFsde.js → chunk-5VM5RSS4-BzSBMKJX.js} +1 -1
- package/dist/ui/assets/{chunk-EX3LRPZG-CEeHrGNV.js → chunk-EX3LRPZG-4-aKwCgZ.js} +1 -1
- package/dist/ui/assets/{chunk-JWPE2WC7-DTRgpK0R.js → chunk-JWPE2WC7-CPC_cBN0.js} +1 -1
- package/dist/ui/assets/{chunk-MOJQB5TN-DiOl0HJx.js → chunk-MOJQB5TN-DrDE4H9w.js} +1 -1
- package/dist/ui/assets/{chunk-RYQCIY6F-CVC3opqY.js → chunk-RYQCIY6F-DkdXe_kU.js} +1 -1
- package/dist/ui/assets/{chunk-V7JOEXUC-yQYlqQCC.js → chunk-V7JOEXUC-Da6EWcQt.js} +1 -1
- package/dist/ui/assets/{chunk-VR4S4FIN-iAA8ZgkK.js → chunk-VR4S4FIN-nP6dstD5.js} +1 -1
- package/dist/ui/assets/{chunk-XXDRQBXY-B303eieF.js → chunk-XXDRQBXY-Bi_rRAPA.js} +1 -1
- package/dist/ui/assets/classDiagram-OUVF2IWQ-C4UVH6RI.js +1 -0
- package/dist/ui/assets/classDiagram-v2-EOCWNBFH-C4UVH6RI.js +1 -0
- package/dist/ui/assets/{clean-MfHaW_uS.js → clean-cc1m9AxK.js} +1 -1
- package/dist/ui/assets/{clojure-9L8TfiWA.js → clojure-DX5V8QA8.js} +1 -1
- package/dist/ui/assets/{clojure-repl-CjsH9sxr.js → clojure-repl-FzjnVNWQ.js} +1 -1
- package/dist/ui/assets/{cmake-D0D1Q30G.js → cmake-COZZyrKs.js} +1 -1
- package/dist/ui/assets/{coffeescript-BI4jWZnB.js → coffeescript-DBsnOmC4.js} +1 -1
- package/dist/ui/assets/{c-BgqCrSpv.js → coq-TwFFolHa.js} +1 -1
- package/dist/ui/assets/{cos-DHax5LIJ.js → cos-Dm5g-IQT.js} +1 -1
- package/dist/ui/assets/{cose-bilkent-JH36ORCC-BzrKmTAZ.js → cose-bilkent-JH36ORCC-B3-weOQF.js} +1 -1
- package/dist/ui/assets/{cpp-M4aMPUas.js → cpp-_RZxQjg7.js} +1 -1
- package/dist/ui/assets/{crmsh-DAAczfR0.js → crmsh-DGPJ11Gt.js} +1 -1
- package/dist/ui/assets/{crystal-7g2CpWm4.js → crystal-BOMSPGge.js} +1 -1
- package/dist/ui/assets/{csharp-DW5GdKKf.js → csharp-DZXiHH72.js} +1 -1
- package/dist/ui/assets/{csp-Bq74fG7-.js → csp-DDSIMUoU.js} +1 -1
- package/dist/ui/assets/{css-DHyeLXff.js → css-Bjye-ZWr.js} +1 -1
- package/dist/ui/assets/{cynefin-VYW2F7L2-DwV1t9iV.js → cynefin-VYW2F7L2-Cj5c4L3y.js} +1 -1
- package/dist/ui/assets/{cynefinDiagram-TSTJHNR4-kBCFRYPz.js → cynefinDiagram-TSTJHNR4-BYsfTeNX.js} +1 -1
- package/dist/ui/assets/{d-yey2lm3v.js → d-22pfurOx.js} +1 -1
- package/dist/ui/assets/{dagre-VKFMJZFB-CErVJ1s0.js → dagre-VKFMJZFB-DiEob-by.js} +1 -1
- package/dist/ui/assets/{dart-BadDxflP.js → dart-Doiu8cDW.js} +1 -1
- package/dist/ui/assets/{delphi-CqzVqtDp.js → delphi-CQ7epp84.js} +1 -1
- package/dist/ui/assets/{diagram-FQU43EPY-C7zAW2DU.js → diagram-FQU43EPY-BOPbQcL4.js} +1 -1
- package/dist/ui/assets/{diagram-G47NLZAW-CbUb6BZI.js → diagram-G47NLZAW-C1UWDJTx.js} +1 -1
- package/dist/ui/assets/{diagram-NH7WQ7WH-C5mgi3dn.js → diagram-NH7WQ7WH-CYsBqW3J.js} +1 -1
- package/dist/ui/assets/{diagram-OA4YK3LP-Cok2YNfS.js → diagram-OA4YK3LP-Dnag0x_3.js} +1 -1
- package/dist/ui/assets/{diagram-WEI45ONY-BODuP2EB.js → diagram-WEI45ONY-Bo4CsDoj.js} +1 -1
- package/dist/ui/assets/{diff-EVigJ-h2.js → diff-Cs6VQQZt.js} +1 -1
- package/dist/ui/assets/{django-BH2EEal6.js → django-Bo3okOrw.js} +1 -1
- package/dist/ui/assets/{dns-BSc8VTm8.js → dns-BpG60eIX.js} +1 -1
- package/dist/ui/assets/{dockerfile-Br_pZjru.js → dockerfile-BWyH8SlV.js} +1 -1
- package/dist/ui/assets/{dos-Bx3ludet.js → dos-DWlNbaB9.js} +1 -1
- package/dist/ui/assets/{dsconfig-DSI-ePne.js → dsconfig-D_8y8YrJ.js} +1 -1
- package/dist/ui/assets/{dts-ClCuE1Xq.js → dts-Cz4SyMYR.js} +1 -1
- package/dist/ui/assets/{dust-CC9Z8iuW.js → dust-Cu4qLkeH.js} +1 -1
- package/dist/ui/assets/{ebnf-DI0w_fbi.js → ebnf-CTVHui3r.js} +1 -1
- package/dist/ui/assets/{ebnfDiagram-CCIWWBDH-CgsnO8Qm.js → ebnfDiagram-CCIWWBDH-epcXQLEj.js} +1 -1
- package/dist/ui/assets/{elixir-hdzZik8p.js → elixir-MAlwXhfU.js} +1 -1
- package/dist/ui/assets/{elm-DJAgqt5I.js → elm-Bdmwbvef.js} +1 -1
- package/dist/ui/assets/{erDiagram-Q63AITRT-K4zJcEKd.js → erDiagram-Q63AITRT-Bb60TqAM.js} +1 -1
- package/dist/ui/assets/{erb-Cq4OQqkl.js → erb-Ce9TpP4g.js} +1 -1
- package/dist/ui/assets/{erlang-CHoXLODu.js → erlang-CN2GEiqk.js} +1 -1
- package/dist/ui/assets/{erlang-repl-Brp70Zip.js → erlang-repl-D8K4O_cp.js} +1 -1
- package/dist/ui/assets/{excel-DjS-QR9P.js → excel-eVZU1r0f.js} +1 -1
- package/dist/ui/assets/{fix-BsO9Oq6H.js → fix-BzKerEv0.js} +1 -1
- package/dist/ui/assets/{flix-2A7CKozm.js → flix-B9CE3skV.js} +1 -1
- package/dist/ui/assets/{flowDiagram-23GEKE2U-Ck4tfxWX.js → flowDiagram-23GEKE2U-DzMLZIyt.js} +1 -1
- package/dist/ui/assets/{fortran-BQu3wORI.js → fortran-B4__3vos.js} +1 -1
- package/dist/ui/assets/{fsharp-D439S6PZ.js → fsharp-BJ3-ARHz.js} +1 -1
- package/dist/ui/assets/{gams-CPRxKfRH.js → gams-Cu43oSYT.js} +1 -1
- package/dist/ui/assets/{ganttDiagram-NO4QXBWP-QTPyXXxa.js → ganttDiagram-NO4QXBWP-D_aAoMRP.js} +1 -1
- package/dist/ui/assets/{gauss-GJFW9Vod.js → gauss-T8vk_TpE.js} +1 -1
- package/dist/ui/assets/{gcode-CF6woDAl.js → gcode-9j3BicpZ.js} +1 -1
- package/dist/ui/assets/{gherkin-Co-YjHfW.js → gherkin-Dyh5KFG-.js} +1 -1
- package/dist/ui/assets/{gitGraphDiagram-IHSO6WYX-Do9VfPHL.js → gitGraphDiagram-IHSO6WYX-CMxCHC-Z.js} +1 -1
- package/dist/ui/assets/{glsl-D3lldBTJ.js → glsl-DWWjN4ts.js} +1 -1
- package/dist/ui/assets/{gml-DyoCibnw.js → gml-BcYE-D5A.js} +1 -1
- package/dist/ui/assets/{go-BNeAS1jC.js → go-DUnUzOEI.js} +1 -1
- package/dist/ui/assets/{golo-BuXecWAH.js → golo-BDoc1QQL.js} +1 -1
- package/dist/ui/assets/{gradle-BP7ToLe9.js → gradle-B_WRa_bT.js} +1 -1
- package/dist/ui/assets/{groovy-GqWVT09g.js → groovy-CgjqFq1e.js} +1 -1
- package/dist/ui/assets/{haml-SLbvCHsC.js → haml-DCqcg7Ti.js} +1 -1
- package/dist/ui/assets/{handlebars-BnaCJTc5.js → handlebars-DSDUQrnw.js} +1 -1
- package/dist/ui/assets/{haskell-CrX9ftWp.js → haskell-DPVnctVi.js} +1 -1
- package/dist/ui/assets/{haxe-DNoaIxsE.js → haxe-BuCGXBa4.js} +1 -1
- package/dist/ui/assets/{hsp-CLjy3djj.js → hsp-BTKpS_u0.js} +1 -1
- package/dist/ui/assets/{htmlbars-w96Kz5NL.js → htmlbars-Cql3Jvy2.js} +1 -1
- package/dist/ui/assets/{http-VIMXIxM8.js → http-BB8I9jUh.js} +1 -1
- package/dist/ui/assets/{hy-_qE83_aW.js → hy-DG7xkZNz.js} +1 -1
- package/dist/ui/assets/index-CK_lJsTu.css +10 -0
- package/dist/ui/assets/index-CfTIGTiY.js +2677 -0
- package/dist/ui/assets/{index-DpcPfZl3.js → index-DqIiCkSD.js} +3 -3
- package/dist/ui/assets/{infoDiagram-FWYZ7A6U-D9O7SZ2X.js → infoDiagram-FWYZ7A6U-DIzEV-BJ.js} +1 -1
- package/dist/ui/assets/{inform7-CnyW73C1.js → inform7-BWNpVEkA.js} +1 -1
- package/dist/ui/assets/{ini-GFMFAjln.js → ini-BMw_C8EP.js} +1 -1
- package/dist/ui/assets/{irpf90-BPmSYATn.js → irpf90-Cy42ibFZ.js} +1 -1
- package/dist/ui/assets/{isbl-BnStGiBQ.js → isbl-CjFSc0hz.js} +1 -1
- package/dist/ui/assets/{ishikawaDiagram-FXEZZL3T-DgcUDM9X.js → ishikawaDiagram-FXEZZL3T-BZcxp5am.js} +1 -1
- package/dist/ui/assets/{java-CVORcFd8.js → java-BDxe9dp1.js} +1 -1
- package/dist/ui/assets/{javascript-B2pFzODm.js → javascript-CgLkkj7h.js} +1 -1
- package/dist/ui/assets/{jboss-cli-B9cQeKvZ.js → jboss-cli-C8biclrb.js} +1 -1
- package/dist/ui/assets/{journeyDiagram-5HDEW3XC-Bivjw4h7.js → journeyDiagram-5HDEW3XC-BbJu6m6Q.js} +1 -1
- package/dist/ui/assets/{json-BJof8L10.js → json-BjJKhmM6.js} +1 -1
- package/dist/ui/assets/{julia-D_dGrCpZ.js → julia-DvKEpg-R.js} +1 -1
- package/dist/ui/assets/{julia-repl-Dsw0K1B1.js → julia-repl-BDJWZxkU.js} +1 -1
- package/dist/ui/assets/{kanban-definition-HUTT4EX6-Dg7NbKta.js → kanban-definition-HUTT4EX6-DeIVPlbv.js} +1 -1
- package/dist/ui/assets/{kotlin-8oetHRtX.js → kotlin-DCoXcnEb.js} +1 -1
- package/dist/ui/assets/{lasso-e37r_NX1.js → lasso-C7m0QmV2.js} +1 -1
- package/dist/ui/assets/{latex-DAmwzl3n.js → latex-SHnTG9Eq.js} +1 -1
- package/dist/ui/assets/{ldif-CD0mgmt4.js → ldif-_6hUnKPV.js} +1 -1
- package/dist/ui/assets/{leaf-GfPKlp7a.js → leaf-Co9qxlaF.js} +1 -1
- package/dist/ui/assets/{less-PndaZJ6n.js → less-CJRDPwNA.js} +1 -1
- package/dist/ui/assets/{lisp-CNaspu3A.js → lisp-JEHGYbiW.js} +1 -1
- package/dist/ui/assets/{livecodeserver-DEKsXiP3.js → livecodeserver-BSYaUj4k.js} +1 -1
- package/dist/ui/assets/{livescript-DM7jasJn.js → livescript-WQMCQeuz.js} +1 -1
- package/dist/ui/assets/{llvm-D_29j9MV.js → llvm-DnAHqj5I.js} +1 -1
- package/dist/ui/assets/{lsl-DY0WRYhg.js → lsl--k-ghYia.js} +1 -1
- package/dist/ui/assets/{lua-DZ_v4xaE.js → lua-CXb23hbC.js} +1 -1
- package/dist/ui/assets/{makefile-VOjcUGXf.js → makefile-CM7o86yn.js} +1 -1
- package/dist/ui/assets/{markdown-yUEmZWvu.js → markdown-HB3HvChQ.js} +1 -1
- package/dist/ui/assets/{mathematica-BLXYGKkd.js → mathematica-9NTuf22N.js} +1 -1
- package/dist/ui/assets/{matlab-B7SkIpvh.js → matlab-CWv-ik4r.js} +1 -1
- package/dist/ui/assets/{maxima-C7Fw8Vyt.js → maxima-CqYiKCrw.js} +1 -1
- package/dist/ui/assets/{mel-C_Znst2Y.js → mel-BbsRpUm5.js} +1 -1
- package/dist/ui/assets/{mercury-DjUnQNsq.js → mercury-Cz2j4HhU.js} +1 -1
- package/dist/ui/assets/{mindmap-definition-LN4V7U3C-Dp6mEy6L.js → mindmap-definition-LN4V7U3C-WyJS8oye.js} +1 -1
- package/dist/ui/assets/{mipsasm-DaGHhR8c.js → mipsasm-BqWSRbQV.js} +1 -1
- package/dist/ui/assets/{mizar-CZnct-_Z.js → mizar-JLBfQ6vt.js} +1 -1
- package/dist/ui/assets/{mojolicious-BdWFK35j.js → mojolicious-D0LbMmyk.js} +1 -1
- package/dist/ui/assets/{monkey-ta_jgafo.js → monkey-DAGL6-JN.js} +1 -1
- package/dist/ui/assets/{moonscript-B9qovjV6.js → moonscript-DzbwNSKy.js} +1 -1
- package/dist/ui/assets/{n1ql-BciXbxiw.js → n1ql-dkgKq6Yv.js} +1 -1
- package/dist/ui/assets/{nginx-DRCZYbxj.js → nginx-AUoaDPV4.js} +1 -1
- package/dist/ui/assets/{nim-DTMCxPJt.js → nim-CdqYmVrl.js} +1 -1
- package/dist/ui/assets/{nix-D39yZxF9.js → nix-CxmVjwwo.js} +1 -1
- package/dist/ui/assets/{node-repl-vAEXdnYM.js → node-repl-B1Z3zUAh.js} +1 -1
- package/dist/ui/assets/{nsis-CCMP8mq3.js → nsis-CTAuPWhe.js} +1 -1
- package/dist/ui/assets/{objectivec-CZx4kSLP.js → objectivec-CvbKeAPz.js} +1 -1
- package/dist/ui/assets/{ocaml-DBnEo9uR.js → ocaml-DCiyXKOH.js} +1 -1
- package/dist/ui/assets/{openscad-BKc7u4Bl.js → openscad-CPGUwmeR.js} +1 -1
- package/dist/ui/assets/{oxygene-M_Z4lQ6l.js → oxygene-CI_bD1Gw.js} +1 -1
- package/dist/ui/assets/{parser3-DS9UKiKD.js → parser3-C91CVs85.js} +1 -1
- package/dist/ui/assets/{pegDiagram-2B236MQR-BBEXn76M.js → pegDiagram-2B236MQR-yF8AW7GR.js} +1 -1
- package/dist/ui/assets/{perl-D6iEALGE.js → perl-ChxfKl-n.js} +1 -1
- package/dist/ui/assets/{pf-JQL0ClGi.js → pf-CKCHkzIA.js} +1 -1
- package/dist/ui/assets/{pgsql-DEmCURBr.js → pgsql-BwOP20uH.js} +1 -1
- package/dist/ui/assets/{php-DVm-0PY5.js → php-B7Rs2tM5.js} +1 -1
- package/dist/ui/assets/{php-template-DfWbDpnE.js → php-template-Cx-Fh4AR.js} +1 -1
- package/dist/ui/assets/{pieDiagram-ENE6RG2P-D5PZFiDj.js → pieDiagram-ENE6RG2P-BS4hnGNX.js} +1 -1
- package/dist/ui/assets/{plaintext-BahVkGlu.js → plaintext-U7qkdtgS.js} +1 -1
- package/dist/ui/assets/{pony-wVig0caC.js → pony-_fGYgePh.js} +1 -1
- package/dist/ui/assets/{powershell-COjMBUit.js → powershell-CFBTcUce.js} +1 -1
- package/dist/ui/assets/{processing-DnUzvFZx.js → processing-BWHneU0K.js} +1 -1
- package/dist/ui/assets/{profile-mDlbwJeL.js → profile-BJ-HxhzS.js} +1 -1
- package/dist/ui/assets/{prolog-x2hG6DnA.js → prolog-ChHo7n6L.js} +1 -1
- package/dist/ui/assets/{properties-DzZyyivC.js → properties-e_DOYclC.js} +1 -1
- package/dist/ui/assets/{protobuf-a5NwbYD5.js → protobuf-5aGSIv7w.js} +1 -1
- package/dist/ui/assets/{puppet-CCWyPVuC.js → puppet-D2vQatzX.js} +1 -1
- package/dist/ui/assets/{purebasic-CXNdqtD4.js → purebasic-n6krfaeF.js} +1 -1
- package/dist/ui/assets/{python-iSR9YlDJ.js → python-CbIo0XxP.js} +1 -1
- package/dist/ui/assets/{python-repl-CCmKzWru.js → python-repl-BpIq9kyr.js} +1 -1
- package/dist/ui/assets/{q-B30ZmDuD.js → q-jntnvcCx.js} +1 -1
- package/dist/ui/assets/{qml-BGdPdB4X.js → qml-BafQlZNV.js} +1 -1
- package/dist/ui/assets/{quadrantDiagram-ABIIQ3AL-BBF1rAvI.js → quadrantDiagram-ABIIQ3AL-C3Th8mUJ.js} +1 -1
- package/dist/ui/assets/{r-B8ASdWL1.js → r-CHgvQFLK.js} +1 -1
- package/dist/ui/assets/{railroadDiagram-RFXS5EU6-DQFUXGVD.js → railroadDiagram-RFXS5EU6-CMQkbGJl.js} +1 -1
- package/dist/ui/assets/{reasonml-Dw4Bi5B5.js → reasonml-DNwlPD_T.js} +1 -1
- package/dist/ui/assets/{requirementDiagram-TGXJPOKE-DCgrs7-P.js → requirementDiagram-TGXJPOKE-B70_oR7v.js} +1 -1
- package/dist/ui/assets/{rib-CgUGGGZ9.js → rib-CX4e9JSF.js} +1 -1
- package/dist/ui/assets/{roboconf-CCZNQvSP.js → roboconf-ee4qsPGf.js} +1 -1
- package/dist/ui/assets/{routeros-DVT5M6iV.js → routeros-BJSwvu2L.js} +1 -1
- package/dist/ui/assets/{rsl-BY-LhdKq.js → rsl-BiKdMl_F.js} +1 -1
- package/dist/ui/assets/{ruby-CZW4dclw.js → ruby-CAXTU5LY.js} +1 -1
- package/dist/ui/assets/{ruleslanguage-CZdjv1of.js → ruleslanguage-C1kgDGXM.js} +1 -1
- package/dist/ui/assets/{rust-D5Xa_mSD.js → rust-DyEf_GXL.js} +1 -1
- package/dist/ui/assets/{sankeyDiagram-HTMAVEWB-BXeEgUB7.js → sankeyDiagram-HTMAVEWB-CvUfseMg.js} +1 -1
- package/dist/ui/assets/{sas-B_UJ-HCZ.js → sas-Q1rlUxPH.js} +1 -1
- package/dist/ui/assets/{scala-B8wSdZik.js → scala-Dg6KNmge.js} +1 -1
- package/dist/ui/assets/{scheme-DD7U81eh.js → scheme-D9iooUxI.js} +1 -1
- package/dist/ui/assets/{scilab-aJGpbkKs.js → scilab-CztEJXJY.js} +1 -1
- package/dist/ui/assets/{scss-BBqyvWYh.js → scss-BMh-JkdE.js} +1 -1
- package/dist/ui/assets/{sequenceDiagram-DBY2YBRQ-CnDTZN18.js → sequenceDiagram-DBY2YBRQ-DB0c9kf4.js} +1 -1
- package/dist/ui/assets/{shell-CR23jqfz.js → shell-DWo6z0MG.js} +1 -1
- package/dist/ui/assets/{sizeCapture-X5ZJPWSS-joZ477RB.js → sizeCapture-X5ZJPWSS-BcQlgjfD.js} +1 -1
- package/dist/ui/assets/{smali-ZmLyRCrQ.js → smali-Cijeb6pL.js} +1 -1
- package/dist/ui/assets/{smalltalk-CnADYfPr.js → smalltalk-D0lvqa_d.js} +1 -1
- package/dist/ui/assets/{sml-zj1KD04_.js → sml-B-vqWZ3b.js} +1 -1
- package/dist/ui/assets/{sqf-DCCaZ3e3.js → sqf-BJ-1Q583.js} +1 -1
- package/dist/ui/assets/{sql-CHGw2SCR.js → sql-CMGLxEYV.js} +1 -1
- package/dist/ui/assets/{sql_more-DsnvjMwh.js → sql_more-gsRmbNCH.js} +1 -1
- package/dist/ui/assets/{stan-ChxdV8f9.js → stan-D1AlTSpf.js} +1 -1
- package/dist/ui/assets/{stata-CgFw45qg.js → stata-DnEYviI0.js} +1 -1
- package/dist/ui/assets/{stateDiagram-2N3HPSRC-CzLIdKbt.js → stateDiagram-2N3HPSRC-BSRgVsHO.js} +1 -1
- package/dist/ui/assets/stateDiagram-v2-6OUMAXLB-BLdfpGJO.js +1 -0
- package/dist/ui/assets/{step21-DaraQMOk.js → step21-DbQV9sMo.js} +1 -1
- package/dist/ui/assets/{stylus-BZpiJEzN.js → stylus-Cyc7vdUc.js} +1 -1
- package/dist/ui/assets/{subunit-B6Gp0n7h.js → subunit-16ipyMie.js} +1 -1
- package/dist/ui/assets/{swift-DQzoz60p.js → swift-DTNnw4qS.js} +1 -1
- package/dist/ui/assets/{swimlanes-5IMT3BWC-DOMOhwX0.js → swimlanes-5IMT3BWC-DgOdcc4_.js} +2 -2
- package/dist/ui/assets/swimlanesDiagram-G3AALYLV-DRVnkg3M.js +8 -0
- package/dist/ui/assets/{taggerscript-BMLkfiab.js → taggerscript-DM6pvUWE.js} +1 -1
- package/dist/ui/assets/{tap-PUNWTFgu.js → tap-Ch-uyKZq.js} +1 -1
- package/dist/ui/assets/{tcl-BODH5qJa.js → tcl-D0T_V5dA.js} +1 -1
- package/dist/ui/assets/{thrift-BQ-W_YlC.js → thrift-D9xJjYw4.js} +1 -1
- package/dist/ui/assets/{timeline-definition-FHXFAJF6-DQBDeTzH.js → timeline-definition-FHXFAJF6-BBeDMHxb.js} +1 -1
- package/dist/ui/assets/{tp-Dt3WwOGF.js → tp-kUrCGo9X.js} +1 -1
- package/dist/ui/assets/{twig-44RQtw7Z.js → twig-Cgub6rxA.js} +1 -1
- package/dist/ui/assets/{typescript-BsouHXHR.js → typescript-BxNP9Ap9.js} +1 -1
- package/dist/ui/assets/{vala-DqJj6fPT.js → vala-DF9ZZagU.js} +1 -1
- package/dist/ui/assets/{vbnet-CuqWYg5r.js → vbnet-Cf46ypDg.js} +1 -1
- package/dist/ui/assets/{vbscript-w20MQMYP.js → vbscript-DNs-QKLH.js} +1 -1
- package/dist/ui/assets/{vbscript-html-BP0D0WEV.js → vbscript-html-DyS6I5L1.js} +1 -1
- package/dist/ui/assets/{vennDiagram-L72KCM5P-DwNnj3Kc.js → vennDiagram-L72KCM5P-8WpWycE-.js} +1 -1
- package/dist/ui/assets/{verilog-DIpBpJAe.js → verilog-CF5wC4X-.js} +1 -1
- package/dist/ui/assets/{vhdl-D5nCxDbL.js → vhdl-Dm0jpDMn.js} +1 -1
- package/dist/ui/assets/{vim-CPfbBM_x.js → vim-nyO2DRAx.js} +1 -1
- package/dist/ui/assets/{wardleyDiagram-EHGQE667-WxVQHmM7.js → wardleyDiagram-EHGQE667-UeIOK-jv.js} +1 -1
- package/dist/ui/assets/{x86asm-D_t4Z_eq.js → x86asm-BNw2-6GG.js} +1 -1
- package/dist/ui/assets/{xl-DQf5IG_W.js → xl-D-YHxr6V.js} +1 -1
- package/dist/ui/assets/{xml-D-Bn0NMR.js → xml-BijAlrow.js} +1 -1
- package/dist/ui/assets/{xquery-DqushYX1.js → xquery-z0wxWBKz.js} +1 -1
- package/dist/ui/assets/{xychartDiagram-FW5EYKEG-B6D8mgs8.js → xychartDiagram-FW5EYKEG-BNzHLweN.js} +1 -1
- package/dist/ui/assets/{yaml-B2GFZenc.js → yaml-n5TIQArR.js} +1 -1
- package/dist/ui/assets/{zephir-SiNGockR.js → zephir-DrGhH8jG.js} +1 -1
- package/dist/ui/index.html +2 -2
- package/dist/utils/__tests__/providers-db.test.js +2 -1
- package/dist/utils/__tests__/tool-injector.test.js +32 -35
- package/dist/utils/db.d.ts +3 -0
- package/dist/utils/db.js +54 -0
- package/dist/utils/inject-loop.d.ts +52 -1
- package/dist/utils/inject-loop.js +70 -2
- package/dist/utils/mcp-db.d.ts +35 -0
- package/dist/utils/mcp-db.js +79 -0
- package/dist/utils/mcp-manager.d.ts +36 -0
- package/dist/utils/mcp-manager.js +215 -0
- package/dist/utils/openai-converter.d.ts +99 -0
- package/dist/utils/openai-converter.js +293 -0
- package/dist/utils/providers-db.d.ts +2 -0
- package/dist/utils/providers-db.js +19 -7
- package/dist/utils/request-writer.d.ts +20 -0
- package/dist/utils/request-writer.js +184 -4
- package/dist/utils/sse-stream-processor.d.ts +27 -0
- package/dist/utils/sse-stream-processor.js +144 -0
- package/dist/utils/stats-aggregator.js +2 -0
- package/dist/utils/status-history.js +3 -3
- package/dist/utils/tool-injector.d.ts +6 -9
- package/dist/utils/tool-injector.js +13 -14
- package/dist/utils/version.d.ts +6 -0
- package/dist/utils/version.js +11 -1
- package/package.json +14 -12
- package/dist/ui/assets/channel-C5JlZ38H.js +0 -1
- package/dist/ui/assets/classDiagram-OUVF2IWQ-j5FVBKaD.js +0 -1
- package/dist/ui/assets/classDiagram-v2-EOCWNBFH-j5FVBKaD.js +0 -1
- package/dist/ui/assets/index-Baqd6LlK.js +0 -2625
- package/dist/ui/assets/index-fHtNI_e8.css +0 -1
- package/dist/ui/assets/stateDiagram-v2-6OUMAXLB-Bg4GAkB5.js +0 -1
- package/dist/ui/assets/swimlanesDiagram-G3AALYLV-99wEK8yq.js +0 -8
package/dist/server/ui-route.js
CHANGED
|
@@ -10,15 +10,21 @@ import { getCallerDirname } from '../utils/esm-dirname.js';
|
|
|
10
10
|
import { getConfigPath, getDisplayPath } from '../utils/paths.js';
|
|
11
11
|
import { loadRequestDB, listRequestDB, sessionIdExists } from '../utils/request-writer.js';
|
|
12
12
|
import { statusHistory } from '../utils/status-history.js';
|
|
13
|
-
import { addDataClient, removeDataClient } from './data-push.js';
|
|
13
|
+
import { addDataClient, removeDataClient, broadcastToDataClients, getDataClientCount } from './data-push.js';
|
|
14
14
|
import { getVersionInfo } from '../utils/version.js';
|
|
15
15
|
import { getStatsData, getTodayStats } from '../utils/stats-aggregator.js';
|
|
16
16
|
import { setupProvidersRoutes } from './providers-route.js';
|
|
17
|
+
import { setupMcpRoutes } from './mcp-route.js';
|
|
18
|
+
import { setupClaudeSettingsRoutes } from './claude-settings-route.js';
|
|
17
19
|
import { checkAuth } from './auth.js';
|
|
18
20
|
export async function setupUiRoutes(fastify) {
|
|
19
21
|
const config = await loadConfig();
|
|
20
22
|
// Mount providers API routes
|
|
21
23
|
await setupProvidersRoutes(fastify, config);
|
|
24
|
+
// Mount MCP server management routes
|
|
25
|
+
await setupMcpRoutes(fastify, config);
|
|
26
|
+
// Mount Claude settings sync route
|
|
27
|
+
await setupClaudeSettingsRoutes(fastify, config);
|
|
22
28
|
// Create WebSocket server for log streaming (bypass @fastify/websocket issues)
|
|
23
29
|
const wss = new WebSocketServer({ noServer: true });
|
|
24
30
|
// WebSocket server for data push (status/requests/stats)
|
|
@@ -362,6 +368,11 @@ export async function setupUiRoutes(fastify) {
|
|
|
362
368
|
const stream = fs.createReadStream(path.join(uiDistPath, 'index.html'));
|
|
363
369
|
return reply.type('text/html').send(stream);
|
|
364
370
|
});
|
|
371
|
+
// Handle /docs root path
|
|
372
|
+
fastify.get('/docs', async (request, reply) => {
|
|
373
|
+
const stream = fs.createReadStream(path.join(docsDistPath, 'index.html'));
|
|
374
|
+
return reply.type('text/html').send(stream);
|
|
375
|
+
});
|
|
365
376
|
// WebSocket log stream handler (using native ws, not @fastify/websocket)
|
|
366
377
|
function handleLogStream(ws, config) {
|
|
367
378
|
const logFile = config.logging.file;
|
|
@@ -407,9 +418,18 @@ export async function setupUiRoutes(fastify) {
|
|
|
407
418
|
return false;
|
|
408
419
|
}
|
|
409
420
|
};
|
|
410
|
-
// Track read position
|
|
421
|
+
// Track read position for incremental reads (avoid loading entire file on each change)
|
|
411
422
|
let readPosition = 0;
|
|
412
|
-
|
|
423
|
+
let lastInode = 0;
|
|
424
|
+
let lastSize = 0;
|
|
425
|
+
// Get initial file metadata
|
|
426
|
+
try {
|
|
427
|
+
const stat = fs.statSync(logPath);
|
|
428
|
+
lastInode = stat.ino;
|
|
429
|
+
lastSize = stat.size;
|
|
430
|
+
}
|
|
431
|
+
catch { /* ignore */ }
|
|
432
|
+
// Send initial last 50 lines on connect (one-time full read, acceptable)
|
|
413
433
|
fs.promises.readFile(logPath, 'utf-8').then((content) => {
|
|
414
434
|
const lines = content.trim().split('\n').slice(-50).filter(shouldFilterLog);
|
|
415
435
|
for (const line of lines) {
|
|
@@ -421,33 +441,105 @@ export async function setupUiRoutes(fastify) {
|
|
|
421
441
|
}).catch(() => {
|
|
422
442
|
// Log file not readable yet
|
|
423
443
|
});
|
|
424
|
-
// Watch for changes
|
|
444
|
+
// Watch for changes — use incremental read instead of full file read
|
|
425
445
|
const watcher = fs.watch(logPath, (event) => {
|
|
426
446
|
if (event === 'change') {
|
|
427
|
-
|
|
428
|
-
|
|
447
|
+
// Check file metadata to detect rotation (inode/size changed = new file)
|
|
448
|
+
try {
|
|
449
|
+
const stat = fs.statSync(logPath);
|
|
450
|
+
if (stat.ino !== lastInode || stat.size < readPosition) {
|
|
451
|
+
// File rotated — reset position and send last 50 lines of new file
|
|
452
|
+
lastInode = stat.ino;
|
|
453
|
+
lastSize = stat.size;
|
|
454
|
+
readPosition = 0;
|
|
455
|
+
fs.promises.readFile(logPath, 'utf-8').then((content) => {
|
|
456
|
+
const lines = content.trim().split('\n').slice(-50).filter(shouldFilterLog);
|
|
457
|
+
for (const line of lines) {
|
|
458
|
+
if (ws.readyState === WebSocket.OPEN) {
|
|
459
|
+
ws.send(line);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
readPosition = content.length;
|
|
463
|
+
}).catch(() => { });
|
|
429
464
|
return;
|
|
430
|
-
const newContent = content.slice(readPosition);
|
|
431
|
-
readPosition = content.length;
|
|
432
|
-
const lines = newContent.trim().split('\n').filter(l => l.length > 0).filter(shouldFilterLog);
|
|
433
|
-
for (const line of lines) {
|
|
434
|
-
if (ws.readyState === WebSocket.OPEN) {
|
|
435
|
-
ws.send(line);
|
|
436
|
-
}
|
|
437
465
|
}
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
466
|
+
lastSize = stat.size;
|
|
467
|
+
}
|
|
468
|
+
catch {
|
|
469
|
+
return;
|
|
470
|
+
}
|
|
471
|
+
// Incremental read: only read newly appended content
|
|
472
|
+
if (lastSize <= readPosition)
|
|
473
|
+
return;
|
|
474
|
+
const readLen = lastSize - readPosition;
|
|
475
|
+
const buffer = Buffer.alloc(readLen);
|
|
476
|
+
try {
|
|
477
|
+
const fd = fs.openSync(logPath, 'r');
|
|
478
|
+
fs.readSync(fd, buffer, 0, readLen, readPosition);
|
|
479
|
+
fs.closeSync(fd);
|
|
480
|
+
}
|
|
481
|
+
catch {
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
484
|
+
readPosition = lastSize;
|
|
485
|
+
const newContent = buffer.toString('utf-8');
|
|
486
|
+
const lines = newContent.trim().split('\n').filter(l => l.length > 0).filter(shouldFilterLog);
|
|
487
|
+
for (const line of lines) {
|
|
488
|
+
if (ws.readyState === WebSocket.OPEN) {
|
|
489
|
+
ws.send(line);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
441
492
|
}
|
|
442
493
|
});
|
|
443
494
|
ws.on('close', () => {
|
|
444
495
|
watcher.close();
|
|
445
496
|
});
|
|
446
497
|
}
|
|
498
|
+
// Global status push timer — single timer broadcasts to all data clients (not per-client)
|
|
499
|
+
let globalStatusTimer = null;
|
|
500
|
+
function startGlobalStatusTimer() {
|
|
501
|
+
if (globalStatusTimer)
|
|
502
|
+
return;
|
|
503
|
+
globalStatusTimer = setInterval(async () => {
|
|
504
|
+
const status = await getProcessStatus('cc-monitoring');
|
|
505
|
+
if (status) {
|
|
506
|
+
statusHistory.push({
|
|
507
|
+
timestamp: Date.now(),
|
|
508
|
+
cpu: status.cpu,
|
|
509
|
+
memory: status.memory
|
|
510
|
+
});
|
|
511
|
+
}
|
|
512
|
+
broadcastToDataClients({
|
|
513
|
+
type: 'status',
|
|
514
|
+
action: 'snapshot',
|
|
515
|
+
data: {
|
|
516
|
+
status: status?.status ?? 'stopped',
|
|
517
|
+
cpu: status?.cpu ?? 0,
|
|
518
|
+
memory: status?.memory ?? 0,
|
|
519
|
+
uptime: status?.uptime ?? 0,
|
|
520
|
+
restarts: status?.restarts ?? 0,
|
|
521
|
+
history: statusHistory.getHistory(3600000)
|
|
522
|
+
}
|
|
523
|
+
});
|
|
524
|
+
}, 10000);
|
|
525
|
+
}
|
|
526
|
+
function stopGlobalStatusTimer() {
|
|
527
|
+
if (globalStatusTimer) {
|
|
528
|
+
clearInterval(globalStatusTimer);
|
|
529
|
+
globalStatusTimer = null;
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
function checkAndStopTimer() {
|
|
533
|
+
if (getDataClientCount() === 0) {
|
|
534
|
+
stopGlobalStatusTimer();
|
|
535
|
+
}
|
|
536
|
+
}
|
|
447
537
|
// WebSocket data stream handler
|
|
448
538
|
function handleDataStream(ws) {
|
|
449
539
|
// Add to connection pool
|
|
450
540
|
addDataClient(ws);
|
|
541
|
+
// Start global status timer on first client connection
|
|
542
|
+
startGlobalStatusTimer();
|
|
451
543
|
// Heartbeat timeout tracking: last time we sent a ping and got activity
|
|
452
544
|
let lastPing = Date.now();
|
|
453
545
|
const HEARTBEAT_TIMEOUT = 30000; // 30s: no activity → close
|
|
@@ -469,46 +561,19 @@ export async function setupUiRoutes(fastify) {
|
|
|
469
561
|
ws.on('message', () => {
|
|
470
562
|
lastPing = Date.now();
|
|
471
563
|
});
|
|
472
|
-
//
|
|
473
|
-
const statusTimer = setInterval(async () => {
|
|
474
|
-
if (ws.readyState === WebSocket.OPEN) {
|
|
475
|
-
const status = await getProcessStatus('cc-monitoring');
|
|
476
|
-
// Sample status history (for trend charts) — WebSocket is the primary source
|
|
477
|
-
if (status) {
|
|
478
|
-
statusHistory.push({
|
|
479
|
-
timestamp: Date.now(),
|
|
480
|
-
cpu: status.cpu,
|
|
481
|
-
memory: status.memory
|
|
482
|
-
});
|
|
483
|
-
}
|
|
484
|
-
// Push status snapshot + history
|
|
485
|
-
ws.send(JSON.stringify({
|
|
486
|
-
type: 'status',
|
|
487
|
-
action: 'snapshot',
|
|
488
|
-
data: {
|
|
489
|
-
status: status?.status ?? 'stopped',
|
|
490
|
-
cpu: status?.cpu ?? 0,
|
|
491
|
-
memory: status?.memory ?? 0,
|
|
492
|
-
uptime: status?.uptime ?? 0,
|
|
493
|
-
restarts: status?.restarts ?? 0,
|
|
494
|
-
history: statusHistory.getHistory(3600000) // Last 1 hour
|
|
495
|
-
}
|
|
496
|
-
}));
|
|
497
|
-
}
|
|
498
|
-
}, 10000);
|
|
499
|
-
// Cleanup on close
|
|
564
|
+
// Cleanup on close (no statusTimer — handled by global timer)
|
|
500
565
|
ws.on('close', () => {
|
|
501
566
|
clearInterval(heartbeatTimer);
|
|
502
567
|
clearInterval(timeoutTimer);
|
|
503
|
-
clearInterval(statusTimer);
|
|
504
568
|
removeDataClient(ws);
|
|
569
|
+
checkAndStopTimer();
|
|
505
570
|
});
|
|
506
571
|
ws.on('error', (error) => {
|
|
507
572
|
console.error('WebSocket data client error:', error);
|
|
508
573
|
clearInterval(heartbeatTimer);
|
|
509
574
|
clearInterval(timeoutTimer);
|
|
510
|
-
clearInterval(statusTimer);
|
|
511
575
|
removeDataClient(ws);
|
|
576
|
+
checkAndStopTimer();
|
|
512
577
|
});
|
|
513
578
|
}
|
|
514
579
|
// Derive server directory from utils dirname (esm-dirname lives in src/utils/)
|
|
@@ -525,5 +590,17 @@ export async function setupUiRoutes(fastify) {
|
|
|
525
590
|
wildcard: true, // Enable wildcard to serve assets properly
|
|
526
591
|
maxAge: 0 // Disable browser caching for dev/prox parity
|
|
527
592
|
});
|
|
593
|
+
// 发布产物:dist/docs(bundle-docs.mjs 注入);本地开发:monorepo 的 proxy-docs dist
|
|
594
|
+
const bundledDocs = path.join(serverDirname, '../docs');
|
|
595
|
+
const docsDistPath = fs.existsSync(bundledDocs)
|
|
596
|
+
? bundledDocs
|
|
597
|
+
: path.join(serverDirname, '../../../proxy-docs/dist');
|
|
598
|
+
await fastify.register(staticPlugin, {
|
|
599
|
+
root: docsDistPath,
|
|
600
|
+
prefix: '/docs/',
|
|
601
|
+
decorateReply: false,
|
|
602
|
+
wildcard: true,
|
|
603
|
+
maxAge: 0
|
|
604
|
+
});
|
|
528
605
|
// Note: SPA routing handled by wildcard: true in static plugin
|
|
529
606
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { InjectableTool } from './types.js';
|
|
2
|
+
import type { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Convert an MCP Tool definition to an InjectableTool.
|
|
5
|
+
*
|
|
6
|
+
* Name is prefixed with `mcp__<serverName>__` to avoid collision with local tools.
|
|
7
|
+
* exec() delegates to MCP Client's callTool(), using the ORIGINAL name (without prefix).
|
|
8
|
+
*/
|
|
9
|
+
export declare function mcpToolToInjectable(mcpTool: {
|
|
10
|
+
name: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
inputSchema: Record<string, unknown>;
|
|
13
|
+
}, serverName: string, client: Client): InjectableTool;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert an MCP Tool definition to an InjectableTool.
|
|
3
|
+
*
|
|
4
|
+
* Name is prefixed with `mcp__<serverName>__` to avoid collision with local tools.
|
|
5
|
+
* exec() delegates to MCP Client's callTool(), using the ORIGINAL name (without prefix).
|
|
6
|
+
*/
|
|
7
|
+
export function mcpToolToInjectable(mcpTool, serverName, client) {
|
|
8
|
+
const prefixedName = `mcp__${serverName}__${mcpTool.name}`;
|
|
9
|
+
return {
|
|
10
|
+
name: prefixedName,
|
|
11
|
+
description: mcpTool.description || '',
|
|
12
|
+
input_schema: mcpTool.inputSchema,
|
|
13
|
+
enabled: true,
|
|
14
|
+
async exec(input) {
|
|
15
|
+
try {
|
|
16
|
+
const result = await client.callTool({
|
|
17
|
+
name: mcpTool.name, // original name, no prefix
|
|
18
|
+
arguments: input
|
|
19
|
+
});
|
|
20
|
+
if (result.content && Array.isArray(result.content)) {
|
|
21
|
+
return result.content
|
|
22
|
+
.map((block) => {
|
|
23
|
+
if (block.type === 'text')
|
|
24
|
+
return block.text;
|
|
25
|
+
return JSON.stringify(block);
|
|
26
|
+
})
|
|
27
|
+
.join('\n');
|
|
28
|
+
}
|
|
29
|
+
return JSON.stringify(result);
|
|
30
|
+
}
|
|
31
|
+
catch (err) {
|
|
32
|
+
return `MCP tool error (${serverName}/${mcpTool.name}): ${err.message || String(err)}`;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
package/dist/tools/registry.js
CHANGED
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
import { probeTool } from './probe.tool.js';
|
|
2
2
|
import { curlTool } from './curl.tool.js';
|
|
3
|
+
import { mcpManager } from '../utils/mcp-manager.js';
|
|
3
4
|
/**
|
|
4
5
|
* 自定义 tool 注册表(后端)。
|
|
5
6
|
*
|
|
6
7
|
* 新增 tool:在 tools/ 下新建 xxx.tool.ts 导出 InjectableTool,
|
|
7
8
|
* 再到 ALL_TOOLS 登记一行即可。
|
|
9
|
+
* MCP tools 通过 mcpManager.getMcpTools() 动态合并。
|
|
8
10
|
*/
|
|
9
|
-
/**
|
|
11
|
+
/** 所有本地已知 tool */
|
|
10
12
|
const ALL_TOOLS = [probeTool, curlTool];
|
|
13
|
+
/** 所有已知 tool(本地 + MCP 动态) */
|
|
14
|
+
function allKnownTools() {
|
|
15
|
+
return [...ALL_TOOLS, ...mcpManager.getMcpTools()];
|
|
16
|
+
}
|
|
11
17
|
/** 已启用的 tool 列表(注入用) */
|
|
12
18
|
export function enabledTools() {
|
|
13
|
-
return
|
|
19
|
+
return allKnownTools().filter((t) => t.enabled);
|
|
14
20
|
}
|
|
15
21
|
/** 是否存在任何启用 tool(决定 proxy 是否进入缓冲检测路径) */
|
|
16
22
|
export function hasEnabledTools() {
|
|
17
|
-
return
|
|
23
|
+
return allKnownTools().some((t) => t.enabled);
|
|
18
24
|
}
|
|
19
25
|
/** 按名查找已启用 tool(命中检测 + 执行用) */
|
|
20
26
|
export function findEnabledTool(name) {
|
|
21
|
-
return
|
|
27
|
+
return allKnownTools().find((t) => t.enabled && t.name === name);
|
|
22
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aD as f}from"./index-
|
|
1
|
+
import{aD as f}from"./index-CfTIGTiY.js";import{r as s}from"./index-DqIiCkSD.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),_=i({__proto__:null,default:p},[n]);export{_};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aD as s}from"./index-
|
|
1
|
+
import{aD as s}from"./index-CfTIGTiY.js";import{a as i}from"./index-DqIiCkSD.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};
|
package/dist/ui/assets/{abnfDiagram-VRR7QNED-DJkd8PHl.js → abnfDiagram-VRR7QNED-CkRuDPu1.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-
|
|
1
|
+
import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-DrDE4H9w.js";import{p as f}from"./chunk-JWPE2WC7-CPC_cBN0.js";import{_ as n,l as o}from"./index-CfTIGTiY.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-Cj5c4L3y.js";var v=d().RailroadAbnf.parser.LangiumParser,l=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),i=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:i,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return l(e.element);case"AbnfOptionalGroup":return{type:"optional",element:l(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:l(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},w={parser:R,db:a,renderer:u,styles:p};export{w as diagram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aD as n}from"./index-
|
|
1
|
+
import{aD as n}from"./index-CfTIGTiY.js";import{b as f}from"./index-DqIiCkSD.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 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 c=f();const g=n(c),u=l({__proto__:null,default:g},[c]);export{u as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aD as n}from"./index-
|
|
1
|
+
import{aD as n}from"./index-CfTIGTiY.js";import{c as s}from"./index-DqIiCkSD.js";function p(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 c=Object.getOwnPropertyDescriptor(t,e);c&&Object.defineProperty(r,e,c.get?c:{enumerable:!0,get:()=>t[e]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var a=s();const f=n(a),g=p({__proto__:null,default:f},[a]);export{g as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aD as s}from"./index-
|
|
1
|
+
import{aD as s}from"./index-CfTIGTiY.js";import{d as i}from"./index-DqIiCkSD.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{aD as i}from"./index-
|
|
1
|
+
import{aD as i}from"./index-CfTIGTiY.js";import{e as c}from"./index-DqIiCkSD.js";function p(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 s=c();const f=i(s),u=p({__proto__:null,default:f},[s]);export{u as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aD as n}from"./index-
|
|
1
|
+
import{aD as n}from"./index-CfTIGTiY.js";import{f as p}from"./index-DqIiCkSD.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 f=p();const i=n(f),g=s({__proto__:null,default:i},[f]);export{g as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aD as i}from"./index-
|
|
1
|
+
import{aD as i}from"./index-CfTIGTiY.js";import{g as c}from"./index-DqIiCkSD.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{a1 as ln,a2 as an,a3 as H,a4 as q,a5 as B,a6 as un,a7 as y,a8 as tn,a9 as L,aa as _,ab as rn,ac as o,ad as on,ae as sn,af as fn}from"./index-
|
|
1
|
+
import{a1 as ln,a2 as an,a3 as H,a4 as q,a5 as B,a6 as un,a7 as y,a8 as tn,a9 as L,aa as _,ab as rn,ac as o,ad as on,ae as sn,af as fn}from"./index-CfTIGTiY.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,C,a){var O=I-l,i=D-h,n=C-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function W(l,h,I,D,v,A,C){var a=l-I,O=h-D,i=(C?A:-A)/L(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,F=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*L(on(0,T*T*R-P*P)),j=(P*g-m*S)/R,z=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=j-F,e=z-t,r=w-F,G=p-t;return x*x+e*e>r*r+G*G&&(j=w,z=p),{cx:j,cy:z,x01:-n,y01:-d,x11:j*(v/T-1),y11:z*(v/T-1)}}function hn(){var l=cn,h=yn,I=B(0),D=null,v=gn,A=dn,C=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,F=rn(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(F>tn-y)a.moveTo(s*H(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*H(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=F,S=F,j=C.apply(this,arguments)/2,z=j>y&&(D?+D.apply(this,arguments):L(u*u+s*s)),w=_(rn(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if(z>y){var G=sn(z/u*q(j)),M=sn(z/s*q(j));(P-=G*2)>y?(G*=t?1:-1,R+=G,T-=G):(P=0,R=T=(f+c)/2),(S-=M*2)>y?(M*=t?1:-1,m+=M,g-=M):(S=0,m=g=(f+c)/2)}var J=s*H(m),K=s*q(m),N=u*H(T),Q=u*q(T);if(w>y){var U=s*H(g),V=s*q(g),X=u*H(R),Y=u*q(R),E;if(F<an)if(E=pn(J,K,X,Y,U,V,N,Q)){var Z=J-E[0],$=K-E[1],b=U-E[0],k=V-E[1],nn=1/q(fn((Z*b+$*k)/(L(Z*Z+$*$)*L(b*b+k*k)))/2),en=L(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=W(X,Y,J,K,s,x,t),r=W(U,V,N,Q,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(J,K),a.arc(0,0,s,m,g,!t)):a.moveTo(J,K),!(u>y)||!(P>y)?a.lineTo(N,Q):p>y?(e=W(N,Q,U,V,u,-p,t),r=W(J,K,X,Y,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[H(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:B(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:B(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:B(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:B(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:B(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:B(+n),i):A},i.padAngle=function(n){return arguments.length?(C=typeof n=="function"?n:B(+n),i):C},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aD as f}from"./index-
|
|
1
|
+
import{aD as f}from"./index-CfTIGTiY.js";import{h as s}from"./index-DqIiCkSD.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};
|