# car-vision

Apple Vision.framework bindings for the Common Agent Runtime.

CAR's perception pipeline previously used Qwen3-VL for screen-text
extraction — accurate but expensive in both latency and tokens.
`car-vision` replaces that with on-device Vision.framework calls
(`VNRecognizeTextRequest`, etc.), which are sub-100ms and free.

## What's covered

| Capability       | Function       | Vision request                     |
|------------------|---------------|------------------------------------|
| Text recognition | `ocr::recognize` | `VNRecognizeTextRequest`         |

The crate is intentionally small. More request types (rectangle
detection, image classification, barcode reading) are added as
real callers need them.

## Architecture

A small Swift shim (`swift/CarVision.swift`) calls into Vision and
exposes a C ABI. `build.rs` compiles the shim into a static library
and links Vision.framework — same pattern as `car-inference`'s
FoundationModels backend.

The crate compiles cleanly on every target. On non-macOS hosts the
Swift shim is skipped and every entry point returns
`VisionError::PlatformUnsupported`. No cargo features.

## Why not `objc2-vision`?

`objc2-vision` 0.3 requires `objc2` 0.6; the workspace is on
`objc2` 0.5 across `car-desktop`. Bumping that is a separate change.
The Swift shim is also more durable across Vision API revisions —
Apple ships them as Swift-first surfaces these days.
