Skip to content

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.

Apple Music in the notch: what's playing, play/pause and skip, and Mochi dances (#144)

Louis91baba574ad6
diff --git a/NotchBuddy/NotchBuddy.xcodeproj/project.pbxproj b/NotchBuddy/NotchBuddy.xcodeproj/project.pbxproj
index 4803a9de..71c9eec5 100644
--- a/NotchBuddy/NotchBuddy.xcodeproj/project.pbxproj
+++ b/NotchBuddy/NotchBuddy.xcodeproj/project.pbxproj
@@ -34,6 +34,7 @@
4F1E0B3C838DA3CD6F864BC0 /* CalcomPoller.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3104222B3F17BA5E8DEA5277 /* CalcomPoller.swift */; };
56BE8C733F10A030A638FB60 /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C1A7D5CBE2AC084A10C5FF3 /* SettingsView.swift */; };
5B9A00AFB0837731FA678E4E /* IslandStateMachine.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8212018F09EA1E96FBD63CD /* IslandStateMachine.swift */; };
+ 5C6D0BC8C546718CAA82BF90 /* MusicController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4F142FB3952B5F0639383047 /* MusicController.swift */; };
60E361FFE84C387E5E3ED1AA /* SoundEngine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BE21C2B315D37AA70ED45E9 /* SoundEngine.swift */; };
61CB7049490F61CFA1B36B64 /* AppLog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F6D7015D6A77AA59323C0E7 /* AppLog.swift */; };
61F73B27A7E3AFF584B2CC22 /* AppState.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2E4F18AA940EFF7E047B9F7 /* AppState.swift */; };
@@ -47,6 +48,7 @@
8C32A0C3EAF536D3836F61D5 /* GreetingCanvasView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C581F7B1A9F14B281B60063E /* GreetingCanvasView.swift */; };
8D1C01F283FA7806119A1C85 /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C1A7D5CBE2AC084A10C5FF3 /* SettingsView.swift */; };
967B525F7D3837F31D740D18 /* ResendPoller.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61B5FDDE03F5F711146937E2 /* ResendPoller.swift */; };
+ 9C653B8291EFFA414565E8A8 /* MusicController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4F142FB3952B5F0639383047 /* MusicController.swift */; };
9DD56C95ECABDDCE23652D50 /* HookServer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79D8DD79C3DD9BBC584B3CB2 /* HookServer.swift */; };
B3EC9CF3C8BD629C3530E8F1 /* sounds in Resources */ = {isa = PBXBuildFile; fileRef = C066E2B991AA4F56B2724263 /* sounds */; };
B605F976F4141435F27CF266 /* IslandRootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15A1A8206F73376F4CAF2057 /* IslandRootView.swift */; };
@@ -82,6 +84,7 @@
3232F258523DD8D09B670363 /* FileDropView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileDropView.swift; sourceTree = "<group>"; };
3B6A38B5686C4A1F15AB5D29 /* PillCatalog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PillCatalog.swift; sourceTree = "<group>"; };
4DC2A07E42245A8CF3BBD2AB /* CoucouAppStore.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CoucouAppStore.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 4F142FB3952B5F0639383047 /* MusicController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MusicController.swift; sourceTree = "<group>"; };
506824380E9C80B9BC6DCE72 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
61B5FDDE03F5F711146937E2 /* ResendPoller.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResendPoller.swift; sourceTree = "<group>"; };
6FD65943C32E150F1CD65C31 /* UploadSequenceEngine.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UploadSequenceEngine.swift; sourceTree = "<group>"; };
@@ -131,6 +134,7 @@
8D3CE3617E9D336DDBA10F7A /* IslandTypes.swift */,
FA02B08886939FF6FE0475DD /* IslandViewContent.swift */,
D710BD7834228045869D0184 /* IslandWindowController.swift */,
+ 4F142FB3952B5F0639383047 /* MusicController.swift */,
B89DA1A0C21AE3535A1760BB /* N8nPoller.swift */,
F1BD8F3CAA60CF37640759E1 /* NotchBuddyApp.swift */,
BE03E03D1804B0B92C5C2DAD /* NotionPoller.swift */,
@@ -303,6 +307,7 @@
3F19756A396F125EC711247F /* IslandTypes.swift in Sources */,
065FCE817315454DE3F85F25 /* IslandViewContent.swift in Sources */,
091EC3B2F1060D7EE1317E4E /* IslandWindowController.swift in Sources */,
+ 5C6D0BC8C546718CAA82BF90 /* MusicController.swift in Sources */,
0A267EE2955C7AD8E02A296C /* N8nPoller.swift in Sources */,
06BF5FD95E03010CAFDBF2D0 /* NotchBuddyApp.swift in Sources */,
2F36E3C6C073E968A682AFA4 /* NotionPoller.swift in Sources */,
@@ -340,6 +345,7 @@
D82E93014C8087AE81511E40 /* IslandTypes.swift in Sources */,
68A950E3C23FD612639D9776 /* IslandViewContent.swift in Sources */,
C61DDE2EC5FDDB39E4AA3B34 /* IslandWindowController.swift in Sources */,
+ 9C653B8291EFFA414565E8A8 /* MusicController.swift in Sources */,
160EDB9D06275E2607DA5151 /* N8nPoller.swift in Sources */,
DE05D09A32117582AC93A24A /* NotchBuddyApp.swift in Sources */,
78FCEDC8F78B683AB10E6529 /* NotionPoller.swift in Sources */,
diff --git a/NotchBuddy/Resources/Info.plist b/NotchBuddy/Resources/Info.plist
index 4a6e788f..2eb7fa8c 100644
--- a/NotchBuddy/Resources/Info.plist
+++ b/NotchBuddy/Resources/Info.plist
@@ -25,7 +25,7 @@
<key>NSAccessibilityUsageDescription</key>
<string>Pour lire le titre de la fenêtre active et l'attacher comme contexte.</string>
<key>NSAppleEventsUsageDescription</key>
- <string>Pour sauter au terminal et envoyer des mails.</string>
+ <string>Pour sauter au terminal, envoyer des mails et piloter Musique.</string>
<key>NSHighResolutionCapable</key>
<true/>
<key>NSSupportsAutomaticGraphicsSwitching</key>
diff --git a/NotchBuddy/Sources/App/AppDelegate.swift b/NotchBuddy/Sources/App/AppDelegate.swift
index f94af2bd..610d0e55 100644
--- a/NotchBuddy/Sources/App/AppDelegate.swift
+++ b/NotchBuddy/Sources/App/AppDelegate.swift
@@ -98,5 +98,8 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
NotionPoller.shared.start()
NotificationCenter.default.addObserver(self, selector: #selector(openSettings),
name: .openFullSettings, object: nil)
+ #if !APPSTORE
+ _ = MusicController.shared
+ #endif
}
}
diff --git a/NotchBuddy/Sources/App/AppState.swift b/NotchBuddy/Sources/App/AppState.swift
index 2ac8e1bf..0d0619c7 100644
--- a/NotchBuddy/Sources/App/AppState.swift
+++ b/NotchBuddy/Sources/App/AppState.swift
@@ -239,6 +239,11 @@ final class AppState: ObservableObject {
// Pending approval request from Claude Code hook
@Published var pendingApproval: ApprovalInfo? = nil
+ #if !APPSTORE
+ @Published var musicPlaying: Bool = false
+ @Published var musicAutomationDenied: Bool = false
+ #endif
+
// MARK: - Init (loads persisted settings)
private init() {
diff --git a/NotchBuddy/Sources/App/BotCanvasView.swift b/NotchBuddy/Sources/App/BotCanvasView.swift
index 866bda8e..050d47af 100644
--- a/NotchBuddy/Sources/App/BotCanvasView.swift
+++ b/NotchBuddy/Sources/App/BotCanvasView.swift
@@ -31,10 +31,28 @@ struct BotCanvasView: View {
engine.bodyColor = (state.focusTask?.isIntegration == true)
? cgColorFromHex(state.focusTask!.color)
: nil
+
+ // Compute shouldDance per-frame (no observer lag)
+ let dancing: Bool = {
+ #if !APPSTORE
+ guard AppState.shared.musicPlaying else { return false }
+ guard AppState.shared.activeIntegrations.contains("integration_music") else { return false }
+ let allowed: Set<BotState> = [.idle, .working, .thinking, .searching, .finished]
+ guard allowed.contains(state.effectiveState) else { return false }
+ if state.mode == .compact { return true }
+ return state.mode == .expanded && state.view == .overview && state.focusId == "integration_music"
+ #else
+ return false
+ #endif
+ }()
+ engine.setDancing(dancing)
+
engine.update(dt: dt)
- engine.drawHandsBehind(context: context, size: size)
- engine.draw(context: context, size: size)
- engine.drawHandsAndExtras(context: context, size: size)
+ var ctx = context
+ engine.applyDance(&ctx, size: size)
+ engine.drawHandsBehind(context: ctx, size: size)
+ engine.draw(context: ctx, size: size)
+ engine.drawHandsAndExtras(context: ctx, size: size)
}
}
.onChange(of: state.effectiveState) { _, newState in
@@ -121,10 +139,12 @@ struct BotCanvasView: View {
/// Mini bot canvas (for agent pills/column)
struct MiniBotCanvasView: View {
let task: AgentTask
+ var isDancing: Bool = false
@StateObject private var engine: BotEngine
- init(task: AgentTask) {
+ init(task: AgentTask, isDancing: Bool = false) {
self.task = task
+ self.isDancing = isDancing
_engine = StateObject(wrappedValue: {
let e = BotEngine()
e.isMini = true
@@ -138,8 +158,11 @@ struct MiniBotCanvasView: View {
Canvas { context, size in
let now = timeline.date.timeIntervalSinceReferenceDate
let dt = min(0.05, now - engine.lastTime)
+ engine.setDancing(isDancing)
engine.update(dt: dt)
- engine.draw(context: context, size: size)
+ var ctx = context
+ engine.applyDance(&ctx, size: size)
+ engine.draw(context: ctx, size: size)
}
}
.onChange(of: task.state) { _, newState in
diff --git a/NotchBuddy/Sources/App/BotEngine.swift b/NotchBuddy/Sources/App/BotEngine.swift
index 3ff297fc..da21a138 100644
--- a/NotchBuddy/Sources/App/BotEngine.swift
+++ b/NotchBuddy/Sources/App/BotEngine.swift
@@ -249,6 +249,10 @@ final class BotEngine: ObservableObject {
// Slap tracking (for dizzy on 3 slaps)
var slapTimes: [Double] = []
+ // Dancing (Apple Music)
+ var isDancing: Bool = false
+ var dancingLevel: CGFloat = 0 // 0→1 over 0.3s, 1→0 over 0.5s
+
// Mini wandering look (random, ignores mouse)
var miniLookTarget: CGPoint = .zero
var miniLookNextTime: Double = 0
@@ -379,6 +383,13 @@ final class BotEngine: ObservableObject {
}
}
+ // MARK: - Dancing
+
+ func setDancing(_ dancing: Bool) {
+ guard isDancing != dancing else { return }
+ isDancing = dancing
+ }
+
// MARK: - Mini periodic behavior loop
func doMiniBehaviorLoop() {
@@ -777,9 +788,34 @@ final class BotEngine: ObservableObject {
slotHVel += slotAcc * dtCG
slotH = max(0, slotH + slotHVel * dtCG)
+ // Dance level: fade in 0.3s, out 0.5s
+ let dancingTarget: CGFloat = isDancing ? 1 : 0
+ if dancingLevel < dancingTarget {
+ dancingLevel = min(dancingTarget, dancingLevel + CGFloat(dt) / 0.3)
+ } else if dancingLevel > dancingTarget {
+ dancingLevel = max(dancingTarget, dancingLevel - CGFloat(dt) / 0.5)
+ }
+
lastTime = now
}
+ // MARK: - Dance transform
+
+ /// Applies a 112-BPM dance bounce/sway around the bottom of the body.
+ /// Call this on a copy of the GraphicsContext before the three draw passes.
+ func applyDance(_ ctx: inout GraphicsContext, size: CGSize) {
+ guard dancingLevel > 0.001 else { return }
+ let W = size.width, H = size.height, R = W * 0.3
+ let px = W / 2 + ox * R
+ let py = H / 2 + particleOverhang / 2 + oy * R + R * 0.06 + R * 0.88
+ let beat = CGFloat(CACurrentMediaTime()) * 112 / 60
+ let hop = abs(sin(.pi * beat)), land = pow(1 - hop, 6), l = dancingLevel
+ ctx.translateBy(x: px + 0.08 * R * sin(.pi * beat) * l, y: py - 0.20 * R * hop * l)
+ ctx.rotate(by: .radians(0.10 * sin(.pi * beat) * l))
+ ctx.scaleBy(x: 1 + 0.045 * land * l, y: 1 - 0.06 * land * l)
+ ctx.translateBy(x: -px, y: -py)
+ }
+
// MARK: - Draw
func draw(context: GraphicsContext, size: CGSize) {
@@ -1112,6 +1148,10 @@ final class BotEngine: ObservableObject {
private func drawEyes(ctx: inout GraphicsContext, path: Path, R: CGFloat, rx: CGFloat, ry: CGFloat) {
var shape = eyeOverride ?? cfg.eye
+ // Dance: happy eyes in calm states
+ if isDancing && dancingLevel > 0.15 && !isMini && (state == .idle || state == .finished) {
+ shape = .happy
+ }
// In box mode: cup eyes when file over box (slotHTarget set), happy arcs while chewing
if morph > 0.5 {
if isChewing { shape = .happy }
diff --git a/NotchBuddy/Sources/App/IslandViewContent.swift b/NotchBuddy/Sources/App/IslandViewContent.swift
index 87d1d1d3..17b5f150 100644
--- a/NotchBuddy/Sources/App/IslandViewContent.swift
+++ b/NotchBuddy/Sources/App/IslandViewContent.swift
@@ -175,6 +175,10 @@ struct OverviewView: View {
switchChatProvider(.google)
case "ai_openai":
switchChatProvider(.openai)
+ case "integration_music":
+ #if !APPSTORE
+ MusicController.shared.openMusic()
+ #endif
default:
// Non-integration real tasks
if task.source == .n8n {
@@ -1180,6 +1184,12 @@ struct IntegrationCardView: View {
#endif
case "agent_cursor", "agent_codex":
return false // coming soon
+ case "integration_music":
+ #if !APPSTORE
+ return true // Apple Music is always installed on macOS
+ #else
+ return false
+ #endif
case "ai_anthropic": return KeychainStore.shared.get("anthropic-api-key") != nil
case "ai_google": return KeychainStore.shared.get("google-api-key") != nil
case "ai_openai": return KeychainStore.shared.get("openai-api-key") != nil
@@ -1253,7 +1263,24 @@ struct IntegrationCardView: View {
task.id == "integration_notion" && appState.notionLoaded
}
+ // Apple Music: show card when a track is loaded (playing or paused) or automation is denied
+ private var musicIsActive: Bool {
+ #if !APPSTORE
+ guard task.id == "integration_music" else { return false }
+ if appState.musicAutomationDenied { return true }
+ return MusicController.shared.trackTitle != nil
+ #else
+ return false
+ #endif
+ }
+
private var statusDot: Color {
+ #if !APPSTORE
+ if task.id == "integration_music" {
+ if appState.musicAutomationDenied { return Color(hex: "#F4505E") }
+ return appState.musicPlaying ? Color(hex: "#FA2D48") : Color(hex: "#22C55E")
+ }
+ #endif
if PillCatalog.definition(for: task.id)?.comingSoon == true { return Color(hex: "#6B7079") }
let svcErr = task.id == "integration_stripe" ? appState.stripeError
: task.id == "integration_calcom" ? appState.calcomError
@@ -1263,6 +1290,13 @@ struct IntegrationCardView: View {
}
private var statusLabel: String {
+ #if !APPSTORE
+ if task.id == "integration_music" {
+ if appState.musicAutomationDenied { return "Automation not allowed" }
+ if appState.musicPlaying { return "Playing · \(MusicController.shared.trackTitle ?? "Unknown")" }
+ return "Not playing"
+ }
+ #endif
if PillCatalog.definition(for: task.id)?.comingSoon == true { return "Coming soon" }
let svcErr = task.id == "integration_stripe" ? appState.stripeError
: task.id == "integration_calcom" ? appState.calcomError
@@ -1316,6 +1350,11 @@ struct IntegrationCardView: View {
} else if notionHasData {
NotionCardView()
.transition(.opacity)
+ } else if musicIsActive {
+ #if !APPSTORE
+ MusicCardView()
+ .transition(.opacity)
+ #endif
} else if agentSessionActive {
// Active session view — reuse overview layout
VStack(alignment: .leading, spacing: 0) {
@@ -1423,6 +1462,19 @@ struct IntegrationCardView: View {
.foregroundColor(Color(hex: task.color).opacity(0.85))
.buttonStyle(.plain)
}
+ } else if task.id == "integration_music" {
+ #if !APPSTORE
+ Button("Open Music") { MusicController.shared.openMusic() }
+ .font(.system(size: 11, weight: .medium))
+ .foregroundColor(Color(hex: task.color).opacity(0.85))
+ .buttonStyle(.plain)
+ if appState.musicAutomationDenied {
+ Button("Open Settings…") { MusicController.shared.openAutomationSettings() }
+ .font(.system(size: 11))
+ .foregroundColor(Color(hex: "#8E939C"))
+ .buttonStyle(.plain)
+ }
+ #endif
} else if n8nHasActivity {
// Clickable pill — tap to open execution detail
let success = task.state == .finished
@@ -1464,10 +1516,11 @@ struct IntegrationCardView: View {
.foregroundColor(Color(hex: "#C9956A").opacity(0.85))
.buttonStyle(.plain)
}
- // Settings button: shown when not configured, except cursor/codex (coming soon)
+ // Settings button: shown when not configured, except cursor/codex and music
if !isConfigured
&& task.id != "agent_cursor"
- && task.id != "agent_codex" {
+ && task.id != "agent_codex"
+ && task.id != "integration_music" {
Button("Settings…") {
NotificationCenter.default.post(name: .openFullSettings, object: nil)
}
@@ -2532,12 +2585,30 @@ struct AgentPillsView: View {
Spacer(minLength: 0)
LazyVGrid(columns: columns, spacing: 4) {
ForEach(displayTasks) { task in
+ #if !APPSTORE
+ if task.id == "integration_music" {
+ MusicPill(task: task, state: state, swapping: $swapping) {
+ swapping = true
+ state.setFocus(task.id)
+ SoundEngine.shared.play("blip")
+ DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { swapping = false }
+ }
+ } else {
+ AgentPill(task: task, state: state, swapping: $swapping) {
+ swapping = true
+ state.setFocus(task.id)
+ SoundEngine.shared.play("blip")
+ DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { swapping = false }
+ }
+ }
+ #else
AgentPill(task: task, state: state, swapping: $swapping) {
swapping = true
state.setFocus(task.id)
SoundEngine.shared.play("blip")
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { swapping = false }
}
+ #endif
}
}
.padding(.horizontal, 8)
@@ -2606,6 +2677,183 @@ struct AgentPill: View {
}
}
+// MARK: - Music Pill (GitHub build only)
+
+#if !APPSTORE
+struct MusicPill: View {
+ let task: AgentTask
+ @ObservedObject var state: AppState
+ @Binding var swapping: Bool
+ let onTap: () -> Void
+ @State private var isHovered = false
+
+ private var isPlaying: Bool { AppState.shared.musicPlaying }
+
+ var body: some View {
+ ZStack(alignment: .topTrailing) {
+ Button(action: { onTap() }) {
+ ZStack {
+ Capsule()
+ .fill(isHovered
+ ? Color(hex: task.color).opacity(0.18)
+ : Color(hex: "#0E0F11"))
+ Capsule()
+ .stroke(Color(hex: task.color).opacity(isHovered ? 0.55 : 0.14), lineWidth: 1)
+ HStack(spacing: 0) {
+ MiniBotCanvasView(task: task, isDancing: isPlaying)
+ .frame(width: 22 / 0.6, height: 22 / 0.6)
+ .frame(width: 22, height: 22, alignment: .center)
+ .padding(.leading, 8)
+ Spacer()
+ }
+ Text(task.name)
+ .font(.system(size: 10, weight: .semibold))
+ .foregroundColor(isHovered
+ ? Color(hex: task.color).lighter(by: 0.3)
+ : Color(hex: "#6B7079"))
+ .lineLimit(1)
+ .truncationMode(.tail)
+ .padding(.leading, 34)
+ .padding(.trailing, 10)
+ .frame(maxWidth: .infinity, alignment: .center)
+ }
+ .frame(maxWidth: .infinity)
+ .frame(height: 28)
+ .shadow(color: Color(hex: task.color).opacity(isHovered ? 0.35 : 0), radius: 10, x: 0, y: 2)
+ }
+ .buttonStyle(.plain)
+ .scaleEffect(isHovered ? 1.04 : 1.0)
+ .brightness(isHovered ? 0.06 : 0)
+ .onHover { newHover in
+ guard !swapping else { return }
+ withAnimation(.spring(response: 0.2, dampingFraction: 0.7)) { isHovered = newHover }
+ }
+
+ // Playback controls — shown when Music is running and a track is loaded
+ if MusicController.shared.trackTitle != nil {
+ HStack(spacing: 2) {
+ Button(action: { MusicController.shared.playPause() }) {
+ ZStack {
+ Circle().fill(Color(hex: "#0B0C0E")).frame(width: 16, height: 16)
+ Circle().fill(Color(hex: task.color)).frame(width: 14, height: 14)
+ Image(systemName: isPlaying ? "pause.fill" : "play.fill")
+ .font(.system(size: 7, weight: .bold))
+ .foregroundColor(.black)
+ }
+ }
+ .buttonStyle(.plain)
+ Button(action: { MusicController.shared.nextTrack() }) {
+ ZStack {
+ Circle().fill(Color(hex: "#0B0C0E")).frame(width: 16, height: 16)
+ Circle().fill(Color(hex: task.color)).frame(width: 14, height: 14)
+ Image(systemName: "forward.fill")
+ .font(.system(size: 7, weight: .bold))
+ .foregroundColor(.black)
+ }
+ }
+ .buttonStyle(.plain)
+ }
+ .offset(x: 3, y: -3)
+ }
+ }
+ }
+}
+#endif
+
+// MARK: - Music Card View (GitHub build only)
+
+#if !APPSTORE
+struct MusicCardView: View {
+ @ObservedObject private var controller = MusicController.shared
+ @ObservedObject private var appState = AppState.shared
+
+ var body: some View {
+ VStack(alignment: .leading, spacing: 4) {
+ if appState.musicAutomationDenied {
+ // Automation denied — prompt user to fix
+ HStack(spacing: 6) {
+ Circle()
+ .fill(Color(hex: "#F4505E"))
+ .frame(width: 7, height: 7)
+ Text("Apple Music")
+ .font(.system(size: 12, weight: .semibold))
+ .foregroundColor(Color(hex: "#F5F6F8"))
+ Spacer(minLength: 2)
+ }
+ .padding(.top, 6)
+ .padding(.leading, 108)
+ .padding(.trailing, 36)
+
+ Text("Allow Coucou to control Music")
+ .font(.system(size: 11))
+ .foregroundColor(Color(hex: "#8E939C"))
+ .padding(.leading, 108)
+ .padding(.trailing, 12)
+
+ Button("Open Settings…") { MusicController.shared.openAutomationSettings() }
+ .font(.system(size: 11, weight: .medium))
+ .foregroundColor(Color(hex: "#FA2D48").opacity(0.85))
+ .buttonStyle(.plain)
+ .padding(.leading, 108)
+ .padding(.top, 2)
+ } else {
+ // Line 1: dot + title
+ HStack(spacing: 6) {
+ Circle()
+ .fill(Color(hex: "#FA2D48"))
+ .frame(width: 7, height: 7)
+ if let title = controller.trackTitle {
+ Text(title)
+ .font(.system(size: 12, weight: .semibold))
+ .foregroundColor(Color(hex: "#F5F6F8"))
+ .lineLimit(1).truncationMode(.tail)
+ .frame(maxWidth: 150, alignment: .leading)
+ }
+ }
+ .padding(.top, 6)
+ .padding(.leading, 108)
+
+ // Line 2: artist
+ if let artist = controller.artist {
+ Text(artist)
+ .font(.system(size: 11))
+ .foregroundColor(Color(hex: "#8E939C"))
+ .lineLimit(1).truncationMode(.tail)
+ .frame(maxWidth: 150, alignment: .leading)
+ .padding(.leading, 108)
+ }
+
+ // Line 3: controls
+ HStack(spacing: 8) {
+ Button(action: { MusicController.shared.previousTrack() }) {
+ Image(systemName: "backward.fill")
+ .font(.system(size: 11))
+ .foregroundColor(Color(hex: "#8E939C"))
+ }
+ .buttonStyle(.plain)
+ Button(action: { MusicController.shared.playPause() }) {
+ Image(systemName: appState.musicPlaying ? "pause.fill" : "play.fill")
+ .font(.system(size: 11))
+ .foregroundColor(Color(hex: "#FA2D48"))
+ }
+ .buttonStyle(.plain)
+ Button(action: { MusicController.shared.nextTrack() }) {
+ Image(systemName: "forward.fill")
+ .font(.system(size: 11))
+ .foregroundColor(Color(hex: "#8E939C"))
+ }
+ .buttonStyle(.plain)
+ }
+ .padding(.leading, 108)
+ .padding(.top, 6)
+ }
+ }
+ .frame(maxWidth: .infinity, alignment: .topLeading)
+ .padding(.top, 4)
+ }
+}
+#endif
+
struct PillBadgeView: View {
let badge: PillBadge
let taskColor: String
diff --git a/NotchBuddy/Sources/App/IslandWindowController.swift b/NotchBuddy/Sources/App/IslandWindowController.swift
index 122ecfd1..7c48579b 100644
--- a/NotchBuddy/Sources/App/IslandWindowController.swift
+++ b/NotchBuddy/Sources/App/IslandWindowController.swift
@@ -19,6 +19,9 @@ final class IslandWindowController: NSWindowController {
// Confused recovery timer (set by handleDizzy)
private var confusedRecoveryTimer: DispatchWorkItem?
+ // Suppress peek sound on next reveal (e.g. musicReveal)
+ var silentNextReveal = false
+
// Finished-pin timer
private var finishedPinTimer: DispatchWorkItem?
@@ -164,7 +167,11 @@ final class IslandWindowController: NSWindowController {
// Fire interrupt first so canvas collapse starts before mode change
NotificationCenter.default.post(name: .greetingInterrupt, object: nil)
} else if from == .hidden {
- SoundEngine.shared.play("peek")
+ if self.silentNextReveal {
+ self.silentNextReveal = false
+ } else {
+ SoundEngine.shared.play("peek")
+ }
}
// setMode BEFORE changing view: onChange(of: state.view) guards on .expanded,
// so setting view while already compact won't trigger a spurious open animation.
@@ -385,6 +392,14 @@ final class IslandWindowController: NSWindowController {
self.fsm.reveal()
}
+ // Music started playing: reveal silently (no peek sound)
+ NotificationCenter.default.addObserver(forName: .musicReveal, object: nil, queue: .main) { [weak self] _ in
+ guard let self else { return }
+ self.silentNextReveal = true
+ self.fsm.reveal()
+ self.silentNextReveal = false
+ }
+
// Collapse requests from views (OK button, etc.)
NotificationCenter.default.addObserver(forName: .islandCollapse, object: nil, queue: .main) { [weak self] _ in
self?.collapse()
@@ -863,6 +878,7 @@ extension Notification.Name {
static let islandCollapse = Notification.Name("notchBuddy.islandCollapse")
static let openFullSettings = Notification.Name("notchBuddy.openFullSettings")
static let hookReveal = Notification.Name("notchBuddy.hookReveal")
+ static let musicReveal = Notification.Name("notchBuddy.musicReveal")
// Greeting ↔ IslandWindowController
static let greetComplete = Notification.Name("notchBuddy.greetComplete")
static let greetingHover = Notification.Name("notchBuddy.greetingHover")
diff --git a/NotchBuddy/Sources/App/MusicController.swift b/NotchBuddy/Sources/App/MusicController.swift
new file mode 100644
index 00000000..3578e382
--- /dev/null
+++ b/NotchBuddy/Sources/App/MusicController.swift
@@ -0,0 +1,279 @@
+#if !APPSTORE
+import Foundation
+import AppKit
+import Combine
+
+// MARK: - Music Controller
+
+/// Observes Apple Music state via distributed notifications and provides playback controls.
+/// Singleton, @MainActor, GitHub build only.
+@MainActor
+final class MusicController: ObservableObject {
+ static let shared = MusicController()
+
+ @Published var trackTitle: String?
+ @Published var artist: String?
+ @Published var album: String?
+
+ private var notifTokens: [Any] = []
+ private var cancellables = Set<AnyCancellable>()
+ private let queue = DispatchQueue(label: "fr.louisraille.coucou.music")
+
+ private var isPillActive: Bool {
+ AppState.shared.activeIntegrations.contains("integration_music")
+ }
+
+ private init() {
+ // playerInfo fires whenever Music state changes (play/pause/track change).
+ // Extract Sendable String? values before crossing into @MainActor.
+ let tok1 = DistributedNotificationCenter.default().addObserver(
+ forName: NSNotification.Name("com.apple.Music.playerInfo"),
+ object: nil,
+ queue: .main
+ ) { [weak self] notif in
+ let info = notif.userInfo
+ let playerState = info?["Player State"] as? String
+ let name = info?["Name"] as? String
+ let artist = info?["Artist"] as? String
+ let album = info?["Album"] as? String
+ Task { @MainActor [weak self] in
+ self?.handlePlayerInfo(playerState: playerState, name: name, artist: artist, album: album)
+ }
+ }
+ notifTokens.append(tok1)
+
+ // Track Music launch — read current state only if granted and pill active
+ let tok2 = NSWorkspace.shared.notificationCenter.addObserver(
+ forName: NSWorkspace.didLaunchApplicationNotification,
+ object: nil,
+ queue: .main
+ ) { [weak self] notif in
+ let bundleId = (notif.userInfo?[NSWorkspace.applicationUserInfoKey]
+ as? NSRunningApplication)?.bundleIdentifier
+ guard bundleId == "com.apple.Music" else { return }
+ Task { @MainActor [weak self] in
+ guard let self else { return }
+ guard self.isPillActive,
+ UserDefaults.standard.bool(forKey: "coucou.musicAutomationGranted") else { return }
+ self.fetchAndApply()
+ }
+ }
+ notifTokens.append(tok2)
+
+ // Clear state when Music quits
+ let tok3 = NSWorkspace.shared.notificationCenter.addObserver(
+ forName: NSWorkspace.didTerminateApplicationNotification,
+ object: nil,
+ queue: .main
+ ) { [weak self] notif in
+ let bundleId = (notif.userInfo?[NSWorkspace.applicationUserInfoKey]
+ as? NSRunningApplication)?.bundleIdentifier
+ guard bundleId == "com.apple.Music" else { return }
+ Task { @MainActor [weak self] in self?.clearState() }
+ }
+ notifTokens.append(tok3)
+
+ // Observe activeIntegrations — pill activated → initial read; deactivated → clear
+ AppState.shared.$activeIntegrations
+ .sink { [weak self] integrations in
+ guard let self else { return }
+ if integrations.contains("integration_music") {
+ if self.isMusicRunning(),
+ UserDefaults.standard.bool(forKey: "coucou.musicAutomationGranted") {
+ self.fetchAndApply()
+ }
+ } else {
+ self.clearState()
+ }
+ }
+ .store(in: &cancellables)
+ }
+
+ // MARK: - Private helpers
+
+ private func isMusicRunning() -> Bool {
+ NSWorkspace.shared.runningApplications.contains { $0.bundleIdentifier == "com.apple.Music" }
+ }
+
+ // MARK: - Metadata cleaners
+
+ private static func shortTitle(_ raw: String) -> String {
+ guard !raw.isEmpty else { return raw }
+ var s = raw
+ // Cut at first " - "
+ if let r = s.range(of: " - ") {
+ s = String(s[..<r.lowerBound])
+ }
+ // Strip trailing (...) or [...] groups repeatedly
+ var changed = true
+ while changed {
+ changed = false
+ let t = s.trimmingCharacters(in: .whitespaces)
+ guard let last = t.last, (last == ")" || last == "]") else { break }
+ let open: Character = last == ")" ? "(" : "["
+ if let idx = t.lastIndex(of: open) {
+ let candidate = String(t[..<idx]).trimmingCharacters(in: .whitespaces)
+ if !candidate.isEmpty { s = candidate; changed = true }
+ } else { break }
+ }
+ let result = s.trimmingCharacters(in: .whitespaces)
+ return result.isEmpty ? raw : result
+ }
+
+ private static func shortArtist(_ raw: String) -> String {
+ guard !raw.isEmpty else { return raw }
+ let lower = raw.lowercased()
+ for tag in [" feat.", " ft."] {
+ if let r = lower.range(of: tag) {
+ let result = String(raw[..<r.lowerBound]).trimmingCharacters(in: .whitespaces)
+ return result.isEmpty ? raw : result
+ }
+ }
+ return raw
+ }
+
+ private func handlePlayerInfo(playerState: String?, name: String?, artist inputArtist: String?, album inputAlbum: String?) {
+ guard isPillActive else { return }
+
+ let playing = playerState == "Playing"
+ let wasPlaying = AppState.shared.musicPlaying
+
+ trackTitle = name.map { Self.shortTitle($0) }.flatMap { $0.isEmpty ? nil : $0 }
+ artist = inputArtist.map { Self.shortArtist($0) }.flatMap { $0.isEmpty ? nil : $0 }
+ album = inputAlbum
+
+ AppState.shared.musicPlaying = playing
+ syncTaskName()
+
+ // Reveal only on transition from not-playing → playing
+ if playing && !wasPlaying {
+ NotificationCenter.default.post(name: .musicReveal, object: nil)
+ }
+ }
+
+ private func fetchAndApply() {
+ Task {
+ let result = await runAppleScript("""
+ tell application id "com.apple.Music"
+ set ps to player state as string
+ if ps is "stopped" then return {ps, "", "", ""}
+ try
+ set tr to current track
+ set n to name of tr
+ on error
+ return {ps, "", "", ""}
+ end try
+ set ar to ""
+ set al to ""
+ try
+ set ar to artist of tr
+ end try
+ try
+ set al to album of tr
+ end try
+ return {ps, n, ar, al}
+ end tell
+ """)
+ guard case .success(let values) = result, values.count >= 4 else { return }
+ let playing = values[0] == "playing"
+ let wasPlaying = AppState.shared.musicPlaying
+ trackTitle = values[1].isEmpty ? nil : Self.shortTitle(values[1])
+ artist = values[2].isEmpty ? nil : Self.shortArtist(values[2])
+ album = values[3].isEmpty ? nil : values[3]
+ AppState.shared.musicPlaying = playing
+ syncTaskName()
+ if playing && !wasPlaying {
+ NotificationCenter.default.post(name: .musicReveal, object: nil)
+ }
+ }
+ }
+
+ private func clearState() {
+ trackTitle = nil; artist = nil; album = nil
+ AppState.shared.musicPlaying = false
+ syncTaskName()
+ }
+
+ private func syncTaskName() {
+ guard let idx = AppState.shared.tasks.firstIndex(where: { $0.id == "integration_music" }) else { return }
+ let title = trackTitle ?? ""
+ AppState.shared.tasks[idx].name = title.isEmpty
+ ? (PillCatalog.definition(for: "integration_music")?.name ?? "Apple Music")
+ : title
+ }
+
+ // MARK: - Playback controls
+
+ func playPause() {
+ guard isMusicRunning() else { return }
+ Task { await runAppleScript(#"tell application id "com.apple.Music" to playpause"#) }
+ }
+
+ func nextTrack() {
+ guard isMusicRunning() else { return }
+ Task { await runAppleScript(#"tell application id "com.apple.Music" to next track"#) }
+ }
+
+ func previousTrack() {
+ guard isMusicRunning() else { return }
+ Task { await runAppleScript(#"tell application id "com.apple.Music" to back track"#) }
+ }
+
+ func openMusic() {
+ if let app = NSWorkspace.shared.runningApplications.first(where: { $0.bundleIdentifier == "com.apple.Music" }) {
+ app.activate(options: .activateIgnoringOtherApps)
+ } else {
+ NSWorkspace.shared.open(URL(fileURLWithPath: "/System/Applications/Music.app"))
+ }
+ }
+
+ func openAutomationSettings() {
+ if let url = URL(string: "x-apple.systempreferences:com.apple.preference.security?Privacy_Automation") {
+ NSWorkspace.shared.open(url)
+ }
+ }
+
+ // MARK: - AppleScript runner
+
+ enum ScriptResult { case success([String]), denied, error }
+
+ @discardableResult
+ private func runAppleScript(_ source: String) async -> ScriptResult {
+ await withCheckedContinuation { cont in
+ queue.async {
+ let script = NSAppleScript(source: source)!
+ var errDict: NSDictionary?
+ let desc = script.executeAndReturnError(&errDict)
+ if let errDict {
+ let code = (errDict[NSAppleScript.errorNumber] as? Int) ?? 0
+ if code == -1743 {
+ Task { @MainActor in
+ AppState.shared.musicAutomationDenied = true
+ UserDefaults.standard.set(false, forKey: "coucou.musicAutomationGranted")
+ }
+ cont.resume(returning: .denied)
+ } else {
+ cont.resume(returning: .error)
+ }
+ return
+ }
+ Task { @MainActor in
+ UserDefaults.standard.set(true, forKey: "coucou.musicAutomationGranted")
+ AppState.shared.musicAutomationDenied = false
+ }
+ // Extract values on this queue before resuming (avoids NSAppleEventDescriptor Sendable issues)
+ var values: [String] = []
+ let count = desc.numberOfItems
+ if count > 0 {
+ for i in 1...count {
+ values.append(desc.atIndex(i)?.stringValue ?? "")
+ }
+ } else {
+ values = [desc.stringValue ?? ""]
+ }
+ cont.resume(returning: .success(values))
+ }
+ }
+ }
+}
+#endif
diff --git a/NotchBuddy/Sources/App/PillCatalog.swift b/NotchBuddy/Sources/App/PillCatalog.swift
index d97f526e..bf4c9c8a 100644
--- a/NotchBuddy/Sources/App/PillCatalog.swift
+++ b/NotchBuddy/Sources/App/PillCatalog.swift
@@ -81,6 +81,8 @@ enum PillCatalog {
category: .service, subtitle: "Integration", source: .n8n),
.init(id: "integration_stripe", name: "Stripe", color: "#0570DE",
category: .service, subtitle: "Integration", source: .n8n),
+ .init(id: "integration_music", name: "Apple Music", color: "#FA2D48",
+ category: .service, subtitle: "Integration", source: .n8n, githubOnly: true),
]
/// Pills available in the current build target.
diff --git a/NotchBuddy/project.yml b/NotchBuddy/project.yml
index 79103761..ed157755 100644
--- a/NotchBuddy/project.yml
+++ b/NotchBuddy/project.yml
@@ -67,7 +67,7 @@ targets:
LSUIElement: YES
NSHighResolutionCapable: YES
NSSupportsAutomaticGraphicsSwitching: YES
- NSAppleEventsUsageDescription: "Pour sauter au terminal et envoyer des mails."
+ NSAppleEventsUsageDescription: "Pour sauter au terminal, envoyer des mails et piloter Musique."
NSAccessibilityUsageDescription: "Pour lire le titre de la fenêtre active et l'attacher comme contexte."
settings:
base:
diff --git a/README.md b/README.md
index 60f2bc23..09985a4c 100644
--- a/README.md
+++ b/README.md
@@ -40,6 +40,7 @@ Meet **Mochi**: a soft little squircle with big eyes that pops out of your notch
- 📎 **Drop a file on the notch** — Mochi turns into a box and swallows it, then ask a question about it or send it by email *(email: macOS, Mail.app)*.
- 🪟 **Drag Mochi onto any window** — attach that window as context for Claude *(macOS)*.
- 🔌 **Integrations** — Stripe payments, n8n workflows, GitHub, Vercel deployments, Resend emails, Notion, Cal.com. Each one gets its own little colored Mochi.
+- 🎵 **Apple Music pill** *(macOS, GitHub build)* — add the Apple Music pill in Settings → Active pills to see what's playing and control playback from the notch; Mochi dances while it plays.
- 🎭 **A real character** — idle breathing, blinks, eyes on a sphere that follow your mouse, emotes, 28 handcrafted sounds, a greeting on launch.
- 🫥 **Invisible when idle** — hides away when nothing is running, peeks out when you hover the notch (the top edge of the screen on Windows and Linux).
- 🖥️ **Any Mac, notch or not** — on an iMac, a Mac mini, or a MacBook with its lid closed on an external display, Mochi sits in a small bar at the top of the screen.
diff --git a/docs/INTEGRATIONS.md b/docs/INTEGRATIONS.md
index c494c2f5..5276b877 100644
--- a/docs/INTEGRATIONS.md
+++ b/docs/INTEGRATIONS.md
@@ -167,6 +167,7 @@ Voir le catalogue de pastilles dans `docs/SPEC.md` (section « Catalogue de past
|---|---|---|
| Automatisation → Mail | envoyer les mails | premier envoi |
| Automatisation → Terminal / iTerm / navigateur | sauter au bon onglet, lire l'URL | première utilisation |
+| Automatisation → Musique *(GitHub only)* | contrôler la lecture Apple Music | première commande depuis le notch |
| Enregistrement de l'écran | capturer la fenêtre attrapée | première attache |
| Micro + Reconnaissance vocale (optionnel) | dictée | premier clic sur le micro |
diff --git a/docs/SPEC.md b/docs/SPEC.md
index 3a0b4c65..1597fc1c 100644
--- a/docs/SPEC.md
+++ b/docs/SPEC.md
@@ -99,7 +99,7 @@ Toutes les pastilles déclarées sont définies dans `PillCatalog.all` (source d
| `workspace` | Where you code | VS Code, Cursor, Antigravity *(GitHub only)*, Codex *(GitHub only)* | Integration | Claude Code / Cursor / Codex / Agent |
| `agent` | Agents | Gemini CLI *(GitHub only)* | Agent | Agent |
| `ai` | AI for the chat | Anthropic, Google AI, OpenAI | Chat | — |
-| `service` | Services | Resend, n8n, Vercel, GitHub, Notion, Cal.com, Stripe | Integration | — |
+| `service` | Services | Resend, n8n, Vercel, GitHub, Notion, Cal.com, Stripe, Apple Music *(GitHub only)* | Integration | — |
Couleurs : Cursor `#C0C4CC`, Codex `#2DD4BF`, Gemini CLI `#8AB4F8`, Antigravity `#E879F9`, pastilles IA = `ChatProvider.accentHex`.
diff --git a/docs/privacy.html b/docs/privacy.html
index 878041a8..02bb1223 100644
--- a/docs/privacy.html
+++ b/docs/privacy.html
@@ -38,19 +38,22 @@
<h2>5. Claude Code, Gemini CLI, Antigravity and Codex hooks</h2>
<p>If you install the Claude Code hooks, Claude Code sends session events to Coucou through a local connection on your computer. If you install the Gemini CLI, Antigravity or Codex hooks, those agents send their session events the same way. These events never leave your computer through Coucou. Before changing any settings file (<code>~/.claude/settings.json</code>, <code>~/.gemini/settings.json</code>, <code>~/.gemini/config/hooks.json</code>, <code>~/.codex/hooks.json</code>), Coucou makes a dated backup and shows you the changes.</p>
-<h2>6. Email</h2>
+<h2>6. Apple Music</h2>
+<p>If you activate the Apple Music pill <i>(macOS, GitHub build)</i>, Coucou reads the current track (title, artist, album) from Music on your Mac to display it in the notch, and only sends play, pause or skip commands to Music when you click. Nothing leaves your computer.</p>
+
+<h2>7. Email</h2>
<p>When you send a file by email, the message is created and sent by your own Mail app. Coucou never sends email by itself.</p>
-<h2>7. System permissions</h2>
-<p>Depending on the version and the features you use, macOS may ask you to allow Automation (Mail, Terminal), Accessibility (to read the title of the window you attach) or Screen Recording (to capture a window you attach). These are only used for the feature you triggered and can be revoked at any time in System Settings → Privacy &amp; Security. The Windows and Linux versions ask for no special permission. On Linux, installing the .deb or .rpm package needs administrator rights; the AppImage doesn't.</p>
+<h2>8. System permissions</h2>
+<p>Depending on the version and the features you use, macOS may ask you to allow Automation (Mail, Terminal, Music), Accessibility (to read the title of the window you attach) or Screen Recording (to capture a window you attach). These are only used for the feature you triggered and can be revoked at any time in System Settings → Privacy &amp; Security. The Windows and Linux versions ask for no special permission. On Linux, installing the .deb or .rpm package needs administrator rights; the AppImage doesn't.</p>
-<h2>8. Children</h2>
+<h2>9. Children</h2>
<p>Coucou is a developer tool and is not directed at children.</p>
-<h2>9. Your rights</h2>
+<h2>10. Your rights</h2>
<p>Since we hold no personal data about you, there is nothing for us to access, correct or delete. For data held by a service you connected, please contact that service. If you live in the EU, you can also contact your data protection authority (in France: the <a href="https://www.cnil.fr">CNIL</a>).</p>
-<h2>10. Changes</h2>
+<h2>11. Changes</h2>
<p>If this policy changes, the new version will be published on this page with a new date.</p>
</section>
@@ -90,19 +93,22 @@
<h2>5. Claude Code, Gemini CLI, Antigravity et Codex</h2>
<p>Si tu installes les hooks Claude Code, Claude Code envoie les événements de session à Coucou par une connexion locale sur ton ordinateur. Si tu installes les hooks Gemini CLI, Antigravity ou Codex, ces agents envoient leurs événements de la même façon. Coucou ne les fait jamais sortir de ton ordinateur. Avant de modifier un fichier de configuration (<code>~/.claude/settings.json</code>, <code>~/.gemini/settings.json</code>, <code>~/.gemini/config/hooks.json</code>, <code>~/.codex/hooks.json</code>), Coucou en fait une sauvegarde datée et te montre les changements.</p>
-<h2>6. E-mail</h2>
+<h2>6. Apple Music</h2>
+<p>Si tu actives la pastille Apple Music <i>(macOS, version GitHub)</i>, Coucou lit le morceau en cours (titre, artiste, album) depuis l’app Musique de ton Mac pour l’afficher dans le notch, et n’envoie lecture, pause ou morceau suivant à Musique que quand tu cliques. Rien ne quitte ton ordinateur.</p>
+
+<h2>7. E-mail</h2>
<p>Quand tu envoies un fichier par e-mail, le message est créé et envoyé par ta propre app Mail. Coucou n’envoie jamais d’e-mail de lui-même.</p>
-<h2>7. Autorisations système</h2>
+<h2>8. Autorisations système</h2>
<p>Selon la version et les fonctions utilisées, macOS peut te demander d’autoriser l’Automatisation (Mail, Terminal), l’Accessibilité (lire le titre de la fenêtre que tu attaches) ou l’Enregistrement de l’écran (capturer une fenêtre que tu attaches). Elles ne servent qu’à la fonction que tu as déclenchée et se retirent à tout moment dans Réglages Système → Confidentialité et sécurité. Les versions Windows et Linux ne demandent aucune autorisation particulière. Sous Linux, l’installation du paquet .deb ou .rpm nécessite des droits administrateur ; l’AppImage non.</p>
-<h2>8. Enfants</h2>
+<h2>9. Enfants</h2>
<p>Coucou est un outil pour développeurs, il ne s’adresse pas aux enfants.</p>
-<h2>9. Tes droits</h2>
+<h2>10. Tes droits</h2>
<p>Le développeur ne détenant aucune donnée personnelle te concernant, il n’y a rien à consulter, corriger ou supprimer de son côté. Pour les données détenues par un service que tu as connecté, contacte ce service. Tu peux aussi saisir la <a href="https://www.cnil.fr">CNIL</a>.</p>
-<h2>10. Modifications</h2>
+<h2>11. Modifications</h2>
<p>En cas de changement, la nouvelle version sera publiée sur cette page avec une nouvelle date.</p>
</section>
<footer>© 2026 Louis Raillé · Coucou is free and open source (MIT) · <a href="https://github.com/Louis-CFM/coucou">GitHub</a> · <a href="privacy.html">Privacy</a> · <a href="terms.html">Terms</a> · <a href="legal.html">Legal notice</a></footer></div></body></html>
diff --git a/docs/support.html b/docs/support.html
index 7b58bce7..4a6a84d8 100644
--- a/docs/support.html
+++ b/docs/support.html
@@ -33,6 +33,10 @@
<p>Yes. Install the Claude Code hooks (<b>Settings → Claude Code → Install hooks</b>). Claude Code started in Cursor's terminal then shows up on the Cursor pill, and its permission requests can be answered from the notch, like in VS Code. Cursor's own agent shows up too when Cursor loads Claude Code's hooks; its requests are still answered in Cursor. Pick Cursor as your Main tool if that's where you code.</p>
<h3>Can I use Coucou with Codex? (macOS, GitHub build)</h3>
<p>Yes. Open <b>Settings → Codex Hooks → Install hooks</b>. Coucou shows you the changes to <code>~/.codex/hooks.json</code> before writing anything. Once installed, open Codex and run <code>/hooks</code>, or open <b>Hooks</b> in Codex's settings, to review and trust the hooks — Codex asks for this once. After that, your Codex sessions show up on the Codex pill, and permission requests show up with <b>Allow</b> and <b>Deny</b> in the notch.</p>
+<h3>Can I use Coucou with Apple Music? (macOS, GitHub build)</h3>
+<p>Yes. Open <b>Settings → Active pills</b> and toggle <b>Apple Music</b> on. The first time you use a playback control from the notch, macOS may ask you to allow Automation for Coucou — click <b>OK</b>. Once granted, the pill shows the current track and lets you play, pause and skip from the notch. Mochi dances while music plays.</p>
+<h3>Apple Music automation was denied</h3>
+<p>Open <b>System Settings → Privacy &amp; Security → Automation</b>, find Coucou and enable the Music checkbox. You can also click <b>Open Settings…</b> in the Apple Music card in the notch, which takes you directly to that setting.</p>
<h3>No sound</h3>
<p>Check the speaker icon in the notch header and the volume in Settings.</p>
<h3>Which model does the chat use?</h3>
@@ -74,6 +78,10 @@
<p>Oui. Installe les hooks Claude Code (<b>Réglages → Claude Code → Install hooks</b>). Claude Code lancé dans le terminal de Cursor apparaît alors sur la pastille Cursor, et tu peux répondre à ses demandes d’autorisation depuis le notch, comme dans VS Code. L’agent de Cursor apparaît aussi quand Cursor charge les hooks de Claude Code ; ses demandes se règlent encore dans Cursor. Choisis Cursor comme outil principal si c’est là que tu codes.</p>
<h3>Puis-je utiliser Coucou avec Codex ? (macOS, version GitHub)</h3>
<p>Oui. Ouvre <b>Réglages → Codex Hooks → Install hooks</b>. Coucou te montre les changements apportés à <code>~/.codex/hooks.json</code> avant d’écrire quoi que ce soit. Une fois les hooks installés, ouvre Codex et tape <code>/hooks</code>, ou ouvre <b>Hooks</b> dans les réglages de l’app, pour les passer en revue et leur faire confiance — Codex ne te le demande qu’une fois. Ensuite, tes sessions Codex apparaissent sur la pastille Codex, et les demandes d’autorisation apparaissent avec <b>Allow</b> et <b>Deny</b> dans le notch.</p>
+<h3>Puis-je utiliser Coucou avec Apple Music ? (macOS, version GitHub)</h3>
+<p>Oui. Ouvre <b>Réglages → Active pills</b> et active <b>Apple Music</b>. La première fois que tu utilises un contrôle de lecture depuis le notch, macOS peut te demander d’autoriser l’Automatisation pour Coucou — clique sur <b>OK</b>. Une fois accordé, la pastille affiche le morceau en cours et te permet de lancer, mettre en pause et passer à la suite depuis le notch. Mochi danse pendant que la musique joue.</p>
+<h3>L’automatisation Apple Music a été refusée</h3>
+<p>Ouvre <b>Réglages Système → Confidentialité et sécurité → Automatisation</b>, trouve Coucou et coche la case Musique. Tu peux aussi cliquer sur <b>Open Settings…</b> dans la carte Apple Music du notch, qui t’y amène directement.</p>
<h3>Pas de son</h3>
<p>Vérifie l’icône haut-parleur dans l’en-tête du notch et le volume dans les Réglages.</p>
<h3>Quel modèle utilise le chat ?</h3>