MEGAINFRA-WEBAPP/src/app/api/ask/change-requests/route.ts
DEls bdb2b2361b feat(ask): log app change requests for the developer
file_change_request (tools-actions.ts) logs an ask_log row
(type "request", status "open") for a change to the app itself — a new
page, column, button or report layout — distinct from propose_changes,
which changes data; the prompt now routes between the two.
list_change_requests (tools.ts, read-only) lists them, which the
existing MCP server picks up automatically since it iterates the whole
tools array. /dashboard/change-requests lists and re-statuses them
(open/planned/done/declined) via new GET/PATCH routes under
/api/ask/change-requests, linked from the sidebar under Ask.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 21:07:27 +02:00

24 lines
814 B
TypeScript

/**
* GET /api/ask/change-requests — app change requests Ask has filed
* (ask_log, type "request"), for the Change Requests dashboard page.
* A plain dashboard route, not gated by the Ask actor picker.
*/
import { loadChangeRequests } from "@/lib/agent/load";
export const dynamic = "force-dynamic";
export async function GET(request: Request) {
const status = new URL(request.url).searchParams.get("status") ?? undefined;
const rows = await loadChangeRequests({ status });
return Response.json({
requests: (rows as { id: string; text?: string; detail?: string; status?: string; created?: string }[]).map(
(r) => ({
id: r.id,
title: r.text ?? "",
detail: r.detail ?? "",
status: r.status ?? "open",
created: r.created ?? "",
}),
),
});
}