update
This commit is contained in:
22
plugin/src/index.ts
Normal file
22
plugin/src/index.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { tool } from "@opencode-ai/plugin/tool";
|
||||
import type { Plugin, PluginInput } from "@opencode-ai/plugin";
|
||||
|
||||
const MyPlugin: Plugin = async (ctx: PluginInput) => {
|
||||
console.log("Plugin loaded!", ctx.project.name);
|
||||
|
||||
return {
|
||||
tool: {
|
||||
greet: tool({
|
||||
description: "Greet someone",
|
||||
args: {
|
||||
name: tool.schema.string().describe("The name to greet"),
|
||||
},
|
||||
async execute(args) {
|
||||
return `Hello, ${args.name}!`;
|
||||
},
|
||||
}),
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default MyPlugin;
|
||||
Reference in New Issue
Block a user