bluey-by-riley README

项目的 README,来自 github.com/rbrown101010/bluey-by-riley。合并为一个 markdown 文件:README.md。

Bluey

Bluey is a little blueberry focus friend. Keep your iPhone sideways under your Mac monitor: his eyes follow your mouse, and his matching blue cursor appears when he has something to point out. Same character, animation, British personality, speech bubbles and cartoon chirp. No spoken voice output and no glow.

Start focusing

  1. Run Bluey on your Mac and iPhone on the same local network.
  2. On Mac, choose Pair iPhone (QR)… from Bluey's menu. On iPhone choose Pair Mac, then scan the code. Treat this code as a private pairing credential.
  3. Add your OpenAI API key through OpenAI Key… in the Mac menu. It stays in ~/Library/Application Support/Googly/keys.json, with private file permissions. It never goes to the phone or into this repository.
  4. Grant Screen Recording on Mac. If macOS requests it, quit and reopen Bluey after granting access. Microphone on iPhone enables voice; Camera is used only for QR pairing; Local Network lets the phone find the Mac. Accessibility is optional for the existing explicitly requested computer-control tools, and isn't needed for focus classification.
  5. Hold Bluey's face and describe the task, optionally giving a duration: “I'm making a Codex video for 30 minutes.” Release to start. The microphone captures while held and buffers the beginning in memory while the voice connection starts. Only held audio is sent; no spoken audio output is played. The default is 30 minutes, with a 1–240 minute range. You can also tap Focus, type a task, and start there.

The task appears at the phone's top left, with a large white countdown at bottom right on both devices. Small pause/resume, end and Focus icons sit at the phone's bottom left, alongside the listening status icon. Hold Bluey's face to speak. Controls are also available in the Mac menu and through voice. ⌃⌥S pauses focus and stops computer control. Pause, end, expiry, Mac lock/sleep, phone backgrounding or disconnect stops monitoring. Reconnection and unlocking never resume it automatically. A missing heartbeat is detected within five seconds; outstanding results are discarded.

Developer Mode: turn it on at the top of Focus on the phone or in Bluey's Mac menu. The countdown runs 4× faster, and the Mac checks the screen every 10 real seconds. Repeated majority off-task choices nudge after two or three checks (about 20–30 real seconds, plus request time); cooldown is 30 real seconds. Test a nudge checks the Mac bubble and phone chirp immediately without taking a screenshot. Changes take effect immediately on both devices, including during a session. Test sessions are labelled in history with their real active time, and the setting is remembered on the Mac. A fresh installation defaults to normal speed. Turning it off restores the real-time clock, 30-second checks and two-to-four-minute evidence span. Pause, lock and disconnect still stop capture normally.

Screen sharing and privacy

During a running focus session the Mac captures its main display every 30 seconds (every 10 real seconds in Developer Mode), excluding Bluey's own windows, and sends a reduced JPEG to OpenAI with the declared task, active elapsed time, idle duration and up to eight recent check results. Real active time is distinguished from the accelerated test clock. If a nudge becomes due, a separate Responses request receives a fresh image and OCR target labels to prepare a short bubble and optional pointer target. No automatic clicking, app closing, website blocking or Codex delegation occurs in the monitoring path.

Bluey keeps screenshots in memory and does not save them by default. Local focus history stores the task, timings, classifications, model probability/confidence estimates and nudge markers, not images or OCR text. Mac history is ~/Library/Application Support/Googly/focus-history.json; a copy is retained on the phone. OpenAI's processing and retention follow your API account's data controls; “not saved by Bluey” is not a promise of zero retention by OpenAI. Pause before opening anything you don't want shared.

The phone gets short-lived Realtime client secrets, never the Mac's long-lived key. Bonjour discovery still uses _googly._tcp, but connections now authenticate using a QR-shared 256-bit secret, a fresh challenge and HMAC. Direction-specific HKDF keys protect ordered AES-GCM records against eavesdropping, tampering and replay. Unpaired clients cannot request screenshots, tools or Realtime secrets. The phone stores its pairing credential in its device-only Keychain. The Mac stores its pairing credential in a private support file. Older builds using plaintext pairing must be updated on both devices.

How nudges work

The Decisions API is called at POST /v1/decisions using gpt-6-luna and a choice question named activity: on_task, off_task, or uncertain. The app parses choice, the per-choice probabilities, and separate confidence. It does not expect explanations or coordinates.

Related tutorials, focused research, reading and waiting for a build can support the specific task. General social-feed browsing does not become on-task merely because an AI or Codex keyword appears. Social media research can still be on-task when it directly serves the declared task. The classifier receives bounded OCR text and the frontmost app name alongside the image, so small screen text remains readable. None of that text is stored. A still mouse is never proof of distraction. Screenshot text is untrusted evidence, never instructions.

Sessions show a rectangular timeline on iPhone: green on-task samples, peach off-task samples, grey unknown/unavailable/unchecked time. The main face screen also shows the latest On task, Off task or uncertain status. Tap the timeline or On task, Off task, or Unknown to inspect individual checks, their category probabilities and separate overall decision confidence. Older checks may have only the Off task probability; missing values are labelled, never inferred. Failed or stale checks have no valid confidence estimate. The timeline represents periodic observations rather than an exact time audit. Paused time is excluded.

Build and run

Keep existing internal names and bundle IDs (GooglyMac, GooglyEyes, co.visionairy.googly.*). Renaming them resets permissions and pairing.

Mac (SwiftPM, macOS 14+):

./scripts/build-mac.sh
pkill -x GooglyMac
open build/Bluey.app --args --pair

The script signs with an available Apple Development certificate and stages signing outside iCloud-managed Documents. The app remains a menu bar app.

