nccgs 1.0.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/.claude/agents/nccgs-accessibility-specialist.md +26 -0
- package/.claude/agents/nccgs-adversarial-reviewer.md +26 -0
- package/.claude/agents/nccgs-ai-programmer.md +26 -0
- package/.claude/agents/nccgs-analytics-engineer.md +26 -0
- package/.claude/agents/nccgs-art-direction-lead.md +26 -0
- package/.claude/agents/nccgs-audio-direction-lead.md +26 -0
- package/.claude/agents/nccgs-creative-director.md +26 -0
- package/.claude/agents/nccgs-documentation-manager.md +26 -0
- package/.claude/agents/nccgs-economy-designer.md +26 -0
- package/.claude/agents/nccgs-engine-programmer.md +26 -0
- package/.claude/agents/nccgs-game-design-lead.md +26 -0
- package/.claude/agents/nccgs-game-designer.md +26 -0
- package/.claude/agents/nccgs-gameplay-programmer.md +26 -0
- package/.claude/agents/nccgs-level-designer.md +26 -0
- package/.claude/agents/nccgs-live-ops-designer.md +26 -0
- package/.claude/agents/nccgs-localization-lead.md +26 -0
- package/.claude/agents/nccgs-narrative-lead.md +26 -0
- package/.claude/agents/nccgs-network-programmer.md +26 -0
- package/.claude/agents/nccgs-performance-analyst.md +26 -0
- package/.claude/agents/nccgs-producer.md +26 -0
- package/.claude/agents/nccgs-production-coordinator.md +23 -0
- package/.claude/agents/nccgs-programming-lead.md +26 -0
- package/.claude/agents/nccgs-prototyper.md +26 -0
- package/.claude/agents/nccgs-qa-engineer.md +26 -0
- package/.claude/agents/nccgs-qa-lead.md +26 -0
- package/.claude/agents/nccgs-release-engineer.md +26 -0
- package/.claude/agents/nccgs-release-lead.md +26 -0
- package/.claude/agents/nccgs-security-engineer.md +26 -0
- package/.claude/agents/nccgs-sound-designer.md +26 -0
- package/.claude/agents/nccgs-systems-designer.md +26 -0
- package/.claude/agents/nccgs-technical-architect.md +26 -0
- package/.claude/agents/nccgs-technical-artist.md +26 -0
- package/.claude/agents/nccgs-technical-director.md +26 -0
- package/.claude/agents/nccgs-tools-programmer.md +26 -0
- package/.claude/agents/nccgs-ui-programmer.md +26 -0
- package/.claude/agents/nccgs-unity-build-specialist.md +26 -0
- package/.claude/agents/nccgs-unity-content-specialist.md +26 -0
- package/.claude/agents/nccgs-unity-implementer.md +26 -0
- package/.claude/agents/nccgs-unity-rendering-specialist.md +26 -0
- package/.claude/agents/nccgs-unity-systems-specialist.md +26 -0
- package/.claude/agents/nccgs-unity-ui-specialist.md +26 -0
- package/.claude/agents/nccgs-ux-designer.md +26 -0
- package/.claude/agents/nccgs-verification-engineer.md +26 -0
- package/.claude/agents/nccgs-world-builder.md +26 -0
- package/.claude/agents/nccgs-writer.md +26 -0
- package/.claude/nccgs/THIRD_PARTY_NOTICES.md +13 -0
- package/.claude/nccgs/VERSION +1 -0
- package/.claude/nccgs/constitution.md +131 -0
- package/.claude/nccgs/hooks/agent-audit.mjs +10 -0
- package/.claude/nccgs/hooks/common.mjs +41 -0
- package/.claude/nccgs/hooks/post-compact.mjs +1 -0
- package/.claude/nccgs/hooks/pre-compact.mjs +8 -0
- package/.claude/nccgs/hooks/protect-git.mjs +22 -0
- package/.claude/nccgs/hooks/protect-write.mjs +17 -0
- package/.claude/nccgs/hooks/session-start.mjs +15 -0
- package/.claude/nccgs/hooks/session-stop.mjs +7 -0
- package/.claude/nccgs/protocols/agent-contract.md +34 -0
- package/.claude/nccgs/protocols/context-packets.md +13 -0
- package/.claude/nccgs/protocols/evidence.md +15 -0
- package/.claude/nccgs/protocols/model-routing.md +22 -0
- package/.claude/nccgs/protocols/orchestration.md +26 -0
- package/.claude/nccgs/protocols/unity-boundary.md +11 -0
- package/.claude/nccgs/settings.fragment.json +77 -0
- package/.claude/nccgs/studio.json +347 -0
- package/.claude/nccgs/tools/configure-models.mjs +39 -0
- package/.claude/nccgs/unity-skills-manifest.json +727 -0
- package/.claude/nccgs/workflow-catalog.json +317 -0
- package/.claude/rules/nccgs-canonical-docs.md +19 -0
- package/.claude/rules/nccgs-editor-tools.md +12 -0
- package/.claude/rules/nccgs-localization.md +12 -0
- package/.claude/rules/nccgs-networking.md +13 -0
- package/.claude/rules/nccgs-performance.md +14 -0
- package/.claude/rules/nccgs-rendering.md +16 -0
- package/.claude/rules/nccgs-security.md +13 -0
- package/.claude/rules/nccgs-tests.md +18 -0
- package/.claude/rules/nccgs-ui.md +14 -0
- package/.claude/rules/nccgs-unity-assets.md +21 -0
- package/.claude/rules/nccgs-unity-code.md +22 -0
- package/.claude/skills/accessibility-review/SKILL.md +14 -0
- package/.claude/skills/architecture-decision/SKILL.md +14 -0
- package/.claude/skills/asset-audit/SKILL.md +14 -0
- package/.claude/skills/audit/SKILL.md +16 -0
- package/.claude/skills/audit/references/dimensions.md +46 -0
- package/.claude/skills/balance-review/SKILL.md +14 -0
- package/.claude/skills/bug-triage/SKILL.md +14 -0
- package/.claude/skills/build-live-game/SKILL.md +317 -0
- package/.claude/skills/build-live-game/references/achievements.md +779 -0
- package/.claude/skills/build-live-game/references/apis.md +280 -0
- package/.claude/skills/build-live-game/references/authentication.md +437 -0
- package/.claude/skills/build-live-game/references/battlepass.md +860 -0
- package/.claude/skills/build-live-game/references/cloud-code.md +563 -0
- package/.claude/skills/build-live-game/references/cloud-save.md +474 -0
- package/.claude/skills/build-live-game/references/deployment.md +216 -0
- package/.claude/skills/build-live-game/references/player-account.md +813 -0
- package/.claude/skills/build-live-game/references/remote-config.md +96 -0
- package/.claude/skills/build-live-game/references/tooling.md +431 -0
- package/.claude/skills/closure/SKILL.md +14 -0
- package/.claude/skills/code-review/SKILL.md +14 -0
- package/.claude/skills/compatibility-review/SKILL.md +14 -0
- package/.claude/skills/context-pack/SKILL.md +14 -0
- package/.claude/skills/dependency-review/SKILL.md +14 -0
- package/.claude/skills/design/SKILL.md +20 -0
- package/.claude/skills/design-review/SKILL.md +14 -0
- package/.claude/skills/evidence-review/SKILL.md +14 -0
- package/.claude/skills/hotfix/SKILL.md +14 -0
- package/.claude/skills/implement-in-app-purchases/README.md +233 -0
- package/.claude/skills/implement-in-app-purchases/SKILL.md +158 -0
- package/.claude/skills/implement-in-app-purchases/references/api-notes.md +562 -0
- package/.claude/skills/implement-in-app-purchases/references/codeless-catalog.md +331 -0
- package/.claude/skills/implement-in-app-purchases/references/convert-adapty.md +268 -0
- package/.claude/skills/implement-in-app-purchases/references/convert-essentialkit.md +239 -0
- package/.claude/skills/implement-in-app-purchases/references/convert-revenuecat.md +275 -0
- package/.claude/skills/implement-in-app-purchases/references/convert-unipay.md +145 -0
- package/.claude/skills/implement-in-app-purchases/references/migration-v4-to-v5.md +204 -0
- package/.claude/skills/implement-in-app-purchases/references/path-add-iap-to-new-project.md +198 -0
- package/.claude/skills/implement-in-app-purchases/references/path-convert-native-google-billing.md +356 -0
- package/.claude/skills/implement-in-app-purchases/references/path-convert-native-storekit.md +446 -0
- package/.claude/skills/implement-in-app-purchases/references/path-implement-iap-d2c.md +680 -0
- package/.claude/skills/implement-in-app-purchases/references/platform-notes.md +204 -0
- package/.claude/skills/implement-in-app-purchases/references/pre-check.md +205 -0
- package/.claude/skills/incident-recovery/SKILL.md +14 -0
- package/.claude/skills/initialize-ai-navigation/SKILL.md +95 -0
- package/.claude/skills/initialize-ai-navigation/references/navigation-system.md +794 -0
- package/.claude/skills/levelplay-unity-integration/CHANGELOG.md +57 -0
- package/.claude/skills/levelplay-unity-integration/README.md +74 -0
- package/.claude/skills/levelplay-unity-integration/SKILL.md +1126 -0
- package/.claude/skills/levelplay-unity-integration/references/banner-api.md +920 -0
- package/.claude/skills/levelplay-unity-integration/references/best-practices.md +536 -0
- package/.claude/skills/levelplay-unity-integration/references/ilrd-api.md +337 -0
- package/.claude/skills/levelplay-unity-integration/references/initialization-api.md +630 -0
- package/.claude/skills/levelplay-unity-integration/references/interstitial-api.md +899 -0
- package/.claude/skills/levelplay-unity-integration/references/ios-setup.md +491 -0
- package/.claude/skills/levelplay-unity-integration/references/migration-sdk-9.md +666 -0
- package/.claude/skills/levelplay-unity-integration/references/privacy-settings.md +608 -0
- package/.claude/skills/levelplay-unity-integration/references/rewarded-api.md +902 -0
- package/.claude/skills/localization/SKILL.md +135 -0
- package/.claude/skills/localization/references/api-notes.md +76 -0
- package/.claude/skills/localization/resources/L10nBatchProcessor.cs +69 -0
- package/.claude/skills/localization/resources/LocalizedFontAsset.cs +18 -0
- package/.claude/skills/localize-game/SKILL.md +14 -0
- package/.claude/skills/migrate-project/SKILL.md +21 -0
- package/.claude/skills/migrate-project/references/procedure.md +63 -0
- package/.claude/skills/milestone-review/SKILL.md +14 -0
- package/.claude/skills/new-unity-project/SKILL.md +179 -0
- package/.claude/skills/optimize-audio/SKILL.md +199 -0
- package/.claude/skills/optimize-audio/resources/audio-import-api.md +146 -0
- package/.claude/skills/optimize-audio/resources/platform-settings.md +48 -0
- package/.claude/skills/optimize-text-mesh-pro/SKILL.md +182 -0
- package/.claude/skills/optimize-web/SKILL.md +393 -0
- package/.claude/skills/optimize-web/resources/WebOptimizer.cs +21 -0
- package/.claude/skills/optimize-web/resources/toktx-examples.sh +11 -0
- package/.claude/skills/performance-audit/SKILL.md +14 -0
- package/.claude/skills/physics-3d-collision/SKILL.md +442 -0
- package/.claude/skills/physics-3d-collision/references/troubleshooting.md +41 -0
- package/.claude/skills/physics-3d-collision/resources/CollisionDebugger.cs +33 -0
- package/.claude/skills/plan-feature/SKILL.md +14 -0
- package/.claude/skills/playtest/SKILL.md +14 -0
- package/.claude/skills/project-stage/SKILL.md +14 -0
- package/.claude/skills/prototype-feature/SKILL.md +14 -0
- package/.claude/skills/qa-plan/SKILL.md +14 -0
- package/.claude/skills/release/SKILL.md +18 -0
- package/.claude/skills/release-readiness/SKILL.md +14 -0
- package/.claude/skills/retrospective/SKILL.md +14 -0
- package/.claude/skills/review/SKILL.md +16 -0
- package/.claude/skills/security-audit/SKILL.md +14 -0
- package/.claude/skills/setup-multiplayer-services/SKILL.md +39 -0
- package/.claude/skills/setup-multiplayer-services/references/dgs-entrypoint.md +79 -0
- package/.claude/skills/setup-multiplayer-services/references/entrypoints.md +213 -0
- package/.claude/skills/setup-multiplayer-services/references/examples.md +33 -0
- package/.claude/skills/setup-multiplayer-services/references/implementation-fit.md +30 -0
- package/.claude/skills/setup-multiplayer-services/references/underlying-services.md +11 -0
- package/.claude/skills/setup-multiplayer-services/references/workflows-prerequisites.md +17 -0
- package/.claude/skills/setup-vivox-voice-chat/SKILL.md +118 -0
- package/.claude/skills/setup-vivox-voice-chat/evals/.env.example +6 -0
- package/.claude/skills/setup-vivox-voice-chat/evals/README.md +101 -0
- package/.claude/skills/setup-vivox-voice-chat/evals/promptfooconfig.yaml +32 -0
- package/.claude/skills/setup-vivox-voice-chat/evals/tests/init-and-login.yaml +76 -0
- package/.claude/skills/setup-vivox-voice-chat/evals/tests/text-chat.yaml +65 -0
- package/.claude/skills/setup-vivox-voice-chat/evals/tests/voice-channels.yaml +74 -0
- package/.claude/skills/setup-vivox-voice-chat/references/events-and-participants.md +79 -0
- package/.claude/skills/setup-vivox-voice-chat/references/init-and-login.md +92 -0
- package/.claude/skills/setup-vivox-voice-chat/references/text-chat.md +93 -0
- package/.claude/skills/setup-vivox-voice-chat/references/troubleshooting.md +47 -0
- package/.claude/skills/setup-vivox-voice-chat/references/voice-channels.md +90 -0
- package/.claude/skills/shader-graph-create-custom-node/SKILL.md +25 -0
- package/.claude/skills/shader-graph-create-custom-node/resources/all_hints.hlsl +182 -0
- package/.claude/skills/sprint-plan/SKILL.md +14 -0
- package/.claude/skills/sprite-editor/SKILL.md +66 -0
- package/.claude/skills/sprite-editor/references/api_reference.md +151 -0
- package/.claude/skills/sprite-editor/references/background.md +112 -0
- package/.claude/skills/sprite-editor/references/templates.md +72 -0
- package/.claude/skills/sprite-editor/scripts/AutomaticSliceTexture.cs +40 -0
- package/.claude/skills/sprite-editor/scripts/GenerateNewSpriteRects.cs +200 -0
- package/.claude/skills/sprite-editor/scripts/GetTextureSourceImageSize.cs +32 -0
- package/.claude/skills/sprite-editor/scripts/GetTextureToSlice.cs +55 -0
- package/.claude/skills/sprite-editor/scripts/GridSliceTexture.cs +40 -0
- package/.claude/skills/sprite-editor/scripts/IsometricSliceTexture.cs +141 -0
- package/.claude/skills/sprite-editor/scripts/README.md +134 -0
- package/.claude/skills/sprite-editor/scripts/SetPivotExample.cs +58 -0
- package/.claude/skills/sprite-editor/scripts/SpriteToPng.cs +88 -0
- package/.claude/skills/status/SKILL.md +16 -0
- package/.claude/skills/story-readiness/SKILL.md +14 -0
- package/.claude/skills/test/SKILL.md +16 -0
- package/.claude/skills/ui/SKILL.md +142 -0
- package/.claude/skills/ui-imgui/SKILL.md +186 -0
- package/.claude/skills/ui-imgui/references/gui-elements.md +156 -0
- package/.claude/skills/ui-imgui/references/templates.md +141 -0
- package/.claude/skills/ui-review/SKILL.md +14 -0
- package/.claude/skills/ui-ugui/SKILL.md +282 -0
- package/.claude/skills/ui-ugui/references/scrollview-setup.md +29 -0
- package/.claude/skills/ui-uitk/SKILL.md +235 -0
- package/.claude/skills/ui-uitk/references/common-issues.md +74 -0
- package/.claude/skills/ui-uitk/references/custom-elements.md +241 -0
- package/.claude/skills/ui-uitk/references/painter2d.md +282 -0
- package/.claude/skills/ui-uitk/references/pointermanipulator-guide.md +94 -0
- package/.claude/skills/ui-uitk/references/svg-icons.md +136 -0
- package/.claude/skills/ui-uitk/references/ui-runtime-binding.md +234 -0
- package/.claude/skills/ui-uitk/references/uss-guide.md +138 -0
- package/.claude/skills/unity-cli/CHANGELOG.md +233 -0
- package/.claude/skills/unity-cli/SECURITY.md +22 -0
- package/.claude/skills/unity-cli/SKILL.md +414 -0
- package/.claude/skills/unity-cli/references/auth-license-cloud.md +146 -0
- package/.claude/skills/unity-cli/references/build-run-test.md +349 -0
- package/.claude/skills/unity-cli/references/collaboration.md +472 -0
- package/.claude/skills/unity-cli/references/config-hub.md +103 -0
- package/.claude/skills/unity-cli/references/diagnostics-maintenance.md +326 -0
- package/.claude/skills/unity-cli/references/editors-install.md +327 -0
- package/.claude/skills/unity-cli/references/integration-advanced.md +472 -0
- package/.claude/skills/unity-cli/references/projects-templates.md +574 -0
- package/.claude/skills/unity-package-management/SKILL.md +304 -0
- package/.claude/skills/unity-package-management/references/select-packages.md +108 -0
- package/.claude/skills/urp-postprocessing/SKILL.md +188 -0
- package/.claude/skills/urp-postprocessing/references/code-templates.md +119 -0
- package/.claude/skills/urp-postprocessing/references/effect-reference.md +86 -0
- package/.claude/skills/validate-urp-render-graph-renderer-feature/SKILL.md +269 -0
- package/.claude/skills/work/SKILL.md +36 -0
- package/.claude/skills/work/references/classification.md +41 -0
- package/.claude/skills/work/references/closure.md +50 -0
- package/.claude/skills/work/references/feature-contracts.md +32 -0
- package/.claude/skills/work/references/verification.md +26 -0
- package/CLAUDE.md +6 -0
- package/LICENSE +21 -0
- package/README.md +162 -0
- package/THIRD_PARTY_NOTICES.md +23 -0
- package/UPGRADING.md +32 -0
- package/VERSION +1 -0
- package/docs/ARCHITECTURE.md +73 -0
- package/docs/HUONG-DAN-MIGRATE-VA-SU-DUNG.md +324 -0
- package/docs/MIGRATION-MATRIX.md +23 -0
- package/docs/PROJECT-POLICY.md +67 -0
- package/docs/WORKFLOWS.md +61 -0
- package/package-assets/setup-vivox-voice-chat-evals.gitignore +7 -0
- package/package.json +41 -0
- package/scaffold/.nccgs/bugs/.gitkeep +1 -0
- package/scaffold/.nccgs/closures/.gitkeep +1 -0
- package/scaffold/.nccgs/context/.gitkeep +1 -0
- package/scaffold/.nccgs/decisions/.gitkeep +1 -0
- package/scaffold/.nccgs/evidence/.gitkeep +1 -0
- package/scaffold/.nccgs/features/.gitkeep +1 -0
- package/scaffold/.nccgs/migrations/.gitkeep +1 -0
- package/scaffold/.nccgs/playtests/.gitkeep +1 -0
- package/scaffold/.nccgs/project.yaml +103 -0
- package/scaffold/.nccgs/requirements.yaml +10 -0
- package/scaffold/.nccgs/reviews/.gitkeep +1 -0
- package/scaffold/.nccgs/state.md +40 -0
- package/scaffold/.nccgs/templates/agent-handoff.md +25 -0
- package/scaffold/.nccgs/templates/architecture-decision.md +27 -0
- package/scaffold/.nccgs/templates/closure-record.md +51 -0
- package/scaffold/.nccgs/templates/context-packet.yaml +17 -0
- package/scaffold/.nccgs/templates/evidence-record.md +23 -0
- package/scaffold/.nccgs/templates/feature-contract.md +35 -0
- package/scaffold/.nccgs/templates/migration-plan.md +40 -0
- package/scaffold/.nccgs/templates/waiver.md +11 -0
- package/scripts/cli.mjs +56 -0
- package/scripts/install.mjs +267 -0
- package/scripts/sync-unity-skills.mjs +126 -0
- package/scripts/validate.mjs +205 -0
- package/tests/framework.test.mjs +121 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Vivox Voice & Text Chat Skill Eval Suite
|
|
2
|
+
|
|
3
|
+
Evaluation suite for the `setup-vivox-voice-chat` skill, powered by [Promptfoo](https://www.promptfoo.dev/). Validates that the skill routes the model to the correct Vivox v16 APIs (no v4/legacy hallucinations) across init, channel join, and messaging.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- **Node.js** v18 or later
|
|
8
|
+
- A **LiteLLM API key** (from https://uai-litellm.internal.unity.com)
|
|
9
|
+
|
|
10
|
+
## Setup
|
|
11
|
+
|
|
12
|
+
### 1. Install Promptfoo
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
# Option A: install globally
|
|
16
|
+
npm install -g promptfoo
|
|
17
|
+
|
|
18
|
+
# Option B: use npx (no install needed)
|
|
19
|
+
npx promptfoo@latest eval
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### 2. Configure your API key
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
cd evals/
|
|
26
|
+
cp .env.example .env
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Open `.env` and set your personal LiteLLM key:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
OPENAI_API_KEY=your-litellm-api-key-here
|
|
33
|
+
OPENAI_BASE_URL=https://uai-litellm.internal.unity.com
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
> **Important:** Never commit your `.env` file. It is already in `.gitignore`.
|
|
37
|
+
|
|
38
|
+
## Running the evals
|
|
39
|
+
|
|
40
|
+
All commands should be run from the `evals/` directory.
|
|
41
|
+
|
|
42
|
+
Use `-j 10` to run up to 10 eval requests concurrently.
|
|
43
|
+
|
|
44
|
+
### Run the full suite
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
promptfoo eval -j 10
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Run a specific test file
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
promptfoo eval --tests tests/init-and-login.yaml -j 10
|
|
54
|
+
promptfoo eval --tests tests/voice-channels.yaml -j 10
|
|
55
|
+
promptfoo eval --tests tests/text-chat.yaml -j 10
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Viewing results
|
|
59
|
+
|
|
60
|
+
### Terminal output
|
|
61
|
+
|
|
62
|
+
Results are printed to the terminal with pass/fail per assertion.
|
|
63
|
+
|
|
64
|
+
### Interactive web UI
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
promptfoo view
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Opens a local UI (usually `http://localhost:15500`) for browsing results, filtering, and comparing runs.
|
|
71
|
+
|
|
72
|
+
## Assertions used
|
|
73
|
+
|
|
74
|
+
| Type | What it checks |
|
|
75
|
+
|---|---|
|
|
76
|
+
| `icontains` | Response contains a substring (case-insensitive), e.g. an exact Vivox API name |
|
|
77
|
+
| `not-icontains` | Response does NOT contain a substring (used to catch v4 legacy names like `Client.Instance`) |
|
|
78
|
+
| `llm-rubric` | An LLM judges whether the response meets a semantic requirement (e.g. correct init order) |
|
|
79
|
+
|
|
80
|
+
## Adding new tests
|
|
81
|
+
|
|
82
|
+
1. Create a new YAML file in `tests/`:
|
|
83
|
+
|
|
84
|
+
```yaml
|
|
85
|
+
- description: "Short description of what is being tested"
|
|
86
|
+
vars:
|
|
87
|
+
user_message: "The user request to test"
|
|
88
|
+
reference_content: "file://../references/your-reference.md" # optional
|
|
89
|
+
assert:
|
|
90
|
+
- type: icontains
|
|
91
|
+
value: "VivoxService.Instance.JoinGroupChannelAsync"
|
|
92
|
+
- type: not-icontains
|
|
93
|
+
value: "SendDirectedTextMessageAsync"
|
|
94
|
+
- type: llm-rubric
|
|
95
|
+
value: |
|
|
96
|
+
Describe the semantic requirement the response must meet.
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
2. Add the file to `promptfooconfig.yaml` under `tests:`.
|
|
100
|
+
|
|
101
|
+
3. Run it: `promptfoo eval --tests tests/your-new-test.yaml`.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
description: "Vivox Voice & Text Chat Skill Eval Suite"
|
|
2
|
+
|
|
3
|
+
providers:
|
|
4
|
+
# Evaluated model: used by the test itself
|
|
5
|
+
- id: openai:chat:claude-sonnet-4-5
|
|
6
|
+
config:
|
|
7
|
+
max_tokens: 2048
|
|
8
|
+
|
|
9
|
+
prompts:
|
|
10
|
+
- id: eval-prompt
|
|
11
|
+
label: "Eval prompt"
|
|
12
|
+
raw: "{{skill_content}}\n\n{{reference_content}}\n\n{{custom_instructions}}\n\n## User Request\n\n{{user_message}}"
|
|
13
|
+
|
|
14
|
+
defaultTest:
|
|
15
|
+
options:
|
|
16
|
+
# Assertion judge: used by llm-rubric
|
|
17
|
+
provider: openai:chat:claude-sonnet-4-6
|
|
18
|
+
vars:
|
|
19
|
+
skill_content: file://../SKILL.md
|
|
20
|
+
reference_content: ""
|
|
21
|
+
custom_instructions: |
|
|
22
|
+
IMPORTANT:
|
|
23
|
+
- This is a planning eval. Do not emit MCP XML/tool-call tags.
|
|
24
|
+
- Refer to APIs with their exact names as documented in the provided skill and references. Do not invent or paraphrase symbol names.
|
|
25
|
+
- Do not mention tool names you will not call. If a step is inapplicable, explain the behavior without naming the omitted API.
|
|
26
|
+
- Always present the complete plan up front. If a step requires a user action, describe what you will do after it succeeds and what happens if it fails, in a single response.
|
|
27
|
+
- Answer only the step or phase requested by the user message. Do not include unrelated setup or migration content that was not asked for.
|
|
28
|
+
|
|
29
|
+
tests:
|
|
30
|
+
- file://tests/init-and-login.yaml
|
|
31
|
+
- file://tests/voice-channels.yaml
|
|
32
|
+
- file://tests/text-chat.yaml
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# ============================================================
|
|
2
|
+
# WORKFLOW: Init + Login — correct order and re-init guard
|
|
3
|
+
# ============================================================
|
|
4
|
+
|
|
5
|
+
- description: "Cold-start init: UGS Core -> Auth -> Vivox Init -> Vivox Login, in order"
|
|
6
|
+
vars:
|
|
7
|
+
user_message: |
|
|
8
|
+
I'm adding Vivox to a fresh Unity project. Walk me through
|
|
9
|
+
the initialization from an empty MonoBehaviour Start method.
|
|
10
|
+
reference_content: file://../references/init-and-login.md
|
|
11
|
+
assert:
|
|
12
|
+
- type: icontains
|
|
13
|
+
value: "UnityServices.InitializeAsync"
|
|
14
|
+
- type: icontains
|
|
15
|
+
value: "AuthenticationService.Instance.SignInAnonymouslyAsync"
|
|
16
|
+
- type: icontains
|
|
17
|
+
value: "VivoxService.Instance.InitializeAsync"
|
|
18
|
+
- type: icontains
|
|
19
|
+
value: "VivoxService.Instance.LoginAsync"
|
|
20
|
+
- type: llm-rubric
|
|
21
|
+
value: |
|
|
22
|
+
The response MUST describe the four initialization calls in this
|
|
23
|
+
exact order:
|
|
24
|
+
1. UnityServices.InitializeAsync
|
|
25
|
+
2. AuthenticationService.Instance.SignInAnonymouslyAsync
|
|
26
|
+
3. VivoxService.Instance.InitializeAsync
|
|
27
|
+
4. VivoxService.Instance.LoginAsync
|
|
28
|
+
Any other ordering (e.g. Vivox init before UGS init, or Login
|
|
29
|
+
before Vivox init) is a failure.
|
|
30
|
+
The response MUST NOT use v4 legacy patterns (Client.Instance,
|
|
31
|
+
ILoginSession, AccountId, ChannelId) as callable code. It is
|
|
32
|
+
fine — even helpful — to mention those names in a "don't use
|
|
33
|
+
these" warning or migration note; a failure is only when the
|
|
34
|
+
code samples or step-by-step instructions actually invoke them.
|
|
35
|
+
|
|
36
|
+
- description: "Login with display name: LoginOptions.DisplayName"
|
|
37
|
+
vars:
|
|
38
|
+
user_message: |
|
|
39
|
+
After Vivox is initialized, sign the player in with the display name
|
|
40
|
+
"Sunbeam" and enable text-to-speech.
|
|
41
|
+
reference_content: file://../references/init-and-login.md
|
|
42
|
+
assert:
|
|
43
|
+
- type: icontains
|
|
44
|
+
value: "LoginOptions"
|
|
45
|
+
- type: icontains
|
|
46
|
+
value: "DisplayName"
|
|
47
|
+
- type: icontains
|
|
48
|
+
value: "EnableTTS"
|
|
49
|
+
- type: icontains
|
|
50
|
+
value: "VivoxService.Instance.LoginAsync"
|
|
51
|
+
- type: llm-rubric
|
|
52
|
+
value: |
|
|
53
|
+
The response must construct a LoginOptions with DisplayName set to
|
|
54
|
+
"Sunbeam" and EnableTTS set to true, then pass it to
|
|
55
|
+
VivoxService.Instance.LoginAsync. It must not USE the v4 AccountId
|
|
56
|
+
or ILoginSession types as callable code (mentioning them in a
|
|
57
|
+
"don't use" warning is acceptable — failure is only when the code
|
|
58
|
+
actually invokes them).
|
|
59
|
+
|
|
60
|
+
- description: "Double-init must warn about VxErrorAlreadyInitialized (5041)"
|
|
61
|
+
vars:
|
|
62
|
+
user_message: |
|
|
63
|
+
My Start method runs every time the main scene reloads and I'm
|
|
64
|
+
seeing Vivox errors. How do I stop it from re-initializing?
|
|
65
|
+
reference_content: file://../references/init-and-login.md
|
|
66
|
+
assert:
|
|
67
|
+
- type: icontains
|
|
68
|
+
value: "5041"
|
|
69
|
+
- type: llm-rubric
|
|
70
|
+
value: |
|
|
71
|
+
The response must identify the underlying issue as
|
|
72
|
+
VivoxService.Instance.InitializeAsync being called more than once,
|
|
73
|
+
cite the 5041 VxErrorAlreadyInitialized error, and propose a fix
|
|
74
|
+
such as guarding with IsInitialized or making the bootstrap
|
|
75
|
+
object DontDestroyOnLoad. The fix must NOT be to catch and
|
|
76
|
+
swallow the exception.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# ============================================================
|
|
2
|
+
# WORKFLOW: Text chat — channel messages, directed messages, history
|
|
3
|
+
# ============================================================
|
|
4
|
+
|
|
5
|
+
- description: "Send a channel message and receive channel messages"
|
|
6
|
+
vars:
|
|
7
|
+
user_message: |
|
|
8
|
+
Send the text "gg" into the "lobby" channel from a UI button, and
|
|
9
|
+
log every message received in that channel to the console.
|
|
10
|
+
reference_content: file://../references/text-chat.md
|
|
11
|
+
assert:
|
|
12
|
+
- type: icontains
|
|
13
|
+
value: "VivoxService.Instance.SendChannelTextMessageAsync"
|
|
14
|
+
- type: icontains
|
|
15
|
+
value: "VivoxService.Instance.ChannelMessageReceived"
|
|
16
|
+
- type: icontains
|
|
17
|
+
value: "VivoxMessage"
|
|
18
|
+
- type: llm-rubric
|
|
19
|
+
value: |
|
|
20
|
+
The response must call VivoxService.Instance.SendChannelTextMessageAsync
|
|
21
|
+
with channelName "lobby" and message "gg", AND subscribe to
|
|
22
|
+
VivoxService.Instance.ChannelMessageReceived with a handler that
|
|
23
|
+
takes a VivoxMessage and logs at least MessageText and
|
|
24
|
+
SenderDisplayName. It must NOT wire the send path to the
|
|
25
|
+
DirectedMessageReceived event.
|
|
26
|
+
|
|
27
|
+
- description: "Send a directed (direct) message — must use SendDirectTextMessageAsync, not SendDirected..."
|
|
28
|
+
vars:
|
|
29
|
+
user_message: |
|
|
30
|
+
Whisper "meet me at the north gate" to the player whose PlayerId
|
|
31
|
+
is "abc123".
|
|
32
|
+
reference_content: file://../references/text-chat.md
|
|
33
|
+
assert:
|
|
34
|
+
- type: icontains
|
|
35
|
+
value: "VivoxService.Instance.SendDirectTextMessageAsync"
|
|
36
|
+
- type: llm-rubric
|
|
37
|
+
value: |
|
|
38
|
+
The response must call VivoxService.Instance.SendDirectTextMessageAsync
|
|
39
|
+
with playerId "abc123" and the exact message
|
|
40
|
+
"meet me at the north gate". The method name must be
|
|
41
|
+
SendDirectTextMessageAsync (with "Direct", no "ed" before "Text").
|
|
42
|
+
SendDirectedTextMessageAsync does not exist in the SDK and MUST
|
|
43
|
+
NOT be USED as callable code — but mentioning it in a "common
|
|
44
|
+
hallucination, don't use this" warning is fine and even helpful.
|
|
45
|
+
The response may also mention subscribing to the
|
|
46
|
+
DirectedMessageReceived event on the recipient side.
|
|
47
|
+
|
|
48
|
+
- description: "Fetch the most recent channel chat history"
|
|
49
|
+
vars:
|
|
50
|
+
user_message: |
|
|
51
|
+
Fetch the last 25 messages from the "lobby" channel and print them
|
|
52
|
+
to the console in oldest-to-newest order.
|
|
53
|
+
reference_content: file://../references/text-chat.md
|
|
54
|
+
assert:
|
|
55
|
+
- type: icontains
|
|
56
|
+
value: "GetChannelTextMessageHistoryAsync"
|
|
57
|
+
- type: llm-rubric
|
|
58
|
+
value: |
|
|
59
|
+
The response must call
|
|
60
|
+
VivoxService.Instance.GetChannelTextMessageHistoryAsync with
|
|
61
|
+
channelName "lobby" and requestSize 25 (or equivalent). It must
|
|
62
|
+
note that the returned collection is newest-first and must
|
|
63
|
+
reverse the collection (or iterate in reverse) before printing to
|
|
64
|
+
achieve oldest-to-newest ordering. It should reference
|
|
65
|
+
VivoxMessage.SenderDisplayName and VivoxMessage.MessageText.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# ============================================================
|
|
2
|
+
# WORKFLOW: Voice channels — group, positional, join lifecycle
|
|
3
|
+
# ============================================================
|
|
4
|
+
|
|
5
|
+
- description: "Join a lobby group channel with voice and text"
|
|
6
|
+
vars:
|
|
7
|
+
user_message: |
|
|
8
|
+
The player is logged into Vivox. Have them join a non-positional
|
|
9
|
+
channel called "lobby" with both voice and text enabled.
|
|
10
|
+
reference_content: file://../references/voice-channels.md
|
|
11
|
+
assert:
|
|
12
|
+
- type: icontains
|
|
13
|
+
value: "VivoxService.Instance.JoinGroupChannelAsync"
|
|
14
|
+
- type: icontains
|
|
15
|
+
value: "ChatCapability.TextAndAudio"
|
|
16
|
+
- type: not-icontains
|
|
17
|
+
value: "JoinPositionalChannelAsync"
|
|
18
|
+
- type: not-icontains
|
|
19
|
+
value: "IChannelSession"
|
|
20
|
+
- type: llm-rubric
|
|
21
|
+
value: |
|
|
22
|
+
The response must call VivoxService.Instance.JoinGroupChannelAsync
|
|
23
|
+
with the channel name "lobby" and ChatCapability.TextAndAudio. It
|
|
24
|
+
must NOT use the positional or echo join methods, and must not
|
|
25
|
+
use any v4 IChannelSession API.
|
|
26
|
+
|
|
27
|
+
- description: "Join a 3D positional channel with Channel3DProperties"
|
|
28
|
+
vars:
|
|
29
|
+
user_message: |
|
|
30
|
+
Set up proximity voice: players near each other in the world should
|
|
31
|
+
hear each other, and voices fall off with distance. Name the
|
|
32
|
+
channel "world-proximity".
|
|
33
|
+
reference_content: file://../references/voice-channels.md
|
|
34
|
+
assert:
|
|
35
|
+
- type: icontains
|
|
36
|
+
value: "Channel3DProperties"
|
|
37
|
+
- type: icontains
|
|
38
|
+
value: "Set3DPosition"
|
|
39
|
+
- type: not-icontains
|
|
40
|
+
value: "JoinGroupChannelAsync"
|
|
41
|
+
- type: llm-rubric
|
|
42
|
+
value: |
|
|
43
|
+
This is a planning eval: judge the plan's correctness, not whether
|
|
44
|
+
it names APIs literally or includes runnable code. The plan must:
|
|
45
|
+
(a) identify positional (3D) channels as the mechanism — mentioning
|
|
46
|
+
"positional channel", "3D channel", or JoinPositionalChannelAsync
|
|
47
|
+
all count, since positional channels have exactly one join method;
|
|
48
|
+
(b) use the channel name "world-proximity";
|
|
49
|
+
(c) configure Channel3DProperties (naming at least the audible/
|
|
50
|
+
conversational distance concept, and ideally the fade model);
|
|
51
|
+
(d) state that each player's 3D position needs a per-frame update
|
|
52
|
+
via Set3DPosition (or an equivalent per-frame transform sync) so
|
|
53
|
+
distance attenuation actually works;
|
|
54
|
+
(e) make clear that awaiting the join call is not sufficient —
|
|
55
|
+
ChannelJoined must be subscribed to first for the join to be
|
|
56
|
+
observable.
|
|
57
|
+
|
|
58
|
+
- description: "Subscribe to ChannelJoined BEFORE calling JoinGroupChannelAsync"
|
|
59
|
+
vars:
|
|
60
|
+
user_message: |
|
|
61
|
+
When I call JoinGroupChannelAsync my UI never activates for the
|
|
62
|
+
newly joined channel. What am I doing wrong?
|
|
63
|
+
reference_content: file://../references/voice-channels.md
|
|
64
|
+
assert:
|
|
65
|
+
- type: icontains
|
|
66
|
+
value: "ChannelJoined"
|
|
67
|
+
- type: llm-rubric
|
|
68
|
+
value: |
|
|
69
|
+
The response must diagnose the problem as the ChannelJoined event
|
|
70
|
+
being subscribed AFTER the join call, and instruct the user to
|
|
71
|
+
subscribe to VivoxService.Instance.ChannelJoined BEFORE calling
|
|
72
|
+
JoinGroupChannelAsync. It must clearly state that awaiting the
|
|
73
|
+
JoinGroupChannelAsync call does NOT mean the join is complete —
|
|
74
|
+
the join completes when the ChannelJoined event fires.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Events, Participants, and Lifecycle
|
|
2
|
+
|
|
3
|
+
## Service-Level Events
|
|
4
|
+
|
|
5
|
+
All on `VivoxService.Instance`. Subscribe **before** the async call that produces them.
|
|
6
|
+
|
|
7
|
+
| Event | Signature | Fires on |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| `LoggedIn` | `Action` | `LoginAsync` success (also on reconnect) |
|
|
10
|
+
| `LoggedOut` | `Action` | `LogoutAsync` or disconnect |
|
|
11
|
+
| `ChannelJoined` | `Action<string channelName>` | Any `Join*ChannelAsync` success |
|
|
12
|
+
| `ChannelLeft` | `Action<string channelName>` | `LeaveChannelAsync` / `LeaveAllChannelsAsync` / disconnect |
|
|
13
|
+
| `ParticipantAddedToChannel` | `Action<VivoxParticipant>` | Any user joins a channel you're in (including yourself) |
|
|
14
|
+
| `ParticipantRemovedFromChannel` | `Action<VivoxParticipant>` | Any user leaves |
|
|
15
|
+
| `ChannelMessageReceived` | `Action<VivoxMessage>` | Any channel text message |
|
|
16
|
+
| `ChannelMessageEdited` | `Action<VivoxMessage>` | Any channel message edited |
|
|
17
|
+
| `ChannelMessageDeleted` | `Action<VivoxMessage>` | Any channel message deleted |
|
|
18
|
+
| `DirectedMessageReceived` | `Action<VivoxMessage>` | Any directed message to you |
|
|
19
|
+
| `DirectedMessageEdited` | `Action<VivoxMessage>` | Directed message edited |
|
|
20
|
+
| `DirectedMessageDeleted` | `Action<VivoxMessage>` | Directed message deleted |
|
|
21
|
+
|
|
22
|
+
## VivoxParticipant
|
|
23
|
+
|
|
24
|
+
Delivered by `ParticipantAddedToChannel` and `ParticipantRemovedFromChannel`. Represents one participant in one channel — the same user in two channels is two separate `VivoxParticipant` instances.
|
|
25
|
+
|
|
26
|
+
| Property | Purpose |
|
|
27
|
+
|---|---|
|
|
28
|
+
| `PlayerId` | Stable UAS PlayerId of the participant |
|
|
29
|
+
| `DisplayName` | From the participant's `LoginOptions.DisplayName` |
|
|
30
|
+
| `ChannelName` | Which channel this participation is in |
|
|
31
|
+
| `IsSelf` | `true` if this is the local player |
|
|
32
|
+
| `IsMuted` | Current locally-muted state |
|
|
33
|
+
| `AudioEnergy` | Continuous 0.0–1.0 signal for VU-meter UI |
|
|
34
|
+
| `SpeechDetected` | `true` when Vivox judges audio energy is speech, not noise |
|
|
35
|
+
|
|
36
|
+
## Per-Participant Events
|
|
37
|
+
|
|
38
|
+
Live on the `VivoxParticipant` instance, **not** on `VivoxService.Instance`:
|
|
39
|
+
|
|
40
|
+
- `ParticipantMuteStateChanged` — `IsMuted` flipped.
|
|
41
|
+
- `ParticipantSpeechDetected` — `SpeechDetected` flipped.
|
|
42
|
+
- `ParticipantAudioEnergyChanged` — `AudioEnergy` updated (higher-frequency; use for VU meter).
|
|
43
|
+
|
|
44
|
+
Typical wiring in a roster item that represents one participant:
|
|
45
|
+
|
|
46
|
+
```csharp
|
|
47
|
+
public void Bind(VivoxParticipant p)
|
|
48
|
+
{
|
|
49
|
+
_participant = p;
|
|
50
|
+
p.ParticipantMuteStateChanged += Refresh;
|
|
51
|
+
p.ParticipantSpeechDetected += Refresh;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
void OnDestroy()
|
|
55
|
+
{
|
|
56
|
+
if (_participant == null) return;
|
|
57
|
+
_participant.ParticipantMuteStateChanged -= Refresh;
|
|
58
|
+
_participant.ParticipantSpeechDetected -= Refresh;
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Local Mute Actions
|
|
63
|
+
|
|
64
|
+
Called on the `VivoxParticipant` (not the service):
|
|
65
|
+
|
|
66
|
+
- `participant.MutePlayerLocally()` — you stop hearing them.
|
|
67
|
+
- `participant.UnmutePlayerLocally()` — you resume hearing them.
|
|
68
|
+
|
|
69
|
+
The remote participant is unaware. To mute globally (they cannot be heard by anyone), a moderator client needs a server-issued mute token.
|
|
70
|
+
|
|
71
|
+
## Cleanup Discipline
|
|
72
|
+
|
|
73
|
+
`VivoxService.Instance` is a persistent singleton across scene loads. Any handler you subscribe from a MonoBehaviour **must** be unsubscribed in `OnDestroy` or `OnDisable`, or the handler will fire against a destroyed object on the next scene load and throw a `MissingReferenceException`.
|
|
74
|
+
|
|
75
|
+
Pattern: subscribe in `Awake`/`Start`, mirror the list in `OnDestroy`, always null-guard `VivoxService.Instance` (it may already be null during application quit).
|
|
76
|
+
|
|
77
|
+
## Connection Recovery
|
|
78
|
+
|
|
79
|
+
On network blips Vivox will auto-reconnect and re-fire `LoggedIn` and (for previously-joined channels) `ChannelJoined`. Design handlers to be **idempotent** — do not assume `LoggedIn` fires exactly once per session, and don't grant one-shot benefits (analytics event, first-login reward) from inside it without a guard.
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Initialization and Login
|
|
2
|
+
|
|
3
|
+
## Package and Namespaces
|
|
4
|
+
|
|
5
|
+
Install `com.unity.services.vivox` via Package Manager. Add `using Unity.Services.Vivox;` to any script that touches the SDK. For UGS-backed auth also add `using Unity.Services.Core;` and `using Unity.Services.Authentication;`.
|
|
6
|
+
|
|
7
|
+
## Full Initialization Snippet
|
|
8
|
+
|
|
9
|
+
Grounded on the Vivox docs — do not deviate from this order.
|
|
10
|
+
|
|
11
|
+
```csharp
|
|
12
|
+
using System;
|
|
13
|
+
using UnityEngine;
|
|
14
|
+
using Unity.Services.Authentication;
|
|
15
|
+
using Unity.Services.Core;
|
|
16
|
+
using Unity.Services.Vivox;
|
|
17
|
+
|
|
18
|
+
public class VivoxBootstrap : MonoBehaviour
|
|
19
|
+
{
|
|
20
|
+
async void Start()
|
|
21
|
+
{
|
|
22
|
+
await UnityServices.InitializeAsync();
|
|
23
|
+
await AuthenticationService.Instance.SignInAnonymouslyAsync();
|
|
24
|
+
|
|
25
|
+
await VivoxService.Instance.InitializeAsync();
|
|
26
|
+
|
|
27
|
+
VivoxService.Instance.LoggedIn += OnLoggedIn;
|
|
28
|
+
VivoxService.Instance.LoggedOut += OnLoggedOut;
|
|
29
|
+
|
|
30
|
+
await VivoxService.Instance.LoginAsync(new LoginOptions
|
|
31
|
+
{
|
|
32
|
+
DisplayName = "Bob",
|
|
33
|
+
EnableTTS = false
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
void OnLoggedIn() { /* joins, UI enable, etc. */ }
|
|
38
|
+
void OnLoggedOut() { /* teardown */ }
|
|
39
|
+
|
|
40
|
+
void OnDestroy()
|
|
41
|
+
{
|
|
42
|
+
if (VivoxService.Instance == null) return;
|
|
43
|
+
VivoxService.Instance.LoggedIn -= OnLoggedIn;
|
|
44
|
+
VivoxService.Instance.LoggedOut -= OnLoggedOut;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## VivoxConfigurationOptions
|
|
50
|
+
|
|
51
|
+
`InitializeAsync` takes an optional `VivoxConfigurationOptions`. Common fields: log level, audio ducking behavior, server region. Leave defaults for most projects; only override when platform-specific tuning is documented in the Vivox docs (e.g. mobile ducking).
|
|
52
|
+
|
|
53
|
+
## LoginOptions
|
|
54
|
+
|
|
55
|
+
| Field | Notes |
|
|
56
|
+
|---|---|
|
|
57
|
+
| `DisplayName` | Shown to other participants via `VivoxParticipant.DisplayName`. Session-only, not persisted. Max 127 bytes. Sanitize / uniqueness-check server-side; the SDK does not validate. |
|
|
58
|
+
| `EnableTTS` | Enables text-to-speech injection into channels. Off by default. |
|
|
59
|
+
| Blocked list | Preload users blocked by this player. |
|
|
60
|
+
|
|
61
|
+
The identity Vivox binds this login to is the current `AuthenticationService.Instance.PlayerId` — that's how other clients address you for directed messages. If you skip UAS, Vivox falls back to a per-session GUID and cross-session identity is lost.
|
|
62
|
+
|
|
63
|
+
## Sign Out
|
|
64
|
+
|
|
65
|
+
```csharp
|
|
66
|
+
await VivoxService.Instance.LogoutAsync();
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
`LogoutAsync` fires `LoggedOut`. Call it before shutting the app down cleanly; the SDK also handles ungraceful teardown but explicit logout gives you a clean disconnect on the server side.
|
|
70
|
+
|
|
71
|
+
## Access Tokens (VAT) — When You Need Them
|
|
72
|
+
|
|
73
|
+
The default UGS-backed path automatically mints access tokens signed by your UGS project. You don't touch tokens in code.
|
|
74
|
+
|
|
75
|
+
You need to switch to server-side VAT minting when:
|
|
76
|
+
|
|
77
|
+
- You're not using UGS Authentication (custom identity system).
|
|
78
|
+
- You need privileged tokens: kick a user from a channel, mute-all, transcription enable, join-muted.
|
|
79
|
+
- You want channel-scoped ACLs (only players holding a valid join token for `raid-42` can enter).
|
|
80
|
+
|
|
81
|
+
Do **not** embed the Vivox app secret / HMAC signing key in client code. See the "Access Token Developer Guide" and the C++, C#, Python, and JavaScript minting examples in the Unity Vivox documentation map for server implementations.
|
|
82
|
+
|
|
83
|
+
## Re-init Guard
|
|
84
|
+
|
|
85
|
+
Calling `VivoxService.Instance.InitializeAsync()` twice throws `5041 VxErrorAlreadyInitialized`. If your `Start` may run again after scene reload, wrap init in a check:
|
|
86
|
+
|
|
87
|
+
```csharp
|
|
88
|
+
if (VivoxService.Instance != null && !VivoxService.Instance.IsInitialized)
|
|
89
|
+
await VivoxService.Instance.InitializeAsync();
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Or make the bootstrap MonoBehaviour `DontDestroyOnLoad` so it only runs once.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Text Chat
|
|
2
|
+
|
|
3
|
+
Text works over any channel joined with `ChatCapability.TextOnly` or `ChatCapability.TextAndAudio`, plus directed (peer-to-peer) messages that don't require a shared channel.
|
|
4
|
+
|
|
5
|
+
## Channel Messages
|
|
6
|
+
|
|
7
|
+
**Send:**
|
|
8
|
+
|
|
9
|
+
```csharp
|
|
10
|
+
await VivoxService.Instance.SendChannelTextMessageAsync(
|
|
11
|
+
string channelName,
|
|
12
|
+
string message);
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
**Receive:**
|
|
16
|
+
|
|
17
|
+
```csharp
|
|
18
|
+
VivoxService.Instance.ChannelMessageReceived += OnChannelMessageReceived;
|
|
19
|
+
|
|
20
|
+
void OnChannelMessageReceived(VivoxMessage m)
|
|
21
|
+
{
|
|
22
|
+
// m.ChannelName, m.SenderDisplayName, m.SenderPlayerId,
|
|
23
|
+
// m.MessageText, m.ReceivedTime, m.Language, m.FromSelf, m.MessageId
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Directed Messages
|
|
28
|
+
|
|
29
|
+
**Send:** (note spelling — `SendDirect…`, not `SendDirected…`)
|
|
30
|
+
|
|
31
|
+
```csharp
|
|
32
|
+
await VivoxService.Instance.SendDirectTextMessageAsync(
|
|
33
|
+
string playerId, // recipient's UAS PlayerId
|
|
34
|
+
string message);
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**Receive:** (event *is* `Directed…`)
|
|
38
|
+
|
|
39
|
+
```csharp
|
|
40
|
+
VivoxService.Instance.DirectedMessageReceived += OnDirectedMessageReceived;
|
|
41
|
+
|
|
42
|
+
void OnDirectedMessageReceived(VivoxMessage m)
|
|
43
|
+
{
|
|
44
|
+
// Same VivoxMessage fields, but m.ChannelName is null and m.FromSelf is false.
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## VivoxMessage Fields
|
|
49
|
+
|
|
50
|
+
| Field | Notes |
|
|
51
|
+
|---|---|
|
|
52
|
+
| `ChannelName` | The channel the message came in on. **`null` for directed messages.** |
|
|
53
|
+
| `SenderDisplayName` | As set in the sender's `LoginOptions`. |
|
|
54
|
+
| `SenderPlayerId` | UAS PlayerId — stable identity to reply/DM back. |
|
|
55
|
+
| `MessageText` | The message body. |
|
|
56
|
+
| `ReceivedTime` | `DateTime` of receipt. |
|
|
57
|
+
| `Language` | Sender's language tag if set. |
|
|
58
|
+
| `FromSelf` | `true` for the local player's own channel messages; `false` for directed messages. |
|
|
59
|
+
| `MessageId` | Server-assigned ID — required to edit or delete. |
|
|
60
|
+
|
|
61
|
+
## Chat History
|
|
62
|
+
|
|
63
|
+
Retention: **7 days** by default (30 days if Text Evidence Management is enabled).
|
|
64
|
+
|
|
65
|
+
```csharp
|
|
66
|
+
IReadOnlyCollection<VivoxMessage> GetChannelTextMessageHistoryAsync(
|
|
67
|
+
string channelName,
|
|
68
|
+
int requestSize = 10,
|
|
69
|
+
ChatHistoryQueryOptions options = null);
|
|
70
|
+
|
|
71
|
+
IReadOnlyCollection<VivoxMessage> GetDirectTextMessageHistoryAsync(
|
|
72
|
+
string playerId,
|
|
73
|
+
int requestSize = 10,
|
|
74
|
+
ChatHistoryQueryOptions options = null);
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Both return messages **newest-first**. Reverse when rendering a chat log.
|
|
78
|
+
|
|
79
|
+
## Edit and Delete
|
|
80
|
+
|
|
81
|
+
Only the original sender can edit or delete their own messages.
|
|
82
|
+
|
|
83
|
+
| Op | Channel | Directed |
|
|
84
|
+
|---|---|---|
|
|
85
|
+
| Edit | `EditChannelTextMessageAsync(channelName, messageId, newText)` | `EditDirectTextMessageAsync(messageId, newText)` |
|
|
86
|
+
| Delete | `DeleteChannelTextMessageAsync(channelName, messageId)` | `DeleteDirectTextMessageAsync(messageId)` |
|
|
87
|
+
| Notify (all participants) | `ChannelMessageEdited`, `ChannelMessageDeleted` | `DirectedMessageEdited`, `DirectedMessageDeleted` |
|
|
88
|
+
|
|
89
|
+
All notify events carry the updated `VivoxMessage`.
|
|
90
|
+
|
|
91
|
+
## Anti-flooding
|
|
92
|
+
|
|
93
|
+
Vivox rate-limits messages per player. When implementing chat UI, disable the send button after each send until acknowledged, and surface a "try again in a moment" hint on rate-limit errors — do not spam-retry.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Troubleshooting and Platform Notes
|
|
2
|
+
|
|
3
|
+
For the authoritative error table, see the Vivox SDK error codes page linked from the Vivox documentation map.
|
|
4
|
+
|
|
5
|
+
## Common Errors
|
|
6
|
+
|
|
7
|
+
| Code | Name | Cause | Fix |
|
|
8
|
+
|---|---|---|---|
|
|
9
|
+
| `5041` | `VxErrorAlreadyInitialized` | `VivoxService.Instance.InitializeAsync()` called twice | Guard with `IsInitialized` or make bootstrap `DontDestroyOnLoad` |
|
|
10
|
+
| `20502` | `VxXmppServerErrorServiceUnavailable` | Exceeded 10 non-positional channels per user, or 200 participants per channel | Leave a channel before joining another; for large positional channels use Large 3D Channels setting |
|
|
11
|
+
| Login fails silently | — | Subscribed to `LoggedIn` **after** `LoginAsync` returned | Subscribe first, then call `LoginAsync` |
|
|
12
|
+
| `ChannelJoined` never fires | — | Awaited `JoinGroupChannelAsync` as if it completes the join | Bind `ChannelJoined` before calling; treat the await as "request queued" |
|
|
13
|
+
| No audio in / out | — | Mic permission denied, wrong `ChatCapability` (e.g. `TextOnly` when audio expected), or muted input device | Check runtime permission, `ChatCapability`, and `IsInputDeviceMuted` — call `UnmuteInputDevice()` if muted |
|
|
14
|
+
|
|
15
|
+
## Platform Notes
|
|
16
|
+
|
|
17
|
+
### Android
|
|
18
|
+
|
|
19
|
+
- Merge `<uses-permission android:name="android.permission.RECORD_AUDIO"/>` into `AndroidManifest.xml`.
|
|
20
|
+
- Request at runtime with `UnityEngine.Android.Permission.RequestUserPermission(Permission.Microphone)` **before** joining an audio channel — Android will not prompt automatically for you.
|
|
21
|
+
- Bluetooth SCO underruns cause choppy input — see the Android troubleshooting page in the documentation map.
|
|
22
|
+
- If shrinking / obfuscating with R8/ProGuard, add the Vivox ProGuard rules from the docs.
|
|
23
|
+
|
|
24
|
+
### iOS
|
|
25
|
+
|
|
26
|
+
- Add `NSMicrophoneUsageDescription` to Info.plist (Project Settings → Player → iOS → Microphone Usage Description).
|
|
27
|
+
- The orange/red iOS recording indicator is shown any time Vivox is capturing — this is OS-enforced and expected.
|
|
28
|
+
|
|
29
|
+
### WebGL
|
|
30
|
+
|
|
31
|
+
- The Vivox WebGL SDK is a subset of the native SDK. Audio Taps, some codecs, and certain positional-audio features are unavailable. Read the WebGL support page in the documentation map before promising a feature on web.
|
|
32
|
+
- Browsers require a user gesture before capturing the mic — trigger the first `JoinGroupChannelAsync`/`JoinPositionalChannelAsync` from a button click, not from `Start()`.
|
|
33
|
+
|
|
34
|
+
### NDA Platforms (console)
|
|
35
|
+
|
|
36
|
+
Vivox ships NDA-gated packages for consoles. Contact Unity for access; the public UPM package does not include console binaries.
|
|
37
|
+
|
|
38
|
+
## Diagnostic Checklist
|
|
39
|
+
|
|
40
|
+
When integration seems broken and no clear error surfaces:
|
|
41
|
+
|
|
42
|
+
1. Confirm init order — `UnityServices.InitializeAsync` → `AuthenticationService.Instance.SignInAnonymouslyAsync` → `VivoxService.Instance.InitializeAsync` → `VivoxService.Instance.LoginAsync`.
|
|
43
|
+
2. Log every event handler entry (`LoggedIn`, `ChannelJoined`, `ChannelMessageReceived`). If a handler you expect never enters, you subscribed after the event already fired.
|
|
44
|
+
3. Confirm the joined channel's `ChatCapability` matches what you're trying to do (text vs audio).
|
|
45
|
+
4. Confirm mic permission on the platform you're testing.
|
|
46
|
+
5. If audio was working then stopped after a scene reload, you have leaked event subscriptions from destroyed MonoBehaviours — audit `OnDestroy` unsubscribes.
|
|
47
|
+
6. If a directed message never arrives, verify `SendDirectTextMessageAsync` is targeting the recipient's **UAS PlayerId** (not display name), and that the recipient has subscribed to `DirectedMessageReceived`.
|