diff options
| author | soryu <soryu@soryu.co> | 2026-03-09 17:20:52 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-09 17:20:52 +0000 |
| commit | f49aaa39a32661b54c109ba002d24cbdf73f4ea3 (patch) | |
| tree | 457f763ebf0eb5f8d0c66b147f8de5acf8e378fe /makima/frontend/src/lib/api.ts | |
| parent | afaae8aba719bf74404a64b57426ecc6a7e70775 (diff) | |
| download | soryu-f49aaa39a32661b54c109ba002d24cbdf73f4ea3.tar.gz soryu-f49aaa39a32661b54c109ba002d24cbdf73f4ea3.zip | |
feat: worktree diff/commit endpoints and frontend diff viewing (#88)
* feat: soryu-co/soryu - makima: Fix worktree info failing when origin ref is missing
* WIP: heartbeat checkpoint
* WIP: heartbeat checkpoint
* WIP: heartbeat checkpoint
* feat: soryu-co/soryu - makima: Add worktree commit endpoint and diff endpoint for regular users
* feat: soryu-co/soryu - makima: Add frontend diff viewing with clickable worktree files
Diffstat (limited to 'makima/frontend/src/lib/api.ts')
| -rw-r--r-- | makima/frontend/src/lib/api.ts | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/makima/frontend/src/lib/api.ts b/makima/frontend/src/lib/api.ts index 7968583..aecdac7 100644 --- a/makima/frontend/src/lib/api.ts +++ b/makima/frontend/src/lib/api.ts @@ -3068,6 +3068,30 @@ export async function getWorktreeInfo(taskId: string): Promise<WorktreeInfo> { return res.json(); } +/** Get the diff for a task's worktree changes */ +export async function getTaskDiff(taskId: string): Promise<{ taskId: string; success: boolean; diff: string | null; error: string | null }> { + const res = await authFetch(`${API_BASE}/api/v1/mesh/tasks/${taskId}/diff`); + if (!res.ok) { + const errorText = await res.text(); + throw new Error(`Failed to get task diff: ${errorText || res.statusText}`); + } + return res.json(); +} + +/** Commit changes in a task's worktree */ +export async function commitWorktree(taskId: string, message?: string): Promise<{ taskId: string; success: boolean; commitSha: string | null; error: string | null }> { + const res = await authFetch(`${API_BASE}/api/v1/mesh/tasks/${taskId}/worktree-commit`, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ message }), + }); + if (!res.ok) { + const errorText = await res.text(); + throw new Error(`Failed to commit worktree: ${errorText || res.statusText}`); + } + return res.json(); +} + // ============================================================================= // Patch Types and Functions // ============================================================================= |
