refactor(coding-agent/core): migrated tool implementations from factory functions to class-based architecture

- Converted all tool implementations from factory functions to class-based architecture.
- Updated SDK exports to expose tool classes instead of create*Tool factory functions.
- Refactored tool instantiation patterns across all built-in tools and test files.
- Added proper TypeScript typing with AgentToolResult and AgentToolUpdateCallback interfaces.
This commit is contained in:
can1357
2026-01-19 16:16:54 +01:00
parent a3ef35d83e
commit fa2261002d
65 changed files with 4804 additions and 4391 deletions
@@ -2,7 +2,7 @@ import { describe, expect, it } from "bun:test";
import { existsSync } from "node:fs";
import { join } from "node:path";
import { resetPreludeDocsCache, warmPythonEnvironment } from "../../src/core/python-executor";
import { createPythonTool, getPythonToolDescription } from "../../src/core/tools/python";
import { getPythonToolDescription, PythonTool } from "../../src/core/tools/python";
const resolvePythonPath = (): string | null => {
const venvPath = process.env.VIRTUAL_ENV;
@@ -102,7 +102,7 @@ describe.skipIf(!shouldRun)("PYTHON_PRELUDE integration", () => {
},
};
const tool = createPythonTool(session);
const tool = new PythonTool(session);
const code = `
helpers = ${JSON.stringify(helpers)}
missing = [name for name in helpers if name not in globals() or not callable(globals()[name])]