Files
next-tjwater-agent/.opencode/plugins/frontend-action-call-id.ts
T

15 lines
480 B
TypeScript

import type { Plugin } from "@opencode-ai/plugin";
export const FRONTEND_ACTION_TOOLS = new Set(["zoom_to_map"]);
export const frontendActionCallIdPlugin: Plugin = async () => ({
"tool.execute.before": async (input, output) => {
if (!FRONTEND_ACTION_TOOLS.has(input.tool)) return;
output.args = { ...(output.args ?? {}), __frontend_action_call_id: input.callID };
},
});
export const server = frontendActionCallIdPlugin;
export default frontendActionCallIdPlugin;