flower-trellis 0.6.13-beta.15 → 0.6.13-beta.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  {
2
- "syncedAt": "2026-11-16T07:48:52.097Z",
2
+ "syncedAt": "2026-11-16T10:37:00.548Z",
3
3
  "syncedFrom": "vendor/skill-garden",
4
4
  "sourceCommit": "d12d725d69473f990ffc6854ad0d08958ea32c46",
5
5
  "common": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flower-trellis",
3
- "version": "0.6.13-beta.15",
3
+ "version": "0.6.13-beta.16",
4
4
  "description": "一键安装/升级 Trellis 并自动融合 skill-garden 强化包(默认 Claude + agents)",
5
5
  "type": "module",
6
6
  "bin": {
@@ -73,9 +73,9 @@
73
73
  "commit-and-tag-version": "^12.7.3"
74
74
  },
75
75
  "flowerReleaseNotes": {
76
- "version": "0.6.13-beta.15",
76
+ "version": "0.6.13-beta.16",
77
77
  "source": "CHANGELOG.md",
78
- "body": "### 🐛 修复 Bug Fixes\n\n* **confirmation:** 分离回合来源并移除多余确认拦截 ([3702d40](https://github.com/SilentFlower/flower-trellis/commit/3702d40b09c2c190a0d421064fca57ae4c81f849))\n* **confirmation:** 支持未绑定任务的 Brief 确认 ([1203748](https://github.com/SilentFlower/flower-trellis/commit/1203748888a536f99f4608797eeda831fdf98557))",
78
+ "body": "### 🐛 修复 Bug Fixes\n\n* **update:** 升级快照排除运行时资料并前置范围判定 ([2cdc2de](https://github.com/SilentFlower/flower-trellis/commit/2cdc2de7233ed17aff3b84af9f5e85a720fccfec))",
79
79
  "truncated": false
80
80
  },
81
81
  "optionalDependencies": {
@@ -36,7 +36,7 @@ function validateRelativePath(relativePath) {
36
36
 
37
37
  function isExcluded(relativePath, directory = false) {
38
38
  const candidate = directory ? `${relativePath.replace(/\/$/, "")}/` : relativePath;
39
- return shouldExcludeFromBackup(candidate);
39
+ return scopeContains(".trellis/.runtime", relativePath) || shouldExcludeFromBackup(candidate);
40
40
  }
41
41
 
42
42
  function assertOrdinaryRoot(projectRoot) {
@@ -120,12 +120,17 @@ function scanScopes(projectRoot, scopes, onFile, options = {}) {
120
120
  scopeContains(scope, relativePath) || scopeContains(relativePath, scope)
121
121
  ));
122
122
 
123
- function walk(absolutePath, relativePath) {
124
- const stat = fs.lstatSync(absolutePath);
123
+ function walk(absolutePath, relativePath, knownStat) {
124
+ const excluded = isExcluded(relativePath, true);
125
+ // 排除范围保存用户资料和运行状态,应在读取节点属性前裁剪。
126
+ if (excluded && !isForced(relativePath)) return;
127
+ const stat = knownStat ?? fs.lstatSync(absolutePath);
125
128
  if (stat.isSymbolicLink()) throw new Error(`Update 受管范围包含软链:${relativePath}`);
126
129
  if (stat.isDirectory()) {
127
- if (isExcluded(relativePath, true) && !isForced(relativePath)) return;
128
- entries.set(relativePath, { path: relativePath, kind: "directory", mode: stat.mode & 0o777 });
130
+ // 仅用于到达精确目标的已排除祖先目录不属于新增路径,补偿时应保留。
131
+ if (!excluded || forcedScopes.some((scope) => scopeContains(scope, relativePath))) {
132
+ entries.set(relativePath, { path: relativePath, kind: "directory", mode: stat.mode & 0o777 });
133
+ }
129
134
  const children = fs.readdirSync(absolutePath, { withFileTypes: true })
130
135
  .sort((left, right) => left.name.localeCompare(right.name));
131
136
  for (const child of children) {
@@ -141,10 +146,22 @@ function scanScopes(projectRoot, scopes, onFile, options = {}) {
141
146
  }
142
147
 
143
148
  for (const scope of scopes) {
149
+ if (isExcluded(scope, true) && !isForced(scope)) continue;
144
150
  if ([...entries.keys()].some((entry) => scope === entry || scope.startsWith(`${entry}/`))) continue;
145
151
  const absolutePath = path.join(projectRoot, ...scope.split("/"));
146
- if (!fs.existsSync(absolutePath)) continue;
147
- walk(absolutePath, scope);
152
+ // 精确路径也需要校验祖先,避免穿过默认未遍历的链接读取项目外资料。
153
+ let parent = projectRoot;
154
+ for (const segment of scope.split("/").slice(0, -1)) {
155
+ parent = path.join(parent, segment);
156
+ const stat = fs.lstatSync(parent, { throwIfNoEntry: false });
157
+ if (!stat) break;
158
+ if (stat.isSymbolicLink() || !stat.isDirectory()) {
159
+ throw new Error(`Update 父路径不是普通目录:${toPosix(path.relative(projectRoot, parent))}`);
160
+ }
161
+ }
162
+ const stat = fs.lstatSync(absolutePath, { throwIfNoEntry: false });
163
+ if (!stat) continue;
164
+ walk(absolutePath, scope, stat);
148
165
  }
149
166
  return [...entries.values()].sort((left, right) => left.path.localeCompare(right.path));
150
167
  }