feat: wire 10 new tools — file_read, file_write, glob, grep, web_fetch, task CRUD, send_message, schedule_cron

- 10 new JS tool classes in src/tools/ (clean, no framework deps)
- tools/index.js: registry-based init with env toggles
- bot/index.js: 16 tool definitions + 16 handlers (was 4)
- Added glob npm dependency
- Tools: bash, file_edit, file_read, file_write, glob, grep, web_search, web_fetch, git, task_create/update/list, send_message, schedule_cron, delegate_agent, run_skill
This commit is contained in:
admin
2026-05-05 16:43:05 +00:00
Unverified
parent 78d994fdda
commit 0a81aa2b82
14 changed files with 751 additions and 103 deletions

View File

@@ -0,0 +1,22 @@
import { logger } from '../utils/logger.js';
import fs from 'fs-extra';
import path from 'path';
export class FileWriteTool {
constructor() {
this.name = 'file_write';
this.description = 'Write content to a file, creating parent directories as needed';
}
async execute(args) {
const { file_path, content } = args;
try {
const fullPath = path.resolve(file_path);
await fs.ensureDir(path.dirname(fullPath));
await fs.writeFile(fullPath, content, 'utf-8');
return `✅ Written ${Buffer.byteLength(content)} bytes to ${fullPath}`;
} catch (e) {
return `❌ Write error: ${e.message}`;
}
}
}