Files
Jordan Diaz 50c2076ebd libraries
2026-04-20 20:40:55 +00:00

21 lines
898 B
JavaScript

import { canEditCode } from "../helpers/roleCheck.js";
import { registerListGlobalLibrariesTool } from "./list_global_libraries.js";
import { registerAddGlobalLibraryTool } from "./add_global_library.js";
import { registerRemoveGlobalLibraryTool } from "./remove_global_library.js";
import { registerSetGlobalLibrariesTool } from "./set_global_libraries.js";
/**
* Tools to manage the project's global libraries (CSS/JS/fonts) that are
* injected site-wide via layout.json. The list tool is always exposed (read
* only); mutating tools are gated by canEditCode() — same pattern used by
* hooks/ and project/ writers.
*/
export function registerLibrariesTools(server) {
registerListGlobalLibrariesTool(server);
if (canEditCode()) {
registerAddGlobalLibraryTool(server);
registerRemoveGlobalLibraryTool(server);
registerSetGlobalLibrariesTool(server);
}
}