@tencentcloud/sdk-mcp 1.7.4 → 1.7.6

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 (98) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +57 -55
  3. package/knowledge/chunker.js +1 -0
  4. package/knowledge/path-meta.js +12 -1
  5. package/knowledge/search/search-core.js +22 -4
  6. package/knowledge/search/search-knowledge.js +1 -1
  7. package/package.json +1 -1
  8. package/resource/index/manifest.json +1 -1
  9. package/resource/integration/callkit/preset/android/integration.md +0 -4
  10. package/resource/integration/callkit/preset/flutter/integration.md +4 -8
  11. package/resource/integration/callkit/preset/ios/integration.md +2 -6
  12. package/resource/integration/callkit/preset/react/integration.md +2 -2
  13. package/resource/integration/callkit/preset/vue/integration.md +9 -9
  14. package/resource/integration/chat/preset/android/integration.md +2 -2
  15. package/resource/integration/chat/preset/flutter/integration.md +2 -2
  16. package/resource/integration/chat/preset/ios/integration.md +10 -10
  17. package/resource/integration/chat/preset/react/integration.md +0 -5
  18. package/resource/integration/chat/preset/uni-app/integration.md +0 -4
  19. package/resource/integration/chat/preset/vue/integration.md +0 -5
  20. package/resource/integration/livekit/preset/live/android/live-host-integration.md +0 -4
  21. package/resource/integration/livekit/preset/live/ios/live-host-integration.md +0 -4
  22. package/resource/integration/livekit/preset/live/ios/prepare-integration.md +3 -3
  23. package/resource/integration/livekit/preset/live/vue/live-pusher-integration.md +0 -4
  24. package/resource/integration/roomkit/preset/vue/integration.md +152 -439
  25. package/resource/knowledge/callkit/best-practice/android/video-chat-dating.md +8 -8
  26. package/resource/knowledge/callkit/core-sdk/android/answer-call.md +2 -2
  27. package/resource/knowledge/callkit/core-sdk/android/make-call.md +5 -5
  28. package/resource/knowledge/callkit/core-sdk/flutter/answer-call.md +7 -7
  29. package/resource/knowledge/callkit/core-sdk/flutter/make-call.md +10 -10
  30. package/resource/knowledge/callkit/core-sdk/ios/answer-call.md +9 -9
  31. package/resource/knowledge/callkit/core-sdk/ios/make-call.md +7 -8
  32. package/resource/knowledge/callkit/core-sdk/uni-app/answer-call.md +2 -2
  33. package/resource/knowledge/callkit/core-sdk/uni-app/make-call.md +2 -2
  34. package/resource/knowledge/callkit/faq/android.md +4 -4
  35. package/resource/knowledge/callkit/faq/common.md +4 -4
  36. package/resource/knowledge/callkit/preset/harmonyos/integration.md +0 -4
  37. package/resource/knowledge/callkit/preset/uni-app/integration.md +10 -10
  38. package/resource/knowledge/chat/preset/android-view/integration.md +2 -6
  39. package/resource/knowledge/chat/preset/ios-uikit/integration.md +43 -40
  40. package/resource/knowledge/chat/preset/react/h5/integration.md +0 -5
  41. package/resource/knowledge/chat/preset/vue/features/message-input.md +4 -4
  42. package/resource/knowledge/chat/preset/vue/h5/integration.md +0 -5
  43. package/resource/knowledge/livekit/core-sdk/features/android/audience-list.md +3 -3
  44. package/resource/knowledge/livekit/core-sdk/features/android/live-list.md +3 -3
  45. package/resource/knowledge/livekit/core-sdk/features/flutter/audience-list.md +3 -3
  46. package/resource/knowledge/livekit/core-sdk/features/flutter/live-list.md +3 -3
  47. package/resource/knowledge/livekit/core-sdk/features/ios/audience-list.md +3 -3
  48. package/resource/knowledge/livekit/core-sdk/features/ios/live-list.md +3 -3
  49. package/resource/knowledge/livekit/core-sdk/features/uni-app/audience-list.md +3 -3
  50. package/resource/knowledge/livekit/core-sdk/features/uni-app/live-list.md +3 -3
  51. package/resource/knowledge/livekit/core-sdk/live/android/host-interaction.md +2 -2
  52. package/resource/knowledge/livekit/core-sdk/live/flutter/host-interaction.md +2 -2
  53. package/resource/knowledge/livekit/core-sdk/live/flutter/integration.md +2 -2
  54. package/resource/knowledge/livekit/core-sdk/live/ios/host-interaction.md +2 -2
  55. package/resource/knowledge/livekit/core-sdk/live/uni-app/co-guest-interaction.md +12 -12
  56. package/resource/knowledge/livekit/core-sdk/live/uni-app/host-interaction.md +4 -4
  57. package/resource/knowledge/livekit/core-sdk/live/uni-app/integration.md +9 -9
  58. package/resource/knowledge/livekit/core-sdk/voice/android/host-interaction.md +2 -2
  59. package/resource/knowledge/livekit/core-sdk/voice/ios/host-interaction.md +2 -2
  60. package/resource/knowledge/livekit/core-sdk/voice/uni-app/integration.md +5 -5
  61. package/resource/knowledge/push/config/donut.md +3 -3
  62. package/resource/knowledge/push/config/harmonyos.md +12 -12
  63. package/resource/knowledge/push/config/ios.md +2 -2
  64. package/resource/knowledge/push/integration/android.md +91 -1112
  65. package/resource/knowledge/push/integration/donut.md +8 -8
  66. package/resource/knowledge/push/integration/ios.md +9 -35
  67. package/resource/knowledge/push/integration/unity.md +3 -3
  68. package/resource/knowledge/push/integration/unreal-engine.md +7 -7
  69. package/resource/knowledge/roomkit/core-sdk/android/room-state.md +3 -3
  70. package/resource/knowledge/roomkit/core-sdk/android/schedule-room.md +9 -9
  71. package/resource/knowledge/roomkit/core-sdk/flutter/room-state.md +3 -3
  72. package/resource/knowledge/roomkit/core-sdk/ios/room-state.md +3 -3
  73. package/resource/knowledge/roomkit/core-sdk/vue/recording.md +3 -3
  74. package/resource/knowledge/roomkit/core-sdk/vue/virtual-background.md +3 -3
  75. package/resource/knowledge/roomkit/preset/ios/integration.md +3 -3
  76. package/resource/knowledge/roomkit/preset/uniapp-app/integration.md +52 -10
  77. package/server.js +42 -34
  78. package/tools/common/get_usersig.js +1 -1
  79. package/tools/common/present_framework_choice.js +5 -5
  80. package/tools/definitions/finalize_answer_def.js +17 -16
  81. package/tools/definitions/get_native_call_uikit_integration_def.js +25 -16
  82. package/tools/definitions/get_native_callkit_core_integration_def.js +37 -26
  83. package/tools/definitions/get_native_chat_uikit_integration_def.js +22 -13
  84. package/tools/definitions/get_native_live_uikit_integration_def.js +30 -21
  85. package/tools/definitions/get_native_livekit_core_integration_def.js +25 -16
  86. package/tools/definitions/get_usersig_def.js +20 -13
  87. package/tools/definitions/get_web_call_uikit_integration_def.js +21 -12
  88. package/tools/definitions/get_web_chat_uikit_integration_def.js +22 -13
  89. package/tools/definitions/get_web_live_uikit_integration_def.js +21 -12
  90. package/tools/definitions/get_web_room_core_integration_def.js +29 -20
  91. package/tools/definitions/get_web_room_uikit_integration_def.js +21 -12
  92. package/tools/definitions/integration-boundary.js +9 -5
  93. package/tools/definitions/present_framework_choice_def.js +21 -21
  94. package/tools/definitions/search_trtc_knowledge_def.js +48 -26
  95. package/tools/definitions/submit_feedback_def.js +18 -14
  96. package/utils/preflight-route.js +203 -185
  97. package/utils/report-cls-client.js +1 -1
  98. package/utils/report-es-client.js +1 -1
