import { RojoTool, RojoToolContext } from "./RojoTool.js"; import { readProjectFile } from "../../storage.js"; export class GetTextContentTool extends RojoTool { readonly Definition = { type: "function", function: { name: "get_text_content", description: "Read and return the text content of a file.", parameters: { type: "object", properties: { path: { type: "string", description: "Path relative to the project root." }, }, required: [ "path" ], }, }, }; async execute( args: Record, ctx: RojoToolContext ): Promise { const content = readProjectFile( ctx.projectId, args.path as string ); if ( null === content ) return { error: "File not found or unreadable" }; return content; } }