Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,325 changes: 9 additions & 1,316 deletions cli/Cargo.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion cli/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -43,7 +43,6 @@ tokio = { version = "1", default-features = false, features = ["rt", "io-util"]
tracing = "0.1"
tracing-opentelemetry = "0.29"
tracing-subscriber = { version = "0.3", features = ["registry"] }
turso = "0"
opentelemetry = { version = "0.28", features = ["trace"] }
opentelemetry_sdk = { version = "0.28", features = ["rt-tokio"] }
opentelemetry-otlp = { version = "0.28", features = ["grpc-tonic", "http-proto", "trace"] }
Expand Down
39 changes: 0 additions & 39 deletions cli/src/app.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,8 +15,6 @@ enum Command {
Setup(services::setup::SetupRequest),
Doctor(services::doctor::DoctorRequest),
Hooks(services::hooks::HookSubcommand),
Trace(services::trace::TraceRequest),
Sync(services::sync::SyncRequest),
Version(services::version::VersionRequest),
}

Expand All@@ -31,8 +29,6 @@ impl Command {
Self::Setup(_) => services::setup::NAME,
Self::Doctor(_) => services::doctor::NAME,
Self::Hooks(_) => services::hooks::NAME,
Self::Trace(_) => services::trace::NAME,
Self::Sync(_) => services::sync::NAME,
Self::Version(_) => services::version::NAME,
}
}
Expand DownExpand Up@@ -463,10 +459,6 @@ fn convert_clap_command(command: cli_schema::Commands) -> Result<Command, Classi
}))
}
cli_schema::Commands::Hooks { subcommand } => convert_hooks_subcommand(subcommand),
cli_schema::Commands::Trace { subcommand } => convert_trace_subcommand(subcommand),
cli_schema::Commands::Sync { format } => Ok(Command::Sync(services::sync::SyncRequest {
format: convert_output_format(format),
})),
cli_schema::Commands::Version { format } => {
Ok(Command::Version(services::version::VersionRequest {
format: convert_output_format(format),
Expand DownExpand Up@@ -622,30 +614,6 @@ fn convert_hooks_subcommand(
}
}

#[allow(clippy::unnecessary_wraps)]
fn convert_trace_subcommand(
subcommand: cli_schema::TraceSubcommand,
) -> Result<Command, ClassifiedError> {
match subcommand {
cli_schema::TraceSubcommand::Prompts {
commit_sha,
format,
json,
} => Ok(Command::Trace(services::trace::TraceRequest {
subcommand: services::trace::TraceSubcommand::Prompts(
services::trace::TracePromptsRequest {
commit_sha,
format: if json {
services::trace::TraceFormat::Json
} else {
convert_output_format(format)
},
},
),
})),
}
}

fn dispatch(
command: &Command,
_logger: &services::observability::Logger,
Expand All@@ -656,7 +624,6 @@ fn dispatch(
Command::Auth(request) => services::auth_command::run_auth_subcommand(*request)
.map_err(|error| ClassifiedError::runtime(error.to_string())),
Command::Completion(request) => Ok(services::completion::render_completion(*request)),
// Clone required: run_config_subcommand takes ownership of ConfigSubcommand
Command::Config(subcommand) => services::config::run_config_subcommand(subcommand.clone())
.map_err(|error| ClassifiedError::runtime(error.to_string())),
Command::Setup(request) => {
Expand DownExpand Up@@ -712,14 +679,8 @@ fn dispatch(
}
Command::Doctor(request) => services::doctor::run_doctor(*request)
.map_err(|error| ClassifiedError::runtime(error.to_string())),
// Clone required: run_hooks_subcommand takes ownership of HookSubcommand
Command::Hooks(subcommand) => services::hooks::run_hooks_subcommand(subcommand.clone())
.map_err(|error| ClassifiedError::runtime(error.to_string())),
// Clone required: run_trace_subcommand takes ownership of TraceRequest
Command::Trace(request) => services::trace::run_trace_subcommand(request.clone())
.map_err(|error| ClassifiedError::runtime(error.to_string())),
Command::Sync(request) => services::sync::run_placeholder_sync(*request)
.map_err(|error| ClassifiedError::runtime(error.to_string())),
Command::Version(request) => services::version::render_version(*request)
.map_err(|error| ClassifiedError::runtime(error.to_string())),
}
Expand Down
28 changes: 1 addition & 27 deletions cli/src/cli_schema.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -99,24 +99,12 @@ pub enum Commands {
format: OutputFormat,
},

#[command(about = "Run git-hook runtime entrypoints for local Agent Trace flows")]
#[command(about = "Run attribution-only git hooks (disabled by default)")]
Hooks {
#[command(subcommand)]
subcommand: HooksSubcommand,
},

#[command(about = "Inspect persisted Agent Trace records and prompt captures")]
Trace {
#[command(subcommand)]
subcommand: TraceSubcommand,
},

#[command(about = "Coordinate future cloud sync workflows (placeholder)")]
Sync {
#[arg(long, value_enum, default_value_t = OutputFormat::Text)]
format: OutputFormat,
},

#[command(about = "Print deterministic runtime version metadata")]
Version {
#[arg(long, value_enum, default_value_t = OutputFormat::Text)]
Expand DownExpand Up@@ -208,20 +196,6 @@ pub enum HooksSubcommand {
PostRewrite { rewrite_method: String },
}

#[derive(Subcommand, Debug, Clone, PartialEq, Eq)]
pub enum TraceSubcommand {
#[command(about = "Show captured prompts for a persisted commit trace")]
Prompts {
commit_sha: String,

#[arg(long, value_enum, default_value_t = OutputFormat::Text, conflicts_with = "json")]
format: OutputFormat,

#[arg(long, conflicts_with = "format")]
json: bool,
},
}

#[derive(ValueEnum, Clone, Copy, Debug, Default, PartialEq, Eq)]
pub enum OutputFormat {
#[default]
Expand Down
15 changes: 1 addition & 14 deletions cli/src/command_surface.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,6 @@ use services::style::{command_name, heading};
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum ImplementationStatus {
Implemented,
Placeholder,
}

#[derive(Clone, Copy, Debug, Eq, PartialEq)]
Expand DownExpand Up@@ -51,19 +50,7 @@ pub const COMMANDS: &[CommandContract] = &[
CommandContract {
name: services::hooks::NAME,
status: ImplementationStatus::Implemented,
purpose: "Run git-hook runtime entrypoints for local Agent Trace flows",
show_in_top_level_help: false,
},
CommandContract {
name: services::trace::NAME,
status: ImplementationStatus::Implemented,
purpose: "Inspect persisted Agent Trace records and captured prompts",
show_in_top_level_help: false,
},
CommandContract {
name: services::sync::NAME,
status: ImplementationStatus::Placeholder,
purpose: "Coordinate future cloud sync workflows",
purpose: "Run attribution-only git hooks (disabled by default)",
show_in_top_level_help: false,
},
CommandContract {
Expand Down
Loading