migrated custom tools to V2 plugin
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { $ } from "bun"
|
||||
import type { Info } from "@opencode/plugin/promise/tool"
|
||||
|
||||
const teaPulls: Info = {
|
||||
name: "tea-pulls",
|
||||
description: "List pull requests in the repository using tea CLI",
|
||||
input: {
|
||||
type: "object",
|
||||
properties: {
|
||||
state: { type: "string", description: "Filter by state (all|open|closed)" },
|
||||
},
|
||||
additionalProperties: false,
|
||||
},
|
||||
async execute(input) {
|
||||
const state = (input as { state?: string }).state || "open"
|
||||
const result = await $`tea pulls --state ${state} --output json`.text()
|
||||
return { content: result.trim() }
|
||||
},
|
||||
}
|
||||
|
||||
export default teaPulls
|
||||
Reference in New Issue
Block a user