@@ -1,40 +1,49 @@
1
1
  import { INTEGRATION_BOUNDARY_SUFFIX } from './integration-boundary.js';
2
2
  const TOOL_DESCRIPTION = `
3
- 用途:
4
- 返回 Web RoomKit Atomicx Core 基础集成文档,适合基于 Atomicx API 自实现会议室(无预制 UI),完成登录、房间状态与设备能力接入。
3
+ Purpose:
4
+ Return Web RoomKit Atomicx Core integration docs for explicit codegen implementation.
5
5
 
6
- 典型适用问题(共用触发词,可能同时命中 'get_web_room_uikit_integration' preset 工具):
6
+ When to call (MUST):
7
+ - User explicitly asks for runnable project integration code or concrete implementation steps.
8
+
9
+ When NOT to call:
10
+ - Pure feature Q&A, documentation lookup, API/component explanation, troubleshooting.
11
+
12
+ Scope details:
13
+ Returns Web RoomKit Atomicx Core integration documentation for custom meeting-room implementation (no preset UI), including login, room state, and device capabilities.
14
+
15
+ Common trigger lexicon (may overlap with 'get_web_room_uikit_integration' preset tool):
7
16
  Web RoomKit, TUIRoomKit, Atomicx, Vue, 集成 RoomKit, 接入会议, 会议室, meeting, room
8
- 命中以上共用触发词时,请**先主动追问用户**:"您希望使用预制 UI 快速集成(TUIRoomUIKit preset),还是基于 Atomicx API 自实现会议室?" 用户选择"自实现/Atomicx/Core"后再调用本工具;选择"预制/preset/默认 UI"则调用 'get_web_room_uikit_integration'。
17
+ When only common triggers are hit, ask a clarification first: "Do you prefer preset UI (TUIRoomUIKit) or custom room implementation with Atomicx API?" Call this tool only after user chooses custom/Atomicx/Core; otherwise call 'get_web_room_uikit_integration'.
9
18
 
10
- 典型适用问题(Core 专属触发词,仅命中本工具,无需追问,直接调用):
19
+ Core-only trigger lexicon (direct call, no clarification needed):
11
20
  Atomicx API, 自实现会议室, 自定义会议 UI, 不用预制 UI, useRoomState, useDeviceState, useLoginState, room-state, device-state, device-detection
12
21
 
13
- 输入:
22
+ Inputs:
14
23
  - framework: vue
15
24
  - goals: room-state | device-detection | device-state
16
- - prompt: 用户的原始问题全文,保留完整上下文,不要压缩成关键词摘要
25
+ - prompt: Original user question. Keep full context; do not compress into keyword summary.
17
26
 
18
- 返回:
19
- - content: [{ type: 'text', text: 文档正文或说明文本 }]
27
+ Outputs:
28
+ - content: [{ type: 'text', text: Documentation body or explanatory text }]
20
29
 
21
- 边界:
22
- - 当用户未明确平台或框架时,应先调用 'present_framework_choice'
23
- - 面向 Atomicx Core 基础接入(登录 + room-state / device 模块),不负责预制 UI 页面模板
24
- - 屏幕分享、虚拟背景、预约会议等扩展模块 → 调用 \`search_trtc_knowledge(types=[feature])\`
25
- - **登录约束**:必须调用 \`get_usersig\` 获取 UserSig,再使用 \`useLoginState.login\` 登录;**禁止**在项目内实现 UserSig 生成(如 GenerateTestUserSig)
30
+ Boundaries:
31
+ - If platform/framework is not specified, call 'present_framework_choice' first.
32
+ - Targets Atomicx Core baseline integration (login + room-state/device modules), not preset UI page templates.
33
+ - For extended modules such as screen sharing, virtual background, or scheduled meeting, call \`search_trtc_knowledge(types=[feature])\`.
34
+ - **Login constraint**: MUST call \`get_usersig\` to obtain UserSig, then use \`useLoginState.login\`; DO NOT implement local UserSig generation in project (e.g. GenerateTestUserSig).
26
35
  ${INTEGRATION_BOUNDARY_SUFFIX}
27
36
  `;
