temp
This commit is contained in:
20
.opencode/plugin/example.ts
Normal file
20
.opencode/plugin/example.ts
Normal 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}!`
|
||||
},
|
||||
}),
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user