@tencentcloud/sdk-mcp 1.0.5 → 1.0.7
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/index.js +7 -8
- package/index.js.map +1 -1
- package/libs/@tencent/aegis-node-sdk/CHANGELOG.md +8 -0
- package/libs/@tencent/aegis-node-sdk/LICENSE +21 -0
- package/libs/@tencent/aegis-node-sdk/README.md +562 -0
- package/libs/@tencent/aegis-node-sdk/lib/aegis.min.js +1 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/constant/config.d.ts +14 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/constant/global.d.ts +1 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/constant/index.d.ts +9 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/constant/report-ignore.d.ts +2 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/core.d.ts +85 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/hooks/afterRequestHooks.d.ts +3 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/hooks/beforeRequestHooks.d.ts +9 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/hooks/modifyRequestHooks.d.ts +3 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/index.d.ts +9 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/interface/config.d.ts +62 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/interface/env.d.ts +11 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/interface/index.d.ts +4 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/interface/log.d.ts +130 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/interface/send.d.ts +34 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/format.d.ts +2 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/index.d.ts +18 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/length-limit.d.ts +8 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/pv.d.ts +8 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/remove-payload.d.ts +2 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/repeat-limit.d.ts +4 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/report.d.ts +10 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/sample.d.ts +3 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/throttle.d.ts +3 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/index.d.ts +34 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/jwt.d.ts +12 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/ot-js.d.ts +14 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/uuid.d.ts +2 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/whitelist.d.ts +12 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/write-before.d.ts +3 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/plugin.d.ts +33 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/polyfill.d.ts +0 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/util/destroy.d.ts +2 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/util/event-emitter.d.ts +18 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/util/index.d.ts +60 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/index.d.ts +15 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/interface/selector.d.ts +5 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/pipes/batch-report-pipe.d.ts +6 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/protocol/protocol_base.d.ts +18 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/protocol/protocol_http.d.ts +12 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/selector/ip_selector.d.ts +10 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/selector/polaris_selector.d.ts +20 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/selector/selector_base.d.ts +27 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/util/eval_require.d.ts +2 -0
- package/libs/@tencent/aegis-node-sdk/package.json +19 -0
- package/libs/@tencent/polaris/README.md +407 -0
- package/libs/@tencent/polaris/dist/consumer/health.d.ts +126 -0
- package/libs/@tencent/polaris/dist/consumer/health.js +283 -0
- package/libs/@tencent/polaris/dist/consumer/health.js.map +1 -0
- package/libs/@tencent/polaris/dist/consumer/index.d.ts +120 -0
- package/libs/@tencent/polaris/dist/consumer/index.js +348 -0
- package/libs/@tencent/polaris/dist/consumer/index.js.map +1 -0
- package/libs/@tencent/polaris/dist/consumer/monitor.d.ts +145 -0
- package/libs/@tencent/polaris/dist/consumer/monitor.js +343 -0
- package/libs/@tencent/polaris/dist/consumer/monitor.js.map +1 -0
- package/libs/@tencent/polaris/dist/consumer/selector.d.ts +73 -0
- package/libs/@tencent/polaris/dist/consumer/selector.js +316 -0
- package/libs/@tencent/polaris/dist/consumer/selector.js.map +1 -0
- package/libs/@tencent/polaris/dist/errors.d.ts +373 -0
- package/libs/@tencent/polaris/dist/errors.js +154 -0
- package/libs/@tencent/polaris/dist/errors.js.map +1 -0
- package/libs/@tencent/polaris/dist/global.d.ts +16 -0
- package/libs/@tencent/polaris/dist/global.js +18 -0
- package/libs/@tencent/polaris/dist/global.js.map +1 -0
- package/libs/@tencent/polaris/dist/index.d.ts +62 -0
- package/libs/@tencent/polaris/dist/index.js +145 -0
- package/libs/@tencent/polaris/dist/index.js.map +1 -0
- package/libs/@tencent/polaris/dist/instance.d.ts +109 -0
- package/libs/@tencent/polaris/dist/instance.js +38 -0
- package/libs/@tencent/polaris/dist/instance.js.map +1 -0
- package/libs/@tencent/polaris/dist/limiter/bucket.d.ts +51 -0
- package/libs/@tencent/polaris/dist/limiter/bucket.js +152 -0
- package/libs/@tencent/polaris/dist/limiter/bucket.js.map +1 -0
- package/libs/@tencent/polaris/dist/limiter/index.d.ts +73 -0
- package/libs/@tencent/polaris/dist/limiter/index.js +149 -0
- package/libs/@tencent/polaris/dist/limiter/index.js.map +1 -0
- package/libs/@tencent/polaris/dist/limiter/ratelimit.d.ts +27 -0
- package/libs/@tencent/polaris/dist/limiter/ratelimit.js +134 -0
- package/libs/@tencent/polaris/dist/limiter/ratelimit.js.map +1 -0
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/base.d.ts +17 -0
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/base.js +15 -0
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/base.js.map +1 -0
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/global.d.ts +59 -0
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/global.js +397 -0
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/global.js.map +1 -0
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/index.d.ts +3 -0
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/index.js +19 -0
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/index.js.map +1 -0
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/local.d.ts +17 -0
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/local.js +52 -0
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/local.js.map +1 -0
- package/libs/@tencent/polaris/dist/location.d.ts +48 -0
- package/libs/@tencent/polaris/dist/location.js +67 -0
- package/libs/@tencent/polaris/dist/location.js.map +1 -0
- package/libs/@tencent/polaris/dist/logging.d.ts +106 -0
- package/libs/@tencent/polaris/dist/logging.js +130 -0
- package/libs/@tencent/polaris/dist/logging.js.map +1 -0
- package/libs/@tencent/polaris/dist/metadata.d.ts +78 -0
- package/libs/@tencent/polaris/dist/metadata.js +119 -0
- package/libs/@tencent/polaris/dist/metadata.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/breaker/polaris.d.ts +47 -0
- package/libs/@tencent/polaris/dist/plugins/breaker/polaris.js +162 -0
- package/libs/@tencent/polaris/dist/plugins/breaker/polaris.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/lb/base.d.ts +24 -0
- package/libs/@tencent/polaris/dist/plugins/lb/base.js +32 -0
- package/libs/@tencent/polaris/dist/plugins/lb/base.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/lb/edf.d.ts +24 -0
- package/libs/@tencent/polaris/dist/plugins/lb/edf.js +77 -0
- package/libs/@tencent/polaris/dist/plugins/lb/edf.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/lb/hashring.d.ts +24 -0
- package/libs/@tencent/polaris/dist/plugins/lb/hashring.js +53 -0
- package/libs/@tencent/polaris/dist/plugins/lb/hashring.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/lb/sticky.d.ts +31 -0
- package/libs/@tencent/polaris/dist/plugins/lb/sticky.js +88 -0
- package/libs/@tencent/polaris/dist/plugins/lb/sticky.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/lb/swrr.d.ts +25 -0
- package/libs/@tencent/polaris/dist/plugins/lb/swrr.js +72 -0
- package/libs/@tencent/polaris/dist/plugins/lb/swrr.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/lb/wr.d.ts +17 -0
- package/libs/@tencent/polaris/dist/plugins/lb/wr.js +50 -0
- package/libs/@tencent/polaris/dist/plugins/lb/wr.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/lb/wrr.d.ts +19 -0
- package/libs/@tencent/polaris/dist/plugins/lb/wrr.js +81 -0
- package/libs/@tencent/polaris/dist/plugins/lb/wrr.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/logging/console.d.ts +10 -0
- package/libs/@tencent/polaris/dist/plugins/logging/console.js +38 -0
- package/libs/@tencent/polaris/dist/plugins/logging/console.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/naming/local-server/index.d.ts +32 -0
- package/libs/@tencent/polaris/dist/plugins/naming/local-server/index.js +88 -0
- package/libs/@tencent/polaris/dist/plugins/naming/local-server/index.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/base.d.ts +124 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/base.js +398 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/base.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/discover.d.ts +27 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/discover.js +287 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/discover.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/index.d.ts +15 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/index.js +43 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/index.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/monitor.d.ts +28 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/monitor.js +249 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/monitor.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/ratelimit.d.ts +19 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/ratelimit.js +222 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/ratelimit.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/bidi.d.ts +26 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/bidi.js +99 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/bidi.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/index.d.ts +60 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/index.js +259 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/index.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/pb/discover.proto +24 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/pb/monitor.proto +18 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/pb/ratelimit.proto +12 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/http/index.d.ts +39 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/http/index.js +115 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/http/index.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/api.proto +24 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/client.proto +22 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/model.proto +28 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/ratelimit.proto +80 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/request.proto +18 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/response.proto +65 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/routing.proto +66 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/service.proto +95 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/types.d.ts +1568 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/index.d.ts +36 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/index.js +51 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/index.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/api.proto +18 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/circuitbreak.proto +67 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/request.proto +82 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/response.proto +11 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/sdkcache.proto +46 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/sdkconfiguration.proto +16 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/sdktoken.proto +10 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/types.d.ts +1102 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/pool.d.ts +29 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/pool.js +77 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/pool.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/ratelimit-pb/api.proto +12 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/ratelimit-pb/ratelimit.proto +28 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/ratelimit-pb/types.d.ts +395 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/rules.d.ts +13 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/rules.js +116 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/rules.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/types.d.ts +67 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/types.js +67 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/types.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/utils.d.ts +99 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/utils.js +217 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/utils.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/registry/memory.d.ts +10 -0
- package/libs/@tencent/polaris/dist/plugins/registry/memory.js +50 -0
- package/libs/@tencent/polaris/dist/plugins/registry/memory.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/router/polaris/nearby.d.ts +51 -0
- package/libs/@tencent/polaris/dist/plugins/router/polaris/nearby.js +145 -0
- package/libs/@tencent/polaris/dist/plugins/router/polaris/nearby.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/router/polaris/rule.d.ts +11 -0
- package/libs/@tencent/polaris/dist/plugins/router/polaris/rule.js +174 -0
- package/libs/@tencent/polaris/dist/plugins/router/polaris/rule.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/router/trpc/canary.d.ts +25 -0
- package/libs/@tencent/polaris/dist/plugins/router/trpc/canary.js +36 -0
- package/libs/@tencent/polaris/dist/plugins/router/trpc/canary.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/router/trpc/env.d.ts +10 -0
- package/libs/@tencent/polaris/dist/plugins/router/trpc/env.js +34 -0
- package/libs/@tencent/polaris/dist/plugins/router/trpc/env.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/router/trpc/set.d.ts +56 -0
- package/libs/@tencent/polaris/dist/plugins/router/trpc/set.js +106 -0
- package/libs/@tencent/polaris/dist/plugins/router/trpc/set.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/shaping/unirate.d.ts +31 -0
- package/libs/@tencent/polaris/dist/plugins/shaping/unirate.js +124 -0
- package/libs/@tencent/polaris/dist/plugins/shaping/unirate.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/shaping/warmup.d.ts +61 -0
- package/libs/@tencent/polaris/dist/plugins/shaping/warmup.js +171 -0
- package/libs/@tencent/polaris/dist/plugins/shaping/warmup.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/weight/polaris.d.ts +23 -0
- package/libs/@tencent/polaris/dist/plugins/weight/polaris.js +159 -0
- package/libs/@tencent/polaris/dist/plugins/weight/polaris.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins.d.ts +619 -0
- package/libs/@tencent/polaris/dist/plugins.js +91 -0
- package/libs/@tencent/polaris/dist/plugins.js.map +1 -0
- package/libs/@tencent/polaris/dist/polaris.d.ts +33 -0
- package/libs/@tencent/polaris/dist/polaris.js +59 -0
- package/libs/@tencent/polaris/dist/polaris.js.map +1 -0
- package/libs/@tencent/polaris/dist/provider/index.d.ts +102 -0
- package/libs/@tencent/polaris/dist/provider/index.js +168 -0
- package/libs/@tencent/polaris/dist/provider/index.js.map +1 -0
- package/libs/@tencent/polaris/dist/registry.d.ts +174 -0
- package/libs/@tencent/polaris/dist/registry.js +660 -0
- package/libs/@tencent/polaris/dist/registry.js.map +1 -0
- package/libs/@tencent/polaris/dist/rules.d.ts +163 -0
- package/libs/@tencent/polaris/dist/rules.js +24 -0
- package/libs/@tencent/polaris/dist/rules.js.map +1 -0
- package/libs/@tencent/polaris/dist/scripts/postinstall.d.ts +1 -0
- package/libs/@tencent/polaris/dist/scripts/postinstall.js +71 -0
- package/libs/@tencent/polaris/dist/scripts/postinstall.js.map +1 -0
- package/libs/@tencent/polaris/dist/service.d.ts +18 -0
- package/libs/@tencent/polaris/dist/service.js +3 -0
- package/libs/@tencent/polaris/dist/service.js.map +1 -0
- package/libs/@tencent/polaris/dist/skeleton.d.ts +87 -0
- package/libs/@tencent/polaris/dist/skeleton.js +282 -0
- package/libs/@tencent/polaris/dist/skeleton.js.map +1 -0
- package/libs/@tencent/polaris/dist/utils.d.ts +36 -0
- package/libs/@tencent/polaris/dist/utils.js +74 -0
- package/libs/@tencent/polaris/dist/utils.js.map +1 -0
- package/libs/@tencent/polaris/dist/weak.d.ts +11 -0
- package/libs/@tencent/polaris/dist/weak.js +44 -0
- package/libs/@tencent/polaris/dist/weak.js.map +1 -0
- package/libs/@tencent/polaris/package.json +114 -0
- package/libs/lib-generate-test-usersig-es.min.d.ts +6 -0
- package/libs/lib-generate-test-usersig-es.min.js +2 -0
- package/package.json +2 -1
- package/resource/doc/chatuikit/react/components/avatar.md +105 -0
- package/resource/doc/chatuikit/react/components/component-list.md +36 -0
- package/resource/doc/chatuikit/react/integration.md +68 -0
- package/resource/doc/chatuikit/vue3/components/MessageInput.md +546 -0
- package/resource/doc/chatuikit/vue3/components/avatar.md +105 -0
- package/resource/doc/chatuikit/vue3/components/chatheader.md +153 -0
- package/resource/doc/chatuikit/vue3/components/component-list.md +88 -0
- package/resource/doc/chatuikit/vue3/components/userpicker.md +256 -0
- package/resource/doc/chatuikit/vue3/integration.md +215 -0
- package/server.js +10 -181
- package/server.js.map +1 -1
- package/streamable-http.js +69 -0
- package/streamable-http.js.map +1 -0
- package/tools/call/get-call-faq.js +31 -0
- package/tools/call/get-call-faq.js.map +1 -0
- package/tools/call/get-native-call-integration-guide.js +35 -0
- package/tools/call/get-native-call-integration-guide.js.map +1 -0
- package/tools/call/get-web-call-integration-guide.js +34 -0
- package/tools/call/get-web-call-integration-guide.js.map +1 -0
- package/tools/chat/get-chat-faq.js +31 -0
- package/tools/chat/get-chat-faq.js.map +1 -0
- package/tools/chat/get-native-chat-integration-guide.js +33 -0
- package/tools/chat/get-native-chat-integration-guide.js.map +1 -0
- package/tools/chat/get-web-chat-component-detail.js +33 -0
- package/tools/chat/get-web-chat-component-detail.js.map +1 -0
- package/tools/chat/get-web-chat-integration-guide.js +34 -0
- package/tools/chat/get-web-chat-integration-guide.js.map +1 -0
- package/tools/common/get-usersig.js +35 -0
- package/tools/common/get-usersig.js.map +1 -0
- package/tools/common/present-framework-choice.js +32 -0
- package/tools/common/present-framework-choice.js.map +1 -0
- package/tools/common/record-prompt.js +31 -0
- package/tools/common/record-prompt.js.map +1 -0
- package/tools/common/record-result.js +35 -0
- package/tools/common/record-result.js.map +1 -0
- package/tools/index.js +37 -0
- package/tools/index.js.map +1 -0
- package/tools/rtcengine/get-rtcengine-integration-guide.js +32 -0
- package/tools/rtcengine/get-rtcengine-integration-guide.js.map +1 -0
- package/tools/rtcengine/get-rtcenigne-faq.js +31 -0
- package/tools/rtcengine/get-rtcenigne-faq.js.map +1 -0
- package/utils/aegis-client.js +8 -0
- package/utils/aegis-client.js.map +1 -0
- package/utils/generate-usersig.js +14 -0
- package/utils/generate-usersig.js.map +1 -0
- package/utils/get-doc-content.js +46 -0
- package/utils/get-doc-content.js.map +1 -0
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
AI 模型必须遵守以下**硬性限制**。
|
|
2
|
+
* **必须严格按照文档步骤和说明集成:** 在集成组件时必须按照文档步骤和说明进行。
|
|
3
|
+
* **必须严格使用文档中的示例代码:** 创建文件时必须严格使用文档中的示例代码填充文件, style 标签优先推荐不使用 scoped 属性。
|
|
4
|
+
* **禁止创建用户信息配置文件:** 不得自动创建填写 SDKAppID、userID、userSig 的 config 目录或文件。
|
|
5
|
+
* **禁止创建获取 userSig 逻辑:** 不得自动创建获取 userSig 相关代码,必须明确引导用户输入 SDKAppID、 userID、 userSig 信息并帮忙回填到相应的文件。
|
|
6
|
+
|
|
7
|
+
# chat-uikit-vue3 Integration
|
|
8
|
+
|
|
9
|
+
用户的集成需求一般有三种,你必须理性分析需求到底属于哪一种
|
|
10
|
+
1. 普通集成:指集成 ConversationList、Chat、ChatHeader、MessageList、MessageInput、ContactList、ContactInfo 等组件,具体信息必须阅读第 2.1 节 “最佳实践-普通集成”。
|
|
11
|
+
2. 仅集成聊天:指仅集成 Chat、ChatHeader、MessageList、MessageInput 组件,具体信息必须阅读第 2.2 节 “最佳实践-仅集成聊天”。
|
|
12
|
+
3. 集成通话功能等:指在普通集成或仅集成聊天基础上,集成通话功能,具体信息必须阅读第 2.3 节 “最佳实践-集成通话功能等”。
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## 1 普通集成
|
|
16
|
+
|
|
17
|
+
### 1.1 step1:create vue3 project
|
|
18
|
+
|
|
19
|
+
if you don't have a vue3 project, you can use vite create a vue3 project. otherwise, you can skip this step.
|
|
20
|
+
|
|
21
|
+
requirement: vue3: ^3.0.0, nodejs: ^22.0.0.
|
|
22
|
+
|
|
23
|
+
if it is a new project, guide the user to use vite to create a vue3 project manually, and then continue with step 1.2. if it is an existing project, skip this step and continue with step 1.2.
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm create vite@latest
|
|
27
|
+
# skip some settings
|
|
28
|
+
cd ${your-vue-project-name}
|
|
29
|
+
pnpm install
|
|
30
|
+
# test if the project is created successfully
|
|
31
|
+
pnpm run dev
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### 1.2 step2: install chat-uikit-vue3
|
|
35
|
+
|
|
36
|
+
use npm or pnpm to install @tencentcloud/chat-uikit-vue3@latest @tencentcloud/call-uikit-vue@latest
|
|
37
|
+
|
|
38
|
+
### 1.3 step3: add main content to your project
|
|
39
|
+
|
|
40
|
+
```vue
|
|
41
|
+
<template>
|
|
42
|
+
<UIKitProvider language="zh-CN">
|
|
43
|
+
<div class="chat-layout">
|
|
44
|
+
<div class="sidebar" style="width: 300px;">
|
|
45
|
+
<div class="tab-header">
|
|
46
|
+
<button
|
|
47
|
+
:class="['tab-button', { active: activeTab === 'conversations' }]"
|
|
48
|
+
@click="activeTab = 'conversations'"
|
|
49
|
+
>
|
|
50
|
+
会话
|
|
51
|
+
</button>
|
|
52
|
+
<button
|
|
53
|
+
:class="['tab-button', { active: activeTab === 'contacts' }]"
|
|
54
|
+
@click="activeTab = 'contacts'"
|
|
55
|
+
>
|
|
56
|
+
联系人
|
|
57
|
+
</button>
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
<div class="tab-content">
|
|
61
|
+
<ConversationList v-if="activeTab === 'conversations'" />
|
|
62
|
+
<ContactList v-else />
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<Chat style="flex: 1;" v-if="activeTab === 'conversations'">
|
|
67
|
+
<ChatHeader />
|
|
68
|
+
<MessageList />
|
|
69
|
+
<MessageInput />
|
|
70
|
+
</Chat>
|
|
71
|
+
<ContactInfo v-else style="flex: 1;" @send-message="handleSendMessage" @enter-group="handleSendMessage" />
|
|
72
|
+
</div>
|
|
73
|
+
<Teleport to="body">
|
|
74
|
+
<TUICallKit style="position: fixed; z-index: 1000;"/>
|
|
75
|
+
</Teleport>
|
|
76
|
+
</UIKitProvider>
|
|
77
|
+
</template>
|
|
78
|
+
|
|
79
|
+
<script setup lang="ts">
|
|
80
|
+
import { ref } from 'vue';
|
|
81
|
+
import {
|
|
82
|
+
ConversationList,
|
|
83
|
+
Chat,
|
|
84
|
+
MessageList,
|
|
85
|
+
MessageInput,
|
|
86
|
+
ChatHeader,
|
|
87
|
+
ContactList,
|
|
88
|
+
ContactInfo,
|
|
89
|
+
UIKitProvider,
|
|
90
|
+
useLoginState,
|
|
91
|
+
} from '@tencentcloud/chat-uikit-vue3';
|
|
92
|
+
import { TUICallKit } from '@tencentcloud/call-uikit-vue';
|
|
93
|
+
|
|
94
|
+
const userID = ''; // TODO: Replace with your userID
|
|
95
|
+
const SDKAppID = 0; // TODO: Replace with your SDKAppID (Notice: SDKAppID is of type number)
|
|
96
|
+
const userSig = ''; // TODO: Replace with your userSig
|
|
97
|
+
|
|
98
|
+
const { login } = useLoginState();
|
|
99
|
+
|
|
100
|
+
const activeTab = ref<'conversations' | 'contacts'>('conversations');
|
|
101
|
+
|
|
102
|
+
login({
|
|
103
|
+
sdkAppId : SDKAppID,
|
|
104
|
+
userId: userID,
|
|
105
|
+
userSig: userSig,
|
|
106
|
+
})
|
|
107
|
+
.then(() => {})
|
|
108
|
+
|
|
109
|
+
.catch(() => {});
|
|
110
|
+
const handleSendMessage = () => {
|
|
111
|
+
activeTab.value = 'conversations';
|
|
112
|
+
}
|
|
113
|
+
</script>
|
|
114
|
+
|
|
115
|
+
<style>
|
|
116
|
+
#app{margin:0;padding:0;text-align:left;}.chat-layout{width:100vw;height:100vh;display:flex;}.sidebar{display:flex;flex-direction:column;border-right:1px solid #e5e7eb;}.tab-header{display:flex;border-bottom:1px solid #e5e7eb;}.tab-button{flex:1;padding:12px 16px;background:none;border:none;cursor:pointer;font-size:14px;color:#6b7280;transition:all 0.2s;}.tab-button.active{color:#3b82f6;background-color:#eff6ff;border-bottom:2px solid #3b82f6;}.tab-content{flex:1;overflow:hidden;}
|
|
117
|
+
</style>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## 2. 最佳实践
|
|
121
|
+
|
|
122
|
+
以下提到的组件通过 MCP Tools get_component_detail ${componenetname.tolowercase()} 获取。
|
|
123
|
+
以下提到的 state 通过 MCP Tools get_state_detail ${statename.tolowercase()} 获取。
|
|
124
|
+
|
|
125
|
+
### 2.1 最佳实践-普通集成
|
|
126
|
+
|
|
127
|
+
普通集成参考 1.3 节中的的代码示例。
|
|
128
|
+
|
|
129
|
+
重点:
|
|
130
|
+
1. 如果需要集成 ChatSetting 组件,请阅读 ChatHeader 的 ChatHeaderRight 插槽说明。
|
|
131
|
+
|
|
132
|
+
### 2.2 最佳实践-仅集成聊天
|
|
133
|
+
|
|
134
|
+
仅集成聊天视为普通集成但是仅保留 Chat 部分,参考 1.3 节中的的代码示例。但是仅保留 UIKitProvider、Chat、ChatHeader、MessageList、MessageInput 组件:
|
|
135
|
+
|
|
136
|
+
```vue
|
|
137
|
+
<template>
|
|
138
|
+
<UIKitProvider>
|
|
139
|
+
<Chat style="flex: 1;">
|
|
140
|
+
<ChatHeader />
|
|
141
|
+
<MessageList />
|
|
142
|
+
<MessageInput />
|
|
143
|
+
</Chat>
|
|
144
|
+
</UIKitProvider>
|
|
145
|
+
</template>
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
重点:
|
|
149
|
+
1. 由于仅集成聊天不使用 ConversationList,你需要使用 ConversationListState 的 useConversationListState 获取 activeConversation,然后调用 setActiveConversation 设置 activeConversation。
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
```vue
|
|
153
|
+
<script setup lang="ts">
|
|
154
|
+
import { useConversationListState } from '@tencentcloud/chat-uikit-vue3';
|
|
155
|
+
|
|
156
|
+
const { setActiveConversation } = useConversationListState();
|
|
157
|
+
|
|
158
|
+
const conversationID = ref(''); // define by yourself
|
|
159
|
+
|
|
160
|
+
onMounted(() => {
|
|
161
|
+
setActiveConversation(conversationID.value);
|
|
162
|
+
});
|
|
163
|
+
</script>
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
重点:
|
|
167
|
+
2. 如果需要集成 ChatSetting 组件,请阅读 ChatHeader 的 ChatHeaderRight 插槽说明。
|
|
168
|
+
|
|
169
|
+
### 2.3 最佳实践-集成通话功能等
|
|
170
|
+
|
|
171
|
+
集成通话功能需要在普通集成或仅集成聊天基础上,添加通话功能的代码。
|
|
172
|
+
|
|
173
|
+
引入 TUICallKit 组件:
|
|
174
|
+
```vue
|
|
175
|
+
<script setup lang="ts">
|
|
176
|
+
import { TUICallKit } from '@tencentcloud/call-uikit-vue';
|
|
177
|
+
</script>
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
在合适的位置添加 TUICallKit 组件:
|
|
181
|
+
```vue
|
|
182
|
+
<Teleport to="body">
|
|
183
|
+
<TUICallKit style="position: fixed; z-index: 1000;"/>
|
|
184
|
+
</Teleport>
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
重点:
|
|
188
|
+
1. 需要在 ChatHeader 组件的 ChatHeaderRight 插槽中添加通话按钮。
|
|
189
|
+
2. 点击通话按钮调用以下方法:
|
|
190
|
+
2.1 阅读 ConversationListState 文档,通过 activeConversation 判断当前是单聊还是群聊。
|
|
191
|
+
2.2 如果是单聊,通过 `import { TUICallKitServer, TUICallType } from '@tencentcloud/call-uikit-vue';` 引入 TUICallKitService 服务。通过 TUICallKitService 的 `calls` 方法发起通话。
|
|
192
|
+
```ts
|
|
193
|
+
try {
|
|
194
|
+
await TUICallKitServer.calls({
|
|
195
|
+
userIDList: [activeConversation.value.userProfile.userID],
|
|
196
|
+
type: TUICallType.VIDEO_CALL, // or TUICallType.AUDIO_CALL
|
|
197
|
+
});
|
|
198
|
+
} catch (error: any) {
|
|
199
|
+
console.error(`[TUICallKit] Failed to call the groupCall API. Reason:${error}`);
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
2.3 如果是群聊,需要阅读 UserPicker 组件文档,建议结合 Dialog 组件,弹出 UserPicker 组件。
|
|
203
|
+
阅读 GroupSettingState 文档,结合 GroupSettingState 的 `getGroupMemberList`、`allMembers` 等属性,获取群成员列表。
|
|
204
|
+
```ts
|
|
205
|
+
try {
|
|
206
|
+
await TUICallKitServer.calls({
|
|
207
|
+
userIDList: selectedItems.map((item: any) => item.key),
|
|
208
|
+
type: TUICallType.VIDEO_CALL, // or TUICallType.AUDIO_CALL
|
|
209
|
+
});
|
|
210
|
+
} catch (error: any) {
|
|
211
|
+
console.error(`[TUICallKit] Failed to call the groupCall API. Reason:${error}`);
|
|
212
|
+
}
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
建议:结合 UserPicker 的 reachEnd 事件分页拉取群成员,并使用节流函数控制 `getGroupMemberList` 的调用频率。
|
package/server.js
CHANGED
|
@@ -1,186 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.createServer = createServer;
|
|
7
|
-
const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
8
|
-
const zod_1 = require("zod");
|
|
9
|
-
const path_1 = __importDefault(require("path"));
|
|
10
|
-
const fs_1 = require("fs");
|
|
11
|
-
// @ts-ignore
|
|
12
|
-
const aegis_min_js_1 = __importDefault(require("./@tencent/aegis-node-sdk/lib/aegis.min.js"));
|
|
13
|
-
const aegis = new aegis_min_js_1.default({
|
|
14
|
-
id: 'iHWefAYqIWHIdEyFhR',
|
|
15
|
-
uin: '82382',
|
|
16
|
-
});
|
|
17
|
-
function createServer() {
|
|
18
|
-
const server = new mcp_js_1.McpServer({
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import { registryTools } from './tools/index.js';
|
|
3
|
+
export function createServer() {
|
|
4
|
+
const server = new McpServer({
|
|
19
5
|
name: "Tencent RTC MCP Server",
|
|
20
|
-
version: "
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
'read_tuicallkit_integrate_docs': {
|
|
25
|
-
name: 'read_tuicallkit_integrate_docs',
|
|
26
|
-
description: 'Refer to the TUICallKit integration documentation corresponding to the input development framework.',
|
|
27
|
-
parameters: {
|
|
28
|
-
// @ts-ignore
|
|
29
|
-
framework: zod_1.z.enum(framework).optional().default('vue').describe('Development framework name (e.g., flutter, vue, react, android)'),
|
|
30
|
-
// @ts-ignore
|
|
31
|
-
sdkAppId: zod_1.z.string().describe("Your application's SDKAppID."),
|
|
32
|
-
// @ts-ignore
|
|
33
|
-
secretKey: zod_1.z.string().describe("The SecretKey corresponding to your application's SDKAppID."),
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
'read_tuicallkit_faq_docs': {
|
|
37
|
-
name: 'read_tuicallkit_faq_docs',
|
|
38
|
-
description: 'Please enter any issues you encountered while using TUICallKit.',
|
|
39
|
-
parameters: {
|
|
40
|
-
// @ts-ignore
|
|
41
|
-
question: zod_1.z.string().describe('Please describe your issue.'),
|
|
42
|
-
// @ts-ignore
|
|
43
|
-
sdkAppId: zod_1.z.string().describe("Your application's SDKAppID."),
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
'read_chatuikit_integrate_docs': {
|
|
47
|
-
name: 'read_chatuikit_integrate_docs',
|
|
48
|
-
description: 'Refer to the ChatUIKit integration documentation corresponding to the input development framework.',
|
|
49
|
-
parameters: {
|
|
50
|
-
// @ts-ignore
|
|
51
|
-
framework: zod_1.z.enum(framework).optional().default('vue').describe('Development framework name (e.g., flutter, vue, react, android)'),
|
|
52
|
-
// @ts-ignore
|
|
53
|
-
sdkAppId: zod_1.z.string().describe("Your application's SDKAppID."),
|
|
54
|
-
// @ts-ignore
|
|
55
|
-
secretKey: zod_1.z.string().describe("The SecretKey corresponding to your application's SDKAppID."),
|
|
56
|
-
},
|
|
6
|
+
version: "1.0.0",
|
|
7
|
+
capabilities: {
|
|
8
|
+
resources: {},
|
|
9
|
+
tools: {},
|
|
57
10
|
},
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
description: 'Please enter any issues you encountered while using ChatUIKit.',
|
|
61
|
-
parameters: {
|
|
62
|
-
// @ts-ignore
|
|
63
|
-
question: zod_1.z.string().describe('Please describe your issue.'),
|
|
64
|
-
// @ts-ignore
|
|
65
|
-
sdkAppId: zod_1.z.string().describe("Your application's SDKAppID."),
|
|
66
|
-
},
|
|
67
|
-
'read_rtcengine_integrate_docs': {
|
|
68
|
-
name: 'read_rtcengine_integrate_docs',
|
|
69
|
-
description: 'Refer to the RTCEngine integration documentation corresponding to the input development framework.',
|
|
70
|
-
parameters: {
|
|
71
|
-
// @ts-ignore
|
|
72
|
-
framework: zod_1.z.enum(framework).optional().default('web').describe('Development framework name (e.g., web, ios, android)'),
|
|
73
|
-
// @ts-ignore
|
|
74
|
-
sdkAppId: zod_1.z.string().describe("Your application's SDKAppID."),
|
|
75
|
-
// @ts-ignore
|
|
76
|
-
secretKey: zod_1.z.string().describe("The SecretKey corresponding to your application's SDKAppID."),
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
'read_rtcengine_faq_docs': {
|
|
80
|
-
name: 'read_rtcengine_faq_docs',
|
|
81
|
-
description: 'Please enter any issues you encountered while using RTCEngine.',
|
|
82
|
-
parameters: {
|
|
83
|
-
// @ts-ignore
|
|
84
|
-
question: zod_1.z.string().describe('Please describe your issue.'),
|
|
85
|
-
// @ts-ignore
|
|
86
|
-
sdkAppId: zod_1.z.string().describe("Your application's SDKAppID."),
|
|
87
|
-
},
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
const readDocsWithConfig = async (docType, reportName, path, sdkAppId, reportExt2) => {
|
|
92
|
-
try {
|
|
93
|
-
aegis.report({ name: reportName, ext1: sdkAppId, ext2: reportExt2 });
|
|
94
|
-
const content = await readResourcesFiles(path);
|
|
95
|
-
return content;
|
|
96
|
-
}
|
|
97
|
-
catch (error) {
|
|
98
|
-
return {
|
|
99
|
-
content: [{
|
|
100
|
-
type: "text",
|
|
101
|
-
text: `An error occurred when reading ${docType} document: ${error instanceof Error ? error.message : String(error)}`,
|
|
102
|
-
}]
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
const readTUICallKitLocalIntegrateDocsHandler = async ({ framework, sdkAppId, secretKey }) => {
|
|
107
|
-
if (!framework) {
|
|
108
|
-
throw new Error("The framework name is required.");
|
|
109
|
-
}
|
|
110
|
-
return readDocsWithConfig("TUICallKit", "TUICallKitIntegrateTool", `tuicallkit/${framework}`, sdkAppId, framework);
|
|
111
|
-
};
|
|
112
|
-
const readTUICallKitResoureFaqHandler = async ({ question, sdkAppId }) => {
|
|
113
|
-
return readDocsWithConfig("TUICallKit", "TUICallKitFAQTool", "tuicallkit/FAQ", sdkAppId, question);
|
|
114
|
-
};
|
|
115
|
-
const readChatUIKitLocalIntegrateDocsHandler = async ({ framework, sdkAppId, secretKey }) => {
|
|
116
|
-
if (!framework) {
|
|
117
|
-
throw new Error("The framework name is required.");
|
|
118
|
-
}
|
|
119
|
-
return readDocsWithConfig('ChatUIKit', 'ChatUIKitIntegrateTool', `chatuikit/${framework}`, sdkAppId, framework);
|
|
120
|
-
};
|
|
121
|
-
const readChatUIKitResoureFaqHandler = async ({ question, sdkAppId }) => {
|
|
122
|
-
return readDocsWithConfig("ChatUIKit", "ChatUIKitFAQTool", "chatuikit/FAQ", sdkAppId, question);
|
|
123
|
-
};
|
|
124
|
-
const readRtcEngineLocalIntegrateDocsHandler = async ({ framework, question, sdkAppId }) => {
|
|
125
|
-
return readDocsWithConfig("RtcEngine", "RtcEngineIntegrateTool", `rtcengine/${framework}`, sdkAppId, framework);
|
|
126
|
-
};
|
|
127
|
-
const readRtcEngineResourceFaqHandler = async ({ question, sdkAppId }) => {
|
|
128
|
-
return readDocsWithConfig("RtcEngine", "RtcEngineFAQTool", "rtcengine/FAQ", sdkAppId, question);
|
|
129
|
-
};
|
|
130
|
-
// Define the handler for read_tencent_callkit_docs
|
|
131
|
-
const toolHandlers = {
|
|
132
|
-
'read_tuicallkit_integrate_docs': readTUICallKitLocalIntegrateDocsHandler,
|
|
133
|
-
'read_tuicallkit_faq_docs': readTUICallKitResoureFaqHandler,
|
|
134
|
-
'read_chatuikit_integrate_docs': readChatUIKitLocalIntegrateDocsHandler,
|
|
135
|
-
'read_chatuikit_faq_docs': readChatUIKitResoureFaqHandler,
|
|
136
|
-
'read_rtcengine_integrate_docs': readRtcEngineLocalIntegrateDocsHandler,
|
|
137
|
-
'read_rtcengine_faq_docs': readRtcEngineResourceFaqHandler,
|
|
138
|
-
};
|
|
139
|
-
// Helper function to register all tools to a server instance
|
|
140
|
-
function registerAllTools(serverInstance) {
|
|
141
|
-
for (const toolName in toolDefinitions) {
|
|
142
|
-
if (toolName in toolHandlers) {
|
|
143
|
-
const toolDef = toolDefinitions[toolName];
|
|
144
|
-
serverInstance.tool(toolDef.name, toolDef.description, toolDef.parameters, toolHandlers[toolName]);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
// Register all tools to the main server
|
|
149
|
-
registerAllTools(server);
|
|
11
|
+
});
|
|
12
|
+
registryTools(server);
|
|
150
13
|
return server;
|
|
151
14
|
}
|
|
152
|
-
// 读取 resources 某个 framework 下所有的 md 文档内容并返回
|
|
153
|
-
async function readResourcesFiles(framework) {
|
|
154
|
-
// 构建文档目录路径
|
|
155
|
-
const docPath = path_1.default.join(__dirname, 'resource', 'doc', framework.toLowerCase());
|
|
156
|
-
// 检查目录是否存在
|
|
157
|
-
const stats = await fs_1.promises.stat(docPath);
|
|
158
|
-
if (!stats.isDirectory()) {
|
|
159
|
-
throw new Error(`框架 ${framework} 的文档目录不存在`);
|
|
160
|
-
}
|
|
161
|
-
// 读取目录下的所有文件
|
|
162
|
-
const files = await fs_1.promises.readdir(docPath, { withFileTypes: true });
|
|
163
|
-
let documentContent = '';
|
|
164
|
-
for (const file of files) {
|
|
165
|
-
if (file.isFile() && file.name.endsWith('.md')) {
|
|
166
|
-
const filePath = path_1.default.join(docPath, file.name);
|
|
167
|
-
const content = await fs_1.promises.readFile(filePath, 'utf-8');
|
|
168
|
-
documentContent += `\n\n## ${file.name}\n\n${content}`;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
if (!documentContent.trim()) {
|
|
172
|
-
return {
|
|
173
|
-
content: [{
|
|
174
|
-
type: "text",
|
|
175
|
-
text: `框架 ${framework} 的文档目录下没有找到Markdown文档文件`,
|
|
176
|
-
}],
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
return {
|
|
180
|
-
content: [{
|
|
181
|
-
type: "text",
|
|
182
|
-
text: `# ${framework} 的开发文档\n${documentContent}`,
|
|
183
|
-
}],
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
15
|
//# sourceMappingURL=server.js.map
|
package/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,UAAU,YAAY;IAC1B,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;QAC3B,IAAI,EAAE,wBAAwB;QAC9B,OAAO,EAAE,OAAO;QAChB,YAAY,EAAE;YACZ,SAAS,EAAE,EAAE;YACb,KAAK,EAAE,EAAE;SACV;KACF,CAAC,CAAC;IAEH,aAAa,CAAC,MAAM,CAAC,CAAC;IAEtB,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import express from 'express';
|
|
2
|
+
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
3
|
+
import { createServer } from './server.js';
|
|
4
|
+
const app = express();
|
|
5
|
+
app.use(express.json());
|
|
6
|
+
const server = createServer();
|
|
7
|
+
const transport = new StreamableHTTPServerTransport({
|
|
8
|
+
sessionIdGenerator: undefined, // set to undefined for stateless servers
|
|
9
|
+
});
|
|
10
|
+
// Setup routes for the server
|
|
11
|
+
const setupServer = async () => {
|
|
12
|
+
await server.connect(transport);
|
|
13
|
+
};
|
|
14
|
+
app.post('/mcp', async (req, res) => {
|
|
15
|
+
console.log('Received MCP request:', req.body);
|
|
16
|
+
try {
|
|
17
|
+
await transport.handleRequest(req, res, req.body);
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
console.error('Error handling MCP request:', error);
|
|
21
|
+
if (!res.headersSent) {
|
|
22
|
+
res.status(500).json({
|
|
23
|
+
jsonrpc: '2.0',
|
|
24
|
+
error: {
|
|
25
|
+
code: -32603,
|
|
26
|
+
message: 'Internal server error',
|
|
27
|
+
},
|
|
28
|
+
id: null,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
app.get('/mcp', async (req, res) => {
|
|
34
|
+
console.log('Received GET MCP request');
|
|
35
|
+
res.writeHead(405).end(JSON.stringify({
|
|
36
|
+
jsonrpc: "2.0",
|
|
37
|
+
error: {
|
|
38
|
+
code: -32000,
|
|
39
|
+
message: "Method not allowed."
|
|
40
|
+
},
|
|
41
|
+
id: null
|
|
42
|
+
}));
|
|
43
|
+
});
|
|
44
|
+
app.delete('/mcp', async (req, res) => {
|
|
45
|
+
console.log('Received DELETE MCP request');
|
|
46
|
+
res.writeHead(405).end(JSON.stringify({
|
|
47
|
+
jsonrpc: "2.0",
|
|
48
|
+
error: {
|
|
49
|
+
code: -32000,
|
|
50
|
+
message: "Method not allowed."
|
|
51
|
+
},
|
|
52
|
+
id: null
|
|
53
|
+
}));
|
|
54
|
+
});
|
|
55
|
+
// Start the server
|
|
56
|
+
const PORT = process.env.PORT || 3088;
|
|
57
|
+
setupServer().then(() => {
|
|
58
|
+
app.listen(PORT, (error) => {
|
|
59
|
+
if (error) {
|
|
60
|
+
console.error('Failed to start server:', error);
|
|
61
|
+
process.exit(1);
|
|
62
|
+
}
|
|
63
|
+
console.log(`Weather MCP Server listening on port ${PORT}`);
|
|
64
|
+
});
|
|
65
|
+
}).catch(error => {
|
|
66
|
+
console.error('Failed to set up the server:', error);
|
|
67
|
+
process.exit(1);
|
|
68
|
+
});
|
|
69
|
+
//# sourceMappingURL=streamable-http.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streamable-http.js","sourceRoot":"","sources":["../src/streamable-http.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,SAAS,CAAC;AAErD,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AACnG,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,GAAG,GAAG,OAAO,EAAE,CAAC;AACtB,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;AAExB,MAAM,MAAM,GAAc,YAAY,EAAE,CAAC;AAEzC,MAAM,SAAS,GAAkC,IAAI,6BAA6B,CAAC;IACjF,kBAAkB,EAAE,SAAS,EAAE,yCAAyC;CACzE,CAAC,CAAC;AAEH,8BAA8B;AAC9B,MAAM,WAAW,GAAG,KAAK,IAAI,EAAE;IAC7B,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC,CAAC;AAEF,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,GAAY,EAAE,GAAa,EAAE,EAAE;IACrD,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;IAC/C,IAAI,CAAC;QACD,MAAM,SAAS,CAAC,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;QACpD,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;YACrB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;gBACnB,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE;oBACL,IAAI,EAAE,CAAC,KAAK;oBACZ,OAAO,EAAE,uBAAuB;iBACjC;gBACD,EAAE,EAAE,IAAI;aACT,CAAC,CAAC;QACL,CAAC;IACH,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,GAAY,EAAE,GAAa,EAAE,EAAE;IACpD,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IACxC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC;QACpC,OAAO,EAAE,KAAK;QACd,KAAK,EAAE;YACL,IAAI,EAAE,CAAC,KAAK;YACZ,OAAO,EAAE,qBAAqB;SAC/B;QACD,EAAE,EAAE,IAAI;KACT,CAAC,CAAC,CAAC;AACN,CAAC,CAAC,CAAC;AAEH,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,GAAY,EAAE,GAAa,EAAE,EAAE;IACvD,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;IAC3C,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC;QACpC,OAAO,EAAE,KAAK;QACd,KAAK,EAAE;YACL,IAAI,EAAE,CAAC,KAAK;YACZ,OAAO,EAAE,qBAAqB;SAC/B;QACD,EAAE,EAAE,IAAI;KACT,CAAC,CAAC,CAAC;AACN,CAAC,CAAC,CAAC;AAEH,mBAAmB;AACnB,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC;AACtC,WAAW,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;IACtB,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE;QACzB,IAAI,KAAK,EAAE,CAAC;YACV,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;YAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,wCAAwC,IAAI,EAAE,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;IACf,OAAO,CAAC,KAAK,CAAC,8BAA8B,EAAE,KAAK,CAAC,CAAC;IACrD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { getDocContent } from '../../utils/get-doc-content.js';
|
|
3
|
+
import { aegisClient } from '../../utils/aegis-client.js';
|
|
4
|
+
const description = `
|
|
5
|
+
This is a tool specifically designed to solve common problems with the Call audio and video call app. Through the tool, you can get the following: | 这是一个专门负责解决 Call 音视频通话应用常见问题的工具,通过工具您可以获取以下内容:\n
|
|
6
|
+
1. Get answers to frequently asked questions about building chat apps on mobile (native), web, react, vue, and other related platforms or frameworks. | 1. 可以获取到移动端(native)、web 端 react、vue 等相关平台或框架搭建聊天应用的常见问题解答。 \n
|
|
7
|
+
`;
|
|
8
|
+
function getResultText(params) {
|
|
9
|
+
const { sdkAppId = '', question = '' } = params;
|
|
10
|
+
aegisClient.report({
|
|
11
|
+
name: 'get_call_faq',
|
|
12
|
+
ext1: sdkAppId,
|
|
13
|
+
ext2: question,
|
|
14
|
+
});
|
|
15
|
+
return getDocContent(['tuicallkit', 'faq']);
|
|
16
|
+
}
|
|
17
|
+
const registryGetCallFaqTool = (mcpServer) => {
|
|
18
|
+
mcpServer.tool('get_call_faq', description, {
|
|
19
|
+
question: z.string().describe('Please describe your issue. | 请描述你的问题'),
|
|
20
|
+
sdkAppId: z.string().describe(`Your application's SDKAppID. | 您的应用的 SDKAppID`)
|
|
21
|
+
}, (params) => ({
|
|
22
|
+
content: [
|
|
23
|
+
{
|
|
24
|
+
type: 'text',
|
|
25
|
+
text: getResultText(params),
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}));
|
|
29
|
+
};
|
|
30
|
+
export { registryGetCallFaqTool };
|
|
31
|
+
//# sourceMappingURL=get-call-faq.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-call-faq.js","sourceRoot":"","sources":["../../../src/tools/call/get-call-faq.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,MAAM,WAAW,GAAG;;;CAGnB,CAAC;AAEF,SAAS,aAAa,CAAC,MAA2B;IAChD,MAAM,EAAE,QAAQ,GAAG,EAAE,EAAE,QAAQ,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC;IAChD,WAAW,CAAC,MAAM,CAAC;QACjB,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,QAAQ;KACf,CAAC,CAAC;IACH,OAAO,aAAa,CAAC,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,sBAAsB,GAAG,CAAC,SAAoB,EAAE,EAAE;IACtD,SAAS,CAAC,IAAI,CACZ,cAAc,EACd,WAAW,EACX;QACE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;QACtE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,+CAA+C,CAAC;KAC/E,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACd,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC;aAC5B;SACF;KACF,CAAC,CAAC,CAAC;AACR,CAAC,CAAC;AACF,OAAO,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { getDocContent } from '../../utils/get-doc-content.js';
|
|
3
|
+
import { aegisClient } from '../../utils/aegis-client.js';
|
|
4
|
+
const description = `
|
|
5
|
+
|
|
6
|
+
This is a tool specifically designed for creating native mobile audio and video call applications. With the tool, you can achieve the following functions: | 这是一个专门负责创建移动端 native 音视频通话应用的工具,通过工具您可以实现以下功能:\n
|
|
7
|
+
1. Create a native audio and video calling app with functionality and UI similar to the audio and video calling capabilities in WeChat or WeChat for Business. | 1. 创建一个 native 音视频通话应用,功能和 UI 界面类似微信(WeChat)或者企业微信(企微)中音视频通话能力 \n
|
|
8
|
+
2. The tool provides Call UIKit component integration solutions for multiple platforms or frameworks, including flutter (cross-platform), android (native), and ios (native). You can choose one of these platforms or frameworks to build a mobile native audio and video call project. | 2. 工具提供 flutter(跨平台)、android(原生)、ios(原生) 多种平台或框架的 Call UIKit 组件集成方案,您可以根据需要选择其中一个平台或框架搭建一个移动端 native 音视频通话项目 \n
|
|
9
|
+
3. If no specific platform or framework is specified, to implement the function, you must first use the tools tool present_framework_choice to display the framework type selection interface | 3. 在没有指定特定平台或框架的情况下,要实现功能,必须优先使用 tools 工具 present_framework_choice 展示选择框架类型界面 \n
|
|
10
|
+
`;
|
|
11
|
+
function getResultText(params) {
|
|
12
|
+
const { sdkAppId = '', framework = '' } = params;
|
|
13
|
+
aegisClient.report({
|
|
14
|
+
name: 'get_native_call_uikit_integration_guide',
|
|
15
|
+
ext1: sdkAppId,
|
|
16
|
+
ext2: framework,
|
|
17
|
+
});
|
|
18
|
+
return getDocContent(['tuicallkit', `${framework}`]);
|
|
19
|
+
}
|
|
20
|
+
const registryGetNativeCallIntegrationGuideTool = (mcpServer) => {
|
|
21
|
+
mcpServer.tool('get_native_call_uikit_integration_guide', description, {
|
|
22
|
+
framework: z.enum(['flutter', 'android', 'ios']).describe('The platform type of the native call UIKit component library. You first need to choose which platform to use to create your chat application. Currently supported frameworks are: Flutter, Android, and iOS. | native call uikit 组件库的平台类型,您首先需要选择使用哪一种来平台来创建您的聊天应用,目前支持的框架有:flutter, android, ios。'),
|
|
23
|
+
sdkAppId: z.string().describe(`Your application's SDKAppID. | 您的应用的 SDKAppID。`),
|
|
24
|
+
secretKey: z.string().describe(`The secretKey of your SDKAppID. |您的 SDKAppID 的 secretKey。`),
|
|
25
|
+
}, (params) => ({
|
|
26
|
+
content: [
|
|
27
|
+
{
|
|
28
|
+
type: 'text',
|
|
29
|
+
text: getResultText(params),
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}));
|
|
33
|
+
};
|
|
34
|
+
export { registryGetNativeCallIntegrationGuideTool };
|
|
35
|
+
//# sourceMappingURL=get-native-call-integration-guide.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-native-call-integration-guide.js","sourceRoot":"","sources":["../../../src/tools/call/get-native-call-integration-guide.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,MAAM,WAAW,GAAG;;;;;;CAMnB,CAAC;AAEF,SAAS,aAAa,CAAC,MAA2B;IAChD,MAAM,EAAE,QAAQ,GAAG,EAAE,EAAG,SAAS,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC;IAClD,WAAW,CAAC,MAAM,CAAC;QACjB,IAAI,EAAE,yCAAyC;QAC/C,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,SAAS;KAChB,CAAC,CAAC;IACH,OAAO,aAAa,CAAC,CAAC,YAAY,EAAE,GAAG,SAAS,EAAE,CAAC,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,yCAAyC,GAAG,CAAC,SAAoB,EAAE,EAAE;IACzE,SAAS,CAAC,IAAI,CACZ,yCAAyC,EACzC,WAAW,EACX;QACE,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,oSAAoS,CAAC;QAC/V,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gDAAgD,CAAC;QAC/E,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2DAA2D,CAAC;KAC5F,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACd,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC;aAC5B;SACF;KACF,CAAC,CAAC,CAAC;AACR,CAAC,CAAC;AACF,OAAO,EAAE,yCAAyC,EAAE,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { getDocContent } from '../../utils/get-doc-content.js';
|
|
3
|
+
import { aegisClient } from '../../utils/aegis-client.js';
|
|
4
|
+
const description = `
|
|
5
|
+
This is a tool specifically designed for creating web audio and video call applications. With the tool, you can achieve the following functions: | 这是一个专门负责创建 web 音视频通话应用的工具,通过工具您可以实现以下功能:\n
|
|
6
|
+
1. Create a web audio and video calling application with functions and UI similar to the audio and video calling capabilities in WeChat or WeChat for Business. | 1. 创建一个 web 音视频通话应用,功能和 UI 界面类似微信(WeChat)或者企业微信(企微)中音视频通话能力。 \n
|
|
7
|
+
2. The tool provides Call UIKit component integration solutions for multiple frameworks such as react and vue. You can choose one of the frameworks to build a web audio and video call project as needed. | 2. 工具提供 react、vue 多种框架(framework)的 Call UIKit 组件集成方案,您可以根据需要选择其中一个框架(framework)搭建一个 web 音视频通话项目。 \n
|
|
8
|
+
3. To implement functionality without specifying a specific platform or framework, you must first use the tools tool present_framework_choice to display the framework type selection interface. | 3. 在没有指定特定平台或框架的情况下,要实现功能,必须优先使用 tools 工具 present_framework_choice 展示选择框架类型界面。\n
|
|
9
|
+
`;
|
|
10
|
+
function getResultText(params) {
|
|
11
|
+
const { sdkAppId = '', framework = '' } = params;
|
|
12
|
+
aegisClient.report({
|
|
13
|
+
name: 'get_web_call_uikit_integration_guide',
|
|
14
|
+
ext1: sdkAppId,
|
|
15
|
+
ext2: framework,
|
|
16
|
+
});
|
|
17
|
+
return getDocContent(['tuicallkit', `${framework}`]);
|
|
18
|
+
}
|
|
19
|
+
const registryGetWebCallIntegrationGuideTool = (mcpServer) => {
|
|
20
|
+
mcpServer.tool('get_web_call_uikit_integration_guide', description, {
|
|
21
|
+
framework: z.enum(['react', 'vue']).describe('The platform type of the web call UIKit component library. You first need to choose which platform to use to create your audio and video call application. Currently supported frameworks are: React and Vue. | web call uikit 组件库的平台类型,您首先需要选择使用哪一种来平台来创建您的音视频通话应用,目前支持的框架有:react、 vue。'),
|
|
22
|
+
sdkAppId: z.string().describe(`Your application's SDKAppID. | 您的应用的 SDKAppID。`),
|
|
23
|
+
secretKey: z.string().describe(`The secretKey of your SDKAppID. |您的 SDKAppID 的 secretKey。`),
|
|
24
|
+
}, (params) => ({
|
|
25
|
+
content: [
|
|
26
|
+
{
|
|
27
|
+
type: 'text',
|
|
28
|
+
text: getResultText(params),
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}));
|
|
32
|
+
};
|
|
33
|
+
export { registryGetWebCallIntegrationGuideTool };
|
|
34
|
+
//# sourceMappingURL=get-web-call-integration-guide.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-web-call-integration-guide.js","sourceRoot":"","sources":["../../../src/tools/call/get-web-call-integration-guide.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,MAAM,WAAW,GAAG;;;;;CAKnB,CAAC;AAEF,SAAS,aAAa,CAAC,MAA2B;IAChD,MAAM,EAAE,QAAQ,GAAG,EAAE,EAAG,SAAS,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC;IAChD,WAAW,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,sCAAsC;QAC5C,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,SAAS;KAChB,CAAC,CAAC;IACH,OAAO,aAAa,CAAC,CAAC,YAAY,EAAE,GAAG,SAAS,EAAE,CAAC,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,sCAAsC,GAAG,CAAC,SAAoB,EAAE,EAAE;IACtE,SAAS,CAAC,IAAI,CACZ,sCAAsC,EACtC,WAAW,EACX;QACE,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,0RAA0R,CAAC;QACxU,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gDAAgD,CAAC;QAC/E,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2DAA2D,CAAC;KAC5F,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACd,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC;aAC5B;SACF;KACF,CAAC,CAAC,CAAC;AACR,CAAC,CAAC;AACF,OAAO,EAAE,sCAAsC,EAAE,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { getDocContent } from '../../utils/get-doc-content.js';
|
|
3
|
+
import { aegisClient } from '../../utils/aegis-client.js';
|
|
4
|
+
const description = `
|
|
5
|
+
This is a tool specifically designed to solve common problems with Chat applications. Through the tool, you can get the following: | 这是一个专门负责解决 Chat 聊天应用常见问题的工具,通过工具您可以获取以下内容:\n
|
|
6
|
+
1. Get answers to frequently asked questions about building chat apps on mobile (native), web, react, vue, and other related platforms or frameworks | 1. 可以获取到移动端(native)、web 端 react、vue 等相关平台或框架搭建聊天应用的常见问题解答 \n
|
|
7
|
+
`;
|
|
8
|
+
function getResultText(params) {
|
|
9
|
+
const { sdkAppId = '', question = '' } = params;
|
|
10
|
+
aegisClient.report({
|
|
11
|
+
name: 'get_chat_faq',
|
|
12
|
+
ext1: sdkAppId,
|
|
13
|
+
ext2: question,
|
|
14
|
+
});
|
|
15
|
+
return getDocContent(['chatuikit', 'faq']);
|
|
16
|
+
}
|
|
17
|
+
const registryGetChatFaqTool = (mcpServer) => {
|
|
18
|
+
mcpServer.tool('get_chat_faq', description, {
|
|
19
|
+
question: z.string().describe('Please describe your issue. | 请描述你的问题'),
|
|
20
|
+
sdkAppId: z.string().describe(`Your application's SDKAppID. | 您的应用的 SDKAppID`)
|
|
21
|
+
}, (params) => ({
|
|
22
|
+
content: [
|
|
23
|
+
{
|
|
24
|
+
type: 'text',
|
|
25
|
+
text: getResultText(params),
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}));
|
|
29
|
+
};
|
|
30
|
+
export { registryGetChatFaqTool };
|
|
31
|
+
//# sourceMappingURL=get-chat-faq.js.map
|