[package]
name = "car-desktop"
version.workspace = true
edition.workspace = true
license.workspace = true
description = "OS-level screen capture, accessibility inspection, and input synthesis for Common Agent Runtime"
repository.workspace = true
readme = "README.md"

# car-desktop is the sibling of car-browser — same UiMap output,
# same async tool verb shape (observe / click / type / keypress /
# list_windows / focus_window / capture). See
# ../../docs/CAR_DESKTOP.md in the tokhn repo for the full plan.
#
# macOS is the only platform with a real backend in v1. The Apple
# framework deps are cfg-target-gated (CLAUDE.md rule #1 — no cargo
# feature flags; OS-specific deps go in a
# [target.'cfg(...)'.dependencies] table). Windows and Linux
# compile-check clean and return CarDesktopError::PlatformUnsupported
# from every method — they are not silent no-ops or todo!() panics.

[dependencies]
# Workspace
serde.workspace = true
serde_json.workspace = true
thiserror.workspace = true
tracing.workspace = true
tokio.workspace = true
chrono.workspace = true

# Shared with car-browser for the perception types (A11yNode, Bounds,
# Modifier). Planned hoist to car-ir / car-perception tracked as an
# open question in docs/CAR_DESKTOP.md (Sprint 4 resolution).
car-browser = { path = "../car-browser", version = "0.23.0" }

# Async trait dispatch (matches car-browser's BrowserBackend style).
async-trait = "0.1"

# Perception helpers.
sha2 = "0.10"
hex = "0.4"

# Apple framework bindings — non-optional, compiled only when the
# target OS is macOS. The `macos` backend module is gated the same
# way (#[cfg(target_os = "macos")] in src/lib.rs).
[target.'cfg(target_os = "macos")'.dependencies]
objc2 = { version = "0.5" }
objc2-foundation = { version = "0.2" }
objc2-app-kit = { version = "0.2", features = ["NSRunningApplication", "NSWorkspace", "libc"] }
objc2-core-foundation = { version = "0.3" }
core-graphics = { version = "0.24" }
core-foundation = { version = "0.10" }
accessibility-sys = { version = "0.1" }
libc = { version = "0.2" }

[dev-dependencies]
tokio = { workspace = true, features = ["test-util", "macros", "rt-multi-thread"] }
