@tencent-rtc/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.
- package/CHANGELOG.md +10 -0
- package/README.md +56 -53
- package/knowledge/chunker.js +1 -0
- package/knowledge/path-meta.js +12 -1
- package/knowledge/search/search-core.js +22 -4
- package/knowledge/search/search-knowledge.js +1 -1
- package/package.json +1 -1
- package/resource/index/manifest.json +1 -1
- package/server.js +35 -29
- package/tools/common/get_usersig.js +1 -1
- package/tools/definitions/get_native_call_uikit_integration_def.js +13 -7
- package/tools/definitions/get_native_callkit_core_integration_def.js +42 -31
- package/tools/definitions/get_native_chat_uikit_integration_def.js +11 -4
- package/tools/definitions/get_native_live_uikit_integration_def.js +21 -15
- package/tools/definitions/get_native_livekit_core_integration_def.js +11 -4
- package/tools/definitions/get_usersig_def.js +18 -11
- package/tools/definitions/get_web_call_uikit_integration_def.js +11 -4
- package/tools/definitions/get_web_chat_uikit_integration_def.js +11 -4
- package/tools/definitions/get_web_live_uikit_integration_def.js +11 -4
- package/tools/definitions/get_web_room_core_integration_def.js +16 -13
- package/tools/definitions/get_web_room_uikit_integration_def.js +11 -4
- package/tools/definitions/integration-boundary.js +9 -5
- package/tools/definitions/present_framework_choice_def.js +20 -20
- package/tools/definitions/search_trtc_knowledge_def.js +47 -27
- package/tools/definitions/submit_feedback_def.js +18 -14
- package/utils/report-cls-client.js +1 -1
- package/utils/report-es-client.js +1 -1
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
const TOOL_DESCRIPTION = `
|
|
2
2
|
Purpose:
|
|
3
|
-
|
|
3
|
+
Collect platform/framework choice from user when the question requires client-side platform context.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
- How do I enable virtual background (product or platform not specified)
|
|
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
|
-
-
|
|
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
|
-
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
- This tool only collects the platform or framework choice. It does not return documentation content.
|
|
22
|
-
- **Consultation chain (hard rule)**: API / component / feature / client troubleshooting / integration lookup without a platform -> MUST call this tool first, then search_trtc_knowledge with **product + frameworks**; do not skip.
|
|
23
|
-
- **Codegen chain (hard rule)**: user wants integration code in a project but platform is unclear -> MUST call this tool first, then the matching get_*_integration tool.
|
|
24
|
-
- Cross-platform general questions (billing, server REST, UserSig principles) unrelated to a single client -> search_trtc_knowledge directly without this tool (product still MUST be inferred from the prompt).
|
|
21
|
+
Few-shot:
|
|
22
|
+
- User: "How do I integrate Chat UIKit?" (no React/Vue) -> CALL present_framework_choice
|
|
23
|
+
- User: "How to configure CallKit ringtone?" (no platform) -> CALL present_framework_choice
|
|
24
|
+
- User: "How do I enable TIMPush vendor channel in console?" -> 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: 'Target product. Allowed
|
|
34
|
+
product: 'Target product. Allowed: chat | call | live | room | rtcengine | native_trtc_sdk | push.',
|
|
35
35
|
},
|
|
36
36
|
};
|
|
@@ -1,40 +1,60 @@
|
|
|
1
1
|
const TOOL_DESCRIPTION = `
|
|
2
|
-
|
|
2
|
+
Purpose:
|
|
3
|
+
Use this tool as the default retrieval entry for Tencent RTC documentation and troubleshooting.
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
When to call (MUST):
|
|
6
|
+
- Technical Q&A: product capability, configuration, best practice, and documentation lookup.
|
|
7
|
+
- API lookup: API / component / event / parameter / error code.
|
|
8
|
+
- Troubleshooting: error, exception, failure, or compatibility issue.
|
|
9
|
+
- Integration reference lookup when user wants guidance/docs but does NOT explicitly ask for runnable code generation.
|
|
5
10
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
chat + error code / ERR_ -> ask platform first | native_trtc_sdk -> MUST include one of android / ios / c++ | rtcengine -> implicit web
|
|
13
|
-
push: vendor name alone is not a platform (framework optional); enablement / console / vendor config may omit framework; if android / ios / flutter etc. appear -> MUST pass framework
|
|
14
|
-
billing / REST / Webhook / UserSig -> framework optional | if types only contain server_api / webhook / product -> framework optional
|
|
15
|
-
console / product capability config (multi-device login, login policy, message storage, console settings) -> types=["product"], not feature; even if Agent passes feature, runtime treats as cross-platform product config
|
|
16
|
-
if types include api / component / feature / plugin / sdk / integration -> framework required | API / component / enterRoom / SDK / plugin / troubleshooting usually require framework or a follow-up question
|
|
15
|
+
Hard input rule:
|
|
16
|
+
- prompt MUST preserve original user question verbatim. Do NOT expand, rewrite, or inject extra assumptions.
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
18
|
+
Product routing:
|
|
19
|
+
- push: TIMPush / push / vendor channel / FCM / APNs / Huawei / Xiaomi / OPPO / vivo
|
|
20
|
+
- chat: conversation / TUIKit / ChatKit / IM / theme
|
|
21
|
+
- call: CallKit / call
|
|
22
|
+
- live: LiveKit / live streaming / voice room
|
|
23
|
+
- room: RoomKit / meeting
|
|
24
|
+
- rtcengine: Web TRTC / WebRTC
|
|
25
|
+
- native_trtc_sdk: TRTCCloud / Native SDK / client SDK
|
|
26
|
+
- Multi-domain is allowed (e.g. ["push","chat"]).
|
|
21
27
|
|
|
22
|
-
|
|
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
|
-
|
|
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. "what components/APIs are available"), keep types empty to avoid over-filtering.
|
|
25
37
|
|
|
26
|
-
|
|
38
|
+
Few-shot:
|
|
39
|
+
- User: "What does TRTC error 10015 mean?" -> CALL search_trtc_knowledge
|
|
40
|
+
- User: "What components are configurable in RoomKit?" -> CALL search_trtc_knowledge
|
|
41
|
+
- User: "Integrate Web Chat UIKit into my React project and provide runnable code" -> 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.
|
|
27
47
|
`;
|
|
28
48
|
const PARAMETER_DESCRIPTIONS = {
|
|
29
|
-
prompt:
|
|
30
|
-
product: 'Product array: chat
|
|
31
|
-
frameworks: '
|
|
32
|
-
types: '
|
|
33
|
-
scenario: 'live
|
|
34
|
-
queryID:
|
|
35
|
-
ide: 'IDE name
|
|
36
|
-
from: '
|
|
37
|
-
limit: '
|
|
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/push 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.',
|
|
38
58
|
};
|
|
39
59
|
export const SEARCH_KNOWLEDGE_DEFINITION = {
|
|
40
60
|
name: 'search_trtc_knowledge',
|
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
const TOOL_DESCRIPTION = `
|
|
2
2
|
Purpose:
|
|
3
|
-
Submit
|
|
3
|
+
Submit user feedback for the finalize_answer follow-up.
|
|
4
4
|
|
|
5
|
-
When to call:
|
|
6
|
-
- If
|
|
7
|
-
-
|
|
8
|
-
-
|
|
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
|
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
|
|
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
|
|
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
|
};
|