#![forbid(unsafe_code)]
#![warn(missing_docs)]
#![warn(clippy::all)]
#![warn(clippy::pedantic)]
#![allow(clippy::module_name_repetitions)]
mod annotations;
mod command;
mod config;
mod error;
mod exec;
mod manager;
mod schema;
mod selector;
pub mod selectors;
mod server;
mod subcommands;
mod tool;
mod walk;
pub use annotations::ToolAnnotations;
pub use command::{command, generate_tools, handle, run};
pub use config::Config;
pub use error::{Error, Result};
pub use schema::SchemaType;
pub use selector::{
BoxedNext, CmdMatcher, FlagMatcher, Middleware, MiddlewareCtx, MiddlewareResult, Selector,
};
pub use tool::{ToolInput, ToolOutput};
#[doc(hidden)]
pub mod __test_internal {
pub use crate::server::BrontesServer;
pub use crate::server::http::serve_http;
pub use crate::server::http::{
Acceptor, SHUTDOWN_GRACE, TokioTcpAcceptor, bind_default_acceptor, serve_http_with,
};
#[cfg(unix)]
pub use crate::subcommands::signal::{
SignalSource, TokioUnixSignalSource, spawn_signal_listener_with,
};
pub use hyper_util::rt::TokioIo;
#[must_use]
pub fn render_flag_argv(
flag_name: &str,
value: &serde_json::Value,
tool_name: &str,
) -> Vec<String> {
let mut out: Vec<String> = Vec::new();
crate::exec::append_flag_for_test(&mut out, flag_name, value, tool_name);
out
}
pub async fn drain_capped<R>(
reader: R,
stream_label: &'static str,
tool_name: String,
) -> Vec<u8>
where
R: tokio::io::AsyncRead + Unpin,
{
crate::exec::read_capped_for_test(reader, stream_label, tool_name).await
}
pub const OUTPUT_CAP_BYTES: usize = crate::exec::OUTPUT_CAP_BYTES;
#[must_use]
pub fn parse_start_log_level(matches: &clap::ArgMatches) -> Option<tracing::Level> {
crate::subcommands::start::parse_log_level_for_test(matches)
}
#[must_use]
pub fn start_subcommand() -> clap::Command {
crate::subcommands::start::build_for_test()
}
#[must_use]
pub fn parse_stream_log_level(matches: &clap::ArgMatches) -> Option<tracing::Level> {
crate::subcommands::stream::parse_log_level_for_test(matches)
}
#[must_use]
pub fn stream_subcommand() -> clap::Command {
crate::subcommands::stream::build_for_test()
}
}