28
37
  const PARAMETER_DESCRIPTIONS = {
29
- framework: '目标框架。参数名固定为 framework,禁止传 platform。固定值:vue。',
30
- goals: '功能列表。可选值:room-state(房间状态)| device-detection(设备检测)| device-state(设备状态)。',
31
- prompt: '用户的原始问题全文,保留完整上下文,不要压缩成关键词摘要。',
38
+ framework: 'Target framework. Parameter name must be framework (not platform). Fixed value: vue.',
39
+ goals: 'Goals list. Allowed values: room-state | device-detection | device-state.',
40
+ prompt: 'Original user question. Keep full context; do not compress into keyword summary.',
32
41
  };
33
- const ANTI_HALLUCINATION_HEADER = `本文档基于 Atomicx Core API 自实现方案,严禁照搬 TUIRoomUIKit 预制 UI 组件。\n\n`;
42
+ const ANTI_HALLUCINATION_HEADER = `This document is based on Atomicx Core API custom implementation. DO NOT copy preset TUIRoomUIKit UI components as-is.\n\n`;
34
43
  const ANTI_HALLUCINATION_CONSTRAINT = `
35
44
  ---
36
- 【AI 代码生成约束 - Atomicx Core 方案】
37
- 请严格基于文档内容生成代码。登录流程 MUST 调用 get_usersig 工具获取 UserSig,再使用 useLoginState.login;禁止在项目中实现 GenerateTestUserSig 或本地 UserSig 签发逻辑。
45
+ [AI Code Generation Constraints - Atomicx Core]
46
+ Generate code strictly based on documented content. Login flow MUST call get_usersig to obtain UserSig, then use useLoginState.login. DO NOT implement GenerateTestUserSig or local UserSig signing logic in project.
38
47
  ---
39
48
  `;
