@tencent-rtc/mcp 1.4.6 → 1.6.0-beta.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/cursor-setting.png +0 -0
- package/knowledge/bm25-cache.js +74 -0
- package/knowledge/bm25-cache.js.map +1 -0
- package/knowledge/bm25.js +148 -0
- package/knowledge/bm25.js.map +1 -0
- package/knowledge/build-index.js +70 -0
- package/knowledge/build-index.js.map +1 -0
- package/knowledge/chunker.js +168 -0
- package/knowledge/chunker.js.map +1 -0
- package/knowledge/content-loader.js +40 -0
- package/knowledge/content-loader.js.map +1 -0
- package/knowledge/doc-url-resolver.js +143 -0
- package/knowledge/doc-url-resolver.js.map +1 -0
- package/knowledge/extractors.js +26 -0
- package/knowledge/extractors.js.map +1 -0
- package/knowledge/path-meta.js +185 -0
- package/knowledge/path-meta.js.map +1 -0
- package/knowledge/search/exact-lookup.js +498 -0
- package/knowledge/search/exact-lookup.js.map +1 -0
- package/knowledge/search/filter-pool.js +105 -0
- package/knowledge/search/filter-pool.js.map +1 -0
- package/knowledge/search/product-scope-intent.js +41 -0
- package/knowledge/search/product-scope-intent.js.map +1 -0
- package/knowledge/search/requires-framework.js +82 -0
- package/knowledge/search/requires-framework.js.map +1 -0
- package/knowledge/search/search-knowledge.js +230 -0
- package/knowledge/search/search-knowledge.js.map +1 -0
- package/mcp-server-prompt.png +0 -0
- package/package.json +1 -1
- package/resource/_schema/feature-aliases.yaml +10 -0
- package/resource/_schema/goal-tags.yaml +72 -0
- package/resource/_schema/products.yaml +19 -0
- package/resource/_schema/trtc-intents.yaml +27 -0
- package/resource/_schema/types.yaml +43 -0
- package/resource/index/component-slugs.json +1 -0
- package/resource/index/doc-source-urls.json +1 -0
- package/resource/index/manifest.json +1 -0
- package/resource/{doc → integration}/callkit/preset/android/integration.md +34 -28
- package/resource/integration/callkit/preset/flutter/integration.md +346 -0
- package/resource/integration/callkit/preset/ios/integration.md +408 -0
- package/resource/integration/callkit/preset/react/integration.md +362 -0
- package/resource/integration/callkit/preset/vue/integration.md +356 -0
- package/resource/integration/chat/preset/android/integration.md +500 -0
- package/resource/integration/chat/preset/flutter/integration.md +370 -0
- package/resource/integration/chat/preset/ios/integration.md +566 -0
- package/resource/integration/chat/preset/react/integration.md +490 -0
- package/resource/integration/chat/preset/vue/integration.md +504 -0
- package/resource/{doc → integration}/livekit/preset/live/vue/live-list-integration.md +26 -22
- package/resource/{doc → integration}/livekit/preset/live/vue/live-player-desk-integration.md +22 -18
- package/resource/integration/livekit/preset/live/vue/live-player-h5-integration.md +309 -0
- package/resource/{doc → integration}/livekit/preset/live/vue/live-pusher-integration.md +47 -39
- package/resource/integration/roomkit/preset/vue/integration.md +562 -0
- package/resource/knowledge/callkit/core-sdk/android/answer-call.md +828 -0
- package/resource/knowledge/callkit/core-sdk/android/make-call.md +897 -0
- package/resource/knowledge/callkit/core-sdk/android/offline-push.md +363 -0
- package/resource/knowledge/callkit/core-sdk/flutter/answer-call.md +1111 -0
- package/resource/knowledge/callkit/core-sdk/flutter/make-call.md +1132 -0
- package/resource/{doc → knowledge}/callkit/core-sdk/flutter/offline-push.md +174 -151
- package/resource/knowledge/callkit/core-sdk/ios/answer-call.md +1084 -0
- package/resource/knowledge/callkit/core-sdk/ios/make-call.md +1252 -0
- package/resource/knowledge/callkit/core-sdk/ios/offline-push.md +534 -0
- package/resource/knowledge/callkit/core-sdk/uni-app/answer-call.md +953 -0
- package/resource/knowledge/callkit/core-sdk/uni-app/make-call.md +1061 -0
- package/resource/knowledge/callkit/faq/android.md +92 -0
- package/resource/{doc/callkit/faq/android-faq.md → knowledge/callkit/faq/common.md} +11 -12
- package/resource/knowledge/callkit/faq/error-code.md +67 -0
- package/resource/knowledge/callkit/faq/flutter.md +52 -0
- package/resource/knowledge/callkit/faq/ios.md +104 -0
- package/resource/knowledge/callkit/faq/web.md +74 -0
- package/resource/knowledge/callkit/preset/android/api.md +412 -0
- package/resource/knowledge/callkit/preset/flutter/api.md +22 -0
- package/resource/knowledge/callkit/preset/ios/api.md +234 -0
- package/resource/knowledge/callkit/preset/web/api.md +83 -0
- package/resource/knowledge/chat/preset/android/features/chat-setting.md +74 -0
- package/resource/knowledge/chat/preset/android/features/contact-list.md +43 -0
- package/resource/knowledge/chat/preset/android/features/conversation-list.md +117 -0
- package/resource/knowledge/chat/preset/android/features/language.md +136 -0
- package/resource/knowledge/chat/preset/android/features/message-input.md +57 -0
- package/resource/knowledge/chat/preset/android/features/message-list.md +142 -0
- package/resource/knowledge/chat/preset/android/features/search.md +64 -0
- package/resource/knowledge/chat/preset/android/features/theme.md +222 -0
- package/resource/knowledge/chat/preset/android-view/integration.md +300 -0
- package/resource/knowledge/chat/preset/flutter/features/chat-setting.md +64 -0
- package/resource/knowledge/chat/preset/flutter/features/contact-list.md +40 -0
- package/resource/knowledge/chat/preset/flutter/features/conversation-list.md +129 -0
- package/resource/knowledge/chat/preset/flutter/features/language.md +104 -0
- package/resource/knowledge/chat/preset/flutter/features/message-input.md +54 -0
- package/resource/knowledge/chat/preset/flutter/features/message-list.md +158 -0
- package/resource/knowledge/chat/preset/flutter/features/search.md +59 -0
- package/resource/knowledge/chat/preset/flutter/features/theme.md +261 -0
- package/resource/knowledge/chat/preset/ios/features/chat-setting.md +94 -0
- package/resource/knowledge/chat/preset/ios/features/contact-list.md +119 -0
- package/resource/knowledge/chat/preset/ios/features/conversation-list.md +134 -0
- package/resource/knowledge/chat/preset/ios/features/language.md +125 -0
- package/resource/knowledge/chat/preset/ios/features/message-input.md +69 -0
- package/resource/knowledge/chat/preset/ios/features/message-list.md +162 -0
- package/resource/knowledge/chat/preset/ios/features/search.md +93 -0
- package/resource/knowledge/chat/preset/ios/features/theme.md +270 -0
- package/resource/{doc/chatkit/ios → knowledge/chat/preset/ios-uikit}/integration.md +160 -158
- package/resource/knowledge/chat/preset/react/features/chat-setting.md +101 -0
- package/resource/{doc/chatkit/react/components → knowledge/chat/preset/react/features}/contact-list.md +43 -41
- package/resource/knowledge/chat/preset/react/features/conversation-actions.md +215 -0
- package/resource/knowledge/chat/preset/react/features/conversation-list.md +339 -0
- package/resource/knowledge/chat/preset/react/features/conversation-preview.md +101 -0
- package/resource/knowledge/chat/preset/react/features/conversation-search.md +61 -0
- package/resource/{doc/chatkit/react/components → knowledge/chat/preset/react/features}/message-input.md +117 -156
- package/resource/knowledge/chat/preset/react/features/message-list.md +297 -0
- package/resource/{doc/chatkit/react/components → knowledge/chat/preset/react/features}/search.md +65 -59
- package/resource/knowledge/chat/preset/react/features/theme.md +93 -0
- package/resource/knowledge/chat/preset/vue/features/chat-header.md +331 -0
- package/resource/knowledge/chat/preset/vue/features/chat-setting.md +79 -0
- package/resource/knowledge/chat/preset/vue/features/contact-list.md +277 -0
- package/resource/knowledge/chat/preset/vue/features/conversation-actions.md +234 -0
- package/resource/knowledge/chat/preset/vue/features/conversation-list.md +331 -0
- package/resource/knowledge/chat/preset/vue/features/conversation-preview.md +216 -0
- package/resource/{doc/chatkit/vue/components → knowledge/chat/preset/vue/features}/conversation-search.md +13 -13
- package/resource/knowledge/chat/preset/vue/features/message-input.md +551 -0
- package/resource/knowledge/chat/preset/vue/features/message-list.md +350 -0
- package/resource/{doc/chatkit/vue/components → knowledge/chat/preset/vue/features}/search.md +79 -73
- package/resource/knowledge/chat/preset/vue/features/theme.md +136 -0
- package/resource/knowledge/chat/urls/error-code.md +17 -0
- package/resource/knowledge/chat/urls/product.md +43 -0
- package/resource/knowledge/chat/urls/restapi.md +204 -0
- package/resource/knowledge/chat/urls/sdk/android.md +80 -0
- package/resource/knowledge/chat/urls/sdk/flutter.md +71 -0
- package/resource/knowledge/chat/urls/sdk/ios.md +80 -0
- package/resource/knowledge/chat/urls/sdk/web.md +80 -0
- package/resource/knowledge/chat/urls/webhook.md +68 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/AudioEffectStore.md +286 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/BarrageStore.md +174 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/BattleStore.md +329 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/CameraView.md +55 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/CoGuestStore.md +434 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/CoHostStore.md +362 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/DeviceStore.md +466 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/GiftStore.md +173 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LikeStore.md +51 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveAudienceStore.md +291 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveCoreView.md +78 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveSeatStore.md +488 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LoginStore.md +219 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/AudioEffectStore.md +282 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BarrageStore.md +212 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BaseBeautyStore.md +153 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BattleStore.md +312 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/CoGuestStore.md +404 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/CoHostStore.md +334 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/DeviceStore.md +426 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/GiftStore.md +166 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LikeStore.md +52 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveAudienceStore.md +281 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveCoreView.md +150 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveSeatStore.md +438 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LoginStore.md +190 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/AudioEffectStore.md +291 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/BarrageStore.md +192 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/BaseBeautyStore.md +146 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/BattleStore.md +309 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/CoGuestStore.md +370 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/CoHostStore.md +339 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/DeviceStore.md +503 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/GiftStore.md +188 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LikeStore.md +51 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveAudienceStore.md +289 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveCoreView.md +78 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveSeatStore.md +487 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LoginStore.md +183 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/web/index.md +736 -0
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-audience-list.md +53 -47
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-audio-effect.md +28 -24
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-barrage.md +22 -18
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-base-beauty.md +17 -15
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-co-guest-interaction.md +19 -18
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-gift.md +102 -89
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-host-interaction.md +41 -37
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-integration.md +45 -43
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-live-list.md +23 -20
- package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-audience-list.md +41 -41
- package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-audio-effect.md +70 -69
- package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-barrage.md +68 -71
- package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-base-beauty.md +43 -47
- package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-co-guest-interaction.md +59 -56
- package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-gift.md +103 -105
- package/resource/knowledge/livekit/core-sdk/live/flutter/live-host-interaction.md +869 -0
- package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-integration.md +84 -87
- package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-live-list.md +43 -40
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-audience-list.md +11 -10
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-audio-effect.md +28 -24
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-barrage.md +22 -18
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-base-beauty.md +15 -14
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-co-guest-interaction.md +19 -18
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-gift.md +54 -50
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-host-interaction.md +41 -37
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-integration.md +40 -40
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-live-list.md +19 -18
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-audience-list.md +53 -47
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-audio-effect.md +28 -24
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-barrage.md +22 -18
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-co-guest-interaction.md +41 -33
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-gift.md +94 -81
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-host-interaction.md +35 -30
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-integration.md +45 -42
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-room-list.md +23 -20
- package/resource/knowledge/livekit/core-sdk/voice/flutter/voice-audience-list.md +260 -0
- package/resource/knowledge/livekit/core-sdk/voice/flutter/voice-audio-effect.md +598 -0
- package/resource/knowledge/livekit/core-sdk/voice/flutter/voice-barrage.md +490 -0
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/flutter/voice-co-guest-interaction.md +65 -59
- package/resource/knowledge/livekit/core-sdk/voice/flutter/voice-gift.md +424 -0
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/flutter/voice-integration.md +69 -76
- package/resource/knowledge/livekit/core-sdk/voice/flutter/voice-room-list.md +726 -0
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-audience-list.md +11 -10
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-audio-effect.md +28 -24
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-barrage.md +22 -18
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-co-guest-interaction.md +41 -33
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-gift.md +54 -50
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-host-interaction.md +35 -30
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-integration.md +49 -46
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-room-list.md +19 -18
- package/resource/knowledge/livekit/faq/error-code.md +193 -0
- package/resource/{doc/livekit/preset/live/vue/components → knowledge/livekit/preset/live/vue/features}/barrage.md +56 -53
- package/resource/{doc/livekit/preset/live/vue/components → knowledge/livekit/preset/live/vue/features}/live-audience-list.md +22 -21
- package/resource/{doc/livekit/preset/live/vue/components → knowledge/livekit/preset/live/vue/features}/live-view.md +34 -32
- package/resource/knowledge/push/config/android.md +92 -0
- package/resource/knowledge/push/config/harmonyos.md +83 -0
- package/resource/knowledge/push/config/ios.md +254 -0
- package/resource/knowledge/push/config/react-native.md +254 -0
- package/resource/knowledge/push/config/unity.md +209 -0
- package/resource/knowledge/push/config/unreal-engine.md +194 -0
- package/resource/knowledge/push/integration/android.md +404 -0
- package/resource/knowledge/push/integration/flutter.md +465 -0
- package/resource/knowledge/push/integration/harmonyos.md +63 -0
- package/resource/knowledge/push/integration/ios.md +246 -0
- package/resource/knowledge/push/integration/react-native.md +366 -0
- package/resource/knowledge/push/integration/uni-app.md +208 -0
- package/resource/knowledge/push/integration/unity.md +389 -0
- package/resource/knowledge/push/integration/unreal-engine.md +390 -0
- package/resource/knowledge/push/overview/prepare.md +60 -0
- package/resource/knowledge/roomkit/core-sdk/android/call-user-to-room.md +241 -0
- package/resource/knowledge/roomkit/core-sdk/android/room-participant-state.md +588 -0
- package/resource/knowledge/roomkit/core-sdk/android/room-state.md +364 -0
- package/resource/knowledge/roomkit/core-sdk/android/schedule-room.md +340 -0
- package/resource/knowledge/roomkit/core-sdk/flutter/call-user-to-room.md +230 -0
- package/resource/knowledge/roomkit/core-sdk/flutter/room-participant-state.md +797 -0
- package/resource/knowledge/roomkit/core-sdk/flutter/room-state.md +325 -0
- package/resource/knowledge/roomkit/core-sdk/flutter/schedule-room.md +325 -0
- package/resource/knowledge/roomkit/core-sdk/ios/call-user-to-room.md +233 -0
- package/resource/knowledge/roomkit/core-sdk/ios/room-participant-state.md +569 -0
- package/resource/knowledge/roomkit/core-sdk/ios/room-state.md +325 -0
- package/resource/knowledge/roomkit/core-sdk/ios/schedule-room.md +322 -0
- package/resource/knowledge/roomkit/core-sdk/vue/call-user-to-room.md +221 -0
- package/resource/{doc/roomkit/vue/features → knowledge/roomkit/core-sdk/vue}/device-detection.md +49 -48
- package/resource/knowledge/roomkit/core-sdk/vue/device-state.md +461 -0
- package/resource/knowledge/roomkit/core-sdk/vue/free-beauty-panel.md +216 -0
- package/resource/knowledge/roomkit/core-sdk/vue/room-chat.md +370 -0
- package/resource/{doc/roomkit/vue/features → knowledge/roomkit/core-sdk/vue}/room-participant-state.md +61 -60
- package/resource/knowledge/roomkit/core-sdk/vue/room-state.md +280 -0
- package/resource/{doc/roomkit/vue/features → knowledge/roomkit/core-sdk/vue}/room-view.md +57 -56
- package/resource/knowledge/roomkit/core-sdk/vue/schedule-room.md +319 -0
- package/resource/knowledge/roomkit/core-sdk/vue/screen-share.md +267 -0
- package/resource/knowledge/roomkit/core-sdk/vue/virtual-background.md +261 -0
- package/resource/knowledge/roomkit/preset/android/integration.md +396 -0
- package/resource/knowledge/roomkit/preset/flutter/integration.md +404 -0
- package/resource/knowledge/roomkit/preset/ios/integration.md +369 -0
- package/resource/knowledge/roomkit/preset/react/integration.md +576 -0
- package/resource/knowledge/rtcengine/web/how_to_run_web_sdk_demo.md +44 -0
- package/resource/{doc → knowledge}/rtcengine/web/plugin/21-advanced-auto-play-policy.md +8 -2
- package/resource/{doc → knowledge}/rtcengine/web/plugin/22-advanced-audio-mixer.md +19 -1
- package/resource/{doc → knowledge}/rtcengine/web/plugin/23-advanced-support-detection.md +1 -1
- package/resource/{doc → knowledge}/rtcengine/web/plugin/24-advanced-network-quality.md +8 -8
- package/resource/{doc → knowledge}/rtcengine/web/plugin/25-advanced-device-change.md +1 -1
- package/resource/{doc → knowledge}/rtcengine/web/plugin/26-advanced-publish-cdn-stream.md +6 -6
- package/resource/{doc → knowledge}/rtcengine/web/plugin/27-advanced-small-stream.md +3 -3
- package/resource/{doc → knowledge}/rtcengine/web/plugin/29-advanced-water-mark.md +18 -0
- package/resource/{doc → knowledge}/rtcengine/web/plugin/31-advanced-plugins-overview.md +1 -1
- package/resource/{doc → knowledge}/rtcengine/web/plugin/34-advanced-proxy.md +2 -2
- package/resource/{doc → knowledge}/rtcengine/web/plugin/35-advanced-ai-denoiser.md +1 -1
- package/resource/knowledge/trtc/android/TRTCCloud.md +1915 -0
- package/resource/knowledge/trtc/android/TRTCCloudDef.md +1029 -0
- package/resource/knowledge/trtc/android/TRTCCloudListener.md +1095 -0
- package/resource/knowledge/trtc/android/TRTCStatistics.md +68 -0
- package/resource/knowledge/trtc/android/TXAudioEffectManager.md +502 -0
- package/resource/knowledge/trtc/android/TXBeautyManager.md +415 -0
- package/resource/knowledge/trtc/android/TXDeviceManager.md +169 -0
- package/resource/knowledge/trtc/android/TXLiteAVCode.md +125 -0
- package/resource/knowledge/trtc/c++/ITRTCCloud.md +2069 -0
- package/resource/knowledge/trtc/c++/ITRTCStatistics.md +73 -0
- package/resource/knowledge/trtc/c++/ITXAudioEffectManager.md +502 -0
- package/resource/knowledge/trtc/c++/ITXDeviceManager.md +391 -0
- package/resource/knowledge/trtc/c++/TRTCCloudCallback.md +1191 -0
- package/resource/knowledge/trtc/c++/TRTCTypeDef.md +931 -0
- package/resource/knowledge/trtc/c++/TXLiteAVCode.md +127 -0
- package/resource/knowledge/trtc/ios/TRTCCloud.md +2118 -0
- package/resource/knowledge/trtc/ios/TRTCCloudDef.md +975 -0
- package/resource/knowledge/trtc/ios/TRTCCloudDelegate.md +1131 -0
- package/resource/knowledge/trtc/ios/TRTCStatistics.md +68 -0
- package/resource/knowledge/trtc/ios/TXAudioEffectManager.md +423 -0
- package/resource/knowledge/trtc/ios/TXBeautyManager.md +416 -0
- package/resource/knowledge/trtc/ios/TXDeviceManager.md +387 -0
- package/resource/knowledge/trtc/ios/TXLiteAVCode.md +127 -0
- package/server.js +35 -10
- package/server.js.map +1 -1
- package/tools/call/get_native_call_uikit_integration.js +2 -3
- package/tools/call/get_native_call_uikit_integration.js.map +1 -1
- package/tools/call/get_native_callkit_core_integration.js +2 -5
- package/tools/call/get_native_callkit_core_integration.js.map +1 -1
- package/tools/call/get_web_call_uikit_integration.js +2 -3
- package/tools/call/get_web_call_uikit_integration.js.map +1 -1
- package/tools/chat/get_native_chat_uikit_integration.js +2 -3
- package/tools/chat/get_native_chat_uikit_integration.js.map +1 -1
- package/tools/chat/get_web_chat_uikit_integration.js +2 -3
- package/tools/chat/get_web_chat_uikit_integration.js.map +1 -1
- package/tools/common/present_framework_choice.js +19 -13
- package/tools/common/present_framework_choice.js.map +1 -1
- package/tools/common/record_answer.js +19 -25
- package/tools/common/record_answer.js.map +1 -1
- package/tools/common/record_feedback.js +17 -30
- package/tools/common/record_feedback.js.map +1 -1
- package/tools/common/search_trtc_knowledge.js +45 -0
- package/tools/common/search_trtc_knowledge.js.map +1 -0
- package/tools/definitions/get_native_call_uikit_integration_def.js +3 -1
- package/tools/definitions/get_native_call_uikit_integration_def.js.map +1 -1
- package/tools/definitions/get_native_callkit_core_integration_def.js +5 -3
- package/tools/definitions/get_native_callkit_core_integration_def.js.map +1 -1
- package/tools/definitions/get_native_chat_uikit_integration_def.js +5 -2
- package/tools/definitions/get_native_chat_uikit_integration_def.js.map +1 -1
- package/tools/definitions/get_native_livekit_core_integration_def.js +6 -5
- package/tools/definitions/get_native_livekit_core_integration_def.js.map +1 -1
- package/tools/definitions/get_web_call_uikit_integration_def.js +4 -2
- package/tools/definitions/get_web_call_uikit_integration_def.js.map +1 -1
- package/tools/definitions/get_web_chat_uikit_integration_def.js +2 -0
- package/tools/definitions/get_web_chat_uikit_integration_def.js.map +1 -1
- package/tools/definitions/get_web_live_uikit_integration_def.js +5 -5
- package/tools/definitions/get_web_live_uikit_integration_def.js.map +1 -1
- package/tools/definitions/get_web_room_core_integration_def.js +50 -0
- package/tools/definitions/get_web_room_core_integration_def.js.map +1 -0
- package/tools/definitions/get_web_room_uikit_integration_def.js +5 -4
- package/tools/definitions/get_web_room_uikit_integration_def.js.map +1 -1
- package/tools/definitions/integration-boundary.js +6 -0
- package/tools/definitions/integration-boundary.js.map +1 -0
- package/tools/definitions/present_framework_choice_def.js +12 -10
- package/tools/definitions/present_framework_choice_def.js.map +1 -1
- package/tools/definitions/record_answer_def.js +19 -17
- package/tools/definitions/record_answer_def.js.map +1 -1
- package/tools/definitions/record_feedback_def.js +14 -13
- package/tools/definitions/record_feedback_def.js.map +1 -1
- package/tools/definitions/search_trtc_knowledge_def.js +40 -0
- package/tools/definitions/search_trtc_knowledge_def.js.map +1 -0
- package/tools/index.js +5 -36
- package/tools/index.js.map +1 -1
- package/tools/live/get_native_livekit_core_integration.js +1 -3
- package/tools/live/get_native_livekit_core_integration.js.map +1 -1
- package/tools/live/get_web_live_uikit_integration.js +2 -4
- package/tools/live/get_web_live_uikit_integration.js.map +1 -1
- package/tools/room/get_web_room_core_integration.js +48 -0
- package/tools/room/get_web_room_core_integration.js.map +1 -0
- package/tools/room/get_web_room_uikit_integration.js +2 -3
- package/tools/room/get_web_room_uikit_integration.js.map +1 -1
- package/utils/generate-structured-result.js +24 -30
- package/utils/generate-structured-result.js.map +1 -1
- package/utils/get-doc-content.js +14 -8
- package/utils/get-doc-content.js.map +1 -1
- package/utils/report-cls-client.js +18 -20
- package/utils/report-cls-client.js.map +1 -1
- package/utils/report-es-client.js +1 -1
- package/resource/doc/callkit/core-sdk/.gitkeep +0 -0
- package/resource/doc/callkit/core-sdk/android/answer-call.md +0 -852
- package/resource/doc/callkit/core-sdk/android/make-call.md +0 -954
- package/resource/doc/callkit/core-sdk/android/offline-push.md +0 -361
- package/resource/doc/callkit/core-sdk/flutter/answer-call.md +0 -1160
- package/resource/doc/callkit/core-sdk/flutter/make-call.md +0 -1205
- package/resource/doc/callkit/core-sdk/ios/answer-call.md +0 -1090
- package/resource/doc/callkit/core-sdk/ios/make-call.md +0 -1248
- package/resource/doc/callkit/core-sdk/ios/offline-push.md +0 -485
- package/resource/doc/callkit/core-sdk/uni-app/answer-call.md +0 -950
- package/resource/doc/callkit/core-sdk/uni-app/make-call.md +0 -1052
- package/resource/doc/callkit/faq/common/error-code.md +0 -47
- package/resource/doc/callkit/faq/flutter-faq.md +0 -115
- package/resource/doc/callkit/faq/ios-faq.md +0 -115
- package/resource/doc/callkit/faq/web-faq.md +0 -36
- package/resource/doc/callkit/preset/android/api.md +0 -296
- package/resource/doc/callkit/preset/flutter/api.md +0 -410
- package/resource/doc/callkit/preset/flutter/integration.md +0 -164
- package/resource/doc/callkit/preset/ios/api.md +0 -80
- package/resource/doc/callkit/preset/ios/integration.md +0 -187
- package/resource/doc/callkit/preset/react/api.md +0 -501
- package/resource/doc/callkit/preset/react/integration.md +0 -86
- package/resource/doc/callkit/preset/vue/api.md +0 -501
- package/resource/doc/callkit/preset/vue/integration.md +0 -83
- package/resource/doc/chatkit/android/faq.md +0 -111
- package/resource/doc/chatkit/android/features/theme.md +0 -219
- package/resource/doc/chatkit/android/integration.md +0 -490
- package/resource/doc/chatkit/faq/android_sdk/client-api.md +0 -281
- package/resource/doc/chatkit/faq/common/product.md +0 -7
- package/resource/doc/chatkit/faq/common/server.md +0 -44
- package/resource/doc/chatkit/faq/common/server_error_code.md +0 -74
- package/resource/doc/chatkit/faq/flutter_sdk/client-api.md +0 -199
- package/resource/doc/chatkit/faq/flutter_sdk/faq.md +0 -53
- package/resource/doc/chatkit/faq/ios_sdk/client-api.md +0 -235
- package/resource/doc/chatkit/faq/web_sdk/error_code.md +0 -47
- package/resource/doc/chatkit/faq/web_sdk/faq.md +0 -287
- package/resource/doc/chatkit/flutter/faq.md +0 -23
- package/resource/doc/chatkit/flutter/features/theme.md +0 -235
- package/resource/doc/chatkit/flutter/integration.md +0 -344
- package/resource/doc/chatkit/ios/faq.md +0 -111
- package/resource/doc/chatkit/ios/features/theme.md +0 -267
- package/resource/doc/chatkit/react/components/avatar.md +0 -104
- package/resource/doc/chatkit/react/components/chat-header.md +0 -148
- package/resource/doc/chatkit/react/components/chat-setting.md +0 -57
- package/resource/doc/chatkit/react/components/chat.md +0 -38
- package/resource/doc/chatkit/react/components/component-list.md +0 -37
- package/resource/doc/chatkit/react/components/conversation-actions.md +0 -174
- package/resource/doc/chatkit/react/components/conversation-list.md +0 -333
- package/resource/doc/chatkit/react/components/conversation-preview.md +0 -118
- package/resource/doc/chatkit/react/components/conversation-search.md +0 -60
- package/resource/doc/chatkit/react/components/message-list.md +0 -293
- package/resource/doc/chatkit/react/components/tuikit.md +0 -34
- package/resource/doc/chatkit/react/faq.md +0 -26
- package/resource/doc/chatkit/react/integration.md +0 -416
- package/resource/doc/chatkit/vue/components/avatar.md +0 -104
- package/resource/doc/chatkit/vue/components/chat-header.md +0 -148
- package/resource/doc/chatkit/vue/components/chat-setting.md +0 -62
- package/resource/doc/chatkit/vue/components/chat.md +0 -45
- package/resource/doc/chatkit/vue/components/component-list.md +0 -87
- package/resource/doc/chatkit/vue/components/contact-list.md +0 -271
- package/resource/doc/chatkit/vue/components/conversation-actions.md +0 -228
- package/resource/doc/chatkit/vue/components/conversation-list.md +0 -320
- package/resource/doc/chatkit/vue/components/conversation-preview.md +0 -213
- package/resource/doc/chatkit/vue/components/message-input.md +0 -1054
- package/resource/doc/chatkit/vue/components/message-list.md +0 -433
- package/resource/doc/chatkit/vue/components/tuikit.md +0 -31
- package/resource/doc/chatkit/vue/components/userpicker.md +0 -256
- package/resource/doc/chatkit/vue/faq.md +0 -36
- package/resource/doc/chatkit/vue/integration.md +0 -428
- package/resource/doc/livekit/core-sdk/live/flutter/live-host-interaction.md +0 -866
- package/resource/doc/livekit/faq/common/error-code.md +0 -88
- package/resource/doc/livekit/preset/live/vue/api-reference/index.md +0 -780
- package/resource/doc/livekit/preset/live/vue/components/co-guest-panel.md +0 -91
- package/resource/doc/livekit/preset/live/vue/components/live-scene-panel.md +0 -112
- package/resource/doc/livekit/preset/live/vue/components/stream-mixer.md +0 -215
- package/resource/doc/livekit/preset/live/vue/live-player-h5-integration.md +0 -300
- package/resource/doc/roomkit/faq/common/error-code.md +0 -67
- package/resource/doc/roomkit/vue/features/call-user-to-room.md +0 -220
- package/resource/doc/roomkit/vue/features/device-state.md +0 -460
- package/resource/doc/roomkit/vue/features/free-beauty-panel.md +0 -215
- package/resource/doc/roomkit/vue/features/room-chat.md +0 -369
- package/resource/doc/roomkit/vue/features/room-state.md +0 -282
- package/resource/doc/roomkit/vue/features/schedule-room.md +0 -318
- package/resource/doc/roomkit/vue/features/screen-share.md +0 -265
- package/resource/doc/roomkit/vue/features/virtual-background.md +0 -271
- package/resource/doc/roomkit/vue/integration.md +0 -315
- package/resource/doc/rtcengine/faq/common/error_code.md +0 -1
- package/resource/doc/rtcengine/faq/web_sdk/.gitkeep +0 -0
- package/resource/doc/rtcengine/web/.gitkeep +0 -0
- package/resource/doc/rtcengine/web/how_to_run_web_sdk_demo.md +0 -59
- package/resource/doc/trtc/C++/ITRTCCloud.md +0 -1970
- package/resource/doc/trtc/C++/ITRTCStatistics.md +0 -70
- package/resource/doc/trtc/C++/ITXAudioEffectManager.md +0 -469
- package/resource/doc/trtc/C++/ITXDeviceManager.md +0 -387
- package/resource/doc/trtc/C++/TRTCCloudCallback.md +0 -1082
- package/resource/doc/trtc/C++/TRTCTypeDef.md +0 -925
- package/resource/doc/trtc/C++/TXLiteAVCode.md +0 -129
- package/resource/doc/trtc/android/TRTCCloud.md +0 -1815
- package/resource/doc/trtc/android/TRTCCloudDef.md +0 -992
- package/resource/doc/trtc/android/TRTCCloudListener.md +0 -1004
- package/resource/doc/trtc/android/TRTCStatistics.md +0 -65
- package/resource/doc/trtc/android/TXAudioEffectManager.md +0 -469
- package/resource/doc/trtc/android/TXBeautyManager.md +0 -402
- package/resource/doc/trtc/android/TXDeviceManager.md +0 -173
- package/resource/doc/trtc/android/TXLiteAVCode.md +0 -127
- package/resource/doc/trtc/iOS/TRTCCloud.md +0 -2028
- package/resource/doc/trtc/iOS/TRTCCloudDef.md +0 -958
- package/resource/doc/trtc/iOS/TRTCCloudDelegate.md +0 -1046
- package/resource/doc/trtc/iOS/TRTCStatistics.md +0 -65
- package/resource/doc/trtc/iOS/TXAudioEffectManager.md +0 -397
- package/resource/doc/trtc/iOS/TXBeautyManager.md +0 -403
- package/resource/doc/trtc/iOS/TXDeviceManager.md +0 -381
- package/resource/doc/trtc/iOS/TXLiteAVCode.md +0 -130
- package/tools/call/get_callkit_api.js +0 -33
- package/tools/call/get_callkit_api.js.map +0 -1
- package/tools/chat/get_native_chat_uikit_feature_detail.js +0 -35
- package/tools/chat/get_native_chat_uikit_feature_detail.js.map +0 -1
- package/tools/chat/get_web_chat_uikit_component_detail.js +0 -35
- package/tools/chat/get_web_chat_uikit_component_detail.js.map +0 -1
- package/tools/common/get_faq.js +0 -266
- package/tools/common/get_faq.js.map +0 -1
- package/tools/common/record_skill_session.js +0 -69
- package/tools/common/record_skill_session.js.map +0 -1
- package/tools/definitions/get_callkit_api_def.js +0 -29
- package/tools/definitions/get_callkit_api_def.js.map +0 -1
- package/tools/definitions/get_faq_def.js +0 -49
- package/tools/definitions/get_faq_def.js.map +0 -1
- package/tools/definitions/get_native_chat_uikit_feature_detail_def.js +0 -31
- package/tools/definitions/get_native_chat_uikit_feature_detail_def.js.map +0 -1
- package/tools/definitions/get_native_livekit_core_features_def.js +0 -34
- package/tools/definitions/get_native_livekit_core_features_def.js.map +0 -1
- package/tools/definitions/get_native_trtc_sdk_docs_def.js +0 -32
- package/tools/definitions/get_native_trtc_sdk_docs_def.js.map +0 -1
- package/tools/definitions/get_web_chat_uikit_component_detail_def.js +0 -31
- package/tools/definitions/get_web_chat_uikit_component_detail_def.js.map +0 -1
- package/tools/definitions/get_web_livekit_api_def.js +0 -30
- package/tools/definitions/get_web_livekit_api_def.js.map +0 -1
- package/tools/definitions/get_web_livekit_component_detail_def.js +0 -32
- package/tools/definitions/get_web_livekit_component_detail_def.js.map +0 -1
- package/tools/definitions/get_web_roomkit_feature_detail_def.js +0 -31
- package/tools/definitions/get_web_roomkit_feature_detail_def.js.map +0 -1
- package/tools/definitions/get_web_trtc_sdk_api_def.js +0 -27
- package/tools/definitions/get_web_trtc_sdk_api_def.js.map +0 -1
- package/tools/definitions/get_web_trtc_sdk_integration_def.js +0 -27
- package/tools/definitions/get_web_trtc_sdk_integration_def.js.map +0 -1
- package/tools/definitions/get_web_trtc_sdk_plugin_def.js +0 -27
- package/tools/definitions/get_web_trtc_sdk_plugin_def.js.map +0 -1
- package/tools/definitions/record_skill_session_def.js +0 -31
- package/tools/definitions/record_skill_session_def.js.map +0 -1
- package/tools/live/get_native_livekit_core_features.js +0 -68
- package/tools/live/get_native_livekit_core_features.js.map +0 -1
- package/tools/live/get_web_livekit_api.js +0 -33
- package/tools/live/get_web_livekit_api.js.map +0 -1
- package/tools/live/get_web_livekit_component_detail.js +0 -35
- package/tools/live/get_web_livekit_component_detail.js.map +0 -1
- package/tools/room/get_web_roomkit_feature_detail.js +0 -69
- package/tools/room/get_web_roomkit_feature_detail.js.map +0 -1
- package/tools/rtcengine/get_web_trtc_sdk_api.js +0 -32
- package/tools/rtcengine/get_web_trtc_sdk_api.js.map +0 -1
- package/tools/rtcengine/get_web_trtc_sdk_integration.js +0 -32
- package/tools/rtcengine/get_web_trtc_sdk_integration.js.map +0 -1
- package/tools/rtcengine/get_web_trtc_sdk_plugin.js +0 -32
- package/tools/rtcengine/get_web_trtc_sdk_plugin.js.map +0 -1
- package/tools/trtc/get_native_trtc_sdk_docs.js +0 -74
- package/tools/trtc/get_native_trtc_sdk_docs.js.map +0 -1
- package/utils/build-session-directives.js +0 -120
- package/utils/build-session-directives.js.map +0 -1
- package/utils/handle-framework.js +0 -9
- package/utils/handle-framework.js.map +0 -1
- package/utils/handle-state-name.js +0 -29
- package/utils/handle-state-name.js.map +0 -1
- package/utils/report-runtime-error-cls-client.js +0 -91
- package/utils/report-runtime-error-cls-client.js.map +0 -1
- /package/resource/{doc/livekit/preset/live/vue/faq.md → knowledge/push/config/donut.md} +0 -0
- /package/resource/{doc/roomkit/vue/faq.md → knowledge/push/integration/donut.md} +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/api.md +0 -0
- /package/resource/{doc/rtcengine/faq/web/web.md → knowledge/rtcengine/web/faq.md} +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/how_to_integrated_web_sdk.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/20-advanced-customized-capture-rendering.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/28-advanced-beauty.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/30-advanced-cross-room-link.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/36-advanced-virtual-background.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/37-advanced-voice-changer.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/39-advanced-video-decoder.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/40-advanced-video-mixer.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/41-advanced-small-stream-auto-switcher.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/42-advanced-realtime-transcriber.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/43-advanced-face-detection.md +0 -0
|
@@ -0,0 +1,498 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
5
|
+
const SCHEMA_ROOT = path.resolve(__dirname, '../../resource/_schema');
|
|
6
|
+
export const DOC_PATH_MAP = {
|
|
7
|
+
android: {
|
|
8
|
+
core_api: 'TRTCCloud',
|
|
9
|
+
type_def: 'TRTCCloudDef',
|
|
10
|
+
callback: 'TRTCCloudListener',
|
|
11
|
+
statistics: 'TRTCStatistics',
|
|
12
|
+
audio_effect: 'TXAudioEffectManager',
|
|
13
|
+
beauty: 'TXBeautyManager',
|
|
14
|
+
device: 'TXDeviceManager',
|
|
15
|
+
error_code: 'TXLiteAVCode',
|
|
16
|
+
},
|
|
17
|
+
ios: {
|
|
18
|
+
core_api: 'TRTCCloud',
|
|
19
|
+
type_def: 'TXLiveSDKTypeDef',
|
|
20
|
+
callback: 'TRTCCloudDelegate',
|
|
21
|
+
statistics: 'TRTCStatistics',
|
|
22
|
+
audio_effect: 'TXAudioEffectManager',
|
|
23
|
+
beauty: 'TXBeautyManager',
|
|
24
|
+
device: 'TXDeviceManager',
|
|
25
|
+
error_code: 'TXLiteAVCode',
|
|
26
|
+
},
|
|
27
|
+
'c++': {
|
|
28
|
+
core_api: 'ITRTCCloud',
|
|
29
|
+
type_def: 'TRTCTypeDef',
|
|
30
|
+
callback: 'TRTCCloudCallback',
|
|
31
|
+
statistics: 'ITRTCStatistics',
|
|
32
|
+
audio_effect: 'ITXAudioEffectManager',
|
|
33
|
+
beauty: null,
|
|
34
|
+
device: 'ITXDeviceManager',
|
|
35
|
+
error_code: 'TXLiteAVCode',
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
export function inferNativeTRTCIntents(prompt) {
|
|
39
|
+
const normalizedPrompt = prompt.toLowerCase();
|
|
40
|
+
if (/enterroom|exitroom|startlocalpreview|mutelocalaudio|trtccloud\.|setlocal|setremote/.test(normalizedPrompt)) {
|
|
41
|
+
return ['core_api'];
|
|
42
|
+
}
|
|
43
|
+
if (/错误|报错|error|warning|code|排查/.test(normalizedPrompt)) {
|
|
44
|
+
return ['error_code'];
|
|
45
|
+
}
|
|
46
|
+
if (/回调|事件|监听|delegate|listener|callback|on[A-Z]/.test(prompt)) {
|
|
47
|
+
return ['callback'];
|
|
48
|
+
}
|
|
49
|
+
if (/参数|结构体|枚举|typedef|type ?def|trtcparams|编码|配置/.test(normalizedPrompt)) {
|
|
50
|
+
return ['type_def'];
|
|
51
|
+
}
|
|
52
|
+
if (/统计|网络质量|码率|帧率|statistics/.test(normalizedPrompt)) {
|
|
53
|
+
return ['statistics'];
|
|
54
|
+
}
|
|
55
|
+
if (/音效|bgm|混响|耳返|audio/.test(normalizedPrompt)) {
|
|
56
|
+
return ['audio_effect'];
|
|
57
|
+
}
|
|
58
|
+
if (/美颜|滤镜|beauty/.test(normalizedPrompt)) {
|
|
59
|
+
return ['beauty'];
|
|
60
|
+
}
|
|
61
|
+
if (/设备|摄像头|麦克风|扬声器|device/.test(normalizedPrompt)) {
|
|
62
|
+
return ['device'];
|
|
63
|
+
}
|
|
64
|
+
return ['core_api', 'error_code'];
|
|
65
|
+
}
|
|
66
|
+
function loadJson(fileName, fallback) {
|
|
67
|
+
const filePath = path.join(SCHEMA_ROOT, fileName);
|
|
68
|
+
if (!fs.existsSync(filePath))
|
|
69
|
+
return fallback;
|
|
70
|
+
return JSON.parse(fs.readFileSync(filePath, 'utf-8'));
|
|
71
|
+
}
|
|
72
|
+
const E7_EN_STOPWORDS = new Set([
|
|
73
|
+
'the', 'and', 'for', 'with', 'from', 'into', 'about', 'using', 'via',
|
|
74
|
+
'how', 'what', 'where', 'when', 'which', 'please', 'docs', 'documentation',
|
|
75
|
+
'tencent', 'im', 'rest', 'server', 'webhook', 'webhooks',
|
|
76
|
+
]);
|
|
77
|
+
/** Generic terms — excluded from API-token hits to avoid false positives */
|
|
78
|
+
const E7_GENERIC_TERMS = new Set([
|
|
79
|
+
'message', 'messages', 'group', 'groups', 'user', 'users', 'account', 'accounts',
|
|
80
|
+
'send', 'get', 'set', 'delete', 'create', 'update', 'query', 'before', 'after',
|
|
81
|
+
'webhook', 'friend', 'single', 'multiple', 'history', 'chat', 'sdk', 'api',
|
|
82
|
+
'profile', 'conversation', 'import', 'recall', 'modify', 'pull', 'mark', 'data',
|
|
83
|
+
'list', 'online', 'status', 'custom', 'attributes', 'counter', 'member', 'members',
|
|
84
|
+
'management', 'overview', 'integration', 'initialization', 'billing', 'topic',
|
|
85
|
+
'topics', 'community', 'robot', 'chatbot', 'streaming', 'broadcast', 'official',
|
|
86
|
+
'extension', 'receipt', 'receipts', 'global', 'mute', 'ban', 'unban', 'forbid',
|
|
87
|
+
'ordinary', 'specified', 'historical', 'unread', 'read', 'configure', 'configuration', 'invalidate',
|
|
88
|
+
'invalidating', 'disband', 'change', 'search', 'cloud', 'local', 'robot', 'bots',
|
|
89
|
+
]);
|
|
90
|
+
const E7_QUERY_NOISE = /\b(rest\s*ful?\s*api|rest\s*api|server\s*api|webhook|webhooks|how\s+to|how\s+do\s+i|what\s+is|where\s+is|please|documentation|docs?)\b/gi;
|
|
91
|
+
const E7_QUERY_NOISE_CN = /怎么|如何|什么|用哪个|查询|服务端/g;
|
|
92
|
+
const E7_PHRASES = [
|
|
93
|
+
'before send one-to-one message',
|
|
94
|
+
'after send one-to-one message',
|
|
95
|
+
'one-to-one message',
|
|
96
|
+
'group message',
|
|
97
|
+
'recall group message',
|
|
98
|
+
'recall one-to-one message',
|
|
99
|
+
'send one-to-one message',
|
|
100
|
+
'send single chat message',
|
|
101
|
+
'getmessagelist',
|
|
102
|
+
'message history',
|
|
103
|
+
'add friend',
|
|
104
|
+
'import single account',
|
|
105
|
+
'import a single account',
|
|
106
|
+
'multi-device login',
|
|
107
|
+
'multi device login',
|
|
108
|
+
'login policy',
|
|
109
|
+
'login strategy',
|
|
110
|
+
'message storage duration',
|
|
111
|
+
'roaming message storage',
|
|
112
|
+
];
|
|
113
|
+
function extractRestEndpoints(text) {
|
|
114
|
+
return [...text.matchAll(/v4\/[\w/]+/gi)].map((m) => m[0].toLowerCase());
|
|
115
|
+
}
|
|
116
|
+
function extractE7ApiTokens(text) {
|
|
117
|
+
const tokens = new Set();
|
|
118
|
+
for (const match of text.matchAll(/\b([a-z][a-z0-9_]{2,})\b/gi)) {
|
|
119
|
+
const token = match[1].toLowerCase();
|
|
120
|
+
if (!E7_GENERIC_TERMS.has(token) && !E7_EN_STOPWORDS.has(token))
|
|
121
|
+
tokens.add(token);
|
|
122
|
+
}
|
|
123
|
+
for (const match of text.matchAll(/\b([A-Z][A-Za-z0-9]*(?:\.[A-Za-z]\w*)?)\b/g)) {
|
|
124
|
+
const token = match[1].toLowerCase();
|
|
125
|
+
if (!E7_GENERIC_TERMS.has(token))
|
|
126
|
+
tokens.add(token);
|
|
127
|
+
}
|
|
128
|
+
for (const match of text.matchAll(/([a-z]+[A-Z][A-Za-z0-9]*)/g)) {
|
|
129
|
+
tokens.add(match[1].toLowerCase());
|
|
130
|
+
}
|
|
131
|
+
return [...tokens];
|
|
132
|
+
}
|
|
133
|
+
function normalizeE7Text(text) {
|
|
134
|
+
return text
|
|
135
|
+
.toLowerCase()
|
|
136
|
+
.replace(E7_QUERY_NOISE, ' ')
|
|
137
|
+
.replace(E7_QUERY_NOISE_CN, '')
|
|
138
|
+
.replace(/[^\w\u4e00-\u9fff/]+/g, ' ')
|
|
139
|
+
.replace(/\s+/g, ' ')
|
|
140
|
+
.trim();
|
|
141
|
+
}
|
|
142
|
+
function phraseBonus(query, title) {
|
|
143
|
+
const q = query.toLowerCase().replace(/\s+/g, ' ');
|
|
144
|
+
const t = title.toLowerCase();
|
|
145
|
+
let bonus = 0;
|
|
146
|
+
for (const phrase of E7_PHRASES) {
|
|
147
|
+
if (q.includes(phrase) && t.includes(phrase))
|
|
148
|
+
bonus += 180;
|
|
149
|
+
}
|
|
150
|
+
if (/send single chat message/.test(q) && /send one-to-one message/.test(t))
|
|
151
|
+
bonus += 200;
|
|
152
|
+
if (/recall group message/.test(q) && /recall group message/.test(t))
|
|
153
|
+
bonus += 200;
|
|
154
|
+
if (/before send one-to-one message/.test(q) && /before send one-to-one message/.test(t))
|
|
155
|
+
bonus += 220;
|
|
156
|
+
if (/\bbefore\b/.test(q) && t.startsWith('before '))
|
|
157
|
+
bonus += 120;
|
|
158
|
+
if (/\bafter\b/.test(q) && t.startsWith('after '))
|
|
159
|
+
bonus += 120;
|
|
160
|
+
if (/多端登录/.test(query) && /多端登录|multi[\s-]?device/i.test(title))
|
|
161
|
+
bonus += 220;
|
|
162
|
+
if (/登录策略|login\s*(policy|strategy)/i.test(query) && /登录策略|login\s*(policy|strategy)/i.test(title))
|
|
163
|
+
bonus += 200;
|
|
164
|
+
return bonus;
|
|
165
|
+
}
|
|
166
|
+
function scoreE7UrlRow(query, title) {
|
|
167
|
+
const queryEndpoints = extractRestEndpoints(query);
|
|
168
|
+
const titleEndpoints = extractRestEndpoints(title);
|
|
169
|
+
for (const qe of queryEndpoints) {
|
|
170
|
+
if (titleEndpoints.some((te) => te === qe || te.endsWith(qe) || qe.endsWith(te))) {
|
|
171
|
+
return 1000;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
let score = phraseBonus(query, title);
|
|
175
|
+
const titleLower = title.toLowerCase();
|
|
176
|
+
const queryApis = extractE7ApiTokens(query);
|
|
177
|
+
let apiHits = 0;
|
|
178
|
+
let longApiHit = false;
|
|
179
|
+
for (const api of queryApis) {
|
|
180
|
+
if (!titleLower.includes(api))
|
|
181
|
+
continue;
|
|
182
|
+
apiHits += 1;
|
|
183
|
+
if (api.length >= 8)
|
|
184
|
+
longApiHit = true;
|
|
185
|
+
}
|
|
186
|
+
if (longApiHit)
|
|
187
|
+
score = Math.max(score, 940);
|
|
188
|
+
else if (apiHits >= 2)
|
|
189
|
+
score = Math.max(score, 900);
|
|
190
|
+
else if (apiHits === 1)
|
|
191
|
+
score = Math.max(score, 860);
|
|
192
|
+
const qNorm = normalizeE7Text(query);
|
|
193
|
+
const tNorm = normalizeE7Text(title);
|
|
194
|
+
const qTokens = qNorm.split(' ').filter((t) => t.length >= 3 && !E7_GENERIC_TERMS.has(t));
|
|
195
|
+
const tTokens = tNorm.split(' ').filter((t) => t.length >= 3 && !E7_GENERIC_TERMS.has(t));
|
|
196
|
+
let overlap = 0;
|
|
197
|
+
for (const qt of qTokens) {
|
|
198
|
+
if (tTokens.some((tt) => tt.includes(qt) || qt.includes(tt)))
|
|
199
|
+
overlap += 1;
|
|
200
|
+
}
|
|
201
|
+
if (overlap >= 3)
|
|
202
|
+
score = Math.max(score, 720 + overlap * 15);
|
|
203
|
+
else if (overlap >= 2)
|
|
204
|
+
score = Math.max(score, 650);
|
|
205
|
+
else if (overlap >= 1)
|
|
206
|
+
score = Math.max(score, 520);
|
|
207
|
+
const qCompact = qNorm.replace(/\s+/g, '');
|
|
208
|
+
const tCompact = tNorm.replace(/\s+/g, '');
|
|
209
|
+
if (qCompact.length >= 5 && tCompact.includes(qCompact)) {
|
|
210
|
+
score = Math.max(score, 560 - Math.min(tCompact.length - qCompact.length, 80));
|
|
211
|
+
}
|
|
212
|
+
else if (tCompact.length >= 5 && qCompact.includes(tCompact)) {
|
|
213
|
+
score = Math.max(score, 500 + Math.min(tCompact.length, 30));
|
|
214
|
+
}
|
|
215
|
+
const qCjk = query.replace(/[^\u4e00-\u9fff]/g, '');
|
|
216
|
+
const tCjk = title.replace(/[^\u4e00-\u9fff]/g, '');
|
|
217
|
+
if (qCjk.length >= 2 && tCjk.includes(qCjk)) {
|
|
218
|
+
let cjkScore = 500;
|
|
219
|
+
if (/批量|群组|群流|广播|导入|公众号|已读|回执/.test(tCjk) && !/批量|群组|群|已读|回执/.test(qCjk)) {
|
|
220
|
+
cjkScore -= 250;
|
|
221
|
+
}
|
|
222
|
+
if (/^单发/.test(tCjk) && /发送|单聊/.test(qCjk))
|
|
223
|
+
cjkScore += 120;
|
|
224
|
+
score = Math.max(score, cjkScore);
|
|
225
|
+
}
|
|
226
|
+
if (score <= 0)
|
|
227
|
+
return 0;
|
|
228
|
+
const queryL = query.toLowerCase();
|
|
229
|
+
const titleL = title.toLowerCase();
|
|
230
|
+
if (/group/.test(queryL) && /one-to-one|c2c/.test(titleL) && !/group/.test(titleL))
|
|
231
|
+
score -= 400;
|
|
232
|
+
if (/one-to-one|c2c|single chat/.test(queryL) && /import.*account|add friend/.test(titleL))
|
|
233
|
+
score -= 400;
|
|
234
|
+
if (/send.*message|one-to-one message/.test(queryL) && /add friend|import.*account/.test(titleL))
|
|
235
|
+
score -= 400;
|
|
236
|
+
if (/getmessagelist|message history/.test(qCompact) && /integration|initialization/.test(titleL) && !/getmessagelist|history/.test(tCompact))
|
|
237
|
+
score -= 400;
|
|
238
|
+
if (/extension/.test(titleL) && !/extension/.test(queryL))
|
|
239
|
+
score -= 350;
|
|
240
|
+
if (/\bbefore\b/.test(queryL) && !/^before\b/.test(titleL.trim()))
|
|
241
|
+
score -= 250;
|
|
242
|
+
if (/\bafter\b/.test(queryL) && !/^after\b/.test(titleL.trim()))
|
|
243
|
+
score -= 250;
|
|
244
|
+
if (/batch|multiple/.test(titleL) && !/batch|multiple/.test(queryL))
|
|
245
|
+
score -= 200;
|
|
246
|
+
if (/group/.test(titleL) && !/group|channel/.test(queryL) && /one-to-one|c2c|single chat/.test(queryL))
|
|
247
|
+
score -= 200;
|
|
248
|
+
return Math.max(score, 0);
|
|
249
|
+
}
|
|
250
|
+
function loadFeatureAliases() {
|
|
251
|
+
const filePath = path.join(SCHEMA_ROOT, 'feature-aliases.yaml');
|
|
252
|
+
if (!fs.existsSync(filePath))
|
|
253
|
+
return {};
|
|
254
|
+
const text = fs.readFileSync(filePath, 'utf-8');
|
|
255
|
+
const result = {};
|
|
256
|
+
let currentProduct = '';
|
|
257
|
+
for (const line of text.split('\n')) {
|
|
258
|
+
const productMatch = line.match(/^(\w+):$/);
|
|
259
|
+
if (productMatch) {
|
|
260
|
+
currentProduct = productMatch[1];
|
|
261
|
+
result[currentProduct] = {};
|
|
262
|
+
continue;
|
|
263
|
+
}
|
|
264
|
+
const aliasMatch = line.match(/^\s+([\w.-]+\.md):\s*\[(.+)\]/);
|
|
265
|
+
if (aliasMatch && currentProduct) {
|
|
266
|
+
const aliases = aliasMatch[2]
|
|
267
|
+
.split(',')
|
|
268
|
+
.map((s) => s.trim().replace(/^["']|["']$/g, ''))
|
|
269
|
+
.filter(Boolean);
|
|
270
|
+
result[currentProduct][aliasMatch[1]] = aliases;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
return result;
|
|
274
|
+
}
|
|
275
|
+
export function runExactLookup(prompt, pool, norm) {
|
|
276
|
+
const boosts = {};
|
|
277
|
+
const exactHits = [];
|
|
278
|
+
const lowerPrompt = prompt.toLowerCase();
|
|
279
|
+
const addBoost = (chunk, amount, label) => {
|
|
280
|
+
boosts[chunk.id] = (boosts[chunk.id] ?? 0) + amount;
|
|
281
|
+
if (!exactHits.includes(label))
|
|
282
|
+
exactHits.push(label);
|
|
283
|
+
};
|
|
284
|
+
// E1: error codes
|
|
285
|
+
const errorMatches = [
|
|
286
|
+
...prompt.matchAll(/\b(\d{5,7})\b/g),
|
|
287
|
+
...prompt.matchAll(/\b(ERR_[A-Z0-9_]+)\b/g),
|
|
288
|
+
];
|
|
289
|
+
for (const match of errorMatches) {
|
|
290
|
+
const code = match[1];
|
|
291
|
+
for (const chunk of pool) {
|
|
292
|
+
if (chunk.error_codes.includes(code) || chunk.title.includes(code)) {
|
|
293
|
+
addBoost(chunk, 200, `E1:${code}`);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
// P1-3:跟踪 E2 已 boost 的文件,避免 E4 在同文件重复满额放大(双重 boost 会压垮 BM25 文件内排序)
|
|
298
|
+
const e2BoostedFiles = new Set();
|
|
299
|
+
// E2: native TRTC intents(只在传了 framework 时 boost;未传 framework 由 requires-framework 拦截)
|
|
300
|
+
// 衰减策略:同文件首 chunk +100,第 2 个 +50,第 3 个 +25 ...(下限 +5),
|
|
301
|
+
// 让 BM25 原始打分主导文件内方法级排序,避免「createSubCloud 顶掉 enterRoom」。
|
|
302
|
+
if (norm.product?.includes('native_trtc_sdk') && norm.frameworks?.length) {
|
|
303
|
+
const intents = inferNativeTRTCIntents(prompt);
|
|
304
|
+
for (const fw of norm.frameworks) {
|
|
305
|
+
const platformMap = DOC_PATH_MAP[fw];
|
|
306
|
+
if (!platformMap)
|
|
307
|
+
continue;
|
|
308
|
+
for (const intent of intents) {
|
|
309
|
+
const docName = platformMap[intent];
|
|
310
|
+
if (!docName)
|
|
311
|
+
continue;
|
|
312
|
+
const target = `knowledge/trtc/${fw}/${docName}.md`;
|
|
313
|
+
// 收集同文件 chunks 按 char_start 排序(即文件内顺序)
|
|
314
|
+
const fileChunks = pool
|
|
315
|
+
.filter((c) => c.source === target || c.source.endsWith(`/${docName}.md`))
|
|
316
|
+
.sort((a, b) => a.char_start - b.char_start);
|
|
317
|
+
for (let i = 0; i < fileChunks.length; i += 1) {
|
|
318
|
+
const decay = Math.max(5, Math.floor(100 / Math.pow(2, i)));
|
|
319
|
+
addBoost(fileChunks[i], decay, `E2:${docName}`);
|
|
320
|
+
e2BoostedFiles.add(fileChunks[i].source);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
// E3: component slugs
|
|
326
|
+
const componentSlugs = loadJson('../index/component-slugs.json', {});
|
|
327
|
+
const indexPath = path.resolve(__dirname, '../../resource/index/component-slugs.json');
|
|
328
|
+
const slugs = fs.existsSync(indexPath)
|
|
329
|
+
? JSON.parse(fs.readFileSync(indexPath, 'utf-8'))
|
|
330
|
+
: componentSlugs;
|
|
331
|
+
for (const [slug, aliases] of Object.entries(slugs)) {
|
|
332
|
+
const hit = [slug, ...aliases].some((alias) => lowerPrompt.includes(alias.toLowerCase()));
|
|
333
|
+
if (!hit)
|
|
334
|
+
continue;
|
|
335
|
+
for (const chunk of pool) {
|
|
336
|
+
if (chunk.source.includes(`components/${slug}.md`) ||
|
|
337
|
+
chunk.source.includes(`features/${slug}.md`)) {
|
|
338
|
+
addBoost(chunk, 100, `E3:${slug}`);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
// E4: symbols / Class.method
|
|
343
|
+
// P1-3:若 chunk 所在文件已被 E2 boost,则 E4 减半(避免双重放大压制 BM25 内序)
|
|
344
|
+
const symbolMatches = [
|
|
345
|
+
...prompt.matchAll(/\b([A-Z][A-Za-z0-9_]*\.[A-Za-z_]\w*)\b/g),
|
|
346
|
+
...prompt.matchAll(/\b(use[A-Z]\w*)\b/g),
|
|
347
|
+
...prompt.matchAll(/\b(TRTC[A-Za-z0-9_]+|TX[A-Za-z0-9_]+)\b/g),
|
|
348
|
+
];
|
|
349
|
+
for (const match of symbolMatches) {
|
|
350
|
+
const symbol = match[1];
|
|
351
|
+
for (const chunk of pool) {
|
|
352
|
+
if (chunk.symbols.includes(symbol)) {
|
|
353
|
+
const amount = e2BoostedFiles.has(chunk.source) ? 50 : 100;
|
|
354
|
+
addBoost(chunk, amount, `E4:${symbol}`);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
// E5: feature aliases
|
|
359
|
+
const featureAliases = loadFeatureAliases();
|
|
360
|
+
const productKey = norm.product?.includes('room') ? 'room'
|
|
361
|
+
: norm.product?.includes('chat') ? 'chat'
|
|
362
|
+
: norm.product?.includes('live') || !norm.product?.length ? 'live'
|
|
363
|
+
: '';
|
|
364
|
+
if (productKey && featureAliases[productKey]) {
|
|
365
|
+
for (const [fileName, aliases] of Object.entries(featureAliases[productKey])) {
|
|
366
|
+
const hit = aliases.some((alias) => lowerPrompt.includes(alias.toLowerCase()) || lowerPrompt.includes(fileName.replace('.md', '')));
|
|
367
|
+
if (!hit)
|
|
368
|
+
continue;
|
|
369
|
+
for (const chunk of pool) {
|
|
370
|
+
if (chunk.source.endsWith(fileName)) {
|
|
371
|
+
addBoost(chunk, 100, `E5:${fileName}`);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
if (norm.scenario === 'voice') {
|
|
377
|
+
for (const chunk of pool) {
|
|
378
|
+
if (chunk.source.includes('/voice/') && /co-guest|上麦/.test(lowerPrompt)) {
|
|
379
|
+
if (chunk.source.includes('voice-co-guest-interaction')) {
|
|
380
|
+
addBoost(chunk, 120, 'E5:voice-co-guest');
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
// E5.5: push overview boost——当用户问 push 综述类问题时把 overview/prepare.md 顶到前列。
|
|
386
|
+
// 关键词分两类:
|
|
387
|
+
// (1) prepare.md 标题语义:开通服务 / 接入流程 / 厂商配置 / SDK 接入 / 高级功能
|
|
388
|
+
// (2) 自然入口问法:准备工作 / 前置 / 前提 / 注意事项 / 是什么 / 计费
|
|
389
|
+
// 否则 BM25 会把各平台 integration.md 顶上来("步骤/集成"等词在多平台文档高频)。
|
|
390
|
+
if (norm.product?.includes('push')) {
|
|
391
|
+
const isOverviewIntent = /开通|创建\s*Push|创建应用|SDKAppID|控制台|数据中心|接入流程|接入推送|厂商配置|SDK\s*接入|高级功能|准备工作|准备|前置|前提|注意事项|是什么|介绍|计费/i.test(prompt)
|
|
392
|
+
|| /\b(push\s+)?(overview|getting\s+started|prerequisites|billing|what\s+is\s+push)\b/i.test(prompt);
|
|
393
|
+
if (isOverviewIntent) {
|
|
394
|
+
for (const chunk of pool) {
|
|
395
|
+
if (chunk.source.includes('knowledge/push/overview/')) {
|
|
396
|
+
addBoost(chunk, 150, 'E5.5:push-overview');
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
// E5.6: push 厂商精确命中——英文 push config 改为与写写一致的平台级页面:
|
|
401
|
+
// Android 厂商配置集中在 config/android.md,iOS/APNs 集中在 config/ios.md。
|
|
402
|
+
// 当 prompt 提到具体厂商时,把对应平台配置页顶到前列,避免被跨平台 integration 文档稀释。
|
|
403
|
+
const ANDROID_VENDOR_PROMPT = /华为|huawei|hms|harmonyconnect|小米|xiaomi|miui|mipush|\boppo\b|colorpush|\bvivo\b|vpush|荣耀|honor|魅族|meizu|flymepush|\bfcm\b|google\s*推送|firebase/i;
|
|
404
|
+
const IOS_VENDOR_PROMPT = /\bapns\b|apple\s*push|ios\s*certificate|p8\s*certificate|p12\s*certificate/i;
|
|
405
|
+
if (ANDROID_VENDOR_PROMPT.test(prompt)) {
|
|
406
|
+
for (const chunk of pool) {
|
|
407
|
+
if (chunk.source === 'knowledge/push/config/android.md') {
|
|
408
|
+
addBoost(chunk, 260, 'E5.6:push-vendor:android');
|
|
409
|
+
}
|
|
410
|
+
if (chunk.source === 'knowledge/push/integration/android.md') {
|
|
411
|
+
addBoost(chunk, 60, 'E5.6:push-vendor:android-fallback');
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
if (IOS_VENDOR_PROMPT.test(prompt)) {
|
|
416
|
+
for (const chunk of pool) {
|
|
417
|
+
if (chunk.source === 'knowledge/push/config/ios.md') {
|
|
418
|
+
addBoost(chunk, 120, 'E5.6:push-vendor:ios');
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
// E6: chat urls boost(L1 URL 映射;错误码单独指向 urls/error-code.md)
|
|
424
|
+
if (!norm.product?.length || norm.product.includes('chat')) {
|
|
425
|
+
if (/payload|usersig|authentication|auth|login|signature|登录|鉴权/i.test(prompt)) {
|
|
426
|
+
for (const chunk of pool) {
|
|
427
|
+
if (chunk.source.includes('knowledge/chat/urls/')) {
|
|
428
|
+
addBoost(chunk, 100, 'E6:chat-urls');
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
const errorCodeIntent = /错误码|\berror\s*code\b/i.test(prompt) || errorMatches.length > 0 || norm.searchIntent?.includes('error_code');
|
|
433
|
+
if (errorCodeIntent) {
|
|
434
|
+
for (const chunk of pool) {
|
|
435
|
+
if (chunk.source.includes('knowledge/chat/urls/error-code.md')) {
|
|
436
|
+
addBoost(chunk, 180, 'E6:chat-error-code-url');
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
// E7: URL map row match (chunk.title = Query column; boost best row only)
|
|
441
|
+
if (normalizeE7Text(prompt).replace(/\s+/g, '').length >= 2) {
|
|
442
|
+
const candidates = [];
|
|
443
|
+
for (const chunk of pool) {
|
|
444
|
+
if (!chunk.source.includes('knowledge/chat/urls/'))
|
|
445
|
+
continue;
|
|
446
|
+
if (!chunk.title.trim())
|
|
447
|
+
continue;
|
|
448
|
+
const score = scoreE7UrlRow(prompt, chunk.title);
|
|
449
|
+
if (score > 0) {
|
|
450
|
+
candidates.push({ chunk, score });
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
candidates.sort((a, b) => b.score - a.score);
|
|
454
|
+
const top = candidates[0];
|
|
455
|
+
if (top) {
|
|
456
|
+
addBoost(top.chunk, 200 + Math.min(top.score, 100), `E7:url-row:${top.chunk.title}`);
|
|
457
|
+
const runnerUp = candidates[1];
|
|
458
|
+
if (runnerUp && top.score - runnerUp.score <= 20) {
|
|
459
|
+
addBoost(runnerUp.chunk, 150 + Math.min(runnerUp.score, 80), `E7:url-row:${runnerUp.chunk.title}`);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
// E8: 集成查阅意图 boost——prompt 含集成/接入/快速开始/接入文档等意图词时,
|
|
465
|
+
// 把 {integration|knowledge}/{product}/preset/{fw}/integration.md 系列文件顶到前列。
|
|
466
|
+
// 解决问题:集成文档内容长、词密度低,BM25 原始分常被短小的 features/ 文档压过。
|
|
467
|
+
// 注:android-view / ios-uikit 已迁到 knowledge corpus,但同样是集成指引,需要一并 boost。
|
|
468
|
+
const isIntegrationIntent = /集成|接入|快速开始|快速接入|集成文档|接入文档|集成指南|接入指南|接入流程|集成步骤|如何接入|如何集成|怎么接入|怎么集成/i.test(prompt)
|
|
469
|
+
|| /\b(integrat(e|ion|ing)|getting\s+started|quick\s+start|setup\s+guide|how\s+to\s+(integrate|set\s+up)|install(?:ation)?\s+guide)\b/i.test(prompt);
|
|
470
|
+
if (isIntegrationIntent && norm.product?.length && norm.frameworks?.length) {
|
|
471
|
+
for (const chunk of pool) {
|
|
472
|
+
if (!norm.product.includes(chunk.product))
|
|
473
|
+
continue;
|
|
474
|
+
const fwMatch = norm.frameworks.some((fw) => chunk.framework.includes(fw));
|
|
475
|
+
if (!fwMatch)
|
|
476
|
+
continue;
|
|
477
|
+
// 命中 preset/{fw}/integration.md 系列(含 integration/ 和 knowledge/ 两种 corpus)
|
|
478
|
+
if (!chunk.source.includes('/preset/') || (!chunk.source.endsWith('integration.md') && !chunk.source.endsWith('-integration.md')))
|
|
479
|
+
continue;
|
|
480
|
+
addBoost(chunk, 120, `E8:integration-doc:${chunk.source}`);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
// E9: chat faq — types=faq 时优先 knowledge/ 语料,避免 integration 文档内 FAQ 章节抢首位
|
|
484
|
+
if (norm.searchIntent?.includes('faq') && norm.product?.includes('chat')) {
|
|
485
|
+
const authPrompt = /auth|login|signature|usersig|鉴权|登录/i.test(prompt);
|
|
486
|
+
for (const chunk of pool) {
|
|
487
|
+
if (chunk.source.startsWith('knowledge/chat/')) {
|
|
488
|
+
const urlBoost = authPrompt && chunk.source.includes('/urls/') ? 180 : 100;
|
|
489
|
+
addBoost(chunk, urlBoost, 'E9:chat-faq:knowledge');
|
|
490
|
+
}
|
|
491
|
+
if (chunk.source.startsWith('integration/chat/')) {
|
|
492
|
+
addBoost(chunk, -120, 'E9:chat-faq:penalize-integration');
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
return { boosts, exactHits };
|
|
497
|
+
}
|
|
498
|
+
//# sourceMappingURL=exact-lookup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exact-lookup.js","sourceRoot":"","sources":["../../../src/knowledge/search/exact-lookup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAIpC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/D,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,wBAAwB,CAAC,CAAC;AAatE,MAAM,CAAC,MAAM,YAAY,GAA4E;IACnG,OAAO,EAAE;QACP,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,cAAc;QACxB,QAAQ,EAAE,mBAAmB;QAC7B,UAAU,EAAE,gBAAgB;QAC5B,YAAY,EAAE,sBAAsB;QACpC,MAAM,EAAE,iBAAiB;QACzB,MAAM,EAAE,iBAAiB;QACzB,UAAU,EAAE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BAAuB,CAAC,CAAC;YACrD,CAAC;YACD,IAAI,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,mBAAmB,CAAC,EAAE,CAAC;gBACjD,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,kCAAkC,CAAC,CAAC;YAC5D,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { downgradeToProductType } from './product-scope-intent.js';
|
|
2
|
+
/**
|
|
3
|
+
* MCP framework enum → index 中对应的 framework 值列表。
|
|
4
|
+
* path-meta.ts 已通过 normalizeFrameworkDir 把目录名归一到标准 framework,
|
|
5
|
+
* 所有产品的 framework 均已对齐枚举值,无需额外别名扩展。
|
|
6
|
+
* web 匹配 react/vue/web(Chat/Call/Live Web 端覆盖)。
|
|
7
|
+
*/
|
|
8
|
+
const FRAMEWORK_SEARCH_ALIASES = {};
|
|
9
|
+
function expandFrameworks(framework) {
|
|
10
|
+
if (!framework)
|
|
11
|
+
return undefined;
|
|
12
|
+
if (framework === 'web')
|
|
13
|
+
return ['react', 'vue', 'web'];
|
|
14
|
+
return FRAMEWORK_SEARCH_ALIASES[framework] ?? [framework];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 类型别名:UIKit「组件(component)」与「feature」是同一批文档的两种叫法
|
|
18
|
+
* (chat preset 双标签,roomkit/live/call 仅打 feature),互相放行避免 types 硬过滤误杀。
|
|
19
|
+
*/
|
|
20
|
+
const TYPE_ALIASES = {
|
|
21
|
+
component: ['component', 'feature'],
|
|
22
|
+
feature: ['feature', 'component'],
|
|
23
|
+
};
|
|
24
|
+
function expandTypeAliases(types) {
|
|
25
|
+
const expanded = new Set();
|
|
26
|
+
for (const t of types) {
|
|
27
|
+
for (const alias of TYPE_ALIASES[t] ?? [t])
|
|
28
|
+
expanded.add(alias);
|
|
29
|
+
}
|
|
30
|
+
return [...expanded];
|
|
31
|
+
}
|
|
32
|
+
/** Chat 无独立 faq.md;types 含 faq 时退化到全语料检索(feature/component/urls 等均命中) */
|
|
33
|
+
function resolveTypes(products, types, prompt, framework) {
|
|
34
|
+
if (!types?.length)
|
|
35
|
+
return undefined;
|
|
36
|
+
if (products?.includes('chat') && types.includes('faq')) {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
const downgraded = downgradeToProductType(products, types, prompt, framework);
|
|
40
|
+
return expandTypeAliases(downgraded);
|
|
41
|
+
}
|
|
42
|
+
/** 单平台产品的隐式 framework 推断:避免对显然唯一的平台再发起询问 */
|
|
43
|
+
function inferImplicitFramework(products, framework) {
|
|
44
|
+
if (framework)
|
|
45
|
+
return framework;
|
|
46
|
+
if (products?.length === 1 && products[0] === 'rtcengine')
|
|
47
|
+
return 'web';
|
|
48
|
+
return undefined;
|
|
49
|
+
}
|
|
50
|
+
export function normalizeParams(params) {
|
|
51
|
+
const limit = Math.min(Math.max(params.limit ?? 8, 1), 16);
|
|
52
|
+
const effectiveFramework = inferImplicitFramework(params.product, params.framework);
|
|
53
|
+
const frameworks = expandFrameworks(effectiveFramework);
|
|
54
|
+
const types = resolveTypes(params.product, params.types, params.prompt, effectiveFramework);
|
|
55
|
+
return {
|
|
56
|
+
prompt: params.prompt,
|
|
57
|
+
product: params.product,
|
|
58
|
+
framework: effectiveFramework,
|
|
59
|
+
frameworks,
|
|
60
|
+
searchIntent: params.types,
|
|
61
|
+
types,
|
|
62
|
+
scenario: params.scenario,
|
|
63
|
+
limit,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* 跨平台类型集合:framework=['*'] 的 chunk 仅在 type 命中这些时才视为合理。
|
|
68
|
+
* - server_api / webhook / product:天然跨平台
|
|
69
|
+
* - faq / error_code:URL 映射页(chat/urls/error-code.md)与 callkit/faq/ 等按平台分 faq 文件,
|
|
70
|
+
* 都标记为 framework=['*'],按 framework 检索时不应被武断排除
|
|
71
|
+
*/
|
|
72
|
+
const CROSS_PLATFORM_CHUNK_TYPES = new Set([
|
|
73
|
+
'server_api',
|
|
74
|
+
'webhook',
|
|
75
|
+
'product',
|
|
76
|
+
'faq',
|
|
77
|
+
'error_code',
|
|
78
|
+
]);
|
|
79
|
+
function chunkIsCrossPlatform(chunkTypes) {
|
|
80
|
+
return chunkTypes.some((t) => CROSS_PLATFORM_CHUNK_TYPES.has(t));
|
|
81
|
+
}
|
|
82
|
+
export function filterPool(chunks, norm) {
|
|
83
|
+
return chunks.filter((chunk) => {
|
|
84
|
+
if (norm.product && !norm.product.includes(chunk.product) && chunk.product !== '*') {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
if (norm.frameworks?.length) {
|
|
88
|
+
const isWildcardChunk = chunk.framework.includes('*');
|
|
89
|
+
// 收紧:framework=['*'] 仅在该 chunk 明确是跨平台 type(product/server_api/webhook)时放行;
|
|
90
|
+
// 否则要求 chunk.framework 与请求 framework 有交集。
|
|
91
|
+
const wildcardAllowed = isWildcardChunk && chunkIsCrossPlatform(chunk.types);
|
|
92
|
+
const explicitMatch = norm.frameworks.some((fw) => chunk.framework.includes(fw));
|
|
93
|
+
if (!explicitMatch && !wildcardAllowed)
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
if (norm.scenario && chunk.scenario && chunk.scenario !== norm.scenario) {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
if (norm.types?.length && !norm.types.some((t) => chunk.types.includes(t))) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
return true;
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=filter-pool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter-pool.js","sourceRoot":"","sources":["../../../src/knowledge/search/filter-pool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAenE;;;;;GAKG;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