CodeIsland

repository·main·Indexed 24 days ago

https://github.com/wxtsky/codeisland

A macOS utility providing a real-time status panel for AI coding agents (Claude Code, Cursor, Copilot) in the MacBook notch. Includes a bridge plugin for OpenClaw and companion ecosystems: Code Island Buddy for ESP32-C6 hardware, CodeIsland Buddy Watch for Wear OS, and a companion app for iPhone and Apple Watch using MultipeerConnectivity and BLE.

Tokens
14.5K
Snippets
8
Records
80
Agent score
81%

What's inside codeisland

  1. What is Buddy?

    main

    Buddy is a hardware peripheral for CodeIsland that brings the AI Coding Agent status animations from the macOS Dynamic Island to a physical ESP32-powered small screen on your desk.

    It uses Bluetooth Low Energy (BLE) to receive real-time status updates from the macOS CodeIsland application and displays corresponding pixel mascot animations based on the agent's state:

    • Idle $\rightarrow$ Sleep: Mascot sleeps with eyes closed.
    • Processing / Running $\rightarrow$ Work: Mascot is coding.
    • Wait Approval $\rightarrow$ Alert: Mascot calls for your attention.
    • Wait Question $\rightarrow$ Question: Mascot prompts you to answer a question.

    When not connected via BLE, Buddy displays a guidance page with the project's GitHub QR code and the device name. You can enter Demo Mode by long-pressing the button to automatically cycle through all 16 mascots.

  2. What is CodeIsland Buddy Watch

    main

    CodeIsland Buddy Watch is a Wear OS companion app designed to mirror the hardware/Buddy protocol used by CodeIsland. It functions as a BLE (Bluetooth Low Energy) peripheral named Buddy, making it discoverable by the macOS application.

    Key capabilities include:

    • Mirroring mascot, agent status, tool name, brightness, and orientation frames.
    • Support for both square and round watch screens.
    • Screen interaction: Tap to notify the host with the current mascot sourceId; long-press to toggle local demo mode.
  3. Overview of CodeIsland Buddy Watch

    main

    CodeIsland Buddy Watch is the Wear OS implementation for CodeIsland. It acts as a BLE peripheral broadcasting under the name Buddy, allowing it to be scanned and connected to by the macOS client.

    Key Features:

    • Synchronizes mascot, Agent status, tool name, brightness, and screen orientation.
    • Supports both square and round watch faces via resource qualifiers.
    • Tap screen: Sends the current mascot's sourceId back to the host.
    • Long press: Toggles between a local demo mode and Agent mode (Agent mode resumes automatically upon receiving a new real-time frame).
  4. What is Code Island Buddy?

    main
    Code Island Buddy is the Apple device companion for Code Island. It synchronizes the current agent status from a Mac to mobile devices, including iPhone, Apple Watch, Dynamic Island, StandBy, and watchOS widgets. It allows users to monitor active sessions, tool calls, and recent activities on the go, with the ability to return to the Mac to continue work.
  5. Comparison between CodeIsland and open-vibe-island

    main

    This research document compares the vibe-notch (CodeIsland) project with the open-vibe-island project as of April 30, 2026.

    Key Differences

    • License: CodeIsland uses the MIT license (permissive), while open-vibe-island uses GPL v3 (copyleft).
    • Ecosystem Coverage: CodeIsland supports Android Watch (via a Gradle project) and ESP32 hardware desktop widgets. open-vibe-island focuses on the Apple ecosystem (iOS App + Apple Watch).
    • Update Channels: CodeIsland provides updates via Sparkle 2 and Homebrew cask, whereas open-vibe-island only uses Sparkle 2.
    • Architecture: CodeIsland uses three Swift Package targets (CodeIsland, CodeIslandCore, CodeIslandBridge), while open-vibe-island uses four targets, including a dedicated Setup CLI.

    Feature Strengths of CodeIsland

    • AI Tool Support: Supports 17+ tools (including Trae, StepFun, AntiGravity, WorkBuddy, Hermes, Kiro, pi-mono, and Copilot) compared to 10 in the competitor.
    • Concurrency Handling: Features tool_use_id precise pairing and concurrency protection to prevent data loss, and sub-agent precise collapsing using CLIProcessResolver.resolvedSessionPID to prevent UI spam during high-concurrency Cursor sessions.
    • Performance: Implements JSONL incremental tailing with DispatchSource and offset-based byte pre-screening, resulting in a 53% latency optimization.
    • Hardware: Includes ESP32 physical desktop mascot widgets (hardware/ directory) and Android Watch support.
  6. Hardware Specifications for Waveshare ESP32-C6-LCD-1.47

    main

    The Waveshare ESP32-C6-LCD-1.47 development board uses the ESP32-C6FH4 microcontroller. Key hardware features include:

    • Wireless: 2.4GHz Wi-Fi 6 and BLE 5.
    • Storage: 4MB Flash.
    • Display: 1.47" TFT, 172x320 resolution, driven by the ST7789 driver.
    • Peripherals: Onboard Micro SD, RGB LED, BOOT button, and RESET button.
  7. Understand the Code Island Buddy project structure

    main

    The Code Island Buddy Xcode project is organized into several targets and shared modules:

    • CodeIslandCompanion/: The main iPhone application.
    • CodeIslandCompanionWidget/: Provides the iPhone Live Activity, Dynamic Island, and StandBy UI.
    • CodeIslandWatchApp/: The Apple Watch application.
    • CodeIslandWatchWidget/: The watchOS widget.
    • Shared/: Contains shared models, display helpers, and mascot views used across targets.
    • project.yml: The XcodeGen project definition file used to generate the .xcodeproj.
  8. Manage Agent Installation Intent

    main

    To prevent silent reinstallation of agents that a user has explicitly uninstalled, implement an AgentIntentStore using a tri-state model. This ensures the 'source of truth' for an agent's status is managed centrally rather than being split between settings, disk state, and actual installation.

    The AgentHookIntent Model:

    • untouched: The agent has never been interacted with; the app can suggest installation.
    • installed: The user chose to install; the app should verify and repair on startup.
    • uninstalled: The user explicitly chose to uninstall; the app must not touch or reinstall it during startup.

    Implementation Details:

    • Use UserDefaults with a stable key pattern: agentIntent.<rawValue>.
    • Implement a migrationVersion to handle first-time upgrades (e.g., scanning existing hooks and setting them to installed without triggering onboarding).
  9. Resolve Workspace Names for Git Worktrees

    main

    When using git worktree, the current working directory (CWD) often contains paths like ~/code/foo/.git/worktrees/feat-bar. To ensure session cards display meaningful names, implement a WorkspaceNameResolver to map these paths back to the project and branch names.

    Resolution Logic:

    1. Identify markers for /.claude/worktrees/ or /.git/worktrees/.
    2. Extract the last path component before the marker as the Project Name.
    3. Convert the path components after the marker from + back to / to reconstruct the Branch Name (since git worktree replaces / with + in paths).
    4. Format the display as: "<projectName> (<branch>)".
  10. Implement Apple Watch and iOS Notification Linkage

    main

    To provide a stronger sensory channel for Agent approvals and questions, implement a notification relay system across macOS, iOS, and Apple Watch.

    Architecture Overview:

    • macOS: Uses NWListener (TCP + Bonjour _codeisland._tcp) to host a lightweight HTTP/1.1 and SSE (Server-Sent Events) server. Endpoints include /pair (for 6-digit pairing codes), /events (SSE stream for permissions/questions), /resolution (for user responses), and /status.
    • iOS: Uses NWBrowser to discover the Mac via Bonjour and an SSEClient to maintain a long-lived connection. It uses UNNotificationCategory (e.g., PERMISSION_REQUEST) to handle alerts.
    • Apple Watch: Uses WatchConnectivityManager to relay notifications from iOS and HapticManager for physical feedback.

    Key Requirements:

    • Permissions: iOS 14+ requires NSLocalNetworkUsageDescription and NSBonjourServices in the Info.plist.
    • Connectivity: Implement reconnection logic for iOS background SSE connections which are frequently interrupted by the system.
    • Security: Store pairing tokens in the Keychain.
  11. Hardware Requirements for Buddy

    main

    Buddy is specifically designed for the following hardware configuration. Using other boards may require significant modifications.

    ItemModel / Specification
    Development BoardWaveshare ESP32-C6-LCD-1.47
    MCUESP32-C6FH4 (RISC-V single-core, 160 MHz, 4 MB Flash)
    Screen1.47 inch IPS, 172×320, ST7789 driver
    WirelessWi-Fi 6 + BLE 5 (Project uses BLE)

    Note on Buttons: The onboard BOOT button is repurposed as the main functional button (GPIO9). No external buttons are required. Short presses switch mascots, and long presses enter Demo Mode.

  12. How Code Island Buddy communication works

    main

    The system uses a dual-channel communication strategy to balance full state synchronization with background reliability without requiring a backend or APNs:

    • MultipeerConnectivity: Used for full state synchronization, recent activities, and sending operation commands. This is best suited for when the iPhone app is in the foreground.
    • CoreBluetooth (BLE): Used for transmitting lightweight status summaries (e.g., agent name, status, current message, workspace). This allows the iPhone to refresh Live Activities and update the Apple Watch even when the app is in the background or on the lock screen.
    • WatchConnectivity: Synchronizes the current iPhone state to the paired Apple Watch.

    Communication Flow:

    • Mac CodeIsland $\rightarrow$ (Multipeer/BLE) $\rightarrow$ iPhone $\rightarrow$ (WatchConnectivity) $\rightarrow$ Apple Watch.