From 92f91f42254cf49b87f0cb618a959111368acd02 Mon Sep 17 00:00:00 2001 From: Totopo27 <35828647+Totopo27@users.noreply.github.com> Date: Sat, 3 Oct 2026 11:02:22 -0600 Subject: [PATCH] feat(pills): add OpenCode declared pill definition and accent color --- NotchBuddy/Sources/App/IslandViewContent.swift | 4 ++-- NotchBuddy/Sources/App/PillCatalog.swift | 3 +++ docs/AGENTS.md | 2 +- windows/src/island/hooks.ts | 9 +++++++++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/NotchBuddy/Sources/App/IslandViewContent.swift b/NotchBuddy/Sources/App/IslandViewContent.swift index 16163f1fa..a79cfff5d 100644 --- a/NotchBuddy/Sources/App/IslandViewContent.swift +++ b/NotchBuddy/Sources/App/IslandViewContent.swift @@ -201,7 +201,7 @@ struct OverviewView: View { NSWorkspace.shared.openApplication(at: url, configuration: .init(), completionHandler: nil) } #endif - case "agent_gemini", "agent_antigravity": + case "agent_gemini", "agent_antigravity", "agent_opencode": #if !APPSTORE let terminalBundleIds = ["com.apple.Terminal", "com.googlecode.iterm2", "net.kovidgoyal.kitty", "com.mitchellh.ghostty"] @@ -1580,7 +1580,7 @@ struct IntegrationCardView: View { #else return false #endif - case "agent_cursor", "agent_codex": + case "agent_cursor", "agent_codex", "agent_opencode": return false // coming soon case "integration_music": #if !APPSTORE diff --git a/NotchBuddy/Sources/App/PillCatalog.swift b/NotchBuddy/Sources/App/PillCatalog.swift index 530b5ecfa..a29c48e8f 100644 --- a/NotchBuddy/Sources/App/PillCatalog.swift +++ b/NotchBuddy/Sources/App/PillCatalog.swift @@ -37,6 +37,7 @@ struct PillDefinition { case "integration_claude": return "Claude Code" case "agent_cursor": return "Cursor" case "agent_codex": return "Codex" + case "agent_opencode": return "OpenCode" default: return "Agent" } } @@ -56,6 +57,8 @@ enum PillCatalog { category: .workspace, subtitle: "Integration", source: .agent, githubOnly: true), .init(id: "agent_codex", name: "Codex", color: "#2DD4BF", category: .workspace, subtitle: "Integration", source: .agent, githubOnly: true), + .init(id: "agent_opencode", name: "OpenCode", color: "#5EEAD4", + category: .workspace, subtitle: "Integration", source: .agent, githubOnly: true), // ── Agents ─────────────────────────────────────────────────────────── .init(id: "agent_gemini", name: "Gemini CLI", color: "#8AB4F8", category: .agent, subtitle: "Agent", source: .agent, githubOnly: true), diff --git a/docs/AGENTS.md b/docs/AGENTS.md index 055a9afae..6d57a3557 100644 --- a/docs/AGENTS.md +++ b/docs/AGENTS.md @@ -99,7 +99,7 @@ A **declared pill** is a catalog entry (`PillCatalog.swift`) that has been enabl A catalog pill that is not checked in Settings behaves like any other agent: it gets an automatic pill when a session starts, and that pill is removed when the session ends. -The GitHub build exposes Gemini CLI (`agent_gemini`) and Antigravity (`agent_antigravity`) in Settings → Active pills. Cursor (`agent_cursor`) and Codex (`agent_codex`, GitHub build only) are there too — their pills can be declared and set as the main pill; session support is coming in a future version. +The GitHub build exposes Gemini CLI (`agent_gemini`) and Antigravity (`agent_antigravity`) in Settings → Active pills. Cursor (`agent_cursor`), Codex (`agent_codex`), and OpenCode (`agent_opencode`, GitHub build only) are there too — their pills can be declared and set as the main pill; session support is coming in a future version. ## Real-world examples diff --git a/windows/src/island/hooks.ts b/windows/src/island/hooks.ts index d90a78f09..e1d013e84 100644 --- a/windows/src/island/hooks.ts +++ b/windows/src/island/hooks.ts @@ -34,9 +34,18 @@ function validateAgent(raw: string | undefined): string | null { return raw; } +const AGENT_COLORS: Record = { + opencode: "#5EEAD4", + gemini: "#8AB4F8", + antigravity: "#E879F9", + codex: "#2DD4BF", + cursor: "#C0C4CC", +}; + const FALLBACK_COLORS = ["#22C55E", "#EAB308", "#60A5FA", "#E879F9"]; function agentColor(name: string): string { + if (AGENT_COLORS[name]) return AGENT_COLORS[name]; let h = 0; for (let i = 0; i < name.length; i++) { h = (Math.imul(31, h) + name.charCodeAt(i)) | 0;