16 lines
606 B
JavaScript
16 lines
606 B
JavaScript
import { canEditCode } from "../helpers/roleCheck.js";
|
|
import { registerGetLayoutFieldTool } from "./get_layout_field.js";
|
|
import { registerSetLayoutFieldTool } from "./set_layout_field.js";
|
|
|
|
/**
|
|
* Tools to read/write global layout fields (style, javascript) of the project.
|
|
* The read tool is always exposed (read only); the mutating tool is gated by
|
|
* canEditCode() — same pattern used by libraries/ and hooks/.
|
|
*/
|
|
export function registerLayoutTools(server) {
|
|
registerGetLayoutFieldTool(server); // read-only, todos
|
|
if (canEditCode()) {
|
|
registerSetLayoutFieldTool(server);
|
|
}
|
|
}
|