release-skill 0.9.18 → 0.9.19

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.
Files changed (55) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.codebuddy-plugin/plugin.json +1 -1
  3. package/.codex-plugin/plugin.json +2 -2
  4. package/.cursor-plugin/plugin.json +1 -1
  5. package/.kimi-plugin/plugin.json +1 -1
  6. package/.qoder-plugin/plugin.json +1 -1
  7. package/CHANGELOG.md +34 -0
  8. package/INSTALL.md +12 -2
  9. package/INSTALL.zh-CN.md +10 -3
  10. package/README.md +27 -17
  11. package/README.zh-CN.md +19 -17
  12. package/adapters/claude/.claude-plugin/plugin.json +1 -1
  13. package/adapters/claude/bin/release-skill.bundle.mjs +924 -378
  14. package/adapters/claude/skills/release-finish/SKILL.md +30 -4
  15. package/adapters/claude/skills/release-help/SKILL.md +44 -101
  16. package/adapters/claude/skills/release-verify/SKILL.md +2 -2
  17. package/adapters/codex/.codex-plugin/plugin.json +2 -2
  18. package/adapters/codex/bin/release-skill.bundle.mjs +924 -378
  19. package/adapters/codex/skills/release-finish/SKILL.md +30 -4
  20. package/adapters/codex/skills/release-help/SKILL.md +46 -103
  21. package/adapters/codex/skills/release-verify/SKILL.md +2 -2
  22. package/adapters/cursor/.cursor-plugin/plugin.json +1 -1
  23. package/adapters/cursor/bin/release-skill.bundle.mjs +924 -378
  24. package/adapters/cursor/skills/release-finish/SKILL.md +30 -4
  25. package/adapters/cursor/skills/release-help/SKILL.md +46 -103
  26. package/adapters/cursor/skills/release-verify/SKILL.md +2 -2
  27. package/adapters/kimi/.kimi-plugin/plugin.json +1 -1
  28. package/adapters/kimi/bin/release-skill.bundle.mjs +924 -378
  29. package/adapters/kimi/skills/release-finish/SKILL.md +30 -4
  30. package/adapters/kimi/skills/release-help/SKILL.md +46 -103
  31. package/adapters/kimi/skills/release-verify/SKILL.md +2 -2
  32. package/adapters/qoder/.qoder-plugin/plugin.json +1 -1
  33. package/adapters/qoder/bin/release-skill.bundle.mjs +924 -378
  34. package/adapters/qoder/skills/release-finish/SKILL.md +30 -4
  35. package/adapters/qoder/skills/release-help/SKILL.md +46 -103
  36. package/adapters/qoder/skills/release-verify/SKILL.md +2 -2
  37. package/adapters/workbuddy/.codebuddy-plugin/plugin.json +1 -1
  38. package/adapters/workbuddy/bin/release-skill.bundle.mjs +924 -378
  39. package/adapters/workbuddy/skills/release-finish/SKILL.md +30 -4
  40. package/adapters/workbuddy/skills/release-help/SKILL.md +44 -101
  41. package/adapters/workbuddy/skills/release-verify/SKILL.md +2 -2
  42. package/bin/release-skill-cli.mjs +90 -14
  43. package/bin/release-skill.bundle.mjs +924 -378
  44. package/package.json +1 -1
  45. package/platform-manifest.json +4 -4
  46. package/references/02-project-config.md +4 -0
  47. package/skills/release-finish/SKILL.md +30 -4
  48. package/skills/release-help/SKILL.md +44 -101
  49. package/skills/release-verify/SKILL.md +2 -2
  50. package/skills-src/release-finish/SKILL.md +30 -4
  51. package/skills-src/release-help/SKILL.md +44 -101
  52. package/skills-src/release-verify/SKILL.md +2 -2
  53. package/src/commands/post-release-finish.mjs +448 -0
  54. package/src/commands/post-release-local.mjs +22 -2
  55. package/src/commands/ship.mjs +1 -0
