From 622f791149aa2955313a0a3b266d95c6fb10e569 Mon Sep 17 00:00:00 2001 From: Hugo Nijhuis Date: Sun, 3 May 2026 16:35:39 +0200 Subject: [PATCH] feat: add tea-notification.ts tool for notifications (notificationList) --- .opencode/tools/tea-notification.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .opencode/tools/tea-notification.ts diff --git a/.opencode/tools/tea-notification.ts b/.opencode/tools/tea-notification.ts new file mode 100644 index 0000000..8db7f23 --- /dev/null +++ b/.opencode/tools/tea-notification.ts @@ -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(), + } + } + }, +}) \ No newline at end of file