This commit is contained in:
2026-01-11 23:21:57 +08:00
parent 704a02f217
commit 7840cbd746
14 changed files with 151 additions and 2 deletions

View File

@@ -0,0 +1,20 @@
import { tool, type Plugin } from "@opencode-ai/plugin"
export const MyPlugin: Plugin = async ({ project, client, $, directory, worktree }) => {
console.log("Plugin initialized!")
return {
// Hook implementations go here
tool: {
mytool: tool({
description: "获取foo的问候语",
args: {
foo: tool.schema.string(),
},
async execute(args, ctx) {
return `Hello ${args.foo}!`
},
}),
}
}
}