@@ -9,9 +9,9 @@ const __bundlePkgRoot = __bundleResolve(__bundleDirname(__bundleFileURLToPath(im
9
9
  // Provide a real require() for CJS packages bundled into ESM (e.g. yaml, ajv).
10
10
  const __bundleRealRequire = __bundleCreateRequire(import.meta.url);
11
11
  // Package identity injected at build time — closure-independent --version probe.
12
- const __bundlePkg = Object.freeze({"name":"release-skill","version":"0.9.18"});
12
+ const __bundlePkg = Object.freeze({"name":"release-skill","version":"0.9.19"});
13
13
  // Build-time source digest for the BUNDLE_STALE freshness gate (see above).
14
- const __bundleSourceDigest = "9bf830cde9028791cf42aa68d65a8c2e4f05f6a924c4bed6db3d5b33aa459062";
14
+ const __bundleSourceDigest = "643c60e90e1d750af9cdf9032c0b76cba40259d9ccef6a988d0715b5316813bc";
15
15
 
16
16
  var __create = Object.create;
17
17
  var __defProp = Object.defineProperty;
@@ -2577,8 +2577,8 @@ var require_resolve = __commonJS({
2577
2577
  return count;
2578
2578
  }
2579
2579
  __name(countKeys, "countKeys");
2580
- function getFullPath(resolver, id = "", normalize6) {
2581
- if (normalize6 !== false)
2580
+ function getFullPath(resolver, id = "", normalize8) {
2581
+ if (normalize8 !== false)
2582
2582
  id = normalizeId(id);
2583
2583
  const p = resolver.parse(id);
2584
2584
  return _getFullPath(resolver, p);
@@ -3384,7 +3384,7 @@ var require_compile = __commonJS({
3384
3384
  const schOrFunc = root.refs[ref];
3385
3385
  if (schOrFunc)
3386
3386
  return schOrFunc;
3387
- let _sch = resolve43.call(this, root, ref);
3387
+ let _sch = resolve44.call(this, root, ref);
3388
3388
  if (_sch === void 0) {
3389
3389
  const schema2 = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref];
3390
3390
  const { schemaId } = this.opts;
@@ -3415,13 +3415,13 @@ var require_compile = __commonJS({
3415
3415
  return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
3416
3416
  }
3417
3417
  __name(sameSchemaEnv, "sameSchemaEnv");
3418
- function resolve43(root, ref) {
3418
+ function resolve44(root, ref) {
3419
3419
  let sch;
3420
3420
  while (typeof (sch = this.refs[ref]) == "string")
3421
3421
  ref = sch;
3422
3422
  return sch || this.schemas[ref] || resolveSchema.call(this, root, ref);
3423
3423
  }
3424
- __name(resolve43, "resolve");
3424
+ __name(resolve44, "resolve");
3425
3425
  function resolveSchema(root, ref) {
3426
3426
  const p = this.opts.uriResolver.parse(ref);
3427
3427
  const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p);
@@ -4265,7 +4265,7 @@ var require_fast_uri = __commonJS({
4265
4265
  return decodedScheme;
4266
4266
  }
4267
4267
  __name(decodeValidScheme, "decodeValidScheme");
4268
- function normalize6(uri, options) {
4268
+ function normalize8(uri, options) {
4269
4269
  if (typeof uri === "string") {
4270
4270
  uri = /** @type {T} */
4271
4271
  normalizeString(uri, options);
@@ -4275,8 +4275,8 @@ var require_fast_uri = __commonJS({
4275
4275
  }
4276
4276
  return uri;
4277
4277
  }
4278
- __name(normalize6, "normalize");
4279
- function resolve43(baseURI, relativeURI, options) {
4278
+ __name(normalize8, "normalize");
4279
+ function resolve44(baseURI, relativeURI, options) {
4280
4280
  const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
4281
4281
  const {
4282
4282
  parsed: baseParsed,
@@ -4309,7 +4309,7 @@ var require_fast_uri = __commonJS({
4309
4309
  schemelessOptions.skipEscape = true;
4310
4310
  return serialize(resolved, schemelessOptions);
4311
4311
  }
4312
- __name(resolve43, "resolve");
4312
+ __name(resolve44, "resolve");
4313
4313
  function resolveComponent(base, relative35, options, skipNormalization) {
4314
4314
  const target = {};
4315
4315
  if (!skipNormalization) {
@@ -4650,8 +4650,8 @@ var require_fast_uri = __commonJS({
4650
4650
  __name(normalizeComparableURI, "normalizeComparableURI");
4651
4651
  var fastUri = {
4652
4652
  SCHEMES,
4653
- normalize: normalize6,
4654
- resolve: resolve43,
4653
+ normalize: normalize8,
4654
+ resolve: resolve44,
4655
4655
  resolveComponent,
4656
4656
  equal,
4657
4657
  serialize,
@@ -16032,13 +16032,13 @@ var require_lib2 = __commonJS({
16032
16032
  }
16033
16033
  __name(cleanupOnExit, "cleanupOnExit");
16034
16034
  function serializeActiveFile(absoluteName) {
16035
- return new Promise((resolve43) => {
16035
+ return new Promise((resolve44) => {
16036
16036
  if (!activeFiles[absoluteName]) {
16037
16037
  activeFiles[absoluteName] = [];
16038
16038
  }
16039
- activeFiles[absoluteName].push(resolve43);
16039
+ activeFiles[absoluteName].push(resolve44);
16040
16040
  if (activeFiles[absoluteName].length === 1) {
16041
- resolve43();
16041
+ resolve44();
16042
16042
  }
16043
16043
  });
16044
16044
  }
@@ -17336,12 +17336,12 @@ var require_isexe = __commonJS({
17336
17336
  if (typeof Promise !== "function") {
17337
17337
  throw new TypeError("callback not provided");
17338
17338
  }
17339
- return new Promise(function(resolve43, reject) {
17339
+ return new Promise(function(resolve44, reject) {
17340
17340
  isexe(path40, options || {}, function(er, is) {
17341
17341
  if (er) {
17342
17342
  reject(er);
17343
17343
  } else {
17344
- resolve43(is);
17344
+ resolve44(is);
17345
17345
  }
17346
17346
  });
17347
17347
  });
@@ -17405,30 +17405,30 @@ var require_which = __commonJS({
17405
17405
  opt = {};
17406
17406
  const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
17407
17407
  const found = [];
17408
- const step = /* @__PURE__ */ __name((i) => new Promise((resolve43, reject) => {
17408
+ const step2 = /* @__PURE__ */ __name((i) => new Promise((resolve44, reject) => {
17409
17409
  if (i === pathEnv.length)
17410
- return opt.all && found.length ? resolve43(found) : reject(getNotFoundError(cmd));
17410
+ return opt.all && found.length ? resolve44(found) : reject(getNotFoundError(cmd));
17411
17411
  const ppRaw = pathEnv[i];
17412
17412
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
17413
17413
  const pCmd = path40.join(pathPart, cmd);
17414
17414
  const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
17415
- resolve43(subStep(p, i, 0));
17415
+ resolve44(subStep(p, i, 0));
17416
17416
  }), "step");
17417
- const subStep = /* @__PURE__ */ __name((p, i, ii) => new Promise((resolve43, reject) => {
17417
+ const subStep = /* @__PURE__ */ __name((p, i, ii) => new Promise((resolve44, reject) => {
17418
17418
  if (ii === pathExt.length)
17419
- return resolve43(step(i + 1));
17419
+ return resolve44(step2(i + 1));
17420
17420
  const ext = pathExt[ii];
17421
17421
  isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
17422
17422
  if (!er && is) {
17423
17423
  if (opt.all)
17424
17424
  found.push(p + ext);
17425
17425
  else
17426
- return resolve43(p + ext);
17426
+ return resolve44(p + ext);
17427
17427
  }
17428
- return resolve43(subStep(p, i, ii + 1));
17428
+ return resolve44(subStep(p, i, ii + 1));
17429
17429
  });
17430
17430
  }), "subStep");
17431
- return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
17431
+ return cb ? step2(0).then((res) => cb(null, res), cb) : step2(0);
17432
17432
  }, "which");
17433
17433
  var whichSync = /* @__PURE__ */ __name((cmd, opt) => {
17434
17434
  opt = opt || {};
@@ -17501,30 +17501,30 @@ var require_which2 = __commonJS({
17501
17501
  opt = {};
17502
17502
  const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
17503
17503
  const found = [];
17504
- const step = /* @__PURE__ */ __name((i) => new Promise((resolve43, reject) => {
17504
+ const step2 = /* @__PURE__ */ __name((i) => new Promise((resolve44, reject) => {
17505
17505
  if (i === pathEnv.length)
17506
- return opt.all && found.length ? resolve43(found) : reject(getNotFoundError(cmd));
17506
+ return opt.all && found.length ? resolve44(found) : reject(getNotFoundError(cmd));
17507
17507
  const ppRaw = pathEnv[i];
17508
17508
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
17509
17509
  const pCmd = path40.join(pathPart, cmd);
17510
17510
  const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
17511
- resolve43(subStep(p, i, 0));
17511
+ resolve44(subStep(p, i, 0));
17512
17512
  }), "step");
17513
- const subStep = /* @__PURE__ */ __name((p, i, ii) => new Promise((resolve43, reject) => {
17513
+ const subStep = /* @__PURE__ */ __name((p, i, ii) => new Promise((resolve44, reject) => {
17514
17514
  if (ii === pathExt.length)
17515
- return resolve43(step(i + 1));
17515
+ return resolve44(step2(i + 1));
17516
17516
  const ext = pathExt[ii];
17517
17517
  isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
17518
17518
  if (!er && is) {
17519
17519
  if (opt.all)
17520
17520
  found.push(p + ext);
17521
17521
  else
17522
- return resolve43(p + ext);
17522
+ return resolve44(p + ext);
17523
17523
  }
17524
- return resolve43(subStep(p, i, ii + 1));
17524
+ return resolve44(subStep(p, i, ii + 1));
17525
17525
  });
17526
17526
  }), "subStep");
17527
- return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
17527
+ return cb ? step2(0).then((res) => cb(null, res), cb) : step2(0);
17528
17528
  }, "which");
17529
17529
  var whichSync = /* @__PURE__ */ __name((cmd, opt) => {
17530
17530
  opt = opt || {};
@@ -18726,7 +18726,7 @@ var require_kill = __commonJS({
18726
18726
  return spawnedPromise;
18727
18727
  }
18728
18728
  let timeoutId;
18729
- const timeoutPromise = new Promise((resolve43, reject) => {
18729
+ const timeoutPromise = new Promise((resolve44, reject) => {
18730
18730
  timeoutId = setTimeout(() => {
18731
18731
  timeoutKill(spawned, killSignal, reject);
18732
18732
  }, timeout);
@@ -18848,7 +18848,7 @@ var require_get_stream = __commonJS({
18848
18848
  };
18849
18849
  const { maxBuffer } = options;
18850
18850
  const stream2 = bufferStream(options);
18851
- await new Promise((resolve43, reject) => {
18851
+ await new Promise((resolve44, reject) => {
18852
18852
  const rejectPromise = /* @__PURE__ */ __name((error) => {
18853
18853
  if (error && stream2.getBufferedLength() <= BufferConstants.MAX_LENGTH) {
18854
18854
  error.bufferedData = stream2.getBufferedValue();
@@ -18858,7 +18858,7 @@ var require_get_stream = __commonJS({
18858
18858
  (async () => {
18859
18859
  try {
18860
18860
  await streamPipelinePromisified(inputStream, stream2);
18861
- resolve43();
18861
+ resolve44();
18862
18862
  } catch (error) {
18863
18863
  rejectPromise(error);
18864
18864
  }
@@ -19019,9 +19019,9 @@ var require_promise = __commonJS({
19019
19019
  return spawned;
19020
19020
  }, "mergePromise");
19021
19021
  var getSpawnedPromise = /* @__PURE__ */ __name((spawned) => {
19022
- return new Promise((resolve43, reject) => {
19022
+ return new Promise((resolve44, reject) => {
19023
19023
  spawned.on("exit", (exitCode, signal) => {
19024
- resolve43({ exitCode, signal });
19024
+ resolve44({ exitCode, signal });
19025
19025
  });
19026
19026
  spawned.on("error", (error) => {
19027
19027
  reject(error);
@@ -21140,10 +21140,10 @@ var require_commonjs = __commonJS({
21140
21140
  * Return a void Promise that resolves once the stream ends.
21141
21141
  */
21142
21142
  async promise() {
21143
- return new Promise((resolve43, reject) => {
21143
+ return new Promise((resolve44, reject) => {
21144
21144
  this.on(DESTROYED, () => reject(new Error("stream destroyed")));
21145
21145
  this.on("error", (er) => reject(er));
21146
- this.on("end", () => resolve43());
21146
+ this.on("end", () => resolve44());
21147
21147
  });
21148
21148
  }
21149
21149
  /**
@@ -21167,7 +21167,7 @@ var require_commonjs = __commonJS({
21167
21167
  return Promise.resolve({ done: false, value: res });
21168
21168
  if (this[EOF])
21169
21169
  return stop();
21170
- let resolve43;
21170
+ let resolve44;
21171
21171
  let reject;
21172
21172
  const onerr = /* @__PURE__ */ __name((er) => {
21173
21173
  this.off("data", ondata);
@@ -21181,19 +21181,19 @@ var require_commonjs = __commonJS({
21181
21181
  this.off("end", onend);
21182
21182
  this.off(DESTROYED, ondestroy);
21183
21183
  this.pause();
21184
- resolve43({ value, done: !!this[EOF] });
21184
+ resolve44({ value, done: !!this[EOF] });
21185
21185
  }, "ondata");
21186
21186
  const onend = /* @__PURE__ */ __name(() => {
21187
21187
  this.off("error", onerr);
21188
21188
  this.off("data", ondata);
21189
21189
  this.off(DESTROYED, ondestroy);
21190
21190
  stop();
21191
- resolve43({ done: true, value: void 0 });
21191
+ resolve44({ done: true, value: void 0 });
21192
21192
  }, "onend");
21193
21193
  const ondestroy = /* @__PURE__ */ __name(() => onerr(new Error("stream destroyed")), "ondestroy");
21194
21194
  return new Promise((res2, rej) => {
21195
21195
  reject = rej;
21196
- resolve43 = res2;
21196
+ resolve44 = res2;
21197
21197
  this.once(DESTROYED, ondestroy);
21198
21198
  this.once("error", onerr);
21199
21199
  this.once("end", onend);
@@ -21659,7 +21659,7 @@ var require_lib9 = __commonJS({
21659
21659
  module.exports.fromStream = fromStream;
21660
21660
  function fromStream(stream, opts) {
21661
21661
  const istream = integrityStream(opts);
21662
- return new Promise((resolve43, reject) => {
21662
+ return new Promise((resolve44, reject) => {
21663
21663
  stream.pipe(istream);
21664
21664
  stream.on("error", reject);
21665
21665
  istream.on("error", reject);
@@ -21667,7 +21667,7 @@ var require_lib9 = __commonJS({
21667
21667
  istream.on("integrity", (s) => {
21668
21668
  sri = s;
21669
21669
  });
21670
- istream.on("end", () => resolve43(sri));
21670
+ istream.on("end", () => resolve44(sri));
21671
21671
  istream.resume();
21672
21672
  });
21673
21673
  }
@@ -21728,7 +21728,7 @@ var require_lib9 = __commonJS({
21728
21728
  ));
21729
21729
  }
21730
21730
  const checker = integrityStream(opts);
21731
- return new Promise((resolve43, reject) => {
21731
+ return new Promise((resolve44, reject) => {
21732
21732
  stream.pipe(checker);
21733
21733
  stream.on("error", reject);
21734
21734
  checker.on("error", reject);
@@ -21736,7 +21736,7 @@ var require_lib9 = __commonJS({
21736
21736
  checker.on("verified", (s) => {
21737
21737
  verified = s;
21738
21738
  });
21739
- checker.on("end", () => resolve43(verified));
21739
+ checker.on("end", () => resolve44(verified));
21740
21740
  checker.resume();
21741
21741
  });
21742
21742
  }
@@ -23903,7 +23903,7 @@ var require_lib11 = __commonJS({
23903
23903
  return mod && mod.__esModule ? mod : { "default": mod };
23904
23904
  };
23905
23905
  Object.defineProperty(exports, "__esModule", { value: true });
23906
- exports.isAbsolute = isAbsolute32;
23906
+ exports.isAbsolute = isAbsolute34;
23907
23907
  exports.indexOfDepPathSuffix = indexOfDepPathSuffix;
23908
23908
  exports.parseDepPath = parseDepPath;
23909
23909
  exports.removeSuffix = removeSuffix;
@@ -23917,10 +23917,10 @@ var require_lib11 = __commonJS({
23917
23917
  exports.createPeerDepGraphHash = createPeerDepGraphHash;
23918
23918
  var crypto_hash_1 = require_lib10();
23919
23919
  var semver_1 = __importDefault(require_semver2());
23920
- function isAbsolute32(dependencyPath) {
23920
+ function isAbsolute34(dependencyPath) {
23921
23921
  return dependencyPath[0] !== "/";
23922
23922
  }
23923
- __name(isAbsolute32, "isAbsolute");
23923
+ __name(isAbsolute34, "isAbsolute");
23924
23924
  function indexOfDepPathSuffix(depPath) {
23925
23925
  if (!depPath.endsWith(")"))
23926
23926
  return { peersIndex: -1, patchHashIndex: -1 };
@@ -24906,14 +24906,14 @@ var require_reduce = __commonJS({
24906
24906
  }
24907
24907
  __name(_arrayReduce, "_arrayReduce");
24908
24908
  function _iterableReduce(xf, acc, iter) {
24909
- var step = iter.next();
24910
- while (!step.done) {
24911
- acc = xf["@@transducer/step"](acc, step.value);
24909
+ var step2 = iter.next();
24910
+ while (!step2.done) {
24911
+ acc = xf["@@transducer/step"](acc, step2.value);
24912
24912
  if (acc && acc["@@transducer/reduced"]) {
24913
24913
  acc = acc["@@transducer/value"];
24914
24914
  break;
24915
24915
  }
24916
- step = iter.next();
24916
+ step2 = iter.next();
24917
24917
  }
24918
24918
  return xf["@@transducer/result"](acc);
24919
24919
  }
@@ -25382,9 +25382,9 @@ var require_write = __commonJS({
25382
25382
  var lockfileName_js_1 = require_lockfileName();
25383
25383
  var lockfileFormatConverters_js_1 = require_lockfileFormatConverters();
25384
25384
  async function writeFileAtomic2(filename, data) {
25385
- return new Promise((resolve43, reject) => {
25385
+ return new Promise((resolve44, reject) => {
25386
25386
  (0, write_file_atomic_1.default)(filename, data, {}, (err) => {
25387
- err != null ? reject(err) : resolve43();
25387
+ err != null ? reject(err) : resolve44();
25388
25388
  });
25389
25389
  });
25390
25390
  }
@@ -25490,14 +25490,14 @@ var require_existsWantedLockfile = __commonJS({
25490
25490
  mergeGitBranchLockfiles: false
25491
25491
  }) {
25492
25492
  const wantedLockfile = await (0, lockfileName_js_1.getWantedLockfileName)(opts);
25493
- return new Promise((resolve43, reject) => {
25493
+ return new Promise((resolve44, reject) => {
25494
25494
  fs_1.default.access(path_1.default.join(pkgPath, wantedLockfile), (err) => {
25495
25495
  if (err == null) {
25496
- resolve43(true);
25496
+ resolve44(true);
25497
25497
  return;
25498
25498
  }
25499
25499
  if (err.code === "ENOENT") {
25500
- resolve43(false);
25500
+ resolve44(false);
25501
25501
  return;
25502
25502
  }
25503
25503
  reject(err);
@@ -34434,21 +34434,21 @@ async function superviseProcess(options, deps = {}) {
34434
34434
  let tickInFlight = false;
34435
34435
  let resolveLifecycle;
34436
34436
  let rejectLifecycle;
34437
- const lifecyclePromise = new Promise((resolve43, reject) => {
34438
- resolveLifecycle = resolve43;
34437
+ const lifecyclePromise = new Promise((resolve44, reject) => {
34438
+ resolveLifecycle = resolve44;
34439
34439
  rejectLifecycle = reject;
34440
34440
  });
34441
34441
  let resolveChildClosed;
34442
34442
  let resolveStdoutClosed;
34443
34443
  let resolveStderrClosed;
34444
- const childClosed = new Promise((resolve43) => {
34445
- resolveChildClosed = resolve43;
34444
+ const childClosed = new Promise((resolve44) => {
34445
+ resolveChildClosed = resolve44;
34446
34446
  });
34447
- const stdoutClosed = new Promise((resolve43) => {
34448
- resolveStdoutClosed = resolve43;
34447
+ const stdoutClosed = new Promise((resolve44) => {
34448
+ resolveStdoutClosed = resolve44;
34449
34449
  });
34450
- const stderrClosed = new Promise((resolve43) => {
34451
- resolveStderrClosed = resolve43;
34450
+ const stderrClosed = new Promise((resolve44) => {
34451
+ resolveStderrClosed = resolve44;
34452
34452
  });
34453
34453
  let child;
34454
34454
  try {
@@ -39937,15 +39937,15 @@ import path33 from "node:path";
39937
39937
  function nativeStage(name, commands) {
39938
39938
  return Object.freeze({
39939
39939
  name,
39940
- commands: Object.freeze(commands.map(({ step, args: args2 }) => Object.freeze({ step, args: Object.freeze(args2) }))),
39940
+ commands: Object.freeze(commands.map(({ step: step2, args: args2 }) => Object.freeze({ step: step2, args: Object.freeze(args2) }))),
39941
39941
  treeRoles: NATIVE_TREE_ROLES[name]
39942
39942
  });
39943
39943
  }
39944
39944
  function qoderNativeLifecyclePlan({ request, roots, prompt }) {
39945
39945
  const global2 = ["--cwd", roots.workspaceRoot, "--config-dir", roots.temporaryRoot];
39946
39946
  const plugin = `${request.source.pluginId}@${request.source.marketplaceId}`;
39947
- const invoke = /* @__PURE__ */ __name((step) => ({ step, args: [...global2, "-p", "-o", "json", "--no-session-persistence", prompt] }), "invoke");
39948
- const manage = /* @__PURE__ */ __name((step, ...args2) => ({ step, args: [...global2, "plugins", ...args2] }), "manage");
39947
+ const invoke = /* @__PURE__ */ __name((step2) => ({ step: step2, args: [...global2, "-p", "-o", "json", "--no-session-persistence", prompt] }), "invoke");
39948
+ const manage = /* @__PURE__ */ __name((step2, ...args2) => ({ step: step2, args: [...global2, "plugins", ...args2] }), "manage");
39949
39949
  return Object.freeze([
39950
39950
  nativeStage("preflight", [{ step: "version-probe", args: ["--version"] }]),
39951
39951
  nativeStage("validate-v1", [manage("plugin-validate", "validate", roots.sourceRoot, "--json", "--strict")]),
@@ -39975,8 +39975,8 @@ function qoderNativeLifecyclePlan({ request, roots, prompt }) {
39975
39975
  }
39976
39976
  function workBuddyNativeLifecyclePlan({ request, roots, prompt }) {
39977
39977
  const plugin = `${request.source.pluginId}@${request.source.marketplaceId}`;
39978
- const invoke = /* @__PURE__ */ __name((step) => ({ step, args: ["-p", prompt, "--output-format", "stream-json", "--permission-mode", "dontAsk", "--no-session-persistence"] }), "invoke");
39979
- const manage = /* @__PURE__ */ __name((step, ...args2) => ({ step, args: ["plugin", ...args2] }), "manage");
39978
+ const invoke = /* @__PURE__ */ __name((step2) => ({ step: step2, args: ["-p", prompt, "--output-format", "stream-json", "--permission-mode", "dontAsk", "--no-session-persistence"] }), "invoke");
39979
+ const manage = /* @__PURE__ */ __name((step2, ...args2) => ({ step: step2, args: ["plugin", ...args2] }), "manage");
39980
39980
  return Object.freeze([
39981
39981
  nativeStage("preflight", [{ step: "version-probe", args: ["--version"] }]),
39982
39982
  nativeStage("validate-v1", [manage("plugin-validate", "validate", roots.sourceRoot)]),
@@ -40007,7 +40007,7 @@ function workBuddyNativeLifecyclePlan({ request, roots, prompt }) {
40007
40007
  function ownKeys2(value) {
40008
40008
  return value && typeof value === "object" && !Array.isArray(value) ? Object.keys(value).sort().join(",") : "";
40009
40009
  }
40010
- function evaluateControlledNativeLifecycleFixture({ bytes, hostId, stage, step } = {}) {
40010
+ function evaluateControlledNativeLifecycleFixture({ bytes, hostId, stage, step: step2 } = {}) {
40011
40011
  let text;
40012
40012
  try {
40013
40013
  text = new TextDecoder("utf-8", { fatal: true }).decode(bytes);
@@ -40022,10 +40022,10 @@ function evaluateControlledNativeLifecycleFixture({ bytes, hostId, stage, step }
40022
40022
  } catch {
40023
40023
  return Object.freeze({ status: "indeterminate" });
40024
40024
  }
40025
- if (ownKeys2(event) !== "hostId,invocation,protocol,stage,stageCode,step" || event.protocol !== CONTROLLED_NATIVE_LIFECYCLE_FIXTURE_PROTOCOL || event.hostId !== hostId || event.stage !== stage || event.step !== step || !Array.isArray(event.invocation)) {
40025
+ if (ownKeys2(event) !== "hostId,invocation,protocol,stage,stageCode,step" || event.protocol !== CONTROLLED_NATIVE_LIFECYCLE_FIXTURE_PROTOCOL || event.hostId !== hostId || event.stage !== stage || event.step !== step2 || !Array.isArray(event.invocation)) {
40026
40026
  return Object.freeze({ status: "indeterminate" });
40027
40027
  }
40028
- const invocationStep = step.includes("invoke");
40028
+ const invocationStep = step2.includes("invoke");
40029
40029
  if (!invocationStep && event.invocation.length !== 0) return Object.freeze({ status: "indeterminate" });
40030
40030
  if (invocationStep) {
40031
40031
  if (event.invocation.length !== 1 || ownKeys2(event.invocation[0]) !== "callId,result") {
@@ -40035,7 +40035,7 @@ function evaluateControlledNativeLifecycleFixture({ bytes, hostId, stage, step }
40035
40035
  if (typeof pair.callId !== "string" || pair.callId.length === 0 || ownKeys2(pair.result) !== "callId,outcome" || pair.result.callId !== pair.callId || !["blocked", "succeeded"].includes(pair.result.outcome)) {
40036
40036
  return Object.freeze({ status: "indeterminate" });
40037
40037
  }
40038
- const expectedOutcome = step === "plugin-invoke-negative" ? "blocked" : "succeeded";
40038
+ const expectedOutcome = step2 === "plugin-invoke-negative" ? "blocked" : "succeeded";
40039
40039
  if (pair.result.outcome !== expectedOutcome) return Object.freeze({ status: "failed" });
40040
40040
  }
40041
40041
  if (event.stageCode === `${stage}:ok`) return Object.freeze({ status: "observed" });
@@ -41449,8 +41449,8 @@ function assertRootIsolation2(roots, sourceRoot, hostsRoot) {
41449
41449
  if (roots.existingUserStateRoot && contained(roots.existingUserStateRoot, write)) throw fail4("existing user state root overlaps a write root");
41450
41450
  }
41451
41451
  }
41452
- function commandObservation(step, envelope, streams, limits) {
41453
- return { step, execution: { spawned: envelope?.evidence?.pid !== void 0, exitStatus: envelope?.exitStatus ?? null, processStatus: envelope?.processStatus ?? null, terminationReason: envelope?.terminationReason ?? null, watchdogReason: envelope?.watchdogReason ?? null, runnerModelOverrideAbsent: true }, streams: streams || null, outputByteLimits: limits || null, outputLimitExceeded: envelope?.evidence?.outputLimitExceeded ?? null };
41452
+ function commandObservation(step2, envelope, streams, limits) {
41453
+ return { step: step2, execution: { spawned: envelope?.evidence?.pid !== void 0, exitStatus: envelope?.exitStatus ?? null, processStatus: envelope?.processStatus ?? null, terminationReason: envelope?.terminationReason ?? null, watchdogReason: envelope?.watchdogReason ?? null, runnerModelOverrideAbsent: true }, streams: streams || null, outputByteLimits: limits || null, outputLimitExceeded: envelope?.evidence?.outputLimitExceeded ?? null };
41454
41454
  }
41455
41455
  async function observeTreeSafe(root, rootBinding2) {
41456
41456
  try {
@@ -41508,10 +41508,10 @@ function qualifiedPluginId(channel) {
41508
41508
  if (!simple.test(channel.pluginId) || !simple.test(channel.marketplaceId)) throw fail4("channel identities must be simple plugin and marketplace names");
41509
41509
  return `${channel.pluginId}@${channel.marketplaceId}`;
41510
41510
  }
41511
- function argsFor(driver, step, channel, locator) {
41511
+ function argsFor(driver, step2, channel, locator) {
41512
41512
  const id = qualifiedPluginId(channel);
41513
- if (step === "marketplace-add") return driver.hostId === "claude" ? ["plugin", "marketplace", "add", locator] : ["plugin", "marketplace", "add", locator, "--ref", channel.sourceRef, "--json"];
41514
- if (step === "plugin-install") return driver.hostId === "claude" ? ["plugin", "install", id] : ["plugin", "add", id, "--json"];
41513
+ if (step2 === "marketplace-add") return driver.hostId === "claude" ? ["plugin", "marketplace", "add", locator] : ["plugin", "marketplace", "add", locator, "--ref", channel.sourceRef, "--json"];
41514
+ if (step2 === "plugin-install") return driver.hostId === "claude" ? ["plugin", "install", id] : ["plugin", "add", id, "--json"];
41515
41515
  return ["plugin", "list", "--json"];
41516
41516
  }
41517
41517
  function channelEnvironment(driver, roots) {
@@ -41577,11 +41577,11 @@ async function runChannel(request, bindings, preflight, facts) {
41577
41577
  if (cause.commandObservation) facts.input.probe = cause.commandObservation;
41578
41578
  return finish(cause?.code === "SFC2004" ? "indeterminate" : "rejected", cause?.code === "SFC2004" ? "boundary-state-indeterminate" : "executable-observation-mismatch");
41579
41579
  }
41580
- for (const step of ["marketplace-add", "plugin-install", "plugin-list"]) {
41580
+ for (const step2 of ["marketplace-add", "plugin-install", "plugin-list"]) {
41581
41581
  try {
41582
- const run6 = await runCommand({ step, command: executablePath, args: argsFor(driver, step, request.source.channel, bindings.channelLocator) }, temporary, timeoutPolicy, limits, path35.join(evidence, step), env);
41582
+ const run6 = await runCommand({ step: step2, command: executablePath, args: argsFor(driver, step2, request.source.channel, bindings.channelLocator) }, temporary, timeoutPolicy, limits, path35.join(evidence, step2), env);
41583
41583
  recordCommand(run6.observation);
41584
- outputs[step] = run6.stdout;
41584
+ outputs[step2] = run6.stdout;
41585
41585
  if (run6.envelope.ok !== true || run6.observation.outputLimitExceeded !== null) return finish("failed", "execution-failed");
41586
41586
  } catch (cause) {
41587
41587
  if (cause.commandObservation) recordCommand(cause.commandObservation);
@@ -47557,16 +47557,16 @@ function validatePostPublishDeclaration(postPublish, options = {}) {
47557
47557
  fail5(`${unitLabel}steps must be an array`);
47558
47558
  }
47559
47559
  const stepNames = /* @__PURE__ */ new Set();
47560
- postPublish.steps.forEach((step, index) => {
47560
+ postPublish.steps.forEach((step2, index) => {
47561
47561
  const where = `${unitLabel}steps[${index}]`;
47562
- validateHookCommand(where, step);
47563
- if (typeof step.name !== "string" || !SAFE_ID_RE2.test(step.name)) {
47564
- fail5(`${where}.name must match /^[a-z0-9][a-z0-9._-]*$/`, { name: step?.name });
47562
+ validateHookCommand(where, step2);
47563
+ if (typeof step2.name !== "string" || !SAFE_ID_RE2.test(step2.name)) {
47564
+ fail5(`${where}.name must match /^[a-z0-9][a-z0-9._-]*$/`, { name: step2?.name });
47565
47565
  }
47566
- if (stepNames.has(step.name)) {
47567
- fail5(`${unitLabel}duplicate step name "${step.name}"`);
47566
+ if (stepNames.has(step2.name)) {
47567
+ fail5(`${unitLabel}duplicate step name "${step2.name}"`);
47568
47568
  }
47569
- stepNames.add(step.name);
47569
+ stepNames.add(step2.name);
47570
47570
  });
47571
47571
  }
47572
47572
  if (postPublish.assertMainVersionAhead !== void 0 && typeof postPublish.assertMainVersionAhead !== "boolean") {
@@ -55386,12 +55386,12 @@ var require_body = __commonJS({
55386
55386
  if (resTimeout && resTimeout.unref) {
55387
55387
  resTimeout.unref();
55388
55388
  }
55389
- return new Promise((resolve43) => {
55389
+ return new Promise((resolve44) => {
55390
55390
  if (stream !== upstream) {
55391
55391
  upstream.on("error", (er) => stream.emit("error", er));
55392
55392
  upstream.pipe(stream);
55393
55393
  }
55394
- resolve43();
55394
+ resolve44();
55395
55395
  }).then(() => stream.concat()).then((buf) => {
55396
55396
  clearTimeout(resTimeout);
55397
55397
  return buf;
@@ -56157,7 +56157,7 @@ var require_lib20 = __commonJS({
56157
56157
  var fetch = /* @__PURE__ */ __name(async (url, opts) => {
56158
56158
  if (/^data:/.test(url)) {
56159
56159
  const request = new Request(url, opts);
56160
- return Promise.resolve().then(() => new Promise((resolve43, reject) => {
56160
+ return Promise.resolve().then(() => new Promise((resolve44, reject) => {
56161
56161
  let type, data;
56162
56162
  try {
56163
56163
  const { pathname, search } = new URL2(url);
@@ -56181,10 +56181,10 @@ var require_lib20 = __commonJS({
56181
56181
  if (type) {
56182
56182
  headers["Content-Type"] = type;
56183
56183
  }
56184
- return resolve43(new Response(data, { headers }));
56184
+ return resolve44(new Response(data, { headers }));
56185
56185
  }));
56186
56186
  }
56187
- return new Promise((resolve43, reject) => {
56187
+ return new Promise((resolve44, reject) => {
56188
56188
  const request = new Request(url, opts);
56189
56189
  let options;
56190
56190
  try {
@@ -56303,7 +56303,7 @@ var require_lib20 = __commonJS({
56303
56303
  requestOpts.body = void 0;
56304
56304
  requestOpts.headers.delete("content-length");
56305
56305
  }
56306
- resolve43(fetch(new Request(locationURL, requestOpts)));
56306
+ resolve44(fetch(new Request(locationURL, requestOpts)));
56307
56307
  finalize();
56308
56308
  return;
56309
56309
  }
@@ -56331,7 +56331,7 @@ var require_lib20 = __commonJS({
56331
56331
  const codings = headers.get("Content-Encoding");
56332
56332
  if (!request.compress || request.method === "HEAD" || codings === null || res.statusCode === 204 || res.statusCode === 304) {
56333
56333
  response = new Response(body, responseOptions);
56334
- resolve43(response);
56334
+ resolve44(response);
56335
56335
  return;
56336
56336
  }
56337
56337
  const zlibOptions = {
@@ -56350,7 +56350,7 @@ var require_lib20 = __commonJS({
56350
56350
  ).pipe(unzip),
56351
56351
  responseOptions
56352
56352
  );
56353
- resolve43(response);
56353
+ resolve44(response);
56354
56354
  return;
56355
56355
  }
56356
56356
  if (codings === "deflate" || codings === "x-deflate") {
@@ -56362,7 +56362,7 @@ var require_lib20 = __commonJS({
56362
56362
  (er) => decoder3.emit("error", er)
56363
56363
  ).pipe(decoder3);
56364
56364
  response = new Response(decoder3, responseOptions);
56365
- resolve43(response);
56365
+ resolve44(response);
56366
56366
  });
56367
56367
  return;
56368
56368
  }
@@ -56380,11 +56380,11 @@ var require_lib20 = __commonJS({
56380
56380
  (er) => decoder2.emit("error", er)
56381
56381
  ).pipe(decoder2);
56382
56382
  response = new Response(decoder2, responseOptions);
56383
- resolve43(response);
56383
+ resolve44(response);
56384
56384
  return;
56385
56385
  }
56386
56386
  response = new Response(body, responseOptions);
56387
- resolve43(response);
56387
+ resolve44(response);
56388
56388
  });
56389
56389
  writeToStream(req, request);
56390
56390
  });
@@ -56642,12 +56642,12 @@ var require_lib21 = __commonJS({
56642
56642
  return process.emit("input", "end", ...args2);
56643
56643
  }, "end"),
56644
56644
  read: /* @__PURE__ */ __name(function(...args2) {
56645
- let resolve43, reject;
56645
+ let resolve44, reject;
56646
56646
  const promise = new Promise((_resolve, _reject) => {
56647
- resolve43 = _resolve;
56647
+ resolve44 = _resolve;
56648
56648
  reject = _reject;
56649
56649
  });
56650
- process.emit("input", "read", resolve43, reject, ...args2);
56650
+ process.emit("input", "read", resolve44, reject, ...args2);
56651
56651
  return promise;
56652
56652
  }, "read")
56653
56653
  }
@@ -58287,7 +58287,7 @@ var require_npa = __commonJS({
58287
58287
  spec = arg;
58288
58288
  }
58289
58289
  }
58290
- return resolve43(name, spec, where, arg);
58290
+ return resolve44(name, spec, where, arg);
58291
58291
  }
58292
58292
  __name(npa, "npa");
58293
58293
  function isFileSpec(spec) {
@@ -58310,7 +58310,7 @@ var require_npa = __commonJS({
58310
58310
  return spec.toLowerCase().startsWith("npm:");
58311
58311
  }
58312
58312
  __name(isAliasSpec, "isAliasSpec");
58313
- function resolve43(name, spec, where, arg) {
58313
+ function resolve44(name, spec, where, arg) {
58314
58314
  const res = new Result({
58315
58315
  raw: arg,
58316
58316
  name,
@@ -58342,7 +58342,7 @@ var require_npa = __commonJS({
58342
58342
  return fromRegistry(res);
58343
58343
  }
58344
58344
  }
58345
- __name(resolve43, "resolve");
58345
+ __name(resolve44, "resolve");
58346
58346
  function toPurl(arg, reg = defaultRegistry) {
58347
58347
  const res = npa(arg);
58348
58348
  if (res.type !== "version") {
@@ -58643,7 +58643,7 @@ var require_npa = __commonJS({
58643
58643
  }
58644
58644
  __name(fromRegistry, "fromRegistry");
58645
58645
  module.exports = npa;
58646
- module.exports.resolve = resolve43;
58646
+ module.exports.resolve = resolve44;
58647
58647
  module.exports.toPurl = toPurl;
58648
58648
  module.exports.Result = Result;
58649
58649
  }
@@ -60431,7 +60431,7 @@ var require_lib25 = __commonJS({
60431
60431
  module.exports.fromStream = fromStream;
60432
60432
  function fromStream(stream, opts) {
60433
60433
  const istream = integrityStream(opts);
60434
- return new Promise((resolve43, reject) => {
60434
+ return new Promise((resolve44, reject) => {
60435
60435
  stream.pipe(istream);
60436
60436
  stream.on("error", reject);
60437
60437
  istream.on("error", reject);
@@ -60439,7 +60439,7 @@ var require_lib25 = __commonJS({
60439
60439
  istream.on("integrity", (s) => {
60440
60440
  sri = s;
60441
60441
  });
60442
- istream.on("end", () => resolve43(sri));
60442
+ istream.on("end", () => resolve44(sri));
60443
60443
  istream.resume();
60444
60444
  });
60445
60445
  }
@@ -60500,7 +60500,7 @@ var require_lib25 = __commonJS({
60500
60500
  ));
60501
60501
  }
60502
60502
  const checker = integrityStream(opts);
60503
- return new Promise((resolve43, reject) => {
60503
+ return new Promise((resolve44, reject) => {
60504
60504
  stream.pipe(checker);
60505
60505
  stream.on("error", reject);
60506
60506
  checker.on("error", reject);
@@ -60508,7 +60508,7 @@ var require_lib25 = __commonJS({
60508
60508
  checker.on("verified", (s) => {
60509
60509
  verified = s;
60510
60510
  });
60511
- checker.on("end", () => resolve43(verified));
60511
+ checker.on("end", () => resolve44(verified));
60512
60512
  checker.resume();
60513
60513
  });
60514
60514
  }
@@ -61146,10 +61146,10 @@ var require_minipass = __commonJS({
61146
61146
  }
61147
61147
  // stream.promise().then(() => done, er => emitted error)
61148
61148
  promise() {
61149
- return new Promise((resolve43, reject) => {
61149
+ return new Promise((resolve44, reject) => {
61150
61150
  this.on(DESTROYED, () => reject(new Error("stream destroyed")));
61151
61151
  this.on("error", (er) => reject(er));
61152
- this.on("end", () => resolve43());
61152
+ this.on("end", () => resolve44());
61153
61153
  });
61154
61154
  }
61155
61155
  // for await (let chunk of stream)
@@ -61160,7 +61160,7 @@ var require_minipass = __commonJS({
61160
61160
  return Promise.resolve({ done: false, value: res });
61161
61161
  if (this[EOF])
61162
61162
  return Promise.resolve({ done: true });
61163
- let resolve43 = null;
61163
+ let resolve44 = null;
61164
61164
  let reject = null;
61165
61165
  const onerr = /* @__PURE__ */ __name((er) => {
61166
61166
  this.removeListener("data", ondata);
@@ -61171,17 +61171,17 @@ var require_minipass = __commonJS({
61171
61171
  this.removeListener("error", onerr);
61172
61172
  this.removeListener("end", onend);
61173
61173
  this.pause();
61174
- resolve43({ value, done: !!this[EOF] });
61174
+ resolve44({ value, done: !!this[EOF] });
61175
61175
  }, "ondata");
61176
61176
  const onend = /* @__PURE__ */ __name(() => {
61177
61177
  this.removeListener("error", onerr);
61178
61178
  this.removeListener("data", ondata);
61179
- resolve43({ done: true });
61179
+ resolve44({ done: true });
61180
61180
  }, "onend");
61181
61181
  const ondestroy = /* @__PURE__ */ __name(() => onerr(new Error("stream destroyed")), "ondestroy");
61182
61182
  return new Promise((res2, rej) => {
61183
61183
  reject = rej;
61184
- resolve43 = res2;
61184
+ resolve44 = res2;
61185
61185
  this.once(DESTROYED, ondestroy);
61186
61186
  this.once("error", onerr);
61187
61187
  this.once("end", onend);
@@ -61654,11 +61654,11 @@ var require_polyfill = __commonJS({
61654
61654
  utimes
61655
61655
  } = __require("fs/promises");
61656
61656
  var {
61657
- dirname: dirname27,
61658
- isAbsolute: isAbsolute32,
61657
+ dirname: dirname28,
61658
+ isAbsolute: isAbsolute34,
61659
61659
  join: join50,
61660
61660
  parse: parse2,
61661
- resolve: resolve43,
61661
+ resolve: resolve44,
61662
61662
  sep: sep11,
61663
61663
  toNamespacedPath
61664
61664
  } = __require("path");
@@ -61758,7 +61758,7 @@ var require_polyfill = __commonJS({
61758
61758
  }
61759
61759
  __name(getStats, "getStats");
61760
61760
  async function checkParentDir(destStat, src, dest, opts) {
61761
- const destParent = dirname27(dest);
61761
+ const destParent = dirname28(dest);
61762
61762
  const dirExists = await pathExists2(destParent);
61763
61763
  if (dirExists) {
61764
61764
  return getStatsForCopy(destStat, src, dest, opts);
@@ -61776,8 +61776,8 @@ var require_polyfill = __commonJS({
61776
61776
  }
61777
61777
  __name(pathExists2, "pathExists");
61778
61778
  async function checkParentPaths(src, srcStat, dest) {
61779
- const srcParent = resolve43(dirname27(src));
61780
- const destParent = resolve43(dirname27(dest));
61779
+ const srcParent = resolve44(dirname28(src));
61780
+ const destParent = resolve44(dirname28(dest));
61781
61781
  if (destParent === srcParent || destParent === parse2(destParent).root) {
61782
61782
  return;
61783
61783
  }
@@ -61801,7 +61801,7 @@ var require_polyfill = __commonJS({
61801
61801
  return checkParentPaths(src, srcStat, destParent);
61802
61802
  }
61803
61803
  __name(checkParentPaths, "checkParentPaths");
61804
- var normalizePathToArray = /* @__PURE__ */ __name((path40) => resolve43(path40).split(sep11).filter(Boolean), "normalizePathToArray");
61804
+ var normalizePathToArray = /* @__PURE__ */ __name((path40) => resolve44(path40).split(sep11).filter(Boolean), "normalizePathToArray");
61805
61805
  function isSrcSubdir(src, dest) {
61806
61806
  const srcArr = normalizePathToArray(src);
61807
61807
  const destArr = normalizePathToArray(dest);
@@ -61946,8 +61946,8 @@ var require_polyfill = __commonJS({
61946
61946
  __name(copyDir, "copyDir");
61947
61947
  async function onLink(destStat, src, dest) {
61948
61948
  let resolvedSrc = await readlink4(src);
61949
- if (!isAbsolute32(resolvedSrc)) {
61950
- resolvedSrc = resolve43(dirname27(src), resolvedSrc);
61949
+ if (!isAbsolute34(resolvedSrc)) {
61950
+ resolvedSrc = resolve44(dirname28(src), resolvedSrc);
61951
61951
  }
61952
61952
  if (!destStat) {
61953
61953
  return symlink(resolvedSrc, dest);
@@ -61961,8 +61961,8 @@ var require_polyfill = __commonJS({
61961
61961
  }
61962
61962
  throw err;
61963
61963
  }
61964
- if (!isAbsolute32(resolvedDest)) {
61965
- resolvedDest = resolve43(dirname27(dest), resolvedDest);
61964
+ if (!isAbsolute34(resolvedDest)) {
61965
+ resolvedDest = resolve44(dirname28(dest), resolvedDest);
61966
61966
  }
61967
61967
  if (isSrcSubdir(resolvedSrc, resolvedDest)) {
61968
61968
  throw new ERR_FS_CP_EINVAL({
@@ -62068,7 +62068,7 @@ var require_readdir_scoped = __commonJS({
62068
62068
  // ../../node_modules/.pnpm/@npmcli+fs@5.0.0/node_modules/@npmcli/fs/lib/move-file.js
62069
62069
  var require_move_file = __commonJS({
62070
62070
  "../../node_modules/.pnpm/@npmcli+fs@5.0.0/node_modules/@npmcli/fs/lib/move-file.js"(exports, module) {
62071
- var { dirname: dirname27, join: join50, resolve: resolve43, relative: relative35, isAbsolute: isAbsolute32 } = __require("path");
62071
+ var { dirname: dirname28, join: join50, resolve: resolve44, relative: relative35, isAbsolute: isAbsolute34 } = __require("path");
62072
62072
  var fs = __require("fs/promises");
62073
62073
  var pathExists2 = /* @__PURE__ */ __name(async (path40) => {
62074
62074
  try {
@@ -62089,7 +62089,7 @@ var require_move_file = __commonJS({
62089
62089
  if (!options.overwrite && await pathExists2(destination)) {
62090
62090
  throw new Error(`The destination file exists: ${destination}`);
62091
62091
  }
62092
- await fs.mkdir(dirname27(destination), { recursive: true });
62092
+ await fs.mkdir(dirname28(destination), { recursive: true });
62093
62093
  try {
62094
62094
  await fs.rename(source, destination);
62095
62095
  } catch (error) {
@@ -62112,12 +62112,12 @@ var require_move_file = __commonJS({
62112
62112
  if (root) {
62113
62113
  await Promise.all(symlinks.map(async ({ source: symSource, destination: symDestination }) => {
62114
62114
  let target = await fs.readlink(symSource);
62115
- if (isAbsolute32(target)) {
62116
- target = resolve43(symDestination, relative35(symSource, target));
62115
+ if (isAbsolute34(target)) {
62116
+ target = resolve44(symDestination, relative35(symSource, target));
62117
62117
  }
62118
62118
  let targetStat = "file";
62119
62119
  try {
62120
- targetStat = await fs.stat(resolve43(dirname27(symSource), target));
62120
+ targetStat = await fs.stat(resolve44(dirname28(symSource), target));
62121
62121
  if (targetStat.isDirectory()) {
62122
62122
  targetStat = "junction";
62123
62123
  }
@@ -62348,7 +62348,7 @@ async function pMap(iterable, mapper, {
62348
62348
  const cleanup = /* @__PURE__ */ __name(() => {
62349
62349
  signal?.removeEventListener("abort", signalListener);
62350
62350
  }, "cleanup");
62351
- const resolve43 = /* @__PURE__ */ __name((value) => {
62351
+ const resolve44 = /* @__PURE__ */ __name((value) => {
62352
62352
  resolve_(value);
62353
62353
  cleanup();
62354
62354
  }, "resolve");
@@ -62380,7 +62380,7 @@ async function pMap(iterable, mapper, {
62380
62380
  }
62381
62381
  isResolved = true;
62382
62382
  if (skippedIndexesMap.size === 0) {
62383
- resolve43(result2);
62383
+ resolve44(result2);
62384
62384
  return;
62385
62385
  }
62386
62386
  const pureResult = [];
@@ -62390,7 +62390,7 @@ async function pMap(iterable, mapper, {
62390
62390
  }
62391
62391
  pureResult.push(value);
62392
62392
  }
62393
- resolve43(pureResult);
62393
+ resolve44(pureResult);
62394
62394
  }
62395
62395
  return;
62396
62396
  }
@@ -67065,10 +67065,10 @@ var require_verify = __commonJS({
67065
67065
  markEndTime
67066
67066
  ];
67067
67067
  const stats = {};
67068
- for (const step of steps) {
67069
- const label = step.name;
67068
+ for (const step2 of steps) {
67069
+ const label = step2.name;
67070
67070
  const start = /* @__PURE__ */ new Date();
67071
- const s = await step(cache, opts);
67071
+ const s = await step2(cache, opts);
67072
67072
  if (s) {
67073
67073
  Object.keys(s).forEach((k) => {
67074
67074
  stats[k] = s[k];
@@ -67119,8 +67119,8 @@ var require_verify = __commonJS({
67119
67119
  liveContent.add(integrity[algo].toString());
67120
67120
  }
67121
67121
  });
67122
- await new Promise((resolve43, reject) => {
67123
- indexStream.on("end", resolve43).on("error", reject);
67122
+ await new Promise((resolve44, reject) => {
67123
+ indexStream.on("end", resolve44).on("error", reject);
67124
67124
  });
67125
67125
  const contentDir = contentPath.contentDir(cache);
67126
67126
  const files = await glob(path40.join(contentDir, "**"), {
@@ -67498,13 +67498,13 @@ var require_lib29 = __commonJS({
67498
67498
  unref: options.unref,
67499
67499
  maxRetryTime: options.maxRetryTime
67500
67500
  });
67501
- return new Promise(function(resolve43, reject) {
67501
+ return new Promise(function(resolve44, reject) {
67502
67502
  operation.attempt(async (number) => {
67503
67503
  try {
67504
67504
  const result2 = await fn((err) => {
67505
67505
  throw Object.assign(new Error("Retrying"), { code: "EPROMISERETRY", retried: err });
67506
67506
  }, number, operation);
67507
- return resolve43(result2);
67507
+ return resolve44(result2);
67508
67508
  } catch (err) {
67509
67509
  if (!isRetryError(err)) {
67510
67510
  return reject(err);
@@ -68389,8 +68389,8 @@ var require_helpers = __commonJS({
68389
68389
  function req(url, opts = {}) {
68390
68390
  const href = typeof url === "string" ? url : url.href;
68391
68391
  const req2 = (href.startsWith("https:") ? https : http).request(url, opts);
68392
- const promise = new Promise((resolve43, reject) => {
68393
- req2.once("response", resolve43).once("error", reject).end();
68392
+ const promise = new Promise((resolve44, reject) => {
68393
+ req2.once("response", resolve44).once("error", reject).end();
68394
68394
  });
68395
68395
  req2.then = promise.then.bind(promise);
68396
68396
  return req2;
@@ -68705,7 +68705,7 @@ var require_parse_proxy_response = __commonJS({
68705
68705
  var debug_1 = __importDefault(require_src());
68706
68706
  var debug = (0, debug_1.default)("https-proxy-agent:parse-proxy-response");
68707
68707
  function parseProxyResponse(socket) {
68708
- return new Promise((resolve43, reject) => {
68708
+ return new Promise((resolve44, reject) => {
68709
68709
  let buffersLength = 0;
68710
68710
  const buffers = [];
68711
68711
  function read() {
@@ -68775,7 +68775,7 @@ var require_parse_proxy_response = __commonJS({
68775
68775
  }
68776
68776
  debug("got proxy server response: %o %o", firstLine, headers);
68777
68777
  cleanup();
68778
- resolve43({
68778
+ resolve44({
68779
68779
  connect: {
68780
68780
  statusCode,
68781
68781
  statusText,
@@ -72601,15 +72601,15 @@ var require_socksclient = __commonJS({
72601
72601
  "use strict";
72602
72602
  var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
72603
72603
  function adopt(value) {
72604
- return value instanceof P ? value : new P(function(resolve43) {
72605
- resolve43(value);
72604
+ return value instanceof P ? value : new P(function(resolve44) {
72605
+ resolve44(value);
72606
72606
  });
72607
72607
  }
72608
72608
  __name(adopt, "adopt");
72609
- return new (P || (P = Promise))(function(resolve43, reject) {
72609
+ return new (P || (P = Promise))(function(resolve44, reject) {
72610
72610
  function fulfilled(value) {
72611
72611
  try {
72612
- step(generator.next(value));
72612
+ step2(generator.next(value));
72613
72613
  } catch (e) {
72614
72614
  reject(e);
72615
72615
  }
@@ -72617,17 +72617,17 @@ var require_socksclient = __commonJS({
72617
72617
  __name(fulfilled, "fulfilled");
72618
72618
  function rejected(value) {
72619
72619
  try {
72620
- step(generator["throw"](value));
72620
+ step2(generator["throw"](value));
72621
72621
  } catch (e) {
72622
72622
  reject(e);
72623
72623
  }
72624
72624
  }
72625
72625
  __name(rejected, "rejected");
72626
- function step(result2) {
72627
- result2.done ? resolve43(result2.value) : adopt(result2.value).then(fulfilled, rejected);
72626
+ function step2(result2) {
72627
+ result2.done ? resolve44(result2.value) : adopt(result2.value).then(fulfilled, rejected);
72628
72628
  }
72629
- __name(step, "step");
72630
- step((generator = generator.apply(thisArg, _arguments || [])).next());
72629
+ __name(step2, "step");
72630
+ step2((generator = generator.apply(thisArg, _arguments || [])).next());
72631
72631
  });
72632
72632
  };
72633
72633
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -72662,13 +72662,13 @@ var require_socksclient = __commonJS({
72662
72662
  * @returns { Promise }
72663
72663
  */
72664
72664
  static createConnection(options, callback) {
72665
- return new Promise((resolve43, reject) => {
72665
+ return new Promise((resolve44, reject) => {
72666
72666
  try {
72667
72667
  (0, helpers_1.validateSocksClientOptions)(options, ["connect"]);
72668
72668
  } catch (err) {
72669
72669
  if (typeof callback === "function") {
72670
72670
  callback(err);
72671
- return resolve43(err);
72671
+ return resolve44(err);
72672
72672
  } else {
72673
72673
  return reject(err);
72674
72674
  }
@@ -72679,16 +72679,16 @@ var require_socksclient = __commonJS({
72679
72679
  client.removeAllListeners();
72680
72680
  if (typeof callback === "function") {
72681
72681
  callback(null, info);
72682
- resolve43(info);
72682
+ resolve44(info);
72683
72683
  } else {
72684
- resolve43(info);
72684
+ resolve44(info);
72685
72685
  }
72686
72686
  });
72687
72687
  client.once("error", (err) => {
72688
72688
  client.removeAllListeners();
72689
72689
  if (typeof callback === "function") {
72690
72690
  callback(err);
72691
- resolve43(err);
72691
+ resolve44(err);
72692
72692
  } else {
72693
72693
  reject(err);
72694
72694
  }
@@ -72705,13 +72705,13 @@ var require_socksclient = __commonJS({
72705
72705
  * @returns { Promise }
72706
72706
  */
72707
72707
  static createConnectionChain(options, callback) {
72708
- return new Promise((resolve43, reject) => __awaiter(this, void 0, void 0, function* () {
72708
+ return new Promise((resolve44, reject) => __awaiter(this, void 0, void 0, function* () {
72709
72709
  try {
72710
72710
  (0, helpers_1.validateSocksClientChainOptions)(options);
72711
72711
  } catch (err) {
72712
72712
  if (typeof callback === "function") {
72713
72713
  callback(err);
72714
- return resolve43(err);
72714
+ return resolve44(err);
72715
72715
  } else {
72716
72716
  return reject(err);
72717
72717
  }
@@ -72737,14 +72737,14 @@ var require_socksclient = __commonJS({
72737
72737
  }
72738
72738
  if (typeof callback === "function") {
72739
72739
  callback(null, { socket: sock });
72740
- resolve43({ socket: sock });
72740
+ resolve44({ socket: sock });
72741
72741
  } else {
72742
- resolve43({ socket: sock });
72742
+ resolve44({ socket: sock });
72743
72743
  }
72744
72744
  } catch (err) {
72745
72745
  if (typeof callback === "function") {
72746
72746
  callback(err);
72747
- resolve43(err);
72747
+ resolve44(err);
72748
72748
  } else {
72749
72749
  reject(err);
72750
72750
  }
@@ -73432,12 +73432,12 @@ var require_dist7 = __commonJS({
73432
73432
  let { host } = opts;
73433
73433
  const { port, lookup: lookupFn = dns.lookup } = opts;
73434
73434
  if (shouldLookup) {
73435
- host = await new Promise((resolve43, reject) => {
73435
+ host = await new Promise((resolve44, reject) => {
73436
73436
  lookupFn(host, {}, (err, res) => {
73437
73437
  if (err) {
73438
73438
  reject(err);
73439
73439
  } else {
73440
- resolve43(res);
73440
+ resolve44(res);
73441
73441
  }
73442
73442
  });
73443
73443
  });
@@ -74294,8 +74294,8 @@ var require_entry = __commonJS({
74294
74294
  let body = null;
74295
74295
  if (this.response.status === 200) {
74296
74296
  let cacheWriteResolve, cacheWriteReject;
74297
- const cacheWritePromise = new Promise((resolve43, reject) => {
74298
- cacheWriteResolve = resolve43;
74297
+ const cacheWritePromise = new Promise((resolve44, reject) => {
74298
+ cacheWriteResolve = resolve44;
74299
74299
  cacheWriteReject = reject;
74300
74300
  }).catch((err) => {
74301
74301
  body.emit("error", err);
@@ -77288,9 +77288,9 @@ var require_lib35 = __commonJS({
77288
77288
  if (opts.shell) {
77289
77289
  return spawnWithShell(cmd, args2, opts, extra);
77290
77290
  }
77291
- let resolve43, reject;
77291
+ let resolve44, reject;
77292
77292
  const promise = new Promise((_resolve, _reject) => {
77293
- resolve43 = _resolve;
77293
+ resolve44 = _resolve;
77294
77294
  reject = _reject;
77295
77295
  });
77296
77296
  const closeError = new Error("command failed");
@@ -77323,7 +77323,7 @@ var require_lib35 = __commonJS({
77323
77323
  if (code || signal) {
77324
77324
  rejectWithOpts(closeError, { code, signal });
77325
77325
  } else {
77326
- resolve43(getResult({ code, signal }));
77326
+ resolve44(getResult({ code, signal }));
77327
77327
  }
77328
77328
  });
77329
77329
  return promise;
@@ -78304,8 +78304,8 @@ var require_lib36 = __commonJS({
78304
78304
  // ../../node_modules/.pnpm/npm-normalize-package-bin@5.0.0/node_modules/npm-normalize-package-bin/lib/index.js
78305
78305
  var require_lib37 = __commonJS({
78306
78306
  "../../node_modules/.pnpm/npm-normalize-package-bin@5.0.0/node_modules/npm-normalize-package-bin/lib/index.js"(exports, module) {
78307
- var { join: join50, basename: basename20 } = __require("path");
78308
- var normalize6 = /* @__PURE__ */ __name((pkg) => !pkg.bin ? removeBin(pkg) : typeof pkg.bin === "string" ? normalizeString(pkg) : Array.isArray(pkg.bin) ? normalizeArray(pkg) : typeof pkg.bin === "object" ? normalizeObject(pkg) : removeBin(pkg), "normalize");
78307
+ var { join: join50, basename: basename21 } = __require("path");
78308
+ var normalize8 = /* @__PURE__ */ __name((pkg) => !pkg.bin ? removeBin(pkg) : typeof pkg.bin === "string" ? normalizeString(pkg) : Array.isArray(pkg.bin) ? normalizeArray(pkg) : typeof pkg.bin === "object" ? normalizeObject(pkg) : removeBin(pkg), "normalize");
78309
78309
  var normalizeString = /* @__PURE__ */ __name((pkg) => {
78310
78310
  if (!pkg.name) {
78311
78311
  return removeBin(pkg);
@@ -78315,7 +78315,7 @@ var require_lib37 = __commonJS({
78315
78315
  }, "normalizeString");
78316
78316
  var normalizeArray = /* @__PURE__ */ __name((pkg) => {
78317
78317
  pkg.bin = pkg.bin.reduce((acc, k) => {
78318
- acc[basename20(k)] = k;
78318
+ acc[basename21(k)] = k;
78319
78319
  return acc;
78320
78320
  }, {});
78321
78321
  return normalizeObject(pkg);
@@ -78329,7 +78329,7 @@ var require_lib37 = __commonJS({
78329
78329
  const clean = {};
78330
78330
  let hasBins = false;
78331
78331
  Object.keys(orig).forEach((binKey) => {
78332
- const base = join50("/", basename20(binKey.replace(/\\|:/g, "/"))).slice(1);
78332
+ const base = join50("/", basename21(binKey.replace(/\\|:/g, "/"))).slice(1);
78333
78333
  if (typeof orig[binKey] !== "string" || !base) {
78334
78334
  return;
78335
78335
  }
@@ -78347,7 +78347,7 @@ var require_lib37 = __commonJS({
78347
78347
  }
78348
78348
  return pkg;
78349
78349
  }, "normalizeObject");
78350
- module.exports = normalize6;
78350
+ module.exports = normalize8;
78351
78351
  }
78352
78352
  });
78353
78353
 
@@ -78643,13 +78643,13 @@ var require_is = __commonJS({
78643
78643
  var require_find = __commonJS({
78644
78644
  "../../node_modules/.pnpm/@npmcli+git@7.0.2/node_modules/@npmcli/git/lib/find.js"(exports, module) {
78645
78645
  var is = require_is();
78646
- var { dirname: dirname27 } = __require("path");
78646
+ var { dirname: dirname28 } = __require("path");
78647
78647
  module.exports = async ({ cwd = process.cwd(), root } = {}) => {
78648
78648
  while (true) {
78649
78649
  if (await is({ cwd })) {
78650
78650
  return cwd;
78651
78651
  }
78652
- const next = dirname27(cwd);
78652
+ const next = dirname28(cwd);
78653
78653
  if (cwd === root || cwd === next) {
78654
78654
  return null;
78655
78655
  }
@@ -79162,19 +79162,19 @@ var require_normalize = __commonJS({
79162
79162
  }
79163
79163
  }
79164
79164
  __name(asyncSteps, "asyncSteps");
79165
- async function normalize6(pkg, opts) {
79165
+ async function normalize8(pkg, opts) {
79166
79166
  if (!pkg.content) {
79167
79167
  throw new Error("Can not normalize without content");
79168
79168
  }
79169
79169
  await asyncSteps(pkg, opts);
79170
79170
  syncSteps(pkg, opts);
79171
79171
  }
79172
- __name(normalize6, "normalize");
79172
+ __name(normalize8, "normalize");
79173
79173
  function syncNormalize(pkg, opts) {
79174
79174
  syncSteps(pkg, opts);
79175
79175
  }
79176
79176
  __name(syncNormalize, "syncNormalize");
79177
- module.exports = { normalize: normalize6, syncNormalize };
79177
+ module.exports = { normalize: normalize8, syncNormalize };
79178
79178
  }
79179
79179
  });
79180
79180
 
@@ -79319,12 +79319,12 @@ var require_sort2 = __commonJS({
79319
79319
  var require_lib40 = __commonJS({
79320
79320
  "../../node_modules/.pnpm/@npmcli+package-json@7.0.5/node_modules/@npmcli/package-json/lib/index.js"(exports, module) {
79321
79321
  var { readFile: readFile58, writeFile: writeFile16 } = __require("node:fs/promises");
79322
- var { resolve: resolve43 } = __require("node:path");
79322
+ var { resolve: resolve44 } = __require("node:path");
79323
79323
  var parseJSON = require_lib33();
79324
79324
  var updateDeps = require_update_dependencies();
79325
79325
  var updateScripts = require_update_scripts();
79326
79326
  var updateWorkspaces = require_update_workspaces();
79327
- var { normalize: normalize6, syncNormalize } = require_normalize();
79327
+ var { normalize: normalize8, syncNormalize } = require_normalize();
79328
79328
  var { read, parse: parse2 } = require_read_package();
79329
79329
  var { packageSort } = require_sort2();
79330
79330
  var knownSteps = /* @__PURE__ */ new Set([
@@ -79441,7 +79441,7 @@ var require_lib40 = __commonJS({
79441
79441
  parseErr = err;
79442
79442
  }
79443
79443
  if (parseErr) {
79444
- const indexFile = resolve43(this.path, "index.js");
79444
+ const indexFile = resolve44(this.path, "index.js");
79445
79445
  let indexFileContent;
79446
79446
  try {
79447
79447
  indexFileContent = await readFile58(indexFile, "utf8");
@@ -79497,7 +79497,7 @@ var require_lib40 = __commonJS({
79497
79497
  }
79498
79498
  get filename() {
79499
79499
  if (this.path) {
79500
- return resolve43(this.path, "package.json");
79500
+ return resolve44(this.path, "package.json");
79501
79501
  }
79502
79502
  return void 0;
79503
79503
  }
@@ -79511,8 +79511,8 @@ var require_lib40 = __commonJS({
79511
79511
  if (!this.content) {
79512
79512
  throw new Error("Can not update without content. Please `load` or `create`");
79513
79513
  }
79514
- for (const step of knownSteps) {
79515
- this.#manifest = step({ content, originalContent: this.content });
79514
+ for (const step2 of knownSteps) {
79515
+ this.#manifest = step2({ content, originalContent: this.content });
79516
79516
  }
79517
79517
  for (const [key, value] of Object.entries(content)) {
79518
79518
  if (!knownKeys.has(key)) {
@@ -79551,19 +79551,19 @@ var require_lib40 = __commonJS({
79551
79551
  if (!opts.steps) {
79552
79552
  opts.steps = this.constructor.normalizeSteps;
79553
79553
  }
79554
- await normalize6(this, opts);
79554
+ await normalize8(this, opts);
79555
79555
  return this;
79556
79556
  }
79557
79557
  async prepare(opts = {}) {
79558
79558
  if (!opts.steps) {
79559
79559
  opts.steps = this.constructor.prepareSteps;
79560
79560
  }
79561
- await normalize6(this, opts);
79561
+ await normalize8(this, opts);
79562
79562
  return this;
79563
79563
  }
79564
79564
  async fix(opts = {}) {
79565
79565
  opts.steps = this.constructor.fixSteps;
79566
- await normalize6(this, opts);
79566
+ await normalize8(this, opts);
79567
79567
  return this;
79568
79568
  }
79569
79569
  };
@@ -89128,12 +89128,12 @@ var require_fetcher = __commonJS({
89128
89128
  };
89129
89129
  exports.DefaultFetcher = DefaultFetcher;
89130
89130
  var writeBufferToStream = /* @__PURE__ */ __name(async (stream, buffer) => {
89131
- return new Promise((resolve43, reject) => {
89131
+ return new Promise((resolve44, reject) => {
89132
89132
  stream.write(buffer, (err) => {
89133
89133
  if (err) {
89134
89134
  reject(err);
89135
89135
  }
89136
- resolve43(true);
89136
+ resolve44(true);
89137
89137
  });
89138
89138
  });
89139
89139
  }, "writeBufferToStream");
@@ -89838,7 +89838,7 @@ var require_target = __commonJS({
89838
89838
  var error_1 = require_error9();
89839
89839
  async function readTarget(tuf, targetPath2) {
89840
89840
  const path40 = await getTargetPath(tuf, targetPath2);
89841
- return new Promise((resolve43, reject) => {
89841
+ return new Promise((resolve44, reject) => {
89842
89842
  fs_1.default.readFile(path40, "utf-8", (err, data) => {
89843
89843
  if (err) {
89844
89844
  reject(new error_1.TUFError({
@@ -89847,7 +89847,7 @@ var require_target = __commonJS({
89847
89847
  cause: err
89848
89848
  }));
89849
89849
  } else {
89850
- resolve43(data);
89850
+ resolve44(data);
89851
89851
  }
89852
89852
  });
89853
89853
  });
@@ -96280,12 +96280,12 @@ var require_body2 = __commonJS({
96280
96280
  if (resTimeout && resTimeout.unref) {
96281
96281
  resTimeout.unref();
96282
96282
  }
96283
- return new Promise((resolve43) => {
96283
+ return new Promise((resolve44) => {
96284
96284
  if (stream !== upstream) {
96285
96285
  upstream.on("error", (er) => stream.emit("error", er));
96286
96286
  upstream.pipe(stream);
96287
96287
  }
96288
- resolve43();
96288
+ resolve44();
96289
96289
  }).then(() => stream.concat()).then((buf) => {
96290
96290
  clearTimeout(resTimeout);
96291
96291
  return buf;
@@ -97050,7 +97050,7 @@ var require_lib44 = __commonJS({
97050
97050
  var fetch = /* @__PURE__ */ __name(async (url, opts) => {
97051
97051
  if (/^data:/.test(url)) {
97052
97052
  const request = new Request(url, opts);
97053
- return Promise.resolve().then(() => new Promise((resolve43, reject) => {
97053
+ return Promise.resolve().then(() => new Promise((resolve44, reject) => {
97054
97054
  let type, data;
97055
97055
  try {
97056
97056
  const { pathname, search } = new URL2(url);
@@ -97074,10 +97074,10 @@ var require_lib44 = __commonJS({
97074
97074
  if (type) {
97075
97075
  headers["Content-Type"] = type;
97076
97076
  }
97077
- return resolve43(new Response(data, { headers }));
97077
+ return resolve44(new Response(data, { headers }));
97078
97078
  }));
97079
97079
  }
97080
- return new Promise((resolve43, reject) => {
97080
+ return new Promise((resolve44, reject) => {
97081
97081
  const request = new Request(url, opts);
97082
97082
  let options;
97083
97083
  try {
@@ -97196,7 +97196,7 @@ var require_lib44 = __commonJS({
97196
97196
  requestOpts.body = void 0;
97197
97197
  requestOpts.headers.delete("content-length");
97198
97198
  }
97199
- resolve43(fetch(new Request(locationURL, requestOpts)));
97199
+ resolve44(fetch(new Request(locationURL, requestOpts)));
97200
97200
  finalize();
97201
97201
  return;
97202
97202
  }
@@ -97224,7 +97224,7 @@ var require_lib44 = __commonJS({
97224
97224
  const codings = headers.get("Content-Encoding");
97225
97225
  if (!request.compress || request.method === "HEAD" || codings === null || res.statusCode === 204 || res.statusCode === 304) {
97226
97226
  response = new Response(body, responseOptions);
97227
- resolve43(response);
97227
+ resolve44(response);
97228
97228
  return;
97229
97229
  }
97230
97230
  const zlibOptions = {
@@ -97243,7 +97243,7 @@ var require_lib44 = __commonJS({
97243
97243
  ).pipe(unzip),
97244
97244
  responseOptions
97245
97245
  );
97246
- resolve43(response);
97246
+ resolve44(response);
97247
97247
  return;
97248
97248
  }
97249
97249
  if (codings === "deflate" || codings === "x-deflate") {
@@ -97255,7 +97255,7 @@ var require_lib44 = __commonJS({
97255
97255
  (er) => decoder3.emit("error", er)
97256
97256
  ).pipe(decoder3);
97257
97257
  response = new Response(decoder3, responseOptions);
97258
- resolve43(response);
97258
+ resolve44(response);
97259
97259
  });
97260
97260
  return;
97261
97261
  }
@@ -97273,11 +97273,11 @@ var require_lib44 = __commonJS({
97273
97273
  (er) => decoder2.emit("error", er)
97274
97274
  ).pipe(decoder2);
97275
97275
  response = new Response(decoder2, responseOptions);
97276
- resolve43(response);
97276
+ resolve44(response);
97277
97277
  return;
97278
97278
  }
97279
97279
  response = new Response(body, responseOptions);
97280
- resolve43(response);
97280
+ resolve44(response);
97281
97281
  });
97282
97282
  writeToStream(req, request);
97283
97283
  });
@@ -97531,12 +97531,12 @@ var require_lib45 = __commonJS({
97531
97531
  return process.emit("input", "end");
97532
97532
  }, "end"),
97533
97533
  read: /* @__PURE__ */ __name(function(...args2) {
97534
- let resolve43, reject;
97534
+ let resolve44, reject;
97535
97535
  const promise = new Promise((_resolve, _reject) => {
97536
- resolve43 = _resolve;
97536
+ resolve44 = _resolve;
97537
97537
  reject = _reject;
97538
97538
  });
97539
- process.emit("input", "read", resolve43, reject, ...args2);
97539
+ process.emit("input", "read", resolve44, reject, ...args2);
97540
97540
  return promise;
97541
97541
  }, "read")
97542
97542
  }
@@ -99945,7 +99945,7 @@ var require_npa2 = __commonJS({
99945
99945
  spec = arg;
99946
99946
  }
99947
99947
  }
99948
- return resolve43(name, spec, where, arg);
99948
+ return resolve44(name, spec, where, arg);
99949
99949
  }
99950
99950
  __name(npa, "npa");
99951
99951
  function isFileSpec(spec) {
@@ -99968,7 +99968,7 @@ var require_npa2 = __commonJS({
99968
99968
  return spec.toLowerCase().startsWith("npm:");
99969
99969
  }
99970
99970
  __name(isAliasSpec, "isAliasSpec");
99971
- function resolve43(name, spec, where, arg) {
99971
+ function resolve44(name, spec, where, arg) {
99972
99972
  const res = new Result({
99973
99973
  raw: arg,
99974
99974
  name,
@@ -100000,7 +100000,7 @@ var require_npa2 = __commonJS({
100000
100000
  return fromRegistry(res);
100001
100001
  }
100002
100002
  }
100003
- __name(resolve43, "resolve");
100003
+ __name(resolve44, "resolve");
100004
100004
  function toPurl(arg, reg = defaultRegistry) {
100005
100005
  const res = npa(arg);
100006
100006
  if (res.type !== "version") {
@@ -100301,7 +100301,7 @@ var require_npa2 = __commonJS({
100301
100301
  }
100302
100302
  __name(fromRegistry, "fromRegistry");
100303
100303
  module.exports = npa;
100304
- module.exports.resolve = resolve43;
100304
+ module.exports.resolve = resolve44;
100305
100305
  module.exports.toPurl = toPurl;
100306
100306
  module.exports.Result = Result;
100307
100307
  }
@@ -100875,7 +100875,7 @@ var require_lib49 = __commonJS({
100875
100875
  module.exports.fromStream = fromStream;
100876
100876
  function fromStream(stream, opts) {
100877
100877
  const istream = integrityStream(opts);
100878
- return new Promise((resolve43, reject) => {
100878
+ return new Promise((resolve44, reject) => {
100879
100879
  stream.pipe(istream);
100880
100880
  stream.on("error", reject);
100881
100881
  istream.on("error", reject);
@@ -100883,7 +100883,7 @@ var require_lib49 = __commonJS({
100883
100883
  istream.on("integrity", (s) => {
100884
100884
  sri = s;
100885
100885
  });
100886
- istream.on("end", () => resolve43(sri));
100886
+ istream.on("end", () => resolve44(sri));
100887
100887
  istream.resume();
100888
100888
  });
100889
100889
  }
@@ -100944,7 +100944,7 @@ var require_lib49 = __commonJS({
100944
100944
  ));
100945
100945
  }
100946
100946
  const checker = integrityStream(opts);
100947
- return new Promise((resolve43, reject) => {
100947
+ return new Promise((resolve44, reject) => {
100948
100948
  stream.pipe(checker);
100949
100949
  stream.on("error", reject);
100950
100950
  checker.on("error", reject);
@@ -100952,7 +100952,7 @@ var require_lib49 = __commonJS({
100952
100952
  checker.on("verified", (s) => {
100953
100953
  verified = s;
100954
100954
  });
100955
- checker.on("end", () => resolve43(verified));
100955
+ checker.on("end", () => resolve44(verified));
100956
100956
  checker.resume();
100957
100957
  });
100958
100958
  }
@@ -101515,11 +101515,11 @@ var require_polyfill2 = __commonJS({
101515
101515
  utimes
101516
101516
  } = __require("fs/promises");
101517
101517
  var {
101518
- dirname: dirname27,
101519
- isAbsolute: isAbsolute32,
101518
+ dirname: dirname28,
101519
+ isAbsolute: isAbsolute34,
101520
101520
  join: join50,
101521
101521
  parse: parse2,
101522
- resolve: resolve43,
101522
+ resolve: resolve44,
101523
101523
  sep: sep11,
101524
101524
  toNamespacedPath
101525
101525
  } = __require("path");
@@ -101619,7 +101619,7 @@ var require_polyfill2 = __commonJS({
101619
101619
  }
101620
101620
  __name(getStats, "getStats");
101621
101621
  async function checkParentDir(destStat, src, dest, opts) {
101622
- const destParent = dirname27(dest);
101622
+ const destParent = dirname28(dest);
101623
101623
  const dirExists = await pathExists2(destParent);
101624
101624
  if (dirExists) {
101625
101625
  return getStatsForCopy(destStat, src, dest, opts);
@@ -101637,8 +101637,8 @@ var require_polyfill2 = __commonJS({
101637
101637
  }
101638
101638
  __name(pathExists2, "pathExists");
101639
101639
  async function checkParentPaths(src, srcStat, dest) {
101640
- const srcParent = resolve43(dirname27(src));
101641
- const destParent = resolve43(dirname27(dest));
101640
+ const srcParent = resolve44(dirname28(src));
101641
+ const destParent = resolve44(dirname28(dest));
101642
101642
  if (destParent === srcParent || destParent === parse2(destParent).root) {
101643
101643
  return;
101644
101644
  }
@@ -101662,7 +101662,7 @@ var require_polyfill2 = __commonJS({
101662
101662
  return checkParentPaths(src, srcStat, destParent);
101663
101663
  }
101664
101664
  __name(checkParentPaths, "checkParentPaths");
101665
- var normalizePathToArray = /* @__PURE__ */ __name((path40) => resolve43(path40).split(sep11).filter(Boolean), "normalizePathToArray");
101665
+ var normalizePathToArray = /* @__PURE__ */ __name((path40) => resolve44(path40).split(sep11).filter(Boolean), "normalizePathToArray");
101666
101666
  function isSrcSubdir(src, dest) {
101667
101667
  const srcArr = normalizePathToArray(src);
101668
101668
  const destArr = normalizePathToArray(dest);
@@ -101807,8 +101807,8 @@ var require_polyfill2 = __commonJS({
101807
101807
  __name(copyDir, "copyDir");
101808
101808
  async function onLink(destStat, src, dest) {
101809
101809
  let resolvedSrc = await readlink4(src);
101810
- if (!isAbsolute32(resolvedSrc)) {
101811
- resolvedSrc = resolve43(dirname27(src), resolvedSrc);
101810
+ if (!isAbsolute34(resolvedSrc)) {
101811
+ resolvedSrc = resolve44(dirname28(src), resolvedSrc);
101812
101812
  }
101813
101813
  if (!destStat) {
101814
101814
  return symlink(resolvedSrc, dest);
@@ -101822,8 +101822,8 @@ var require_polyfill2 = __commonJS({
101822
101822
  }
101823
101823
  throw err;
101824
101824
  }
101825
- if (!isAbsolute32(resolvedDest)) {
101826
- resolvedDest = resolve43(dirname27(dest), resolvedDest);
101825
+ if (!isAbsolute34(resolvedDest)) {
101826
+ resolvedDest = resolve44(dirname28(dest), resolvedDest);
101827
101827
  }
101828
101828
  if (isSrcSubdir(resolvedSrc, resolvedDest)) {
101829
101829
  throw new ERR_FS_CP_EINVAL({
@@ -101929,7 +101929,7 @@ var require_readdir_scoped2 = __commonJS({
101929
101929
  // ../../node_modules/.pnpm/@npmcli+fs@4.0.0/node_modules/@npmcli/fs/lib/move-file.js
101930
101930
  var require_move_file2 = __commonJS({
101931
101931
  "../../node_modules/.pnpm/@npmcli+fs@4.0.0/node_modules/@npmcli/fs/lib/move-file.js"(exports, module) {
101932
- var { dirname: dirname27, join: join50, resolve: resolve43, relative: relative35, isAbsolute: isAbsolute32 } = __require("path");
101932
+ var { dirname: dirname28, join: join50, resolve: resolve44, relative: relative35, isAbsolute: isAbsolute34 } = __require("path");
101933
101933
  var fs = __require("fs/promises");
101934
101934
  var pathExists2 = /* @__PURE__ */ __name(async (path40) => {
101935
101935
  try {
@@ -101950,7 +101950,7 @@ var require_move_file2 = __commonJS({
101950
101950
  if (!options.overwrite && await pathExists2(destination)) {
101951
101951
  throw new Error(`The destination file exists: ${destination}`);
101952
101952
  }
101953
- await fs.mkdir(dirname27(destination), { recursive: true });
101953
+ await fs.mkdir(dirname28(destination), { recursive: true });
101954
101954
  try {
101955
101955
  await fs.rename(source, destination);
101956
101956
  } catch (error) {
@@ -101973,12 +101973,12 @@ var require_move_file2 = __commonJS({
101973
101973
  if (root) {
101974
101974
  await Promise.all(symlinks.map(async ({ source: symSource, destination: symDestination }) => {
101975
101975
  let target = await fs.readlink(symSource);
101976
- if (isAbsolute32(target)) {
101977
- target = resolve43(symDestination, relative35(symSource, target));
101976
+ if (isAbsolute34(target)) {
101977
+ target = resolve44(symDestination, relative35(symSource, target));
101978
101978
  }
101979
101979
  let targetStat = "file";
101980
101980
  try {
101981
- targetStat = await fs.stat(resolve43(dirname27(symSource), target));
101981
+ targetStat = await fs.stat(resolve44(dirname28(symSource), target));
101982
101982
  if (targetStat.isDirectory()) {
101983
101983
  targetStat = "junction";
101984
101984
  }
@@ -104920,7 +104920,7 @@ var require_commonjs9 = __commonJS({
104920
104920
  var TYPEMASK = 1023;
104921
104921
  var entToType = /* @__PURE__ */ __name((s) => s.isFile() ? IFREG : s.isDirectory() ? IFDIR : s.isSymbolicLink() ? IFLNK : s.isCharacterDevice() ? IFCHR : s.isBlockDevice() ? IFBLK : s.isSocket() ? IFSOCK : s.isFIFO() ? IFIFO : UNKNOWN, "entToType");
104922
104922
  var normalizeCache = /* @__PURE__ */ new Map();
104923
- var normalize6 = /* @__PURE__ */ __name((s) => {
104923
+ var normalize8 = /* @__PURE__ */ __name((s) => {
104924
104924
  const c = normalizeCache.get(s);
104925
104925
  if (c)
104926
104926
  return c;
@@ -104933,7 +104933,7 @@ var require_commonjs9 = __commonJS({
104933
104933
  const c = normalizeNocaseCache.get(s);
104934
104934
  if (c)
104935
104935
  return c;
104936
- const n = normalize6(s.toLowerCase());
104936
+ const n = normalize8(s.toLowerCase());
104937
104937
  normalizeNocaseCache.set(s, n);
104938
104938
  return n;
104939
104939
  }, "normalizeNocase");
@@ -105111,7 +105111,7 @@ var require_commonjs9 = __commonJS({
105111
105111
  */
105112
105112
  constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
105113
105113
  this.name = name;
105114
- this.#matchName = nocase ? normalizeNocase(name) : normalize6(name);
105114
+ this.#matchName = nocase ? normalizeNocase(name) : normalize8(name);
105115
105115
  this.#type = type & TYPEMASK;
105116
105116
  this.nocase = nocase;
105117
105117
  this.roots = roots;
@@ -105204,7 +105204,7 @@ var require_commonjs9 = __commonJS({
105204
105204
  return this.parent || this;
105205
105205
  }
105206
105206
  const children = this.children();
105207
- const name = this.nocase ? normalizeNocase(pathPart) : normalize6(pathPart);
105207
+ const name = this.nocase ? normalizeNocase(pathPart) : normalize8(pathPart);
105208
105208
  for (const p of children) {
105209
105209
  if (p.#matchName === name) {
105210
105210
  return p;
@@ -105449,7 +105449,7 @@ var require_commonjs9 = __commonJS({
105449
105449
  * directly.
105450
105450
  */
105451
105451
  isNamed(n) {
105452
- return !this.nocase ? this.#matchName === normalize6(n) : this.#matchName === normalizeNocase(n);
105452
+ return !this.nocase ? this.#matchName === normalize8(n) : this.#matchName === normalizeNocase(n);
105453
105453
  }
105454
105454
  /**
105455
105455
  * Return the Path object corresponding to the target of a symbolic link.
@@ -105588,7 +105588,7 @@ var require_commonjs9 = __commonJS({
105588
105588
  #readdirMaybePromoteChild(e, c) {
105589
105589
  for (let p = c.provisional; p < c.length; p++) {
105590
105590
  const pchild = c[p];
105591
- const name = this.nocase ? normalizeNocase(e.name) : normalize6(e.name);
105591
+ const name = this.nocase ? normalizeNocase(e.name) : normalize8(e.name);
105592
105592
  if (name !== pchild.#matchName) {
105593
105593
  continue;
105594
105594
  }
@@ -105757,9 +105757,9 @@ var require_commonjs9 = __commonJS({
105757
105757
  if (this.#asyncReaddirInFlight) {
105758
105758
  await this.#asyncReaddirInFlight;
105759
105759
  } else {
105760
- let resolve43 = /* @__PURE__ */ __name(() => {
105760
+ let resolve44 = /* @__PURE__ */ __name(() => {
105761
105761
  }, "resolve");
105762
- this.#asyncReaddirInFlight = new Promise((res) => resolve43 = res);
105762
+ this.#asyncReaddirInFlight = new Promise((res) => resolve44 = res);
105763
105763
  try {
105764
105764
  for (const e of await this.#fs.promises.readdir(fullpath, {
105765
105765
  withFileTypes: true
@@ -105772,7 +105772,7 @@ var require_commonjs9 = __commonJS({
105772
105772
  children.provisional = 0;
105773
105773
  }
105774
105774
  this.#asyncReaddirInFlight = void 0;
105775
- resolve43();
105775
+ resolve44();
105776
105776
  }
105777
105777
  return children.slice(0, children.provisional);
105778
105778
  }
@@ -107936,10 +107936,10 @@ var require_verify3 = __commonJS({
107936
107936
  markEndTime
107937
107937
  ];
107938
107938
  const stats = {};
107939
- for (const step of steps) {
107940
- const label = step.name;
107939
+ for (const step2 of steps) {
107940
+ const label = step2.name;
107941
107941
  const start = /* @__PURE__ */ new Date();
107942
- const s = await step(cache, opts);
107942
+ const s = await step2(cache, opts);
107943
107943
  if (s) {
107944
107944
  Object.keys(s).forEach((k) => {
107945
107945
  stats[k] = s[k];
@@ -107990,8 +107990,8 @@ var require_verify3 = __commonJS({
107990
107990
  liveContent.add(integrity[algo].toString());
107991
107991
  }
107992
107992
  });
107993
- await new Promise((resolve43, reject) => {
107994
- indexStream.on("end", resolve43).on("error", reject);
107993
+ await new Promise((resolve44, reject) => {
107994
+ indexStream.on("end", resolve44).on("error", reject);
107995
107995
  });
107996
107996
  const contentDir = contentPath.contentDir(cache);
107997
107997
  const files = await glob(path40.join(contentDir, "**"), {
@@ -108547,7 +108547,7 @@ var require_promise_retry = __commonJS({
108547
108547
  fn = temp;
108548
108548
  }
108549
108549
  operation = retry.operation(options);
108550
- return new Promise(function(resolve43, reject) {
108550
+ return new Promise(function(resolve44, reject) {
108551
108551
  operation.attempt(function(number) {
108552
108552
  Promise.resolve().then(function() {
108553
108553
  return fn(function(err) {
@@ -108556,7 +108556,7 @@ var require_promise_retry = __commonJS({
108556
108556
  }
108557
108557
  throw errcode(new Error("Retrying"), "EPROMISERETRY", { retried: err });
108558
108558
  }, number);
108559
- }).then(resolve43, function(err) {
108559
+ }).then(resolve44, function(err) {
108560
108560
  if (isRetryError(err)) {
108561
108561
  err = err.retried;
108562
108562
  if (operation.retry(err || new Error())) {
@@ -109449,8 +109449,8 @@ var require_entry4 = __commonJS({
109449
109449
  let body = null;
109450
109450
  if (this.response.status === 200) {
109451
109451
  let cacheWriteResolve, cacheWriteReject;
109452
- const cacheWritePromise = new Promise((resolve43, reject) => {
109453
- cacheWriteResolve = resolve43;
109452
+ const cacheWritePromise = new Promise((resolve44, reject) => {
109453
+ cacheWriteResolve = resolve44;
109454
109454
  cacheWriteReject = reject;
109455
109455
  }).catch((err) => {
109456
109456
  body.emit("error", err);
@@ -131517,7 +131517,7 @@ function collectPostPublishCommandCandidates(postPublish) {
131517
131517
  }
131518
131518
  }, "visit");
131519
131519
  visit2("materialize", postPublish.materialize?.command);
131520
- for (const step of postPublish.steps ?? []) visit2(`steps[${step.name}]`, step.command);
131520
+ for (const step2 of postPublish.steps ?? []) visit2(`steps[${step2.name}]`, step2.command);
131521
131521
  for (const hook of postPublish.hooks ?? []) {
131522
131522
  if (Array.isArray(hook.command)) visit2(`hooks[${hook.id}]`, hook.command);
131523
131523
  }
@@ -134549,16 +134549,18 @@ __export(post_release_local_exports, {
134549
134549
  assertLocalFinishRun: () => assertLocalFinishRun,
134550
134550
  assertVerifiedReleaseRun: () => assertVerifiedReleaseRun,
134551
134551
  derivePostReleaseChecklist: () => derivePostReleaseChecklist,
134552
+ runLocalFinishCommand: () => defaultRun,
134552
134553
  unavailablePostReleaseChecklist: () => unavailablePostReleaseChecklist,
134553
134554
  updateLocalHostPlugins: () => updateLocalHostPlugins
134554
134555
  });
134555
134556
  import { access as access2, readFile as readFile38, mkdir as mkdir23, mkdtemp as mkdtemp7, cp as cp2, rename as rename5, rm as rm11, lstat as lstat44, realpath as realpath32, chmod as chmod5 } from "node:fs/promises";
134556
134557
  import { homedir } from "node:os";
134557
134558
  import { join as join29, relative as relative29, isAbsolute as isAbsolute26, normalize as normalize5 } from "node:path";
134558
- function attachFoundationFailure(error, { envelope, stdout }) {
134559
+ function attachFoundationFailure(error, { envelope, stdout, stderr }) {
134559
134560
  Object.defineProperties(error, {
134560
134561
  foundationEnvelope: { value: envelope, enumerable: false },
134561
- foundationStdout: { value: stdout, enumerable: false }
134562
+ foundationStdout: { value: stdout, enumerable: false },
134563
+ foundationStderr: { value: stderr, enumerable: false }
134562
134564
  });
134563
134565
  return error;
134564
134566
  }
@@ -134681,6 +134683,7 @@ function hubTargets(plan) {
134681
134683
  unitId: declaration.unitId,
134682
134684
  host,
134683
134685
  plugin: local.plugin,
134686
+ version: unit?.targetVersion,
134684
134687
  hub,
134685
134688
  message: `${manualInstruction[host]} Install or upgrade ${local.plugin} from Hub ${hub.name}; release-skill does not execute or probe this action.`,
134686
134689
  ...unit?.publicRepo ? { publicRepo: unit.publicRepo } : {},
@@ -134776,9 +134779,26 @@ function buildShipNextStep({ root, statePath, unitIds }) {
134776
134779
  argv
134777
134780
  };
134778
134781
  }
134782
+ function buildFinishCommand({ root, planPath, runPath }) {
134783
+ if (![root, planPath, runPath].every((value) => typeof value === "string" && value.length > 0)) return void 0;
134784
+ return {
134785
+ argv: [
134786
+ "release-skill",
134787
+ "post-release",
134788
+ "--root",
134789
+ root,
134790
+ "--plan",
134791
+ planPath,
134792
+ "--run",
134793
+ runPath,
134794
+ "--finish"
134795
+ ]
134796
+ };
134797
+ }
134779
134798
  function derivePostReleaseChecklist(plan, {
134780
134799
  runPath,
134781
134800
  root,
134801
+ planPath,
134782
134802
  statePath,
134783
134803
  unitIds,
134784
134804
  postVerifyComplete = false
@@ -134798,10 +134818,12 @@ function derivePostReleaseChecklist(plan, {
134798
134818
  const hasPendingPostVerify = postVerifyHooks(plan).length > 0 && !postVerifyComplete && targets.length > 0;
134799
134819
  const hasStatePath = typeof statePath === "string" && statePath.length > 0;
134800
134820
  const selectedUnitIds = Array.isArray(unitIds) ? unitIds : void 0;
134821
+ const finishCommand = hasPendingPostVerify ? void 0 : buildFinishCommand({ root, planPath, runPath });
134801
134822
  return {
134802
134823
  command: "post-release",
134803
134824
  status: "AWAITING_USER_DECISION",
134804
134825
  planDigest: plan.digest,
134826
+ ...finishCommand ? { finishCommand } : {},
134805
134827
  merge: {
134806
134828
  promptRequired: uncovered.length > 0,
134807
134829
  alreadyHandledByRelease: uncovered.length === 0,
@@ -135015,7 +135037,7 @@ async function defaultRun(command2, args2, options = {}) {
135015
135037
  watchdogReason: envelope.watchdogReason,
135016
135038
  ...envelope.evidence?.spawnError ? { spawnError: envelope.evidence.spawnError } : {}
135017
135039
  };
135018
- throw attachFoundationFailure(error, { envelope, stdout });
135040
+ throw attachFoundationFailure(error, { envelope, stdout, stderr });
135019
135041
  }
135020
135042
  return { stdout, stderr };
135021
135043
  }, { prefix: "release-skill-host-command-" });
@@ -136406,6 +136428,7 @@ var init_post_release_local = __esm({
136406
136428
  __name(assertExecutableTarget, "assertExecutableTarget");
136407
136429
  __name(assertQoderExecutableTarget, "assertQoderExecutableTarget");
136408
136430
  __name(buildShipNextStep, "buildShipNextStep");
136431
+ __name(buildFinishCommand, "buildFinishCommand");
136409
136432
  __name(derivePostReleaseChecklist, "derivePostReleaseChecklist");
136410
136433
  __name(postVerifyHooks, "postVerifyHooks");
136411
136434
  __name(localFinishEvidenceError, "localFinishEvidenceError");
@@ -136787,7 +136810,7 @@ function defaultSleep(ms) {
136787
136810
  if (process.env.RELEASE_SKILL_OBSERVE_RETRY_NO_WAIT === "1") {
136788
136811
  return Promise.resolve();
136789
136812
  }
136790
- return new Promise((resolve43) => setTimeout(resolve43, ms));
136813
+ return new Promise((resolve44) => setTimeout(resolve44, ms));
136791
136814
  }
136792
136815
  function isPropagatingMissing(result2) {
136793
136816
  if (result2 == null) return true;
@@ -141832,28 +141855,28 @@ async function distributeRelease(options) {
141832
141855
  fileCount: publicFiles.length
141833
141856
  });
141834
141857
  }
141835
- for (const step of declaration.steps ?? []) {
141858
+ for (const step2 of declaration.steps ?? []) {
141836
141859
  if (dryRun === true) {
141837
- await evidence.append({ phase: "postpublish-step", step: step.name, status: "skipped", reason: "DRY_RUN" });
141860
+ await evidence.append({ phase: "postpublish-step", step: step2.name, status: "skipped", reason: "DRY_RUN" });
141838
141861
  continue;
141839
141862
  }
141840
141863
  if (pendingHookApprovals.length > 0) {
141841
141864
  await evidence.append({
141842
141865
  phase: "postpublish-step",
141843
- step: step.name,
141866
+ step: step2.name,
141844
141867
  status: "skipped",
141845
141868
  reason: "AWAITING_CHECKPOINT_APPROVAL",
141846
141869
  pendingHookApprovals: pendingHookApprovals.map((hook) => hook.id)
141847
141870
  });
141848
141871
  continue;
141849
141872
  }
141850
- await evidence.append({ phase: "postpublish-step", step: step.name, status: "started" });
141873
+ await evidence.append({ phase: "postpublish-step", step: step2.name, status: "started" });
141851
141874
  const stepResult = await hookRunner(
141852
141875
  {
141853
- command: step.command,
141854
- ...step.cwd ? { cwd: step.cwd } : {},
141855
- ...step.timeoutMs !== void 0 ? { timeoutMs: step.timeoutMs } : {},
141856
- ...step.envAllowlist ? { envAllowlist: step.envAllowlist } : {}
141876
+ command: step2.command,
141877
+ ...step2.cwd ? { cwd: step2.cwd } : {},
141878
+ ...step2.timeoutMs !== void 0 ? { timeoutMs: step2.timeoutMs } : {},
141879
+ ...step2.envAllowlist ? { envAllowlist: step2.envAllowlist } : {}
141857
141880
  },
141858
141881
  {
141859
141882
  // F-04: steps run in the execution worktree (see materialize).
@@ -141865,7 +141888,7 @@ async function distributeRelease(options) {
141865
141888
  if (stepResult.exitCode !== 0) {
141866
141889
  await evidence.append({
141867
141890
  phase: "postpublish-step",
141868
- step: step.name,
141891
+ step: step2.name,
141869
141892
  status: "failed",
141870
141893
  exitCode: stepResult.exitCode,
141871
141894
  stdoutTail: boundedOutputTail(stepResult.stdout),
@@ -141873,11 +141896,11 @@ async function distributeRelease(options) {
141873
141896
  });
141874
141897
  await failBlocked(new ReleaseError(
141875
141898
  GATE_FAILED,
141876
- `postPublish step "${step.name}" exited with code ${stepResult.exitCode}`,
141877
- { step: step.name, exitCode: stepResult.exitCode }
141899
+ `postPublish step "${step2.name}" exited with code ${stepResult.exitCode}`,
141900
+ { step: step2.name, exitCode: stepResult.exitCode }
141878
141901
  ));
141879
141902
  }
141880
- await evidence.append({ phase: "postpublish-step", step: step.name, status: "passed" });
141903
+ await evidence.append({ phase: "postpublish-step", step: step2.name, status: "passed" });
141881
141904
  }
141882
141905
  await evidence.append({
141883
141906
  phase: "distribute",
@@ -143827,6 +143850,7 @@ async function advanceShip(options = {}, injected = {}) {
143827
143850
  try {
143828
143851
  postRelease = derivePostReleaseChecklist(finalPlan, {
143829
143852
  root,
143853
+ planPath: state.planPath,
143830
143854
  statePath,
143831
143855
  unitIds: state.selectedUnitIds,
143832
143856
  runPath: localFinishRunPath,
@@ -144312,22 +144336,22 @@ function classifyProbeFailure(text) {
144312
144336
  return "transport";
144313
144337
  }
144314
144338
  function renderMarketplaceIndex(marketplace, params = {}) {
144315
- const fail10 = /* @__PURE__ */ __name((message, details = {}) => {
144339
+ const fail11 = /* @__PURE__ */ __name((message, details = {}) => {
144316
144340
  throw new ReleaseError(GATE_FAILED, `marketplace index render failed: ${message}`, details);
144317
144341
  }, "fail");
144318
144342
  if (!marketplace || typeof marketplace !== "object" || Array.isArray(marketplace)) {
144319
- fail10("marketplace metadata is required");
144343
+ fail11("marketplace metadata is required");
144320
144344
  }
144321
144345
  if (marketplace.form !== "github" && marketplace.form !== "url") {
144322
- fail10('marketplace.form must be "github" or "url"', { form: marketplace.form });
144346
+ fail11('marketplace.form must be "github" or "url"', { form: marketplace.form });
144323
144347
  }
144324
144348
  const { pluginName, ref, sha = null, dependencyUrl = null } = params;
144325
- if (typeof marketplace.name !== "string" || marketplace.name.length === 0) fail10("marketplace.name must be a non-empty string");
144326
- if (typeof marketplace.owner !== "string" || marketplace.owner.length === 0) fail10("marketplace.owner must be a non-empty string");
144327
- if (typeof pluginName !== "string" || pluginName.length === 0) fail10("pluginName must be a non-empty string");
144328
- if (typeof ref !== "string" || ref.length === 0) fail10("ref must be a non-empty tag");
144349
+ if (typeof marketplace.name !== "string" || marketplace.name.length === 0) fail11("marketplace.name must be a non-empty string");
144350
+ if (typeof marketplace.owner !== "string" || marketplace.owner.length === 0) fail11("marketplace.owner must be a non-empty string");
144351
+ if (typeof pluginName !== "string" || pluginName.length === 0) fail11("pluginName must be a non-empty string");
144352
+ if (typeof ref !== "string" || ref.length === 0) fail11("ref must be a non-empty tag");
144329
144353
  if (sha !== null && !SHA_RE6.test(sha)) {
144330
- fail10("sha must be the full 40-hex commit hash from the actual push result", { sha });
144354
+ fail11("sha must be the full 40-hex commit hash from the actual push result", { sha });
144331
144355
  }
144332
144356
  let source;
144333
144357
  if (marketplace.form === "github") {
@@ -144339,7 +144363,7 @@ function renderMarketplaceIndex(marketplace, params = {}) {
144339
144363
  };
144340
144364
  } else {
144341
144365
  if (typeof dependencyUrl !== "string" || !isAllowedGitRemoteUrl(dependencyUrl)) {
144342
- fail10("url form requires the payload-mirror dependency remoteUrl", {});
144366
+ fail11("url form requires the payload-mirror dependency remoteUrl", {});
144343
144367
  }
144344
144368
  source = {
144345
144369
  source: "url",
@@ -144984,6 +145008,447 @@ var init_attest = __esm({
144984
145008
  }
144985
145009
  });
144986
145010
 
145011
+ // src/commands/post-release-finish.mjs
145012
+ var post_release_finish_exports = {};
145013
+ __export(post_release_finish_exports, {
145014
+ runPostReleaseFinish: () => runPostReleaseFinish
145015
+ });
145016
+ import { realpath as realpath36 } from "node:fs/promises";
145017
+ import { basename as basename17, dirname as dirname24, isAbsolute as isAbsolute31, normalize as normalize6, resolve as resolve40 } from "node:path";
145018
+ function fail10(message) {
145019
+ const error = new Error(message);
145020
+ error.code = "POST_RELEASE_FINISH_INVALID";
145021
+ error.exitCode = 1;
145022
+ throw error;
145023
+ }
145024
+ function assertPlainObject(value, label) {
145025
+ if (!value || typeof value !== "object" || Array.isArray(value)) fail10(`${label} must be an object`);
145026
+ }
145027
+ function assertClosed2(value, allowed, label) {
145028
+ assertPlainObject(value, label);
145029
+ const unknown = Object.keys(value).filter((field) => !allowed.has(field));
145030
+ if (unknown.length > 0) fail10(`${label} contains unknown fields: ${unknown.join(", ")}`);
145031
+ }
145032
+ function nonEmptyString(value, label) {
145033
+ if (typeof value !== "string" || value.trim().length === 0) fail10(`${label} must be a non-empty string`);
145034
+ return value;
145035
+ }
145036
+ function normalizedAbsolutePath(value, label) {
145037
+ nonEmptyString(value, label);
145038
+ if (!isAbsolute31(value) || normalize6(value) !== value) fail10(`${label} must be a normalized absolute path`);
145039
+ return value;
145040
+ }
145041
+ async function readFeedback(feedbackPath) {
145042
+ if (feedbackPath === void 0) return null;
145043
+ normalizedAbsolutePath(feedbackPath, "finish feedback path");
145044
+ let receipt;
145045
+ try {
145046
+ receipt = await readFileStrict(dirname24(feedbackPath), basename17(feedbackPath), { encoding: "utf8" });
145047
+ } catch (cause) {
145048
+ fail10(`cannot strictly read finish feedback: ${cause.message}`);
145049
+ }
145050
+ let value;
145051
+ try {
145052
+ value = JSON.parse(receipt.content);
145053
+ } catch (cause) {
145054
+ fail10(`finish feedback is not valid JSON: ${cause.message}`);
145055
+ }
145056
+ return value;
145057
+ }
145058
+ function targetKey(unitId, host) {
145059
+ return `${unitId}\0${host}`;
145060
+ }
145061
+ function validateFeedback(raw, { projectRoot, planDigest, configDigest, selectedTargets, setupSkill }) {
145062
+ if (raw === null) return { merge: null, hosts: [], setup: null };
145063
+ assertClosed2(raw, FEEDBACK_FIELDS, "finish feedback");
145064
+ for (const field of ["planDigest", "configDigest", "projectRoot"]) nonEmptyString(raw[field], `finish feedback.${field}`);
145065
+ if (raw.planDigest !== planDigest) fail10("finish feedback planDigest does not match the frozen plan");
145066
+ if (raw.configDigest !== configDigest) fail10("finish feedback configDigest does not match the current project configuration");
145067
+ if (normalizedAbsolutePath(raw.projectRoot, "finish feedback.projectRoot") !== projectRoot) {
145068
+ fail10("finish feedback projectRoot does not match the current project root");
145069
+ }
145070
+ let merge = null;
145071
+ if (raw.merge !== void 0) {
145072
+ assertClosed2(raw.merge, MERGE_FIELDS, "finish feedback.merge");
145073
+ if (!["completed", "skipped", "pending"].includes(raw.merge.outcome)) fail10("finish feedback.merge.outcome is invalid");
145074
+ nonEmptyString(raw.merge.summary, "finish feedback.merge.summary");
145075
+ merge = { ...raw.merge, basis: "agent-reported" };
145076
+ }
145077
+ const targetsByKey = new Map(selectedTargets.map((target) => [targetKey(target.unitId, target.host), target]));
145078
+ const hosts = [];
145079
+ const seen = /* @__PURE__ */ new Set();
145080
+ if (raw.hosts !== void 0 && !Array.isArray(raw.hosts)) fail10("finish feedback.hosts must be an array");
145081
+ for (const [index, host] of (raw.hosts ?? []).entries()) {
145082
+ assertClosed2(host, HOST_FIELDS, `finish feedback.hosts[${index}]`);
145083
+ for (const field of ["unitId", "host", "plugin", "version", "summary"]) {
145084
+ nonEmptyString(host[field], `finish feedback.hosts[${index}].${field}`);
145085
+ }
145086
+ if (!["current", "pending", "failed"].includes(host.installation)) fail10(`finish feedback.hosts[${index}].installation is invalid`);
145087
+ if (typeof host.loaded !== "boolean") fail10(`finish feedback.hosts[${index}].loaded must be boolean`);
145088
+ if (host.installation !== "current" && host.loaded) fail10(`finish feedback.hosts[${index}] cannot be loaded unless installation is current`);
145089
+ if (host.skillFile !== void 0) normalizedAbsolutePath(host.skillFile, `finish feedback.hosts[${index}].skillFile`);
145090
+ const key = targetKey(host.unitId, host.host);
145091
+ if (seen.has(key)) fail10(`finish feedback contains duplicate host result for ${host.unitId}/${host.host}`);
145092
+ seen.add(key);
145093
+ const target = targetsByKey.get(key);
145094
+ if (!target) fail10(`finish feedback host ${host.unitId}/${host.host} is outside the selected frozen targets`);
145095
+ if (host.plugin !== target.plugin || host.version !== target.version) {
145096
+ fail10(`finish feedback host ${host.unitId}/${host.host} does not match the frozen plugin identity`);
145097
+ }
145098
+ hosts.push({ ...host, basis: "agent-reported" });
145099
+ }
145100
+ let setup = null;
145101
+ if (raw.setup !== void 0) {
145102
+ if (!setupSkill) fail10("finish feedback.setup is not allowed when releaseFinish.setupSkill is not configured");
145103
+ assertClosed2(raw.setup, SETUP_FIELDS, "finish feedback.setup");
145104
+ for (const field of ["host", "unitId", "skillFile", "summary"]) nonEmptyString(raw.setup[field], `finish feedback.setup.${field}`);
145105
+ normalizedAbsolutePath(raw.setup.skillFile, "finish feedback.setup.skillFile");
145106
+ if (!["completed", "pending", "failed"].includes(raw.setup.outcome)) fail10("finish feedback.setup.outcome is invalid");
145107
+ const host = hosts.find((entry) => entry.host === raw.setup.host && entry.unitId === raw.setup.unitId);
145108
+ if (!host || host.installation !== "current" || host.loaded !== true || host.skillFile !== raw.setup.skillFile) {
145109
+ fail10("finish feedback.setup is not bound to one selected, current, loaded host and matching skillFile");
145110
+ }
145111
+ setup = { ...raw.setup, basis: "agent-reported" };
145112
+ }
145113
+ return { merge, hosts, setup };
145114
+ }
145115
+ function step(status, summary, extra = {}) {
145116
+ if (!STEP_STATUSES.has(status)) throw new Error(`unknown finish step status: ${status}`);
145117
+ return { status, summary, ...extra };
145118
+ }
145119
+ function resultToInstallation(result2, target) {
145120
+ if (!result2) return null;
145121
+ if (["UPDATED", "ALREADY_CURRENT"].includes(result2.status) && result2.version !== target.version) {
145122
+ return {
145123
+ unitId: target.unitId,
145124
+ host: target.host,
145125
+ plugin: target.plugin,
145126
+ version: target.version,
145127
+ installation: "failed",
145128
+ loaded: false,
145129
+ summary: `\u5BBF\u4E3B\u66F4\u65B0\u7ED3\u679C\u7248\u672C ${result2.version ?? "(missing)"} \u4E0E\u51BB\u7ED3\u7248\u672C ${target.version} \u4E0D\u4E00\u81F4\u3002`,
145130
+ basis: "script-observed",
145131
+ updateStatus: result2.status
145132
+ };
145133
+ }
145134
+ if (["UPDATED", "ALREADY_CURRENT"].includes(result2.status)) {
145135
+ return {
145136
+ unitId: target.unitId,
145137
+ host: target.host,
145138
+ plugin: target.plugin,
145139
+ version: target.version,
145140
+ installation: "current",
145141
+ loaded: false,
145142
+ summary: result2.status === "UPDATED" ? "\u811A\u672C\u5DF2\u66F4\u65B0\u5E76\u590D\u9A8C\u5B89\u88C5\u8F7D\u8377\uFF1B\u4ECD\u9700\u7531\u5F53\u524D\u667A\u80FD\u4F53\u786E\u8BA4\u5BBF\u4E3B\u5B9E\u9645\u52A0\u8F7D\u3002" : "\u811A\u672C\u5DF2\u786E\u8BA4\u5B89\u88C5\u8F7D\u8377\u4E0E\u51BB\u7ED3\u7248\u672C\u4E00\u81F4\uFF1B\u4ECD\u9700\u7531\u5F53\u524D\u667A\u80FD\u4F53\u786E\u8BA4\u5BBF\u4E3B\u5B9E\u9645\u52A0\u8F7D\u3002",
145143
+ basis: "script-observed",
145144
+ updateStatus: result2.status,
145145
+ ...result2.restartRequired ? { restartRequired: true } : {}
145146
+ };
145147
+ }
145148
+ return {
145149
+ unitId: target.unitId,
145150
+ host: target.host,
145151
+ plugin: target.plugin,
145152
+ version: target.version,
145153
+ installation: result2.status === "FAILED" ? "failed" : "pending",
145154
+ loaded: false,
145155
+ summary: result2.reason ?? result2.error ?? `\u5BBF\u4E3B\u66F4\u65B0\u7ED3\u679C\u4E3A ${result2.status}\u3002`,
145156
+ basis: "script-observed",
145157
+ updateStatus: result2.status
145158
+ };
145159
+ }
145160
+ function gitReadEnvironment() {
145161
+ const env = { GIT_OPTIONAL_LOCKS: "0", GIT_TERMINAL_PROMPT: "0" };
145162
+ for (const key of ["PATH", "HOME", "TMPDIR", "LANG", "LC_ALL"]) {
145163
+ if (process.env[key] !== void 0) env[key] = process.env[key];
145164
+ }
145165
+ return env;
145166
+ }
145167
+ async function observeGitCommand({ root, args: args2, run: run6 }) {
145168
+ const argv = ["git", ...args2];
145169
+ try {
145170
+ const result2 = await run6("git", args2, { cwd: root, env: gitReadEnvironment() });
145171
+ return { argv, status: "SUCCEEDED", exitStatus: 0, stdout: result2.stdout, stderr: result2.stderr };
145172
+ } catch (cause) {
145173
+ return {
145174
+ argv,
145175
+ status: "FAILED",
145176
+ exitStatus: cause?.exitStatus ?? cause?.code ?? null,
145177
+ stdout: cause?.stdout ?? cause?.foundationStdout ?? "",
145178
+ stderr: cause?.stderr ?? cause?.foundationStderr ?? "",
145179
+ message: cause?.message ?? String(cause)
145180
+ };
145181
+ }
145182
+ }
145183
+ async function inspectSourceBranch({ root, config, run: run6 }) {
145184
+ const policy = config.releaseFinish?.sourceBranchCheck ?? "remind";
145185
+ const targetBranch = config.project.defaultBranch;
145186
+ if (policy === "skip") {
145187
+ return step("SKIPPED", "\u9879\u76EE\u914D\u7F6E\u5DF2\u5173\u95ED\u6E90\u7801\u5206\u652F\u68C0\u67E5\u3002", { policy, targetBranch, basis: "script-observed" });
145188
+ }
145189
+ const branchResult = await observeGitCommand({ root, args: ["branch", "--show-current"], run: run6 });
145190
+ const statusResult = await observeGitCommand({ root, args: ["status", "--short", "--branch"], run: run6 });
145191
+ const commands = [branchResult, statusResult];
145192
+ if (commands.some((command2) => command2.status === "FAILED")) {
145193
+ return step("FAILED", "\u6E90\u7801\u5206\u652F\u53EA\u8BFB\u68C0\u67E5\u81F3\u5C11\u4E00\u6761 Git \u547D\u4EE4\u5931\u8D25\u3002", {
145194
+ policy,
145195
+ targetBranch,
145196
+ commands,
145197
+ basis: "script-observed"
145198
+ });
145199
+ }
145200
+ try {
145201
+ const currentBranch = branchResult.stdout.trim();
145202
+ const lines = statusResult.stdout.replace(/\r/gu, "").split("\n").filter(Boolean);
145203
+ const tracking = lines[0]?.startsWith("## ") ? lines[0].slice(3) : "";
145204
+ const changed = (lines[0]?.startsWith("## ") ? lines.slice(1) : lines).length > 0;
145205
+ const detached = currentBranch.length === 0;
145206
+ const aligned = !detached && currentBranch === targetBranch;
145207
+ return step("COMPLETE", detached ? "\u5DF2\u5B8C\u6210\u53EA\u8BFB\u68C0\u67E5\uFF1B\u5F53\u524D\u4E3A detached HEAD\uFF0C\u672A\u731C\u6D4B\u540E\u7EED Git \u64CD\u4F5C\u3002" : aligned ? `\u5DF2\u5B8C\u6210\u53EA\u8BFB\u68C0\u67E5\uFF1B\u5F53\u524D\u5206\u652F\u4E3A\u76EE\u6807\u5206\u652F ${targetBranch}\u3002` : `\u5DF2\u5B8C\u6210\u53EA\u8BFB\u68C0\u67E5\uFF1B\u5F53\u524D\u5206\u652F ${currentBranch} \u4E0E\u76EE\u6807\u5206\u652F ${targetBranch} \u4E0D\u540C\u3002`, {
145208
+ policy,
145209
+ targetBranch,
145210
+ currentBranch: detached ? null : currentBranch,
145211
+ detached,
145212
+ aligned,
145213
+ changed,
145214
+ tracking: tracking || null,
145215
+ rawStatus: statusResult.stdout,
145216
+ commands,
145217
+ basis: "script-observed"
145218
+ });
145219
+ } catch (cause) {
145220
+ return step("FAILED", `\u6E90\u7801\u5206\u652F\u53EA\u8BFB\u68C0\u67E5\u5931\u8D25\uFF1A${cause.message}`, {
145221
+ policy,
145222
+ targetBranch,
145223
+ commands,
145224
+ basis: "script-observed"
145225
+ });
145226
+ }
145227
+ }
145228
+ function finishStatus(steps) {
145229
+ const statuses = Object.values(steps).map((entry) => entry.status);
145230
+ if (statuses.includes("FAILED")) return "FAILED";
145231
+ if (statuses.includes("PENDING")) return "PENDING";
145232
+ return "COMPLETE";
145233
+ }
145234
+ async function runPostReleaseFinish({
145235
+ root = process.cwd(),
145236
+ plan,
145237
+ planPath,
145238
+ runPath,
145239
+ selectedHosts = [],
145240
+ updateRequested = false,
145241
+ skipLocalHosts = false,
145242
+ confirmPlanDigest,
145243
+ cursorPluginsRoot,
145244
+ feedbackPath,
145245
+ updateLocalHostPluginsFn = updateLocalHostPlugins,
145246
+ run: run6 = defaultRun
145247
+ } = {}) {
145248
+ const projectRoot = await realpath36(resolve40(root));
145249
+ const loaded = await loadProjectConfig({ root: projectRoot });
145250
+ const checklist = derivePostReleaseChecklist(plan, {
145251
+ root: projectRoot,
145252
+ planPath,
145253
+ runPath,
145254
+ postVerifyComplete: true
145255
+ });
145256
+ const selected = new Set(selectedHosts);
145257
+ const unknownHosts = [...selected].filter((host) => !checklist.localHostUpdate.hosts.includes(host));
145258
+ if (unknownHosts.length > 0) fail10(`selected hosts are not declared by the plan: ${unknownHosts.join(", ")}`);
145259
+ const selectedTargets = checklist.localHostUpdate.targets.filter((target) => selected.has(target.host));
145260
+ const feedback = validateFeedback(await readFeedback(feedbackPath), {
145261
+ projectRoot,
145262
+ planDigest: plan.digest,
145263
+ configDigest: loaded.configDigest,
145264
+ selectedTargets,
145265
+ setupSkill: loaded.config.releaseFinish?.setupSkill
145266
+ });
145267
+ let update = null;
145268
+ if (updateRequested) {
145269
+ update = await updateLocalHostPluginsFn({
145270
+ planPath,
145271
+ runPath,
145272
+ root: projectRoot,
145273
+ confirmPlanDigest,
145274
+ selectedHosts,
145275
+ cursorPluginsRoot
145276
+ });
145277
+ }
145278
+ const nextActions = [];
145279
+ let mergeStep;
145280
+ if (!checklist.merge.promptRequired) {
145281
+ mergeStep = step("COMPLETE", "\u53D1\u5E03\u6D41\u7A0B\u5DF2\u8986\u76D6\u5206\u652F\u63A8\u8FDB\uFF0C\u65E0\u9700\u989D\u5916\u5408\u5E76\u51B3\u5B9A\u3002", { basis: "script-observed" });
145282
+ } else if (!feedback.merge) {
145283
+ mergeStep = step("PENDING", "\u5C1A\u672A\u63D0\u4F9B\u5269\u4F59\u53D1\u5E03\u5206\u652F\u7684\u5904\u7406\u7ED3\u679C\u3002");
145284
+ nextActions.push({ type: "decide-merge", units: checklist.merge.units });
145285
+ } else {
145286
+ const status = feedback.merge.outcome === "completed" ? "COMPLETE" : feedback.merge.outcome === "skipped" ? "SKIPPED" : "PENDING";
145287
+ mergeStep = step(status, feedback.merge.summary, { basis: feedback.merge.basis, outcome: feedback.merge.outcome });
145288
+ if (status === "PENDING") nextActions.push({ type: "decide-merge", units: checklist.merge.units });
145289
+ }
145290
+ const observations = [];
145291
+ const feedbackByKey = new Map(feedback.hosts.map((entry) => [targetKey(entry.unitId, entry.host), entry]));
145292
+ const updateByKey = new Map((update?.results ?? []).map((entry) => [targetKey(entry.unitId, entry.host), entry]));
145293
+ const updateKeepsFeedback = !updateRequested || selectedTargets.every((target) => {
145294
+ const result2 = updateByKey.get(targetKey(target.unitId, target.host));
145295
+ return result2?.status === "ALREADY_CURRENT" && result2.version === target.version;
145296
+ });
145297
+ for (const target of selectedTargets) {
145298
+ const reported = feedbackByKey.get(targetKey(target.unitId, target.host));
145299
+ const updateResult = updateByKey.get(targetKey(target.unitId, target.host));
145300
+ const scriptObservation = resultToInstallation(updateResult, target);
145301
+ if (!scriptObservation) {
145302
+ if (reported) observations.push(reported);
145303
+ continue;
145304
+ }
145305
+ if (scriptObservation.installation === "current" && scriptObservation.updateStatus === "ALREADY_CURRENT" && reported?.installation === "current") {
145306
+ observations.push({
145307
+ ...scriptObservation,
145308
+ loaded: reported.loaded,
145309
+ ...reported.skillFile ? { skillFile: reported.skillFile } : {},
145310
+ loadSummary: reported.summary,
145311
+ loadBasis: "agent-reported"
145312
+ });
145313
+ } else {
145314
+ observations.push(scriptObservation);
145315
+ }
145316
+ }
145317
+ let hostUpdateStep;
145318
+ let hostLoadStep;
145319
+ const hasTargets = checklist.localHostUpdate.targets.length > 0;
145320
+ if (skipLocalHosts) {
145321
+ hostUpdateStep = step("SKIPPED", "\u8C03\u7528\u8005\u5DF2\u660E\u786E\u8DF3\u8FC7\u672C\u8F6E\u5BBF\u4E3B\u66F4\u65B0\u3002");
145322
+ hostLoadStep = step("SKIPPED", "\u672C\u8F6E\u8DF3\u8FC7\u5BBF\u4E3B\u66F4\u65B0\uFF0C\u56E0\u6B64\u4E0D\u68C0\u67E5\u76EE\u6807\u63D2\u4EF6\u52A0\u8F7D\u3002");
145323
+ } else if (!hasTargets) {
145324
+ hostUpdateStep = step("SKIPPED", "\u51BB\u7ED3\u8BA1\u5212\u6CA1\u6709\u9002\u7528\u7684\u672C\u673A\u5BBF\u4E3B\u76EE\u6807\u3002");
145325
+ hostLoadStep = step("SKIPPED", "\u6CA1\u6709\u9002\u7528\u7684\u5BBF\u4E3B\u52A0\u8F7D\u76EE\u6807\u3002");
145326
+ } else if (selectedTargets.length === 0) {
145327
+ hostUpdateStep = step("PENDING", "\u5C1A\u672A\u9009\u62E9\u672C\u8F6E\u8981\u5904\u7406\u7684\u5BBF\u4E3B\u3002", { availableHosts: checklist.localHostUpdate.hosts });
145328
+ hostLoadStep = step("PENDING", "\u9700\u5148\u9009\u62E9\u5BBF\u4E3B\u5E76\u786E\u8BA4\u5B89\u88C5\u7ED3\u679C\u3002");
145329
+ nextActions.push({ type: "choose-local-hosts", hosts: checklist.localHostUpdate.hosts, targets: checklist.localHostUpdate.targets });
145330
+ } else {
145331
+ const failed = observations.filter((entry) => entry.installation === "failed");
145332
+ const current = observations.filter((entry) => entry.installation === "current");
145333
+ const missing = selectedTargets.filter((target) => !observations.some((entry) => entry.unitId === target.unitId && entry.host === target.host));
145334
+ const pending = observations.filter((entry) => entry.installation === "pending");
145335
+ hostUpdateStep = step(
145336
+ failed.length > 0 ? "FAILED" : missing.length > 0 || pending.length > 0 ? "PENDING" : "COMPLETE",
145337
+ failed.length > 0 ? "\u81F3\u5C11\u4E00\u4E2A\u6240\u9009\u5BBF\u4E3B\u7684\u5B89\u88C5\u6216\u66F4\u65B0\u5931\u8D25\u3002" : missing.length > 0 || pending.length > 0 ? "\u90E8\u5206\u6240\u9009\u5BBF\u4E3B\u7F3A\u5C11\u5B89\u88C5\u7ED3\u679C\u6216\u4ECD\u5F85\u5904\u7406\u3002" : "\u6240\u9009\u5BBF\u4E3B\u7684\u5B89\u88C5\u5747\u5DF2\u786E\u8BA4\u4E3A\u76EE\u6807\u7248\u672C\u3002",
145338
+ { observations }
145339
+ );
145340
+ const unloaded = observations.filter((entry) => entry.installation === "current" && entry.loaded !== true);
145341
+ const loadedHosts = observations.filter((entry) => entry.installation === "current" && entry.loaded === true);
145342
+ hostLoadStep = step(
145343
+ failed.length > 0 ? "FAILED" : loadedHosts.length !== selectedTargets.length ? "PENDING" : "COMPLETE",
145344
+ failed.length > 0 ? "\u5BBF\u4E3B\u5B89\u88C5\u5931\u8D25\uFF0C\u65E0\u6CD5\u5B8C\u6210\u52A0\u8F7D\u786E\u8BA4\u3002" : loadedHosts.length !== selectedTargets.length ? "\u5C1A\u672A\u786E\u8BA4\u5168\u90E8\u6240\u9009\u5BBF\u4E3B\u5DF2\u5B9E\u9645\u52A0\u8F7D\u76EE\u6807\u63D2\u4EF6\u548C\u5165\u53E3\u3002" : "\u5F53\u524D\u667A\u80FD\u4F53\u5DF2\u62A5\u544A\u5168\u90E8\u6240\u9009\u5BBF\u4E3B\u52A0\u8F7D\u76EE\u6807\u5165\u53E3\u3002",
145345
+ { observations }
145346
+ );
145347
+ if (missing.length > 0 || pending.length > 0) nextActions.push({ type: "observe-host-installation", targets: [...missing, ...pending] });
145348
+ if (unloaded.length > 0) nextActions.push({ type: "check-host-load", projectRoot, observations: unloaded });
145349
+ }
145350
+ const setupSkill = loaded.config.releaseFinish?.setupSkill;
145351
+ const candidates = observations.filter((entry) => entry.installation === "current" && entry.loaded === true && typeof entry.skillFile === "string");
145352
+ const candidateOwners = new Set(candidates.map((entry) => `${entry.plugin}\0${entry.version}\0${entry.skillFile}`));
145353
+ const effectiveSetup = updateKeepsFeedback ? feedback.setup : null;
145354
+ let setupStep;
145355
+ if (!setupSkill) {
145356
+ setupStep = step("SKIPPED", "\u9879\u76EE\u672A\u914D\u7F6E releaseFinish.setupSkill\u3002");
145357
+ } else if (skipLocalHosts) {
145358
+ setupStep = step("SKIPPED", "\u8C03\u7528\u8005\u5DF2\u660E\u786E\u8DF3\u8FC7\u5BBF\u4E3B\u66F4\u65B0\u548C\u52A0\u8F7D\uFF0C\u672C\u8F6E\u4E0D\u6267\u884C setup\u3002", { setupSkill });
145359
+ } else if (candidateOwners.size > 1) {
145360
+ setupStep = step("PENDING", `\u76EE\u6807\u5165\u53E3 ${setupSkill} \u5B58\u5728\u591A\u4E2A\u63D2\u4EF6\u8EAB\u4EFD\u5F52\u5C5E\uFF0C\u4E0D\u80FD\u7528\u5355\u4E2A setup \u53CD\u9988\u5B8C\u6574\u6536\u5C3E\u3002`, {
145361
+ setupSkill,
145362
+ candidates
145363
+ });
145364
+ nextActions.push({ type: "disambiguate-setup", setupSkill, projectRoot, candidates });
145365
+ } else if (effectiveSetup) {
145366
+ const status = effectiveSetup.outcome === "completed" ? "COMPLETE" : effectiveSetup.outcome === "failed" ? "FAILED" : "PENDING";
145367
+ setupStep = step(status, effectiveSetup.summary, {
145368
+ setupSkill,
145369
+ result: effectiveSetup,
145370
+ basis: "agent-reported"
145371
+ });
145372
+ if (status === "PENDING") nextActions.push({ type: "invoke-setup", setupSkill, projectRoot, resume: effectiveSetup });
145373
+ } else {
145374
+ setupStep = step("PENDING", candidates.length > 0 ? `\u76EE\u6807\u5165\u53E3 ${setupSkill} \u5DF2\u6709\u53EF\u7528\u5BBF\u4E3B\uFF0C\u4F46\u672A\u6536\u5230\u5B9E\u9645 setup \u7ED3\u679C\u3002` : `\u76EE\u6807\u5165\u53E3 ${setupSkill} \u5C1A\u7F3A\u53EF\u7528\u7684\u5DF2\u52A0\u8F7D\u5BBF\u4E3B\u4E0E\u6280\u80FD\u5143\u6570\u636E\u3002`, { setupSkill, candidates });
145375
+ if (candidates.length > 0) {
145376
+ nextActions.push({
145377
+ type: "invoke-setup",
145378
+ setupSkill,
145379
+ projectRoot,
145380
+ intent: "read-only-diagnosis",
145381
+ authorization: "No new write authority is granted by this request.",
145382
+ candidates: candidates.map((entry) => ({
145383
+ unitId: entry.unitId,
145384
+ host: entry.host,
145385
+ plugin: entry.plugin,
145386
+ version: entry.version,
145387
+ skillFile: entry.skillFile
145388
+ })),
145389
+ hostObservations: observations
145390
+ });
145391
+ } else {
145392
+ nextActions.push({
145393
+ type: "resolve-setup-target",
145394
+ setupSkill,
145395
+ projectRoot,
145396
+ reason: hasTargets ? "no-loaded-candidates" : "no-host-targets",
145397
+ targets: checklist.localHostUpdate.targets
145398
+ });
145399
+ }
145400
+ }
145401
+ const sourceBranchStep = await inspectSourceBranch({ root: projectRoot, config: loaded.config, run: run6 });
145402
+ const steps = {
145403
+ merge: mergeStep,
145404
+ "host-update": hostUpdateStep,
145405
+ "host-load": hostLoadStep,
145406
+ setup: setupStep,
145407
+ "source-branch": sourceBranchStep
145408
+ };
145409
+ return {
145410
+ command: "post-release",
145411
+ ...update ? { operation: "finish-with-local-host-update", localHostUpdate: update } : { checklist },
145412
+ finish: {
145413
+ status: finishStatus(steps),
145414
+ projectRoot,
145415
+ planDigest: plan.digest,
145416
+ configDigest: loaded.configDigest,
145417
+ steps,
145418
+ nextActions,
145419
+ releaseStatusChanged: false
145420
+ }
145421
+ };
145422
+ }
145423
+ var STEP_STATUSES, FEEDBACK_FIELDS, MERGE_FIELDS, HOST_FIELDS, SETUP_FIELDS;
145424
+ var init_post_release_finish = __esm({
145425
+ async "src/commands/post-release-finish.mjs"() {
145426
+ init_src2();
145427
+ await init_config();
145428
+ await init_post_release_local();
145429
+ STEP_STATUSES = /* @__PURE__ */ new Set(["COMPLETE", "PENDING", "FAILED", "SKIPPED"]);
145430
+ FEEDBACK_FIELDS = /* @__PURE__ */ new Set(["planDigest", "configDigest", "projectRoot", "merge", "hosts", "setup"]);
145431
+ MERGE_FIELDS = /* @__PURE__ */ new Set(["outcome", "summary"]);
145432
+ HOST_FIELDS = /* @__PURE__ */ new Set(["unitId", "host", "installation", "loaded", "plugin", "version", "skillFile", "summary"]);
145433
+ SETUP_FIELDS = /* @__PURE__ */ new Set(["host", "unitId", "skillFile", "outcome", "summary"]);
145434
+ __name(fail10, "fail");
145435
+ __name(assertPlainObject, "assertPlainObject");
145436
+ __name(assertClosed2, "assertClosed");
145437
+ __name(nonEmptyString, "nonEmptyString");
145438
+ __name(normalizedAbsolutePath, "normalizedAbsolutePath");
145439
+ __name(readFeedback, "readFeedback");
145440
+ __name(targetKey, "targetKey");
145441
+ __name(validateFeedback, "validateFeedback");
145442
+ __name(step, "step");
145443
+ __name(resultToInstallation, "resultToInstallation");
145444
+ __name(gitReadEnvironment, "gitReadEnvironment");
145445
+ __name(observeGitCommand, "observeGitCommand");
145446
+ __name(inspectSourceBranch, "inspectSourceBranch");
145447
+ __name(finishStatus, "finishStatus");
145448
+ __name(runPostReleaseFinish, "runPostReleaseFinish");
145449
+ }
145450
+ });
145451
+
144987
145452
  // src/artifacts/policy.mjs
144988
145453
  import { readFile as readFile49 } from "node:fs/promises";
144989
145454
  import { join as join42 } from "node:path";
@@ -146171,7 +146636,7 @@ var init_state = __esm({
146171
146636
 
146172
146637
  // src/artifacts/artifact-plan.mjs
146173
146638
  import { writeFile as writeFile15, mkdir as mkdir35, readFile as readFile52, rename as rename6, open as open14 } from "node:fs/promises";
146174
- import { dirname as dirname24 } from "node:path";
146639
+ import { dirname as dirname25 } from "node:path";
146175
146640
  function assemblePlan({
146176
146641
  operation,
146177
146642
  bindings,
@@ -146194,7 +146659,7 @@ function assemblePlan({
146194
146659
  return Object.freeze(plan);
146195
146660
  }
146196
146661
  async function writePlan(plan, outputPath) {
146197
- const dir = dirname24(outputPath);
146662
+ const dir = dirname25(outputPath);
146198
146663
  await mkdir35(dir, { recursive: true });
146199
146664
  const tmpPath = `${outputPath}.tmp`;
146200
146665
  const content = JSON.stringify(plan, null, 2);
@@ -147132,7 +147597,7 @@ var init_inspect = __esm({
147132
147597
 
147133
147598
  // src/artifacts/resolution.mjs
147134
147599
  import { mkdir as mkdir36, open as open15, readFile as readFile54, stat as stat21, lstat as lstat49, chmod as chmod7 } from "node:fs/promises";
147135
- import { join as join46, resolve as resolve40, relative as relative33, isAbsolute as isAbsolute31, basename as basename17 } from "node:path";
147600
+ import { join as join46, resolve as resolve41, relative as relative33, isAbsolute as isAbsolute32, basename as basename18 } from "node:path";
147136
147601
  function decodeBuffer(value, label) {
147137
147602
  if (value == null) return null;
147138
147603
  if (Buffer.isBuffer(value)) return value;
@@ -147252,18 +147717,18 @@ async function assertNoSymlinksInPath(root, artifactId) {
147252
147717
  }
147253
147718
  }
147254
147719
  async function assertSafeResolvedPath(root, artifactId, resolvedPath) {
147255
- const resolutionDir = resolve40(root, ".release-skill", "resolution", artifactId);
147256
- const resolved = resolve40(resolvedPath);
147720
+ const resolutionDir = resolve41(root, ".release-skill", "resolution", artifactId);
147721
+ const resolved = resolve41(resolvedPath);
147257
147722
  await assertNoSymlinksInPath(root, artifactId);
147258
147723
  const rel = relative33(resolutionDir, resolved);
147259
- if (rel.startsWith("..") || isAbsolute31(rel)) {
147724
+ if (rel.startsWith("..") || isAbsolute32(rel)) {
147260
147725
  throw new ReleaseError(
147261
147726
  PATH_UNSAFE,
147262
147727
  `resolvedPath must be inside resolution directory ${resolutionDir}`,
147263
147728
  { resolvedPath, resolutionDir }
147264
147729
  );
147265
147730
  }
147266
- const filename = basename17(resolvedPath);
147731
+ const filename = basename18(resolvedPath);
147267
147732
  if (filename !== `${artifactId}.resolved`) {
147268
147733
  throw new ReleaseError(
147269
147734
  PATH_UNSAFE,
@@ -147271,7 +147736,7 @@ async function assertSafeResolvedPath(root, artifactId, resolvedPath) {
147271
147736
  { resolvedPath, expected: `${artifactId}.resolved`, actual: filename }
147272
147737
  );
147273
147738
  }
147274
- if (resolved !== resolve40(resolutionDir, `${artifactId}.resolved`)) {
147739
+ if (resolved !== resolve41(resolutionDir, `${artifactId}.resolved`)) {
147275
147740
  throw new ReleaseError(
147276
147741
  PATH_UNSAFE,
147277
147742
  "resolvedPath must be the exact materialized resolution file",
@@ -148714,7 +149179,7 @@ __export(route_exports, {
148714
149179
  });
148715
149180
  import { execFileSync } from "node:child_process";
148716
149181
  import { lstat as lstat50, readdir as readdir34, readFile as readFile56 } from "node:fs/promises";
148717
- import { relative as relative34, resolve as resolve41, basename as basename18, dirname as dirname25, join as join48 } from "node:path";
149182
+ import { relative as relative34, resolve as resolve42, basename as basename19, dirname as dirname26, join as join48 } from "node:path";
148718
149183
  function classifyPath(path40) {
148719
149184
  if (typeof path40 !== "string" || path40.length === 0) return "ignore";
148720
149185
  const p = path40.replace(/\\+/g, "/");
@@ -148759,7 +149224,7 @@ function bucketPaths(paths) {
148759
149224
  return { ...buckets, mixed: categoryCount > 1 };
148760
149225
  }
148761
149226
  async function classifyWorktreeDiff(root) {
148762
- const cwd = resolve41(root);
149227
+ const cwd = resolve42(root);
148763
149228
  let output;
148764
149229
  try {
148765
149230
  output = execFileSync(
@@ -148791,16 +149256,16 @@ async function classifyWorktreeDiff(root) {
148791
149256
  return bucketPaths(paths);
148792
149257
  }
148793
149258
  async function resolvePreviousReleaseCommit(root) {
148794
- const cwd = resolve41(root);
149259
+ const cwd = resolve42(root);
148795
149260
  try {
148796
- const plansDir = resolve41(cwd, ".release-skill", "plans");
149261
+ const plansDir = resolve42(cwd, ".release-skill", "plans");
148797
149262
  const planFiles = await readdir34(plansDir).catch(() => []);
148798
149263
  let best = null;
148799
149264
  for (const file of planFiles) {
148800
149265
  if (!file.endsWith(".json")) continue;
148801
149266
  let plan;
148802
149267
  try {
148803
- plan = JSON.parse(await readFile56(resolve41(plansDir, file), "utf8"));
149268
+ plan = JSON.parse(await readFile56(resolve42(plansDir, file), "utf8"));
148804
149269
  } catch {
148805
149270
  continue;
148806
149271
  }
@@ -148835,7 +149300,7 @@ async function objectExistsLocally(root, sha) {
148835
149300
  }
148836
149301
  }
148837
149302
  async function classifyBaselineSurface(root, prevCommit) {
148838
- const cwd = resolve41(root);
149303
+ const cwd = resolve42(root);
148839
149304
  let diffOutput = "";
148840
149305
  try {
148841
149306
  diffOutput = execFileSync(
@@ -148880,9 +149345,9 @@ async function classifyBaselineSurface(root, prevCommit) {
148880
149345
  return { status: "determinable", categories: buckets, kind, paths: allPaths };
148881
149346
  }
148882
149347
  async function readRunRouting(root, options = {}) {
148883
- const cwd = resolve41(root);
149348
+ const cwd = resolve42(root);
148884
149349
  const targetVersion = options.targetVersion ?? null;
148885
- const runsDir = resolve41(cwd, ".release-skill", "runs");
149350
+ const runsDir = resolve42(cwd, ".release-skill", "runs");
148886
149351
  let runDirs;
148887
149352
  try {
148888
149353
  runDirs = await readdir34(runsDir);
@@ -148920,8 +149385,8 @@ async function readRunRouting(root, options = {}) {
148920
149385
  const records = [];
148921
149386
  const diagnostics = [];
148922
149387
  for (const runDir of runDirs) {
148923
- let runPath = resolve41(runsDir, runDir, "release-run.json");
148924
- const runDirectory = resolve41(runsDir, runDir);
149388
+ let runPath = resolve42(runsDir, runDir, "release-run.json");
149389
+ const runDirectory = resolve42(runsDir, runDir);
148925
149390
  let authorityExists = false;
148926
149391
  let authorityMissing = false;
148927
149392
  let markerlessRunDebris = false;
@@ -148932,7 +149397,7 @@ async function readRunRouting(root, options = {}) {
148932
149397
  if (error.code === "ENOENT") {
148933
149398
  authorityMissing = true;
148934
149399
  if (/^(prepare|assess|hooks-validate)-/.test(runDir)) continue;
148935
- const statesPath = resolve41(runsDir, runDir, "states");
149400
+ const statesPath = resolve42(runsDir, runDir, "states");
148936
149401
  const stateInspection = await inspectStateDirectory(statesPath);
148937
149402
  if (!stateInspection.ok) {
148938
149403
  records.push({
@@ -148947,7 +149412,7 @@ async function readRunRouting(root, options = {}) {
148947
149412
  }
148948
149413
  const slots = stateInspection.entries.filter((name) => /^\d{6}\.json$/.test(name)).sort();
148949
149414
  if (slots.length > 0) {
148950
- runPath = resolve41(runsDir, runDir, "states", slots.at(-1));
149415
+ runPath = resolve42(runsDir, runDir, "states", slots.at(-1));
148951
149416
  authorityExists = true;
148952
149417
  }
148953
149418
  }
@@ -149191,7 +149656,7 @@ async function isProvenPreAuthorityFailure(runDir, runName) {
149191
149656
  const validLegacyTimestamp = /* @__PURE__ */ __name((value) => typeof value === "string" && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/.test(value) && Number.isFinite(Date.parse(value)), "validLegacyTimestamp");
149192
149657
  const validLegacyError = /* @__PURE__ */ __name((error) => error && typeof error === "object" && !Array.isArray(error) && typeof error.code === "string" && error.code.length > 0 && (error.message === void 0 || typeof error.message === "string"), "validLegacyError");
149193
149658
  const validLegacyEvent = /* @__PURE__ */ __name((event, runId) => event && typeof event === "object" && !Array.isArray(event) && event.schemaVersion === 1 && !Object.hasOwn(event, "producer") && typeof event.runId === "string" && event.runId === runId && Number.isSafeInteger(event.sequence) && event.sequence >= 1 && validLegacyTimestamp(event.timestamp) && event.command === "publish" && typeof event.phase === "string" && (legacyPreAuthorityPhases.has(event.phase) || event.phase === "publish") && typeof event.status === "string" && event.status.length > 0 && (event.error === void 0 || event.error === null || validLegacyError(event.error)) && (event.duration === void 0 || Number.isSafeInteger(event.duration) && event.duration >= 0) && (event.details === void 0 || event.details !== null && typeof event.details === "object" && !Array.isArray(event.details)), "validLegacyEvent");
149194
- const legacyRunId = basename18(runDir);
149659
+ const legacyRunId = basename19(runDir);
149195
149660
  const legacyTerminal = events.at(-1);
149196
149661
  const legacyValid = summary && summary.status === "FAILED" && validLegacyError(summary.error) && typeof summary.error.message === "string" && legacyInputFailure.test(summary.error.message) && !legacyUnsafeFailure.test(summary.error.message) && (summary.recoveryActionCode === void 0 || summary.recoveryActionCode === "RETRY_COMMAND") && summary.runPath === void 0 && summary.finalRunDigest === void 0 && summary.latestStatePath === void 0 && summary.checkpointStatuses === void 0 && Array.isArray(events) && events.length >= 2 && events.every((event, index) => validLegacyEvent(event, legacyRunId) && event.sequence === index + 1) && legacyTerminal.phase === "publish" && legacyTerminal.status === "failed" && validLegacyError(legacyTerminal.error) && legacyTerminal.error.code === summary.error.code && events.slice(0, -1).filter((event) => event.status === "failed").every((event) => event.phase === "safety-gate" && legacyPreAuthorityGates.has(event.gate) && validLegacyError(event.error)) && !events.some((event) => event.phase === "global-preflight-arbitration" && event.status !== "pre-observe") && !events.slice(0, -1).some((event) => event.phase === "publish" || /checkpoint|execute|postpublish/i.test(event.phase) || Object.hasOwn(event, "prePersistedRunPath") || Object.hasOwn(event, "checkpointCount") || Object.hasOwn(event, "checkpointStatuses"));
149197
149662
  if (legacyValid) return true;
@@ -149227,7 +149692,7 @@ async function isProvenPreAuthorityFailure(runDir, runName) {
149227
149692
  findingCount: /* @__PURE__ */ __name((value) => Number.isSafeInteger(value) && value >= 0, "findingCount")
149228
149693
  };
149229
149694
  const validDetails = /* @__PURE__ */ __name((value) => value === void 0 || value !== null && typeof value === "object" && !Array.isArray(value) && Object.entries(value).every(([key, detail]) => !detailValidators[key] || detailValidators[key](detail)), "validDetails");
149230
- const validEnvelope = /* @__PURE__ */ __name((event) => event && typeof event === "object" && Object.keys(event).every((key) => envelopeKeys.has(key)) && event.schemaVersion === 2 && typeof event.runId === "string" && event.runId === basename18(runDir) && Number.isSafeInteger(event.sequence) && event.sequence >= 1 && validTimestamp(event.timestamp) && event.command === "publish" && typeof event.phase === "string" && event.phase.length > 0 && typeof event.status === "string" && event.status.length > 0 && sameProducer(event.producer) && (event.error === void 0 || event.error === null || typeof event.error === "object" && !Array.isArray(event.error) && Object.keys(event.error).every((key) => key === "code" || key === "message") && typeof event.error.code === "string" && event.error.code.length > 0 && (event.error.message === void 0 || typeof event.error.message === "string")) && (event.duration === void 0 || Number.isSafeInteger(event.duration) && event.duration >= 0) && validDetails(event.details), "validEnvelope");
149695
+ const validEnvelope = /* @__PURE__ */ __name((event) => event && typeof event === "object" && Object.keys(event).every((key) => envelopeKeys.has(key)) && event.schemaVersion === 2 && typeof event.runId === "string" && event.runId === basename19(runDir) && Number.isSafeInteger(event.sequence) && event.sequence >= 1 && validTimestamp(event.timestamp) && event.command === "publish" && typeof event.phase === "string" && event.phase.length > 0 && typeof event.status === "string" && event.status.length > 0 && sameProducer(event.producer) && (event.error === void 0 || event.error === null || typeof event.error === "object" && !Array.isArray(event.error) && Object.keys(event.error).every((key) => key === "code" || key === "message") && typeof event.error.code === "string" && event.error.code.length > 0 && (event.error.message === void 0 || typeof event.error.message === "string")) && (event.duration === void 0 || Number.isSafeInteger(event.duration) && event.duration >= 0) && validDetails(event.details), "validEnvelope");
149231
149696
  if (summary.status !== "FAILED" || summary.recoveryActionCode !== "RETRY_COMMAND" || summary.evidencePath !== "evidence.jsonl" || !sameProducer(summary.producer) || !Array.isArray(events) || events.length === 0) return false;
149232
149697
  let previousSequence = 0;
149233
149698
  let firstFailure = null;
@@ -149283,7 +149748,7 @@ async function readLegacyPostverifyRecovery(runPath) {
149283
149748
  runPath: run6.sourceRunPath,
149284
149749
  production
149285
149750
  });
149286
- const summary = JSON.parse(await readFile56(join48(resolve41(runPath, ".."), "summary.json"), "utf8"));
149751
+ const summary = JSON.parse(await readFile56(join48(resolve42(runPath, ".."), "summary.json"), "utf8"));
149287
149752
  if (!summary || summary.status !== run6.status) {
149288
149753
  throw new ReleaseError(GATE_FAILED, "legacy postverify summary status does not match its sealed run status");
149289
149754
  }
@@ -149300,16 +149765,16 @@ async function readLegacyPostverifyRecovery(runPath) {
149300
149765
  throw new ReleaseError(GATE_FAILED, "legacy postverify DISTRIBUTED run has incomplete checkpoints");
149301
149766
  }
149302
149767
  return {
149303
- runPath: resolve41(runPath),
149768
+ runPath: resolve42(runPath),
149304
149769
  run: run6,
149305
149770
  plan,
149306
- lineage: [{ run: parent, runPath: resolve41(run6.sourceRunPath) }],
149771
+ lineage: [{ run: parent, runPath: resolve42(run6.sourceRunPath) }],
149307
149772
  recoveryActionCode: null,
149308
149773
  legacyPostverify: true
149309
149774
  };
149310
149775
  } catch (error) {
149311
149776
  return {
149312
- runPath: resolve41(runPath),
149777
+ runPath: resolve42(runPath),
149313
149778
  recoveryActionCode: "DIAGNOSE",
149314
149779
  diagnostic: { code: error.code ?? GATE_FAILED, message: error.message }
149315
149780
  };
@@ -149658,7 +150123,7 @@ Workflow Profiles:
149658
150123
 
149659
150124
  // bin/release-skill-cli.mjs
149660
150125
  import { readFile as readFile57 } from "node:fs/promises";
149661
- import { basename as basename19, dirname as dirname26, join as join49, resolve as resolve42 } from "node:path";
150126
+ import { basename as basename20, dirname as dirname27, isAbsolute as isAbsolute33, join as join49, normalize as normalize7, resolve as resolve43 } from "node:path";
149662
150127
  import { execFile as execFileCb22 } from "node:child_process";
149663
150128
  import { promisify as promisify26 } from "node:util";
149664
150129
 
@@ -149759,11 +150224,11 @@ function publicErrorDetails(error) {
149759
150224
  if (Object.keys(cause).length > 0) output.cause = cause;
149760
150225
  }
149761
150226
  if (Array.isArray(details.nextSteps)) {
149762
- const nextSteps = details.nextSteps.filter((step) => step && typeof step === "object" && !Array.isArray(step)).map((step) => ({
149763
- ...typeof step.code === "string" ? { code: step.code } : {},
149764
- ...typeof step.message === "string" ? { message: step.message } : {},
149765
- ...Array.isArray(step.argv) && step.argv.every((arg) => typeof arg === "string") ? { argv: [...step.argv] } : {}
149766
- })).filter((step) => Object.keys(step).length > 0);
150227
+ const nextSteps = details.nextSteps.filter((step2) => step2 && typeof step2 === "object" && !Array.isArray(step2)).map((step2) => ({
150228
+ ...typeof step2.code === "string" ? { code: step2.code } : {},
150229
+ ...typeof step2.message === "string" ? { message: step2.message } : {},
150230
+ ...Array.isArray(step2.argv) && step2.argv.every((arg) => typeof arg === "string") ? { argv: [...step2.argv] } : {}
150231
+ })).filter((step2) => Object.keys(step2).length > 0);
149767
150232
  if (nextSteps.length > 0) output.nextSteps = nextSteps;
149768
150233
  }
149769
150234
  return output;
@@ -150024,6 +150489,9 @@ Options:
150024
150489
  --hosts <ids> Comma-separated local hosts for post-release update: claude,codex,kimi,codebuddy,workbuddy,qoder,cursor. No local host is updated unless --hosts contains at least one id
150025
150490
  --cursor-plugins-root <absolute-directory> Required for Cursor Local installation/update; quit Cursor before running
150026
150491
  --confirm-plan <digest> Confirm the exact VERIFIED plan before local host mutation
150492
+ --finish Run the complete post-release finish orchestration and return COMPLETE/PENDING/FAILED
150493
+ --finish-feedback <absolute-json-file> Read bound agent-reported host loading and setup results
150494
+ --skip-local-hosts Explicitly skip host update, loading, and setup for this finish run
150027
150495
  --no-hook-cache Force every prepare hook to run in full; neither read nor write the hook cache
150028
150496
  --json Output results as JSON
150029
150497
  --version Show version and exit
@@ -150066,7 +150534,7 @@ if (!command && (args.includes("--version") || args.includes("-v"))) {
150066
150534
  } else {
150067
150535
  const { readFileSync: readFileSync17 } = await import("node:fs");
150068
150536
  const { fileURLToPath: fileURLToPath7 } = await import("node:url");
150069
- const pkgPath = join49(dirname26(fileURLToPath7(import.meta.url)), "..", "package.json");
150537
+ const pkgPath = join49(dirname27(fileURLToPath7(import.meta.url)), "..", "package.json");
150070
150538
  pkg = JSON.parse(readFileSync17(pkgPath, "utf8"));
150071
150539
  }
150072
150540
  if (hasJson) {
@@ -150359,7 +150827,7 @@ if (command === "verify-records") {
150359
150827
  if (command === "setup") {
150360
150828
  const rootIdx = args.indexOf("--root");
150361
150829
  const rawRoot = rootIdx !== -1 && args[rootIdx + 1] ? args[rootIdx + 1] : process.cwd();
150362
- const root = resolve42(rawRoot);
150830
+ const root = resolve43(rawRoot);
150363
150831
  const answersIdx = args.indexOf("--answers");
150364
150832
  const answersPath = answersIdx !== -1 && args[answersIdx + 1] ? args[answersIdx + 1] : void 0;
150365
150833
  const confirmationIdx = args.indexOf("--confirm-setup");
@@ -150475,7 +150943,7 @@ if (command === "setup") {
150475
150943
  if (command === "assess") {
150476
150944
  const rootIdx = args.indexOf("--root");
150477
150945
  const rawRoot = rootIdx !== -1 && args[rootIdx + 1] ? args[rootIdx + 1] : process.cwd();
150478
- const root = resolve42(rawRoot);
150946
+ const root = resolve43(rawRoot);
150479
150947
  const offline = args.includes("--offline") || !args.includes("--online");
150480
150948
  const outputIdx = args.indexOf("--output");
150481
150949
  const output = outputIdx !== -1 && args[outputIdx + 1] ? args[outputIdx + 1] : void 0;
@@ -150506,7 +150974,7 @@ if (command === "assess") {
150506
150974
  if (command === "hooks") {
150507
150975
  const subcommand = positional[1];
150508
150976
  const rootIdx = args.indexOf("--root");
150509
- const root = resolve42(rootIdx !== -1 && args[rootIdx + 1] ? args[rootIdx + 1] : process.cwd());
150977
+ const root = resolve43(rootIdx !== -1 && args[rootIdx + 1] ? args[rootIdx + 1] : process.cwd());
150510
150978
  if (subcommand !== "validate") {
150511
150979
  const message = "hooks requires subcommand: hooks validate";
150512
150980
  if (hasJson) console.log(JSON.stringify({ error: "MISSING_PARAMETERS", message }));
@@ -150573,7 +151041,7 @@ if (command === "ship") {
150573
151041
  const idx = args.indexOf(flag);
150574
151042
  return idx !== -1 && args[idx + 1] ? args[idx + 1] : void 0;
150575
151043
  }, "value");
150576
- const root = resolve42(value("--root") ?? process.cwd());
151044
+ const root = resolve43(value("--root") ?? process.cwd());
150577
151045
  const hasUnitSelection = args.includes("--unit");
150578
151046
  const unitIds = [];
150579
151047
  for (let i = 0; i < args.length; i += 1) {
@@ -150584,7 +151052,7 @@ if (command === "ship") {
150584
151052
  const postpublishApprovalPaths = [];
150585
151053
  for (let i = 0; i < args.length; i += 1) {
150586
151054
  if (args[i] === "--hook-approval" && args[i + 1]) {
150587
- postpublishApprovalPaths.push(resolve42(args[i + 1]));
151055
+ postpublishApprovalPaths.push(resolve43(args[i + 1]));
150588
151056
  }
150589
151057
  }
150590
151058
  try {
@@ -150658,14 +151126,14 @@ if (command === "ship") {
150658
151126
  const localHostUpdate = result2.postRelease.localHostUpdate;
150659
151127
  if (localHostUpdate?.promptRequired === true) {
150660
151128
  console.log(`Post-release: ask whether to update local host plugins (${result2.postRelease.localHostUpdate.hosts.join(", ")}).`);
150661
- if (localHostUpdate.available === true && typeof localHostUpdate.runPath === "string") {
150662
- console.log(`Post-release command: release-skill post-release --plan ${result2.planPath} --run ${localHostUpdate.runPath}`);
150663
- console.log("Choose --hosts before adding --update-local-hosts to perform a local update.");
151129
+ if (result2.postRelease.finishCommand) {
151130
+ console.log(`Post-release finish command: ${result2.postRelease.finishCommand.argv.join(" ")}`);
151131
+ console.log("Choose --hosts before adding --update-local-hosts, or use --skip-local-hosts.");
150664
151132
  }
150665
151133
  printHubManualTargets(localHostUpdate.targets);
150666
151134
  } else {
150667
- for (const step of localHostUpdate?.nextSteps ?? []) {
150668
- console.log(`Next [${step.code}] ${step.message} (${step.argv.join(" ")})`);
151135
+ for (const step2 of localHostUpdate?.nextSteps ?? []) {
151136
+ console.log(`Next [${step2.code}] ${step2.message} (${step2.argv.join(" ")})`);
150669
151137
  }
150670
151138
  }
150671
151139
  }
@@ -150696,7 +151164,7 @@ if (command === "attest") {
150696
151164
  const idx = args.indexOf(flag);
150697
151165
  return idx !== -1 && args[idx + 1] ? args[idx + 1] : void 0;
150698
151166
  }, "value");
150699
- const root = resolve42(value("--root") ?? process.cwd());
151167
+ const root = resolve43(value("--root") ?? process.cwd());
150700
151168
  try {
150701
151169
  const { recordManualAttestation: recordManualAttestation2 } = await Promise.resolve().then(() => (init_attest(), attest_exports));
150702
151170
  const result2 = await recordManualAttestation2({
@@ -150734,7 +151202,7 @@ if (command === "attest") {
150734
151202
  if (command === "prepare") {
150735
151203
  const rootIdx = args.indexOf("--root");
150736
151204
  const rawRoot = rootIdx !== -1 && args[rootIdx + 1] ? args[rootIdx + 1] : process.cwd();
150737
- const root = resolve42(rawRoot);
151205
+ const root = resolve43(rawRoot);
150738
151206
  const offline = args.includes("--offline") || !args.includes("--online");
150739
151207
  let targetVersion;
150740
151208
  for (const flag of ["--target-version", "--version"]) {
@@ -150753,9 +151221,9 @@ if (command === "prepare") {
150753
151221
  const testSelectionIdx = args.indexOf("--test-selection");
150754
151222
  const testSelection = testSelectionIdx !== -1 && args[testSelectionIdx + 1] ? args[testSelectionIdx + 1] : void 0;
150755
151223
  const outputIdx = args.indexOf("--output");
150756
- const output = outputIdx !== -1 && args[outputIdx + 1] ? resolve42(args[outputIdx + 1]) : void 0;
151224
+ const output = outputIdx !== -1 && args[outputIdx + 1] ? resolve43(args[outputIdx + 1]) : void 0;
150757
151225
  const runDirIdx = args.indexOf("--run-dir");
150758
- const runDir = runDirIdx !== -1 && args[runDirIdx + 1] ? resolve42(args[runDirIdx + 1]) : void 0;
151226
+ const runDir = runDirIdx !== -1 && args[runDirIdx + 1] ? resolve43(args[runDirIdx + 1]) : void 0;
150759
151227
  const hasUnitSelection = args.includes("--unit");
150760
151228
  const unitIds = [];
150761
151229
  for (let i = 0; i < args.length; i += 1) {
@@ -150812,8 +151280,8 @@ if (command === "prepare") {
150812
151280
  console.log(`Plan frozen at: ${result2.planPath}`);
150813
151281
  console.log(`Plan digest: ${result2.planDigest}`);
150814
151282
  console.log(`Evidence: ${result2.evidenceDir}`);
150815
- for (const step of result2.nextSteps ?? []) {
150816
- console.log(`Next [${step.code}] ${step.message}${step.argv ? ` (${step.argv.join(" ")})` : ""}`);
151283
+ for (const step2 of result2.nextSteps ?? []) {
151284
+ console.log(`Next [${step2.code}] ${step2.message}${step2.argv ? ` (${step2.argv.join(" ")})` : ""}`);
150817
151285
  }
150818
151286
  if (result2.releaseScope) {
150819
151287
  console.log(`Release scope: ${result2.releaseScope.selectedUnitIds.join(", ")}`);
@@ -150853,7 +151321,7 @@ if (command === "approve") {
150853
151321
  const actorIdx = args.indexOf("--actor");
150854
151322
  const actor = actorIdx !== -1 && args[actorIdx + 1] ? args[actorIdx + 1] : void 0;
150855
151323
  const outputIdx = args.indexOf("--output");
150856
- const outputPath = outputIdx !== -1 && args[outputIdx + 1] ? resolve42(args[outputIdx + 1]) : void 0;
151324
+ const outputPath = outputIdx !== -1 && args[outputIdx + 1] ? resolve43(args[outputIdx + 1]) : void 0;
150857
151325
  const hookIdx = args.indexOf("--hook");
150858
151326
  const hookId = hookIdx !== -1 && args[hookIdx + 1] ? args[hookIdx + 1] : void 0;
150859
151327
  const runIdIdx = args.indexOf("--run-id");
@@ -150871,7 +151339,7 @@ if (command === "approve") {
150871
151339
  try {
150872
151340
  const { approvePostPublishHook: approvePostPublishHook2 } = await init_approve().then(() => approve_exports);
150873
151341
  const record = await approvePostPublishHook2({
150874
- planPath: resolve42(planPath),
151342
+ planPath: resolve43(planPath),
150875
151343
  hookId,
150876
151344
  actor,
150877
151345
  ...runId ? { runId } : {}
@@ -150909,13 +151377,13 @@ if (command === "approve") {
150909
151377
  const { readFile: readFileFs } = await import("node:fs/promises");
150910
151378
  let resolvedDigest = expectedDigest;
150911
151379
  if (!resolvedDigest) {
150912
- const planRaw = await readFileFs(resolve42(planPath), "utf8");
151380
+ const planRaw = await readFileFs(resolve43(planPath), "utf8");
150913
151381
  const planObj = JSON.parse(planRaw);
150914
151382
  resolvedDigest = computePlanDigest2(planObj);
150915
151383
  }
150916
- const resolvedPlanPath = resolve42(planPath);
150917
- const planDir = dirname26(resolvedPlanPath);
150918
- const releaseDir = basename19(planDir) === "plans" && basename19(resolvedPlanPath) === `${resolvedDigest}.json` ? dirname26(planDir) : planDir;
151384
+ const resolvedPlanPath = resolve43(planPath);
151385
+ const planDir = dirname27(resolvedPlanPath);
151386
+ const releaseDir = basename20(planDir) === "plans" && basename20(resolvedPlanPath) === `${resolvedDigest}.json` ? dirname27(planDir) : planDir;
150919
151387
  const approvalPath = outputPath ?? join49(releaseDir, "approval-record.json");
150920
151388
  const record = await approvePlan2({ planPath, expectedDigest: resolvedDigest, actor, outputPath: approvalPath });
150921
151389
  if (hasJson) {
@@ -150943,13 +151411,13 @@ if (command === "approve") {
150943
151411
  if (command === "reconcile") {
150944
151412
  const rootIdx = args.indexOf("--root");
150945
151413
  const rawRoot = rootIdx !== -1 && args[rootIdx + 1] ? args[rootIdx + 1] : process.cwd();
150946
- const root = resolve42(rawRoot);
151414
+ const root = resolve43(rawRoot);
150947
151415
  const planIdx = args.indexOf("--plan");
150948
- const planPath = planIdx !== -1 && args[planIdx + 1] ? resolve42(args[planIdx + 1]) : void 0;
151416
+ const planPath = planIdx !== -1 && args[planIdx + 1] ? resolve43(args[planIdx + 1]) : void 0;
150949
151417
  const runIdx = args.indexOf("--run");
150950
- const runPath = runIdx !== -1 && args[runIdx + 1] ? resolve42(args[runIdx + 1]) : void 0;
151418
+ const runPath = runIdx !== -1 && args[runIdx + 1] ? resolve43(args[runIdx + 1]) : void 0;
150951
151419
  const approvalIdx = args.indexOf("--approval");
150952
- const approvalPath = approvalIdx !== -1 && args[approvalIdx + 1] ? resolve42(args[approvalIdx + 1]) : void 0;
151420
+ const approvalPath = approvalIdx !== -1 && args[approvalIdx + 1] ? resolve43(args[approvalIdx + 1]) : void 0;
150953
151421
  if (!planPath || !runPath) {
150954
151422
  const msg = "reconcile requires --plan <path> and --run <path>";
150955
151423
  if (hasJson) {
@@ -151007,8 +151475,55 @@ if (command === "post-release") {
151007
151475
  const idx = args.indexOf(flag);
151008
151476
  return idx !== -1 && args[idx + 1] ? args[idx + 1] : void 0;
151009
151477
  }, "value");
151010
- const planPath = value("--plan") ? resolve42(value("--plan")) : void 0;
151011
- const runPath = value("--run") ? resolve42(value("--run")) : void 0;
151478
+ const planPath = value("--plan") ? resolve43(value("--plan")) : void 0;
151479
+ const runPath = value("--run") ? resolve43(value("--run")) : void 0;
151480
+ const finishRequested = args.includes("--finish");
151481
+ const skipLocalHosts = args.includes("--skip-local-hosts");
151482
+ const feedbackValue = value("--finish-feedback");
151483
+ if (finishRequested || skipLocalHosts || args.includes("--finish-feedback")) {
151484
+ const valued = /* @__PURE__ */ new Set([
151485
+ "--root",
151486
+ "--plan",
151487
+ "--run",
151488
+ "--confirm-plan",
151489
+ "--hosts",
151490
+ "--cursor-plugins-root",
151491
+ "--finish-feedback"
151492
+ ]);
151493
+ const booleans = /* @__PURE__ */ new Set(["--finish", "--skip-local-hosts", "--update-local-hosts", "--json"]);
151494
+ const seen = /* @__PURE__ */ new Set();
151495
+ let parameterError;
151496
+ for (let index = 1; index < args.length; index += 1) {
151497
+ const token = args[index];
151498
+ if (valued.has(token)) {
151499
+ if (seen.has(token)) parameterError ??= `post-release finish does not accept duplicate ${token}`;
151500
+ seen.add(token);
151501
+ const next = args[index + 1];
151502
+ if (!next || next.startsWith("-")) parameterError ??= `post-release finish requires a value for ${token}`;
151503
+ else index += 1;
151504
+ continue;
151505
+ }
151506
+ if (booleans.has(token)) {
151507
+ if (seen.has(token)) parameterError ??= `post-release finish does not accept duplicate ${token}`;
151508
+ seen.add(token);
151509
+ continue;
151510
+ }
151511
+ parameterError ??= `post-release finish does not accept ${token}`;
151512
+ }
151513
+ const rawHosts = value("--hosts");
151514
+ if (!finishRequested) parameterError ??= "--skip-local-hosts and --finish-feedback require --finish";
151515
+ if (skipLocalHosts && (args.includes("--update-local-hosts") || typeof rawHosts === "string" && rawHosts.trim().length > 0)) {
151516
+ parameterError ??= "--skip-local-hosts conflicts with --update-local-hosts and --hosts";
151517
+ }
151518
+ if (feedbackValue && (!isAbsolute33(feedbackValue) || normalize7(feedbackValue) !== feedbackValue)) {
151519
+ parameterError ??= "--finish-feedback requires a normalized absolute JSON file path";
151520
+ }
151521
+ if (parameterError) {
151522
+ if (hasJson) console.log(JSON.stringify({ error: "POST_RELEASE_FINISH_INVALID", message: parameterError, exitCode: 1 }));
151523
+ else console.error(`Error: ${parameterError}`);
151524
+ await exitAfterFlush(1);
151525
+ }
151526
+ }
151012
151527
  if (!planPath || !runPath) {
151013
151528
  const message = "post-release requires --plan <path> and --run <verify-or-postverify-run-path>";
151014
151529
  if (hasJson) console.log(JSON.stringify({ error: "MISSING_PARAMETERS", message, exitCode: 1 }));
@@ -151033,7 +151548,7 @@ if (command === "post-release") {
151033
151548
  requireDigest: true,
151034
151549
  authorityPlanPath: planPath
151035
151550
  });
151036
- if (!updateRequested) {
151551
+ if (!updateRequested || finishRequested) {
151037
151552
  const { assertLocalFinishRun: assertLocalFinishRun2 } = await init_post_release_local().then(() => post_release_local_exports);
151038
151553
  await assertLocalFinishRun2({
151039
151554
  plan,
@@ -151041,26 +151556,49 @@ if (command === "post-release") {
151041
151556
  runPath: resolvedRunPath,
151042
151557
  runRecord,
151043
151558
  production: Boolean(plan.production),
151044
- root: resolve42(value("--root") ?? process.cwd())
151559
+ root: resolve43(value("--root") ?? process.cwd())
151045
151560
  });
151046
151561
  }
151047
151562
  const hostsIndex = args.indexOf("--hosts");
151048
151563
  const rawHosts = hostsIndex !== -1 && args[hostsIndex + 1] && !args[hostsIndex + 1].startsWith("--") ? args[hostsIndex + 1] : "";
151049
151564
  const selectedHosts = rawHosts.split(",").map((host) => host.trim()).filter(Boolean);
151050
- const result2 = updateRequested ? await updateLocalHostPlugins2({
151565
+ const root = resolve43(value("--root") ?? process.cwd());
151566
+ const result2 = finishRequested ? await (async () => {
151567
+ const { runPostReleaseFinish: runPostReleaseFinish2 } = await init_post_release_finish().then(() => post_release_finish_exports);
151568
+ return runPostReleaseFinish2({
151569
+ root,
151570
+ plan,
151571
+ planPath,
151572
+ runPath: resolvedRunPath,
151573
+ selectedHosts,
151574
+ updateRequested,
151575
+ skipLocalHosts,
151576
+ confirmPlanDigest: value("--confirm-plan"),
151577
+ cursorPluginsRoot: value("--cursor-plugins-root"),
151578
+ feedbackPath: feedbackValue
151579
+ });
151580
+ })() : updateRequested ? await updateLocalHostPlugins2({
151051
151581
  planPath,
151052
151582
  runPath: resolvedRunPath,
151053
- root: resolve42(value("--root") ?? process.cwd()),
151583
+ root,
151054
151584
  confirmPlanDigest: value("--confirm-plan"),
151055
151585
  selectedHosts,
151056
151586
  cursorPluginsRoot: value("--cursor-plugins-root")
151057
151587
  }) : derivePostReleaseChecklist2(plan, {
151058
151588
  runPath: runRecord.command === "postverify" && runRecord.status === "DISTRIBUTED" ? resolvedRunPath : runRecord.command === "verify" ? resolvedRunPath : void 0,
151059
- root: resolve42(value("--root") ?? process.cwd()),
151589
+ root: resolve43(value("--root") ?? process.cwd()),
151060
151590
  postVerifyComplete: runRecord.command === "postverify" && runRecord.status === "DISTRIBUTED"
151061
151591
  });
151062
151592
  if (hasJson) {
151063
151593
  console.log(JSON.stringify(result2, null, 2));
151594
+ } else if (finishRequested) {
151595
+ console.log(`Post-release finish: ${result2.finish.status}`);
151596
+ for (const [name, outcome] of Object.entries(result2.finish.steps)) {
151597
+ console.log(` ${name}: ${outcome.status} - ${outcome.summary}`);
151598
+ }
151599
+ for (const action of result2.finish.nextActions) {
151600
+ console.log(`Next [${action.type}] ${JSON.stringify(action)}`);
151601
+ }
151064
151602
  } else if (!updateRequested) {
151065
151603
  console.log(`Post-release status: ${result2.status}`);
151066
151604
  if (result2.merge.promptRequired) console.log("Ask whether the user wants to merge the remaining branch.");
@@ -151073,8 +151611,8 @@ if (command === "post-release") {
151073
151611
  }
151074
151612
  printHubManualTargets(result2.localHostUpdate.targets);
151075
151613
  } else {
151076
- for (const step of result2.localHostUpdate.nextSteps ?? []) {
151077
- console.log(`Next [${step.code}] ${step.message} (${step.argv.join(" ")})`);
151614
+ for (const step2 of result2.localHostUpdate.nextSteps ?? []) {
151615
+ console.log(`Next [${step2.code}] ${step2.message} (${step2.argv.join(" ")})`);
151078
151616
  }
151079
151617
  }
151080
151618
  } else {
@@ -151084,6 +151622,9 @@ if (command === "post-release") {
151084
151622
  }
151085
151623
  console.log("The release remains VERIFIED; restart updated hosts before using the new plugin bytes.");
151086
151624
  }
151625
+ if (finishRequested) {
151626
+ await exitAfterFlush(result2.finish.status === "COMPLETE" ? 0 : result2.finish.status === "PENDING" ? 2 : 1);
151627
+ }
151087
151628
  const success = !updateRequested || ["UPDATED", "ALREADY_CURRENT", "NO_APPLICABLE_HOSTS"].includes(result2.status);
151088
151629
  await exitAfterFlush(success ? 0 : 1);
151089
151630
  } catch (err) {
@@ -151096,8 +151637,8 @@ if (command === "post-release") {
151096
151637
  }));
151097
151638
  } else {
151098
151639
  console.error(`Error: ${err.message}`);
151099
- for (const step of err.details?.nextSteps ?? []) {
151100
- console.error(`Next [${step.code}] ${step.message} (${step.argv.join(" ")})`);
151640
+ for (const step2 of err.details?.nextSteps ?? []) {
151641
+ console.error(`Next [${step2.code}] ${step2.message} (${step2.argv.join(" ")})`);
151101
151642
  }
151102
151643
  }
151103
151644
  await exitAfterFlush(err.exitCode ?? 1);
@@ -151110,11 +151651,11 @@ if (command === "verify") {
151110
151651
  }, "cursorValue");
151111
151652
  const rootIdx = args.indexOf("--root");
151112
151653
  const rawRoot = rootIdx !== -1 && args[rootIdx + 1] ? args[rootIdx + 1] : process.cwd();
151113
- const root = resolve42(rawRoot);
151654
+ const root = resolve43(rawRoot);
151114
151655
  const planIdx = args.indexOf("--plan");
151115
- const planPath = planIdx !== -1 && args[planIdx + 1] ? resolve42(args[planIdx + 1]) : void 0;
151656
+ const planPath = planIdx !== -1 && args[planIdx + 1] ? resolve43(args[planIdx + 1]) : void 0;
151116
151657
  const runIdx = args.indexOf("--run");
151117
- const runPath = runIdx !== -1 && args[runIdx + 1] ? resolve42(args[runIdx + 1]) : void 0;
151658
+ const runPath = runIdx !== -1 && args[runIdx + 1] ? resolve43(args[runIdx + 1]) : void 0;
151118
151659
  const verificationGatesAuthorized = args.includes("--acknowledge-gate-side-effects");
151119
151660
  if (!planPath || !runPath) {
151120
151661
  const msg = "verify requires --plan <path> and --run <path>";
@@ -151156,7 +151697,11 @@ if (command === "verify") {
151156
151697
  } = await init_post_release_local().then(() => post_release_local_exports);
151157
151698
  const plan = JSON.parse(await readFile57(planPath, "utf8"));
151158
151699
  try {
151159
- result2.postRelease = derivePostReleaseChecklist2(plan, { root, runPath: result2.runPath });
151700
+ result2.postRelease = derivePostReleaseChecklist2(plan, {
151701
+ root,
151702
+ planPath,
151703
+ runPath: result2.runPath
151704
+ });
151160
151705
  } catch (error) {
151161
151706
  result2.postRelease = unavailablePostReleaseChecklist2(plan, error);
151162
151707
  }
@@ -151183,14 +151728,14 @@ if (command === "verify") {
151183
151728
  }
151184
151729
  if (result2.postRelease?.localHostUpdate?.promptRequired === true) {
151185
151730
  console.log(`Post-release: ask whether to update local host plugins (${result2.postRelease.localHostUpdate.hosts.join(", ")}).`);
151186
- if (result2.postRelease.localHostUpdate.available === true && typeof result2.postRelease.localHostUpdate.runPath === "string") {
151187
- console.log(`Post-release command: release-skill post-release --plan ${planPath} --run ${result2.postRelease.localHostUpdate.runPath}`);
151188
- console.log("Choose --hosts before adding --update-local-hosts to perform a local update.");
151731
+ if (result2.postRelease.finishCommand) {
151732
+ console.log(`Post-release finish command: ${result2.postRelease.finishCommand.argv.join(" ")}`);
151733
+ console.log("Choose --hosts before adding --update-local-hosts, or use --skip-local-hosts.");
151189
151734
  }
151190
151735
  printHubManualTargets(result2.postRelease.localHostUpdate.targets);
151191
151736
  } else {
151192
- for (const step of result2.postRelease?.localHostUpdate?.nextSteps ?? []) {
151193
- console.log(`Next [${step.code}] ${step.message} (${step.argv.join(" ")})`);
151737
+ for (const step2 of result2.postRelease?.localHostUpdate?.nextSteps ?? []) {
151738
+ console.log(`Next [${step2.code}] ${step2.message} (${step2.argv.join(" ")})`);
151194
151739
  }
151195
151740
  }
151196
151741
  }
@@ -151264,7 +151809,7 @@ This command creates an independent postVerify run and never reads or writes shi
151264
151809
  }
151265
151810
  return firstValue;
151266
151811
  }, "value");
151267
- const root = resolve42(value("--root") ?? process.cwd());
151812
+ const root = resolve43(value("--root") ?? process.cwd());
151268
151813
  const planPath = value("--plan");
151269
151814
  const approvalPath = value("--approval");
151270
151815
  const runPath = value("--run");
@@ -151275,7 +151820,7 @@ This command creates an independent postVerify run and never reads or writes shi
151275
151820
  if (!next || next.startsWith("-")) {
151276
151821
  malformedValuedFlag ??= "--hook-approval";
151277
151822
  } else {
151278
- postpublishApprovalPaths.push(resolve42(next));
151823
+ postpublishApprovalPaths.push(resolve43(next));
151279
151824
  }
151280
151825
  }
151281
151826
  }
@@ -151291,9 +151836,9 @@ This command creates an independent postVerify run and never reads or writes shi
151291
151836
  try {
151292
151837
  const { postVerifyRelease: postVerifyRelease2 } = await init_postverify().then(() => postverify_exports);
151293
151838
  const result2 = await postVerifyRelease2({
151294
- planPath: resolve42(planPath),
151295
- approvalPath: resolve42(approvalPath),
151296
- sourceRunPath: resolve42(runPath),
151839
+ planPath: resolve43(planPath),
151840
+ approvalPath: resolve43(approvalPath),
151841
+ sourceRunPath: resolve43(runPath),
151297
151842
  root,
151298
151843
  ...postpublishApprovalPaths.length > 0 ? { postpublishApprovalPaths } : {}
151299
151844
  });
@@ -151304,9 +151849,10 @@ This command creates an independent postVerify run and never reads or writes shi
151304
151849
  } = await init_post_release_local().then(() => post_release_local_exports);
151305
151850
  let plan;
151306
151851
  try {
151307
- plan = JSON.parse(await readFile57(resolve42(planPath), "utf8"));
151852
+ plan = JSON.parse(await readFile57(resolve43(planPath), "utf8"));
151308
151853
  result2.postRelease = derivePostReleaseChecklist2(plan, {
151309
151854
  root,
151855
+ planPath: resolve43(planPath),
151310
151856
  runPath: result2.runPath,
151311
151857
  postVerifyComplete: true
151312
151858
  });
@@ -151327,9 +151873,9 @@ This command creates an independent postVerify run and never reads or writes shi
151327
151873
  } else if (result2.postRelease?.localHostUpdate?.promptRequired === true) {
151328
151874
  const localHostUpdate = result2.postRelease.localHostUpdate;
151329
151875
  console.log(`Post-release: ask whether to update local host plugins (${localHostUpdate.hosts.join(", ")}).`);
151330
- if (localHostUpdate.available === true && typeof localHostUpdate.runPath === "string") {
151331
- console.log(`Post-release command: release-skill post-release --plan ${resolve42(planPath)} --run ${localHostUpdate.runPath}`);
151332
- console.log("Choose --hosts before adding --update-local-hosts to perform a local update.");
151876
+ if (result2.postRelease.finishCommand) {
151877
+ console.log(`Post-release finish command: ${result2.postRelease.finishCommand.argv.join(" ")}`);
151878
+ console.log("Choose --hosts before adding --update-local-hosts, or use --skip-local-hosts.");
151333
151879
  }
151334
151880
  printHubManualTargets(localHostUpdate.targets);
151335
151881
  }
@@ -151352,11 +151898,11 @@ This command creates an independent postVerify run and never reads or writes shi
151352
151898
  if (command === "publish") {
151353
151899
  const rootIdx = args.indexOf("--root");
151354
151900
  const rawRoot = rootIdx !== -1 && args[rootIdx + 1] ? args[rootIdx + 1] : process.cwd();
151355
- const root = resolve42(rawRoot);
151901
+ const root = resolve43(rawRoot);
151356
151902
  const planIdx = args.indexOf("--plan");
151357
- const planPath = planIdx !== -1 && args[planIdx + 1] ? resolve42(args[planIdx + 1]) : void 0;
151903
+ const planPath = planIdx !== -1 && args[planIdx + 1] ? resolve43(args[planIdx + 1]) : void 0;
151358
151904
  const approvalIdx = args.indexOf("--approval");
151359
- const approvalPath = approvalIdx !== -1 && args[approvalIdx + 1] ? resolve42(args[approvalIdx + 1]) : void 0;
151905
+ const approvalPath = approvalIdx !== -1 && args[approvalIdx + 1] ? resolve43(args[approvalIdx + 1]) : void 0;
151360
151906
  if (!planPath || !approvalPath) {
151361
151907
  const msg = "publish requires --plan <path> and --approval <path>";
151362
151908
  if (hasJson) {
@@ -151412,9 +151958,9 @@ if (command === "publish") {
151412
151958
  if (command === "artifacts") {
151413
151959
  const rootIdx = args.indexOf("--root");
151414
151960
  const rawRoot = rootIdx !== -1 && args[rootIdx + 1] ? args[rootIdx + 1] : process.cwd();
151415
- const root = resolve42(rawRoot);
151961
+ const root = resolve43(rawRoot);
151416
151962
  const outputIdx = args.indexOf("--output");
151417
- const output = outputIdx !== -1 && args[outputIdx + 1] ? resolve42(args[outputIdx + 1]) : void 0;
151963
+ const output = outputIdx !== -1 && args[outputIdx + 1] ? resolve43(args[outputIdx + 1]) : void 0;
151418
151964
  const subcommand = positional[1] ?? "status";
151419
151965
  try {
151420
151966
  const { runArtifactsCommand: runArtifactsCommand2 } = await init_artifacts().then(() => artifacts_exports);
@@ -151481,7 +152027,7 @@ if (command === "docs") {
151481
152027
  );
151482
152028
  }
151483
152029
  }
151484
- const root = resolve42(rawRoot);
152030
+ const root = resolve43(rawRoot);
151485
152031
  const valuedDocsFlags = /* @__PURE__ */ new Set(["--root", "--unit", "--confirm-refresh"]);
151486
152032
  const booleanDocsFlags = /* @__PURE__ */ new Set(["--json", "--write", "--ack-local-document-write"]);
151487
152033
  let docsSubcommand;
@@ -151564,7 +152110,7 @@ if (command === "distribute") {
151564
152110
  const idx = args.indexOf(flag);
151565
152111
  return idx !== -1 && args[idx + 1] ? args[idx + 1] : void 0;
151566
152112
  }, "value");
151567
- const root = resolve42(value("--root") ?? process.cwd());
152113
+ const root = resolve43(value("--root") ?? process.cwd());
151568
152114
  const planPath = value("--plan");
151569
152115
  const approvalPath = value("--approval");
151570
152116
  const runPath = value("--run");
@@ -151572,7 +152118,7 @@ if (command === "distribute") {
151572
152118
  const postpublishApprovalPaths = [];
151573
152119
  for (let i = 0; i < args.length; i += 1) {
151574
152120
  if (args[i] === "--hook-approval" && args[i + 1]) {
151575
- postpublishApprovalPaths.push(resolve42(args[i + 1]));
152121
+ postpublishApprovalPaths.push(resolve43(args[i + 1]));
151576
152122
  }
151577
152123
  }
151578
152124
  if (args.includes("--list-presets")) {