diff options
| author | soryu <soryu@soryu.co> | 2026-02-08 21:07:30 +0000 |
|---|---|---|
| committer | soryu <soryu@soryu.co> | 2026-02-08 21:07:30 +0000 |
| commit | 3662b334dfd68cfdf00ed44ae88927c2e1b2aabe (patch) | |
| tree | bff5ae1e189fb8bcc0211d97dab3b9acb4257038 /makima/frontend/src/lib/api.ts | |
| parent | 87fa8c4af66745bd30bc84b6c5ef657dd4dec002 (diff) | |
| download | soryu-3662b334dfd68cfdf00ed44ae88927c2e1b2aabe.tar.gz soryu-3662b334dfd68cfdf00ed44ae88927c2e1b2aabe.zip | |
Remove directive mechanism
Diffstat (limited to 'makima/frontend/src/lib/api.ts')
| -rw-r--r-- | makima/frontend/src/lib/api.ts | 213 |
1 files changed, 0 insertions, 213 deletions
diff --git a/makima/frontend/src/lib/api.ts b/makima/frontend/src/lib/api.ts index 5080ee1..7732725 100644 --- a/makima/frontend/src/lib/api.ts +++ b/makima/frontend/src/lib/api.ts @@ -3003,217 +3003,4 @@ export async function listTaskPatches(taskId: string, contractId: string): Promi return res.json(); } -// ============================================================================= -// Directive Types & API -// ============================================================================= - -export type DirectiveStatus = "draft" | "planning" | "active" | "paused" | "completed" | "archived" | "failed"; -export type AutonomyLevel = "full_auto" | "guardrails" | "manual"; - -export interface DirectiveSummary { - id: string; - title: string; - goal: string; - status: DirectiveStatus; - autonomyLevel: AutonomyLevel; - chainCount: number; - stepCount: number; - totalCostUsd: number; - version: number; - createdAt: string; - updatedAt: string; -} - -export interface Directive { - id: string; - ownerId: string; - title: string; - goal: string; - requirements: unknown[]; - acceptanceCriteria: unknown[]; - constraints: unknown[]; - externalDependencies: unknown[]; - status: DirectiveStatus; - autonomyLevel: AutonomyLevel; - confidenceThresholdGreen: number; - confidenceThresholdYellow: number; - maxTotalCostUsd: number | null; - maxWallTimeMinutes: number | null; - maxReworkCycles: number | null; - maxChainRegenerations: number | null; - repositoryUrl: string | null; - localPath: string | null; - baseBranch: string | null; - orchestratorContractId: string | null; - currentChainId: string | null; - chainGenerationCount: number; - totalCostUsd: number; - startedAt: string | null; - completedAt: string | null; - version: number; - createdAt: string; - updatedAt: string; -} - -export interface DirectiveChain { - id: string; - directiveId: string; - generation: number; - name: string; - description: string | null; - rationale: string | null; - planningModel: string | null; - status: string; - totalSteps: number; - completedSteps: number; - failedSteps: number; - currentConfidence: number | null; - startedAt: string | null; - completedAt: string | null; - version: number; - createdAt: string; - updatedAt: string; -} - -export interface StepContractSummary { - id: string; - name: string; - contractType: string; - phase: string; - status: string; - taskCount: number; - tasksDone: number; - tasksRunning: number; - tasksFailed: number; -} - -export interface ChainStep { - id: string; - chainId: string; - name: string; - description: string | null; - stepType: string; - contractType: string; - initialPhase: string | null; - taskPlan: string | null; - dependsOn: string[] | null; - status: string; - contractId: string | null; - supervisorTaskId: string | null; - monitoringContractId: string | null; - monitoringTaskId: string | null; - confidenceScore: number | null; - confidenceLevel: string | null; - evaluationCount: number; - reworkCount: number; - lastEvaluationId: string | null; - orderIndex: number; - startedAt: string | null; - completedAt: string | null; - createdAt: string; - contractSummary: StepContractSummary | null; -} - -export interface ChainWithSteps extends DirectiveChain { - steps: ChainStep[]; -} - -export interface DirectiveWithChains extends Directive { - orchestratorContractSummary: StepContractSummary | null; - chains: ChainWithSteps[]; -} - -export interface DirectiveListResponse { - directives: DirectiveSummary[]; - total: number; -} - -export interface CreateDirectiveRequest { - title: string; - goal: string; - requirements?: unknown[]; - acceptanceCriteria?: unknown[]; - constraints?: unknown[]; - externalDependencies?: unknown[]; - autonomyLevel?: AutonomyLevel; - repositoryUrl?: string; - localPath?: string; - baseBranch?: string; -} - -export interface UpdateDirectiveRequest { - title?: string; - goal?: string; - status?: DirectiveStatus; - autonomyLevel?: AutonomyLevel; - version?: number; -} - -export async function listDirectives(): Promise<DirectiveListResponse> { - const res = await authFetch(`${API_BASE}/api/v1/directives`); - if (!res.ok) { - throw new Error(`Failed to list directives: ${res.statusText}`); - } - return res.json(); -} - -export async function getDirective(id: string): Promise<DirectiveWithChains> { - const res = await authFetch(`${API_BASE}/api/v1/directives/${id}`); - if (!res.ok) { - throw new Error(`Failed to get directive: ${res.statusText}`); - } - return res.json(); -} - -export async function createDirective( - data: CreateDirectiveRequest -): Promise<Directive> { - const res = await authFetch(`${API_BASE}/api/v1/directives`, { - method: "POST", - body: JSON.stringify(data), - }); - if (!res.ok) { - throw new Error(`Failed to create directive: ${res.statusText}`); - } - return res.json(); -} - -export async function updateDirective( - id: string, - data: UpdateDirectiveRequest -): Promise<Directive> { - const res = await authFetch(`${API_BASE}/api/v1/directives/${id}`, { - method: "PUT", - body: JSON.stringify(data), - }); - if (res.status === 409) { - const conflict = (await res.json()) as ConflictErrorResponse; - throw new VersionConflictError(conflict); - } - if (!res.ok) { - throw new Error(`Failed to update directive: ${res.statusText}`); - } - return res.json(); -} - -export async function deleteDirective(id: string): Promise<void> { - const res = await authFetch(`${API_BASE}/api/v1/directives/${id}`, { - method: "DELETE", - }); - if (!res.ok) { - throw new Error(`Failed to delete directive: ${res.statusText}`); - } -} - -export async function startDirective(id: string): Promise<Directive> { - const res = await authFetch(`${API_BASE}/api/v1/directives/${id}/start`, { - method: "POST", - }); - if (!res.ok) { - const body = await res.json().catch(() => null); - const msg = body?.message || res.statusText; - throw new Error(`Failed to start directive: ${msg}`); - } - return res.json(); -} |
