A tiny friend in your Mac's notch and on your iPhone that keeps an eye on your AI coding agents: Claude Code, Codex, Cursor, Gemini CLI, Antigravity and more. Approve from the notch or your Lock Screen.
Swift ai-agentsanthropicantigravityclaudeclaude-codecodexcursordynamic-islandgemini-cliiosiphonlinuxmacosmacos-appmenubar-appnotchopen-sourceswiftswiftuiwindows
feat/voice-phase1: «OK Coucou» wake word + listening island
Louis Raillef2f3fb7ab480
diff --git a/NotchBuddy/NotchBuddy.xcodeproj/project.pbxproj b/NotchBuddy/NotchBuddy.xcodeproj/project.pbxprojindex dcaa83f0..57bb08eb 100644--- a/NotchBuddy/NotchBuddy.xcodeproj/project.pbxproj+++ b/NotchBuddy/NotchBuddy.xcodeproj/project.pbxproj@@ -10,7 +10,10 @@0099C844CFD9424CEAA5CA77 /* ClaudeResponseText.swift in Sources */ = {isa = PBXBuildFile; fileRef = 444604C7E2C530B664849EF9 /* ClaudeResponseText.swift */; };01B96F947DF2BDC352E8526D /* WeeklyRecapView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 888B3E1420BCB6292BDC8117 /* WeeklyRecapView.swift */; };0329E76BA4A8FEEA8A6D76E7 /* ClaudeService.swift in Sources */ = {isa = PBXBuildFile; fileRef = A83D5410BD030B243ADDCFF4 /* ClaudeService.swift */; };+ 03538CF0E693300A14029EDE /* SpotifyViews.swift in Sources */ = {isa = PBXBuildFile; fileRef = 914A792788D403F836BEB570 /* SpotifyViews.swift */; };+ 035F9A85BF71B21F9AA5E004 /* VoiceSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4543CB771E0B723783F529E /* VoiceSettings.swift */; };0393CA5466F52252378F0346 /* ServiceSnapshot.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84ECC59BE7CDDEE348FC7096 /* ServiceSnapshot.swift */; };+ 03FDC0AA0CEDE913B59D0F4D /* NowPlayingViews.swift in Sources */ = {isa = PBXBuildFile; fileRef = F56C7E1EBC74664A7F1689CF /* NowPlayingViews.swift */; };0408FE7F86EBEE61CAED32DA /* TurnRecorder.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2DFAEAF1DD1CBF03D3C314E /* TurnRecorder.swift */; };0417DE195518EE21267F8479 /* IslandTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0365DDE3C554F5E8570055F4 /* IslandTypes.swift */; };053B30CF4568F7FE5138A898 /* MochiWardrobe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79A7807ADD0963FF260D1FAD /* MochiWardrobe.swift */; };@@ -19,6 +22,7 @@06BF5FD95E03010CAFDBF2D0 /* NotchBuddyApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1BD8F3CAA60CF37640759E1 /* NotchBuddyApp.swift */; };077ECE0906D8E820BD5FA764 /* DiffEngine.swift in Sources */ = {isa = PBXBuildFile; fileRef = B32FB972D02162720E566674 /* DiffEngine.swift */; };07B49D6825179DAA18DFF4D3 /* PillCatalog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96C64C4C5D705CE486221B74 /* PillCatalog.swift */; };+ 07EC91820A69E8BF11EC778D /* PillColors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37564F5F041B38C976DF3DEF /* PillColors.swift */; };08A485F2AC63FF5298ED897B /* OpenLeadMochiIntent.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1D96E57E8DADE6B82628E3E /* OpenLeadMochiIntent.swift */; };091EC3B2F1060D7EE1317E4E /* IslandWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D710BD7834228045869D0184 /* IslandWindowController.swift */; };0A267EE2955C7AD8E02A296C /* N8nPoller.swift in Sources */ = {isa = PBXBuildFile; fileRef = B89DA1A0C21AE3535A1760BB /* N8nPoller.swift */; };@@ -26,6 +30,7 @@0E83C1DD4D20E7FB7A904450 /* VercelPoller.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71718D1B87A39A4879DD2A9D /* VercelPoller.swift */; };0FAAA8683282E9E8EA9E2416 /* AgentNotifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 011D05714C97CF5CAB32DCE7 /* AgentNotifier.swift */; };118FC4AE0AC74D84B4A134D8 /* VercelPoller.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71718D1B87A39A4879DD2A9D /* VercelPoller.swift */; };+ 11F14DB97C93CF84DF9D5C43 /* TerminalTarget+AppKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 244A7909EEDA4BFF4C2EA9B5 /* TerminalTarget+AppKit.swift */; };11F49CD9D12E69CE18DFEDCC /* MochiOutfitDrawing.swift in Sources */ = {isa = PBXBuildFile; fileRef = E84E5D91129352E8A1D32AA4 /* MochiOutfitDrawing.swift */; };134D136F3CF0B91AEBCA84EB /* finish.wav in Resources */ = {isa = PBXBuildFile; fileRef = 37147F42613183DBA8896835 /* finish.wav */; };13663D98590927AF71C17628 /* PillCatalog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96C64C4C5D705CE486221B74 /* PillCatalog.swift */; };@@ -35,7 +40,9 @@17D6063D3B374FB82340314E /* IslandTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0365DDE3C554F5E8570055F4 /* IslandTypes.swift */; };18D47AE663EB96BE5638D5F7 /* ClaudePlanCardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4263B550838CC5614569D13 /* ClaudePlanCardView.swift */; };1969590AFEE6CB21404346F1 /* CalcomPoller.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3104222B3F17BA5E8DEA5277 /* CalcomPoller.swift */; };+ 1C2BB61FA83015C42B321E0E /* PillColors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37564F5F041B38C976DF3DEF /* PillColors.swift */; };1D23613B270FE8B11C5E27A7 /* IslandDisplayChoice.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A09E73F1E58019EF6EA2A62 /* IslandDisplayChoice.swift */; };+ 1D4CE0CCD2B5A0FFE50C7F06 /* TerminalTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87AF6F7A027AB1D46309DD49 /* TerminalTarget.swift */; };1DAB0704A136FF8E6FB34191 /* ClaudeResponseText.swift in Sources */ = {isa = PBXBuildFile; fileRef = 444604C7E2C530B664849EF9 /* ClaudeResponseText.swift */; };1DCF28998358810CDBC93F91 /* ClaudeHookDetection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EA7D927F6BB2667D37AA963 /* ClaudeHookDetection.swift */; };1E55440B97C640993E93D04D /* DiffEngine.swift in Sources */ = {isa = PBXBuildFile; fileRef = B32FB972D02162720E566674 /* DiffEngine.swift */; };@@ -46,6 +53,7 @@2132477000FD77F7EB234DAA /* FileDropView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3232F258523DD8D09B670363 /* FileDropView.swift */; };23BFB915C12B0BC4E9B50AAA /* ApprovalRelay.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD426E81DF79CA79888059D9 /* ApprovalRelay.swift */; };244EC9B77D1903C8DD505D04 /* MochiLiveActivity.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADA6A002ABEC0CC57667FBE0 /* MochiLiveActivity.swift */; };+ 2540E4198492CC2B9237ED99 /* SpotifyController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A9E6EB7C8468A8339CF6A5C /* SpotifyController.swift */; };25F66E99460D62478899A292 /* MochiWardrobe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79A7807ADD0963FF260D1FAD /* MochiWardrobe.swift */; };26E35C79CCD09FEBA04A3EF6 /* LinkTestView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6762C38A8952A90F394EDFE4 /* LinkTestView.swift */; };273FC0FA14AAF6CE62FD14AE /* DesktopMochi.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1DDC96E7967032F5D0BD585 /* DesktopMochi.swift */; };@@ -58,7 +66,10 @@2F36E3C6C073E968A682AFA4 /* NotionPoller.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE03E03D1804B0B92C5C2DAD /* NotionPoller.swift */; };3756B7E1A55D9CEC8C4D34A4 /* IslandStateMachine.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8212018F09EA1E96FBD63CD /* IslandStateMachine.swift */; };38EEB2D3A6EC538958D92575 /* GitHubPulse.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8D3AD61802A32C4833F3EDA /* GitHubPulse.swift */; };+ 3CF69605BB03E567C2DB0935 /* MacDictation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6544ED02D945CF9F00647AD1 /* MacDictation.swift */; };+ 3E84EA0AE7C450941ED943CF /* NowPlayingViews.swift in Sources */ = {isa = PBXBuildFile; fileRef = F56C7E1EBC74664A7F1689CF /* NowPlayingViews.swift */; };40473EEC3029D466B2769672 /* AppleStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 681E15F99FCF1E60C2553004 /* AppleStyle.swift */; };+ 40F7576FC56ED7BC1D2B717E /* PillColors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37564F5F041B38C976DF3DEF /* PillColors.swift */; };4117E7C8AA231AAE36E7509D /* UploadCanvasView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B241B043223AFBBFB7418A5E /* UploadCanvasView.swift */; };41966EEF7599793AD70DFCEA /* DiffEngine.swift in Sources */ = {isa = PBXBuildFile; fileRef = B32FB972D02162720E566674 /* DiffEngine.swift */; };422C116E73D2D9A96DAE104D /* MochiLive.swift in Sources */ = {isa = PBXBuildFile; fileRef = 265262A422C270C1798F4A80 /* MochiLive.swift */; };@@ -69,9 +80,11 @@4A32FB2EA69E8BA70EBEA8A7 /* ServiceLiveDetail.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21B710512DB99390EC564487 /* ServiceLiveDetail.swift */; };4B6AC00F22EC75E90E0157D5 /* AppLog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F6D7015D6A77AA59323C0E7 /* AppLog.swift */; };4B83070258D5AAAC8FCEB15F /* MochiOutfitDrawing.swift in Sources */ = {isa = PBXBuildFile; fileRef = E84E5D91129352E8A1D32AA4 /* MochiOutfitDrawing.swift */; };+ 4B99E2AD54926078AB087B43 /* SpotifyViews.swift in Sources */ = {isa = PBXBuildFile; fileRef = 914A792788D403F836BEB570 /* SpotifyViews.swift */; };4D34FF10654B19B69FE1964C /* TurnSnapshot.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A1C4152EBDBD7C24CABFFD7 /* TurnSnapshot.swift */; };4D958F2DDCE9504490FDA357 /* DiffEngine.swift in Sources */ = {isa = PBXBuildFile; fileRef = B32FB972D02162720E566674 /* DiffEngine.swift */; };4F1E0B3C838DA3CD6F864BC0 /* CalcomPoller.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3104222B3F17BA5E8DEA5277 /* CalcomPoller.swift */; };+ 502F2B0D607C511DD3B836B3 /* VoiceSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4543CB771E0B723783F529E /* VoiceSettings.swift */; };52F0DF1FBCB522951910390E /* InstructionRunner.swift in Sources */ = {isa = PBXBuildFile; fileRef = FADC1FE5696B1075932D0B7C /* InstructionRunner.swift */; };530443F46F896F037A56F663 /* HotKeyCenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1218B86E249691AF44F819AC /* HotKeyCenter.swift */; };535EC818E1DAF0FA588545D8 /* QuestionPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C6993B34A0FFF8E3D454ADC /* QuestionPayload.swift */; };@@ -85,12 +98,15 @@61F73B27A7E3AFF584B2CC22 /* AppState.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2E4F18AA940EFF7E047B9F7 /* AppState.swift */; };62C4EE3F74DAA59764729E62 /* UploadCanvasView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B241B043223AFBBFB7418A5E /* UploadCanvasView.swift */; };63093DC288B68F7F17249517 /* GitHubActivity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 168A9A73B519018FAB0AA465 /* GitHubActivity.swift */; };+ 63B87D9E49F228ADCEC4C293 /* WakeSpotter.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC1DE3225F5239394398E6B6 /* WakeSpotter.swift */; };63F9F3AAC881D3EDDDD8AED9 /* UserIdentity.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4A13AEE6E06F46CEC9D908C /* UserIdentity.swift */; };640D3B3296748445A8F96F6D /* question.wav in Resources */ = {isa = PBXBuildFile; fileRef = A5DC0954D23B69B247578437 /* question.wav */; };+ 64FE8055CCAD30B44FE398E7 /* VoiceAudio.swift in Sources */ = {isa = PBXBuildFile; fileRef = A87F39805C78722F614295B4 /* VoiceAudio.swift */; };651FA3F09608DE5D02D61CCE /* BotCanvasView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A29F4C0B02BE91654D02AA0C /* BotCanvasView.swift */; };654A8E7D8BA79AF90FA8B0DA /* QuestionPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C6993B34A0FFF8E3D454ADC /* QuestionPayload.swift */; };658C579523CF5F8D67B31369 /* InstructionRunner.swift in Sources */ = {isa = PBXBuildFile; fileRef = FADC1FE5696B1075932D0B7C /* InstructionRunner.swift */; };65CB53E20B2289CA3AC3E8FE /* TurnSnapshot.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A1C4152EBDBD7C24CABFFD7 /* TurnSnapshot.swift */; };+ 6726F74966EDE7F82BFE89B2 /* TerminalTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87AF6F7A027AB1D46309DD49 /* TerminalTarget.swift */; };68A950E3C23FD612639D9776 /* IslandViewContent.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA02B08886939FF6FE0475DD /* IslandViewContent.swift */; };68C3ACC708B69035FD0CB8C4 /* TurnSnapshot.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A1C4152EBDBD7C24CABFFD7 /* TurnSnapshot.swift */; };694AB4504CD65662E1681E5C /* ServicePublisher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F0C229BD085D76EB3DD94DF /* ServicePublisher.swift */; };@@ -117,6 +133,7 @@7C75CCB3DC0116D8D3B12313 /* AskQuestion.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBB84A66045EB20CAC93A8A6 /* AskQuestion.swift */; };7CF3242DAD44B442297116E5 /* Decisions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 369F5AFDE37A03A1C25EB262 /* Decisions.swift */; };7D50086C2D8B6AEA0BD138FC /* QuestionPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C6993B34A0FFF8E3D454ADC /* QuestionPayload.swift */; };+ 80B0B3C777A9DC8C82952FD2 /* VoiceEngine.swift in Sources */ = {isa = PBXBuildFile; fileRef = B328028D18F590D6680B8A2B /* VoiceEngine.swift */; };81250AE3E83493CF806D459B /* BotEngine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66E6F5FC81429871B6F766A8 /* BotEngine.swift */; };8173F93555ED400954AA1CB3 /* AboutView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 097F57179CC066459E64303A /* AboutView.swift */; };818E87607FD9F0CA5406BF35 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = B2AA83D80260660475FAB052 /* Localizable.xcstrings */; };@@ -128,7 +145,9 @@878924960FC0F2B3524D48AC /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 192844E7299DEED5C2372067 /* AppDelegate.swift */; };8881BC510155DEC038F3B552 /* ServiceSnapshot.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84ECC59BE7CDDEE348FC7096 /* ServiceSnapshot.swift */; };88A88E8704759E7F1F9D52BA /* ClaudeHost.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0F0D0F67E7C56B9E37E7648 /* ClaudeHost.swift */; };+ 88A8F2E4E754FAFABF6B1960 /* VoiceAudio.swift in Sources */ = {isa = PBXBuildFile; fileRef = A87F39805C78722F614295B4 /* VoiceAudio.swift */; };88C3F0A4F3AE29DBED8710A0 /* ClaudeSettingsFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B238F6E7B20EFDED5CD3E8E /* ClaudeSettingsFile.swift */; };+ 88F268E408FBBA2702B90E6C /* PillColors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37564F5F041B38C976DF3DEF /* PillColors.swift */; };8A6B3688D6B3BF728D106D8B /* UserIdentity.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4A13AEE6E06F46CEC9D908C /* UserIdentity.swift */; };8AC19BAF88822CB31519D447 /* CoucouIntents.swift in Sources */ = {isa = PBXBuildFile; fileRef = 708E1FD9894461B4AD727DB1 /* CoucouIntents.swift */; };8C32A0C3EAF536D3836F61D5 /* GreetingCanvasView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C581F7B1A9F14B281B60063E /* GreetingCanvasView.swift */; };@@ -139,6 +158,7 @@8E9A18333EE821A3CF9F7E34 /* DiffEngine.swift in Sources */ = {isa = PBXBuildFile; fileRef = B32FB972D02162720E566674 /* DiffEngine.swift */; };8FC5907E9506DC79EB1DDC3C /* ChatMarkdown.swift in Sources */ = {isa = PBXBuildFile; fileRef = D797CC384B5BC70D34F121BC /* ChatMarkdown.swift */; };908043F62E2C31F5FBC0A0C4 /* ShortcutsSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62CF42AE7611EF212CA0458F /* ShortcutsSettingsView.swift */; };+ 9088C7BADF166685E471D248 /* VoiceIslandView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 22E03C8E267399FA25C75877 /* VoiceIslandView.swift */; };91B8AAADB623A12FF6769755 /* ClaudeHookDetection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EA7D927F6BB2667D37AA963 /* ClaudeHookDetection.swift */; };920EC34AE78BDC6DDD4452F9 /* MochiActivityState.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE18399D1CD69468CCF57966 /* MochiActivityState.swift */; };924CE1172B5572DA3E45A7C9 /* ColorHex.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8ACB4350729C6513824D1ADF /* ColorHex.swift */; };@@ -150,6 +170,7 @@94E0849D13762C6EC8548FEF /* ClaudePlanCardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4263B550838CC5614569D13 /* ClaudePlanCardView.swift */; };967B525F7D3837F31D740D18 /* ResendPoller.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61B5FDDE03F5F711146937E2 /* ResendPoller.swift */; };9728564FCBF0334E68E9E6E7 /* SessionPublisher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 824E56D2255CA86DAC350DBF /* SessionPublisher.swift */; };+ 992C904D46CB503D947C0940 /* PillColors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37564F5F041B38C976DF3DEF /* PillColors.swift */; };99A1CF41C797EA7F98F2B5B1 /* MochiActivityState.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE18399D1CD69468CCF57966 /* MochiActivityState.swift */; };9A04B16AEEAB1A344D13CE74 /* InstructionComposer.swift in Sources */ = {isa = PBXBuildFile; fileRef = E18E74B3586BC0861C69E70A /* InstructionComposer.swift */; };9AD370335A3ECC9C82375F93 /* CodexPlanGauge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73FA4DF1BE5246CCFFB72E5C /* CodexPlanGauge.swift */; };@@ -158,6 +179,7 @@9C653B8291EFFA414565E8A8 /* MusicController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4F142FB3952B5F0639383047 /* MusicController.swift */; };9DD56C95ECABDDCE23652D50 /* HookServer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79D8DD79C3DD9BBC584B3CB2 /* HookServer.swift */; };9E34044A001B01C3A514D20A /* IslandDisplayChoice.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A09E73F1E58019EF6EA2A62 /* IslandDisplayChoice.swift */; };+ 9EA178EA395B116336C1FA10 /* TerminalTarget+AppKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 244A7909EEDA4BFF4C2EA9B5 /* TerminalTarget+AppKit.swift */; };9ECEE890D4486B6E83BD5B7F /* ColorHex.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8ACB4350729C6513824D1ADF /* ColorHex.swift */; };9F43BE6E77E371FCEB7FE8BA /* ServiceDetailRunner.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6AAC67875F84A862BC2A9AF /* ServiceDetailRunner.swift */; };A7733EE60694EA3E2A86C37A /* IslandTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0365DDE3C554F5E8570055F4 /* IslandTypes.swift */; };@@ -171,6 +193,7 @@B2D86BE268D6F4C86BD0C446 /* ChatMarkdown.swift in Sources */ = {isa = PBXBuildFile; fileRef = D797CC384B5BC70D34F121BC /* ChatMarkdown.swift */; };B314F09AD7924387D0E04B45 /* BotEngine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66E6F5FC81429871B6F766A8 /* BotEngine.swift */; };B3EC9CF3C8BD629C3530E8F1 /* sounds in Resources */ = {isa = PBXBuildFile; fileRef = C066E2B991AA4F56B2724263 /* sounds */; };+ B5206E9D10AD77C0C24463AB /* WakeSpotter.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC1DE3225F5239394398E6B6 /* WakeSpotter.swift */; };B5D8D34DD7A72F340030EF46 /* MacStubs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B66D0C664FB9FF74517AAF5 /* MacStubs.swift */; };B605F976F4141435F27CF266 /* IslandRootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15A1A8206F73376F4CAF2057 /* IslandRootView.swift */; };B69DE31E2B0C2E35594CAA87 /* RecapStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78FB882D49084DEA6A10DB4D /* RecapStore.swift */; };@@ -181,11 +204,13 @@BC6819C32C715E203254B9C6 /* TurnShare.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29E156CF1C215B8FE713B3A0 /* TurnShare.swift */; };BCB4B7AEA1140868C36F39CC /* SessionStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5108F622EF0C553F053716C2 /* SessionStatus.swift */; };BDD8A210DD6D9DA2D15BC5EE /* PillCatalog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96C64C4C5D705CE486221B74 /* PillCatalog.swift */; };+ BDEFF4223DA949E2B8AB85A7 /* VoiceEngine.swift in Sources */ = {isa = PBXBuildFile; fileRef = B328028D18F590D6680B8A2B /* VoiceEngine.swift */; };BEC5DDB55B3DA67C61CA8470 /* DesktopMochi.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1DDC96E7967032F5D0BD585 /* DesktopMochi.swift */; };C07E9A04E827284FDF33DB16 /* ShortcutLogic.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA51E5B140C20812641168EA /* ShortcutLogic.swift */; };C0E18D0F6F5F6D131E6066B8 /* GreetingCanvasView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C581F7B1A9F14B281B60063E /* GreetingCanvasView.swift */; };C18227D148D99FE6EE3CC51A /* GithubPoller.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8CB8B6E5E9DA6164F979E88F /* GithubPoller.swift */; };C209B71CDC296F561F10A443 /* ServiceSnapshot.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84ECC59BE7CDDEE348FC7096 /* ServiceSnapshot.swift */; };+ C3BA3FA2A4025194FC088C5A /* VoiceIslandView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 22E03C8E267399FA25C75877 /* VoiceIslandView.swift */; };C3D39D96E087E98F8BF59226 /* LastTurnView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 112D2BD70628CD67ACDD18AF /* LastTurnView.swift */; };C3ECA730677F467D28910AF6 /* LiveActivityRelay.swift in Sources */ = {isa = PBXBuildFile; fileRef = 136626568FF0C3EAB1D08067 /* LiveActivityRelay.swift */; };C5549C2D60998E297A7DC593 /* TurnSnapshot.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A1C4152EBDBD7C24CABFFD7 /* TurnSnapshot.swift */; };@@ -220,6 +245,7 @@DE05D09A32117582AC93A24A /* NotchBuddyApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1BD8F3CAA60CF37640759E1 /* NotchBuddyApp.swift */; };DE66BB6D18F467A7F4220CC3 /* SessionPublisher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 824E56D2255CA86DAC350DBF /* SessionPublisher.swift */; };E1581F8F2725B26E90D91C4A /* IntroView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B2EED5205DD7161E51BE1E1 /* IntroView.swift */; };+ E2414533EDC7565286141198 /* SpotifyController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A9E6EB7C8468A8339CF6A5C /* SpotifyController.swift */; };E4B9986674F4D425826F15A8 /* StripePoller.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EF78999D68D56ADE4CEFBE2 /* StripePoller.swift */; };E701BC8996229D08362CA732 /* ServiceStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AF705275522F99CAE7E1429 /* ServiceStatus.swift */; };E776C7D1DE5C62EA8D4BA3E3 /* FileDropView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3232F258523DD8D09B670363 /* FileDropView.swift */; };@@ -244,6 +270,7 @@F5D6F8E2CA65AB16B487DDD0 /* IslandScreenGeometry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9466FDE02C9B3FB4EF01DFF8 /* IslandScreenGeometry.swift */; };F6CA56F362902839EF9A3E2E /* PhoneAssets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 60401D1023D17C3FD30D7113 /* PhoneAssets.xcassets */; };F6D57EEBD7E937EFD2B715CF /* ClaudeHost.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0F0D0F67E7C56B9E37E7648 /* ClaudeHost.swift */; };+ F8F95EAD88F70E0A147D1662 /* MacDictation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6544ED02D945CF9F00647AD1 /* MacDictation.swift */; };F9445A71BBF9E4D20224238E /* QuestionPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C6993B34A0FFF8E3D454ADC /* QuestionPayload.swift */; };FAD78D74C6906D4EC8AA4101 /* UploadSequenceEngine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FD65943C32E150F1CD65C31 /* UploadSequenceEngine.swift */; };FB063FE6B8A4BB8FBAAF56CB /* LiveActivityLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0FA2D136C81C6D930C5357BD /* LiveActivityLink.swift */; };@@ -305,6 +332,8 @@1BE21C2B315D37AA70ED45E9 /* SoundEngine.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SoundEngine.swift; sourceTree = "<group>"; };1EA7D927F6BB2667D37AA963 /* ClaudeHookDetection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClaudeHookDetection.swift; sourceTree = "<group>"; };21B710512DB99390EC564487 /* ServiceLiveDetail.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ServiceLiveDetail.swift; sourceTree = "<group>"; };+ 22E03C8E267399FA25C75877 /* VoiceIslandView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VoiceIslandView.swift; sourceTree = "<group>"; };+ 244A7909EEDA4BFF4C2EA9B5 /* TerminalTarget+AppKit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "TerminalTarget+AppKit.swift"; sourceTree = "<group>"; };265262A422C270C1798F4A80 /* MochiLive.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MochiLive.swift; sourceTree = "<group>"; };28323DC20034A281F6829884 /* CloudProbe.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CloudProbe.swift; sourceTree = "<group>"; };29E156CF1C215B8FE713B3A0 /* TurnShare.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TurnShare.swift; sourceTree = "<group>"; };@@ -315,6 +344,7 @@323F242B14A61A7C071EC115 /* MochiActivityAttributes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MochiActivityAttributes.swift; sourceTree = "<group>"; };369F5AFDE37A03A1C25EB262 /* Decisions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Decisions.swift; sourceTree = "<group>"; };37147F42613183DBA8896835 /* finish.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = finish.wav; sourceTree = "<group>"; };+ 37564F5F041B38C976DF3DEF /* PillColors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PillColors.swift; sourceTree = "<group>"; };38BEAB5F20A13E5806A42EC9 /* ApprovalCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApprovalCard.swift; sourceTree = "<group>"; };3A27178AA6007F7B56901750 /* SessionDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SessionDetailView.swift; sourceTree = "<group>"; };3B238F6E7B20EFDED5CD3E8E /* ClaudeSettingsFile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClaudeSettingsFile.swift; sourceTree = "<group>"; };@@ -330,10 +360,12 @@60401D1023D17C3FD30D7113 /* PhoneAssets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = PhoneAssets.xcassets; sourceTree = "<group>"; };61B5FDDE03F5F711146937E2 /* ResendPoller.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResendPoller.swift; sourceTree = "<group>"; };62CF42AE7611EF212CA0458F /* ShortcutsSettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShortcutsSettingsView.swift; sourceTree = "<group>"; };+ 6544ED02D945CF9F00647AD1 /* MacDictation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MacDictation.swift; sourceTree = "<group>"; };65F64746B2740D5FE26B7E5A /* ServiceDetail.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ServiceDetail.swift; sourceTree = "<group>"; };66E6F5FC81429871B6F766A8 /* BotEngine.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BotEngine.swift; sourceTree = "<group>"; };6762C38A8952A90F394EDFE4 /* LinkTestView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinkTestView.swift; sourceTree = "<group>"; };681E15F99FCF1E60C2553004 /* AppleStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppleStyle.swift; sourceTree = "<group>"; };+ 6A9E6EB7C8468A8339CF6A5C /* SpotifyController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpotifyController.swift; sourceTree = "<group>"; };6C6993B34A0FFF8E3D454ADC /* QuestionPayload.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuestionPayload.swift; sourceTree = "<group>"; };6E5F9E4BB282FDE68D65FE6B /* TurnArchive.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TurnArchive.swift; sourceTree = "<group>"; };6F0C229BD085D76EB3DD94DF /* ServicePublisher.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ServicePublisher.swift; sourceTree = "<group>"; };@@ -350,10 +382,12 @@84ECC59BE7CDDEE348FC7096 /* ServiceSnapshot.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ServiceSnapshot.swift; sourceTree = "<group>"; };871CA2BADC67D97C97C7009D /* error.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = error.wav; sourceTree = "<group>"; };8790ACE9F73BD74640A0F20C /* LocalChat.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalChat.swift; sourceTree = "<group>"; };+ 87AF6F7A027AB1D46309DD49 /* TerminalTarget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TerminalTarget.swift; sourceTree = "<group>"; };888B3E1420BCB6292BDC8117 /* WeeklyRecapView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WeeklyRecapView.swift; sourceTree = "<group>"; };8ACB4350729C6513824D1ADF /* ColorHex.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorHex.swift; sourceTree = "<group>"; };8BF22817EC70748F2D1FB2E7 /* ClaudePlanGauge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClaudePlanGauge.swift; sourceTree = "<group>"; };8CB8B6E5E9DA6164F979E88F /* GithubPoller.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GithubPoller.swift; sourceTree = "<group>"; };+ 914A792788D403F836BEB570 /* SpotifyViews.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpotifyViews.swift; sourceTree = "<group>"; };9466FDE02C9B3FB4EF01DFF8 /* IslandScreenGeometry.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IslandScreenGeometry.swift; sourceTree = "<group>"; };96C64C4C5D705CE486221B74 /* PillCatalog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PillCatalog.swift; sourceTree = "<group>"; };9AF705275522F99CAE7E1429 /* ServiceStatus.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ServiceStatus.swift; sourceTree = "<group>"; };@@ -363,6 +397,7 @@A29F4C0B02BE91654D02AA0C /* BotCanvasView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BotCanvasView.swift; sourceTree = "<group>"; };A5DC0954D23B69B247578437 /* question.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = question.wav; sourceTree = "<group>"; };A83D5410BD030B243ADDCFF4 /* ClaudeService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClaudeService.swift; sourceTree = "<group>"; };+ A87F39805C78722F614295B4 /* VoiceAudio.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VoiceAudio.swift; sourceTree = "<group>"; };AB78996E9F9A2E8A80D45E54 /* QuestionRelay.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuestionRelay.swift; sourceTree = "<group>"; };ADA6A002ABEC0CC57667FBE0 /* MochiLiveActivity.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MochiLiveActivity.swift; sourceTree = "<group>"; };AEF5BD66B00BB64BB80AF38C /* DemoEngine.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoEngine.swift; sourceTree = "<group>"; };@@ -370,10 +405,12 @@B241B043223AFBBFB7418A5E /* UploadCanvasView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UploadCanvasView.swift; sourceTree = "<group>"; };B2AA83D80260660475FAB052 /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = "<group>"; };B2FDED98F7F6C755A72C97A3 /* SafeWebURL.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SafeWebURL.swift; sourceTree = "<group>"; };+ B328028D18F590D6680B8A2B /* VoiceEngine.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VoiceEngine.swift; sourceTree = "<group>"; };B32FB972D02162720E566674 /* DiffEngine.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiffEngine.swift; sourceTree = "<group>"; };B53E4CAD2BCC77B280689B0F /* HomeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeView.swift; sourceTree = "<group>"; };B6723392BE01AF210E484316 /* CoucouWidgets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoucouWidgets.swift; sourceTree = "<group>"; };B89DA1A0C21AE3535A1760BB /* N8nPoller.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = N8nPoller.swift; sourceTree = "<group>"; };+ BC1DE3225F5239394398E6B6 /* WakeSpotter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WakeSpotter.swift; sourceTree = "<group>"; };BE03E03D1804B0B92C5C2DAD /* NotionPoller.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotionPoller.swift; sourceTree = "<group>"; };BFE88A53AEAA637F866D479D /* ChatMarkdownView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatMarkdownView.swift; sourceTree = "<group>"; };C066E2B991AA4F56B2724263 /* sounds */ = {isa = PBXFileReference; lastKnownFileType = folder; name = sounds; path = Resources/sounds; sourceTree = SOURCE_ROOT; };@@ -384,6 +421,7 @@C581F7B1A9F14B281B60063E /* GreetingCanvasView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GreetingCanvasView.swift; sourceTree = "<group>"; };D0F0D0F67E7C56B9E37E7648 /* ClaudeHost.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClaudeHost.swift; sourceTree = "<group>"; };D1D96E57E8DADE6B82628E3E /* OpenLeadMochiIntent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenLeadMochiIntent.swift; sourceTree = "<group>"; };+ D4543CB771E0B723783F529E /* VoiceSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VoiceSettings.swift; sourceTree = "<group>"; };D6DF93125491729E14636AD8 /* CoucouNotificationContent.appex */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "wrapper.app-extension"; path = CoucouNotificationContent.appex; sourceTree = BUILT_PRODUCTS_DIR; };D710BD7834228045869D0184 /* IslandWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IslandWindowController.swift; sourceTree = "<group>"; };D797CC384B5BC70D34F121BC /* ChatMarkdown.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatMarkdown.swift; sourceTree = "<group>"; };@@ -403,6 +441,7 @@F1BD8F3CAA60CF37640759E1 /* NotchBuddyApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotchBuddyApp.swift; sourceTree = "<group>"; };F4263B550838CC5614569D13 /* ClaudePlanCardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClaudePlanCardView.swift; sourceTree = "<group>"; };F4A13AEE6E06F46CEC9D908C /* UserIdentity.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserIdentity.swift; sourceTree = "<group>"; };+ F56C7E1EBC74664A7F1689CF /* NowPlayingViews.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NowPlayingViews.swift; sourceTree = "<group>"; };F86B99CF65C5E4BC887888C6 /* Haptics.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Haptics.swift; sourceTree = "<group>"; };F8D3AD61802A32C4833F3EDA /* GitHubPulse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GitHubPulse.swift; sourceTree = "<group>"; };FA02B08886939FF6FE0475DD /* IslandViewContent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IslandViewContent.swift; sourceTree = "<group>"; };@@ -457,10 +496,12 @@FA02B08886939FF6FE0475DD /* IslandViewContent.swift */,D710BD7834228045869D0184 /* IslandWindowController.swift */,8790ACE9F73BD74640A0F20C /* LocalChat.swift */,+ 6544ED02D945CF9F00647AD1 /* MacDictation.swift */,4F142FB3952B5F0639383047 /* MusicController.swift */,B89DA1A0C21AE3535A1760BB /* N8nPoller.swift */,F1BD8F3CAA60CF37640759E1 /* NotchBuddyApp.swift */,BE03E03D1804B0B92C5C2DAD /* NotionPoller.swift */,+ F56C7E1EBC74664A7F1689CF /* NowPlayingViews.swift */,78FB882D49084DEA6A10DB4D /* RecapStore.swift */,61B5FDDE03F5F711146937E2 /* ResendPoller.swift */,B2FDED98F7F6C755A72C97A3 /* SafeWebURL.swift */,@@ -468,7 +509,11 @@FA51E5B140C20812641168EA /* ShortcutLogic.swift */,62CF42AE7611EF212CA0458F /* ShortcutsSettingsView.swift */,1BE21C2B315D37AA70ED45E9 /* SoundEngine.swift */,+ 6A9E6EB7C8468A8339CF6A5C /* SpotifyController.swift */,+ 914A792788D403F836BEB570 /* SpotifyViews.swift */,2EF78999D68D56ADE4CEFBE2 /* StripePoller.swift */,+ 87AF6F7A027AB1D46309DD49 /* TerminalTarget.swift */,+ 244A7909EEDA4BFF4C2EA9B5 /* TerminalTarget+AppKit.swift */,B241B043223AFBBFB7418A5E /* UploadCanvasView.swift */,6FD65943C32E150F1CD65C31 /* UploadSequenceEngine.swift */,F4A13AEE6E06F46CEC9D908C /* UserIdentity.swift */,@@ -476,6 +521,7 @@888B3E1420BCB6292BDC8117 /* WeeklyRecapView.swift */,E91B733ADC638E14E9BB6EFA /* WindowContextCapture.swift */,9207F9B32D9C7844F5332A31 /* PhoneLink */,+ FB8E4AAB0B5E949069B8D03D /* Voice */,);path = App;sourceTree = "<group>";@@ -611,6 +657,7 @@045E7300878138F0AC385920 /* MochiStill.swift */,79A7807ADD0963FF260D1FAD /* MochiWardrobe.swift */,96C64C4C5D705CE486221B74 /* PillCatalog.swift */,+ 37564F5F041B38C976DF3DEF /* PillColors.swift */,6C6993B34A0FFF8E3D454ADC /* QuestionPayload.swift */,65F64746B2740D5FE26B7E5A /* ServiceDetail.swift */,84ECC59BE7CDDEE348FC7096 /* ServiceSnapshot.swift */,@@ -619,6 +666,18 @@path = CoucouKit;sourceTree = "<group>";};+ FB8E4AAB0B5E949069B8D03D /* Voice */ = {+ isa = PBXGroup;+ children = (+ A87F39805C78722F614295B4 /* VoiceAudio.swift */,+ B328028D18F590D6680B8A2B /* VoiceEngine.swift */,+ 22E03C8E267399FA25C75877 /* VoiceIslandView.swift */,+ D4543CB771E0B723783F529E /* VoiceSettings.swift */,+ BC1DE3225F5239394398E6B6 /* WakeSpotter.swift */,+ );+ path = Voice;+ sourceTree = "<group>";+ };/* End PBXGroup section *//* Begin PBXNativeTarget section */@@ -844,6 +903,7 @@091EC3B2F1060D7EE1317E4E /* IslandWindowController.swift in Sources */,C3ECA730677F467D28910AF6 /* LiveActivityRelay.swift in Sources */,6D158183870434FEDF07E050 /* LocalChat.swift in Sources */,+ F8F95EAD88F70E0A147D1662 /* MacDictation.swift in Sources */,D34D31C27D97D23C0441D1BE /* MochiActivityState.swift in Sources */,DD2EEF113DB5EAA35CD88312 /* MochiOutfitDrawing.swift in Sources */,72B1AEDB2152BF73659EB598 /* MochiStill.swift in Sources */,@@ -852,7 +912,9 @@0A267EE2955C7AD8E02A296C /* N8nPoller.swift in Sources */,06BF5FD95E03010CAFDBF2D0 /* NotchBuddyApp.swift in Sources */,2F36E3C6C073E968A682AFA4 /* NotionPoller.swift in Sources */,+ 03FDC0AA0CEDE913B59D0F4D /* NowPlayingViews.swift in Sources */,BDD8A210DD6D9DA2D15BC5EE /* PillCatalog.swift in Sources */,+ 07EC91820A69E8BF11EC778D /* PillColors.swift in Sources */,CD05A497A7D0B3D723D92C06 /* QuestionPayload.swift in Sources */,93AB64BF47D6D1EE7DB4C22B /* QuestionRelay.swift in Sources */,7A449E237CAAB62758508C7C /* RecapStore.swift in Sources */,@@ -867,13 +929,22 @@C07E9A04E827284FDF33DB16 /* ShortcutLogic.swift in Sources */,1EAFEE80A8066B77F9410025 /* ShortcutsSettingsView.swift in Sources */,60E361FFE84C387E5E3ED1AA /* SoundEngine.swift in Sources */,+ E2414533EDC7565286141198 /* SpotifyController.swift in Sources */,+ 4B99E2AD54926078AB087B43 /* SpotifyViews.swift in Sources */,1558BB00C530B721172F6E65 /* StripePoller.swift in Sources */,+ 9EA178EA395B116336C1FA10 /* TerminalTarget+AppKit.swift in Sources */,+ 1D4CE0CCD2B5A0FFE50C7F06 /* TerminalTarget.swift in Sources */,0408FE7F86EBEE61CAED32DA /* TurnRecorder.swift in Sources */,68C3ACC708B69035FD0CB8C4 /* TurnSnapshot.swift in Sources */,62C4EE3F74DAA59764729E62 /* UploadCanvasView.swift in Sources */,FAD78D74C6906D4EC8AA4101 /* UploadSequenceEngine.swift in Sources */,8A6B3688D6B3BF728D106D8B /* UserIdentity.swift in Sources */,118FC4AE0AC74D84B4A134D8 /* VercelPoller.swift in Sources */,+ 88A8F2E4E754FAFABF6B1960 /* VoiceAudio.swift in Sources */,+ BDEFF4223DA949E2B8AB85A7 /* VoiceEngine.swift in Sources */,+ 9088C7BADF166685E471D248 /* VoiceIslandView.swift in Sources */,+ 502F2B0D607C511DD3B836B3 /* VoiceSettings.swift in Sources */,+ 63B87D9E49F228ADCEC4C293 /* WakeSpotter.swift in Sources */,01B96F947DF2BDC352E8526D /* WeeklyRecapView.swift in Sources */,2875610F701376BD65573386 /* WindowContextCapture.swift in Sources */,);@@ -896,6 +967,7 @@B2584220B877056366C8DCAE /* MochiWardrobe.swift in Sources */,6A1AC92C431FA842928E8115 /* NotificationViewController.swift in Sources */,D20B2B175A5C1D9B410B51C0 /* PillCatalog.swift in Sources */,+ 992C904D46CB503D947C0940 /* PillColors.swift in Sources */,7D50086C2D8B6AEA0BD138FC /* QuestionPayload.swift in Sources */,C5737FE7AE6B2BA92B9A8F72 /* ServiceDetail.swift in Sources */,C209B71CDC296F561F10A443 /* ServiceSnapshot.swift in Sources */,@@ -938,6 +1010,7 @@08A485F2AC63FF5298ED897B /* OpenLeadMochiIntent.swift in Sources */,2104B8000768F551064B17E4 /* PhoneLink.swift in Sources */,CC81DAE27417672CB93349A5 /* PillCatalog.swift in Sources */,+ 88F268E408FBBA2702B90E6C /* PillColors.swift in Sources */,93CD58567884F5B7715D3A3E /* QuestionCard.swift in Sources */,F9445A71BBF9E4D20224238E /* QuestionPayload.swift in Sources */,9BCD79FD8CF211DC8FBD2971 /* SearchAndSpotlight.swift in Sources */,@@ -1000,6 +1073,7 @@C61DDE2EC5FDDB39E4AA3B34 /* IslandWindowController.swift in Sources */,F28275101D83F121E582B1B1 /* LiveActivityRelay.swift in Sources */,E81575CE4433C6F88E424A8F /* LocalChat.swift in Sources */,+ 3CF69605BB03E567C2DB0935 /* MacDictation.swift in Sources */,82E72E0AFCAB192D98AB2004 /* MochiActivityState.swift in Sources */,ADBB9C15DDA4044625B325BE /* MochiOutfitDrawing.swift in Sources */,78F045A55E6F4EEA5787EEEF /* MochiStill.swift in Sources */,@@ -1008,7 +1082,9 @@160EDB9D06275E2607DA5151 /* N8nPoller.swift in Sources */,DE05D09A32117582AC93A24A /* NotchBuddyApp.swift in Sources */,78FCEDC8F78B683AB10E6529 /* NotionPoller.swift in Sources */,+ 3E84EA0AE7C450941ED943CF /* NowPlayingViews.swift in Sources */,13663D98590927AF71C17628 /* PillCatalog.swift in Sources */,+ 40F7576FC56ED7BC1D2B717E /* PillColors.swift in Sources */,535EC818E1DAF0FA588545D8 /* QuestionPayload.swift in Sources */,9AEFD05D0A39D4AF3C091B3A /* QuestionRelay.swift in Sources */,B69DE31E2B0C2E35594CAA87 /* RecapStore.swift in Sources */,@@ -1023,13 +1099,22 @@6CCEC73ED68E9F253C22D692 /* ShortcutLogic.swift in Sources */,908043F62E2C31F5FBC0A0C4 /* ShortcutsSettingsView.swift in Sources */,78B3C6814431B2DD9D1F4949 /* SoundEngine.swift in Sources */,+ 2540E4198492CC2B9237ED99 /* SpotifyController.swift in Sources */,+ 03538CF0E693300A14029EDE /* SpotifyViews.swift in Sources */,E4B9986674F4D425826F15A8 /* StripePoller.swift in Sources */,+ 11F14DB97C93CF84DF9D5C43 /* TerminalTarget+AppKit.swift in Sources */,+ 6726F74966EDE7F82BFE89B2 /* TerminalTarget.swift in Sources */,CE0A1BD64DF3E08D200691A6 /* TurnRecorder.swift in Sources */,4D34FF10654B19B69FE1964C /* TurnSnapshot.swift in Sources */,4117E7C8AA231AAE36E7509D /* UploadCanvasView.swift in Sources */,ECECA2F225E82B7C951658D7 /* UploadSequenceEngine.swift in Sources */,63F9F3AAC881D3EDDDD8AED9 /* UserIdentity.swift in Sources */,0E83C1DD4D20E7FB7A904450 /* VercelPoller.swift in Sources */,+ 64FE8055CCAD30B44FE398E7 /* VoiceAudio.swift in Sources */,+ 80B0B3C777A9DC8C82952FD2 /* VoiceEngine.swift in Sources */,+ C3BA3FA2A4025194FC088C5A /* VoiceIslandView.swift in Sources */,+ 035F9A85BF71B21F9AA5E004 /* VoiceSettings.swift in Sources */,+ B5206E9D10AD77C0C24463AB /* WakeSpotter.swift in Sources */,FB58020A389126865363C342 /* WeeklyRecapView.swift in Sources */,2CC2E3B688B15BBEB3AE3BCE /* WindowContextCapture.swift in Sources */,);@@ -1056,6 +1141,7 @@053B30CF4568F7FE5138A898 /* MochiWardrobe.swift in Sources */,D6559770BBFB06FD4E90187B /* OpenLeadMochiIntent.swift in Sources */,07B49D6825179DAA18DFF4D3 /* PillCatalog.swift in Sources */,+ 1C2BB61FA83015C42B321E0E /* PillColors.swift in Sources */,654A8E7D8BA79AF90FA8B0DA /* QuestionPayload.swift in Sources */,D2746E6D92F2E4C46892D5AA /* ServiceDetail.swift in Sources */,8881BC510155DEC038F3B552 /* ServiceSnapshot.swift in Sources */,diff --git a/NotchBuddy/Sources/App/AppDelegate.swift b/NotchBuddy/Sources/App/AppDelegate.swiftindex c928a8c5..1814a5e7 100644--- a/NotchBuddy/Sources/App/AppDelegate.swift+++ b/NotchBuddy/Sources/App/AppDelegate.swift@@ -189,6 +189,9 @@ final class AppDelegate: NSObject, NSApplicationDelegate {islandController?.showWindow(nil)islandController?.fsm.launch()HookServer.shared.start()+ #if !APPSTORE+ _ = VoiceEngine.shared // registers system observers; starts mic only if the user enabled voice+ #endifN8nPoller.shared.start()VercelPoller.shared.start()ResendPoller.shared.start()diff --git a/NotchBuddy/Sources/App/IslandStateMachine.swift b/NotchBuddy/Sources/App/IslandStateMachine.swiftindex dc4e4e6e..407d6312 100644--- a/NotchBuddy/Sources/App/IslandStateMachine.swift+++ b/NotchBuddy/Sources/App/IslandStateMachine.swift@@ -6,10 +6,11 @@ import Foundationfinal class IslandStateMachine {enum State: Equatable {- case hidden // island invisible (notch size)- case petit // compact island (notch + ears)- case home // expanded, overview- case coucou // expanded, greeting animation+ case hidden // island invisible (notch size)+ case petit // compact island (notch + ears)+ case home // expanded, overview+ case coucou // expanded, greeting animation+ case listening // expanded, voice listening («OK Coucou» detected)}private(set) var state: State = .hidden@@ -81,6 +82,8 @@ final class IslandStateMachine {case .coucou:// Mouse hovering during greeting — cancel short auto-collapse, extend to hover delayscheduleGreetCollapse(delay: greetHoverCollapseDelay)+ case .listening:+ break // already open; no action on hover}}@@ -99,6 +102,8 @@ final class IslandStateMachine {greetCollapseWork?.cancel(); greetCollapseWork = niltransition(to: .petit)}+ case .listening:+ break // never auto-collapse while listening}}@@ -136,11 +141,26 @@ final class IslandStateMachine {/// 15 s home timer left the island compact on screen while the FSM still said `.home`.func collapse() {openedByHover = false- guard state == .home || state == .coucou else { return }+ guard state == .home || state == .coucou || state == .listening else { return }cancelTimers()transition(to: .petit)}+ // MARK: – Voice inputs++ /// Wake phrase detected: open the island in listening mode from any state.+ func voiceWoke() {+ cancelTimers()+ openedByHover = false+ transition(to: .listening)+ }++ /// Command session ended (silence timeout, cancel phrase, or user dismiss).+ func voiceFinished() {+ guard state == .listening else { return }+ transition(to: .petit)+ }+/// Greeting animation finished (called at T.end ≈ 4.60 s)./// Schedules auto-collapse. Does not override a longer hover timer already running.func greetComplete() {diff --git a/NotchBuddy/Sources/App/IslandViewContent.swift b/NotchBuddy/Sources/App/IslandViewContent.swiftindex 3d161ae5..c87668a2 100644--- a/NotchBuddy/Sources/App/IslandViewContent.swift+++ b/NotchBuddy/Sources/App/IslandViewContent.swift@@ -27,6 +27,12 @@ struct IslandViewContent: View {case .greeting: EmptyView() // GreetingCanvasView overlaid in IslandRootViewcase .wardrobe: WardrobeView(state: state)case .recap: WeeklyRecapCardView(state: state)+ case .listening:+ #if !APPSTORE+ VoiceListeningView()+ #else+ EmptyView()+ #endif}}}diff --git a/NotchBuddy/Sources/App/IslandWindowController.swift b/NotchBuddy/Sources/App/IslandWindowController.swiftindex 2d5ef644..6bff86d7 100644--- a/NotchBuddy/Sources/App/IslandWindowController.swift+++ b/NotchBuddy/Sources/App/IslandWindowController.swift@@ -248,6 +248,11 @@ final class IslandWindowController: NSWindowController {} else {SoundEngine.shared.play("peek")}+ } else if from == .listening {+ // Voice session ended — no peek sound, just compact+ #if !APPSTORE+ VoiceEngine.shared.cancelListening()+ #endif}// setMode BEFORE changing view: onChange(of: state.view) guards on .expanded,// so setting view while already compact won't trigger a spurious open animation.@@ -265,6 +270,11 @@ final class IslandWindowController: NSWindowController {case .coucou:self.expand(to: .greeting)++ case .listening:+ self.expand(to: .listening)+ NotificationCenter.default.post(name: .triggerEmote,+ object: BotEmote.listening)}}@@ -276,6 +286,21 @@ final class IslandWindowController: NSWindowController {}fsm.isHeldOpen = { AppState.shared.pendingApproval != nil }++ // Voice: wake phrase detected → open listening island+ #if !APPSTORE+ NotificationCenter.default.addObserver(+ forName: .voiceWoke, object: nil, queue: .main+ ) { [weak self] _ in+ self?.fsm.voiceWoke()+ }+ // Voice: command session ended → close listening island+ NotificationCenter.default.addObserver(+ forName: .voiceFinished, object: nil, queue: .main+ ) { [weak self] _ in+ self?.fsm.voiceFinished()+ }+ #endif}// MARK: - Polling loopdiff --git a/NotchBuddy/Sources/App/SettingsView.swift b/NotchBuddy/Sources/App/SettingsView.swiftindex 74a472ab..348808b2 100644--- a/NotchBuddy/Sources/App/SettingsView.swift+++ b/NotchBuddy/Sources/App/SettingsView.swift@@ -177,6 +177,9 @@ struct SettingsView: View {SettingsSidebarRow(title: "Agents", icon: "terminal.fill", color: "#3B9EFF").tag("agents")SettingsSidebarRow(title: "Chat", icon: "bubble.left.and.bubble.right.fill", color: "#E07950").tag("chat")SettingsSidebarRow(title: "Integrations", icon: "puzzlepiece.extension.fill", color: "#7C5CFF").tag("integrations")+ #if !APPSTORE+ SettingsSidebarRow(title: "Voice", icon: "mic.fill", color: "#F97316").tag("voice")+ #endifSettingsSidebarRow(title: "Shortcuts", icon: "keyboard.fill", color: "#6366F1").tag("shortcuts")}.listStyle(.sidebar)@@ -245,6 +248,7 @@ struct SettingsView: View {case "agents": return String(localized: "Agents")case "chat": return String(localized: "Chat")case "integrations": return String(localized: "Integrations")+ case "voice": return "Voice"case "shortcuts": return String(localized: "Shortcuts")default: return String(localized: "General")}@@ -256,6 +260,9 @@ struct SettingsView: View {case "agents": agentsSectioncase "chat": chatSectioncase "integrations": integrationsSection+ #if !APPSTORE+ case "voice": voiceSection+ #endifcase "shortcuts": ShortcutsSettingsView()default: generalSection}@@ -1248,6 +1255,101 @@ struct SettingsView: View {}}+ // MARK: - Voice section++ #if !APPSTORE+ @State private var voicePermissionsGranted: Bool = false+ @ObservedObject private var voiceEngine = VoiceEngine.shared++ @ViewBuilder private var voiceSection: some View {+ GroupBox("«\u{202F}OK Coucou\u{202F}» — commande vocale mains libres") {+ VStack(alignment: .leading, spacing: 10) {+ Toggle("Activer la commande vocale", isOn: $voiceEngine.isEnabled)+ .disabled(!voicePermissionsGranted && !voiceEngine.isEnabled)++ Text("Quand cette option est activée, Coucou écoute le mot de réveil «\u{202F}OK Coucou\u{202F}». La reconnaissance vocale se fait entièrement sur l'appareil — aucun audio ni transcription ne quitte votre Mac.")+ .font(.system(size: 11))+ .foregroundColor(.secondary)+ .fixedSize(horizontal: false, vertical: true)++ // Orange dot explanation+ HStack(alignment: .top, spacing: 6) {+ Circle()+ .fill(Color(hex: "#F97316"))+ .frame(width: 8, height: 8)+ .padding(.top, 2)+ Text("Pendant l'écoute, macOS affiche le point orange du microphone en haut à droite de la barre de menus. C'est le comportement normal du système.")+ .font(.system(size: 11))+ .foregroundColor(.secondary)+ .fixedSize(horizontal: false, vertical: true)+ }++ if voiceEngine.recognizerUnavailable {+ HStack(spacing: 6) {+ Image(systemName: "exclamationmark.triangle.fill")+ .foregroundColor(.orange)+ Text("Aucun modèle de reconnaissance vocale disponible sur cet appareil. Installez un modèle dans Réglages Système → Clavier → Dictée.")+ .font(.system(size: 11))+ .foregroundColor(.secondary)+ .fixedSize(horizontal: false, vertical: true)+ }+ }+ }+ .padding(6)+ }++ GroupBox("Permissions") {+ VStack(alignment: .leading, spacing: 10) {+ HStack(spacing: 6) {+ Image(systemName: micStatusIcon)+ .foregroundColor(micStatusColor)+ Text("Microphone : \(micStatusLabel)")+ .font(.system(size: 12))+ }+ HStack(spacing: 6) {+ Image(systemName: speechStatusIcon)+ .foregroundColor(speechStatusColor)+ Text("Reconnaissance vocale : \(speechStatusLabel)")+ .font(.system(size: 12))+ }+ if !voicePermissionsGranted {+ Button("Demander les permissions") {+ Task {+ let ok = await VoiceSettings.requestPermissions()+ voicePermissionsGranted = ok+ }+ }+ .buttonStyle(.borderedProminent)+ }+ }+ .padding(6)+ }+ .onAppear {+ voicePermissionsGranted = VoiceSettings.micStatus == .granted+ && VoiceSettings.speechStatus == .granted+ }+ }++ private var micStatusIcon: String { VoiceSettings.micStatus == .granted ? "checkmark.circle.fill" : "xmark.circle.fill" }+ private var micStatusColor: Color { VoiceSettings.micStatus == .granted ? .green : .red }+ private var micStatusLabel: String {+ switch VoiceSettings.micStatus {+ case .granted: return "accordé"+ case .denied: return "refusé (Réglages Système → Confidentialité → Microphone)"+ case .undetermined: return "non demandé"+ }+ }+ private var speechStatusIcon: String { VoiceSettings.speechStatus == .granted ? "checkmark.circle.fill" : "xmark.circle.fill" }+ private var speechStatusColor: Color { VoiceSettings.speechStatus == .granted ? .green : .red }+ private var speechStatusLabel: String {+ switch VoiceSettings.speechStatus {+ case .granted: return "accordé"+ case .denied: return "refusé (Réglages Système → Confidentialité → Reconnaissance vocale)"+ case .undetermined: return "non demandé"+ }+ }+ #endif+// MARK: - Actionsprivate func applyCustomModel(_ value: String) {diff --git a/NotchBuddy/Sources/App/Voice/VoiceAudio.swift b/NotchBuddy/Sources/App/Voice/VoiceAudio.swiftnew file mode 100644index 00000000..b29dfdcb--- /dev/null+++ b/NotchBuddy/Sources/App/Voice/VoiceAudio.swift@@ -0,0 +1,116 @@+#if !APPSTORE+import AVFoundation++// MARK: - VoiceAudio++/// Wraps AVAudioEngine to deliver a low-level audio tap for voice detection.+/// Computes per-buffer RMS energy and drives a simple adaptive VAD (voice activity+/// detector): the recognizer only runs while someone is actually speaking, keeping+/// CPU near 0 % during silence.+///+/// Thread model: `start()` / `stop()` are called on the main thread.+/// `onVoiceStart`, `onVoiceEnd` are dispatched to the main thread.+/// `onBuffer` is called **on the audio tap thread** — its closure must be thread-safe.+final class VoiceAudio: @unchecked Sendable {++ private let engine = AVAudioEngine()+ private var tapInstalled = false++ // Adaptive VAD — state read/written only on the audio tap thread.+ private var noisePower: Double = 1e-7 // background power estimate (exponential avg)+ private var vadActive = false+ private var silentBufs = 0 // consecutive below-threshold buffers++ /// Voice starts when instantaneous power exceeds noisePower × this ratio.+ private static let riseRatio: Double = 8.0+ /// Voice ends when power stays below noisePower × this ratio for `silenceFrames`.+ private static let fallRatio: Double = 2.0+ /// Number of consecutive quiet buffers required to declare end-of-voice.+ /// At bufferSize=1024 and ~44 kHz the tap fires ~43 times/s → ~6 ≈ 140 ms.+ private static let silenceFrames = 6++ // MARK: Callbacks++ /// Fired on the main thread when voice activity starts.+ var onVoiceStart: (() -> Void)?+ /// Fired on the main thread when voice activity ends.+ var onVoiceEnd: (() -> Void)?+ /// Fired on the **audio tap thread** with each PCM buffer during voice activity.+ /// The closure must be thread-safe (do not access main-actor state).+ var onBuffer: ((AVAudioPCMBuffer, AVAudioTime) -> Void)?++ // MARK: - Control++ func start() throws {+ guard !tapInstalled else { return }+ let input = engine.inputNode+ let fmt = input.outputFormat(forBus: 0)+ input.installTap(onBus: 0, bufferSize: 1024, format: fmt) { [weak self] buf, time in+ self?.processTap(buf, time: time)+ }+ tapInstalled = true+ engine.prepare()+ try engine.start()+ }++ func stop() {+ guard tapInstalled else { return }+ engine.stop()+ engine.inputNode.removeTap(onBus: 0)+ tapInstalled = false+ if vadActive {+ vadActive = false+ DispatchQueue.main.async { [weak self] in self?.onVoiceEnd?() }+ }+ }++ // MARK: - Tap processing (audio thread)++ private func processTap(_ buf: AVAudioPCMBuffer, time: AVAudioTime) {+ let power = buf.meanSquarePower++ if !vadActive {+ // Update noise floor only during silence (speech would inflate it)+ noisePower = noisePower * 0.995 + power * 0.005+ if power > noisePower * Self.riseRatio {+ vadActive = true+ silentBufs = 0+ DispatchQueue.main.async { [weak self] in self?.onVoiceStart?() }+ }+ } else {+ // Feed buffer to the active consumer (spotter or command recognizer)+ onBuffer?(buf, time)+ if power < noisePower * Self.fallRatio {+ silentBufs += 1+ if silentBufs >= Self.silenceFrames {+ vadActive = false+ silentBufs = 0+ DispatchQueue.main.async { [weak self] in self?.onVoiceEnd?() }+ }+ } else {+ silentBufs = 0+ }+ }+ }+}++// MARK: - AVAudioPCMBuffer mean-square power++private extension AVAudioPCMBuffer {+ /// Mean of squared samples across all frames and channels.+ var meanSquarePower: Double {+ guard let data = floatChannelData, frameLength > 0 else { return 0 }+ let frames = Int(frameLength)+ let chans = Int(format.channelCount)+ var sum: Double = 0+ for ch in 0..<chans {+ let p = data[ch]+ for i in 0..<frames {+ let s = Double(p[i])+ sum += s * s+ }+ }+ return sum / Double(frames * max(1, chans))+ }+}+#endifdiff --git a/NotchBuddy/Sources/App/Voice/VoiceEngine.swift b/NotchBuddy/Sources/App/Voice/VoiceEngine.swiftnew file mode 100644index 00000000..76c0711e--- /dev/null+++ b/NotchBuddy/Sources/App/Voice/VoiceEngine.swift@@ -0,0 +1,344 @@+#if !APPSTORE+import AppKit+import AVFoundation+import Speech++// MARK: - VoiceEngine++/// Coordinator for the «OK Coucou» voice feature.+///+/// Responsibilities:+/// - Manages VoiceAudio (energy VAD) and WakeSpotter (on-device recognition).+/// - Routes audio buffers to the wake spotter or, after a wake event, to the+/// command recognizer.+/// - Fires island notifications (.voiceWoke / .voiceFinished) so+/// IslandWindowController keeps the FSM in sync.+/// - Auto-pauses on: screen lock/sleep, Low Power Mode, voice disabled.+///+/// Audio transcriptions are never logged beyond the per-session command+/// transcript held in `commandTranscript` (in-memory only).+@MainActor+final class VoiceEngine: ObservableObject {+ static let shared = VoiceEngine()++ // MARK: - Published state++ @Published var isEnabled: Bool = VoiceSettings.isEnabled {+ didSet {+ VoiceSettings.isEnabled = isEnabled+ handleEnabledChanged()+ }+ }+ /// True while the engine is actively listening for a command (after wake detection).+ @Published private(set) var isListeningForCommand: Bool = false+ /// Live command transcript (in-memory only, never written to disk or logs).+ @Published private(set) var commandTranscript: String = ""+ /// True when no on-device speech model is available for any supported locale.+ @Published private(set) var recognizerUnavailable: Bool = false++ // MARK: - Pause reasons++ private var screenLocked = false+ private var screenSleeping = false+ private var lowPowerMode = false++ var isPaused: Bool { screenLocked || screenSleeping || lowPowerMode }++ // MARK: - Audio pipeline (main-thread owned)++ private var audio: VoiceAudio?+ private var spotter: WakeSpotter?++ // Command recognition+ private var commandRecognizer: SFSpeechRecognizer?+ private var commandTask: SFSpeechRecognitionTask?+ private var silenceWork: DispatchWorkItem?+ private var commandMaxWork: DispatchWorkItem?+ private var lastWordCount = 0++ // Lock protecting tap-thread-accessible references+ private let tapLock = NSLock()+ nonisolated(unsafe) private var tapSpotter: WakeSpotter?+ nonisolated(unsafe) private var tapCommandReq: SFSpeechAudioBufferRecognitionRequest?+ nonisolated(unsafe) private var tapMode: TapMode = .wake++ private enum TapMode { case wake, command }++ // Timing constants+ private static let silenceTimeout: TimeInterval = 1.2+ private static let commandMaxTime: TimeInterval = 10.0+ private static let cancelPhrases = ["annule", "annuler", "cancel", "laisse tomber"]++ // MARK: - Init++ private init() {+ lowPowerMode = ProcessInfo.processInfo.isLowPowerModeEnabled+ observeSystemEvents()+ if isEnabled && !isPaused { startAudioPipeline() }+ }++ // MARK: - Enable / pause++ private func handleEnabledChanged() {+ if isEnabled && !isPaused { startAudioPipeline() }+ else { stopAudioPipeline() }+ }++ private func updatePause() {+ if isPaused { stopAudioPipeline() }+ else if isEnabled { startAudioPipeline() }+ }++ /// Called by IslandWindowController when the listening island is dismissed by+ /// a user action (Escape, external collapse) so the command session ends cleanly.+ func cancelListening() {+ endCommand(postFinished: false)+ }++ // MARK: - Audio pipeline++ private func startAudioPipeline() {+ guard audio == nil else { return }+ guard let locale = suitableLocale() else {+ recognizerUnavailable = true+ return+ }+ recognizerUnavailable = false++ let a = VoiceAudio()+ let s = WakeSpotter()++ // Give spotter access to the tap-thread-safe slot+ tapLock.withLock {+ tapSpotter = s+ tapCommandReq = nil+ tapMode = .wake+ }++ s.onWake = { [weak self] transcript in+ // Already dispatched to main by WakeSpotter+ self?.wakeDetected(transcript: transcript, locale: locale)+ }++ a.onVoiceStart = { [weak self] in+ s.beginWindow(locale: locale)+ }++ a.onVoiceEnd = { [weak self] in+ guard let self else { return }+ // VAD ended without wake → close the recognition window+ tapLock.withLock {+ if tapMode == .wake { s.endWindow() }+ }+ }++ // Audio tap → spotter or command recognizer (audio thread)+ a.onBuffer = { [weak self] buf, _ in+ guard let self else { return }+ self.tapLock.withLock {+ switch self.tapMode {+ case .wake: self.tapSpotter?.feed(buf)+ case .command: self.tapCommandReq?.append(buf)+ }+ }+ }++ do {+ try a.start()+ audio = a+ spotter = s+ } catch {+ // Microphone unavailable or permission denied+ }+ }++ private func stopAudioPipeline() {+ endCommand(postFinished: false)+ audio?.stop()+ audio = nil+ spotter = nil+ tapLock.withLock {+ tapSpotter = nil+ tapCommandReq = nil+ tapMode = .wake+ }+ }++ // MARK: - Wake detection++ private func wakeDetected(transcript: String, locale: Locale) {+ guard isEnabled, !isPaused, !isListeningForCommand else { return }+ isListeningForCommand = true+ commandTranscript = ""+ lastWordCount = 0+ NotificationCenter.default.post(name: .voiceWoke, object: nil)+ startCommandRecognizer(locale: locale)+ }++ // MARK: - Command recognition++ private func startCommandRecognizer(locale: Locale) {+ guard let r = SFSpeechRecognizer(locale: locale),+ r.supportsOnDeviceRecognition,+ r.isAvailable else {+ endCommand(postFinished: true)+ return+ }+ let req = SFSpeechAudioBufferRecognitionRequest()+ req.shouldReportPartialResults = true+ req.requiresOnDeviceRecognition = true++ commandRecognizer = r+ tapLock.withLock {+ tapCommandReq = req+ tapMode = .command+ }++ commandTask = r.recognitionTask(with: req) { [weak self] result, error in+ guard let self else { return }+ Task { @MainActor in+ if let text = result?.bestTranscription.formattedString {+ let stripped = Self.stripWakePhrase(text)+ self.commandTranscript = stripped+ let wc = stripped.split(separator: " ").count+ if wc > self.lastWordCount {+ self.lastWordCount = wc+ self.resetSilenceTimer()+ // Check for cancel phrase+ let lower = stripped.lowercased()+ if Self.cancelPhrases.contains(where: { lower.contains($0) }) {+ self.endCommand(postFinished: true)+ return+ }+ }+ }+ if result?.isFinal == true || error != nil {+ self.endCommand(postFinished: true)+ }+ }+ }++ // Hard cap on command duration+ let maxItem = DispatchWorkItem { [weak self] in+ Task { @MainActor in self?.endCommand(postFinished: true) }+ }+ commandMaxWork = maxItem+ DispatchQueue.main.asyncAfter(deadline: .now() + Self.commandMaxTime, execute: maxItem)++ // Initial silence timer (fires if nothing is said after wake)+ resetSilenceTimer()+ }++ private func resetSilenceTimer() {+ silenceWork?.cancel()+ let item = DispatchWorkItem { [weak self] in+ Task { @MainActor in self?.endCommand(postFinished: true) }+ }+ silenceWork = item+ DispatchQueue.main.asyncAfter(deadline: .now() + Self.silenceTimeout, execute: item)+ }++ private func endCommand(postFinished: Bool) {+ silenceWork?.cancel(); silenceWork = nil+ commandMaxWork?.cancel(); commandMaxWork = nil++ tapLock.withLock {+ tapCommandReq?.endAudio()+ tapCommandReq = nil+ tapMode = .wake+ }+ commandTask?.cancel()+ commandTask = nil+ commandRecognizer = nil+ isListeningForCommand = false++ if postFinished {+ let cmd = commandTranscript+ NotificationCenter.default.post(name: .voiceFinished, object: cmd.isEmpty ? nil : cmd as NSString)+ }+ }++ // MARK: - Helpers++ /// Returns the first locale whose SFSpeechRecognizer supports on-device recognition.+ private func suitableLocale() -> Locale? {+ var candidates = MacDictation.automaticLocales()+ candidates += [Locale(identifier: "fr-FR"), Locale(identifier: "en-US")]+ for locale in candidates {+ if let r = SFSpeechRecognizer(locale: locale),+ r.supportsOnDeviceRecognition, r.isAvailable {+ return locale+ }+ }+ return nil+ }++ /// Strip the wake phrase from the start of a transcript.+ private static func stripWakePhrase(_ raw: String) -> String {+ let lower = raw.lowercased()+ let phrases = ["ok coucou", "okay coucou", "ok cuckoo", "ok kuku",+ "hey coucou", "dis coucou", "coucou"]+ for phrase in phrases where lower.hasPrefix(phrase) {+ return String(raw.dropFirst(phrase.count))+ .trimmingCharacters(in: .whitespaces)+ }+ return raw+ }++ // MARK: - System event observers++ private func observeSystemEvents() {+ let dc = DistributedNotificationCenter.default()+ dc.addObserver(forName: NSNotification.Name("com.apple.screenIsLocked"),+ object: nil, queue: .main) { [weak self] _ in+ Task { @MainActor in+ self?.screenLocked = true+ self?.updatePause()+ }+ }+ dc.addObserver(forName: NSNotification.Name("com.apple.screenIsUnlocked"),+ object: nil, queue: .main) { [weak self] _ in+ Task { @MainActor in+ self?.screenLocked = false+ self?.updatePause()+ }+ }++ let ws = NSWorkspace.shared.notificationCenter+ ws.addObserver(forName: NSWorkspace.willSleepNotification,+ object: nil, queue: .main) { [weak self] _ in+ Task { @MainActor in+ self?.screenSleeping = true+ self?.updatePause()+ }+ }+ ws.addObserver(forName: NSWorkspace.didWakeNotification,+ object: nil, queue: .main) { [weak self] _ in+ Task { @MainActor in+ self?.screenSleeping = false+ self?.updatePause()+ }+ }++ NotificationCenter.default.addObserver(+ forName: NSNotification.Name.NSProcessInfoPowerStateDidChange,+ object: nil, queue: .main+ ) { [weak self] _ in+ Task { @MainActor in+ self?.lowPowerMode = ProcessInfo.processInfo.isLowPowerModeEnabled+ self?.updatePause()+ }+ }+ }+}++// MARK: - Voice notification names (defined alongside the engine that posts them)++extension Notification.Name {+ /// Posted (main thread) when the wake phrase is detected. Island opens in .listening.+ static let voiceWoke = Notification.Name("notchBuddy.voiceWoke")+ /// Posted (main thread) when listening ends (silence, cancel, max time, or user dismiss).+ /// `object` is the command String if any words were captured, nil otherwise.+ static let voiceFinished = Notification.Name("notchBuddy.voiceFinished")+}+#endifdiff --git a/NotchBuddy/Sources/App/Voice/VoiceIslandView.swift b/NotchBuddy/Sources/App/Voice/VoiceIslandView.swiftnew file mode 100644index 00000000..719846a7--- /dev/null+++ b/NotchBuddy/Sources/App/Voice/VoiceIslandView.swift@@ -0,0 +1,72 @@+#if !APPSTORE+import SwiftUI++// MARK: - VoiceListeningView++/// Content of the island while the voice engine is listening for a command.+/// Shown when `AppState.view == .listening`.+///+/// Layout mirrors other 160-pt views: Mochi (BotPlacement) occupies the left ~110 pt;+/// the card fills the remaining space to the right.+struct VoiceListeningView: View {+ @ObservedObject private var voice = VoiceEngine.shared++ var body: some View {+ ZStack {+ CardBackground(wash: .cyan)++ HStack(spacing: 0) {+ // Reserve space for BotPlacement (injected by IslandContainer)+ Spacer().frame(width: 110)++ VStack(alignment: .leading, spacing: 6) {+ // Status row: pulsing mic dot + "À l'écoute…" label+ HStack(spacing: 7) {+ MicDotView()+ Text("À l'écoute…")+ .font(.system(size: 14, weight: .semibold))+ .foregroundColor(Color(hex: "#F5F6F8"))+ }++ // Live transcript (empty until user starts speaking)+ if voice.commandTranscript.isEmpty {+ Text("Dites votre commande")+ .font(.system(size: 12))+ .foregroundColor(Color(hex: "#8E939C"))+ } else {+ Text(voice.commandTranscript)+ .font(.system(size: 12))+ .foregroundColor(Color(hex: "#C8CBD0"))+ .lineLimit(2)+ .animation(.easeOut(duration: 0.1), value: voice.commandTranscript)+ }+ }+ .padding(.trailing, 18)++ Spacer(minLength: 0)+ }+ }+ }+}++// MARK: - MicDotView++/// A pulsing microphone-indicator dot (matches macOS orange recording dot convention).+private struct MicDotView: View {+ @State private var pulsing = false++ var body: some View {+ Circle()+ .fill(Color(hex: "#F97316")) // warm orange+ .frame(width: 8, height: 8)+ .scaleEffect(pulsing ? 1.35 : 1.0)+ .opacity(pulsing ? 0.65 : 1.0)+ .animation(+ .easeInOut(duration: 0.8).repeatForever(autoreverses: true),+ value: pulsing+ )+ .onAppear { pulsing = true }+ .onDisappear { pulsing = false }+ }+}+#endifdiff --git a/NotchBuddy/Sources/App/Voice/VoiceSettings.swift b/NotchBuddy/Sources/App/Voice/VoiceSettings.swiftnew file mode 100644index 00000000..f70448d8--- /dev/null+++ b/NotchBuddy/Sources/App/Voice/VoiceSettings.swift@@ -0,0 +1,54 @@+#if !APPSTORE+import AVFoundation+import Speech++// MARK: - VoiceSettings++/// Persisted voice feature settings and permission helpers.+enum VoiceSettings {+ static let enabledKey = "voiceEnabled"++ static var isEnabled: Bool {+ get { UserDefaults.standard.bool(forKey: enabledKey) }+ set { UserDefaults.standard.set(newValue, forKey: enabledKey) }+ }++ // MARK: - Permissions++ enum PermissionStatus { case granted, denied, undetermined }++ static var micStatus: PermissionStatus {+ switch AVCaptureDevice.authorizationStatus(for: .audio) {+ case .authorized: return .granted+ case .denied, .restricted: return .denied+ case .notDetermined: return .undetermined+ @unknown default: return .undetermined+ }+ }++ static var speechStatus: PermissionStatus {+ switch SFSpeechRecognizer.authorizationStatus() {+ case .authorized: return .granted+ case .denied, .restricted: return .denied+ case .notDetermined: return .undetermined+ @unknown default: return .undetermined+ }+ }++ var bothGranted: Bool {+ VoiceSettings.micStatus == .granted && VoiceSettings.speechStatus == .granted+ }++ /// Request microphone then speech recognition. Returns true if both granted.+ @MainActor+ static func requestPermissions() async -> Bool {+ let mic = await AVAudioApplication.requestRecordPermission()+ guard mic else { return false }+ return await withCheckedContinuation { cont in+ SFSpeechRecognizer.requestAuthorization { status in+ cont.resume(returning: status == .authorized)+ }+ }+ }+}+#endifdiff --git a/NotchBuddy/Sources/App/Voice/WakeSpotter.swift b/NotchBuddy/Sources/App/Voice/WakeSpotter.swiftnew file mode 100644index 00000000..b35ce407--- /dev/null+++ b/NotchBuddy/Sources/App/Voice/WakeSpotter.swift@@ -0,0 +1,122 @@+#if !APPSTORE+import AVFoundation+import Speech++// MARK: - WakeSpotter++/// Runs a single SFSpeechRecognizer window to detect the "OK Coucou" wake phrase.+///+/// Rules:+/// - `requiresOnDeviceRecognition = true`; never falls back to a server recognizer.+/// If the device has no on-device model for the locale, the window silently closes.+/// - Audio and transcriptions are never written to disk or to any log.+/// - `matchesWake(_:)` is a pure function: testable in isolation.+///+/// Thread model: `beginWindow`, `endWindow`, and the `onWake` callback all run on the+/// thread of the caller. `feed(_:)` may be called from any thread (the audio tap thread).+final class WakeSpotter: @unchecked Sendable {++ /// Called when the wake phrase is detected. Receives the raw transcript (may include+ /// words spoken after the wake phrase — those become the command).+ var onWake: ((String) -> Void)?++ private var recognizer: SFSpeechRecognizer?+ private var request: SFSpeechAudioBufferRecognitionRequest?+ private var task: SFSpeechRecognitionTask?+ private var active = false++ // MARK: - Recognition window lifecycle++ /// Begin a recognition window, listening for the wake phrase in `locale`.+ /// No-op if a window is already active. If the locale has no on-device model,+ /// the window is not opened (never falls back to server).+ func beginWindow(locale: Locale) {+ guard !active else { return }+ guard let r = SFSpeechRecognizer(locale: locale),+ r.supportsOnDeviceRecognition,+ r.isAvailable else { return }++ let req = SFSpeechAudioBufferRecognitionRequest()+ req.shouldReportPartialResults = true+ req.requiresOnDeviceRecognition = true+ req.contextualStrings = ["Coucou", "OK Coucou", "okay Coucou",+ "hey Coucou"]+ active = true+ recognizer = r+ request = req++ task = r.recognitionTask(with: req) { [weak self] result, error in+ guard let self else { return }+ if let transcript = result?.bestTranscription.formattedString,+ Self.matchesWake(transcript) {+ let text = transcript+ DispatchQueue.main.async { self.onWake?(text) }+ self.endWindow()+ return+ }+ if result?.isFinal == true || error != nil {+ self.endWindow()+ }+ }+ }++ /// Append an audio buffer to the current window. Thread-safe.+ func feed(_ buffer: AVAudioPCMBuffer) {+ request?.append(buffer)+ }++ /// Close the current recognition window without firing `onWake`.+ func endWindow() {+ request?.endAudio()+ task?.cancel()+ request = nil+ task = nil+ recognizer = nil+ active = false+ }++ // MARK: - Wake phrase matching (pure — no side effects)++ /// Returns `true` when `raw` contains one of the recognised wake patterns.+ ///+ /// Accepted patterns (case-insensitive, after phonetic normalisation):+ /// - "coucou" — exactly that word alone (not mid-sentence, not "coucou ça va")+ /// - "ok coucou" and its variants: "okay coucou", "ok cuckoo", "ok kuku" …+ /// - "hey coucou", "dis coucou"+ ///+ /// The match may be followed by command words (e.g. "ok coucou add GitHub").+ static func matchesWake(_ raw: String) -> Bool {+ // 1. Lower-case and strip punctuation+ var text = raw.lowercased()+ .components(separatedBy: .punctuationCharacters)+ .joined()+ .trimmingCharacters(in: .whitespaces)++ // 2. Normalise common phonetic / OCR variants+ text = text+ .replacingOccurrences(of: "cuckoo", with: "coucou")+ .replacingOccurrences(of: "kuku", with: "coucou")+ .replacingOccurrences(of: "kucou", with: "coucou")+ .replacingOccurrences(of: "cou cou", with: "coucou")+ .replacingOccurrences(of: "okay", with: "ok")+ .replacingOccurrences(of: "o k ", with: "ok ")+ // Remove internal double spaces that normalisation may introduce+ while text.contains(" ") { text = text.replacingOccurrences(of: " ", with: " ") }++ // 3. Standalone "coucou" — the entire transcript is just "coucou".+ // "coucou ça va" or "dis coucou à Marie" must NOT trigger.+ if text == "coucou" { return true }++ // 4. Prefix-based patterns (may be followed by a command).+ // "dis coucou" is excluded: in French it also means "say hello to [person]" and+ // creates too many false positives (e.g. "dis coucou à Marie"). Added in a later phase.+ let wakePrefixes = ["ok coucou", "hey coucou"]+ for prefix in wakePrefixes {+ if text == prefix { return true }+ if text.hasPrefix(prefix + " ") { return true }+ }++ return false+ }+}+#endifdiff --git a/NotchBuddy/Sources/CoucouKit/BotEngine.swift b/NotchBuddy/Sources/CoucouKit/BotEngine.swiftindex 0443ef9c..6dc8b389 100644--- a/NotchBuddy/Sources/CoucouKit/BotEngine.swift+++ b/NotchBuddy/Sources/CoucouKit/BotEngine.swift@@ -679,6 +679,17 @@ final class BotEngine: ObservableObject {DispatchQueue.main.asyncAfter(deadline: .now() + 0.06) {SoundEngine.shared.play("annoyed")}+ case .listening:+ // Attentive: slight head tilt + wide-open eyes+ anim("tilt", keys: [+ TweenKey(target: -0.07, duration: 180, ease: Ease.out),+ TweenKey(target: -0.07, duration: CGFloat((duration - 0.4) * 1000), ease: Ease.lin),+ TweenKey(target: 0, duration: 240, ease: Ease.inOut),+ ])+ anim("es", keys: [+ TweenKey(target: 1.12, duration: 200, ease: Ease.out),+ TweenKey(target: 1, duration: 500, ease: Ease.inOut),+ ])}}@@ -1615,6 +1626,7 @@ private func emoteEyeShape(_ e: BotEmote) -> EyeShape {case .yawn: return .tiredcase .happy: return .happycase .annoyed: return .line+ case .listening: return .wide}}diff --git a/NotchBuddy/Sources/CoucouKit/IslandTypes.swift b/NotchBuddy/Sources/CoucouKit/IslandTypes.swiftindex 26217856..f21a6677 100644--- a/NotchBuddy/Sources/CoucouKit/IslandTypes.swift+++ b/NotchBuddy/Sources/CoucouKit/IslandTypes.swift@@ -12,6 +12,7 @@ enum IslandView: String, CaseIterable {case overview, empty, approval, question, error, finishedcase confused, upload, uploading, choose, mail, promptcase searching, result, note, settings, greeting, wardrobe, recap+ case listening // voice wake detected — "À l'écoute…" with live transcript}// MARK: - Bot State@@ -26,6 +27,7 @@ enum BotState: String, CaseIterable {enum BotEmote: String, CaseIterable {case love, surprised, proud, wink, yawn, happy, annoyed+ case listening // attentive: head tilt + wide-open eyes}// MARK: - Approval info (pending PermissionRequest from Claude Code)@@ -192,6 +194,8 @@ enum IslandConst {.greeting: ViewLayout(height: 150, botX: 320, botY: 90, botDiameter: 0, agentMode: .none),.wardrobe: ViewLayout(height: 160, botX: 68, botY: nil, botDiameter: 58, agentMode: .none),.recap: ViewLayout(height: 160, botX: 62, botY: nil, botDiameter: 58, agentMode: .column),+ // Voice listening: Mochi (listening emote) on left, transcript on right+ .listening: ViewLayout(height: 160, botX: 68, botY: nil, botDiameter: 58, agentMode: .none),]// Project colors — keyed by lowercase display name or slugdiff --git a/NotchBuddy/Tests/VoiceIslandTests.swift b/NotchBuddy/Tests/VoiceIslandTests.swiftnew file mode 100644index 00000000..24cf4d5a--- /dev/null+++ b/NotchBuddy/Tests/VoiceIslandTests.swift@@ -0,0 +1,185 @@+#!/usr/bin/swift+// VoiceIslandTests.swift — standalone tests for IslandStateMachine listening state.+// Run from repo root:+// swift NotchBuddy/Tests/VoiceIslandTests.swift+//+// Copies the FSM logic (voice-specific paths only) to avoid Xcode dependencies.++import Foundation++// ── Minimal FSM copy for testing ──────────────────────────────────────────────++enum FSMState: Equatable {+ case hidden, petit, home, coucou, listening+}++class TestFSM {+ var state: FSMState = .hidden+ var transitions: [(from: FSMState, to: FSMState)] = []++ private func transition(to new: FSMState) {+ guard new != state else { return }+ let old = state+ state = new+ transitions.append((from: old, to: new))+ }++ func voiceWoke() {+ transition(to: .listening)+ }++ func voiceFinished() {+ guard state == .listening else { return }+ transition(to: .petit)+ }++ func collapse() {+ guard state == .home || state == .coucou || state == .listening else { return }+ transition(to: .petit)+ }++ func mouseLeft() {+ switch state {+ case .hidden: break+ case .petit: break // simplified — real FSM schedules a timer+ case .home: break // simplified+ case .coucou: break // simplified+ case .listening: break // must NOT schedule any timer+ }+ }++ func mouseEntered() {+ switch state {+ case .hidden: transition(to: .petit)+ case .petit: break+ case .home: break+ case .coucou: break+ case .listening: break // already open+ }+ }++ func click() {+ guard state == .petit || state == .hidden else { return }+ transition(to: .home)+ }+}++// ── Helpers ───────────────────────────────────────────────────────────────────++var passed = 0+var failed = 0++func check(_ label: String, _ condition: Bool) {+ if condition {+ print("✓ \(label)")+ passed += 1+ } else {+ print("✗ \(label)")+ failed += 1+ }+}++// ── Tests ──────────────────────────────────────────────────────────────────────++do {+ // Wake from hidden+ let fsm = TestFSM()+ fsm.voiceWoke()+ check("voiceWoke from hidden → listening", fsm.state == .listening)+}++do {+ // Wake from petit+ let fsm = TestFSM()+ fsm.state = .petit+ fsm.voiceWoke()+ check("voiceWoke from petit → listening", fsm.state == .listening)+}++do {+ // Wake from home+ let fsm = TestFSM()+ fsm.state = .home+ fsm.voiceWoke()+ check("voiceWoke from home → listening", fsm.state == .listening)+}++do {+ // Finish after wake+ let fsm = TestFSM()+ fsm.voiceWoke()+ fsm.voiceFinished()+ check("voiceFinished → petit", fsm.state == .petit)+}++do {+ // voiceFinished is a no-op when not in listening+ let fsm = TestFSM()+ fsm.state = .home+ fsm.voiceFinished()+ check("voiceFinished from home → no-op (stays home)", fsm.state == .home)+}++do {+ // voiceFinished is a no-op from petit+ let fsm = TestFSM()+ fsm.state = .petit+ fsm.voiceFinished()+ check("voiceFinished from petit → no-op (stays petit)", fsm.state == .petit)+}++do {+ // collapse() while listening → petit+ let fsm = TestFSM()+ fsm.voiceWoke()+ fsm.collapse()+ check("collapse while listening → petit", fsm.state == .petit)+}++do {+ // click() while listening → no-op (already expanded)+ let fsm = TestFSM()+ fsm.voiceWoke()+ fsm.click()+ check("click while listening → no-op (stays listening)", fsm.state == .listening)+}++do {+ // mouseLeft while listening → no timer; state unchanged+ let fsm = TestFSM()+ fsm.voiceWoke()+ fsm.mouseLeft()+ check("mouseLeft while listening → stays listening", fsm.state == .listening)+}++do {+ // mouseEntered while listening → no-op+ let fsm = TestFSM()+ fsm.voiceWoke()+ fsm.mouseEntered()+ check("mouseEntered while listening → stays listening", fsm.state == .listening)+}++do {+ // Transition sequence: hidden → listening → petit+ let fsm = TestFSM()+ fsm.voiceWoke()+ fsm.voiceFinished()+ let seq = fsm.transitions.map { "\($0.from)→\($0.to)" }+ check("full sequence hidden→listening→petit",+ seq == ["hidden→listening", "listening→petit"])+}++do {+ // Wake while already listening → stays listening (transition(to:) is idempotent)+ let fsm = TestFSM()+ fsm.voiceWoke()+ let before = fsm.transitions.count+ fsm.voiceWoke()+ check("double voiceWoke → no second transition", fsm.transitions.count == before)+ check("double voiceWoke → still listening", fsm.state == .listening)+}++// ── Summary ───────────────────────────────────────────────────────────────────+print("\n\(passed)/\(passed + failed) tests passed.")+if failed > 0 { exit(1) }diff --git a/NotchBuddy/Tests/WakeSpotterTests.swift b/NotchBuddy/Tests/WakeSpotterTests.swiftnew file mode 100644index 00000000..6e3d9e7d--- /dev/null+++ b/NotchBuddy/Tests/WakeSpotterTests.swift@@ -0,0 +1,95 @@+#!/usr/bin/swift+// WakeSpotterTests.swift — standalone test script for WakeSpotter.matchesWake(_:)+// Run from repo root:+// swift NotchBuddy/Tests/WakeSpotterTests.swift++import Foundation++// ── Copy of WakeSpotter.matchesWake from WakeSpotter.swift ───────────────────+// Keep in sync with Sources/App/Voice/WakeSpotter.swift WakeSpotter.matchesWake.++func matchesWake(_ raw: String) -> Bool {+ var text = raw.lowercased()+ .components(separatedBy: CharacterSet.punctuationCharacters)+ .joined()+ .trimmingCharacters(in: .whitespaces)++ text = text+ .replacingOccurrences(of: "cuckoo", with: "coucou")+ .replacingOccurrences(of: "kuku", with: "coucou")+ .replacingOccurrences(of: "kucou", with: "coucou")+ .replacingOccurrences(of: "cou cou", with: "coucou")+ .replacingOccurrences(of: "okay", with: "ok")+ .replacingOccurrences(of: "o k ", with: "ok ")++ while text.contains(" ") { text = text.replacingOccurrences(of: " ", with: " ") }++ if text == "coucou" { return true }++ let wakePrefixes = ["ok coucou", "hey coucou"]+ for prefix in wakePrefixes {+ if text == prefix { return true }+ if text.hasPrefix(prefix + " ") { return true }+ }++ return false+}++// ── Test table ────────────────────────────────────────────────────────────────++struct Case {+ let input: String+ let expected: Bool+ let label: String+}++let cases: [Case] = [+ // ── Should trigger ────────────────────────────────────────────────────────+ Case(input: "ok coucou", expected: true, label: "canonical lowercase"),+ Case(input: "OK Coucou", expected: true, label: "canonical mixed-case"),+ Case(input: "OK COUCOU", expected: true, label: "all caps"),+ Case(input: "okay coucou", expected: true, label: "okay variant"),+ Case(input: "Okay Coucou", expected: true, label: "okay mixed-case"),+ Case(input: "ok cuckoo", expected: true, label: "phonetic: cuckoo"),+ Case(input: "ok kuku", expected: true, label: "phonetic: kuku"),+ Case(input: "ok cou cou", expected: true, label: "spaced: cou cou"),+ Case(input: "hey coucou", expected: true, label: "hey prefix"),+ Case(input: "Hey Coucou", expected: true, label: "hey mixed-case"),+ Case(input: "coucou", expected: true, label: "standalone"),+ Case(input: "COUCOU", expected: true, label: "standalone caps"),+ // Wake + command (recognizer may capture command words after wake phrase)+ Case(input: "ok coucou add github", expected: true, label: "wake + command words"),+ Case(input: "ok coucou ouvre figma", expected: true, label: "wake + french command"),++ // ── Should NOT trigger ────────────────────────────────────────────────────+ Case(input: "coucou ça va", expected: false, label: "greeting sentence"),+ Case(input: "coucou comment tu vas", expected: false, label: "greeting with more words"),+ Case(input: "ok google", expected: false, label: "other wake word"),+ Case(input: "hey siri", expected: false, label: "other assistant"),+ Case(input: "comment ça va", expected: false, label: "unrelated sentence"),+ Case(input: "", expected: false, label: "empty string"),+ Case(input: "bonjour coucou", expected: false, label: "coucou not at known prefix"),+ Case(input: "salut", expected: false, label: "unrelated word"),+ Case(input: "okkkk coucou", expected: false, label: "malformed ok"),+]++// ── Runner ────────────────────────────────────────────────────────────────────++var passed = 0+var failed = 0++for c in cases {+ let got = matchesWake(c.input)+ if got == c.expected {+ print("✓ \(c.label)")+ passed += 1+ } else {+ print("✗ \(c.label)")+ print(" input: \"\(c.input)\"")+ print(" expected: \(c.expected), got: \(got)")+ failed += 1+ }+}++print("\n\(passed)/\(passed + failed) tests passed.")+if failed > 0 { exit(1) }diff --git a/docs/VOICE.md b/docs/VOICE.mdnew file mode 100644index 00000000..6086f12e--- /dev/null+++ b/docs/VOICE.md@@ -0,0 +1,106 @@+# « OK Coucou » : commande vocale mains libres (Mac)++Plan de travail pour Claude Code. Mac uniquement : ne toucher ni à `windows/`, ni à l'app iPhone (`Sources/Phone/`).+Chaque phase = une PR, avec ses tests, et rien ne sort de ce qui est demandé dans la phase.++## L'idée++Coucou écoute en permanence (si l'utilisateur l'a activé). On dit « OK Coucou » : l'île compacte s'ouvre, Mochi fait+une petite émote d'écoute et affiche « À l'écoute… » avec la transcription en direct. On dit ce qu'on veut, Coucou le fait,+Mochi réagit (content, ou « je n'ai pas compris »), l'île se referme. Coucou ne parle pas (pas de synthèse vocale pour l'instant).++## Règles non négociables++- **100 % local.** Reconnaissance vocale sur l'appareil uniquement (`requiresOnDeviceRecognition = true`, jamais de repli+ serveur : si la langue n'est pas disponible sur l'appareil, on le dit et on n'écoute pas). Compréhension par analyseur+ local, puis par le modèle d'Apple sur l'appareil (Foundation Models). Aucun appel réseau, aucune clé d'API.+- **Rien n'est enregistré.** L'audio reste en mémoire, jamais sur disque. Les transcriptions ne sont pas loguées+ (au plus « commande reconnue : music.play » dans les logs).+- **Désactivé par défaut.** Interrupteur dans Réglages → Voix. Éteint = micro fermé, 0 % CPU, comme aujourd'hui.+- **Budget CPU quand l'écoute est active** : < 1 % en moyenne au repos (silence) sur Apple Silicon, mesuré dans+ Moniteur d'activité, chiffres dans la PR. Pas de reconnaissance vocale qui tourne pendant le silence (détection de voix d'abord).+- **Règles de CLAUDE.md inchangées** : la voix ne peut jamais approuver une permission Claude Code / Codex, ni envoyer un e-mail.+ Elle prépare, l'utilisateur clique. (Refuser une permission à la voix est autorisé.)+- **Pas de dépendance tierce** : AVFoundation, Speech, FoundationModels, Contacts, CoreSpotlight/NSMetadataQuery, AppKit.+- **Ne pas restyler l'existant** : l'état d'écoute et la carte de confirmation sont de nouvelles vues dans le style de l'app.+- Cible de déploiement inchangée (macOS 15). Tout ce qui demande macOS 26 passe par `#available` avec un repli.+- Le micro affiche le point orange de macOS tant que l'écoute est active : c'est normal, à expliquer dans les réglages.++## Architecture++Nouveau dossier `NotchBuddy/Sources/App/Voice/` :++| Fichier | Rôle |+|---|---|+| `VoiceSettings.swift` | Interrupteur, phrase de réveil (« OK Coucou » par défaut, « Dis Coucou », « Hey Coucou »), langues (réutiliser `MacDictation.automaticLocales()`), raccourci pour couper le micro. |+| `VoiceAudio.swift` | `AVAudioEngine`, entrée 16 kHz mono. Détection de voix par énergie (seuil adaptatif au bruit de fond) qui ne réveille la reconnaissance que quand quelqu'un parle. |+| `WakeSpotter.swift` | Protocole + implémentations : `SpeechWakeSpotter` (SFSpeechRecognizer, macOS 15, `contextualStrings = ["Coucou", "OK Coucou"]`) et `AnalyzerWakeSpotter` (SpeechAnalyzer, macOS 26). Correspondance tolérante : « ok coucou », « okay coucou », « OK cuckoo », « ok kuku »… |+| `CommandListener.swift` | Après le réveil : capture la commande, transcription partielle en direct, fin sur 1,2 s de silence ou 10 s max. « Annule » / « laisse tomber » ferme. |+| `VoiceIntent.swift` | L'enum des actions (voir les 10 fonctions) avec leurs paramètres typés. C'est le seul contrat entre compréhension et exécution. |+| `IntentParser.swift` | Analyseur déterministe FR + EN (expressions + listes de synonymes). Instantané, prévisible, testable. |+| `EntityResolver.swift` | Relie les mots aux vraies choses : pilules (noms + alias de `PillCatalog`, sans jamais changer les IDs), tenues, apps installées, contacts, fichiers (Spotlight limité à Téléchargements / Bureau / Documents). Correspondance floue + score. |+| `VoiceBrain.swift` | macOS 26 + Apple Intelligence : `LanguageModelSession` avec des `Tool` qui renvoient des `VoiceIntent` (génération guidée `@Generable`). Le modèle n'exécute rien lui-même : il propose, `VoiceActionRunner` décide. Utilisé seulement si l'analyseur déterministe n'a rien trouvé, et pour les questions. |+| `VoiceActionRunner.swift` | Exécute un `VoiceIntent` selon sa politique : direct (musique, pilules…) ou carte de confirmation (e-mail, consigne à un agent). Renvoie un résultat pour la réaction de Mochi. |+| `VoiceIslandViews.swift` | État « écoute » de l'île : émote de Mochi, « À l'écoute… », transcription, puis résultat / carte de confirmation. |++Chaîne : micro → détection de voix → réveil → commande → `IntentParser` → (sinon `VoiceBrain`) → `EntityResolver` → `VoiceActionRunner` → île.++Pause automatique de l'écoute : écran verrouillé ou en veille, mode Économie d'énergie, dictée du chat en cours+(`MacDictation` utilise déjà le micro), raccourci « couper le micro ». Reprise automatique.++Machine d'état de l'île : ajouter un état `listening` à `IslandStateMachine` (à côté de `petit` / `home` / `coucou`),+avec ses tests comme les autres transitions.++## Les 10 fonctions de base++| # | Fonction | Exemples (FR / EN) | Exécution | Confirmation |+|---|---|---|---|---|+| 1 | **Musique** | « lance Apple Music », « mets ma playlist Focus », « pause », « suivant », « mets du Daft Punk », « monte le son » | `MusicController` (AppleScript déjà autorisé) ; Spotify via `SpotifyController` si c'est lui qui joue | Non |+| 2 | **Pilules actives** | « ajoute Vercel », « enlève Stripe », « remplace n8n par GitHub », « garde seulement GitHub et Vercel » | `AppState.activeIntegrations`, même logique que Réglages (limite de 4) | Non. Si c'est plein : Mochi demande laquelle retirer |+| 3 | **Pilule principale** | « passe la pilule principale sur Cursor », « main pill Terminal » | `AppState.mainPillId`, même enchaînement que le Picker des réglages | Non |+| 4 | **Envoyer un fichier par mail** | « envoie le fichier facture octobre de mes téléchargements à Tana » | Spotlight trouve le fichier, Contacts trouve l'adresse, `NSSharingService(.composeEmail)` avec destinataire, objet et pièce jointe | **Toujours** : carte « facture-octobre.pdf → Tana (tana@…) », puis l'envoi se fait d'un clic dans Mail. Si plusieurs fichiers ou contacts : choix dans la carte |+| 5 | **Ouvrir** | « ouvre Figma », « ouvre le dossier Coucou », « ouvre le dernier fichier téléchargé », « ouvre github.com » | `NSWorkspace` + Spotlight ; URL seulement en http(s) (`SafeWebURL`) | Non |+| 6 | **Où en sont mes agents** | « qu'est-ce que fait Claude ? », « ouvre la session Codex », « montre-moi le terminal de Claude » | Focus de la pilule + `TerminalTarget` pour sauter au terminal | Non |+| 7 | **Dicter une consigne à un agent** | « dis à Claude de lancer les tests », « demande à Cursor de corriger le lint » | Même chemin que les consignes de l'iPhone (`InstructionRunner`), Claude Code et Cursor seulement | **Oui** : carte avec le texte exact, un clic pour envoyer |+| 8 | **Demandes d'autorisation** | « c'est quoi la demande ? », « refuse » | Ouvre la carte d'approbation existante. Refuser à la voix : oui. Autoriser : jamais, le clic reste obligatoire | Autoriser = clic, toujours |+| 9 | **Minuteurs et rappels** | « rappelle-moi dans 20 minutes de sortir le linge », « minuteur 5 minutes » | Rappel local, Mochi l'annonce dans le notch (+ notification) | Non |+| 10 | **Questions** | « est-ce que la CI est verte ? », « combien j'ai vendu aujourd'hui ? », « il me reste combien sur mon plan Claude ? », « c'est quoi la commande pour annuler un commit ? » | État de Coucou et des services déjà lus (GitHub, Vercel, Stripe, Resend, n8n, usage Claude) ; questions générales par `VoiceBrain` sur l'appareil | Non. Réponse en texte dans l'île |++Bonus (après les 10) : Mochi et l'app à la voix (« mets-toi en pirate », « coupe les sons », « ne pas déranger »),+routines (« mode focus » = playlist + ne pas déranger + pilules de travail).++## Phases (une PR chacune)++**Phase 1 : écoute et réveil.** Réglages → Voix (désactivé par défaut, explication du point orange), permission micro+et reconnaissance vocale, `VoiceAudio` + détection de voix, `SpeechWakeSpotter`, état `listening` de l'île avec+l'émote de Mochi et la transcription. Pas encore d'actions : la commande s'affiche, c'est tout.+Critères : réveil en moins de ~1 s après « OK Coucou », pas de déclenchement sur « coucou » tout seul dans une phrase,+CPU au repos mesuré et < 1 %, 0 % et micro fermé quand c'est éteint, pause écran verrouillé / Économie d'énergie / dictée du chat.+Tests : correspondance de la phrase de réveil (table de variantes), transitions de l'île.++**Phase 2 : comprendre et agir (fonctions 1, 2, 3).** `VoiceIntent`, `IntentParser` FR + EN, `EntityResolver` pour les+pilules, `VoiceActionRunner`, réaction de Mochi (réussi / pas compris / impossible).+Tests : table d'au moins 60 phrases FR + EN → intention attendue, résolution floue des noms de pilules, limite de 4.++**Phase 3 : fichiers, apps, contacts (fonctions 4, 5).** Spotlight limité aux trois dossiers, Contacts (permission demandée+au premier usage seulement), carte de confirmation, `NSSharingService` pour Mail. Rien ne part sans le clic dans Mail.++**Phase 4 : agents (fonctions 6, 7, 8).** Focus et saut au terminal, consigne via `InstructionRunner` avec carte de+confirmation, carte d'autorisation (refuser à la voix oui, autoriser jamais).++**Phase 5 : rappels et questions sur l'état (fonctions 9, 10 sans le modèle).**++**Phase 6 : le cerveau local (macOS 26).** `VoiceBrain` avec Foundation Models et des `Tool` pour chaque `VoiceIntent`,+utilisé quand l'analyseur ne trouve pas, plus les questions générales. Vérifier `SystemLanguageModel.default.availability`+et dire clairement dans les réglages quand ce n'est pas disponible (Mac Intel, Apple Intelligence éteinte, langue).+Passer aussi la détection sur `SpeechAnalyzer` quand macOS 26 est là.++**Phase 7 : finitions.** Réglage de la sensibilité, liste des faux déclenchements, traductions (le catalogue de chaînes+existant), `docs/SPEC.md`, section README, CHANGELOG, puis release (règles de release de CLAUDE.md).+Piste pour plus tard : un petit modèle Core ML dédié à « OK Coucou » sur le Neural Engine, pour descendre encore le CPU.++## Build App Store (sandbox)++À vérifier à chaque phase : entitlements micro (`com.apple.security.device.audio-input`), Contacts, Téléchargements en+lecture. Pour Mail, `NSSharingService` passe sans Apple Events. Si une fonction ne peut pas marcher dans le sandbox, elle reste+dans le build GitHub (comme l'usage du plan Claude aujourd'hui) et c'est écrit dans la PR.