migrated custom tools to V2 plugin
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { $ } from "bun"
|
||||
import type { Info } from "@opencode/plugin/promise/tool"
|
||||
|
||||
const teaPrGet: Info = {
|
||||
name: "tea-pr-get",
|
||||
description: "Get a specific pull request with all details and comments using tea CLI",
|
||||
input: {
|
||||
type: "object",
|
||||
properties: {
|
||||
pullNumber: { type: "number", description: "Pull request number/index" },
|
||||
},
|
||||
required: ["pullNumber"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
async execute(input) {
|
||||
const { pullNumber } = input as { pullNumber: number }
|
||||
const result = await $`tea pulls ${pullNumber} --comments --output json`.text()
|
||||
return { content: result.trim() }
|
||||
},
|
||||
}
|
||||
|
||||
export default teaPrGet
|
||||
Reference in New Issue
Block a user