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: "为选定的管网要素打开前端的历史记录或计算结果面板。",
@@ -23,8 +24,7 @@ export default tool({
.optional()
.describe("Optional ISO8601 end time."),
},
async execute() {
// 返回短确认即可;面板打开动作由前端根据 tool_call 参数完成。
return "已打开计算结果面板。";
async execute(args, context) {
return executeFrontendAction("view_history", args, context);
},
});