40
49
  export const GET_WEB_ROOM_CORE_INTEGRATION_DEFINITION = {
@@ -1,26 +1,35 @@
1
1
  import { INTEGRATION_BOUNDARY_SUFFIX } from './integration-boundary.js';
2
2
  const TOOL_DESCRIPTION = `
3
- 用途:
4
- 返回 Web Room UIKit 预制 UI 集成文档,适合接入会议入口页、会议室页面和默认会议应用方案。
3
+ Purpose:
4
+ Return Web Room UIKit preset integration docs for explicit codegen implementation.
5
5
 
6
- 典型适用问题:
6
+ When to call (MUST):
7
+ - User explicitly asks for runnable project integration code or concrete implementation steps.
8
+
9
+ When NOT to call:
10
+ - Pure feature Q&A, documentation lookup, API/component explanation, troubleshooting.
11
+
12
+ Scope details:
13
+ Returns Web Room UIKit preset integration documentation for meeting entry page, meeting room page, and default meeting app setup.
14
+
15
+ Common trigger lexicon:
7
16
  Web Room UIKit, TUIRoomUIKit, Atomicx, Vue, 预制 UI, 默认会议方案, meeting app, home.vue, room.vue, 会议入口页, 会议室页面, H5 会议, PC 会议, 集成
8
17
 
9
- 输入:
18
+ Inputs:
10
19
  - framework: vue
11
- - prompt: 用户的原始问题全文,保留完整上下文,不要压缩成关键词摘要
20
+ - prompt: Original user question. Keep full context; do not compress into keyword summary.
12
21
 
13
- 返回:
14
- - content: [{ type: 'text', text: 文档正文或说明文本 }]
22
+ Outputs:
23
+ - content: [{ type: 'text', text: Documentation body or explanatory text }]
15
24
 
16
- 边界:
17
- - 面向预制 UI 主接入,不负责 Atomicx API 或单功能模块的自定义实现细节
18
- - 用户要自实现 Atomicx 会议室 → 调用 'get_web_room_core_integration'
25
+ Boundaries:
26
+ - Targets preset UI primary integration, not Atomicx API-level or single-module custom implementation details.
27
+ - If user wants custom Atomicx meeting-room implementation, call 'get_web_room_core_integration'.
19
28
  ${INTEGRATION_BOUNDARY_SUFFIX}
20
29
  `;
21
30
  const PARAMETER_DESCRIPTIONS = {
22
- framework: '目标框架。参数名固定为 framework,禁止传 platform。固定值:vue。',
23
- prompt: '用户的原始问题全文,保留完整上下文,不要压缩成关键词摘要。',
31
+ framework: 'Target framework. Parameter name must be framework (not platform). Fixed value: vue.',
32
+ prompt: 'Original user question. Keep full context; do not compress into keyword summary.',
24
33
  };
25
34
  export const GET_WEB_ROOM_UIKIT_INTEGRATION_DEFINITION = {
26
35
  name: 'get_web_room_uikit_integration',
@@ -1,6 +1,10 @@
1
- /** Phase 1 统一追加到 9× integration 工具「边界」段末尾 */
1
+ /** Shared Phase B boundary suffix for all get_* integration tools */
2
2
  export const INTEGRATION_BOUNDARY_SUFFIX = `
3
- - **Codegen 专用**:仅当用户明确要求「集成进项目 / 写接入代码 / 帮我实现接入 / 生成工程代码」时调用本工具
4
- - **纯咨询或查阅**(怎么用、是什么、有哪些步骤、先看文档、错误排查、API/组件说明)→ 调用 \`search_trtc_knowledge\`,**不要**调用本工具
5
- - 本工具属 codegen 链路:作答后**不**调用 \`finalize_answer\` / \`submit_feedback\`(这两个仅属 \`search_trtc_knowledge\` 链路)
6
- - **用户可见输出约束(强制)**:以上链路/工具选择仅用于内部决策,禁止在对用户文本中出现“应调用/先调用/让我先搜索/我将调用某工具/属于咨询类问题/而非 codegen”等流程说明;直接输出结论与可执行内容。`;
3
+ - **Codegen only (MUST)**: Call this tool only when user explicitly asks for runnable integration/code implementation (e.g. “接入到项目”, “写接入代码”, “直接给我可运行代码”).
4
+ - **When NOT to call**: For pure Q&A, documentation lookup, API/component explanation, error troubleshooting, or “先了解方案/步骤” requests, call \`search_trtc_knowledge\` instead.
5
+ - **Workflow split**: This tool belongs to codegen flow. After responding with integration/code content, do **NOT** call \`finalize_answer\` or \`submit_feedback\`.
6
+ - **User-visible output rule (MUST)**: Tool routing decisions are internal. Do not expose process text like “应调用/先调用/让我先搜索/我将调用某工具/属于咨询类问题/而非 codegen”. Output only the final actionable content.
7
+ - **Few-shot boundary**:
8
+ - Positive: “用 Vue 把 Chat UIKit 接到我现有项目,给可运行代码” -> call corresponding \`get_*_integration\`
9
+ - Negative: “Chat UIKit 有哪些能力/组件?” -> call \`search_trtc_knowledge\`
10
+ `;
@@ -1,36 +1,36 @@
1
1
  const TOOL_DESCRIPTION = `
2
- 用途:
3
- 当用户未明确平台或框架时,先引导用户从受支持选项中明确选择,再继续调用 \`search_trtc_knowledge\` 或对应的 integration 工具。
2
+ Purpose:
3
+ Collect platform/framework choice from user when the question requires client-side platform context.
4
4
 
5
- 典型适用问题:
6
- 平台选择, 框架选择, 先选平台, 先选框架, 未指定平台, 未指定框架, 获取集成指南, 获取接入文档, 快速开始, 查询 API, 查询组件, 查询功能点, 怎么设置, 怎么配置, Chat UIKit 集成, Call UIKit 集成, Live UIKit 集成, Room UIKit 集成, CallKit API, LiveKit API, WebRTC SDK 集成, Native TRTC SDK 集成, react, vue, web, miniprogram, 小程序, uni-app, flutter, android, ios, webrtc
5
+ When to call (MUST):
6
+ - User asks API/component/feature/client troubleshooting/integration guidance but does not specify platform.
7
+ - search_trtc_knowledge returns needs_framework.
8
+ - User requests explicit codegen/integration but platform is not specified.
7
9
 
8
- 触发示例:
9
- - 获取 Chat UIKit 集成指南(未说明 React/Vue)
10
- - CallKit 来电铃声怎么设置(未说明平台)
11
- - Chat UIKit 某个组件怎么用(未说明 Web/Native)
12
- - 虚拟背景怎么开(未说明产品或平台)
10
+ When NOT to call:
11
+ - Cross-platform product topics: pricing, product package, console-level product config.
12
+ - Server-side topics: REST API, webhook, UserSig principle.
13
+ - Platform is already explicitly provided by user.
13
14
 
14
- 输入:
15
- - product: chat | call | live | room | rtcengine | native_trtc_sdk | push
15
+ Boundary:
16
+ - This tool only collects platform/framework; it does NOT return documentation content.
17
+ - After user chooses platform:
18
+ - Q&A / troubleshooting / doc lookup -> call search_trtc_knowledge with product + frameworks.
19
+ - Explicit codegen request -> call corresponding get_*_integration tool.
16
20
 
17
- 返回:
18
- - content: [{ type: 'text', text: 选项列表 }]
19
-
20
- 边界:
21
- - 只负责收集平台或框架选择,不返回文档正文
22
- - **咨询链路(硬规则)**:用户问 API/组件/feature/客户端排障/集成查阅,但未说明平台 → MUST **先本工具**,用户选定后再 \`search_trtc_knowledge\`(**product + frameworks**);**禁止**跳过
23
- - **codegen 链路(硬规则)**:用户要集成进项目且未说明平台 → MUST **先本工具**,选定后再对应 \`get_*_integration\`
24
- - 跨平台通用问题(计费、服务端 REST、UserSig 原理)且与单一客户端无关 → 可直接 \`search_trtc_knowledge\`,不必经过本工具(**product 仍 MUST 从 prompt 提取**)
21
+ Few-shot:
22
+ - User: "Chat UIKit 怎么集成?" (no React/Vue) -> CALL present_framework_choice
23
+ - User: "CallKit 来电铃声怎么设置?" (no platform) -> CALL present_framework_choice
24
+ - User: "TIMPush 厂商通道怎么在控制台开通?" -> DO NOT call present_framework_choice
25
25
  `;
26
26
  const SELECTION_PROMPT_TEXT = `
27
- 请直接向用户展示可选的平台或框架,并等待用户选择后再继续后续集成或查询。
27
+ Please show available platform/framework options to user first. Continue with search or integration only after user selects one option.
28
28
  `;
29
29
  export const PRESENT_FRAMEWORK_CHOICE_DEFINITION = {
30
30
  name: 'present_framework_choice',
31
31
  description: TOOL_DESCRIPTION,
32
32
  selectionText: SELECTION_PROMPT_TEXT,
33
33
  parameter_descriptions: {
34
- product: '目标产品。可选值:chat | call | live | room | rtcengine | native_trtc_sdk | push。',
34
+ product: 'Target product. Allowed: chat | call | live | room | rtcengine | native_trtc_sdk | push.',
35
35
  },
36
36
  };
@@ -1,38 +1,60 @@
1
1
  const TOOL_DESCRIPTION = `
2
- 凡 Tencent RTC 文档咨询(Chat/Call/Live/Room/Push/Web TRTC/Native TRTC):FAQ、错误码、API、组件、feature、插件、集成查阅、排障 → MUST 先本工具。禁止 web_search。写接入代码 → get_*_integration。
2
+ Purpose:
3
+ Use this tool as the default retrieval entry for Tencent RTC documentation and troubleshooting.
3
4
 
4
- **prompt 必须原样保留用户问题**:禁止扩写、发散、改写、补充 API 用法/场景描述。用户问什么就传什么原文。若需补充语义(如 API/事件/具体实现),用 types/frameworks/product 结构化参数表达,或另行搜索。
5
+ When to call (MUST):
6
+ - Technical Q&A: product capability, configuration, best practice, documentation lookup.
7
+ - API lookup: API / component / event / parameter / error code.
8
+ - Troubleshooting: error, exception, failure, compatibility issue.
9
+ - Integration reference lookup when user wants guidance/docs but does NOT explicitly ask for runnable code generation.
5
10
 
6
- **product**(能推断 MUST 传;不能确定先问用户):
7
- push:TIMPush/推送/厂商/FCM/华为/小米/OPPO(≠chat)| chat:会话/TUIKit/IM/主题 | call:CallKit | live:LiveKit | room:RoomKit/会议
8
- rtcengine:Web TRTC | native_trtc_sdk:TRTCCloud | 跨域:["push","chat"]
11
+ When NOT to call:
12
+ - Non-technical chat/greeting/small talk.
13
+ - User explicitly asks to generate or modify runnable integration code in project -> use corresponding get_*_integration tool.
9
14
 
10
- **frameworks**(requires-framework.ts 顺序):
11
- 已传→检索 | needs_framework→present_framework_choice后重搜
12
- chat+错误码/ERR_→先问platform | native→MUST 包含 android/ios/c++ 之一 | rtcengine→隐式web
13
- push:厂商名≠平台(可不传);开通/接入/控制台/厂商配置可不传;含android/ios/flutter等→MUST
14
- 计费/REST/Webhook/UserSig→可不传 | types仅server_api/webhook/product→可不传
15
- 控制台/产品能力配置(多端登录/登录策略/消息存储时长/控制台设置)→types=["product"],勿用feature;误传feature时runtime按跨平台产品配置处理
16
- types含api/component/feature/plugin/sdk/integration→MUST | API/组件/enterRoom/SDK/插件/排障→MUST或先问
15
+ Hard input rule:
16
+ - prompt MUST preserve original user question verbatim. Do NOT expand, rewrite, or inject extra assumptions.
17
17
 
18
- **types**:默认不传;开放["faq"];REST/错误码/Webhook/控制台产品配置时再传。控制台配置勿窄传component/api/feature。
19
- - 发现型/罗列型问题("有哪些组件/API"、"可用组件列表")→ MUST 省略 types(窄传会杀掉召回)。
20
- - component 与 feature 等价(UIKit 文档统一打 feature 标签),传任一都会同时匹配。RoomKit/LiveKit Web 基于 Vue(framework=web 已含 vue)。
18
+ Product routing:
19
+ - push: TIMPush / 推送 / 厂商 / FCM / APNs / 华为 / 小米 / OPPO / vivo
20
+ - chat: 会话 / TUIKit / IM / 主题
21
+ - call: CallKit / 通话
22
+ - live: LiveKit / 直播 / 语聊房
23
+ - room: RoomKit / 会议
24
+ - rtcengine: Web TRTC / WebRTC
25
+ - native_trtc_sdk: TRTCCloud / Native SDK / 客户端
26
+ - Multi-domain is allowed (e.g. ["push","chat"]).
21
27
 
22
- **L0/L1**:本地fragments仅基于片段答;chat/urls/须fetch官网URL,禁止臆造。
28
+ Framework policy:
29
+ - If client platform is required but missing, call present_framework_choice first.
30
+ - If status=needs_framework, MUST collect framework first and then re-search.
31
+ - Framework is optional for cross-platform topics (pricing, REST, webhook, product-level console config).
23
32
 
24
- **返回**:status、confidence、fragments(doc_urls)、meta.references、queryID、message、meta.answer_contract。答案遵守 answer_contract(完整输出、用户可执行、未确认显式化),禁止精简,禁止输出"命中片段/检索结果/置信度/分数"等系统话术,但末尾需保留"参考文档"并列出 references/doc_urls。最终回复前 MUST 调用 finalize_answer;明确 follow-up 反馈后调用 submit_feedback。
33
+ Types policy:
34
+ - Default: do not pass types.
35
+ - Pass types only for clearly scoped cases (REST / webhook / error_code / product-level config).
36
+ - For discovery/listing questions (e.g. “有哪些组件/API”), keep types empty to avoid over-filtering.
37
+
38
+ Few-shot:
39
+ - User: "TRTC 报错 10015 是什么原因?" -> CALL search_trtc_knowledge
40
+ - User: "RoomKit 有哪些可配置组件?" -> CALL search_trtc_knowledge
41
+ - User: "帮我把 Web Chat UIKit 接进 React 项目并给可运行代码" -> Prefer get_*_integration (not this tool first)
42
+
43
+ Return contract:
44
+ - Returns status/confidence/fragments/meta.references/queryID/answer_contract.
45
+ - Before final user reply, MUST call finalize_answer.
46
+ - After explicit follow-up feedback, MUST call submit_feedback.
25
47
  `;
26
48
  const PARAMETER_DESCRIPTIONS = {
27
- prompt: '用户原始问题原文,MUST 原样透传,禁止扩写/发散/补充(如补 API 用法、场景、追问)。用户没说的不写进去;需补充语义用 types/frameworks 等结构化参数表达。',
28
- product: '产品数组:chat|call|live|room|push|rtcengine|native_trtc_sdk。能推断 MUST 传;push优先(TIMPush/推送→push,禁止误归chat)。live 常见关键词:LiveKit/直播/语聊房/TUILiveKit/AtomicXCore/开播/观看。不能确定先问用户。',
29
- frameworks: '平台数组:react|vue|web|miniprogram|android|ios|flutter|c++|uni-app|harmonyos|react-native|unity|unreal-engine|donut。支持传多个平台用于跨端检索;CallKit 中 TUICallKit 建议按 react/vue 区分检索,TUICallEngine/TUICallEvent 仍归 web;小程序用 miniprogram;harmonyos/react-native/unity/unreal/donut仅push适用。若未传且问题依赖具体客户端平台,必须先调用 present_framework_choice 询问后重搜。',
30
- types: '默认不传;开放["faq"]。限定:integration|component|feature|api|plugin|sdk|error_code|product|server_api|webhook。component 与 feature 等价(同时匹配);发现型/罗列型问题("有哪些组件")MUST 省略 types。控制台/计费/产品能力配置→product(非feature)。勿主动窄传。',
31
- scenario: 'live|voice,仅live产品。',
32
- queryID: '首次\'\',后续同一咨询MUST透传(见server)。',
33
- ide: 'IDE名称(cursor|claude-code|vscode|codebuddy|codex|trae|others)',
34
- from: '默认空字符串。',
35
- limit: '片段数,默认8,最大16。',
49
+ prompt: 'Original user question, MUST be passed verbatim. Do not rewrite or extend. Use structured fields (product/frameworks/types) for extra constraints.',
50
+ product: 'Product array: chat|call|live|room|push|rtcengine|native_trtc_sdk. Infer and pass when confident. push has priority for TIMPush/推送 queries.',
51
+ frameworks: 'Framework/platform array: react|vue|web|miniprogram|android|ios|flutter|c++|uni-app|harmonyos|react-native|unity|unreal-engine|donut. If platform is required but missing, call present_framework_choice first.',
52
+ types: 'Optional filter. Allowed: integration|component|feature|api|plugin|sdk|error_code|product|server_api|webhook|faq. Keep empty for discovery/listing queries.',
53
+ scenario: 'live|voice, only for live product.',
54
+ queryID: 'First call can be empty string; all subsequent calls in same consultation MUST reuse the returned queryID.',
55
+ ide: 'IDE name: cursor|claude-code|vscode|codebuddy|codex|trae|others.',
56
+ from: 'Optional, default empty string.',
57
+ limit: 'Fragment count, default 8, max 16.',
36
58
  };
37
59
  export const SEARCH_KNOWLEDGE_DEFINITION = {
38
60
  name: 'search_trtc_knowledge',
@@ -1,23 +1,27 @@
1
1
  const TOOL_DESCRIPTION = `
2
2
  Purpose:
3
- Submit the user's reply to the finalize_answer follow-up.
3
+ Submit user feedback for the finalize_answer follow-up.
4
4
 
5
- When to call:
6
- - If the previous assistant response ended with the finalize_answer follow-up, check the next user reply for feedback before any normal response.
7
- - Positive: "Yes", "已解决", "解决了", "好的", "谢谢", "OK", "yes", "resolved" -> resolved="1".
8
- - Negative: "No", "未解决", "没解决", "不行", "还有问题", "no" -> resolved="0".
9
- - MUST call this tool before replying when feedback is explicit.
10
- - Never say feedback was submitted/recorded unless this tool was called.
11
- - Do NOT call for unclear replies or new unrelated questions.
5
+ When to call (hard rule):
6
+ - If previous assistant message ended with finalize_answer follow-up, inspect the next user reply first.
7
+ - If reply explicitly indicates solved/unsolved, MUST call this tool before any normal response.
8
+ - Do NOT call for unclear replies, unrelated new questions, or non-feedback messages.
12
9
 
13
- Input:
14
- - prompt: Original user question. Must match finalize_answer.
15
- - queryID: REQUIRED. Same queryID as search_trtc_knowledge/finalize_answer.
16
- - resolved: "1" for positive feedback, "0" for negative feedback.
10
+ Resolved mapping:
11
+ - resolved="1": Yes / 已解决 / 解决了 / 好的 / 谢谢 / OK / resolved
12
+ - resolved="0": No / 未解决 / 没解决 / 不行 / 还有问题 / still not working
13
+
14
+ Input contract:
15
+ - prompt: original user question, consistent with finalize_answer.
16
+ - queryID: REQUIRED, same queryID used by search_trtc_knowledge/finalize_answer.
17
+ - resolved: "1" or "0".
18
+
19
+ Output contract:
20
+ - Never claim feedback is submitted/recorded unless this tool has been called.
17
21
  `;
18
22
  const PARAMETER_DESCRIPTIONS = {
19
- prompt: 'Original user question. Must match finalize_answer.',
20
- framework: 'Reuse framework from the search_trtc_knowledge chain when available.',
23
+ prompt: 'Original user question. Must match finalize_answer prompt.',
24
+ framework: 'Reuse framework from current search_trtc_knowledge chain when available.',
21
25
  queryID: 'REQUIRED. Same queryID as search_trtc_knowledge/finalize_answer.',
22
26
  resolved: '"1" for positive feedback, "0" for negative feedback.',
23
27
  };