文档: 更新并发安全修复记录与 refresh_editor 路径优化

- UPDATE_LOG.md 新增第七章: 指令队列、IPC超时、batchExecute串行化、refresh路径参数
- mcp_freeze_analysis.md 标记为已修复并补充修复措施摘要
- refresh_editor 默认路径改为 db://assets,新增 properties.path 精确刷新支持
This commit is contained in:
火焰库拉
2026-02-12 23:18:02 +08:00
parent 517866e50a
commit bb9a558364
3 changed files with 125 additions and 4 deletions

15
main.js
View File

@@ -399,7 +399,11 @@ const getToolsList = () => {
enum: ["node", "asset"],
description: "目标类型 (用于 set_selection 操作)",
},
properties: { type: "object", description: "操作属性" },
properties: {
type: "object",
description:
"操作属性。refresh_editor 支持 properties.path 指定刷新路径(如 'db://assets/scripts/MyScript.ts' 或 'db://assets/resources')。不传则默认刷新 'db://assets'(全量刷新,大型项目可能耗时数分钟,建议尽量指定具体路径)。",
},
},
required: ["action"],
},
@@ -1531,8 +1535,13 @@ export default class NewScript extends cc.Component {
callback(null, "选中状态已更新");
break;
case "refresh_editor":
// 刷新编辑器
const refreshPath = properties && properties.path ? properties.path : "db://assets/scripts";
// 刷新编辑器资源数据库
// 支持指定路径以避免大型项目全量刷新耗时过长
// 示例: properties.path = 'db://assets/scripts/MyScript.ts' (刷新单个文件)
// properties.path = 'db://assets/resources' (刷新某个目录)
// 不传 (默认 'db://assets',全量刷新)
const refreshPath = properties && properties.path ? properties.path : "db://assets";
addLog("info", `[refresh_editor] 开始刷新: ${refreshPath}`);
Editor.assetdb.refresh(refreshPath, (err) => {
if (err) {
addLog("error", `刷新失败: ${err}`);