diff options
Diffstat (limited to 'makima/frontend/src/lib/api.ts')
| -rw-r--r-- | makima/frontend/src/lib/api.ts | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/makima/frontend/src/lib/api.ts b/makima/frontend/src/lib/api.ts index 8896f2c..e3dbc30 100644 --- a/makima/frontend/src/lib/api.ts +++ b/makima/frontend/src/lib/api.ts @@ -3451,6 +3451,40 @@ export interface PickUpOrdersResponse { taskId: string | null; } +/** + * Per-PR snapshot of a directive's goal — frozen at PR creation, lifecycle + * tracked alongside the PR itself. + */ +export interface DirectiveRevision { + id: string; + directiveId: string; + /** Inline-markdown content of the directive goal at the moment the PR was raised. */ + content: string; + prUrl: string; + prBranch: string | null; + /** "open" | "merged" | "closed" — tracks the PR lifecycle. */ + prState: string; + version: number; + frozenAt: string; +} + +export interface DirectiveRevisionListResponse { + revisions: DirectiveRevision[]; + total: number; +} + +export async function listDirectiveRevisions( + directiveId: string, +): Promise<DirectiveRevisionListResponse> { + const res = await authFetch( + `${API_BASE}/api/v1/directives/${directiveId}/revisions`, + ); + if (!res.ok) { + throw new Error(`Failed to list revisions: ${res.statusText}`); + } + return res.json(); +} + export async function createDirectivePR(id: string): Promise<DirectiveWithSteps> { const res = await authFetch(`${API_BASE}/api/v1/directives/${id}/create-pr`, { method: "POST" }); if (!res.ok) throw new Error(`Failed to create PR: ${res.statusText}`); |
