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
@@ -4,7 +4,7 @@ import { tmpdir } from "node:os";
import { join } from "node:path";
import * as pythonExecutor from "../../src/core/python-executor";
import type { ToolSession } from "../../src/core/tools/index";
import { createPythonTool } from "../../src/core/tools/python";
import { PythonTool } from "../../src/core/tools/python";
function createSession(cwd: string): ToolSession {
return {
@@ -40,7 +40,7 @@ describe("python tool execution", () => {
stdinRequested: false,
});
const tool = createPythonTool(createSession(tempDir));
const tool = new PythonTool(createSession(tempDir));
const result = await tool.execute(
"call-id",
{ code: "print('hi')", timeout: 5, workdir: tempDir, reset: true },