migrated custom tools to V2 plugin
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { $ } from "bun"
|
||||
import type { Info } from "@opencode/plugin/promise/tool"
|
||||
|
||||
const teaIssueCreate: Info = {
|
||||
name: "tea-issue-create",
|
||||
description: "Create a new issue in the GitHub repository using tea CLI",
|
||||
input: {
|
||||
type: "object",
|
||||
properties: {
|
||||
title: { type: "string", description: "Issue title" },
|
||||
description: { type: "string", description: "Issue description (supports markdown)" },
|
||||
},
|
||||
required: ["title"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
async execute(input) {
|
||||
const { title, description } = input as { title: string; description?: string }
|
||||
const result = await $`tea issues create -t ${title} -d ${description}`.text()
|
||||
return { content: result.trim() }
|
||||
},
|
||||
}
|
||||
|
||||
export default teaIssueCreate
|
||||
Reference in New Issue
Block a user