31 lines
974 B
TypeScript
31 lines
974 B
TypeScript
import { tool } from "@opencode-ai/plugin";
|
|
import { executeFrontendAction } from "./frontend_action.js";
|
|
|
|
export default tool({
|
|
description: "为选定的管网要素打开前端的历史记录或计算结果面板。",
|
|
args: {
|
|
reason: tool.schema
|
|
.string()
|
|
.describe(
|
|
"Why this history panel should be opened for the current task.",
|
|
),
|
|
feature_infos: tool.schema
|
|
.array(tool.schema.tuple([tool.schema.string(), tool.schema.string()]))
|
|
.describe("List of [id, type] pairs."),
|
|
data_type: tool.schema
|
|
.enum(["realtime", "scheme", "none"])
|
|
.describe("History data source type."),
|
|
start_time: tool.schema
|
|
.string()
|
|
.optional()
|
|
.describe("Optional ISO8601 start time."),
|
|
end_time: tool.schema
|
|
.string()
|
|
.optional()
|
|
.describe("Optional ISO8601 end time."),
|
|
},
|
|
async execute(args, context) {
|
|
return executeFrontendAction("view_history", args, context);
|
|
},
|
|
});
|