[package]
name = "car-ffi-common"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
description = "Shared logic for FFI bindings (NAPI, PyO3) — JSON wrappers for verify, multi-agent, scheduler"

[features]
default = []
# Passes through to car-voice; enables the macOS Core Audio system-audio
# listener. Requires full Xcode (cidre's build.rs invokes xcodebuild).
system-audio-macos = ["car-voice/system-audio-macos"]
# car-meeting moved to car-server-core in phase 7.3, so the meeting-side
# of these passthroughs lives there now. car-voice is still a direct dep
# (the in-process voice helpers in src/voice.rs use it), so the
# car-voice passthroughs stay here.
diarization = ["car-voice/diarization"]
parakeet = ["car-voice/parakeet"]

[dependencies]
# Shared daemon-spawn / probe / URL-parsing primitives. car-cli
# also depends on these helpers; one source of truth for both
# sides (#139-fu1).
car-proto = { path = "../car-proto", version = "0.29.0" }
car-ir = { path = "../car-ir", version = "0.29.0" }
car-verify = { path = "../car-verify", version = "0.29.0" }
car-policy = { path = "../car-policy", version = "0.29.0" }
car-eventlog = { path = "../car-eventlog", version = "0.29.0" }
car-multi = { path = "../car-multi", version = "0.29.0" }
car-scheduler = { path = "../car-scheduler", version = "0.29.0" }
car-browser = { path = "../car-browser", version = "0.29.0" }
car-secrets = { path = "../car-secrets", version = "0.29.0" }
car-permissions = { path = "../car-permissions", version = "0.29.0" }
car-accounts = { path = "../car-accounts", version = "0.29.0" }
car-integrations = { path = "../car-integrations", version = "0.29.0" }
car-health = { path = "../car-health", version = "0.29.0" }
car-voice = { path = "../car-voice", version = "0.29.0" }
car-registry = { path = "../car-registry", version = "0.29.0" }
car-external-agents = { path = "../car-external-agents", version = "0.29.0" }
car-workflow = { path = "../car-workflow", version = "0.29.0" }
car-memgine = { path = "../car-memgine", version = "0.29.0" }
car-a2ui = { path = "../car-a2ui", version = "0.29.0" }
car-automation = { path = "../car-automation", version = "0.29.0" }
car-vision = { path = "../car-vision", version = "0.29.0" }
# (removed in v0.8.x phase 7.3) car-engine, car-inference, car-a2a,
# car-meeting — they were only pulled by the daemon-only modules
# (a2a / a2a_dispatch / meeting / voice_turn) that moved to
# car-server-core. Multi-track speaker pipeline + diarizer-prepared
# state still lives in car-voice via the cross-crate helpers
# `car_ffi_common::voice::current_prepared_diarizer` / `…::current_or_build_pipeline`,
# which the moved meeting helper imports.
axum = { version = "0.7", default-features = false, features = ["http1", "tokio", "json"] }
tokio-tungstenite = "0.27"
futures-util = "0.3"
uuid.workspace = true
tracing.workspace = true
tracing-subscriber = { workspace = true, features = ["env-filter"] }
chrono.workspace = true
serde.workspace = true
serde_json.workspace = true
async-trait = "0.1"
tokio.workspace = true
dashmap = "6"
base64 = "0.22"

# Windows-only: DPAPI (CryptProtectData / CryptUnprotectData) for
# encrypting the per-launch auth-token at rest under the launching
# user's logon secret. File ACLs (icacls hardening in src/auth_token.rs)
# bring the DACL to chmod-0600 parity but cannot stop a *malicious
# elevated administrator*: SeTakeOwnership / SeBackupPrivilege let such a
# principal re-own or backup-read the file regardless of its ACL. DPAPI
# encrypts the token bytes so the file holds ciphertext only the user's
# (or SYSTEM's, in service context) DPAPI master key can decrypt — taking
# ownership of the file yields nothing usable. Parslee-ai/car#295.
# Version pinned to the `windows = "0.54"` already in the workspace
# lockfile (car-registry's Job Object code) so Cargo doesn't materialize
# two copies. Linux/macOS builds skip this entirely via cfg-target gating.
[target.'cfg(target_os = "windows")'.dependencies]
windows = { version = "0.54", features = [
    "Win32_Foundation",
    # CryptProtectData / CryptUnprotectData + CRYPT_INTEGER_BLOB live
    # behind Win32_Security_Cryptography (pulls in Win32_Security).
    "Win32_Security_Cryptography",
] }

[dev-dependencies]
tempfile = "3"
