feat: fix-borders 升级为通用 meta 噪音清理 + 修中文路径 bug

- 新增「纯 key 顺序/格式变化(值没变)」检测:还原成 git 原文,消 git diff 噪音
  (Cocos 重启会重排 userData 里 trimType/atlasUuid 等字段位置)
- 修中文路径 bug:git 调用统一加 core.quotePath=false;之前中文名图(如 1公共资源/)
  的 border meta 被 git 引号转义跳过、漏还原,现已覆盖
- border 还原后若整体已等于 git 则直接写 git 原文(连带消顺序噪音)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
furao
2026-06-07 18:45:24 +08:00
parent fc93911d31
commit 7ae2f994cf
3 changed files with 68 additions and 39 deletions
+1 -1
View File
@@ -310,7 +310,7 @@ function defineTools(ctx) {
},
{
name: 'meta_fix_reset_border',
description: '修复 Cocos 重启把图片九宫格 bordersubMetas.*.userData.border*)重置成 0 的 meta:扫 git 改动的 .meta,把「git 有值、工作区被清 0」的 border 还原成 git 的正确值,只动 border 字段、保留 meta 其它改动。dryRun=true 只预览不写。',
description: '清理 Cocos 重启造成的图片 meta 噪音:① 纯 key 顺序/格式变化(值没变只 git diff 噪音)还原成 git 原文;② 九宫格 bordersubMetas.*.userData.border*重置成 0 的精准还原 git 的值。靠 git 对比、正确处理中文路径。dryRun=true 只预览不写。',
inputSchema: {
type: 'object',
properties: { dryRun: { type: 'boolean', description: 'true=只预览不写文件,列出将还原的 meta' } },