day 1: Kin from zero to production - agents, GUI, autopilot, 352 tests

This commit is contained in:
Gros Frumos 2026-03-15 23:22:49 +02:00
parent 8d9facda4f
commit 8a6f280cbd
22 changed files with 1907 additions and 103 deletions

View file

@ -26,6 +26,12 @@ async function post<T>(path: string, body: unknown): Promise<T> {
return res.json()
}
async function del<T>(path: string): Promise<T> {
const res = await fetch(`${BASE}${path}`, { method: 'DELETE' })
if (!res.ok) throw new Error(`${res.status} ${res.statusText}`)
return res.json()
}
export interface Project {
id: string
name: string
@ -59,6 +65,7 @@ export interface Task {
brief: Record<string, unknown> | null
spec: Record<string, unknown> | null
execution_mode: string | null
blocked_reason: string | null
created_at: string
updated_at: string
}
@ -152,8 +159,8 @@ export const api = {
post<{ choice: string; result: unknown }>(`/tasks/${id}/resolve`, { action, choice }),
rejectTask: (id: string, reason: string) =>
post<{ status: string }>(`/tasks/${id}/reject`, { reason }),
runTask: (id: string, allowWrite = false) =>
post<{ status: string }>(`/tasks/${id}/run`, { allow_write: allowWrite }),
runTask: (id: string) =>
post<{ status: string }>(`/tasks/${id}/run`, {}),
bootstrap: (data: { path: string; id: string; name: string }) =>
post<{ project: Project }>('/bootstrap', data),
auditProject: (projectId: string) =>
@ -164,4 +171,6 @@ export const api = {
patch<Task>(`/tasks/${id}`, data),
patchProject: (id: string, data: { execution_mode: string }) =>
patch<Project>(`/projects/${id}`, data),
deleteDecision: (projectId: string, decisionId: number) =>
del<{ deleted: number }>(`/projects/${projectId}/decisions/${decisionId}`),
}