23 lines
1.1 KiB
TypeScript
23 lines
1.1 KiB
TypeScript
import { tool } from "@opencode-ai/plugin";
|
||
|
||
export default tool({
|
||
description:
|
||
"在前端地图上对 junctions 图层应用分区渲染。先把包装格式 { metadata, location: { file_path }, data: { node_area_map, area_ids?, area_colors? } } 写入 RESULT_REF_IMPORT_DIR,location.file_path 必须等于文件绝对路径;再调用 store_render_ref 获得 res-... 引用,最后把引用传入本工具。不要读取并转传完整 ref 内容,也不要直接传本地文件路径。",
|
||
args: {
|
||
reason: tool.schema
|
||
.string()
|
||
.describe(
|
||
"Why this junction rendering action is needed for the user request.",
|
||
),
|
||
render_ref: tool.schema
|
||
.string()
|
||
.describe(
|
||
"上一步通过 store_render_ref 获得的渲染引用 ID(res-...)。前端会按该引用拉取完整 payload 并渲染。不可直接传入本地文件路径或完整 JSON 数据。",
|
||
),
|
||
},
|
||
async execute() {
|
||
// 工具参数里只需要 render_ref;浏览器端会再用该引用回读完整 payload.data 并完成渲染。
|
||
return "已在地图上应用节点分区渲染。";
|
||
},
|
||
});
|