diff options
| author | soryu <soryu@soryu.co> | 2026-01-31 23:07:56 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-31 23:07:56 +0000 |
| commit | 7567153e6281b94e39e52be5d060b381ed69597d (patch) | |
| tree | 1d7dd73756345f3671af32cc84b9b4235d34d173 /makima/src/daemon/api | |
| parent | a6e36a8bfecb9ebe6c7b135b9e01557f7ebc3e58 (diff) | |
| parent | 44bb3fe07ab191abd8260af6975bc175c223878e (diff) | |
| download | soryu-7567153e6281b94e39e52be5d060b381ed69597d.tar.gz soryu-7567153e6281b94e39e52be5d060b381ed69597d.zip | |
Merge pull request #52 from soryu-co/makima/contract-management-improvements
feat: Add contract management system improvements (Phase 1)
Diffstat (limited to 'makima/src/daemon/api')
| -rw-r--r-- | makima/src/daemon/api/supervisor.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/makima/src/daemon/api/supervisor.rs b/makima/src/daemon/api/supervisor.rs index c841b21..c2da1db 100644 --- a/makima/src/daemon/api/supervisor.rs +++ b/makima/src/daemon/api/supervisor.rs @@ -233,22 +233,43 @@ impl ApiClient { } /// Advance contract to a new phase. + /// + /// When `confirmed` is false and phase_guard is enabled, returns a response with + /// `status: "pending_confirmation"` containing deliverables for user review. + /// When `confirmed` is true, proceeds with the phase transition. pub async fn supervisor_advance_phase( &self, contract_id: Uuid, phase: &str, + confirmed: bool, ) -> Result<JsonValue, ApiError> { #[derive(Serialize)] struct AdvancePhaseRequest { phase: String, + confirmed: bool, } let req = AdvancePhaseRequest { phase: phase.to_string(), + confirmed, }; self.post(&format!("/api/v1/contracts/{}/phase", contract_id), &req) .await } + /// Request phase advancement without confirmation (for phase_guard check). + /// + /// This method calls `supervisor_advance_phase` with `confirmed=false`. + /// If phase_guard is enabled, the response will have `status: "pending_confirmation"` + /// and the caller should prompt the user for confirmation before calling again with + /// `confirmed=true`. + pub async fn supervisor_request_phase_advance( + &self, + contract_id: Uuid, + phase: &str, + ) -> Result<JsonValue, ApiError> { + self.supervisor_advance_phase(contract_id, phase, false).await + } + /// Get individual task details. pub async fn supervisor_get_task(&self, task_id: Uuid) -> Result<JsonValue, ApiError> { self.get(&format!("/api/v1/mesh/tasks/{}", task_id)).await |
