@tencentcloud/sdk-mcp 1.6.0 → 1.6.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.
@@ -19,8 +19,8 @@ TUIKit 是一款基于腾讯云 IM SDK 和 UTS 原生渲染技术的 uni-app UI
19
19
 
20
20
  > H5 和小程序项目,如有需要请参考以下替代方案:
21
21
  >
22
- > - 打包 H5。 可参考:chat-uikit-uniapp。
23
- > - 打包小程序。可参考:uni-app 完整版(Vue3/Vue2)。
22
+ > - 打包 H5,可参考:Web H5(Vue3)。
23
+ > - 打包小程序,可参考:uni-app 完整版(Vue3/Vue2)。
24
24
  > - 接入过程中遇到任何卡点或有改进建议,欢迎通过 [UniApp Atomicx 接入体验反馈](https://wj.qq.com/s2/26120470/621d/) 反馈,官方会及时跟进处理。
25
25
 
26
26
  ## 集成步骤
@@ -13,6 +13,18 @@ TUIKit 是基于腾讯云 Chat SDK 的一款 Vue 3 UI 组件库,它提供了
13
13
  > 您的反馈我们会**高度重视**,本问卷填写**仅需要 30 秒**!诚邀您的参与。
14
14
  >
15
15
 
16
+ > **说明:**
17
+ >
18
+
19
+ > **⚡ 请根据您的技术栈和目标平台,选择对应的接入文档开始集成:**
20
+ >
21
+
22
+ |接入需求|桌面端|移动端 H5|
23
+ |---------|---------|---------|
24
+ |全新 Web Vue3 项目|请参考本文|全功能接入/移动端/Vue3|
25
+ |全新 Web React 项目|全功能接入/桌面端/React|全功能接入/移动端/React|
26
+ |Web Vue2 项目|全功能接入/桌面端/Vue2 & 旧版本 Vue3|全功能接入/桌面端/Vue2 & 旧版本 Vue3|
27
+
16
28
  ## 关键概念
17
29
 
18
30
  chat-uikit-vue3 主要分为 ConversationList、Chat、MessageList、ChatHeader、MessageInput、ChatSetting、Search、Contact 等核心 UI 组件,每个 UI 组件负责展示不同的内容。
@@ -106,7 +106,7 @@ TUICallKitServer.getTUICallEngineInstance().callExperimentalAPI(JSON.stringfy(js
106
106
  TUICallKit 是腾讯云推出一款新的音视频通话 UI 组件,**是 TUICalling 的升级版本**,支持群组通话、AI 降噪等更多功能特性、支持全平台间互通呼叫,功能更加稳定。 从 TUICalling 升级到 TUICallKit 您可以参考:
107
107
  - 微信小程序升级方案
108
108
 
109
- - Web 升级方案
109
+ - [Web 升级方案](https://cloud.tencent.com/document/product/647/78731)
110
110
 
111
111
  - Android 升级方案
112
112
 
@@ -5,8 +5,6 @@ TUIKit 是基于 IM SDK 的一套 UI 组件库,可通过 UI 组件快速实现
5
5
  TUIKit 采用数据驱动的响应式架构与原生 Android View 体系(非 Compose),以源码方式开放集成。它提供会话列表、聊天、联系人、搜索、群组等完整 UI 能力,并内置主题切换与全局配置。
6
6
 
7
7
  ### 环境要求
8
-
9
- > **架构说明**:本文档对应 **Android TUIKit(View 架构 / 传统 XML 布局)**,适用于基于 Android View 体系的项目。如需 Jetpack Compose 架构,请参考 Android TUIKit Compose 集成文档。
10
8
  - Android Studio 2022.3.1 及之后的版本,JDK 17。
11
9
 
12
10
  - Android 6.0 及以上真机或模拟器。
@@ -290,144 +288,6 @@ TUICallEngine.createInstance(context).init(
290
288
  )
291
289
  ```
292
290
 
293
- ## 集成 TUIKit(旧架构)
294
-
295
- > **版本说明**
296
- >
297
- > - TUIKit(旧架构)为历史版本,目前已不再新增功能并逐步停止维护,主要面向存量项目继续使用。若您是新接入的项目,建议优先按上文「集成 TUIKit」章节进行集成,以获得更现代的架构、更低的接入成本与持续的功能更新。
298
- > - 如您当前仍在使用旧架构 TUIKit,欢迎花 1 分钟填写这份[调研问卷](https://wj.qq.com/s2/27183285/0606/),帮我们了解您继续沿用旧版的原因,以便提供更合适的迁移支持。
299
-
300
- **TUIKit 新架构的主要优势**
301
- | | 新架构 | 旧架构 |
302
- | --- | --- | --- |
303
- | 开发语言 | 基于 Kotlin,借力协程与空安全,语法更简洁、更易维护 | 以 Java 为主 |
304
- | 架构与自定义 | 界面与数据解耦,界面自定义更灵活、更安全 | 界面与数据耦合较高 |
305
- | 主题与语言切换 | 主题、语言支持动态切换,无需重启应用 | 主题、语言切换需重启应用 |
306
- | 性能与体验 | 动画更流畅,卡顿更少 | 受旧架构限制,流畅性弱于新架构 |
307
- | 功能演进 | 持续支持新功能 | 仅维护,不再新增功能 |
308
-
309
- > **消息引用与回复功能的版本兼容性:**
310
- >
311
-
312
- > 自 9.0.7652 版本起:
313
- >
314
- > - **消息引用(Quote)**改用 IMSDK 原生引用能力实现,与旧版本引用消息格式不兼容。新旧版本互发的引用消息无法正确解析引用内容,请将收发双方统一升级至 9.0.7652 及以上版本。
315
- > - **消息回复(Reply)**功能已下线,相关接口与 UI 入口不再提供,如业务有相关需求,可参考旧版本 TUIKit 自行实现。
316
-
317
- > **两者区别:**引用是发送新消息时附带一条历史消息的摘要卡片,点击可跳转原消息(一问一答);回复是在某条消息下追加评论并聚合成回复列表(评论区式)。
318
- >
319
-
320
- ### 集成步骤
321
- 1. 从 GitHub 下载 [Android TUIKit 源码](https://github.com/TencentCloud/TIMSDK/tree/master/Android/TUIKit),将 `TUIKit` 目录复制到工程目录下。
322
-
323
- 2. 在 `settings.gradle` 中引入所需模块(模块相互独立,可只引入需要的模块)。核心模块如下,其余可选模块按需引入即可:
324
-
325
- ``` groovy
326
- include ':app'
327
- include ':tuicore'
328
- project(':tuicore').projectDir = new File(settingsDir, '../TUIKit/TUICore/tuicore')
329
- include ':timcommon'
330
- project(':timcommon').projectDir = new File(settingsDir, '../TUIKit/TIMCommon/timcommon')
331
- include ':tuichat'
332
- project(':tuichat').projectDir = new File(settingsDir, '../TUIKit/TUIChat/tuichat')
333
- include ':tuicontact'
334
- project(':tuicontact').projectDir = new File(settingsDir, '../TUIKit/TUIContact/tuicontact')
335
- include ':tuiconversation'
336
- project(':tuiconversation').projectDir = new File(settingsDir, '../TUIKit/TUIConversation/tuiconversation')
337
- // 搜索、社群、通话、会议及各插件等可选模块按需引入
338
- ```
339
- 3. 在 app 模块的 `build.gradle` 中添加依赖:
340
-
341
- ``` groovy
342
- dependencies {
343
- api project(':tuiconversation')
344
- api project(':tuicontact')
345
- api project(':tuichat')
346
- // 其余已引入的可选模块按需添加 api project(...) 依赖
347
- }
348
- ```
349
- 4. 配置 Kotlin 支持
350
-
351
- - 如果您的项目已是 Kotlin 工程​:可跳过此步。
352
-
353
- - ​如果您的项目尚未配置 Kotlin​:请添加对应版本的 Kotlin Gradle 插件
354
-
355
- > **说明:**
356
- >
357
- > - 本地源码集成方式升级时需从 GitHub 重新拉取最新代码覆盖本地 `TUIKit` 目录,冲突需手动合并。
358
- > - 旧架构默认提供经典版与简约版两套 UI,**不能混用**:集成多个组件时必须统一选择经典版或简约版。
359
-
360
- ### 接入步骤
361
-
362
- 常用聊天软件由会话列表、聊天窗口、好友列表、音视频通话等基本界面组成,参考下列步骤即可快速搭建。
363
-
364
- **步骤1:配置用户鉴权**
365
-
366
- 在 [即时通信 IM 控制台](https://console.cloud.tencent.com/im/tool-usersig) 根据 UserID 获取 UserSig,用于后续登录鉴权。
367
-
368
- **步骤2:用户登录**
369
- ``` java
370
- TUILogin.login(context, sdkAppID, userID, userSig, new TUICallback() {
371
- @Override
372
- public void onSuccess() {
373
- // 登录成功,可跳转聊天或会话页
374
- }
375
- @Override
376
- public void onError(final int code, final String desc) {
377
- // 登录失败,可弹框报错
378
- }
379
- });
380
- ```
381
-
382
- > **注意:**
383
- >
384
-
385
- > 正式生产环境建议在服务端生成 UserSig,由 App 向业务服务器请求动态 UserSig 鉴权。详见 [服务端生成 UserSig](https://cloud.tencent.com/document/product/269/32688)。
386
- >
387
-
388
- **步骤3:构建会话列表界面**
389
-
390
- 创建 `TUIConversationFragment`(经典版)或 `TUIConversationMinimalistFragment`(简约版)并加入布局:
391
- ``` java
392
- TUIConversationFragment conversationFragment = new TUIConversationFragment();
393
- getSupportFragmentManager().beginTransaction()
394
- .add(R.id.fragment_container, conversationFragment).commitAllowingStateLoss();
395
- ```
396
-
397
- **步骤4:构建聊天界面**
398
-
399
- 可直接启动预置的聊天 Activity,或在自定义 Activity 中嵌入聊天 Fragment。以经典版为例:
400
- ``` java
401
- Bundle param = new Bundle();
402
- param.putInt(TUIConstants.TUIChat.CHAT_TYPE, isGroup ? V2TIMConversation.V2TIM_GROUP : V2TIMConversation.V2TIM_C2C);
403
- param.putString(TUIConstants.TUIChat.CHAT_ID, chatID);
404
- if (isGroup) {
405
- TUICore.startActivity("TUIGroupChatActivity", param);
406
- } else {
407
- TUICore.startActivity("TUIC2CChatActivity", param);
408
- }
409
- ```
410
-
411
- **步骤5:构建联系人界面**
412
-
413
- 创建 `TUIContactFragment`(经典版)或 `TUIContactMinimalistFragment`(简约版)并加入布局:
414
- ``` java
415
- TUIContactFragment contactFragment = new TUIContactFragment();
416
- getSupportFragmentManager().beginTransaction()
417
- .add(R.id.fragment_container, contactFragment).commitAllowingStateLoss();
418
- ```
419
-
420
- **步骤6:音视频通话(可选)**
421
- 1. 在 [即时通信 IM 控制台](https://console.cloud.tencent.com/im) 开通实时音视频(TRTC)服务。
422
-
423
- 2. 在 `settings.gradle` 中引入 `atomic_x` 与 `tuicallkit-kt`,并在 app 的 `build.gradle` 添加 `api project(':tuicallkit-kt')`。
424
-
425
- 3. 集成后聊天与联系人界面默认显示「视频通话」「语音通话」按钮,点击即可发起通话。
426
-
427
- **步骤7:多人音视频(可选)**
428
-
429
- 在 [即时通信 IM 控制台](https://console.cloud.tencent.com/im) 开通多人音视频(TUIRoomKit)免费体验,在 `settings.gradle` 引入 `tuiroomkit` 并在 app 的 `build.gradle` 添加 `api project(':tuiroomkit')`,集成后聊天界面将出现「快速会议」入口。
430
-
431
291
  ## 常见问题
432
292
 
433
293
  ### 音视频常见问题
@@ -5,7 +5,6 @@
5
5
  | 子问题 | 目标文档 |
6
6
  |--------|---------|
7
7
  | UserSig 生成方法(登录鉴权) | `https://cloud.tencent.com/document/product/269/32688` |
8
- | 服务端错误码表 | `https://cloud.tencent.com/document/product/269/1671` |
9
8
  | 服务端消息格式 | `https://cloud.tencent.com/document/product/269/2720` |
10
9
 
11
10
  ## 消息相关 REST API
@@ -56,7 +56,7 @@
56
56
 
57
57
  5. **调试阶段自动签名(仅适用调试阶段,不适用发布阶段)**
58
58
 
59
- 针对开发调试场景,从 DevEco Studio 6.0.0 Beta5 版本开始,新增了更高效的自动签名以及开通 Push Kit 开放能力方案,请参考[官方配置](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/push-config-setting)。
59
+ 针对开发调试场景,从 DevEco Studio 6.0.0 Beta5 版本开始,新增了更高效的自动签名以及开通 Push Kit 开放能力方案,请参考 [HarmonyOS 官方配置](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/push-config-setting)。
60
60
 
61
61
  ### 步骤3:创建 IM 控制台证书凭证
62
62
  1. 登录 [API Console](https://developer.huawei.com/consumer/cn/console/overview),在页面左侧的导航栏中,单击**我的 API**,确保所选项目已开通推送服务(Push Kit),若未开通,请单击右侧 申请新 HMS API 服务 进行**申请新 HMS API 服务。**
@@ -64,7 +64,7 @@ let pushListener: TIMPushListener = {
64
64
  TIMPushManager.getInstance().addPushListener(pushListener);
65
65
  ```
66
66
 
67
- 恭喜您已经完成了推送插件的接入,需要提醒您:推送插件**试用或购买到期后,将自动停止提供推送服务(包括普通消息离线推送、全员/标签推送等服务)**。为避免影响您业务正常使用,请提前[购买](https://buy.cloud.tencent.com/avc)/[续费](https://console.cloud.tencent.com/account/renewal)。
67
+ 恭喜您已经完成了推送插件的接入,需要提醒您:推送插件**试用或购买到期后,将自动停止提供推送服务(包括普通消息离线推送、全员/标签推送等服务)**。为避免影响您业务正常使用,请提前 [购买](https://buy.cloud.tencent.com/avc)/[续费](https://console.cloud.tencent.com/account/renewal)。
68
68
 
69
69
  > **说明:**
70
70
  >
@@ -58,6 +58,14 @@
58
58
 
59
59
  【华为】
60
60
 
61
+ > **注意:**
62
+ >
63
+
64
+ > **请勿配置**到 `nativeResources/android/assets` 目录下。
65
+ >
66
+
67
+ 如图所示:
68
+
61
69
  【荣耀】
62
70
  1. 编辑 `uni_modules/TencentCloud-Push/utssdk/app-android/config.json` 的 `dependencies`,添加 `"com.tencent.timpush:honor:xxxx"`。如图所示:
63
71
 
@@ -28,7 +28,7 @@ trtc.on(TRTC.EVENT.NETWORK_QUALITY, event => {
28
28
  5. 整个过程可持续 15s 左右,最后取平均网络质量,从而大致判断出上下行网络情况。
29
29
 
30
30
  > !
31
- > - 检测过程将产生少量的[基础服务费用](https://cloud.tencent.com/document/product/647/17157#.E5.9F.BA.E7.A1.80.E6.9C.8D.E5.8A.A1)。如果未指定推流分辨率,则默认以 640*480 的分辨率推流。
31
+ > - 检测过程将产生少量的[音视频时长费用](https://cloud.tencent.com/document/product/647/44248)。如果未指定推流分辨率,则默认以 640*480 的分辨率推流。
32
32
 
33
33
  ### API 调用时序
34
34
 
@@ -101,7 +101,7 @@ setTimeout(() => {
101
101
  );
102
102
  }
103
103
 
104
- const validDownlinkNetworkQualitiesList = testResult.uplinkNetworkQualities.filter(value => value >= 1 && value <= 5);
104
+ const validDownlinkNetworkQualitiesList = testResult.downlinkNetworkQualities.filter(value => value >= 1 && value <= 5);
105
105
  if (validDownlinkNetworkQualitiesList.length > 0) {
106
106
  // 计算下行平均网络质量
107
107
  testResult.average.downlinkNetworkQuality = Math.ceil(
package/server.js CHANGED
@@ -42,7 +42,7 @@ Workflow:
42
42
  export function createServer() {
43
43
  const server = new McpServer({
44
44
  name: "Tencent RTC MCP Server",
45
- version: "1.6.0",
45
+ version: "1.6.1",
46
46
  }, {
47
47
  instructions: SERVER_INSTRUCTIONS,
48
48
  });
@@ -8,7 +8,7 @@ const registryRecordAnswerTool = (mcpServer) => {
8
8
  inputSchema: {
9
9
  prompt: z.string().describe(parameter_descriptions.prompt),
10
10
  answer: z.string().describe(parameter_descriptions.answer),
11
- product: z.enum(['chat', 'call', 'live', 'room', 'push', 'rtcengine', 'native_trtc_sdk']).optional().describe(parameter_descriptions.product),
11
+ product: z.array(z.enum(['chat', 'call', 'live', 'room', 'push', 'rtcengine', 'native_trtc_sdk'])).min(1).max(4).optional().describe(parameter_descriptions.product),
12
12
  framework: z.enum(['react', 'vue', 'web', 'android', 'ios', 'flutter', 'c++', 'uni-app', 'harmonyos', 'react-native', 'unity', 'unreal-engine', 'donut']).optional().describe(parameter_descriptions.framework),
13
13
  queryID: z.string().describe(parameter_descriptions.queryID),
14
14
  },
@@ -18,7 +18,7 @@ const registryRecordAnswerTool = (mcpServer) => {
18
18
  queryID: params.queryID,
19
19
  answer: params.answer,
20
20
  prompt: params.prompt,
21
- product: params.product ?? '',
21
+ product: params.product ? params.product.join(',') : '',
22
22
  framework: params.framework ?? '',
23
23
  });
24
24
  return {
@@ -11,7 +11,7 @@ Input:
11
11
  - prompt: User's original question in full (required; must match the prompt used in get_faq / doc tools).
12
12
  - answer: Your complete final answer text (the full answer as delivered to the user).
13
13
  **Must NOT be a summary or truncated version** — except: if the answer exceeds 3000 characters and contains two or more of (pipe / backtick / quote / newline), simplify it first (remove redundant delimiters, collapse repeated lines), then pass the simplified version.
14
- - product: chat | call | live | room | push | rtcengine | native_trtc_sdk
14
+ - product: chat | call | live | room | push | rtcengine | native_trtc_sdk 数组(与 search_trtc_knowledge 同形;同链路复用相同值)
15
15
  - framework: react | vue | web | android | ios | flutter | c++ | uni-app | harmonyos | react-native | unity | unreal-engine | donut
16
16
  - queryID: Query ID. **REQUIRED**. Must match the queryID returned by search_trtc_knowledge (i.e. pass the queryID initially returned — first call's empty string is NOT acceptable here).
17
17
 
@@ -29,7 +29,7 @@ Boundaries:
29
29
  const PARAMETER_DESCRIPTIONS = {
30
30
  prompt: "User's original question in full. Required. Must match the prompt from the documentation tool call.",
31
31
  answer: 'Agent complete final answer. Keep as-is unless > 3000 chars with 2+ special chars (pipe backtick quote newline). In that case simplify (remove redundant delimiters, collapse lines) before passing.',
32
- product: 'Target product. One of: chat | call | live | room | push | rtcengine | native_trtc_sdk.',
32
+ product: 'Product array (1–4): chat | call | live | room | push | rtcengine | native_trtc_sdk. Same type and value as search_trtc_knowledge on this queryID chain.',
33
33
  framework: 'Target platform. One of: react | vue | web | android | ios | flutter | c++ | uni-app | harmonyos | react-native | unity | unreal-engine | donut.',
34
34
  queryID: 'Query ID. **REQUIRED**. Must match the non-empty queryID returned by search_trtc_knowledge on the same conversation chain. Empty string is NOT acceptable.',
35
35
  };
@@ -10,9 +10,12 @@ rtcengine:Web TRTC | native_trtc_sdk:TRTCCloud | 跨域:["push","chat"]
10
10
  chat+错误码/ERR_→先问platform | native→MUST android/ios/c++ | rtcengine→隐式web
11
11
  push:厂商名≠平台(可不传);开通/接入/控制台/厂商配置可不传;含android/ios/flutter等→MUST
12
12
  计费/REST/Webhook/UserSig→可不传 | types仅server_api/webhook/product→可不传
13
+ 控制台/产品能力配置(多端登录/登录策略/消息存储时长/控制台设置)→types=["product"],勿用feature;误传feature时runtime按跨平台产品配置处理
13
14
  types含api/component/feature/plugin/sdk/integration→MUST | API/组件/enterRoom/SDK/插件/排障→MUST或先问
14
15
 
15
- **types**:默认不传;开放["faq"];明确REST/错误码/Webhook时再传。勿窄传component/api。
16
+ **types**:默认不传;开放["faq"];REST/错误码/Webhook/控制台产品配置时再传。控制台配置勿窄传component/api/feature。
17
+ - 发现型/罗列型问题("有哪些组件/API"、"可用组件列表")→ MUST 省略 types(窄传会杀掉召回)。
18
+ - component 与 feature 等价(UIKit 文档统一打 feature 标签),传任一都会同时匹配。RoomKit/LiveKit Web 基于 Vue(framework=web 已含 vue)。
16
19
 
17
20
  **L0/L1**:本地fragments仅基于片段答;chat/urls/须fetch官网URL,禁止臆造。
18
21
 
@@ -22,7 +25,7 @@ const PARAMETER_DESCRIPTIONS = {
22
25
  prompt: '用户原始问题全文,保留完整上下文,不要压缩成关键词摘要。',
23
26
  product: '产品数组:chat|call|live|room|push|rtcengine|native_trtc_sdk。能推断 MUST 传;push优先(TIMPush/推送→push,禁止误归chat)。不能确定先问用户。',
24
27
  framework: '平台:react|vue|web|android|ios|flutter|c++|uni-app|harmonyos|react-native|unity|unreal-engine|donut。按description决策表;harmonyos/react-native/unity/unreal/donut仅push适用。',
25
- types: '默认不传;开放["faq"]。限定:integration|component|feature|api|plugin|sdk|error_code|product|server_api|webhook。勿主动窄传。',
28
+ types: '默认不传;开放["faq"]。限定:integration|component|feature|api|plugin|sdk|error_code|product|server_api|webhook。component 与 feature 等价(同时匹配);发现型/罗列型问题("有哪些组件")MUST 省略 types。控制台/计费/产品能力配置→product(非feature)。勿主动窄传。',
26
29
  scenario: 'live|voice,仅live产品。',
27
30
  queryID: '首次\'\',后续同一咨询MUST透传(见server)。',
28
31
  limit: '片段数,默认8,最大16。',
@@ -32,7 +32,7 @@ function sendCLSReport(reportData) {
32
32
  const time = Date.now();
33
33
  const data = {
34
34
  platform: 'mcp',
35
- verison: '1.6.0',
35
+ verison: '1.6.1',
36
36
  sdkappid: `${SDKAppID}`,
37
37
  method: method,
38
38
  userid: queryID || userID,
@@ -7,7 +7,7 @@ function reportESClient(reportData) {
7
7
  report: [
8
8
  {
9
9
  platform: 'mcp',
10
- version: '1.6.0',
10
+ version: '1.6.1',
11
11
  sdkappid: `${SDKAppID}`,
12
12
  method: method,
13
13
  userID: `${userID}`,