diff --git a/.env.example b/.env.example index a12b24e7b..de27196af 100644 --- a/.env.example +++ b/.env.example @@ -1,10 +1,15 @@ # This file is intentionally documentation-only. # # Integrated LexVoice runs should not configure frontend variables here. -# Use `../lex-voice/.env` as the single source of truth; `lex-voice/run.sh` -# injects LiveKit, room-input, input-source, role-device, agent, media, and -# debug settings into the frontend process when it starts `make start_ui`. +# Use the LexVoice repository `.env` as the single source of truth; its `run.sh` +# injects LiveKit, room-input, input-source, role-device, agent, media, and debug +# settings into the frontend process when it starts `make start_ui`. # # Only create `agent-starter-react/.env.local` for standalone frontend # development where this repository is launched directly with `pnpm dev`. # In that case, define only the variables needed for that standalone run. + +# For sandbox gateway deployment, see the LexVoice repository's +# `deploy/liveavatar_gateway/env.example`; copy that reference file to +# `deploy/liveavatar_gateway/.env` inside the LexVoice repository to configure +# a deployed gateway. diff --git a/.gitignore b/.gitignore index 122bf192a..03a7151c0 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,12 @@ # testing /coverage +# Legacy sandbox gateway artifacts from pre-migration local runs +/.sandbox-gateway/ +/logs/direct-proxy.log +/logs/sandbox-gateway*.log +/logs/sandbox-gateway.pid + # next.js /.next/ /out/ diff --git a/README.md b/README.md index 3cadc5a13..54ebe2f90 100644 --- a/README.md +++ b/README.md @@ -57,10 +57,10 @@ Run the following command to automatically clone this template. lk app create --template agent-starter-react ``` -For integrated LexVoice runs, configure `../lex-voice/.env` and start the -frontend through the LexVoice runtime scripts. `../lex-voice/run.sh` injects -LiveKit, room-input, input-source, role-device, agent, media, and debug settings -into this Next.js process. +For integrated LexVoice runs, configure the LexVoice repository `.env` and start +the frontend through the LexVoice runtime scripts. The LexVoice repository's +`run.sh` injects LiveKit, room-input, input-source, role-device, agent, media, +and debug settings into this Next.js process. The session lifecycle API keeps start/stop state in memory, so integrated deployments should route `/api/session/*` to a single Next.js instance or sticky routing. @@ -68,6 +68,16 @@ If you replace the custom connection details endpoint, it must echo the requeste `sessionId` and derive the same room name so dispatch and stop calls coordinate with the connected room. +### LiveAvatar Gateway Deployments + +Sandbox-backed public deployments are owned by the LexVoice repository. Set +`LIVEAVATAR_USE_SANDBOX=1` in the LexVoice repository `.env` and configure +broker, template, warm pool, and `SANDBOX_ENV_*` values in the LexVoice repository's +`deploy/liveavatar_gateway/.env`. + +This frontend repository only runs the Next.js UI. It does not create, release, +or warm sandbox sessions. + For standalone frontend development, install dependencies and run the dev server directly: @@ -78,8 +88,8 @@ pnpm dev And open http://localhost:3000 in your browser. -You'll also need a LiveKit server and an agent worker. In this workspace, those -are normally provided by the sibling `../lex-voice` project. +You'll also need a LiveKit server and an agent worker. In integrated workspaces, +those are normally provided by the LexVoice project. ## Configuration @@ -118,7 +128,7 @@ You can update these values in [`app-config.ts`](./app-config.ts) to customize b #### Environment Variables -Integrated runs should keep runtime variables in `../lex-voice/.env`; this +Integrated runs should keep runtime variables in the LexVoice repository `.env`; this repository's `.env.example` is documentation-only. Only create `agent-starter-react/.env.local` for standalone frontend development launched directly with `pnpm dev`. @@ -130,7 +140,7 @@ LIVEKIT_URL=https://your-livekit-server-url ``` The frontend defaults to the browser camera/microphone input when no input -source is provided. Configure `INPUT_SOURCE` only in `../lex-voice/.env` for +source is provided. Configure `INPUT_SOURCE` only in the LexVoice repository `.env` for integrated backend runs. The LiveKit variables above are required for standalone voice agent functionality to work with your LiveKit project. diff --git a/next.config.ts b/next.config.ts index 597fcaa5a..8564a5b86 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,7 +1,7 @@ import type { NextConfig } from 'next'; const nextConfig: NextConfig = { - allowedDevOrigins: ['liveavatar.lexmount.cn'], + allowedDevOrigins: ['liveavatar.local.lexmount.net'], }; export default nextConfig; diff --git a/tests/project-config.test.mjs b/tests/project-config.test.mjs index fa75dc818..1cb1bf5c1 100644 --- a/tests/project-config.test.mjs +++ b/tests/project-config.test.mjs @@ -15,7 +15,9 @@ test('README matches the documented LexVoice environment source', async () => { const envExample = await readFile('.env.example', 'utf8'); assert.match(envExample, /documentation-only/); - assert.match(readme, /\.\.\/lex-voice\/\.env/); + assert.match(readme, /LexVoice repository `\.env`/); + assert.doesNotMatch(readme, /\blex-voice\b/); + assert.doesNotMatch(envExample, /\blex-voice\b/); assert.match(readme, /single Next\.js instance or sticky routing/); assert.match(readme, /custom connection details endpoint/); assert.match(readme, /sessionId/);