From 8adcb0a4cdbdb6e68399025d43816601c98a1b2c Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Sat, 7 Feb 2026 14:41:21 +0700 Subject: [PATCH] Update files --- CLAUDE.md | 33 +++++++++++++++++++ packages/app/src/contexts/voice-context.tsx | 14 +++----- .../app/src/voice/realtime-voice-config.ts | 7 ++++ 3 files changed, 45 insertions(+), 9 deletions(-) create mode 100644 packages/app/src/voice/realtime-voice-config.ts diff --git a/CLAUDE.md b/CLAUDE.md index 1eb746106..324b49072 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -102,6 +102,39 @@ Get the session ID from the agent JSON file (`persistence.sessionId`), then: Take screenshots like this: `adb exec-out screencap -p > screenshot.png` +### Android variants (vanilla Expo) + +Use `APP_VARIANT` in `packages/app/app.config.js` to control app name + package ID (no custom Gradle flavor plugin): + +- `prod` -> app name `Paseo`, package `sh.paseo` +- `debug` -> app name `Paseo Debug`, package `sh.paseo.debug` +- `fast` -> app name `Paseo Dev`, package `sh.paseo.dev` + +EAS profiles live in `packages/app/eas.json` as `prod`, `debug`, and `fast`. + +`fast` uses Android `debugOptimized` for better runtime performance while still supporting Metro/Fast Refresh. + +### Local build + install (Android device) + +From `packages/app`: + +```bash +# prod (release) +APP_VARIANT=prod npx expo prebuild --platform android --clean --no-install +(cd android && ./gradlew app:assembleRelease) +adb install -r android/app/build/outputs/apk/release/app-release.apk + +# debug (full debug tooling) +APP_VARIANT=debug npx expo prebuild --platform android --clean --no-install +(cd android && ./gradlew app:assembleDebug) +adb install -r android/app/build/outputs/apk/debug/app-debug.apk + +# fast (debugOptimized + Metro/Fast Refresh) +APP_VARIANT=fast npx expo prebuild --platform android --clean --no-install +(cd android && ./gradlew app:assembleDebugOptimized) +adb install -r android/app/build/outputs/apk/debugOptimized/app-debugOptimized.apk +``` + ## Testing with Playwright MCP **CRITICAL:** When asked to test the app, you MUST use the Playwright MCP connecting to Metro at `http://localhost:8081`. diff --git a/packages/app/src/contexts/voice-context.tsx b/packages/app/src/contexts/voice-context.tsx index fd2fd2692..d03da889d 100644 --- a/packages/app/src/contexts/voice-context.tsx +++ b/packages/app/src/contexts/voice-context.tsx @@ -3,13 +3,9 @@ import { useSpeechmaticsAudio } from "@/hooks/use-speechmatics-audio"; import type { SessionState } from "@/stores/session-store"; import { useSessionStore } from "@/stores/session-store"; import { activateKeepAwakeAsync, deactivateKeepAwake } from "expo-keep-awake"; +import { REALTIME_VOICE_VAD_CONFIG } from "@/voice/realtime-voice-config"; const KEEP_AWAKE_TAG = "paseo:voice"; -const VOICE_VAD_VOLUME_THRESHOLD = 0.18; -const VOICE_VAD_SILENCE_DURATION_MS = 1400; -const VOICE_VAD_SPEECH_CONFIRMATION_MS = 120; -const VOICE_VAD_DETECTION_GRACE_PERIOD_MS = 700; - interface VoiceContextValue { isVoiceMode: boolean; isVoiceSwitching: boolean; @@ -137,10 +133,10 @@ export function VoiceProvider({ children }: VoiceProviderProps) { console.error("[Voice] Cannot handle error - setMessages not available from SessionState"); } }, - volumeThreshold: VOICE_VAD_VOLUME_THRESHOLD, - silenceDuration: VOICE_VAD_SILENCE_DURATION_MS, - speechConfirmationDuration: VOICE_VAD_SPEECH_CONFIRMATION_MS, - detectionGracePeriod: VOICE_VAD_DETECTION_GRACE_PERIOD_MS, + volumeThreshold: REALTIME_VOICE_VAD_CONFIG.volumeThreshold, + silenceDuration: REALTIME_VOICE_VAD_CONFIG.silenceDurationMs, + speechConfirmationDuration: REALTIME_VOICE_VAD_CONFIG.speechConfirmationMs, + detectionGracePeriod: REALTIME_VOICE_VAD_CONFIG.detectionGracePeriodMs, }); useEffect(() => { diff --git a/packages/app/src/voice/realtime-voice-config.ts b/packages/app/src/voice/realtime-voice-config.ts new file mode 100644 index 000000000..e18cf4c97 --- /dev/null +++ b/packages/app/src/voice/realtime-voice-config.ts @@ -0,0 +1,7 @@ +export const REALTIME_VOICE_VAD_CONFIG = { + volumeThreshold: 0.18, + silenceDurationMs: 2200, + speechConfirmationMs: 120, + detectionGracePeriodMs: 700, +} as const; +