release-skill 0.2.7 → 0.2.9

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 (36) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.codebuddy-plugin/plugin.json +1 -1
  4. package/.codex-plugin/plugin.json +2 -2
  5. package/.kimi-plugin/plugin.json +1 -1
  6. package/CHANGELOG.md +36 -0
  7. package/INSTALL.md +4 -4
  8. package/INSTALL.zh-CN.md +4 -4
  9. package/README.md +7 -13
  10. package/README.zh-CN.md +7 -13
  11. package/adapters/claude/.claude-plugin/marketplace.json +1 -1
  12. package/adapters/claude/.claude-plugin/plugin.json +1 -1
  13. package/adapters/claude/bin/release-skill.bundle.mjs +1153 -620
  14. package/adapters/claude/schemas/.render-manifest.json +2 -2
  15. package/adapters/claude/schemas/release-project.schema.json +60 -0
  16. package/adapters/codex/.codex-plugin/plugin.json +2 -2
  17. package/adapters/codex/bin/release-skill.bundle.mjs +1153 -620
  18. package/adapters/codex/schemas/.render-manifest.json +2 -2
  19. package/adapters/codex/schemas/release-project.schema.json +60 -0
  20. package/adapters/kimi/.kimi-plugin/plugin.json +1 -1
  21. package/adapters/kimi/bin/release-skill.bundle.mjs +1153 -620
  22. package/adapters/kimi/schemas/.render-manifest.json +2 -2
  23. package/adapters/kimi/schemas/release-project.schema.json +60 -0
  24. package/adapters/workbuddy/.codebuddy-plugin/plugin.json +1 -1
  25. package/adapters/workbuddy/bin/release-skill.bundle.mjs +1153 -620
  26. package/adapters/workbuddy/schemas/.render-manifest.json +2 -2
  27. package/adapters/workbuddy/schemas/release-project.schema.json +60 -0
  28. package/bin/release-skill-cli.mjs +4 -0
  29. package/bin/release-skill.bundle.mjs +1153 -620
  30. package/package.json +1 -1
  31. package/schemas/.render-manifest.json +2 -2
  32. package/schemas/release-project.schema.json +60 -0
  33. package/src/commands/assess.mjs +18 -5
  34. package/src/commands/prepare.mjs +59 -1
  35. package/src/core/config.mjs +48 -0
  36. package/src/core/public-surface.mjs +535 -0
@@ -9,7 +9,7 @@ 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.2.7"});
12
+ const __bundlePkg = Object.freeze({"name":"release-skill","version":"0.2.9"});
13
13
 
14
14
  var __create = Object.create;
15
15
  var __defProp = Object.defineProperty;
