libraries

This commit is contained in:
Jordan Diaz
2026-04-20 20:40:55 +00:00
parent 950d43f5d7
commit 50c2076ebd
6 changed files with 350 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
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);
}
}