summaryrefslogtreecommitdiff
path: root/makima/src/daemon/cli/supervisor.rs
diff options
context:
space:
mode:
authorsoryu <soryu@soryu.co>2026-01-20 17:19:18 +0000
committerGitHub <noreply@github.com>2026-01-20 17:19:18 +0000
commit54c6d409e1d5667f4ab7f63a43e1459e68575c94 (patch)
tree13a4b58b00f67076b532933b9f8f208122d54bf9 /makima/src/daemon/cli/supervisor.rs
parent5c79032637a9593f1530599726842f49ac904a13 (diff)
downloadsoryu-54c6d409e1d5667f4ab7f63a43e1459e68575c94.tar.gz
soryu-54c6d409e1d5667f4ab7f63a43e1459e68575c94.zip
Clean contract lifecycle: Add supervisor complete command (#13)
* feat: Add contract lifecycle management commands (complete and resume-contract) Add supervisor commands for properly managing contract lifecycle: - `makima supervisor complete` - Mark a contract as complete and stop the supervisor - `makima supervisor resume-contract` - Resume a completed contract (reactivate it) Also adds `api_key` field to TaskConfig for authenticated API calls. This consolidates the lifecycle management features from the contract-lifecycle-cleanup branch. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Fix: prevent supervisor auto-start for completed contracts When viewing a completed contract, the supervisor was auto-starting on component mount. This would resurrect completed contracts and cause them to continue running. Changes: - Add contract.status !== 'completed' check to the auto-start condition - Add contract.status to the useEffect dependency array Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Task completion checkpoint --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'makima/src/daemon/cli/supervisor.rs')
-rw-r--r--makima/src/daemon/cli/supervisor.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/makima/src/daemon/cli/supervisor.rs b/makima/src/daemon/cli/supervisor.rs
index ae1a126..798a55f 100644
--- a/makima/src/daemon/cli/supervisor.rs
+++ b/makima/src/daemon/cli/supervisor.rs
@@ -390,3 +390,30 @@ pub struct ConversationRewindArgs {
#[arg(long)]
pub rewind_code: bool,
}
+
+/// Arguments for complete command (mark contract as complete).
+#[derive(Args, Debug)]
+pub struct CompleteArgs {
+ #[command(flatten)]
+ pub common: SupervisorArgs,
+}
+
+// ============================================================================
+// Resume Contract Command Args
+// ============================================================================
+
+/// Arguments for resume-contract command (reactivate a completed contract).
+#[derive(Args, Debug)]
+pub struct ResumeContractArgs {
+ /// API URL
+ #[arg(long, env = "MAKIMA_API_URL", default_value = "https://api.makima.jp")]
+ pub api_url: String,
+
+ /// API key for authentication
+ #[arg(long, env = "MAKIMA_API_KEY")]
+ pub api_key: String,
+
+ /// Contract ID to resume
+ #[arg(index = 1)]
+ pub contract_id: Uuid,
+}