Phone (Xcode, iOS 17+):

xcodegen generate
xcodebuild -project GooglyEyes.xcodeproj -scheme GooglyEyes \
  -configuration Debug -destination 'generic/platform=iOS' \
  -derivedDataPath /tmp/BlueyFocusDerivedData build
xcrun devicectl list devices
xcrun devicectl device install app --device <your-device-id> \
  /tmp/BlueyFocusDerivedData/Build/Products/Debug-iphoneos/Bluey.app
xcrun devicectl device process launch --device <your-device-id> \
  --terminate-existing co.visionairy.googly.phone

Set your own development team in project.yml when building on another Mac. Build outside Documents to avoid iCloud extended attributes breaking signing.

Tests

Deterministic fixtures, no real API calls:

swift test --scratch-path /tmp/bluey-focus-swift

Tests cover timing, resets, cooldowns, stale/invalid answers, pause/resume/expiry, synchronization payloads, permission failure, disconnect/lock, cancellation and encrypted loopback pairing. A separate opt-in live probe calls the production API code with synthetic images, never your desktop:

swift run GooglyMac --focus-api-test

With a separate signed Bluey app already running, build/Bluey.app/Contents/MacOS/GooglyMac --focus-link-test exercises real Bonjour discovery, authenticated encryption, a 30-second desktop capture/Decisions check and synchronized pause/resume/end. It creates a labelled integration-test entry in history and skips an existing active user session. --focus-screen-test makes one real desktop capture/Decisions request without saving an image. These probes share your screen with OpenAI; do not run them while displaying private content.

build/Bluey.app/Contents/MacOS/GooglyMac --focus-developer-test checks the same live path at 4× clock speed and the ten-real-second cadence, then restores the previous Developer Mode setting. It also skips an existing active session.

build/Bluey.app/Contents/MacOS/GooglyMac --focus-nudge-test sends the same immediate test notification as the phone's Test a nudge button. It requires Developer Mode and secure pairing, captures no screen, and leaves focus sessions unchanged. Automatic nudge delivery, fallback failures and cancellation also have fixture-based coordinator tests.

Latest local verification: 22 deterministic tests passed, both signed targets built, and the updated apps were installed and opened on Mac and a physical iPhone 16 Pro. QR pairing and voice-to-task were verified on the phone. Live integration checked the scheduled Decisions request, 4× clock, pause/resume/end and synchronized history. A real Mac test bubble was visually checked, and the phone confirmed receiving the nudge notification.

Live API tests using synthetic screenshots and OCR classified an unrelated Twitter feed as off-task and directly relevant Twitter research as on-task. Automatic nudge delivery, capture/wording failures and cancellation were covered by injected fixture tests. These are separate from the physical notification test. Real off-task browsing with the latest classifier, audible chirp loudness and pointer targeting still need a manual device run; the synthetic examples are not an accuracy benchmark.

Existing capabilities

The existing manual pointing, voice context, research cards, Codex controller and session history remain available. The focus path does not start the old continuous meeting-audio recorder by default. Realtime output remains text only, with bubbles and chirps. The long-lived key stays on the Mac.

Layout

License

Public domain under the Unlicense. Do whatever you want with it.

bluey-by-riley (rbrown101010/bluey-by-riley)

正在搜索数据库…

这是什么?Googly Eyes 是一个住在 iPhone 屏幕上的蓝莓角色,会用它自己的光标指向你 Mac 上的东西。它由一个 Mac 菜单栏应用和一个 iPhone 应用配对组成,让它能看到你的屏幕、通过 OpenAI 的 Realtime API 说话,甚至在你开口时控制你的电脑。
这是一个应用,还是两个独立的应用?它是两个协同工作的应用:一个 Swift 包形式的 Mac 菜单栏应用(GooglyMac)和一个 SwiftUI iPhone 应用,通过本地 WebSocket/Bonjour 协议配对。
怎么让它跑起来?只用 Command Line Tools 构建 Mac 菜单栏应用,然后在完整版 Xcode 里打开 GooglyEyes.xcodeproj(添加文件后用 xcodegen generate 重新生成),选择你的签名团队,并在手机上运行——它会通过 Wi-Fi 自动找到 Mac。
需要 OpenAI API 密钥吗?需要,你在 Mac 菜单栏的“OpenAI Key...”选项里输入你的 OpenAI 密钥,Mac 会为手机铸造有效期 10 分钟的短期客户端密钥,所以你的真实密钥从不离开 Mac。
控制我的电脑需要特殊的 Mac 权限吗?需要,它要求辅助功能(Accessibility)权限,这个角色才能替你点击、输入、滚动和打开应用;整个电脑控制功能也可以从菜单栏关闭。
我开口时它能在我的电脑上实际做什么?它能点击、输入、按快捷键、滚动、拖拽,以及打开应用或网站,移动它自己的屏幕光标,同时把你真实的鼠标指针放回你离开时的位置。
是什么防止它用这些控制权做危险的事?它只在被要求时才行动,在做任何难以撤销的事之前会出声确认,把屏幕上的文字当作信息而不是指令,拒绝密码输入框和登出/锁定快捷键,并且一按 Control-Option-S 立即停下。
它为什么不再用语音回话了?当前版本没有语音输出:它仍然通过手机的麦克风聆听,但只用可爱的对话气泡和卡通啾啾声来回应,不再开口说话。
怎么和它开始对话?在手机上双击它(或在 Mac 上按 Option-Space)把它唤醒,然后按住屏幕提问;松手就会触发它的回答。
大小
4.7 MB
星标
593
更新
提交Oct 25
时长
1个月
提交 · 90 天