extern crate self as xyz_rust;
#[cfg(test)]
mod dispatch_test;
pub mod blocks;
pub mod builder;
pub mod builtins;
pub mod cli;
pub mod config;
pub mod ctx;
pub mod dispatch;
pub mod errors;
pub mod lang;
pub mod logx;
#[cfg(any(feature = "http", feature = "mcp"))]
pub mod httpapi;
#[cfg(feature = "mcp")]
pub mod mcp;
pub mod overview;
pub mod registry;
pub mod spec;
pub mod termx;
pub mod version;
pub use ctx::Ctx;
pub fn language() -> &'static str {
crate::lang::current().as_str()
}
pub fn interactive() -> bool {
crate::termx::interactive()
}
pub fn no_color() -> bool {
crate::termx::no_color()
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct EnvContext {
pub language: &'static str,
pub interactive: bool,
pub no_color: bool,
}
pub fn env() -> EnvContext {
EnvContext {
language: language(),
interactive: interactive(),
no_color: no_color(),
}
}
pub fn language_from_ctx(ctx: &Ctx) -> String {
ctx.language()
.map(|s| s.to_string())
.unwrap_or_else(|| crate::lang::current().as_str().to_string())
}
pub use errors as errs;
pub use xyz_rust_macros::{XyzArgs, XyzField, XyzOutput};
pub use chrono;
pub use serde;
pub use serde_json;
pub use builder::{Builder, Definable, define};
pub use config::{Capabilities, Config, ModeWords};
pub use dispatch::{main as main_entry, main_config, run, run_config};
pub use errors::{Error, Kind};
pub use lang::{XyzLang, set as set_lang, t, tf};
pub use registry::Registry;
pub use spec::{
CliFieldHint, CliHints, Entry, FieldMeta, HTTPFieldHint, HTTPHints, MCPFieldHint, MCPHints,
Schema, XyzArgs, XyzField,
};
pub use version::{set_version, version};