feat(app): delete workspace

This commit is contained in:
Adam
2026-01-15 12:48:54 -06:00
parent 06d03dec3b
commit f26de6c52f
6 changed files with 345 additions and 60 deletions

View File

@@ -133,6 +133,32 @@ export const ExperimentalRoutes = lazy(() =>
return c.json(sandboxes)
},
)
.delete(
"/worktree",
describeRoute({
summary: "Remove worktree",
description: "Remove a git worktree and delete its branch.",
operationId: "worktree.remove",
responses: {
200: {
description: "Worktree removed",
content: {
"application/json": {
schema: resolver(z.boolean()),
},
},
},
...errors(400),
},
}),
validator("json", Worktree.remove.schema),
async (c) => {
const body = c.req.valid("json")
await Worktree.remove(body)
await Project.removeSandbox(Instance.project.id, body.directory)
return c.json(true)
},
)
.get(
"/resource",
describeRoute({