pub mod agents;
pub mod api;
pub mod functions;
pub mod laboratories;
pub mod swarms;
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 = "agents")]
Agents {
#[command(subcommand)]
command: agents::Commands,
},
#[command(name = "api")]
Api {
#[command(subcommand)]
command: api::Commands,
},
#[command(name = "functions")]
Functions {
#[command(subcommand)]
command: functions::Commands,
},
#[command(name = "laboratories")]
Laboratories {
#[command(subcommand)]
command: laboratories::Commands,
},
#[command(name = "swarms")]
Swarms {
#[command(subcommand)]
command: swarms::Commands,
},
Cleared {
#[command(subcommand)]
command: GetCommand,
},
Installed {
#[command(subcommand)]
command: GetCommand,
},
Instructions {
#[command(subcommand)]
command: GetCommand,
},
JqResults {
#[command(subcommand)]
command: GetCommand,
},
ListItem {
#[command(subcommand)]
command: GetCommand,
},
LogContent {
#[command(subcommand)]
command: GetCommand,
},
LogStreamReady {
#[command(subcommand)]
command: GetCommand,
},
Ok {
#[command(subcommand)]
command: GetCommand,
},
PairListItem {
#[command(subcommand)]
command: GetCommand,
},
Plugin {
#[command(subcommand)]
command: GetCommand,
},
Plugins {
#[command(subcommand)]
command: GetCommand,
},
Published {
#[command(subcommand)]
command: GetCommand,
},
Schema {
#[command(subcommand)]
command: GetCommand,
},
Schemas {
#[command(subcommand)]
command: GetCommand,
},
}
impl Commands {
pub async fn handle(self, handle: &objectiveai_sdk::cli::output::Handle) -> Result<(), crate::error::Error> {
match self {
Commands::List => {
const NAMES: &[&str] = &["agents", "api", "functions", "laboratories", "swarms", "Cleared", "Installed", "Instructions", "JqResults", "ListItem", "LogContent", "LogStreamReady", "Ok", "PairListItem", "Plugin", "Plugins", "Published", "Schema", "Schemas"];
objectiveai_sdk::cli::output::Output::<objectiveai_sdk::cli::output::Schemas>::Notification(
objectiveai_sdk::cli::output::Notification {
value: objectiveai_sdk::cli::output::Schemas {
schemas: NAMES.iter().map(|s| s.to_string()).collect(),
},
},
).emit(handle).await;
Ok(())
}
Commands::Agents { command } => command.handle(handle).await,
Commands::Api { command } => command.handle(handle).await,
Commands::Functions { command } => command.handle(handle).await,
Commands::Laboratories { command } => command.handle(handle).await,
Commands::Swarms { command } => command.handle(handle).await,
Commands::Cleared { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../../objectiveai-json-schema/cli.output.notification.Cleared.json"),
).expect("embedded JSON Schema must parse");
objectiveai_sdk::cli::output::Output::<objectiveai_sdk::cli::output::Schema>::Notification(
objectiveai_sdk::cli::output::Notification {
value: objectiveai_sdk::cli::output::Schema { schema },
},
).emit(handle).await;
Ok(())
}
Commands::Installed { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../../objectiveai-json-schema/cli.output.notification.Installed.json"),
).expect("embedded JSON Schema must parse");
objectiveai_sdk::cli::output::Output::<objectiveai_sdk::cli::output::Schema>::Notification(
objectiveai_sdk::cli::output::Notification {
value: objectiveai_sdk::cli::output::Schema { schema },
},
).emit(handle).await;
Ok(())
}
Commands::Instructions { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../../objectiveai-json-schema/cli.output.notification.Instructions.json"),
).expect("embedded JSON Schema must parse");
objectiveai_sdk::cli::output::Output::<objectiveai_sdk::cli::output::Schema>::Notification(
objectiveai_sdk::cli::output::Notification {
value: objectiveai_sdk::cli::output::Schema { schema },
},
).emit(handle).await;
Ok(())
}
Commands::JqResults { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../../objectiveai-json-schema/cli.output.notification.JqResults.json"),
).expect("embedded JSON Schema must parse");
objectiveai_sdk::cli::output::Output::<objectiveai_sdk::cli::output::Schema>::Notification(
objectiveai_sdk::cli::output::Notification {
value: objectiveai_sdk::cli::output::Schema { schema },
},
).emit(handle).await;
Ok(())
}
Commands::ListItem { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../../objectiveai-json-schema/cli.output.notification.ListItem.json"),
).expect("embedded JSON Schema must parse");
objectiveai_sdk::cli::output::Output::<objectiveai_sdk::cli::output::Schema>::Notification(
objectiveai_sdk::cli::output::Notification {
value: objectiveai_sdk::cli::output::Schema { schema },
},
).emit(handle).await;
Ok(())
}
Commands::LogContent { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../../objectiveai-json-schema/cli.output.notification.LogContent.json"),
).expect("embedded JSON Schema must parse");
objectiveai_sdk::cli::output::Output::<objectiveai_sdk::cli::output::Schema>::Notification(
objectiveai_sdk::cli::output::Notification {
value: objectiveai_sdk::cli::output::Schema { schema },
},
).emit(handle).await;
Ok(())
}
Commands::LogStreamReady { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../../objectiveai-json-schema/cli.output.notification.LogStreamReady.json"),
).expect("embedded JSON Schema must parse");
objectiveai_sdk::cli::output::Output::<objectiveai_sdk::cli::output::Schema>::Notification(
objectiveai_sdk::cli::output::Notification {
value: objectiveai_sdk::cli::output::Schema { schema },
},
).emit(handle).await;
Ok(())
}
Commands::Ok { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../../objectiveai-json-schema/cli.output.notification.Ok.json"),
).expect("embedded JSON Schema must parse");
objectiveai_sdk::cli::output::Output::<objectiveai_sdk::cli::output::Schema>::Notification(
objectiveai_sdk::cli::output::Notification {
value: objectiveai_sdk::cli::output::Schema { schema },
},
).emit(handle).await;
Ok(())
}
Commands::PairListItem { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../../objectiveai-json-schema/cli.output.notification.PairListItem.json"),
).expect("embedded JSON Schema must parse");
objectiveai_sdk::cli::output::Output::<objectiveai_sdk::cli::output::Schema>::Notification(
objectiveai_sdk::cli::output::Notification {
value: objectiveai_sdk::cli::output::Schema { schema },
},
).emit(handle).await;
Ok(())
}
Commands::Plugin { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../../objectiveai-json-schema/cli.output.notification.Plugin.json"),
).expect("embedded JSON Schema must parse");
objectiveai_sdk::cli::output::Output::<objectiveai_sdk::cli::output::Schema>::Notification(
objectiveai_sdk::cli::output::Notification {
value: objectiveai_sdk::cli::output::Schema { schema },
},
).emit(handle).await;
Ok(())
}
Commands::Plugins { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../../objectiveai-json-schema/cli.output.notification.Plugins.json"),
).expect("embedded JSON Schema must parse");
objectiveai_sdk::cli::output::Output::<objectiveai_sdk::cli::output::Schema>::Notification(
objectiveai_sdk::cli::output::Notification {
value: objectiveai_sdk::cli::output::Schema { schema },
},
).emit(handle).await;
Ok(())
}
Commands::Published { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../../objectiveai-json-schema/cli.output.notification.Published.json"),
).expect("embedded JSON Schema must parse");
objectiveai_sdk::cli::output::Output::<objectiveai_sdk::cli::output::Schema>::Notification(
objectiveai_sdk::cli::output::Notification {
value: objectiveai_sdk::cli::output::Schema { schema },
},
).emit(handle).await;
Ok(())
}
Commands::Schema { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../../objectiveai-json-schema/cli.output.notification.Schema.json"),
).expect("embedded JSON Schema must parse");
objectiveai_sdk::cli::output::Output::<objectiveai_sdk::cli::output::Schema>::Notification(
objectiveai_sdk::cli::output::Notification {
value: objectiveai_sdk::cli::output::Schema { schema },
},
).emit(handle).await;
Ok(())
}
Commands::Schemas { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../../objectiveai-json-schema/cli.output.notification.Schemas.json"),
).expect("embedded JSON Schema must parse");
objectiveai_sdk::cli::output::Output::<objectiveai_sdk::cli::output::Schema>::Notification(
objectiveai_sdk::cli::output::Notification {
value: objectiveai_sdk::cli::output::Schema { schema },
},
).emit(handle).await;
Ok(())
}
}
}
}