create-spatius-app 0.1.2 → 0.1.3-beta.2

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 (53) hide show
  1. package/README.md +18 -6
  2. package/dist/cli.js +647 -144
  3. package/dist/templates.js +529 -66
  4. package/package.json +4 -4
  5. package/schemas/result-v3.schema.json +6 -2
  6. package/schemas/result-v4.schema.json +170 -0
  7. package/templates/cloudflare-livekit/AGENTS.md +2 -0
  8. package/templates/cloudflare-livekit/agent/README.md +13 -0
  9. package/templates/cloudflare-livekit/agent/env.example +3 -0
  10. package/templates/cloudflare-livekit/agent/pyproject.toml +1 -1
  11. package/templates/cloudflare-livekit/agent/src/agent.py +7 -4
  12. package/templates/cloudflare-livekit/agent/tests/test_agent_startup.py +49 -0
  13. package/templates/cloudflare-livekit/agent/uv.lock +14 -14
  14. package/templates/cloudflare-livekit/gitignore +1 -0
  15. package/templates/cloudflare-livekit/package-lock.json +247 -158
  16. package/templates/cloudflare-livekit/package.json +9 -8
  17. package/templates/cloudflare-livekit/pnpm-lock.yaml +200 -177
  18. package/templates/cloudflare-livekit/tests/dev-events.test.mjs +23 -0
  19. package/templates/cloudflare-livekit/tests/dev-fixtures.mjs +14 -5
  20. package/templates/cloudflare-livekit/tests/dev-supervision.test.mjs +17 -14
  21. package/templates/cloudflare-livekit/tsconfig.web.json +1 -0
  22. package/templates/cloudflare-livekit/tsconfig.worker.json +1 -0
  23. package/templates/cloudflare-livekit/web/api.ts +12 -0
  24. package/templates/cloudflare-livekit/web/components/agents-ui/agent-chat-transcript.tsx +6 -90
  25. package/templates/cloudflare-livekit/web/components/transcript-view.tsx +90 -0
  26. package/templates/cloudflare-livekit/web/session-attempt.ts +23 -2
  27. package/templates/cloudflare-livekit/worker/capability.test.ts +31 -0
  28. package/templates/cloudflare-livekit/worker/capability.ts +72 -0
  29. package/templates/cloudflare-livekit/worker/index.test.ts +2 -2
  30. package/templates/cloudflare-livekit/worker/index.ts +15 -3
  31. package/templates/cloudflare-livekit/worker/session.ts +34 -0
  32. package/templates/layers/agora/AGENTS.md +13 -0
  33. package/templates/layers/agora/README.md +25 -0
  34. package/templates/layers/agora/dev.vars.example +9 -0
  35. package/templates/layers/agora/package-lock.json +6988 -0
  36. package/templates/layers/agora/package.json +60 -0
  37. package/templates/layers/agora/pnpm-lock.yaml +4648 -0
  38. package/templates/layers/agora/scripts/check-worker.mjs +98 -0
  39. package/templates/layers/agora/tsconfig.worker.json +23 -0
  40. package/templates/layers/agora/vitest.config.ts +4 -0
  41. package/templates/layers/agora/web/App.tsx +174 -0
  42. package/templates/layers/agora/web/agora-session.test.ts +70 -0
  43. package/templates/layers/agora/web/agora-session.ts +267 -0
  44. package/templates/layers/agora/worker/agora.test.ts +62 -0
  45. package/templates/layers/agora/worker/agora.ts +156 -0
  46. package/templates/layers/agora/worker/index.test.ts +66 -0
  47. package/templates/layers/agora/worker/index.ts +54 -0
  48. package/templates/layers/agora/wrangler.jsonc +24 -0
  49. package/templates/layers/catalog/DEPLOYMENT.md +3 -0
  50. package/templates/layers/catalog/spatius.config.json +1 -0
  51. package/dist/cli.js.map +0 -1
  52. package/dist/templates.js.map +0 -1
  53. package/templates/cloudflare-livekit/worker-configuration.d.ts +0 -17184
@@ -0,0 +1,13 @@
1
+ # Generated Agora application
2
+
3
+ Use `__DEV__` for local development and `__CHECK__` for verification.
4
+ The Cloudflare Worker API calls hosted Conversational AI over HTTP. Agora owns
5
+ the conversational agent; this application has no Python worker or Node server.
6
+ Browser audio uses Agora RTC, and text input and transcripts use the official
7
+ Agora client toolkit. Spatius renders the avatar locally.
8
+
9
+ Keep secrets in `.dev.vars` locally and Cloudflare Worker secrets in production.
10
+ Wrangler generates the ignored `worker-configuration.d.ts` during installation
11
+ and before lint, type checking, and builds. Update `wrangler.jsonc` to change bindings.
12
+ Preserve session cleanup on disconnect and failed startup.
13
+ Use mocks for provider calls in tests. See DEPLOYMENT.md for Cloudflare setup.
@@ -0,0 +1,25 @@
1
+ # Spatius voice assistant — Cloudflare + Agora
2
+
3
+ A minimal React avatar conversation with a Cloudflare Worker API and Agora
4
+ Conversational AI. The frontend and API deploy together on Cloudflare Workers;
5
+ Agora hosts the conversational agent.
6
+
7
+ Requires Node.js 22.12+, an Agora project with Conversational AI and RTM enabled,
8
+ a published English assistant pipeline, and Spatius credentials. No Python is needed.
9
+
10
+ ```sh
11
+ __INSTALL__
12
+ npx create-spatius-app setup . --interactive
13
+ __DEV__
14
+ ```
15
+
16
+ Local setup saves credentials in `.dev.vars`. The Vite Cloudflare plugin runs
17
+ both the frontend and Worker API locally. Open the printed URL, start a
18
+ conversation, and speak or type. Microphone permission is optional: typed
19
+ messages use Agora RTM. The transcript stays visible after disconnecting.
20
+
21
+ Configure the assistant persona, speech recognition language, model, and voice
22
+ in the published Agora pipeline. Match `AGORA_AVATAR_SAMPLE_RATE` to its TTS output.
23
+
24
+ Run `__CHECK__` to verify the application. See [DEPLOYMENT.md](DEPLOYMENT.md)
25
+ to deploy the frontend and API together to Cloudflare Workers.
@@ -0,0 +1,9 @@
1
+ AGORA_APP_ID=your-agora-app-id
2
+ AGORA_APP_CERTIFICATE=your-agora-app-certificate
3
+ AGORA_PIPELINE_ID=your-published-pipeline-id
4
+ SPATIUS_APP_ID=your-spatius-app-id
5
+ SPATIUS_API_KEY=your-spatius-api-key
6
+ SPATIUS_AVATAR_ID=your-spatius-avatar-id
7
+ SPATIUS_REGION=cn-beijing
8
+ # Must match the published pipeline's TTS output.
9
+ AGORA_AVATAR_SAMPLE_RATE=24000