# nocta-recorder Local, **macOS** screen-activity recorder for [Nocta](https://usenocta.app). Captures screen context, on-device OCR, the accessibility element tree, input events, and audio into a local SQLite database. Local-first: no cloud. **MIT, built and owned by Nocta.** Written in Rust on permissively-licensed crates (objc2, rusqlite, xcap, cpal, whisper-rs, axum) to a documented database spec (`docs/SPEC-db.md`), so any consumer can read the store. macOS-native; other targets compile as inert stubs. ## What it captures | Signal | How | Table(s) | |---|---|---| | Focused app / window / URL / focus | NSWorkspace + Accessibility | `frames` | | Accessibility element tree | AXUIElement walk (0-1 bounds) | `elements` (source=accessibility), `frames.full_text` | | Screen pixels | ScreenCaptureKit via xcap (macOS) | JPEG snapshots, `frames.snapshot_path` | | On-screen text (OCR fallback) | Apple Vision, when the AX tree is thin | `elements` (source=ocr), `ocr_text` | | Keyboard / mouse / scroll / clipboard | CGEventTap (rdev), OS-layout-decoded | `ui_events` | | Microphone audio + transcription | cpal + whisper.cpp (on-device) | `audio_chunks`, `audio_transcriptions` | | Meetings | meeting-app presence | `meetings` | Capture is event-driven and activity-gated (a frame per context change + an input-gated heartbeat), so idle screens don't inflate active time. ## Contract The database is a drop-in for the [activity-frames](https://github.com/nossa-y/activity-frames) compiler (`docs/SPEC-db.md`), and the recorder serves the local REST API on `127.0.0.1:3030` that the Nocta skills, desktop app, and daemon consume. ## Build ```bash cargo build --release --bin nocta-recorder ./scripts/build-dev.sh # build + Developer-ID-sign (stable TCC across rebuilds) ./scripts/make-app.sh # assemble + sign "Nocta Recorder.app" ``` ## Usage ```bash nocta-recorder setup # request macOS permissions (Accessibility/Screen/Input) nocta-recorder record # start recording + serve the REST API (--disable-audio to skip audio) nocta-recorder status # paths, permissions, DB stats nocta-recorder serve --data-dir ~/.nocta # REST API only, against an existing DB ``` Data is stored in `~/.nocta/db.sqlite` (+ `data/` snapshots, `models/` Whisper). On macOS, run via the signed `.app` bundle (launchd) so permission grants apply - see `docs/RELEASE.md`. ## Crates `nocta-core` (time/paths) · `nocta-store` (schema + writer) · `nocta-capture` (displays, context, AX tree, screen pixels) · `nocta-a11y` (input tap) · `nocta-ocr` (Vision) · `nocta-audio` (mic + Whisper) · `nocta-server` (REST) · `nocta-engine` (`nocta-recorder` binary). ## License MIT - see [LICENSE](LICENSE).