[package]
name = "speech"
version = "0.8.3"
edition = "2021"
license = "MIT OR Apache-2.0"
homepage = "https://github.com/doom-fish/speech-rs"
repository = "https://github.com/doom-fish/speech-rs"
description = "Safe Rust bindings for Apple's Speech framework — on-device speech recognition (SFSpeechRecognizer) on macOS"
authors = ["Per Johansson <per@doom.fish>"]
keywords = ["speech", "transcription", "macos", "asr", "apple"]
categories = ["api-bindings", "os::macos-apis", "multimedia::audio"]
rust-version = "1.76"
readme = "README.md"
build = "build.rs"
include = [
    "src/**/*",
    "swift-bridge/Package.swift",
    "swift-bridge/Sources/**/*",
    "examples/**/*",
    "tests/**/*",
    "build.rs",
    "Cargo.toml",
    "README.md",
    "LICENSE-*",
    "CHANGELOG.md",
    "COVERAGE.md",
]

[lints.rust]

[lints.clippy]
pedantic = { level = "warn", priority = -1 }
nursery = { level = "warn", priority = -1 }
cargo = { level = "warn", priority = -1 }

[lib]
name = "speech"
crate-type = ["lib"]

[features]
default = ["recognize_url"]

# Per-input feature flags. Future: recognize_audio_buffer (live mic / CMSampleBuffer).
recognize_url = []

# Async API: wraps completion-handler and async-throws Swift APIs as Rust Futures.
# Requires `doom-fish-utils` (path = "../doom-fish-utils").
async = []

[dependencies]
doom-fish-utils = { path = "../doom-fish-utils", version = ">=0.1, <0.3" }
serde = { version = "1", features = ["derive"] }
serde_json = "1"

[dev-dependencies]
pollster = "0.3"
regex-lite = "0.1"

[package.metadata.docs.rs]
all-features = true
default-target = "aarch64-apple-darwin"
targets = ["aarch64-apple-darwin", "x86_64-apple-darwin"]
rustdoc-args = ["--cfg", "docsrs"]

[badges]
maintenance = { status = "actively-developed" }

[[example]]
name = "01_recognize_smoke"
required-features = ["recognize_url"]

[[example]]
name = "05_async_smoke"
required-features = ["async"]

[profile.release]
debug = "full"
strip = "none"
