fix: stabilize opencode declarations across package managers

This commit is contained in:
Affaan Mustafa
2026-04-05 15:11:19 -07:00
parent 0f4f95b3de
commit 05acc27530
8 changed files with 31 additions and 15 deletions

View File

@@ -4,10 +4,10 @@
* Returns branch/status/log/diff details for the active repository.
*/
import { tool } from "@opencode-ai/plugin/tool"
import { tool, type ToolDefinition } from "@opencode-ai/plugin/tool"
import { execSync } from "child_process"
export default tool({
const gitSummaryTool: ToolDefinition = tool({
description:
"Generate git summary with branch, status, recent commits, and optional diff stats.",
args: {
@@ -45,6 +45,8 @@ export default tool({
},
})
export default gitSummaryTool
function run(command: string, cwd: string): string {
try {
return execSync(command, { cwd, encoding: "utf-8", stdio: ["ignore", "pipe", "pipe"] }).trim()