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

53 lines
3.3 KiB
Markdown

# 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
- [x] Create `universal/media/voice/` with `src/`, `tests/`, and all feature subdirectories per the layout in `proposal.md`.
- [x] Write `package.json` at version `0.1.0` with `"type": "module"`, `"sideEffects": false`, correct `exports` map, `dependencies`, and `devDependencies`.
- [x] Write `tsconfig.lib.json` extending `../../../tsconfig.base.json`.
- [x] Write `vitest.config.ts` using `createTestConfig()` from `@suaveplan/testing/config`.
- [x] Add `lint`, `typecheck`, `test`, `test:coverage`, `build`, `docs:check` scripts.
---
## 2. Errors + types
- [x] `src/errors/voice-error/voice-error.ts` — `VoiceError extends SuaveplanError`; `defineCodes('VOICE', [...])` with all 12 codes; `voice-error.md`.
- [x] `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`.
- [x] `src/types/common.test.ts` — schema round-trips for `AudioFormat`, `Voice`, `VoiceSettings`; invalid values rejected.
---
## 3. Engine interfaces + schemas
- [x] `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).
- [x] `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`.
- [x] `src/voices/voice-repository/voice-repository.ts` + `voice-repository.types.ts` — `VoiceRepository` interface; `voice-repository.schemas.ts`; `voice-repository.md`; `voice-repository.test.ts`.
- [x] `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`.
- [x] `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`)
- [x] `AudioFormat` round-trip: every valid format string parses and serialises to itself.
- [x] `VoiceSettings` bounds: `stability`, `similarityBoost`, `style` ∈ [0, 1] when parsed via Zod.
- [x] `WordTimestamp` ordering: for any generated array of words, `startMs < endMs` and sequences are monotonic.
---
## 5. Docs + verify
- [x] Root `README.md` with install, quick-start, modules table linking every co-located `.md`.
- [x] `bun run docs:check --filter=@suaveplan/voice` ≥ 90%.
- [x] `bunx turbo lint typecheck test:coverage --filter=@suaveplan/voice` green with 100% coverage (statement + branch + function + line).
- [x] No `TODO`, `FIXME`, `@deprecated`, `any`, `ts-ignore`, or `.skip` in `src/`.
- [x] Publish to Verdaccio, update `CLAUDE.md`, archive OpenSpec change.