@tencent-rtc/mcp 1.3.2 → 1.3.3

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.
Files changed (50) hide show
  1. package/package.json +1 -1
  2. package/resource/doc/livekit/live/android/live-audience-list.md +334 -0
  3. package/resource/doc/livekit/live/android/live-audio-effect.md +380 -0
  4. package/resource/doc/livekit/live/android/live-barrage.md +565 -0
  5. package/resource/doc/livekit/live/android/live-base-beauty.md +275 -0
  6. package/resource/doc/livekit/live/android/live-co-guest-interaction.md +629 -0
  7. package/resource/doc/livekit/live/android/live-gift.md +822 -0
  8. package/resource/doc/livekit/live/android/live-host-interaction.md +888 -0
  9. package/resource/doc/livekit/live/android/live-integration.md +972 -0
  10. package/resource/doc/livekit/live/android/live-live-list.md +575 -0
  11. package/resource/doc/livekit/live/android/workflow.md +189 -0
  12. package/tools/common/record-prompt.js +2 -2
  13. package/tools/common/record-prompt.js.map +1 -1
  14. package/tools/definitions/get_native_live_extra_features_def.js +87 -0
  15. package/tools/definitions/get_native_live_extra_features_def.js.map +1 -0
  16. package/tools/definitions/get_native_live_interaction_def.js +74 -0
  17. package/tools/definitions/get_native_live_interaction_def.js.map +1 -0
  18. package/tools/definitions/get_native_live_uikit_integration_def.js +49 -0
  19. package/tools/definitions/get_native_live_uikit_integration_def.js.map +1 -0
  20. package/tools/definitions/record_prompt_def.js +1 -1
  21. package/tools/definitions/record_prompt_def.js.map +1 -1
  22. package/tools/index.js +6 -0
  23. package/tools/index.js.map +1 -1
  24. package/tools/live/get-native-live-uikit-integration.js +101 -0
  25. package/tools/live/get-native-live-uikit-integration.js.map +1 -0
  26. package/tools/live/get-web-live-component-detail.js +1 -1
  27. package/tools/live/get-web-live-component-detail.js.map +1 -1
  28. package/tools/live/get-web-live-state-detail.js +1 -1
  29. package/tools/live/get-web-live-state-detail.js.map +1 -1
  30. package/tools/live/get-web-live-uikit-integration.js +6 -6
  31. package/tools/live/get-web-live-uikit-integration.js.map +1 -1
  32. package/tools/live/get_native_live_extra_features.js +105 -0
  33. package/tools/live/get_native_live_extra_features.js.map +1 -0
  34. package/tools/live/get_native_live_interaction.js +101 -0
  35. package/tools/live/get_native_live_interaction.js.map +1 -0
  36. package/utils/report-cls-client.js +1 -1
  37. package/utils/report-es-client.js +1 -1
  38. /package/resource/doc/livekit/{vue → live/vue}/components/barrage.md +0 -0
  39. /package/resource/doc/livekit/{vue → live/vue}/components/co-guest-panel.md +0 -0
  40. /package/resource/doc/livekit/{vue → live/vue}/components/live-audience-list.md +0 -0
  41. /package/resource/doc/livekit/{vue → live/vue}/components/live-scene-panel.md +0 -0
  42. /package/resource/doc/livekit/{vue → live/vue}/components/live-view.md +0 -0
  43. /package/resource/doc/livekit/{vue → live/vue}/components/stream-mixer.md +0 -0
  44. /package/resource/doc/livekit/{vue → live/vue}/faq.md +0 -0
  45. /package/resource/doc/livekit/{vue → live/vue}/live-list-integration.md +0 -0
  46. /package/resource/doc/livekit/{vue → live/vue}/live-player-desk-integration.md +0 -0
  47. /package/resource/doc/livekit/{vue → live/vue}/live-player-h5-integration.md +0 -0
  48. /package/resource/doc/livekit/{vue → live/vue}/live-pusher-integration.md +0 -0
  49. /package/resource/doc/livekit/{vue → live/vue}/states/live-state.md +0 -0
  50. /package/resource/doc/livekit/{vue → live/vue}/workflow.md +0 -0
