import fs from "fs"; import { RojoTool, RojoToolContext } from "./RojoTool.js"; import { resolveProjectPath } from "../../storage.js"; export class CreateDirectoryTool extends RojoTool { readonly Definition = { type: "function", function: { name: "create_directory", description: "Create a directory and any missing parent directories at the given path.", parameters: { type: "object", properties: { path: { type: "string", description: "Path relative to the project root." }, }, required: [ "path" ], }, }, }; async execute( args: Record, ctx: RojoToolContext ): Promise { const full = resolveProjectPath( ctx.projectId, args.path as string ); if ( !full ) return { error: "Invalid path" }; fs.mkdirSync( full, { recursive: true } ); return { ok: true }; } }