From 3f49ef4589b2b7f544df7b8086bd566b10496979 Mon Sep 17 00:00:00 2001 From: Hugo Nijhuis Date: Sun, 3 May 2026 16:35:46 +0200 Subject: [PATCH] feat: add tea-context.ts tool for context helpers (whoami) --- .opencode/tools/tea-context.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .opencode/tools/tea-context.ts diff --git a/.opencode/tools/tea-context.ts b/.opencode/tools/tea-context.ts new file mode 100644 index 0000000..34f82f1 --- /dev/null +++ b/.opencode/tools/tea-context.ts @@ -0,0 +1,19 @@ +import { tool } from "@opencode-ai/plugin" +import { $ } from "bun" + +export const whoami = tool({ + description: "Get current logged-in user info for the Gitea instance", + args: {}, + async execute(args, context) { + try { + const result = await $`tea whoami --output json`.text() + return JSON.parse(result) + } catch (error: any) { + return { + error: "Failed to get current user info", + message: error.message, + stderr: error.stderr?.toString(), + } + } + }, +}) \ No newline at end of file