# Phase 95 — out-of-tree standalone subprocess plugin for
# multi-provider web search (Brave / Tavily / DuckDuckGo /
# Perplexity). Wraps the published `nexo-web-search 0.1.2` lib
# instead of re-implementing provider abstraction; the plugin
# adds the subprocess JSON-RPC shell + multi-instance fanout +
# admin/metrics broker subscribers.
#
# Daemon discovers + spawns this binary via `[plugin.entrypoint]`;
# the `web_search` tool reaches agents through the canonical
# `tool.invoke` JSON-RPC contract (Phase 95 adds `params.policy`
# for per-binding allowlists / defaults).

[package]
name         = "nexo-plugin-web-search"
version      = "0.1.1"
description  = "Multi-provider web search (Brave / Tavily / DuckDuckGo / Perplexity) tool plugin for Nexo agents (out-of-tree subprocess)."
edition      = "2021"
license      = "MIT OR Apache-2.0"
repository   = "https://github.com/lordmacu/nexo-rs-plugin-web-search"
authors      = ["Cristian García <informacion@cristiangarcia.co>"]
readme       = "README.md"
keywords     = ["nexo", "plugin", "web-search", "brave", "tavily"]
categories   = ["api-bindings"]
rust-version = "1.80"

[lib]
name = "nexo_plugin_web_search"
path = "src/lib.rs"

[[bin]]
name = "nexo-plugin-web-search"
path = "src/main.rs"

[features]
default = ["brave", "tavily", "duckduckgo"]
# Forward per-provider features to the underlying lib so operators
# building without a provider drop its HTTP machinery entirely.
brave      = ["nexo-web-search/brave"]
tavily     = ["nexo-web-search/tavily"]
duckduckgo = ["nexo-web-search/duckduckgo"]
perplexity = ["nexo-web-search/perplexity"]

[dependencies]
# Framework deps from crates.io (no path deps — out-of-tree repo).
# Phase 95 ships nexo-microapp-sdk 0.1.19 + nexo-core 0.2.0; this
# plugin requires both. During development against the workspace
# these may be pinned to pre-release path deps; flip to crates.io
# release before publish (step 27).
# All framework deps from crates.io — out-of-tree plugin
# convention. SDK 0.1.19 is the first release carrying the
# `ToolInvocation.policy` field needed by Phase 95.
nexo-microapp-sdk    = { version = "0.1.19", features = ["plugin"] }
nexo-broker          = "0.1.5"
nexo-core            = "0.2"
nexo-config          = "0.1.9"
nexo-plugin-manifest = "0.1.6"
nexo-resilience      = "0.1.3"
nexo-web-search      = { version = "0.2.0", default-features = false }

# Async / runtime
tokio        = { version = "1", features = ["rt-multi-thread", "macros", "sync", "io-util", "time", "process", "net", "fs"] }
async-trait  = "0.1"
futures      = "0.3"

# Serde / encoding
serde        = { version = "1", features = ["derive"] }
serde_json   = "1"
serde_yaml   = "0.9"

# Tracing / errors / IDs
anyhow       = "1"
thiserror    = "1"
tracing      = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
once_cell    = "1"
dashmap      = "6"
arc-swap     = "1"

# CLI
clap         = { version = "4", features = ["derive"] }

# TLS — rustls + ring per Android NDK rule.
rustls       = { version = "0.23", default-features = false, features = ["ring", "std", "tls12", "logging"] }

[dev-dependencies]
tempfile    = "3"
serial_test = "3"
tokio       = { version = "1", features = ["test-util", "macros", "rt-multi-thread"] }
toml        = "1"

[profile.release]
lto             = "thin"
codegen-units   = 1
strip           = "symbols"

[lints.clippy]
doc_overindented_list_items = "allow"
doc_lazy_continuation       = "allow"
incompatible_msrv           = "allow"
