Commit Graph
3 Commits
Author SHA1 Message Date
Louis RailleandClaude Sonnet 4.6 641d02e5f5 Voice: conversation window, TTS, adaptive silence, context, VoiceBrain, bug fixes
Conversation window
- After each result (success/failure), island stays open and re-listens 8 s
  without wake phrase (startConversationTurn via startListeningDirectly)
- Ends on 8 s silence, cancel phrases ("merci", "c'est bon", "that's all"…),
  or island click/collapse; returns to normal "OK Coucou" wake mode

TurnEndPolicy (pure, tested)
- Base silence 1.5 s; extended to 3 s when partial transcript ends with a
  linking word, article, or bare action verb (speaker is mid-thought)
- Max turn time bumped from 10 s to 20 s

VoiceSpeaker
- AVSpeechSynthesizer, pitch ×1.25 for Mochi's voice
- Semi-duplex: recognition ignored while Coucou speaks; resumes 300 ms after
  didFinish with VAD recalibration
- "Coucou responds aloud" toggle in Settings → Voice (default on)
- Island click / ⌃⌥V stops speech

ConversationContext (pure, tested)
- "et Vercel aussi", "pareil pour Stripe", "also X" → same verb, new target
- "remets-la", "annule ça", "undo" → inverse of last reversible action

VoiceBrain
- #if canImport(FoundationModels) + #available(macOS 26, *) guards — compiles
  on macOS 15 / CI without SDK 26
- LanguageModelSession per conversation, reset on window end
- Settings → Voice shows local model status (available / AI off / not macOS 26)

Bug fixes
- Multi-action: removals executed before additions (4-pill limit fix)
- GitHub aliases: "git hub", "jit hub", "guitare hub", "guitar hub", "gitub",
  "g t", "gt" all resolve to integration_github; 55/55 entity tests
- Pill names added to SFSpeechRecognizer contextualStrings for better recognition
- Music not found: opens Apple Music search (NSWorkspace deep link) instead of
  silently failing; new voice.music-search-opened localization key

CI: 4 new test steps, 31/31 scripts pass

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-10-10 02:33:03 +02:00
Louis RailleandClaude Sonnet 4.6 77ed4a73b7 Voice Phase 2: review fixes — aliases, new intents, async music, question outcome, PillFixture
- EntityResolver: alias table (claude/gemini/google/music/…) + word-match before Levenshtein
- IntentParser: musicSetVolume, pillReplace, pillOnly, "principale" keyword rule, "en principal" rule, music-service-pill routing (Apple Music/Spotify → musicPlay), "pilule" stripped as article; parse order tightened so pilMainTriggers never fall through to music
- VoiceIntent: add musicSetVolume, pillReplace, pillOnly; Outcome.question(text:)
- VoiceActionRunner: play/pause/setVolume/launchAndPlay/async-artist-playlist; pillReplace+pillOnly handlers; rawTranscript param; hooksInstalled on PillControlling
- LiveVoiceControls: wire play/pause/setVolume/launchAndPlay; hooksInstalled via AppState.installedHookPills
- MusicController: play(), pause(), setVolume(), async playArtist(→Bool), async playPlaylist(→Bool)
- SpotifyController: play(), pause() commands
- AppState: installedHookPills @Published property
- IslandWindowController: rawTranscript param, .failure → botDizzy, question delay 6 s
- tests/PillFixture.swift: new file mirroring PillCatalog (avoids app compile deps in tests)
- All 3 test suites updated to use PillFixture.available; 92+48+39 = 179 tests all pass
- Localizable.xcstrings: restored to phase1 baseline + 21 voice.* keys in 10 languages
- VOICE.md removed from repo root

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-10-09 22:30:03 +02:00
Louis RailleandClaude Sonnet 4.6 6be8c89531 Voice phase 2: IntentParser, EntityResolver, VoiceActionRunner, VoiceResultView
- VoiceIntent enum (FR+EN music + pill intents) and VoiceActionResult
- IntentParser: normalise → word-array pattern match, article stripping, playlist-before-artist order
- EntityResolver: exact match → Levenshtein ≤ 2 with ambiguity rejection, category filter
- VoiceActionRunner: @MainActor, injectable MusicControlling/PillControlling protocols, null defaults
- LiveVoiceControls: live AppKit implementations wired up via configureLive() at app startup
- VoiceResultView: 2 s result card (✓/✗) shown at IslandView.voiceResult
- IslandWindowController: handleVoiceCommand runs intent→result→2 s auto-dismiss
- MusicController/SpotifyController: adjustVolume(by:), playArtist(_:), playPlaylist(_:)
- AppState: voiceResult published property, setMainPill(_:)
- IslandTypes: voiceResult layout; IslandViewContent: VoiceResultView case
- VoiceEngine: shouldIgnoreWake skips .voiceResult; all prints → appendAppLog
- 125 standalone tests (70 intent + 27 entity + 28 runner) + build.yml steps

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-10-09 22:02:43 +02:00