fix(.opencode/tools): fix tool call in .opencode/tools

This commit is contained in:
2026-04-14 17:42:17 +05:30
parent 02af2003e2
commit 011d850e65
3 changed files with 9 additions and 9 deletions
@@ -7,7 +7,7 @@ import { tool } from "@opencode-ai/plugin";
import { import {
createEvaluateInEngine262Tool, createEvaluateInEngine262Tool,
toolMetadata, toolMetadata,
} from "../../src/agent-tools/evaluateInEngine262"; } from "../../src/agent-tools/evaluateInEngine262.js";
export default tool({ export default tool({
description: toolMetadata.description, description: toolMetadata.description,
@@ -19,8 +19,8 @@ export default tool({
// Create and execute tool (no external dependencies needed) // Create and execute tool (no external dependencies needed)
const evaluateTool = createEvaluateInEngine262Tool(); const evaluateTool = createEvaluateInEngine262Tool();
const result = await evaluateTool.func({ code }); const result = await evaluateTool({ code });
return result; return JSON.stringify(result, null, 2);
}, },
}); });
@@ -8,7 +8,7 @@ import { tool } from "@opencode-ai/plugin";
import { import {
createGetSectionContentTool, createGetSectionContentTool,
toolMetadata, toolMetadata,
} from "../../src/agent-tools/getSectionContent"; } from "../../src/agent-tools/getSectionContent.js";
export default tool({ export default tool({
description: toolMetadata.description, description: toolMetadata.description,
@@ -30,8 +30,8 @@ export default tool({
// Create and execute tool // Create and execute tool
const contentTool = createGetSectionContentTool(table); const contentTool = createGetSectionContentTool(table);
const result = await contentTool.func({ sectionId, recursive }); const result = await contentTool({ sectionId, recursive });
return result; return JSON.stringify(result, null, 2);
}, },
}); });
@@ -9,7 +9,7 @@ import { tool } from "@opencode-ai/plugin";
import { import {
createSearchSpecSectionsTool, createSearchSpecSectionsTool,
toolMetadata, toolMetadata,
} from "../../src/agent-tools/searchSpecSections"; } from "../../src/agent-tools/searchSpecSections.js";
export default tool({ export default tool({
description: toolMetadata.description, description: toolMetadata.description,
@@ -32,8 +32,8 @@ export default tool({
// Create and execute tool // Create and execute tool
const searchTool = createSearchSpecSectionsTool(table, embeddings); const searchTool = createSearchSpecSectionsTool(table, embeddings);
const result = await searchTool.func({ query }); const result = await searchTool({ query });
return result; return JSON.stringify(result, null, 2);
}, },
}); });