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:
@@ -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)" });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user