@tencent-rtc/trtc-agent-skills 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (360) hide show
  1. package/.cursor/rules/main.mdc +12 -0
  2. package/AGENTS.md +14 -104
  3. package/CLAUDE.md +15 -127
  4. package/CODEBUDDY.md +32 -118
  5. package/README.md +7 -5
  6. package/README.zh.md +7 -5
  7. package/bin/cli.js +133 -41
  8. package/hooks/__pycache__/cursor-adapter.cpython-313.pyc +0 -0
  9. package/hooks/cursor-adapter.py +45 -18
  10. package/hooks/hooks-cursor.json +5 -18
  11. package/hooks/hooks.json +6 -31
  12. package/knowledge-base/conference/web/index.yaml +143 -0
  13. package/knowledge-base/platform-slice-template.md +1041 -133
  14. package/knowledge-base/products.yaml +76 -0
  15. package/knowledge-base/scenario-spec.md +1316 -115
  16. package/knowledge-base/scenarios/conference/base/general-conference.md +22 -2
  17. package/knowledge-base/scenarios/conference/base/webinar-conference.md +14 -0
  18. package/knowledge-base/scenarios/conference/medical/1v1-video-consultation.md +19 -0
  19. package/knowledge-base/scenarios/conference/medical/medical-multidoctor-consultation.md +13 -0
  20. package/knowledge-base/scenarios/live/entertainment-live-room.md +12 -0
  21. package/knowledge-base/slice-spec.md +2377 -299
  22. package/knowledge-base/slices/conference/web/integration-audit.md +1 -1
  23. package/knowledge-base/slices/conference/web/login-auth.md +14 -1
  24. package/knowledge-base/tooling/aliases.yaml +92 -0
  25. package/knowledge-base/tooling/intent-signals.yaml +181 -0
  26. package/knowledge-base/tooling/symptom-keywords.yaml +21 -0
  27. package/package.json +1 -1
  28. package/skills/trtc/SKILL.md +202 -245
  29. package/skills/trtc/hooks/__pycache__/report_prompt.cpython-313.pyc +0 -0
  30. package/skills/{trtc-topic/guardrails → trtc/hooks}/gate_slice_read.py +12 -8
  31. package/skills/{trtc-topic/guardrails → trtc/hooks}/gate_slice_write.py +16 -12
  32. package/skills/{trtc-topic/guardrails → trtc/hooks}/stop_require_apply_evidence.py +22 -14
  33. package/skills/trtc/hooks/topic_phase_gate.py +161 -0
  34. package/skills/{trtc-topic → trtc}/runtime/README.md +2 -2
  35. package/skills/{trtc-onboarding/reference/reporting-protocol.md → trtc/runtime/REPORTING.md} +5 -5
  36. package/skills/{trtc-topic → trtc}/runtime/RUNTIME.md +5 -5
  37. package/skills/trtc/runtime/lib/__init__.py +0 -0
  38. package/skills/{trtc-topic → trtc}/runtime/package-lock.json +2 -2
  39. package/skills/{trtc-topic → trtc}/runtime/package.json +2 -2
  40. package/skills/{trtc-topic → trtc}/runtime/telemetry-bridge.mjs +1 -1
  41. package/skills/{trtc-topic/scripts → trtc/tools}/STATE-MACHINE-GUIDE.md +23 -23
  42. package/skills/trtc/tools/__init__.py +2 -0
  43. package/skills/trtc/tools/__pycache__/__init__.cpython-313.pyc +0 -0
  44. package/skills/trtc/tools/__pycache__/query_classifier.cpython-313.pyc +0 -0
  45. package/skills/trtc/tools/__pycache__/reporting.cpython-313.pyc +0 -0
  46. package/skills/trtc/tools/__pycache__/search.cpython-313.pyc +0 -0
  47. package/skills/trtc/tools/__pycache__/session.cpython-313.pyc +0 -0
  48. package/skills/trtc/tools/apply.py +540 -0
  49. package/skills/trtc/tools/docs.py +712 -0
  50. package/skills/trtc/tools/docsbot.py +182 -0
  51. package/skills/trtc/tools/entry/render_ai_instructions.py +92 -0
  52. package/skills/trtc/tools/flow.py +1089 -0
  53. package/skills/{trtc-topic/scripts → trtc/tools}/init_slice_queue.py +5 -4
  54. package/skills/{trtc-topic/scripts → trtc/tools}/next_slice.py +5 -4
  55. package/skills/trtc/tools/query_classifier.py +301 -0
  56. package/skills/trtc/tools/reporting.py +447 -0
  57. package/skills/trtc/tools/search.py +817 -0
  58. package/skills/trtc/tools/session.py +1261 -0
  59. package/skills/trtc/tools/state_machine.py +690 -0
  60. package/skills/trtc-ai-service/README.md +195 -0
  61. package/skills/trtc-ai-service/README.zh-CN.md +193 -0
  62. package/skills/trtc-ai-service/SKILL.md +945 -0
  63. package/skills/trtc-ai-service/auto_adapters/README.md +40 -0
  64. package/skills/trtc-ai-service/auto_adapters/frontend-spa/README.md +27 -0
  65. package/skills/trtc-ai-service/auto_adapters/frontend-spa/angular/voice-agent.component.ts.tpl +131 -0
  66. package/skills/trtc-ai-service/auto_adapters/frontend-spa/manifest.yaml +57 -0
  67. package/skills/trtc-ai-service/auto_adapters/frontend-spa/react/VoiceAgent.tsx.tpl +142 -0
  68. package/skills/trtc-ai-service/auto_adapters/frontend-spa/vue/VoiceAgent.vue.tpl +121 -0
  69. package/skills/trtc-ai-service/auto_adapters/integration_templates/generic-backend.md +45 -0
  70. package/skills/trtc-ai-service/auto_adapters/integration_templates/generic-frontend.md +51 -0
  71. package/skills/trtc-ai-service/auto_adapters/integration_templates/generic-rest-api.md +93 -0
  72. package/skills/trtc-ai-service/auto_adapters/java-backend/README.md +25 -0
  73. package/skills/trtc-ai-service/auto_adapters/java-backend/manifest.yaml +30 -0
  74. package/skills/trtc-ai-service/auto_adapters/java-backend/quarkus/VoiceAgentFilter.java.tpl +64 -0
  75. package/skills/trtc-ai-service/auto_adapters/java-backend/springboot/VoiceAgentFilter.java.tpl +91 -0
  76. package/skills/trtc-ai-service/auto_adapters/manifest.yaml +43 -0
  77. package/skills/trtc-ai-service/auto_adapters/node-backend/README.md +25 -0
  78. package/skills/trtc-ai-service/auto_adapters/node-backend/express.js.tpl +40 -0
  79. package/skills/trtc-ai-service/auto_adapters/node-backend/fastify.js.tpl +27 -0
  80. package/skills/trtc-ai-service/auto_adapters/node-backend/koa.js.tpl +31 -0
  81. package/skills/trtc-ai-service/auto_adapters/node-backend/manifest.yaml +47 -0
  82. package/skills/trtc-ai-service/auto_adapters/python-backend/README.md +22 -0
  83. package/skills/trtc-ai-service/auto_adapters/python-backend/django.py.tpl +32 -0
  84. package/skills/trtc-ai-service/auto_adapters/python-backend/fastapi.py.tpl +35 -0
  85. package/skills/trtc-ai-service/auto_adapters/python-backend/flask.py.tpl +31 -0
  86. package/skills/trtc-ai-service/auto_adapters/python-backend/manifest.yaml +45 -0
  87. package/skills/trtc-ai-service/capabilities/__init__.py +43 -0
  88. package/skills/trtc-ai-service/capabilities/conversation-core/.env.example +29 -0
  89. package/skills/trtc-ai-service/capabilities/conversation-core/INTEGRATION.md +134 -0
  90. package/skills/trtc-ai-service/capabilities/conversation-core/INTERFACE_ADAPT.md +111 -0
  91. package/skills/trtc-ai-service/capabilities/conversation-core/QUICK_START.md +62 -0
  92. package/skills/trtc-ai-service/capabilities/conversation-core/manifest.yaml +250 -0
  93. package/skills/trtc-ai-service/capabilities/conversation-core/requirements.txt +6 -0
  94. package/skills/trtc-ai-service/capabilities/conversation-core/src/__init__.py +10 -0
  95. package/skills/trtc-ai-service/capabilities/conversation-core/src/_capability_loader.py +218 -0
  96. package/skills/trtc-ai-service/capabilities/conversation-core/src/agent.py +231 -0
  97. package/skills/trtc-ai-service/capabilities/conversation-core/src/credentials.py +132 -0
  98. package/skills/trtc-ai-service/capabilities/conversation-core/src/health.py +355 -0
  99. package/skills/trtc-ai-service/capabilities/conversation-core/src/log_filter.py +76 -0
  100. package/skills/trtc-ai-service/capabilities/conversation-core/src/modality.py +109 -0
  101. package/skills/trtc-ai-service/capabilities/conversation-core/src/server.py +312 -0
  102. package/skills/trtc-ai-service/capabilities/conversation-core/src/trtc_client.py +315 -0
  103. package/skills/trtc-ai-service/capabilities/conversation-core/src/usersig.py +90 -0
  104. package/skills/trtc-ai-service/capabilities/conversation-core/tests/test_skeleton.py +216 -0
  105. package/skills/trtc-ai-service/capabilities/conversation-core/web-demo/README.md +48 -0
  106. package/skills/trtc-ai-service/capabilities/conversation-core/web-demo/app.js +415 -0
  107. package/skills/trtc-ai-service/capabilities/conversation-core/web-demo/index.html +68 -0
  108. package/skills/trtc-ai-service/capabilities/conversation-core/web-demo/styles.css +136 -0
  109. package/skills/trtc-ai-service/capabilities/digital-human/README.md +31 -0
  110. package/skills/trtc-ai-service/capabilities/digital-human/manifest.yaml +64 -0
  111. package/skills/trtc-ai-service/capabilities/digital-human/src/__init__.py +2 -0
  112. package/skills/trtc-ai-service/capabilities/digital-human/src/router.py +43 -0
  113. package/skills/trtc-ai-service/capabilities/human-handoff/INTERFACE_ADAPT.md +353 -0
  114. package/skills/trtc-ai-service/capabilities/human-handoff/README.md +44 -0
  115. package/skills/trtc-ai-service/capabilities/human-handoff/manifest.yaml +227 -0
  116. package/skills/trtc-ai-service/capabilities/human-handoff/src/__init__.py +2 -0
  117. package/skills/trtc-ai-service/capabilities/human-handoff/src/adapters/__init__.py +9 -0
  118. package/skills/trtc-ai-service/capabilities/human-handoff/src/adapters/default_rest.py +242 -0
  119. package/skills/trtc-ai-service/capabilities/human-handoff/src/adapters/factory.py +89 -0
  120. package/skills/trtc-ai-service/capabilities/human-handoff/src/adapters/local_queue.py +258 -0
  121. package/skills/trtc-ai-service/capabilities/human-handoff/src/adapters/mock.py +132 -0
  122. package/skills/trtc-ai-service/capabilities/human-handoff/src/core/__init__.py +25 -0
  123. package/skills/trtc-ai-service/capabilities/human-handoff/src/core/intent_detector.py +75 -0
  124. package/skills/trtc-ai-service/capabilities/human-handoff/src/core/models.py +163 -0
  125. package/skills/trtc-ai-service/capabilities/human-handoff/src/core/service.py +192 -0
  126. package/skills/trtc-ai-service/capabilities/human-handoff/src/feedback_store.py +54 -0
  127. package/skills/trtc-ai-service/capabilities/human-handoff/src/ports/__init__.py +4 -0
  128. package/skills/trtc-ai-service/capabilities/human-handoff/src/ports/handoff_client.py +86 -0
  129. package/skills/trtc-ai-service/capabilities/human-handoff/src/queue.py +62 -0
  130. package/skills/trtc-ai-service/capabilities/human-handoff/src/router.py +201 -0
  131. package/skills/trtc-ai-service/capabilities/human-handoff/src/summary_link.py +77 -0
  132. package/skills/trtc-ai-service/capabilities/human-handoff/src/trigger.py +25 -0
  133. package/skills/trtc-ai-service/capabilities/knowledge-base/INTERFACE_ADAPT.md +297 -0
  134. package/skills/trtc-ai-service/capabilities/knowledge-base/README.md +51 -0
  135. package/skills/trtc-ai-service/capabilities/knowledge-base/data/faq.json +20 -0
  136. package/skills/trtc-ai-service/capabilities/knowledge-base/manifest.yaml +211 -0
  137. package/skills/trtc-ai-service/capabilities/knowledge-base/src/__init__.py +8 -0
  138. package/skills/trtc-ai-service/capabilities/knowledge-base/src/adapters/__init__.py +9 -0
  139. package/skills/trtc-ai-service/capabilities/knowledge-base/src/adapters/default_rest.py +209 -0
  140. package/skills/trtc-ai-service/capabilities/knowledge-base/src/adapters/factory.py +86 -0
  141. package/skills/trtc-ai-service/capabilities/knowledge-base/src/adapters/local_json.py +172 -0
  142. package/skills/trtc-ai-service/capabilities/knowledge-base/src/adapters/mock.py +91 -0
  143. package/skills/trtc-ai-service/capabilities/knowledge-base/src/core/__init__.py +12 -0
  144. package/skills/trtc-ai-service/capabilities/knowledge-base/src/core/models.py +77 -0
  145. package/skills/trtc-ai-service/capabilities/knowledge-base/src/core/scoring.py +73 -0
  146. package/skills/trtc-ai-service/capabilities/knowledge-base/src/core/service.py +78 -0
  147. package/skills/trtc-ai-service/capabilities/knowledge-base/src/ports/__init__.py +4 -0
  148. package/skills/trtc-ai-service/capabilities/knowledge-base/src/ports/kb_client.py +61 -0
  149. package/skills/trtc-ai-service/capabilities/knowledge-base/src/retriever.py +56 -0
  150. package/skills/trtc-ai-service/capabilities/knowledge-base/src/router.py +85 -0
  151. package/skills/trtc-ai-service/capabilities/session-summary/INTERFACE_ADAPT.md +99 -0
  152. package/skills/trtc-ai-service/capabilities/session-summary/README.md +47 -0
  153. package/skills/trtc-ai-service/capabilities/session-summary/data/test_session.json +18 -0
  154. package/skills/trtc-ai-service/capabilities/session-summary/manifest.yaml +165 -0
  155. package/skills/trtc-ai-service/capabilities/session-summary/src/__init__.py +2 -0
  156. package/skills/trtc-ai-service/capabilities/session-summary/src/adapters/__init__.py +5 -0
  157. package/skills/trtc-ai-service/capabilities/session-summary/src/adapters/base.py +31 -0
  158. package/skills/trtc-ai-service/capabilities/session-summary/src/adapters/default_rest.py +67 -0
  159. package/skills/trtc-ai-service/capabilities/session-summary/src/adapters/factory.py +51 -0
  160. package/skills/trtc-ai-service/capabilities/session-summary/src/adapters/local_json.py +42 -0
  161. package/skills/trtc-ai-service/capabilities/session-summary/src/adapters/mock.py +22 -0
  162. package/skills/trtc-ai-service/capabilities/session-summary/src/recorder.py +210 -0
  163. package/skills/trtc-ai-service/capabilities/session-summary/src/router.py +93 -0
  164. package/skills/trtc-ai-service/capabilities/session-summary/src/summarizer.py +163 -0
  165. package/skills/trtc-ai-service/capabilities/tool-calling/INTERFACE_ADAPT.md +158 -0
  166. package/skills/trtc-ai-service/capabilities/tool-calling/README.md +50 -0
  167. package/skills/trtc-ai-service/capabilities/tool-calling/data/tools.yaml +58 -0
  168. package/skills/trtc-ai-service/capabilities/tool-calling/examples/__init__.py +1 -0
  169. package/skills/trtc-ai-service/capabilities/tool-calling/examples/local_tools.py +101 -0
  170. package/skills/trtc-ai-service/capabilities/tool-calling/manifest.yaml +146 -0
  171. package/skills/trtc-ai-service/capabilities/tool-calling/src/__init__.py +8 -0
  172. package/skills/trtc-ai-service/capabilities/tool-calling/src/dispatcher.py +54 -0
  173. package/skills/trtc-ai-service/capabilities/tool-calling/src/registry.py +219 -0
  174. package/skills/trtc-ai-service/capabilities/tool-calling/src/router.py +50 -0
  175. package/skills/trtc-ai-service/references/business-contract-spec.md +263 -0
  176. package/skills/trtc-ai-service/scenarios/custom-builder/README.md +86 -0
  177. package/skills/trtc-ai-service/scenarios/custom-builder/output-templates/recipe.yaml.j2 +194 -0
  178. package/skills/trtc-ai-service/scenarios/custom-builder/prompts/q1-business-scenario.md +43 -0
  179. package/skills/trtc-ai-service/scenarios/custom-builder/prompts/q2-io-modality.md +57 -0
  180. package/skills/trtc-ai-service/scenarios/custom-builder/prompts/q3-ui-form.md +55 -0
  181. package/skills/trtc-ai-service/scenarios/custom-builder/prompts/q4-capabilities.md +78 -0
  182. package/skills/trtc-ai-service/scenarios/customer-service/README.md +114 -0
  183. package/skills/trtc-ai-service/scenarios/customer-service/recipe.yaml +154 -0
  184. package/skills/trtc-ai-service/scenarios/customer-service/sample-data/README.md +32 -0
  185. package/skills/trtc-ai-service/scenarios/customer-service/sample-data/faq-sample.json +37 -0
  186. package/skills/trtc-ai-service/scenarios/customer-service/system-prompt.template.md +94 -0
  187. package/skills/trtc-ai-service/scenarios/customer-service/ui/admin-board/app.js +347 -0
  188. package/skills/trtc-ai-service/scenarios/customer-service/ui/admin-board/index.html +125 -0
  189. package/skills/trtc-ai-service/scenarios/customer-service/ui/admin-board/styles.css +487 -0
  190. package/skills/trtc-ai-service/scenarios/customer-service/ui/admin-board/tokens.css +71 -0
  191. package/skills/trtc-ai-service/scenarios/customer-service/ui/design-system/DESIGN_GUIDELINES.md +370 -0
  192. package/skills/trtc-ai-service/scenarios/customer-service/ui/voice-customer-service/README.md +68 -0
  193. package/skills/trtc-ai-service/scenarios/customer-service/ui/voice-customer-service/app.js +1307 -0
  194. package/skills/trtc-ai-service/scenarios/customer-service/ui/voice-customer-service/data.js +40 -0
  195. package/skills/trtc-ai-service/scenarios/customer-service/ui/voice-customer-service/index.html +233 -0
  196. package/skills/trtc-ai-service/scenarios/customer-service/ui/voice-customer-service/mock-shop.json +21 -0
  197. package/skills/trtc-ai-service/scenarios/customer-service/ui/voice-customer-service/styles.css +603 -0
  198. package/skills/trtc-ai-service/scenarios/customer-service/ui/voice-customer-service/tokens.css +71 -0
  199. package/skills/trtc-ai-service/scenarios/customer-service/ui/widget-floating/agent-link.js +323 -0
  200. package/skills/trtc-ai-service/scenarios/customer-service/ui/widget-floating/app.js +458 -0
  201. package/skills/trtc-ai-service/scenarios/customer-service/ui/widget-floating/index.html +109 -0
  202. package/skills/trtc-ai-service/scenarios/customer-service/ui/widget-floating/styles.css +489 -0
  203. package/skills/trtc-ai-service/scenarios/customer-service/ui/widget-floating/tokens.css +59 -0
  204. package/skills/trtc-ai-service/scripts/add-capability.py +364 -0
  205. package/skills/trtc-ai-service/scripts/contract-adapt.py +334 -0
  206. package/skills/trtc-ai-service/scripts/detect-stack.py +40 -0
  207. package/skills/trtc-ai-service/scripts/lib/__init__.py +20 -0
  208. package/skills/trtc-ai-service/scripts/lib/adapter_codegen.py +509 -0
  209. package/skills/trtc-ai-service/scripts/lib/arbitrator.py +152 -0
  210. package/skills/trtc-ai-service/scripts/lib/contract_resolver.py +519 -0
  211. package/skills/trtc-ai-service/scripts/lib/credential_validators.py +253 -0
  212. package/skills/trtc-ai-service/scripts/lib/curl_parser.py +303 -0
  213. package/skills/trtc-ai-service/scripts/lib/degrader.py +140 -0
  214. package/skills/trtc-ai-service/scripts/lib/injector.py +347 -0
  215. package/skills/trtc-ai-service/scripts/lib/manifest_resolver.py +288 -0
  216. package/skills/trtc-ai-service/scripts/lib/openapi_parser.py +289 -0
  217. package/skills/trtc-ai-service/scripts/lib/stack_detector.py +159 -0
  218. package/skills/trtc-ai-service/scripts/lib/tokens_compile.py +204 -0
  219. package/skills/trtc-ai-service/scripts/post-install-patch.py +225 -0
  220. package/skills/trtc-ai-service/scripts/setup-credentials.py +393 -0
  221. package/skills/trtc-ai-service/scripts/verify-credentials.py +108 -0
  222. package/skills/trtc-ai-service/start.sh +111 -0
  223. package/skills/trtc-ai-service/tests/__init__.py +1 -0
  224. package/skills/trtc-ai-service/tests/test_arbitrator.py +64 -0
  225. package/skills/trtc-ai-service/tests/test_capability_overlay.py +85 -0
  226. package/skills/trtc-ai-service/tests/test_contract_resolver.py +190 -0
  227. package/skills/trtc-ai-service/tests/test_handoff_ports.py +195 -0
  228. package/skills/trtc-ai-service/tests/test_kb_ports.py +195 -0
  229. package/skills/trtc-ai-service/tests/test_manifest_resolver.py +95 -0
  230. package/skills/trtc-ai-service/tests/test_recipe_assembly.py +175 -0
  231. package/skills/trtc-ai-service/tests/test_stack_and_degrader.py +101 -0
  232. package/skills/trtc-ai-service/tests/test_verify_credentials.py +285 -0
  233. package/skills/trtc-ai-service/triggers.yaml +29 -0
  234. package/skills/trtc-conference/SKILL.md +324 -0
  235. package/skills/trtc-conference/flows/onboarding.md +205 -0
  236. package/skills/trtc-conference/flows/topic.md +474 -0
  237. package/skills/trtc-conference/flows/troubleshoot.md +85 -0
  238. package/skills/trtc-conference/hooks/pretooluse_require_business_decisions.py +213 -0
  239. package/skills/trtc-conference/playbooks/medical-quickstart.md +84 -0
  240. package/skills/trtc-conference/playbooks/official-roomkit.md +97 -0
  241. package/skills/trtc-conference/references/local-usersig/basic-info-config.ts +39 -0
  242. package/skills/trtc-conference/references/usersig-handling.md +134 -0
  243. package/skills/trtc-conference/templates/medical-consultation/src/config/lib-generate-test-usersig-es.min.d.ts +4 -0
  244. package/skills/trtc-conference/templates/medical-consultation/src/config/lib-generate-test-usersig-es.min.js +2 -0
  245. package/skills/trtc-conference/tests/__pycache__/test_conference_onboarding_contract.cpython-313-pytest-9.0.2.pyc +0 -0
  246. package/skills/trtc-conference/tests/__pycache__/test_conference_topic_flow_contract.cpython-313-pytest-9.0.2.pyc +0 -0
  247. package/skills/trtc-conference/tests/test_conference_index_contract.py +43 -0
  248. package/skills/trtc-conference/tests/test_conference_onboarding_contract.py +103 -0
  249. package/skills/trtc-conference/tests/test_conference_template_contract.py +25 -0
  250. package/skills/trtc-conference/tests/test_conference_topic_flow_contract.py +132 -0
  251. package/skills/trtc-conference/tools/apply_checks.py +328 -0
  252. package/skills/trtc-conference/verify_lib/__init__.py +0 -0
  253. package/skills/{trtc-apply/guardrails/apply_lib → trtc-conference/verify_lib}/rule_parser.py +1 -1
  254. package/skills/trtc-docs/SKILL.md +91 -119
  255. package/.cursor/rules/ui-mode.mdc +0 -99
  256. package/ai-instructions/base.md +0 -13
  257. package/ai-instructions/ui-mode.md +0 -93
  258. package/knowledge-base/index.yaml +0 -462
  259. package/skills/trtc/room-builder/SKILL.md +0 -133
  260. package/skills/trtc/room-builder/templates/scenarios/medical-consultation/README.md +0 -108
  261. package/skills/trtc/room-builder/tools/render_ai_instructions.py +0 -226
  262. package/skills/trtc-apply/SKILL.md +0 -97
  263. package/skills/trtc-onboarding/SKILL.md +0 -841
  264. package/skills/trtc-onboarding/reference/path-a1-demo.md +0 -103
  265. package/skills/trtc-onboarding/reference/path-a2-integrate.md +0 -737
  266. package/skills/trtc-onboarding/reference/path-b-troubleshoot.md +0 -186
  267. package/skills/trtc-onboarding/reference/path-c-expand.md +0 -43
  268. package/skills/trtc-onboarding/reference/supported-matrix.md +0 -100
  269. package/skills/trtc-search/SKILL.md +0 -228
  270. package/skills/trtc-topic/SKILL.md +0 -622
  271. package/skills/trtc-topic/scripts/apply.py +0 -581
  272. package/skills/trtc-topic/scripts/lib/state_machine.py +0 -328
  273. package/skills/trtc-topic/tests/README.md +0 -70
  274. package/skills/trtc-topic/tests/conftest.py +0 -72
  275. package/skills/trtc-topic/tests/test_apply_cli.py +0 -480
  276. package/skills/trtc-topic/tests/test_end_to_end.py +0 -305
  277. package/skills/trtc-topic/tests/test_finalize_session.py +0 -51
  278. package/skills/trtc-topic/tests/test_gates.py +0 -316
  279. package/skills/trtc-topic/tests/test_session_resolver.py +0 -260
  280. package/skills/trtc-topic/tests/test_state_machine.py +0 -414
  281. package/skills/trtc-topic/tests/test_stop_require_apply.py +0 -99
  282. package/skills/trtc-topic/tests/test_topic_skill_invariants.py +0 -130
  283. /package/skills/{trtc-topic → trtc}/runtime/lib/platforms.py +0 -0
  284. /package/skills/{trtc-topic → trtc}/runtime/telemetry_collector.py +0 -0
  285. /package/skills/{trtc-onboarding/reference → trtc/runtime}/usersig-handling.md +0 -0
  286. /package/skills/{trtc-topic/scripts → trtc/tools}/finalize_session.py +0 -0
  287. /package/skills/{trtc-apply/guardrails/apply_lib → trtc-ai-service/capabilities/conversation-core/tests}/__init__.py +0 -0
  288. /package/skills/{trtc-topic → trtc-conference}/references/execution-units.yaml +0 -0
  289. /package/skills/{trtc/room-builder/templates/scenarios/medical-consultation/src/config → trtc-conference/references/local-usersig}/lib-generate-test-usersig-es.min.d.ts +0 -0
  290. /package/skills/{trtc/room-builder/templates/scenarios/medical-consultation/src/config → trtc-conference/references/local-usersig}/lib-generate-test-usersig-es.min.js +0 -0
  291. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/docs/backend-contract.zh-CN.md +0 -0
  292. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/docs/integration.zh-CN.md +0 -0
  293. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/docs/theme.zh-CN.md +0 -0
  294. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/index.html +0 -0
  295. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/package.json +0 -0
  296. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/postcss.config.js +0 -0
  297. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/App.vue +0 -0
  298. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/components/ConsultationManagePanel.vue +0 -0
  299. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/components/LanguageSwitch.vue +0 -0
  300. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/components/LoadingSpinner.vue +0 -0
  301. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/components/MedicalAlert.vue +0 -0
  302. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/components/MedicalBusinessPanel.vue +0 -0
  303. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/components/MedicalButton.vue +0 -0
  304. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/components/MedicalConfirmDialog.vue +0 -0
  305. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/components/MedicalDataPanel.vue +0 -0
  306. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/components/MedicalRecordPanel.vue +0 -0
  307. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/components/PrescriptionPanel.vue +0 -0
  308. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/config/basic-info-config.ts +0 -0
  309. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/config/runtime-config.ts +0 -0
  310. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/env.d.ts +0 -0
  311. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/features/consultation/components/ConsultationChatPanel.vue +0 -0
  312. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/features/consultation/components/ConsultationMembersPanel.vue +0 -0
  313. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/features/consultation/components/ConsultationTranscriptionPanel.vue +0 -0
  314. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/features/consultation/components/ConsultationVideoStage.vue +0 -0
  315. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/features/consultation/components/InviteDoctorDialog.vue +0 -0
  316. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/features/consultation/components/KickMemberConfirmDialog.vue +0 -0
  317. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/features/consultation/types.ts +0 -0
  318. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/features/consultation/useConsultationChat.ts +0 -0
  319. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/features/consultation/useConsultationDevices.ts +0 -0
  320. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/features/consultation/useConsultationParticipants.ts +0 -0
  321. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/features/consultation/useConsultationPermissions.ts +0 -0
  322. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/features/consultation/utils.ts +0 -0
  323. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/i18n/en-US/index.ts +0 -0
  324. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/i18n/index.ts +0 -0
  325. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/i18n/medicalTranslate.ts +0 -0
  326. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/i18n/state.ts +0 -0
  327. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/i18n/zh-CN/index.ts +0 -0
  328. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/main.ts +0 -0
  329. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/mock/appointments.ts +0 -0
  330. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/mock/users.ts +0 -0
  331. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/router/index.ts +0 -0
  332. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/services/adapters/index.ts +0 -0
  333. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/services/adapters/integration/appointmentService.ts +0 -0
  334. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/services/adapters/integration/authService.ts +0 -0
  335. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/services/adapters/integration/launchContext.ts +0 -0
  336. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/services/adapters/integration/userService.ts +0 -0
  337. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/services/adapters/mock/appointmentService.ts +0 -0
  338. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/services/adapters/mock/authService.ts +0 -0
  339. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/services/adapters/mock/userService.ts +0 -0
  340. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/services/adapters/types.ts +0 -0
  341. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/shared/icons.ts +0 -0
  342. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/styles/index.css +0 -0
  343. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/styles/tailwind.css +0 -0
  344. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/styles/theme.css +0 -0
  345. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/utils/auth.ts +0 -0
  346. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/utils/format.ts +0 -0
  347. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/utils/navigation.ts +0 -0
  348. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/utils/session.ts +0 -0
  349. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/views/DoctorConsultationView.vue +0 -0
  350. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/views/DoctorDashboardView.vue +0 -0
  351. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/views/LoginView.vue +0 -0
  352. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/views/PatientConsultationFinishedView.vue +0 -0
  353. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/views/PatientConsultationView.vue +0 -0
  354. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/views/PatientSelectDoctorView.vue +0 -0
  355. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/src/views/PatientWaitingView.vue +0 -0
  356. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/tsconfig.json +0 -0
  357. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/tsconfig.node.json +0 -0
  358. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation/vite.config.ts +0 -0
  359. /package/skills/{trtc/room-builder/templates/scenarios → trtc-conference/templates}/medical-consultation//346/216/245/345/205/245/350/257/264/346/230/216.md" +0 -0
  360. /package/skills/{trtc-topic/runtime/lib → trtc-conference/tools}/__init__.py +0 -0
