@tencentcloud/sdk-mcp 1.7.5 → 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 (48) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +57 -54
  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 +0 -4
  11. package/resource/integration/callkit/preset/ios/integration.md +0 -4
  12. package/resource/integration/chat/preset/react/integration.md +0 -5
  13. package/resource/integration/chat/preset/uni-app/integration.md +0 -4
  14. package/resource/integration/chat/preset/vue/integration.md +0 -5
  15. package/resource/integration/livekit/preset/live/android/live-host-integration.md +0 -4
  16. package/resource/integration/livekit/preset/live/ios/live-host-integration.md +0 -4
  17. package/resource/integration/livekit/preset/live/vue/live-pusher-integration.md +0 -4
  18. package/resource/knowledge/callkit/preset/harmonyos/integration.md +0 -4
  19. package/resource/knowledge/chat/preset/android-view/integration.md +0 -4
  20. package/resource/knowledge/chat/preset/ios-uikit/integration.md +0 -4
  21. package/resource/knowledge/chat/preset/react/h5/integration.md +0 -5
  22. package/resource/knowledge/chat/preset/vue/h5/integration.md +0 -5
  23. package/resource/knowledge/roomkit/preset/android/integration.md +0 -4
  24. package/resource/knowledge/roomkit/preset/flutter/integration.md +0 -4
  25. package/resource/knowledge/roomkit/preset/harmonyos/integration.md +0 -4
  26. package/resource/knowledge/roomkit/preset/ios/integration.md +0 -4
  27. package/resource/knowledge/roomkit/preset/uniapp-app/integration.md +0 -4
  28. package/server.js +42 -34
  29. package/tools/common/get_usersig.js +1 -1
  30. package/tools/common/present_framework_choice.js +5 -5
  31. package/tools/definitions/finalize_answer_def.js +17 -16
  32. package/tools/definitions/get_native_call_uikit_integration_def.js +25 -16
  33. package/tools/definitions/get_native_callkit_core_integration_def.js +37 -26
  34. package/tools/definitions/get_native_chat_uikit_integration_def.js +22 -13
  35. package/tools/definitions/get_native_live_uikit_integration_def.js +30 -21
  36. package/tools/definitions/get_native_livekit_core_integration_def.js +25 -16
  37. package/tools/definitions/get_usersig_def.js +20 -13
  38. package/tools/definitions/get_web_call_uikit_integration_def.js +21 -12
  39. package/tools/definitions/get_web_chat_uikit_integration_def.js +22 -13
  40. package/tools/definitions/get_web_live_uikit_integration_def.js +21 -12
  41. package/tools/definitions/get_web_room_core_integration_def.js +29 -20
  42. package/tools/definitions/get_web_room_uikit_integration_def.js +21 -12
  43. package/tools/definitions/integration-boundary.js +9 -5
  44. package/tools/definitions/present_framework_choice_def.js +21 -21
  45. package/tools/definitions/search_trtc_knowledge_def.js +48 -26
  46. package/tools/definitions/submit_feedback_def.js +18 -14
  47. package/utils/report-cls-client.js +1 -1
  48. package/utils/report-es-client.js +1 -1
@@ -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
  };
@@ -32,7 +32,7 @@ function sendCLSReport(reportData) {
32
32
  const time = Date.now();
33
33
  const data = {
34
34
  platform: 'mcp',
35
- verison: '1.7.5',
35
+ verison: '1.7.6',
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.7.5',
10
+ version: '1.7.6',
11
11
  sdkappid: `${SDKAppID}`,
12
12
  method: method,
13
13
  userID: `${userID}`,