@tencentcloud/sdk-mcp 1.6.8 → 1.7.1
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/CHANGELOG.md +36 -0
- package/README.md +59 -35
- package/knowledge/build-index.js +28 -4
- package/knowledge/chunker.js +82 -14
- package/knowledge/chunking-policy.js +100 -0
- package/knowledge/doc-url-resolver.js +70 -19
- package/knowledge/frontmatter-meta.js +167 -0
- package/knowledge/path-meta.js +28 -6
- package/knowledge/search/exact-lookup.js +126 -125
- package/knowledge/search/filter-pool.js +12 -29
- package/knowledge/search/framework-fallback.js +22 -0
- package/knowledge/search/intent-router.js +29 -0
- package/knowledge/search/l1-enrich.js +159 -0
- package/knowledge/search/query-normalizer.js +63 -3
- package/knowledge/search/search-core.js +410 -0
- package/knowledge/search/search-knowledge.js +419 -377
- package/knowledge/search/search-message.js +88 -0
- package/knowledge/search/search-pass.js +428 -0
- package/knowledge/search/search-types.js +1 -0
- package/knowledge/search/url-row-idf.js +120 -0
- package/knowledge/search/url-row-scorer.js +337 -0
- package/package.json +3 -1
- package/resource/index/manifest.json +1 -1
- package/resource/integration/callkit/preset/flutter/integration.md +7 -3
- package/resource/integration/callkit/preset/ios/integration.md +1 -0
- package/resource/integration/chat/preset/android/integration.md +1 -0
- package/resource/integration/chat/preset/flutter/integration.md +111 -10
- package/resource/integration/chat/preset/ios/integration.md +1 -0
- package/resource/integration/chat/preset/react/integration.md +1 -0
- package/resource/integration/chat/preset/uni-app/integration.md +1 -0
- package/resource/integration/chat/preset/vue/integration.md +1 -0
- package/resource/integration/livekit/preset/live/android/prepare-integration.md +1 -0
- package/resource/integration/livekit/preset/live/vue/live-player-desk-integration.md +12 -10
- package/resource/integration/livekit/preset/live/vue/live-pusher-integration.md +14 -14
- package/resource/integration/roomkit/preset/vue/integration.md +1 -0
- package/resource/knowledge/callkit/best-practice/callkit-miniprogram/uniapp-shrink.md +64 -0
- package/resource/knowledge/callkit/best-practice/common/call-autoplay-blocked.md +81 -0
- package/resource/knowledge/callkit/best-practice/common/call-message-in-chat.md +84 -0
- package/resource/knowledge/callkit/best-practice/common/call-vs-calls.md +114 -0
- package/resource/knowledge/callkit/best-practice/common/callengine-call-flow.md +128 -0
- package/resource/knowledge/callkit/best-practice/common/callengine-log-level.md +72 -0
- package/resource/knowledge/callkit/best-practice/common/callkit-get-engine-instance.md +87 -0
- package/resource/knowledge/callkit/best-practice/common/callkit-get-roomid.md +83 -0
- package/resource/knowledge/callkit/best-practice/common/callkit-limitations.md +37 -0
- package/resource/knowledge/callkit/best-practice/common/callkit-user-register-and-kicked.md +103 -0
- package/resource/knowledge/callkit/core-sdk/android/answer-call.md +1 -0
- package/resource/knowledge/callkit/core-sdk/android/make-call.md +1 -0
- package/resource/knowledge/callkit/core-sdk/flutter/answer-call.md +1 -0
- package/resource/knowledge/callkit/core-sdk/flutter/make-call.md +1 -0
- package/resource/knowledge/callkit/core-sdk/ios/answer-call.md +1 -0
- package/resource/knowledge/callkit/core-sdk/ios/make-call.md +1 -0
- package/resource/knowledge/callkit/core-sdk/ios/offline-push.md +1 -1
- package/resource/knowledge/callkit/core-sdk/uni-app/answer-call.md +1 -0
- package/resource/knowledge/callkit/core-sdk/uni-app/make-call.md +1 -0
- package/resource/knowledge/callkit/faq/flutter.md +1 -0
- package/resource/knowledge/callkit/faq/uniapp-app.md +1 -0
- package/resource/knowledge/callkit/preset/react/api.md +1 -150
- package/resource/knowledge/callkit/preset/vue/api.md +1 -38
- package/resource/knowledge/chat/best-practice/common/avchatroom-message-loss-diagnosis.md +71 -0
- package/resource/knowledge/chat/best-practice/common/group-conversation-cleanup-on-system-notice.md +67 -0
- package/resource/knowledge/chat/best-practice/common/image-message-url-lifecycle.md +63 -0
- package/resource/knowledge/chat/best-practice/common/login-repeat-2025-diagnosis.md +65 -0
- package/resource/knowledge/chat/best-practice/common/message-read-report-and-receipt.md +72 -0
- package/resource/knowledge/chat/best-practice/common/message-receive-event.md +70 -0
- package/resource/knowledge/chat/best-practice/common/message-risk-error-and-render.md +69 -0
- package/resource/knowledge/chat/best-practice/common/message-unread-count.md +71 -0
- package/resource/knowledge/chat/best-practice/miniprogram/audio-message-send.md +118 -0
- package/resource/knowledge/chat/best-practice/miniprogram/login-timeout-2801-diagnosis.md +67 -0
- package/resource/knowledge/chat/best-practice/miniprogram/media-upload-fail-diagnosis.md +68 -0
- package/resource/knowledge/chat/best-practice/web/audio-message-send.md +123 -0
- package/resource/knowledge/chat/preset/android/features/conversation-list.md +1 -0
- package/resource/knowledge/chat/preset/android/features/language.md +1 -0
- package/resource/knowledge/chat/preset/android/features/message-input.md +1 -0
- package/resource/knowledge/chat/preset/android/features/message-list.md +1 -0
- package/resource/knowledge/chat/preset/android-view/integration.md +1 -0
- package/resource/knowledge/chat/preset/flutter/features/conversation-list.md +1 -0
- package/resource/knowledge/chat/preset/flutter/features/message-input.md +1 -0
- package/resource/knowledge/chat/preset/flutter/features/message-list.md +1 -0
- package/resource/knowledge/chat/preset/ios/features/conversation-list.md +1 -0
- package/resource/knowledge/chat/preset/ios/features/message-input.md +1 -0
- package/resource/knowledge/chat/preset/ios/features/message-list.md +1 -0
- package/resource/knowledge/chat/preset/ios-uikit/integration.md +1 -0
- package/resource/knowledge/chat/preset/react/features/conversation-preview.md +1 -0
- package/resource/knowledge/chat/preset/react/features/message-input.md +61 -3
- package/resource/knowledge/chat/preset/react/features/message-list.md +7 -0
- package/resource/knowledge/chat/preset/vue/features/message-input.md +58 -5
- package/resource/knowledge/chat/preset/vue/features/message-list.md +7 -0
- package/resource/knowledge/chat/urls/product.md +8 -8
- package/resource/knowledge/chat/urls/restapi.md +3 -3
- package/resource/knowledge/chat/urls/sdk/android.md +5 -5
- package/resource/knowledge/chat/urls/sdk/flutter.md +5 -5
- package/resource/knowledge/chat/urls/sdk/ios.md +5 -5
- package/resource/knowledge/chat/urls/sdk/web.md +8 -8
- package/resource/knowledge/chat/urls/webhook.md +11 -17
- package/resource/knowledge/livekit/best-practice/android/voice-room-anchor-start.md +124 -0
- package/resource/knowledge/livekit/best-practice/common/admin-take-seat.md +73 -0
- package/resource/knowledge/livekit/best-practice/common/audience-leave-live.md +81 -0
- package/resource/knowledge/livekit/best-practice/common/voice-room-no-audio-troubleshoot.md +100 -0
- package/resource/knowledge/livekit/best-practice/common/voice-room-seat-list-change.md +65 -0
- package/resource/knowledge/livekit/best-practice/flutter/voice-room-anchor-start.md +126 -0
- package/resource/knowledge/livekit/best-practice/ios/voice-room-anchor-start.md +130 -0
- package/resource/knowledge/push/config/harmonyos.md +1 -1
- package/resource/knowledge/push/config/ios.md +2 -2
- package/resource/knowledge/push/config/react-native.md +1 -0
- package/resource/knowledge/push/config/unity.md +1 -0
- package/resource/knowledge/push/config/unreal-engine.md +1 -0
- package/resource/knowledge/push/integration/android.md +17 -16
- package/resource/knowledge/push/integration/donut.md +2 -2
- package/resource/knowledge/push/integration/flutter.md +4 -3
- package/resource/knowledge/push/integration/harmonyos.md +1 -1
- package/resource/knowledge/push/integration/ios.md +4 -3
- package/resource/knowledge/push/integration/react-native.md +1 -1
- package/resource/knowledge/push/integration/uni-app.md +1 -0
- package/resource/knowledge/push/integration/unity.md +4 -4
- package/resource/knowledge/push/integration/unreal-engine.md +37 -35
- package/resource/knowledge/roomkit/best-practice/common/room-ghost-member.md +75 -0
- package/resource/knowledge/roomkit/best-practice/common/room-limit-and-multi.md +88 -0
- package/resource/knowledge/roomkit/best-practice/common/room-screen-share-preview.md +87 -0
- package/resource/knowledge/roomkit/best-practice/common/room-status-after-all-leave.md +73 -0
- package/resource/knowledge/roomkit/best-practice/vue/room-uikit-vs-atomicx.md +115 -0
- package/resource/knowledge/roomkit/core-sdk/android/call-user-to-room.md +1 -0
- package/resource/knowledge/roomkit/core-sdk/android/room-participant-state.md +1 -0
- package/resource/knowledge/roomkit/core-sdk/android/room-state.md +1 -0
- package/resource/knowledge/roomkit/core-sdk/android/schedule-room.md +1 -0
- package/resource/knowledge/roomkit/core-sdk/flutter/call-user-to-room.md +1 -0
- package/resource/knowledge/roomkit/core-sdk/flutter/room-participant-state.md +1 -0
- package/resource/knowledge/roomkit/core-sdk/flutter/room-state.md +1 -0
- package/resource/knowledge/roomkit/core-sdk/flutter/schedule-room.md +1 -0
- package/resource/knowledge/roomkit/core-sdk/ios/call-user-to-room.md +1 -0
- package/resource/knowledge/roomkit/core-sdk/ios/room-participant-state.md +1 -0
- package/resource/knowledge/roomkit/core-sdk/ios/room-state.md +1 -0
- package/resource/knowledge/roomkit/core-sdk/ios/schedule-room.md +1 -0
- package/resource/knowledge/roomkit/core-sdk/vue/room-view.md +1 -0
- package/resource/knowledge/roomkit/preset/react/integration.md +1 -0
- package/resource/knowledge/rtcengine/web/plugin/30-advanced-cross-room-link.md +2 -0
- package/resource/knowledge/rtcengine/web/plugin/39-advanced-video-decoder.md +2 -0
- package/resource/knowledge/trtc/android/TRTCCloud.md +1 -0
- package/resource/knowledge/trtc/c++/ITRTCCloud.md +1 -0
- package/resource/knowledge/trtc/ios/TRTCCloud.md +1 -0
- package/server.js +9 -4
- package/streamable-http.js +19 -54
- package/tools/common/search_trtc_knowledge.js +24 -12
- package/tools/definitions/finalize_answer_def.js +2 -2
- package/tools/definitions/integration-boundary.js +2 -1
- package/tools/definitions/search_trtc_knowledge_def.js +5 -3
- package/utils/fetch-doc-content.js +198 -0
- package/utils/preflight-route.js +197 -0
- package/utils/report-cls-client.js +1 -1
- package/utils/report-es-client.js +1 -1
- package/cursor-setting.png +0 -0
- package/mcp-server-prompt.png +0 -0
- package/resource/knowledge/callkit/best-practice/web/callengine-invitation.md +0 -80
- package/resource/knowledge/callkit/best-practice/web/callengine-log-control.md +0 -20
- package/resource/knowledge/callkit/best-practice/web/callkit-call-vs-calls.md +0 -116
- package/resource/knowledge/callkit/preset/react/uikit-api-reference.md +0 -469
- package/resource/knowledge/callkit/preset/vue/uikit-api-reference.md +0 -581
- package/resource/knowledge/callkit/preset/web/api.md +0 -79
- package/resource/knowledge/chat/best-practice/web/image-message-url-handling.md +0 -16
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: TUIRoomKit 屏幕共享本地预览与避免无限套娃
|
|
3
|
+
product: room
|
|
4
|
+
frameworks: [react, vue, web]
|
|
5
|
+
scope: platform_common
|
|
6
|
+
tags: [TUIRoomKit, 屏幕共享, 本地预览, startScreenSharing, startScreenShare, 整屏共享, 无限套娃, 无限镜像, 窗口共享, 外接显示器, useDeviceState, view参数]
|
|
7
|
+
version_range: ">=2.0.0"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# TUIRoomKit 屏幕共享本地预览与避免无限套娃
|
|
11
|
+
|
|
12
|
+
## 1. 核心结论
|
|
13
|
+
|
|
14
|
+
- `view` 参数可以本地显示正在共享的内容:传入有效 `view` 会在本地容器渲染分享画面(本地预览);不传或传 `null` 则不渲染本地预览。
|
|
15
|
+
- 整屏共享时本地预览会出现"无限套娃/无限镜像":原因在于本地预览区域也在被采集的整屏/当前页里,预览画面再次进入采集产生递归镜像。
|
|
16
|
+
- **优先方案:改为分享"窗口"而非整屏**,从源头避免会议页被采进画面导致的套娃。
|
|
17
|
+
- **分享 WPS 注意事项**:通常无法单独拿到"放映窗口"(放映态与编辑窗在采集列表里表现受限)。此时可让用户接**外接显示器**:把放映画面放到外接屏,再分享该显示器/对应窗口,会议主屏继续操作、预览也不易套娃。
|
|
18
|
+
- **兜底方案**:无法改分享窗口、也无法使用外接显示器时,将本地预览窗口尽量做小(缩小 `view` 容器),可明显降低递归镜像的影响面;或本地不传 `view` / 传 `null`,仅用"正在共享"状态提示。
|
|
19
|
+
|
|
20
|
+
## 2. 字段语义对照
|
|
21
|
+
|
|
22
|
+
| 字段/能力 | 作用 | 说明 |
|
|
23
|
+
|---|---|---|
|
|
24
|
+
| `view` | 本地屏幕分享预览容器 | 传入有效 DOM(元素或 id)则渲染本地预览;传 `null` 不渲染 |
|
|
25
|
+
| `startScreenSharing` | 屏幕共享接口 | TRTC Web / Room 屏幕共享,`view` 指定本地预览 |
|
|
26
|
+
| `startScreenShare` | 底层屏幕共享 | TRTC `startScreenShare`,与 Atomicx 一致 |
|
|
27
|
+
| `useDeviceState().startScreenShare` | Atomicx 无 UI 路径 | 屏幕共享入口,本地预览由预览视图/容器决定 |
|
|
28
|
+
|
|
29
|
+
## 3. 机制/时序
|
|
30
|
+
|
|
31
|
+
### 本地预览
|
|
32
|
+
|
|
33
|
+
调用屏幕共享接口并传入有效 `view` -> 本地容器渲染正在分享的画面(本地预览)-> 不传或传 `null` 则不渲染本地预览。
|
|
34
|
+
|
|
35
|
+
## 4. 标准用法
|
|
36
|
+
|
|
37
|
+
### 带本地预览的屏幕共享
|
|
38
|
+
|
|
39
|
+
```javascript
|
|
40
|
+
// TRTC Web / Room 屏幕共享,view 指定本地预览容器(元素或 id)
|
|
41
|
+
startScreenShare({
|
|
42
|
+
view: 'local-preview-container', // 传入有效 view,本地渲染分享画面
|
|
43
|
+
// 传 null 则不渲染本地预览
|
|
44
|
+
});
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### 避免无限套娃
|
|
48
|
+
|
|
49
|
+
```javascript
|
|
50
|
+
// 方案 1:优先分享窗口而非整屏,从源头避免套娃
|
|
51
|
+
startScreenShare({ view: 'local-preview-container' }); // 选择窗口采集源
|
|
52
|
+
|
|
53
|
+
// 方案 2(兜底):无法分享窗口时,缩小本地预览容器或本地不传 view
|
|
54
|
+
startScreenShare({ view: null }); // 不渲染本地预览,仅用"正在共享"状态提示
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## 5. 结果判定
|
|
58
|
+
|
|
59
|
+
- 传入有效 `view`:本地容器渲染分享画面,实现本地预览。
|
|
60
|
+
- 不传 / 传 `null`:不渲染本地预览,仅共享画面给远端。
|
|
61
|
+
- 整屏共享 + 本地预览:可能出现无限套娃,需改为窗口共享或缩小预览。
|
|
62
|
+
- 分享 WPS 放映:需用外接显示器方案避免套娃。
|
|
63
|
+
|
|
64
|
+
## 6. 常见误区
|
|
65
|
+
|
|
66
|
+
- 误区 1:认为 `view` 是远端渲染参数(`view` 指定的是本地屏幕分享预览)。
|
|
67
|
+
- 误区 2:整屏共享时本地预览必然套娃就放弃本地预览(可改为窗口共享或缩小预览)。
|
|
68
|
+
- 误区 3:分享 WPS 时以为能单独拿到放映窗口(通常受限,需外接显示器)。
|
|
69
|
+
- 误区 4:混淆 `startScreenSharing` 与 `startScreenShare`(底层一致,均通过 `view` 指定本地预览)。
|
|
70
|
+
|
|
71
|
+
## 7. 问题定义(检索辅助,极简)
|
|
72
|
+
|
|
73
|
+
TUIRoomKit 屏幕共享时 `view` 参数能否本地预览正在共享的内容,以及整屏共享时本地预览如何避免无限套娃/无限镜像。
|
|
74
|
+
|
|
75
|
+
## 8. 同义问法覆盖(检索召回,极简)
|
|
76
|
+
|
|
77
|
+
- 屏幕共享能本地预览吗?
|
|
78
|
+
- TUIRoomKit 屏幕共享 startScreenShare view 参数是什么?
|
|
79
|
+
- 整屏共享怎么避免无限镜像?
|
|
80
|
+
- 屏幕共享出现套娃怎么办?
|
|
81
|
+
- 分享窗口还是整屏更合适?
|
|
82
|
+
- 本地预览窗口怎么缩小?
|
|
83
|
+
- 屏幕共享怎么隐藏本地预览?
|
|
84
|
+
|
|
85
|
+
## 9. 参考来源(可选)
|
|
86
|
+
|
|
87
|
+
- TRTC Web `startScreenShare`:`https://web.sdk.qcloud.com/trtc/webrtc/doc/zh-cn/TRTC.html`
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: TUIRoomKit 所有人离开后房间状态与计费说明
|
|
3
|
+
product: room
|
|
4
|
+
frameworks: [react, vue, web, android, ios, flutter]
|
|
5
|
+
scope: platform_common
|
|
6
|
+
tags: [TUIRoomKit, 所有人离开, 房间销毁, 回收房间, 解散房间, 计费, 会议结束, 房间存在, 房间数量]
|
|
7
|
+
version_range: ">=2.0.0"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# TUIRoomKit 所有人离开后房间状态与计费说明
|
|
11
|
+
|
|
12
|
+
## 1. 核心结论
|
|
13
|
+
|
|
14
|
+
- 房间**不会**因为"所有人离开"就立刻自动销毁。
|
|
15
|
+
- 会议结束后,业务侧应**主动调用解散房间接口**结束本场会议。
|
|
16
|
+
- 若未手动解散:后台会在会议结束时间 **6 小时以后**尝试回收房间,回收条件是**房间内成员数为 0**。
|
|
17
|
+
- 计费按实际推拉流/通话消耗;成员都离开且无媒体占用后一般不再产生音视频时长,但房间对象在未解散、未回收前仍占用房间数量。
|
|
18
|
+
|
|
19
|
+
## 2. 字段语义对照
|
|
20
|
+
|
|
21
|
+
| 字段/能力 | 作用 | 说明 |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| 解散房间接口 | 主动结束会议 | 业务侧会议结束后主动调用 |
|
|
24
|
+
| 后台回收 | 自动清理房间 | 会议结束 6 小时后尝试回收,条件为成员数 0 |
|
|
25
|
+
| 房间内成员数 | 房间成员统计 | 回收的条件:成员数为 0 |
|
|
26
|
+
| 音视频时长计费 | 通话消耗计费 | 按实际推拉流/通话消耗计费 |
|
|
27
|
+
| 房间数量占用 | 房间对象占用 | 未解散、未回收前仍占用房间数量 |
|
|
28
|
+
|
|
29
|
+
## 3. 机制/时序
|
|
30
|
+
|
|
31
|
+
所有人离开房间 -> 房间不会立刻自动销毁 -> 业务侧主动调用解散房间接口(推荐),或等待后台自动回收 -> 后台在会议结束 6 小时后尝试回收(条件为成员数 0)-> 房间回收。
|
|
32
|
+
|
|
33
|
+
计费维度:
|
|
34
|
+
|
|
35
|
+
- 音视频时长按实际推拉流/通话消耗计费。
|
|
36
|
+
- 成员都离开且无媒体占用后,一般不再产生该房间的音视频时长。
|
|
37
|
+
- 房间对象在未解散、未回收前仍占用房间数量。
|
|
38
|
+
|
|
39
|
+
## 4. 标准用法
|
|
40
|
+
|
|
41
|
+
1. 会议结束后,业务侧主动调用解散房间接口结束会议,避免房间残留。
|
|
42
|
+
2. 若忘记手动解散,后台会在 6 小时后自动回收(成员数为 0 时)。
|
|
43
|
+
3. 评估房间数量占用时,注意未解散、未回收的房间对象仍占用配额。
|
|
44
|
+
|
|
45
|
+
## 5. 结果判定
|
|
46
|
+
|
|
47
|
+
- 主动解散后,房间立即结束。
|
|
48
|
+
- 未主动解散时,后台在会议结束 6 小时后、成员数为 0 时回收房间。
|
|
49
|
+
- 成员都离开且无媒体占用后,不再产生音视频时长计费。
|
|
50
|
+
- 未解散、未回收的房间对象仍占用房间数量。
|
|
51
|
+
|
|
52
|
+
## 6. 常见误区
|
|
53
|
+
|
|
54
|
+
- 误区 1:认为所有人离开后房间会自动销毁(需主动解散或等待 6 小时后台回收)。
|
|
55
|
+
- 误区 2:认为未解散的房间不产生任何费用(房间对象仍占用房间数量,可能影响并发配额)。
|
|
56
|
+
- 误区 3:忽略业务侧主动解散(推荐主动调用解散接口,而非依赖后台回收)。
|
|
57
|
+
|
|
58
|
+
## 7. 问题定义(检索辅助,极简)
|
|
59
|
+
|
|
60
|
+
TUIRoomKit 房间内所有人离开后房间是否还存在、是否会继续计费,以及如何主动解散房间。
|
|
61
|
+
|
|
62
|
+
## 8. 同义问法覆盖(检索召回,极简)
|
|
63
|
+
|
|
64
|
+
- 所有人离开后房间会自动销毁吗?
|
|
65
|
+
- TUIRoomKit 房间空了还会计费吗?
|
|
66
|
+
- 会议结束后怎么解散房间?
|
|
67
|
+
- 房间回收要等多久?
|
|
68
|
+
- 房间成员数为 0 会怎样?
|
|
69
|
+
- 房间对象还占房间数量吗?
|
|
70
|
+
|
|
71
|
+
## 9. 参考来源(可选)
|
|
72
|
+
|
|
73
|
+
- 开通服务 / 功能与计费说明:`https://cloud.tencent.com/document/product/269/104946`
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: tuikit-atomicx-vue3/room 与 roomkit-web-vue3 定位对比
|
|
3
|
+
product: room
|
|
4
|
+
frameworks: [vue, web]
|
|
5
|
+
scope: platform_specific
|
|
6
|
+
tags: [TUIRoomKit, Atomicx, UIKit, tuikit-atomicx-vue3, roomkit-web-vue3, useRoomState, conference, 层级对比, 无UI, 预制UI, 自定义集成, 依赖关系, vue3]
|
|
7
|
+
version_range: ">=2.0.0"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# tuikit-atomicx-vue3/room 与 roomkit-web-vue3 定位对比
|
|
11
|
+
|
|
12
|
+
## 1. 核心结论
|
|
13
|
+
|
|
14
|
+
- `tuikit-atomicx-vue3/room`(Atomicx)是**原子能力层**,无 UI / 强自定义集成主路径,把房间、设备、成员等拆成响应式 State。
|
|
15
|
+
- `@tencentcloud/roomkit-web-vue3`(RoomKit / UIKit)是**含 UI 低代码层**,开箱即用的会议套件与页面级组件。
|
|
16
|
+
- 依赖关系:**RoomKit(含 UI)建在 Atomicx/Room 能力之上的产品化封装**,业务上可理解为 RoomKit 复用/对接 Atomicx 能力,而非两套互不相干的房间协议。
|
|
17
|
+
- API 入口:Atomicx 用 `useRoomState()`,UIKit 用 `conference`。
|
|
18
|
+
|
|
19
|
+
## 2. 字段语义对照
|
|
20
|
+
|
|
21
|
+
| 字段/能力 | 作用 | 说明 |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| `useRoomState` | Atomicx 房间状态入口 | `createAndJoinRoom` / `joinRoom` / `leaveRoom` / `endRoom` / `currentRoom` |
|
|
24
|
+
| `useDeviceState` | Atomicx 设备状态 | 设备开关、屏幕共享等 |
|
|
25
|
+
| `useRoomParticipantState` | Atomicx 成员状态 | 成员管控、事件订阅 |
|
|
26
|
+
| `useLoginState` | Atomicx 登录状态 | 登录能力,UIKit 会中可复用 |
|
|
27
|
+
| `conference` | UIKit 会议门面 API | 推荐 `createAndJoinRoom` / `joinRoom` / `leaveRoom` / `endRoom` |
|
|
28
|
+
| `ConferenceMainView` | UIKit 预制视图 | 登录进房、会控、布局、麦位等完整会议 UI |
|
|
29
|
+
|
|
30
|
+
## 3. 机制/时序
|
|
31
|
+
|
|
32
|
+
### 定位对比
|
|
33
|
+
|
|
34
|
+
| 对比项 | `tuikit-atomicx-vue3/room`(Atomicx) | `@tencentcloud/roomkit-web-vue3`(RoomKit / UIKit) |
|
|
35
|
+
|---|---|---|
|
|
36
|
+
| **层级** | Atomicx(原子能力层):State Hooks + 可选原子 UI 组件 | UIKit / 含 UI 低代码层:开箱即用的会议套件与页面级组件 |
|
|
37
|
+
| **包定位** | 无 UI / 强自定义集成主路径;把房间、设备、成员等拆成响应式 State | 含 UI 快速集成主路径;提供完整会议 UI 与 `conference` 门面 API |
|
|
38
|
+
| **核心能力** | `useRoomState` / `useDeviceState` / `useRoomParticipantState` / `useLoginState`:创房、入会、设备、屏幕共享、成员管控、事件订阅;可自拼 UI | `conference` + 预制视图(如 `ConferenceMainView`):登录进房、会控、布局、麦位等会议完整体验;支持部分组件显隐/自定义 Widget |
|
|
39
|
+
| **适用场景** | 把音视频嵌进自有业务 UI(医联、OA、教育后台等),要 100% 控交互与品牌 | 要最快上线标准会议/研讨会,少写 UI,接受官方会议交互 |
|
|
40
|
+
| **依赖关系** | 底层基于 RoomEngine / TRTC / IM;是原子化接入方案 | 含 UI 方案复用/对接 Atomicx 能力(如登录用 `useLoginState`,会中逻辑走 Room 能力);业务上可理解为 RoomKit(含 UI)建在 Atomicx/Room 能力之上的产品化封装 |
|
|
41
|
+
| **API 入口** | `useRoomState()`:`createAndJoinRoom` / `joinRoom` / `leaveRoom` / `endRoom`、`currentRoom`、事件订阅等 | `conference`:推荐 `createAndJoinRoom` / `joinRoom` / `leaveRoom` / `endRoom` |
|
|
42
|
+
| **UI 形态** | 预制原子组件可选用 + 自定义模块自拼为主 | 预制完整会议 UI 为主,可通过 Widget/显隐配置做有限定制 |
|
|
43
|
+
|
|
44
|
+
## 4. 标准用法
|
|
45
|
+
|
|
46
|
+
### Atomicx 方式(无 UI,自定义集成)
|
|
47
|
+
|
|
48
|
+
```javascript
|
|
49
|
+
import { useRoomState } from 'tuikit-atomicx-vue3/room';
|
|
50
|
+
|
|
51
|
+
const { createAndJoinRoom } = useRoomState();
|
|
52
|
+
|
|
53
|
+
createAndJoinRoom({
|
|
54
|
+
roomId: 'YOUR_ROOM_ID', // 必填:建议由业务后台生成的唯一标识
|
|
55
|
+
options: {
|
|
56
|
+
roomName: '项目进度周会',
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
// 通过 useDeviceState / useRoomParticipantState 等获取响应式状态自拼 UI
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### UIKit 方式(含 UI,快速集成)
|
|
63
|
+
|
|
64
|
+
```javascript
|
|
65
|
+
import { conference, ConferenceMainView, ConferenceMainViewH5, RoomEvent, genTestUserSig } from '@tencentcloud/roomkit-web-vue3';
|
|
66
|
+
const SDKAppID = 0; // 替换为您在开通服务阶段获取的 SDKAppID
|
|
67
|
+
const SDKSecretKey = ''; // 替换为您在开通服务阶段获取的 SDKSecretKey
|
|
68
|
+
const handleEnterRoom = async () => {
|
|
69
|
+
if (!SDKAppID || !SDKSecretKey) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
try {
|
|
73
|
+
const { userSig } = genTestUserSig({ userId: 'test01', sdkAppId: SDKAppID, secretKey: SDKSecretKey });
|
|
74
|
+
await conference.login({ sdkAppId: SDKAppID, userId: 'test01', userSig });
|
|
75
|
+
await conference.setSelfInfo({ userName: 'test', avatarUrl: '' });
|
|
76
|
+
await conference.createAndJoinRoom({ roomId: '123456', options: { roomName: `test01 的会议` } });
|
|
77
|
+
inRoom.value = true;
|
|
78
|
+
} catch (error) {
|
|
79
|
+
console.error('进入会议失败:', error);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
// 使用预制 ConferenceMainView 渲染完整会议 UI
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## 5. 结果判定
|
|
86
|
+
|
|
87
|
+
- 无 UI / 强自定义需求:选 Atomicx,用 `useRoomState()` + State Hooks 自拼 UI。
|
|
88
|
+
- 快速上线标准会议:选 UIKit,用 `conference` + `ConferenceMainView`。
|
|
89
|
+
- 依赖关系:UIKit 复用 Atomicx 能力,非两套独立协议。
|
|
90
|
+
- API 入口:Atomicx 为 `useRoomState()`,UIKit 为 `conference`。
|
|
91
|
+
|
|
92
|
+
## 6. 常见误区
|
|
93
|
+
|
|
94
|
+
- 误区 1:认为 Atomicx 和 UIKit 是两套互不相干的房间协议(UIKit 建在 Atomicx/Room 能力之上)。
|
|
95
|
+
- 误区 2:用 Atomicx 时误以为自带完整会议 UI(Atomicx 是 State Hooks + 可选原子组件,UI 需自拼)。
|
|
96
|
+
- 误区 3:用 UIKit 时误以为无法自定义(支持部分组件显隐 / 自定义 Widget)。
|
|
97
|
+
- 误区 4:混淆两套的 API 入口(Atomicx 用 `useRoomState()`,UIKit 用 `conference`)。
|
|
98
|
+
|
|
99
|
+
## 7. 问题定义(检索辅助,极简)
|
|
100
|
+
|
|
101
|
+
对比 TUIRoomKit Vue3 两种集成方案的定位差异:`tuikit-atomicx-vue3/room`(Atomicx Core SDK,无 UI,State Hooks 自拼)与 `@tencentcloud/roomkit-web-vue3`(RoomKit UIKit,含 UI,conference 低代码)在层级、能力、适用场景、依赖关系与 API 入口(useRoomState vs conference)方面的差异。
|
|
102
|
+
|
|
103
|
+
## 8. 同义问法覆盖(检索召回,极简)
|
|
104
|
+
|
|
105
|
+
- Atomicx 和 RoomKit 有什么区别?
|
|
106
|
+
- `tuikit-atomicx-vue3/room` 和 `roomkit-web-vue3` 怎么选?
|
|
107
|
+
- TUIRoomKit 无 UI 和含 UI 方案怎么选?
|
|
108
|
+
- `useRoomState` 和 `conference` 区别?
|
|
109
|
+
- RoomKit 基于 Atomicx 吗?
|
|
110
|
+
- 自定义会议室 UI 用哪个包?
|
|
111
|
+
- 快速集成会议用 Atomicx 还是 UIKit?
|
|
112
|
+
|
|
113
|
+
## 9. 参考来源(可选)
|
|
114
|
+
|
|
115
|
+
- 房间管理 Web:`https://cloud.tencent.com/document/product/647/126919`
|
|
@@ -232,3 +232,4 @@ fun rejectCall(roomID: String, reason: CallRejectionReason = CallRejectionReason
|
|
|
232
232
|
| <strong>Store/Component</strong> | <strong>功能描述</strong> | <strong>API文档</strong> |
|
|
233
233
|
| --- | --- | --- |
|
|
234
234
|
| <strong>RoomStore</strong> | 房间全生命周期管理:创建并加入 / 加入 / 离开 / 结束房间 / 更新、获取房间信息 / 房间预约 / 呼叫房间外成员 / 监听房间内被动事件(例如房间解散,房间信息更新等)。 | <a href="https://tencent-rtc.github.io/TUIKit_Android/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.room/-room-store/index.html">API 文档</a> |
|
|
235
|
+
|
|
@@ -675,3 +675,4 @@ private fun subscribeParticipantState() {
|
|
|
675
675
|
| <strong>Store/Component</strong> | <strong>功能描述</strong> | <strong>API 文档</strong> |
|
|
676
676
|
| --- | --- | --- |
|
|
677
677
|
| <strong>RoomParticipantStore</strong> | 房间内参与者管理:设置管理员 / 转移房主 / 获取参与者列表 / 移出房间 / 参与者设备控制(例如关闭、邀请打开摄像头、麦克风等)/ 申请打开设备(例如申请打开摄像头、麦克风等)。 | <a href="https://tencent-rtc.github.io/TUIKit_Android/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.room/-room-participant-store/index.html">API 文档</a> |
|
|
678
|
+
|
|
@@ -226,3 +226,4 @@ Future<void> rejectCall(String roomID, {CallRejectionReason reason = CallRejecti
|
|
|
226
226
|
| <strong>Store/Component</strong> | <strong>功能描述</strong> | <strong>API 文档</strong> |
|
|
227
227
|
| --- | --- | --- |
|
|
228
228
|
| <strong>RoomStore</strong> | 房间全生命周期管理:创建并加入 / 加入 / 离开 / 结束房间 / 更新、获取房间信息 / 预定房间 / 呼叫房间外成员 / 监听房间内被动事件(例如房间解散,房间信息更新等)。 | <a href="https://tencent-rtc.github.io/TUIKit_Flutter/api_room_room_store/RoomStore-class.html">API 文档</a> |
|
|
229
|
+
|
|
@@ -793,3 +793,4 @@ Widget buildSpeakingUsersWidget() {
|
|
|
793
793
|
| <strong>Store</strong> | <strong>功能描述</strong> | <strong>API文档</strong> |
|
|
794
794
|
| --- | --- | --- |
|
|
795
795
|
| <strong>RoomParticipantStore</strong> | 房间内参与者管理:设置管理员 / 转移房主 / 获取参与者列表 / 移出房间 / 参与者设备控制(例如关闭、邀请打开摄像头、麦克风等)/ 申请打开设备(例如申请打开摄像头、麦克风等)。 | <a href="https://tencent-rtc.github.io/TUIKit_Flutter/api_room_room_participant_store/RoomParticipantStore-class.html">API 文档</a> |
|
|
796
|
+
|
|
@@ -224,3 +224,4 @@ func rejectCall(roomID: String, reason: CallRejectionReason = .rejected) {
|
|
|
224
224
|
| <strong>Store/Component</strong> | <strong>功能描述</strong> | <strong>API文档</strong> |
|
|
225
225
|
| --- | --- | --- |
|
|
226
226
|
| <strong>RoomStore</strong> | 房间全生命周期管理:创建并加入 / 加入 / 离开 / 结束房间 / 更新、获取房间信息 / 预定房间 / 呼叫房间外成员 / 监听房间内被动事件(例如房间解散,房间信息更新等)。 | <a href="https://tencent-rtc.github.io/TUIKit_iOS/documentation/atomicxcore/roomstore">API 文档</a> |
|
|
227
|
+
|
|
@@ -648,3 +648,4 @@ private func subscribeParticipantState() {
|
|
|
648
648
|
| <strong>Store/Component</strong> | <strong>功能描述</strong> | <strong>API 文档</strong> |
|
|
649
649
|
| --- | --- | --- |
|
|
650
650
|
| <strong>RoomParticipantStore</strong> | 房间内参与者管理:设置管理员 / 转移房主 / 获取参与者列表 / 移出房间 / 参与者设备控制(例如关闭、邀请打开摄像头、麦克风等)/ 申请打开设备(例如申请打开摄像头、麦克风等)。 | <a href="https://tencent-rtc.github.io/TUIKit_iOS/documentation/atomicxcore/roomparticipantstore">API 文档</a> |
|
|
651
|
+
|
package/server.js
CHANGED
|
@@ -28,15 +28,20 @@ You are using Tencent RTC MCP Server for SDK documentation retrieval.
|
|
|
28
28
|
|
|
29
29
|
Workflow:
|
|
30
30
|
1. Call search_trtc_knowledge. Reuse the same queryID for all retries/searches in this consultation.
|
|
31
|
-
2. Draft the
|
|
32
|
-
3. MUST call finalize_answer with the same prompt
|
|
33
|
-
4. Reply with
|
|
31
|
+
2. Draft the complete answer from fragments. Include References from meta.references/doc_urls when available.
|
|
32
|
+
3. MUST call finalize_answer with the same prompt, answer, and queryID before replying.
|
|
33
|
+
4. Reply with that answer + finalize_answer follow-up text.
|
|
34
34
|
5. After finalize_answer follow-up, check the next user reply before any normal response. If it means Yes/已解决/thanks/OK, MUST call submit_feedback(resolved="1") before replying. If it means No/未解决/still not working, MUST call submit_feedback(resolved="0") before replying. Never say feedback was submitted unless submit_feedback was called.
|
|
35
|
+
|
|
36
|
+
User-visible output rule (MUST):
|
|
37
|
+
- Internal routing/tool decisions are NEVER user-facing text.
|
|
38
|
+
- Before calling any tool, do NOT output preface like “应调用…/先调用…/让我先搜索…/属于咨询类问题…/而非 codegen…”.
|
|
39
|
+
- If a tool call is needed, call it directly; then provide user-facing results only.
|
|
35
40
|
`.trim();
|
|
36
41
|
export function createServer() {
|
|
37
42
|
const server = new McpServer({
|
|
38
43
|
name: "Tencent RTC MCP Server",
|
|
39
|
-
version: "1.
|
|
44
|
+
version: "1.7.1",
|
|
40
45
|
}, {
|
|
41
46
|
instructions: SERVER_INSTRUCTIONS,
|
|
42
47
|
});
|
package/streamable-http.js
CHANGED
|
@@ -3,66 +3,31 @@ import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/
|
|
|
3
3
|
import { createServer } from './server.js';
|
|
4
4
|
const app = express();
|
|
5
5
|
app.use(express.json());
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
// 无状态 Streamable HTTP:每个请求都新建独立 McpServer 实例和 transport,
|
|
7
|
+
// 避免复用已 connect 的实例导致 "Already connected"。
|
|
8
|
+
async function handleMcpRequest(req, res) {
|
|
9
|
+
const server = createServer();
|
|
10
|
+
const transport = new StreamableHTTPServerTransport({
|
|
11
|
+
sessionIdGenerator: undefined, // 无状态服务:不生成持久 session
|
|
12
|
+
});
|
|
12
13
|
await server.connect(transport);
|
|
13
|
-
|
|
14
|
+
await transport.handleRequest(req, res, req.body);
|
|
15
|
+
}
|
|
14
16
|
app.post('/mcp', async (req, res) => {
|
|
15
|
-
|
|
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
|
-
}
|
|
17
|
+
await handleMcpRequest(req, res);
|
|
32
18
|
});
|
|
33
19
|
app.get('/mcp', async (req, res) => {
|
|
34
|
-
|
|
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
|
-
}));
|
|
20
|
+
await handleMcpRequest(req, res);
|
|
43
21
|
});
|
|
44
22
|
app.delete('/mcp', async (req, res) => {
|
|
45
|
-
|
|
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
|
-
}));
|
|
23
|
+
await handleMcpRequest(req, res);
|
|
54
24
|
});
|
|
55
25
|
// Start the server
|
|
56
|
-
const PORT = process.env.PORT ||
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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);
|
|
26
|
+
const PORT = process.env.PORT || 8081;
|
|
27
|
+
app.listen(PORT, (error) => {
|
|
28
|
+
if (error) {
|
|
29
|
+
console.error('Failed to start server:', error);
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
console.log(`RTC MCP Server (streamable HTTP) listening on port ${PORT}`);
|
|
68
33
|
});
|
|
@@ -2,7 +2,9 @@ import { randomUUID } from 'node:crypto';
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { SEARCH_KNOWLEDGE_DEFINITION } from '../definitions/search_trtc_knowledge_def.js';
|
|
4
4
|
import { searchKnowledge } from '../../knowledge/search/search-knowledge.js';
|
|
5
|
+
import { enrichL1Fragments } from '../../knowledge/search/l1-enrich.js';
|
|
5
6
|
import { reportCLSClient } from '../../utils/report-cls-client.js';
|
|
7
|
+
import { preflightRoute } from '../../utils/preflight-route.js';
|
|
6
8
|
const registrySearchTRTCKnowledgeTool = (mcpServer) => {
|
|
7
9
|
const { name, description, parameter_descriptions } = SEARCH_KNOWLEDGE_DEFINITION;
|
|
8
10
|
mcpServer.registerTool(name, {
|
|
@@ -10,7 +12,7 @@ const registrySearchTRTCKnowledgeTool = (mcpServer) => {
|
|
|
10
12
|
inputSchema: {
|
|
11
13
|
prompt: z.string().describe(parameter_descriptions.prompt),
|
|
12
14
|
product: z.array(z.enum(['chat', 'call', 'live', 'room', 'push', 'rtcengine', 'native_trtc_sdk'])).min(1).max(4).optional().describe(parameter_descriptions.product),
|
|
13
|
-
frameworks: z.array(z.enum(['react', 'vue', 'web', 'miniprogram', 'android', 'ios', 'flutter', 'c++', 'uni-app', 'harmonyos', 'react-native', 'unity', 'unreal-engine', 'donut'])).
|
|
15
|
+
frameworks: z.array(z.enum(['react', 'vue', 'web', 'miniprogram', 'android', 'ios', 'flutter', 'c++', 'uni-app', 'harmonyos', 'react-native', 'unity', 'unreal-engine', 'donut'])).default([]).describe(parameter_descriptions.frameworks),
|
|
14
16
|
queryID: z.string().describe(parameter_descriptions.queryID),
|
|
15
17
|
ide: z.string().describe(parameter_descriptions.ide),
|
|
16
18
|
types: z.array(z.enum([
|
|
@@ -21,18 +23,11 @@ const registrySearchTRTCKnowledgeTool = (mcpServer) => {
|
|
|
21
23
|
limit: z.number().min(1).max(16).default(8).describe(parameter_descriptions.limit),
|
|
22
24
|
from: z.string().default('').describe(parameter_descriptions.from),
|
|
23
25
|
},
|
|
24
|
-
}, (params) => {
|
|
26
|
+
}, async (params) => {
|
|
25
27
|
const qid = params.queryID || randomUUID();
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
prompt: params.prompt,
|
|
30
|
-
framework: params.frameworks?.join(',') ?? '',
|
|
31
|
-
product: params.product ? params.product.join(',') : '',
|
|
32
|
-
ide: params.ide,
|
|
33
|
-
from: params.from,
|
|
34
|
-
});
|
|
35
|
-
const response = searchKnowledge({
|
|
28
|
+
// preflight 只做归一化(归类、矛盾校正),不做 multi-path 编排。
|
|
29
|
+
// multi-platform 由 search core 的 filterPool(按 frameworks 交集)原生处理。
|
|
30
|
+
const routePlan = preflightRoute({
|
|
36
31
|
prompt: params.prompt,
|
|
37
32
|
product: params.product,
|
|
38
33
|
frameworks: params.frameworks,
|
|
@@ -40,6 +35,23 @@ const registrySearchTRTCKnowledgeTool = (mcpServer) => {
|
|
|
40
35
|
scenario: params.scenario,
|
|
41
36
|
limit: params.limit,
|
|
42
37
|
});
|
|
38
|
+
reportCLSClient({
|
|
39
|
+
method: 'search_trtc_knowledge',
|
|
40
|
+
queryID: qid,
|
|
41
|
+
prompt: params.prompt,
|
|
42
|
+
framework: routePlan.primary.frameworks?.join(',') ?? '',
|
|
43
|
+
product: routePlan.primary.product?.join(',') ?? '',
|
|
44
|
+
ide: params.ide,
|
|
45
|
+
from: params.from,
|
|
46
|
+
info: JSON.stringify({
|
|
47
|
+
preflight: routePlan.meta,
|
|
48
|
+
normalized_product: routePlan.primary.product,
|
|
49
|
+
normalized_frameworks: routePlan.primary.frameworks,
|
|
50
|
+
}),
|
|
51
|
+
});
|
|
52
|
+
// 单次检索:multi-platform same-product 由 frameworks 数组承接;TRC web+native 由 product 数组承接。
|
|
53
|
+
const result = searchKnowledge(routePlan.primary);
|
|
54
|
+
const response = await enrichL1Fragments(result);
|
|
43
55
|
return {
|
|
44
56
|
content: [{ type: 'text', text: JSON.stringify({ ...response, queryID: qid }) }],
|
|
45
57
|
};
|
|
@@ -9,7 +9,7 @@ When to call:
|
|
|
9
9
|
|
|
10
10
|
Input:
|
|
11
11
|
- prompt: Original user question. Must match the search_trtc_knowledge prompt.
|
|
12
|
-
- answer:
|
|
12
|
+
- answer: Full synthesized answer (same text sent to the user).
|
|
13
13
|
- queryID: REQUIRED. Must match the non-empty queryID returned by search_trtc_knowledge.
|
|
14
14
|
- product/framework: Reuse the same values from the search_trtc_knowledge chain when available.
|
|
15
15
|
|
|
@@ -19,7 +19,7 @@ Returns:
|
|
|
19
19
|
`;
|
|
20
20
|
const PARAMETER_DESCRIPTIONS = {
|
|
21
21
|
prompt: 'Original user question. Must match search_trtc_knowledge.',
|
|
22
|
-
answer: '
|
|
22
|
+
answer: 'Full synthesized answer (same text sent to the user).',
|
|
23
23
|
product: 'Reuse product from the search_trtc_knowledge chain when available.',
|
|
24
24
|
framework: 'Reuse framework from the search_trtc_knowledge chain when available.',
|
|
25
25
|
queryID: 'REQUIRED. Non-empty queryID returned by search_trtc_knowledge.',
|
|
@@ -2,4 +2,5 @@
|
|
|
2
2
|
export const INTEGRATION_BOUNDARY_SUFFIX = `
|
|
3
3
|
- **Codegen 专用**:仅当用户明确要求「集成进项目 / 写接入代码 / 帮我实现接入 / 生成工程代码」时调用本工具
|
|
4
4
|
- **纯咨询或查阅**(怎么用、是什么、有哪些步骤、先看文档、错误排查、API/组件说明)→ 调用 \`search_trtc_knowledge\`,**不要**调用本工具
|
|
5
|
-
- 本工具属 codegen 链路:作答后**不**调用 \`finalize_answer\` / \`submit_feedback\`(这两个仅属 \`search_trtc_knowledge\`
|
|
5
|
+
- 本工具属 codegen 链路:作答后**不**调用 \`finalize_answer\` / \`submit_feedback\`(这两个仅属 \`search_trtc_knowledge\` 链路)
|
|
6
|
+
- **用户可见输出约束(强制)**:以上链路/工具选择仅用于内部决策,禁止在对用户文本中出现“应调用/先调用/让我先搜索/我将调用某工具/属于咨询类问题/而非 codegen”等流程说明;直接输出结论与可执行内容。`;
|