feat: guard de schemas de tablas en las file tools (redirige a las table tools)

This commit is contained in:
Jordan Diaz
2026-07-25 16:12:46 +00:00
parent 6dfedd07fc
commit 5e61124c65
4 changed files with 69 additions and 4 deletions

View File

@@ -1,7 +1,12 @@
import { z } from "zod";
import { handleToolError, validateRequired } from "../helpers/errorHandler.js";
import { getCurrentProjectInfo, callLocalFileEndpoint, buildLocalFileErrorResponse } from "./helpers.js";
import { isProtectedLayoutPath, buildProtectedLayoutPathError } from "./protectedPaths.js";
import {
isProtectedLayoutPath,
buildProtectedLayoutPathError,
isProtectedSchemaPath,
buildProtectedSchemaPathError,
} from "./protectedPaths.js";
export function registerAcaiDeleteTool(server) {
server.tool(
@@ -21,6 +26,10 @@ export function registerAcaiDeleteTool(server) {
return buildProtectedLayoutPathError(file_path);
}
if (isProtectedSchemaPath(file_path)) {
return buildProtectedSchemaPathError(file_path);
}
const { projectSlug, projectDir } = getCurrentProjectInfo();
const result = await callLocalFileEndpoint("POST", "/api/files/delete", {
project: projectSlug,