[package]
name = "bob-rs"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
description = "Unofficial Rust SDK for the bob agent CLI — detection, install, keychain, run. Not affiliated with or endorsed by the bob maintainers."
license.workspace = true
readme = "README.md"
repository.workspace = true
keywords = ["bob", "agent", "cli", "sdk", "keychain"]
categories = ["command-line-utilities"]

# Pure library. No binaries, no Tauri, no axum — those live in the
# crates that depend on this one (`src-tauri` and `bob-api`). The
# goal is that this crate is the *only* place the actual logic
# (probing PATH, spawning the install script, reading the keychain,
# parsing bob's stream-json) is implemented.
[lib]

[dependencies]
# The generic subprocess engine + event shapes bob-rs builds its
# bob-specific spawn/install on top of. Depending on this leaf (not the
# harness framework) is what keeps bob-rs a standalone SDK.
cli-stream.workspace = true
serde.workspace = true
serde_json.workspace = true
# Typed errors (BobError) carrying real io::Error / keyring::Error /
# serde_json::Error / cli_stream::StreamError sources. Build-time proc-macro.
thiserror.workspace = true
# Tempfile is needed to spool the embedded `install-bob.sh` to
# disk before exec'ing it. The script ships as a string constant
# (`include_str!`) so the consumer doesn't need to ship a separate
# file at runtime.
tempfile = "3"
# Cross-platform app-data-dir resolution. Used by `keychain` to
# store the sidecar marker file that lets us tell whether a key
# is configured *without* touching the OS keychain at boot.
dirs = "5"
# (The SIGTERM/SIGKILL cancel + libc dep moved to agent-harness with the
# streaming engine.)

# OS keychain access — one backend per platform. `keyring` resolves to a
# no-op "mock" store on any target where no backend feature is enabled, so a
# single `features = ["apple-native"]` would have silently stopped persisting
# keys on Linux/Windows. Pick the native store per-OS instead:
#   * macOS   → Keychain Access (Security.framework)
#   * Windows → Credential Manager
#   * Linux   → Secret Service (GNOME Keyring / KWallet) over D-Bus, with a
#               pure-Rust encrypted session (`crypto-rust` — no system OpenSSL).
#               Headless/containers have no Secret Service daemon; there the
#               key comes from the BOBSHELL_API_KEY env var (see keychain.rs's
#               resolve precedence) and the keychain read just returns None.
# `keyring` forbids enabling both the sync and async secret-service backends,
# so Linux uses the sync one only.
[target.'cfg(target_os = "macos")'.dependencies]
keyring = { version = "3.6", features = ["apple-native"] }

[target.'cfg(target_os = "windows")'.dependencies]
keyring = { version = "3.6", features = ["windows-native"] }

[target.'cfg(target_os = "linux")'.dependencies]
keyring = { version = "3.6", features = ["sync-secret-service", "crypto-rust"] }
