Add packages/opencode-config and use it
This commit is contained in:
18
packages/opencode-config/plugin/hello.js
Normal file
18
packages/opencode-config/plugin/hello.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import { tool } from "@opencode-ai/plugin/tool"
|
||||
|
||||
export async function HelloPlugin() {
|
||||
return {
|
||||
tool: {
|
||||
hello: tool({
|
||||
description: "Return a friendly greeting",
|
||||
args: {
|
||||
name: tool.schema.string().optional().describe("Name to greet"),
|
||||
},
|
||||
async execute(args) {
|
||||
const target = args.name?.trim() || "CodeNomad"
|
||||
return `Hello, ${target}!`
|
||||
},
|
||||
}),
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user