* media: check ffmpeg filter support before subtitle operations * sandbox: handle synchronous spawn errors safely in desktop sandbox * Voice-first streaming, non-blocking follow-ups, quiet routines and chat UX Why: questions blocked the chat, follow-up messages had no acknowledgement, message actions sat beside the bubble, and voice turn-taking added latency. What: waiting runs accept steering messages and the bot marks each claimed follow-up as seen; unclaimed follow-ups show as queued. Reaction, copy and reply controls sit under each message. Streaming voice (VAD endpointing, barge-in that stops the run, clause-based TTS), an optimistic input queue, procedural earcons and delta-based quiet routines were added. Onboarding can be skipped straight to the main conversation. Dual-surface layout and project pickers are included. Status colors use semantic tokens. Tested: unit suites for core, adapters, api and web pass, typecheck and Biome are clean. Browser end-to-end tests were not run locally. * Update translation catalogs Re-extracted catalogs for the new and moved strings; the catalog sync test passes. * Add project plan and test readiness notes Notes from the milestone work: feature inventory, test infrastructure and test readiness. No code changes. * fix(ci): align scale guards, space deletion, computer toggle, and mobile expo deps * fix(ci): restore space deletion guard, browser toggle, and run-steps contracts * fix(ci): restore model resolution errors, group stage, and onboarding flow * fix(ci): restore in-app-browser close button, disable stop button while sending, and sync lingui catalogs * fix(ci): address web e2e failures for bot-crud, choice cards, message quote, and voice onboarding * test(web): wait for avatar and rig visibility in oo-avatar motion spec * test(web): wait for persisted message IDs in message-hover-actions pagination spec * Onboarding: always drop the local voice when the voice step is skipped Skipping waited only for the latest voice load and disconnected only when the client saw the connect succeed. An earlier or client-failed connect could still persist the local credential, so a user who skipped voice was left with one. Wait for every load and always disconnect. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wy1md9QE1ayJbDCwJ4vAQs * Shell: hide the optimistic copy once the transcript shows the send A message sent while the bot works streamed into the transcript before its send request resolved, so the same text showed twice until the optimistic bubble was removed. Drop an optimistic message as soon as a persisted user message with the same text appears. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wy1md9QE1ayJbDCwJ4vAQs --------- Co-authored-by: Claude <noreply@anthropic.com>
70 lines
2.3 KiB
TypeScript
70 lines
2.3 KiB
TypeScript
import type { OoSoundCue, SoundDriver } from "@rakazo/core";
|
|
import { CUE_RECIPES, PcmWavSynthesizer } from "@rakazo/core";
|
|
import { File, Paths } from "expo-file-system";
|
|
|
|
export class ExpoMobileSoundDriver implements SoundDriver {
|
|
private cacheDir = `${Paths.cache}/earcons`;
|
|
private cachedUris = new Map<OoSoundCue, string>();
|
|
|
|
isSupported(): boolean {
|
|
return true;
|
|
}
|
|
|
|
async play(cue: OoSoundCue): Promise<void> {
|
|
if (!CUE_RECIPES[cue]) return;
|
|
|
|
// Check if HTML5 audio is present (mobile web fallback / test environment)
|
|
const AudioCtor = (globalThis as { Audio?: typeof Audio }).Audio;
|
|
if (typeof AudioCtor === "function" && typeof window !== "undefined") {
|
|
const wav = PcmWavSynthesizer.renderCueWav(cue);
|
|
const blob = new Blob([wav as Uint8Array<ArrayBuffer>], { type: "audio/wav" });
|
|
const url = URL.createObjectURL(blob);
|
|
try {
|
|
const audio = new AudioCtor(url);
|
|
await audio.play().catch(() => undefined);
|
|
} finally {
|
|
setTimeout(() => URL.revokeObjectURL(url), 2000);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// Native Expo Audio playback
|
|
try {
|
|
const { createAudioPlayer, setAudioModeAsync } = await import("expo-audio");
|
|
await setAudioModeAsync({
|
|
playsInSilentMode: true,
|
|
interruptionMode: "mixWithOthers",
|
|
shouldPlayInBackground: false,
|
|
});
|
|
|
|
let uri = this.cachedUris.get(cue);
|
|
if (!uri) {
|
|
const wav = PcmWavSynthesizer.renderCueWav(cue);
|
|
const file = new File(this.cacheDir, `earcon-${cue}.wav`);
|
|
file.create({ overwrite: true });
|
|
file.write(this.bytesToBase64(wav), { encoding: "base64" });
|
|
uri = file.uri;
|
|
this.cachedUris.set(cue, uri);
|
|
}
|
|
|
|
const player = createAudioPlayer({ uri });
|
|
player.play();
|
|
setTimeout(() => player.release(), 2000);
|
|
} catch {
|
|
// Best-effort degradation
|
|
}
|
|
}
|
|
|
|
private bytesToBase64(bytes: Uint8Array): string {
|
|
if (typeof Buffer !== "undefined") return Buffer.from(bytes).toString("base64");
|
|
let binary = "";
|
|
const chunk = 0x8000;
|
|
for (let i = 0; i < bytes.length; i += chunk) {
|
|
binary += String.fromCharCode(...bytes.subarray(i, i + chunk));
|
|
}
|
|
return btoa(binary);
|
|
}
|
|
}
|
|
|
|
export const mobileSound = new ExpoMobileSoundDriver();
|