()
| 79 | | { readonly ok: false; readonly status: number; readonly error: CreateError }; |
| 80 | |
| 81 | export async function listWorkspaces(): Promise<Workspace[]> { |
| 82 | const res = await fetch('/api/workspaces'); |
| 83 | if (!res.ok) throw new Error(`list failed: ${res.status}`); |
| 84 | const body = (await res.json()) as { workspaces: Workspace[] }; |
| 85 | return body.workspaces; |
| 86 | } |
| 87 | |
| 88 | /** |
| 89 | * Create a workspace. `agents` is optional and normally omitted — the backend |
no test coverage detected