From c5807eda364980645b21727dab4236d16d119a56 Mon Sep 17 00:00:00 2001 From: soryu Date: Mon, 26 Jan 2026 20:32:25 +0000 Subject: Add local-only mode toggle to contract creation --- .../src/components/contracts/ContractDetail.tsx | 5 +++ .../src/components/contracts/ContractList.tsx | 15 ++++++-- makima/frontend/src/lib/api.ts | 6 +++ makima/frontend/src/routes/contracts.tsx | 44 ++++++++++++++++++++++ 4 files changed, 66 insertions(+), 4 deletions(-) diff --git a/makima/frontend/src/components/contracts/ContractDetail.tsx b/makima/frontend/src/components/contracts/ContractDetail.tsx index 90b6967..6e31c84 100644 --- a/makima/frontend/src/components/contracts/ContractDetail.tsx +++ b/makima/frontend/src/components/contracts/ContractDetail.tsx @@ -177,6 +177,11 @@ export function ContractDetail({ > {statusConfig[contract.status].label} + {contract.localOnly && ( + + Local-Only + + )} {contract.description && (

diff --git a/makima/frontend/src/components/contracts/ContractList.tsx b/makima/frontend/src/components/contracts/ContractList.tsx index ebde497..98f8ff6 100644 --- a/makima/frontend/src/components/contracts/ContractList.tsx +++ b/makima/frontend/src/components/contracts/ContractList.tsx @@ -127,11 +127,18 @@ export function ContractList({ `} >

-

- {contract.name} -

+
+

+ {contract.name} +

+ {contract.localOnly && ( + + Local + + )} +
diff --git a/makima/frontend/src/lib/api.ts b/makima/frontend/src/lib/api.ts index f15eec0..7c9fcd6 100644 --- a/makima/frontend/src/lib/api.ts +++ b/makima/frontend/src/lib/api.ts @@ -1673,6 +1673,8 @@ export interface ContractSummary { status: ContractStatus; /** Supervisor task ID for contract orchestration */ supervisorTaskId: string | null; + /** When true, tasks won't auto-push or create PRs - use patch files instead */ + localOnly: boolean; fileCount: number; taskCount: number; repositoryCount: number; @@ -1695,6 +1697,8 @@ export interface Contract { autonomousLoop: boolean; /** Whether to wait for user confirmation before progressing to the next phase */ phaseGuard: boolean; + /** When true, tasks won't auto-push or create PRs - use patch files instead */ + localOnly: boolean; version: number; createdAt: string; updatedAt: string; @@ -1728,6 +1732,8 @@ export interface CreateContractRequest { contractType?: ContractType; /** Initial phase to start in (defaults based on contract type) */ initialPhase?: ContractPhase; + /** When true, tasks won't auto-push or create PRs - use patch files instead */ + localOnly?: boolean; } export interface UpdateContractRequest { diff --git a/makima/frontend/src/routes/contracts.tsx b/makima/frontend/src/routes/contracts.tsx index 36eb980..aa62bd9 100644 --- a/makima/frontend/src/routes/contracts.tsx +++ b/makima/frontend/src/routes/contracts.tsx @@ -92,6 +92,7 @@ function ContractsPageContent() { const [showRepoSuggestions, setShowRepoSuggestions] = useState(false); const [contractTypes, setContractTypes] = useState([]); const [contractTypesLoading, setContractTypesLoading] = useState(false); + const [localOnly, setLocalOnly] = useState(false); // Fetch contract types when modal opens - merges built-in types with user templates useEffect(() => { @@ -263,6 +264,7 @@ function ContractsPageContent() { description: newContractDescription.trim() || undefined, contractType: contractType, initialPhase: initialPhase !== defaultPhaseForType ? initialPhase : undefined, + localOnly: localOnly || undefined, }; try { @@ -303,6 +305,7 @@ function ContractsPageContent() { setRepoName(""); setRepoUrl(""); setRepoPath(""); + setLocalOnly(false); navigate(`/contracts/${contract.id}`); } } catch (err) { @@ -336,6 +339,7 @@ function ContractsPageContent() { setRepoName(""); setRepoUrl(""); setRepoPath(""); + setLocalOnly(false); setCreateError(null); }, []); @@ -661,6 +665,46 @@ function ContractsPageContent() {

+ {/* Local-Only Mode */} +
+
+ + +
+

+ When enabled, tasks won't automatically push to remote or create PRs. + Use patch files to export changes. +

+
+ {/* Repository Configuration */}