Add skill enable controls and data factory SQL skill

This commit is contained in:
武阳
2026-05-08 14:56:32 +08:00
parent 046b0eeab0
commit bd2f260b9f
16 changed files with 1167 additions and 25 deletions
+27
View File
@@ -20,3 +20,30 @@ export async function GET() {
},
});
}
export async function PATCH(request: Request) {
const account = await getCurrentAccount();
if (!account)
return Response.json({ error: "unauthorized" }, { status: 401 });
const body = (await request.json()) as Record<string, unknown>;
const response = await fetch(`${CLAW_API_URL}/api/skills`, {
method: "PATCH",
headers: {
"content-type": "application/json",
},
body: JSON.stringify({
...body,
account_id: account.id,
}),
cache: "no-store",
});
const payload = await response.text();
return new Response(payload, {
status: response.status,
headers: {
"content-type":
response.headers.get("content-type") ?? "application/json",
},
});
}