diff --git a/rust/crates/commands/src/lib.rs b/rust/crates/commands/src/lib.rs index a1e70069..66f393da 100644 --- a/rust/crates/commands/src/lib.rs +++ b/rust/crates/commands/src/lib.rs @@ -198,6 +198,13 @@ const SLASH_COMMAND_SPECS: &[SlashCommandSpec] = &[ argument_hint: Some("[task]"), resume_supported: false, }, + SlashCommandSpec { + name: "ultragoal", + aliases: &[], + summary: "Start or manage a durable goal ledger with ultragoal workflow", + argument_hint: Some("[op|args]"), + resume_supported: false, + }, SlashCommandSpec { name: "teleport", aliases: &[], @@ -212,6 +219,20 @@ const SLASH_COMMAND_SPECS: &[SlashCommandSpec] = &[ argument_hint: None, resume_supported: false, }, + SlashCommandSpec { + name: "dump", + aliases: &[], + summary: "Dump debugging information for the current session", + argument_hint: Some("[scope]"), + resume_supported: true, + }, + SlashCommandSpec { + name: "trace", + aliases: &[], + summary: "Enable or disable execution tracing", + argument_hint: Some("[on|off]"), + resume_supported: true, + }, SlashCommandSpec { name: "export", aliases: &[], @@ -1063,10 +1084,19 @@ pub enum SlashCommand { Ultraplan { task: Option, }, + Ultragoal { + args: Option, + }, Teleport { target: Option, }, DebugToolCall, + Dump { + scope: Option, + }, + Trace { + mode: Option, + }, Model { model: Option, }, @@ -1248,8 +1278,11 @@ impl SlashCommand { Self::Init => "/init", Self::Bughunter { .. } => "/bughunter", Self::Ultraplan { .. } => "/ultraplan", + Self::Ultragoal { .. } => "/ultragoal", Self::Teleport { .. } => "/teleport", Self::DebugToolCall { .. } => "/debug-tool-call", + Self::Dump { .. } => "/dump", + Self::Trace { .. } => "/trace", Self::Resume { .. } => "/resume", Self::Model { .. } => "/model", Self::Permissions { .. } => "/permissions", @@ -1349,6 +1382,7 @@ pub fn validate_slash_command_input( "pr" => SlashCommand::Pr { context: remainder }, "issue" => SlashCommand::Issue { context: remainder }, "ultraplan" => SlashCommand::Ultraplan { task: remainder }, + "ultragoal" => SlashCommand::Ultragoal { args: remainder }, "teleport" => SlashCommand::Teleport { target: Some(require_remainder(command, remainder, "")?), }, @@ -1356,6 +1390,12 @@ pub fn validate_slash_command_input( validate_no_args(command, &args)?; SlashCommand::DebugToolCall } + "dump" => SlashCommand::Dump { + scope: optional_single_arg(command, &args, "[scope]")?, + }, + "trace" => SlashCommand::Trace { + mode: optional_single_arg(command, &args, "[on|off]")?, + }, "model" => SlashCommand::Model { model: optional_single_arg(command, &args, "[model]")?, }, @@ -5340,8 +5380,11 @@ pub fn handle_slash_command( | SlashCommand::Pr { .. } | SlashCommand::Issue { .. } | SlashCommand::Ultraplan { .. } + | SlashCommand::Ultragoal { .. } | SlashCommand::Teleport { .. } | SlashCommand::DebugToolCall + | SlashCommand::Dump { .. } + | SlashCommand::Trace { .. } | SlashCommand::Sandbox | SlashCommand::Model { .. } | SlashCommand::Permissions { .. } @@ -5579,6 +5622,36 @@ mod tests { SlashCommand::parse("/debug-tool-call"), Ok(Some(SlashCommand::DebugToolCall)) ); + assert_eq!( + SlashCommand::parse("/dump"), + Ok(Some(SlashCommand::Dump { scope: None })) + ); + assert_eq!( + SlashCommand::parse("/dump session"), + Ok(Some(SlashCommand::Dump { + scope: Some("session".to_string()) + })) + ); + assert_eq!( + SlashCommand::parse("/trace"), + Ok(Some(SlashCommand::Trace { mode: None })) + ); + assert_eq!( + SlashCommand::parse("/trace on"), + Ok(Some(SlashCommand::Trace { + mode: Some("on".to_string()) + })) + ); + assert_eq!( + SlashCommand::parse("/ultragoal"), + Ok(Some(SlashCommand::Ultragoal { args: None })) + ); + assert_eq!( + SlashCommand::parse("/ultragoal create my-goal"), + Ok(Some(SlashCommand::Ultragoal { + args: Some("create my-goal".to_string()) + })) + ); assert_eq!( SlashCommand::parse("/bughunter runtime"), Ok(Some(SlashCommand::Bughunter { @@ -6020,7 +6093,10 @@ mod tests { assert!(!help.contains("/login")); assert!(!help.contains("/logout")); assert!(help.contains("/setup")); - assert_eq!(slash_command_specs().len(), 140); + assert!(help.contains("/ultragoal [op|args]")); + assert!(help.contains("/dump [scope]")); + assert!(help.contains("/trace [on|off]")); + assert_eq!(slash_command_specs().len(), 143); assert!(resume_supported_slash_commands().len() >= 39); } diff --git a/rust/crates/rusty-claude-cli/src/main.rs b/rust/crates/rusty-claude-cli/src/main.rs index cda89fa1..be507a4b 100644 --- a/rust/crates/rusty-claude-cli/src/main.rs +++ b/rust/crates/rusty-claude-cli/src/main.rs @@ -6989,8 +6989,11 @@ fn run_resume_command( | SlashCommand::Pr { .. } | SlashCommand::Issue { .. } | SlashCommand::Ultraplan { .. } + | SlashCommand::Ultragoal { .. } | SlashCommand::Teleport { .. } | SlashCommand::DebugToolCall { .. } + | SlashCommand::Dump { .. } + | SlashCommand::Trace { .. } | SlashCommand::Resume { .. } | SlashCommand::Permissions { .. } | SlashCommand::Login @@ -8231,6 +8234,10 @@ impl LiveCli { self.run_ultraplan(task.as_deref())?; false } + SlashCommand::Ultragoal { args } => { + self.run_ultragoal(args.as_deref())?; + false + } SlashCommand::Teleport { target } => { Self::run_teleport(target.as_deref())?; false @@ -8239,6 +8246,14 @@ impl LiveCli { self.run_debug_tool_call(None)?; false } + SlashCommand::Dump { scope } => { + self.run_dump(scope.as_deref())?; + false + } + SlashCommand::Trace { mode } => { + self.run_trace(mode.as_deref())?; + false + } SlashCommand::Sandbox => { Self::print_sandbox_status(); false @@ -9260,6 +9275,21 @@ impl LiveCli { Ok(()) } + fn run_ultragoal(&self, args: Option<&str>) -> Result<(), Box> { + println!("{}", format_ultragoal_report(args)); + Ok(()) + } + + fn run_dump(&self, scope: Option<&str>) -> Result<(), Box> { + println!("{}", format_dump_report(scope)); + Ok(()) + } + + fn run_trace(&self, mode: Option<&str>) -> Result<(), Box> { + println!("{}", format_trace_report(mode)); + Ok(()) + } + fn run_commit(&mut self, args: Option<&str>) -> Result<(), Box> { validate_no_args("/commit", args)?; let status = git_output(&["status", "--short", "--branch"])?; @@ -11620,6 +11650,36 @@ fn format_ultraplan_report(task: Option<&str>) -> String { ) } +fn format_ultragoal_report(args: Option<&str>) -> String { + format!( + "Ultragoal + Args {} + Action start or manage a durable goal ledger with ultragoal workflow + Output goal ledger state and operations on the goal tracking system", + args.unwrap_or("none") + ) +} + +fn format_dump_report(scope: Option<&str>) -> String { + format!( + "Dump + Scope {} + Action dump debugging information for the current session + Output session state, messages, and internal debugging data", + scope.unwrap_or("session") + ) +} + +fn format_trace_report(mode: Option<&str>) -> String { + format!( + "Trace + Mode {} + Action enable or disable execution tracing + Output execution trace information or confirmation of trace state", + mode.unwrap_or("current state") + ) +} + fn format_pr_report(branch: &str, context: Option<&str>) -> String { format!( "PR