ajustes coder
This commit is contained in:
@@ -13,7 +13,7 @@ import { getCurrentProjectInfo } from "../files/helpers.js";
|
||||
export function registerGetLayoutFieldTool(server) {
|
||||
server.tool(
|
||||
"get_layout_field",
|
||||
`Get the content of a global layout field of the project. Supported: 'style' (global CSS injected in all pages), 'javascript' (global JS), 'header' (HTML/Twig source of the site header), 'footer' (HTML/Twig source of the site footer). Use this before set_layout_field to see the current content.`,
|
||||
`Get the content of a global layout field: 'style', 'javascript', 'header' or 'footer'. For header/footer this is the source of truth — the .tpl files in template/estandar/modulos/custom-{header,footer}-twig/ are generated artifacts. Always prefer this over acai-view on those .tpl files when you need to read the global header/footer source.`,
|
||||
withAuthParams({
|
||||
field: z.enum(["style", "javascript", "header", "footer"]).describe("Which layout field: 'style', 'javascript', 'header' or 'footer'"),
|
||||
}),
|
||||
|
||||
@@ -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."),
|
||||
|
||||
Reference in New Issue
Block a user