pub mod agent;
pub mod auth;
pub mod error;
pub mod filesystem;
pub mod functions;
pub mod laboratories;
pub mod mcp;
pub mod swarm;
pub mod vector;
use clap::Subcommand;
#[derive(Subcommand)]
#[command(rename_all = "verbatim")]
pub enum GetCommand {
#[command(name = "get")]
Get,
}
#[derive(Subcommand)]
#[command(rename_all = "verbatim")]
pub enum Commands {
#[command(name = "list")]
List,
#[command(name = "agent")]
Agent {
#[command(subcommand)]
command: agent::Commands,
},
#[command(name = "auth")]
Auth {
#[command(subcommand)]
command: auth::Commands,
},
#[command(name = "error")]
Error {
#[command(subcommand)]
command: error::Commands,
},
#[command(name = "filesystem")]
Filesystem {
#[command(subcommand)]
command: filesystem::Commands,
},
#[command(name = "functions")]
Functions {
#[command(subcommand)]
command: functions::Commands,
},
#[command(name = "laboratories")]
Laboratories {
#[command(subcommand)]
command: laboratories::Commands,
},
#[command(name = "mcp")]
Mcp {
#[command(subcommand)]
command: mcp::Commands,
},
#[command(name = "swarm")]
Swarm {
#[command(subcommand)]
command: swarm::Commands,
},
#[command(name = "vector")]
Vector {
#[command(subcommand)]
command: vector::Commands,
},
PrefixedUuid {
#[command(subcommand)]
command: GetCommand,
},
Remote {
#[command(subcommand)]
command: GetCommand,
},
RemotePath {
#[command(subcommand)]
command: GetCommand,
},
RemotePathCommitOptional {
#[command(subcommand)]
command: GetCommand,
},
Weights {
#[command(subcommand)]
command: GetCommand,
},
WeightsEntry {
#[command(subcommand)]
command: GetCommand,
},
}
impl Commands {
pub async fn handle(self, handle: &objectiveai_cli_sdk::output::Handle) -> Result<(), crate::error::Error> {
match self {
Commands::List => {
const NAMES: &[&str] = &["agent", "auth", "error", "filesystem", "functions", "laboratories", "mcp", "swarm", "vector", "PrefixedUuid", "Remote", "RemotePath", "RemotePathCommitOptional", "Weights", "WeightsEntry"];
objectiveai_cli_sdk::output::Output::<objectiveai_cli_sdk::output::Schemas>::Notification(
objectiveai_cli_sdk::output::Notification {
value: objectiveai_cli_sdk::output::Schemas {
schemas: NAMES.iter().map(|s| s.to_string()).collect(),
},
},
).emit(handle).await;
Ok(())
}
Commands::Agent { command } => command.handle(handle).await,
Commands::Auth { command } => command.handle(handle).await,
Commands::Error { command } => command.handle(handle).await,
Commands::Filesystem { command } => command.handle(handle).await,
Commands::Functions { command } => command.handle(handle).await,
Commands::Laboratories { command } => command.handle(handle).await,
Commands::Mcp { command } => command.handle(handle).await,
Commands::Swarm { command } => command.handle(handle).await,
Commands::Vector { command } => command.handle(handle).await,
Commands::PrefixedUuid { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../objectiveai-json-schema/PrefixedUuid.json"),
).expect("embedded JSON Schema must parse");
objectiveai_cli_sdk::output::Output::<objectiveai_cli_sdk::output::Schema>::Notification(
objectiveai_cli_sdk::output::Notification {
value: objectiveai_cli_sdk::output::Schema { schema },
},
).emit(handle).await;
Ok(())
}
Commands::Remote { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../objectiveai-json-schema/Remote.json"),
).expect("embedded JSON Schema must parse");
objectiveai_cli_sdk::output::Output::<objectiveai_cli_sdk::output::Schema>::Notification(
objectiveai_cli_sdk::output::Notification {
value: objectiveai_cli_sdk::output::Schema { schema },
},
).emit(handle).await;
Ok(())
}
Commands::RemotePath { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../objectiveai-json-schema/RemotePath.json"),
).expect("embedded JSON Schema must parse");
objectiveai_cli_sdk::output::Output::<objectiveai_cli_sdk::output::Schema>::Notification(
objectiveai_cli_sdk::output::Notification {
value: objectiveai_cli_sdk::output::Schema { schema },
},
).emit(handle).await;
Ok(())
}
Commands::RemotePathCommitOptional { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../objectiveai-json-schema/RemotePathCommitOptional.json"),
).expect("embedded JSON Schema must parse");
objectiveai_cli_sdk::output::Output::<objectiveai_cli_sdk::output::Schema>::Notification(
objectiveai_cli_sdk::output::Notification {
value: objectiveai_cli_sdk::output::Schema { schema },
},
).emit(handle).await;
Ok(())
}
Commands::Weights { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../objectiveai-json-schema/Weights.json"),
).expect("embedded JSON Schema must parse");
objectiveai_cli_sdk::output::Output::<objectiveai_cli_sdk::output::Schema>::Notification(
objectiveai_cli_sdk::output::Notification {
value: objectiveai_cli_sdk::output::Schema { schema },
},
).emit(handle).await;
Ok(())
}
Commands::WeightsEntry { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../objectiveai-json-schema/WeightsEntry.json"),
).expect("embedded JSON Schema must parse");
objectiveai_cli_sdk::output::Output::<objectiveai_cli_sdk::output::Schema>::Notification(
objectiveai_cli_sdk::output::Notification {
value: objectiveai_cli_sdk::output::Schema { schema },
},
).emit(handle).await;
Ok(())
}
}
}
}