@@ -4425,10 +4425,10 @@ var require_resolve_block_map = __commonJS({
4425
4425
  let offset = bm.offset;
4426
4426
  let commentEnd = null;
4427
4427
  for (const collItem of bm.items) {
4428
- const { start, key, sep: sep6, value } = collItem;
4428
+ const { start, key, sep: sep7, value } = collItem;
4429
4429
  const keyProps = resolveProps.resolveProps(start, {
4430
4430
  indicator: "explicit-key-ind",
4431
- next: key ?? sep6?.[0],
4431
+ next: key ?? sep7?.[0],
4432
4432
  offset,
4433
4433
  onError,
4434
4434
  parentIndent: bm.indent,
@@ -4442,7 +4442,7 @@ var require_resolve_block_map = __commonJS({
4442
4442
  else if ("indent" in key && key.indent !== bm.indent)
4443
4443
  onError(offset, "BAD_INDENT", startColMsg);
4444
4444
  }
4445
- if (!keyProps.anchor && !keyProps.tag && !sep6) {
4445
+ if (!keyProps.anchor && !keyProps.tag && !sep7) {
4446
4446
  commentEnd = keyProps.end;
4447
4447
  if (keyProps.comment) {
4448
4448
  if (map.comment)
@@ -4466,7 +4466,7 @@ var require_resolve_block_map = __commonJS({
4466
4466
  ctx.atKey = false;
4467
4467
  if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode))
4468
4468
  onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
4469
- const valueProps = resolveProps.resolveProps(sep6 ?? [], {
4469
+ const valueProps = resolveProps.resolveProps(sep7 ?? [], {
4470
4470
  indicator: "map-value-ind",
4471
4471
  next: value,
4472
4472
  offset: keyNode.range[2],
@@ -4482,7 +4482,7 @@ var require_resolve_block_map = __commonJS({
4482
4482
  if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024)
4483
4483
  onError(keyNode.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key");
4484
4484
  }
4485
- const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset, sep6, null, valueProps, onError);
4485
+ const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset, sep7, null, valueProps, onError);
4486
4486
  if (ctx.schema.compat)
4487
4487
  utilFlowIndentCheck.flowIndentCheck(bm.indent, value, onError);
4488
4488
  offset = valueNode.range[2];
@@ -4575,7 +4575,7 @@ var require_resolve_end = __commonJS({
4575
4575
  let comment = "";
4576
4576
  if (end) {
4577
4577
  let hasSpace = false;
4578
- let sep6 = "";
4578
+ let sep7 = "";
4579
4579
  for (const token of end) {
4580
4580
  const { source, type } = token;
4581
4581
  switch (type) {
@@ -4589,13 +4589,13 @@ var require_resolve_end = __commonJS({
4589
4589
  if (!comment)
4590
4590
  comment = cb;
4591
4591
  else
4592
- comment += sep6 + cb;
4593
- sep6 = "";
4592
+ comment += sep7 + cb;
4593
+ sep7 = "";
4594
4594
  break;
4595
4595
  }
4596
4596
  case "newline":
4597
4597
  if (comment)
4598
- sep6 += source;
4598
+ sep7 += source;
4599
4599
  hasSpace = true;
4600
4600
  break;
4601
4601
  default:
@@ -4639,18 +4639,18 @@ var require_resolve_flow_collection = __commonJS({
4639
4639
  let offset = fc.offset + fc.start.source.length;
4640
4640
  for (let i = 0; i < fc.items.length; ++i) {
4641
4641
  const collItem = fc.items[i];
4642
- const { start, key, sep: sep6, value } = collItem;
4642
+ const { start, key, sep: sep7, value } = collItem;
4643
4643
  const props = resolveProps.resolveProps(start, {
4644
4644
  flow: fcName,
4645
4645
  indicator: "explicit-key-ind",
4646
- next: key ?? sep6?.[0],
4646
+ next: key ?? sep7?.[0],
4647
4647
  offset,
4648
4648
  onError,
4649
4649
  parentIndent: fc.indent,
4650
4650
  startOnNewline: false
4651
4651
  });
4652
4652
  if (!props.found) {
4653
- if (!props.anchor && !props.tag && !sep6 && !value) {
4653
+ if (!props.anchor && !props.tag && !sep7 && !value) {
4654
4654
  if (i === 0 && props.comma)
4655
4655
  onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`);
4656
4656
  else if (i < fc.items.length - 1)
@@ -4704,8 +4704,8 @@ var require_resolve_flow_collection = __commonJS({
4704
4704
  }
4705
4705
  }
4706
4706
  }
4707
- if (!isMap && !sep6 && !props.found) {
4708
- const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, sep6, null, props, onError);
4707
+ if (!isMap && !sep7 && !props.found) {
4708
+ const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, sep7, null, props, onError);
4709
4709
  coll.items.push(valueNode);
4710
4710
  offset = valueNode.range[2];
4711
4711
  if (isBlock(value))
@@ -4717,7 +4717,7 @@ var require_resolve_flow_collection = __commonJS({
4717
4717
  if (isBlock(key))
4718
4718
  onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg);
4719
4719
  ctx.atKey = false;
4720
- const valueProps = resolveProps.resolveProps(sep6 ?? [], {
4720
+ const valueProps = resolveProps.resolveProps(sep7 ?? [], {
4721
4721
  flow: fcName,
4722
4722
  indicator: "map-value-ind",
4723
4723
  next: value,
@@ -4728,8 +4728,8 @@ var require_resolve_flow_collection = __commonJS({
4728
4728
  });
4729
4729
  if (valueProps.found) {
4730
4730
  if (!isMap && !props.found && ctx.options.strict) {
4731
- if (sep6)
4732
- for (const st of sep6) {
4731
+ if (sep7)
4732
+ for (const st of sep7) {
4733
4733
  if (st === valueProps.found)
4734
4734
  break;
4735
4735
  if (st.type === "newline") {
@@ -4746,7 +4746,7 @@ var require_resolve_flow_collection = __commonJS({
4746
4746
  else
4747
4747
  onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`);
4748
4748
  }
4749
- const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep6, null, valueProps, onError) : null;
4749
+ const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep7, null, valueProps, onError) : null;
4750
4750
  if (valueNode) {
4751
4751
  if (isBlock(value))
4752
4752
  onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
@@ -4929,7 +4929,7 @@ var require_resolve_block_scalar = __commonJS({
4929
4929
  chompStart = i + 1;
4930
4930
  }
4931
4931
  let value = "";
4932
- let sep6 = "";
4932
+ let sep7 = "";
4933
4933
  let prevMoreIndented = false;
4934
4934
  for (let i = 0; i < contentStart; ++i)
4935
4935
  value += lines[i][0].slice(trimIndent) + "\n";
@@ -4946,24 +4946,24 @@ var require_resolve_block_scalar = __commonJS({
4946
4946
  indent = "";
4947
4947
  }
4948
4948
  if (type === Scalar.Scalar.BLOCK_LITERAL) {
4949
- value += sep6 + indent.slice(trimIndent) + content;
4950
- sep6 = "\n";
4949
+ value += sep7 + indent.slice(trimIndent) + content;
4950
+ sep7 = "\n";
4951
4951
  } else if (indent.length > trimIndent || content[0] === " ") {
4952
- if (sep6 === " ")
4953
- sep6 = "\n";
4954
- else if (!prevMoreIndented && sep6 === "\n")
4955
- sep6 = "\n\n";
4956
- value += sep6 + indent.slice(trimIndent) + content;
4957
- sep6 = "\n";
4952
+ if (sep7 === " ")
4953
+ sep7 = "\n";
4954
+ else if (!prevMoreIndented && sep7 === "\n")
4955
+ sep7 = "\n\n";
4956
+ value += sep7 + indent.slice(trimIndent) + content;
4957
+ sep7 = "\n";
4958
4958
  prevMoreIndented = true;
4959
4959
  } else if (content === "") {
4960
- if (sep6 === "\n")
4960
+ if (sep7 === "\n")
4961
4961
  value += "\n";
4962
4962
  else
4963
- sep6 = "\n";
4963
+ sep7 = "\n";
4964
4964
  } else {
4965
- value += sep6 + content;
4966
- sep6 = " ";
4965
+ value += sep7 + content;
4966
+ sep7 = " ";
4967
4967
  prevMoreIndented = false;
4968
4968
  }
4969
4969
  }
@@ -5151,25 +5151,25 @@ var require_resolve_flow_scalar = __commonJS({
5151
5151
  if (!match)
5152
5152
  return source;
5153
5153
  let res = match[1];
5154
- let sep6 = " ";
5154
+ let sep7 = " ";
5155
5155
  let pos = first.lastIndex;
5156
5156
  line.lastIndex = pos;
5157
5157
  while (match = line.exec(source)) {
5158
5158
  if (match[1] === "") {
5159
- if (sep6 === "\n")
5160
- res += sep6;
5159
+ if (sep7 === "\n")
5160
+ res += sep7;
5161
5161
  else
5162
- sep6 = "\n";
5162
+ sep7 = "\n";
5163
5163
  } else {
5164
- res += sep6 + match[1];
5165
- sep6 = " ";
5164
+ res += sep7 + match[1];
5165
+ sep7 = " ";
5166
5166
  }
5167
5167
  pos = line.lastIndex;
5168
5168
  }
5169
5169
  const last = /[ \t]*(.*)/sy;
5170
5170
  last.lastIndex = pos;
5171
5171
  match = last.exec(source);
5172
- return res + sep6 + (match?.[1] ?? "");
5172
+ return res + sep7 + (match?.[1] ?? "");
5173
5173
  }
5174
5174
  __name(foldLines, "foldLines");
5175
5175
  function doubleQuotedValue(source, onError) {
@@ -6003,14 +6003,14 @@ var require_cst_stringify = __commonJS({
6003
6003
  }
6004
6004
  }
6005
6005
  __name(stringifyToken, "stringifyToken");
6006
- function stringifyItem({ start, key, sep: sep6, value }) {
6006
+ function stringifyItem({ start, key, sep: sep7, value }) {
6007
6007
  let res = "";
6008
6008
  for (const st of start)
6009
6009
  res += st.source;
6010
6010
  if (key)
6011
6011
  res += stringifyToken(key);
6012
- if (sep6)
6013
- for (const st of sep6)
6012
+ if (sep7)
6013
+ for (const st of sep7)
6014
6014
  res += st.source;
6015
6015
  if (value)
6016
6016
  res += stringifyToken(value);
@@ -7199,18 +7199,18 @@ var require_parser = __commonJS({
7199
7199
  if (this.type === "map-value-ind") {
7200
7200
  const prev = getPrevProps(this.peek(2));
7201
7201
  const start = getFirstKeyStartProps(prev);
7202
- let sep6;
7202
+ let sep7;
7203
7203
  if (scalar.end) {
7204
- sep6 = scalar.end;
7205
- sep6.push(this.sourceToken);
7204
+ sep7 = scalar.end;
7205
+ sep7.push(this.sourceToken);
7206
7206
  delete scalar.end;
7207
7207
  } else
7208
- sep6 = [this.sourceToken];
7208
+ sep7 = [this.sourceToken];
7209
7209
  const map = {
7210
7210
  type: "block-map",
7211
7211
  offset: scalar.offset,
7212
7212
  indent: scalar.indent,
7213
- items: [{ start, key: scalar, sep: sep6 }]
7213
+ items: [{ start, key: scalar, sep: sep7 }]
7214
7214
  };
7215
7215
  this.onKeyLine = true;
7216
7216
  this.stack[this.stack.length - 1] = map;
@@ -7363,15 +7363,15 @@ var require_parser = __commonJS({
7363
7363
  } else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
7364
7364
  const start2 = getFirstKeyStartProps(it.start);
7365
7365
  const key = it.key;
7366
- const sep6 = it.sep;
7367
- sep6.push(this.sourceToken);
7366
+ const sep7 = it.sep;
7367
+ sep7.push(this.sourceToken);
7368
7368
  delete it.key;
7369
7369
  delete it.sep;
7370
7370
  this.stack.push({
7371
7371
  type: "block-map",
7372
7372
  offset: this.offset,
7373
7373
  indent: this.indent,
7374
- items: [{ start: start2, key, sep: sep6 }]
7374
+ items: [{ start: start2, key, sep: sep7 }]
7375
7375
  });
7376
7376
  } else if (start.length > 0) {
7377
7377
  it.sep = it.sep.concat(start, this.sourceToken);
@@ -7565,13 +7565,13 @@ var require_parser = __commonJS({
7565
7565
  const prev = getPrevProps(parent);
7566
7566
  const start = getFirstKeyStartProps(prev);
7567
7567
  fixFlowSeqItems(fc);
7568
- const sep6 = fc.end.splice(1, fc.end.length);
7569
- sep6.push(this.sourceToken);
7568
+ const sep7 = fc.end.splice(1, fc.end.length);
7569
+ sep7.push(this.sourceToken);
7570
7570
  const map = {
7571
7571
  type: "block-map",
7572
7572
  offset: fc.offset,
7573
7573
  indent: fc.indent,
7574
- items: [{ start, key: fc, sep: sep6 }]
7574
+ items: [{ start, key: fc, sep: sep7 }]
7575
7575
  };
7576
7576
  this.onKeyLine = true;
7577
7577
  this.stack[this.stack.length - 1] = map;
@@ -11062,7 +11062,7 @@ var require_compile = __commonJS({
11062
11062
  const schOrFunc = root.refs[ref];
11063
11063
  if (schOrFunc)
11064
11064
  return schOrFunc;
11065
- let _sch = resolve28.call(this, root, ref);
11065
+ let _sch = resolve29.call(this, root, ref);
11066
11066
  if (_sch === void 0) {
11067
11067
  const schema2 = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref];
11068
11068
  const { schemaId } = this.opts;
@@ -11093,13 +11093,13 @@ var require_compile = __commonJS({
11093
11093
  return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
11094
11094
  }
11095
11095
  __name(sameSchemaEnv, "sameSchemaEnv");
11096
- function resolve28(root, ref) {
11096
+ function resolve29(root, ref) {
11097
11097
  let sch;
11098
11098
  while (typeof (sch = this.refs[ref]) == "string")
11099
11099
  ref = sch;
11100
11100
  return sch || this.schemas[ref] || resolveSchema.call(this, root, ref);
11101
11101
  }
11102
- __name(resolve28, "resolve");
11102
+ __name(resolve29, "resolve");
11103
11103
  function resolveSchema(root, ref) {
11104
11104
  const p = this.opts.uriResolver.parse(ref);
11105
11105
  const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p);
@@ -11751,56 +11751,56 @@ var require_fast_uri = __commonJS({
11751
11751
  return uri;
11752
11752
  }
11753
11753
  __name(normalize4, "normalize");
11754
- function resolve28(baseURI, relativeURI, options) {
11754
+ function resolve29(baseURI, relativeURI, options) {
11755
11755
  const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
11756
11756
  const resolved = resolveComponent(parse2(baseURI, schemelessOptions), parse2(relativeURI, schemelessOptions), schemelessOptions, true);
11757
11757
  schemelessOptions.skipEscape = true;
11758
11758
  return serialize(resolved, schemelessOptions);
11759
11759
  }
11760
- __name(resolve28, "resolve");
11761
- function resolveComponent(base, relative25, options, skipNormalization) {
11760
+ __name(resolve29, "resolve");
11761
+ function resolveComponent(base, relative26, options, skipNormalization) {
11762
11762
  const target = {};
11763
11763
  if (!skipNormalization) {
11764
11764
  base = parse2(serialize(base, options), options);
11765
- relative25 = parse2(serialize(relative25, options), options);
11765
+ relative26 = parse2(serialize(relative26, options), options);
11766
11766
  }
11767
11767
  options = options || {};
11768
- if (!options.tolerant && relative25.scheme) {
11769
- target.scheme = relative25.scheme;
11770
- target.userinfo = relative25.userinfo;
11771
- target.host = relative25.host;
11772
- target.port = relative25.port;
11773
- target.path = removeDotSegments(relative25.path || "");
11774
- target.query = relative25.query;
11768
+ if (!options.tolerant && relative26.scheme) {
11769
+ target.scheme = relative26.scheme;
11770
+ target.userinfo = relative26.userinfo;
11771
+ target.host = relative26.host;
11772
+ target.port = relative26.port;
11773
+ target.path = removeDotSegments(relative26.path || "");
11774
+ target.query = relative26.query;
11775
11775
  } else {
11776
- if (relative25.userinfo !== void 0 || relative25.host !== void 0 || relative25.port !== void 0) {
11777
- target.userinfo = relative25.userinfo;
11778
- target.host = relative25.host;
11779
- target.port = relative25.port;
11780
- target.path = removeDotSegments(relative25.path || "");
11781
- target.query = relative25.query;
11776
+ if (relative26.userinfo !== void 0 || relative26.host !== void 0 || relative26.port !== void 0) {
11777
+ target.userinfo = relative26.userinfo;
11778
+ target.host = relative26.host;
11779
+ target.port = relative26.port;
11780
+ target.path = removeDotSegments(relative26.path || "");
11781
+ target.query = relative26.query;
11782
11782
  } else {
11783
- if (!relative25.path) {
11783
+ if (!relative26.path) {
11784
11784
  target.path = base.path;
11785
- if (relative25.query !== void 0) {
11786
- target.query = relative25.query;
11785
+ if (relative26.query !== void 0) {
11786
+ target.query = relative26.query;
11787
11787
  } else {
11788
11788
  target.query = base.query;
11789
11789
  }
11790
11790
  } else {
11791
- if (relative25.path[0] === "/") {
11792
- target.path = removeDotSegments(relative25.path);
11791
+ if (relative26.path[0] === "/") {
11792
+ target.path = removeDotSegments(relative26.path);
11793
11793
  } else {
11794
11794
  if ((base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0) && !base.path) {
11795
- target.path = "/" + relative25.path;
11795
+ target.path = "/" + relative26.path;
11796
11796
  } else if (!base.path) {
11797
- target.path = relative25.path;
11797
+ target.path = relative26.path;
11798
11798
  } else {
11799
- target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative25.path;
11799
+ target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative26.path;
11800
11800
  }
11801
11801
  target.path = removeDotSegments(target.path);
11802
11802
  }
11803
- target.query = relative25.query;
11803
+ target.query = relative26.query;
11804
11804
  }
11805
11805
  target.userinfo = base.userinfo;
11806
11806
  target.host = base.host;
@@ -11808,7 +11808,7 @@ var require_fast_uri = __commonJS({
11808
11808
  }
11809
11809
  target.scheme = base.scheme;
11810
11810
  }
11811
- target.fragment = relative25.fragment;
11811
+ target.fragment = relative26.fragment;
11812
11812
  return target;
11813
11813
  }
11814
11814
  __name(resolveComponent, "resolveComponent");
@@ -12019,7 +12019,7 @@ var require_fast_uri = __commonJS({
12019
12019
  var fastUri = {
12020
12020
  SCHEMES,
12021
12021
  normalize: normalize4,
12022
- resolve: resolve28,
12022
+ resolve: resolve29,
12023
12023
  resolveComponent,
12024
12024
  equal,
12025
12025
  serialize,
@@ -17089,8 +17089,8 @@ function kimiAuthorityDir(context, planDigest, plugin) {
17089
17089
  const base = resolve4(context.root, ".release-skill", "kimi-attestations");
17090
17090
  const dir = resolve4(base, plugin);
17091
17091
  const rel = relative2(base, dir);
17092
- const sep6 = process.platform === "win32" ? "\\" : "/";
17093
- if (rel === "" || rel === ".." || isAbsolute2(rel) || rel.startsWith(`..${sep6}`) || rel.split(sep6).some((segment) => segment === ".." || segment === "")) {
17092
+ const sep7 = process.platform === "win32" ? "\\" : "/";
17093
+ if (rel === "" || rel === ".." || isAbsolute2(rel) || rel.startsWith(`..${sep7}`) || rel.split(sep7).some((segment) => segment === ".." || segment === "")) {
17094
17094
  throw new Error("kimi attestation authority path escapes its base");
17095
17095
  }
17096
17096
  return dir;
@@ -17429,8 +17429,8 @@ function codebuddyAuthorityDir(context, planDigest, plugin) {
17429
17429
  const base = resolve5(context.root, ".release-skill", "codebuddy-attestations");
17430
17430
  const dir = resolve5(base, plugin);
17431
17431
  const rel = relative3(base, dir);
17432
- const sep6 = process.platform === "win32" ? "\\" : "/";
17433
- if (rel === "" || rel === ".." || isAbsolute3(rel) || rel.startsWith(`..${sep6}`) || rel.split(sep6).some((segment) => segment === ".." || segment === "")) {
17432
+ const sep7 = process.platform === "win32" ? "\\" : "/";
17433
+ if (rel === "" || rel === ".." || isAbsolute3(rel) || rel.startsWith(`..${sep7}`) || rel.split(sep7).some((segment) => segment === ".." || segment === "")) {
17434
17434
  throw new Error("codebuddy attestation authority path escapes its base");
17435
17435
  }
17436
17436
  return dir;
@@ -17786,8 +17786,8 @@ function codexAuthorityDir(context, planDigest, plugin) {
17786
17786
  const base = resolve6(context.root, ".release-skill", "codex-attestations");
17787
17787
  const dir = resolve6(base, plugin);
17788
17788
  const rel = relative4(base, dir);
17789
- const sep6 = process.platform === "win32" ? "\\" : "/";
17790
- if (rel === "" || rel === ".." || isAbsolute4(rel) || rel.startsWith(`..${sep6}`) || rel.split(sep6).some((segment) => segment === ".." || segment === "")) {
17789
+ const sep7 = process.platform === "win32" ? "\\" : "/";
17790
+ if (rel === "" || rel === ".." || isAbsolute4(rel) || rel.startsWith(`..${sep7}`) || rel.split(sep7).some((segment) => segment === ".." || segment === "")) {
17791
17791
  throw new Error("codex attestation authority path escapes its base");
17792
17792
  }
17793
17793
  return dir;
@@ -21523,11 +21523,437 @@ var init_public_path = __esm({
21523
21523
  }
21524
21524
  });
21525
21525
 
21526
+ // src/core/public-surface.mjs
21527
+ import { lstat as lstat6, readdir as readdir4, realpath as realpath6 } from "node:fs/promises";
21528
+ import {
21529
+ isAbsolute as isAbsolute8,
21530
+ join as join9,
21531
+ relative as relative8,
21532
+ resolve as resolve11,
21533
+ sep as sep3
21534
+ } from "node:path";
21535
+ function compareStrings(left, right) {
21536
+ return left < right ? -1 : left > right ? 1 : 0;
21537
+ }
21538
+ function collectExpectedPublicSurfaceAdoptionWarnings(config) {
21539
+ return Object.freeze(
21540
+ (config?.releaseUnits ?? []).filter((unit) => !unit?.expectedPublicSurface).map((unit) => Object.freeze({
21541
+ code: PUBLIC_SURFACE_CONFIG_MISSING,
21542
+ unitId: unit.id,
21543
+ message: `\u53D1\u5E03\u5355\u5143 "${unit.id}" \u672A\u914D\u7F6E expectedPublicSurface\uFF1B\u65B0\u589E\u6216\u6F0F\u914D\u6587\u4EF6\u4E0D\u4F1A\u88AB\u5206\u7C7B\u95E8\u7981\u53D1\u73B0\u3002\u8BF7\u5BA1\u9605\u9879\u76EE\u53D1\u5E03\u8FB9\u754C\u540E\uFF0C\u5728 .release-skill/project.yaml \u4E2D\u914D\u7F6E expectedPublicSurface.scanRoots\u3002`
21544
+ }))
21545
+ );
21546
+ }
21547
+ function toPosixPath(path3) {
21548
+ return path3.split(sep3).join("/");
21549
+ }
21550
+ function isContainedOrEqual(root, candidate) {
21551
+ const rel = relative8(root, candidate);
21552
+ return rel === "" || rel !== ".." && !rel.startsWith(`..${sep3}`) && !isAbsolute8(rel);
21553
+ }
21554
+ function isWorkspaceControlPath(workspaceRoot, candidate) {
21555
+ return ROOT_CONTROL_DIRECTORIES.some((name) => isContainedOrEqual(join9(workspaceRoot, name), candidate));
21556
+ }
21557
+ function failConfig(message, details) {
21558
+ throw new ReleaseError(CONFIG_INVALID, message, details);
21559
+ }
21560
+ function validatePublicSurfaceGlob(glob) {
21561
+ if (typeof glob !== "string" || glob.length === 0) {
21562
+ failConfig("public surface glob must be a non-empty string", {
21563
+ reason: "PUBLIC_SURFACE_GLOB_INVALID",
21564
+ glob
21565
+ });
21566
+ }
21567
+ if (glob.startsWith("/") || glob.startsWith("./") || glob.includes("\\") || glob.includes("\0") || glob.includes(":") || glob.endsWith("/") || UNSUPPORTED_GLOB_CHARACTERS.test(glob)) {
21568
+ failConfig(`unsupported or unsafe public surface glob "${glob}"`, {
21569
+ reason: "PUBLIC_SURFACE_GLOB_INVALID",
21570
+ glob
21571
+ });
21572
+ }
21573
+ const segments = glob.split("/");
21574
+ if (segments.some((segment) => segment === "" || segment === "." || segment === ".." || segment.includes("**") && segment !== "**")) {
21575
+ failConfig(`unsupported or unsafe public surface glob "${glob}"`, {
21576
+ reason: "PUBLIC_SURFACE_GLOB_INVALID",
21577
+ glob
21578
+ });
21579
+ }
21580
+ return glob;
21581
+ }
21582
+ function compileGlob(glob) {
21583
+ validatePublicSurfaceGlob(glob);
21584
+ let source = "";
21585
+ for (let index = 0; index < glob.length; ) {
21586
+ if (glob.startsWith("**/", index)) {
21587
+ source += "(?:.*/)?";
21588
+ index += 3;
21589
+ continue;
21590
+ }
21591
+ if (glob.startsWith("**", index)) {
21592
+ source += ".*";
21593
+ index += 2;
21594
+ continue;
21595
+ }
21596
+ const character = glob[index];
21597
+ if (character === "*") {
21598
+ source += "[^/]*";
21599
+ } else if (character === "?") {
21600
+ source += "[^/]";
21601
+ } else {
21602
+ source += character.replace(/[.+^$|\\]/gu, "\\$&");
21603
+ }
21604
+ index += 1;
21605
+ }
21606
+ return new RegExp(`^${source}$`, "u");
21607
+ }
21608
+ function compilePatterns(patterns) {
21609
+ return (patterns ?? []).map((pattern) => ({
21610
+ pattern,
21611
+ regexp: compileGlob(pattern)
21612
+ }));
21613
+ }
21614
+ function matchingPatterns(matchers, path3) {
21615
+ return matchers.filter(({ regexp }) => regexp.test(path3)).map(({ pattern }) => pattern).sort(compareStrings);
21616
+ }
21617
+ async function assertSafeDirectoryPath({
21618
+ workspaceRoot,
21619
+ containmentRoot,
21620
+ candidate,
21621
+ unitId,
21622
+ configuredRoot
21623
+ }) {
21624
+ if (!isContainedOrEqual(containmentRoot, candidate)) {
21625
+ failConfig(`public surface scan root escapes its ${containmentRoot === workspaceRoot ? "workspace" : "unit"} scope`, {
21626
+ reason: "PUBLIC_SURFACE_SCAN_ROOT_UNSAFE",
21627
+ unitId,
21628
+ root: configuredRoot
21629
+ });
21630
+ }
21631
+ const rel = relative8(workspaceRoot, candidate);
21632
+ if (!isContainedOrEqual(workspaceRoot, candidate)) {
21633
+ failConfig("public surface scan root escapes the workspace", {
21634
+ reason: "PUBLIC_SURFACE_SCAN_ROOT_UNSAFE",
21635
+ unitId,
21636
+ root: configuredRoot
21637
+ });
21638
+ }
21639
+ let cursor = workspaceRoot;
21640
+ for (const segment of rel.split(sep3).filter(Boolean)) {
21641
+ cursor = join9(cursor, segment);
21642
+ let stat9;
21643
+ try {
21644
+ stat9 = await lstat6(cursor);
21645
+ } catch (error) {
21646
+ failConfig(`cannot inspect public surface scan root "${configuredRoot}"`, {
21647
+ reason: "PUBLIC_SURFACE_SCAN_ROOT_UNSAFE",
21648
+ unitId,
21649
+ root: configuredRoot,
21650
+ cause: error.code ?? "UNKNOWN"
21651
+ });
21652
+ }
21653
+ if (stat9.isSymbolicLink() || !stat9.isDirectory()) {
21654
+ failConfig(`public surface scan root or ancestor is not a physical directory: "${configuredRoot}"`, {
21655
+ reason: "PUBLIC_SURFACE_SCAN_ROOT_UNSAFE",
21656
+ unitId,
21657
+ root: configuredRoot
21658
+ });
21659
+ }
21660
+ }
21661
+ let physicalCandidate;
21662
+ let physicalContainmentRoot;
21663
+ try {
21664
+ [physicalCandidate, physicalContainmentRoot] = await Promise.all([
21665
+ realpath6(candidate),
21666
+ realpath6(containmentRoot)
21667
+ ]);
21668
+ } catch (error) {
21669
+ failConfig(`cannot resolve public surface scan root "${configuredRoot}"`, {
21670
+ reason: "PUBLIC_SURFACE_SCAN_ROOT_UNSAFE",
21671
+ unitId,
21672
+ root: configuredRoot,
21673
+ cause: error.code ?? "UNKNOWN"
21674
+ });
21675
+ }
21676
+ if (!isContainedOrEqual(workspaceRoot, physicalCandidate) || !isContainedOrEqual(physicalContainmentRoot, physicalCandidate)) {
21677
+ failConfig(`public surface scan root escapes physical containment: "${configuredRoot}"`, {
21678
+ reason: "PUBLIC_SURFACE_SCAN_ROOT_UNSAFE",
21679
+ unitId,
21680
+ root: configuredRoot
21681
+ });
21682
+ }
21683
+ return physicalCandidate;
21684
+ }
21685
+ async function resolveScanRoots({ root, unit }) {
21686
+ let workspaceRoot;
21687
+ try {
21688
+ workspaceRoot = await realpath6(resolve11(root));
21689
+ } catch (error) {
21690
+ failConfig("cannot resolve public surface workspace root", {
21691
+ reason: "PUBLIC_SURFACE_SCAN_ROOT_UNSAFE",
21692
+ unitId: unit.id,
21693
+ cause: error.code ?? "UNKNOWN"
21694
+ });
21695
+ }
21696
+ const unitSource = canonicalPublicPath(unit.source, { allowDot: true }).path;
21697
+ const unitRoot = resolve11(workspaceRoot, unitSource);
21698
+ await assertSafeDirectoryPath({
21699
+ workspaceRoot,
21700
+ containmentRoot: workspaceRoot,
21701
+ candidate: unitRoot,
21702
+ unitId: unit.id,
21703
+ configuredRoot: unit.source
21704
+ });
21705
+ const resolvedRoots = [];
21706
+ for (const [index, rule] of unit.expectedPublicSurface.scanRoots.entries()) {
21707
+ const sourceScope = rule.sourceScope ?? "unit";
21708
+ const configuredRoot = rule.root ?? ".";
21709
+ const rootPath = canonicalPublicPath(configuredRoot, { allowDot: true }).path;
21710
+ const scopeRoot = sourceScope === "workspace" ? workspaceRoot : unitRoot;
21711
+ const candidate = resolve11(scopeRoot, rootPath);
21712
+ if (isWorkspaceControlPath(workspaceRoot, candidate)) {
21713
+ failConfig(`public surface scan root cannot target workspace control paths: "${configuredRoot}"`, {
21714
+ reason: "PUBLIC_SURFACE_SCAN_ROOT_CONTROL_PATH",
21715
+ unitId: unit.id,
21716
+ root: configuredRoot
21717
+ });
21718
+ }
21719
+ const physicalPath = await assertSafeDirectoryPath({
21720
+ workspaceRoot,
21721
+ containmentRoot: scopeRoot,
21722
+ candidate,
21723
+ unitId: unit.id,
21724
+ configuredRoot
21725
+ });
21726
+ resolvedRoots.push({
21727
+ index,
21728
+ sourceScope,
21729
+ configuredRoot,
21730
+ physicalPath,
21731
+ includeMatchers: compilePatterns(rule.include),
21732
+ excludeMatchers: compilePatterns(rule.exclude)
21733
+ });
21734
+ }
21735
+ for (let leftIndex = 0; leftIndex < resolvedRoots.length; leftIndex += 1) {
21736
+ for (let rightIndex = leftIndex + 1; rightIndex < resolvedRoots.length; rightIndex += 1) {
21737
+ const left = resolvedRoots[leftIndex];
21738
+ const right = resolvedRoots[rightIndex];
21739
+ if (isContainedOrEqual(left.physicalPath, right.physicalPath) || isContainedOrEqual(right.physicalPath, left.physicalPath)) {
21740
+ failConfig(`public surface scan roots overlap for unit "${unit.id}"`, {
21741
+ reason: "PUBLIC_SURFACE_SCAN_ROOT_OVERLAP",
21742
+ unitId: unit.id,
21743
+ scanRoots: [
21744
+ { index: left.index, sourceScope: left.sourceScope, root: left.configuredRoot },
21745
+ { index: right.index, sourceScope: right.sourceScope, root: right.configuredRoot }
21746
+ ]
21747
+ });
21748
+ }
21749
+ }
21750
+ }
21751
+ return { workspaceRoot, resolvedRoots };
21752
+ }
21753
+ function unsupportedEntryError({ unit, rule, workspaceRelative, relativePath, entry, includePatterns, excludePatterns }) {
21754
+ return new ReleaseError(
21755
+ GATE_FAILED,
21756
+ `public surface contains an unsupported non-regular entry "${workspaceRelative}"`,
21757
+ {
21758
+ reason: "PUBLIC_SURFACE_UNSUPPORTED_ENTRY",
21759
+ unitId: unit.id,
21760
+ sourceScope: rule.sourceScope,
21761
+ from: workspaceRelative,
21762
+ scanRoot: rule.configuredRoot,
21763
+ relativePath,
21764
+ entryType: entry.isSymbolicLink() ? "symlink" : "special",
21765
+ includePatterns,
21766
+ excludePatterns
21767
+ }
21768
+ );
21769
+ }
21770
+ async function scanRoot({ workspaceRoot, unit, rule }) {
21771
+ const files = [];
21772
+ let skippedNonRegularCount = 0;
21773
+ const skippedControlPaths = new Set(
21774
+ ROOT_CONTROL_DIRECTORIES.map((name) => join9(workspaceRoot, name))
21775
+ );
21776
+ async function walk(directory, relativeDirectory) {
21777
+ let entries;
21778
+ try {
21779
+ entries = await readdir4(directory, { withFileTypes: true });
21780
+ } catch (error) {
21781
+ failConfig(`cannot read public surface scan root for unit "${unit.id}"`, {
21782
+ reason: "PUBLIC_SURFACE_SCAN_ROOT_UNSAFE",
21783
+ unitId: unit.id,
21784
+ root: rule.configuredRoot,
21785
+ cause: error.code ?? "UNKNOWN"
21786
+ });
21787
+ }
21788
+ entries.sort((left, right) => compareStrings(left.name, right.name));
21789
+ for (const entry of entries) {
21790
+ const absolutePath = join9(directory, entry.name);
21791
+ if (skippedControlPaths.has(absolutePath)) continue;
21792
+ if (entry.isDirectory()) {
21793
+ const childRelative = relativeDirectory ? `${relativeDirectory}/${entry.name}` : entry.name;
21794
+ await walk(absolutePath, childRelative);
21795
+ continue;
21796
+ }
21797
+ const relativePath = relativeDirectory ? `${relativeDirectory}/${entry.name}` : entry.name;
21798
+ const includePatterns = matchingPatterns(rule.includeMatchers, relativePath);
21799
+ const excludePatterns = matchingPatterns(rule.excludeMatchers, relativePath);
21800
+ const workspaceRelative = canonicalPublicPath(
21801
+ toPosixPath(relative8(workspaceRoot, absolutePath))
21802
+ ).path;
21803
+ if (!entry.isFile()) {
21804
+ if (includePatterns.length === 0 && excludePatterns.length > 0) {
21805
+ skippedNonRegularCount += 1;
21806
+ continue;
21807
+ }
21808
+ throw unsupportedEntryError({
21809
+ unit,
21810
+ rule,
21811
+ workspaceRelative,
21812
+ relativePath,
21813
+ entry,
21814
+ includePatterns,
21815
+ excludePatterns
21816
+ });
21817
+ }
21818
+ files.push({
21819
+ identity: `${rule.sourceScope}\0${workspaceRelative}`,
21820
+ sourceScope: rule.sourceScope,
21821
+ from: workspaceRelative,
21822
+ scanRoot: rule.configuredRoot,
21823
+ relativePath,
21824
+ includePatterns,
21825
+ excludePatterns
21826
+ });
21827
+ }
21828
+ }
21829
+ __name(walk, "walk");
21830
+ await walk(rule.physicalPath, "");
21831
+ return { files, skippedNonRegularCount };
21832
+ }
21833
+ function publicSourceIdentity(sourceScope, from) {
21834
+ return `${sourceScope}\0${from}`;
21835
+ }
21836
+ function sortBySource(left, right) {
21837
+ return compareStrings(left.sourceScope, right.sourceScope) || compareStrings(left.from, right.from);
21838
+ }
21839
+ async function inspectExpectedPublicSurface({ root, unit } = {}) {
21840
+ if (!unit?.expectedPublicSurface) {
21841
+ return Object.freeze({ enabled: false, passed: true, unitId: unit?.id ?? null });
21842
+ }
21843
+ const { workspaceRoot, resolvedRoots } = await resolveScanRoots({ root, unit });
21844
+ const observedFiles = [];
21845
+ let skippedNonRegularCount = 0;
21846
+ for (const rule of resolvedRoots) {
21847
+ const observed = await scanRoot({ workspaceRoot, unit, rule });
21848
+ observedFiles.push(...observed.files);
21849
+ skippedNonRegularCount += observed.skippedNonRegularCount;
21850
+ }
21851
+ const includedByIdentity = /* @__PURE__ */ new Map();
21852
+ const unclassifiedFiles = [];
21853
+ const ambiguousFiles = [];
21854
+ let excludedFileCount = 0;
21855
+ for (const file of observedFiles) {
21856
+ const included = file.includePatterns.length > 0;
21857
+ const excluded = file.excludePatterns.length > 0;
21858
+ if (included) includedByIdentity.set(file.identity, file);
21859
+ if (!included && !excluded) {
21860
+ unclassifiedFiles.push(file);
21861
+ } else if (included && excluded) {
21862
+ ambiguousFiles.push(file);
21863
+ } else if (excluded) {
21864
+ excludedFileCount += 1;
21865
+ }
21866
+ }
21867
+ const mappingsByIdentity = /* @__PURE__ */ new Map();
21868
+ for (const mapping of unit.publicFiles ?? []) {
21869
+ const sourceScope = mapping.sourceScope ?? "unit";
21870
+ const from = canonicalPublicPath(mapping.from).path;
21871
+ const identity = publicSourceIdentity(sourceScope, from);
21872
+ const current = mappingsByIdentity.get(identity) ?? {
21873
+ sourceScope,
21874
+ from,
21875
+ targets: []
21876
+ };
21877
+ current.targets.push(canonicalPublicPath(mapping.to).path);
21878
+ current.targets.sort(compareStrings);
21879
+ mappingsByIdentity.set(identity, current);
21880
+ }
21881
+ const missingMappings = [...includedByIdentity.entries()].filter(([identity]) => !mappingsByIdentity.has(identity)).map(([, file]) => ({
21882
+ sourceScope: file.sourceScope,
21883
+ from: file.from
21884
+ })).sort(sortBySource);
21885
+ const unexpectedMappings = [...mappingsByIdentity.entries()].filter(([identity]) => !includedByIdentity.has(identity)).map(([, mapping]) => mapping).sort(sortBySource);
21886
+ unclassifiedFiles.sort(sortBySource);
21887
+ ambiguousFiles.sort(sortBySource);
21888
+ const passed = missingMappings.length === 0 && unexpectedMappings.length === 0 && unclassifiedFiles.length === 0 && ambiguousFiles.length === 0;
21889
+ return {
21890
+ enabled: true,
21891
+ passed,
21892
+ unitId: unit.id,
21893
+ summary: {
21894
+ scannedFileCount: observedFiles.length,
21895
+ includedFileCount: includedByIdentity.size,
21896
+ excludedFileCount,
21897
+ mappedSourceCount: mappingsByIdentity.size,
21898
+ skippedNonRegularCount
21899
+ },
21900
+ missingMappings,
21901
+ unexpectedMappings,
21902
+ unclassifiedFiles,
21903
+ ambiguousFiles
21904
+ };
21905
+ }
21906
+ async function assertExpectedPublicSurface(options) {
21907
+ const result = await inspectExpectedPublicSurface(options);
21908
+ if (!result.enabled || result.passed) return result;
21909
+ throw new ReleaseError(
21910
+ GATE_FAILED,
21911
+ `expected public surface mismatch for unit "${result.unitId}"`,
21912
+ {
21913
+ reason: "PUBLIC_SURFACE_MISMATCH",
21914
+ unitId: result.unitId,
21915
+ summary: result.summary,
21916
+ missingMappings: result.missingMappings,
21917
+ unexpectedMappings: result.unexpectedMappings,
21918
+ unclassifiedFiles: result.unclassifiedFiles,
21919
+ ambiguousFiles: result.ambiguousFiles
21920
+ }
21921
+ );
21922
+ }
21923
+ var ROOT_CONTROL_DIRECTORIES, UNSUPPORTED_GLOB_CHARACTERS, PUBLIC_SURFACE_CONFIG_MISSING;
21924
+ var init_public_surface = __esm({
21925
+ "src/core/public-surface.mjs"() {
21926
+ init_errors();
21927
+ init_public_path();
21928
+ ROOT_CONTROL_DIRECTORIES = Object.freeze([".git", ".release-skill"]);
21929
+ UNSUPPORTED_GLOB_CHARACTERS = /[!()[\]{}]/u;
21930
+ PUBLIC_SURFACE_CONFIG_MISSING = "PUBLIC_SURFACE_CONFIG_MISSING";
21931
+ __name(compareStrings, "compareStrings");
21932
+ __name(collectExpectedPublicSurfaceAdoptionWarnings, "collectExpectedPublicSurfaceAdoptionWarnings");
21933
+ __name(toPosixPath, "toPosixPath");
21934
+ __name(isContainedOrEqual, "isContainedOrEqual");
21935
+ __name(isWorkspaceControlPath, "isWorkspaceControlPath");
21936
+ __name(failConfig, "failConfig");
21937
+ __name(validatePublicSurfaceGlob, "validatePublicSurfaceGlob");
21938
+ __name(compileGlob, "compileGlob");
21939
+ __name(compilePatterns, "compilePatterns");
21940
+ __name(matchingPatterns, "matchingPatterns");
21941
+ __name(assertSafeDirectoryPath, "assertSafeDirectoryPath");
21942
+ __name(resolveScanRoots, "resolveScanRoots");
21943
+ __name(unsupportedEntryError, "unsupportedEntryError");
21944
+ __name(scanRoot, "scanRoot");
21945
+ __name(publicSourceIdentity, "publicSourceIdentity");
21946
+ __name(sortBySource, "sortBySource");
21947
+ __name(inspectExpectedPublicSurface, "inspectExpectedPublicSurface");
21948
+ __name(assertExpectedPublicSurface, "assertExpectedPublicSurface");
21949
+ }
21950
+ });
21951
+
21526
21952
  // src/core/baseline.mjs
21527
21953
  import { execFile as execFileCb3 } from "node:child_process";
21528
21954
  import { promisify as promisify3 } from "node:util";
21529
21955
  import { createHash as createHash5 } from "node:crypto";
21530
- import { lstat as lstat6, open as open4, readlink } from "node:fs/promises";
21956
+ import { lstat as lstat7, open as open4, readlink } from "node:fs/promises";
21531
21957
  import { constants as fsConstants2 } from "node:fs";
21532
21958
  import path from "node:path";
21533
21959
  function isControlPlanePath(p) {
@@ -21606,7 +22032,7 @@ async function computeWorkspaceDigest(root) {
21606
22032
  `Refusing to read path outside repository root: ${relPath} resolves to ${absPath}`
21607
22033
  );
21608
22034
  }
21609
- const stat9 = await lstat6(absPath);
22035
+ const stat9 = await lstat7(absPath);
21610
22036
  let type;
21611
22037
  if (stat9.isSymbolicLink()) {
21612
22038
  type = "symlink";
@@ -21730,7 +22156,7 @@ var init_baseline = __esm({
21730
22156
 
21731
22157
  // src/core/config.mjs
21732
22158
  import { readFile as readFile8 } from "node:fs/promises";
21733
- import { resolve as resolve11, isAbsolute as isAbsolute8, relative as relative8, normalize as normalize2 } from "node:path";
22159
+ import { resolve as resolve12, isAbsolute as isAbsolute9, relative as relative9, normalize as normalize2 } from "node:path";
21734
22160
  function containsAlias(node) {
21735
22161
  if (!node || typeof node !== "object") {
21736
22162
  return false;
@@ -21755,9 +22181,9 @@ function containsAlias(node) {
21755
22181
  }
21756
22182
  function resolveConfigPath(root, configPath) {
21757
22183
  const rootNorm = normalize2(root);
21758
- const resolved = isAbsolute8(configPath) ? normalize2(configPath) : resolve11(rootNorm, configPath);
21759
- const rel = relative8(rootNorm, resolved);
21760
- if (rel.startsWith("..") || rel === ".." || isAbsolute8(rel)) {
22184
+ const resolved = isAbsolute9(configPath) ? normalize2(configPath) : resolve12(rootNorm, configPath);
22185
+ const rel = relative9(rootNorm, resolved);
22186
+ if (rel.startsWith("..") || rel === ".." || isAbsolute9(rel)) {
21761
22187
  throw new ReleaseError(
21762
22188
  CONFIG_INVALID,
21763
22189
  `config path "${configPath}" resolves outside project root "${root}"`,
@@ -21848,6 +22274,49 @@ async function loadProjectConfig({ root, configPath } = {}) {
21848
22274
  { unitId: unit.id, source: unit.source, field: "source" }
21849
22275
  );
21850
22276
  }
22277
+ const surface = unit.expectedPublicSurface;
22278
+ if (surface && typeof surface === "object" && Array.isArray(surface.scanRoots)) {
22279
+ for (const [rootIndex, scanRoot2] of surface.scanRoots.entries()) {
22280
+ if (!scanRoot2 || typeof scanRoot2 !== "object") continue;
22281
+ if (typeof scanRoot2.root === "string") {
22282
+ try {
22283
+ canonicalPublicPath(scanRoot2.root, { allowDot: true });
22284
+ } catch (err) {
22285
+ throw new ReleaseError(
22286
+ CONFIG_INVALID,
22287
+ `unit "${unit.id}" has invalid expectedPublicSurface scan root: ${err.message}`,
22288
+ {
22289
+ unitId: unit.id,
22290
+ rootIndex,
22291
+ root: scanRoot2.root,
22292
+ field: "expectedPublicSurface.scanRoots[].root"
22293
+ }
22294
+ );
22295
+ }
22296
+ }
22297
+ for (const field of ["include", "exclude"]) {
22298
+ if (!Array.isArray(scanRoot2[field])) continue;
22299
+ for (const pattern of scanRoot2[field]) {
22300
+ if (typeof pattern !== "string") continue;
22301
+ try {
22302
+ validatePublicSurfaceGlob(pattern);
22303
+ } catch (err) {
22304
+ throw new ReleaseError(
22305
+ CONFIG_INVALID,
22306
+ `unit "${unit.id}" has invalid expectedPublicSurface ${field} glob: ${err.message}`,
22307
+ {
22308
+ unitId: unit.id,
22309
+ rootIndex,
22310
+ pattern,
22311
+ field: `expectedPublicSurface.scanRoots[].${field}`,
22312
+ reason: err.details?.reason ?? "PUBLIC_SURFACE_GLOB_INVALID"
22313
+ }
22314
+ );
22315
+ }
22316
+ }
22317
+ }
22318
+ }
22319
+ }
21851
22320
  if (Array.isArray(unit.publicFiles)) {
21852
22321
  for (const mapping of unit.publicFiles) {
21853
22322
  if (typeof mapping === "object" && mapping !== null) {
@@ -22020,6 +22489,7 @@ var init_config = __esm({
22020
22489
  import_ajv_formats3 = __toESM(require_dist2(), 1);
22021
22490
  init_digest();
22022
22491
  init_errors();
22492
+ init_public_surface();
22023
22493
  init_public_path();
22024
22494
  init_baseline();
22025
22495
  init_trusted_resource();
@@ -22055,7 +22525,7 @@ __export(assess_exports, {
22055
22525
  assessProject: () => assessProject
22056
22526
  });
22057
22527
  import { readFile as readFile9, stat as stat2, writeFile as writeFile4, mkdir as mkdir4 } from "node:fs/promises";
22058
- import { resolve as resolve12, dirname as dirname5, relative as relative9 } from "node:path";
22528
+ import { resolve as resolve13, dirname as dirname5, relative as relative10 } from "node:path";
22059
22529
  import { execFile as execFileCb4 } from "node:child_process";
22060
22530
  import { promisify as promisify4 } from "node:util";
22061
22531
  async function fileExists(filePath) {
@@ -22156,9 +22626,9 @@ async function checkCommonDocs(root, config) {
22156
22626
  { file: "LICENSE", code: "LICENSE_MISSING", message: "\u7F3A\u5C11 LICENSE \u6587\u4EF6" }
22157
22627
  ];
22158
22628
  for (const unit of units) {
22159
- const unitRoot = resolve12(root, unit.source);
22629
+ const unitRoot = resolve13(root, unit.source);
22160
22630
  for (const doc of requiredDocs) {
22161
- const exists = await fileExists(resolve12(unitRoot, doc.file));
22631
+ const exists = await fileExists(resolve13(unitRoot, doc.file));
22162
22632
  if (!exists) {
22163
22633
  gaps.push(
22164
22634
  createGap({
@@ -22179,9 +22649,9 @@ async function checkCommonDocs(root, config) {
22179
22649
  { file: "CONTRIBUTING.md", code: "CONTRIBUTING_MISSING", message: "\u5EFA\u8BAE\u6DFB\u52A0 CONTRIBUTING.md" }
22180
22650
  ];
22181
22651
  for (const unit of units) {
22182
- const unitRoot = resolve12(root, unit.source);
22652
+ const unitRoot = resolve13(root, unit.source);
22183
22653
  for (const doc of recommendedDocs) {
22184
- const exists = await fileExists(resolve12(unitRoot, doc.file));
22654
+ const exists = await fileExists(resolve13(unitRoot, doc.file));
22185
22655
  if (!exists) {
22186
22656
  gaps.push(
22187
22657
  createGap({
@@ -22203,9 +22673,9 @@ async function checkPluginManifests(root, config) {
22203
22673
  const units = config.releaseUnits ?? [];
22204
22674
  for (const unit of units) {
22205
22675
  const distributionTypes = new Set((unit.distributions ?? []).map((dist) => dist.type));
22206
- const unitRoot = resolve12(root, unit.source);
22676
+ const unitRoot = resolve13(root, unit.source);
22207
22677
  if (distributionTypes.has("claude-plugin")) {
22208
- const manifestPath = resolve12(unitRoot, ".claude-plugin", "plugin.json");
22678
+ const manifestPath = resolve13(unitRoot, ".claude-plugin", "plugin.json");
22209
22679
  const displayPath = unitFile(unit, ".claude-plugin/plugin.json");
22210
22680
  const exists = await fileExists(manifestPath);
22211
22681
  if (!exists) {
@@ -22252,7 +22722,7 @@ async function checkPluginManifests(root, config) {
22252
22722
  }
22253
22723
  }
22254
22724
  if (distributionTypes.has("codex-plugin")) {
22255
- const manifestPath = resolve12(unitRoot, ".codex-plugin", "plugin.json");
22725
+ const manifestPath = resolve13(unitRoot, ".codex-plugin", "plugin.json");
22256
22726
  const displayPath = unitFile(unit, ".codex-plugin/plugin.json");
22257
22727
  const exists = await fileExists(manifestPath);
22258
22728
  if (!exists) {
@@ -22299,7 +22769,7 @@ async function checkPluginManifests(root, config) {
22299
22769
  }
22300
22770
  }
22301
22771
  if (distributionTypes.has("kimi-plugin")) {
22302
- const manifestPath = resolve12(unitRoot, ".kimi-plugin", "plugin.json");
22772
+ const manifestPath = resolve13(unitRoot, ".kimi-plugin", "plugin.json");
22303
22773
  const displayPath = unitFile(unit, ".kimi-plugin/plugin.json");
22304
22774
  const exists = await fileExists(manifestPath);
22305
22775
  if (!exists) {
@@ -22346,7 +22816,7 @@ async function checkPluginManifests(root, config) {
22346
22816
  }
22347
22817
  }
22348
22818
  if (distributionTypes.has("codebuddy-plugin")) {
22349
- const manifestPath = resolve12(unitRoot, ".codebuddy-plugin", "plugin.json");
22819
+ const manifestPath = resolve13(unitRoot, ".codebuddy-plugin", "plugin.json");
22350
22820
  const displayPath = unitFile(unit, ".codebuddy-plugin/plugin.json");
22351
22821
  const exists = await fileExists(manifestPath);
22352
22822
  if (!exists) {
@@ -22412,8 +22882,8 @@ async function checkPackageMetadata(root, config) {
22412
22882
  for (const unit of units) {
22413
22883
  const hasNpmDist = (unit.distributions ?? []).some((d) => d.type === "npm");
22414
22884
  if (!hasNpmDist) continue;
22415
- const unitRoot = resolve12(root, unit.source);
22416
- const pkgPath = resolve12(unitRoot, "package.json");
22885
+ const unitRoot = resolve13(root, unit.source);
22886
+ const pkgPath = resolve13(unitRoot, "package.json");
22417
22887
  const exists = await fileExists(pkgPath);
22418
22888
  if (!exists) {
22419
22889
  gaps.push(
@@ -22496,7 +22966,7 @@ async function checkRemotePrerequisites(root, config, offline) {
22496
22966
  for (const unit of units) {
22497
22967
  const npmDist = (unit.distributions ?? []).find((d) => d.type === "npm");
22498
22968
  if (!npmDist?.package) continue;
22499
- const pkgPath = resolve12(root, unit.source, "package.json");
22969
+ const pkgPath = resolve13(root, unit.source, "package.json");
22500
22970
  let version;
22501
22971
  try {
22502
22972
  const content = await readFile9(pkgPath, "utf8");
@@ -22530,7 +23000,7 @@ async function checkReadmeStructure(root, config) {
22530
23000
  const gaps = [];
22531
23001
  const units = config.releaseUnits ?? [];
22532
23002
  for (const unit of units) {
22533
- const readmePath = resolve12(root, unit.source, "README.md");
23003
+ const readmePath = resolve13(root, unit.source, "README.md");
22534
23004
  const displayPath = unitFile(unit, "README.md");
22535
23005
  const exists = await fileExists(readmePath);
22536
23006
  if (!exists) continue;
@@ -22679,6 +23149,16 @@ async function assessProject(options) {
22679
23149
  }
22680
23150
  const config = configResult.config;
22681
23151
  const topology = identifyTopology(config);
23152
+ for (const warning of collectExpectedPublicSurfaceAdoptionWarnings(config)) {
23153
+ allGaps.push(createGap({
23154
+ scope: GapScope.PROJECT,
23155
+ category: GapCategory.POLICY,
23156
+ severity: Severity.WARNING,
23157
+ code: warning.code,
23158
+ message: warning.message,
23159
+ file: ".release-skill/project.yaml"
23160
+ }));
23161
+ }
22682
23162
  const docGaps = await checkCommonDocs(root, config);
22683
23163
  allGaps.push(...docGaps);
22684
23164
  const manifestGaps = await checkPluginManifests(root, config);
@@ -22715,6 +23195,7 @@ var init_assess = __esm({
22715
23195
  async "src/commands/assess.mjs"() {
22716
23196
  await init_config();
22717
23197
  init_errors();
23198
+ init_public_surface();
22718
23199
  execFile4 = promisify4(execFileCb4);
22719
23200
  Severity = Object.freeze({
22720
23201
  ERROR: "error",
@@ -22753,8 +23234,8 @@ var init_assess = __esm({
22753
23234
  // src/core/hooks.mjs
22754
23235
  import { execFile as execFileCb5 } from "node:child_process";
22755
23236
  import { promisify as promisify5 } from "node:util";
22756
- import { resolve as resolve13, relative as relative10, isAbsolute as isAbsolute9 } from "node:path";
22757
- import { realpath as realpath6 } from "node:fs/promises";
23237
+ import { resolve as resolve14, relative as relative11, isAbsolute as isAbsolute10 } from "node:path";
23238
+ import { realpath as realpath7 } from "node:fs/promises";
22758
23239
  function validateHook(hook) {
22759
23240
  if (!hook || typeof hook !== "object" || Array.isArray(hook)) {
22760
23241
  throw new ReleaseError("INVALID_HOOK", "hook must be a non-null object");
@@ -22837,13 +23318,13 @@ async function runHook(hook, context) {
22837
23318
  if (!context || typeof context !== "object" || Array.isArray(context)) {
22838
23319
  throw new ReleaseError("INVALID_HOOK", "context must be a non-null object");
22839
23320
  }
22840
- if (typeof context.root !== "string" || !isAbsolute9(context.root)) {
23321
+ if (typeof context.root !== "string" || !isAbsolute10(context.root)) {
22841
23322
  throw new ReleaseError("INVALID_HOOK", "context.root must be an absolute path");
22842
23323
  }
22843
23324
  const { command: command2, cwd, timeoutMs, envAllowlist = [] } = hook;
22844
- const rootReal = await realpath6(context.root);
22845
- const resolvedCwd = cwd ? await realpath6(resolve13(rootReal, cwd)) : rootReal;
22846
- const rel = relative10(rootReal, resolvedCwd);
23325
+ const rootReal = await realpath7(context.root);
23326
+ const resolvedCwd = cwd ? await realpath7(resolve14(rootReal, cwd)) : rootReal;
23327
+ const rel = relative11(rootReal, resolvedCwd);
22847
23328
  if (rel.startsWith("..") || rel === "..") {
22848
23329
  throw new ReleaseError(
22849
23330
  "INVALID_HOOK",
@@ -22909,8 +23390,8 @@ var init_hooks = __esm({
22909
23390
  });
22910
23391
 
22911
23392
  // src/core/hook-cache.mjs
22912
- import { readdir as readdir4, readFile as readFile10, mkdir as mkdir5, writeFile as writeFile5 } from "node:fs/promises";
22913
- import { join as join9 } from "node:path";
23393
+ import { readdir as readdir5, readFile as readFile10, mkdir as mkdir5, writeFile as writeFile5 } from "node:fs/promises";
23394
+ import { join as join10 } from "node:path";
22914
23395
  function globToRegExp(glob) {
22915
23396
  let source = "";
22916
23397
  let i = 0;
@@ -22939,7 +23420,7 @@ async function listInputFiles(root) {
22939
23420
  async function walk(dirAbs, dirRel) {
22940
23421
  let entries;
22941
23422
  try {
22942
- entries = await readdir4(dirAbs, { withFileTypes: true });
23423
+ entries = await readdir5(dirAbs, { withFileTypes: true });
22943
23424
  } catch {
22944
23425
  return;
22945
23426
  }
@@ -22947,7 +23428,7 @@ async function listInputFiles(root) {
22947
23428
  if (entry.isDirectory()) {
22948
23429
  if (SKIPPED_DIRS.has(entry.name)) continue;
22949
23430
  const rel = dirRel ? `${dirRel}/${entry.name}` : entry.name;
22950
- await walk(join9(dirAbs, entry.name), rel);
23431
+ await walk(join10(dirAbs, entry.name), rel);
22951
23432
  } else if (entry.isFile()) {
22952
23433
  out.push(dirRel ? `${dirRel}/${entry.name}` : entry.name);
22953
23434
  }
@@ -22986,17 +23467,17 @@ async function computeHookCacheKey(hook, root) {
22986
23467
  matched.sort();
22987
23468
  const fileEntries = [];
22988
23469
  for (const relPath of matched) {
22989
- const content = await readFile10(join9(root, relPath));
23470
+ const content = await readFile10(join10(root, relPath));
22990
23471
  fileEntries.push({ path: relPath, sha256: sha256Hex(content) });
22991
23472
  }
22992
23473
  const cacheKey = sha256Hex(canonicalJson(hook) + canonicalJson(fileEntries));
22993
23474
  return { cacheKey, matchedFiles: matched };
22994
23475
  }
22995
23476
  function hookCacheDir(root, hookName) {
22996
- return join9(root, ...CACHE_BASE, hookName);
23477
+ return join10(root, ...CACHE_BASE, hookName);
22997
23478
  }
22998
23479
  function hookCachePath(root, hookName, cacheKey) {
22999
- return join9(hookCacheDir(root, hookName), `${cacheKey}.json`);
23480
+ return join10(hookCacheDir(root, hookName), `${cacheKey}.json`);
23000
23481
  }
23001
23482
  async function readHookCache(root, hookName, cacheKey) {
23002
23483
  try {
@@ -23051,8 +23532,8 @@ var init_hook_cache = __esm({
23051
23532
  // src/core/verification-gates.mjs
23052
23533
  import { createHash as createHash6 } from "node:crypto";
23053
23534
  import { spawn as spawn2 } from "node:child_process";
23054
- import { chmod as chmod2, cp, lstat as lstat7, mkdir as mkdir6, readdir as readdir5, realpath as realpath7, rm as rm4 } from "node:fs/promises";
23055
- import { isAbsolute as isAbsolute10, join as join10, relative as relative11, resolve as resolve14 } from "node:path";
23535
+ import { chmod as chmod2, cp, lstat as lstat8, mkdir as mkdir6, readdir as readdir6, realpath as realpath8, rm as rm4 } from "node:fs/promises";
23536
+ import { isAbsolute as isAbsolute11, join as join11, relative as relative12, resolve as resolve15 } from "node:path";
23056
23537
  function gateError(gate, message, details = {}) {
23057
23538
  return new ReleaseError(GATE_FAILED, `verification gate "${gate?.id ?? "unknown"}" ${message}`, {
23058
23539
  gateId: gate?.id,
@@ -23060,9 +23541,9 @@ function gateError(gate, message, details = {}) {
23060
23541
  });
23061
23542
  }
23062
23543
  function isInside2(parent, candidate) {
23063
- const rel = relative11(parent, candidate);
23544
+ const rel = relative12(parent, candidate);
23064
23545
  const separator = process.platform === "win32" ? "\\" : "/";
23065
- return rel === "" || !isAbsolute10(rel) && rel !== ".." && !rel.startsWith(`..${separator}`);
23546
+ return rel === "" || !isAbsolute11(rel) && rel !== ".." && !rel.startsWith(`..${separator}`);
23066
23547
  }
23067
23548
  function matchesSubset(actual, expected) {
23068
23549
  if (expected === null || typeof expected !== "object" || Array.isArray(expected)) {
@@ -23117,25 +23598,25 @@ function filteredEnv(allowlist, suppliedEnv, fixedEnv = {}) {
23117
23598
  return result;
23118
23599
  }
23119
23600
  async function resolveSafeCwd(executionRoot, cwd, gate) {
23120
- const rootStat = await lstat7(executionRoot).catch((error) => {
23601
+ const rootStat = await lstat8(executionRoot).catch((error) => {
23121
23602
  throw gateError(gate, "execution root is missing", { cause: error.code });
23122
23603
  });
23123
23604
  if (!rootStat.isDirectory() || rootStat.isSymbolicLink()) {
23124
23605
  throw gateError(gate, "execution root must be a real directory");
23125
23606
  }
23126
- const rootReal = await realpath7(executionRoot);
23127
- const lexical = resolve14(rootReal, cwd ?? ".");
23607
+ const rootReal = await realpath8(executionRoot);
23608
+ const lexical = resolve15(rootReal, cwd ?? ".");
23128
23609
  if (!isInside2(rootReal, lexical)) throw gateError(gate, "cwd escapes the execution root");
23129
- const rel = relative11(rootReal, lexical);
23610
+ const rel = relative12(rootReal, lexical);
23130
23611
  let current = rootReal;
23131
23612
  for (const segment of rel.split(/[\\/]/).filter(Boolean)) {
23132
- current = join10(current, segment);
23133
- const stat9 = await lstat7(current).catch((error) => {
23613
+ current = join11(current, segment);
23614
+ const stat9 = await lstat8(current).catch((error) => {
23134
23615
  throw gateError(gate, "cwd does not exist", { cause: error.code });
23135
23616
  });
23136
23617
  if (stat9.isSymbolicLink()) throw gateError(gate, "cwd contains a symlink");
23137
23618
  }
23138
- const physical = await realpath7(lexical);
23619
+ const physical = await realpath8(lexical);
23139
23620
  if (!isInside2(rootReal, physical)) throw gateError(gate, "cwd resolves outside the execution root");
23140
23621
  return physical;
23141
23622
  }
@@ -23374,12 +23855,12 @@ async function runVerificationGate({
23374
23855
  return result;
23375
23856
  }
23376
23857
  async function makeTreeWritable(root) {
23377
- const stat9 = await lstat7(root);
23858
+ const stat9 = await lstat8(root);
23378
23859
  if (!stat9.isDirectory() || stat9.isSymbolicLink()) throw new Error("gate copy root must be a real directory");
23379
23860
  await chmod2(root, stat9.mode | 448);
23380
- for (const child of await readdir5(root, { withFileTypes: true })) {
23381
- const absolute = join10(root, child.name);
23382
- const childStat = await lstat7(absolute);
23861
+ for (const child of await readdir6(root, { withFileTypes: true })) {
23862
+ const absolute = join11(root, child.name);
23863
+ const childStat = await lstat8(absolute);
23383
23864
  if (childStat.isSymbolicLink()) throw new Error("gate copy must not contain symlinks");
23384
23865
  if (childStat.isDirectory()) await makeTreeWritable(absolute);
23385
23866
  else if (childStat.isFile() && childStat.nlink === 1) await chmod2(absolute, childStat.mode | 384);
@@ -23397,7 +23878,7 @@ async function runSnapshotVerificationGates({
23397
23878
  const snapshotGates = gates.filter((item) => item.phase === "snapshot-verify");
23398
23879
  if (snapshotGates.length === 0) return [];
23399
23880
  const byUnit = new Map(unitResults.map((item) => [item.unit.id, item]));
23400
- const gateRoot = join10(runDir, "snapshot-gates");
23881
+ const gateRoot = join11(runDir, "snapshot-gates");
23401
23882
  await mkdir6(gateRoot, { recursive: true });
23402
23883
  const results = [];
23403
23884
  for (const gate of snapshotGates) {
@@ -23595,32 +24076,32 @@ var init_evidence = __esm({
23595
24076
  });
23596
24077
 
23597
24078
  // src/core/skill-resource-closure.mjs
23598
- import { lstat as lstat8, readFile as readFile11, readdir as readdir6 } from "node:fs/promises";
23599
- import { dirname as dirname6, isAbsolute as isAbsolute11, join as join11, relative as relative12, resolve as resolve15, sep as sep3 } from "node:path";
24079
+ import { lstat as lstat9, readFile as readFile11, readdir as readdir7 } from "node:fs/promises";
24080
+ import { dirname as dirname6, isAbsolute as isAbsolute12, join as join12, relative as relative13, resolve as resolve16, sep as sep4 } from "node:path";
23600
24081
  function toPosix(value) {
23601
24082
  return value.replaceAll("\\", "/");
23602
24083
  }
23603
24084
  function relativeStable(root, target) {
23604
- const value = toPosix(relative12(root, target));
24085
+ const value = toPosix(relative13(root, target));
23605
24086
  return value === "" ? "." : value;
23606
24087
  }
23607
24088
  function isInside3(parent, candidate) {
23608
- const rel = relative12(parent, candidate);
23609
- return rel === "" || !isAbsolute11(rel) && rel !== ".." && !rel.startsWith(`..${sep3}`);
24089
+ const rel = relative13(parent, candidate);
24090
+ return rel === "" || !isAbsolute12(rel) && rel !== ".." && !rel.startsWith(`..${sep4}`);
23610
24091
  }
23611
24092
  async function discoverSkills(root, base = root) {
23612
24093
  const results = [];
23613
24094
  let entries;
23614
24095
  try {
23615
- entries = await readdir6(root, { withFileTypes: true });
24096
+ entries = await readdir7(root, { withFileTypes: true });
23616
24097
  } catch (error) {
23617
24098
  if (error.code === "ENOENT") return results;
23618
24099
  throw error;
23619
24100
  }
23620
24101
  for (const entry of entries) {
23621
24102
  if (entry.name === ".git" || entry.name === "node_modules") continue;
23622
- const absolute = join11(root, entry.name);
23623
- const stableRelative = toPosix(relative12(base, absolute));
24103
+ const absolute = join12(root, entry.name);
24104
+ const stableRelative = toPosix(relative13(base, absolute));
23624
24105
  if (stableRelative === ".codex-plugin/migrated-command-skills") continue;
23625
24106
  if (entry.isDirectory()) {
23626
24107
  results.push(...await discoverSkills(absolute, base));
@@ -23630,14 +24111,14 @@ async function discoverSkills(root, base = root) {
23630
24111
  }
23631
24112
  return results.sort();
23632
24113
  }
23633
- function resolvePluginRoot(skillRelativePath, scanRoot) {
24114
+ function resolvePluginRoot(skillRelativePath, scanRoot2) {
23634
24115
  const parts = toPosix(skillRelativePath).split("/");
23635
24116
  const skillsIndex = parts.lastIndexOf("skills");
23636
- if (skillsIndex < 0) return resolve15(scanRoot);
23637
- return resolve15(scanRoot, ...parts.slice(0, skillsIndex));
24117
+ if (skillsIndex < 0) return resolve16(scanRoot2);
24118
+ return resolve16(scanRoot2, ...parts.slice(0, skillsIndex));
23638
24119
  }
23639
- function resolveSkillRoot(skillRelativePath, scanRoot) {
23640
- return resolve15(scanRoot, dirname6(skillRelativePath));
24120
+ function resolveSkillRoot(skillRelativePath, scanRoot2) {
24121
+ return resolve16(scanRoot2, dirname6(skillRelativePath));
23641
24122
  }
23642
24123
  function trimCandidate(value) {
23643
24124
  return value.trim().replace(/^["']/u, "").replace(/["']$/u, "").replace(/[.,;:]+$/u, "");
@@ -23690,7 +24171,7 @@ function stripExplicitPrefix(token) {
23690
24171
  }
23691
24172
  return token;
23692
24173
  }
23693
- function classifyReference(token, skillRoot, pluginRoot, scanRoot) {
24174
+ function classifyReference(token, skillRoot, pluginRoot, scanRoot2) {
23694
24175
  if (MACHINE_ABSOLUTE_PATTERN.test(token)) {
23695
24176
  return {
23696
24177
  classification: CLASSIFICATION.MACHINE_ABSOLUTE,
@@ -23704,41 +24185,41 @@ function classifyReference(token, skillRoot, pluginRoot, scanRoot) {
23704
24185
  classification: CLASSIFICATION.SOURCE_BACKJUMP,
23705
24186
  resolutionRoot: "(source-tree)",
23706
24187
  resolvedTarget: token,
23707
- absoluteTarget: resolve15(scanRoot, token)
24188
+ absoluteTarget: resolve16(scanRoot2, token)
23708
24189
  };
23709
24190
  }
23710
24191
  const explicit = EXPLICIT_PREFIXES.some((prefix) => token.startsWith(prefix));
23711
24192
  const resolutionRootAbsolute = explicit ? pluginRoot : skillRoot;
23712
24193
  const relativeTarget = explicit ? stripExplicitPrefix(token) : token;
23713
- const absoluteTarget = resolve15(resolutionRootAbsolute, relativeTarget);
24194
+ const absoluteTarget = resolve16(resolutionRootAbsolute, relativeTarget);
23714
24195
  const inBounds = isInside3(resolutionRootAbsolute, absoluteTarget);
23715
24196
  return {
23716
24197
  classification: inBounds ? explicit ? CLASSIFICATION.PLUGIN_ROOT : CLASSIFICATION.SKILL_LOCAL : CLASSIFICATION.OUT_OF_BOUNDS,
23717
- resolutionRoot: relativeStable(scanRoot, resolutionRootAbsolute),
23718
- resolvedTarget: relativeStable(scanRoot, absoluteTarget),
24198
+ resolutionRoot: relativeStable(scanRoot2, resolutionRootAbsolute),
24199
+ resolvedTarget: relativeStable(scanRoot2, absoluteTarget),
23719
24200
  absoluteTarget
23720
24201
  };
23721
24202
  }
23722
24203
  async function inspectRegularFile(root, target) {
23723
24204
  if (!isInside3(root, target)) return { code: FINDING_CODE.OUT_OF_BOUNDS };
23724
- const parts = relative12(root, target).split(sep3).filter(Boolean);
24205
+ const parts = relative13(root, target).split(sep4).filter(Boolean);
23725
24206
  let current = root;
23726
- const rootStat = await lstat8(root);
24207
+ const rootStat = await lstat9(root);
23727
24208
  if (rootStat.isSymbolicLink() || !rootStat.isDirectory()) {
23728
24209
  return { code: FINDING_CODE.SYMLINK_NOT_ALLOWED };
23729
24210
  }
23730
24211
  for (const part of parts) {
23731
- current = join11(current, part);
24212
+ current = join12(current, part);
23732
24213
  let stat9;
23733
24214
  try {
23734
- stat9 = await lstat8(current);
24215
+ stat9 = await lstat9(current);
23735
24216
  } catch (error) {
23736
24217
  if (error.code === "ENOENT") return { code: FINDING_CODE.RESOURCE_MISSING };
23737
24218
  throw error;
23738
24219
  }
23739
24220
  if (stat9.isSymbolicLink()) return { code: FINDING_CODE.SYMLINK_NOT_ALLOWED };
23740
24221
  }
23741
- const targetStat = await lstat8(target);
24222
+ const targetStat = await lstat9(target);
23742
24223
  if (!targetStat.isFile() || targetStat.nlink !== 1) {
23743
24224
  return { code: FINDING_CODE.RESOURCE_NOT_REGULAR_FILE };
23744
24225
  }
@@ -23811,15 +24292,15 @@ async function checkSkillResourceClosure({
23811
24292
  if (typeof snapshotDir !== "string" || snapshotDir.length === 0) {
23812
24293
  throw new TypeError("snapshotDir must be a non-empty string");
23813
24294
  }
23814
- const scanRoot = resolve15(snapshotDir);
23815
- const scanStat = await lstat8(scanRoot);
24295
+ const scanRoot2 = resolve16(snapshotDir);
24296
+ const scanStat = await lstat9(scanRoot2);
23816
24297
  if (!scanStat.isDirectory() || scanStat.isSymbolicLink()) {
23817
24298
  throw new Error("snapshotDir must be a real directory");
23818
24299
  }
23819
24300
  let inputDigest;
23820
24301
  let snapshotError = null;
23821
24302
  try {
23822
- inputDigest = (await computeFrozenSnapshot(scanRoot, {
24303
+ inputDigest = (await computeFrozenSnapshot(scanRoot2, {
23823
24304
  excludeRootEntries: TRANSPORT_EXCLUSIONS
23824
24305
  })).digest;
23825
24306
  } catch (error) {
@@ -23828,15 +24309,15 @@ async function checkSkillResourceClosure({
23828
24309
  invalidTree: error.message
23829
24310
  }));
23830
24311
  }
23831
- const skillPaths = await discoverSkills(scanRoot);
24312
+ const skillPaths = await discoverSkills(scanRoot2);
23832
24313
  const findings = [];
23833
24314
  const surfaceMap = /* @__PURE__ */ new Map();
23834
24315
  let referenceCount = 0;
23835
24316
  let sourceOnlyCount = 0;
23836
24317
  for (const skill of skillPaths) {
23837
- const skillRoot = resolveSkillRoot(skill, scanRoot);
23838
- const pluginRoot = resolvePluginRoot(skill, scanRoot);
23839
- const surfaceId = relativeStable(scanRoot, pluginRoot);
24318
+ const skillRoot = resolveSkillRoot(skill, scanRoot2);
24319
+ const pluginRoot = resolvePluginRoot(skill, scanRoot2);
24320
+ const surfaceId = relativeStable(scanRoot2, pluginRoot);
23840
24321
  const surfaceHost = inferSurfaceHost(surfaceId, host);
23841
24322
  const surface = surfaceMap.get(surfaceId) ?? {
23842
24323
  id: surfaceId,
@@ -23847,7 +24328,7 @@ async function checkSkillResourceClosure({
23847
24328
  };
23848
24329
  surface.skillCount += 1;
23849
24330
  surfaceMap.set(surfaceId, surface);
23850
- const content = await readFile11(resolve15(scanRoot, skill), "utf8");
24331
+ const content = await readFile11(resolve16(scanRoot2, skill), "utf8");
23851
24332
  for (const pathToken of extractPathTokens(content)) {
23852
24333
  referenceCount += 1;
23853
24334
  surface.referenceCount += 1;
@@ -23855,7 +24336,7 @@ async function checkSkillResourceClosure({
23855
24336
  pathToken.token,
23856
24337
  skillRoot,
23857
24338
  pluginRoot,
23858
- scanRoot
24339
+ scanRoot2
23859
24340
  );
23860
24341
  const findingBase = {
23861
24342
  host: surfaceHost,
@@ -23991,9 +24472,9 @@ var init_skill_resource_closure = __esm({
23991
24472
  });
23992
24473
 
23993
24474
  // src/snapshot/public-map.mjs
23994
- import { lstat as lstat9, readFile as readFile12, mkdir as mkdir8, readdir as readdir7, realpath as realpath8, chmod as fsChmod } from "node:fs/promises";
24475
+ import { lstat as lstat10, readFile as readFile12, mkdir as mkdir8, readdir as readdir8, realpath as realpath9, chmod as fsChmod } from "node:fs/promises";
23995
24476
  import { open as fsOpen } from "node:fs/promises";
23996
- import { relative as relative13, resolve as resolve16, dirname as dirname7, sep as pathSep, isAbsolute as isAbsolute12 } from "node:path";
24477
+ import { relative as relative14, resolve as resolve17, dirname as dirname7, sep as pathSep, isAbsolute as isAbsolute13 } from "node:path";
23997
24478
  import { posix } from "node:path";
23998
24479
  import { constants as fsConstants3 } from "node:fs";
23999
24480
  import { createHash as createHash7 } from "node:crypto";
@@ -24002,14 +24483,14 @@ function _isContainedWith(relativeFn, isAbsoluteFn, root, candidate, relPathSep
24002
24483
  return rel !== "" && rel !== ".." && !rel.startsWith(`..${relPathSep}`) && !isAbsoluteFn(rel);
24003
24484
  }
24004
24485
  function isContained(root, candidate) {
24005
- return _isContainedWith(relative13, isAbsolute12, root, candidate);
24486
+ return _isContainedWith(relative14, isAbsolute13, root, candidate);
24006
24487
  }
24007
- async function assertNoAncestorSymlinks(root, filePath, fs = { lstat: lstat9 }) {
24008
- const rel = relative13(root, filePath);
24488
+ async function assertNoAncestorSymlinks(root, filePath, fs = { lstat: lstat10 }) {
24489
+ const rel = relative14(root, filePath);
24009
24490
  const segments = rel.split(/[/\\]/);
24010
24491
  let current = root;
24011
24492
  for (const segment of segments) {
24012
- current = resolve16(current, segment);
24493
+ current = resolve17(current, segment);
24013
24494
  try {
24014
24495
  const st = await fs.lstat(current, { stage: "source-ancestor" });
24015
24496
  if (st.isSymbolicLink()) {
@@ -24031,7 +24512,7 @@ async function assertNoAncestorSymlinks(root, filePath, fs = { lstat: lstat9 })
24031
24512
  }
24032
24513
  }
24033
24514
  }
24034
- async function assertOutputAncestorsNoFollow(effectiveOutputDir, fs = { lstat: lstat9 }) {
24515
+ async function assertOutputAncestorsNoFollow(effectiveOutputDir, fs = { lstat: lstat10 }) {
24035
24516
  const parts = effectiveOutputDir.split(pathSep).filter(Boolean);
24036
24517
  let accumulated = "";
24037
24518
  for (const part of parts) {
@@ -24065,12 +24546,12 @@ async function assertOutputAncestorsNoFollow(effectiveOutputDir, fs = { lstat: l
24065
24546
  }
24066
24547
  }
24067
24548
  }
24068
- async function assertDestAncestorsNoFollow(realOutputRoot, destPath, fs = { lstat: lstat9 }) {
24069
- const relDest = relative13(realOutputRoot, destPath);
24549
+ async function assertDestAncestorsNoFollow(realOutputRoot, destPath, fs = { lstat: lstat10 }) {
24550
+ const relDest = relative14(realOutputRoot, destPath);
24070
24551
  const segments = relDest.split(pathSep).filter(Boolean);
24071
24552
  let current = realOutputRoot;
24072
24553
  for (const segment of segments) {
24073
- current = resolve16(current, segment);
24554
+ current = resolve17(current, segment);
24074
24555
  try {
24075
24556
  const st = await fs.lstat(current, { stage: "dest-ancestor" });
24076
24557
  if (st.isSymbolicLink()) {
@@ -24224,12 +24705,12 @@ async function buildPublicStaging({
24224
24705
  throw new ReleaseError(CONFIG_INVALID, "unit.publicFiles must be an array");
24225
24706
  }
24226
24707
  const fs = {
24227
- lstat: _fsOps.lstat ? (p, ctx) => _fsOps.lstat({ operation: "lstat", path: p, ...ctx }) : lstat9,
24228
- realpath: _fsOps.realpath ? (p, ctx) => _fsOps.realpath({ operation: "realpath", path: p, ...ctx }) : realpath8,
24708
+ lstat: _fsOps.lstat ? (p, ctx) => _fsOps.lstat({ operation: "lstat", path: p, ...ctx }) : lstat10,
24709
+ realpath: _fsOps.realpath ? (p, ctx) => _fsOps.realpath({ operation: "realpath", path: p, ...ctx }) : realpath9,
24229
24710
  readFile: _fsOps.readFile ? (p, ctx) => _fsOps.readFile({ operation: "readFile", path: p, ...ctx }) : readFile12,
24230
24711
  open: _fsOps.open ? (p, flags, mode, ctx) => _fsOps.open({ operation: "open", path: p, flags, mode, ...ctx }) : fsOpen,
24231
24712
  mkdir: _fsOps.mkdir ? (p, opts, ctx) => _fsOps.mkdir({ operation: "mkdir", path: p, opts, ...ctx }) : mkdir8,
24232
- readdir: _fsOps.readdir ? (p, ctx) => _fsOps.readdir({ operation: "readdir", path: p, ...ctx }) : readdir7,
24713
+ readdir: _fsOps.readdir ? (p, ctx) => _fsOps.readdir({ operation: "readdir", path: p, ...ctx }) : readdir8,
24233
24714
  chmod: _fsOps.chmod ? (p, mode, ctx) => _fsOps.chmod({ operation: "chmod", path: p, mode, ...ctx }) : fsChmod
24234
24715
  };
24235
24716
  let realSourceRoot;
@@ -24261,7 +24742,7 @@ async function buildPublicStaging({
24261
24742
  { count: mappings.length, limit: MAX_MAPPINGS }
24262
24743
  );
24263
24744
  }
24264
- const unitRootLexical = resolve16(sourceRoot, unit.source);
24745
+ const unitRootLexical = resolve17(sourceRoot, unit.source);
24265
24746
  let realUnitRoot;
24266
24747
  try {
24267
24748
  realUnitRoot = await fs.realpath(unitRootLexical, { stage: "unit-root-realpath" });
@@ -24274,14 +24755,14 @@ async function buildPublicStaging({
24274
24755
  { sourceRoot, unitSource: unit.source, cause: code }
24275
24756
  );
24276
24757
  }
24277
- const effectiveOutputDir = resolve16(
24278
- outputDir ?? resolve16(sourceRoot, ".release-skill", "staging")
24758
+ const effectiveOutputDir = resolve17(
24759
+ outputDir ?? resolve17(sourceRoot, ".release-skill", "staging")
24279
24760
  );
24280
24761
  const preflightRecords = [];
24281
24762
  const requiredTargetSet = new Set(unit.requiredPublicFiles ?? []);
24282
24763
  for (const mapping of mappings) {
24283
- const srcPath = resolve16(sourceRoot, mapping.from);
24284
- const destPath = resolve16(effectiveOutputDir, mapping.to);
24764
+ const srcPath = resolve17(sourceRoot, mapping.from);
24765
+ const destPath = resolve17(effectiveOutputDir, mapping.to);
24285
24766
  if (srcPath.length > MAX_PATH_LENGTH || destPath.length > MAX_PATH_LENGTH) {
24286
24767
  preflightRecords.push({
24287
24768
  ok: false,
@@ -24768,11 +25249,11 @@ async function buildPublicStaging({
24768
25249
  );
24769
25250
  }
24770
25251
  const destDir = dirname7(destPath);
24771
- const relDest = relative13(realOutputRoot, destDir);
25252
+ const relDest = relative14(realOutputRoot, destDir);
24772
25253
  const destSegments = relDest.split(pathSep).filter(Boolean);
24773
25254
  let accumulatedPath = realOutputRoot;
24774
25255
  for (const seg of destSegments) {
24775
- accumulatedPath = resolve16(accumulatedPath, seg);
25256
+ accumulatedPath = resolve17(accumulatedPath, seg);
24776
25257
  try {
24777
25258
  const segStat = await fs.lstat(accumulatedPath, { stage: "dest-ancestor-pre-mkdir" });
24778
25259
  if (segStat.isSymbolicLink()) {
@@ -25071,25 +25552,25 @@ var init_public_map = __esm({
25071
25552
  });
25072
25553
 
25073
25554
  // src/snapshot/scan.mjs
25074
- import { readFile as readFile13, readdir as readdir8, stat as stat3 } from "node:fs/promises";
25075
- import { join as join12, relative as relative14, extname, posix as posix2, win32 } from "node:path";
25555
+ import { readFile as readFile13, readdir as readdir9, stat as stat3 } from "node:fs/promises";
25556
+ import { join as join13, relative as relative15, extname, posix as posix2, win32 } from "node:path";
25076
25557
  import { createHash as createHash8 } from "node:crypto";
25077
25558
  async function collectFiles(dir, base = dir) {
25078
25559
  const results = [];
25079
25560
  let entries;
25080
25561
  try {
25081
- entries = await readdir8(dir, { withFileTypes: true });
25562
+ entries = await readdir9(dir, { withFileTypes: true });
25082
25563
  } catch {
25083
25564
  return results;
25084
25565
  }
25085
25566
  for (const entry of entries) {
25086
25567
  if (entry.name === ".git") continue;
25087
- const abs = join12(dir, entry.name);
25568
+ const abs = join13(dir, entry.name);
25088
25569
  if (entry.isDirectory()) {
25089
25570
  const sub = await collectFiles(abs, base);
25090
25571
  results.push(...sub);
25091
25572
  } else if (entry.isFile()) {
25092
- results.push(relative14(base, abs));
25573
+ results.push(relative15(base, abs));
25093
25574
  }
25094
25575
  }
25095
25576
  return results;
@@ -25121,9 +25602,9 @@ async function scanFile(relPath, absPath, forbiddenPaths, forbiddenContentPatter
25121
25602
  for (const fp of forbiddenPaths) {
25122
25603
  const normFp = fp.replaceAll(win32.sep, posix2.sep).replace(/\/+$/, "").toLowerCase();
25123
25604
  if (!normFp) continue;
25124
- for (const sep6 of separators) {
25125
- const prefix = normFp.endsWith(sep6.toLowerCase()) ? normFp : normFp + sep6.toLowerCase();
25126
- const checkPath = lowerRel + sep6.toLowerCase();
25605
+ for (const sep7 of separators) {
25606
+ const prefix = normFp.endsWith(sep7.toLowerCase()) ? normFp : normFp + sep7.toLowerCase();
25607
+ const checkPath = lowerRel + sep7.toLowerCase();
25127
25608
  if (lowerRel === normFp || checkPath.startsWith(prefix)) {
25128
25609
  const dedupKey = `FORBIDDEN_PATH:${normFp}:${normRel}`;
25129
25610
  if (!seenKinds.has(dedupKey)) {
@@ -25209,7 +25690,7 @@ async function scanFile(relPath, absPath, forbiddenPaths, forbiddenContentPatter
25209
25690
  }
25210
25691
  async function scanForStaleDist(snapshotDir) {
25211
25692
  const findings = [];
25212
- const manifestPath = join12(snapshotDir, "dist", "manifest.json");
25693
+ const manifestPath = join13(snapshotDir, "dist", "manifest.json");
25213
25694
  let manifest;
25214
25695
  try {
25215
25696
  const raw = await readFile13(manifestPath, "utf8");
@@ -25220,10 +25701,10 @@ async function scanForStaleDist(snapshotDir) {
25220
25701
  if (!manifest.files || typeof manifest.files !== "object") {
25221
25702
  return findings;
25222
25703
  }
25223
- const distDir = join12(snapshotDir, "dist");
25704
+ const distDir = join13(snapshotDir, "dist");
25224
25705
  for (const [fileRel, expectedHash] of Object.entries(manifest.files)) {
25225
25706
  if (typeof expectedHash !== "string") continue;
25226
- const fileAbs = join12(distDir, fileRel);
25707
+ const fileAbs = join13(distDir, fileRel);
25227
25708
  let actualContent;
25228
25709
  try {
25229
25710
  actualContent = await readFile13(fileAbs);
@@ -25267,7 +25748,7 @@ async function scanSnapshot({ snapshotDir, policy = {} } = {}) {
25267
25748
  const relFiles = await collectFiles(snapshotDir);
25268
25749
  const seenKinds = /* @__PURE__ */ new Set();
25269
25750
  for (const relPath of relFiles) {
25270
- const absPath = join12(snapshotDir, relPath);
25751
+ const absPath = join13(snapshotDir, relPath);
25271
25752
  const normRel = relPath.replaceAll(win32.sep, posix2.sep);
25272
25753
  if (await isBinaryFile(relPath, absPath)) continue;
25273
25754
  const fileFindings = await scanFile(normRel, absPath, forbiddenPaths, forbiddenContentPatterns, seenKinds);
@@ -25521,11 +26002,11 @@ var init_contract2 = __esm({
25521
26002
  // src/core/source-authority.mjs
25522
26003
  import { execFile as execFileCb6 } from "node:child_process";
25523
26004
  import { promisify as promisify6 } from "node:util";
25524
- import { lstat as lstat10, mkdtemp as mkdtemp2, readFile as readFile15, readdir as readdir9, realpath as realpath9, rm as rm5 } from "node:fs/promises";
25525
- import { join as join13, relative as relative15, resolve as resolve17, sep as sep4 } from "node:path";
26005
+ import { lstat as lstat11, mkdtemp as mkdtemp2, readFile as readFile15, readdir as readdir10, realpath as realpath10, rm as rm5 } from "node:fs/promises";
26006
+ import { join as join14, relative as relative16, resolve as resolve18, sep as sep5 } from "node:path";
25526
26007
  import { tmpdir as tmpdir3 } from "node:os";
25527
26008
  async function computeSourceInputClosure({ units, root }) {
25528
- const realRoot = await realpath9(resolve17(root));
26009
+ const realRoot = await realpath10(resolve18(root));
25529
26010
  const entriesByPath = /* @__PURE__ */ new Map();
25530
26011
  for (const unit of units ?? []) {
25531
26012
  for (const mapping of unit.publicFiles ?? []) {
@@ -25564,7 +26045,7 @@ function computeEntriesDigest(entries) {
25564
26045
  async function collectPath({ absolutePath, root, entriesByPath }) {
25565
26046
  let stat9;
25566
26047
  try {
25567
- stat9 = await lstat10(absolutePath);
26048
+ stat9 = await lstat11(absolutePath);
25568
26049
  } catch (error) {
25569
26050
  throw new ReleaseError(
25570
26051
  CONFIG_INVALID,
@@ -25580,7 +26061,7 @@ async function collectPath({ absolutePath, root, entriesByPath }) {
25580
26061
  { path: rel }
25581
26062
  );
25582
26063
  }
25583
- const physicalPath = await realpath9(absolutePath);
26064
+ const physicalPath = await realpath10(absolutePath);
25584
26065
  if (physicalPath !== absolutePath) {
25585
26066
  throw new ReleaseError(
25586
26067
  CONFIG_INVALID,
@@ -25589,11 +26070,11 @@ async function collectPath({ absolutePath, root, entriesByPath }) {
25589
26070
  );
25590
26071
  }
25591
26072
  if (stat9.isDirectory()) {
25592
- const children = await readdir9(absolutePath, { withFileTypes: true });
26073
+ const children = await readdir10(absolutePath, { withFileTypes: true });
25593
26074
  children.sort((left, right) => left.name.localeCompare(right.name));
25594
26075
  for (const child of children) {
25595
26076
  await collectPath({
25596
- absolutePath: join13(absolutePath, child.name),
26077
+ absolutePath: join14(absolutePath, child.name),
25597
26078
  root,
25598
26079
  entriesByPath
25599
26080
  });
@@ -25615,9 +26096,9 @@ async function collectPath({ absolutePath, root, entriesByPath }) {
25615
26096
  });
25616
26097
  }
25617
26098
  function resolveInside(base, candidate, containmentRoot = base) {
25618
- const resolved = resolve17(base, candidate);
25619
- const root = resolve17(containmentRoot);
25620
- if (resolved !== root && !resolved.startsWith(`${root}${sep4}`)) {
26099
+ const resolved = resolve18(base, candidate);
26100
+ const root = resolve18(containmentRoot);
26101
+ if (resolved !== root && !resolved.startsWith(`${root}${sep5}`)) {
25621
26102
  throw new ReleaseError(
25622
26103
  CONFIG_INVALID,
25623
26104
  `source-input closure path escapes workspace root: "${candidate}"`,
@@ -25627,7 +26108,7 @@ function resolveInside(base, candidate, containmentRoot = base) {
25627
26108
  return resolved;
25628
26109
  }
25629
26110
  function toRelative(root, absolutePath) {
25630
- const rel = relative15(root, absolutePath).split(sep4).join("/");
26111
+ const rel = relative16(root, absolutePath).split(sep5).join("/");
25631
26112
  if (!rel || rel === "." || rel.startsWith("../") || rel === "..") {
25632
26113
  throw new ReleaseError(
25633
26114
  CONFIG_INVALID,
@@ -25837,7 +26318,7 @@ async function verifyWithTemporaryGit({
25837
26318
  if (!branchLine) {
25838
26319
  return failure(REF_MISSING, `remote ref "refs/heads/${defaultBranch}" does not exist`);
25839
26320
  }
25840
- const tempRoot = await mkdtemp2(join13(tmpdir3(), "release-skill-source-authority-"));
26321
+ const tempRoot = await mkdtemp2(join14(tmpdir3(), "release-skill-source-authority-"));
25841
26322
  try {
25842
26323
  await execFn("git", ["init", "--bare", tempRoot], {
25843
26324
  encoding: "utf8",
@@ -26944,10 +27425,10 @@ var require_commonjs = __commonJS({
26944
27425
  * Return a void Promise that resolves once the stream ends.
26945
27426
  */
26946
27427
  async promise() {
26947
- return new Promise((resolve28, reject) => {
27428
+ return new Promise((resolve29, reject) => {
26948
27429
  this.on(DESTROYED, () => reject(new Error("stream destroyed")));
26949
27430
  this.on("error", (er) => reject(er));
26950
- this.on("end", () => resolve28());
27431
+ this.on("end", () => resolve29());
26951
27432
  });
26952
27433
  }
26953
27434
  /**
@@ -26971,7 +27452,7 @@ var require_commonjs = __commonJS({
26971
27452
  return Promise.resolve({ done: false, value: res });
26972
27453
  if (this[EOF])
26973
27454
  return stop();
26974
- let resolve28;
27455
+ let resolve29;
26975
27456
  let reject;
26976
27457
  const onerr = /* @__PURE__ */ __name((er) => {
26977
27458
  this.off("data", ondata);
@@ -26985,19 +27466,19 @@ var require_commonjs = __commonJS({
26985
27466
  this.off("end", onend);
26986
27467
  this.off(DESTROYED, ondestroy);
26987
27468
  this.pause();
26988
- resolve28({ value, done: !!this[EOF] });
27469
+ resolve29({ value, done: !!this[EOF] });
26989
27470
  }, "ondata");
26990
27471
  const onend = /* @__PURE__ */ __name(() => {
26991
27472
  this.off("error", onerr);
26992
27473
  this.off("data", ondata);
26993
27474
  this.off(DESTROYED, ondestroy);
26994
27475
  stop();
26995
- resolve28({ done: true, value: void 0 });
27476
+ resolve29({ done: true, value: void 0 });
26996
27477
  }, "onend");
26997
27478
  const ondestroy = /* @__PURE__ */ __name(() => onerr(new Error("stream destroyed")), "ondestroy");
26998
27479
  return new Promise((res2, rej) => {
26999
27480
  reject = rej;
27000
- resolve28 = res2;
27481
+ resolve29 = res2;
27001
27482
  this.once(DESTROYED, ondestroy);
27002
27483
  this.once("error", onerr);
27003
27484
  this.once("end", onend);
@@ -28088,10 +28569,10 @@ var require_minipass = __commonJS({
28088
28569
  }
28089
28570
  // stream.promise().then(() => done, er => emitted error)
28090
28571
  promise() {
28091
- return new Promise((resolve28, reject) => {
28572
+ return new Promise((resolve29, reject) => {
28092
28573
  this.on(DESTROYED, () => reject(new Error("stream destroyed")));
28093
28574
  this.on("error", (er) => reject(er));
28094
- this.on("end", () => resolve28());
28575
+ this.on("end", () => resolve29());
28095
28576
  });
28096
28577
  }
28097
28578
  // for await (let chunk of stream)
@@ -28102,7 +28583,7 @@ var require_minipass = __commonJS({
28102
28583
  return Promise.resolve({ done: false, value: res });
28103
28584
  if (this[EOF])
28104
28585
  return Promise.resolve({ done: true });
28105
- let resolve28 = null;
28586
+ let resolve29 = null;
28106
28587
  let reject = null;
28107
28588
  const onerr = /* @__PURE__ */ __name((er) => {
28108
28589
  this.removeListener("data", ondata);
@@ -28113,17 +28594,17 @@ var require_minipass = __commonJS({
28113
28594
  this.removeListener("error", onerr);
28114
28595
  this.removeListener("end", onend);
28115
28596
  this.pause();
28116
- resolve28({ value, done: !!this[EOF] });
28597
+ resolve29({ value, done: !!this[EOF] });
28117
28598
  }, "ondata");
28118
28599
  const onend = /* @__PURE__ */ __name(() => {
28119
28600
  this.removeListener("error", onerr);
28120
28601
  this.removeListener("data", ondata);
28121
- resolve28({ done: true });
28602
+ resolve29({ done: true });
28122
28603
  }, "onend");
28123
28604
  const ondestroy = /* @__PURE__ */ __name(() => onerr(new Error("stream destroyed")), "ondestroy");
28124
28605
  return new Promise((res2, rej) => {
28125
28606
  reject = rej;
28126
- resolve28 = res2;
28607
+ resolve29 = res2;
28127
28608
  this.once(DESTROYED, ondestroy);
28128
28609
  this.once("error", onerr);
28129
28610
  this.once("end", onend);
@@ -32162,12 +32643,12 @@ var require_body = __commonJS({
32162
32643
  if (resTimeout && resTimeout.unref) {
32163
32644
  resTimeout.unref();
32164
32645
  }
32165
- return new Promise((resolve28) => {
32646
+ return new Promise((resolve29) => {
32166
32647
  if (stream !== upstream) {
32167
32648
  upstream.on("error", (er) => stream.emit("error", er));
32168
32649
  upstream.pipe(stream);
32169
32650
  }
32170
- resolve28();
32651
+ resolve29();
32171
32652
  }).then(() => stream.concat()).then((buf) => {
32172
32653
  clearTimeout(resTimeout);
32173
32654
  return buf;
@@ -32932,7 +33413,7 @@ var require_lib2 = __commonJS({
32932
33413
  var fetch = /* @__PURE__ */ __name(async (url, opts) => {
32933
33414
  if (/^data:/.test(url)) {
32934
33415
  const request = new Request(url, opts);
32935
- return Promise.resolve().then(() => new Promise((resolve28, reject) => {
33416
+ return Promise.resolve().then(() => new Promise((resolve29, reject) => {
32936
33417
  let type, data;
32937
33418
  try {
32938
33419
  const { pathname, search } = new URL2(url);
@@ -32956,10 +33437,10 @@ var require_lib2 = __commonJS({
32956
33437
  if (type) {
32957
33438
  headers["Content-Type"] = type;
32958
33439
  }
32959
- return resolve28(new Response(data, { headers }));
33440
+ return resolve29(new Response(data, { headers }));
32960
33441
  }));
32961
33442
  }
32962
- return new Promise((resolve28, reject) => {
33443
+ return new Promise((resolve29, reject) => {
32963
33444
  const request = new Request(url, opts);
32964
33445
  let options;
32965
33446
  try {
@@ -33078,7 +33559,7 @@ var require_lib2 = __commonJS({
33078
33559
  requestOpts.body = void 0;
33079
33560
  requestOpts.headers.delete("content-length");
33080
33561
  }
33081
- resolve28(fetch(new Request(locationURL, requestOpts)));
33562
+ resolve29(fetch(new Request(locationURL, requestOpts)));
33082
33563
  finalize();
33083
33564
  return;
33084
33565
  }
@@ -33106,7 +33587,7 @@ var require_lib2 = __commonJS({
33106
33587
  const codings = headers.get("Content-Encoding");
33107
33588
  if (!request.compress || request.method === "HEAD" || codings === null || res.statusCode === 204 || res.statusCode === 304) {
33108
33589
  response = new Response(body, responseOptions);
33109
- resolve28(response);
33590
+ resolve29(response);
33110
33591
  return;
33111
33592
  }
33112
33593
  const zlibOptions = {
@@ -33125,7 +33606,7 @@ var require_lib2 = __commonJS({
33125
33606
  ).pipe(unzip),
33126
33607
  responseOptions
33127
33608
  );
33128
- resolve28(response);
33609
+ resolve29(response);
33129
33610
  return;
33130
33611
  }
33131
33612
  if (codings === "deflate" || codings === "x-deflate") {
@@ -33137,7 +33618,7 @@ var require_lib2 = __commonJS({
33137
33618
  (er) => decoder2.emit("error", er)
33138
33619
  ).pipe(decoder2);
33139
33620
  response = new Response(decoder2, responseOptions);
33140
- resolve28(response);
33621
+ resolve29(response);
33141
33622
  });
33142
33623
  return;
33143
33624
  }
@@ -33155,11 +33636,11 @@ var require_lib2 = __commonJS({
33155
33636
  (er) => decoder.emit("error", er)
33156
33637
  ).pipe(decoder);
33157
33638
  response = new Response(decoder, responseOptions);
33158
- resolve28(response);
33639
+ resolve29(response);
33159
33640
  return;
33160
33641
  }
33161
33642
  response = new Response(body, responseOptions);
33162
- resolve28(response);
33643
+ resolve29(response);
33163
33644
  });
33164
33645
  writeToStream(req, request);
33165
33646
  });
@@ -33413,12 +33894,12 @@ var require_lib3 = __commonJS({
33413
33894
  return process.emit("input", "end");
33414
33895
  }, "end"),
33415
33896
  read: /* @__PURE__ */ __name(function(...args2) {
33416
- let resolve28, reject;
33897
+ let resolve29, reject;
33417
33898
  const promise = new Promise((_resolve, _reject) => {
33418
- resolve28 = _resolve;
33899
+ resolve29 = _resolve;
33419
33900
  reject = _reject;
33420
33901
  });
33421
- process.emit("input", "read", resolve28, reject, ...args2);
33902
+ process.emit("input", "read", resolve29, reject, ...args2);
33422
33903
  return promise;
33423
33904
  }, "read")
33424
33905
  }
@@ -37833,7 +38314,7 @@ var require_npa = __commonJS({
37833
38314
  spec = arg;
37834
38315
  }
37835
38316
  }
37836
- return resolve28(name, spec, where, arg);
38317
+ return resolve29(name, spec, where, arg);
37837
38318
  }
37838
38319
  __name(npa, "npa");
37839
38320
  function isFileSpec(spec) {
@@ -37856,7 +38337,7 @@ var require_npa = __commonJS({
37856
38337
  return spec.toLowerCase().startsWith("npm:");
37857
38338
  }
37858
38339
  __name(isAliasSpec, "isAliasSpec");
37859
- function resolve28(name, spec, where, arg) {
38340
+ function resolve29(name, spec, where, arg) {
37860
38341
  const res = new Result({
37861
38342
  raw: arg,
37862
38343
  name,
@@ -37888,7 +38369,7 @@ var require_npa = __commonJS({
37888
38369
  return fromRegistry(res);
37889
38370
  }
37890
38371
  }
37891
- __name(resolve28, "resolve");
38372
+ __name(resolve29, "resolve");
37892
38373
  function toPurl(arg, reg = defaultRegistry) {
37893
38374
  const res = npa(arg);
37894
38375
  if (res.type !== "version") {
@@ -38189,7 +38670,7 @@ var require_npa = __commonJS({
38189
38670
  }
38190
38671
  __name(fromRegistry, "fromRegistry");
38191
38672
  module.exports = npa;
38192
- module.exports.resolve = resolve28;
38673
+ module.exports.resolve = resolve29;
38193
38674
  module.exports.toPurl = toPurl;
38194
38675
  module.exports.Result = Result;
38195
38676
  }
@@ -39780,7 +40261,7 @@ var require_lib7 = __commonJS({
39780
40261
  return `${this.algorithm}-${this.digest}${getOptString(this.options)}`;
39781
40262
  }
39782
40263
  };
39783
- function integrityHashToString(toString, sep6, opts, hashes) {
40264
+ function integrityHashToString(toString, sep7, opts, hashes) {
39784
40265
  const toStringIsNotEmpty = toString !== "";
39785
40266
  let shouldAddFirstSep = false;
39786
40267
  let complement = "";
@@ -39790,7 +40271,7 @@ var require_lib7 = __commonJS({
39790
40271
  if (hashString) {
39791
40272
  shouldAddFirstSep = true;
39792
40273
  complement += hashString;
39793
- complement += sep6;
40274
+ complement += sep7;
39794
40275
  }
39795
40276
  }
39796
40277
  const finalHashString = Hash.prototype.toString.call(hashes[lastIndex], opts);
@@ -39799,7 +40280,7 @@ var require_lib7 = __commonJS({
39799
40280
  complement += finalHashString;
39800
40281
  }
39801
40282
  if (toStringIsNotEmpty && shouldAddFirstSep) {
39802
- return toString + sep6 + complement;
40283
+ return toString + sep7 + complement;
39803
40284
  }
39804
40285
  return toString + complement;
39805
40286
  }
@@ -39818,18 +40299,18 @@ var require_lib7 = __commonJS({
39818
40299
  return Object.keys(this).length === 0;
39819
40300
  }
39820
40301
  toString(opts) {
39821
- let sep6 = opts?.sep || " ";
40302
+ let sep7 = opts?.sep || " ";
39822
40303
  let toString = "";
39823
40304
  if (opts?.strict) {
39824
- sep6 = sep6.replace(/\S+/g, " ");
40305
+ sep7 = sep7.replace(/\S+/g, " ");
39825
40306
  for (const hash of SPEC_ALGORITHMS) {
39826
40307
  if (this[hash]) {
39827
- toString = integrityHashToString(toString, sep6, opts, this[hash]);
40308
+ toString = integrityHashToString(toString, sep7, opts, this[hash]);
39828
40309
  }
39829
40310
  }
39830
40311
  } else {
39831
40312
  for (const hash of Object.keys(this)) {
39832
- toString = integrityHashToString(toString, sep6, opts, this[hash]);
40313
+ toString = integrityHashToString(toString, sep7, opts, this[hash]);
39833
40314
  }
39834
40315
  }
39835
40316
  return toString;
@@ -39962,7 +40443,7 @@ var require_lib7 = __commonJS({
39962
40443
  module.exports.fromStream = fromStream;
39963
40444
  function fromStream(stream, opts) {
39964
40445
  const istream = integrityStream(opts);
39965
- return new Promise((resolve28, reject) => {
40446
+ return new Promise((resolve29, reject) => {
39966
40447
  stream.pipe(istream);
39967
40448
  stream.on("error", reject);
39968
40449
  istream.on("error", reject);
@@ -39970,7 +40451,7 @@ var require_lib7 = __commonJS({
39970
40451
  istream.on("integrity", (s) => {
39971
40452
  sri = s;
39972
40453
  });
39973
- istream.on("end", () => resolve28(sri));
40454
+ istream.on("end", () => resolve29(sri));
39974
40455
  istream.resume();
39975
40456
  });
39976
40457
  }
@@ -40031,7 +40512,7 @@ var require_lib7 = __commonJS({
40031
40512
  ));
40032
40513
  }
40033
40514
  const checker = integrityStream(opts);
40034
- return new Promise((resolve28, reject) => {
40515
+ return new Promise((resolve29, reject) => {
40035
40516
  stream.pipe(checker);
40036
40517
  stream.on("error", reject);
40037
40518
  checker.on("error", reject);
@@ -40039,7 +40520,7 @@ var require_lib7 = __commonJS({
40039
40520
  checker.on("verified", (s) => {
40040
40521
  verified = s;
40041
40522
  });
40042
- checker.on("end", () => resolve28(verified));
40523
+ checker.on("end", () => resolve29(verified));
40043
40524
  checker.resume();
40044
40525
  });
40045
40526
  }
@@ -40920,9 +41401,9 @@ var require_polyfill = __commonJS({
40920
41401
  var {
40921
41402
  chmod: chmod5,
40922
41403
  copyFile,
40923
- lstat: lstat17,
41404
+ lstat: lstat18,
40924
41405
  mkdir: mkdir18,
40925
- readdir: readdir16,
41406
+ readdir: readdir17,
40926
41407
  readlink: readlink2,
40927
41408
  stat: stat9,
40928
41409
  symlink,
@@ -40931,11 +41412,11 @@ var require_polyfill = __commonJS({
40931
41412
  } = __require("fs/promises");
40932
41413
  var {
40933
41414
  dirname: dirname16,
40934
- isAbsolute: isAbsolute21,
40935
- join: join29,
41415
+ isAbsolute: isAbsolute22,
41416
+ join: join30,
40936
41417
  parse: parse2,
40937
- resolve: resolve28,
40938
- sep: sep6,
41418
+ resolve: resolve29,
41419
+ sep: sep7,
40939
41420
  toNamespacedPath
40940
41421
  } = __require("path");
40941
41422
  var { fileURLToPath: fileURLToPath3 } = __require("url");
@@ -41021,7 +41502,7 @@ var require_polyfill = __commonJS({
41021
41502
  }
41022
41503
  __name(areIdentical, "areIdentical");
41023
41504
  function getStats(src, dest, opts) {
41024
- const statFunc = opts.dereference ? (file) => stat9(file, { bigint: true }) : (file) => lstat17(file, { bigint: true });
41505
+ const statFunc = opts.dereference ? (file) => stat9(file, { bigint: true }) : (file) => lstat18(file, { bigint: true });
41025
41506
  return Promise.all([
41026
41507
  statFunc(src),
41027
41508
  statFunc(dest).catch((err) => {
@@ -41052,8 +41533,8 @@ var require_polyfill = __commonJS({
41052
41533
  }
41053
41534
  __name(pathExists2, "pathExists");
41054
41535
  async function checkParentPaths(src, srcStat, dest) {
41055
- const srcParent = resolve28(dirname16(src));
41056
- const destParent = resolve28(dirname16(dest));
41536
+ const srcParent = resolve29(dirname16(src));
41537
+ const destParent = resolve29(dirname16(dest));
41057
41538
  if (destParent === srcParent || destParent === parse2(destParent).root) {
41058
41539
  return;
41059
41540
  }
@@ -41077,7 +41558,7 @@ var require_polyfill = __commonJS({
41077
41558
  return checkParentPaths(src, srcStat, destParent);
41078
41559
  }
41079
41560
  __name(checkParentPaths, "checkParentPaths");
41080
- var normalizePathToArray = /* @__PURE__ */ __name((path3) => resolve28(path3).split(sep6).filter(Boolean), "normalizePathToArray");
41561
+ var normalizePathToArray = /* @__PURE__ */ __name((path3) => resolve29(path3).split(sep7).filter(Boolean), "normalizePathToArray");
41081
41562
  function isSrcSubdir(src, dest) {
41082
41563
  const srcArr = normalizePathToArray(src);
41083
41564
  const destArr = normalizePathToArray(dest);
@@ -41099,7 +41580,7 @@ var require_polyfill = __commonJS({
41099
41580
  }
41100
41581
  __name(startCopy, "startCopy");
41101
41582
  async function getStatsForCopy(destStat, src, dest, opts) {
41102
- const statFn = opts.dereference ? stat9 : lstat17;
41583
+ const statFn = opts.dereference ? stat9 : lstat18;
41103
41584
  const srcStat = await statFn(src);
41104
41585
  if (srcStat.isDirectory() && opts.recursive) {
41105
41586
  return onDir(srcStat, destStat, src, dest, opts);
@@ -41210,11 +41691,11 @@ var require_polyfill = __commonJS({
41210
41691
  }
41211
41692
  __name(mkDirAndCopy, "mkDirAndCopy");
41212
41693
  async function copyDir(src, dest, opts) {
41213
- const dir = await readdir16(src);
41694
+ const dir = await readdir17(src);
41214
41695
  for (let i = 0; i < dir.length; i++) {
41215
41696
  const item = dir[i];
41216
- const srcItem = join29(src, item);
41217
- const destItem = join29(dest, item);
41697
+ const srcItem = join30(src, item);
41698
+ const destItem = join30(dest, item);
41218
41699
  const { destStat } = await checkPaths(srcItem, destItem, opts);
41219
41700
  await startCopy(destStat, srcItem, destItem, opts);
41220
41701
  }
@@ -41222,8 +41703,8 @@ var require_polyfill = __commonJS({
41222
41703
  __name(copyDir, "copyDir");
41223
41704
  async function onLink(destStat, src, dest) {
41224
41705
  let resolvedSrc = await readlink2(src);
41225
- if (!isAbsolute21(resolvedSrc)) {
41226
- resolvedSrc = resolve28(dirname16(src), resolvedSrc);
41706
+ if (!isAbsolute22(resolvedSrc)) {
41707
+ resolvedSrc = resolve29(dirname16(src), resolvedSrc);
41227
41708
  }
41228
41709
  if (!destStat) {
41229
41710
  return symlink(resolvedSrc, dest);
@@ -41237,8 +41718,8 @@ var require_polyfill = __commonJS({
41237
41718
  }
41238
41719
  throw err;
41239
41720
  }
41240
- if (!isAbsolute21(resolvedDest)) {
41241
- resolvedDest = resolve28(dirname16(dest), resolvedDest);
41721
+ if (!isAbsolute22(resolvedDest)) {
41722
+ resolvedDest = resolve29(dirname16(dest), resolvedDest);
41242
41723
  }
41243
41724
  if (isSrcSubdir(resolvedSrc, resolvedDest)) {
41244
41725
  throw new ERR_FS_CP_EINVAL({
@@ -41290,7 +41771,7 @@ var require_cp = __commonJS({
41290
41771
  // ../../node_modules/.pnpm/@npmcli+fs@4.0.0/node_modules/@npmcli/fs/lib/with-temp-dir.js
41291
41772
  var require_with_temp_dir = __commonJS({
41292
41773
  "../../node_modules/.pnpm/@npmcli+fs@4.0.0/node_modules/@npmcli/fs/lib/with-temp-dir.js"(exports, module) {
41293
- var { join: join29, sep: sep6 } = __require("path");
41774
+ var { join: join30, sep: sep7 } = __require("path");
41294
41775
  var getOptions = require_get_options();
41295
41776
  var { mkdir: mkdir18, mkdtemp: mkdtemp6, rm: rm10 } = __require("fs/promises");
41296
41777
  var withTempDir = /* @__PURE__ */ __name(async (root, fn, opts) => {
@@ -41298,7 +41779,7 @@ var require_with_temp_dir = __commonJS({
41298
41779
  copy: ["tmpPrefix"]
41299
41780
  });
41300
41781
  await mkdir18(root, { recursive: true });
41301
- const target = await mkdtemp6(join29(`${root}${sep6}`, options.tmpPrefix || ""));
41782
+ const target = await mkdtemp6(join30(`${root}${sep7}`, options.tmpPrefix || ""));
41302
41783
  let err;
41303
41784
  let result;
41304
41785
  try {
@@ -41322,14 +41803,14 @@ var require_with_temp_dir = __commonJS({
41322
41803
  // ../../node_modules/.pnpm/@npmcli+fs@4.0.0/node_modules/@npmcli/fs/lib/readdir-scoped.js
41323
41804
  var require_readdir_scoped = __commonJS({
41324
41805
  "../../node_modules/.pnpm/@npmcli+fs@4.0.0/node_modules/@npmcli/fs/lib/readdir-scoped.js"(exports, module) {
41325
- var { readdir: readdir16 } = __require("fs/promises");
41326
- var { join: join29 } = __require("path");
41806
+ var { readdir: readdir17 } = __require("fs/promises");
41807
+ var { join: join30 } = __require("path");
41327
41808
  var readdirScoped = /* @__PURE__ */ __name(async (dir) => {
41328
41809
  const results = [];
41329
- for (const item of await readdir16(dir)) {
41810
+ for (const item of await readdir17(dir)) {
41330
41811
  if (item.startsWith("@")) {
41331
- for (const scopedItem of await readdir16(join29(dir, item))) {
41332
- results.push(join29(item, scopedItem));
41812
+ for (const scopedItem of await readdir17(join30(dir, item))) {
41813
+ results.push(join30(item, scopedItem));
41333
41814
  }
41334
41815
  } else {
41335
41816
  results.push(item);
@@ -41344,7 +41825,7 @@ var require_readdir_scoped = __commonJS({
41344
41825
  // ../../node_modules/.pnpm/@npmcli+fs@4.0.0/node_modules/@npmcli/fs/lib/move-file.js
41345
41826
  var require_move_file = __commonJS({
41346
41827
  "../../node_modules/.pnpm/@npmcli+fs@4.0.0/node_modules/@npmcli/fs/lib/move-file.js"(exports, module) {
41347
- var { dirname: dirname16, join: join29, resolve: resolve28, relative: relative25, isAbsolute: isAbsolute21 } = __require("path");
41828
+ var { dirname: dirname16, join: join30, resolve: resolve29, relative: relative26, isAbsolute: isAbsolute22 } = __require("path");
41348
41829
  var fs = __require("fs/promises");
41349
41830
  var pathExists2 = /* @__PURE__ */ __name(async (path3) => {
41350
41831
  try {
@@ -41374,7 +41855,7 @@ var require_move_file = __commonJS({
41374
41855
  if (sourceStat.isDirectory()) {
41375
41856
  const files = await fs.readdir(source);
41376
41857
  await Promise.all(files.map(
41377
- (file) => moveFile(join29(source, file), join29(destination, file), options, false, symlinks)
41858
+ (file) => moveFile(join30(source, file), join30(destination, file), options, false, symlinks)
41378
41859
  ));
41379
41860
  } else if (sourceStat.isSymbolicLink()) {
41380
41861
  symlinks.push({ source, destination });
@@ -41388,12 +41869,12 @@ var require_move_file = __commonJS({
41388
41869
  if (root) {
41389
41870
  await Promise.all(symlinks.map(async ({ source: symSource, destination: symDestination }) => {
41390
41871
  let target = await fs.readlink(symSource);
41391
- if (isAbsolute21(target)) {
41392
- target = resolve28(symDestination, relative25(symSource, target));
41872
+ if (isAbsolute22(target)) {
41873
+ target = resolve29(symDestination, relative26(symSource, target));
41393
41874
  }
41394
41875
  let targetStat = "file";
41395
41876
  try {
41396
- targetStat = await fs.stat(resolve28(dirname16(symSource), target));
41877
+ targetStat = await fs.stat(resolve29(dirname16(symSource), target));
41397
41878
  if (targetStat.isDirectory()) {
41398
41879
  targetStat = "junction";
41399
41880
  }
@@ -41466,7 +41947,7 @@ async function pMap(iterable, mapper, {
41466
41947
  const cleanup = /* @__PURE__ */ __name(() => {
41467
41948
  signal?.removeEventListener("abort", signalListener);
41468
41949
  }, "cleanup");
41469
- const resolve28 = /* @__PURE__ */ __name((value) => {
41950
+ const resolve29 = /* @__PURE__ */ __name((value) => {
41470
41951
  resolve_(value);
41471
41952
  cleanup();
41472
41953
  }, "resolve");
@@ -41498,7 +41979,7 @@ async function pMap(iterable, mapper, {
41498
41979
  }
41499
41980
  isResolved = true;
41500
41981
  if (skippedIndexesMap.size === 0) {
41501
- resolve28(result);
41982
+ resolve29(result);
41502
41983
  return;
41503
41984
  }
41504
41985
  const pureResult = [];
@@ -41508,7 +41989,7 @@ async function pMap(iterable, mapper, {
41508
41989
  }
41509
41990
  pureResult.push(value);
41510
41991
  }
41511
- resolve28(pureResult);
41992
+ resolve29(pureResult);
41512
41993
  }
41513
41994
  return;
41514
41995
  }
@@ -41649,7 +42130,7 @@ var require_entry_index = __commonJS({
41649
42130
  appendFile,
41650
42131
  mkdir: mkdir18,
41651
42132
  readFile: readFile33,
41652
- readdir: readdir16,
42133
+ readdir: readdir17,
41653
42134
  rm: rm10,
41654
42135
  writeFile: writeFile11
41655
42136
  } = __require("fs/promises");
@@ -41909,7 +42390,7 @@ ${hashEntry(stringified)} ${stringified}`);
41909
42390
  }
41910
42391
  __name(formatEntry, "formatEntry");
41911
42392
  function readdirOrEmpty(dir) {
41912
- return readdir16(dir).catch((err) => {
42393
+ return readdir17(dir).catch((err) => {
41913
42394
  if (err.code === "ENOENT" || err.code === "ENOTDIR") {
41914
42395
  return [];
41915
42396
  }
@@ -45714,9 +46195,9 @@ var require_commonjs5 = __commonJS({
45714
46195
  if (this.#asyncReaddirInFlight) {
45715
46196
  await this.#asyncReaddirInFlight;
45716
46197
  } else {
45717
- let resolve28 = /* @__PURE__ */ __name(() => {
46198
+ let resolve29 = /* @__PURE__ */ __name(() => {
45718
46199
  }, "resolve");
45719
- this.#asyncReaddirInFlight = new Promise((res) => resolve28 = res);
46200
+ this.#asyncReaddirInFlight = new Promise((res) => resolve29 = res);
45720
46201
  try {
45721
46202
  for (const e of await this.#fs.promises.readdir(fullpath, {
45722
46203
  withFileTypes: true
@@ -45729,7 +46210,7 @@ var require_commonjs5 = __commonJS({
45729
46210
  children.provisional = 0;
45730
46211
  }
45731
46212
  this.#asyncReaddirInFlight = void 0;
45732
- resolve28();
46213
+ resolve29();
45733
46214
  }
45734
46215
  return children.slice(0, children.provisional);
45735
46216
  }
@@ -45971,7 +46452,7 @@ var require_commonjs5 = __commonJS({
45971
46452
  *
45972
46453
  * @internal
45973
46454
  */
45974
- constructor(cwd = process.cwd(), pathImpl, sep6, { nocase, childrenCacheSize = 16 * 1024, fs = defaultFS } = {}) {
46455
+ constructor(cwd = process.cwd(), pathImpl, sep7, { nocase, childrenCacheSize = 16 * 1024, fs = defaultFS } = {}) {
45975
46456
  this.#fs = fsFromOption(fs);
45976
46457
  if (cwd instanceof URL || cwd.startsWith("file://")) {
45977
46458
  cwd = (0, node_url_1.fileURLToPath)(cwd);
@@ -45982,7 +46463,7 @@ var require_commonjs5 = __commonJS({
45982
46463
  this.#resolveCache = new ResolveCache();
45983
46464
  this.#resolvePosixCache = new ResolveCache();
45984
46465
  this.#children = new ChildrenCache(childrenCacheSize);
45985
- const split = cwdPath.substring(this.rootPath.length).split(sep6);
46466
+ const split = cwdPath.substring(this.rootPath.length).split(sep7);
45986
46467
  if (split.length === 1 && !split[0]) {
45987
46468
  split.pop();
45988
46469
  }
@@ -46840,10 +47321,10 @@ var require_ignore = __commonJS({
46840
47321
  ignored(p) {
46841
47322
  const fullpath = p.fullpath();
46842
47323
  const fullpaths = `${fullpath}/`;
46843
- const relative25 = p.relative() || ".";
46844
- const relatives = `${relative25}/`;
47324
+ const relative26 = p.relative() || ".";
47325
+ const relatives = `${relative26}/`;
46845
47326
  for (const m of this.relative) {
46846
- if (m.match(relative25) || m.match(relatives))
47327
+ if (m.match(relative26) || m.match(relatives))
46847
47328
  return true;
46848
47329
  }
46849
47330
  for (const m of this.absolute) {
@@ -46854,9 +47335,9 @@ var require_ignore = __commonJS({
46854
47335
  }
46855
47336
  childrenIgnored(p) {
46856
47337
  const fullpath = p.fullpath() + "/";
46857
- const relative25 = (p.relative() || ".") + "/";
47338
+ const relative26 = (p.relative() || ".") + "/";
46858
47339
  for (const m of this.relativeChildren) {
46859
- if (m.match(relative25))
47340
+ if (m.match(relative26))
46860
47341
  return true;
46861
47342
  }
46862
47343
  for (const m of this.absoluteChildren) {
@@ -47947,8 +48428,8 @@ var require_verify = __commonJS({
47947
48428
  liveContent.add(integrity[algo].toString());
47948
48429
  }
47949
48430
  });
47950
- await new Promise((resolve28, reject) => {
47951
- indexStream.on("end", resolve28).on("error", reject);
48431
+ await new Promise((resolve29, reject) => {
48432
+ indexStream.on("end", resolve29).on("error", reject);
47952
48433
  });
47953
48434
  const contentDir = contentPath.contentDir(cache);
47954
48435
  const files = await glob(path3.join(contentDir, "**"), {
@@ -48504,7 +48985,7 @@ var require_promise_retry = __commonJS({
48504
48985
  fn = temp;
48505
48986
  }
48506
48987
  operation = retry.operation(options);
48507
- return new Promise(function(resolve28, reject) {
48988
+ return new Promise(function(resolve29, reject) {
48508
48989
  operation.attempt(function(number) {
48509
48990
  Promise.resolve().then(function() {
48510
48991
  return fn(function(err) {
@@ -48513,7 +48994,7 @@ var require_promise_retry = __commonJS({
48513
48994
  }
48514
48995
  throw errcode(new Error("Retrying"), "EPROMISERETRY", { retried: err });
48515
48996
  }, number);
48516
- }).then(resolve28, function(err) {
48997
+ }).then(resolve29, function(err) {
48517
48998
  if (isRetryError(err)) {
48518
48999
  err = err.retried;
48519
49000
  if (operation.retry(err || new Error())) {
@@ -49398,8 +49879,8 @@ var require_helpers = __commonJS({
49398
49879
  function req(url, opts = {}) {
49399
49880
  const href = typeof url === "string" ? url : url.href;
49400
49881
  const req2 = (href.startsWith("https:") ? https : http).request(url, opts);
49401
- const promise = new Promise((resolve28, reject) => {
49402
- req2.once("response", resolve28).once("error", reject).end();
49882
+ const promise = new Promise((resolve29, reject) => {
49883
+ req2.once("response", resolve29).once("error", reject).end();
49403
49884
  });
49404
49885
  req2.then = promise.then.bind(promise);
49405
49886
  return req2;
@@ -49714,7 +50195,7 @@ var require_parse_proxy_response = __commonJS({
49714
50195
  var debug_1 = __importDefault(require_src());
49715
50196
  var debug = (0, debug_1.default)("https-proxy-agent:parse-proxy-response");
49716
50197
  function parseProxyResponse(socket) {
49717
- return new Promise((resolve28, reject) => {
50198
+ return new Promise((resolve29, reject) => {
49718
50199
  let buffersLength = 0;
49719
50200
  const buffers = [];
49720
50201
  function read() {
@@ -49784,7 +50265,7 @@ var require_parse_proxy_response = __commonJS({
49784
50265
  }
49785
50266
  debug("got proxy server response: %o %o", firstLine, headers);
49786
50267
  cleanup();
49787
- resolve28({
50268
+ resolve29({
49788
50269
  connect: {
49789
50270
  statusCode,
49790
50271
  statusText,
@@ -53463,12 +53944,12 @@ var require_socksclient = __commonJS({
53463
53944
  "use strict";
53464
53945
  var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
53465
53946
  function adopt(value) {
53466
- return value instanceof P ? value : new P(function(resolve28) {
53467
- resolve28(value);
53947
+ return value instanceof P ? value : new P(function(resolve29) {
53948
+ resolve29(value);
53468
53949
  });
53469
53950
  }
53470
53951
  __name(adopt, "adopt");
53471
- return new (P || (P = Promise))(function(resolve28, reject) {
53952
+ return new (P || (P = Promise))(function(resolve29, reject) {
53472
53953
  function fulfilled(value) {
53473
53954
  try {
53474
53955
  step(generator.next(value));
@@ -53486,7 +53967,7 @@ var require_socksclient = __commonJS({
53486
53967
  }
53487
53968
  __name(rejected, "rejected");
53488
53969
  function step(result) {
53489
- result.done ? resolve28(result.value) : adopt(result.value).then(fulfilled, rejected);
53970
+ result.done ? resolve29(result.value) : adopt(result.value).then(fulfilled, rejected);
53490
53971
  }
53491
53972
  __name(step, "step");
53492
53973
  step((generator = generator.apply(thisArg, _arguments || [])).next());
@@ -53524,13 +54005,13 @@ var require_socksclient = __commonJS({
53524
54005
  * @returns { Promise }
53525
54006
  */
53526
54007
  static createConnection(options, callback) {
53527
- return new Promise((resolve28, reject) => {
54008
+ return new Promise((resolve29, reject) => {
53528
54009
  try {
53529
54010
  (0, helpers_1.validateSocksClientOptions)(options, ["connect"]);
53530
54011
  } catch (err) {
53531
54012
  if (typeof callback === "function") {
53532
54013
  callback(err);
53533
- return resolve28(err);
54014
+ return resolve29(err);
53534
54015
  } else {
53535
54016
  return reject(err);
53536
54017
  }
@@ -53541,16 +54022,16 @@ var require_socksclient = __commonJS({
53541
54022
  client.removeAllListeners();
53542
54023
  if (typeof callback === "function") {
53543
54024
  callback(null, info);
53544
- resolve28(info);
54025
+ resolve29(info);
53545
54026
  } else {
53546
- resolve28(info);
54027
+ resolve29(info);
53547
54028
  }
53548
54029
  });
53549
54030
  client.once("error", (err) => {
53550
54031
  client.removeAllListeners();
53551
54032
  if (typeof callback === "function") {
53552
54033
  callback(err);
53553
- resolve28(err);
54034
+ resolve29(err);
53554
54035
  } else {
53555
54036
  reject(err);
53556
54037
  }
@@ -53567,13 +54048,13 @@ var require_socksclient = __commonJS({
53567
54048
  * @returns { Promise }
53568
54049
  */
53569
54050
  static createConnectionChain(options, callback) {
53570
- return new Promise((resolve28, reject) => __awaiter(this, void 0, void 0, function* () {
54051
+ return new Promise((resolve29, reject) => __awaiter(this, void 0, void 0, function* () {
53571
54052
  try {
53572
54053
  (0, helpers_1.validateSocksClientChainOptions)(options);
53573
54054
  } catch (err) {
53574
54055
  if (typeof callback === "function") {
53575
54056
  callback(err);
53576
- return resolve28(err);
54057
+ return resolve29(err);
53577
54058
  } else {
53578
54059
  return reject(err);
53579
54060
  }
@@ -53599,14 +54080,14 @@ var require_socksclient = __commonJS({
53599
54080
  }
53600
54081
  if (typeof callback === "function") {
53601
54082
  callback(null, { socket: sock });
53602
- resolve28({ socket: sock });
54083
+ resolve29({ socket: sock });
53603
54084
  } else {
53604
- resolve28({ socket: sock });
54085
+ resolve29({ socket: sock });
53605
54086
  }
53606
54087
  } catch (err) {
53607
54088
  if (typeof callback === "function") {
53608
54089
  callback(err);
53609
- resolve28(err);
54090
+ resolve29(err);
53610
54091
  } else {
53611
54092
  reject(err);
53612
54093
  }
@@ -54294,12 +54775,12 @@ var require_dist6 = __commonJS({
54294
54775
  let { host } = opts;
54295
54776
  const { port, lookup: lookupFn = dns.lookup } = opts;
54296
54777
  if (shouldLookup) {
54297
- host = await new Promise((resolve28, reject) => {
54778
+ host = await new Promise((resolve29, reject) => {
54298
54779
  lookupFn(host, {}, (err, res) => {
54299
54780
  if (err) {
54300
54781
  reject(err);
54301
54782
  } else {
54302
- resolve28(res);
54783
+ resolve29(res);
54303
54784
  }
54304
54785
  });
54305
54786
  });
@@ -55111,8 +55592,8 @@ var require_entry = __commonJS({
55111
55592
  let body = null;
55112
55593
  if (this.response.status === 200) {
55113
55594
  let cacheWriteResolve, cacheWriteReject;
55114
- const cacheWritePromise = new Promise((resolve28, reject) => {
55115
- cacheWriteResolve = resolve28;
55595
+ const cacheWritePromise = new Promise((resolve29, reject) => {
55596
+ cacheWriteResolve = resolve29;
55116
55597
  cacheWriteReject = reject;
55117
55598
  }).catch((err) => {
55118
55599
  body.emit("error", err);
@@ -56627,9 +57108,9 @@ var require_index_min = __commonJS({
56627
57108
  var require_lib17 = __commonJS({
56628
57109
  "../../node_modules/.pnpm/which@5.0.0/node_modules/which/lib/index.js"(exports, module) {
56629
57110
  var { isexe, sync: isexeSync } = require_index_min();
56630
- var { join: join29, delimiter, sep: sep6, posix: posix3 } = __require("path");
57111
+ var { join: join30, delimiter, sep: sep7, posix: posix3 } = __require("path");
56631
57112
  var isWindows = process.platform === "win32";
56632
- var rSlash = new RegExp(`[${posix3.sep}${sep6 === posix3.sep ? "" : sep6}]`.replace(/(\\)/g, "\\$1"));
57113
+ var rSlash = new RegExp(`[${posix3.sep}${sep7 === posix3.sep ? "" : sep7}]`.replace(/(\\)/g, "\\$1"));
56633
57114
  var rRel = new RegExp(`^\\.${rSlash.source}`);
56634
57115
  var getNotFoundError = /* @__PURE__ */ __name((cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" }), "getNotFoundError");
56635
57116
  var getPathInfo = /* @__PURE__ */ __name((cmd, {
@@ -56656,7 +57137,7 @@ var require_lib17 = __commonJS({
56656
57137
  var getPathPart = /* @__PURE__ */ __name((raw, cmd) => {
56657
57138
  const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw;
56658
57139
  const prefix = !pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "";
56659
- return prefix + join29(pathPart, cmd);
57140
+ return prefix + join30(pathPart, cmd);
56660
57141
  }, "getPathPart");
56661
57142
  var which = /* @__PURE__ */ __name(async (cmd, opt = {}) => {
56662
57143
  const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
@@ -56779,9 +57260,9 @@ var require_lib18 = __commonJS({
56779
57260
  if (opts.shell) {
56780
57261
  return spawnWithShell(cmd, args2, opts, extra);
56781
57262
  }
56782
- let resolve28, reject;
57263
+ let resolve29, reject;
56783
57264
  const promise = new Promise((_resolve, _reject) => {
56784
- resolve28 = _resolve;
57265
+ resolve29 = _resolve;
56785
57266
  reject = _reject;
56786
57267
  });
56787
57268
  const closeError = new Error("command failed");
@@ -56814,7 +57295,7 @@ var require_lib18 = __commonJS({
56814
57295
  if (code || signal) {
56815
57296
  rejectWithOpts(closeError, { code, signal });
56816
57297
  } else {
56817
- resolve28(getResult({ code, signal }));
57298
+ resolve29(getResult({ code, signal }));
56818
57299
  }
56819
57300
  });
56820
57301
  return promise;
@@ -57795,7 +58276,7 @@ var require_lib19 = __commonJS({
57795
58276
  // ../../node_modules/.pnpm/npm-normalize-package-bin@4.0.0/node_modules/npm-normalize-package-bin/lib/index.js
57796
58277
  var require_lib20 = __commonJS({
57797
58278
  "../../node_modules/.pnpm/npm-normalize-package-bin@4.0.0/node_modules/npm-normalize-package-bin/lib/index.js"(exports, module) {
57798
- var { join: join29, basename: basename11 } = __require("path");
58279
+ var { join: join30, basename: basename11 } = __require("path");
57799
58280
  var normalize4 = /* @__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");
57800
58281
  var normalizeString = /* @__PURE__ */ __name((pkg) => {
57801
58282
  if (!pkg.name) {
@@ -57820,11 +58301,11 @@ var require_lib20 = __commonJS({
57820
58301
  const clean = {};
57821
58302
  let hasBins = false;
57822
58303
  Object.keys(orig).forEach((binKey) => {
57823
- const base = join29("/", basename11(binKey.replace(/\\|:/g, "/"))).slice(1);
58304
+ const base = join30("/", basename11(binKey.replace(/\\|:/g, "/"))).slice(1);
57824
58305
  if (typeof orig[binKey] !== "string" || !base) {
57825
58306
  return;
57826
58307
  }
57827
- const binTarget = join29("/", orig[binKey].replace(/\\/g, "/")).replace(/\\/g, "/").slice(1);
58308
+ const binTarget = join30("/", orig[binKey].replace(/\\/g, "/")).replace(/\\/g, "/").slice(1);
57828
58309
  if (!binTarget) {
57829
58310
  return;
57830
58311
  }
@@ -60503,7 +60984,7 @@ var require_sort2 = __commonJS({
60503
60984
  var require_lib23 = __commonJS({
60504
60985
  "../../node_modules/.pnpm/@npmcli+package-json@6.2.0/node_modules/@npmcli/package-json/lib/index.js"(exports, module) {
60505
60986
  var { readFile: readFile33, writeFile: writeFile11 } = __require("node:fs/promises");
60506
- var { resolve: resolve28 } = __require("node:path");
60987
+ var { resolve: resolve29 } = __require("node:path");
60507
60988
  var parseJSON = require_lib16();
60508
60989
  var updateDeps = require_update_dependencies();
60509
60990
  var updateScripts = require_update_scripts();
@@ -60626,7 +61107,7 @@ var require_lib23 = __commonJS({
60626
61107
  parseErr = err;
60627
61108
  }
60628
61109
  if (parseErr) {
60629
- const indexFile = resolve28(this.path, "index.js");
61110
+ const indexFile = resolve29(this.path, "index.js");
60630
61111
  let indexFileContent;
60631
61112
  try {
60632
61113
  indexFileContent = await readFile33(indexFile, "utf8");
@@ -60678,7 +61159,7 @@ var require_lib23 = __commonJS({
60678
61159
  }
60679
61160
  get filename() {
60680
61161
  if (this.path) {
60681
- return resolve28(this.path, "package.json");
61162
+ return resolve29(this.path, "package.json");
60682
61163
  }
60683
61164
  return void 0;
60684
61165
  }
@@ -67604,12 +68085,12 @@ var require_fetcher = __commonJS({
67604
68085
  };
67605
68086
  exports.DefaultFetcher = DefaultFetcher;
67606
68087
  var writeBufferToStream = /* @__PURE__ */ __name(async (stream, buffer) => {
67607
- return new Promise((resolve28, reject) => {
68088
+ return new Promise((resolve29, reject) => {
67608
68089
  stream.write(buffer, (err) => {
67609
68090
  if (err) {
67610
68091
  reject(err);
67611
68092
  }
67612
- resolve28(true);
68093
+ resolve29(true);
67613
68094
  });
67614
68095
  });
67615
68096
  }, "writeBufferToStream");
@@ -67828,12 +68309,12 @@ var require_url = __commonJS({
67828
68309
  "../../node_modules/.pnpm/tuf-js@3.1.0/node_modules/tuf-js/dist/utils/url.js"(exports) {
67829
68310
  "use strict";
67830
68311
  Object.defineProperty(exports, "__esModule", { value: true });
67831
- exports.join = join29;
68312
+ exports.join = join30;
67832
68313
  var url_1 = __require("url");
67833
- function join29(base, path3) {
68314
+ function join30(base, path3) {
67834
68315
  return new url_1.URL(ensureTrailingSlash(base) + removeLeadingSlash(path3)).toString();
67835
68316
  }
67836
- __name(join29, "join");
68317
+ __name(join30, "join");
67837
68318
  function ensureTrailingSlash(path3) {
67838
68319
  return path3.endsWith("/") ? path3 : path3 + "/";
67839
68320
  }
@@ -68212,7 +68693,7 @@ var require_target = __commonJS({
68212
68693
  var error_1 = require_error8();
68213
68694
  async function readTarget(tuf, targetPath) {
68214
68695
  const path3 = await getTargetPath(tuf, targetPath);
68215
- return new Promise((resolve28, reject) => {
68696
+ return new Promise((resolve29, reject) => {
68216
68697
  fs_1.default.readFile(path3, "utf-8", (err, data) => {
68217
68698
  if (err) {
68218
68699
  reject(new error_1.TUFError({
@@ -68221,7 +68702,7 @@ var require_target = __commonJS({
68221
68702
  cause: err
68222
68703
  }));
68223
68704
  } else {
68224
- resolve28(data);
68705
+ resolve29(data);
68225
68706
  }
68226
68707
  });
68227
68708
  });
@@ -70470,9 +70951,9 @@ import { createHash as createHash9, randomUUID } from "node:crypto";
70470
70951
  import { execFile as execFileCb7, spawn as spawn3 } from "node:child_process";
70471
70952
  import { gunzipSync } from "node:zlib";
70472
70953
  import { promisify as promisify7 } from "node:util";
70473
- import { dirname as dirname8, isAbsolute as isAbsolute13, join as join14, relative as relative16, resolve as resolve18 } from "node:path";
70954
+ import { dirname as dirname8, isAbsolute as isAbsolute14, join as join15, relative as relative17, resolve as resolve19 } from "node:path";
70474
70955
  import { constants as fsConstants4 } from "node:fs";
70475
- import { chmod as chmod3, lstat as lstat11, mkdtemp as mkdtemp3, open as open6, readFile as readFile16, realpath as realpath10, rm as rm6 } from "node:fs/promises";
70956
+ import { chmod as chmod3, lstat as lstat12, mkdtemp as mkdtemp3, open as open6, readFile as readFile16, realpath as realpath11, rm as rm6 } from "node:fs/promises";
70476
70957
  function validatePackageName(value) {
70477
70958
  if (typeof value !== "string" || value.length > 214 || !SAFE_PACKAGE_NAME.test(value)) {
70478
70959
  throw new Error("npm package must be a safe lowercase package name or @scope/name");
@@ -70549,7 +71030,7 @@ async function defaultResolveAuthToken({ registry, cwd, exec, env = process.env
70549
71030
  if (env[name]) candidates.push(env[name]);
70550
71031
  }
70551
71032
  const key = registryTokenKey(registry);
70552
- candidates.push(...await tokensFromNpmrc(join14(cwd, ".npmrc"), key, env));
71033
+ candidates.push(...await tokensFromNpmrc(join15(cwd, ".npmrc"), key, env));
70553
71034
  const npmUserConfigKey = ["npm", "config", "userconfig"].join("_");
70554
71035
  const userConfig = env[npmUserConfigKey] ?? (await exec("npm", ["config", "get", "userconfig"], { cwd, shell: false })).stdout.trim();
70555
71036
  if (userConfig) candidates.push(...await tokensFromNpmrc(userConfig, key, env));
@@ -70578,10 +71059,10 @@ async function defaultWhoamiWithToken({ registry, token, cwd, exec }) {
70578
71059
  }
70579
71060
  function resolvePackageCwd(cwd, root) {
70580
71061
  if (!cwd || typeof cwd !== "string") throw new Error("NPM_PUBLISH requires a non-empty action.cwd (package directory)");
70581
- const rootPath = resolve18(root);
70582
- const packagePath = resolve18(root, cwd);
70583
- const rel = relative16(rootPath, packagePath);
70584
- if (isAbsolute13(rel) || rel === ".." || rel.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`)) {
71062
+ const rootPath = resolve19(root);
71063
+ const packagePath = resolve19(root, cwd);
71064
+ const rel = relative17(rootPath, packagePath);
71065
+ if (isAbsolute14(rel) || rel === ".." || rel.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`)) {
70585
71066
  throw new Error(`cwd "${cwd}" is outside project root "${root}"`);
70586
71067
  }
70587
71068
  return packagePath;
@@ -70594,15 +71075,15 @@ ${error?.message ?? ""}`;
70594
71075
  return /\bE404\b|\b404\b.*not found|not found.*\b404\b/i.test(text);
70595
71076
  }
70596
71077
  async function readVerifiedTarballBytes(action, root) {
70597
- if (!action.tarballPath || isAbsolute13(action.tarballPath)) throw new Error("tarballPath must be project-relative");
71078
+ if (!action.tarballPath || isAbsolute14(action.tarballPath)) throw new Error("tarballPath must be project-relative");
70598
71079
  if (!/^[a-f0-9]{64}$/.test(action.tarballSha256 ?? "")) throw new Error("tarballSha256 must be a lowercase SHA-256 digest");
70599
- const rootReal = await realpath10(root);
70600
- const lexical = resolve18(rootReal, action.tarballPath);
70601
- const rel = relative16(rootReal, lexical);
70602
- if (isAbsolute13(rel) || rel === ".." || rel.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`)) {
71080
+ const rootReal = await realpath11(root);
71081
+ const lexical = resolve19(rootReal, action.tarballPath);
71082
+ const rel = relative17(rootReal, lexical);
71083
+ if (isAbsolute14(rel) || rel === ".." || rel.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`)) {
70603
71084
  throw new Error("tarballPath escapes project root");
70604
71085
  }
70605
- const before = await lstat11(lexical);
71086
+ const before = await lstat12(lexical);
70606
71087
  if (!before.isFile() || before.isSymbolicLink() || before.nlink !== 1) {
70607
71088
  throw new Error("frozen tarball must be a single-link regular file");
70608
71089
  }
@@ -70895,7 +71376,7 @@ function createNpmAdapter(deps = {}) {
70895
71376
  throw new Error("npm bearer authentication does not match the frozen registry and publisher");
70896
71377
  }
70897
71378
  if (typeof beforeBufferPublishHook === "function") {
70898
- await beforeBufferPublishHook(resolve18(context.root, action.tarballPath));
71379
+ await beforeBufferPublishHook(resolve19(context.root, action.tarballPath));
70899
71380
  }
70900
71381
  try {
70901
71382
  await publishTarballBuffer({
@@ -71061,11 +71542,11 @@ var init_npm = __esm({
71061
71542
  });
71062
71543
 
71063
71544
  // src/core/run.mjs
71064
- import { link as link2, lstat as lstat12, mkdir as mkdir9, open as open7, readFile as readFile17, unlink as unlink3 } from "node:fs/promises";
71545
+ import { link as link2, lstat as lstat13, mkdir as mkdir9, open as open7, readFile as readFile17, unlink as unlink3 } from "node:fs/promises";
71065
71546
  import { realpathSync as realpathSync3 } from "node:fs";
71066
- import { dirname as dirname9, join as join15, resolve as resolve19, basename as basename4, relative as relative17, isAbsolute as isAbsolute14 } from "node:path";
71547
+ import { dirname as dirname9, join as join16, resolve as resolve20, basename as basename4, relative as relative18, isAbsolute as isAbsolute15 } from "node:path";
71067
71548
  function resolveDefaultRunDir(planPath, command2, runId = `${command2}-${Date.now()}`) {
71068
- const absolute = resolve19(planPath);
71549
+ const absolute = resolve20(planPath);
71069
71550
  const fileName = basename4(absolute);
71070
71551
  const parentDir = dirname9(absolute);
71071
71552
  if (fileName === "release-plan.json") {
@@ -71073,7 +71554,7 @@ function resolveDefaultRunDir(planPath, command2, runId = `${command2}-${Date.no
71073
71554
  }
71074
71555
  if (basename4(parentDir) === "plans") {
71075
71556
  const releaseDir = dirname9(parentDir);
71076
- return join15(releaseDir, "runs", runId);
71557
+ return join16(releaseDir, "runs", runId);
71077
71558
  }
71078
71559
  return `${parentDir}/runs/${runId}`;
71079
71560
  }
@@ -71138,7 +71619,7 @@ async function loadRun(runPath, options = {}) {
71138
71619
  return run5;
71139
71620
  }
71140
71621
  function assertImmutableRunAuthority(runPath, planPath, run5) {
71141
- const absolutePlan = realpathSync3(resolve19(planPath));
71622
+ const absolutePlan = realpathSync3(resolve20(planPath));
71142
71623
  const planDir = dirname9(absolutePlan);
71143
71624
  if (basename4(planDir) !== "plans") {
71144
71625
  throw new ReleaseError(GATE_FAILED, "run authority requires an immutable plans/<digest>.json plan path");
@@ -71152,10 +71633,10 @@ function assertImmutableRunAuthority(runPath, planPath, run5) {
71152
71633
  }
71153
71634
  cursor = dirname9(cursor);
71154
71635
  }
71155
- const runsDir = join15(authorityRoot, "runs");
71156
- const absoluteRun = realpathSync3(resolve19(runPath));
71157
- const rel = relative17(runsDir, absoluteRun);
71158
- if (isAbsolute14(rel) || rel === ".." || rel.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`)) {
71636
+ const runsDir = join16(authorityRoot, "runs");
71637
+ const absoluteRun = realpathSync3(resolve20(runPath));
71638
+ const rel = relative18(runsDir, absoluteRun);
71639
+ if (isAbsolute15(rel) || rel === ".." || rel.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`)) {
71159
71640
  throw new ReleaseError(GATE_FAILED, "production run authority must be inside the plan sibling runs/ directory");
71160
71641
  }
71161
71642
  const fileName = basename4(absoluteRun);
@@ -71170,7 +71651,7 @@ function assertImmutableRunAuthority(runPath, planPath, run5) {
71170
71651
  }
71171
71652
  }
71172
71653
  async function createProductionRunDir(runDir, planPath) {
71173
- const absolutePlan = realpathSync3(resolve19(planPath));
71654
+ const absolutePlan = realpathSync3(resolve20(planPath));
71174
71655
  const planDir = dirname9(absolutePlan);
71175
71656
  if (basename4(planDir) !== "plans") {
71176
71657
  throw new ReleaseError(GATE_FAILED, "production run directory requires an immutable plans/<digest>.json authority");
@@ -71179,10 +71660,10 @@ async function createProductionRunDir(runDir, planPath) {
71179
71660
  return createProductionRunDirWithinAuthority(runDir, authorityRoot);
71180
71661
  }
71181
71662
  async function createProductionPrepareRunDir(runDir, releaseDir) {
71182
- const authorityRoot = resolve19(releaseDir);
71663
+ const authorityRoot = resolve20(releaseDir);
71183
71664
  let authorityStat;
71184
71665
  try {
71185
- authorityStat = await lstat12(authorityRoot);
71666
+ authorityStat = await lstat13(authorityRoot);
71186
71667
  } catch (error) {
71187
71668
  throw new ReleaseError(GATE_FAILED, "cannot inspect production .release-skill authority root", {
71188
71669
  releaseDir: authorityRoot,
@@ -71207,10 +71688,10 @@ async function createProductionPrepareRunDir(runDir, releaseDir) {
71207
71688
  return createProductionRunDirWithinAuthority(runDir, physicalAuthorityRoot);
71208
71689
  }
71209
71690
  async function createProductionRunDirWithinAuthority(runDir, authorityRoot) {
71210
- const runsDir = join15(authorityRoot, "runs");
71691
+ const runsDir = join16(authorityRoot, "runs");
71211
71692
  let runsStat;
71212
71693
  try {
71213
- runsStat = await lstat12(runsDir);
71694
+ runsStat = await lstat13(runsDir);
71214
71695
  } catch (error) {
71215
71696
  if (error.code !== "ENOENT") {
71216
71697
  throw new ReleaseError(GATE_FAILED, "cannot inspect production runs authority root", {
@@ -71228,7 +71709,7 @@ async function createProductionRunDirWithinAuthority(runDir, authorityRoot) {
71228
71709
  });
71229
71710
  }
71230
71711
  }
71231
- runsStat = await lstat12(runsDir);
71712
+ runsStat = await lstat13(runsDir);
71232
71713
  }
71233
71714
  if (runsStat.isSymbolicLink() || !runsStat.isDirectory()) {
71234
71715
  throw new ReleaseError(
@@ -71245,7 +71726,7 @@ async function createProductionRunDirWithinAuthority(runDir, authorityRoot) {
71245
71726
  { runsDir, physicalRunsDir }
71246
71727
  );
71247
71728
  }
71248
- const requested = resolve19(runDir);
71729
+ const requested = resolve20(runDir);
71249
71730
  let physicalParent;
71250
71731
  try {
71251
71732
  physicalParent = realpathSync3(dirname9(requested));
@@ -71263,7 +71744,7 @@ async function createProductionRunDirWithinAuthority(runDir, authorityRoot) {
71263
71744
  );
71264
71745
  }
71265
71746
  try {
71266
- await lstat12(requested);
71747
+ await lstat13(requested);
71267
71748
  throw new ReleaseError(GATE_FAILED, "production run directory already exists; authority directories cannot be reused", { runDir });
71268
71749
  } catch (error) {
71269
71750
  if (error instanceof ReleaseError) throw error;
@@ -71296,7 +71777,7 @@ async function validateStatePredecessorChain(run5, runPath, options = {}) {
71296
71777
  return;
71297
71778
  }
71298
71779
  let current = run5;
71299
- let currentPath = realpathSync3(resolve19(runPath));
71780
+ let currentPath = realpathSync3(resolve20(runPath));
71300
71781
  let traversed = 0;
71301
71782
  while (true) {
71302
71783
  const sequence = current.stateSequence;
@@ -71317,7 +71798,7 @@ async function validateStatePredecessorChain(run5, runPath, options = {}) {
71317
71798
  if (traversed > 1e5) {
71318
71799
  throw new ReleaseError(GATE_FAILED, "run state predecessor chain exceeds maximum depth");
71319
71800
  }
71320
- const previousPath = join15(dirname9(currentPath), `${String(sequence - 1).padStart(6, "0")}.json`);
71801
+ const previousPath = join16(dirname9(currentPath), `${String(sequence - 1).padStart(6, "0")}.json`);
71321
71802
  const previous = await loadRun(previousPath, {
71322
71803
  requireDigest: true,
71323
71804
  ...options.production ? { authorityPlanPath: options.planPath } : {}
@@ -71410,7 +71891,7 @@ function validateRunPlanDigest(run5, plan, options = {}) {
71410
71891
  { runDigest: run5.planDigest, planDigest: expectedDigest }
71411
71892
  );
71412
71893
  }
71413
- if (plan.production && run5.planPath && options.planPath && resolve19(run5.planPath) !== resolve19(options.planPath)) {
71894
+ if (plan.production && run5.planPath && options.planPath && resolve20(run5.planPath) !== resolve20(options.planPath)) {
71414
71895
  throw new ReleaseError(
71415
71896
  GATE_FAILED,
71416
71897
  "source run immutable plan path does not match the supplied plan authority",
@@ -71527,10 +72008,10 @@ async function appendRunState(runDir, sequence, run5) {
71527
72008
  if (!Number.isSafeInteger(sequence) || sequence < 0) {
71528
72009
  throw new ReleaseError(GATE_FAILED, "run state sequence must be a non-negative integer");
71529
72010
  }
71530
- const statesDir = join15(runDir, "states");
72011
+ const statesDir = join16(runDir, "states");
71531
72012
  let previousStateDigest;
71532
72013
  if (sequence > 0) {
71533
- const previousPath = join15(statesDir, `${String(sequence - 1).padStart(6, "0")}.json`);
72014
+ const previousPath = join16(statesDir, `${String(sequence - 1).padStart(6, "0")}.json`);
71534
72015
  const previous = await loadRun(previousPath, { requireDigest: true });
71535
72016
  if (previous.stateSequence !== sequence - 1 || previous.runId !== run5.runId || previous.command !== run5.command || previous.planDigest !== run5.planDigest) {
71536
72017
  throw new ReleaseError(
@@ -71547,7 +72028,7 @@ async function appendRunState(runDir, sequence, run5) {
71547
72028
  stateSequence: sequence,
71548
72029
  ...previousStateDigest ? { previousStateDigest } : {}
71549
72030
  });
71550
- const statePath = join15(statesDir, `${String(sequence).padStart(6, "0")}.json`);
72031
+ const statePath = join16(statesDir, `${String(sequence).padStart(6, "0")}.json`);
71551
72032
  await writeRunAtomic(statePath, state);
71552
72033
  return Object.freeze({ state, statePath });
71553
72034
  }
@@ -71599,8 +72080,8 @@ __export(plugin_marketplace_exports, {
71599
72080
  });
71600
72081
  import { execFile as execFileCb8 } from "node:child_process";
71601
72082
  import { promisify as promisify8 } from "node:util";
71602
- import { readFile as readFile18, stat as stat4, mkdir as mkdir10, readdir as readdir10, realpath as realpath11, lstat as lstat13 } from "node:fs/promises";
71603
- import { join as join16, resolve as resolve20, relative as relative18, isAbsolute as isAbsolute15, basename as basename5 } from "node:path";
72083
+ import { readFile as readFile18, stat as stat4, mkdir as mkdir10, readdir as readdir11, realpath as realpath12, lstat as lstat14 } from "node:fs/promises";
72084
+ import { join as join17, resolve as resolve21, relative as relative19, isAbsolute as isAbsolute16, basename as basename5 } from "node:path";
71604
72085
  import { createHash as createHash10 } from "node:crypto";
71605
72086
  function transportPayload(entries) {
71606
72087
  return entries.map(({ path: path3, type, mode, size, contentDigest }) => ({
@@ -71668,21 +72149,21 @@ async function resolvePluginManifestFromMarketplaceEntrySource(marketIndex, plug
71668
72149
  }
71669
72150
  const entry = matches[0];
71670
72151
  const sourcePath = extractDeclaredPluginSource(platform.id, entry);
71671
- const snapshotDirReal = await realpath11(snapshotDir).catch(() => snapshotDir);
71672
- const marketplaceRootAbs = marketplaceRootRel === "." ? snapshotDirReal : resolve20(snapshotDirReal, marketplaceRootRel);
71673
- const pluginRootAbs = resolve20(marketplaceRootAbs, sourcePath);
71674
- const pluginRootReal = await realpath11(pluginRootAbs).catch(() => null);
72152
+ const snapshotDirReal = await realpath12(snapshotDir).catch(() => snapshotDir);
72153
+ const marketplaceRootAbs = marketplaceRootRel === "." ? snapshotDirReal : resolve21(snapshotDirReal, marketplaceRootRel);
72154
+ const pluginRootAbs = resolve21(marketplaceRootAbs, sourcePath);
72155
+ const pluginRootReal = await realpath12(pluginRootAbs).catch(() => null);
71675
72156
  if (!pluginRootReal) {
71676
72157
  throw new Error(`marketplace plugin entry source "${sourcePath}" does not exist in snapshot`);
71677
72158
  }
71678
- const containment = relative18(snapshotDirReal, pluginRootReal);
71679
- const sep6 = process.platform === "win32" ? "\\" : "/";
71680
- if (containment !== "" && (isAbsolute15(containment) || containment === ".." || containment.startsWith(`..${sep6}`))) {
72159
+ const containment = relative19(snapshotDirReal, pluginRootReal);
72160
+ const sep7 = process.platform === "win32" ? "\\" : "/";
72161
+ if (containment !== "" && (isAbsolute16(containment) || containment === ".." || containment.startsWith(`..${sep7}`))) {
71681
72162
  throw new Error(`marketplace plugin entry source "${sourcePath}" escapes the snapshot after symlink resolution`);
71682
72163
  }
71683
72164
  const manifestRelative = platform.manifestPaths.plugin;
71684
- const manifestAbs = resolve20(pluginRootReal, manifestRelative);
71685
- const pluginRootRelToSnapshot = relative18(snapshotDirReal, pluginRootReal);
72165
+ const manifestAbs = resolve21(pluginRootReal, manifestRelative);
72166
+ const pluginRootRelToSnapshot = relative19(snapshotDirReal, pluginRootReal);
71686
72167
  const fullManifestRelative = pluginRootRelToSnapshot === "" ? manifestRelative : `${pluginRootRelToSnapshot}/${manifestRelative}`;
71687
72168
  let raw;
71688
72169
  try {
@@ -71717,7 +72198,7 @@ async function validateInstallationContractDigest(action, snapshotDirReal, platf
71717
72198
  includeMarketplaceEntry = hasMarketplacePath;
71718
72199
  if (includeMarketplaceEntry) {
71719
72200
  marketplaceIndexRelative = action.marketplaceIndexPath ?? platform.manifestPaths.marketplace;
71720
- const marketplacePath = resolve20(snapshotDirReal, marketplaceIndexRelative);
72201
+ const marketplacePath = resolve21(snapshotDirReal, marketplaceIndexRelative);
71721
72202
  const mkResult = await validateManifestFile(marketplacePath, ["name", "plugins"]);
71722
72203
  if (!mkResult.valid) {
71723
72204
  return { valid: false, error: `installationContractDigest \u9A8C\u8BC1\u5931\u8D25\uFF1A\u5E02\u573A\u7D22\u5F15\u8BFB\u53D6\u5931\u8D25\uFF1A${mkResult.error}` };
@@ -71763,7 +72244,7 @@ async function validateInstallationContractDigest(action, snapshotDirReal, platf
71763
72244
  pluginManifestRelative = readResult.manifestRelative ?? platform.manifestPaths.plugin;
71764
72245
  } else {
71765
72246
  pluginManifestRelative = platform.manifestPaths.plugin;
71766
- const pluginManifestPath = resolve20(snapshotDirReal, pluginManifestRelative);
72247
+ const pluginManifestPath = resolve21(snapshotDirReal, pluginManifestRelative);
71767
72248
  const manifestResult = await validateManifestFile(pluginManifestPath, ["name", "version"]);
71768
72249
  if (!manifestResult.valid) {
71769
72250
  return { valid: false, error: `installationContractDigest \u9A8C\u8BC1\u5931\u8D25\uFF1A\u63D2\u4EF6 manifest \u8BFB\u53D6\u5931\u8D25\uFF1A${manifestResult.error}` };
@@ -71800,7 +72281,7 @@ async function resolveInstalledPayloadSubpath(snapshotDir, sourceEntries, action
71800
72281
  if (!anchored) {
71801
72282
  throw new Error(`frozen snapshot is missing the marketplace manifest ${marketplaceRelative}`);
71802
72283
  }
71803
- const result = await validateManifestFile(resolve20(snapshotDir, marketplaceRelative), ["name", "plugins"]);
72284
+ const result = await validateManifestFile(resolve21(snapshotDir, marketplaceRelative), ["name", "plugins"]);
71804
72285
  if (!result.valid) {
71805
72286
  throw new Error(`frozen snapshot ${marketplaceRelative} invalid: ${result.error}`);
71806
72287
  }
@@ -71914,26 +72395,26 @@ async function resolveKimiEntrySkillFile(pluginRootReal, manifest, entrySkill) {
71914
72395
  }
71915
72396
  let entryAbs;
71916
72397
  if (manifest.skills === void 0 || manifest.skills === null) {
71917
- entryAbs = resolve20(pluginRootReal, "SKILL.md");
72398
+ entryAbs = resolve21(pluginRootReal, "SKILL.md");
71918
72399
  } else {
71919
72400
  const skillsRel = normalizeKimiSkillsRel(manifest.skills);
71920
- const skillsRootAbs = skillsRel === "" ? pluginRootReal : resolve20(pluginRootReal, skillsRel);
71921
- const skillsRootReal = await realpath11(skillsRootAbs).catch(() => null);
72401
+ const skillsRootAbs = skillsRel === "" ? pluginRootReal : resolve21(pluginRootReal, skillsRel);
72402
+ const skillsRootReal = await realpath12(skillsRootAbs).catch(() => null);
71922
72403
  if (!skillsRootReal) {
71923
72404
  throw new Error(`kimi manifest skills root does not exist: ${manifest.skills}`);
71924
72405
  }
71925
- const skillsContainment = relative18(pluginRootReal, skillsRootReal);
72406
+ const skillsContainment = relative19(pluginRootReal, skillsRootReal);
71926
72407
  const sepK = process.platform === "win32" ? "\\" : "/";
71927
- if (skillsContainment !== "" && (isAbsolute15(skillsContainment) || skillsContainment === ".." || skillsContainment.startsWith(`..${sepK}`))) {
72408
+ if (skillsContainment !== "" && (isAbsolute16(skillsContainment) || skillsContainment === ".." || skillsContainment.startsWith(`..${sepK}`))) {
71928
72409
  throw new Error(`kimi manifest skills "${manifest.skills}" escapes the plugin root after symlink resolution`);
71929
72410
  }
71930
- entryAbs = resolve20(skillsRootReal, entrySkill, "SKILL.md");
72411
+ entryAbs = resolve21(skillsRootReal, entrySkill, "SKILL.md");
71931
72412
  }
71932
72413
  let entryLexicalStat;
71933
72414
  try {
71934
- entryLexicalStat = await lstat13(entryAbs);
72415
+ entryLexicalStat = await lstat14(entryAbs);
71935
72416
  } catch {
71936
- throw new Error(`kimi entry skill not found: ${relative18(pluginRootReal, entryAbs) || "SKILL.md"}`);
72417
+ throw new Error(`kimi entry skill not found: ${relative19(pluginRootReal, entryAbs) || "SKILL.md"}`);
71937
72418
  }
71938
72419
  if (entryLexicalStat.isSymbolicLink()) {
71939
72420
  throw new Error("kimi entry skill must not be a symlink");
@@ -71941,13 +72422,13 @@ async function resolveKimiEntrySkillFile(pluginRootReal, manifest, entrySkill) {
71941
72422
  if (!entryLexicalStat.isFile()) {
71942
72423
  throw new Error("kimi entry skill is not a regular file");
71943
72424
  }
71944
- const entryReal = await realpath11(entryAbs).catch(() => null);
72425
+ const entryReal = await realpath12(entryAbs).catch(() => null);
71945
72426
  if (!entryReal) {
71946
- throw new Error(`kimi entry skill not found: ${relative18(pluginRootReal, entryAbs) || "SKILL.md"}`);
72427
+ throw new Error(`kimi entry skill not found: ${relative19(pluginRootReal, entryAbs) || "SKILL.md"}`);
71947
72428
  }
71948
- const entryContainment = relative18(pluginRootReal, entryReal);
72429
+ const entryContainment = relative19(pluginRootReal, entryReal);
71949
72430
  const sepE = process.platform === "win32" ? "\\" : "/";
71950
- if (entryContainment !== "" && (isAbsolute15(entryContainment) || entryContainment === ".." || entryContainment.startsWith(`..${sepE}`))) {
72431
+ if (entryContainment !== "" && (isAbsolute16(entryContainment) || entryContainment === ".." || entryContainment.startsWith(`..${sepE}`))) {
71951
72432
  throw new Error("kimi entry skill escapes the plugin root after symlink resolution");
71952
72433
  }
71953
72434
  return entryReal;
@@ -71985,26 +72466,26 @@ async function resolveCodeBuddyEntrySkillFile(pluginRootReal, manifest, entrySki
71985
72466
  }
71986
72467
  let entryAbs;
71987
72468
  if (manifest.skills === void 0 || manifest.skills === null) {
71988
- entryAbs = resolve20(pluginRootReal, "SKILL.md");
72469
+ entryAbs = resolve21(pluginRootReal, "SKILL.md");
71989
72470
  } else {
71990
72471
  const skillsRel = normalizeCodeBuddySkillsRel(manifest.skills);
71991
- const skillsRootAbs = skillsRel === "" ? pluginRootReal : resolve20(pluginRootReal, skillsRel);
71992
- const skillsRootReal = await realpath11(skillsRootAbs).catch(() => null);
72472
+ const skillsRootAbs = skillsRel === "" ? pluginRootReal : resolve21(pluginRootReal, skillsRel);
72473
+ const skillsRootReal = await realpath12(skillsRootAbs).catch(() => null);
71993
72474
  if (!skillsRootReal) {
71994
72475
  throw new Error(`codebuddy manifest skills root does not exist: ${manifest.skills}`);
71995
72476
  }
71996
- const skillsContainment = relative18(pluginRootReal, skillsRootReal);
72477
+ const skillsContainment = relative19(pluginRootReal, skillsRootReal);
71997
72478
  const sepK = process.platform === "win32" ? "\\" : "/";
71998
- if (skillsContainment !== "" && (isAbsolute15(skillsContainment) || skillsContainment === ".." || skillsContainment.startsWith(`..${sepK}`))) {
72479
+ if (skillsContainment !== "" && (isAbsolute16(skillsContainment) || skillsContainment === ".." || skillsContainment.startsWith(`..${sepK}`))) {
71999
72480
  throw new Error(`codebuddy manifest skills "${manifest.skills}" escapes the plugin root after symlink resolution`);
72000
72481
  }
72001
- entryAbs = resolve20(skillsRootReal, entrySkill, "SKILL.md");
72482
+ entryAbs = resolve21(skillsRootReal, entrySkill, "SKILL.md");
72002
72483
  }
72003
72484
  let entryLexicalStat;
72004
72485
  try {
72005
- entryLexicalStat = await lstat13(entryAbs);
72486
+ entryLexicalStat = await lstat14(entryAbs);
72006
72487
  } catch {
72007
- throw new Error(`codebuddy entry skill not found: ${relative18(pluginRootReal, entryAbs) || "SKILL.md"}`);
72488
+ throw new Error(`codebuddy entry skill not found: ${relative19(pluginRootReal, entryAbs) || "SKILL.md"}`);
72008
72489
  }
72009
72490
  if (entryLexicalStat.isSymbolicLink()) {
72010
72491
  throw new Error("codebuddy entry skill must not be a symlink");
@@ -72012,13 +72493,13 @@ async function resolveCodeBuddyEntrySkillFile(pluginRootReal, manifest, entrySki
72012
72493
  if (!entryLexicalStat.isFile()) {
72013
72494
  throw new Error("codebuddy entry skill is not a regular file");
72014
72495
  }
72015
- const entryReal = await realpath11(entryAbs).catch(() => null);
72496
+ const entryReal = await realpath12(entryAbs).catch(() => null);
72016
72497
  if (!entryReal) {
72017
- throw new Error(`codebuddy entry skill not found: ${relative18(pluginRootReal, entryAbs) || "SKILL.md"}`);
72498
+ throw new Error(`codebuddy entry skill not found: ${relative19(pluginRootReal, entryAbs) || "SKILL.md"}`);
72018
72499
  }
72019
- const entryContainment = relative18(pluginRootReal, entryReal);
72500
+ const entryContainment = relative19(pluginRootReal, entryReal);
72020
72501
  const sepE = process.platform === "win32" ? "\\" : "/";
72021
- if (entryContainment !== "" && (isAbsolute15(entryContainment) || entryContainment === ".." || entryContainment.startsWith(`..${sepE}`))) {
72502
+ if (entryContainment !== "" && (isAbsolute16(entryContainment) || entryContainment === ".." || entryContainment.startsWith(`..${sepE}`))) {
72022
72503
  throw new Error("codebuddy entry skill escapes the plugin root after symlink resolution");
72023
72504
  }
72024
72505
  return entryReal;
@@ -72157,7 +72638,7 @@ async function checkRequiredFiles(dir, requiredFiles) {
72157
72638
  const missing = [];
72158
72639
  for (const file of requiredFiles) {
72159
72640
  try {
72160
- await stat4(resolve20(dir, file));
72641
+ await stat4(resolve21(dir, file));
72161
72642
  } catch {
72162
72643
  missing.push(file);
72163
72644
  }
@@ -72884,7 +73365,7 @@ function createPluginMarketplaceAdapter(deps = {}) {
72884
73365
  });
72885
73366
  }
72886
73367
  const externalManifestRelative = platform.manifestPaths.plugin;
72887
- const externalManifestPath = resolve20(snapshotDirReal, externalManifestRelative);
73368
+ const externalManifestPath = resolve21(snapshotDirReal, externalManifestRelative);
72888
73369
  const externalManifestResult = await validateManifestFile(externalManifestPath, ["name", "version"]);
72889
73370
  if (!externalManifestResult.valid) {
72890
73371
  return createResult({
@@ -72919,7 +73400,7 @@ function createPluginMarketplaceAdapter(deps = {}) {
72919
73400
  error: `marketplace root resolution failed: ${mktRootErr.message}`
72920
73401
  });
72921
73402
  }
72922
- const marketplacePath = resolve20(snapshotDirReal, marketplaceRelative);
73403
+ const marketplacePath = resolve21(snapshotDirReal, marketplaceRelative);
72923
73404
  const marketplaceResult = await validateManifestFile(marketplacePath, ["name"]);
72924
73405
  if (!marketplaceResult.valid) {
72925
73406
  return createResult({
@@ -72962,9 +73443,9 @@ function createPluginMarketplaceAdapter(deps = {}) {
72962
73443
  error: sourceErr.message
72963
73444
  });
72964
73445
  }
72965
- const mktRootAbs = mktRoot === "." ? snapshotDirReal : resolve20(snapshotDirReal, mktRoot);
72966
- const sourceDirAbs = resolve20(mktRootAbs, sourcePath);
72967
- sourceDirReal = await realpath11(sourceDirAbs).catch(() => null);
73446
+ const mktRootAbs = mktRoot === "." ? snapshotDirReal : resolve21(snapshotDirReal, mktRoot);
73447
+ const sourceDirAbs = resolve21(mktRootAbs, sourcePath);
73448
+ sourceDirReal = await realpath12(sourceDirAbs).catch(() => null);
72968
73449
  if (!sourceDirReal) {
72969
73450
  return createResult({
72970
73451
  actionType,
@@ -72972,8 +73453,8 @@ function createPluginMarketplaceAdapter(deps = {}) {
72972
73453
  error: `marketplace plugin entry source directory does not exist: ${sourcePath}`
72973
73454
  });
72974
73455
  }
72975
- const sourceRelCheck = relative18(snapshotDirReal, sourceDirReal);
72976
- if (sourceRelCheck.startsWith("..") || isAbsolute15(sourceRelCheck)) {
73456
+ const sourceRelCheck = relative19(snapshotDirReal, sourceDirReal);
73457
+ if (sourceRelCheck.startsWith("..") || isAbsolute16(sourceRelCheck)) {
72977
73458
  return createResult({
72978
73459
  actionType,
72979
73460
  status: ActionStatus.PREFLIGHT_FAILED,
@@ -72981,9 +73462,9 @@ function createPluginMarketplaceAdapter(deps = {}) {
72981
73462
  });
72982
73463
  }
72983
73464
  pluginRootForEntrySkill = sourceDirReal;
72984
- const pluginRootRelToSnapshot = relative18(snapshotDirReal, sourceDirReal) || ".";
73465
+ const pluginRootRelToSnapshot = relative19(snapshotDirReal, sourceDirReal) || ".";
72985
73466
  const manifestRelative = pluginRootRelToSnapshot === "." ? platform.manifestPaths.plugin : `${pluginRootRelToSnapshot}/${platform.manifestPaths.plugin}`;
72986
- const manifestPath = resolve20(snapshotDirReal, manifestRelative);
73467
+ const manifestPath = resolve21(snapshotDirReal, manifestRelative);
72987
73468
  const manifestResult = await validateManifestFile(manifestPath, ["name", "version"]);
72988
73469
  if (!manifestResult.valid) {
72989
73470
  return createResult({
@@ -73036,11 +73517,11 @@ function createPluginMarketplaceAdapter(deps = {}) {
73036
73517
  }
73037
73518
  } else {
73038
73519
  const pluginRootForSkill = pluginRootForEntrySkill || snapshotDirReal;
73039
- const entrySkillFile = resolve20(pluginRootForSkill, "skills", action.entrySkill, "SKILL.md");
73520
+ const entrySkillFile = resolve21(pluginRootForSkill, "skills", action.entrySkill, "SKILL.md");
73040
73521
  try {
73041
73522
  await stat4(entrySkillFile);
73042
73523
  } catch {
73043
- const skillRel = relative18(snapshotDirReal, entrySkillFile) || `skills/${action.entrySkill}/SKILL.md`;
73524
+ const skillRel = relative19(snapshotDirReal, entrySkillFile) || `skills/${action.entrySkill}/SKILL.md`;
73044
73525
  return createResult({
73045
73526
  actionType,
73046
73527
  status: ActionStatus.PREFLIGHT_FAILED,
@@ -73162,7 +73643,7 @@ function createPluginMarketplaceAdapter(deps = {}) {
73162
73643
  }
73163
73644
  if (action.entryPoint) {
73164
73645
  try {
73165
- await exec(process.execPath, ["--check", resolve20(pluginDir, action.entryPoint)]);
73646
+ await exec(process.execPath, ["--check", resolve21(pluginDir, action.entryPoint)]);
73166
73647
  } catch (checkErr) {
73167
73648
  return createResult({
73168
73649
  actionType,
@@ -73220,12 +73701,12 @@ function createPluginMarketplaceAdapter(deps = {}) {
73220
73701
  }
73221
73702
  const consumer = action.consumer;
73222
73703
  const runDir = context.runDir;
73223
- const isolatedHome = resolve20(runDir, "consumers", `${consumer}-${action.plugin}`);
73224
- const runDirReal = await realpath11(runDir).catch(() => runDir);
73225
- const isolatedHomePreReal = await realpath11(isolatedHome).catch(() => isolatedHome);
73226
- const relToRun = relative18(runDirReal, isolatedHomePreReal);
73704
+ const isolatedHome = resolve21(runDir, "consumers", `${consumer}-${action.plugin}`);
73705
+ const runDirReal = await realpath12(runDir).catch(() => runDir);
73706
+ const isolatedHomePreReal = await realpath12(isolatedHome).catch(() => isolatedHome);
73707
+ const relToRun = relative19(runDirReal, isolatedHomePreReal);
73227
73708
  const sepE = process.platform === "win32" ? "\\" : "/";
73228
- if (relToRun !== "" && (isAbsolute15(relToRun) || relToRun === ".." || relToRun.startsWith(`..${sepE}`))) {
73709
+ if (relToRun !== "" && (isAbsolute16(relToRun) || relToRun === ".." || relToRun.startsWith(`..${sepE}`))) {
73229
73710
  return createResult({
73230
73711
  actionType,
73231
73712
  status: ActionStatus.EXECUTE_FAILED,
@@ -73234,7 +73715,7 @@ function createPluginMarketplaceAdapter(deps = {}) {
73234
73715
  }
73235
73716
  await mkdir10(isolatedHome, { recursive: true, mode: 448 });
73236
73717
  for (const subdir of platform.isolationSubdirs) {
73237
- await mkdir10(resolve20(isolatedHome, subdir), { recursive: true, mode: 448 });
73718
+ await mkdir10(resolve21(isolatedHome, subdir), { recursive: true, mode: 448 });
73238
73719
  }
73239
73720
  const cliCmd = platform.cli.binary;
73240
73721
  const baseEnv = { ...process.env, ...context.env };
@@ -73331,9 +73812,9 @@ function createPluginMarketplaceAdapter(deps = {}) {
73331
73812
  error: `plugin install JSON missing installedPath`
73332
73813
  });
73333
73814
  }
73334
- const installPathAbs = resolve20(installFields.installedPath);
73335
- const installPathRel = relative18(isolatedHome, installPathAbs);
73336
- if (isAbsolute15(installPathRel) || installPathRel === ".." || installPathRel.startsWith(`..${sepE}`)) {
73815
+ const installPathAbs = resolve21(installFields.installedPath);
73816
+ const installPathRel = relative19(isolatedHome, installPathAbs);
73817
+ if (isAbsolute16(installPathRel) || installPathRel === ".." || installPathRel.startsWith(`..${sepE}`)) {
73337
73818
  return createResult({
73338
73819
  actionType,
73339
73820
  status: ActionStatus.EXECUTE_FAILED,
@@ -73394,9 +73875,9 @@ function createPluginMarketplaceAdapter(deps = {}) {
73394
73875
  executedAt: (/* @__PURE__ */ new Date()).toISOString(),
73395
73876
  ...extraInstalledPathsAudit(executeBinding)
73396
73877
  };
73397
- const evidenceDir = resolve20(runDir, "evidence", `${consumer}-${action.plugin}`);
73878
+ const evidenceDir = resolve21(runDir, "evidence", `${consumer}-${action.plugin}`);
73398
73879
  await mkdir10(evidenceDir, { recursive: true, mode: 448 });
73399
- const evidencePath = resolve20(evidenceDir, "release-skill-install-evidence.json");
73880
+ const evidencePath = resolve21(evidenceDir, "release-skill-install-evidence.json");
73400
73881
  await writeEvidenceAtomic(evidencePath, evidence);
73401
73882
  const executeObservation = {
73402
73883
  ...evidence,
@@ -73492,7 +73973,7 @@ function createPluginMarketplaceAdapter(deps = {}) {
73492
73973
  observation: { installed: false, error: "context.runDir is required" }
73493
73974
  });
73494
73975
  }
73495
- const isolatedHome = resolve20(runDir, "consumers", `${consumer}-${action.plugin}`);
73976
+ const isolatedHome = resolve21(runDir, "consumers", `${consumer}-${action.plugin}`);
73496
73977
  const platform = PLATFORMS.find((p) => p.id === consumer) ?? null;
73497
73978
  if (!platform) {
73498
73979
  throw new Error(
@@ -73544,7 +74025,7 @@ function createPluginMarketplaceAdapter(deps = {}) {
73544
74025
  }
73545
74026
  let requirement = null;
73546
74027
  try {
73547
- requirement = JSON.parse(await readFile18(resolve20(attestationDir, KIMI_REQUIREMENT_FILE), "utf8"));
74028
+ requirement = JSON.parse(await readFile18(resolve21(attestationDir, KIMI_REQUIREMENT_FILE), "utf8"));
73548
74029
  } catch {
73549
74030
  return createResult({
73550
74031
  actionType,
@@ -73568,7 +74049,7 @@ function createPluginMarketplaceAdapter(deps = {}) {
73568
74049
  }
73569
74050
  let attestation = null;
73570
74051
  try {
73571
- attestation = JSON.parse(await readFile18(resolve20(attestationDir, KIMI_ATTESTATION_FILE), "utf8"));
74052
+ attestation = JSON.parse(await readFile18(resolve21(attestationDir, KIMI_ATTESTATION_FILE), "utf8"));
73572
74053
  } catch {
73573
74054
  return createResult({
73574
74055
  actionType,
@@ -73578,7 +74059,7 @@ function createPluginMarketplaceAdapter(deps = {}) {
73578
74059
  manualInstallRequired: true,
73579
74060
  installUrl: requirement.installUrl,
73580
74061
  attestationDir,
73581
- error: `kimi attestation is missing; write ${resolve20(attestationDir, KIMI_ATTESTATION_FILE)} after the interactive install (${requirement.installUrl})`
74062
+ error: `kimi attestation is missing; write ${resolve21(attestationDir, KIMI_ATTESTATION_FILE)} after the interactive install (${requirement.installUrl})`
73582
74063
  }
73583
74064
  });
73584
74065
  }
@@ -73620,10 +74101,10 @@ function createPluginMarketplaceAdapter(deps = {}) {
73620
74101
  }
73621
74102
  let verifiedInstallPath = null;
73622
74103
  if (normalizedAttestation.installPath) {
73623
- const installPathAbs = resolve20(normalizedAttestation.installPath);
74104
+ const installPathAbs = resolve21(normalizedAttestation.installPath);
73624
74105
  let lexicalStat;
73625
74106
  try {
73626
- lexicalStat = await lstat13(installPathAbs);
74107
+ lexicalStat = await lstat14(installPathAbs);
73627
74108
  } catch {
73628
74109
  return createResult({
73629
74110
  actionType,
@@ -73644,7 +74125,7 @@ function createPluginMarketplaceAdapter(deps = {}) {
73644
74125
  }
73645
74126
  });
73646
74127
  }
73647
- const installPathReal2 = await realpath11(installPathAbs).catch(() => null);
74128
+ const installPathReal2 = await realpath12(installPathAbs).catch(() => null);
73648
74129
  if (!installPathReal2) {
73649
74130
  return createResult({
73650
74131
  actionType,
@@ -73735,7 +74216,7 @@ function createPluginMarketplaceAdapter(deps = {}) {
73735
74216
  }
73736
74217
  let requirement = null;
73737
74218
  try {
73738
- requirement = JSON.parse(await readFile18(resolve20(attestationDir, CODEBUDDY_REQUIREMENT_FILE), "utf8"));
74219
+ requirement = JSON.parse(await readFile18(resolve21(attestationDir, CODEBUDDY_REQUIREMENT_FILE), "utf8"));
73739
74220
  } catch {
73740
74221
  return createResult({
73741
74222
  actionType,
@@ -73759,7 +74240,7 @@ function createPluginMarketplaceAdapter(deps = {}) {
73759
74240
  }
73760
74241
  let attestation = null;
73761
74242
  try {
73762
- attestation = JSON.parse(await readFile18(resolve20(attestationDir, CODEBUDDY_ATTESTATION_FILE), "utf8"));
74243
+ attestation = JSON.parse(await readFile18(resolve21(attestationDir, CODEBUDDY_ATTESTATION_FILE), "utf8"));
73763
74244
  } catch {
73764
74245
  return createResult({
73765
74246
  actionType,
@@ -73769,7 +74250,7 @@ function createPluginMarketplaceAdapter(deps = {}) {
73769
74250
  manualInstallRequired: true,
73770
74251
  marketplaceSource: CODEBUDDY_MARKETPLACE_SOURCE,
73771
74252
  attestationDir,
73772
- error: `codebuddy attestation is missing; write ${resolve20(attestationDir, CODEBUDDY_ATTESTATION_FILE)} after the manual install (marketplace ${CODEBUDDY_MARKETPLACE_SOURCE})`
74253
+ error: `codebuddy attestation is missing; write ${resolve21(attestationDir, CODEBUDDY_ATTESTATION_FILE)} after the manual install (marketplace ${CODEBUDDY_MARKETPLACE_SOURCE})`
73773
74254
  }
73774
74255
  });
73775
74256
  }
@@ -73833,10 +74314,10 @@ function createPluginMarketplaceAdapter(deps = {}) {
73833
74314
  }
73834
74315
  });
73835
74316
  }
73836
- const installPathAbs = resolve20(normalizedAttestation.installPath);
74317
+ const installPathAbs = resolve21(normalizedAttestation.installPath);
73837
74318
  let lexicalStat;
73838
74319
  try {
73839
- lexicalStat = await lstat13(installPathAbs);
74320
+ lexicalStat = await lstat14(installPathAbs);
73840
74321
  } catch {
73841
74322
  return createResult({
73842
74323
  actionType,
@@ -73857,7 +74338,7 @@ function createPluginMarketplaceAdapter(deps = {}) {
73857
74338
  }
73858
74339
  });
73859
74340
  }
73860
- verifiedInstallPath = await realpath11(installPathAbs);
74341
+ verifiedInstallPath = await realpath12(installPathAbs);
73861
74342
  }
73862
74343
  return createResult({
73863
74344
  actionType,
@@ -73897,13 +74378,13 @@ function createPluginMarketplaceAdapter(deps = {}) {
73897
74378
  if (codexAttestationDir) {
73898
74379
  let codexRequirement = null;
73899
74380
  try {
73900
- codexRequirement = JSON.parse(await readFile18(resolve20(codexAttestationDir, CODEX_REQUIREMENT_FILE), "utf8"));
74381
+ codexRequirement = JSON.parse(await readFile18(resolve21(codexAttestationDir, CODEX_REQUIREMENT_FILE), "utf8"));
73901
74382
  } catch {
73902
74383
  }
73903
74384
  if (codexRequirement && codexRequirement.planDigest === codexBoundPlanDigest && codexRequirement.plugin === action.plugin && codexRequirement.version === action.version && codexRequirement.repo === action.repo && codexRequirement.ref === (action.ref ?? `v${action.version}`) && (!action.entrySkill || codexRequirement.entrySkill === action.entrySkill)) {
73904
74385
  let codexAttestation = null;
73905
74386
  try {
73906
- codexAttestation = JSON.parse(await readFile18(resolve20(codexAttestationDir, CODEX_ATTESTATION_FILE), "utf8"));
74387
+ codexAttestation = JSON.parse(await readFile18(resolve21(codexAttestationDir, CODEX_ATTESTATION_FILE), "utf8"));
73907
74388
  } catch {
73908
74389
  }
73909
74390
  if (codexAttestation) {
@@ -73958,7 +74439,7 @@ function createPluginMarketplaceAdapter(deps = {}) {
73958
74439
  }
73959
74440
  let evidence = null;
73960
74441
  try {
73961
- const evidenceRaw = await readFile18(resolve20(runDir, "evidence", `${consumer}-${action.plugin}`, "release-skill-install-evidence.json"), "utf8");
74442
+ const evidenceRaw = await readFile18(resolve21(runDir, "evidence", `${consumer}-${action.plugin}`, "release-skill-install-evidence.json"), "utf8");
73962
74443
  evidence = JSON.parse(evidenceRaw);
73963
74444
  } catch {
73964
74445
  return createResult({
@@ -74041,11 +74522,11 @@ function createPluginMarketplaceAdapter(deps = {}) {
74041
74522
  }
74042
74523
  }
74043
74524
  }
74044
- const isolatedHomeReal = await realpath11(isolatedHome).catch(() => isolatedHome);
74045
- const installPathReal = await realpath11(installPath).catch(() => installPath);
74046
- const relToHome = relative18(isolatedHomeReal, installPathReal);
74047
- const sep6 = process.platform === "win32" ? "\\" : "/";
74048
- if (relToHome !== "" && (isAbsolute15(relToHome) || relToHome === ".." || relToHome.startsWith(`..${sep6}`))) {
74525
+ const isolatedHomeReal = await realpath12(isolatedHome).catch(() => isolatedHome);
74526
+ const installPathReal = await realpath12(installPath).catch(() => installPath);
74527
+ const relToHome = relative19(isolatedHomeReal, installPathReal);
74528
+ const sep7 = process.platform === "win32" ? "\\" : "/";
74529
+ if (relToHome !== "" && (isAbsolute16(relToHome) || relToHome === ".." || relToHome.startsWith(`..${sep7}`))) {
74049
74530
  return createResult({
74050
74531
  actionType,
74051
74532
  status: ActionStatus.OBSERVED,
@@ -74055,10 +74536,10 @@ function createPluginMarketplaceAdapter(deps = {}) {
74055
74536
  }
74056
74537
  });
74057
74538
  }
74058
- const entrySkillPath = resolve20(installPath, "skills", action.entrySkill, "SKILL.md");
74539
+ const entrySkillPath = resolve21(installPath, "skills", action.entrySkill, "SKILL.md");
74059
74540
  let entrySkillFound = false;
74060
74541
  try {
74061
- const skillStat = await lstat13(entrySkillPath);
74542
+ const skillStat = await lstat14(entrySkillPath);
74062
74543
  if (skillStat.isFile() && !skillStat.isSymbolicLink()) {
74063
74544
  entrySkillFound = true;
74064
74545
  }
@@ -74124,7 +74605,7 @@ function createPluginMarketplaceAdapter(deps = {}) {
74124
74605
  });
74125
74606
  }
74126
74607
  try {
74127
- const installedManifestPath = resolve20(installPath, platform.manifestPaths.plugin);
74608
+ const installedManifestPath = resolve21(installPath, platform.manifestPaths.plugin);
74128
74609
  const installedManifestContent = await readFile18(installedManifestPath, "utf8");
74129
74610
  const installedManifest = JSON.parse(installedManifestContent);
74130
74611
  const expectedName = observation.plugin;
@@ -74307,8 +74788,8 @@ var init_plugin_marketplace = __esm({
74307
74788
  });
74308
74789
 
74309
74790
  // src/artifacts/transaction-journal.mjs
74310
- import { readdir as readdir11, readFile as readFile19, rm as rm7, stat as stat5 } from "node:fs/promises";
74311
- import { join as join17 } from "node:path";
74791
+ import { readdir as readdir12, readFile as readFile19, rm as rm7, stat as stat5 } from "node:fs/promises";
74792
+ import { join as join18 } from "node:path";
74312
74793
  function failSchema(message, details) {
74313
74794
  throw new ReleaseError(TRANSACTION_INCOMPLETE, message, details);
74314
74795
  }
@@ -75305,7 +75786,7 @@ async function pruneTerminalTransactionRecords(transactionsRoot, {
75305
75786
  if (!Number.isInteger(retentionMax) || retentionMax < 0) return summary;
75306
75787
  let entries;
75307
75788
  try {
75308
- entries = await readdir11(transactionsRoot, { withFileTypes: true });
75789
+ entries = await readdir12(transactionsRoot, { withFileTypes: true });
75309
75790
  } catch (scanErr) {
75310
75791
  summary.errors.push(`scan: ${scanErr?.code || scanErr?.message || "readdir-failed"}`);
75311
75792
  return summary;
@@ -75315,11 +75796,11 @@ async function pruneTerminalTransactionRecords(transactionsRoot, {
75315
75796
  if (txnDirs.length <= retentionMax) return summary;
75316
75797
  const terminal = [];
75317
75798
  for (const entry of txnDirs) {
75318
- const recordDir = join17(transactionsRoot, entry.name);
75799
+ const recordDir = join18(transactionsRoot, entry.name);
75319
75800
  let state = null;
75320
75801
  let createdAt = null;
75321
75802
  try {
75322
- const raw = await readFile19(join17(recordDir, "journal.json"), "utf8");
75803
+ const raw = await readFile19(join18(recordDir, "journal.json"), "utf8");
75323
75804
  const journal = JSON.parse(raw);
75324
75805
  if (journal && typeof journal === "object") {
75325
75806
  state = typeof journal.state === "string" ? journal.state : null;
@@ -75383,7 +75864,7 @@ async function createTransactionJournal({
75383
75864
  );
75384
75865
  if (typeof root === "string" && root.length > 0) {
75385
75866
  await pruneTerminalTransactionRecords(
75386
- join17(root, ".release-skill", "transactions"),
75867
+ join18(root, ".release-skill", "transactions"),
75387
75868
  { retentionMax }
75388
75869
  );
75389
75870
  }
@@ -75747,7 +76228,7 @@ __export(transaction_exports, {
75747
76228
  applyWriteSetUnderLock: () => applyWriteSetUnderLock
75748
76229
  });
75749
76230
  import { randomBytes as randomBytes2 } from "node:crypto";
75750
- import { relative as relative19 } from "node:path";
76231
+ import { relative as relative20 } from "node:path";
75751
76232
  function computeCanonicalPlanDigest(plan) {
75752
76233
  const { planDigest: _ignored, ...content } = plan;
75753
76234
  return `sha256:${sha256Hex(canonicalJson(content))}`;
@@ -76660,7 +77141,7 @@ async function applyArtifactPlanUnderLock({
76660
77141
  }
76661
77142
  const handle = await safeFs.openRoot(root);
76662
77143
  try {
76663
- const relPlanPath = canonicalArtifactPath(relative19(root, planPath)).path;
77144
+ const relPlanPath = canonicalArtifactPath(relative20(root, planPath)).path;
76664
77145
  const planFileData = await withParentHandle(handle, relPlanPath, async (parent, leaf) => {
76665
77146
  const planEntry = await parent.readEntry(leaf);
76666
77147
  if (!planEntry || planEntry.kind === "absent") {
@@ -79075,7 +79556,7 @@ __export(refresh_service_exports, {
79075
79556
  planReleaseDocsRefreshForUnit: () => planReleaseDocsRefreshForUnit,
79076
79557
  runReleaseDocsRefresh: () => runReleaseDocsRefresh
79077
79558
  });
79078
- import { isAbsolute as isAbsolute16, relative as relative20, resolve as resolve21, sep as sep5 } from "node:path";
79559
+ import { isAbsolute as isAbsolute17, relative as relative21, resolve as resolve22, sep as sep6 } from "node:path";
79079
79560
  function deepFreeze7(value) {
79080
79561
  if (Array.isArray(value)) {
79081
79562
  for (const item of value) deepFreeze7(item);
@@ -79158,7 +79639,7 @@ async function planReleaseDocsRefreshForUnit({
79158
79639
  field: "unit.source"
79159
79640
  });
79160
79641
  }
79161
- const unitRoot = resolve21(root, unit.source);
79642
+ const unitRoot = resolve22(root, unit.source);
79162
79643
  const backend = await (backendFactory ?? loadSafeFs)();
79163
79644
  const sharedFactory = /* @__PURE__ */ __name(async () => backend, "sharedFactory");
79164
79645
  const notesSource = await loadReleaseNotesSource({
@@ -79368,16 +79849,16 @@ async function runReleaseDocsRefresh({
79368
79849
  });
79369
79850
  }
79370
79851
  const changedFiles = plan.files.filter((file) => file.changed);
79371
- const unitRoot = resolve21(root, unit.source);
79372
- const unitLocation = relative20(root, unitRoot);
79373
- if (unitLocation === ".." || unitLocation.startsWith(`..${sep5}`) || isAbsolute16(unitLocation)) {
79852
+ const unitRoot = resolve22(root, unit.source);
79853
+ const unitLocation = relative21(root, unitRoot);
79854
+ if (unitLocation === ".." || unitLocation.startsWith(`..${sep6}`) || isAbsolute17(unitLocation)) {
79374
79855
  throw new ReleaseError(
79375
79856
  PATH_UNSAFE,
79376
79857
  "release unit source escapes the project root",
79377
79858
  { reason: "UNIT_SOURCE_ESCAPE", unitId }
79378
79859
  );
79379
79860
  }
79380
- const unitPrefix = unitLocation === "" ? "" : `${unitLocation.split(sep5).join("/")}/`;
79861
+ const unitPrefix = unitLocation === "" ? "" : `${unitLocation.split(sep6).join("/")}/`;
79381
79862
  const projectPath = /* @__PURE__ */ __name((targetPath) => `${unitPrefix}${targetPath}`, "projectPath");
79382
79863
  const writeSet = changedFiles.map((file) => ({
79383
79864
  id: `${file.kind}:${projectPath(file.path)}`,
@@ -79428,7 +79909,7 @@ async function runReleaseDocsRefresh({
79428
79909
  if (err instanceof ReleaseError && err.code === TRANSACTION_INCOMPLETE && typeof err.details?.recover === "string") {
79429
79910
  const restored = await tryRestoreOldBytes(
79430
79911
  backend,
79431
- resolve21(root, unit.source),
79912
+ resolve22(root, unit.source),
79432
79913
  changedFiles,
79433
79914
  modes
79434
79915
  );
@@ -79528,8 +80009,8 @@ __export(prepare_exports, {
79528
80009
  resolveUnitVersion: () => resolveUnitVersion,
79529
80010
  runDeclaredHooks: () => runDeclaredHooks
79530
80011
  });
79531
- import { resolve as resolve22, relative as relative21, isAbsolute as isAbsolute17, normalize as normalize3, dirname as dirname10 } from "node:path";
79532
- import { readFile as readFile20, mkdir as mkdir11, realpath as realpath12 } from "node:fs/promises";
80012
+ import { resolve as resolve23, relative as relative22, isAbsolute as isAbsolute18, normalize as normalize3, dirname as dirname10 } from "node:path";
80013
+ import { readFile as readFile20, mkdir as mkdir11, realpath as realpath13 } from "node:fs/promises";
79533
80014
  import { execFile as execFileCb9 } from "node:child_process";
79534
80015
  import { promisify as promisify9 } from "node:util";
79535
80016
  async function resolveUnitVersion(unit, root, explicitVersion) {
@@ -79541,18 +80022,18 @@ async function resolveUnitVersion(unit, root, explicitVersion) {
79541
80022
  { unitId: unit.id }
79542
80023
  );
79543
80024
  }
79544
- if (isAbsolute17(versionSource)) {
80025
+ if (isAbsolute18(versionSource)) {
79545
80026
  throw new ReleaseError(
79546
80027
  CONFIG_INVALID,
79547
80028
  `unit "${unit.id}" version.source must be a relative path, got absolute: "${versionSource}"`,
79548
80029
  { unitId: unit.id, versionSource }
79549
80030
  );
79550
80031
  }
79551
- const unitRoot = resolve22(root, unit.source);
79552
- const resolvedPath = resolve22(unitRoot, versionSource);
80032
+ const unitRoot = resolve23(root, unit.source);
80033
+ const resolvedPath = resolve23(unitRoot, versionSource);
79553
80034
  const normalizedPath = normalize3(resolvedPath);
79554
- const rel = relative21(unitRoot, normalizedPath);
79555
- if (rel.startsWith("..") || rel === ".." || isAbsolute17(rel)) {
80035
+ const rel = relative22(unitRoot, normalizedPath);
80036
+ if (rel.startsWith("..") || rel === ".." || isAbsolute18(rel)) {
79556
80037
  throw new ReleaseError(
79557
80038
  CONFIG_INVALID,
79558
80039
  `unit "${unit.id}" version.source escapes unit root: "${versionSource}"`,
@@ -79851,7 +80332,7 @@ async function processSnapshots(config, root, evidence, runDir, production = fal
79851
80332
  const unitResults = [];
79852
80333
  const snapshotDigests = [];
79853
80334
  for (const unit of units) {
79854
- const outputDir = resolveUnitScopedPath(resolve22(runDir, "snapshots"), unit.id);
80335
+ const outputDir = resolveUnitScopedPath(resolve23(runDir, "snapshots"), unit.id);
79855
80336
  await evidence.append({
79856
80337
  phase: "snapshot",
79857
80338
  status: "started",
@@ -80079,7 +80560,7 @@ async function buildProductionAssets(unitResults, resolvedVersions, root, runDir
80079
80560
  const { unit, manifest } = unitResults[index];
80080
80561
  const version = resolvedVersions[index];
80081
80562
  const { tag, branch, branchStrategy } = resolveProductionBranch(unit, version);
80082
- const snapshotPath = relative21(root, manifest.outputDir);
80563
+ const snapshotPath = relative22(root, manifest.outputDir);
80083
80564
  const observed = await computeFrozenSnapshot(manifest.outputDir);
80084
80565
  if (observed.digest !== manifest.snapshotDigest) {
80085
80566
  throw new ReleaseError(
@@ -80090,7 +80571,7 @@ async function buildProductionAssets(unitResults, resolvedVersions, root, runDir
80090
80571
  }
80091
80572
  await sealFrozenSnapshot(manifest.outputDir);
80092
80573
  const sealed = await computeFrozenSnapshot(manifest.outputDir);
80093
- const repositoryDir = resolveUnitScopedPath(resolve22(runDir, "git"), unit.id, { suffix: ".git" });
80574
+ const repositoryDir = resolveUnitScopedPath(resolve23(runDir, "git"), unit.id, { suffix: ".git" });
80094
80575
  const unitBaseline = unitBaselineResults.get(unit.id);
80095
80576
  const parent = branchStrategy === "create-release-branch" ? void 0 : {
80096
80577
  githubHost: unitBaseline.githubHost,
@@ -80111,21 +80592,21 @@ async function buildProductionAssets(unitResults, resolvedVersions, root, runDir
80111
80592
  if (npmDistribution) {
80112
80593
  npm = await buildFrozenNpmTarball({
80113
80594
  snapshotDir: manifest.outputDir,
80114
- tarballDir: resolveUnitScopedPath(resolve22(runDir, "tarballs"), unit.id),
80595
+ tarballDir: resolveUnitScopedPath(resolve23(runDir, "tarballs"), unit.id),
80115
80596
  expectedSnapshotDigest: sealed.digest
80116
80597
  });
80117
80598
  await verifyFrozenNpmTarballContract({
80118
80599
  package: npmDistribution.package,
80119
80600
  version,
80120
- tarballPath: relative21(root, npm.tarballPath),
80601
+ tarballPath: relative22(root, npm.tarballPath),
80121
80602
  tarballSha256: npm.sha256,
80122
80603
  integrity: npm.integrity
80123
- }, root, resolveUnitScopedPath(resolve22(runDir, "tarballs"), unit.id));
80604
+ }, root, resolveUnitScopedPath(resolve23(runDir, "tarballs"), unit.id));
80124
80605
  }
80125
80606
  assets.push({
80126
80607
  snapshotPath,
80127
80608
  manifestDigest: sealed.digest,
80128
- gitObjectDir: relative21(root, repositoryDir),
80609
+ gitObjectDir: relative22(root, repositoryDir),
80129
80610
  commit: git2.commit,
80130
80611
  tree: git2.tree,
80131
80612
  commitTimestamp: canonicalFreezeTimestamp,
@@ -80134,7 +80615,7 @@ async function buildProductionAssets(unitResults, resolvedVersions, root, runDir
80134
80615
  branch,
80135
80616
  tag,
80136
80617
  npm: npm ? {
80137
- tarballPath: relative21(root, npm.tarballPath),
80618
+ tarballPath: relative22(root, npm.tarballPath),
80138
80619
  tarballSha256: npm.sha256,
80139
80620
  integrity: npm.integrity,
80140
80621
  size: npm.size
@@ -80685,7 +81166,7 @@ async function prepareRelease(options) {
80685
81166
  }
80686
81167
  let realRoot;
80687
81168
  try {
80688
- realRoot = await realpath12(root);
81169
+ realRoot = await realpath13(root);
80689
81170
  } catch (err) {
80690
81171
  throw new ReleaseError(
80691
81172
  CONFIG_INVALID,
@@ -80694,26 +81175,26 @@ async function prepareRelease(options) {
80694
81175
  );
80695
81176
  }
80696
81177
  if (production) {
80697
- const canonicalOutput = resolve22(realRoot, ".release-skill", "release-plan.json");
80698
- if (output && resolve22(output) !== canonicalOutput) {
81178
+ const canonicalOutput = resolve23(realRoot, ".release-skill", "release-plan.json");
81179
+ if (output && resolve23(output) !== canonicalOutput) {
80699
81180
  throw new ReleaseError(
80700
81181
  GATE_FAILED,
80701
81182
  "production prepare requires the canonical .release-skill/release-plan.json output; custom --output is supported only outside production",
80702
- { output: resolve22(output), expected: canonicalOutput }
81183
+ { output: resolve23(output), expected: canonicalOutput }
80703
81184
  );
80704
81185
  }
80705
81186
  }
80706
81187
  const lock = await acquireProjectLock({ root: realRoot, command: "prepare", mode: "exclusive" });
80707
- const releaseDir = resolve22(realRoot, ".release-skill");
81188
+ const releaseDir = resolve23(realRoot, ".release-skill");
80708
81189
  const runId = `prepare-${Date.now()}`;
80709
- const rawRunDir = runDirOpt ?? resolve22(releaseDir, "runs", runId);
81190
+ const rawRunDir = runDirOpt ?? resolve23(releaseDir, "runs", runId);
80710
81191
  let runDir;
80711
81192
  try {
80712
81193
  if (production) {
80713
81194
  runDir = await createProductionPrepareRunDir(rawRunDir, releaseDir);
80714
81195
  } else {
80715
81196
  await mkdir11(rawRunDir, { recursive: true });
80716
- runDir = await realpath12(rawRunDir);
81197
+ runDir = await realpath13(rawRunDir);
80717
81198
  }
80718
81199
  } catch (error) {
80719
81200
  await lock.release();
@@ -80724,12 +81205,20 @@ async function prepareRelease(options) {
80724
81205
  try {
80725
81206
  await evidence.append({ phase: "config", status: "started" });
80726
81207
  const { config, configPath, configDigest } = await loadProjectConfig({ root: realRoot });
81208
+ const adoptionWarnings = collectExpectedPublicSurfaceAdoptionWarnings(config);
80727
81209
  await evidence.append({
80728
81210
  phase: "config",
80729
81211
  status: "completed",
80730
- configPath: relative21(realRoot, configPath),
81212
+ configPath: relative22(realRoot, configPath),
80731
81213
  configDigest
80732
81214
  });
81215
+ for (const warning of adoptionWarnings) {
81216
+ await evidence.append({
81217
+ phase: "public-surface-adoption",
81218
+ status: "warning",
81219
+ ...warning
81220
+ });
81221
+ }
80733
81222
  const configUnits = config.releaseUnits ?? [];
80734
81223
  const resolvedVersions = await resolveAllUnitVersions(
80735
81224
  configUnits,
@@ -80859,6 +81348,44 @@ To proceed, pass --acknowledge-hook-side-effects (CLI) or hooksAuthorized=true (
80859
81348
  expectedBindings: preHookDocsBindings
80860
81349
  });
80861
81350
  }
81351
+ for (const unit of configUnits) {
81352
+ if (!unit?.expectedPublicSurface) continue;
81353
+ await evidence.append({
81354
+ phase: "public-surface",
81355
+ status: "started",
81356
+ unitId: unit.id
81357
+ });
81358
+ try {
81359
+ const surface = await assertExpectedPublicSurface({
81360
+ root: realRoot,
81361
+ unit
81362
+ });
81363
+ await evidence.append({
81364
+ phase: "public-surface",
81365
+ status: "completed",
81366
+ unitId: unit.id,
81367
+ ...surface.summary
81368
+ });
81369
+ } catch (error) {
81370
+ await evidence.append({
81371
+ phase: "public-surface",
81372
+ status: "failed",
81373
+ unitId: unit.id,
81374
+ reason: error.details?.reason ?? "PUBLIC_SURFACE_CHECK_FAILED",
81375
+ error: {
81376
+ code: error.code,
81377
+ message: error.message
81378
+ },
81379
+ diagnostics: {
81380
+ missingMappings: error.details?.missingMappings ?? [],
81381
+ unexpectedMappings: error.details?.unexpectedMappings ?? [],
81382
+ unclassifiedFiles: error.details?.unclassifiedFiles ?? [],
81383
+ ambiguousFiles: error.details?.ambiguousFiles ?? []
81384
+ }
81385
+ });
81386
+ throw error;
81387
+ }
81388
+ }
80862
81389
  const sourceRepository = config.project?.sourceRepository ?? null;
80863
81390
  const configDefaultBranch = config.project?.defaultBranch ?? null;
80864
81391
  let sourceAuthority = null;
@@ -81371,7 +81898,7 @@ To proceed, pass --acknowledge-hook-side-effects (CLI) or hooksAuthorized=true (
81371
81898
  { unitId: unit.id, distributionType: dist.type }
81372
81899
  );
81373
81900
  }
81374
- const marketplaceIndexPath = resolve22(snapshotDir, marketplaceIndexRelative);
81901
+ const marketplaceIndexPath = resolve23(snapshotDir, marketplaceIndexRelative);
81375
81902
  let marketplaceIndexRaw;
81376
81903
  try {
81377
81904
  marketplaceIndexRaw = await readFile20(marketplaceIndexPath, "utf8");
@@ -81440,7 +81967,7 @@ To proceed, pass --acknowledge-hook-side-effects (CLI) or hooksAuthorized=true (
81440
81967
  pluginManifestRelative = readResult.manifestRelative ?? platform.manifestPaths.plugin;
81441
81968
  } else {
81442
81969
  pluginManifestRelative = platform.manifestPaths.plugin;
81443
- const pluginManifestPath = resolve22(snapshotDir, pluginManifestRelative);
81970
+ const pluginManifestPath = resolve23(snapshotDir, pluginManifestRelative);
81444
81971
  let raw;
81445
81972
  try {
81446
81973
  raw = await readFile20(pluginManifestPath, "utf8");
@@ -81573,7 +82100,7 @@ To proceed, pass --acknowledge-hook-side-effects (CLI) or hooksAuthorized=true (
81573
82100
  ...production ? {
81574
82101
  production: {
81575
82102
  mode: "github-npm-v1",
81576
- assetRoot: relative21(realRoot, runDir)
82103
+ assetRoot: relative22(realRoot, runDir)
81577
82104
  }
81578
82105
  } : {},
81579
82106
  units,
@@ -81588,9 +82115,9 @@ To proceed, pass --acknowledge-hook-side-effects (CLI) or hooksAuthorized=true (
81588
82115
  actionCount: externalActions.length
81589
82116
  });
81590
82117
  await evidence.append({ phase: "plan-write", status: "started" });
81591
- const latestPlanPath = output ?? resolve22(releaseDir, "release-plan.json");
82118
+ const latestPlanPath = output ?? resolve23(releaseDir, "release-plan.json");
81592
82119
  const plannedDigest = computePlanDigest(plan);
81593
- const immutablePlanPath = resolve22(dirname10(latestPlanPath), "plans", `${plannedDigest}.json`);
82120
+ const immutablePlanPath = resolve23(dirname10(latestPlanPath), "plans", `${plannedDigest}.json`);
81594
82121
  const { planPath: writtenPath, planDigest } = await writePlanImmutable(immutablePlanPath, plan);
81595
82122
  await writePlanAtomic(latestPlanPath, plan);
81596
82123
  await evidence.append({
@@ -81613,7 +82140,8 @@ To proceed, pass --acknowledge-hook-side-effects (CLI) or hooksAuthorized=true (
81613
82140
  return {
81614
82141
  planPath: writtenPath,
81615
82142
  planDigest,
81616
- evidenceDir
82143
+ evidenceDir,
82144
+ warnings: adoptionWarnings
81617
82145
  };
81618
82146
  } catch (err) {
81619
82147
  await evidence.append({
@@ -81638,6 +82166,7 @@ var init_prepare = __esm({
81638
82166
  init_baseline();
81639
82167
  init_hooks();
81640
82168
  init_hook_cache();
82169
+ init_public_surface();
81641
82170
  init_verification_gates();
81642
82171
  init_evidence();
81643
82172
  await init_plan();
@@ -81682,7 +82211,7 @@ var init_prepare = __esm({
81682
82211
 
81683
82212
  // src/core/approval.mjs
81684
82213
  import { readFile as readFile21 } from "node:fs/promises";
81685
- import { basename as basename6, dirname as dirname11, join as join18, resolve as resolve23 } from "node:path";
82214
+ import { basename as basename6, dirname as dirname11, join as join19, resolve as resolve24 } from "node:path";
81686
82215
  function validateApprovalRecordSchema(approval) {
81687
82216
  if (validateApprovalSchema(approval)) return;
81688
82217
  const errors = validateApprovalSchema.errors ?? [];
@@ -81699,7 +82228,7 @@ function assertImmutableApprovalAuthority(approvalPath, plan, rawApproval) {
81699
82228
  if (!plan?.production) return;
81700
82229
  const planDigest = computePlanDigest(plan);
81701
82230
  const approvalDigest = computeApprovalDigest(rawApproval);
81702
- const absolute = resolve23(approvalPath);
82231
+ const absolute = resolve24(approvalPath);
81703
82232
  const planDirectory = dirname11(absolute);
81704
82233
  if (basename6(absolute) !== `${approvalDigest}.json` || basename6(planDirectory) !== planDigest || basename6(dirname11(planDirectory)) !== "approvals") {
81705
82234
  throw new ReleaseError(
@@ -81969,7 +82498,7 @@ __export(approve_exports, {
81969
82498
  approvePlan: () => approvePlan
81970
82499
  });
81971
82500
  import { readFile as readFile22, writeFile as writeFile7 } from "node:fs/promises";
81972
- import { resolve as resolve24, dirname as dirname12, basename as basename7 } from "node:path";
82501
+ import { resolve as resolve25, dirname as dirname12, basename as basename7 } from "node:path";
81973
82502
  function defaultClock() {
81974
82503
  return (/* @__PURE__ */ new Date()).toISOString();
81975
82504
  }
@@ -82099,18 +82628,18 @@ async function approvePlan(options) {
82099
82628
  expiresAt
82100
82629
  };
82101
82630
  validateApprovalRecordSchema(approvalRecord);
82102
- const planDir = dirname12(resolve24(planPath));
82631
+ const planDir = dirname12(resolve25(planPath));
82103
82632
  const releaseDir = basename7(planDir) === "plans" && basename7(planPath) === `${actualDigest}.json` ? dirname12(planDir) : planDir;
82104
- if (plan.production?.mode === "github-npm-v1" && outputPath && resolve24(outputPath) !== resolve24(releaseDir, "approval-record.json")) {
82633
+ if (plan.production?.mode === "github-npm-v1" && outputPath && resolve25(outputPath) !== resolve25(releaseDir, "approval-record.json")) {
82105
82634
  throw new ReleaseError(
82106
82635
  GATE_FAILED,
82107
82636
  "production approve requires the canonical approval-record.json alias next to the immutable plan authority; custom --output is supported only outside production",
82108
- { outputPath: resolve24(outputPath), expected: resolve24(releaseDir, "approval-record.json") }
82637
+ { outputPath: resolve25(outputPath), expected: resolve25(releaseDir, "approval-record.json") }
82109
82638
  );
82110
82639
  }
82111
82640
  const json = JSON.stringify(approvalRecord, null, 2);
82112
82641
  const approvalDigest = computeApprovalDigest(json);
82113
- const immutableApprovalPath = resolve24(
82642
+ const immutableApprovalPath = resolve25(
82114
82643
  releaseDir,
82115
82644
  "approvals",
82116
82645
  actualDigest,
@@ -82131,7 +82660,7 @@ async function approvePlan(options) {
82131
82660
  );
82132
82661
  }
82133
82662
  }
82134
- const writePath = outputPath ?? resolve24(releaseDir, "approval-record.json");
82663
+ const writePath = outputPath ?? resolve25(releaseDir, "approval-record.json");
82135
82664
  await prepareAuthorityDirectory(dirname12(writePath));
82136
82665
  await assertAuthorityFileTarget(writePath);
82137
82666
  await writeFile7(writePath, json, "utf8");
@@ -82333,7 +82862,7 @@ function defaultSleep(ms) {
82333
82862
  if (process.env.RELEASE_SKILL_OBSERVE_RETRY_NO_WAIT === "1") {
82334
82863
  return Promise.resolve();
82335
82864
  }
82336
- return new Promise((resolve28) => setTimeout(resolve28, ms));
82865
+ return new Promise((resolve29) => setTimeout(resolve29, ms));
82337
82866
  }
82338
82867
  function isPropagatingMissing(result) {
82339
82868
  if (result == null) return true;
@@ -82423,7 +82952,7 @@ __export(reconcile_exports, {
82423
82952
  reconcileRelease: () => reconcileRelease
82424
82953
  });
82425
82954
  import { readFile as readFile23, mkdir as mkdir12 } from "node:fs/promises";
82426
- import { join as join19 } from "node:path";
82955
+ import { join as join20 } from "node:path";
82427
82956
  function defaultClock3() {
82428
82957
  return (/* @__PURE__ */ new Date()).toISOString();
82429
82958
  }
@@ -83371,7 +83900,7 @@ async function reconcileRelease(options) {
83371
83900
  ...normalized === "deferred" ? { reason: CONSUMER_VERIFICATION_DEFERRED, phase: "post-publish-verification" } : {}
83372
83901
  };
83373
83902
  });
83374
- const runPath = join19(runDir, "release-run.json");
83903
+ const runPath = join20(runDir, "release-run.json");
83375
83904
  const sourceRunDigest = sourceAuthorityDigest;
83376
83905
  const runState = {
83377
83906
  runId,
@@ -84038,9 +84567,9 @@ __export(verify_exports, {
84038
84567
  runSmokeTest: () => runSmokeTest,
84039
84568
  verifyRelease: () => verifyRelease
84040
84569
  });
84041
- import { readFile as readFile24, writeFile as writeFile8, mkdtemp as mkdtemp4, rm as rm8, mkdir as mkdir13, lstat as lstat14, realpath as realpath13, readdir as readdir12 } from "node:fs/promises";
84570
+ import { readFile as readFile24, writeFile as writeFile8, mkdtemp as mkdtemp4, rm as rm8, mkdir as mkdir13, lstat as lstat15, realpath as realpath14, readdir as readdir13 } from "node:fs/promises";
84042
84571
  import { realpathSync as realpathSync4 } from "node:fs";
84043
- import { dirname as dirname13, join as join20, relative as relative22, isAbsolute as isAbsolute18, resolve as resolve25, basename as basename8 } from "node:path";
84572
+ import { dirname as dirname13, join as join21, relative as relative23, isAbsolute as isAbsolute19, resolve as resolve26, basename as basename8 } from "node:path";
84044
84573
  import { tmpdir as tmpdir4 } from "node:os";
84045
84574
  import { execFile as execFileCb12 } from "node:child_process";
84046
84575
  import { promisify as promisify12 } from "node:util";
@@ -84070,7 +84599,7 @@ function matchesSubset2(actual, expected) {
84070
84599
  async function runSmokeTest(plan, root, options = {}) {
84071
84600
  const baseDir = options.baseDir ?? tmpdir4();
84072
84601
  await mkdir13(baseDir, { recursive: true });
84073
- const tmpDir = await mkdtemp4(join20(baseDir, "verify-smoke-"));
84602
+ const tmpDir = await mkdtemp4(join21(baseDir, "verify-smoke-"));
84074
84603
  const npmExec = options.npmExecutor ?? defaultNpmExecutor;
84075
84604
  const installFlags = [
84076
84605
  "--ignore-scripts",
@@ -84118,7 +84647,7 @@ async function runSmokeTest(plan, root, options = {}) {
84118
84647
  for (const { package: pkgName, registry, targetVersion, unitId, smokeBin, smokeArgs, smokeExpectedJson } of npmDistributions) {
84119
84648
  const packageAtVersion = `${pkgName}@${targetVersion}`;
84120
84649
  const installDir = resolveUnitScopedPath(tmpDir, unitId);
84121
- await mkdir13(join20(installDir, "node_modules"), { recursive: true });
84650
+ await mkdir13(join21(installDir, "node_modules"), { recursive: true });
84122
84651
  const registryFlags = [...installFlags, "--registry", registry];
84123
84652
  const installResult = await npmExec.install(
84124
84653
  packageAtVersion,
@@ -84136,7 +84665,7 @@ async function runSmokeTest(plan, root, options = {}) {
84136
84665
  }
84137
84666
  };
84138
84667
  }
84139
- const installedPkgPath = join20(installDir, "node_modules", pkgName, "package.json");
84668
+ const installedPkgPath = join21(installDir, "node_modules", pkgName, "package.json");
84140
84669
  let installedPkg;
84141
84670
  try {
84142
84671
  installedPkg = JSON.parse(await readFile24(installedPkgPath, "utf8"));
@@ -84170,7 +84699,7 @@ async function runSmokeTest(plan, root, options = {}) {
84170
84699
  }
84171
84700
  };
84172
84701
  }
84173
- const pkgRoot = join20(installDir, "node_modules", pkgName);
84702
+ const pkgRoot = join21(installDir, "node_modules", pkgName);
84174
84703
  {
84175
84704
  const dirIndex = await buildDirectoryFileIndex(pkgRoot);
84176
84705
  const closureResult = checkNpmEntryClosure(installedPkg, dirIndex);
@@ -84270,10 +84799,10 @@ async function runSmokeTest(plan, root, options = {}) {
84270
84799
  }
84271
84800
  };
84272
84801
  }
84273
- const binPath = resolve25(pkgRoot, binRelative);
84274
- const relBin = relative22(pkgRoot, binPath);
84275
- const sep6 = process.platform === "win32" ? "\\" : "/";
84276
- if (isAbsolute18(relBin) || relBin === ".." || relBin.startsWith(`..${sep6}`)) {
84802
+ const binPath = resolve26(pkgRoot, binRelative);
84803
+ const relBin = relative23(pkgRoot, binPath);
84804
+ const sep7 = process.platform === "win32" ? "\\" : "/";
84805
+ if (isAbsolute19(relBin) || relBin === ".." || relBin.startsWith(`..${sep7}`)) {
84277
84806
  return {
84278
84807
  passed: false,
84279
84808
  details: {
@@ -84285,10 +84814,10 @@ async function runSmokeTest(plan, root, options = {}) {
84285
84814
  }
84286
84815
  let binStat;
84287
84816
  try {
84288
- binStat = await lstat14(binPath);
84289
- const [pkgRootReal, binPathReal] = await Promise.all([realpath13(pkgRoot), realpath13(binPath)]);
84290
- const relReal = relative22(pkgRootReal, binPathReal);
84291
- if (!binStat.isFile() || binStat.isSymbolicLink() || isAbsolute18(relReal) || relReal === ".." || relReal.startsWith(`..${sep6}`)) {
84817
+ binStat = await lstat15(binPath);
84818
+ const [pkgRootReal, binPathReal] = await Promise.all([realpath14(pkgRoot), realpath14(binPath)]);
84819
+ const relReal = relative23(pkgRootReal, binPathReal);
84820
+ if (!binStat.isFile() || binStat.isSymbolicLink() || isAbsolute19(relReal) || relReal === ".." || relReal.startsWith(`..${sep7}`)) {
84292
84821
  throw new Error("bin is not a regular file inside the installed package");
84293
84822
  }
84294
84823
  } catch (err) {
@@ -84574,7 +85103,7 @@ async function verifyRelease(options) {
84574
85103
  const trustedVerifyRuns = [];
84575
85104
  const planDir = dirname13(planPath);
84576
85105
  const releaseDir = basename8(planDir) === "plans" ? dirname13(planDir) : planDir;
84577
- const runsDir = resolve25(releaseDir, "runs");
85106
+ const runsDir = resolve26(releaseDir, "runs");
84578
85107
  let runsDirReal = null;
84579
85108
  let authorityDirReal = null;
84580
85109
  if (previousVerifyRun) {
@@ -84587,7 +85116,7 @@ async function verifyRelease(options) {
84587
85116
  }
84588
85117
  {
84589
85118
  try {
84590
- const runsDirStat = await lstat14(runsDir);
85119
+ const runsDirStat = await lstat15(runsDir);
84591
85120
  if (runsDirStat.isSymbolicLink()) {
84592
85121
  throw new ReleaseError(
84593
85122
  GATE_FAILED,
@@ -84616,7 +85145,7 @@ async function verifyRelease(options) {
84616
85145
  runsDirReal = null;
84617
85146
  }
84618
85147
  if (runsDirReal) {
84619
- const entries = await readdir12(runsDirReal, { withFileTypes: true });
85148
+ const entries = await readdir13(runsDirReal, { withFileTypes: true });
84620
85149
  for (const entry of entries) {
84621
85150
  if (!entry.name.startsWith("verify-")) continue;
84622
85151
  if (!entry.isDirectory() || entry.isSymbolicLink()) {
@@ -84626,8 +85155,8 @@ async function verifyRelease(options) {
84626
85155
  { entry: entry.name, runsDir: runsDirReal }
84627
85156
  );
84628
85157
  }
84629
- const candidateDir = resolve25(runsDirReal, entry.name);
84630
- const candidateStat = await lstat14(candidateDir).catch(() => null);
85158
+ const candidateDir = resolve26(runsDirReal, entry.name);
85159
+ const candidateStat = await lstat15(candidateDir).catch(() => null);
84631
85160
  if (!candidateStat || candidateStat.isSymbolicLink()) {
84632
85161
  throw new ReleaseError(
84633
85162
  GATE_FAILED,
@@ -84643,7 +85172,7 @@ async function verifyRelease(options) {
84643
85172
  { candidateDir, candidateReal, runsDir: runsDirReal }
84644
85173
  );
84645
85174
  }
84646
- const candidatePath = resolve25(candidateDir, "release-run.json");
85175
+ const candidatePath = resolve26(candidateDir, "release-run.json");
84647
85176
  try {
84648
85177
  const candidate = await loadRun(candidatePath, { requireDigest: true });
84649
85178
  if (candidate.status !== "VERIFIED") continue;
@@ -84835,15 +85364,15 @@ async function verifyRelease(options) {
84835
85364
  evidence,
84836
85365
  env: gateEnv ?? process.env,
84837
85366
  fixedEnv: action.type === "claude-marketplace-install" ? {
84838
- HOME: resolve25(runDir, "consumers", `claude-${action.parameters.plugin}`),
84839
- CLAUDE_CONFIG_DIR: resolve25(runDir, "consumers", `claude-${action.parameters.plugin}`, ".claude")
85367
+ HOME: resolve26(runDir, "consumers", `claude-${action.parameters.plugin}`),
85368
+ CLAUDE_CONFIG_DIR: resolve26(runDir, "consumers", `claude-${action.parameters.plugin}`, ".claude")
84840
85369
  } : action.type === "codex-marketplace-install" ? {
84841
- HOME: resolve25(runDir, "consumers", `codex-${action.parameters.plugin}`),
84842
- CODEX_HOME: resolve25(runDir, "consumers", `codex-${action.parameters.plugin}`)
85370
+ HOME: resolve26(runDir, "consumers", `codex-${action.parameters.plugin}`),
85371
+ CODEX_HOME: resolve26(runDir, "consumers", `codex-${action.parameters.plugin}`)
84843
85372
  } : action.type === "codebuddy-marketplace-install" ? {
84844
- HOME: resolve25(runDir, "consumers", `codebuddy-${action.parameters.plugin}`)
85373
+ HOME: resolve26(runDir, "consumers", `codebuddy-${action.parameters.plugin}`)
84845
85374
  } : {
84846
- HOME: resolve25(runDir, "consumers", `kimi-${action.parameters.plugin}`)
85375
+ HOME: resolve26(runDir, "consumers", `kimi-${action.parameters.plugin}`)
84847
85376
  }
84848
85377
  }));
84849
85378
  } else {
@@ -85013,7 +85542,7 @@ async function verifyRelease(options) {
85013
85542
  assertTransition(PUBLISHED, VERIFIED);
85014
85543
  await evidence.append({ phase: "verify", status: "completed", overallStatus: VERIFIED });
85015
85544
  const sourceRunDigest = sourceRun.runDigest ?? computeRunDigest(sourceRun);
85016
- const verifyRunPath = join20(runDir, "release-run.json");
85545
+ const verifyRunPath = join21(runDir, "release-run.json");
85017
85546
  const verifyRunState = {
85018
85547
  runId,
85019
85548
  command: "verify",
@@ -85134,7 +85663,7 @@ var init_verify = __esm({
85134
85663
  exec: execFile11,
85135
85664
  env: process.env
85136
85665
  });
85137
- const userConfig = join20(cwd, ".release-skill-npmrc");
85666
+ const userConfig = join21(cwd, ".release-skill-npmrc");
85138
85667
  await writeFile8(
85139
85668
  userConfig,
85140
85669
  `registry=${normalizedRegistry}/
@@ -85195,10 +85724,10 @@ __export(publish_exports, {
85195
85724
  publishRelease: () => publishRelease
85196
85725
  });
85197
85726
  import { readFile as readFile25, mkdir as mkdir14 } from "node:fs/promises";
85198
- import { isAbsolute as isAbsolute19, join as join21, relative as relative23 } from "node:path";
85727
+ import { isAbsolute as isAbsolute20, join as join22, relative as relative24 } from "node:path";
85199
85728
  function assertInsideAssetRoot(assetRoot, candidate, label) {
85200
- const rel = relative23(assetRoot, candidate);
85201
- if (rel === "" || isAbsolute19(rel) || rel === ".." || rel.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`)) {
85729
+ const rel = relative24(assetRoot, candidate);
85730
+ if (rel === "" || isAbsolute20(rel) || rel === ".." || rel.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`)) {
85202
85731
  throw new ReleaseError(GATE_FAILED, `${label} must be a child of the production asset root`);
85203
85732
  }
85204
85733
  }
@@ -85907,7 +86436,7 @@ async function publishRelease(options) {
85907
86436
  }
85908
86437
  }
85909
86438
  await evidence.append({ phase: "safety-gate", gate: "global-preflight", status: "passed" });
85910
- const runPath = join21(runDir, "release-run.json");
86439
+ const runPath = join22(runDir, "release-run.json");
85911
86440
  const checkpoints = orderedActions.map((action) => {
85912
86441
  if (isMarketplaceAction(action.type)) {
85913
86442
  return {
@@ -86177,7 +86706,7 @@ var init_publish = __esm({
86177
86706
 
86178
86707
  // src/artifacts/policy.mjs
86179
86708
  import { readFile as readFile26 } from "node:fs/promises";
86180
- import { join as join22 } from "node:path";
86709
+ import { join as join23 } from "node:path";
86181
86710
  import { createHash as createHash11 } from "node:crypto";
86182
86711
  function validateArtifactPolicy(policy) {
86183
86712
  const ok = _validate(policy);
@@ -86273,7 +86802,7 @@ async function parseSafeYamlWithinRoot(root, policyPath) {
86273
86802
  }
86274
86803
  throw err;
86275
86804
  }
86276
- const fullPath = join22(root, policyPath);
86805
+ const fullPath = join23(root, policyPath);
86277
86806
  let content;
86278
86807
  try {
86279
86808
  content = await readFile26(fullPath, "utf8");
@@ -86387,8 +86916,8 @@ var init_policy = __esm({
86387
86916
  });
86388
86917
 
86389
86918
  // src/artifacts/entry.mjs
86390
- import { lstat as lstat15, readdir as readdir13, readFile as readFile27 } from "node:fs/promises";
86391
- import { join as join23 } from "node:path";
86919
+ import { lstat as lstat16, readdir as readdir14, readFile as readFile27 } from "node:fs/promises";
86920
+ import { join as join24 } from "node:path";
86392
86921
  import { promisify as promisify13 } from "node:util";
86393
86922
  import { execFile as execFile12 } from "node:child_process";
86394
86923
  function statToGitMode(stat9) {
@@ -86408,12 +86937,12 @@ async function gitHashObject(root, absPath) {
86408
86937
  }
86409
86938
  async function enumerateTreeEntries(root, dirPath, relBase) {
86410
86939
  const entries = [];
86411
- const items = await readdir13(dirPath, { withFileTypes: true });
86940
+ const items = await readdir14(dirPath, { withFileTypes: true });
86412
86941
  for (const item of items) {
86413
86942
  if (SKIP_DIRS2.has(item.name)) continue;
86414
- const absPath = join23(dirPath, item.name);
86943
+ const absPath = join24(dirPath, item.name);
86415
86944
  const relPath = relBase ? `${relBase}/${item.name}` : item.name;
86416
- const st = await lstat15(absPath);
86945
+ const st = await lstat16(absPath);
86417
86946
  if (st.isSymbolicLink()) {
86418
86947
  throw new ReleaseError(
86419
86948
  PATH_UNSAFE,
@@ -86462,10 +86991,10 @@ async function readEntry({ root, path: path3, source = "worktree" } = {}) {
86462
86991
  if (source !== "worktree") {
86463
86992
  throw new ReleaseError(PATH_UNSAFE, `unsupported readEntry source: ${source}`, { source });
86464
86993
  }
86465
- const absPath = join23(root, path3);
86994
+ const absPath = join24(root, path3);
86466
86995
  let st;
86467
86996
  try {
86468
- st = await lstat15(absPath);
86997
+ st = await lstat16(absPath);
86469
86998
  } catch (err) {
86470
86999
  if (err.code === "ENOENT" || err.code === "ENOTDIR") {
86471
87000
  return Object.freeze({ kind: "absent" });
@@ -86758,8 +87287,8 @@ var init_graph = __esm({
86758
87287
  });
86759
87288
 
86760
87289
  // src/artifacts/producer-registry.mjs
86761
- import { readFile as readFile28, readdir as readdir14, stat as stat6, mkdir as mkdir15, writeFile as writeFile9, rm as rm9 } from "node:fs/promises";
86762
- import { join as join24 } from "node:path";
87290
+ import { readFile as readFile28, readdir as readdir15, stat as stat6, mkdir as mkdir15, writeFile as writeFile9, rm as rm9 } from "node:fs/promises";
87291
+ import { join as join25 } from "node:path";
86763
87292
  import { mkdtemp as mkdtemp5 } from "node:fs/promises";
86764
87293
  import { tmpdir as tmpdir5 } from "node:os";
86765
87294
  import { createHash as createHash12 } from "node:crypto";
@@ -86780,7 +87309,7 @@ function collectStaticImports(filePath, visited = /* @__PURE__ */ new Set()) {
86780
87309
  const dir = abs.replace(/\/[^/]*$/, "");
86781
87310
  while ((match = importRe.exec(source)) !== null) {
86782
87311
  const spec = match[1];
86783
- let resolved = join24(dir, spec);
87312
+ let resolved = join25(dir, spec);
86784
87313
  if (!resolved.endsWith(".mjs")) resolved += ".mjs";
86785
87314
  results.push(...collectStaticImports(resolved, visited));
86786
87315
  }
@@ -86788,7 +87317,7 @@ function collectStaticImports(filePath, visited = /* @__PURE__ */ new Set()) {
86788
87317
  }
86789
87318
  async function createBuiltInProducerRegistry() {
86790
87319
  const producers = /* @__PURE__ */ new Map();
86791
- const lockfilePath = join24(new URL("../../..", import.meta.url).pathname, "pnpm-lock.yaml");
87320
+ const lockfilePath = join25(new URL("../../..", import.meta.url).pathname, "pnpm-lock.yaml");
86792
87321
  let lockfileBytes;
86793
87322
  try {
86794
87323
  lockfileBytes = await readFile28(lockfilePath);
@@ -86825,10 +87354,10 @@ async function createBuiltInProducerRegistry() {
86825
87354
  }
86826
87355
  async function readDirEntries(dirPath, relBase = "") {
86827
87356
  const entries = [];
86828
- const items = await readdir14(dirPath, { withFileTypes: true });
87357
+ const items = await readdir15(dirPath, { withFileTypes: true });
86829
87358
  for (const item of items) {
86830
87359
  if (item.name === ".git") continue;
86831
- const absPath = join24(dirPath, item.name);
87360
+ const absPath = join25(dirPath, item.name);
86832
87361
  const relPath = relBase ? `${relBase}/${item.name}` : item.name;
86833
87362
  const st = await stat6(absPath);
86834
87363
  if (st.isDirectory()) {
@@ -86851,11 +87380,11 @@ async function readDirEntries(dirPath, relBase = "") {
86851
87380
  async function materializeEntries(entries, dirPath) {
86852
87381
  for (const entry of entries) {
86853
87382
  if (!entry.path) continue;
86854
- const targetPath = join24(dirPath, entry.path);
87383
+ const targetPath = join25(dirPath, entry.path);
86855
87384
  if (entry.type === "tree" || entry.kind === "tree") {
86856
87385
  await mkdir15(targetPath, { recursive: true });
86857
87386
  } else {
86858
- await mkdir15(join24(targetPath, ".."), { recursive: true });
87387
+ await mkdir15(join25(targetPath, ".."), { recursive: true });
86859
87388
  if (entry.content) {
86860
87389
  await writeFile9(targetPath, entry.content);
86861
87390
  }
@@ -86899,7 +87428,7 @@ async function runProducerClosure({
86899
87428
  graph,
86900
87429
  inputSnapshot,
86901
87430
  artifactIds,
86902
- tempRootFactory = /* @__PURE__ */ __name(async () => mkdtemp5(join24(tmpdir5(), "producer-")), "tempRootFactory")
87431
+ tempRootFactory = /* @__PURE__ */ __name(async () => mkdtemp5(join25(tmpdir5(), "producer-")), "tempRootFactory")
86903
87432
  } = {}) {
86904
87433
  const generatedSet = new Set(graph.topologicalOrder);
86905
87434
  for (const id of artifactIds) {
@@ -86936,7 +87465,7 @@ async function runProducerClosure({
86936
87465
  if (inputEntries) {
86937
87466
  const first = inputEntries[0];
86938
87467
  if (first && first.path) {
86939
- const absPath = first.path.startsWith("/") ? first.path : join24(process.cwd(), first.path);
87468
+ const absPath = first.path.startsWith("/") ? first.path : join25(process.cwd(), first.path);
86940
87469
  try {
86941
87470
  const st = await stat6(absPath);
86942
87471
  if (st.isDirectory()) {
@@ -88049,8 +88578,8 @@ var init_adoption = __esm({
88049
88578
  // src/artifacts/inspect.mjs
88050
88579
  import { promisify as promisify16 } from "node:util";
88051
88580
  import { execFile as execFile15 } from "node:child_process";
88052
- import { readdir as readdir15, stat as stat7, readFile as readFile30 } from "node:fs/promises";
88053
- import { join as join25 } from "node:path";
88581
+ import { readdir as readdir16, stat as stat7, readFile as readFile30 } from "node:fs/promises";
88582
+ import { join as join26 } from "node:path";
88054
88583
  async function hasNestedGitRoots(root) {
88055
88584
  try {
88056
88585
  const { stdout } = await execFileAsync5(
@@ -88060,9 +88589,9 @@ async function hasNestedGitRoots(root) {
88060
88589
  );
88061
88590
  const dirs = stdout.split("\n").filter((s) => s.length > 0);
88062
88591
  for (const dir of dirs) {
88063
- const absDir = join25(root, dir);
88592
+ const absDir = join26(root, dir);
88064
88593
  try {
88065
- const nestedGit = join25(absDir, ".git");
88594
+ const nestedGit = join26(absDir, ".git");
88066
88595
  await stat7(nestedGit);
88067
88596
  return true;
88068
88597
  } catch {
@@ -88321,8 +88850,8 @@ var init_inspect = __esm({
88321
88850
  });
88322
88851
 
88323
88852
  // src/artifacts/resolution.mjs
88324
- import { mkdir as mkdir17, open as open9, readFile as readFile31, stat as stat8, lstat as lstat16, chmod as chmod4 } from "node:fs/promises";
88325
- import { join as join26, resolve as resolve26, relative as relative24, isAbsolute as isAbsolute20, basename as basename9 } from "node:path";
88853
+ import { mkdir as mkdir17, open as open9, readFile as readFile31, stat as stat8, lstat as lstat17, chmod as chmod4 } from "node:fs/promises";
88854
+ import { join as join27, resolve as resolve27, relative as relative25, isAbsolute as isAbsolute21, basename as basename9 } from "node:path";
88326
88855
  function decodeBuffer(value, label) {
88327
88856
  if (value == null) return null;
88328
88857
  if (Buffer.isBuffer(value)) return value;
@@ -88424,13 +88953,13 @@ function assertSafeArtifactId(id) {
88424
88953
  }
88425
88954
  async function assertNoSymlinksInPath(root, artifactId) {
88426
88955
  const levels = [
88427
- join26(root, ".release-skill"),
88428
- join26(root, ".release-skill", "resolution"),
88429
- join26(root, ".release-skill", "resolution", artifactId)
88956
+ join27(root, ".release-skill"),
88957
+ join27(root, ".release-skill", "resolution"),
88958
+ join27(root, ".release-skill", "resolution", artifactId)
88430
88959
  ];
88431
88960
  for (const dir of levels) {
88432
88961
  try {
88433
- const st = await lstat16(dir);
88962
+ const st = await lstat17(dir);
88434
88963
  if (st.isSymbolicLink()) {
88435
88964
  throw new ReleaseError(PATH_UNSAFE, `directory is a symlink: ${dir}`, { path: dir });
88436
88965
  }
@@ -88442,11 +88971,11 @@ async function assertNoSymlinksInPath(root, artifactId) {
88442
88971
  }
88443
88972
  }
88444
88973
  async function assertSafeResolvedPath(root, artifactId, resolvedPath) {
88445
- const resolutionDir = resolve26(root, ".release-skill", "resolution", artifactId);
88446
- const resolved = resolve26(resolvedPath);
88974
+ const resolutionDir = resolve27(root, ".release-skill", "resolution", artifactId);
88975
+ const resolved = resolve27(resolvedPath);
88447
88976
  await assertNoSymlinksInPath(root, artifactId);
88448
- const rel = relative24(resolutionDir, resolved);
88449
- if (rel.startsWith("..") || isAbsolute20(rel)) {
88977
+ const rel = relative25(resolutionDir, resolved);
88978
+ if (rel.startsWith("..") || isAbsolute21(rel)) {
88450
88979
  throw new ReleaseError(
88451
88980
  PATH_UNSAFE,
88452
88981
  `resolvedPath must be inside resolution directory ${resolutionDir}`,
@@ -88461,7 +88990,7 @@ async function assertSafeResolvedPath(root, artifactId, resolvedPath) {
88461
88990
  { resolvedPath, expected: `${artifactId}.resolved`, actual: filename }
88462
88991
  );
88463
88992
  }
88464
- if (resolved !== resolve26(resolutionDir, `${artifactId}.resolved`)) {
88993
+ if (resolved !== resolve27(resolutionDir, `${artifactId}.resolved`)) {
88465
88994
  throw new ReleaseError(
88466
88995
  PATH_UNSAFE,
88467
88996
  "resolvedPath must be the exact materialized resolution file",
@@ -88470,7 +88999,7 @@ async function assertSafeResolvedPath(root, artifactId, resolvedPath) {
88470
88999
  }
88471
89000
  let st;
88472
89001
  try {
88473
- st = await lstat16(resolvedPath);
89002
+ st = await lstat17(resolvedPath);
88474
89003
  } catch (err) {
88475
89004
  throw new ReleaseError(
88476
89005
  MISSING_PARAMETERS,
@@ -88605,13 +89134,13 @@ async function materializeResolution({
88605
89134
  const template = buildConflictTemplate(artifact.conflict ?? {}, decodedBuffers);
88606
89135
  const templateDigest = sha256Hex(template);
88607
89136
  await assertNoSymlinksInPath(root, artifactId);
88608
- const resolutionDir = join26(root, ".release-skill", "resolution", artifactId);
89137
+ const resolutionDir = join27(root, ".release-skill", "resolution", artifactId);
88609
89138
  await mkdir17(resolutionDir, { recursive: true, mode: 448 });
88610
89139
  const dirStat = await stat8(resolutionDir);
88611
89140
  if ((dirStat.mode & 511) !== 448) {
88612
89141
  await chmod4(resolutionDir, 448);
88613
89142
  }
88614
- const resolvedPath = join26(resolutionDir, `${artifactId}.resolved`);
89143
+ const resolvedPath = join27(resolutionDir, `${artifactId}.resolved`);
88615
89144
  const fh = await open9(resolvedPath, "wx", 384);
88616
89145
  try {
88617
89146
  await fh.write(template, 0, template.length);
@@ -88822,7 +89351,7 @@ __export(artifacts_exports, {
88822
89351
  runArtifactsCommand: () => runArtifactsCommand
88823
89352
  });
88824
89353
  import { readFile as readFile32 } from "node:fs/promises";
88825
- import { join as join27 } from "node:path";
89354
+ import { join as join28 } from "node:path";
88826
89355
  async function runArtifactsCommand({ subcommand, args: args2, root } = {}) {
88827
89356
  if (!VALID_SUBCOMMANDS.has(subcommand)) {
88828
89357
  throw new ReleaseError(
@@ -88965,7 +89494,7 @@ async function handleAdopt({ args: args2, root }) {
88965
89494
  if (artifact.path) {
88966
89495
  const entry = await readEntry({ root, path: artifact.path, source: "worktree" });
88967
89496
  if (entry.kind === "regular") {
88968
- const bytes = await readFile32(join27(root, artifact.path));
89497
+ const bytes = await readFile32(join28(root, artifact.path));
88969
89498
  currentEntries.set(artifact.id, Object.freeze({ ...entry, bytes, content: bytes }));
88970
89499
  } else {
88971
89500
  currentEntries.set(artifact.id, entry);
@@ -89042,7 +89571,7 @@ async function handleBootstrap({ args: args2, root }) {
89042
89571
  if (entry.kind !== "regular") {
89043
89572
  throw new ReleaseError("PLAN_STALE", `artifact is no longer a regular file: ${id}`, { id });
89044
89573
  }
89045
- const bytes = await readFile32(join27(root, artifactPath));
89574
+ const bytes = await readFile32(join28(root, artifactPath));
89046
89575
  currentEntries.set(id, Object.freeze({ ...entry, bytes, content: bytes }));
89047
89576
  }
89048
89577
  let replacementBytes;
@@ -89453,7 +89982,7 @@ var init_docs = __esm({
89453
89982
  });
89454
89983
 
89455
89984
  // bin/release-skill-cli.mjs
89456
- import { basename as basename10, dirname as dirname15, join as join28, resolve as resolve27 } from "node:path";
89985
+ import { basename as basename10, dirname as dirname15, join as join29, resolve as resolve28 } from "node:path";
89457
89986
  import { execFile as execFileCb13 } from "node:child_process";
89458
89987
  import { promisify as promisify17 } from "node:util";
89459
89988
 
@@ -89707,7 +90236,7 @@ if (!command && (args.includes("--version") || args.includes("-v"))) {
89707
90236
  } else {
89708
90237
  const { readFileSync: readFileSync5 } = await import("node:fs");
89709
90238
  const { fileURLToPath: fileURLToPath3 } = await import("node:url");
89710
- const pkgPath = join28(dirname15(fileURLToPath3(import.meta.url)), "..", "package.json");
90239
+ const pkgPath = join29(dirname15(fileURLToPath3(import.meta.url)), "..", "package.json");
89711
90240
  pkg = JSON.parse(readFileSync5(pkgPath, "utf8"));
89712
90241
  }
89713
90242
  if (hasJson) {
@@ -89828,7 +90357,7 @@ if (!COMMANDS.has(command)) {
89828
90357
  if (command === "setup") {
89829
90358
  const rootIdx = args.indexOf("--root");
89830
90359
  const rawRoot = rootIdx !== -1 && args[rootIdx + 1] ? args[rootIdx + 1] : process.cwd();
89831
- const root = resolve27(rawRoot);
90360
+ const root = resolve28(rawRoot);
89832
90361
  const answersIdx = args.indexOf("--answers");
89833
90362
  const answersPath = answersIdx !== -1 && args[answersIdx + 1] ? args[answersIdx + 1] : void 0;
89834
90363
  const confirmationIdx = args.indexOf("--confirm-setup");
@@ -89863,7 +90392,7 @@ if (command === "setup") {
89863
90392
  if (command === "assess") {
89864
90393
  const rootIdx = args.indexOf("--root");
89865
90394
  const rawRoot = rootIdx !== -1 && args[rootIdx + 1] ? args[rootIdx + 1] : process.cwd();
89866
- const root = resolve27(rawRoot);
90395
+ const root = resolve28(rawRoot);
89867
90396
  const offline = args.includes("--offline") || !args.includes("--online");
89868
90397
  const outputIdx = args.indexOf("--output");
89869
90398
  const output = outputIdx !== -1 && args[outputIdx + 1] ? args[outputIdx + 1] : void 0;
@@ -89894,7 +90423,7 @@ if (command === "assess") {
89894
90423
  if (command === "prepare") {
89895
90424
  const rootIdx = args.indexOf("--root");
89896
90425
  const rawRoot = rootIdx !== -1 && args[rootIdx + 1] ? args[rootIdx + 1] : process.cwd();
89897
- const root = resolve27(rawRoot);
90426
+ const root = resolve28(rawRoot);
89898
90427
  const offline = args.includes("--offline") || !args.includes("--online");
89899
90428
  let targetVersion;
89900
90429
  for (const flag of ["--target-version", "--version"]) {
@@ -89909,9 +90438,9 @@ if (command === "prepare") {
89909
90438
  const hookCache = !args.includes("--no-hook-cache");
89910
90439
  const production = args.includes("--production");
89911
90440
  const outputIdx = args.indexOf("--output");
89912
- const output = outputIdx !== -1 && args[outputIdx + 1] ? resolve27(args[outputIdx + 1]) : void 0;
90441
+ const output = outputIdx !== -1 && args[outputIdx + 1] ? resolve28(args[outputIdx + 1]) : void 0;
89913
90442
  const runDirIdx = args.indexOf("--run-dir");
89914
- const runDir = runDirIdx !== -1 && args[runDirIdx + 1] ? resolve27(args[runDirIdx + 1]) : void 0;
90443
+ const runDir = runDirIdx !== -1 && args[runDirIdx + 1] ? resolve28(args[runDirIdx + 1]) : void 0;
89915
90444
  try {
89916
90445
  const { prepareRelease: prepareRelease2 } = await init_prepare().then(() => prepare_exports);
89917
90446
  const { readFile: readFileFs } = await import("node:fs/promises");
@@ -89933,9 +90462,13 @@ if (command === "prepare") {
89933
90462
  ...plan,
89934
90463
  planPath: result.planPath,
89935
90464
  planDigest: result.planDigest,
89936
- evidenceDir: result.evidenceDir
90465
+ evidenceDir: result.evidenceDir,
90466
+ warnings: result.warnings
89937
90467
  }, null, 2));
89938
90468
  } else {
90469
+ for (const warning of result.warnings) {
90470
+ console.log(`Warning [${warning.code}] ${warning.message}`);
90471
+ }
89939
90472
  console.log(`Plan frozen at: ${result.planPath}`);
89940
90473
  console.log(`Plan digest: ${result.planDigest}`);
89941
90474
  console.log(`Evidence: ${result.evidenceDir}`);
@@ -89964,7 +90497,7 @@ if (command === "approve") {
89964
90497
  const actorIdx = args.indexOf("--actor");
89965
90498
  const actor = actorIdx !== -1 && args[actorIdx + 1] ? args[actorIdx + 1] : void 0;
89966
90499
  const outputIdx = args.indexOf("--output");
89967
- const outputPath = outputIdx !== -1 && args[outputIdx + 1] ? resolve27(args[outputIdx + 1]) : void 0;
90500
+ const outputPath = outputIdx !== -1 && args[outputIdx + 1] ? resolve28(args[outputIdx + 1]) : void 0;
89968
90501
  if (!planPath || !expectedDigest || !actor) {
89969
90502
  const msg = "approve requires --plan <path>, --digest <sha256>, and --actor <name>";
89970
90503
  if (hasJson) {
@@ -89976,10 +90509,10 @@ if (command === "approve") {
89976
90509
  }
89977
90510
  try {
89978
90511
  const { approvePlan: approvePlan2 } = await init_approve().then(() => approve_exports);
89979
- const resolvedPlanPath = resolve27(planPath);
90512
+ const resolvedPlanPath = resolve28(planPath);
89980
90513
  const planDir = dirname15(resolvedPlanPath);
89981
90514
  const releaseDir = basename10(planDir) === "plans" && basename10(resolvedPlanPath) === `${expectedDigest}.json` ? dirname15(planDir) : planDir;
89982
- const approvalPath = outputPath ?? join28(releaseDir, "approval-record.json");
90515
+ const approvalPath = outputPath ?? join29(releaseDir, "approval-record.json");
89983
90516
  const record = await approvePlan2({ planPath, expectedDigest, actor, outputPath: approvalPath });
89984
90517
  if (hasJson) {
89985
90518
  console.log(JSON.stringify(record, null, 2));
@@ -90006,13 +90539,13 @@ if (command === "approve") {
90006
90539
  if (command === "reconcile") {
90007
90540
  const rootIdx = args.indexOf("--root");
90008
90541
  const rawRoot = rootIdx !== -1 && args[rootIdx + 1] ? args[rootIdx + 1] : process.cwd();
90009
- const root = resolve27(rawRoot);
90542
+ const root = resolve28(rawRoot);
90010
90543
  const planIdx = args.indexOf("--plan");
90011
- const planPath = planIdx !== -1 && args[planIdx + 1] ? resolve27(args[planIdx + 1]) : void 0;
90544
+ const planPath = planIdx !== -1 && args[planIdx + 1] ? resolve28(args[planIdx + 1]) : void 0;
90012
90545
  const runIdx = args.indexOf("--run");
90013
- const runPath = runIdx !== -1 && args[runIdx + 1] ? resolve27(args[runIdx + 1]) : void 0;
90546
+ const runPath = runIdx !== -1 && args[runIdx + 1] ? resolve28(args[runIdx + 1]) : void 0;
90014
90547
  const approvalIdx = args.indexOf("--approval");
90015
- const approvalPath = approvalIdx !== -1 && args[approvalIdx + 1] ? resolve27(args[approvalIdx + 1]) : void 0;
90548
+ const approvalPath = approvalIdx !== -1 && args[approvalIdx + 1] ? resolve28(args[approvalIdx + 1]) : void 0;
90016
90549
  const confirmationIdx = args.indexOf("--confirm-production");
90017
90550
  const productionConfirmation = confirmationIdx !== -1 && args[confirmationIdx + 1] ? args[confirmationIdx + 1] : void 0;
90018
90551
  if (!planPath || !runPath) {
@@ -90071,11 +90604,11 @@ if (command === "reconcile") {
90071
90604
  if (command === "verify") {
90072
90605
  const rootIdx = args.indexOf("--root");
90073
90606
  const rawRoot = rootIdx !== -1 && args[rootIdx + 1] ? args[rootIdx + 1] : process.cwd();
90074
- const root = resolve27(rawRoot);
90607
+ const root = resolve28(rawRoot);
90075
90608
  const planIdx = args.indexOf("--plan");
90076
- const planPath = planIdx !== -1 && args[planIdx + 1] ? resolve27(args[planIdx + 1]) : void 0;
90609
+ const planPath = planIdx !== -1 && args[planIdx + 1] ? resolve28(args[planIdx + 1]) : void 0;
90077
90610
  const runIdx = args.indexOf("--run");
90078
- const runPath = runIdx !== -1 && args[runIdx + 1] ? resolve27(args[runIdx + 1]) : void 0;
90611
+ const runPath = runIdx !== -1 && args[runIdx + 1] ? resolve28(args[runIdx + 1]) : void 0;
90079
90612
  const verificationGatesAuthorized = args.includes("--acknowledge-gate-side-effects");
90080
90613
  if (!planPath || !runPath) {
90081
90614
  const msg = "verify requires --plan <path> and --run <path>";
@@ -90131,11 +90664,11 @@ if (command === "verify") {
90131
90664
  if (command === "publish") {
90132
90665
  const rootIdx = args.indexOf("--root");
90133
90666
  const rawRoot = rootIdx !== -1 && args[rootIdx + 1] ? args[rootIdx + 1] : process.cwd();
90134
- const root = resolve27(rawRoot);
90667
+ const root = resolve28(rawRoot);
90135
90668
  const planIdx = args.indexOf("--plan");
90136
- const planPath = planIdx !== -1 && args[planIdx + 1] ? resolve27(args[planIdx + 1]) : void 0;
90669
+ const planPath = planIdx !== -1 && args[planIdx + 1] ? resolve28(args[planIdx + 1]) : void 0;
90137
90670
  const approvalIdx = args.indexOf("--approval");
90138
- const approvalPath = approvalIdx !== -1 && args[approvalIdx + 1] ? resolve27(args[approvalIdx + 1]) : void 0;
90671
+ const approvalPath = approvalIdx !== -1 && args[approvalIdx + 1] ? resolve28(args[approvalIdx + 1]) : void 0;
90139
90672
  const confirmationIdx = args.indexOf("--confirm-production");
90140
90673
  const productionConfirmation = confirmationIdx !== -1 && args[confirmationIdx + 1] ? args[confirmationIdx + 1] : void 0;
90141
90674
  if (!planPath || !approvalPath || !productionConfirmation) {
@@ -90194,9 +90727,9 @@ if (command === "publish") {
90194
90727
  if (command === "artifacts") {
90195
90728
  const rootIdx = args.indexOf("--root");
90196
90729
  const rawRoot = rootIdx !== -1 && args[rootIdx + 1] ? args[rootIdx + 1] : process.cwd();
90197
- const root = resolve27(rawRoot);
90730
+ const root = resolve28(rawRoot);
90198
90731
  const outputIdx = args.indexOf("--output");
90199
- const output = outputIdx !== -1 && args[outputIdx + 1] ? resolve27(args[outputIdx + 1]) : void 0;
90732
+ const output = outputIdx !== -1 && args[outputIdx + 1] ? resolve28(args[outputIdx + 1]) : void 0;
90200
90733
  const subcommand = positional[1] ?? "status";
90201
90734
  try {
90202
90735
  const { runArtifactsCommand: runArtifactsCommand2 } = await Promise.resolve().then(() => (init_artifacts(), artifacts_exports));
@@ -90263,7 +90796,7 @@ if (command === "docs") {
90263
90796
  );
90264
90797
  }
90265
90798
  }
90266
- const root = resolve27(rawRoot);
90799
+ const root = resolve28(rawRoot);
90267
90800
  const valuedDocsFlags = /* @__PURE__ */ new Set(["--root", "--unit", "--confirm-refresh"]);
90268
90801
  const booleanDocsFlags = /* @__PURE__ */ new Set(["--json", "--write", "--ack-local-document-write"]);
90269
90802
  let docsSubcommand;