@tencent-rtc/trtc-agent-skills 0.1.0
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/LICENSE +21 -0
- package/README.md +172 -0
- package/README.zh.md +173 -0
- package/bin/cli.js +434 -0
- package/knowledge-base/index.yaml +454 -0
- package/knowledge-base/platform-slice-template.md +233 -0
- package/knowledge-base/scenario-spec.md +350 -0
- package/knowledge-base/scenarios/conference/base/general-conference.md +365 -0
- package/knowledge-base/scenarios/conference/base/webinar-conference.md +130 -0
- package/knowledge-base/scenarios/conference/medical/1v1-video-consultation.md +145 -0
- package/knowledge-base/scenarios/conference/medical/medical-multidoctor-consultation.md +113 -0
- package/knowledge-base/scenarios/live/entertainment-live-room.md +118 -0
- package/knowledge-base/slice-spec.md +546 -0
- package/knowledge-base/slices/conference/web/ai-tools.md +225 -0
- package/knowledge-base/slices/conference/web/beauty-effects.md +188 -0
- package/knowledge-base/slices/conference/web/device-control.md +338 -0
- package/knowledge-base/slices/conference/web/login-auth.md +261 -0
- package/knowledge-base/slices/conference/web/network-quality.md +190 -0
- package/knowledge-base/slices/conference/web/official-roomkit-api.md +298 -0
- package/knowledge-base/slices/conference/web/official-roomkit-login-ui.md +246 -0
- package/knowledge-base/slices/conference/web/participant-list.md +238 -0
- package/knowledge-base/slices/conference/web/participant-management.md +718 -0
- package/knowledge-base/slices/conference/web/prejoin-check.md +293 -0
- package/knowledge-base/slices/conference/web/room-call.md +213 -0
- package/knowledge-base/slices/conference/web/room-chat.md +426 -0
- package/knowledge-base/slices/conference/web/room-lifecycle.md +534 -0
- package/knowledge-base/slices/conference/web/room-schedule.md +281 -0
- package/knowledge-base/slices/conference/web/screen-share.md +211 -0
- package/knowledge-base/slices/conference/web/video-layout.md +675 -0
- package/knowledge-base/slices/conference/web/virtual-background.md +197 -0
- package/knowledge-base/slices/conference/web/webinar-interaction.md +206 -0
- package/knowledge-base/slices/live/anchor-lifecycle.md +122 -0
- package/knowledge-base/slices/live/anchor-preview.md +90 -0
- package/knowledge-base/slices/live/anchor-room-config.md +104 -0
- package/knowledge-base/slices/live/audience-list.md +86 -0
- package/knowledge-base/slices/live/audience-manage.md +92 -0
- package/knowledge-base/slices/live/audience-watch.md +85 -0
- package/knowledge-base/slices/live/audio.md +116 -0
- package/knowledge-base/slices/live/barrage.md +88 -0
- package/knowledge-base/slices/live/beauty.md +99 -0
- package/knowledge-base/slices/live/coguest-apply.md +105 -0
- package/knowledge-base/slices/live/device-control.md +91 -0
- package/knowledge-base/slices/live/error-codes.md +167 -0
- package/knowledge-base/slices/live/gift.md +84 -0
- package/knowledge-base/slices/live/ios/.gitkeep +0 -0
- package/knowledge-base/slices/live/ios/anchor-lifecycle.md +313 -0
- package/knowledge-base/slices/live/ios/anchor-preview.md +228 -0
- package/knowledge-base/slices/live/ios/anchor-room-config.md +257 -0
- package/knowledge-base/slices/live/ios/audience-list.md +353 -0
- package/knowledge-base/slices/live/ios/audience-manage.md +381 -0
- package/knowledge-base/slices/live/ios/audience-watch.md +286 -0
- package/knowledge-base/slices/live/ios/audio.md +373 -0
- package/knowledge-base/slices/live/ios/barrage.md +285 -0
- package/knowledge-base/slices/live/ios/beauty.md +323 -0
- package/knowledge-base/slices/live/ios/coguest-apply.md +506 -0
- package/knowledge-base/slices/live/ios/device-control.md +286 -0
- package/knowledge-base/slices/live/ios/error-codes.md +270 -0
- package/knowledge-base/slices/live/ios/gift.md +315 -0
- package/knowledge-base/slices/live/ios/live-list.md +269 -0
- package/knowledge-base/slices/live/ios/login-auth.md +247 -0
- package/knowledge-base/slices/live/live-list.md +82 -0
- package/knowledge-base/slices/live/login-auth.md +78 -0
- package/package.json +34 -0
- package/skills/trtc/SKILL.md +326 -0
- package/skills/trtc/room-builder/SKILL.md +138 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/README.md +108 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/docs/backend-contract.zh-CN.md +162 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/docs/integration.zh-CN.md +154 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/docs/theme.zh-CN.md +78 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/index.html +12 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/package.json +28 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/postcss.config.js +5 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/App.vue +25 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/components/ConsultationManagePanel.vue +838 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/components/LanguageSwitch.vue +102 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/components/LoadingSpinner.vue +6 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/components/MedicalAlert.vue +34 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/components/MedicalBusinessPanel.vue +148 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/components/MedicalButton.vue +49 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/components/MedicalConfirmDialog.vue +68 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/components/MedicalDataPanel.vue +196 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/components/MedicalRecordPanel.vue +270 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/components/PrescriptionPanel.vue +363 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/config/basic-info-config.ts +29 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/config/lib-generate-test-usersig-es.min.d.ts +4 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/config/lib-generate-test-usersig-es.min.js +2 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/config/runtime-config.ts +12 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/env.d.ts +32 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/components/ConsultationChatPanel.vue +123 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/components/ConsultationMembersPanel.vue +230 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/components/ConsultationTranscriptionPanel.vue +135 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/components/ConsultationVideoStage.vue +113 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/components/InviteDoctorDialog.vue +132 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/components/KickMemberConfirmDialog.vue +50 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/types.ts +77 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/useConsultationChat.ts +97 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/useConsultationDevices.ts +48 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/useConsultationParticipants.ts +121 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/useConsultationPermissions.ts +25 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/features/consultation/utils.ts +70 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/i18n/en-US/index.ts +553 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/i18n/index.ts +25 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/i18n/medicalTranslate.ts +85 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/i18n/state.ts +49 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/i18n/zh-CN/index.ts +463 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/main.ts +12 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/mock/appointments.ts +96 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/mock/users.ts +79 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/router/index.ts +63 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/services/adapters/index.ts +25 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/services/adapters/integration/appointmentService.ts +77 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/services/adapters/integration/authService.ts +38 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/services/adapters/integration/launchContext.ts +31 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/services/adapters/integration/userService.ts +35 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/services/adapters/mock/appointmentService.ts +43 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/services/adapters/mock/authService.ts +33 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/services/adapters/mock/userService.ts +43 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/services/adapters/types.ts +135 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/shared/icons.ts +53 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/styles/index.css +106 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/styles/tailwind.css +3 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/styles/theme.css +209 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/utils/auth.ts +50 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/utils/format.ts +24 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/utils/navigation.ts +12 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/utils/session.ts +28 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/views/DoctorConsultationView.vue +777 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/views/DoctorDashboardView.vue +678 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/views/LoginView.vue +441 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/views/PatientConsultationFinishedView.vue +185 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/views/PatientConsultationView.vue +1003 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/views/PatientSelectDoctorView.vue +317 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/src/views/PatientWaitingView.vue +454 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/tsconfig.json +21 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/tsconfig.node.json +8 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation/vite.config.ts +17 -0
- package/skills/trtc/room-builder/templates/scenarios/medical-consultation//346/216/245/345/205/245/350/257/264/346/230/216.md +6 -0
- package/skills/trtc/room-builder/tools/render_ai_instructions.py +226 -0
- package/skills/trtc-apply/SKILL.md +97 -0
- package/skills/trtc-apply/guardrails/apply_lib/__init__.py +0 -0
- package/skills/trtc-apply/guardrails/apply_lib/__pycache__/__init__.cpython-313.pyc +0 -0
- package/skills/trtc-apply/guardrails/apply_lib/__pycache__/rule_parser.cpython-313.pyc +0 -0
- package/skills/trtc-apply/guardrails/apply_lib/rule_parser.py +268 -0
- package/skills/trtc-docs/SKILL.md +207 -0
- package/skills/trtc-onboarding/SKILL.md +839 -0
- package/skills/trtc-onboarding/reference/path-a1-demo.md +103 -0
- package/skills/trtc-onboarding/reference/path-a2-integrate.md +693 -0
- package/skills/trtc-onboarding/reference/path-b-troubleshoot.md +115 -0
- package/skills/trtc-onboarding/reference/path-c-expand.md +43 -0
- package/skills/trtc-onboarding/reference/reporting-protocol.md +174 -0
- package/skills/trtc-onboarding/reference/supported-matrix.md +100 -0
- package/skills/trtc-onboarding/reference/usersig-handling.md +140 -0
- package/skills/trtc-search/SKILL.md +221 -0
- package/skills/trtc-topic/SKILL.md +638 -0
- package/skills/trtc-topic/guardrails/__pycache__/gate_slice_read.cpython-313.pyc +0 -0
- package/skills/trtc-topic/guardrails/__pycache__/gate_slice_write.cpython-313.pyc +0 -0
- package/skills/trtc-topic/guardrails/__pycache__/stop_require_apply_evidence.cpython-313.pyc +0 -0
- package/skills/trtc-topic/guardrails/gate_slice_read.py +133 -0
- package/skills/trtc-topic/guardrails/gate_slice_write.py +169 -0
- package/skills/trtc-topic/guardrails/stop_require_apply_evidence.py +97 -0
- package/skills/trtc-topic/references/execution-units.yaml +58 -0
- package/skills/trtc-topic/runtime/README.md +50 -0
- package/skills/trtc-topic/runtime/RUNTIME.md +128 -0
- package/skills/trtc-topic/runtime/lib/__init__.py +0 -0
- package/skills/trtc-topic/runtime/lib/platforms.py +194 -0
- package/skills/trtc-topic/runtime/package-lock.json +1211 -0
- package/skills/trtc-topic/runtime/package.json +13 -0
- package/skills/trtc-topic/runtime/telemetry-bridge.mjs +339 -0
- package/skills/trtc-topic/runtime/telemetry_collector.py +293 -0
- package/skills/trtc-topic/scripts/STATE-MACHINE-GUIDE.md +186 -0
- package/skills/trtc-topic/scripts/__pycache__/apply.cpython-313.pyc +0 -0
- package/skills/trtc-topic/scripts/apply.py +581 -0
- package/skills/trtc-topic/scripts/finalize_session.py +113 -0
- package/skills/trtc-topic/scripts/init_slice_queue.py +96 -0
- package/skills/trtc-topic/scripts/lib/__pycache__/state_machine.cpython-313.pyc +0 -0
- package/skills/trtc-topic/scripts/lib/state_machine.py +328 -0
- package/skills/trtc-topic/scripts/next_slice.py +137 -0
- package/skills/trtc-topic/tests/README.md +70 -0
- package/skills/trtc-topic/tests/__pycache__/conftest.cpython-313-pytest-9.0.2.pyc +0 -0
- package/skills/trtc-topic/tests/__pycache__/conftest.cpython-313-pytest-9.0.3.pyc +0 -0
- package/skills/trtc-topic/tests/__pycache__/test_apply_cli.cpython-313-pytest-9.0.2.pyc +0 -0
- package/skills/trtc-topic/tests/__pycache__/test_apply_cli.cpython-313-pytest-9.0.3.pyc +0 -0
- package/skills/trtc-topic/tests/__pycache__/test_end_to_end.cpython-313-pytest-9.0.2.pyc +0 -0
- package/skills/trtc-topic/tests/__pycache__/test_end_to_end.cpython-313-pytest-9.0.3.pyc +0 -0
- package/skills/trtc-topic/tests/__pycache__/test_finalize_session.cpython-313-pytest-9.0.2.pyc +0 -0
- package/skills/trtc-topic/tests/__pycache__/test_finalize_session.cpython-313-pytest-9.0.3.pyc +0 -0
- package/skills/trtc-topic/tests/__pycache__/test_gates.cpython-313-pytest-9.0.2.pyc +0 -0
- package/skills/trtc-topic/tests/__pycache__/test_gates.cpython-313-pytest-9.0.3.pyc +0 -0
- package/skills/trtc-topic/tests/__pycache__/test_session_resolver.cpython-313-pytest-9.0.2.pyc +0 -0
- package/skills/trtc-topic/tests/__pycache__/test_session_resolver.cpython-313-pytest-9.0.3.pyc +0 -0
- package/skills/trtc-topic/tests/__pycache__/test_state_machine.cpython-313-pytest-9.0.2.pyc +0 -0
- package/skills/trtc-topic/tests/__pycache__/test_state_machine.cpython-313-pytest-9.0.3.pyc +0 -0
- package/skills/trtc-topic/tests/__pycache__/test_stop_require_apply.cpython-313-pytest-9.0.2.pyc +0 -0
- package/skills/trtc-topic/tests/__pycache__/test_stop_require_apply.cpython-313-pytest-9.0.3.pyc +0 -0
- package/skills/trtc-topic/tests/__pycache__/test_topic_skill_invariants.cpython-313-pytest-9.0.2.pyc +0 -0
- package/skills/trtc-topic/tests/__pycache__/test_topic_skill_invariants.cpython-313-pytest-9.0.3.pyc +0 -0
- package/skills/trtc-topic/tests/conftest.py +72 -0
- package/skills/trtc-topic/tests/test_apply_cli.py +480 -0
- package/skills/trtc-topic/tests/test_end_to_end.py +305 -0
- package/skills/trtc-topic/tests/test_finalize_session.py +51 -0
- package/skills/trtc-topic/tests/test_gates.py +316 -0
- package/skills/trtc-topic/tests/test_session_resolver.py +260 -0
- package/skills/trtc-topic/tests/test_state_machine.py +414 -0
- package/skills/trtc-topic/tests/test_stop_require_apply.py +99 -0
- package/skills/trtc-topic/tests/test_topic_skill_invariants.py +130 -0
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
# Scenario 文件写作规范(Spec)
|
|
2
|
+
|
|
3
|
+
> 本文档定义 `knowledge-base/scenarios/{scenario-id}.md` 的标准结构。
|
|
4
|
+
> 新建场景文件按本规范写;老文件按本规范逐步对齐。
|
|
5
|
+
> 配套:`slice-spec.md`(slice 级规范)、`index.yaml`(场景索引)。
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 一、scenario 文件的角色
|
|
10
|
+
|
|
11
|
+
scenario 文件是 **topic skill 的场景剧本**。topic 接到一个场景 id 后,把这份文件当 ground truth,按它说的:
|
|
12
|
+
|
|
13
|
+
- 列出场景包含哪些能力(slice)
|
|
14
|
+
- 决定是否让用户在"主链路 / 完整版"之间选 coverage
|
|
15
|
+
- 走每一步 slice 集成
|
|
16
|
+
|
|
17
|
+
→ **写 scenario 文件 = 给 topic 提供执行剧本**,措辞应面向"AI 读这份文件后该做什么"。
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 二、两种场景形态:A vs B
|
|
22
|
+
|
|
23
|
+
每个场景按自身性质二选一形态,**不强制都要分层**。
|
|
24
|
+
|
|
25
|
+
| 形态 | 适用场景 | 特征 | 用户是否参与 coverage 选择 |
|
|
26
|
+
|---|---|---|---|
|
|
27
|
+
| **A:单一完整能力** | 所有 slice 缺一不可:1v1 通话、秀场直播间、电商直播等 | 能力不可拆,少一个就不成场景 | 否 |
|
|
28
|
+
| **B:主链路 + 可选增强** | 有清晰的"开箱可用最小集 + 推荐增强"边界:通用会议、协作工具等 | 主链路是默认,增强按需 | 是(minimal / complete 二选一,或可选模块多选) |
|
|
29
|
+
|
|
30
|
+
**形态 B 的两种 coverage 粒度:**
|
|
31
|
+
|
|
32
|
+
- **B-二选一(minimal / complete)**:增强项作为一个整体,用户在"主链路"和"完整版"之间二选一。写 `enhancement_level`。
|
|
33
|
+
- **B-多选(必装骨架 + 可选模块多选)**:增强项彼此独立、用户通常只要其中几项(典型如通用会议:要屏幕共享和预约,但不要美颜)。此时**必装骨架 always on,可选模块逐项多选,默认只勾选命中用户 `target_features` / 原始 prompt 的项**,结果写入 `confirmed_plan = 必装骨架 + 选中模块`。
|
|
34
|
+
- 选这种粒度的判据:可选项之间没有"要就全要"的耦合,且默认全装会给用户塞他没要的功能(over-integration)。
|
|
35
|
+
- 反模式:把这类场景写成 Form A(整张 `slices:` 全集默认安装)——这正是"用户没要美颜却被装上美颜"的根因,**禁止**。
|
|
36
|
+
- 章节写法见下方「形态 B:能力展示 + coverage」的多选变体说明;参考实现 `scenarios/conference/base/general-conference.md`。
|
|
37
|
+
|
|
38
|
+
形态判断准则:
|
|
39
|
+
- 写 P1 之前先问自己——"如果不选这条增强,场景还能成立吗?" 能 → P1;不能 → P0。
|
|
40
|
+
- 整个场景全部 slice 都"少一个就不成立" → 直接走 A 形态,不必硬掰。
|
|
41
|
+
|
|
42
|
+
不确定时 default 走 A,将来发现确实有可选项再升级到 B。
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## 三、必备章节
|
|
47
|
+
|
|
48
|
+
每个 active scenario 文件 **必须** 包含以下章节。命名可微调,章节角色和顺序不能动。带 (A) (B) 标记的章节按形态二选一写法。
|
|
49
|
+
|
|
50
|
+
### 1. `## 场景概述`
|
|
51
|
+
|
|
52
|
+
一段 2-4 行散文,回答三个问题:
|
|
53
|
+
- 这个场景对应什么真实业务(举 1-2 个具体例子)
|
|
54
|
+
- 用户做这种场景的核心诉求是什么
|
|
55
|
+
- 与其他相似场景如何区分(边界划清)
|
|
56
|
+
|
|
57
|
+
**用途**:topic Step 1.5 展示给用户的"我帮你定位到了什么场景"的依据。
|
|
58
|
+
|
|
59
|
+
### 2. `## 能力清单` (A) 或 `## 能力分层` (B)
|
|
60
|
+
|
|
61
|
+
**slice id 必须与 `index.yaml` 一致**。
|
|
62
|
+
|
|
63
|
+
#### 形态 A:能力清单
|
|
64
|
+
|
|
65
|
+
```markdown
|
|
66
|
+
## 能力清单
|
|
67
|
+
|
|
68
|
+
- `<product>/<slice-id>` —— {一句话功能描述(中文,UI 上能直接用做按钮 label / 设置项标题)}
|
|
69
|
+
- ...
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
#### 形态 B:能力分层
|
|
73
|
+
|
|
74
|
+
```markdown
|
|
75
|
+
## 能力分层
|
|
76
|
+
|
|
77
|
+
### P0 主链路(必装)
|
|
78
|
+
|
|
79
|
+
- `<product>/<slice-id>` —— {一句话}
|
|
80
|
+
- ...
|
|
81
|
+
|
|
82
|
+
### P1 常见增强(可选)
|
|
83
|
+
|
|
84
|
+
- `<product>/<slice-id>` —— {一句话}
|
|
85
|
+
- 推荐默认勾选:是 / 否
|
|
86
|
+
- ...
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**P1 字段说明(仅形态 B)**:
|
|
90
|
+
|
|
91
|
+
| 字段 | 含义 | 取值 |
|
|
92
|
+
|---|---|---|
|
|
93
|
+
| `推荐默认勾选` | minimal coverage 时是否仍当作必装;complete 时是否预选 | 是 / 否 |
|
|
94
|
+
|
|
95
|
+
### 3. `## 能力展示` (A) 或 `## 能力展示与 coverage 选择` (B)
|
|
96
|
+
|
|
97
|
+
**topic Step 1.5 直接照抄的展示模板**。包含展示文案 + (B 形态特有) AskUserQuestion 选项。
|
|
98
|
+
|
|
99
|
+
#### 形态 A:能力展示
|
|
100
|
+
|
|
101
|
+
```markdown
|
|
102
|
+
## 能力展示
|
|
103
|
+
|
|
104
|
+
### 展示文案
|
|
105
|
+
|
|
106
|
+
我帮你定位到「{场景中文名}」场景,包含以下 {总数} 项能力:
|
|
107
|
+
|
|
108
|
+
• {slice 1 中文名} (`{slice id}`)
|
|
109
|
+
• {slice 2 中文名} (`{slice id}`)
|
|
110
|
+
...
|
|
111
|
+
|
|
112
|
+
接下来开始集成。
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
A 形态不向用户提问 coverage,topic 展示完直接进 Step 2。
|
|
116
|
+
|
|
117
|
+
#### 形态 B:能力展示 + coverage
|
|
118
|
+
|
|
119
|
+
```markdown
|
|
120
|
+
## 能力展示与 coverage 选择
|
|
121
|
+
|
|
122
|
+
### 展示文案
|
|
123
|
+
|
|
124
|
+
我帮你定位到「{场景中文名}」场景,包含以下能力:
|
|
125
|
+
|
|
126
|
+
📋 主链路(必装,{P0 count} 项)
|
|
127
|
+
• {P0 slice 1 中文名} (`{slice id}`)
|
|
128
|
+
• {P0 slice 2 中文名} (`{slice id}`)
|
|
129
|
+
...
|
|
130
|
+
|
|
131
|
+
➕ 增强能力(可选,{P1 count} 项)
|
|
132
|
+
• {P1 slice 1 中文名} (`{slice id}`) {如"推荐默认勾选 = 是",加 ✓}
|
|
133
|
+
...
|
|
134
|
+
|
|
135
|
+
集成哪种?
|
|
136
|
+
1) 主链路(最快,开箱可用基础{场景类型})
|
|
137
|
+
2) 完整版(含全部 {总数} 项能力,推荐)
|
|
138
|
+
|
|
139
|
+
### AskUserQuestion 选项
|
|
140
|
+
|
|
141
|
+
| 选项 | label | 写入 session |
|
|
142
|
+
|---|---|---|
|
|
143
|
+
| 1 | 主链路 | `enhancement_level: minimal` |
|
|
144
|
+
| 2 | 完整版 | `enhancement_level: complete` |
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**B-多选变体(必装骨架 + 可选模块多选)**:当增强项彼此独立、不应默认全装时,用这种写法替代上面的二选一表。章节里必须包含:
|
|
148
|
+
|
|
149
|
+
```markdown
|
|
150
|
+
## 能力展示与 coverage 选择
|
|
151
|
+
|
|
152
|
+
### 必装骨架(always on,不向用户提问)
|
|
153
|
+
- `<product>/<skeleton-slice>` —— ...
|
|
154
|
+
|
|
155
|
+
### 可选模块(多选,默认只勾选命中用户需求的项)
|
|
156
|
+
- `<product>/<optional-slice>` —— ...
|
|
157
|
+
|
|
158
|
+
### 执行规则(topic 必须遵守)
|
|
159
|
+
1. 预勾选 = 仅命中 `target_features` / 原始 prompt 的可选模块;其余默认不勾。
|
|
160
|
+
2. 展示文案(说明骨架默认装 + 已识别到的增强项)。
|
|
161
|
+
3. AskUserQuestion 多选(超 4 项分组拆问)。**每组必须包含「以上都不需要」选项(value=`none`),放在末尾,作为用户显式拒绝该组所有能力的出口。选中`none`时该组其他选项视为未勾选。**
|
|
162
|
+
4. 写 `confirmed_plan = 必装骨架 + 选中模块`(唯一下游真源)。
|
|
163
|
+
5. 未选中的模块不得进 `confirmed_plan`,也不得在代码里顺手生成。
|
|
164
|
+
6. `enhancement_level` 仅兼容:全选 → complete,否则 → minimal。
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
topic Step 1.5 会识别这种章节并按「执行规则」走,而不是把整张 `slices:` 当默认全集。
|
|
168
|
+
|
|
169
|
+
### 4. `## 前置条件`
|
|
170
|
+
|
|
171
|
+
集成前用户必须做的事(控制台配置、SDK 版本、账号开通、平台权限等)。topic Step 2 展示给用户。
|
|
172
|
+
|
|
173
|
+
```markdown
|
|
174
|
+
- 已开通 TRTC 服务并获取 SDKAppID 和 SecretKey
|
|
175
|
+
- {平台} SDK 版本 ≥ {version}
|
|
176
|
+
- {权限 / 配置 / 其他}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### 5. `## 验收 Checklist`
|
|
180
|
+
|
|
181
|
+
集成完成后用户用来自检"我这套真的跑起来了吗"的清单。topic Step 完成后展示。
|
|
182
|
+
|
|
183
|
+
```markdown
|
|
184
|
+
- [ ] 用户能登录并进入会议
|
|
185
|
+
- [ ] 摄像头 / 麦克风可以正常打开关闭
|
|
186
|
+
- [ ] {针对本场景的特有验收点}
|
|
187
|
+
- [ ] {...}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### 6. `## 排障速查`(可选但强烈建议)
|
|
191
|
+
|
|
192
|
+
把场景下高频出错的 3-5 个症状 → 排查路径列出。**不重复 slice 内的排障**,只列**跨 slice、属于场景级的**问题。
|
|
193
|
+
|
|
194
|
+
例如通用会议场景:
|
|
195
|
+
- "进得去房但是看不到别人画面" → 检查推流 + 拉流 + 视频布局三个 slice 的状态
|
|
196
|
+
- "聊天发不出去" → 检查会控秩序是否禁聊 + room-chat slice 状态
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## 四、可选章节
|
|
201
|
+
|
|
202
|
+
按需写,不强制:
|
|
203
|
+
|
|
204
|
+
- `## 子场景命中差异` —— 同一场景下不同子形态(如"日常团队会议" vs "培训会议")的 slice 增减建议
|
|
205
|
+
- `## 跨产品依赖` —— 本场景依赖其他产品 SDK 时的说明
|
|
206
|
+
- `## 设计取舍` —— 为什么这个场景这么拆、和兄弟场景的边界(给后续 scenario 作者看的设计笔记)
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
## 五、字段一致性检查
|
|
211
|
+
|
|
212
|
+
写完 scenario 文件,检查:
|
|
213
|
+
|
|
214
|
+
| 检查项 | 哪两处必须一致 |
|
|
215
|
+
|---|---|
|
|
216
|
+
| slice id 列表 | `index.yaml` `scenarios.<id>.slices` 数组 ↔ 本文件「能力清单」(A) 或 「能力分层」(B) 总和 |
|
|
217
|
+
| 中文名 | 「能力清单 / 能力分层」中的 slice 名 ↔ 「能力展示」展示文案中的 slice 名 |
|
|
218
|
+
| `推荐默认勾选 = 是`(仅 B) | 必须在「能力展示」展示文案的 ✓ 标记列表 |
|
|
219
|
+
|
|
220
|
+
未来可加 `scripts/validate_scenario.py` 自动跑这些检查。
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## 六、模板骨架
|
|
225
|
+
|
|
226
|
+
### A 形态模板(单一完整能力)
|
|
227
|
+
|
|
228
|
+
适合:1v1-video-call、entertainment-live-room 等场景所有 slice 缺一不可的情况。
|
|
229
|
+
|
|
230
|
+
```markdown
|
|
231
|
+
# {场景中文名}({scenario-id})
|
|
232
|
+
|
|
233
|
+
## 场景概述
|
|
234
|
+
|
|
235
|
+
{2-4 行散文}
|
|
236
|
+
|
|
237
|
+
## 能力清单
|
|
238
|
+
|
|
239
|
+
- `{product}/{slice-id-1}` —— {一句话}
|
|
240
|
+
- `{product}/{slice-id-2}` —— {一句话}
|
|
241
|
+
- ...
|
|
242
|
+
|
|
243
|
+
## 能力展示
|
|
244
|
+
|
|
245
|
+
### 展示文案
|
|
246
|
+
|
|
247
|
+
我帮你定位到「{场景中文名}」场景,包含以下 {总数} 项能力:
|
|
248
|
+
|
|
249
|
+
• {slice 1 中文名} (`{slice id}`)
|
|
250
|
+
• {slice 2 中文名} (`{slice id}`)
|
|
251
|
+
• ...
|
|
252
|
+
|
|
253
|
+
接下来开始集成。
|
|
254
|
+
|
|
255
|
+
## 前置条件
|
|
256
|
+
|
|
257
|
+
- {条件 1}
|
|
258
|
+
- {条件 2}
|
|
259
|
+
|
|
260
|
+
## 验收 Checklist
|
|
261
|
+
|
|
262
|
+
- [ ] {验收点 1}
|
|
263
|
+
- [ ] {验收点 2}
|
|
264
|
+
|
|
265
|
+
## 排障速查
|
|
266
|
+
|
|
267
|
+
| 症状 | 可能原因 | 排查方向 |
|
|
268
|
+
|---|---|---|
|
|
269
|
+
| {症状 1} | {原因} | {slice / 配置项} |
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
### B 形态模板(主链路 + 可选增强)
|
|
273
|
+
|
|
274
|
+
适合:general-conference、协作工具等有清晰 P0/P1 边界的场景。
|
|
275
|
+
|
|
276
|
+
```markdown
|
|
277
|
+
# {场景中文名}({scenario-id})
|
|
278
|
+
|
|
279
|
+
## 场景概述
|
|
280
|
+
|
|
281
|
+
{2-4 行散文}
|
|
282
|
+
|
|
283
|
+
## 能力分层
|
|
284
|
+
|
|
285
|
+
### P0 主链路(必装)
|
|
286
|
+
|
|
287
|
+
- `{product}/{slice-id-1}` —— {一句话}
|
|
288
|
+
- `{product}/{slice-id-2}` —— {一句话}
|
|
289
|
+
|
|
290
|
+
### P1 常见增强(可选)
|
|
291
|
+
|
|
292
|
+
- `{product}/{slice-id-3}` —— {一句话}
|
|
293
|
+
- 推荐默认勾选:是
|
|
294
|
+
- `{product}/{slice-id-4}` —— {一句话}
|
|
295
|
+
- 推荐默认勾选:否
|
|
296
|
+
|
|
297
|
+
## 能力展示与 coverage 选择
|
|
298
|
+
|
|
299
|
+
### 展示文案
|
|
300
|
+
|
|
301
|
+
我帮你定位到「{场景中文名}」场景,包含以下能力:
|
|
302
|
+
|
|
303
|
+
📋 主链路(必装,{P0 count} 项)
|
|
304
|
+
• {P0 slice 1 中文名} (`{slice id}`)
|
|
305
|
+
• ...
|
|
306
|
+
|
|
307
|
+
➕ 增强能力(可选,{P1 count} 项)
|
|
308
|
+
• {P1 slice 1 中文名} (`{slice id}`) ✓
|
|
309
|
+
• {P1 slice 2 中文名} (`{slice id}`)
|
|
310
|
+
• ...
|
|
311
|
+
|
|
312
|
+
集成哪种?
|
|
313
|
+
1) 主链路(最快,开箱可用基础{场景类型})
|
|
314
|
+
2) 完整版(含全部 {总数} 项能力,推荐)
|
|
315
|
+
|
|
316
|
+
### AskUserQuestion 选项
|
|
317
|
+
|
|
318
|
+
| 选项 | label | 写入 session |
|
|
319
|
+
|---|---|---|
|
|
320
|
+
| 1 | 主链路 | `enhancement_level: minimal` |
|
|
321
|
+
| 2 | 完整版 | `enhancement_level: complete` |
|
|
322
|
+
|
|
323
|
+
## 前置条件
|
|
324
|
+
|
|
325
|
+
- {条件 1}
|
|
326
|
+
- {条件 2}
|
|
327
|
+
|
|
328
|
+
## 验收 Checklist
|
|
329
|
+
|
|
330
|
+
- [ ] {验收点 1}
|
|
331
|
+
- [ ] {验收点 2}
|
|
332
|
+
|
|
333
|
+
## 排障速查
|
|
334
|
+
|
|
335
|
+
| 症状 | 可能原因 | 排查方向 |
|
|
336
|
+
|---|---|---|
|
|
337
|
+
| {症状 1} | {原因} | {slice / 配置项} |
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
---
|
|
341
|
+
|
|
342
|
+
## 七、对老文件的迁移建议
|
|
343
|
+
|
|
344
|
+
老文件不强制立刻按 spec 重写。建议路径:
|
|
345
|
+
|
|
346
|
+
1. **`general-conference.md`** → 走 B 形态。原文里已有"P0 默认会议骨架 / P1 按需补命中"分层结构,只需补「能力展示与 coverage 选择」「验收 Checklist」两节,其他内容可移到「设计取舍」可选章节。
|
|
347
|
+
|
|
348
|
+
2. **`entertainment-live-room.md`** → 走 A 形态。原文按"主播端流程 / 观众端流程 / 阶段一 / 阶段二"组织,先按 spec 改为「能力清单」「能力展示」+ 验收 Checklist;流程描述可保留为「子场景命中差异」可选章节。
|
|
349
|
+
|
|
350
|
+
3. **新建场景** → 直接走 spec,按形态选 A 或 B 模板。
|