@tencent-rtc/mcp 1.2.8 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/resource/doc/chatuikit/faq/common/server.md +44 -0
- package/resource/doc/chatuikit/faq/web_sdk/faq.md +57 -0
- package/resource/doc/livekit/vue/components/co-guest-panel.md +3 -3
- package/resource/doc/livekit/vue/components/live-view.md +4 -4
- package/resource/doc/livekit/vue/{components/live-list.md → live-list-integration.md} +7 -7
- package/resource/doc/livekit/vue/{components/live-player.md → live-player-desk-integration.md} +8 -8
- package/resource/doc/livekit/vue/live-player-h5-integration.md +269 -0
- package/resource/doc/livekit/vue/workflow.md +218 -0
- package/resource/doc/native_live/android/V2TXLiveCode_api_android.md +312 -0
- package/resource/doc/native_live/android/V2TXLiveDef_api_android.md +430 -0
- package/resource/doc/native_live/android/V2TXLivePlayerObserver_api_android.md +679 -0
- package/resource/doc/native_live/android/V2TXLivePlayer_api_android.md +671 -0
- package/resource/doc/native_live/android/V2TXLivePremier_api_android.md +271 -0
- package/resource/doc/native_live/android/V2TXLivePusherObserver_api_android.md +849 -0
- package/resource/doc/native_live/android/V2TXLivePusher_api_android.md +1046 -0
- package/resource/doc/native_live/flutter/V2TXLiveCode_api_flutter.md +460 -0
- package/resource/doc/native_live/flutter/V2TXLiveDef_api_flutter.md +558 -0
- package/resource/doc/native_live/flutter/V2TXLivePlayerObserver_api_flutter.md +865 -0
- package/resource/doc/native_live/flutter/V2TXLivePlayer_api_flutter.md +657 -0
- package/resource/doc/native_live/flutter/V2TXLivePremier_api_flutter.md +437 -0
- package/resource/doc/native_live/flutter/V2TXLivePusherObserver_api_flutter.md +335 -0
- package/resource/doc/native_live/flutter/V2TXLivePusher_api_flutter.md +748 -0
- package/resource/doc/native_live/iOS/V2TXLiveCode_api_iOS.md +327 -0
- package/resource/doc/native_live/iOS/V2TXLiveDef_api_iOS.md +507 -0
- package/resource/doc/native_live/iOS/V2TXLivePlayerObserver_api_iOS.md +507 -0
- package/resource/doc/native_live/iOS/V2TXLivePlayer_api_iOS.md +659 -0
- package/resource/doc/native_live/iOS/V2TXLivePremier_api_iOS.md +284 -0
- package/resource/doc/native_live/iOS/V2TXLivePusherObserver_api_iOS.md +814 -0
- package/resource/doc/native_live/iOS/V2TXLivePusher_api_iOS.md +1000 -0
- package/resource/doc/trtc/C++/ITRTCCloud.md +4119 -0
- package/resource/doc/trtc/C++/ITRTCStatistics.md +325 -0
- package/resource/doc/trtc/C++/ITXAudioEffectManager.md +1289 -0
- package/resource/doc/trtc/C++/ITXDeviceManager.md +1028 -0
- package/resource/doc/trtc/C++/TRTCCloudCallback.md +2650 -0
- package/resource/doc/trtc/C++/TRTCTypeDef.md +3600 -0
- package/resource/doc/trtc/C++/TXLiteAVCode.md +921 -0
- package/resource/doc/trtc/android/TRTCCloud.md +3782 -0
- package/resource/doc/trtc/android/TRTCCloudDef.md +3880 -0
- package/resource/doc/trtc/android/TRTCCloudListener.md +2431 -0
- package/resource/doc/trtc/android/TRTCStatistics.md +295 -0
- package/resource/doc/trtc/android/TXAudioEffectManager.md +1289 -0
- package/resource/doc/trtc/android/TXBeautyManager.md +979 -0
- package/resource/doc/trtc/android/TXDeviceManager.md +440 -0
- package/resource/doc/trtc/android/TXLiteAVCode.md +905 -0
- package/resource/doc/trtc/iOS/TRTCCloud.md +4238 -0
- package/resource/doc/trtc/iOS/TRTCCloudDef.md +3730 -0
- package/resource/doc/trtc/iOS/TRTCCloudDelegate.md +2531 -0
- package/resource/doc/trtc/iOS/TRTCStatistics.md +295 -0
- package/resource/doc/trtc/iOS/TXAudioEffectManager.md +1100 -0
- package/resource/doc/trtc/iOS/TXBeautyManager.md +985 -0
- package/resource/doc/trtc/iOS/TXDeviceManager.md +1024 -0
- package/resource/doc/trtc/iOS/TXLiteAVCode.md +928 -0
- package/tools/definitions/get_faq_def.js +4 -0
- package/tools/definitions/get_faq_def.js.map +1 -1
- package/tools/definitions/get_native_live_api_def.js +23 -0
- package/tools/definitions/get_native_live_api_def.js.map +1 -0
- package/tools/definitions/get_trtc_native_api_def.js +16 -0
- package/tools/definitions/get_trtc_native_api_def.js.map +1 -0
- package/tools/definitions/get_web_live_uikit_component_detail_def.js +13 -8
- package/tools/definitions/get_web_live_uikit_component_detail_def.js.map +1 -1
- package/tools/definitions/get_web_live_uikit_integration_def.js +32 -0
- package/tools/definitions/get_web_live_uikit_integration_def.js.map +1 -0
- package/tools/index.js +8 -0
- package/tools/index.js.map +1 -1
- package/tools/live/get-web-live-uikit-integration.js +52 -0
- package/tools/live/get-web-live-uikit-integration.js.map +1 -0
- package/tools/native_live/get-native-live-api.js +31 -0
- package/tools/native_live/get-native-live-api.js.map +1 -0
- package/tools/trtc/get-trtc-native-api.js +31 -0
- package/tools/trtc/get-trtc-native-api.js.map +1 -0
- package/utils/generate-structured-result.js +34 -0
- package/utils/generate-structured-result.js.map +1 -0
- package/utils/handle-component-name.js +0 -8
- package/utils/handle-component-name.js.map +1 -1
- package/utils/report-cls-client.js +1 -1
- package/utils/report-es-client.js +1 -1
- /package/resource/doc/livekit/vue/{components/broadcast.md → live-pusher-integration.md} +0 -0
|
@@ -13,6 +13,10 @@ const TOOL_DESCRIPTION = `
|
|
|
13
13
|
|
|
14
14
|
[KEYWORDS]: FAQ, Knowledge Base, Document Retrieval, Common Questions, Chat, Call, TRTC, Real-Time Communication, User Authentication, UserSig, SDK.\n
|
|
15
15
|
|
|
16
|
+
[Mandatory Constraints]: \n
|
|
17
|
+
1. Product Selection Constraint: If the LLM cannot explicitly infer the target product line (product) from the user's prompt, it must prioritize guiding the user to select one of the following products: (chat, call, live, room, rtcengine).
|
|
18
|
+
2. Framework Selection Constraint: If the LLM cannot explicitly infer the target platform or framework (framework) from the user's prompt, it must prioritize calling the 'present_framework_choice' tool to guide the user to select the platform/framework.
|
|
19
|
+
|
|
16
20
|
[RETURN FORMAT]: Returns raw Markdown content and a structured JSON object.
|
|
17
21
|
`;
|
|
18
22
|
const PARAMETER_DESCRIPTIONS = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get_faq_def.js","sourceRoot":"","sources":["../../../src/tools/definitions/get_faq_def.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAG
|
|
1
|
+
{"version":3,"file":"get_faq_def.js","sourceRoot":"","sources":["../../../src/tools/definitions/get_faq_def.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;CAoBxB,CAAC;AAEF,MAAM,sBAAsB,GAAG;IAC7B,KAAK,EAAE,kDAAkD;IACzD,OAAO,EAAE,wFAAwF;IACjG,SAAS,EAAE,2GAA2G;CACvH,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,gBAAgB;IAC7B,sBAAsB,EAAE,sBAAsB;CAC/C,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const TOOL_DESCRIPTION = `
|
|
2
|
+
[CORE FUNCTION]: This is a tool (Live SDK) specifically designed for live streaming push and pull.\n
|
|
3
|
+
|
|
4
|
+
You can achieve the following functions:\n
|
|
5
|
+
1. V2TXLivePusher enables camera and screen sharing, as well as pushing local video files to the cloud.
|
|
6
|
+
2. V2TXLivePlayer can pull and play live streams from the cloud, supporting FLV, RTMP, WebRTC, and M3U8 protocols.
|
|
7
|
+
3. The live streaming SDK supports multiple platforms including Flutter (cross-platform), Android (native) and iOS (native). You can choose one of these platforms for integration as needed.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
[KEYWORDS]: 'Live', '直播', '推流', 'Pusher', 'Player', '拉流', '播放', 'V2TXLivePlayer', 'V2TXLivePusher', 'flv', 'rtmp', 'hls', 'm3u8', 'webrtc', 'leb', '快直播', 'Live Stream'。\n
|
|
11
|
+
|
|
12
|
+
[SUPPORTED FRAMEWORKS]: Currently only supports the Android、iOS、Flutter frameworks.
|
|
13
|
+
`;
|
|
14
|
+
const PARAMETER_DESCRIPTIONS = {
|
|
15
|
+
framework: 'For the Live SDK platform type. You first need to choose which platform to use to create your chat application. Currently supported frameworks are: Flutter, Android and iOS.',
|
|
16
|
+
componentName: 'Live SDK.'
|
|
17
|
+
};
|
|
18
|
+
export const GET_NATIVE_LIVE_API_DEFINITION = {
|
|
19
|
+
name: 'get_native_live_api',
|
|
20
|
+
description: TOOL_DESCRIPTION,
|
|
21
|
+
parameter_descriptions: PARAMETER_DESCRIPTIONS,
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=get_native_live_api_def.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get_native_live_api_def.js","sourceRoot":"","sources":["../../../src/tools/definitions/get_native_live_api_def.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAG;;;;;;;;;;;;CAYxB,CAAC;AAEF,MAAM,sBAAsB,GAAG;IAC7B,SAAS,EAAE,+KAA+K;IAC1L,aAAa,EAAE,WAAW;CAC3B,CAAC;AAEF,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,gBAAgB;IAC7B,sBAAsB,EAAE,sBAAsB;CAC/C,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const TOOL_DESCRIPTION = `The Real-Time Audio & Video (TRTC SDK) primarily offers two solutions: low-latency interactive live streaming and multi-person audio & video. It supports low-latency live streaming viewing, real-time recording, screen sharing, beauty effects, stereo sound, and seamless integration with live streaming CDNs. It is suitable for various business scenarios such as interactive live streaming, cross-room PK, voice radio, karaoke, small group classes, large group classes, voice chat, video chat, and online conferencing. This article will briefly describe the business scenarios that the low-latency interactive live streaming and multi-person audio & video solutions can address.\n
|
|
2
|
+
|
|
3
|
+
[KEYWORDS]: 'TRTC', '实时音视频', '互动直播', '多人音视频'。\n
|
|
4
|
+
|
|
5
|
+
[SUPPORTED FRAMEWORKS]: Currently only supports the Android、iOS and C++ frameworks.
|
|
6
|
+
`;
|
|
7
|
+
const PARAMETER_DESCRIPTIONS = {
|
|
8
|
+
framework: 'For the TRTC SDK platform type. You first need to choose which platform to use to create your chat application. Currently supported frameworks are: Flutter, Android、iOS and C++.',
|
|
9
|
+
componentName: 'TRTC SDK.'
|
|
10
|
+
};
|
|
11
|
+
export const GET_TRTC_NATIVE_API_DEFINITION = {
|
|
12
|
+
name: 'get_trtc_native_api',
|
|
13
|
+
description: TOOL_DESCRIPTION,
|
|
14
|
+
parameter_descriptions: PARAMETER_DESCRIPTIONS,
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=get_trtc_native_api_def.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get_trtc_native_api_def.js","sourceRoot":"","sources":["../../../src/tools/definitions/get_trtc_native_api_def.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAG;;;;;CAKxB,CAAC;AAEF,MAAM,sBAAsB,GAAG;IAC7B,SAAS,EAAE,mLAAmL;IAC9L,aAAa,EAAE,WAAW;CAC3B,CAAC;AAEF,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,gBAAgB;IAC7B,sBAAsB,EAAE,sBAAsB;CAC/C,CAAC"}
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
const TOOL_DESCRIPTION = `
|
|
2
|
-
|
|
2
|
+
【CORE PURPOSE】Dedicated to querying detailed information about individual Web TUILiveKit components, providing comprehensive descriptions, usage guides, and example code for components within the Web TUILiveKit ecosystem.
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
1. Scenario Support: Specifically designed for building Web live streaming
|
|
6
|
-
2. Component Details:
|
|
4
|
+
【FUNCTIONAL SCOPE】:
|
|
5
|
+
1. Scenario Support: Specifically designed for building Web live streaming applications.
|
|
6
|
+
2. Component List Details:
|
|
7
|
+
- Live Video Component (LiveView)
|
|
8
|
+
- Audience List Component (LiveAudienceList)
|
|
9
|
+
- Barrage/Chat Component (Barrage)
|
|
10
|
+
- Co-Guest Management Panel Component (CoGuestPanel)
|
|
11
|
+
- Media Resource Configuration Panel Component (LiveScenePanel)
|
|
12
|
+
- Video Source Editing Panel Component (StreamMixer)
|
|
7
13
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
[SUPPORTED FRAMEWORKS]: Currently only supports the Vue framework.
|
|
14
|
+
【KEYWORDS】:'vue live components', 'co-guest management','LiveKit', 'TUILiveKit', 'component details', 'Vue', 'live video', 'barrage component'.
|
|
11
15
|
|
|
16
|
+
【SUPPORTED FRAMEWORK】:Currently supports only the Vue framework.
|
|
12
17
|
`;
|
|
13
18
|
const PARAMETER_DESCRIPTIONS = {
|
|
14
|
-
framework: 'The framework type supported
|
|
19
|
+
framework: 'The framework type supported by the Web Live UIKit component details query. Currently, only Vue is supported.',
|
|
15
20
|
componentName: 'The specific name of the Web Live UIKit component, e.g., live-view (Live Video Component).'
|
|
16
21
|
};
|
|
17
22
|
export const GET_WEB_LIVE_UIKIT_COMPONENT_DETAIL_DEFINITION = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get_web_live_uikit_component_detail_def.js","sourceRoot":"","sources":["../../../src/tools/definitions/get_web_live_uikit_component_detail_def.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAG
|
|
1
|
+
{"version":3,"file":"get_web_live_uikit_component_detail_def.js","sourceRoot":"","sources":["../../../src/tools/definitions/get_web_live_uikit_component_detail_def.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;CAgBxB,CAAC;AAEF,MAAM,sBAAsB,GAAG;IAC7B,SAAS,EAAE,+GAA+G;IAC1H,aAAa,EAAE,4FAA4F;CAC5G,CAAC;AAEF,MAAM,CAAC,MAAM,8CAA8C,GAAG;IAC5D,IAAI,EAAE,qCAAqC;IAC3C,WAAW,EAAE,gBAAgB;IAC7B,sBAAsB,EAAE,sBAAsB;CAC/C,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const TOOL_DESCRIPTION = `
|
|
2
|
+
【CORE PURPOSE】:
|
|
3
|
+
Acting as a professional Web Live UIKit Integration Assistant, this tool is dedicated to providing Agents with workflow action commands and real-time aggregated, up-to-date documentation content to guide the LLM in implementing complex live streaming features.
|
|
4
|
+
|
|
5
|
+
【KEYWORDS】:'liveKit', 'TUILiveKit', 'live UIKit', 'live list', 'host streaming', 'live streaming', 'audience viewing', 'desktop PC', 'mobile H5'.
|
|
6
|
+
|
|
7
|
+
【ACTION COMMANDS AND WORKFLOW GUIDANCE】:
|
|
8
|
+
When processing user requests, the Agent should utilize the 'llm_code_generation_instructions_md' field returned by this tool. This field includes:
|
|
9
|
+
1. Core workflow instructions (from integration.md).
|
|
10
|
+
2. The latest, real-time official documentation content corresponding to the user's required features (Goals).
|
|
11
|
+
|
|
12
|
+
The LLM MUST prioritize and exclusively use the real-time documentation content returned by this tool for code generation, avoiding self-access to external URLs.
|
|
13
|
+
|
|
14
|
+
1. Implement Live List Page: Guides the LLM to use the 'liveList' integration documentation for implementation.
|
|
15
|
+
2. Implement Live Viewing Page: Guides the LLM to use the 'livePlayer' integration documentation for implementation.
|
|
16
|
+
3. Implement Live Hosting Page: Guides the LLM to use the 'livePusher' integration to implement hosting configuration and streaming.
|
|
17
|
+
4. Implement Live Co-Guesting: Guides the LLM to use the 'CoGuestPanel' component, in conjunction with 'livePusher' and 'livePlayer', for co-guesting logic integration.
|
|
18
|
+
|
|
19
|
+
【FUNCTIONAL SCOPE】:
|
|
20
|
+
Specifically designed for building Web live streaming applications.
|
|
21
|
+
|
|
22
|
+
【SUPPORTED FRAMEWORK】:Currently supports only the Vue framework.
|
|
23
|
+
`;
|
|
24
|
+
const PARAMETER_DESCRIPTIONS = {
|
|
25
|
+
goals: `A list of features requested by the user for implementation, e.g., ['liveList', 'livePlayer-desk', 'livePlayer-h5']. The tool will concurrently fetch the corresponding exclusive documentation content based on this list.`
|
|
26
|
+
};
|
|
27
|
+
export const GET_WEB_LIVE_UIKIT_INTEGRATION_DEFINITION = {
|
|
28
|
+
name: 'get_web_live_uikit_integration',
|
|
29
|
+
description: TOOL_DESCRIPTION,
|
|
30
|
+
parameter_descriptions: PARAMETER_DESCRIPTIONS,
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=get_web_live_uikit_integration_def.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get_web_live_uikit_integration_def.js","sourceRoot":"","sources":["../../../src/tools/definitions/get_web_live_uikit_integration_def.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;CAsBxB,CAAC;AAEF,MAAM,sBAAsB,GAAG;IAC7B,KAAK,EAAE,6NAA6N;CACrO,CAAC;AAEF,MAAM,CAAC,MAAM,yCAAyC,GAAG;IACvD,IAAI,EAAE,gCAAgC;IACtC,WAAW,EAAE,gBAAgB;IAC7B,sBAAsB,EAAE,sBAAsB;CAC/C,CAAC"}
|
package/tools/index.js
CHANGED
|
@@ -22,10 +22,13 @@ import { registryGetRTCEngineWebSDKIntegrationTool } from './rtcengine/get-rtcen
|
|
|
22
22
|
import { registryGetTRTCWebSDKIntegrationTool } from './rtcengine/get-trtc-web-sdk-integration.js';
|
|
23
23
|
import { registryGetWebAPITool } from './rtcengine/get-trtc-web-sdk-api.js';
|
|
24
24
|
// live
|
|
25
|
+
import { registryGetWebLiveIntegrationTool } from './live/get-web-live-uikit-integration.js';
|
|
25
26
|
import { registryGetWebLiveComponentDetailTool } from './live/get-web-live-component-detail.js';
|
|
26
27
|
import { registerGetWebLiveStateDetailTool } from './live/get-web-live-state-detail.js';
|
|
27
28
|
// room
|
|
28
29
|
import { registryGetWebRoomStateDetailTool } from './room/get-web-room-state-detail.js';
|
|
30
|
+
// native live
|
|
31
|
+
import { registryGetTRTCNativeAPITool } from './trtc/get-trtc-native-api.js';
|
|
29
32
|
function registryTools(mcpServer) {
|
|
30
33
|
// common
|
|
31
34
|
registryPresentFrameworkChoiceTool(mcpServer);
|
|
@@ -51,10 +54,15 @@ function registryTools(mcpServer) {
|
|
|
51
54
|
registryGetTRTCWebSDKIntegrationTool(mcpServer);
|
|
52
55
|
registryGetWebAPITool(mcpServer);
|
|
53
56
|
// live
|
|
57
|
+
registryGetWebLiveIntegrationTool(mcpServer);
|
|
54
58
|
registryGetWebLiveComponentDetailTool(mcpServer);
|
|
55
59
|
registerGetWebLiveStateDetailTool(mcpServer);
|
|
56
60
|
// room
|
|
57
61
|
registryGetWebRoomStateDetailTool(mcpServer);
|
|
62
|
+
// native live
|
|
63
|
+
// registryGetNativeLiveAPITool(mcpServer);
|
|
64
|
+
// trtc
|
|
65
|
+
registryGetTRTCNativeAPITool(mcpServer);
|
|
58
66
|
}
|
|
59
67
|
export { registryTools, };
|
|
60
68
|
//# sourceMappingURL=index.js.map
|
package/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AACA,SAAS;AACT,OAAO,EAAE,kCAAkC,EAAE,MAAM,sCAAsC,CAAC;AAC1F,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO;AACP,OAAO,EAAE,iCAAiC,EAAE,MAAM,oCAAoC,CAAC;AACvF,OAAO,EAAE,uCAAuC,EAAE,MAAM,2CAA2C,CAAC;AACpG,OAAO,EAAE,qCAAqC,EAAE,MAAM,yCAAyC,CAAC;AAChG,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAC/E,sFAAsF;AACtF,OAAO,EAAE,oCAAoC,EAAE,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C;IAC7C,cAAc;IACd,2CAA2C;IAC3C,OAAO;IACP,4BAA4B,CAAC,SAAS,CAAC,CAAC;AAC1C,CAAC;AAED,OAAO,EACL,aAAa,GACd,CAAA"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { GET_WEB_LIVE_UIKIT_INTEGRATION_DEFINITION } from '../definitions/get_web_live_uikit_integration_def.js';
|
|
3
|
+
import { getDocContent } from '../../utils/get-doc-content.js';
|
|
4
|
+
import { generateStructuredResult } from '../../utils/generate-structured-result.js';
|
|
5
|
+
import { reportCLSClient } from '../../utils/report-cls-client.js';
|
|
6
|
+
// tools 返回结果说明
|
|
7
|
+
// content: 为了让框架兼容满足其对文本输出的格式要求。
|
|
8
|
+
// result: !!必需。LLM 依赖这个结构化 JSON 来执行复杂的推理和代码生成,它是机器可读的指令。
|
|
9
|
+
const PATH_MAP = {
|
|
10
|
+
'liveList': ['livekit', 'vue', 'live-list-integration.md'],
|
|
11
|
+
'livePlayer-desk': ['livekit', 'vue', 'live-player-desk-integration.md'],
|
|
12
|
+
'livePlayer-h5': ['livekit', 'vue', 'live-player-h5-integration.md'],
|
|
13
|
+
'livePusher': ['livekit', 'vue', 'live-pusher-integration.md'],
|
|
14
|
+
'CoGuestPanel': ['livekit', 'vue', 'components', 'co-guest-panel.md']
|
|
15
|
+
};
|
|
16
|
+
async function getResultText(params) {
|
|
17
|
+
const { goals = [] } = params;
|
|
18
|
+
reportCLSClient({
|
|
19
|
+
method: 'get_web_live_uikit_integration',
|
|
20
|
+
info: goals.join(','),
|
|
21
|
+
framework: 'vue'
|
|
22
|
+
});
|
|
23
|
+
// 获取工作流指令
|
|
24
|
+
const baseInstructions = getDocContent(['livekit', 'vue', 'workflow.md']);
|
|
25
|
+
// 批量读取目标文档并生成结构化结果
|
|
26
|
+
const result = await generateStructuredResult({
|
|
27
|
+
baseInstructions,
|
|
28
|
+
goals,
|
|
29
|
+
pathMap: PATH_MAP,
|
|
30
|
+
frameWork: 'vue',
|
|
31
|
+
});
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
const registryGetWebLiveIntegrationTool = (mcpServer) => {
|
|
35
|
+
const { name, description, parameter_descriptions } = GET_WEB_LIVE_UIKIT_INTEGRATION_DEFINITION;
|
|
36
|
+
mcpServer.tool(name, description, {
|
|
37
|
+
goals: z.array(z.enum(['liveList', 'livePlayer-desk', 'livePlayer-h5', 'livePusher', 'CoGuestPanel'])).describe(parameter_descriptions.goals)
|
|
38
|
+
}, async (params) => {
|
|
39
|
+
const result = await getResultText(params);
|
|
40
|
+
return {
|
|
41
|
+
content: [
|
|
42
|
+
{
|
|
43
|
+
type: 'text',
|
|
44
|
+
text: result.llm_code_generation_instructions_md,
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
result: result,
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
export { registryGetWebLiveIntegrationTool };
|
|
52
|
+
//# sourceMappingURL=get-web-live-uikit-integration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-web-live-uikit-integration.js","sourceRoot":"","sources":["../../../src/tools/live/get-web-live-uikit-integration.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,yCAAyC,EAAE,MAAM,sDAAsD,CAAC;AACjH,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,eAAe;AACf,iCAAiC;AACjC,yDAAyD;AAEzD,MAAM,QAAQ,GAA6B;IACzC,UAAU,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,0BAA0B,CAAC;IAC1D,iBAAiB,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,iCAAiC,CAAC;IACxE,eAAe,E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;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,MAAM,CAAC,mCAAmC;iBACjD;aACF;YACD,MAAM,EAAE,MAAM;SACf,CAAA;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,OAAO,EAAE,iCAAiC,EAAE,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { GET_NATIVE_LIVE_API_DEFINITION } from '../definitions/get_native_live_api_def.js';
|
|
3
|
+
import { getDocContent } from '../../utils/get-doc-content.js';
|
|
4
|
+
import { reportCLSClient } from '../../utils/report-cls-client.js';
|
|
5
|
+
import { handleFramework } from '../../utils/handle-framework.js';
|
|
6
|
+
import { handleStateName } from '../../utils/handle-state-name.js';
|
|
7
|
+
function getResultText(params) {
|
|
8
|
+
const { framework, componentName = '' } = params;
|
|
9
|
+
reportCLSClient({
|
|
10
|
+
method: 'get_native_live_api',
|
|
11
|
+
info: componentName,
|
|
12
|
+
framework: framework,
|
|
13
|
+
});
|
|
14
|
+
return getDocContent(['native_live', `${handleFramework(framework)}`, 'states', `${handleStateName(componentName)}.md`]);
|
|
15
|
+
}
|
|
16
|
+
const registryGetNativeLiveAPITool = (mcpServer) => {
|
|
17
|
+
const { name, description, parameter_descriptions } = GET_NATIVE_LIVE_API_DEFINITION;
|
|
18
|
+
mcpServer.tool(name, description, {
|
|
19
|
+
framework: z.enum(['flutter', 'android', 'ios', 'c++']).describe(parameter_descriptions.framework),
|
|
20
|
+
componentName: z.string().describe(parameter_descriptions.componentName),
|
|
21
|
+
}, (params) => ({
|
|
22
|
+
content: [
|
|
23
|
+
{
|
|
24
|
+
type: 'text',
|
|
25
|
+
text: getResultText(params),
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}));
|
|
29
|
+
};
|
|
30
|
+
export { registryGetNativeLiveAPITool };
|
|
31
|
+
//# sourceMappingURL=get-native-live-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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AAC;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,4BAA4B,EAAE,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { GET_TRTC_NATIVE_API_DEFINITION } from '../definitions/get_trtc_native_api_def.js';
|
|
3
|
+
import { getDocContent } from '../../utils/get-doc-content.js';
|
|
4
|
+
import { reportCLSClient } from '../../utils/report-cls-client.js';
|
|
5
|
+
import { handleFramework } from '../../utils/handle-framework.js';
|
|
6
|
+
import { handleStateName } from '../../utils/handle-state-name.js';
|
|
7
|
+
function getResultText(params) {
|
|
8
|
+
const { framework, componentName = '' } = params;
|
|
9
|
+
reportCLSClient({
|
|
10
|
+
method: 'get_trtc_native_api',
|
|
11
|
+
info: componentName,
|
|
12
|
+
framework: framework,
|
|
13
|
+
});
|
|
14
|
+
return getDocContent(['trtc', `${handleFramework(framework)}`, 'states', `${handleStateName(componentName)}.md`]);
|
|
15
|
+
}
|
|
16
|
+
const registryGetTRTCNativeAPITool = (mcpServer) => {
|
|
17
|
+
const { name, description, parameter_descriptions } = GET_TRTC_NATIVE_API_DEFINITION;
|
|
18
|
+
mcpServer.tool(name, description, {
|
|
19
|
+
framework: z.enum(['android', 'ios', 'C++']).describe(parameter_descriptions.framework),
|
|
20
|
+
componentName: z.string().describe(parameter_descriptions.componentName),
|
|
21
|
+
}, (params) => ({
|
|
22
|
+
content: [
|
|
23
|
+
{
|
|
24
|
+
type: 'text',
|
|
25
|
+
text: getResultText(params),
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}));
|
|
29
|
+
};
|
|
30
|
+
export { registryGetTRTCNativeAPITool };
|
|
31
|
+
//# sourceMappingURL=get-trtc-native-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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AE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC;aAC5B;SACF;KACF,CAAC,CAAC,CAAC;AACR,CAAC,CAAC;AACF,OAAO,EAAE,4BAA4B,EAAE,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { getDocContent } from "./get-doc-content.js";
|
|
2
|
+
/**
|
|
3
|
+
* @typedef {Record<string, any>} params
|
|
4
|
+
* @property {string[]} params.goals - 需要获取的功能列表
|
|
5
|
+
* @property {Record<string, string>} params.pathMap - 文档 url 映射
|
|
6
|
+
* @property {string} [params.framework] - 框架或平台,可选
|
|
7
|
+
* @property {string} [params.baseInstructions] - 基础指令说明
|
|
8
|
+
*/
|
|
9
|
+
async function generateStructuredResult(params) {
|
|
10
|
+
const { goals, pathMap, baseInstructions = '' } = params;
|
|
11
|
+
const pathsToRead = [];
|
|
12
|
+
for (const goal of goals) {
|
|
13
|
+
if (pathMap[goal]) {
|
|
14
|
+
pathsToRead.push(pathMap[goal]);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const readPromises = pathsToRead.map(path => getDocContent(path));
|
|
18
|
+
const readResults = await Promise.all(readPromises);
|
|
19
|
+
// 结果聚合,构建一个聚合的文档内容块,使用 Markdown 分隔符清晰地分隔每个文档内容,方便 LLM 解析
|
|
20
|
+
let combinedDocContent = '';
|
|
21
|
+
readResults.forEach((result) => {
|
|
22
|
+
combinedDocContent += `\n\n## 📚 Exclusive document content: ${result}\n\n---\n`;
|
|
23
|
+
});
|
|
24
|
+
const finalContent = baseInstructions + combinedDocContent;
|
|
25
|
+
return {
|
|
26
|
+
status: 'SUCCESS',
|
|
27
|
+
framework: 'Vue',
|
|
28
|
+
read_paths: pathsToRead,
|
|
29
|
+
llm_code_generation_instructions_md: finalContent,
|
|
30
|
+
note_to_llm: `Agent, I have concurrently retrieved ${pathsToRead.length} documents for you. Please generate the code based on the workflow instructions and the document content.`
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export { generateStructuredResult, };
|
|
34
|
+
//# sourceMappingURL=generate-structured-result.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-structured-result.js","sourceRoot":"","sources":["../../src/utils/generate-structured-result.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD;;;;;;GAMG;AACH,KAAK,UAAU,wBAAwB,CAAC,MAA2B;IACjE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,gBAAgB,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC;IACzD,MAAM,WAAW,GAAG,EAAE,CAAC;IACvB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YAClB,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;IACD,MAAM,YAAY,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;IAClE,MAAM,WAAW,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IACpD,yDAAyD;IACzD,IAAI,kBAAkB,GAAG,EAAE,CAAC;IAC5B,WAAW,CAAC,OAAO,CAAC,CAAC,MAAW,EAAE,EAAE;QAClC,kBAAkB,IAAI,yCAAyC,MAAM,WAAW,CAAC;IACnF,CAAC,CAAC,CAAC;IACH,MAAM,YAAY,GAAG,gBAAgB,GAAG,kBAAkB,CAAC;IAE3D,OAAO;QACL,MAAM,EAAE,SAAS;QACjB,SAAS,EAAE,KAAK;QAChB,UAAU,EAAE,WAAW;QACvB,mCAAmC,EAAE,YAAY;QACjD,WAAW,EAAE,wCAAwC,WAAW,CAAC,MAAM,2GAA2G;KACnL,CAAC;AACJ,CAAC;AAED,OAAO,EACL,wBAAwB,GACzB,CAAC"}
|
|
@@ -19,14 +19,6 @@ const COMPONENT_NAME_RULES = [
|
|
|
19
19
|
test: (name) => name.includes('live-view') || name.includes('liveview'),
|
|
20
20
|
value: 'live-view',
|
|
21
21
|
},
|
|
22
|
-
{
|
|
23
|
-
test: (name) => name.includes('live-player') || name.includes('liveplayer') || name.includes('live-watch') || name.includes('livewatch'),
|
|
24
|
-
value: 'live-player',
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
test: (name) => name.includes('live-list') || name.includes('livelist'),
|
|
28
|
-
value: 'live-list',
|
|
29
|
-
},
|
|
30
22
|
{
|
|
31
23
|
test: (name) => name.includes('live-audience-list') || name.includes('liveaudiencelist'),
|
|
32
24
|
value: 'live-audience-list',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handle-component-name.js","sourceRoot":"","sources":["../../src/utils/handle-component-name.ts"],"names":[],"mappings":"AAKA,MAAM,oBAAoB,GAAsB;IAC9C;QACE,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC;QAC1C,KAAK,EAAE,MAAM;KACd;IACD;QACE,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC;QACrF,KAAK,EAAE,mBAAmB;KAC3B;IACD;QACE,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC;QAC7E,KAAK,EAAE,cAAc;KACtB;IACD;QACE,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC;QAC/E,KAAK,EAAE,eAAe;KACvB;IACD;QACE,IAAI,EAAE,CAAC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