This commit is contained in:
abearxiong committed 2026-01-11 23:21:57 +08:00
1 parent 704a02f217
commit 7840cbd746
14 files changed
+151 -2

No files matched your search

+20
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}!`
},
}),
}
}
}