feat: add agent-first minitool studio MVP
CI / verify (push) Has been cancelled

This commit is contained in:
2026-09-17 21:54:33 +08:00
commit 74a8f7cdf3
51 changed files with 3855 additions and 0 deletions
@@ -0,0 +1,24 @@
import { NextRequest, NextResponse } from "next/server";
import { errorResponse } from "../../../../../../lib/http";
import { readProjectFile, writeProjectFiles } from "../../../../../../lib/storage";
export const runtime = "nodejs";
type Context = { params: Promise<{ id: string; path: string[] }> };
export async function GET(_: NextRequest, context: Context) {
try {
const params = await context.params;
return NextResponse.json({ content: await readProjectFile(params.id, params.path) });
} catch (error) { return errorResponse(error); }
}
export async function PUT(request: NextRequest, context: Context) {
try {
const params = await context.params;
const body = await request.json();
if (typeof body.content !== "string") throw new Error("content must be a string");
const project = await writeProjectFiles(params.id, [{ path: params.path.join("/"), content: body.content }], body.revision);
return NextResponse.json({ project });
} catch (error) { return errorResponse(error); }
}