diff options
| author | soryu <soryu@soryu.co> | 2026-01-15 00:23:44 +0000 |
|---|---|---|
| committer | soryu <soryu@soryu.co> | 2026-01-15 00:23:47 +0000 |
| commit | eff0d844ca6e35bfbc2d5fdaa2d2f92177611f2e (patch) | |
| tree | 90d87d6daf9dd78c31e4b816bb1d282db73821dd /makima/frontend/src/lib/api.ts | |
| parent | 87044a747b47bd83249d61a45842c7f7b2eae56d (diff) | |
| download | soryu-eff0d844ca6e35bfbc2d5fdaa2d2f92177611f2e.tar.gz soryu-eff0d844ca6e35bfbc2d5fdaa2d2f92177611f2e.zip | |
Contract type system
Diffstat (limited to 'makima/frontend/src/lib/api.ts')
| -rw-r--r-- | makima/frontend/src/lib/api.ts | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/makima/frontend/src/lib/api.ts b/makima/frontend/src/lib/api.ts index d77c85c..d7ac8b6 100644 --- a/makima/frontend/src/lib/api.ts +++ b/makima/frontend/src/lib/api.ts @@ -1342,11 +1342,26 @@ export async function deleteAccount( // Contract Types for Workflow Management // ============================================================================= +/** Contract type determines the workflow and required documents */ +export type ContractType = "simple" | "specification"; export type ContractPhase = "research" | "specify" | "plan" | "execute" | "review"; export type ContractStatus = "active" | "completed" | "archived"; export type RepositorySourceType = "remote" | "local" | "managed"; export type RepositoryStatus = "ready" | "pending" | "creating" | "failed"; +/** Get valid phases for a contract type */ +export function getValidPhases(contractType: ContractType): ContractPhase[] { + if (contractType === "simple") { + return ["plan", "execute"]; + } + return ["research", "specify", "plan", "execute", "review"]; +} + +/** Get default initial phase for a contract type */ +export function getDefaultPhase(contractType: ContractType): ContractPhase { + return contractType === "simple" ? "plan" : "research"; +} + export interface ContractRepository { id: string; contractId: string; @@ -1364,6 +1379,8 @@ export interface ContractSummary { id: string; name: string; description: string | null; + /** Contract type: "simple" or "specification" */ + contractType: ContractType; phase: ContractPhase; status: ContractStatus; fileCount: number; @@ -1378,6 +1395,8 @@ export interface Contract { ownerId: string; name: string; description: string | null; + /** Contract type: "simple" or "specification" */ + contractType: ContractType; phase: ContractPhase; status: ContractStatus; /** Supervisor task ID for contract orchestration */ @@ -1411,7 +1430,9 @@ export interface ContractListResponse { export interface CreateContractRequest { name: string; description?: string; - /** Initial phase to start in (defaults to "research") */ + /** Contract type: "simple" (default) or "specification" */ + contractType?: ContractType; + /** Initial phase to start in (defaults based on contract type) */ initialPhase?: ContractPhase; } |
