feat(agent): add frontend action bridge
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import type { Plugin } from "@opencode-ai/plugin";
|
||||
|
||||
export const FRONTEND_ACTION_TOOLS = new Set(["zoom_to_map", "locate_features", "view_history", "view_scada"]);
|
||||
|
||||
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 default frontendActionCallIdPlugin;
|
||||
Reference in New Issue
Block a user