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 08:40:27 +01:00
parent a3ef35d83e
commit fa2261002d
65 changed files with 4804 additions and 4391 deletions
@@ -5,7 +5,7 @@ import { join } from "node:path";
import * as pythonExecutor from "../src/core/python-executor";
import * as pythonKernel from "../src/core/python-kernel";
import { createTools, type ToolSession } from "../src/core/tools/index";
import { createPythonTool } from "../src/core/tools/python";
import { PythonTool } from "../src/core/tools/python";
function createSettings(overrides?: Partial<ToolSession["settings"]>): ToolSession["settings"] {
return {
@@ -76,7 +76,7 @@ describe("python tool settings", () => {
});
const session = createSession(testDir, { getPythonKernelMode: () => "per-call" });
const pythonTool = createPythonTool(session);
const pythonTool = new PythonTool(session);
await pythonTool.execute("tool-call", { code: "print(1)" });