@@ -0,0 +1,370 @@
1
+ # Design Guidelines (DESIGN_GUIDELINES)
2
+
3
+ > Scope: All UIs under `scenarios/customer-service/` (voice-customer-service, admin-board).
4
+ >
5
+ > Origin: `voice_ai_customer_service (3).html` prototype design, v2.0.0 (light / glassmorphism / purple-pink gradient).
6
+
7
+ ---
8
+
9
+ ## 1. Theme & Background
10
+
11
+ | Category | Rule |
12
+ |---|---|
13
+ | **Theme** | Light theme (light mode), no dark mode toggle |
14
+ | **Background** | Multi-layer radial gradient overlay (soft purple + light pink + pale blue), base `#f7f3ff` |
15
+ | **Panels** | Glassmorphism panels (`glass` class): `backdrop-filter: blur(22px) saturate(140%)` |
16
+
17
+ ## 2. Color Spec
18
+
19
+ ### 2.1 Palette
20
+
21
+ Full expansion: CSS variables (defined in `tokens.css`, compiled from `design_tokens.json`)
22
+ Grouped by namespace:
23
+
24
+ ```
25
+ Foreground / Text
26
+ --foreground : #1a1530 Primary text color (deep purple-black)
27
+ --muted : #6b6580 Secondary/auxiliary text
28
+
29
+ Cards / Panels
30
+ --card : rgba(255,255,255,0.55) Glass panel background
31
+ --card-strong : rgba(255,255,255,0.78) Strong glass panel
32
+ --card-border : rgba(255,255,255,0.85) Panel stroke
33
+
34
+ Brand / Accent
35
+ --primary : #9b7bf7 Primary purple (gradient start)
36
+ --pink : #f7b7d4 Pink (gradient end)
37
+ --blue : #7ba8f7 Auxiliary blue
38
+ --accent-grad : linear-gradient(135deg, #9b7bf7 0%, #f7b7d4 100%)
39
+
40
+ Status Colors
41
+ --green : #34c77b Success / Online / Connected
42
+ --red : #ff5c7a Error / Hang up / Muted
43
+ ```
44
+
45
+ > **Two variable namespaces, one palette.** The customer widget uses the short names
46
+ > above (defined in its own `styles.css :root`). The admin board uses the long-form
47
+ > `--color-*` namespace (defined in `tokens.css`). Both resolve to the SAME light
48
+ > purple-pink glassmorphism palette. `tokens.css` is the canonical design-variable
49
+ > file and now ships the light palette directly (no dark override anywhere):
50
+ >
51
+ > ```
52
+ > tokens.css (--color-* namespace, shared by admin; light palette)
53
+ > --color-bg-gradient multi-radial ambient, base #f7f3ff (= .bg-ambient)
54
+ > --color-bg-surface rgba(255,255,255,0.55) (= --card)
55
+ > --color-bg-surface-strong rgba(255,255,255,0.82) (= --card-strong)
56
+ > --color-bg-border rgba(155,123,247,0.18) (purple-tinted stroke)
57
+ > --color-brand-accent #9b7bf7 (= --primary)
58
+ > --color-text-primary #1a1530 (= --foreground)
59
+ > --color-text-secondary #6b6580 (= --muted)
60
+ > --color-status-success #1f8e57 info #3b6bcf
61
+ > --color-status-warning #c46500 error #d6476b (darkened for light bg)
62
+ > --font-family-base Inter, 'SF Pro Display', system-ui, sans-serif
63
+ > ```
64
+
65
+ **Correct usage**:
66
+ ```css
67
+ .my-button {
68
+ background: var(--accent-grad);
69
+ color: white;
70
+ }
71
+ .badge-success {
72
+ background: rgba(52,199,123,0.15);
73
+ color: var(--green);
74
+ }
75
+ ```
76
+
77
+ **Forbidden usage**:
78
+ ```css
79
+ .my-button {
80
+ background: linear-gradient(135deg, #9b7bf7, #f7b7d4); /* should reference --accent-grad */
81
+ }
82
+ ```
83
+
84
+ ### 2.2 Tailwind Integration
85
+
86
+ The prototype uses Tailwind CSS CDN; custom colors are injected in `tailwind.config`:
87
+
88
+ ```js
89
+ tailwind.config = {
90
+ theme: { extend: {
91
+ colors: { ink:'#1a1530', muted:'#6b6580', primary:'#9b7bf7', pink:'#f7b7d4', blue2:'#7ba8f7' },
92
+ fontFamily: { sans: ['Inter','SF Pro Display','system-ui','sans-serif'] }
93
+ } }
94
+ }
95
+ ```
96
+
97
+ > **Note**: Tailwind class names (e.g., `text-ink`, `text-muted`, `bg-primary`) map to the above CSS variable names but belong to **two independent naming systems**. For new UIs, prefer Tailwind classes for layout, and CSS variables from `styles.css` for core styling.
98
+
99
+ ---
100
+
101
+ ## 3. Layout Spec
102
+
103
+ ### 3.1 Overall Layout
104
+
105
+ ```
106
+ +----------------------------------------------------------+
107
+ | HEADER: logo + connection status indicators |
108
+ +----------------------------------------------------------+
109
+ | SIDEBAR (300px) | MAIN CONSOLE (flex:1) |
110
+ | - Products / Orders | - Orb breathing ball |
111
+ | tab bar | - Status text (Ready/Listening/…) |
112
+ | - Search box | - Large waveform animation |
113
+ | - Card list (scrollable)| - Dock control bar |
114
+ | | - IM chat drawer |
115
+ +----------------------------------------------------------+
116
+ | FOOTER |
117
+ +----------------------------------------------------------+
118
+ ```
119
+
120
+ ### 3.2 Responsive Breakpoints
121
+
122
+ | Breakpoint | Layout |
123
+ |---|---|
124
+ | `≥ 1024px` (lg) | Two-column: `grid-cols-[300px,1fr]`, fixed height 620px |
125
+ | `< 1024px` | Sidebar shrinks to `max-height: 50vh`, main panel auto-fills height |
126
+
127
+ ---
128
+
129
+ ## 4. Component Spec
130
+
131
+ ### 4.1 Orb Breathing Ball
132
+
133
+ - **Position**: Centered in main console
134
+ - **Size**: 160×160px (200×200px when ≥760px)
135
+ - **Style**: Multi-layer gradient circle + `inset` shadow simulating glass texture + highlight dot
136
+ - **Animation**:
137
+ | State | Animation | Period |
138
+ |---|---|---|
139
+ | idle | `breathe` | 4.5s |
140
+ | listening | `breathe` | 1.2s |
141
+ | speaking | `breathe` | 0.7s |
142
+ - **Halos**: 3 layers of `orb-halo`, animation delays 0 / 1.1s / 2.2s, expanding from scale(0.85) to scale(1.7) and fading out
143
+
144
+ ### 4.2 Large Waveform (wave-big)
145
+
146
+ - **Position**: Below the Orb
147
+ - **Size**: width `min(520px, 90%)`, height 80px
148
+ - **Composition**: 32 vertical bars, `background: linear-gradient(180deg, #9b7bf7, #f7b7d4)`
149
+ - **Animation**:
150
+ | State | Animation | Period |
151
+ |---|---|---|
152
+ | idle | Paused, height fixed 10px, opacity 0.4 | — |
153
+ | listening | `wv` | 0.7s |
154
+ | speaking | `wv` | 0.5s |
155
+
156
+ ### 4.3 Dock Control Bar
157
+
158
+ **Collapsed state**: Single green circular Start button, 58×58px
159
+
160
+ **Expanded state** (after Start):
161
+ - Glassmorphism pill container (`border-radius: 999px`)
162
+ - Contains 3 buttons:
163
+ | Button | Icon | Style |
164
+ |---|---|---|
165
+ | Microphone | `mic` / `mic-off` | Rounded 46×46px, white background; red gradient when muted |
166
+ | Human Support | `headphones` + "Human Support" | Blue gradient background + white text |
167
+ | Hang up | `phone-off` | Circle 46×46px, red gradient background |
168
+
169
+ **Transition animation**: Start button shrinks and disappears (`scale(0.4)`), expanded bar pops in from `scale(0.6)`
170
+
171
+ ### 4.4 Knowledge Base Sidebar (KB Sidebar)
172
+
173
+ - **Tab switching**: Products / Orders, `kb-tabs` container
174
+ - **Search box**: Search icon, rounded input
175
+ - **Product cards**:
176
+ - Thumbnail 52×52px + name + price + tag (Hot / In stock / Low stock)
177
+ - Hover: lifts 2px + shadow enhancement
178
+ - **Order cards**:
179
+ - Order number + date + status badge + product thumbnail 38×38px
180
+
181
+ ### 4.5 Detail View
182
+
183
+ - Layout switches after clicking a product/order card:
184
+ - Top compact bar (back button + mini Orb + waveform)
185
+ - Center: question text + detail card
186
+ - Bottom: expanded Dock
187
+ - **Product detail card**: Large image 140×140px + name + rating + description + price + add-to-cart button
188
+ - **Order detail card**: Order number + date + status + product thumbnail 64×64px + total
189
+
190
+ ### 4.6 IM Chat Drawer
191
+
192
+ - **Position**: Floating at bottom-right, `position: absolute; right: 18px; bottom: 90px`
193
+ - **Size**: width 360px, `max-width: calc(100% - 36px)`
194
+ - **Structure**: Title bar + message list (max-height: 280px) + input bar
195
+ - **Bubble styles**:
196
+ - AI bubble: White background, top-left corner cut
197
+ - User bubble: Purple gradient background, white text, top-right corner cut
198
+ - System bubble: Semi-transparent white background, italic centered, pill-shaped
199
+ - **Typing indicator**: 3 bouncing dots
200
+
201
+ ### 4.7 Queue Progress Bar
202
+
203
+ - Shown below the Orb after initiating handoff
204
+ - Progress bar: `background: var(--accent-grad)` filling over a white base
205
+ - Timer: updates every minute with formatted time (`0:00` → `0:08`)
206
+
207
+ ### 4.8 Toast Notifications
208
+
209
+ - Clicking a card when not connected → purple semi-transparent toast: "Please press Start to connect AI before viewing..."
210
+ - Auto-dismisses after 2.6s
211
+
212
+ ---
213
+
214
+ ## 5. Typography Spec
215
+
216
+ | Role | Font | Source |
217
+ |---|---|---|
218
+ | Global body | `Inter` | Google Fonts CDN |
219
+ | Fallback | `SF Pro Display` | System built-in |
220
+ | Reserve | `system-ui`, `sans-serif` | Browser default |
221
+
222
+ **Exception**: The prototype loads Inter from Google Fonts CDN to satisfy design requirements (SF Pro / Helvetica Neue cannot guarantee cross-platform consistency).
223
+
224
+ ---
225
+
226
+ ## 6. Icon Spec
227
+
228
+ | Category | Rule |
229
+ |---|---|
230
+ | **Source** | [Lucide](https://lucide.dev/), CDN loaded via `unpkg.com/lucide@latest` |
231
+ | **Style** | Monochrome linear SVG, consistent |
232
+ | **Sizes** | `w-3 h-3` (small pill) / `w-4 h-4` (standard) / `w-5 h-5` (buttons) |
233
+ | **Init** | Call `lucide.createIcons()` after DOM changes |
234
+
235
+ ---
236
+
237
+ ## 7. No-Emoji Alternatives
238
+
239
+ Emoji renders inconsistently across operating systems and clashes with the design language — therefore **emojis are completely disabled in the UI rendering layer**.
240
+
241
+ | Scenario | ✅ Alternative |
242
+ |---|---|
243
+ | Status/success | Green `<span class="status-dot">` + text "Live · Connected" |
244
+ | Disconnected/hang up | Gray dot + text "Disconnected" |
245
+ | Notification/toast | Plain text toast, no attached icon |
246
+ | Business tags | `tag-hot` (pink background, red text), `tag-instock` (green background, green text), `tag-low` (yellow background, orange text) CSS classes |
247
+
248
+ ---
249
+
250
+ ## 8. Animations & Effects
251
+
252
+ | Animation | Purpose | Duration/Period |
253
+ |---|---|---|
254
+ | `breathe` | Orb breathing scale | 4.5s (idle) / 1.2s (listening) / 0.7s (speaking) |
255
+ | `halo` | Orb halo expand and fade | 3.4s |
256
+ | `core-pulse` | Orb core glow pulse | 2s |
257
+ | `wv` | Large waveform ripple | 1.1s (idle paused) |
258
+ | `cwv` | Compact waveform ripple | 1s |
259
+ | `bubble-in` | Chat bubble entrance | 0.35s ease-out |
260
+ | `tdot` | Typing indicator bounce | 1.2s (3 dots 0.2s staggered) |
261
+ | `fade-in-down` | Compact bar slide-in | 0.35s ease |
262
+ | `detail-in` | Detail page fade-in slide-up | 0.4s ease |
263
+ | `pulse-dot` | Connection indicator pulse | 1.6s |
264
+
265
+ ---
266
+
267
+ ## 9. Browser Compatibility
268
+
269
+ Glassmorphism `backdrop-filter` is unavailable in some older browsers. Glass panels in `styles.css` already declare the `-webkit-backdrop-filter` prefix:
270
+
271
+ ```css
272
+ .glass {
273
+ backdrop-filter: blur(22px) saturate(140%);
274
+ -webkit-backdrop-filter: blur(22px) saturate(140%);
275
+ }
276
+ ```
277
+
278
+ Unsupported browsers will fall back to a solid semi-transparent background (`rgba(255,255,255,0.55)`), ignoring the blur effect.
279
+
280
+ ---
281
+
282
+ ## 10. Status Text
283
+
284
+ | State | Primary text (ai-state) | Secondary text (ai-substate) | Orb/Wave state |
285
+ |---|---|---|---|
286
+ | Not connected (pre) | "Ready to start conversation" | "Press Start below to begin a real-time voice session" | idle |
287
+ | Idle listening | "Listening for you" | "Speak naturally · I will respond in real time" | idle |
288
+ | Listening (listening) | "Listening…" | "Capturing your voice" | listening |
289
+ | Thinking (thinking) | "Thinking…" | "Processing your request" | listening |
290
+ | AI speaking (speaking) | "AI is speaking…" | "Streaming response over TRTC" | speaking |
291
+
292
+ ---
293
+
294
+ ## 11. Checklist (Self-check before submitting UI)
295
+
296
+ - [ ] All colors use CSS variables (`--primary`, `--accent-grad`, etc.) or Tailwind presets; bare hex forbidden
297
+ - [ ] All icons come from Lucide, sizes in 3 / 4 / 5 (Tailwind `w-* h-*`)
298
+ - [ ] No emoji characters in any UI text, status, or buttons
299
+ - [ ] Glassmorphism elements include `-webkit-backdrop-filter` prefix
300
+ - [ ] Fonts only reference Inter + SF Pro + system-ui combination
301
+ - [ ] Orb/Wave animation state transitions correct (idle/listening/speaking three states)
302
+ - [ ] Responsive: mobile sidebar shrinks to 50vh
303
+ - [ ] Call `lucide.createIcons()` after every DOM insertion of new icons
304
+
305
+ ---
306
+
307
+ ## 12. Admin Board (Ticket Agent Board)
308
+
309
+ > Scope: `scenarios/customer-service/ui/admin-board/` (served at `/static/admin/`).
310
+ >
311
+ > **Issue 10 — UI unification**: the admin board shares ONE visual language with the
312
+ > customer widget above. It is a light, purple-pink glassmorphism theme — NOT the dark
313
+ > teal palette that `tokens.css` ships by default.
314
+
315
+ ### 12.1 Theme override mechanism
316
+
317
+ `tokens.css` is auto-generated from `design_tokens.json` and ships a dark teal palette
318
+ (`--color-bg-gradient: #3A4D4A → #1E2B2B`, white text, green accent). The admin board
319
+ does **not** edit `tokens.css`; instead `admin/styles.css` begins with a `:root` block
320
+ that re-points the same CSS custom properties to the light palette — exactly mirroring
321
+ how the customer widget's `styles.css` overrides its own `tokens.css`. Because
322
+ `styles.css` loads after `tokens.css`, the override wins.
323
+
324
+ ### 12.2 Palette mapping (admin override → customer widget equivalent)
325
+
326
+ | Admin token (`--color-*`) | Admin override value | Customer widget equivalent |
327
+ |---|---|---|
328
+ | `--color-bg-gradient` | Multi-radial light ambient, base `#f7f3ff` | `.bg-ambient` |
329
+ | `--color-bg-surface` | `rgba(255,255,255,0.55)` | `--card` |
330
+ | `--color-bg-surface-strong` | `rgba(255,255,255,0.82)` | `--card-strong` |
331
+ | `--color-bg-border` | `rgba(155,123,247,0.18)` | purple-tinted stroke (visible on light) |
332
+ | `--color-brand-accent` | `#9b7bf7` | `--primary` |
333
+ | `--color-text-primary` | `#1a1530` | `--foreground` |
334
+ | `--color-text-secondary` | `#6b6580` | `--muted` |
335
+ | Status colors | `#1f8e57` / `#3b6bcf` / `#c46500` / `#d6476b` | darker, readable on light |
336
+
337
+ Glass cards (`.content`, `.filter-rail`, `.drawer`) use `backdrop-filter: blur(20px)` +
338
+ a purple-tinted shadow `0 12px 40px -16px rgba(120,90,200,0.22)` for depth on the light
339
+ background. Accent buttons (`.btn--accent`) use purple background + white text.
340
+
341
+ ### 12.3 Typography & icons
342
+
343
+ - Font: `Inter` loaded from Google Fonts CDN (added in `admin/index.html <head>`), falling
344
+ back to `SF Pro` / `system-ui` — identical stack to the customer widget.
345
+ - Icons: the admin uses self-contained inline SVGs (no CDN dependency) for reliability.
346
+ They follow the same monochrome linear style as Lucide; no emoji anywhere.
347
+
348
+ ### 12.4 Session summary rendering (issue 2)
349
+
350
+ The detail drawer renders the session summary attached to a ticket. Field names MUST
351
+ match the real `summarizer.summarize()` output:
352
+
353
+ ```
354
+ topics: [str] user_intents: [str] next_actions: [str] highlights: [str]
355
+ engine: "heuristic" | "llm" model: str | null
356
+ ```
357
+
358
+ > ⚠️ Do NOT use `topic/intent/key_points/suggested_actions` — those names are incorrect.
359
+ > The real fields are `topics/user_intents/next_actions/highlights` (all arrays).
360
+
361
+ If a ticket has no embedded summary, the drawer fetches `GET /api/v1/summary/{session_id}`;
362
+ a "Generate summary" button calls `POST /api/v1/summary/{session_id}/finalize` (LLM path).
363
+
364
+ ### 12.5 Customer feedback block (issue 6)
365
+
366
+ When a ticket carries a `feedback` object (posted by the customer's post-call rating card
367
+ via `POST /api/v1/handoff/feedback`), the detail drawer renders a `.feedback-block`:
368
+ 5-star rating (`★`/`☆`), numeric `n/5` score, and the optional written comment. The
369
+ feedback is also written onto the ticket (`ticket.extra["feedback"]`) so it appears in
370
+ `GET /api/v1/handoff/admin/tickets` without an extra round-trip.
@@ -0,0 +1,68 @@
1
+ # voice-customer-service — Path A Default UI (v1.1)
2
+
3
+ > Design spec: `scenarios/customer-service/ui/design-system/DESIGN_GUIDELINES.md`
4
+ > Deployment location: `capabilities/conversation-core/web-demo/` (copied by Path A SOP §6 Step 3)
5
+
6
+ ---
7
+
8
+ ## What This UI Solves
9
+
10
+ - conversation-core's built-in `web-demo/` is a **developer self-check page** ("Voice Agent Demo / All three indicators must be green before starting") — not suitable as a customer service artifact
11
+ - `widget-floating/` is a **lightweight text IM demo** that doesn't bring up the TRTC voice channel — only shows KB + ticket REST API
12
+ - This directory is the **real Voice Agent customer service** — based on the conversation-core voice pipeline + customer service capability overlay + business panel
13
+
14
+ ---
15
+
16
+ ## Feature List
17
+
18
+ | Module | Implementation |
19
+ |---|---|
20
+ | **Top Bar** | Business title + three LEDs (Cloud/TRTC/LLM) + Recheck button + session status badge; LED hover shows tooltip explaining each one's role |
21
+ | **Sidebar** | Product list (click → "I'd like to know more about..." auto-send) + order list (click → "Can you check the status of order ...") |
22
+ | **Message Flow** | IM bubbles (user right / AI left / system centered); AI subtitles real-time incremental / cumulative adaptive aggregation; user voice ASR finalize drops into bubble |
23
+ | **Voice** | One-click Start → enterRoom + agent/start; mic toggle; smart interrupt before switching |
24
+ | **Text** | sendCustomMessage(cmdId:2, type:20000) directly to AI bot; IME (Chinese input) enter-key compatible |
25
+ | **KB Silent** | Each user utterance calls `/api/v1/kb/search`; hits are **not shown as cards**, only console.debug; keeps the chat window clean |
26
+ | **Handoff** | Button + keyword trigger ("talk to agent", etc.); ticket card + 8s progress bar + shimmer highlight + countdown; on completion calls `/handoff/connect` to simulate agent connection; polls `state=connected` |
27
+ | **Dedup** | sendText active render + 30s TTL local-echo list → skips same-text subtitles replayed by the AI bot (prevents double bubbles) |
28
+
29
+ ---
30
+
31
+ ## File List
32
+
33
+ | File | Description |
34
+ |---|---|
35
+ | `index.html` | Three-column layout + top bar + control bar; includes Lucide-style SVG icon defs (no emoji) |
36
+ | `app.js` | Full frontend logic (health / TRTC / KB / HH / products & orders / dedup) |
37
+ | `styles.css` | Light glassmorphism theme + progress animations + tooltips; 100% via tokens.css variables |
38
+ | `mock-shop.json` | 3 products + 3 orders (English mock data) |
39
+ | `tokens.css` | Light glassmorphism design tokens (hand-aligned to the running theme; single source of truth for `--color-*`) |
40
+
41
+ ---
42
+
43
+ ## API Contract (Frontend Call Checklist)
44
+
45
+ ```
46
+ GET /api/v1/health Three-LED self-check
47
+ POST /api/v1/get_config Get sessionId / sdkAppId / roomId / userSig / agentUserId
48
+ POST /api/v1/agent/start { session_id, language: "en" }
49
+ POST /api/v1/agent/stop { session_id }
50
+ POST /api/v1/kb/search { query, top_k: 1 } (silent; no cards rendered)
51
+ POST /api/v1/handoff/request { session_id, reason }
52
+ POST /api/v1/handoff/connect { session_id, agent_id: "demo_agent_alex" } (for simulated connection)
53
+ POST /api/v1/handoff/cancel { session_id }
54
+ GET /api/v1/handoff/{session_id} Ticket status polling; returns legacy_dict (field is `state`, not `status`)
55
+ GET /static/mock-shop.json Product / order data
56
+ ```
57
+
58
+ > ⚠ **Legacy Field Trap**: `/handoff/*` uses `to_legacy_dict` — the field is `state`, values: `waiting / connected / closed / canceled / timeout` ("canceled" with single L), and there is **no top-level `ticket_id`** (use `session_id` as the tracking ID). `/admin/tickets` uses `to_dict`, which has both `status` + `ticket_id`.
59
+
60
+ ---
61
+
62
+ ## Customization Points
63
+
64
+ - **Change KB integration**: Currently `silentKbLookup` only console.debugs on hit. For real RAG, inject hit entries as system prompt context (requires backend — conversation-core doesn't support system prompt injection yet; can indirectly use `agent_runtime.system_prompt.variables`)
65
+ - **Change queue wait time**: `HANDOFF_QUEUE_MS = 8_000`
66
+ - **Change simulated agent name**: `SIM_AGENT_ID = "demo_agent_alex"`
67
+ - **Add business panels**: `renderProducts` / `renderOrders` are already templates — copy and adjust fields
68
+ - **Multi-language**: Defaults to English (`agent/start` body `language: "en"`); for Chinese/English switching, write language toggle to `state` + UI dropdown