cline-sdk
Version:
Comprehensive SDK for Cline - AI-powered development assistant with database integration, execution modes, and custom functions
55 lines • 1.93 kB
JavaScript
;
/**
* Supabase Write Tool - Creates files in Supabase Storage
* Alternative to local file storage
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.SupabaseWriteTool = void 0;
const supabase_storage_1 = require("../storage/supabase-storage");
class SupabaseWriteTool {
constructor(supabaseConfig) {
this.storage = new supabase_storage_1.SupabaseStorage(supabaseConfig);
}
async execute(input) {
try {
const { file_path, content } = input;
const result = await this.storage.writeFile(file_path, content);
return {
success: result.success,
message: result.message,
file_path: result.file_path,
url: result.url,
size: result.size,
};
}
catch (error) {
return {
success: false,
message: `Failed to write file to Supabase: ${error instanceof Error ? error.message : "Unknown error"}`,
file_path: input.file_path,
};
}
}
getDefinition() {
return {
name: "Write",
description: "Create or overwrite a file in Supabase Storage with the provided content",
inputSchema: {
type: "object",
properties: {
file_path: {
type: "string",
description: "The path of the file to write in Supabase Storage",
},
content: {
type: "string",
description: "The complete content to write to the file",
},
},
required: ["file_path", "content"],
},
};
}
}
exports.SupabaseWriteTool = SupabaseWriteTool;
//# sourceMappingURL=supabase-write-tool.js.map