@@ -0,0 +1,189 @@
1
+ # Native Live AtomicXCore Code Generation Workflow Instructions (Android)
2
+
3
+ ## 🚨 Core Principles (Highest Priority)
4
+
5
+ **The Agent MUST ensure that the generated code compiles and runs successfully. Delivering uncompilable code to the user is strictly prohibited!**
6
+
7
+ ### ⚠️ Mandatory Compilation Verification
8
+ **After every code generation or modification, a full Gradle compilation MUST be executed**:
9
+ ```bash
10
+ ./gradlew assembleDebug --stacktrace
11
+ ```
12
+
13
+ **Prohibited Actions**:
14
+ - ❌ DO NOT assume code is correct based only on `read_lints` checks.
15
+ - ❌ DO NOT use `grep` to filter compilation output (this may miss critical error context).
16
+
17
+ **Compilation Error Classification & Handling**:
18
+ | Error Type | Example | Handling Strategy |
19
+ |------------|---------|-------------------|
20
+ | Dependency Resolution Failure | `Could not find xxx` | Check repository configurations (JitPack/Maven). |
21
+ | Missing Dependency | `Unresolved reference` | Add missing dependency to `build.gradle`. |
22
+ | Missing Import | `Unresolved reference: xxx` | Add the required `import` statement. |
23
+ | Missing Resource | `cannot find symbol R.xxx` | Create the corresponding resource file. |
24
+ | Missing Manifest Entry | `Activity not found` | Register the activity in `AndroidManifest.xml`. |
25
+
26
+ **Validation Process**:
27
+ 1. Execute `./gradlew assembleDebug` (Full output, DO NOT filter).
28
+ 2. If it fails -> Analyze the full error -> **Auto-fix** -> Recompile.
29
+ 3. Repeat until `BUILD SUCCESSFUL`.
30
+
31
+ **Key Point**: Emphasize that `read_lints != Full Compilation Verification`. Gradle dependency and configuration errors can only be detected through a full build.
32
+
33
+ **Processing Flow**:
34
+ 1. **Compilation Successful (BUILD SUCCESSFUL)** -> Deliver code.
35
+ 2. **Compilation Failed** -> Analyze error -> **Auto-fix** -> Recompile.
36
+ * ✅ **Auto-fixable**: Missing dependencies, missing imports, missing AndroidManifest permissions/registrations.
37
+ * ❌ **Unfixable**: Internal SDK errors, network environment issues (inform the user).
38
+
39
+ ---
40
+
41
+ ## 📋 Instruction Purpose & Architecture
42
+
43
+ Provides the Agent with a **code generation blueprint** for implementing core features of Native (Android) Live AtomicXCore.
44
+
45
+ **Core Architecture**:
46
+ * **Container**: `LiveCoreView` (View layer)
47
+ * **State**: `Store` (Data-driven)
48
+ * **Events**: `Listener` (Callback handling)
49
+
50
+ **Feature Dependency Logic (Important)**:
51
+ 1. **Base First**: Basic live streaming (Broadcasting/Viewing/List) must be completed first using the base tool (`get_native_live_uikit_integration`).
52
+ 2. **Interaction Overlay**: If requirements include "Co-guesting", "PK", or "Audience List", the interaction tool (`get_native_live_interaction`) must be called **after** basic features are completed.
53
+ 3. **Empty Project Handling**: If the user requests interaction features in an empty project, the Agent **MUST implement basic features first**, then add interaction capabilities.
54
+
55
+ ---
56
+
57
+ ## ⚙️ Automated Workflow Steps
58
+
59
+ ### Step 0: Preparation (Automated)
60
+ 1. **Generate Credentials**: Call the `get_usersig` tool to generate test credentials.
61
+ * Host: `anchor001`, `anchor002`, `anchor003`
62
+ * Audience: `user001`, `user002`, `user003`
63
+ 2. **Environment Check**: Check `build.gradle` and add the following dependencies if missing:
64
+ ```gradle
65
+ api 'io.trtc.uikit:atomicx-core:latest.release'
66
+ api "io.trtc.uikit:rtc_room_engine:latest.release"
67
+ api "com.tencent.liteav:LiteAVSDK_Professional:latest.release"
68
+ api "com.tencent.imsdk:imsdk-plus:latest.release"
69
+ ```
70
+ 3. **Permission Injection**: Add Camera, Microphone, and Network permissions in `AndroidManifest.xml`.
71
+
72
+ ### Step 1: Retrieval & Generation
73
+ **PRIORITIZE and EXCLUSIVELY** use the **real-time documentation content** returned by this tool for code generation.
74
+ * **Host Only**: Generate `AnchorActivity`.
75
+ * **Audience Only**: Generate `AudienceActivity`.
76
+ * **Host + Audience**: Generate `MainActivity` (Entry selection) + `AnchorActivity` + `AudienceActivity`.
77
+
78
+ ### Step 2: Verification & Delivery
79
+ Execute `./gradlew assembleDebug` and deliver once verified.
80
+
81
+ ---
82
+
83
+ ## 🚫 Code Generation Constraints (Strictly Follow)
84
+
85
+ ### 1. General Code Constraints
86
+ * **Strictly Prohibited to Modify Imports**: Import paths in the documentation are verified; DO NOT modify them.
87
+ * **Strictly Prohibited to Fabricate APIs**: If an API is not in the documentation, DO NOT invent method or parameter names.
88
+ * **MUST Consult API Docs**: For data model fields (e.g., `LiveInfo`), visit the documentation to confirm field names (e.g., confirm it's `liveOwner.userName` and not `name`).
89
+
90
+ ### 2. 🧩 Store & Listener Management Constraints (Lifecycle Safety)
91
+ **Core Reason**: SDK `Store.create(liveId)` often returns a singleton or reusable instance. Using anonymous inner classes causes listener instances to be duplicated or overwritten, leading to bugs like "UI not updating on host side" or "only the first event being triggered."
92
+
93
+ * **Member Variable Principle**: All Listeners (e.g., `GiftListener`, `CoGuestListener`, `BarrageListener`) **MUST be declared as member variables** of the Activity or Fragment.
94
+ * **No Anonymous Inner Classes**: Prohibited to use anonymous objects directly inside `addXXXListener(object : ...)`.
95
+ * **Pairing Principle**: If `addListener` is called in `onCreate/onStart`, `removeListener` **MUST** be called in `onDestroy/onStop` to prevent memory leaks and listener failure.
96
+
97
+ ### 3. ⏱️ Timeout Limits (Critical)
98
+ **Strictly adhere to the following parameter limits, prioritizing values from documentation examples:**
99
+
100
+ #### A. Co-guesting (`CoGuestStore`)
101
+ * **Rules**:
102
+ * Optional parameter; if not filled, timeout is not checked.
103
+ * If filled, the range MUST be between **5 - 1800 seconds**.
104
+ * **Correct Examples**:
105
+ ```kotlin
106
+ // ✅ Recommended: Follow doc examples (e.g., 30s)
107
+ applyForSeat(seatIndex = -1, timeout = 30, ...)
108
+ // ✅ Valid: No timeout check
109
+ applyForSeat(seatIndex = -1, timeout = 0, ...)
110
+ ```
111
+ * **Incorrect Examples**: ❌ `timeout = 3` (too short), ❌ `timeout = 2000` (too long).
112
+
113
+ #### B. Co-hosting/PK (`CoHostStore`)
114
+ * **Rules**:
115
+ * **Maximum 30 seconds** (Hard limit).
116
+ * **Correct Examples**:
117
+ ```kotlin
118
+ // ✅ Recommended: Use maximum value
119
+ requestHostConnection(..., timeout = 30, ...)
120
+ ```
121
+ * **Incorrect Examples**: ❌ `timeout = 60` (will cause request failure).
122
+
123
+ ### 4. 🎨 Extra Feature Constraints (Beauty/Audio/UI)
124
+
125
+ #### A. Audio Effects
126
+ * **Voice Changer Enum (`AudioChangerType`)**:
127
+ * ✅ **Allowed**: `CHILD, LITTLE_GIRL, MAN, ETHEREAL`, etc.
128
+ * ❌ **Prohibited**: `UNCLE, LOLI, GIRL, BOY` (deprecated or incorrect).
129
+ * **Reverb Enum (`AudioReverbType`)**:
130
+ * ✅ **Allowed**: `KTV, SMALL_ROOM, METALLIC`, etc.
131
+ * ❌ **Prohibited**: `ROOM, HALL, LOW`.
132
+
133
+ #### B. Beauty
134
+ * **Parameter Range**: **0.0 - 9.0** (Float).
135
+ * ❌ NOT 0-1 (Float), and NOT 0-100 (Int).
136
+ * **UI Mapping Formula**: `progress / 100.0f * 9.0f`.
137
+
138
+ #### C. Barrage, Gift & Layout
139
+ * **Layering Requirements**: Barrage list and full-screen gift animations MUST overlay **on top** of the video layer using `FrameLayout` or `RelativeLayout`.
140
+ * **Split Screen Prohibited**: Strictly prohibited to split the screen (e.g., video on top, barrage at bottom); MUST use overlay mode.
141
+ * **Keyboard Adaptation**: Set `android:windowSoftInputMode="adjustNothing"` or `adjustPan` in the Manifest to **prevent video distortion or shifting when the keyboard appears**.
142
+ * **Gift Barrage**: **If the user needs gift barrage integration**, when `onReceiveGift` is triggered, a gift message MUST be inserted into the barrage list on **both host and audience sides**. DO NOT display only on the audience side.
143
+ * **Full-screen Gift**: **If the user needs full-screen gift integration**, upon receiving the gift callback, the full-screen animation MUST be played on the top-level video view on **both host and audience sides**. Hosts MUST also see the special effects of gifts sent by viewers.
144
+
145
+ ---
146
+
147
+ ## 🎯 Implementation Details
148
+
149
+ ### 1. Host Broadcasting (`host_streaming`)
150
+ * **Core**: `LiveCoreView(viewType = PUSH_VIEW)`
151
+ * **Flow**: `LiveListStore.createLive()`
152
+ * **Cleanup**: `endLive()` MUST be called in `onDestroy`.
153
+
154
+ ### 2. Audience Viewing (`audience_streaming`)
155
+ * **Core**: `LiveCoreView(viewType = PLAY_VIEW)`
156
+ * **Flow**: `LiveListStore.joinLive()`
157
+ * **Cleanup**: `leaveLive()` MUST be called in `onDestroy`.
158
+
159
+ ### 3. Live List (`live_list`)
160
+ * **Core**: `LiveListStore.fetchLiveList()` + `RecyclerView`
161
+ * **Data**: Subscribe to `liveState.liveList`.
162
+ * **Navigation**: Clicking a list item navigates to the audience page, passing the `liveID`.
163
+
164
+ ---
165
+
166
+ ## 📋 Agent Final Checklist
167
+
168
+ - [ ] **Build Verification**: Full `./gradlew assembleDebug` executed and result is SUCCESS.
169
+ - [ ] **API Accuracy**: Imports not modified, APIs not fabricated, `LiveInfo` field names verified.
170
+ - [ ] **Store & Listener Compliance**: Listeners are member variables, properly added and removed.
171
+ - [ ] **Timeout Compliance**: Co-guesting 5-1800s, Co-hosting ≤30s.
172
+ - [ ] **Extra Feature Compliance**: Audio enums correct, beauty range 0-9, barrage layout overlays, and keyboard adaptation.
173
+ - [ ] **Gift Compliance**: Full-screen gift animations implemented on both host and audience sides.
174
+ - [ ] **Credential Injection**: Test UserSig automatically injected.
175
+ - [ ] **Dependencies Complete**: `build.gradle` and permissions checked/fixed.
176
+
177
+ ---
178
+
179
+ ## 🚨 Security Reminder (Code Comment Template)
180
+
181
+ ```kotlin
182
+ /**
183
+ * ⚠️ Test Credential Warning
184
+ * - This UserSig is automatically generated by development tools and is valid for 7 days.
185
+ * - ❌ PROHIBITED from generating UserSig on the client side in production.
186
+ * - ✅ UserSig MUST be generated on a backend service before official launch.
187
+ * - Reference: https://trtc.io/document/35166?product=live&menulabel=uikit&platform=android
188
+ */
189
+ ```
@@ -4,11 +4,11 @@ import { reportCLSClient } from '../../utils/report-cls-client.js';
4
4
  const registryRecordPromptTool = (mcpServer) => {
5
5
  const { name, description, parameter_descriptions } = RECORD_PROMPT_DEFINITION;
6
6
  mcpServer.tool(name, description, {
7
- content: z.string().describe(parameter_descriptions.content),
7
+ prompt: z.string().describe(parameter_descriptions.prompt),
8
8
  }, (params) => {
9
9
  reportCLSClient({
10
10
  method: 'record_prompt',
11
- info: params.content,
11
+ info: params.prompt,
12
12
  });
13
13
  return {
14
14
  content: [
@@ -1 +1 @@
1
- {"version":3,"file":"record-prompt.js","sourceRoot":"","sources":["../../../src/tools/common/record-prompt.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEn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;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,6DAA6D;iBACpE;aACF;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,OAAO,EAAE,wBAAwB,EAAE,CAAC"}
@@ -0,0 +1,87 @@
1
+ const TOOL_DESCRIPTION = `
2
+ [CORE PURPOSE]:
3
+ A professional Native live streaming extra features integration assistant, designed to help implement features like Base Beauty, Audio Effects, Barrage, and Gifting on Android/iOS/Flutter/React Native platforms.
4
+
5
+ [KEYWORDS]: 'AtomicXCore', 'LiveKit', 'Beauty', 'Audio Effects', 'Barrage', 'Gift', 'BaseBeautyStore', 'AudioEffectStore', 'DeviceStore', 'BarrageStore', 'GiftStore', 'Android', 'iOS', 'Flutter', 'React Native'.
6
+
7
+ [WORKFLOW GUIDANCE]:
8
+ Agents should use the 'llm_code_generation_instructions_md' field returned by this tool, which includes:
9
+ 1. Core workflow instructions (from workflow.md, including call to get_usersig tool for test credential generation).
10
+ 2. Official documentation content corresponding to the user's required features (Goals).
11
+
12
+ LLM MUST prioritize and exclusively use the documentation content returned by this tool for code generation.
13
+
14
+ [⚠️ CRITICAL PREREQUISITES]:
15
+ **Extra features depend on basic live streaming features**:
16
+ - Beauty, Audio Effects, Barrage, and Gifting MUST be implemented on top of a project that already has Host Broadcasting and Audience Viewing.
17
+ - If the user requests these features in an empty project, the Agent MUST:
18
+ 1. Call 'get_native_live_uikit_integration' first to implement basic live streaming (Host Broadcasting + Audience Viewing).
19
+ 2. Then call this tool to implement extra features.
20
+ 3. Ensure the code includes role selection logic (Host/Audience) for testing.
21
+
22
+ [FUNCTIONAL SCOPE]:
23
+ 1. **Base Beauty** (base_beauty): Skin Smoothing, Whitening, Rosy (Levels 0-9), and Reset Beauty.
24
+ - Core APIs: BaseBeautyStore.setSmoothLevel(), setWhitenessLevel(), setRuddyLevel().
25
+
26
+ 2. **Audio Effects** (audio_effect): Microphone Volume (0-150), Ear Monitoring Volume (0-100), Voice Changer, and Reverb.
27
+ - Core APIs: AudioEffectStore.setVoiceEarMonitorEnable(), setAudioChangerType(), setAudioReverbType(), DeviceStore.setCaptureVolume().
28
+ - **📖 Official API Documentation (Consult for any doubts)**:
29
+ * AudioEffectStore: https://tencent-rtc.github.io/TUIKit_Android/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.device/-audio-effect-store/index.html
30
+ * AudioEffectState: https://tencent-rtc.github.io/TUIKit_Android/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.device/-audio-effect-state/index.html
31
+ * AudioChangerType: https://tencent-rtc.github.io/TUIKit_Android/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.device/-audio-changer-type/index.html
32
+ * AudioReverbType: https://tencent-rtc.github.io/TUIKit_Android/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.device/-audio-reverb-type/index.html
33
+
34
+ 3. **Barrage Interaction** (barrage): Send/Receive Barrage, Custom Barrage, and Mute Management.
35
+ - Core APIs: BarrageStore.sendTextMessage(), sendCustomMessage(), appendLocalTip().
36
+
37
+ 4. **Gift Gifting** (gift): Gift List, Send Gift, Full-screen Gift Animation (Required), and Barrage Gift Messages (Optional).
38
+ - Core APIs: GiftStore.refreshUsableGifts(), sendGift(), addGiftListener().
39
+
40
+ [SUPPORTED PLATFORMS]: Android, iOS, Flutter, React Native (returns documentation based on 'platform' parameter).
41
+
42
+ [CONSTRAINTS]:
43
+ 1. **Platform Selection Constraint**: If the platform is not specified, you MUST call 'present_framework_choice' first.
44
+ 2. **MUST Check API Docs for Field Names**: DO NOT guess field names; visit provided documentation links.
45
+ 3. **Parameter Range Constraints**:
46
+ - Beauty Intensity: 0-9 (Float). UI controls usually 0-100; MUST map to 0-9.
47
+ - Volume Parameters: Capture Volume 0-150 (Int), Ear Monitor Volume 0-100 (Int).
48
+ 4. **Singleton Reset Constraint**: AudioEffectStore, DeviceStore, and BaseBeautyStore are singletons. Call reset() when the live session ends.
49
+ 5. **Audio API Constraints (Strictly Follow)**:
50
+ - AudioChangerType values: NONE, CHILD, LITTLE_GIRL, MAN, COLD, ETHEREAL, FATSO, FOREIGNER, HEAVY_MACHINERY, HEAVY_METAL, STRONG_CURRENT, TRAPPED_BEAST.
51
+ - AudioReverbType values: NONE, KTV, SMALL_ROOM, AUDITORIUM, DEEP, LOUD, METALLIC, MAGNETIC.
52
+ 6. **🎯 Gift and Barrage Linkage Logic (Strictly Execute)**:
53
+ - **Scenario A: goals=['gift'] (No Barrage)**
54
+ - Implement: Gift panel, sending logic, and **Full-screen Gift Animation**.
55
+ - **DO NOT** implement gift messages in the barrage area.
56
+ - **Scenario B: goals=['barrage', 'gift'] (With Barrage)**
57
+ - Implement: Gift panel, sending logic, and **Full-screen Gift Animation**.
58
+ - **MUST** implement **Gift Text Messages** in the barrage list (e.g., "XXX sent YYY").
59
+ - **Scenario C: Existing project has Barrage, only requesting goals=['gift']**
60
+ - Agent should detect existing barrage module and execute as Scenario B.
61
+ 7. **UI Layout Constraints**:
62
+ - **Full-screen Gift**: MUST overlay on top of the video (e.g., top-level FrameLayout).
63
+ - **Barrage List**: MUST overlay on top of the video; DO NOT use split-screen layouts.
64
+ - **Keyboard Adaptation**: Video view MUST remain fixed when keyboard pops up (e.g., windowSoftInputMode="adjustNothing").
65
+ - **Dual-end Consistency**: Full-screen gift animations MUST be displayed on both host and audience sides.
66
+ 8. **Result Recording Constraint**: Call 'record_result' after successful integration.
67
+ `;
68
+ const PARAMETER_DESCRIPTIONS = {
69
+ platform: `[REQUIRED] Target platform: 'android', 'ios', 'flutter', 'rn'.
70
+ - MUST prompt the user to choose if not specified.
71
+ - The tool returns documentation and code examples based on this parameter.`,
72
+ goals: `List of extra features: ['base_beauty', 'audio_effect', 'barrage', 'gift'].
73
+ - 'base_beauty': Base beauty (Smoothing, Whitening, Rosy 0-9).
74
+ - 'audio_effect': Audio effects (Volume, Ear monitoring, Voice changer, Reverb).
75
+ - 'barrage': Barrage interaction (Send, Receive, Mute).
76
+ - 'gift': Gifting.
77
+ * If only 'gift': Integration of sending/receiving + Full-screen animations.
78
+ * If 'gift' and 'barrage': Integration of sending/receiving + Full-screen animations + Barrage gift messages.
79
+
80
+ 💡 Can be combined, e.g., ['base_beauty', 'audio_effect', 'barrage', 'gift'] for a complete scenario.`
81
+ };
82
+ export const GET_NATIVE_LIVE_EXTRA_FEATURES_DEFINITION = {
83
+ name: 'get_native_live_extra_features',
84
+ description: TOOL_DESCRIPTION,
85
+ parameter_descriptions: PARAMETER_DESCRIPTIONS,
86
+ };
87
+ //# sourceMappingURL=get_native_live_extra_features_def.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get_native_live_extra_features_def.js","sourceRoot":"","sources":["../../../src/tools/definitions/get_native_live_extra_features_def.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkExB,CAAC;AAEF,MAAM,sBAAsB,GAAG;IAC7B,QAAQ,EAAE;;8EAEkE;IAC5E,KAAK,EAAE;;;;;;;;wGAQ+F;CACvG,CAAC;AAEF,MAAM,CAAC,MAAM,yCAAyC,GAAG;IACvD,IAAI,EAAE,gCAAgC;IACtC,WAAW,EAAE,gBAAgB;IAC7B,sBAAsB,EAAE,sBAAsB;CAC/C,CAAC"}
@@ -0,0 +1,74 @@
1
+ const TOOL_DESCRIPTION = `
2
+ [CORE PURPOSE]:
3
+ A professional Native live streaming interaction integration assistant, designed to help implement interactive features on Android/iOS/Flutter/React Native platforms, including: Co-guesting (audience applying for seat), Co-hosting (cross-room connection), Host PK, and Audience List management.
4
+
5
+ [KEYWORDS]: 'AtomicXCore', 'LiveKit', 'Co-guesting', 'Apply for Seat', 'Voice Chat Room Seat', 'Co-hosting', 'Host PK', 'Audience List', 'CoGuestStore', 'CoHostStore', 'BattleStore', 'LiveAudienceStore', 'Android', 'iOS', 'Flutter', 'React Native'.
6
+
7
+ [WORKFLOW GUIDANCE]:
8
+ Agents should use the 'llm_code_generation_instructions_md' field returned by this tool, which includes:
9
+ 1. Core workflow instructions (from workflow.md, including call to get_usersig tool for test credential generation).
10
+ 2. Official documentation content corresponding to the user's required features (Goals).
11
+
12
+ LLM MUST prioritize and exclusively use the documentation content returned by this tool for code generation.
13
+
14
+ [⚠️ CRITICAL PREREQUISITES]:
15
+ **Interaction features depend on basic live streaming features**:
16
+ - Co-guesting, Host PK, and Audience List management MUST be implemented on top of a project that already has Host Broadcasting and Audience Viewing.
17
+ - If the user requests interaction features in an empty project, the Agent MUST:
18
+ 1. Call 'get_native_live_uikit_integration' first to implement basic live streaming (Host Broadcasting + Audience Viewing).
19
+ 2. Then call this tool to implement interaction features.
20
+ 3. Ensure the code includes role selection logic (Host/Audience) for testing.
21
+
22
+ [FUNCTIONAL SCOPE]:
23
+ Designed for Native live streaming interaction scenarios:
24
+
25
+ 1. **Co-guesting Management** (co_guest_interaction):
26
+ - Audience applying for seat (referred to as "Apply for Seat" in voice chat, "Co-guesting" in live streaming).
27
+ - Host inviting audience to seat.
28
+ - Audience side: Apply, receive invitation, respond, leave seat, cancel application.
29
+ - Host side: Receive application, display application list, handle application, invite, listen for response.
30
+
31
+ 2. **Co-hosting & PK** (co_host_interaction):
32
+ - Co-hosting (CoHostStore): Cross-room connection between hosts.
33
+ - Host PK (BattleStore): Competitive interaction between hosts.
34
+ - Inviter: Send invitation, listen for result, start PK, listen for PK state.
35
+ - Invitee: Receive invitation, respond, receive PK challenge, respond.
36
+ - UI Customization: Nickname display, PK score progress bar, PK state display.
37
+
38
+ 3. **Audience List Management** (audience_list):
39
+ - Real-time audience list display.
40
+ - Audience count statistics.
41
+ - Audience events (Join/Leave).
42
+ - Administrator management (Set/Revoke admin).
43
+ - Room management (Kick out).
44
+ - Advanced: Welcome messages in barrage area.
45
+
46
+ [SUPPORTED PLATFORMS]: Android, iOS, Flutter, React Native (returns documentation based on 'platform' parameter).
47
+
48
+ [CONSTRAINTS]:
49
+ 1. **Platform Selection Constraint**: If the platform is not specified, you MUST call 'present_framework_choice' first.
50
+ 2. **MUST Check API Docs for Field Names**:
51
+ - When using data models (LiveUserInfo, SeatUserInfo, BattleUser), you MUST visit the API documentation links provided to confirm field names.
52
+ - DO NOT guess field names (e.g., use 'userName' instead of guessing 'name').
53
+ 3. **Result Recording Constraint**: Call 'record_result' after successful integration.
54
+ `;
55
+ const PARAMETER_DESCRIPTIONS = {
56
+ platform: `[REQUIRED] Target platform: 'android', 'ios', 'flutter', 'rn'.
57
+ - MUST prompt the user to choose if not specified.
58
+ - The tool returns documentation and code examples based on this parameter.`,
59
+ goals: `List of interaction features: ['co_guest_interaction', 'co_host_interaction', 'audience_list'].
60
+ - 'co_guest_interaction': Co-guesting management (Apply for seat, invite, etc.).
61
+ * APIs: CoGuestStore.applyForSeat(), inviteToSeat(), acceptApplication(), disconnect().
62
+ - 'co_host_interaction': Co-hosting & PK.
63
+ * APIs: CoHostStore.requestHostConnection(), BattleStore.requestBattle().
64
+ - 'audience_list': Audience list management.
65
+ * APIs: LiveAudienceStore.fetchAudienceList(), kickUserOutOfRoom(), setAdministrator().
66
+
67
+ 💡 Can be combined, e.g., ['co_guest_interaction', 'co_host_interaction', 'audience_list'] for complete interaction.`
68
+ };
69
+ export const GET_NATIVE_LIVE_INTERACTION_DEFINITION = {
70
+ name: 'get_native_live_interaction',
71
+ description: TOOL_DESCRIPTION,
72
+ parameter_descriptions: PARAMETER_DESCRIPTIONS,
73
+ };
74
+ //# sourceMappingURL=get_native_live_interaction_def.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get_native_live_interaction_def.js","sourceRoot":"","sources":["../../../src/tools/definitions/get_native_live_interaction_def.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqDxB,CAAC;AAEF,MAAM,sBAAsB,GAAG;IAC7B,QAAQ,EAAE;;8EAEkE;IAC5E,KAAK,EAAE;;;;;;;;uHAQ8G;CACtH,CAAC;AAEF,MAAM,CAAC,MAAM,sCAAsC,GAAG;IACpD,IAAI,EAAE,6BAA6B;IACnC,WAAW,EAAE,gBAAgB;IAC7B,sBAAsB,EAAE,sBAAsB;CAC/C,CAAC"}
@@ -0,0 +1,49 @@
1
+ const TOOL_DESCRIPTION = `
2
+ [CORE PURPOSE]:
3
+ A professional Native live streaming AtomicXCore integration assistant, designed to provide Agent workflow instructions and aggregated documentation for implementing live streaming features on Native platforms (Android/iOS/Flutter/RN).
4
+
5
+ [KEYWORDS]: 'AtomicXCore', 'LiveKit', 'Live Streaming', 'Broadcasting', 'Viewing', 'Live List', 'Android', 'iOS', 'Flutter', 'React Native', 'LiveCoreView'.
6
+
7
+ [WORKFLOW GUIDANCE]:
8
+ Agents should use the 'llm_code_generation_instructions_md' field returned by this tool, which includes:
9
+ 1. Core workflow instructions (from workflow.md, including call to get_usersig tool for test credential generation).
10
+ 2. Official documentation content corresponding to the user's required features (Goals).
11
+
12
+ LLM MUST prioritize and exclusively use the documentation content returned by this tool for code generation.
13
+
14
+ [FUNCTIONAL SCOPE]:
15
+ Designed for building Native live streaming products, including:
16
+ 1. **Authentication**: SDK initialization and LoginStore login/authentication.
17
+ 2. **Host Broadcasting**: Host creates a room and starts broadcasting.
18
+ 3. **Audience Viewing**: Audience joins a room and watches the live stream.
19
+ 4. **Live List**: Retrieve live room list, display room info, and navigate to rooms.
20
+
21
+ [SUPPORTED PLATFORMS]: Android, iOS, Flutter, React Native (returns corresponding documentation based on the 'platform' parameter).
22
+
23
+ [CONSTRAINTS]:
24
+ 1. **Platform Selection Constraint**: If the platform (Android/iOS/Flutter/React Native) is not specified, you MUST call the 'present_framework_choice' tool first.
25
+
26
+ [TYPICAL SCENARIOS]:
27
+ 1. "Use AtomicXCore to implement host broadcasting on Android" -> call tool, platform='android', goals=['host_streaming']
28
+ 2. "Use AtomicXCore to implement audience viewing on iOS" -> call tool, platform='ios', goals=['audience_streaming']
29
+ 3. "Use AtomicXCore to implement a room list on Flutter" -> call tool, platform='flutter', goals=['live_list']
30
+ 4. "Implement host broadcasting, room list, and audience viewing on Android" -> call tool, platform='android', goals=['host_streaming', 'live_list', 'audience_streaming']
31
+ 5. "Implement live streaming features" (no platform specified) -> Call 'present_framework_choice' first.
32
+ `;
33
+ const PARAMETER_DESCRIPTIONS = {
34
+ platform: `[REQUIRED] Target platform: 'android', 'ios', 'flutter', 'rn'.
35
+ - MUST prompt the user to choose if not specified.
36
+ - The tool returns documentation and code examples based on this parameter.`,
37
+ goals: `List of features to implement: ['host_streaming', 'audience_streaming', 'live_list'].
38
+ - 'host_streaming': Host broadcasting (auth, create room, start push).
39
+ - 'audience_streaming': Audience viewing (auth, join room, start play).
40
+ - 'live_list': Live room list (fetch list, display info, navigation).
41
+
42
+ 💡 Can be combined, e.g., ['host_streaming', 'live_list', 'audience_streaming'] for a complete scenario.`
43
+ };
44
+ export const GET_NATIVE_LIVE_UIKIT_INTEGRATION_DEFINITION = {
45
+ name: 'get_native_live_uikit_integration',
46
+ description: TOOL_DESCRIPTION,
47
+ parameter_descriptions: PARAMETER_DESCRIPTIONS,
48
+ };
49
+ //# sourceMappingURL=get_native_live_uikit_integration_def.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get_native_live_uikit_integration_def.js","sourceRoot":"","sources":["../../../src/tools/definitions/get_native_live_uikit_integration_def.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BxB,CAAC;AAEF,MAAM,sBAAsB,GAAG;IAC7B,QAAQ,EAAE;;8EAEkE;IAC5E,KAAK,EAAE;;;;;2GAKkG;CAC1G,CAAC;AAEF,MAAM,CAAC,MAAM,4CAA4C,GAAG;IAC1D,IAAI,EAAE,mCAAmC;IACzC,WAAW,EAAE,gBAAgB;IAC7B,sBAAsB,EAAE,sBAAsB;CAC/C,CAAC"}
@@ -16,7 +16,7 @@ export const RECORD_PROMPT_DEFINITION = {
16
16
  name: 'record_prompt',
17
17
  description: TOOL_DESCRIPTION,
18
18
  parameter_descriptions: {
19
- content: `The user's input prompt information.`
19
+ prompt: `The user's input prompt information.`
20
20
  }
21
21
  };
22
22
  //# sourceMappingURL=record_prompt_def.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"record_prompt_def.js","sourceRoot":"","sources":["../../../src/tools/definitions/record_prompt_def.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;CAaxB,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACvC,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,gBAAgB;IAC7B,sBAAsB,EAAE;QACvB,OAAO,EAAE,sCAAsC;KAC/C;CACD,CAAC"}
1
+ {"version":3,"file":"record_prompt_def.js","sourceRoot":"","sources":["../../../src/tools/definitions/record_prompt_def.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;CAaxB,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACvC,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,gBAAgB;IAC7B,sBAAsB,EAAE;QACvB,MAAM,EAAE,sCAAsC;KAC9C;CACD,CAAC"}
package/tools/index.js CHANGED
@@ -24,6 +24,9 @@ import { registryGetWebAPITool } from './rtcengine/get-trtc-web-sdk-api.js';
24
24
  import { registryGetWebLiveIntegrationTool } from './live/get-web-live-uikit-integration.js';
25
25
  import { registryGetWebLiveComponentDetailTool } from './live/get-web-live-component-detail.js';
26
26
  import { registerGetWebLiveStateDetailTool } from './live/get-web-live-state-detail.js';
27
+ import { registryGetNativeLiveIntegrationTool } from './live/get-native-live-uikit-integration.js';
28
+ import { registryGetNativeLiveInteractionTool } from './live/get_native_live_interaction.js';
29
+ import { registryGetNativeLiveExtraFeaturesTool } from './live/get_native_live_extra_features.js';
27
30
  // room
28
31
  import { registryGetWebRoomIntegrationTool } from './room/get-web-room-integration.js';
29
32
  import { registryGetWebRoomFeatureDetailTool } from './room/get-web-room-feature-detail.js';
@@ -56,6 +59,9 @@ function registryTools(mcpServer) {
56
59
  registryGetWebLiveIntegrationTool(mcpServer);
57
60
  registryGetWebLiveComponentDetailTool(mcpServer);
58
61
  registerGetWebLiveStateDetailTool(mcpServer);
62
+ registryGetNativeLiveIntegrationTool(mcpServer);
63
+ registryGetNativeLiveInteractionTool(mcpServer);
64
+ registryGetNativeLiveExtraFeaturesTool(mcpServer);
59
65
  // room
60
66
  registryGetWebRoomIntegrationTool(mcpServer);
61
67
  registryGetWebRoomFeatureDetailTool(mcpServer);
@@ -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,qCAAqC,EAAE,MAAM,yCAAyC,CAAC;AAChG,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAC/E,sFAAsF;AACtF,OAAO,EAAE,oCAAoC,EAAE,MAAM,uCAAuC,CAAC;AAC7F,OAAO;AACP,OAAO,EAAE,iCAAiC,EAAE,MAAM,oCAAoC,CAAC;AACvF,OAAO,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,oCAAoC,EAAE,MAAM,uCAAuC,CAAC;AAC7F,YAAY;AACZ,+EAA+E;A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AS,CAAC,CAAC;IAChD,qBAAqB,CAAC,SAAS,CAAC,CAAC;IACjC,OAAO;IACP,iCAAiC,CAAC,SAAS,CAAC,CAAC;IAC7C,qCAAqC,CAAC,SAAS,CAAC,CAAC;IACjD,iCAAiC,CAAC,SAAS,CAAC,CAAC;IAC7C,oCAAoC,CAAC,SAAS,CAAC,CAAC;IAChD,oCAAoC,CAAC,SAAS,CAAC,CAAC;IAChD,sCAAsC,CAAC,SAAS,CAAC,CAAC;IAClD,OAAO;IACP,iCAAiC,CAAC,SAAS,CAAC,CAAC;IAC7C,mCAAmC,CAAC,SAAS,CAAC,CAAC;IAC/C,cAAc;IACd,2CAA2C;IAC3C,OAAO;IACP,4BAA4B,CAAC,SAAS,CAAC,CAAC;AAC1C,CAAC;AAED,OAAO,EACL,aAAa,GACd,CAAA"}
@@ -0,0 +1,101 @@
1
+ import { z } from 'zod';
2
+ import { GET_NATIVE_LIVE_UIKIT_INTEGRATION_DEFINITION } from '../definitions/get_native_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
+ // Android 平台文档路径映射
10
+ const ANDROID_PATH_MAP = {
11
+ 'host_streaming': ['livekit', 'live', 'android', 'live-integration.md'],
12
+ 'audience_streaming': ['livekit', 'live', 'android', 'live-integration.md'],
13
+ 'live_list': ['livekit', 'live', 'android', 'live-live-list.md']
14
+ };
15
+ // iOS 平台文档路径映射(预留,待 iOS 文档完善后启用)
16
+ const IOS_PATH_MAP = {
17
+ 'host_streaming': ['livekit', 'live', 'ios', 'live-integration.md'],
18
+ 'audience_streaming': ['livekit', 'live', 'ios', 'live-integration.md'],
19
+ 'live_list': ['livekit', 'live', 'ios', 'live-live-list.md']
20
+ };
21
+ // Flutter 平台文档路径映射(预留,待 Flutter 文档完善后启用)
22
+ const FLUTTER_PATH_MAP = {
23
+ 'host_streaming': ['livekit', 'live', 'flutter', 'live-integration.md'],
24
+ 'audience_streaming': ['livekit', 'live', 'flutter', 'live-integration.md'],
25
+ 'live_list': ['livekit', 'live', 'flutter', 'live-live-list.md']
26
+ };
27
+ // React Native 平台文档路径映射(预留,待 RN 文档完善后启用)
28
+ const RN_PATH_MAP = {
29
+ 'host_streaming': ['livekit', 'live', 'rn', 'live-integration.md'],
30
+ 'audience_streaming': ['livekit', 'live', 'rn', 'live-integration.md'],
31
+ 'live_list': ['livekit', 'live', 'rn', 'live-live-list.md']
32
+ };
33
+ /**
34
+ * 根据平台选择对应的文档路径映射
35
+ */
36
+ function getPathMapByPlatform(platform) {
37
+ const pathMaps = {
38
+ 'android': ANDROID_PATH_MAP,
39
+ 'ios': IOS_PATH_MAP,
40
+ 'flutter': FLUTTER_PATH_MAP,
41
+ 'rn': RN_PATH_MAP
42
+ };
43
+ return pathMaps[platform] || ANDROID_PATH_MAP; // 默认使用 Android
44
+ }
45
+ /**
46
+ * 根据平台获取 workflow 文档路径
47
+ */
48
+ function getWorkflowPath(platform) {
49
+ const workflowPaths = {
50
+ 'android': ['livekit', 'live', 'android', 'workflow.md'],
51
+ 'ios': ['livekit', 'live', 'ios', 'workflow.md'],
52
+ 'flutter': ['livekit', 'live', 'flutter', 'workflow.md'],
53
+ 'rn': ['livekit', 'live', 'rn', 'workflow.md']
54
+ };
55
+ return workflowPaths[platform] || workflowPaths['android']; // 默认使用 Android
56
+ }
57
+ async function getResultText(params) {
58
+ const { platform, goals = [] } = params;
59
+ // 验证 platform 参数
60
+ if (!platform) {
61
+ throw new Error('platform 参数为必填项,请从 android, ios, flutter, rn 中选择一个平台');
62
+ }
63
+ reportCLSClient({
64
+ method: 'get_native_live_uikit_integration',
65
+ info: goals.join(','),
66
+ framework: platform
67
+ });
68
+ // 获取平台对应的工作流指令
69
+ const workflowPath = getWorkflowPath(platform);
70
+ const baseInstructions = getDocContent(workflowPath);
71
+ // 获取平台对应的文档路径映射
72
+ const pathMap = getPathMapByPlatform(platform);
73
+ // 批量读取目标文档并生成结构化结果
74
+ const result = await generateStructuredResult({
75
+ baseInstructions,
76
+ goals,
77
+ pathMap,
78
+ framework: platform,
79
+ });
80
+ return result;
81
+ }
82
+ const registryGetNativeLiveIntegrationTool = (mcpServer) => {
83
+ const { name, description, parameter_descriptions } = GET_NATIVE_LIVE_UIKIT_INTEGRATION_DEFINITION;
84
+ mcpServer.tool(name, description, {
85
+ platform: z.enum(['android', 'ios', 'flutter', 'rn']).describe(parameter_descriptions.platform),
86
+ goals: z.array(z.enum(['host_streaming', 'audience_streaming', 'live_list'])).describe(parameter_descriptions.goals)
87
+ }, async (params) => {
88
+ const result = await getResultText(params);
89
+ return {
90
+ content: [
91
+ {
92
+ type: 'text',
93
+ text: result.llm_code_generation_instructions_md,
94
+ }
95
+ ],
96
+ result: result,
97
+ };
98
+ });
99
+ };
100
+ export { registryGetNativeLiveIntegrationTool };
101
+ //# sourceMappingURL=get-native-live-uikit-integration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-native-live-uikit-integration.js","sourceRoot":"","sources":["../../../src/tools/live/get-native-live-uikit-integration.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,4CAA4C,EAAE,MAAM,yDAAyD,CAAC;AACvH,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,mBAAmB;AACnB,MAAM,gBAAgB,GAA6B;IACjD,gBAAgB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE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C,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,oCAAoC,GAAG,CAAC,SAAoB,EAAE,EAAE;IACpE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,sBAAsB,EAAE,GAAG,4CAA4C,CAAC;IAEnG,SAAS,CAAC,IAAI,CACZ,IAAI,EACJ,WAAW,EACX;QACE,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,sBAAsB,CAAC,QAAQ,CAAC;QAC/F,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,gBAAgB,EAAE,oBAAoB,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,sBAAsB,CAAC,KAAK,CAAC;KACrH,EACD,KAAK,EAAE,MAAW,EAAE,EAAE;QACpB,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,MAAM,CAAC,CAAC;QAC3C,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,MAAM,CAAC,mCAAmC;iBACjD;aACF;YACD,MAAM,EAAE,MAAM;SACf,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAE,oCAAoC,EAAE,CAAC"}
@@ -11,7 +11,7 @@ function getResultText(params) {
11
11
  info: componentName,
12
12
  framework: framework,
13
13
  });
14
- return getDocContent(['livekit', `${handleFramework(framework)}`, 'components', `${handleComponentName(componentName)}.md`]);
14
+ return getDocContent(['livekit', 'live', `${handleFramework(framework)}`, 'components', `${handleComponentName(componentName)}.md`]);
15
15
  }
16
16
  const registryGetWebLiveComponentDetailTool = (mcpServer) => {
17
17
  const { name, description, parameter_descriptions } = GET_WEB_LIVE_UIKIT_COMPONENT_DETAIL_DEFINITION;
@@ -1 +1 @@
1
- {"version":3,"file":"get-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;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC;aAC5B;SACF;KACF,CAAC,CAAC,CAAC;AACR,CAAC,CAAC;AACF,OAAO,EAAE,qCAAqC,EAAE,CAAC"}
1
+ {"version":3,"file":"get-web-live-component-detail.js","sourceRoot":"","sources":["../../../src/tools/live/get-web-live-component-detail.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,8CAA8C,EAAG,MAAM,2DAA2D,CAAC;AAC5H,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAE3E,SAAS,aAAa,CAAC,MAA2B;IAChD,MAAM,EAAE,SAAS,EAAE,aAAa,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC;IACjD,eAAe,CAAC;QACd,MAAM,EAAE,qCAAqC;QAC7C,IAAI,EAAE,aAAa;QACnB,SAAS,EAAE,SAAS;KACrB,CAAC,CAAC;IACH,OAAO,aAAa,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,eAAe,CAAC,SAAS,CAAC,EAAE,EAAE,YAAY,EAAE,GAAG,mBAAmB,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;AACvI,CAAC;AAED,MAAM,qCAAqC,GAAG,CAAC,SAAoB,EAAE,EAAE;IACrE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,sBAAsB,EAAE,GAAG,8CAA8C,CAAC;IACrG,SAAS,CAAC,IAAI,CACZ,IAAI,EACJ,WAAW,EACX;QACE,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,sBAAsB,CAAC,SAAS,CAAC;QACpF,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC,aAAa,CAAC;KACzE,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,qCAAqC,EAAE,CAAC"}
@@ -11,7 +11,7 @@ function getResultText(params) {
11
11
  info: componentName,
12
12
  framework: framework,
13
13
  });
14
- return getDocContent(['livekit', `${handleFramework(framework)}`, 'states', `${handleStateName(componentName)}.md`]);
14
+ return getDocContent(['livekit', 'live', `${handleFramework(framework)}`, 'states', `${handleStateName(componentName)}.md`]);
15
15
  }
16
16
  const registerGetWebLiveStateDetailTool = (mcpServer) => {
17
17
  const { name, description, parameter_descriptions } = GET_WEB_LIVE_STATE_DETAIL_DEFINITION;