feat(agent): add frontend action bridge

This commit is contained in:
2026-07-13 17:26:03 +08:00
parent 4418e99a5c
commit 6b45e7c40c
16 changed files with 447 additions and 14 deletions
+3 -3
View File
@@ -1,4 +1,5 @@
import { tool } from "@opencode-ai/plugin";
import { executeFrontendAction } from "./frontend_action.js";
export default tool({
description: "打开前端的 SCADA 监测数据历史面板。",
@@ -23,8 +24,7 @@ export default tool({
.optional()
.describe("Optional ISO8601 end time."),
},
async execute() {
// SCADA 面板仍在浏览器侧执行,工具结果不承载实际监测数据。
return "已打开 SCADA 监测面板。";
async execute(args, context) {
return executeFrontendAction("view_scada", args, context);
},
});