ajustes coder

This commit is contained in:
Jordan Diaz
2026-04-21 16:55:37 +00:00
parent 362666295f
commit 62239cb0a5
7 changed files with 97 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
import { z } from "zod";
import { handleToolError, validateRequired } from "../helpers/errorHandler.js";
import { getCurrentProjectInfo, callLocalFileEndpoint, buildLocalFileErrorResponse } from "./helpers.js";
import { isProtectedLayoutPath, buildProtectedLayoutPathError } from "./protectedPaths.js";
export function registerAcaiWriteTool(server) {
server.tool(
@@ -23,6 +24,10 @@ Before writing, check the matching documentation for the file type:
const validationError = validateRequired({ file_path }, ["file_path"], "acai-write");
if (validationError) return validationError;
if (isProtectedLayoutPath(file_path)) {
return buildProtectedLayoutPathError(file_path);
}
const { projectSlug, projectDir } = getCurrentProjectInfo();
const result = await callLocalFileEndpoint("POST", "/api/files/write", {
project: projectSlug,