feat: add tea-notification.ts tool for notifications (notificationList)

This commit is contained in:
2026-05-03 16:35:39 +02:00
parent 27f33ca7c6
commit 622f791149

View File

@@ -0,0 +1,21 @@
import { tool } from "@opencode-ai/plugin"
import { $ } from "bun"
export const notificationList = tool({
description: "List unread notifications including PR reviews, mentions, and other updates",
args: {
limit: tool.schema.number().default(30).describe("Number of notifications to return"),
},
async execute(args, context) {
try {
const result = await $`tea notification list --output json --limit ${args.limit}`.text()
return JSON.parse(result)
} catch (error: any) {
return {
error: "Failed to list notifications",
message: error.message,
stderr: error.stderr?.toString(),
}
}
},
})