feat: guard de schemas de tablas en las file tools (redirige a las table tools)
This commit is contained in:
@@ -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 registerAcaiWriteTool(server) {
|
||||
server.tool(
|
||||
@@ -28,6 +33,10 @@ Before writing, check the matching documentation for the file type:
|
||||
return buildProtectedLayoutPathError(file_path);
|
||||
}
|
||||
|
||||
if (isProtectedSchemaPath(file_path)) {
|
||||
return buildProtectedSchemaPathError(file_path);
|
||||
}
|
||||
|
||||
const { projectSlug, projectDir } = getCurrentProjectInfo();
|
||||
const result = await callLocalFileEndpoint("POST", "/api/files/write", {
|
||||
project: projectSlug,
|
||||
|
||||
Reference in New Issue
Block a user