summaryrefslogtreecommitdiff
path: root/makima/src/daemon/cli
diff options
context:
space:
mode:
Diffstat (limited to 'makima/src/daemon/cli')
-rw-r--r--makima/src/daemon/cli/mod.rs21
-rw-r--r--makima/src/daemon/cli/supervisor.rs161
2 files changed, 182 insertions, 0 deletions
diff --git a/makima/src/daemon/cli/mod.rs b/makima/src/daemon/cli/mod.rs
index da71b0d..cde6e16 100644
--- a/makima/src/daemon/cli/mod.rs
+++ b/makima/src/daemon/cli/mod.rs
@@ -88,6 +88,27 @@ pub enum SupervisorCommand {
/// Get task output/claude log
Output(supervisor::GetTaskOutputArgs),
+
+ /// View task conversation history
+ TaskHistory(supervisor::TaskHistoryArgs),
+
+ /// List task checkpoints (with optional diff)
+ TaskCheckpoints(supervisor::TaskCheckpointsArgs),
+
+ /// Resume supervisor after interruption
+ Resume(supervisor::ResumeArgs),
+
+ /// Resume task from checkpoint
+ TaskResumeFrom(supervisor::TaskResumeFromArgs),
+
+ /// Rewind task code to checkpoint
+ TaskRewind(supervisor::TaskRewindArgs),
+
+ /// Fork task from historical point
+ TaskFork(supervisor::TaskForkArgs),
+
+ /// Rewind supervisor conversation
+ RewindConversation(supervisor::ConversationRewindArgs),
}
/// Contract subcommands for task-contract interaction.
diff --git a/makima/src/daemon/cli/supervisor.rs b/makima/src/daemon/cli/supervisor.rs
index 2bc4c89..ba4fb2b 100644
--- a/makima/src/daemon/cli/supervisor.rs
+++ b/makima/src/daemon/cli/supervisor.rs
@@ -221,3 +221,164 @@ pub struct GetTaskOutputArgs {
#[arg(index = 1, id = "target_task_id")]
pub target_task_id: Uuid,
}
+
+// ============================================================================
+// History Command Args
+// ============================================================================
+
+/// Arguments for task-history command.
+#[derive(Args, Debug)]
+pub struct TaskHistoryArgs {
+ #[command(flatten)]
+ pub common: SupervisorArgs,
+
+ /// Task ID to view history for
+ #[arg(index = 1)]
+ pub task_id: Uuid,
+
+ /// Include tool calls in output
+ #[arg(long, default_value = "true")]
+ pub tool_calls: bool,
+
+ /// Maximum messages to return
+ #[arg(long)]
+ pub limit: Option<i32>,
+
+ /// Output format (table, json, chat)
+ #[arg(long, default_value = "chat")]
+ pub format: String,
+}
+
+/// Arguments for task-checkpoints command (with optional diff).
+#[derive(Args, Debug)]
+pub struct TaskCheckpointsArgs {
+ #[command(flatten)]
+ pub common: SupervisorArgs,
+
+ /// Task ID to list checkpoints for
+ #[arg(index = 1)]
+ pub task_id: Uuid,
+
+ /// Include diff summary
+ #[arg(long)]
+ pub with_diff: bool,
+}
+
+// ============================================================================
+// Resume Command Args
+// ============================================================================
+
+/// Arguments for resume command.
+#[derive(Args, Debug)]
+pub struct ResumeArgs {
+ #[command(flatten)]
+ pub common: SupervisorArgs,
+
+ /// Resume mode: continue, restart_phase, from_checkpoint
+ #[arg(long, default_value = "continue")]
+ pub mode: String,
+
+ /// Checkpoint ID (required for from_checkpoint mode)
+ #[arg(long)]
+ pub checkpoint: Option<Uuid>,
+
+ /// Additional context to inject
+ #[arg(long)]
+ pub context: Option<String>,
+}
+
+/// Arguments for task-resume-from command.
+#[derive(Args, Debug)]
+pub struct TaskResumeFromArgs {
+ #[command(flatten)]
+ pub common: SupervisorArgs,
+
+ /// Source task ID
+ #[arg(index = 1)]
+ pub task_id: Uuid,
+
+ /// Checkpoint number to resume from
+ #[arg(long)]
+ pub checkpoint: i32,
+
+ /// Plan for the new task
+ #[arg(long)]
+ pub plan: String,
+
+ /// Name for the new task
+ #[arg(long)]
+ pub name: Option<String>,
+}
+
+// ============================================================================
+// Rewind Command Args
+// ============================================================================
+
+/// Arguments for task-rewind command.
+#[derive(Args, Debug)]
+pub struct TaskRewindArgs {
+ #[command(flatten)]
+ pub common: SupervisorArgs,
+
+ /// Task ID to rewind
+ #[arg(index = 1)]
+ pub task_id: Uuid,
+
+ /// Checkpoint number to rewind to
+ #[arg(long)]
+ pub checkpoint: i32,
+
+ /// Preserve mode: discard, create_branch, stash
+ #[arg(long, default_value = "create_branch")]
+ pub preserve: String,
+
+ /// Branch name (for create_branch mode)
+ #[arg(long)]
+ pub branch_name: Option<String>,
+}
+
+/// Arguments for task-fork command.
+#[derive(Args, Debug)]
+pub struct TaskForkArgs {
+ #[command(flatten)]
+ pub common: SupervisorArgs,
+
+ /// Source task ID
+ #[arg(index = 1)]
+ pub task_id: Uuid,
+
+ /// Checkpoint number to fork from
+ #[arg(long)]
+ pub checkpoint: i32,
+
+ /// Name for the new task
+ #[arg(long)]
+ pub name: String,
+
+ /// Plan for the new task
+ #[arg(long)]
+ pub plan: String,
+
+ /// Include conversation history
+ #[arg(long, default_value = "true")]
+ pub include_conversation: bool,
+}
+
+/// Arguments for rewind-conversation command.
+#[derive(Args, Debug)]
+pub struct ConversationRewindArgs {
+ #[command(flatten)]
+ pub common: SupervisorArgs,
+
+ /// Number of messages to rewind
+ #[arg(long)]
+ pub by_messages: Option<i32>,
+
+ /// Message ID to rewind to
+ #[arg(long)]
+ pub to_message: Option<String>,
+
+ /// Also rewind code to matching checkpoint
+ #[arg(long)]
+ pub rewind_code: bool,
+}