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

@@ -14,7 +14,7 @@ import { getCurrentProjectInfo } from "../files/helpers.js";
export function registerSetLayoutFieldTool(server) {
server.tool(
"set_layout_field",
`Replace the content of a global layout field. 'style'/'javascript' are simple string fields injected via CDN-like URLs (no regeneration needed). 'header'/'footer' are more complex: saving them triggers a server-side pipeline that regenerates the compiled PHP, Twig module files, and TWIG-compiled templates — changes are visible immediately. Destructive: overwrites existing content. Prefer reading with get_layout_field first.`,
`Replace the content of a global layout field: 'style' (CSS), 'javascript' (JS), 'header' (Twig source of the site header), 'footer' (Twig source). CRITICAL: for header/footer, ALWAYS use this tool instead of editing template/estandar/modulos/custom-header-twig/index-base.tpl or custom-footer-twig/index-base.tpl directly with acai-line-replace or acai-write. Editing those .tpl files directly leaves layout.json.{header,footer} out of sync and the visual builder will overwrite your changes on its next save. This tool writes the source, syncs layout.json, regenerates the compiled module files, and runs the TWIG compilation in one atomic pipeline. Destructive: overwrites the full content. Pair with get_layout_field first to read the current source.`,
withAuthParams({
field: z.enum(["style", "javascript", "header", "footer"]).describe("Which layout field: 'style', 'javascript', 'header' or 'footer'"),
content: z.string().describe("Full replacement content. Max 500KB."),