Files
2026-05-27 23:29:53 +01:00

3.3 KiB

Tasks: voice

Change ID: voice Package: @suaveplan/voice Target path: universal/media/voice Prerequisite packages on Verdaccio: @suaveplan/error, @suaveplan/types, @suaveplan/streams


1. Scaffold

  • Create universal/media/voice/ with src/, tests/, and all feature subdirectories per the layout in proposal.md.
  • Write package.json at version 0.1.0 with "type": "module", "sideEffects": false, correct exports map, dependencies, and devDependencies.
  • Write tsconfig.lib.json extending ../../../tsconfig.base.json.
  • Write vitest.config.ts using createTestConfig() from @suaveplan/testing/config.
  • Add lint, typecheck, test, test:coverage, build, docs:check scripts.

2. Errors + types

  • src/errors/voice-error/voice-error.ts — VoiceError extends SuaveplanError; defineCodes('VOICE', [...]) with all 12 codes; voice-error.md.
  • src/types/common.ts — AudioFormat, LatencyMode, VoiceCategory, VoiceGender, VoiceAge, VoiceSettings, Voice, ListVoicesOptions, VoiceList, AudioSource, WordTimestamp, SpeakerSegment, DetectedEntity; shared Zod schemas in common.schemas.ts; common.md.
  • src/types/common.test.ts — schema round-trips for AudioFormat, Voice, VoiceSettings; invalid values rejected.

3. Engine interfaces + schemas

  • src/tts/tts-engine/tts-engine.ts + tts-engine.types.ts — VoiceSynthesizer interface, SynthesisRequest, SynthesisResult; tts-engine.schemas.ts — Zod schemas; tts-engine.md; tts-engine.test.ts — schema validation only (no impl to test).
  • src/stt/stt-engine/stt-engine.ts + stt-engine.types.ts — TranscriptionEngine interface, TranscriptionRequest, TranscriptionResult; stt-engine.schemas.ts; stt-engine.md; stt-engine.test.ts.
  • src/voices/voice-repository/voice-repository.ts + voice-repository.types.ts — VoiceRepository interface; voice-repository.schemas.ts; voice-repository.md; voice-repository.test.ts.
  • src/effects/sound-effect-engine/sound-effect-engine.ts + sound-effect-engine.types.ts — SoundEffectEngine interface; sound-effect-engine.schemas.ts; sound-effect-engine.md; sound-effect-engine.test.ts.
  • src/isolation/voice-isolation-engine/voice-isolation-engine.ts + voice-isolation-engine.types.ts — VoiceIsolationEngine interface; voice-isolation-engine.schemas.ts; voice-isolation-engine.md; voice-isolation-engine.test.ts.

4. Property-based tests (tests/property.test.ts)

  • AudioFormat round-trip: every valid format string parses and serialises to itself.
  • VoiceSettings bounds: stability, similarityBoost, style ∈ [0, 1] when parsed via Zod.
  • WordTimestamp ordering: for any generated array of words, startMs < endMs and sequences are monotonic.

5. Docs + verify

  • Root README.md with install, quick-start, modules table linking every co-located .md.
  • bun run docs:check --filter=@suaveplan/voice ≥ 90%.
  • bunx turbo lint typecheck test:coverage --filter=@suaveplan/voice green with 100% coverage (statement + branch + function + line).
  • No TODO, FIXME, @deprecated, any, ts-ignore, or .skip in src/.
  • Publish to Verdaccio, update CLAUDE.md, archive OpenSpec change.