34 lines
1.2 KiB
TypeScript
34 lines
1.2 KiB
TypeScript
import { tool } from "@opencode-ai/plugin";
|
|
import { executeFrontendAction } from "./frontend_action.js";
|
|
|
|
export default tool({
|
|
description: "打开前端的 SCADA 监测数据历史面板。",
|
|
args: {
|
|
reason: tool.schema
|
|
.string()
|
|
.describe("Why SCADA panel interaction is required for this request."),
|
|
device_ids: tool.schema
|
|
.array(tool.schema.string())
|
|
.optional()
|
|
.describe("Preferred SCADA device ids."),
|
|
device_id: tool.schema
|
|
.string()
|
|
.optional()
|
|
.describe("Single SCADA device id."),
|
|
start_time: tool.schema
|
|
.string()
|
|
.optional()
|
|
.describe("Optional ISO8601 start time."),
|
|
end_time: tool.schema
|
|
.string()
|
|
.optional()
|
|
.describe("Optional ISO8601 end time."),
|
|
result_ref: tool.schema.string().optional().describe("Authorized large monitoring result reference."),
|
|
metrics: tool.schema.array(tool.schema.string()).optional().describe("Metrics represented by the result."),
|
|
granularity: tool.schema.enum(["5m", "1h", "1d"]).optional().describe("Reading aggregation granularity."),
|
|
},
|
|
async execute(args, context) {
|
|
return executeFrontendAction("view_scada", args, context);
|
|
},
|
|
});
|