refactor: fix-borders 升级改名为 fix-meta,新增 trim 破坏识别

- 改名 fix-borders → fix-meta(CLI 子命令 fix-meta;MCP tool meta_fix),名字更通用
- 新增第三类噪音识别:trimType 从 none 被 Cocos 改成自动裁剪(连带 width/height/
  offset/顶点全变)→ 还原该 frame 到 git(恢复不裁剪)。保守:只还原 git=none 的
  明确破坏,不碰 git 本就 auto 的(分不清破坏 vs 真改)
- 三类统一处理:① 纯顺序/格式噪音 ② 九宫格 border 重置 ③ trim 强改

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
furao
2026-06-07 19:00:47 +08:00
parent 7ae2f994cf
commit f54f0762ef
5 changed files with 66 additions and 49 deletions
+3 -3
View File
@@ -309,14 +309,14 @@ function defineTools(ctx) {
},
},
{
name: 'meta_fix_reset_border',
description: '清理 Cocos 重启造成的图片 meta 噪音:① 纯 key 顺序/格式变化(值没变只 git diff 噪音)还原 git 原文;② 九宫格 bordersubMetas.*.userData.border*被重置成 0 精准还原 git 的值。靠 git 对比、正确处理中文路径。dryRun=true 只预览不写。',
name: 'meta_fix',
description: '清理 Cocos 重启造成的图片 meta 噪音(保守,只还原能确认是破坏的):① 纯 key 顺序/格式变化还原 git 原文;② 九宫格 border 被重置成 0 精准还原;③ trimType 从 none 被改成自动裁剪还原该 frame 到 git。靠 git 对比、正确处理中文路径。dryRun=true 只预览不写。',
inputSchema: {
type: 'object',
properties: { dryRun: { type: 'boolean', description: 'true=只预览不写文件,列出将还原的 meta' } },
},
handler: async function (args) {
return local.fixResetBorders({ dryRun: !!(args && args.dryRun) });
return local.fixMeta({ dryRun: !!(args && args.dryRun) });
},
},
];