release-skill 0.2.5 → 0.2.6
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.
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.codebuddy-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +2 -2
- package/.kimi-plugin/plugin.json +1 -1
- package/CHANGELOG.md +21 -0
- package/INSTALL.md +32 -8
- package/INSTALL.zh-CN.md +28 -6
- package/README.md +26 -14
- package/README.zh-CN.md +24 -14
- package/adapters/claude/.claude-plugin/marketplace.json +1 -1
- package/adapters/claude/.claude-plugin/plugin.json +1 -1
- package/adapters/claude/bin/release-skill.bundle.mjs +1340 -614
- package/adapters/claude/schemas/.render-manifest.json +6 -6
- package/adapters/claude/schemas/release-plan.schema.json +67 -0
- package/adapters/claude/schemas/release-project.schema.json +6 -0
- package/adapters/claude/schemas/release-run.schema.json +65 -0
- package/adapters/codex/.codex-plugin/plugin.json +2 -2
- package/adapters/codex/bin/release-skill.bundle.mjs +1340 -614
- package/adapters/codex/schemas/.render-manifest.json +6 -6
- package/adapters/codex/schemas/release-plan.schema.json +67 -0
- package/adapters/codex/schemas/release-project.schema.json +6 -0
- package/adapters/codex/schemas/release-run.schema.json +65 -0
- package/adapters/kimi/.kimi-plugin/plugin.json +1 -1
- package/adapters/kimi/bin/release-skill.bundle.mjs +1340 -614
- package/adapters/kimi/schemas/.render-manifest.json +6 -6
- package/adapters/kimi/schemas/release-plan.schema.json +67 -0
- package/adapters/kimi/schemas/release-project.schema.json +6 -0
- package/adapters/kimi/schemas/release-run.schema.json +65 -0
- package/adapters/workbuddy/.codebuddy-plugin/plugin.json +1 -1
- package/adapters/workbuddy/bin/release-skill.bundle.mjs +1340 -614
- package/adapters/workbuddy/schemas/.render-manifest.json +6 -6
- package/adapters/workbuddy/schemas/release-plan.schema.json +67 -0
- package/adapters/workbuddy/schemas/release-project.schema.json +6 -0
- package/adapters/workbuddy/schemas/release-run.schema.json +65 -0
- package/bin/release-skill.bundle.mjs +1340 -614
- package/package.json +1 -1
- package/references/.render-manifest.json +4 -4
- package/references/02-project-config.md +28 -2
- package/references/05-evidence-and-errors.md +6 -0
- package/schemas/.render-manifest.json +6 -6
- package/schemas/release-plan.schema.json +67 -0
- package/schemas/release-project.schema.json +6 -0
- package/schemas/release-run.schema.json +65 -0
- package/src/commands/prepare.mjs +158 -1
- package/src/commands/publish.mjs +72 -0
- package/src/commands/reconcile.mjs +19 -0
- package/src/commands/setup.mjs +26 -0
- package/src/commands/verify.mjs +32 -0
- package/src/core/errors.mjs +12 -0
- package/src/core/source-authority.mjs +547 -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.
|
|
12
|
+
const __bundlePkg = Object.freeze({"name":"release-skill","version":"0.2.6"});
|
|
13
13
|
|
|
14
14
|
var __create = Object.create;
|
|
15
15
|
var __defProp = Object.defineProperty;
|
|
@@ -177,8 +177,11 @@ __export(errors_exports, {
|
|
|
177
177
|
BASE_UNAVAILABLE: () => BASE_UNAVAILABLE,
|
|
178
178
|
CONFIG_EXISTS: () => CONFIG_EXISTS,
|
|
179
179
|
CONFIG_INVALID: () => CONFIG_INVALID,
|
|
180
|
+
CONFIG_MISSING: () => CONFIG_MISSING,
|
|
180
181
|
CONSUMER_VERIFICATION_DEFERRED: () => CONSUMER_VERIFICATION_DEFERRED,
|
|
182
|
+
CONTENT_MISMATCH: () => CONTENT_MISMATCH,
|
|
181
183
|
DIRTY_SCOPE_CONFLICT: () => DIRTY_SCOPE_CONFLICT,
|
|
184
|
+
DIRTY_SOURCE_INPUT: () => DIRTY_SOURCE_INPUT,
|
|
182
185
|
EXIT_CODE_MAP: () => EXIT_CODE_MAP,
|
|
183
186
|
FORBIDDEN_CONTENT_DETECTED: () => FORBIDDEN_CONTENT_DETECTED,
|
|
184
187
|
GATE_FAILED: () => GATE_FAILED,
|
|
@@ -186,6 +189,7 @@ __export(errors_exports, {
|
|
|
186
189
|
INVALID_STATE_TRANSITION: () => INVALID_STATE_TRANSITION,
|
|
187
190
|
LOCK_MIGRATION_REQUIRED: () => LOCK_MIGRATION_REQUIRED,
|
|
188
191
|
MISSING_PARAMETERS: () => MISSING_PARAMETERS,
|
|
192
|
+
NOT_DEFAULT: () => NOT_DEFAULT,
|
|
189
193
|
PARTIAL_RELEASE: () => PARTIAL_RELEASE,
|
|
190
194
|
PATH_UNSAFE: () => PATH_UNSAFE,
|
|
191
195
|
PLAN_DIGEST_MISMATCH: () => PLAN_DIGEST_MISMATCH,
|
|
@@ -195,12 +199,14 @@ __export(errors_exports, {
|
|
|
195
199
|
PRODUCER_SCOPE_VIOLATION: () => PRODUCER_SCOPE_VIOLATION,
|
|
196
200
|
PUBLIC_FILE_MISSING: () => PUBLIC_FILE_MISSING,
|
|
197
201
|
PUBLIC_PATH_FORBIDDEN: () => PUBLIC_PATH_FORBIDDEN,
|
|
202
|
+
REF_MISSING: () => REF_MISSING,
|
|
198
203
|
RELEASE_DOCS_CONFLICT: () => RELEASE_DOCS_CONFLICT,
|
|
199
204
|
RELEASE_DOCS_INVALID: () => RELEASE_DOCS_INVALID,
|
|
200
205
|
RELEASE_DOCS_REFRESH_STALE: () => RELEASE_DOCS_REFRESH_STALE,
|
|
201
206
|
RELEASE_DOCS_STALE: () => RELEASE_DOCS_STALE,
|
|
202
207
|
RELEASE_DOCS_TRANSLATION_MISSING: () => RELEASE_DOCS_TRANSLATION_MISSING,
|
|
203
208
|
REMOTE_CONFLICT: () => REMOTE_CONFLICT,
|
|
209
|
+
REMOTE_UNAVAILABLE: () => REMOTE_UNAVAILABLE,
|
|
204
210
|
ReleaseError: () => ReleaseError,
|
|
205
211
|
SAFE_WRITE_UNAVAILABLE: () => SAFE_WRITE_UNAVAILABLE,
|
|
206
212
|
SECRET_DETECTED: () => SECRET_DETECTED,
|
|
@@ -215,7 +221,7 @@ __export(errors_exports, {
|
|
|
215
221
|
function registerPathRedactor(fn) {
|
|
216
222
|
if (typeof fn === "function") redactSensitivePaths2 = fn;
|
|
217
223
|
}
|
|
218
|
-
var redactSensitivePaths2, EXIT_CODE_MAP, CONFIG_INVALID, BASELINE_CHANGED, DIRTY_SCOPE_CONFLICT, GATE_FAILED, AUTH_MISSING, REMOTE_CONFLICT, HOOK_TIMEOUT, PARTIAL_RELEASE, POST_PUBLISH_VERIFY_FAILED, INVALID_STATE_TRANSITION, PLAN_DIGEST_MISMATCH, SECRET_DETECTED, PUBLIC_PATH_FORBIDDEN, STALE_BUILD_ARTIFACT, MISSING_PARAMETERS, PUBLIC_FILE_MISSING, SNAPSHOT_FIDELITY_FAILED, FORBIDDEN_CONTENT_DETECTED, PATH_UNSAFE, STRUCTURE_INVALID, LOCK_MIGRATION_REQUIRED, ARTIFACT_POLICY_INVALID, BASE_UNAVAILABLE, PRODUCER_NONDETERMINISTIC, PRODUCER_SCOPE_VIOLATION, ADOPTION_AMBIGUOUS, PLAN_STALE, SENSITIVE_CONFLICT, TRANSACTION_INCOMPLETE, SAFE_WRITE_UNAVAILABLE, SETUP_DIGEST_MISMATCH, CONFIG_EXISTS, RELEASE_DOCS_INVALID, RELEASE_DOCS_TRANSLATION_MISSING, RELEASE_DOCS_CONFLICT, RELEASE_DOCS_REFRESH_STALE, RELEASE_DOCS_STALE, CONSUMER_VERIFICATION_DEFERRED, ReleaseError, ALL_ERROR_CODES;
|
|
224
|
+
var redactSensitivePaths2, EXIT_CODE_MAP, CONFIG_INVALID, BASELINE_CHANGED, DIRTY_SCOPE_CONFLICT, GATE_FAILED, AUTH_MISSING, REMOTE_CONFLICT, HOOK_TIMEOUT, PARTIAL_RELEASE, POST_PUBLISH_VERIFY_FAILED, INVALID_STATE_TRANSITION, PLAN_DIGEST_MISMATCH, SECRET_DETECTED, PUBLIC_PATH_FORBIDDEN, STALE_BUILD_ARTIFACT, MISSING_PARAMETERS, PUBLIC_FILE_MISSING, SNAPSHOT_FIDELITY_FAILED, FORBIDDEN_CONTENT_DETECTED, PATH_UNSAFE, STRUCTURE_INVALID, LOCK_MIGRATION_REQUIRED, ARTIFACT_POLICY_INVALID, BASE_UNAVAILABLE, PRODUCER_NONDETERMINISTIC, PRODUCER_SCOPE_VIOLATION, ADOPTION_AMBIGUOUS, PLAN_STALE, SENSITIVE_CONFLICT, TRANSACTION_INCOMPLETE, SAFE_WRITE_UNAVAILABLE, SETUP_DIGEST_MISMATCH, CONFIG_EXISTS, RELEASE_DOCS_INVALID, RELEASE_DOCS_TRANSLATION_MISSING, RELEASE_DOCS_CONFLICT, RELEASE_DOCS_REFRESH_STALE, RELEASE_DOCS_STALE, CONSUMER_VERIFICATION_DEFERRED, CONFIG_MISSING, REMOTE_UNAVAILABLE, REF_MISSING, NOT_DEFAULT, CONTENT_MISMATCH, DIRTY_SOURCE_INPUT, ReleaseError, ALL_ERROR_CODES;
|
|
219
225
|
var init_errors = __esm({
|
|
220
226
|
"src/core/errors.mjs"() {
|
|
221
227
|
redactSensitivePaths2 = /* @__PURE__ */ __name((value) => value, "redactSensitivePaths");
|
|
@@ -263,7 +269,13 @@ var init_errors = __esm({
|
|
|
263
269
|
RELEASE_DOCS_CONFLICT: 44,
|
|
264
270
|
RELEASE_DOCS_REFRESH_STALE: 45,
|
|
265
271
|
RELEASE_DOCS_STALE: 46,
|
|
266
|
-
CONSUMER_VERIFICATION_DEFERRED: 47
|
|
272
|
+
CONSUMER_VERIFICATION_DEFERRED: 47,
|
|
273
|
+
CONFIG_MISSING: 48,
|
|
274
|
+
REMOTE_UNAVAILABLE: 49,
|
|
275
|
+
REF_MISSING: 50,
|
|
276
|
+
NOT_DEFAULT: 51,
|
|
277
|
+
CONTENT_MISMATCH: 52,
|
|
278
|
+
DIRTY_SOURCE_INPUT: 53
|
|
267
279
|
});
|
|
268
280
|
CONFIG_INVALID = "CONFIG_INVALID";
|
|
269
281
|
BASELINE_CHANGED = "BASELINE_CHANGED";
|
|
@@ -303,6 +315,12 @@ var init_errors = __esm({
|
|
|
303
315
|
RELEASE_DOCS_REFRESH_STALE = "RELEASE_DOCS_REFRESH_STALE";
|
|
304
316
|
RELEASE_DOCS_STALE = "RELEASE_DOCS_STALE";
|
|
305
317
|
CONSUMER_VERIFICATION_DEFERRED = "CONSUMER_VERIFICATION_DEFERRED";
|
|
318
|
+
CONFIG_MISSING = "CONFIG_MISSING";
|
|
319
|
+
REMOTE_UNAVAILABLE = "REMOTE_UNAVAILABLE";
|
|
320
|
+
REF_MISSING = "REF_MISSING";
|
|
321
|
+
NOT_DEFAULT = "NOT_DEFAULT";
|
|
322
|
+
CONTENT_MISMATCH = "CONTENT_MISMATCH";
|
|
323
|
+
DIRTY_SOURCE_INPUT = "DIRTY_SOURCE_INPUT";
|
|
306
324
|
ReleaseError = class _ReleaseError extends Error {
|
|
307
325
|
static {
|
|
308
326
|
__name(this, "ReleaseError");
|
|
@@ -4407,10 +4425,10 @@ var require_resolve_block_map = __commonJS({
|
|
|
4407
4425
|
let offset = bm.offset;
|
|
4408
4426
|
let commentEnd = null;
|
|
4409
4427
|
for (const collItem of bm.items) {
|
|
4410
|
-
const { start, key, sep:
|
|
4428
|
+
const { start, key, sep: sep6, value } = collItem;
|
|
4411
4429
|
const keyProps = resolveProps.resolveProps(start, {
|
|
4412
4430
|
indicator: "explicit-key-ind",
|
|
4413
|
-
next: key ??
|
|
4431
|
+
next: key ?? sep6?.[0],
|
|
4414
4432
|
offset,
|
|
4415
4433
|
onError,
|
|
4416
4434
|
parentIndent: bm.indent,
|
|
@@ -4424,7 +4442,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
4424
4442
|
else if ("indent" in key && key.indent !== bm.indent)
|
|
4425
4443
|
onError(offset, "BAD_INDENT", startColMsg);
|
|
4426
4444
|
}
|
|
4427
|
-
if (!keyProps.anchor && !keyProps.tag && !
|
|
4445
|
+
if (!keyProps.anchor && !keyProps.tag && !sep6) {
|
|
4428
4446
|
commentEnd = keyProps.end;
|
|
4429
4447
|
if (keyProps.comment) {
|
|
4430
4448
|
if (map.comment)
|
|
@@ -4448,7 +4466,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
4448
4466
|
ctx.atKey = false;
|
|
4449
4467
|
if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode))
|
|
4450
4468
|
onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
|
|
4451
|
-
const valueProps = resolveProps.resolveProps(
|
|
4469
|
+
const valueProps = resolveProps.resolveProps(sep6 ?? [], {
|
|
4452
4470
|
indicator: "map-value-ind",
|
|
4453
4471
|
next: value,
|
|
4454
4472
|
offset: keyNode.range[2],
|
|
@@ -4464,7 +4482,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
4464
4482
|
if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024)
|
|
4465
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");
|
|
4466
4484
|
}
|
|
4467
|
-
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset,
|
|
4485
|
+
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset, sep6, null, valueProps, onError);
|
|
4468
4486
|
if (ctx.schema.compat)
|
|
4469
4487
|
utilFlowIndentCheck.flowIndentCheck(bm.indent, value, onError);
|
|
4470
4488
|
offset = valueNode.range[2];
|
|
@@ -4557,7 +4575,7 @@ var require_resolve_end = __commonJS({
|
|
|
4557
4575
|
let comment = "";
|
|
4558
4576
|
if (end) {
|
|
4559
4577
|
let hasSpace = false;
|
|
4560
|
-
let
|
|
4578
|
+
let sep6 = "";
|
|
4561
4579
|
for (const token of end) {
|
|
4562
4580
|
const { source, type } = token;
|
|
4563
4581
|
switch (type) {
|
|
@@ -4571,13 +4589,13 @@ var require_resolve_end = __commonJS({
|
|
|
4571
4589
|
if (!comment)
|
|
4572
4590
|
comment = cb;
|
|
4573
4591
|
else
|
|
4574
|
-
comment +=
|
|
4575
|
-
|
|
4592
|
+
comment += sep6 + cb;
|
|
4593
|
+
sep6 = "";
|
|
4576
4594
|
break;
|
|
4577
4595
|
}
|
|
4578
4596
|
case "newline":
|
|
4579
4597
|
if (comment)
|
|
4580
|
-
|
|
4598
|
+
sep6 += source;
|
|
4581
4599
|
hasSpace = true;
|
|
4582
4600
|
break;
|
|
4583
4601
|
default:
|
|
@@ -4621,18 +4639,18 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
4621
4639
|
let offset = fc.offset + fc.start.source.length;
|
|
4622
4640
|
for (let i = 0; i < fc.items.length; ++i) {
|
|
4623
4641
|
const collItem = fc.items[i];
|
|
4624
|
-
const { start, key, sep:
|
|
4642
|
+
const { start, key, sep: sep6, value } = collItem;
|
|
4625
4643
|
const props = resolveProps.resolveProps(start, {
|
|
4626
4644
|
flow: fcName,
|
|
4627
4645
|
indicator: "explicit-key-ind",
|
|
4628
|
-
next: key ??
|
|
4646
|
+
next: key ?? sep6?.[0],
|
|
4629
4647
|
offset,
|
|
4630
4648
|
onError,
|
|
4631
4649
|
parentIndent: fc.indent,
|
|
4632
4650
|
startOnNewline: false
|
|
4633
4651
|
});
|
|
4634
4652
|
if (!props.found) {
|
|
4635
|
-
if (!props.anchor && !props.tag && !
|
|
4653
|
+
if (!props.anchor && !props.tag && !sep6 && !value) {
|
|
4636
4654
|
if (i === 0 && props.comma)
|
|
4637
4655
|
onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`);
|
|
4638
4656
|
else if (i < fc.items.length - 1)
|
|
@@ -4686,8 +4704,8 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
4686
4704
|
}
|
|
4687
4705
|
}
|
|
4688
4706
|
}
|
|
4689
|
-
if (!isMap && !
|
|
4690
|
-
const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end,
|
|
4707
|
+
if (!isMap && !sep6 && !props.found) {
|
|
4708
|
+
const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, sep6, null, props, onError);
|
|
4691
4709
|
coll.items.push(valueNode);
|
|
4692
4710
|
offset = valueNode.range[2];
|
|
4693
4711
|
if (isBlock(value))
|
|
@@ -4699,7 +4717,7 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
4699
4717
|
if (isBlock(key))
|
|
4700
4718
|
onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
4701
4719
|
ctx.atKey = false;
|
|
4702
|
-
const valueProps = resolveProps.resolveProps(
|
|
4720
|
+
const valueProps = resolveProps.resolveProps(sep6 ?? [], {
|
|
4703
4721
|
flow: fcName,
|
|
4704
4722
|
indicator: "map-value-ind",
|
|
4705
4723
|
next: value,
|
|
@@ -4710,8 +4728,8 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
4710
4728
|
});
|
|
4711
4729
|
if (valueProps.found) {
|
|
4712
4730
|
if (!isMap && !props.found && ctx.options.strict) {
|
|
4713
|
-
if (
|
|
4714
|
-
for (const st of
|
|
4731
|
+
if (sep6)
|
|
4732
|
+
for (const st of sep6) {
|
|
4715
4733
|
if (st === valueProps.found)
|
|
4716
4734
|
break;
|
|
4717
4735
|
if (st.type === "newline") {
|
|
@@ -4728,7 +4746,7 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
4728
4746
|
else
|
|
4729
4747
|
onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`);
|
|
4730
4748
|
}
|
|
4731
|
-
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end,
|
|
4749
|
+
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep6, null, valueProps, onError) : null;
|
|
4732
4750
|
if (valueNode) {
|
|
4733
4751
|
if (isBlock(value))
|
|
4734
4752
|
onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
@@ -4911,7 +4929,7 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
4911
4929
|
chompStart = i + 1;
|
|
4912
4930
|
}
|
|
4913
4931
|
let value = "";
|
|
4914
|
-
let
|
|
4932
|
+
let sep6 = "";
|
|
4915
4933
|
let prevMoreIndented = false;
|
|
4916
4934
|
for (let i = 0; i < contentStart; ++i)
|
|
4917
4935
|
value += lines[i][0].slice(trimIndent) + "\n";
|
|
@@ -4928,24 +4946,24 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
4928
4946
|
indent = "";
|
|
4929
4947
|
}
|
|
4930
4948
|
if (type === Scalar.Scalar.BLOCK_LITERAL) {
|
|
4931
|
-
value +=
|
|
4932
|
-
|
|
4949
|
+
value += sep6 + indent.slice(trimIndent) + content;
|
|
4950
|
+
sep6 = "\n";
|
|
4933
4951
|
} else if (indent.length > trimIndent || content[0] === " ") {
|
|
4934
|
-
if (
|
|
4935
|
-
|
|
4936
|
-
else if (!prevMoreIndented &&
|
|
4937
|
-
|
|
4938
|
-
value +=
|
|
4939
|
-
|
|
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";
|
|
4940
4958
|
prevMoreIndented = true;
|
|
4941
4959
|
} else if (content === "") {
|
|
4942
|
-
if (
|
|
4960
|
+
if (sep6 === "\n")
|
|
4943
4961
|
value += "\n";
|
|
4944
4962
|
else
|
|
4945
|
-
|
|
4963
|
+
sep6 = "\n";
|
|
4946
4964
|
} else {
|
|
4947
|
-
value +=
|
|
4948
|
-
|
|
4965
|
+
value += sep6 + content;
|
|
4966
|
+
sep6 = " ";
|
|
4949
4967
|
prevMoreIndented = false;
|
|
4950
4968
|
}
|
|
4951
4969
|
}
|
|
@@ -5133,25 +5151,25 @@ var require_resolve_flow_scalar = __commonJS({
|
|
|
5133
5151
|
if (!match)
|
|
5134
5152
|
return source;
|
|
5135
5153
|
let res = match[1];
|
|
5136
|
-
let
|
|
5154
|
+
let sep6 = " ";
|
|
5137
5155
|
let pos = first.lastIndex;
|
|
5138
5156
|
line.lastIndex = pos;
|
|
5139
5157
|
while (match = line.exec(source)) {
|
|
5140
5158
|
if (match[1] === "") {
|
|
5141
|
-
if (
|
|
5142
|
-
res +=
|
|
5159
|
+
if (sep6 === "\n")
|
|
5160
|
+
res += sep6;
|
|
5143
5161
|
else
|
|
5144
|
-
|
|
5162
|
+
sep6 = "\n";
|
|
5145
5163
|
} else {
|
|
5146
|
-
res +=
|
|
5147
|
-
|
|
5164
|
+
res += sep6 + match[1];
|
|
5165
|
+
sep6 = " ";
|
|
5148
5166
|
}
|
|
5149
5167
|
pos = line.lastIndex;
|
|
5150
5168
|
}
|
|
5151
5169
|
const last = /[ \t]*(.*)/sy;
|
|
5152
5170
|
last.lastIndex = pos;
|
|
5153
5171
|
match = last.exec(source);
|
|
5154
|
-
return res +
|
|
5172
|
+
return res + sep6 + (match?.[1] ?? "");
|
|
5155
5173
|
}
|
|
5156
5174
|
__name(foldLines, "foldLines");
|
|
5157
5175
|
function doubleQuotedValue(source, onError) {
|
|
@@ -5985,14 +6003,14 @@ var require_cst_stringify = __commonJS({
|
|
|
5985
6003
|
}
|
|
5986
6004
|
}
|
|
5987
6005
|
__name(stringifyToken, "stringifyToken");
|
|
5988
|
-
function stringifyItem({ start, key, sep:
|
|
6006
|
+
function stringifyItem({ start, key, sep: sep6, value }) {
|
|
5989
6007
|
let res = "";
|
|
5990
6008
|
for (const st of start)
|
|
5991
6009
|
res += st.source;
|
|
5992
6010
|
if (key)
|
|
5993
6011
|
res += stringifyToken(key);
|
|
5994
|
-
if (
|
|
5995
|
-
for (const st of
|
|
6012
|
+
if (sep6)
|
|
6013
|
+
for (const st of sep6)
|
|
5996
6014
|
res += st.source;
|
|
5997
6015
|
if (value)
|
|
5998
6016
|
res += stringifyToken(value);
|
|
@@ -7181,18 +7199,18 @@ var require_parser = __commonJS({
|
|
|
7181
7199
|
if (this.type === "map-value-ind") {
|
|
7182
7200
|
const prev = getPrevProps(this.peek(2));
|
|
7183
7201
|
const start = getFirstKeyStartProps(prev);
|
|
7184
|
-
let
|
|
7202
|
+
let sep6;
|
|
7185
7203
|
if (scalar.end) {
|
|
7186
|
-
|
|
7187
|
-
|
|
7204
|
+
sep6 = scalar.end;
|
|
7205
|
+
sep6.push(this.sourceToken);
|
|
7188
7206
|
delete scalar.end;
|
|
7189
7207
|
} else
|
|
7190
|
-
|
|
7208
|
+
sep6 = [this.sourceToken];
|
|
7191
7209
|
const map = {
|
|
7192
7210
|
type: "block-map",
|
|
7193
7211
|
offset: scalar.offset,
|
|
7194
7212
|
indent: scalar.indent,
|
|
7195
|
-
items: [{ start, key: scalar, sep:
|
|
7213
|
+
items: [{ start, key: scalar, sep: sep6 }]
|
|
7196
7214
|
};
|
|
7197
7215
|
this.onKeyLine = true;
|
|
7198
7216
|
this.stack[this.stack.length - 1] = map;
|
|
@@ -7345,15 +7363,15 @@ var require_parser = __commonJS({
|
|
|
7345
7363
|
} else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
|
|
7346
7364
|
const start2 = getFirstKeyStartProps(it.start);
|
|
7347
7365
|
const key = it.key;
|
|
7348
|
-
const
|
|
7349
|
-
|
|
7366
|
+
const sep6 = it.sep;
|
|
7367
|
+
sep6.push(this.sourceToken);
|
|
7350
7368
|
delete it.key;
|
|
7351
7369
|
delete it.sep;
|
|
7352
7370
|
this.stack.push({
|
|
7353
7371
|
type: "block-map",
|
|
7354
7372
|
offset: this.offset,
|
|
7355
7373
|
indent: this.indent,
|
|
7356
|
-
items: [{ start: start2, key, sep:
|
|
7374
|
+
items: [{ start: start2, key, sep: sep6 }]
|
|
7357
7375
|
});
|
|
7358
7376
|
} else if (start.length > 0) {
|
|
7359
7377
|
it.sep = it.sep.concat(start, this.sourceToken);
|
|
@@ -7547,13 +7565,13 @@ var require_parser = __commonJS({
|
|
|
7547
7565
|
const prev = getPrevProps(parent);
|
|
7548
7566
|
const start = getFirstKeyStartProps(prev);
|
|
7549
7567
|
fixFlowSeqItems(fc);
|
|
7550
|
-
const
|
|
7551
|
-
|
|
7568
|
+
const sep6 = fc.end.splice(1, fc.end.length);
|
|
7569
|
+
sep6.push(this.sourceToken);
|
|
7552
7570
|
const map = {
|
|
7553
7571
|
type: "block-map",
|
|
7554
7572
|
offset: fc.offset,
|
|
7555
7573
|
indent: fc.indent,
|
|
7556
|
-
items: [{ start, key: fc, sep:
|
|
7574
|
+
items: [{ start, key: fc, sep: sep6 }]
|
|
7557
7575
|
};
|
|
7558
7576
|
this.onKeyLine = true;
|
|
7559
7577
|
this.stack[this.stack.length - 1] = map;
|
|
@@ -11044,7 +11062,7 @@ var require_compile = __commonJS({
|
|
|
11044
11062
|
const schOrFunc = root.refs[ref];
|
|
11045
11063
|
if (schOrFunc)
|
|
11046
11064
|
return schOrFunc;
|
|
11047
|
-
let _sch =
|
|
11065
|
+
let _sch = resolve28.call(this, root, ref);
|
|
11048
11066
|
if (_sch === void 0) {
|
|
11049
11067
|
const schema2 = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref];
|
|
11050
11068
|
const { schemaId } = this.opts;
|
|
@@ -11075,13 +11093,13 @@ var require_compile = __commonJS({
|
|
|
11075
11093
|
return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
|
|
11076
11094
|
}
|
|
11077
11095
|
__name(sameSchemaEnv, "sameSchemaEnv");
|
|
11078
|
-
function
|
|
11096
|
+
function resolve28(root, ref) {
|
|
11079
11097
|
let sch;
|
|
11080
11098
|
while (typeof (sch = this.refs[ref]) == "string")
|
|
11081
11099
|
ref = sch;
|
|
11082
11100
|
return sch || this.schemas[ref] || resolveSchema.call(this, root, ref);
|
|
11083
11101
|
}
|
|
11084
|
-
__name(
|
|
11102
|
+
__name(resolve28, "resolve");
|
|
11085
11103
|
function resolveSchema(root, ref) {
|
|
11086
11104
|
const p = this.opts.uriResolver.parse(ref);
|
|
11087
11105
|
const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p);
|
|
@@ -11733,56 +11751,56 @@ var require_fast_uri = __commonJS({
|
|
|
11733
11751
|
return uri;
|
|
11734
11752
|
}
|
|
11735
11753
|
__name(normalize4, "normalize");
|
|
11736
|
-
function
|
|
11754
|
+
function resolve28(baseURI, relativeURI, options) {
|
|
11737
11755
|
const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
|
|
11738
11756
|
const resolved = resolveComponent(parse2(baseURI, schemelessOptions), parse2(relativeURI, schemelessOptions), schemelessOptions, true);
|
|
11739
11757
|
schemelessOptions.skipEscape = true;
|
|
11740
11758
|
return serialize(resolved, schemelessOptions);
|
|
11741
11759
|
}
|
|
11742
|
-
__name(
|
|
11743
|
-
function resolveComponent(base,
|
|
11760
|
+
__name(resolve28, "resolve");
|
|
11761
|
+
function resolveComponent(base, relative25, options, skipNormalization) {
|
|
11744
11762
|
const target = {};
|
|
11745
11763
|
if (!skipNormalization) {
|
|
11746
11764
|
base = parse2(serialize(base, options), options);
|
|
11747
|
-
|
|
11765
|
+
relative25 = parse2(serialize(relative25, options), options);
|
|
11748
11766
|
}
|
|
11749
11767
|
options = options || {};
|
|
11750
|
-
if (!options.tolerant &&
|
|
11751
|
-
target.scheme =
|
|
11752
|
-
target.userinfo =
|
|
11753
|
-
target.host =
|
|
11754
|
-
target.port =
|
|
11755
|
-
target.path = removeDotSegments(
|
|
11756
|
-
target.query =
|
|
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;
|
|
11757
11775
|
} else {
|
|
11758
|
-
if (
|
|
11759
|
-
target.userinfo =
|
|
11760
|
-
target.host =
|
|
11761
|
-
target.port =
|
|
11762
|
-
target.path = removeDotSegments(
|
|
11763
|
-
target.query =
|
|
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;
|
|
11764
11782
|
} else {
|
|
11765
|
-
if (!
|
|
11783
|
+
if (!relative25.path) {
|
|
11766
11784
|
target.path = base.path;
|
|
11767
|
-
if (
|
|
11768
|
-
target.query =
|
|
11785
|
+
if (relative25.query !== void 0) {
|
|
11786
|
+
target.query = relative25.query;
|
|
11769
11787
|
} else {
|
|
11770
11788
|
target.query = base.query;
|
|
11771
11789
|
}
|
|
11772
11790
|
} else {
|
|
11773
|
-
if (
|
|
11774
|
-
target.path = removeDotSegments(
|
|
11791
|
+
if (relative25.path[0] === "/") {
|
|
11792
|
+
target.path = removeDotSegments(relative25.path);
|
|
11775
11793
|
} else {
|
|
11776
11794
|
if ((base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0) && !base.path) {
|
|
11777
|
-
target.path = "/" +
|
|
11795
|
+
target.path = "/" + relative25.path;
|
|
11778
11796
|
} else if (!base.path) {
|
|
11779
|
-
target.path =
|
|
11797
|
+
target.path = relative25.path;
|
|
11780
11798
|
} else {
|
|
11781
|
-
target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) +
|
|
11799
|
+
target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative25.path;
|
|
11782
11800
|
}
|
|
11783
11801
|
target.path = removeDotSegments(target.path);
|
|
11784
11802
|
}
|
|
11785
|
-
target.query =
|
|
11803
|
+
target.query = relative25.query;
|
|
11786
11804
|
}
|
|
11787
11805
|
target.userinfo = base.userinfo;
|
|
11788
11806
|
target.host = base.host;
|
|
@@ -11790,7 +11808,7 @@ var require_fast_uri = __commonJS({
|
|
|
11790
11808
|
}
|
|
11791
11809
|
target.scheme = base.scheme;
|
|
11792
11810
|
}
|
|
11793
|
-
target.fragment =
|
|
11811
|
+
target.fragment = relative25.fragment;
|
|
11794
11812
|
return target;
|
|
11795
11813
|
}
|
|
11796
11814
|
__name(resolveComponent, "resolveComponent");
|
|
@@ -12001,7 +12019,7 @@ var require_fast_uri = __commonJS({
|
|
|
12001
12019
|
var fastUri = {
|
|
12002
12020
|
SCHEMES,
|
|
12003
12021
|
normalize: normalize4,
|
|
12004
|
-
resolve:
|
|
12022
|
+
resolve: resolve28,
|
|
12005
12023
|
resolveComponent,
|
|
12006
12024
|
equal,
|
|
12007
12025
|
serialize,
|
|
@@ -17071,8 +17089,8 @@ function kimiAuthorityDir(context, planDigest, plugin) {
|
|
|
17071
17089
|
const base = resolve4(context.root, ".release-skill", "kimi-attestations");
|
|
17072
17090
|
const dir = resolve4(base, planDigest, plugin);
|
|
17073
17091
|
const rel = relative2(base, dir);
|
|
17074
|
-
const
|
|
17075
|
-
if (rel === "" || rel === ".." || isAbsolute2(rel) || rel.startsWith(`..${
|
|
17092
|
+
const sep6 = process.platform === "win32" ? "\\" : "/";
|
|
17093
|
+
if (rel === "" || rel === ".." || isAbsolute2(rel) || rel.startsWith(`..${sep6}`) || rel.split(sep6).some((segment) => segment === ".." || segment === "")) {
|
|
17076
17094
|
throw new Error("kimi attestation authority path escapes its base");
|
|
17077
17095
|
}
|
|
17078
17096
|
return dir;
|
|
@@ -17422,8 +17440,8 @@ function codebuddyAuthorityDir(context, planDigest, plugin) {
|
|
|
17422
17440
|
const base = resolve5(context.root, ".release-skill", "codebuddy-attestations");
|
|
17423
17441
|
const dir = resolve5(base, planDigest, plugin);
|
|
17424
17442
|
const rel = relative3(base, dir);
|
|
17425
|
-
const
|
|
17426
|
-
if (rel === "" || rel === ".." || isAbsolute3(rel) || rel.startsWith(`..${
|
|
17443
|
+
const sep6 = process.platform === "win32" ? "\\" : "/";
|
|
17444
|
+
if (rel === "" || rel === ".." || isAbsolute3(rel) || rel.startsWith(`..${sep6}`) || rel.split(sep6).some((segment) => segment === ".." || segment === "")) {
|
|
17427
17445
|
throw new Error("codebuddy attestation authority path escapes its base");
|
|
17428
17446
|
}
|
|
17429
17447
|
return dir;
|
|
@@ -17776,8 +17794,8 @@ function codexAuthorityDir(context, planDigest, plugin) {
|
|
|
17776
17794
|
const base = resolve6(context.root, ".release-skill", "codex-attestations");
|
|
17777
17795
|
const dir = resolve6(base, planDigest, plugin);
|
|
17778
17796
|
const rel = relative4(base, dir);
|
|
17779
|
-
const
|
|
17780
|
-
if (rel === "" || rel === ".." || isAbsolute4(rel) || rel.startsWith(`..${
|
|
17797
|
+
const sep6 = process.platform === "win32" ? "\\" : "/";
|
|
17798
|
+
if (rel === "" || rel === ".." || isAbsolute4(rel) || rel.startsWith(`..${sep6}`) || rel.split(sep6).some((segment) => segment === ".." || segment === "")) {
|
|
17781
17799
|
throw new Error("codex attestation authority path escapes its base");
|
|
17782
17800
|
}
|
|
17783
17801
|
return dir;
|
|
@@ -19766,6 +19784,19 @@ function buildCandidates(facts) {
|
|
|
19766
19784
|
function buildRecommendedProposal(facts, candidates) {
|
|
19767
19785
|
const assumptions = [];
|
|
19768
19786
|
const legacyOwner = facts.legacyReleaseConfigs.map((c) => c.owner).find(Boolean);
|
|
19787
|
+
const sourceRepositoryCandidates = [...new Set(
|
|
19788
|
+
facts.git.remotes.map((remote) => remote.repo).filter(Boolean)
|
|
19789
|
+
)].sort();
|
|
19790
|
+
if (sourceRepositoryCandidates.length !== 1) {
|
|
19791
|
+
return {
|
|
19792
|
+
answers: null,
|
|
19793
|
+
conflicts: [{
|
|
19794
|
+
code: sourceRepositoryCandidates.length === 0 ? "SOURCE_REPOSITORY_MISSING" : "SOURCE_REPOSITORY_AMBIGUOUS",
|
|
19795
|
+
candidates: sourceRepositoryCandidates
|
|
19796
|
+
}],
|
|
19797
|
+
assumptions
|
|
19798
|
+
};
|
|
19799
|
+
}
|
|
19769
19800
|
const units = [];
|
|
19770
19801
|
for (const unit of candidates.units) {
|
|
19771
19802
|
if (unit.authorityConflict) {
|
|
@@ -19904,7 +19935,8 @@ function buildRecommendedProposal(facts, candidates) {
|
|
|
19904
19935
|
kind: "ReleaseProject",
|
|
19905
19936
|
project: {
|
|
19906
19937
|
name: facts.packages[0]?.name ?? "project",
|
|
19907
|
-
defaultBranch: facts.legacyReleaseConfigs[0]?.defaultBranch ?? facts.git.branch ?? "main"
|
|
19938
|
+
defaultBranch: facts.legacyReleaseConfigs[0]?.defaultBranch ?? facts.git.branch ?? "main",
|
|
19939
|
+
sourceRepository: sourceRepositoryCandidates[0]
|
|
19908
19940
|
},
|
|
19909
19941
|
releaseUnits: units,
|
|
19910
19942
|
...selectedGateIds.length > 0 ? {
|
|
@@ -20235,6 +20267,9 @@ async function setupProject({ root, answersPath, write = false, confirmSetup, fa
|
|
|
20235
20267
|
}
|
|
20236
20268
|
const facts = await discoverFacts(rootReal);
|
|
20237
20269
|
const candidates = buildCandidates(facts);
|
|
20270
|
+
const sourceRepositoryCandidates = [...new Set(
|
|
20271
|
+
facts.git.remotes.map((remote) => remote.repo).filter(Boolean)
|
|
20272
|
+
)].sort();
|
|
20238
20273
|
let answers = null;
|
|
20239
20274
|
if (answersPath) {
|
|
20240
20275
|
const resolvedAnswers = isAbsolute5(answersPath) ? answersPath : resolve8(rootReal, answersPath);
|
|
@@ -20245,6 +20280,7 @@ async function setupProject({ root, answersPath, write = false, confirmSetup, fa
|
|
|
20245
20280
|
const digestAuthority = {
|
|
20246
20281
|
setupVersion: 1,
|
|
20247
20282
|
facts,
|
|
20283
|
+
sourceRepositoryCandidates,
|
|
20248
20284
|
releaseUnitCandidates: candidates.units,
|
|
20249
20285
|
gateCandidates: candidates.gates,
|
|
20250
20286
|
selectedGateIds,
|
|
@@ -20296,6 +20332,9 @@ async function setupProject({ root, answersPath, write = false, confirmSetup, fa
|
|
|
20296
20332
|
const lockedAuthority = {
|
|
20297
20333
|
setupVersion: 1,
|
|
20298
20334
|
facts: lockedFacts,
|
|
20335
|
+
sourceRepositoryCandidates: [...new Set(
|
|
20336
|
+
lockedFacts.git.remotes.map((remote) => remote.repo).filter(Boolean)
|
|
20337
|
+
)].sort(),
|
|
20299
20338
|
releaseUnitCandidates: lockedCandidates.units,
|
|
20300
20339
|
gateCandidates: lockedCandidates.gates,
|
|
20301
20340
|
selectedGateIds: lockedAnswers.selectedGateIds,
|
|
@@ -20319,6 +20358,9 @@ async function setupProject({ root, answersPath, write = false, confirmSetup, fa
|
|
|
20319
20358
|
const finalAuthority = {
|
|
20320
20359
|
setupVersion: 1,
|
|
20321
20360
|
facts: finalFacts,
|
|
20361
|
+
sourceRepositoryCandidates: [...new Set(
|
|
20362
|
+
finalFacts.git.remotes.map((remote) => remote.repo).filter(Boolean)
|
|
20363
|
+
)].sort(),
|
|
20322
20364
|
releaseUnitCandidates: finalCandidates.units,
|
|
20323
20365
|
gateCandidates: finalCandidates.gates,
|
|
20324
20366
|
selectedGateIds: finalAnswers.selectedGateIds,
|
|
@@ -24744,9 +24786,9 @@ async function scanFile(relPath, absPath, forbiddenPaths, forbiddenContentPatter
|
|
|
24744
24786
|
for (const fp of forbiddenPaths) {
|
|
24745
24787
|
const normFp = fp.replaceAll(win32.sep, posix2.sep).replace(/\/+$/, "").toLowerCase();
|
|
24746
24788
|
if (!normFp) continue;
|
|
24747
|
-
for (const
|
|
24748
|
-
const prefix = normFp.endsWith(
|
|
24749
|
-
const checkPath = lowerRel +
|
|
24789
|
+
for (const sep6 of separators) {
|
|
24790
|
+
const prefix = normFp.endsWith(sep6.toLowerCase()) ? normFp : normFp + sep6.toLowerCase();
|
|
24791
|
+
const checkPath = lowerRel + sep6.toLowerCase();
|
|
24750
24792
|
if (lowerRel === normFp || checkPath.startsWith(prefix)) {
|
|
24751
24793
|
const dedupKey = `FORBIDDEN_PATH:${normFp}:${normRel}`;
|
|
24752
24794
|
if (!seenKinds.has(dedupKey)) {
|
|
@@ -25141,6 +25183,473 @@ var init_contract2 = __esm({
|
|
|
25141
25183
|
}
|
|
25142
25184
|
});
|
|
25143
25185
|
|
|
25186
|
+
// src/core/source-authority.mjs
|
|
25187
|
+
import { execFile as execFileCb6 } from "node:child_process";
|
|
25188
|
+
import { promisify as promisify6 } from "node:util";
|
|
25189
|
+
import { lstat as lstat10, mkdtemp as mkdtemp2, readFile as readFile15, readdir as readdir9, realpath as realpath9, rm as rm5 } from "node:fs/promises";
|
|
25190
|
+
import { join as join13, relative as relative15, resolve as resolve17, sep as sep4 } from "node:path";
|
|
25191
|
+
import { tmpdir as tmpdir2 } from "node:os";
|
|
25192
|
+
async function computeSourceInputClosure({ units, root }) {
|
|
25193
|
+
const realRoot = await realpath9(resolve17(root));
|
|
25194
|
+
const entriesByPath = /* @__PURE__ */ new Map();
|
|
25195
|
+
for (const unit of units ?? []) {
|
|
25196
|
+
for (const mapping of unit.publicFiles ?? []) {
|
|
25197
|
+
if (typeof mapping?.from !== "string" || mapping.from.length === 0) continue;
|
|
25198
|
+
await collectPath({
|
|
25199
|
+
absolutePath: resolveInside(realRoot, mapping.from),
|
|
25200
|
+
root: realRoot,
|
|
25201
|
+
entriesByPath
|
|
25202
|
+
});
|
|
25203
|
+
}
|
|
25204
|
+
const versionSource = unit.version?.source;
|
|
25205
|
+
if (typeof versionSource === "string" && versionSource.length > 0) {
|
|
25206
|
+
const unitRoot = resolveInside(realRoot, unit.source ?? ".");
|
|
25207
|
+
await collectPath({
|
|
25208
|
+
absolutePath: resolveInside(unitRoot, versionSource, realRoot),
|
|
25209
|
+
root: realRoot,
|
|
25210
|
+
entriesByPath
|
|
25211
|
+
});
|
|
25212
|
+
}
|
|
25213
|
+
}
|
|
25214
|
+
const entries = [...entriesByPath.values()].sort((left, right) => left.path.localeCompare(right.path));
|
|
25215
|
+
const digest = computeEntriesDigest(entries);
|
|
25216
|
+
return {
|
|
25217
|
+
algorithmVersion: SOURCE_INPUT_ALGORITHM_VERSION,
|
|
25218
|
+
entries,
|
|
25219
|
+
digest
|
|
25220
|
+
};
|
|
25221
|
+
}
|
|
25222
|
+
function computeEntriesDigest(entries) {
|
|
25223
|
+
return sha256Hex(canonicalJson(entries.map(({ path: path3, digest, mode }) => ({
|
|
25224
|
+
digest,
|
|
25225
|
+
mode,
|
|
25226
|
+
path: path3
|
|
25227
|
+
}))));
|
|
25228
|
+
}
|
|
25229
|
+
async function collectPath({ absolutePath, root, entriesByPath }) {
|
|
25230
|
+
let stat9;
|
|
25231
|
+
try {
|
|
25232
|
+
stat9 = await lstat10(absolutePath);
|
|
25233
|
+
} catch (error) {
|
|
25234
|
+
throw new ReleaseError(
|
|
25235
|
+
CONFIG_INVALID,
|
|
25236
|
+
`source-input closure cannot stat "${toRelative(root, absolutePath)}": ${error.message}`,
|
|
25237
|
+
{ cause: error.code ?? "UNKNOWN", path: toRelative(root, absolutePath) }
|
|
25238
|
+
);
|
|
25239
|
+
}
|
|
25240
|
+
const rel = toRelative(root, absolutePath);
|
|
25241
|
+
if (stat9.isSymbolicLink()) {
|
|
25242
|
+
throw new ReleaseError(
|
|
25243
|
+
CONFIG_INVALID,
|
|
25244
|
+
`source-input closure rejects symlink "${rel}"`,
|
|
25245
|
+
{ path: rel }
|
|
25246
|
+
);
|
|
25247
|
+
}
|
|
25248
|
+
const physicalPath = await realpath9(absolutePath);
|
|
25249
|
+
if (physicalPath !== absolutePath) {
|
|
25250
|
+
throw new ReleaseError(
|
|
25251
|
+
CONFIG_INVALID,
|
|
25252
|
+
`source-input closure rejects symlinked ancestor for "${rel}"`,
|
|
25253
|
+
{ path: rel }
|
|
25254
|
+
);
|
|
25255
|
+
}
|
|
25256
|
+
if (stat9.isDirectory()) {
|
|
25257
|
+
const children = await readdir9(absolutePath, { withFileTypes: true });
|
|
25258
|
+
children.sort((left, right) => left.name.localeCompare(right.name));
|
|
25259
|
+
for (const child of children) {
|
|
25260
|
+
await collectPath({
|
|
25261
|
+
absolutePath: join13(absolutePath, child.name),
|
|
25262
|
+
root,
|
|
25263
|
+
entriesByPath
|
|
25264
|
+
});
|
|
25265
|
+
}
|
|
25266
|
+
return;
|
|
25267
|
+
}
|
|
25268
|
+
if (!stat9.isFile()) {
|
|
25269
|
+
throw new ReleaseError(
|
|
25270
|
+
CONFIG_INVALID,
|
|
25271
|
+
`source-input closure rejects non-regular file "${rel}"`,
|
|
25272
|
+
{ path: rel }
|
|
25273
|
+
);
|
|
25274
|
+
}
|
|
25275
|
+
const content = await readFile15(absolutePath);
|
|
25276
|
+
entriesByPath.set(rel, {
|
|
25277
|
+
path: rel,
|
|
25278
|
+
digest: sha256Hex(content),
|
|
25279
|
+
mode: normalizeLocalGitMode(stat9.mode)
|
|
25280
|
+
});
|
|
25281
|
+
}
|
|
25282
|
+
function resolveInside(base, candidate, containmentRoot = base) {
|
|
25283
|
+
const resolved = resolve17(base, candidate);
|
|
25284
|
+
const root = resolve17(containmentRoot);
|
|
25285
|
+
if (resolved !== root && !resolved.startsWith(`${root}${sep4}`)) {
|
|
25286
|
+
throw new ReleaseError(
|
|
25287
|
+
CONFIG_INVALID,
|
|
25288
|
+
`source-input closure path escapes workspace root: "${candidate}"`,
|
|
25289
|
+
{ path: candidate }
|
|
25290
|
+
);
|
|
25291
|
+
}
|
|
25292
|
+
return resolved;
|
|
25293
|
+
}
|
|
25294
|
+
function toRelative(root, absolutePath) {
|
|
25295
|
+
const rel = relative15(root, absolutePath).split(sep4).join("/");
|
|
25296
|
+
if (!rel || rel === "." || rel.startsWith("../") || rel === "..") {
|
|
25297
|
+
throw new ReleaseError(
|
|
25298
|
+
CONFIG_INVALID,
|
|
25299
|
+
`source-input closure path is outside the workspace: "${absolutePath}"`,
|
|
25300
|
+
{ path: absolutePath }
|
|
25301
|
+
);
|
|
25302
|
+
}
|
|
25303
|
+
return rel;
|
|
25304
|
+
}
|
|
25305
|
+
function normalizeLocalGitMode(mode) {
|
|
25306
|
+
return (mode & 73) === 0 ? "100644" : "100755";
|
|
25307
|
+
}
|
|
25308
|
+
async function checkSourceInputDirty({ closure, root, execFn = execFile5 }) {
|
|
25309
|
+
const paths = (closure?.entries ?? []).map((entry) => entry.path);
|
|
25310
|
+
if (paths.length === 0) return { dirty: false, dirtyPaths: [] };
|
|
25311
|
+
let stdout;
|
|
25312
|
+
try {
|
|
25313
|
+
({ stdout } = await execFn(
|
|
25314
|
+
"git",
|
|
25315
|
+
[
|
|
25316
|
+
"status",
|
|
25317
|
+
"--porcelain=v1",
|
|
25318
|
+
"-z",
|
|
25319
|
+
"--untracked-files=all",
|
|
25320
|
+
"--ignored=matching",
|
|
25321
|
+
"--",
|
|
25322
|
+
...paths
|
|
25323
|
+
],
|
|
25324
|
+
{ cwd: root, encoding: "utf8", shell: false }
|
|
25325
|
+
));
|
|
25326
|
+
} catch (error) {
|
|
25327
|
+
throw new ReleaseError(
|
|
25328
|
+
DIRTY_SOURCE_INPUT,
|
|
25329
|
+
`cannot check source-input dirty status: ${error.message}`,
|
|
25330
|
+
{ cause: error.code ?? "UNKNOWN" }
|
|
25331
|
+
);
|
|
25332
|
+
}
|
|
25333
|
+
const dirtyPaths = [];
|
|
25334
|
+
const records = String(stdout).split("\0").filter(Boolean);
|
|
25335
|
+
for (let index = 0; index < records.length; index += 1) {
|
|
25336
|
+
const record = records[index];
|
|
25337
|
+
if (record.length < 4) continue;
|
|
25338
|
+
const status = record.slice(0, 2);
|
|
25339
|
+
const recordPath = record.slice(3);
|
|
25340
|
+
dirtyPaths.push(recordPath);
|
|
25341
|
+
if (status.startsWith("R") || status.startsWith("C")) index += 1;
|
|
25342
|
+
}
|
|
25343
|
+
return {
|
|
25344
|
+
dirty: dirtyPaths.length > 0,
|
|
25345
|
+
dirtyPaths: [...new Set(dirtyPaths)].sort()
|
|
25346
|
+
};
|
|
25347
|
+
}
|
|
25348
|
+
function verifySnapshotSourcesMatchClosure({ closure, unitResults }) {
|
|
25349
|
+
if (!closure || !Array.isArray(closure.entries)) {
|
|
25350
|
+
return failure(CONFIG_INVALID, "source-input closure is missing");
|
|
25351
|
+
}
|
|
25352
|
+
const closureByPath = new Map(
|
|
25353
|
+
closure.entries.map((entry) => [entry.path, entry])
|
|
25354
|
+
);
|
|
25355
|
+
const mismatchedPaths = [];
|
|
25356
|
+
for (const { manifest } of unitResults ?? []) {
|
|
25357
|
+
for (const entry of manifest?.entries ?? []) {
|
|
25358
|
+
const expected = closureByPath.get(entry.from);
|
|
25359
|
+
const actualMode = normalizeSnapshotGitMode(entry.mode);
|
|
25360
|
+
if (!expected || entry.hash !== expected.digest || actualMode !== expected.mode) {
|
|
25361
|
+
mismatchedPaths.push(entry.from);
|
|
25362
|
+
}
|
|
25363
|
+
}
|
|
25364
|
+
}
|
|
25365
|
+
if (mismatchedPaths.length > 0) {
|
|
25366
|
+
const paths = [...new Set(mismatchedPaths)].sort();
|
|
25367
|
+
return {
|
|
25368
|
+
passed: false,
|
|
25369
|
+
error: {
|
|
25370
|
+
code: DIRTY_SOURCE_INPUT,
|
|
25371
|
+
message: `frozen snapshots differ from ${paths.length} source-input closure file(s)`,
|
|
25372
|
+
paths
|
|
25373
|
+
}
|
|
25374
|
+
};
|
|
25375
|
+
}
|
|
25376
|
+
return {
|
|
25377
|
+
passed: true,
|
|
25378
|
+
observation: {
|
|
25379
|
+
snapshotSourceCount: new Set(
|
|
25380
|
+
(unitResults ?? []).flatMap(({ manifest }) => (manifest?.entries ?? []).map((entry) => entry.from))
|
|
25381
|
+
).size
|
|
25382
|
+
}
|
|
25383
|
+
};
|
|
25384
|
+
}
|
|
25385
|
+
function normalizeSnapshotGitMode(mode) {
|
|
25386
|
+
if (typeof mode === "string" && GIT_MODE_RE.test(mode)) return mode;
|
|
25387
|
+
if (typeof mode === "number") return normalizeLocalGitMode(mode);
|
|
25388
|
+
return null;
|
|
25389
|
+
}
|
|
25390
|
+
async function verifyRemoteSourceContent({
|
|
25391
|
+
sourceRepository,
|
|
25392
|
+
defaultBranch,
|
|
25393
|
+
closure,
|
|
25394
|
+
readRemoteFn,
|
|
25395
|
+
execFn = execFile5
|
|
25396
|
+
}) {
|
|
25397
|
+
if (!REPOSITORY_RE.test(sourceRepository ?? "")) {
|
|
25398
|
+
return failure(CONFIG_MISSING, "project.sourceRepository must be an explicit GitHub owner/repo");
|
|
25399
|
+
}
|
|
25400
|
+
if (typeof defaultBranch !== "string" || defaultBranch.length === 0) {
|
|
25401
|
+
return failure(CONFIG_MISSING, "project.defaultBranch must be an explicit branch name");
|
|
25402
|
+
}
|
|
25403
|
+
if (!closure || closure.algorithmVersion !== SOURCE_INPUT_ALGORITHM_VERSION) {
|
|
25404
|
+
return failure(CONFIG_INVALID, "source-input closure algorithm is unsupported");
|
|
25405
|
+
}
|
|
25406
|
+
if (!Array.isArray(closure.entries) || computeEntriesDigest(closure.entries) !== closure.digest) {
|
|
25407
|
+
return failure(CONFIG_INVALID, "source-input closure entries do not match the frozen digest");
|
|
25408
|
+
}
|
|
25409
|
+
if (readRemoteFn) {
|
|
25410
|
+
return verifyWithInjectedReader({
|
|
25411
|
+
closure,
|
|
25412
|
+
defaultBranch,
|
|
25413
|
+
readRemoteFn,
|
|
25414
|
+
sourceRepository
|
|
25415
|
+
});
|
|
25416
|
+
}
|
|
25417
|
+
return verifyWithTemporaryGit({
|
|
25418
|
+
closure,
|
|
25419
|
+
defaultBranch,
|
|
25420
|
+
execFn,
|
|
25421
|
+
sourceRepository
|
|
25422
|
+
});
|
|
25423
|
+
}
|
|
25424
|
+
async function verifyWithInjectedReader({
|
|
25425
|
+
closure,
|
|
25426
|
+
defaultBranch,
|
|
25427
|
+
readRemoteFn,
|
|
25428
|
+
sourceRepository
|
|
25429
|
+
}) {
|
|
25430
|
+
const mismatchedPaths = [];
|
|
25431
|
+
for (const entry of closure.entries) {
|
|
25432
|
+
let result;
|
|
25433
|
+
try {
|
|
25434
|
+
result = await readRemoteFn(sourceRepository, defaultBranch, entry.path);
|
|
25435
|
+
} catch (error) {
|
|
25436
|
+
return failure(REMOTE_UNAVAILABLE, error.message);
|
|
25437
|
+
}
|
|
25438
|
+
const classified = classifyRemoteStatus(result, sourceRepository, defaultBranch);
|
|
25439
|
+
if (classified) return classified;
|
|
25440
|
+
if (sha256Hex(Buffer.isBuffer(result.content) ? result.content : Buffer.from(result.content)) !== entry.digest || result.mode !== entry.mode) {
|
|
25441
|
+
mismatchedPaths.push(entry.path);
|
|
25442
|
+
}
|
|
25443
|
+
}
|
|
25444
|
+
return mismatchedPaths.length > 0 ? mismatch(defaultBranch, mismatchedPaths) : {
|
|
25445
|
+
passed: true,
|
|
25446
|
+
observation: {
|
|
25447
|
+
defaultBranch,
|
|
25448
|
+
entryCount: closure.entries.length,
|
|
25449
|
+
sourceRepository
|
|
25450
|
+
}
|
|
25451
|
+
};
|
|
25452
|
+
}
|
|
25453
|
+
function classifyRemoteStatus(result, repository, branch) {
|
|
25454
|
+
if (result?.status === "ok") return null;
|
|
25455
|
+
if (result?.status === "ref_missing") {
|
|
25456
|
+
return failure(
|
|
25457
|
+
REF_MISSING,
|
|
25458
|
+
result.error ?? `remote ref "${branch}" does not exist in "${repository}"`
|
|
25459
|
+
);
|
|
25460
|
+
}
|
|
25461
|
+
if (result?.status === "not_default") {
|
|
25462
|
+
return failure(
|
|
25463
|
+
NOT_DEFAULT,
|
|
25464
|
+
result.error ?? `"${branch}" is not the default branch of "${repository}"`
|
|
25465
|
+
);
|
|
25466
|
+
}
|
|
25467
|
+
return failure(
|
|
25468
|
+
REMOTE_UNAVAILABLE,
|
|
25469
|
+
result?.error ?? `remote source "${repository}" is unavailable`
|
|
25470
|
+
);
|
|
25471
|
+
}
|
|
25472
|
+
async function verifyWithTemporaryGit({
|
|
25473
|
+
closure,
|
|
25474
|
+
defaultBranch,
|
|
25475
|
+
execFn,
|
|
25476
|
+
sourceRepository
|
|
25477
|
+
}) {
|
|
25478
|
+
const repositoryUrl = `https://github.com/${sourceRepository}.git`;
|
|
25479
|
+
let observed;
|
|
25480
|
+
try {
|
|
25481
|
+
({ stdout: observed } = await execFn(
|
|
25482
|
+
"git",
|
|
25483
|
+
["ls-remote", "--symref", repositoryUrl, "HEAD", `refs/heads/${defaultBranch}`],
|
|
25484
|
+
{ encoding: "utf8", shell: false, timeout: 6e4 }
|
|
25485
|
+
));
|
|
25486
|
+
} catch (error) {
|
|
25487
|
+
return failure(REMOTE_UNAVAILABLE, `cannot observe "${sourceRepository}": ${error.message}`);
|
|
25488
|
+
}
|
|
25489
|
+
const lines = String(observed).split(/\r?\n/u).filter(Boolean);
|
|
25490
|
+
const headSymref = lines.find((line) => line.startsWith("ref: refs/heads/"));
|
|
25491
|
+
const actualDefault = headSymref?.match(/^ref: refs\/heads\/(.+)\tHEAD$/u)?.[1] ?? null;
|
|
25492
|
+
if (!actualDefault) {
|
|
25493
|
+
return failure(REMOTE_UNAVAILABLE, `remote default branch is not observable for "${sourceRepository}"`);
|
|
25494
|
+
}
|
|
25495
|
+
if (actualDefault !== defaultBranch) {
|
|
25496
|
+
return failure(
|
|
25497
|
+
NOT_DEFAULT,
|
|
25498
|
+
`configured defaultBranch "${defaultBranch}" does not match remote default "${actualDefault}"`
|
|
25499
|
+
);
|
|
25500
|
+
}
|
|
25501
|
+
const branchLine = lines.find((line) => line.endsWith(` refs/heads/${defaultBranch}`));
|
|
25502
|
+
if (!branchLine) {
|
|
25503
|
+
return failure(REF_MISSING, `remote ref "refs/heads/${defaultBranch}" does not exist`);
|
|
25504
|
+
}
|
|
25505
|
+
const tempRoot = await mkdtemp2(join13(tmpdir2(), "release-skill-source-authority-"));
|
|
25506
|
+
try {
|
|
25507
|
+
await execFn("git", ["init", "--bare", tempRoot], {
|
|
25508
|
+
encoding: "utf8",
|
|
25509
|
+
shell: false,
|
|
25510
|
+
timeout: 3e4
|
|
25511
|
+
});
|
|
25512
|
+
await execFn(
|
|
25513
|
+
"git",
|
|
25514
|
+
[
|
|
25515
|
+
"-C",
|
|
25516
|
+
tempRoot,
|
|
25517
|
+
"fetch",
|
|
25518
|
+
"--depth=1",
|
|
25519
|
+
repositoryUrl,
|
|
25520
|
+
`refs/heads/${defaultBranch}:refs/source-authority/target`
|
|
25521
|
+
],
|
|
25522
|
+
{ encoding: "utf8", shell: false, timeout: 12e4 }
|
|
25523
|
+
);
|
|
25524
|
+
const { stdout: fetchedCommitOutput } = await execFn(
|
|
25525
|
+
"git",
|
|
25526
|
+
["-C", tempRoot, "rev-parse", "refs/source-authority/target"],
|
|
25527
|
+
{ encoding: "utf8", shell: false, timeout: 3e4 }
|
|
25528
|
+
);
|
|
25529
|
+
const observedCommit = String(fetchedCommitOutput).trim();
|
|
25530
|
+
const { stdout: treeOutput } = await execFn(
|
|
25531
|
+
"git",
|
|
25532
|
+
["-C", tempRoot, "ls-tree", "-r", "-z", "refs/source-authority/target"],
|
|
25533
|
+
{ encoding: "utf8", maxBuffer: 64 * 1024 * 1024, shell: false, timeout: 3e4 }
|
|
25534
|
+
);
|
|
25535
|
+
const tree = parseLsTree(treeOutput);
|
|
25536
|
+
const mismatchedPaths = [];
|
|
25537
|
+
for (const expected of closure.entries) {
|
|
25538
|
+
const actual = tree.get(expected.path);
|
|
25539
|
+
if (!actual || actual.type !== "blob" || actual.mode !== expected.mode) {
|
|
25540
|
+
mismatchedPaths.push(expected.path);
|
|
25541
|
+
continue;
|
|
25542
|
+
}
|
|
25543
|
+
const { stdout: content } = await execFn(
|
|
25544
|
+
"git",
|
|
25545
|
+
["-C", tempRoot, "cat-file", "blob", actual.objectId],
|
|
25546
|
+
{ encoding: null, maxBuffer: 64 * 1024 * 1024, shell: false, timeout: 3e4 }
|
|
25547
|
+
);
|
|
25548
|
+
const bytes = Buffer.isBuffer(content) ? content : Buffer.from(content);
|
|
25549
|
+
if (sha256Hex(bytes) !== expected.digest) mismatchedPaths.push(expected.path);
|
|
25550
|
+
}
|
|
25551
|
+
return mismatchedPaths.length > 0 ? mismatch(defaultBranch, mismatchedPaths) : {
|
|
25552
|
+
passed: true,
|
|
25553
|
+
observation: {
|
|
25554
|
+
defaultBranch,
|
|
25555
|
+
entryCount: closure.entries.length,
|
|
25556
|
+
observedCommit,
|
|
25557
|
+
sourceRepository
|
|
25558
|
+
}
|
|
25559
|
+
};
|
|
25560
|
+
} catch (error) {
|
|
25561
|
+
return failure(REMOTE_UNAVAILABLE, `cannot read remote source tree: ${error.message}`);
|
|
25562
|
+
} finally {
|
|
25563
|
+
await rm5(tempRoot, { force: true, recursive: true });
|
|
25564
|
+
}
|
|
25565
|
+
}
|
|
25566
|
+
function parseLsTree(output) {
|
|
25567
|
+
const result = /* @__PURE__ */ new Map();
|
|
25568
|
+
for (const record of String(output).split("\0").filter(Boolean)) {
|
|
25569
|
+
const match = record.match(/^([0-9]{6}) ([a-z]+) ([0-9a-f]{40,64})\t(.+)$/u);
|
|
25570
|
+
if (!match) continue;
|
|
25571
|
+
result.set(match[4], {
|
|
25572
|
+
mode: match[1],
|
|
25573
|
+
objectId: match[3],
|
|
25574
|
+
type: match[2]
|
|
25575
|
+
});
|
|
25576
|
+
}
|
|
25577
|
+
return result;
|
|
25578
|
+
}
|
|
25579
|
+
function mismatch(defaultBranch, paths) {
|
|
25580
|
+
const uniquePaths = [...new Set(paths)].sort();
|
|
25581
|
+
return {
|
|
25582
|
+
passed: false,
|
|
25583
|
+
error: {
|
|
25584
|
+
code: CONTENT_MISMATCH,
|
|
25585
|
+
message: `remote default branch "${defaultBranch}" differs from ${uniquePaths.length} frozen source input(s)`,
|
|
25586
|
+
paths: uniquePaths
|
|
25587
|
+
}
|
|
25588
|
+
};
|
|
25589
|
+
}
|
|
25590
|
+
function failure(code, message) {
|
|
25591
|
+
return { passed: false, error: { code, message } };
|
|
25592
|
+
}
|
|
25593
|
+
function verifySourceAuthorityReceipt({ plan, run: run5 }) {
|
|
25594
|
+
const authority = plan.sourceAuthority;
|
|
25595
|
+
if (!authority) return { passed: true };
|
|
25596
|
+
const matching = (run5.sourceAuthorityReceipts ?? []).find((receipt) => receipt.sourceRepository === authority.sourceRepository && receipt.defaultBranch === authority.defaultBranch && receipt.inputDigest === authority.inputDigest && receipt.algorithmVersion === authority.algorithmVersion && receipt.entryCount === authority.entries.length && receipt.planDigest === plan.digest && receipt.result === "CONSISTENT");
|
|
25597
|
+
return matching ? { passed: true, receipt: matching } : {
|
|
25598
|
+
passed: false,
|
|
25599
|
+
reason: "publish run has no CONSISTENT source-authority receipt bound to this plan digest"
|
|
25600
|
+
};
|
|
25601
|
+
}
|
|
25602
|
+
function createSourceAuthorityReceipt({
|
|
25603
|
+
plan,
|
|
25604
|
+
result,
|
|
25605
|
+
observation,
|
|
25606
|
+
mismatchedPaths,
|
|
25607
|
+
clock = /* @__PURE__ */ __name(() => (/* @__PURE__ */ new Date()).toISOString(), "clock")
|
|
25608
|
+
}) {
|
|
25609
|
+
const authority = plan.sourceAuthority;
|
|
25610
|
+
return {
|
|
25611
|
+
algorithmVersion: authority.algorithmVersion,
|
|
25612
|
+
defaultBranch: authority.defaultBranch,
|
|
25613
|
+
entryCount: authority.entries.length,
|
|
25614
|
+
inputDigest: authority.inputDigest,
|
|
25615
|
+
planDigest: plan.digest,
|
|
25616
|
+
result,
|
|
25617
|
+
sourceRepository: authority.sourceRepository,
|
|
25618
|
+
verifiedAt: clock(),
|
|
25619
|
+
...observation?.observedCommit ? { observedCommit: observation.observedCommit } : {},
|
|
25620
|
+
...mismatchedPaths?.length ? { mismatchedPaths: [...new Set(mismatchedPaths)].sort() } : {}
|
|
25621
|
+
};
|
|
25622
|
+
}
|
|
25623
|
+
var execFile5, REPOSITORY_RE, GIT_MODE_RE, SOURCE_INPUT_ALGORITHM_VERSION;
|
|
25624
|
+
var init_source_authority = __esm({
|
|
25625
|
+
"src/core/source-authority.mjs"() {
|
|
25626
|
+
init_digest();
|
|
25627
|
+
init_errors();
|
|
25628
|
+
execFile5 = promisify6(execFileCb6);
|
|
25629
|
+
REPOSITORY_RE = /^[A-Za-z0-9._-]+\/[A-Za-z0-9._-]+$/u;
|
|
25630
|
+
GIT_MODE_RE = /^(?:100644|100755)$/u;
|
|
25631
|
+
SOURCE_INPUT_ALGORITHM_VERSION = 1;
|
|
25632
|
+
__name(computeSourceInputClosure, "computeSourceInputClosure");
|
|
25633
|
+
__name(computeEntriesDigest, "computeEntriesDigest");
|
|
25634
|
+
__name(collectPath, "collectPath");
|
|
25635
|
+
__name(resolveInside, "resolveInside");
|
|
25636
|
+
__name(toRelative, "toRelative");
|
|
25637
|
+
__name(normalizeLocalGitMode, "normalizeLocalGitMode");
|
|
25638
|
+
__name(checkSourceInputDirty, "checkSourceInputDirty");
|
|
25639
|
+
__name(verifySnapshotSourcesMatchClosure, "verifySnapshotSourcesMatchClosure");
|
|
25640
|
+
__name(normalizeSnapshotGitMode, "normalizeSnapshotGitMode");
|
|
25641
|
+
__name(verifyRemoteSourceContent, "verifyRemoteSourceContent");
|
|
25642
|
+
__name(verifyWithInjectedReader, "verifyWithInjectedReader");
|
|
25643
|
+
__name(classifyRemoteStatus, "classifyRemoteStatus");
|
|
25644
|
+
__name(verifyWithTemporaryGit, "verifyWithTemporaryGit");
|
|
25645
|
+
__name(parseLsTree, "parseLsTree");
|
|
25646
|
+
__name(mismatch, "mismatch");
|
|
25647
|
+
__name(failure, "failure");
|
|
25648
|
+
__name(verifySourceAuthorityReceipt, "verifySourceAuthorityReceipt");
|
|
25649
|
+
__name(createSourceAuthorityReceipt, "createSourceAuthorityReceipt");
|
|
25650
|
+
}
|
|
25651
|
+
});
|
|
25652
|
+
|
|
25144
25653
|
// src/core/previous-public-baseline.mjs
|
|
25145
25654
|
async function observePreviousPublicBaseline({ baseline, observeFn, evidence }) {
|
|
25146
25655
|
if (!baseline || typeof baseline !== "object") {
|
|
@@ -26100,10 +26609,10 @@ var require_commonjs = __commonJS({
|
|
|
26100
26609
|
* Return a void Promise that resolves once the stream ends.
|
|
26101
26610
|
*/
|
|
26102
26611
|
async promise() {
|
|
26103
|
-
return new Promise((
|
|
26612
|
+
return new Promise((resolve28, reject) => {
|
|
26104
26613
|
this.on(DESTROYED, () => reject(new Error("stream destroyed")));
|
|
26105
26614
|
this.on("error", (er) => reject(er));
|
|
26106
|
-
this.on("end", () =>
|
|
26615
|
+
this.on("end", () => resolve28());
|
|
26107
26616
|
});
|
|
26108
26617
|
}
|
|
26109
26618
|
/**
|
|
@@ -26127,7 +26636,7 @@ var require_commonjs = __commonJS({
|
|
|
26127
26636
|
return Promise.resolve({ done: false, value: res });
|
|
26128
26637
|
if (this[EOF])
|
|
26129
26638
|
return stop();
|
|
26130
|
-
let
|
|
26639
|
+
let resolve28;
|
|
26131
26640
|
let reject;
|
|
26132
26641
|
const onerr = /* @__PURE__ */ __name((er) => {
|
|
26133
26642
|
this.off("data", ondata);
|
|
@@ -26141,19 +26650,19 @@ var require_commonjs = __commonJS({
|
|
|
26141
26650
|
this.off("end", onend);
|
|
26142
26651
|
this.off(DESTROYED, ondestroy);
|
|
26143
26652
|
this.pause();
|
|
26144
|
-
|
|
26653
|
+
resolve28({ value, done: !!this[EOF] });
|
|
26145
26654
|
}, "ondata");
|
|
26146
26655
|
const onend = /* @__PURE__ */ __name(() => {
|
|
26147
26656
|
this.off("error", onerr);
|
|
26148
26657
|
this.off("data", ondata);
|
|
26149
26658
|
this.off(DESTROYED, ondestroy);
|
|
26150
26659
|
stop();
|
|
26151
|
-
|
|
26660
|
+
resolve28({ done: true, value: void 0 });
|
|
26152
26661
|
}, "onend");
|
|
26153
26662
|
const ondestroy = /* @__PURE__ */ __name(() => onerr(new Error("stream destroyed")), "ondestroy");
|
|
26154
26663
|
return new Promise((res2, rej) => {
|
|
26155
26664
|
reject = rej;
|
|
26156
|
-
|
|
26665
|
+
resolve28 = res2;
|
|
26157
26666
|
this.once(DESTROYED, ondestroy);
|
|
26158
26667
|
this.once("error", onerr);
|
|
26159
26668
|
this.once("end", onend);
|
|
@@ -27244,10 +27753,10 @@ var require_minipass = __commonJS({
|
|
|
27244
27753
|
}
|
|
27245
27754
|
// stream.promise().then(() => done, er => emitted error)
|
|
27246
27755
|
promise() {
|
|
27247
|
-
return new Promise((
|
|
27756
|
+
return new Promise((resolve28, reject) => {
|
|
27248
27757
|
this.on(DESTROYED, () => reject(new Error("stream destroyed")));
|
|
27249
27758
|
this.on("error", (er) => reject(er));
|
|
27250
|
-
this.on("end", () =>
|
|
27759
|
+
this.on("end", () => resolve28());
|
|
27251
27760
|
});
|
|
27252
27761
|
}
|
|
27253
27762
|
// for await (let chunk of stream)
|
|
@@ -27258,7 +27767,7 @@ var require_minipass = __commonJS({
|
|
|
27258
27767
|
return Promise.resolve({ done: false, value: res });
|
|
27259
27768
|
if (this[EOF])
|
|
27260
27769
|
return Promise.resolve({ done: true });
|
|
27261
|
-
let
|
|
27770
|
+
let resolve28 = null;
|
|
27262
27771
|
let reject = null;
|
|
27263
27772
|
const onerr = /* @__PURE__ */ __name((er) => {
|
|
27264
27773
|
this.removeListener("data", ondata);
|
|
@@ -27269,17 +27778,17 @@ var require_minipass = __commonJS({
|
|
|
27269
27778
|
this.removeListener("error", onerr);
|
|
27270
27779
|
this.removeListener("end", onend);
|
|
27271
27780
|
this.pause();
|
|
27272
|
-
|
|
27781
|
+
resolve28({ value, done: !!this[EOF] });
|
|
27273
27782
|
}, "ondata");
|
|
27274
27783
|
const onend = /* @__PURE__ */ __name(() => {
|
|
27275
27784
|
this.removeListener("error", onerr);
|
|
27276
27785
|
this.removeListener("data", ondata);
|
|
27277
|
-
|
|
27786
|
+
resolve28({ done: true });
|
|
27278
27787
|
}, "onend");
|
|
27279
27788
|
const ondestroy = /* @__PURE__ */ __name(() => onerr(new Error("stream destroyed")), "ondestroy");
|
|
27280
27789
|
return new Promise((res2, rej) => {
|
|
27281
27790
|
reject = rej;
|
|
27282
|
-
|
|
27791
|
+
resolve28 = res2;
|
|
27283
27792
|
this.once(DESTROYED, ondestroy);
|
|
27284
27793
|
this.once("error", onerr);
|
|
27285
27794
|
this.once("end", onend);
|
|
@@ -31318,12 +31827,12 @@ var require_body = __commonJS({
|
|
|
31318
31827
|
if (resTimeout && resTimeout.unref) {
|
|
31319
31828
|
resTimeout.unref();
|
|
31320
31829
|
}
|
|
31321
|
-
return new Promise((
|
|
31830
|
+
return new Promise((resolve28) => {
|
|
31322
31831
|
if (stream !== upstream) {
|
|
31323
31832
|
upstream.on("error", (er) => stream.emit("error", er));
|
|
31324
31833
|
upstream.pipe(stream);
|
|
31325
31834
|
}
|
|
31326
|
-
|
|
31835
|
+
resolve28();
|
|
31327
31836
|
}).then(() => stream.concat()).then((buf) => {
|
|
31328
31837
|
clearTimeout(resTimeout);
|
|
31329
31838
|
return buf;
|
|
@@ -32088,7 +32597,7 @@ var require_lib2 = __commonJS({
|
|
|
32088
32597
|
var fetch = /* @__PURE__ */ __name(async (url, opts) => {
|
|
32089
32598
|
if (/^data:/.test(url)) {
|
|
32090
32599
|
const request = new Request(url, opts);
|
|
32091
|
-
return Promise.resolve().then(() => new Promise((
|
|
32600
|
+
return Promise.resolve().then(() => new Promise((resolve28, reject) => {
|
|
32092
32601
|
let type, data;
|
|
32093
32602
|
try {
|
|
32094
32603
|
const { pathname, search } = new URL2(url);
|
|
@@ -32112,10 +32621,10 @@ var require_lib2 = __commonJS({
|
|
|
32112
32621
|
if (type) {
|
|
32113
32622
|
headers["Content-Type"] = type;
|
|
32114
32623
|
}
|
|
32115
|
-
return
|
|
32624
|
+
return resolve28(new Response(data, { headers }));
|
|
32116
32625
|
}));
|
|
32117
32626
|
}
|
|
32118
|
-
return new Promise((
|
|
32627
|
+
return new Promise((resolve28, reject) => {
|
|
32119
32628
|
const request = new Request(url, opts);
|
|
32120
32629
|
let options;
|
|
32121
32630
|
try {
|
|
@@ -32234,7 +32743,7 @@ var require_lib2 = __commonJS({
|
|
|
32234
32743
|
requestOpts.body = void 0;
|
|
32235
32744
|
requestOpts.headers.delete("content-length");
|
|
32236
32745
|
}
|
|
32237
|
-
|
|
32746
|
+
resolve28(fetch(new Request(locationURL, requestOpts)));
|
|
32238
32747
|
finalize();
|
|
32239
32748
|
return;
|
|
32240
32749
|
}
|
|
@@ -32262,7 +32771,7 @@ var require_lib2 = __commonJS({
|
|
|
32262
32771
|
const codings = headers.get("Content-Encoding");
|
|
32263
32772
|
if (!request.compress || request.method === "HEAD" || codings === null || res.statusCode === 204 || res.statusCode === 304) {
|
|
32264
32773
|
response = new Response(body, responseOptions);
|
|
32265
|
-
|
|
32774
|
+
resolve28(response);
|
|
32266
32775
|
return;
|
|
32267
32776
|
}
|
|
32268
32777
|
const zlibOptions = {
|
|
@@ -32281,7 +32790,7 @@ var require_lib2 = __commonJS({
|
|
|
32281
32790
|
).pipe(unzip),
|
|
32282
32791
|
responseOptions
|
|
32283
32792
|
);
|
|
32284
|
-
|
|
32793
|
+
resolve28(response);
|
|
32285
32794
|
return;
|
|
32286
32795
|
}
|
|
32287
32796
|
if (codings === "deflate" || codings === "x-deflate") {
|
|
@@ -32293,7 +32802,7 @@ var require_lib2 = __commonJS({
|
|
|
32293
32802
|
(er) => decoder2.emit("error", er)
|
|
32294
32803
|
).pipe(decoder2);
|
|
32295
32804
|
response = new Response(decoder2, responseOptions);
|
|
32296
|
-
|
|
32805
|
+
resolve28(response);
|
|
32297
32806
|
});
|
|
32298
32807
|
return;
|
|
32299
32808
|
}
|
|
@@ -32311,11 +32820,11 @@ var require_lib2 = __commonJS({
|
|
|
32311
32820
|
(er) => decoder.emit("error", er)
|
|
32312
32821
|
).pipe(decoder);
|
|
32313
32822
|
response = new Response(decoder, responseOptions);
|
|
32314
|
-
|
|
32823
|
+
resolve28(response);
|
|
32315
32824
|
return;
|
|
32316
32825
|
}
|
|
32317
32826
|
response = new Response(body, responseOptions);
|
|
32318
|
-
|
|
32827
|
+
resolve28(response);
|
|
32319
32828
|
});
|
|
32320
32829
|
writeToStream(req, request);
|
|
32321
32830
|
});
|
|
@@ -32569,12 +33078,12 @@ var require_lib3 = __commonJS({
|
|
|
32569
33078
|
return process.emit("input", "end");
|
|
32570
33079
|
}, "end"),
|
|
32571
33080
|
read: /* @__PURE__ */ __name(function(...args2) {
|
|
32572
|
-
let
|
|
33081
|
+
let resolve28, reject;
|
|
32573
33082
|
const promise = new Promise((_resolve, _reject) => {
|
|
32574
|
-
|
|
33083
|
+
resolve28 = _resolve;
|
|
32575
33084
|
reject = _reject;
|
|
32576
33085
|
});
|
|
32577
|
-
process.emit("input", "read",
|
|
33086
|
+
process.emit("input", "read", resolve28, reject, ...args2);
|
|
32578
33087
|
return promise;
|
|
32579
33088
|
}, "read")
|
|
32580
33089
|
}
|
|
@@ -36989,7 +37498,7 @@ var require_npa = __commonJS({
|
|
|
36989
37498
|
spec = arg;
|
|
36990
37499
|
}
|
|
36991
37500
|
}
|
|
36992
|
-
return
|
|
37501
|
+
return resolve28(name, spec, where, arg);
|
|
36993
37502
|
}
|
|
36994
37503
|
__name(npa, "npa");
|
|
36995
37504
|
function isFileSpec(spec) {
|
|
@@ -37012,7 +37521,7 @@ var require_npa = __commonJS({
|
|
|
37012
37521
|
return spec.toLowerCase().startsWith("npm:");
|
|
37013
37522
|
}
|
|
37014
37523
|
__name(isAliasSpec, "isAliasSpec");
|
|
37015
|
-
function
|
|
37524
|
+
function resolve28(name, spec, where, arg) {
|
|
37016
37525
|
const res = new Result({
|
|
37017
37526
|
raw: arg,
|
|
37018
37527
|
name,
|
|
@@ -37044,7 +37553,7 @@ var require_npa = __commonJS({
|
|
|
37044
37553
|
return fromRegistry(res);
|
|
37045
37554
|
}
|
|
37046
37555
|
}
|
|
37047
|
-
__name(
|
|
37556
|
+
__name(resolve28, "resolve");
|
|
37048
37557
|
function toPurl(arg, reg = defaultRegistry) {
|
|
37049
37558
|
const res = npa(arg);
|
|
37050
37559
|
if (res.type !== "version") {
|
|
@@ -37345,7 +37854,7 @@ var require_npa = __commonJS({
|
|
|
37345
37854
|
}
|
|
37346
37855
|
__name(fromRegistry, "fromRegistry");
|
|
37347
37856
|
module.exports = npa;
|
|
37348
|
-
module.exports.resolve =
|
|
37857
|
+
module.exports.resolve = resolve28;
|
|
37349
37858
|
module.exports.toPurl = toPurl;
|
|
37350
37859
|
module.exports.Result = Result;
|
|
37351
37860
|
}
|
|
@@ -38936,7 +39445,7 @@ var require_lib7 = __commonJS({
|
|
|
38936
39445
|
return `${this.algorithm}-${this.digest}${getOptString(this.options)}`;
|
|
38937
39446
|
}
|
|
38938
39447
|
};
|
|
38939
|
-
function integrityHashToString(toString,
|
|
39448
|
+
function integrityHashToString(toString, sep6, opts, hashes) {
|
|
38940
39449
|
const toStringIsNotEmpty = toString !== "";
|
|
38941
39450
|
let shouldAddFirstSep = false;
|
|
38942
39451
|
let complement = "";
|
|
@@ -38946,7 +39455,7 @@ var require_lib7 = __commonJS({
|
|
|
38946
39455
|
if (hashString) {
|
|
38947
39456
|
shouldAddFirstSep = true;
|
|
38948
39457
|
complement += hashString;
|
|
38949
|
-
complement +=
|
|
39458
|
+
complement += sep6;
|
|
38950
39459
|
}
|
|
38951
39460
|
}
|
|
38952
39461
|
const finalHashString = Hash.prototype.toString.call(hashes[lastIndex], opts);
|
|
@@ -38955,7 +39464,7 @@ var require_lib7 = __commonJS({
|
|
|
38955
39464
|
complement += finalHashString;
|
|
38956
39465
|
}
|
|
38957
39466
|
if (toStringIsNotEmpty && shouldAddFirstSep) {
|
|
38958
|
-
return toString +
|
|
39467
|
+
return toString + sep6 + complement;
|
|
38959
39468
|
}
|
|
38960
39469
|
return toString + complement;
|
|
38961
39470
|
}
|
|
@@ -38974,18 +39483,18 @@ var require_lib7 = __commonJS({
|
|
|
38974
39483
|
return Object.keys(this).length === 0;
|
|
38975
39484
|
}
|
|
38976
39485
|
toString(opts) {
|
|
38977
|
-
let
|
|
39486
|
+
let sep6 = opts?.sep || " ";
|
|
38978
39487
|
let toString = "";
|
|
38979
39488
|
if (opts?.strict) {
|
|
38980
|
-
|
|
39489
|
+
sep6 = sep6.replace(/\S+/g, " ");
|
|
38981
39490
|
for (const hash of SPEC_ALGORITHMS) {
|
|
38982
39491
|
if (this[hash]) {
|
|
38983
|
-
toString = integrityHashToString(toString,
|
|
39492
|
+
toString = integrityHashToString(toString, sep6, opts, this[hash]);
|
|
38984
39493
|
}
|
|
38985
39494
|
}
|
|
38986
39495
|
} else {
|
|
38987
39496
|
for (const hash of Object.keys(this)) {
|
|
38988
|
-
toString = integrityHashToString(toString,
|
|
39497
|
+
toString = integrityHashToString(toString, sep6, opts, this[hash]);
|
|
38989
39498
|
}
|
|
38990
39499
|
}
|
|
38991
39500
|
return toString;
|
|
@@ -39118,7 +39627,7 @@ var require_lib7 = __commonJS({
|
|
|
39118
39627
|
module.exports.fromStream = fromStream;
|
|
39119
39628
|
function fromStream(stream, opts) {
|
|
39120
39629
|
const istream = integrityStream(opts);
|
|
39121
|
-
return new Promise((
|
|
39630
|
+
return new Promise((resolve28, reject) => {
|
|
39122
39631
|
stream.pipe(istream);
|
|
39123
39632
|
stream.on("error", reject);
|
|
39124
39633
|
istream.on("error", reject);
|
|
@@ -39126,7 +39635,7 @@ var require_lib7 = __commonJS({
|
|
|
39126
39635
|
istream.on("integrity", (s) => {
|
|
39127
39636
|
sri = s;
|
|
39128
39637
|
});
|
|
39129
|
-
istream.on("end", () =>
|
|
39638
|
+
istream.on("end", () => resolve28(sri));
|
|
39130
39639
|
istream.resume();
|
|
39131
39640
|
});
|
|
39132
39641
|
}
|
|
@@ -39187,7 +39696,7 @@ var require_lib7 = __commonJS({
|
|
|
39187
39696
|
));
|
|
39188
39697
|
}
|
|
39189
39698
|
const checker = integrityStream(opts);
|
|
39190
|
-
return new Promise((
|
|
39699
|
+
return new Promise((resolve28, reject) => {
|
|
39191
39700
|
stream.pipe(checker);
|
|
39192
39701
|
stream.on("error", reject);
|
|
39193
39702
|
checker.on("error", reject);
|
|
@@ -39195,7 +39704,7 @@ var require_lib7 = __commonJS({
|
|
|
39195
39704
|
checker.on("verified", (s) => {
|
|
39196
39705
|
verified = s;
|
|
39197
39706
|
});
|
|
39198
|
-
checker.on("end", () =>
|
|
39707
|
+
checker.on("end", () => resolve28(verified));
|
|
39199
39708
|
checker.resume();
|
|
39200
39709
|
});
|
|
39201
39710
|
}
|
|
@@ -40076,9 +40585,9 @@ var require_polyfill = __commonJS({
|
|
|
40076
40585
|
var {
|
|
40077
40586
|
chmod: chmod5,
|
|
40078
40587
|
copyFile,
|
|
40079
|
-
lstat:
|
|
40588
|
+
lstat: lstat17,
|
|
40080
40589
|
mkdir: mkdir18,
|
|
40081
|
-
readdir:
|
|
40590
|
+
readdir: readdir16,
|
|
40082
40591
|
readlink: readlink2,
|
|
40083
40592
|
stat: stat9,
|
|
40084
40593
|
symlink,
|
|
@@ -40088,10 +40597,10 @@ var require_polyfill = __commonJS({
|
|
|
40088
40597
|
var {
|
|
40089
40598
|
dirname: dirname16,
|
|
40090
40599
|
isAbsolute: isAbsolute21,
|
|
40091
|
-
join:
|
|
40600
|
+
join: join29,
|
|
40092
40601
|
parse: parse2,
|
|
40093
|
-
resolve:
|
|
40094
|
-
sep:
|
|
40602
|
+
resolve: resolve28,
|
|
40603
|
+
sep: sep6,
|
|
40095
40604
|
toNamespacedPath
|
|
40096
40605
|
} = __require("path");
|
|
40097
40606
|
var { fileURLToPath: fileURLToPath3 } = __require("url");
|
|
@@ -40177,7 +40686,7 @@ var require_polyfill = __commonJS({
|
|
|
40177
40686
|
}
|
|
40178
40687
|
__name(areIdentical, "areIdentical");
|
|
40179
40688
|
function getStats(src, dest, opts) {
|
|
40180
|
-
const statFunc = opts.dereference ? (file) => stat9(file, { bigint: true }) : (file) =>
|
|
40689
|
+
const statFunc = opts.dereference ? (file) => stat9(file, { bigint: true }) : (file) => lstat17(file, { bigint: true });
|
|
40181
40690
|
return Promise.all([
|
|
40182
40691
|
statFunc(src),
|
|
40183
40692
|
statFunc(dest).catch((err) => {
|
|
@@ -40208,8 +40717,8 @@ var require_polyfill = __commonJS({
|
|
|
40208
40717
|
}
|
|
40209
40718
|
__name(pathExists2, "pathExists");
|
|
40210
40719
|
async function checkParentPaths(src, srcStat, dest) {
|
|
40211
|
-
const srcParent =
|
|
40212
|
-
const destParent =
|
|
40720
|
+
const srcParent = resolve28(dirname16(src));
|
|
40721
|
+
const destParent = resolve28(dirname16(dest));
|
|
40213
40722
|
if (destParent === srcParent || destParent === parse2(destParent).root) {
|
|
40214
40723
|
return;
|
|
40215
40724
|
}
|
|
@@ -40233,7 +40742,7 @@ var require_polyfill = __commonJS({
|
|
|
40233
40742
|
return checkParentPaths(src, srcStat, destParent);
|
|
40234
40743
|
}
|
|
40235
40744
|
__name(checkParentPaths, "checkParentPaths");
|
|
40236
|
-
var normalizePathToArray = /* @__PURE__ */ __name((path3) =>
|
|
40745
|
+
var normalizePathToArray = /* @__PURE__ */ __name((path3) => resolve28(path3).split(sep6).filter(Boolean), "normalizePathToArray");
|
|
40237
40746
|
function isSrcSubdir(src, dest) {
|
|
40238
40747
|
const srcArr = normalizePathToArray(src);
|
|
40239
40748
|
const destArr = normalizePathToArray(dest);
|
|
@@ -40255,7 +40764,7 @@ var require_polyfill = __commonJS({
|
|
|
40255
40764
|
}
|
|
40256
40765
|
__name(startCopy, "startCopy");
|
|
40257
40766
|
async function getStatsForCopy(destStat, src, dest, opts) {
|
|
40258
|
-
const statFn = opts.dereference ? stat9 :
|
|
40767
|
+
const statFn = opts.dereference ? stat9 : lstat17;
|
|
40259
40768
|
const srcStat = await statFn(src);
|
|
40260
40769
|
if (srcStat.isDirectory() && opts.recursive) {
|
|
40261
40770
|
return onDir(srcStat, destStat, src, dest, opts);
|
|
@@ -40366,11 +40875,11 @@ var require_polyfill = __commonJS({
|
|
|
40366
40875
|
}
|
|
40367
40876
|
__name(mkDirAndCopy, "mkDirAndCopy");
|
|
40368
40877
|
async function copyDir(src, dest, opts) {
|
|
40369
|
-
const dir = await
|
|
40878
|
+
const dir = await readdir16(src);
|
|
40370
40879
|
for (let i = 0; i < dir.length; i++) {
|
|
40371
40880
|
const item = dir[i];
|
|
40372
|
-
const srcItem =
|
|
40373
|
-
const destItem =
|
|
40881
|
+
const srcItem = join29(src, item);
|
|
40882
|
+
const destItem = join29(dest, item);
|
|
40374
40883
|
const { destStat } = await checkPaths(srcItem, destItem, opts);
|
|
40375
40884
|
await startCopy(destStat, srcItem, destItem, opts);
|
|
40376
40885
|
}
|
|
@@ -40379,7 +40888,7 @@ var require_polyfill = __commonJS({
|
|
|
40379
40888
|
async function onLink(destStat, src, dest) {
|
|
40380
40889
|
let resolvedSrc = await readlink2(src);
|
|
40381
40890
|
if (!isAbsolute21(resolvedSrc)) {
|
|
40382
|
-
resolvedSrc =
|
|
40891
|
+
resolvedSrc = resolve28(dirname16(src), resolvedSrc);
|
|
40383
40892
|
}
|
|
40384
40893
|
if (!destStat) {
|
|
40385
40894
|
return symlink(resolvedSrc, dest);
|
|
@@ -40394,7 +40903,7 @@ var require_polyfill = __commonJS({
|
|
|
40394
40903
|
throw err;
|
|
40395
40904
|
}
|
|
40396
40905
|
if (!isAbsolute21(resolvedDest)) {
|
|
40397
|
-
resolvedDest =
|
|
40906
|
+
resolvedDest = resolve28(dirname16(dest), resolvedDest);
|
|
40398
40907
|
}
|
|
40399
40908
|
if (isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
40400
40909
|
throw new ERR_FS_CP_EINVAL({
|
|
@@ -40446,15 +40955,15 @@ var require_cp = __commonJS({
|
|
|
40446
40955
|
// ../../node_modules/.pnpm/@npmcli+fs@4.0.0/node_modules/@npmcli/fs/lib/with-temp-dir.js
|
|
40447
40956
|
var require_with_temp_dir = __commonJS({
|
|
40448
40957
|
"../../node_modules/.pnpm/@npmcli+fs@4.0.0/node_modules/@npmcli/fs/lib/with-temp-dir.js"(exports, module) {
|
|
40449
|
-
var { join:
|
|
40958
|
+
var { join: join29, sep: sep6 } = __require("path");
|
|
40450
40959
|
var getOptions = require_get_options();
|
|
40451
|
-
var { mkdir: mkdir18, mkdtemp:
|
|
40960
|
+
var { mkdir: mkdir18, mkdtemp: mkdtemp6, rm: rm10 } = __require("fs/promises");
|
|
40452
40961
|
var withTempDir = /* @__PURE__ */ __name(async (root, fn, opts) => {
|
|
40453
40962
|
const options = getOptions(opts, {
|
|
40454
40963
|
copy: ["tmpPrefix"]
|
|
40455
40964
|
});
|
|
40456
40965
|
await mkdir18(root, { recursive: true });
|
|
40457
|
-
const target = await
|
|
40966
|
+
const target = await mkdtemp6(join29(`${root}${sep6}`, options.tmpPrefix || ""));
|
|
40458
40967
|
let err;
|
|
40459
40968
|
let result;
|
|
40460
40969
|
try {
|
|
@@ -40463,7 +40972,7 @@ var require_with_temp_dir = __commonJS({
|
|
|
40463
40972
|
err = _err;
|
|
40464
40973
|
}
|
|
40465
40974
|
try {
|
|
40466
|
-
await
|
|
40975
|
+
await rm10(target, { force: true, recursive: true });
|
|
40467
40976
|
} catch {
|
|
40468
40977
|
}
|
|
40469
40978
|
if (err) {
|
|
@@ -40478,14 +40987,14 @@ var require_with_temp_dir = __commonJS({
|
|
|
40478
40987
|
// ../../node_modules/.pnpm/@npmcli+fs@4.0.0/node_modules/@npmcli/fs/lib/readdir-scoped.js
|
|
40479
40988
|
var require_readdir_scoped = __commonJS({
|
|
40480
40989
|
"../../node_modules/.pnpm/@npmcli+fs@4.0.0/node_modules/@npmcli/fs/lib/readdir-scoped.js"(exports, module) {
|
|
40481
|
-
var { readdir:
|
|
40482
|
-
var { join:
|
|
40990
|
+
var { readdir: readdir16 } = __require("fs/promises");
|
|
40991
|
+
var { join: join29 } = __require("path");
|
|
40483
40992
|
var readdirScoped = /* @__PURE__ */ __name(async (dir) => {
|
|
40484
40993
|
const results = [];
|
|
40485
|
-
for (const item of await
|
|
40994
|
+
for (const item of await readdir16(dir)) {
|
|
40486
40995
|
if (item.startsWith("@")) {
|
|
40487
|
-
for (const scopedItem of await
|
|
40488
|
-
results.push(
|
|
40996
|
+
for (const scopedItem of await readdir16(join29(dir, item))) {
|
|
40997
|
+
results.push(join29(item, scopedItem));
|
|
40489
40998
|
}
|
|
40490
40999
|
} else {
|
|
40491
41000
|
results.push(item);
|
|
@@ -40500,7 +41009,7 @@ var require_readdir_scoped = __commonJS({
|
|
|
40500
41009
|
// ../../node_modules/.pnpm/@npmcli+fs@4.0.0/node_modules/@npmcli/fs/lib/move-file.js
|
|
40501
41010
|
var require_move_file = __commonJS({
|
|
40502
41011
|
"../../node_modules/.pnpm/@npmcli+fs@4.0.0/node_modules/@npmcli/fs/lib/move-file.js"(exports, module) {
|
|
40503
|
-
var { dirname: dirname16, join:
|
|
41012
|
+
var { dirname: dirname16, join: join29, resolve: resolve28, relative: relative25, isAbsolute: isAbsolute21 } = __require("path");
|
|
40504
41013
|
var fs = __require("fs/promises");
|
|
40505
41014
|
var pathExists2 = /* @__PURE__ */ __name(async (path3) => {
|
|
40506
41015
|
try {
|
|
@@ -40530,7 +41039,7 @@ var require_move_file = __commonJS({
|
|
|
40530
41039
|
if (sourceStat.isDirectory()) {
|
|
40531
41040
|
const files = await fs.readdir(source);
|
|
40532
41041
|
await Promise.all(files.map(
|
|
40533
|
-
(file) => moveFile(
|
|
41042
|
+
(file) => moveFile(join29(source, file), join29(destination, file), options, false, symlinks)
|
|
40534
41043
|
));
|
|
40535
41044
|
} else if (sourceStat.isSymbolicLink()) {
|
|
40536
41045
|
symlinks.push({ source, destination });
|
|
@@ -40545,11 +41054,11 @@ var require_move_file = __commonJS({
|
|
|
40545
41054
|
await Promise.all(symlinks.map(async ({ source: symSource, destination: symDestination }) => {
|
|
40546
41055
|
let target = await fs.readlink(symSource);
|
|
40547
41056
|
if (isAbsolute21(target)) {
|
|
40548
|
-
target =
|
|
41057
|
+
target = resolve28(symDestination, relative25(symSource, target));
|
|
40549
41058
|
}
|
|
40550
41059
|
let targetStat = "file";
|
|
40551
41060
|
try {
|
|
40552
|
-
targetStat = await fs.stat(
|
|
41061
|
+
targetStat = await fs.stat(resolve28(dirname16(symSource), target));
|
|
40553
41062
|
if (targetStat.isDirectory()) {
|
|
40554
41063
|
targetStat = "junction";
|
|
40555
41064
|
}
|
|
@@ -40622,7 +41131,7 @@ async function pMap(iterable, mapper, {
|
|
|
40622
41131
|
const cleanup = /* @__PURE__ */ __name(() => {
|
|
40623
41132
|
signal?.removeEventListener("abort", signalListener);
|
|
40624
41133
|
}, "cleanup");
|
|
40625
|
-
const
|
|
41134
|
+
const resolve28 = /* @__PURE__ */ __name((value) => {
|
|
40626
41135
|
resolve_(value);
|
|
40627
41136
|
cleanup();
|
|
40628
41137
|
}, "resolve");
|
|
@@ -40654,7 +41163,7 @@ async function pMap(iterable, mapper, {
|
|
|
40654
41163
|
}
|
|
40655
41164
|
isResolved = true;
|
|
40656
41165
|
if (skippedIndexesMap.size === 0) {
|
|
40657
|
-
|
|
41166
|
+
resolve28(result);
|
|
40658
41167
|
return;
|
|
40659
41168
|
}
|
|
40660
41169
|
const pureResult = [];
|
|
@@ -40664,7 +41173,7 @@ async function pMap(iterable, mapper, {
|
|
|
40664
41173
|
}
|
|
40665
41174
|
pureResult.push(value);
|
|
40666
41175
|
}
|
|
40667
|
-
|
|
41176
|
+
resolve28(pureResult);
|
|
40668
41177
|
}
|
|
40669
41178
|
return;
|
|
40670
41179
|
}
|
|
@@ -40804,9 +41313,9 @@ var require_entry_index = __commonJS({
|
|
|
40804
41313
|
var {
|
|
40805
41314
|
appendFile,
|
|
40806
41315
|
mkdir: mkdir18,
|
|
40807
|
-
readFile:
|
|
40808
|
-
readdir:
|
|
40809
|
-
rm:
|
|
41316
|
+
readFile: readFile33,
|
|
41317
|
+
readdir: readdir16,
|
|
41318
|
+
rm: rm10,
|
|
40810
41319
|
writeFile: writeFile11
|
|
40811
41320
|
} = __require("fs/promises");
|
|
40812
41321
|
var { Minipass } = require_commonjs();
|
|
@@ -40858,7 +41367,7 @@ var require_entry_index = __commonJS({
|
|
|
40858
41367
|
}, "setup");
|
|
40859
41368
|
const teardown = /* @__PURE__ */ __name(async (tmp2) => {
|
|
40860
41369
|
if (!tmp2.moved) {
|
|
40861
|
-
return
|
|
41370
|
+
return rm10(tmp2.target, { recursive: true, force: true });
|
|
40862
41371
|
}
|
|
40863
41372
|
}, "teardown");
|
|
40864
41373
|
const write = /* @__PURE__ */ __name(async (tmp2) => {
|
|
@@ -40928,7 +41437,7 @@ ${hashEntry(stringified)} ${stringified}`);
|
|
|
40928
41437
|
return insert(cache, key, null, opts);
|
|
40929
41438
|
}
|
|
40930
41439
|
const bucket = bucketPath(cache, key);
|
|
40931
|
-
return
|
|
41440
|
+
return rm10(bucket, { recursive: true, force: true });
|
|
40932
41441
|
}
|
|
40933
41442
|
__name(del, "del");
|
|
40934
41443
|
module.exports.lsStream = lsStream;
|
|
@@ -40996,7 +41505,7 @@ ${hashEntry(stringified)} ${stringified}`);
|
|
|
40996
41505
|
__name(ls, "ls");
|
|
40997
41506
|
module.exports.bucketEntries = bucketEntries;
|
|
40998
41507
|
async function bucketEntries(bucket, filter) {
|
|
40999
|
-
const data = await
|
|
41508
|
+
const data = await readFile33(bucket, "utf8");
|
|
41000
41509
|
return _bucketEntries(data, filter);
|
|
41001
41510
|
}
|
|
41002
41511
|
__name(bucketEntries, "bucketEntries");
|
|
@@ -41065,7 +41574,7 @@ ${hashEntry(stringified)} ${stringified}`);
|
|
|
41065
41574
|
}
|
|
41066
41575
|
__name(formatEntry, "formatEntry");
|
|
41067
41576
|
function readdirOrEmpty(dir) {
|
|
41068
|
-
return
|
|
41577
|
+
return readdir16(dir).catch((err) => {
|
|
41069
41578
|
if (err.code === "ENOENT" || err.code === "ENOTDIR") {
|
|
41070
41579
|
return [];
|
|
41071
41580
|
}
|
|
@@ -44870,9 +45379,9 @@ var require_commonjs5 = __commonJS({
|
|
|
44870
45379
|
if (this.#asyncReaddirInFlight) {
|
|
44871
45380
|
await this.#asyncReaddirInFlight;
|
|
44872
45381
|
} else {
|
|
44873
|
-
let
|
|
45382
|
+
let resolve28 = /* @__PURE__ */ __name(() => {
|
|
44874
45383
|
}, "resolve");
|
|
44875
|
-
this.#asyncReaddirInFlight = new Promise((res) =>
|
|
45384
|
+
this.#asyncReaddirInFlight = new Promise((res) => resolve28 = res);
|
|
44876
45385
|
try {
|
|
44877
45386
|
for (const e of await this.#fs.promises.readdir(fullpath, {
|
|
44878
45387
|
withFileTypes: true
|
|
@@ -44885,7 +45394,7 @@ var require_commonjs5 = __commonJS({
|
|
|
44885
45394
|
children.provisional = 0;
|
|
44886
45395
|
}
|
|
44887
45396
|
this.#asyncReaddirInFlight = void 0;
|
|
44888
|
-
|
|
45397
|
+
resolve28();
|
|
44889
45398
|
}
|
|
44890
45399
|
return children.slice(0, children.provisional);
|
|
44891
45400
|
}
|
|
@@ -45127,7 +45636,7 @@ var require_commonjs5 = __commonJS({
|
|
|
45127
45636
|
*
|
|
45128
45637
|
* @internal
|
|
45129
45638
|
*/
|
|
45130
|
-
constructor(cwd = process.cwd(), pathImpl,
|
|
45639
|
+
constructor(cwd = process.cwd(), pathImpl, sep6, { nocase, childrenCacheSize = 16 * 1024, fs = defaultFS } = {}) {
|
|
45131
45640
|
this.#fs = fsFromOption(fs);
|
|
45132
45641
|
if (cwd instanceof URL || cwd.startsWith("file://")) {
|
|
45133
45642
|
cwd = (0, node_url_1.fileURLToPath)(cwd);
|
|
@@ -45138,7 +45647,7 @@ var require_commonjs5 = __commonJS({
|
|
|
45138
45647
|
this.#resolveCache = new ResolveCache();
|
|
45139
45648
|
this.#resolvePosixCache = new ResolveCache();
|
|
45140
45649
|
this.#children = new ChildrenCache(childrenCacheSize);
|
|
45141
|
-
const split = cwdPath.substring(this.rootPath.length).split(
|
|
45650
|
+
const split = cwdPath.substring(this.rootPath.length).split(sep6);
|
|
45142
45651
|
if (split.length === 1 && !split[0]) {
|
|
45143
45652
|
split.pop();
|
|
45144
45653
|
}
|
|
@@ -45996,10 +46505,10 @@ var require_ignore = __commonJS({
|
|
|
45996
46505
|
ignored(p) {
|
|
45997
46506
|
const fullpath = p.fullpath();
|
|
45998
46507
|
const fullpaths = `${fullpath}/`;
|
|
45999
|
-
const
|
|
46000
|
-
const relatives = `${
|
|
46508
|
+
const relative25 = p.relative() || ".";
|
|
46509
|
+
const relatives = `${relative25}/`;
|
|
46001
46510
|
for (const m of this.relative) {
|
|
46002
|
-
if (m.match(
|
|
46511
|
+
if (m.match(relative25) || m.match(relatives))
|
|
46003
46512
|
return true;
|
|
46004
46513
|
}
|
|
46005
46514
|
for (const m of this.absolute) {
|
|
@@ -46010,9 +46519,9 @@ var require_ignore = __commonJS({
|
|
|
46010
46519
|
}
|
|
46011
46520
|
childrenIgnored(p) {
|
|
46012
46521
|
const fullpath = p.fullpath() + "/";
|
|
46013
|
-
const
|
|
46522
|
+
const relative25 = (p.relative() || ".") + "/";
|
|
46014
46523
|
for (const m of this.relativeChildren) {
|
|
46015
|
-
if (m.match(
|
|
46524
|
+
if (m.match(relative25))
|
|
46016
46525
|
return true;
|
|
46017
46526
|
}
|
|
46018
46527
|
for (const m of this.absoluteChildren) {
|
|
@@ -46963,8 +47472,8 @@ var require_rm = __commonJS({
|
|
|
46963
47472
|
var fs = __require("fs/promises");
|
|
46964
47473
|
var contentPath = require_path();
|
|
46965
47474
|
var { hasContent } = require_read();
|
|
46966
|
-
module.exports =
|
|
46967
|
-
async function
|
|
47475
|
+
module.exports = rm10;
|
|
47476
|
+
async function rm10(cache, integrity) {
|
|
46968
47477
|
const content = await hasContent(cache, integrity);
|
|
46969
47478
|
if (content && content.sri) {
|
|
46970
47479
|
await fs.rm(contentPath(cache, content.sri), { recursive: true, force: true });
|
|
@@ -46973,7 +47482,7 @@ var require_rm = __commonJS({
|
|
|
46973
47482
|
return false;
|
|
46974
47483
|
}
|
|
46975
47484
|
}
|
|
46976
|
-
__name(
|
|
47485
|
+
__name(rm10, "rm");
|
|
46977
47486
|
}
|
|
46978
47487
|
});
|
|
46979
47488
|
|
|
@@ -46981,7 +47490,7 @@ var require_rm = __commonJS({
|
|
|
46981
47490
|
var require_rm2 = __commonJS({
|
|
46982
47491
|
"../../node_modules/.pnpm/cacache@19.0.1/node_modules/cacache/lib/rm.js"(exports, module) {
|
|
46983
47492
|
"use strict";
|
|
46984
|
-
var { rm:
|
|
47493
|
+
var { rm: rm10 } = __require("fs/promises");
|
|
46985
47494
|
var glob = require_glob2();
|
|
46986
47495
|
var index = require_entry_index();
|
|
46987
47496
|
var memo = require_memoization();
|
|
@@ -47004,7 +47513,7 @@ var require_rm2 = __commonJS({
|
|
|
47004
47513
|
async function all(cache) {
|
|
47005
47514
|
memo.clearMemoized();
|
|
47006
47515
|
const paths = await glob(path3.join(cache, "*(content-*|index-*)"), { silent: true, nosort: true });
|
|
47007
|
-
return Promise.all(paths.map((p) =>
|
|
47516
|
+
return Promise.all(paths.map((p) => rm10(p, { recursive: true, force: true })));
|
|
47008
47517
|
}
|
|
47009
47518
|
__name(all, "all");
|
|
47010
47519
|
}
|
|
@@ -47016,8 +47525,8 @@ var require_verify = __commonJS({
|
|
|
47016
47525
|
"use strict";
|
|
47017
47526
|
var {
|
|
47018
47527
|
mkdir: mkdir18,
|
|
47019
|
-
readFile:
|
|
47020
|
-
rm:
|
|
47528
|
+
readFile: readFile33,
|
|
47529
|
+
rm: rm10,
|
|
47021
47530
|
stat: stat9,
|
|
47022
47531
|
truncate,
|
|
47023
47532
|
writeFile: writeFile11
|
|
@@ -47103,8 +47612,8 @@ var require_verify = __commonJS({
|
|
|
47103
47612
|
liveContent.add(integrity[algo].toString());
|
|
47104
47613
|
}
|
|
47105
47614
|
});
|
|
47106
|
-
await new Promise((
|
|
47107
|
-
indexStream.on("end",
|
|
47615
|
+
await new Promise((resolve28, reject) => {
|
|
47616
|
+
indexStream.on("end", resolve28).on("error", reject);
|
|
47108
47617
|
});
|
|
47109
47618
|
const contentDir = contentPath.contentDir(cache);
|
|
47110
47619
|
const files = await glob(path3.join(contentDir, "**"), {
|
|
@@ -47139,7 +47648,7 @@ var require_verify = __commonJS({
|
|
|
47139
47648
|
} else {
|
|
47140
47649
|
stats.reclaimedCount++;
|
|
47141
47650
|
const s = await stat9(f);
|
|
47142
|
-
await
|
|
47651
|
+
await rm10(f, { recursive: true, force: true });
|
|
47143
47652
|
stats.reclaimedSize += s.size;
|
|
47144
47653
|
}
|
|
47145
47654
|
return stats;
|
|
@@ -47163,7 +47672,7 @@ var require_verify = __commonJS({
|
|
|
47163
47672
|
if (err.code !== "EINTEGRITY") {
|
|
47164
47673
|
throw err;
|
|
47165
47674
|
}
|
|
47166
|
-
await
|
|
47675
|
+
await rm10(filepath, { recursive: true, force: true });
|
|
47167
47676
|
contentInfo.valid = false;
|
|
47168
47677
|
}
|
|
47169
47678
|
return contentInfo;
|
|
@@ -47232,7 +47741,7 @@ var require_verify = __commonJS({
|
|
|
47232
47741
|
__name(rebuildBucket, "rebuildBucket");
|
|
47233
47742
|
function cleanTmp(cache, opts) {
|
|
47234
47743
|
opts.log.silly("verify", "cleaning tmp directory");
|
|
47235
|
-
return
|
|
47744
|
+
return rm10(path3.join(cache, "tmp"), { recursive: true, force: true });
|
|
47236
47745
|
}
|
|
47237
47746
|
__name(cleanTmp, "cleanTmp");
|
|
47238
47747
|
async function writeVerifile(cache, opts) {
|
|
@@ -47243,7 +47752,7 @@ var require_verify = __commonJS({
|
|
|
47243
47752
|
__name(writeVerifile, "writeVerifile");
|
|
47244
47753
|
module.exports.lastRun = lastRun;
|
|
47245
47754
|
async function lastRun(cache) {
|
|
47246
|
-
const data = await
|
|
47755
|
+
const data = await readFile33(path3.join(cache, "_lastverified"), { encoding: "utf8" });
|
|
47247
47756
|
return /* @__PURE__ */ new Date(+data);
|
|
47248
47757
|
}
|
|
47249
47758
|
__name(lastRun, "lastRun");
|
|
@@ -47284,7 +47793,7 @@ var require_lib12 = __commonJS({
|
|
|
47284
47793
|
"use strict";
|
|
47285
47794
|
var get = require_get();
|
|
47286
47795
|
var put = require_put();
|
|
47287
|
-
var
|
|
47796
|
+
var rm10 = require_rm2();
|
|
47288
47797
|
var verify = require_verify();
|
|
47289
47798
|
var { clearMemoized } = require_memoization();
|
|
47290
47799
|
var tmp = require_tmp();
|
|
@@ -47304,10 +47813,10 @@ var require_lib12 = __commonJS({
|
|
|
47304
47813
|
module.exports.get.hasContent = get.hasContent;
|
|
47305
47814
|
module.exports.put = put;
|
|
47306
47815
|
module.exports.put.stream = put.stream;
|
|
47307
|
-
module.exports.rm =
|
|
47308
|
-
module.exports.rm.all =
|
|
47816
|
+
module.exports.rm = rm10.entry;
|
|
47817
|
+
module.exports.rm.all = rm10.all;
|
|
47309
47818
|
module.exports.rm.entry = module.exports.rm;
|
|
47310
|
-
module.exports.rm.content =
|
|
47819
|
+
module.exports.rm.content = rm10.content;
|
|
47311
47820
|
module.exports.clearMemoized = clearMemoized;
|
|
47312
47821
|
module.exports.tmp = {};
|
|
47313
47822
|
module.exports.tmp.mkdir = tmp.mkdir;
|
|
@@ -47660,7 +48169,7 @@ var require_promise_retry = __commonJS({
|
|
|
47660
48169
|
fn = temp;
|
|
47661
48170
|
}
|
|
47662
48171
|
operation = retry.operation(options);
|
|
47663
|
-
return new Promise(function(
|
|
48172
|
+
return new Promise(function(resolve28, reject) {
|
|
47664
48173
|
operation.attempt(function(number) {
|
|
47665
48174
|
Promise.resolve().then(function() {
|
|
47666
48175
|
return fn(function(err) {
|
|
@@ -47669,7 +48178,7 @@ var require_promise_retry = __commonJS({
|
|
|
47669
48178
|
}
|
|
47670
48179
|
throw errcode(new Error("Retrying"), "EPROMISERETRY", { retried: err });
|
|
47671
48180
|
}, number);
|
|
47672
|
-
}).then(
|
|
48181
|
+
}).then(resolve28, function(err) {
|
|
47673
48182
|
if (isRetryError(err)) {
|
|
47674
48183
|
err = err.retried;
|
|
47675
48184
|
if (operation.retry(err || new Error())) {
|
|
@@ -48554,8 +49063,8 @@ var require_helpers = __commonJS({
|
|
|
48554
49063
|
function req(url, opts = {}) {
|
|
48555
49064
|
const href = typeof url === "string" ? url : url.href;
|
|
48556
49065
|
const req2 = (href.startsWith("https:") ? https : http).request(url, opts);
|
|
48557
|
-
const promise = new Promise((
|
|
48558
|
-
req2.once("response",
|
|
49066
|
+
const promise = new Promise((resolve28, reject) => {
|
|
49067
|
+
req2.once("response", resolve28).once("error", reject).end();
|
|
48559
49068
|
});
|
|
48560
49069
|
req2.then = promise.then.bind(promise);
|
|
48561
49070
|
return req2;
|
|
@@ -48870,7 +49379,7 @@ var require_parse_proxy_response = __commonJS({
|
|
|
48870
49379
|
var debug_1 = __importDefault(require_src());
|
|
48871
49380
|
var debug = (0, debug_1.default)("https-proxy-agent:parse-proxy-response");
|
|
48872
49381
|
function parseProxyResponse(socket) {
|
|
48873
|
-
return new Promise((
|
|
49382
|
+
return new Promise((resolve28, reject) => {
|
|
48874
49383
|
let buffersLength = 0;
|
|
48875
49384
|
const buffers = [];
|
|
48876
49385
|
function read() {
|
|
@@ -48940,7 +49449,7 @@ var require_parse_proxy_response = __commonJS({
|
|
|
48940
49449
|
}
|
|
48941
49450
|
debug("got proxy server response: %o %o", firstLine, headers);
|
|
48942
49451
|
cleanup();
|
|
48943
|
-
|
|
49452
|
+
resolve28({
|
|
48944
49453
|
connect: {
|
|
48945
49454
|
statusCode,
|
|
48946
49455
|
statusText,
|
|
@@ -52619,12 +53128,12 @@ var require_socksclient = __commonJS({
|
|
|
52619
53128
|
"use strict";
|
|
52620
53129
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
52621
53130
|
function adopt(value) {
|
|
52622
|
-
return value instanceof P ? value : new P(function(
|
|
52623
|
-
|
|
53131
|
+
return value instanceof P ? value : new P(function(resolve28) {
|
|
53132
|
+
resolve28(value);
|
|
52624
53133
|
});
|
|
52625
53134
|
}
|
|
52626
53135
|
__name(adopt, "adopt");
|
|
52627
|
-
return new (P || (P = Promise))(function(
|
|
53136
|
+
return new (P || (P = Promise))(function(resolve28, reject) {
|
|
52628
53137
|
function fulfilled(value) {
|
|
52629
53138
|
try {
|
|
52630
53139
|
step(generator.next(value));
|
|
@@ -52642,7 +53151,7 @@ var require_socksclient = __commonJS({
|
|
|
52642
53151
|
}
|
|
52643
53152
|
__name(rejected, "rejected");
|
|
52644
53153
|
function step(result) {
|
|
52645
|
-
result.done ?
|
|
53154
|
+
result.done ? resolve28(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
52646
53155
|
}
|
|
52647
53156
|
__name(step, "step");
|
|
52648
53157
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
@@ -52680,13 +53189,13 @@ var require_socksclient = __commonJS({
|
|
|
52680
53189
|
* @returns { Promise }
|
|
52681
53190
|
*/
|
|
52682
53191
|
static createConnection(options, callback) {
|
|
52683
|
-
return new Promise((
|
|
53192
|
+
return new Promise((resolve28, reject) => {
|
|
52684
53193
|
try {
|
|
52685
53194
|
(0, helpers_1.validateSocksClientOptions)(options, ["connect"]);
|
|
52686
53195
|
} catch (err) {
|
|
52687
53196
|
if (typeof callback === "function") {
|
|
52688
53197
|
callback(err);
|
|
52689
|
-
return
|
|
53198
|
+
return resolve28(err);
|
|
52690
53199
|
} else {
|
|
52691
53200
|
return reject(err);
|
|
52692
53201
|
}
|
|
@@ -52697,16 +53206,16 @@ var require_socksclient = __commonJS({
|
|
|
52697
53206
|
client.removeAllListeners();
|
|
52698
53207
|
if (typeof callback === "function") {
|
|
52699
53208
|
callback(null, info);
|
|
52700
|
-
|
|
53209
|
+
resolve28(info);
|
|
52701
53210
|
} else {
|
|
52702
|
-
|
|
53211
|
+
resolve28(info);
|
|
52703
53212
|
}
|
|
52704
53213
|
});
|
|
52705
53214
|
client.once("error", (err) => {
|
|
52706
53215
|
client.removeAllListeners();
|
|
52707
53216
|
if (typeof callback === "function") {
|
|
52708
53217
|
callback(err);
|
|
52709
|
-
|
|
53218
|
+
resolve28(err);
|
|
52710
53219
|
} else {
|
|
52711
53220
|
reject(err);
|
|
52712
53221
|
}
|
|
@@ -52723,13 +53232,13 @@ var require_socksclient = __commonJS({
|
|
|
52723
53232
|
* @returns { Promise }
|
|
52724
53233
|
*/
|
|
52725
53234
|
static createConnectionChain(options, callback) {
|
|
52726
|
-
return new Promise((
|
|
53235
|
+
return new Promise((resolve28, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
52727
53236
|
try {
|
|
52728
53237
|
(0, helpers_1.validateSocksClientChainOptions)(options);
|
|
52729
53238
|
} catch (err) {
|
|
52730
53239
|
if (typeof callback === "function") {
|
|
52731
53240
|
callback(err);
|
|
52732
|
-
return
|
|
53241
|
+
return resolve28(err);
|
|
52733
53242
|
} else {
|
|
52734
53243
|
return reject(err);
|
|
52735
53244
|
}
|
|
@@ -52755,14 +53264,14 @@ var require_socksclient = __commonJS({
|
|
|
52755
53264
|
}
|
|
52756
53265
|
if (typeof callback === "function") {
|
|
52757
53266
|
callback(null, { socket: sock });
|
|
52758
|
-
|
|
53267
|
+
resolve28({ socket: sock });
|
|
52759
53268
|
} else {
|
|
52760
|
-
|
|
53269
|
+
resolve28({ socket: sock });
|
|
52761
53270
|
}
|
|
52762
53271
|
} catch (err) {
|
|
52763
53272
|
if (typeof callback === "function") {
|
|
52764
53273
|
callback(err);
|
|
52765
|
-
|
|
53274
|
+
resolve28(err);
|
|
52766
53275
|
} else {
|
|
52767
53276
|
reject(err);
|
|
52768
53277
|
}
|
|
@@ -53450,12 +53959,12 @@ var require_dist6 = __commonJS({
|
|
|
53450
53959
|
let { host } = opts;
|
|
53451
53960
|
const { port, lookup: lookupFn = dns.lookup } = opts;
|
|
53452
53961
|
if (shouldLookup) {
|
|
53453
|
-
host = await new Promise((
|
|
53962
|
+
host = await new Promise((resolve28, reject) => {
|
|
53454
53963
|
lookupFn(host, {}, (err, res) => {
|
|
53455
53964
|
if (err) {
|
|
53456
53965
|
reject(err);
|
|
53457
53966
|
} else {
|
|
53458
|
-
|
|
53967
|
+
resolve28(res);
|
|
53459
53968
|
}
|
|
53460
53969
|
});
|
|
53461
53970
|
});
|
|
@@ -54267,8 +54776,8 @@ var require_entry = __commonJS({
|
|
|
54267
54776
|
let body = null;
|
|
54268
54777
|
if (this.response.status === 200) {
|
|
54269
54778
|
let cacheWriteResolve, cacheWriteReject;
|
|
54270
|
-
const cacheWritePromise = new Promise((
|
|
54271
|
-
cacheWriteResolve =
|
|
54779
|
+
const cacheWritePromise = new Promise((resolve28, reject) => {
|
|
54780
|
+
cacheWriteResolve = resolve28;
|
|
54272
54781
|
cacheWriteReject = reject;
|
|
54273
54782
|
}).catch((err) => {
|
|
54274
54783
|
body.emit("error", err);
|
|
@@ -55783,9 +56292,9 @@ var require_index_min = __commonJS({
|
|
|
55783
56292
|
var require_lib17 = __commonJS({
|
|
55784
56293
|
"../../node_modules/.pnpm/which@5.0.0/node_modules/which/lib/index.js"(exports, module) {
|
|
55785
56294
|
var { isexe, sync: isexeSync } = require_index_min();
|
|
55786
|
-
var { join:
|
|
56295
|
+
var { join: join29, delimiter, sep: sep6, posix: posix3 } = __require("path");
|
|
55787
56296
|
var isWindows = process.platform === "win32";
|
|
55788
|
-
var rSlash = new RegExp(`[${posix3.sep}${
|
|
56297
|
+
var rSlash = new RegExp(`[${posix3.sep}${sep6 === posix3.sep ? "" : sep6}]`.replace(/(\\)/g, "\\$1"));
|
|
55789
56298
|
var rRel = new RegExp(`^\\.${rSlash.source}`);
|
|
55790
56299
|
var getNotFoundError = /* @__PURE__ */ __name((cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" }), "getNotFoundError");
|
|
55791
56300
|
var getPathInfo = /* @__PURE__ */ __name((cmd, {
|
|
@@ -55812,7 +56321,7 @@ var require_lib17 = __commonJS({
|
|
|
55812
56321
|
var getPathPart = /* @__PURE__ */ __name((raw, cmd) => {
|
|
55813
56322
|
const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw;
|
|
55814
56323
|
const prefix = !pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "";
|
|
55815
|
-
return prefix +
|
|
56324
|
+
return prefix + join29(pathPart, cmd);
|
|
55816
56325
|
}, "getPathPart");
|
|
55817
56326
|
var which = /* @__PURE__ */ __name(async (cmd, opt = {}) => {
|
|
55818
56327
|
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
@@ -55935,9 +56444,9 @@ var require_lib18 = __commonJS({
|
|
|
55935
56444
|
if (opts.shell) {
|
|
55936
56445
|
return spawnWithShell(cmd, args2, opts, extra);
|
|
55937
56446
|
}
|
|
55938
|
-
let
|
|
56447
|
+
let resolve28, reject;
|
|
55939
56448
|
const promise = new Promise((_resolve, _reject) => {
|
|
55940
|
-
|
|
56449
|
+
resolve28 = _resolve;
|
|
55941
56450
|
reject = _reject;
|
|
55942
56451
|
});
|
|
55943
56452
|
const closeError = new Error("command failed");
|
|
@@ -55970,7 +56479,7 @@ var require_lib18 = __commonJS({
|
|
|
55970
56479
|
if (code || signal) {
|
|
55971
56480
|
rejectWithOpts(closeError, { code, signal });
|
|
55972
56481
|
} else {
|
|
55973
|
-
|
|
56482
|
+
resolve28(getResult({ code, signal }));
|
|
55974
56483
|
}
|
|
55975
56484
|
});
|
|
55976
56485
|
return promise;
|
|
@@ -56951,7 +57460,7 @@ var require_lib19 = __commonJS({
|
|
|
56951
57460
|
// ../../node_modules/.pnpm/npm-normalize-package-bin@4.0.0/node_modules/npm-normalize-package-bin/lib/index.js
|
|
56952
57461
|
var require_lib20 = __commonJS({
|
|
56953
57462
|
"../../node_modules/.pnpm/npm-normalize-package-bin@4.0.0/node_modules/npm-normalize-package-bin/lib/index.js"(exports, module) {
|
|
56954
|
-
var { join:
|
|
57463
|
+
var { join: join29, basename: basename11 } = __require("path");
|
|
56955
57464
|
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");
|
|
56956
57465
|
var normalizeString = /* @__PURE__ */ __name((pkg) => {
|
|
56957
57466
|
if (!pkg.name) {
|
|
@@ -56976,11 +57485,11 @@ var require_lib20 = __commonJS({
|
|
|
56976
57485
|
const clean = {};
|
|
56977
57486
|
let hasBins = false;
|
|
56978
57487
|
Object.keys(orig).forEach((binKey) => {
|
|
56979
|
-
const base =
|
|
57488
|
+
const base = join29("/", basename11(binKey.replace(/\\|:/g, "/"))).slice(1);
|
|
56980
57489
|
if (typeof orig[binKey] !== "string" || !base) {
|
|
56981
57490
|
return;
|
|
56982
57491
|
}
|
|
56983
|
-
const binTarget =
|
|
57492
|
+
const binTarget = join29("/", orig[binKey].replace(/\\/g, "/")).replace(/\\/g, "/").slice(1);
|
|
56984
57493
|
if (!binTarget) {
|
|
56985
57494
|
return;
|
|
56986
57495
|
}
|
|
@@ -59521,11 +60030,11 @@ var require_normalize = __commonJS({
|
|
|
59521
60030
|
// ../../node_modules/.pnpm/@npmcli+package-json@6.2.0/node_modules/@npmcli/package-json/lib/read-package.js
|
|
59522
60031
|
var require_read_package = __commonJS({
|
|
59523
60032
|
"../../node_modules/.pnpm/@npmcli+package-json@6.2.0/node_modules/@npmcli/package-json/lib/read-package.js"(exports, module) {
|
|
59524
|
-
var { readFile:
|
|
60033
|
+
var { readFile: readFile33 } = __require("fs/promises");
|
|
59525
60034
|
var parseJSON = require_lib16();
|
|
59526
60035
|
async function read(filename) {
|
|
59527
60036
|
try {
|
|
59528
|
-
const data = await
|
|
60037
|
+
const data = await readFile33(filename, "utf8");
|
|
59529
60038
|
return data;
|
|
59530
60039
|
} catch (err) {
|
|
59531
60040
|
err.message = `Could not read package.json: ${err}`;
|
|
@@ -59658,8 +60167,8 @@ var require_sort2 = __commonJS({
|
|
|
59658
60167
|
// ../../node_modules/.pnpm/@npmcli+package-json@6.2.0/node_modules/@npmcli/package-json/lib/index.js
|
|
59659
60168
|
var require_lib23 = __commonJS({
|
|
59660
60169
|
"../../node_modules/.pnpm/@npmcli+package-json@6.2.0/node_modules/@npmcli/package-json/lib/index.js"(exports, module) {
|
|
59661
|
-
var { readFile:
|
|
59662
|
-
var { resolve:
|
|
60170
|
+
var { readFile: readFile33, writeFile: writeFile11 } = __require("node:fs/promises");
|
|
60171
|
+
var { resolve: resolve28 } = __require("node:path");
|
|
59663
60172
|
var parseJSON = require_lib16();
|
|
59664
60173
|
var updateDeps = require_update_dependencies();
|
|
59665
60174
|
var updateScripts = require_update_scripts();
|
|
@@ -59782,10 +60291,10 @@ var require_lib23 = __commonJS({
|
|
|
59782
60291
|
parseErr = err;
|
|
59783
60292
|
}
|
|
59784
60293
|
if (parseErr) {
|
|
59785
|
-
const indexFile =
|
|
60294
|
+
const indexFile = resolve28(this.path, "index.js");
|
|
59786
60295
|
let indexFileContent;
|
|
59787
60296
|
try {
|
|
59788
|
-
indexFileContent = await
|
|
60297
|
+
indexFileContent = await readFile33(indexFile, "utf8");
|
|
59789
60298
|
} catch (err) {
|
|
59790
60299
|
throw parseErr;
|
|
59791
60300
|
}
|
|
@@ -59834,7 +60343,7 @@ var require_lib23 = __commonJS({
|
|
|
59834
60343
|
}
|
|
59835
60344
|
get filename() {
|
|
59836
60345
|
if (this.path) {
|
|
59837
|
-
return
|
|
60346
|
+
return resolve28(this.path, "package.json");
|
|
59838
60347
|
}
|
|
59839
60348
|
return void 0;
|
|
59840
60349
|
}
|
|
@@ -66760,12 +67269,12 @@ var require_fetcher = __commonJS({
|
|
|
66760
67269
|
};
|
|
66761
67270
|
exports.DefaultFetcher = DefaultFetcher;
|
|
66762
67271
|
var writeBufferToStream = /* @__PURE__ */ __name(async (stream, buffer) => {
|
|
66763
|
-
return new Promise((
|
|
67272
|
+
return new Promise((resolve28, reject) => {
|
|
66764
67273
|
stream.write(buffer, (err) => {
|
|
66765
67274
|
if (err) {
|
|
66766
67275
|
reject(err);
|
|
66767
67276
|
}
|
|
66768
|
-
|
|
67277
|
+
resolve28(true);
|
|
66769
67278
|
});
|
|
66770
67279
|
});
|
|
66771
67280
|
}, "writeBufferToStream");
|
|
@@ -66984,12 +67493,12 @@ var require_url = __commonJS({
|
|
|
66984
67493
|
"../../node_modules/.pnpm/tuf-js@3.1.0/node_modules/tuf-js/dist/utils/url.js"(exports) {
|
|
66985
67494
|
"use strict";
|
|
66986
67495
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
66987
|
-
exports.join =
|
|
67496
|
+
exports.join = join29;
|
|
66988
67497
|
var url_1 = __require("url");
|
|
66989
|
-
function
|
|
67498
|
+
function join29(base, path3) {
|
|
66990
67499
|
return new url_1.URL(ensureTrailingSlash(base) + removeLeadingSlash(path3)).toString();
|
|
66991
67500
|
}
|
|
66992
|
-
__name(
|
|
67501
|
+
__name(join29, "join");
|
|
66993
67502
|
function ensureTrailingSlash(path3) {
|
|
66994
67503
|
return path3.endsWith("/") ? path3 : path3 + "/";
|
|
66995
67504
|
}
|
|
@@ -67368,7 +67877,7 @@ var require_target = __commonJS({
|
|
|
67368
67877
|
var error_1 = require_error8();
|
|
67369
67878
|
async function readTarget(tuf, targetPath) {
|
|
67370
67879
|
const path3 = await getTargetPath(tuf, targetPath);
|
|
67371
|
-
return new Promise((
|
|
67880
|
+
return new Promise((resolve28, reject) => {
|
|
67372
67881
|
fs_1.default.readFile(path3, "utf-8", (err, data) => {
|
|
67373
67882
|
if (err) {
|
|
67374
67883
|
reject(new error_1.TUFError({
|
|
@@ -67377,7 +67886,7 @@ var require_target = __commonJS({
|
|
|
67377
67886
|
cause: err
|
|
67378
67887
|
}));
|
|
67379
67888
|
} else {
|
|
67380
|
-
|
|
67889
|
+
resolve28(data);
|
|
67381
67890
|
}
|
|
67382
67891
|
});
|
|
67383
67892
|
});
|
|
@@ -69094,7 +69603,7 @@ var require_dist15 = __commonJS({
|
|
|
69094
69603
|
var require_provenance = __commonJS({
|
|
69095
69604
|
"../../node_modules/.pnpm/libnpmpublish@11.1.0/node_modules/libnpmpublish/lib/provenance.js"(exports, module) {
|
|
69096
69605
|
var sigstore = require_dist15();
|
|
69097
|
-
var { readFile:
|
|
69606
|
+
var { readFile: readFile33 } = __require("node:fs/promises");
|
|
69098
69607
|
var ci = require_ci_info();
|
|
69099
69608
|
var { env } = process;
|
|
69100
69609
|
var INTOTO_PAYLOAD_TYPE = "application/vnd.in-toto+json";
|
|
@@ -69286,7 +69795,7 @@ var require_provenance = __commonJS({
|
|
|
69286
69795
|
var verifyProvenance = /* @__PURE__ */ __name(async (subject, provenancePath) => {
|
|
69287
69796
|
let provenanceBundle;
|
|
69288
69797
|
try {
|
|
69289
|
-
provenanceBundle = JSON.parse(await
|
|
69798
|
+
provenanceBundle = JSON.parse(await readFile33(provenancePath));
|
|
69290
69799
|
} catch (err) {
|
|
69291
69800
|
err.message = `Invalid provenance provided: ${err.message}`;
|
|
69292
69801
|
throw err;
|
|
@@ -69622,12 +70131,12 @@ __export(npm_exports, {
|
|
|
69622
70131
|
verifyFrozenNpmTarballIdentity: () => verifyFrozenNpmTarballIdentity
|
|
69623
70132
|
});
|
|
69624
70133
|
import { createHash as createHash9, randomUUID } from "node:crypto";
|
|
69625
|
-
import { execFile as
|
|
70134
|
+
import { execFile as execFileCb7, spawn as spawn3 } from "node:child_process";
|
|
69626
70135
|
import { gunzipSync } from "node:zlib";
|
|
69627
|
-
import { promisify as
|
|
69628
|
-
import { dirname as dirname8, isAbsolute as isAbsolute13, join as
|
|
70136
|
+
import { promisify as promisify7 } from "node:util";
|
|
70137
|
+
import { dirname as dirname8, isAbsolute as isAbsolute13, join as join14, relative as relative16, resolve as resolve18 } from "node:path";
|
|
69629
70138
|
import { constants as fsConstants4 } from "node:fs";
|
|
69630
|
-
import { chmod as chmod3, lstat as
|
|
70139
|
+
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";
|
|
69631
70140
|
function validatePackageName(value) {
|
|
69632
70141
|
if (typeof value !== "string" || value.length > 214 || !SAFE_PACKAGE_NAME.test(value)) {
|
|
69633
70142
|
throw new Error("npm package must be a safe lowercase package name or @scope/name");
|
|
@@ -69651,7 +70160,7 @@ function normalizeRegistry(registry) {
|
|
|
69651
70160
|
return parsed.toString().replace(/\/$/, "");
|
|
69652
70161
|
}
|
|
69653
70162
|
async function run(command2, args2, options = {}) {
|
|
69654
|
-
return
|
|
70163
|
+
return execFile6(command2, args2, {
|
|
69655
70164
|
shell: false,
|
|
69656
70165
|
encoding: "utf8",
|
|
69657
70166
|
timeout: 12e4,
|
|
@@ -69681,7 +70190,7 @@ function expandNpmrcValue(raw, env) {
|
|
|
69681
70190
|
async function tokensFromNpmrc(path3, key, env) {
|
|
69682
70191
|
let contents;
|
|
69683
70192
|
try {
|
|
69684
|
-
contents = await
|
|
70193
|
+
contents = await readFile16(path3, "utf8");
|
|
69685
70194
|
} catch (err) {
|
|
69686
70195
|
if (err?.code === "ENOENT") return [];
|
|
69687
70196
|
throw new Error("cannot read npm authentication config");
|
|
@@ -69704,7 +70213,7 @@ async function defaultResolveAuthToken({ registry, cwd, exec, env = process.env
|
|
|
69704
70213
|
if (env[name]) candidates.push(env[name]);
|
|
69705
70214
|
}
|
|
69706
70215
|
const key = registryTokenKey(registry);
|
|
69707
|
-
candidates.push(...await tokensFromNpmrc(
|
|
70216
|
+
candidates.push(...await tokensFromNpmrc(join14(cwd, ".npmrc"), key, env));
|
|
69708
70217
|
const npmUserConfigKey = ["npm", "config", "userconfig"].join("_");
|
|
69709
70218
|
const userConfig = env[npmUserConfigKey] ?? (await exec("npm", ["config", "get", "userconfig"], { cwd, shell: false })).stdout.trim();
|
|
69710
70219
|
if (userConfig) candidates.push(...await tokensFromNpmrc(userConfig, key, env));
|
|
@@ -69733,9 +70242,9 @@ async function defaultWhoamiWithToken({ registry, token, cwd, exec }) {
|
|
|
69733
70242
|
}
|
|
69734
70243
|
function resolvePackageCwd(cwd, root) {
|
|
69735
70244
|
if (!cwd || typeof cwd !== "string") throw new Error("NPM_PUBLISH requires a non-empty action.cwd (package directory)");
|
|
69736
|
-
const rootPath =
|
|
69737
|
-
const packagePath =
|
|
69738
|
-
const rel =
|
|
70245
|
+
const rootPath = resolve18(root);
|
|
70246
|
+
const packagePath = resolve18(root, cwd);
|
|
70247
|
+
const rel = relative16(rootPath, packagePath);
|
|
69739
70248
|
if (isAbsolute13(rel) || rel === ".." || rel.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`)) {
|
|
69740
70249
|
throw new Error(`cwd "${cwd}" is outside project root "${root}"`);
|
|
69741
70250
|
}
|
|
@@ -69751,13 +70260,13 @@ ${error?.message ?? ""}`;
|
|
|
69751
70260
|
async function readVerifiedTarballBytes(action, root) {
|
|
69752
70261
|
if (!action.tarballPath || isAbsolute13(action.tarballPath)) throw new Error("tarballPath must be project-relative");
|
|
69753
70262
|
if (!/^[a-f0-9]{64}$/.test(action.tarballSha256 ?? "")) throw new Error("tarballSha256 must be a lowercase SHA-256 digest");
|
|
69754
|
-
const rootReal = await
|
|
69755
|
-
const lexical =
|
|
69756
|
-
const rel =
|
|
70263
|
+
const rootReal = await realpath10(root);
|
|
70264
|
+
const lexical = resolve18(rootReal, action.tarballPath);
|
|
70265
|
+
const rel = relative16(rootReal, lexical);
|
|
69757
70266
|
if (isAbsolute13(rel) || rel === ".." || rel.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`)) {
|
|
69758
70267
|
throw new Error("tarballPath escapes project root");
|
|
69759
70268
|
}
|
|
69760
|
-
const before = await
|
|
70269
|
+
const before = await lstat11(lexical);
|
|
69761
70270
|
if (!before.isFile() || before.isSymbolicLink() || before.nlink !== 1) {
|
|
69762
70271
|
throw new Error("frozen tarball must be a single-link regular file");
|
|
69763
70272
|
}
|
|
@@ -70023,7 +70532,7 @@ function createNpmAdapter(deps = {}) {
|
|
|
70023
70532
|
throw new Error("npm bearer authentication does not match the frozen registry and publisher");
|
|
70024
70533
|
}
|
|
70025
70534
|
if (typeof beforeBufferPublishHook === "function") {
|
|
70026
|
-
await beforeBufferPublishHook(
|
|
70535
|
+
await beforeBufferPublishHook(resolve18(context.root, action.tarballPath));
|
|
70027
70536
|
}
|
|
70028
70537
|
try {
|
|
70029
70538
|
await publishTarballBuffer({
|
|
@@ -70154,13 +70663,13 @@ function createNpmAdapter(deps = {}) {
|
|
|
70154
70663
|
}
|
|
70155
70664
|
});
|
|
70156
70665
|
}
|
|
70157
|
-
var import_libnpmpublish, import_npm_registry_fetch,
|
|
70666
|
+
var import_libnpmpublish, import_npm_registry_fetch, execFile6, NAME, SAFE_PACKAGE_NAME;
|
|
70158
70667
|
var init_npm = __esm({
|
|
70159
70668
|
"src/adapters/npm.mjs"() {
|
|
70160
70669
|
import_libnpmpublish = __toESM(require_lib25(), 1);
|
|
70161
70670
|
import_npm_registry_fetch = __toESM(require_lib15(), 1);
|
|
70162
70671
|
init_contract();
|
|
70163
|
-
|
|
70672
|
+
execFile6 = promisify7(execFileCb7);
|
|
70164
70673
|
NAME = "npm";
|
|
70165
70674
|
SAFE_PACKAGE_NAME = /^(?:@[a-z0-9][a-z0-9._-]*\/[a-z0-9][a-z0-9._-]*|[a-z0-9][a-z0-9._-]*)$/;
|
|
70166
70675
|
__name(validatePackageName, "validatePackageName");
|
|
@@ -70185,11 +70694,11 @@ var init_npm = __esm({
|
|
|
70185
70694
|
});
|
|
70186
70695
|
|
|
70187
70696
|
// src/core/run.mjs
|
|
70188
|
-
import { link as link2, lstat as
|
|
70697
|
+
import { link as link2, lstat as lstat12, mkdir as mkdir9, open as open7, readFile as readFile17, unlink as unlink3 } from "node:fs/promises";
|
|
70189
70698
|
import { realpathSync as realpathSync3 } from "node:fs";
|
|
70190
|
-
import { dirname as dirname9, join as
|
|
70699
|
+
import { dirname as dirname9, join as join15, resolve as resolve19, basename as basename4, relative as relative17, isAbsolute as isAbsolute14 } from "node:path";
|
|
70191
70700
|
function resolveDefaultRunDir(planPath, command2, runId = `${command2}-${Date.now()}`) {
|
|
70192
|
-
const absolute =
|
|
70701
|
+
const absolute = resolve19(planPath);
|
|
70193
70702
|
const fileName = basename4(absolute);
|
|
70194
70703
|
const parentDir = dirname9(absolute);
|
|
70195
70704
|
if (fileName === "release-plan.json") {
|
|
@@ -70197,7 +70706,7 @@ function resolveDefaultRunDir(planPath, command2, runId = `${command2}-${Date.no
|
|
|
70197
70706
|
}
|
|
70198
70707
|
if (basename4(parentDir) === "plans") {
|
|
70199
70708
|
const releaseDir = dirname9(parentDir);
|
|
70200
|
-
return
|
|
70709
|
+
return join15(releaseDir, "runs", runId);
|
|
70201
70710
|
}
|
|
70202
70711
|
return `${parentDir}/runs/${runId}`;
|
|
70203
70712
|
}
|
|
@@ -70237,7 +70746,7 @@ function validateRun(run5, options = {}) {
|
|
|
70237
70746
|
async function loadRun(runPath, options = {}) {
|
|
70238
70747
|
let raw;
|
|
70239
70748
|
try {
|
|
70240
|
-
raw = await
|
|
70749
|
+
raw = await readFile17(runPath, "utf8");
|
|
70241
70750
|
} catch (err) {
|
|
70242
70751
|
throw new ReleaseError(
|
|
70243
70752
|
GATE_FAILED,
|
|
@@ -70262,7 +70771,7 @@ async function loadRun(runPath, options = {}) {
|
|
|
70262
70771
|
return run5;
|
|
70263
70772
|
}
|
|
70264
70773
|
function assertImmutableRunAuthority(runPath, planPath, run5) {
|
|
70265
|
-
const absolutePlan = realpathSync3(
|
|
70774
|
+
const absolutePlan = realpathSync3(resolve19(planPath));
|
|
70266
70775
|
const planDir = dirname9(absolutePlan);
|
|
70267
70776
|
if (basename4(planDir) !== "plans") {
|
|
70268
70777
|
throw new ReleaseError(GATE_FAILED, "run authority requires an immutable plans/<digest>.json plan path");
|
|
@@ -70276,9 +70785,9 @@ function assertImmutableRunAuthority(runPath, planPath, run5) {
|
|
|
70276
70785
|
}
|
|
70277
70786
|
cursor = dirname9(cursor);
|
|
70278
70787
|
}
|
|
70279
|
-
const runsDir =
|
|
70280
|
-
const absoluteRun = realpathSync3(
|
|
70281
|
-
const rel =
|
|
70788
|
+
const runsDir = join15(authorityRoot, "runs");
|
|
70789
|
+
const absoluteRun = realpathSync3(resolve19(runPath));
|
|
70790
|
+
const rel = relative17(runsDir, absoluteRun);
|
|
70282
70791
|
if (isAbsolute14(rel) || rel === ".." || rel.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`)) {
|
|
70283
70792
|
throw new ReleaseError(GATE_FAILED, "production run authority must be inside the plan sibling runs/ directory");
|
|
70284
70793
|
}
|
|
@@ -70294,7 +70803,7 @@ function assertImmutableRunAuthority(runPath, planPath, run5) {
|
|
|
70294
70803
|
}
|
|
70295
70804
|
}
|
|
70296
70805
|
async function createProductionRunDir(runDir, planPath) {
|
|
70297
|
-
const absolutePlan = realpathSync3(
|
|
70806
|
+
const absolutePlan = realpathSync3(resolve19(planPath));
|
|
70298
70807
|
const planDir = dirname9(absolutePlan);
|
|
70299
70808
|
if (basename4(planDir) !== "plans") {
|
|
70300
70809
|
throw new ReleaseError(GATE_FAILED, "production run directory requires an immutable plans/<digest>.json authority");
|
|
@@ -70303,10 +70812,10 @@ async function createProductionRunDir(runDir, planPath) {
|
|
|
70303
70812
|
return createProductionRunDirWithinAuthority(runDir, authorityRoot);
|
|
70304
70813
|
}
|
|
70305
70814
|
async function createProductionPrepareRunDir(runDir, releaseDir) {
|
|
70306
|
-
const authorityRoot =
|
|
70815
|
+
const authorityRoot = resolve19(releaseDir);
|
|
70307
70816
|
let authorityStat;
|
|
70308
70817
|
try {
|
|
70309
|
-
authorityStat = await
|
|
70818
|
+
authorityStat = await lstat12(authorityRoot);
|
|
70310
70819
|
} catch (error) {
|
|
70311
70820
|
throw new ReleaseError(GATE_FAILED, "cannot inspect production .release-skill authority root", {
|
|
70312
70821
|
releaseDir: authorityRoot,
|
|
@@ -70331,10 +70840,10 @@ async function createProductionPrepareRunDir(runDir, releaseDir) {
|
|
|
70331
70840
|
return createProductionRunDirWithinAuthority(runDir, physicalAuthorityRoot);
|
|
70332
70841
|
}
|
|
70333
70842
|
async function createProductionRunDirWithinAuthority(runDir, authorityRoot) {
|
|
70334
|
-
const runsDir =
|
|
70843
|
+
const runsDir = join15(authorityRoot, "runs");
|
|
70335
70844
|
let runsStat;
|
|
70336
70845
|
try {
|
|
70337
|
-
runsStat = await
|
|
70846
|
+
runsStat = await lstat12(runsDir);
|
|
70338
70847
|
} catch (error) {
|
|
70339
70848
|
if (error.code !== "ENOENT") {
|
|
70340
70849
|
throw new ReleaseError(GATE_FAILED, "cannot inspect production runs authority root", {
|
|
@@ -70352,7 +70861,7 @@ async function createProductionRunDirWithinAuthority(runDir, authorityRoot) {
|
|
|
70352
70861
|
});
|
|
70353
70862
|
}
|
|
70354
70863
|
}
|
|
70355
|
-
runsStat = await
|
|
70864
|
+
runsStat = await lstat12(runsDir);
|
|
70356
70865
|
}
|
|
70357
70866
|
if (runsStat.isSymbolicLink() || !runsStat.isDirectory()) {
|
|
70358
70867
|
throw new ReleaseError(
|
|
@@ -70369,7 +70878,7 @@ async function createProductionRunDirWithinAuthority(runDir, authorityRoot) {
|
|
|
70369
70878
|
{ runsDir, physicalRunsDir }
|
|
70370
70879
|
);
|
|
70371
70880
|
}
|
|
70372
|
-
const requested =
|
|
70881
|
+
const requested = resolve19(runDir);
|
|
70373
70882
|
let physicalParent;
|
|
70374
70883
|
try {
|
|
70375
70884
|
physicalParent = realpathSync3(dirname9(requested));
|
|
@@ -70387,7 +70896,7 @@ async function createProductionRunDirWithinAuthority(runDir, authorityRoot) {
|
|
|
70387
70896
|
);
|
|
70388
70897
|
}
|
|
70389
70898
|
try {
|
|
70390
|
-
await
|
|
70899
|
+
await lstat12(requested);
|
|
70391
70900
|
throw new ReleaseError(GATE_FAILED, "production run directory already exists; authority directories cannot be reused", { runDir });
|
|
70392
70901
|
} catch (error) {
|
|
70393
70902
|
if (error instanceof ReleaseError) throw error;
|
|
@@ -70420,7 +70929,7 @@ async function validateStatePredecessorChain(run5, runPath, options = {}) {
|
|
|
70420
70929
|
return;
|
|
70421
70930
|
}
|
|
70422
70931
|
let current = run5;
|
|
70423
|
-
let currentPath = realpathSync3(
|
|
70932
|
+
let currentPath = realpathSync3(resolve19(runPath));
|
|
70424
70933
|
let traversed = 0;
|
|
70425
70934
|
while (true) {
|
|
70426
70935
|
const sequence = current.stateSequence;
|
|
@@ -70441,7 +70950,7 @@ async function validateStatePredecessorChain(run5, runPath, options = {}) {
|
|
|
70441
70950
|
if (traversed > 1e5) {
|
|
70442
70951
|
throw new ReleaseError(GATE_FAILED, "run state predecessor chain exceeds maximum depth");
|
|
70443
70952
|
}
|
|
70444
|
-
const previousPath =
|
|
70953
|
+
const previousPath = join15(dirname9(currentPath), `${String(sequence - 1).padStart(6, "0")}.json`);
|
|
70445
70954
|
const previous = await loadRun(previousPath, {
|
|
70446
70955
|
requireDigest: true,
|
|
70447
70956
|
...options.production ? { authorityPlanPath: options.planPath } : {}
|
|
@@ -70534,7 +71043,7 @@ function validateRunPlanDigest(run5, plan, options = {}) {
|
|
|
70534
71043
|
{ runDigest: run5.planDigest, planDigest: expectedDigest }
|
|
70535
71044
|
);
|
|
70536
71045
|
}
|
|
70537
|
-
if (plan.production && run5.planPath && options.planPath &&
|
|
71046
|
+
if (plan.production && run5.planPath && options.planPath && resolve19(run5.planPath) !== resolve19(options.planPath)) {
|
|
70538
71047
|
throw new ReleaseError(
|
|
70539
71048
|
GATE_FAILED,
|
|
70540
71049
|
"source run immutable plan path does not match the supplied plan authority",
|
|
@@ -70632,7 +71141,7 @@ async function writeRunAtomic(runPath, run5) {
|
|
|
70632
71141
|
await syncDirectory(dir);
|
|
70633
71142
|
} catch (error) {
|
|
70634
71143
|
if (error.code !== "EEXIST") throw error;
|
|
70635
|
-
const existing = await
|
|
71144
|
+
const existing = await readFile17(runPath, "utf8");
|
|
70636
71145
|
if (existing !== json) {
|
|
70637
71146
|
throw new ReleaseError(
|
|
70638
71147
|
GATE_FAILED,
|
|
@@ -70651,10 +71160,10 @@ async function appendRunState(runDir, sequence, run5) {
|
|
|
70651
71160
|
if (!Number.isSafeInteger(sequence) || sequence < 0) {
|
|
70652
71161
|
throw new ReleaseError(GATE_FAILED, "run state sequence must be a non-negative integer");
|
|
70653
71162
|
}
|
|
70654
|
-
const statesDir =
|
|
71163
|
+
const statesDir = join15(runDir, "states");
|
|
70655
71164
|
let previousStateDigest;
|
|
70656
71165
|
if (sequence > 0) {
|
|
70657
|
-
const previousPath =
|
|
71166
|
+
const previousPath = join15(statesDir, `${String(sequence - 1).padStart(6, "0")}.json`);
|
|
70658
71167
|
const previous = await loadRun(previousPath, { requireDigest: true });
|
|
70659
71168
|
if (previous.stateSequence !== sequence - 1 || previous.runId !== run5.runId || previous.command !== run5.command || previous.planDigest !== run5.planDigest) {
|
|
70660
71169
|
throw new ReleaseError(
|
|
@@ -70671,7 +71180,7 @@ async function appendRunState(runDir, sequence, run5) {
|
|
|
70671
71180
|
stateSequence: sequence,
|
|
70672
71181
|
...previousStateDigest ? { previousStateDigest } : {}
|
|
70673
71182
|
});
|
|
70674
|
-
const statePath =
|
|
71183
|
+
const statePath = join15(statesDir, `${String(sequence).padStart(6, "0")}.json`);
|
|
70675
71184
|
await writeRunAtomic(statePath, state);
|
|
70676
71185
|
return Object.freeze({ state, statePath });
|
|
70677
71186
|
}
|
|
@@ -70721,10 +71230,10 @@ __export(plugin_marketplace_exports, {
|
|
|
70721
71230
|
resolvePluginManifestFromMarketplaceEntrySource: () => resolvePluginManifestFromMarketplaceEntrySource,
|
|
70722
71231
|
validateMarketplaceSourceSelection: () => validateMarketplaceSourceSelection
|
|
70723
71232
|
});
|
|
70724
|
-
import { execFile as
|
|
70725
|
-
import { promisify as
|
|
70726
|
-
import { readFile as
|
|
70727
|
-
import { join as
|
|
71233
|
+
import { execFile as execFileCb8 } from "node:child_process";
|
|
71234
|
+
import { promisify as promisify8 } from "node:util";
|
|
71235
|
+
import { readFile as readFile18, stat as stat4, mkdir as mkdir10, readdir as readdir10, realpath as realpath11, lstat as lstat13 } from "node:fs/promises";
|
|
71236
|
+
import { join as join16, resolve as resolve20, relative as relative18, isAbsolute as isAbsolute15, basename as basename5 } from "node:path";
|
|
70728
71237
|
import { createHash as createHash10 } from "node:crypto";
|
|
70729
71238
|
function transportPayload(entries) {
|
|
70730
71239
|
return entries.map(({ path: path3, type, mode, size, contentDigest }) => ({
|
|
@@ -70792,25 +71301,25 @@ async function resolvePluginManifestFromMarketplaceEntrySource(marketIndex, plug
|
|
|
70792
71301
|
}
|
|
70793
71302
|
const entry = matches[0];
|
|
70794
71303
|
const sourcePath = extractDeclaredPluginSource(platform.id, entry);
|
|
70795
|
-
const snapshotDirReal = await
|
|
70796
|
-
const marketplaceRootAbs = marketplaceRootRel === "." ? snapshotDirReal :
|
|
70797
|
-
const pluginRootAbs =
|
|
70798
|
-
const pluginRootReal = await
|
|
71304
|
+
const snapshotDirReal = await realpath11(snapshotDir).catch(() => snapshotDir);
|
|
71305
|
+
const marketplaceRootAbs = marketplaceRootRel === "." ? snapshotDirReal : resolve20(snapshotDirReal, marketplaceRootRel);
|
|
71306
|
+
const pluginRootAbs = resolve20(marketplaceRootAbs, sourcePath);
|
|
71307
|
+
const pluginRootReal = await realpath11(pluginRootAbs).catch(() => null);
|
|
70799
71308
|
if (!pluginRootReal) {
|
|
70800
71309
|
throw new Error(`marketplace plugin entry source "${sourcePath}" does not exist in snapshot`);
|
|
70801
71310
|
}
|
|
70802
|
-
const containment =
|
|
70803
|
-
const
|
|
70804
|
-
if (containment !== "" && (isAbsolute15(containment) || containment === ".." || containment.startsWith(`..${
|
|
71311
|
+
const containment = relative18(snapshotDirReal, pluginRootReal);
|
|
71312
|
+
const sep6 = process.platform === "win32" ? "\\" : "/";
|
|
71313
|
+
if (containment !== "" && (isAbsolute15(containment) || containment === ".." || containment.startsWith(`..${sep6}`))) {
|
|
70805
71314
|
throw new Error(`marketplace plugin entry source "${sourcePath}" escapes the snapshot after symlink resolution`);
|
|
70806
71315
|
}
|
|
70807
71316
|
const manifestRelative = platform.manifestPaths.plugin;
|
|
70808
|
-
const manifestAbs =
|
|
70809
|
-
const pluginRootRelToSnapshot =
|
|
71317
|
+
const manifestAbs = resolve20(pluginRootReal, manifestRelative);
|
|
71318
|
+
const pluginRootRelToSnapshot = relative18(snapshotDirReal, pluginRootReal);
|
|
70810
71319
|
const fullManifestRelative = pluginRootRelToSnapshot === "" ? manifestRelative : `${pluginRootRelToSnapshot}/${manifestRelative}`;
|
|
70811
71320
|
let raw;
|
|
70812
71321
|
try {
|
|
70813
|
-
raw = await
|
|
71322
|
+
raw = await readFile18(manifestAbs, "utf8");
|
|
70814
71323
|
} catch (err) {
|
|
70815
71324
|
throw new Error(
|
|
70816
71325
|
`plugin manifest not found at "${fullManifestRelative}": ${err.message}`
|
|
@@ -70841,7 +71350,7 @@ async function validateInstallationContractDigest(action, snapshotDirReal, platf
|
|
|
70841
71350
|
includeMarketplaceEntry = hasMarketplacePath;
|
|
70842
71351
|
if (includeMarketplaceEntry) {
|
|
70843
71352
|
marketplaceIndexRelative = action.marketplaceIndexPath ?? platform.manifestPaths.marketplace;
|
|
70844
|
-
const marketplacePath =
|
|
71353
|
+
const marketplacePath = resolve20(snapshotDirReal, marketplaceIndexRelative);
|
|
70845
71354
|
const mkResult = await validateManifestFile(marketplacePath, ["name", "plugins"]);
|
|
70846
71355
|
if (!mkResult.valid) {
|
|
70847
71356
|
return { valid: false, error: `installationContractDigest \u9A8C\u8BC1\u5931\u8D25\uFF1A\u5E02\u573A\u7D22\u5F15\u8BFB\u53D6\u5931\u8D25\uFF1A${mkResult.error}` };
|
|
@@ -70887,7 +71396,7 @@ async function validateInstallationContractDigest(action, snapshotDirReal, platf
|
|
|
70887
71396
|
pluginManifestRelative = readResult.manifestRelative ?? platform.manifestPaths.plugin;
|
|
70888
71397
|
} else {
|
|
70889
71398
|
pluginManifestRelative = platform.manifestPaths.plugin;
|
|
70890
|
-
const pluginManifestPath =
|
|
71399
|
+
const pluginManifestPath = resolve20(snapshotDirReal, pluginManifestRelative);
|
|
70891
71400
|
const manifestResult = await validateManifestFile(pluginManifestPath, ["name", "version"]);
|
|
70892
71401
|
if (!manifestResult.valid) {
|
|
70893
71402
|
return { valid: false, error: `installationContractDigest \u9A8C\u8BC1\u5931\u8D25\uFF1A\u63D2\u4EF6 manifest \u8BFB\u53D6\u5931\u8D25\uFF1A${manifestResult.error}` };
|
|
@@ -70924,7 +71433,7 @@ async function resolveInstalledPayloadSubpath(snapshotDir, sourceEntries, action
|
|
|
70924
71433
|
if (!anchored) {
|
|
70925
71434
|
throw new Error(`frozen snapshot is missing the marketplace manifest ${marketplaceRelative}`);
|
|
70926
71435
|
}
|
|
70927
|
-
const result = await validateManifestFile(
|
|
71436
|
+
const result = await validateManifestFile(resolve20(snapshotDir, marketplaceRelative), ["name", "plugins"]);
|
|
70928
71437
|
if (!result.valid) {
|
|
70929
71438
|
throw new Error(`frozen snapshot ${marketplaceRelative} invalid: ${result.error}`);
|
|
70930
71439
|
}
|
|
@@ -71038,26 +71547,26 @@ async function resolveKimiEntrySkillFile(pluginRootReal, manifest, entrySkill) {
|
|
|
71038
71547
|
}
|
|
71039
71548
|
let entryAbs;
|
|
71040
71549
|
if (manifest.skills === void 0 || manifest.skills === null) {
|
|
71041
|
-
entryAbs =
|
|
71550
|
+
entryAbs = resolve20(pluginRootReal, "SKILL.md");
|
|
71042
71551
|
} else {
|
|
71043
71552
|
const skillsRel = normalizeKimiSkillsRel(manifest.skills);
|
|
71044
|
-
const skillsRootAbs = skillsRel === "" ? pluginRootReal :
|
|
71045
|
-
const skillsRootReal = await
|
|
71553
|
+
const skillsRootAbs = skillsRel === "" ? pluginRootReal : resolve20(pluginRootReal, skillsRel);
|
|
71554
|
+
const skillsRootReal = await realpath11(skillsRootAbs).catch(() => null);
|
|
71046
71555
|
if (!skillsRootReal) {
|
|
71047
71556
|
throw new Error(`kimi manifest skills root does not exist: ${manifest.skills}`);
|
|
71048
71557
|
}
|
|
71049
|
-
const skillsContainment =
|
|
71558
|
+
const skillsContainment = relative18(pluginRootReal, skillsRootReal);
|
|
71050
71559
|
const sepK = process.platform === "win32" ? "\\" : "/";
|
|
71051
71560
|
if (skillsContainment !== "" && (isAbsolute15(skillsContainment) || skillsContainment === ".." || skillsContainment.startsWith(`..${sepK}`))) {
|
|
71052
71561
|
throw new Error(`kimi manifest skills "${manifest.skills}" escapes the plugin root after symlink resolution`);
|
|
71053
71562
|
}
|
|
71054
|
-
entryAbs =
|
|
71563
|
+
entryAbs = resolve20(skillsRootReal, entrySkill, "SKILL.md");
|
|
71055
71564
|
}
|
|
71056
71565
|
let entryLexicalStat;
|
|
71057
71566
|
try {
|
|
71058
|
-
entryLexicalStat = await
|
|
71567
|
+
entryLexicalStat = await lstat13(entryAbs);
|
|
71059
71568
|
} catch {
|
|
71060
|
-
throw new Error(`kimi entry skill not found: ${
|
|
71569
|
+
throw new Error(`kimi entry skill not found: ${relative18(pluginRootReal, entryAbs) || "SKILL.md"}`);
|
|
71061
71570
|
}
|
|
71062
71571
|
if (entryLexicalStat.isSymbolicLink()) {
|
|
71063
71572
|
throw new Error("kimi entry skill must not be a symlink");
|
|
@@ -71065,11 +71574,11 @@ async function resolveKimiEntrySkillFile(pluginRootReal, manifest, entrySkill) {
|
|
|
71065
71574
|
if (!entryLexicalStat.isFile()) {
|
|
71066
71575
|
throw new Error("kimi entry skill is not a regular file");
|
|
71067
71576
|
}
|
|
71068
|
-
const entryReal = await
|
|
71577
|
+
const entryReal = await realpath11(entryAbs).catch(() => null);
|
|
71069
71578
|
if (!entryReal) {
|
|
71070
|
-
throw new Error(`kimi entry skill not found: ${
|
|
71579
|
+
throw new Error(`kimi entry skill not found: ${relative18(pluginRootReal, entryAbs) || "SKILL.md"}`);
|
|
71071
71580
|
}
|
|
71072
|
-
const entryContainment =
|
|
71581
|
+
const entryContainment = relative18(pluginRootReal, entryReal);
|
|
71073
71582
|
const sepE = process.platform === "win32" ? "\\" : "/";
|
|
71074
71583
|
if (entryContainment !== "" && (isAbsolute15(entryContainment) || entryContainment === ".." || entryContainment.startsWith(`..${sepE}`))) {
|
|
71075
71584
|
throw new Error("kimi entry skill escapes the plugin root after symlink resolution");
|
|
@@ -71109,26 +71618,26 @@ async function resolveCodeBuddyEntrySkillFile(pluginRootReal, manifest, entrySki
|
|
|
71109
71618
|
}
|
|
71110
71619
|
let entryAbs;
|
|
71111
71620
|
if (manifest.skills === void 0 || manifest.skills === null) {
|
|
71112
|
-
entryAbs =
|
|
71621
|
+
entryAbs = resolve20(pluginRootReal, "SKILL.md");
|
|
71113
71622
|
} else {
|
|
71114
71623
|
const skillsRel = normalizeCodeBuddySkillsRel(manifest.skills);
|
|
71115
|
-
const skillsRootAbs = skillsRel === "" ? pluginRootReal :
|
|
71116
|
-
const skillsRootReal = await
|
|
71624
|
+
const skillsRootAbs = skillsRel === "" ? pluginRootReal : resolve20(pluginRootReal, skillsRel);
|
|
71625
|
+
const skillsRootReal = await realpath11(skillsRootAbs).catch(() => null);
|
|
71117
71626
|
if (!skillsRootReal) {
|
|
71118
71627
|
throw new Error(`codebuddy manifest skills root does not exist: ${manifest.skills}`);
|
|
71119
71628
|
}
|
|
71120
|
-
const skillsContainment =
|
|
71629
|
+
const skillsContainment = relative18(pluginRootReal, skillsRootReal);
|
|
71121
71630
|
const sepK = process.platform === "win32" ? "\\" : "/";
|
|
71122
71631
|
if (skillsContainment !== "" && (isAbsolute15(skillsContainment) || skillsContainment === ".." || skillsContainment.startsWith(`..${sepK}`))) {
|
|
71123
71632
|
throw new Error(`codebuddy manifest skills "${manifest.skills}" escapes the plugin root after symlink resolution`);
|
|
71124
71633
|
}
|
|
71125
|
-
entryAbs =
|
|
71634
|
+
entryAbs = resolve20(skillsRootReal, entrySkill, "SKILL.md");
|
|
71126
71635
|
}
|
|
71127
71636
|
let entryLexicalStat;
|
|
71128
71637
|
try {
|
|
71129
|
-
entryLexicalStat = await
|
|
71638
|
+
entryLexicalStat = await lstat13(entryAbs);
|
|
71130
71639
|
} catch {
|
|
71131
|
-
throw new Error(`codebuddy entry skill not found: ${
|
|
71640
|
+
throw new Error(`codebuddy entry skill not found: ${relative18(pluginRootReal, entryAbs) || "SKILL.md"}`);
|
|
71132
71641
|
}
|
|
71133
71642
|
if (entryLexicalStat.isSymbolicLink()) {
|
|
71134
71643
|
throw new Error("codebuddy entry skill must not be a symlink");
|
|
@@ -71136,11 +71645,11 @@ async function resolveCodeBuddyEntrySkillFile(pluginRootReal, manifest, entrySki
|
|
|
71136
71645
|
if (!entryLexicalStat.isFile()) {
|
|
71137
71646
|
throw new Error("codebuddy entry skill is not a regular file");
|
|
71138
71647
|
}
|
|
71139
|
-
const entryReal = await
|
|
71648
|
+
const entryReal = await realpath11(entryAbs).catch(() => null);
|
|
71140
71649
|
if (!entryReal) {
|
|
71141
|
-
throw new Error(`codebuddy entry skill not found: ${
|
|
71650
|
+
throw new Error(`codebuddy entry skill not found: ${relative18(pluginRootReal, entryAbs) || "SKILL.md"}`);
|
|
71142
71651
|
}
|
|
71143
|
-
const entryContainment =
|
|
71652
|
+
const entryContainment = relative18(pluginRootReal, entryReal);
|
|
71144
71653
|
const sepE = process.platform === "win32" ? "\\" : "/";
|
|
71145
71654
|
if (entryContainment !== "" && (isAbsolute15(entryContainment) || entryContainment === ".." || entryContainment.startsWith(`..${sepE}`))) {
|
|
71146
71655
|
throw new Error("codebuddy entry skill escapes the plugin root after symlink resolution");
|
|
@@ -71250,7 +71759,7 @@ function validateMarketplaceParams(params) {
|
|
|
71250
71759
|
return { valid: true, error: null };
|
|
71251
71760
|
}
|
|
71252
71761
|
async function run2(cmd, args2, options = {}) {
|
|
71253
|
-
return
|
|
71762
|
+
return execFile7(cmd, args2, {
|
|
71254
71763
|
shell: false,
|
|
71255
71764
|
encoding: "utf8",
|
|
71256
71765
|
timeout: 3e4,
|
|
@@ -71259,7 +71768,7 @@ async function run2(cmd, args2, options = {}) {
|
|
|
71259
71768
|
}
|
|
71260
71769
|
async function validateManifestFile(manifestPath, requiredFields) {
|
|
71261
71770
|
try {
|
|
71262
|
-
const content = await
|
|
71771
|
+
const content = await readFile18(manifestPath, "utf8");
|
|
71263
71772
|
const manifest = JSON.parse(content);
|
|
71264
71773
|
const missing = requiredFields.filter((f) => !(f in manifest));
|
|
71265
71774
|
return {
|
|
@@ -71281,7 +71790,7 @@ async function checkRequiredFiles(dir, requiredFiles) {
|
|
|
71281
71790
|
const missing = [];
|
|
71282
71791
|
for (const file of requiredFiles) {
|
|
71283
71792
|
try {
|
|
71284
|
-
await stat4(
|
|
71793
|
+
await stat4(resolve20(dir, file));
|
|
71285
71794
|
} catch {
|
|
71286
71795
|
missing.push(file);
|
|
71287
71796
|
}
|
|
@@ -72008,7 +72517,7 @@ function createPluginMarketplaceAdapter(deps = {}) {
|
|
|
72008
72517
|
});
|
|
72009
72518
|
}
|
|
72010
72519
|
const externalManifestRelative = platform.manifestPaths.plugin;
|
|
72011
|
-
const externalManifestPath =
|
|
72520
|
+
const externalManifestPath = resolve20(snapshotDirReal, externalManifestRelative);
|
|
72012
72521
|
const externalManifestResult = await validateManifestFile(externalManifestPath, ["name", "version"]);
|
|
72013
72522
|
if (!externalManifestResult.valid) {
|
|
72014
72523
|
return createResult({
|
|
@@ -72043,7 +72552,7 @@ function createPluginMarketplaceAdapter(deps = {}) {
|
|
|
72043
72552
|
error: `marketplace root resolution failed: ${mktRootErr.message}`
|
|
72044
72553
|
});
|
|
72045
72554
|
}
|
|
72046
|
-
const marketplacePath =
|
|
72555
|
+
const marketplacePath = resolve20(snapshotDirReal, marketplaceRelative);
|
|
72047
72556
|
const marketplaceResult = await validateManifestFile(marketplacePath, ["name"]);
|
|
72048
72557
|
if (!marketplaceResult.valid) {
|
|
72049
72558
|
return createResult({
|
|
@@ -72086,9 +72595,9 @@ function createPluginMarketplaceAdapter(deps = {}) {
|
|
|
72086
72595
|
error: sourceErr.message
|
|
72087
72596
|
});
|
|
72088
72597
|
}
|
|
72089
|
-
const mktRootAbs = mktRoot === "." ? snapshotDirReal :
|
|
72090
|
-
const sourceDirAbs =
|
|
72091
|
-
sourceDirReal = await
|
|
72598
|
+
const mktRootAbs = mktRoot === "." ? snapshotDirReal : resolve20(snapshotDirReal, mktRoot);
|
|
72599
|
+
const sourceDirAbs = resolve20(mktRootAbs, sourcePath);
|
|
72600
|
+
sourceDirReal = await realpath11(sourceDirAbs).catch(() => null);
|
|
72092
72601
|
if (!sourceDirReal) {
|
|
72093
72602
|
return createResult({
|
|
72094
72603
|
actionType,
|
|
@@ -72096,7 +72605,7 @@ function createPluginMarketplaceAdapter(deps = {}) {
|
|
|
72096
72605
|
error: `marketplace plugin entry source directory does not exist: ${sourcePath}`
|
|
72097
72606
|
});
|
|
72098
72607
|
}
|
|
72099
|
-
const sourceRelCheck =
|
|
72608
|
+
const sourceRelCheck = relative18(snapshotDirReal, sourceDirReal);
|
|
72100
72609
|
if (sourceRelCheck.startsWith("..") || isAbsolute15(sourceRelCheck)) {
|
|
72101
72610
|
return createResult({
|
|
72102
72611
|
actionType,
|
|
@@ -72105,9 +72614,9 @@ function createPluginMarketplaceAdapter(deps = {}) {
|
|
|
72105
72614
|
});
|
|
72106
72615
|
}
|
|
72107
72616
|
pluginRootForEntrySkill = sourceDirReal;
|
|
72108
|
-
const pluginRootRelToSnapshot =
|
|
72617
|
+
const pluginRootRelToSnapshot = relative18(snapshotDirReal, sourceDirReal) || ".";
|
|
72109
72618
|
const manifestRelative = pluginRootRelToSnapshot === "." ? platform.manifestPaths.plugin : `${pluginRootRelToSnapshot}/${platform.manifestPaths.plugin}`;
|
|
72110
|
-
const manifestPath =
|
|
72619
|
+
const manifestPath = resolve20(snapshotDirReal, manifestRelative);
|
|
72111
72620
|
const manifestResult = await validateManifestFile(manifestPath, ["name", "version"]);
|
|
72112
72621
|
if (!manifestResult.valid) {
|
|
72113
72622
|
return createResult({
|
|
@@ -72160,11 +72669,11 @@ function createPluginMarketplaceAdapter(deps = {}) {
|
|
|
72160
72669
|
}
|
|
72161
72670
|
} else {
|
|
72162
72671
|
const pluginRootForSkill = pluginRootForEntrySkill || snapshotDirReal;
|
|
72163
|
-
const entrySkillFile =
|
|
72672
|
+
const entrySkillFile = resolve20(pluginRootForSkill, "skills", action.entrySkill, "SKILL.md");
|
|
72164
72673
|
try {
|
|
72165
72674
|
await stat4(entrySkillFile);
|
|
72166
72675
|
} catch {
|
|
72167
|
-
const skillRel =
|
|
72676
|
+
const skillRel = relative18(snapshotDirReal, entrySkillFile) || `skills/${action.entrySkill}/SKILL.md`;
|
|
72168
72677
|
return createResult({
|
|
72169
72678
|
actionType,
|
|
72170
72679
|
status: ActionStatus.PREFLIGHT_FAILED,
|
|
@@ -72286,7 +72795,7 @@ function createPluginMarketplaceAdapter(deps = {}) {
|
|
|
72286
72795
|
}
|
|
72287
72796
|
if (action.entryPoint) {
|
|
72288
72797
|
try {
|
|
72289
|
-
await exec(process.execPath, ["--check",
|
|
72798
|
+
await exec(process.execPath, ["--check", resolve20(pluginDir, action.entryPoint)]);
|
|
72290
72799
|
} catch (checkErr) {
|
|
72291
72800
|
return createResult({
|
|
72292
72801
|
actionType,
|
|
@@ -72344,10 +72853,10 @@ function createPluginMarketplaceAdapter(deps = {}) {
|
|
|
72344
72853
|
}
|
|
72345
72854
|
const consumer = action.consumer;
|
|
72346
72855
|
const runDir = context.runDir;
|
|
72347
|
-
const isolatedHome =
|
|
72348
|
-
const runDirReal = await
|
|
72349
|
-
const isolatedHomePreReal = await
|
|
72350
|
-
const relToRun =
|
|
72856
|
+
const isolatedHome = resolve20(runDir, "consumers", `${consumer}-${action.plugin}`);
|
|
72857
|
+
const runDirReal = await realpath11(runDir).catch(() => runDir);
|
|
72858
|
+
const isolatedHomePreReal = await realpath11(isolatedHome).catch(() => isolatedHome);
|
|
72859
|
+
const relToRun = relative18(runDirReal, isolatedHomePreReal);
|
|
72351
72860
|
const sepE = process.platform === "win32" ? "\\" : "/";
|
|
72352
72861
|
if (relToRun !== "" && (isAbsolute15(relToRun) || relToRun === ".." || relToRun.startsWith(`..${sepE}`))) {
|
|
72353
72862
|
return createResult({
|
|
@@ -72358,7 +72867,7 @@ function createPluginMarketplaceAdapter(deps = {}) {
|
|
|
72358
72867
|
}
|
|
72359
72868
|
await mkdir10(isolatedHome, { recursive: true, mode: 448 });
|
|
72360
72869
|
for (const subdir of platform.isolationSubdirs) {
|
|
72361
|
-
await mkdir10(
|
|
72870
|
+
await mkdir10(resolve20(isolatedHome, subdir), { recursive: true, mode: 448 });
|
|
72362
72871
|
}
|
|
72363
72872
|
const cliCmd = platform.cli.binary;
|
|
72364
72873
|
const baseEnv = { ...process.env, ...context.env };
|
|
@@ -72455,8 +72964,8 @@ function createPluginMarketplaceAdapter(deps = {}) {
|
|
|
72455
72964
|
error: `plugin install JSON missing installedPath`
|
|
72456
72965
|
});
|
|
72457
72966
|
}
|
|
72458
|
-
const installPathAbs =
|
|
72459
|
-
const installPathRel =
|
|
72967
|
+
const installPathAbs = resolve20(installFields.installedPath);
|
|
72968
|
+
const installPathRel = relative18(isolatedHome, installPathAbs);
|
|
72460
72969
|
if (isAbsolute15(installPathRel) || installPathRel === ".." || installPathRel.startsWith(`..${sepE}`)) {
|
|
72461
72970
|
return createResult({
|
|
72462
72971
|
actionType,
|
|
@@ -72518,9 +73027,9 @@ function createPluginMarketplaceAdapter(deps = {}) {
|
|
|
72518
73027
|
executedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
72519
73028
|
...extraInstalledPathsAudit(executeBinding)
|
|
72520
73029
|
};
|
|
72521
|
-
const evidenceDir =
|
|
73030
|
+
const evidenceDir = resolve20(runDir, "evidence", `${consumer}-${action.plugin}`);
|
|
72522
73031
|
await mkdir10(evidenceDir, { recursive: true, mode: 448 });
|
|
72523
|
-
const evidencePath =
|
|
73032
|
+
const evidencePath = resolve20(evidenceDir, "release-skill-install-evidence.json");
|
|
72524
73033
|
await writeEvidenceAtomic(evidencePath, evidence);
|
|
72525
73034
|
const executeObservation = {
|
|
72526
73035
|
...evidence,
|
|
@@ -72573,7 +73082,7 @@ function createPluginMarketplaceAdapter(deps = {}) {
|
|
|
72573
73082
|
if (actionType === ActionType.PLUGIN_MANIFEST_VALIDATE) {
|
|
72574
73083
|
const manifestPath = action.manifestPath;
|
|
72575
73084
|
try {
|
|
72576
|
-
const content = await
|
|
73085
|
+
const content = await readFile18(manifestPath, "utf8");
|
|
72577
73086
|
const manifest = JSON.parse(content);
|
|
72578
73087
|
return createResult({
|
|
72579
73088
|
actionType,
|
|
@@ -72616,7 +73125,7 @@ function createPluginMarketplaceAdapter(deps = {}) {
|
|
|
72616
73125
|
observation: { installed: false, error: "context.runDir is required" }
|
|
72617
73126
|
});
|
|
72618
73127
|
}
|
|
72619
|
-
const isolatedHome =
|
|
73128
|
+
const isolatedHome = resolve20(runDir, "consumers", `${consumer}-${action.plugin}`);
|
|
72620
73129
|
const platform = PLATFORMS.find((p) => p.id === consumer) ?? null;
|
|
72621
73130
|
if (!platform) {
|
|
72622
73131
|
throw new Error(
|
|
@@ -72668,7 +73177,7 @@ function createPluginMarketplaceAdapter(deps = {}) {
|
|
|
72668
73177
|
}
|
|
72669
73178
|
let requirement = null;
|
|
72670
73179
|
try {
|
|
72671
|
-
requirement = JSON.parse(await
|
|
73180
|
+
requirement = JSON.parse(await readFile18(resolve20(attestationDir, KIMI_REQUIREMENT_FILE), "utf8"));
|
|
72672
73181
|
} catch {
|
|
72673
73182
|
return createResult({
|
|
72674
73183
|
actionType,
|
|
@@ -72692,7 +73201,7 @@ function createPluginMarketplaceAdapter(deps = {}) {
|
|
|
72692
73201
|
}
|
|
72693
73202
|
let attestation = null;
|
|
72694
73203
|
try {
|
|
72695
|
-
attestation = JSON.parse(await
|
|
73204
|
+
attestation = JSON.parse(await readFile18(resolve20(attestationDir, KIMI_ATTESTATION_FILE), "utf8"));
|
|
72696
73205
|
} catch {
|
|
72697
73206
|
return createResult({
|
|
72698
73207
|
actionType,
|
|
@@ -72702,7 +73211,7 @@ function createPluginMarketplaceAdapter(deps = {}) {
|
|
|
72702
73211
|
manualInstallRequired: true,
|
|
72703
73212
|
installUrl: requirement.installUrl,
|
|
72704
73213
|
attestationDir,
|
|
72705
|
-
error: `kimi attestation is missing; write ${
|
|
73214
|
+
error: `kimi attestation is missing; write ${resolve20(attestationDir, KIMI_ATTESTATION_FILE)} after the interactive install (${requirement.installUrl})`
|
|
72706
73215
|
}
|
|
72707
73216
|
});
|
|
72708
73217
|
}
|
|
@@ -72744,9 +73253,9 @@ function createPluginMarketplaceAdapter(deps = {}) {
|
|
|
72744
73253
|
}
|
|
72745
73254
|
let verifiedInstallPath = null;
|
|
72746
73255
|
if (normalizedAttestation.installPath) {
|
|
72747
|
-
const managedRoot =
|
|
72748
|
-
const installPathAbs =
|
|
72749
|
-
const managedRootReal = await
|
|
73256
|
+
const managedRoot = resolve20(attestationDir, "kimi-home", "plugins", "managed");
|
|
73257
|
+
const installPathAbs = resolve20(normalizedAttestation.installPath);
|
|
73258
|
+
const managedRootReal = await realpath11(managedRoot).catch(() => null);
|
|
72750
73259
|
if (!managedRootReal) {
|
|
72751
73260
|
return createResult({
|
|
72752
73261
|
actionType,
|
|
@@ -72759,7 +73268,7 @@ function createPluginMarketplaceAdapter(deps = {}) {
|
|
|
72759
73268
|
}
|
|
72760
73269
|
let lexicalStat;
|
|
72761
73270
|
try {
|
|
72762
|
-
lexicalStat = await
|
|
73271
|
+
lexicalStat = await lstat13(installPathAbs);
|
|
72763
73272
|
} catch {
|
|
72764
73273
|
return createResult({
|
|
72765
73274
|
actionType,
|
|
@@ -72780,7 +73289,7 @@ function createPluginMarketplaceAdapter(deps = {}) {
|
|
|
72780
73289
|
}
|
|
72781
73290
|
});
|
|
72782
73291
|
}
|
|
72783
|
-
const installPathReal2 = await
|
|
73292
|
+
const installPathReal2 = await realpath11(installPathAbs).catch(() => null);
|
|
72784
73293
|
if (!installPathReal2) {
|
|
72785
73294
|
return createResult({
|
|
72786
73295
|
actionType,
|
|
@@ -72791,9 +73300,9 @@ function createPluginMarketplaceAdapter(deps = {}) {
|
|
|
72791
73300
|
}
|
|
72792
73301
|
});
|
|
72793
73302
|
}
|
|
72794
|
-
const rel =
|
|
72795
|
-
const
|
|
72796
|
-
if (rel === "" || rel === ".." || isAbsolute15(rel) || rel.startsWith(`..${
|
|
73303
|
+
const rel = relative18(managedRootReal, installPathReal2);
|
|
73304
|
+
const sep7 = process.platform === "win32" ? "\\" : "/";
|
|
73305
|
+
if (rel === "" || rel === ".." || isAbsolute15(rel) || rel.startsWith(`..${sep7}`)) {
|
|
72797
73306
|
return createResult({
|
|
72798
73307
|
actionType,
|
|
72799
73308
|
status: ActionStatus.OBSERVED,
|
|
@@ -72883,7 +73392,7 @@ function createPluginMarketplaceAdapter(deps = {}) {
|
|
|
72883
73392
|
}
|
|
72884
73393
|
let requirement = null;
|
|
72885
73394
|
try {
|
|
72886
|
-
requirement = JSON.parse(await
|
|
73395
|
+
requirement = JSON.parse(await readFile18(resolve20(attestationDir, CODEBUDDY_REQUIREMENT_FILE), "utf8"));
|
|
72887
73396
|
} catch {
|
|
72888
73397
|
return createResult({
|
|
72889
73398
|
actionType,
|
|
@@ -72907,7 +73416,7 @@ function createPluginMarketplaceAdapter(deps = {}) {
|
|
|
72907
73416
|
}
|
|
72908
73417
|
let attestation = null;
|
|
72909
73418
|
try {
|
|
72910
|
-
attestation = JSON.parse(await
|
|
73419
|
+
attestation = JSON.parse(await readFile18(resolve20(attestationDir, CODEBUDDY_ATTESTATION_FILE), "utf8"));
|
|
72911
73420
|
} catch {
|
|
72912
73421
|
return createResult({
|
|
72913
73422
|
actionType,
|
|
@@ -72917,7 +73426,7 @@ function createPluginMarketplaceAdapter(deps = {}) {
|
|
|
72917
73426
|
manualInstallRequired: true,
|
|
72918
73427
|
marketplaceSource: CODEBUDDY_MARKETPLACE_SOURCE,
|
|
72919
73428
|
attestationDir,
|
|
72920
|
-
error: `codebuddy attestation is missing; write ${
|
|
73429
|
+
error: `codebuddy attestation is missing; write ${resolve20(attestationDir, CODEBUDDY_ATTESTATION_FILE)} after the manual install (marketplace ${CODEBUDDY_MARKETPLACE_SOURCE})`
|
|
72921
73430
|
}
|
|
72922
73431
|
});
|
|
72923
73432
|
}
|
|
@@ -72981,10 +73490,10 @@ function createPluginMarketplaceAdapter(deps = {}) {
|
|
|
72981
73490
|
}
|
|
72982
73491
|
});
|
|
72983
73492
|
}
|
|
72984
|
-
const installPathAbs =
|
|
73493
|
+
const installPathAbs = resolve20(normalizedAttestation.installPath);
|
|
72985
73494
|
let lexicalStat;
|
|
72986
73495
|
try {
|
|
72987
|
-
lexicalStat = await
|
|
73496
|
+
lexicalStat = await lstat13(installPathAbs);
|
|
72988
73497
|
} catch {
|
|
72989
73498
|
return createResult({
|
|
72990
73499
|
actionType,
|
|
@@ -73005,7 +73514,7 @@ function createPluginMarketplaceAdapter(deps = {}) {
|
|
|
73005
73514
|
}
|
|
73006
73515
|
});
|
|
73007
73516
|
}
|
|
73008
|
-
verifiedInstallPath = await
|
|
73517
|
+
verifiedInstallPath = await realpath11(installPathAbs);
|
|
73009
73518
|
}
|
|
73010
73519
|
return createResult({
|
|
73011
73520
|
actionType,
|
|
@@ -73045,13 +73554,13 @@ function createPluginMarketplaceAdapter(deps = {}) {
|
|
|
73045
73554
|
if (codexAttestationDir) {
|
|
73046
73555
|
let codexRequirement = null;
|
|
73047
73556
|
try {
|
|
73048
|
-
codexRequirement = JSON.parse(await
|
|
73557
|
+
codexRequirement = JSON.parse(await readFile18(resolve20(codexAttestationDir, CODEX_REQUIREMENT_FILE), "utf8"));
|
|
73049
73558
|
} catch {
|
|
73050
73559
|
}
|
|
73051
73560
|
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)) {
|
|
73052
73561
|
let codexAttestation = null;
|
|
73053
73562
|
try {
|
|
73054
|
-
codexAttestation = JSON.parse(await
|
|
73563
|
+
codexAttestation = JSON.parse(await readFile18(resolve20(codexAttestationDir, CODEX_ATTESTATION_FILE), "utf8"));
|
|
73055
73564
|
} catch {
|
|
73056
73565
|
}
|
|
73057
73566
|
if (codexAttestation) {
|
|
@@ -73106,7 +73615,7 @@ function createPluginMarketplaceAdapter(deps = {}) {
|
|
|
73106
73615
|
}
|
|
73107
73616
|
let evidence = null;
|
|
73108
73617
|
try {
|
|
73109
|
-
const evidenceRaw = await
|
|
73618
|
+
const evidenceRaw = await readFile18(resolve20(runDir, "evidence", `${consumer}-${action.plugin}`, "release-skill-install-evidence.json"), "utf8");
|
|
73110
73619
|
evidence = JSON.parse(evidenceRaw);
|
|
73111
73620
|
} catch {
|
|
73112
73621
|
return createResult({
|
|
@@ -73189,11 +73698,11 @@ function createPluginMarketplaceAdapter(deps = {}) {
|
|
|
73189
73698
|
}
|
|
73190
73699
|
}
|
|
73191
73700
|
}
|
|
73192
|
-
const isolatedHomeReal = await
|
|
73193
|
-
const installPathReal = await
|
|
73194
|
-
const relToHome =
|
|
73195
|
-
const
|
|
73196
|
-
if (relToHome !== "" && (isAbsolute15(relToHome) || relToHome === ".." || relToHome.startsWith(`..${
|
|
73701
|
+
const isolatedHomeReal = await realpath11(isolatedHome).catch(() => isolatedHome);
|
|
73702
|
+
const installPathReal = await realpath11(installPath).catch(() => installPath);
|
|
73703
|
+
const relToHome = relative18(isolatedHomeReal, installPathReal);
|
|
73704
|
+
const sep6 = process.platform === "win32" ? "\\" : "/";
|
|
73705
|
+
if (relToHome !== "" && (isAbsolute15(relToHome) || relToHome === ".." || relToHome.startsWith(`..${sep6}`))) {
|
|
73197
73706
|
return createResult({
|
|
73198
73707
|
actionType,
|
|
73199
73708
|
status: ActionStatus.OBSERVED,
|
|
@@ -73203,10 +73712,10 @@ function createPluginMarketplaceAdapter(deps = {}) {
|
|
|
73203
73712
|
}
|
|
73204
73713
|
});
|
|
73205
73714
|
}
|
|
73206
|
-
const entrySkillPath =
|
|
73715
|
+
const entrySkillPath = resolve20(installPath, "skills", action.entrySkill, "SKILL.md");
|
|
73207
73716
|
let entrySkillFound = false;
|
|
73208
73717
|
try {
|
|
73209
|
-
const skillStat = await
|
|
73718
|
+
const skillStat = await lstat13(entrySkillPath);
|
|
73210
73719
|
if (skillStat.isFile() && !skillStat.isSymbolicLink()) {
|
|
73211
73720
|
entrySkillFound = true;
|
|
73212
73721
|
}
|
|
@@ -73272,8 +73781,8 @@ function createPluginMarketplaceAdapter(deps = {}) {
|
|
|
73272
73781
|
});
|
|
73273
73782
|
}
|
|
73274
73783
|
try {
|
|
73275
|
-
const installedManifestPath =
|
|
73276
|
-
const installedManifestContent = await
|
|
73784
|
+
const installedManifestPath = resolve20(installPath, platform.manifestPaths.plugin);
|
|
73785
|
+
const installedManifestContent = await readFile18(installedManifestPath, "utf8");
|
|
73277
73786
|
const installedManifest = JSON.parse(installedManifestContent);
|
|
73278
73787
|
const expectedName = observation.plugin;
|
|
73279
73788
|
if (expectedName && installedManifest.name !== expectedName) {
|
|
@@ -73392,7 +73901,7 @@ function createPluginMarketplaceAdapter(deps = {}) {
|
|
|
73392
73901
|
}
|
|
73393
73902
|
});
|
|
73394
73903
|
}
|
|
73395
|
-
var
|
|
73904
|
+
var execFile7, NAME2, PAYLOAD_CONTRACT_DECLARED_MANIFEST, PAYLOAD_CONTRACT_EXTERNAL_MARKETPLACE, EXTRA_INSTALLED_PATHS_CAP, PAYLOAD_CONFLICT_REPORT_CAP, CONSUMER_INSTALL_RECIPE_VERSION, SUPPORTED_TYPES, SAFE_REPO_RE, SAFE_DIGEST_RE, CONSUMER_IDS, STRICT_SEMVER_RE, MARKETPLACE_SOURCE_TYPES, PLATFORM_SUPPORTED_SOURCES;
|
|
73396
73905
|
var init_plugin_marketplace = __esm({
|
|
73397
73906
|
async "src/adapters/plugin-marketplace.mjs"() {
|
|
73398
73907
|
init_contract();
|
|
@@ -73402,7 +73911,7 @@ var init_plugin_marketplace = __esm({
|
|
|
73402
73911
|
await init_kimi();
|
|
73403
73912
|
init_codebuddy();
|
|
73404
73913
|
init_codex();
|
|
73405
|
-
|
|
73914
|
+
execFile7 = promisify8(execFileCb8);
|
|
73406
73915
|
NAME2 = "plugin-marketplace";
|
|
73407
73916
|
__name(transportPayload, "transportPayload");
|
|
73408
73917
|
PAYLOAD_CONTRACT_DECLARED_MANIFEST = "declared-manifest-v1";
|
|
@@ -73455,8 +73964,8 @@ var init_plugin_marketplace = __esm({
|
|
|
73455
73964
|
});
|
|
73456
73965
|
|
|
73457
73966
|
// src/artifacts/transaction-journal.mjs
|
|
73458
|
-
import { readdir as
|
|
73459
|
-
import { join as
|
|
73967
|
+
import { readdir as readdir11, readFile as readFile19, rm as rm7, stat as stat5 } from "node:fs/promises";
|
|
73968
|
+
import { join as join17 } from "node:path";
|
|
73460
73969
|
function failSchema(message, details) {
|
|
73461
73970
|
throw new ReleaseError(TRANSACTION_INCOMPLETE, message, details);
|
|
73462
73971
|
}
|
|
@@ -74453,7 +74962,7 @@ async function pruneTerminalTransactionRecords(transactionsRoot, {
|
|
|
74453
74962
|
if (!Number.isInteger(retentionMax) || retentionMax < 0) return summary;
|
|
74454
74963
|
let entries;
|
|
74455
74964
|
try {
|
|
74456
|
-
entries = await
|
|
74965
|
+
entries = await readdir11(transactionsRoot, { withFileTypes: true });
|
|
74457
74966
|
} catch (scanErr) {
|
|
74458
74967
|
summary.errors.push(`scan: ${scanErr?.code || scanErr?.message || "readdir-failed"}`);
|
|
74459
74968
|
return summary;
|
|
@@ -74463,11 +74972,11 @@ async function pruneTerminalTransactionRecords(transactionsRoot, {
|
|
|
74463
74972
|
if (txnDirs.length <= retentionMax) return summary;
|
|
74464
74973
|
const terminal = [];
|
|
74465
74974
|
for (const entry of txnDirs) {
|
|
74466
|
-
const recordDir =
|
|
74975
|
+
const recordDir = join17(transactionsRoot, entry.name);
|
|
74467
74976
|
let state = null;
|
|
74468
74977
|
let createdAt = null;
|
|
74469
74978
|
try {
|
|
74470
|
-
const raw = await
|
|
74979
|
+
const raw = await readFile19(join17(recordDir, "journal.json"), "utf8");
|
|
74471
74980
|
const journal = JSON.parse(raw);
|
|
74472
74981
|
if (journal && typeof journal === "object") {
|
|
74473
74982
|
state = typeof journal.state === "string" ? journal.state : null;
|
|
@@ -74495,7 +75004,7 @@ async function pruneTerminalTransactionRecords(transactionsRoot, {
|
|
|
74495
75004
|
for (let i = 0; i < excess; i += 1) {
|
|
74496
75005
|
const victim = terminal[i];
|
|
74497
75006
|
try {
|
|
74498
|
-
await
|
|
75007
|
+
await rm7(victim.dir, { recursive: true, force: true, maxRetries: 0 });
|
|
74499
75008
|
summary.pruned.push(victim.name);
|
|
74500
75009
|
} catch (rmErr) {
|
|
74501
75010
|
summary.errors.push(`${victim.name}: ${rmErr?.code || rmErr?.message || "rm-failed"}`);
|
|
@@ -74531,7 +75040,7 @@ async function createTransactionJournal({
|
|
|
74531
75040
|
);
|
|
74532
75041
|
if (typeof root === "string" && root.length > 0) {
|
|
74533
75042
|
await pruneTerminalTransactionRecords(
|
|
74534
|
-
|
|
75043
|
+
join17(root, ".release-skill", "transactions"),
|
|
74535
75044
|
{ retentionMax }
|
|
74536
75045
|
);
|
|
74537
75046
|
}
|
|
@@ -74895,7 +75404,7 @@ __export(transaction_exports, {
|
|
|
74895
75404
|
applyWriteSetUnderLock: () => applyWriteSetUnderLock
|
|
74896
75405
|
});
|
|
74897
75406
|
import { randomBytes as randomBytes2 } from "node:crypto";
|
|
74898
|
-
import { relative as
|
|
75407
|
+
import { relative as relative19 } from "node:path";
|
|
74899
75408
|
function computeCanonicalPlanDigest(plan) {
|
|
74900
75409
|
const { planDigest: _ignored, ...content } = plan;
|
|
74901
75410
|
return `sha256:${sha256Hex(canonicalJson(content))}`;
|
|
@@ -75808,7 +76317,7 @@ async function applyArtifactPlanUnderLock({
|
|
|
75808
76317
|
}
|
|
75809
76318
|
const handle = await safeFs.openRoot(root);
|
|
75810
76319
|
try {
|
|
75811
|
-
const relPlanPath = canonicalArtifactPath(
|
|
76320
|
+
const relPlanPath = canonicalArtifactPath(relative19(root, planPath)).path;
|
|
75812
76321
|
const planFileData = await withParentHandle(handle, relPlanPath, async (parent, leaf) => {
|
|
75813
76322
|
const planEntry = await parent.readEntry(leaf);
|
|
75814
76323
|
if (!planEntry || planEntry.kind === "absent") {
|
|
@@ -78223,7 +78732,7 @@ __export(refresh_service_exports, {
|
|
|
78223
78732
|
planReleaseDocsRefreshForUnit: () => planReleaseDocsRefreshForUnit,
|
|
78224
78733
|
runReleaseDocsRefresh: () => runReleaseDocsRefresh
|
|
78225
78734
|
});
|
|
78226
|
-
import { isAbsolute as isAbsolute16, relative as
|
|
78735
|
+
import { isAbsolute as isAbsolute16, relative as relative20, resolve as resolve21, sep as sep5 } from "node:path";
|
|
78227
78736
|
function deepFreeze7(value) {
|
|
78228
78737
|
if (Array.isArray(value)) {
|
|
78229
78738
|
for (const item of value) deepFreeze7(item);
|
|
@@ -78306,7 +78815,7 @@ async function planReleaseDocsRefreshForUnit({
|
|
|
78306
78815
|
field: "unit.source"
|
|
78307
78816
|
});
|
|
78308
78817
|
}
|
|
78309
|
-
const unitRoot =
|
|
78818
|
+
const unitRoot = resolve21(root, unit.source);
|
|
78310
78819
|
const backend = await (backendFactory ?? loadSafeFs)();
|
|
78311
78820
|
const sharedFactory = /* @__PURE__ */ __name(async () => backend, "sharedFactory");
|
|
78312
78821
|
const notesSource = await loadReleaseNotesSource({
|
|
@@ -78516,16 +79025,16 @@ async function runReleaseDocsRefresh({
|
|
|
78516
79025
|
});
|
|
78517
79026
|
}
|
|
78518
79027
|
const changedFiles = plan.files.filter((file) => file.changed);
|
|
78519
|
-
const unitRoot =
|
|
78520
|
-
const unitLocation =
|
|
78521
|
-
if (unitLocation === ".." || unitLocation.startsWith(`..${
|
|
79028
|
+
const unitRoot = resolve21(root, unit.source);
|
|
79029
|
+
const unitLocation = relative20(root, unitRoot);
|
|
79030
|
+
if (unitLocation === ".." || unitLocation.startsWith(`..${sep5}`) || isAbsolute16(unitLocation)) {
|
|
78522
79031
|
throw new ReleaseError(
|
|
78523
79032
|
PATH_UNSAFE,
|
|
78524
79033
|
"release unit source escapes the project root",
|
|
78525
79034
|
{ reason: "UNIT_SOURCE_ESCAPE", unitId }
|
|
78526
79035
|
);
|
|
78527
79036
|
}
|
|
78528
|
-
const unitPrefix = unitLocation === "" ? "" : `${unitLocation.split(
|
|
79037
|
+
const unitPrefix = unitLocation === "" ? "" : `${unitLocation.split(sep5).join("/")}/`;
|
|
78529
79038
|
const projectPath = /* @__PURE__ */ __name((targetPath) => `${unitPrefix}${targetPath}`, "projectPath");
|
|
78530
79039
|
const writeSet = changedFiles.map((file) => ({
|
|
78531
79040
|
id: `${file.kind}:${projectPath(file.path)}`,
|
|
@@ -78576,7 +79085,7 @@ async function runReleaseDocsRefresh({
|
|
|
78576
79085
|
if (err instanceof ReleaseError && err.code === TRANSACTION_INCOMPLETE && typeof err.details?.recover === "string") {
|
|
78577
79086
|
const restored = await tryRestoreOldBytes(
|
|
78578
79087
|
backend,
|
|
78579
|
-
|
|
79088
|
+
resolve21(root, unit.source),
|
|
78580
79089
|
changedFiles,
|
|
78581
79090
|
modes
|
|
78582
79091
|
);
|
|
@@ -78676,10 +79185,10 @@ __export(prepare_exports, {
|
|
|
78676
79185
|
resolveUnitVersion: () => resolveUnitVersion,
|
|
78677
79186
|
runDeclaredHooks: () => runDeclaredHooks
|
|
78678
79187
|
});
|
|
78679
|
-
import { resolve as
|
|
78680
|
-
import { readFile as
|
|
78681
|
-
import { execFile as
|
|
78682
|
-
import { promisify as
|
|
79188
|
+
import { resolve as resolve22, relative as relative21, isAbsolute as isAbsolute17, normalize as normalize3, dirname as dirname10 } from "node:path";
|
|
79189
|
+
import { readFile as readFile20, mkdir as mkdir11, realpath as realpath12 } from "node:fs/promises";
|
|
79190
|
+
import { execFile as execFileCb9 } from "node:child_process";
|
|
79191
|
+
import { promisify as promisify9 } from "node:util";
|
|
78683
79192
|
async function resolveUnitVersion(unit, root, explicitVersion) {
|
|
78684
79193
|
const versionSource = unit.version?.source;
|
|
78685
79194
|
if (!versionSource || typeof versionSource !== "string") {
|
|
@@ -78696,10 +79205,10 @@ async function resolveUnitVersion(unit, root, explicitVersion) {
|
|
|
78696
79205
|
{ unitId: unit.id, versionSource }
|
|
78697
79206
|
);
|
|
78698
79207
|
}
|
|
78699
|
-
const unitRoot =
|
|
78700
|
-
const resolvedPath =
|
|
79208
|
+
const unitRoot = resolve22(root, unit.source);
|
|
79209
|
+
const resolvedPath = resolve22(unitRoot, versionSource);
|
|
78701
79210
|
const normalizedPath = normalize3(resolvedPath);
|
|
78702
|
-
const rel =
|
|
79211
|
+
const rel = relative21(unitRoot, normalizedPath);
|
|
78703
79212
|
if (rel.startsWith("..") || rel === ".." || isAbsolute17(rel)) {
|
|
78704
79213
|
throw new ReleaseError(
|
|
78705
79214
|
CONFIG_INVALID,
|
|
@@ -78709,7 +79218,7 @@ async function resolveUnitVersion(unit, root, explicitVersion) {
|
|
|
78709
79218
|
}
|
|
78710
79219
|
let content;
|
|
78711
79220
|
try {
|
|
78712
|
-
content = await
|
|
79221
|
+
content = await readFile20(normalizedPath, "utf8");
|
|
78713
79222
|
} catch (err) {
|
|
78714
79223
|
throw new ReleaseError(
|
|
78715
79224
|
CONFIG_INVALID,
|
|
@@ -78999,7 +79508,7 @@ async function processSnapshots(config, root, evidence, runDir, production = fal
|
|
|
78999
79508
|
const unitResults = [];
|
|
79000
79509
|
const snapshotDigests = [];
|
|
79001
79510
|
for (const unit of units) {
|
|
79002
|
-
const outputDir = resolveUnitScopedPath(
|
|
79511
|
+
const outputDir = resolveUnitScopedPath(resolve22(runDir, "snapshots"), unit.id);
|
|
79003
79512
|
await evidence.append({
|
|
79004
79513
|
phase: "snapshot",
|
|
79005
79514
|
status: "started",
|
|
@@ -79186,7 +79695,7 @@ function normalizedProductionConfig(unit) {
|
|
|
79186
79695
|
branchStrategy: unit.production?.branchStrategy ?? "create-release-branch"
|
|
79187
79696
|
};
|
|
79188
79697
|
}
|
|
79189
|
-
async function readHeadCommitTimestamp(root, headCommit, exec =
|
|
79698
|
+
async function readHeadCommitTimestamp(root, headCommit, exec = execFile8) {
|
|
79190
79699
|
try {
|
|
79191
79700
|
const { stdout } = await exec(
|
|
79192
79701
|
"git",
|
|
@@ -79227,7 +79736,7 @@ async function buildProductionAssets(unitResults, resolvedVersions, root, runDir
|
|
|
79227
79736
|
const { unit, manifest } = unitResults[index];
|
|
79228
79737
|
const version = resolvedVersions[index];
|
|
79229
79738
|
const { tag, branch, branchStrategy } = resolveProductionBranch(unit, version);
|
|
79230
|
-
const snapshotPath =
|
|
79739
|
+
const snapshotPath = relative21(root, manifest.outputDir);
|
|
79231
79740
|
const observed = await computeFrozenSnapshot(manifest.outputDir);
|
|
79232
79741
|
if (observed.digest !== manifest.snapshotDigest) {
|
|
79233
79742
|
throw new ReleaseError(
|
|
@@ -79238,7 +79747,7 @@ async function buildProductionAssets(unitResults, resolvedVersions, root, runDir
|
|
|
79238
79747
|
}
|
|
79239
79748
|
await sealFrozenSnapshot(manifest.outputDir);
|
|
79240
79749
|
const sealed = await computeFrozenSnapshot(manifest.outputDir);
|
|
79241
|
-
const repositoryDir = resolveUnitScopedPath(
|
|
79750
|
+
const repositoryDir = resolveUnitScopedPath(resolve22(runDir, "git"), unit.id, { suffix: ".git" });
|
|
79242
79751
|
const unitBaseline = unitBaselineResults.get(unit.id);
|
|
79243
79752
|
const parent = branchStrategy === "create-release-branch" ? void 0 : {
|
|
79244
79753
|
githubHost: unitBaseline.githubHost,
|
|
@@ -79259,13 +79768,13 @@ async function buildProductionAssets(unitResults, resolvedVersions, root, runDir
|
|
|
79259
79768
|
if (npmDistribution) {
|
|
79260
79769
|
npm = await buildFrozenNpmTarball({
|
|
79261
79770
|
snapshotDir: manifest.outputDir,
|
|
79262
|
-
tarballDir: resolveUnitScopedPath(
|
|
79771
|
+
tarballDir: resolveUnitScopedPath(resolve22(runDir, "tarballs"), unit.id),
|
|
79263
79772
|
expectedSnapshotDigest: sealed.digest
|
|
79264
79773
|
});
|
|
79265
79774
|
await verifyFrozenNpmTarballIdentity({
|
|
79266
79775
|
package: npmDistribution.package,
|
|
79267
79776
|
version,
|
|
79268
|
-
tarballPath:
|
|
79777
|
+
tarballPath: relative21(root, npm.tarballPath),
|
|
79269
79778
|
tarballSha256: npm.sha256,
|
|
79270
79779
|
integrity: npm.integrity
|
|
79271
79780
|
}, root);
|
|
@@ -79273,7 +79782,7 @@ async function buildProductionAssets(unitResults, resolvedVersions, root, runDir
|
|
|
79273
79782
|
assets.push({
|
|
79274
79783
|
snapshotPath,
|
|
79275
79784
|
manifestDigest: sealed.digest,
|
|
79276
|
-
gitObjectDir:
|
|
79785
|
+
gitObjectDir: relative21(root, repositoryDir),
|
|
79277
79786
|
commit: git2.commit,
|
|
79278
79787
|
tree: git2.tree,
|
|
79279
79788
|
commitTimestamp: canonicalFreezeTimestamp,
|
|
@@ -79282,7 +79791,7 @@ async function buildProductionAssets(unitResults, resolvedVersions, root, runDir
|
|
|
79282
79791
|
branch,
|
|
79283
79792
|
tag,
|
|
79284
79793
|
npm: npm ? {
|
|
79285
|
-
tarballPath:
|
|
79794
|
+
tarballPath: relative21(root, npm.tarballPath),
|
|
79286
79795
|
tarballSha256: npm.sha256,
|
|
79287
79796
|
integrity: npm.integrity,
|
|
79288
79797
|
size: npm.size
|
|
@@ -79324,7 +79833,7 @@ function decodeExternalMarketplaceIndex(base64Content) {
|
|
|
79324
79833
|
}
|
|
79325
79834
|
async function defaultObserveExternalMarketplaceHead(repo, { githubHost = "github.com" } = {}) {
|
|
79326
79835
|
try {
|
|
79327
|
-
const { stdout } = await
|
|
79836
|
+
const { stdout } = await execFile8(
|
|
79328
79837
|
"git",
|
|
79329
79838
|
["ls-remote", "--symref", `https://${githubHost}/${repo}.git`, "HEAD"],
|
|
79330
79839
|
{ shell: false, encoding: "utf8", timeout: 3e4 }
|
|
@@ -79340,7 +79849,7 @@ async function defaultObserveExternalMarketplaceHead(repo, { githubHost = "githu
|
|
|
79340
79849
|
}
|
|
79341
79850
|
async function defaultFetchExternalMarketplaceIndex(repo, manifestPath, ref, { githubHost = "github.com" } = {}) {
|
|
79342
79851
|
try {
|
|
79343
|
-
const { stdout } = await
|
|
79852
|
+
const { stdout } = await execFile8(
|
|
79344
79853
|
"gh",
|
|
79345
79854
|
["api", `repos/${repo}/contents/${manifestPath}?ref=${ref}`, "--jq", ".content"],
|
|
79346
79855
|
{
|
|
@@ -79833,7 +80342,7 @@ async function prepareRelease(options) {
|
|
|
79833
80342
|
}
|
|
79834
80343
|
let realRoot;
|
|
79835
80344
|
try {
|
|
79836
|
-
realRoot = await
|
|
80345
|
+
realRoot = await realpath12(root);
|
|
79837
80346
|
} catch (err) {
|
|
79838
80347
|
throw new ReleaseError(
|
|
79839
80348
|
CONFIG_INVALID,
|
|
@@ -79842,26 +80351,26 @@ async function prepareRelease(options) {
|
|
|
79842
80351
|
);
|
|
79843
80352
|
}
|
|
79844
80353
|
if (production) {
|
|
79845
|
-
const canonicalOutput =
|
|
79846
|
-
if (output &&
|
|
80354
|
+
const canonicalOutput = resolve22(realRoot, ".release-skill", "release-plan.json");
|
|
80355
|
+
if (output && resolve22(output) !== canonicalOutput) {
|
|
79847
80356
|
throw new ReleaseError(
|
|
79848
80357
|
GATE_FAILED,
|
|
79849
80358
|
"production prepare requires the canonical .release-skill/release-plan.json output; custom --output is supported only outside production",
|
|
79850
|
-
{ output:
|
|
80359
|
+
{ output: resolve22(output), expected: canonicalOutput }
|
|
79851
80360
|
);
|
|
79852
80361
|
}
|
|
79853
80362
|
}
|
|
79854
80363
|
const lock = await acquireProjectLock({ root: realRoot, command: "prepare", mode: "exclusive" });
|
|
79855
|
-
const releaseDir =
|
|
80364
|
+
const releaseDir = resolve22(realRoot, ".release-skill");
|
|
79856
80365
|
const runId = `prepare-${Date.now()}`;
|
|
79857
|
-
const rawRunDir = runDirOpt ??
|
|
80366
|
+
const rawRunDir = runDirOpt ?? resolve22(releaseDir, "runs", runId);
|
|
79858
80367
|
let runDir;
|
|
79859
80368
|
try {
|
|
79860
80369
|
if (production) {
|
|
79861
80370
|
runDir = await createProductionPrepareRunDir(rawRunDir, releaseDir);
|
|
79862
80371
|
} else {
|
|
79863
80372
|
await mkdir11(rawRunDir, { recursive: true });
|
|
79864
|
-
runDir = await
|
|
80373
|
+
runDir = await realpath12(rawRunDir);
|
|
79865
80374
|
}
|
|
79866
80375
|
} catch (error) {
|
|
79867
80376
|
await lock.release();
|
|
@@ -79875,7 +80384,7 @@ async function prepareRelease(options) {
|
|
|
79875
80384
|
await evidence.append({
|
|
79876
80385
|
phase: "config",
|
|
79877
80386
|
status: "completed",
|
|
79878
|
-
configPath:
|
|
80387
|
+
configPath: relative21(realRoot, configPath),
|
|
79879
80388
|
configDigest
|
|
79880
80389
|
});
|
|
79881
80390
|
const configUnits = config.releaseUnits ?? [];
|
|
@@ -80007,6 +80516,71 @@ To proceed, pass --acknowledge-hook-side-effects (CLI) or hooksAuthorized=true (
|
|
|
80007
80516
|
expectedBindings: preHookDocsBindings
|
|
80008
80517
|
});
|
|
80009
80518
|
}
|
|
80519
|
+
const sourceRepository = config.project?.sourceRepository ?? null;
|
|
80520
|
+
const configDefaultBranch = config.project?.defaultBranch ?? null;
|
|
80521
|
+
let sourceAuthority = null;
|
|
80522
|
+
let sourceInputClosure = null;
|
|
80523
|
+
if (production) {
|
|
80524
|
+
if (!sourceRepository || typeof sourceRepository !== "string") {
|
|
80525
|
+
throw new ReleaseError(
|
|
80526
|
+
CONFIG_MISSING,
|
|
80527
|
+
"production prepare requires project.sourceRepository in configuration; source authority content gate needs a workspace source repository",
|
|
80528
|
+
{ configPath }
|
|
80529
|
+
);
|
|
80530
|
+
}
|
|
80531
|
+
await evidence.append({ phase: "source-authority", status: "started" });
|
|
80532
|
+
const unitConfigsForClosure = configUnits.map((unit, idx) => ({
|
|
80533
|
+
...unit,
|
|
80534
|
+
version: { ...unit.version }
|
|
80535
|
+
}));
|
|
80536
|
+
sourceInputClosure = await computeSourceInputClosure({
|
|
80537
|
+
units: unitConfigsForClosure,
|
|
80538
|
+
root: realRoot
|
|
80539
|
+
});
|
|
80540
|
+
await evidence.append({
|
|
80541
|
+
phase: "source-authority",
|
|
80542
|
+
step: "closure-computed",
|
|
80543
|
+
entryCount: sourceInputClosure.entries.length,
|
|
80544
|
+
inputDigest: sourceInputClosure.digest
|
|
80545
|
+
});
|
|
80546
|
+
const dirtyResult = await checkSourceInputDirty({
|
|
80547
|
+
closure: sourceInputClosure,
|
|
80548
|
+
root: realRoot
|
|
80549
|
+
});
|
|
80550
|
+
if (dirtyResult.dirty) {
|
|
80551
|
+
await evidence.append({
|
|
80552
|
+
phase: "source-authority",
|
|
80553
|
+
status: "blocking",
|
|
80554
|
+
reason: "DIRTY_SOURCE_INPUT",
|
|
80555
|
+
dirtyPaths: dirtyResult.dirtyPaths
|
|
80556
|
+
});
|
|
80557
|
+
throw new ReleaseError(
|
|
80558
|
+
DIRTY_SOURCE_INPUT,
|
|
80559
|
+
`source-input closure files have uncommitted changes: ${dirtyResult.dirtyPaths.join(", ")}`,
|
|
80560
|
+
{ dirtyPaths: dirtyResult.dirtyPaths }
|
|
80561
|
+
);
|
|
80562
|
+
}
|
|
80563
|
+
await evidence.append({
|
|
80564
|
+
phase: "source-authority",
|
|
80565
|
+
step: "dirty-check",
|
|
80566
|
+
status: "clean"
|
|
80567
|
+
});
|
|
80568
|
+
sourceAuthority = {
|
|
80569
|
+
sourceRepository,
|
|
80570
|
+
defaultBranch: configDefaultBranch,
|
|
80571
|
+
entries: sourceInputClosure.entries,
|
|
80572
|
+
inputDigest: sourceInputClosure.digest,
|
|
80573
|
+
algorithmVersion: SOURCE_INPUT_ALGORITHM_VERSION
|
|
80574
|
+
};
|
|
80575
|
+
await evidence.append({
|
|
80576
|
+
phase: "source-authority",
|
|
80577
|
+
status: "completed",
|
|
80578
|
+
sourceRepository,
|
|
80579
|
+
defaultBranch: configDefaultBranch,
|
|
80580
|
+
inputDigest: sourceInputClosure.digest,
|
|
80581
|
+
remoteObservation: offline ? "unobserved-offline" : "deferred-to-publish"
|
|
80582
|
+
});
|
|
80583
|
+
}
|
|
80010
80584
|
await evidence.append({ phase: "baseline", status: "started" });
|
|
80011
80585
|
const baseline = await captureBaseline(realRoot);
|
|
80012
80586
|
await evidence.append({
|
|
@@ -80018,7 +80592,7 @@ To proceed, pass --acknowledge-hook-side-effects (CLI) or hooksAuthorized=true (
|
|
|
80018
80592
|
});
|
|
80019
80593
|
const defaultObserveFn = /* @__PURE__ */ __name(async (repo, ref, expectedCommit, { githubHost = "github.com" } = {}) => {
|
|
80020
80594
|
try {
|
|
80021
|
-
const { stdout } = await
|
|
80595
|
+
const { stdout } = await execFile8("git", ["ls-remote", `https://${githubHost}/${repo}.git`, ref], {
|
|
80022
80596
|
shell: false,
|
|
80023
80597
|
encoding: "utf8",
|
|
80024
80598
|
timeout: 3e4
|
|
@@ -80035,7 +80609,7 @@ To proceed, pass --acknowledge-hook-side-effects (CLI) or hooksAuthorized=true (
|
|
|
80035
80609
|
const observeFn = options.observePreviousPublicBaselineFn ?? defaultObserveFn;
|
|
80036
80610
|
const defaultObserveDefaultBranchFn = /* @__PURE__ */ __name(async (repo, { githubHost = "github.com" } = {}) => {
|
|
80037
80611
|
try {
|
|
80038
|
-
const { stdout } = await
|
|
80612
|
+
const { stdout } = await execFile8(
|
|
80039
80613
|
"gh",
|
|
80040
80614
|
["api", `repos/${repo}`, "--jq", ".default_branch"],
|
|
80041
80615
|
{
|
|
@@ -80236,6 +80810,64 @@ To proceed, pass --acknowledge-hook-side-effects (CLI) or hooksAuthorized=true (
|
|
|
80236
80810
|
status: "completed",
|
|
80237
80811
|
gateCount: snapshotGateResults.length
|
|
80238
80812
|
});
|
|
80813
|
+
if (production) {
|
|
80814
|
+
const snapshotSourceResult = verifySnapshotSourcesMatchClosure({
|
|
80815
|
+
closure: sourceInputClosure,
|
|
80816
|
+
unitResults
|
|
80817
|
+
});
|
|
80818
|
+
if (!snapshotSourceResult.passed) {
|
|
80819
|
+
throw new ReleaseError(
|
|
80820
|
+
DIRTY_SOURCE_INPUT,
|
|
80821
|
+
"source inputs changed between closure calculation and frozen snapshot construction",
|
|
80822
|
+
{
|
|
80823
|
+
reason: "SNAPSHOT_SOURCE_DRIFT",
|
|
80824
|
+
dirtyPaths: snapshotSourceResult.error.paths
|
|
80825
|
+
}
|
|
80826
|
+
);
|
|
80827
|
+
}
|
|
80828
|
+
const finalClosure = await computeSourceInputClosure({
|
|
80829
|
+
units: configUnits,
|
|
80830
|
+
root: realRoot
|
|
80831
|
+
});
|
|
80832
|
+
if (finalClosure.digest !== sourceInputClosure.digest) {
|
|
80833
|
+
const initialByPath = new Map(
|
|
80834
|
+
sourceInputClosure.entries.map((entry) => [entry.path, entry])
|
|
80835
|
+
);
|
|
80836
|
+
const finalByPath = new Map(
|
|
80837
|
+
finalClosure.entries.map((entry) => [entry.path, entry])
|
|
80838
|
+
);
|
|
80839
|
+
const changedPaths = [.../* @__PURE__ */ new Set([
|
|
80840
|
+
...sourceInputClosure.entries.map((entry) => entry.path),
|
|
80841
|
+
...finalClosure.entries.map((entry) => entry.path)
|
|
80842
|
+
])].filter((path3) => JSON.stringify(initialByPath.get(path3) ?? null) !== JSON.stringify(finalByPath.get(path3) ?? null)).sort();
|
|
80843
|
+
throw new ReleaseError(
|
|
80844
|
+
DIRTY_SOURCE_INPUT,
|
|
80845
|
+
"source-input closure changed while preparing frozen snapshots",
|
|
80846
|
+
{ reason: "SOURCE_CLOSURE_DRIFT", dirtyPaths: changedPaths }
|
|
80847
|
+
);
|
|
80848
|
+
}
|
|
80849
|
+
const finalDirtyResult = await checkSourceInputDirty({
|
|
80850
|
+
closure: finalClosure,
|
|
80851
|
+
root: realRoot
|
|
80852
|
+
});
|
|
80853
|
+
if (finalDirtyResult.dirty) {
|
|
80854
|
+
throw new ReleaseError(
|
|
80855
|
+
DIRTY_SOURCE_INPUT,
|
|
80856
|
+
`source-input closure files have uncommitted changes after snapshot construction: ${finalDirtyResult.dirtyPaths.join(", ")}`,
|
|
80857
|
+
{
|
|
80858
|
+
reason: "DIRTY_AFTER_SNAPSHOT",
|
|
80859
|
+
dirtyPaths: finalDirtyResult.dirtyPaths
|
|
80860
|
+
}
|
|
80861
|
+
);
|
|
80862
|
+
}
|
|
80863
|
+
await evidence.append({
|
|
80864
|
+
phase: "source-authority",
|
|
80865
|
+
step: "snapshot-binding",
|
|
80866
|
+
status: "completed",
|
|
80867
|
+
inputDigest: sourceInputClosure.digest,
|
|
80868
|
+
snapshotSourceCount: snapshotSourceResult.observation.snapshotSourceCount
|
|
80869
|
+
});
|
|
80870
|
+
}
|
|
80239
80871
|
if (!offline) {
|
|
80240
80872
|
await evidence.append({
|
|
80241
80873
|
phase: "remote-check",
|
|
@@ -80396,10 +81028,10 @@ To proceed, pass --acknowledge-hook-side-effects (CLI) or hooksAuthorized=true (
|
|
|
80396
81028
|
{ unitId: unit.id, distributionType: dist.type }
|
|
80397
81029
|
);
|
|
80398
81030
|
}
|
|
80399
|
-
const marketplaceIndexPath =
|
|
81031
|
+
const marketplaceIndexPath = resolve22(snapshotDir, marketplaceIndexRelative);
|
|
80400
81032
|
let marketplaceIndexRaw;
|
|
80401
81033
|
try {
|
|
80402
|
-
marketplaceIndexRaw = await
|
|
81034
|
+
marketplaceIndexRaw = await readFile20(marketplaceIndexPath, "utf8");
|
|
80403
81035
|
} catch (err) {
|
|
80404
81036
|
throw new ReleaseError(
|
|
80405
81037
|
GATE_FAILED,
|
|
@@ -80465,10 +81097,10 @@ To proceed, pass --acknowledge-hook-side-effects (CLI) or hooksAuthorized=true (
|
|
|
80465
81097
|
pluginManifestRelative = readResult.manifestRelative ?? platform.manifestPaths.plugin;
|
|
80466
81098
|
} else {
|
|
80467
81099
|
pluginManifestRelative = platform.manifestPaths.plugin;
|
|
80468
|
-
const pluginManifestPath =
|
|
81100
|
+
const pluginManifestPath = resolve22(snapshotDir, pluginManifestRelative);
|
|
80469
81101
|
let raw;
|
|
80470
81102
|
try {
|
|
80471
|
-
raw = await
|
|
81103
|
+
raw = await readFile20(pluginManifestPath, "utf8");
|
|
80472
81104
|
} catch (err) {
|
|
80473
81105
|
throw new ReleaseError(
|
|
80474
81106
|
GATE_FAILED,
|
|
@@ -80598,11 +81230,12 @@ To proceed, pass --acknowledge-hook-side-effects (CLI) or hooksAuthorized=true (
|
|
|
80598
81230
|
...production ? {
|
|
80599
81231
|
production: {
|
|
80600
81232
|
mode: "github-npm-v1",
|
|
80601
|
-
assetRoot:
|
|
81233
|
+
assetRoot: relative21(realRoot, runDir)
|
|
80602
81234
|
}
|
|
80603
81235
|
} : {},
|
|
80604
81236
|
units,
|
|
80605
81237
|
externalActions,
|
|
81238
|
+
...sourceAuthority ? { sourceAuthority } : {},
|
|
80606
81239
|
createdAt: production ? createdAtTimestamp : clock ? clock() : (/* @__PURE__ */ new Date()).toISOString()
|
|
80607
81240
|
};
|
|
80608
81241
|
await evidence.append({
|
|
@@ -80612,9 +81245,9 @@ To proceed, pass --acknowledge-hook-side-effects (CLI) or hooksAuthorized=true (
|
|
|
80612
81245
|
actionCount: externalActions.length
|
|
80613
81246
|
});
|
|
80614
81247
|
await evidence.append({ phase: "plan-write", status: "started" });
|
|
80615
|
-
const latestPlanPath = output ??
|
|
81248
|
+
const latestPlanPath = output ?? resolve22(releaseDir, "release-plan.json");
|
|
80616
81249
|
const plannedDigest = computePlanDigest(plan);
|
|
80617
|
-
const immutablePlanPath =
|
|
81250
|
+
const immutablePlanPath = resolve22(dirname10(latestPlanPath), "plans", `${plannedDigest}.json`);
|
|
80618
81251
|
const { planPath: writtenPath, planDigest } = await writePlanImmutable(immutablePlanPath, plan);
|
|
80619
81252
|
await writePlanAtomic(latestPlanPath, plan);
|
|
80620
81253
|
await evidence.append({
|
|
@@ -80655,7 +81288,7 @@ To proceed, pass --acknowledge-hook-side-effects (CLI) or hooksAuthorized=true (
|
|
|
80655
81288
|
await lock.release();
|
|
80656
81289
|
}
|
|
80657
81290
|
}
|
|
80658
|
-
var
|
|
81291
|
+
var execFile8, CONSUMER_INSTALL_RECIPE_VERSION2, EXTERNAL_MARKETPLACE_SHA_RE2;
|
|
80659
81292
|
var init_prepare = __esm({
|
|
80660
81293
|
async "src/commands/prepare.mjs"() {
|
|
80661
81294
|
await init_config();
|
|
@@ -80673,6 +81306,7 @@ var init_prepare = __esm({
|
|
|
80673
81306
|
init_contract2();
|
|
80674
81307
|
init_frozen();
|
|
80675
81308
|
init_errors();
|
|
81309
|
+
init_source_authority();
|
|
80676
81310
|
init_project_lock();
|
|
80677
81311
|
init_previous_public_baseline();
|
|
80678
81312
|
init_npm();
|
|
@@ -80680,7 +81314,7 @@ var init_prepare = __esm({
|
|
|
80680
81314
|
await init_registry();
|
|
80681
81315
|
await init_plugin_marketplace();
|
|
80682
81316
|
init_installation_contract();
|
|
80683
|
-
|
|
81317
|
+
execFile8 = promisify9(execFileCb9);
|
|
80684
81318
|
CONSUMER_INSTALL_RECIPE_VERSION2 = "consumer-install-v1";
|
|
80685
81319
|
__name(resolveUnitVersion, "resolveUnitVersion");
|
|
80686
81320
|
__name(resolveAllUnitVersions, "resolveAllUnitVersions");
|
|
@@ -80704,8 +81338,8 @@ var init_prepare = __esm({
|
|
|
80704
81338
|
});
|
|
80705
81339
|
|
|
80706
81340
|
// src/core/approval.mjs
|
|
80707
|
-
import { readFile as
|
|
80708
|
-
import { basename as basename6, dirname as dirname11, join as
|
|
81341
|
+
import { readFile as readFile21 } from "node:fs/promises";
|
|
81342
|
+
import { basename as basename6, dirname as dirname11, join as join18, resolve as resolve23 } from "node:path";
|
|
80709
81343
|
function validateApprovalRecordSchema(approval) {
|
|
80710
81344
|
if (validateApprovalSchema(approval)) return;
|
|
80711
81345
|
const errors = validateApprovalSchema.errors ?? [];
|
|
@@ -80722,7 +81356,7 @@ function assertImmutableApprovalAuthority(approvalPath, plan, rawApproval) {
|
|
|
80722
81356
|
if (!plan?.production) return;
|
|
80723
81357
|
const planDigest = computePlanDigest(plan);
|
|
80724
81358
|
const approvalDigest = computeApprovalDigest(rawApproval);
|
|
80725
|
-
const absolute =
|
|
81359
|
+
const absolute = resolve23(approvalPath);
|
|
80726
81360
|
const planDirectory = dirname11(absolute);
|
|
80727
81361
|
if (basename6(absolute) !== `${approvalDigest}.json` || basename6(planDirectory) !== planDigest || basename6(dirname11(planDirectory)) !== "approvals") {
|
|
80728
81362
|
throw new ReleaseError(
|
|
@@ -80991,8 +81625,8 @@ var approve_exports = {};
|
|
|
80991
81625
|
__export(approve_exports, {
|
|
80992
81626
|
approvePlan: () => approvePlan
|
|
80993
81627
|
});
|
|
80994
|
-
import { readFile as
|
|
80995
|
-
import { resolve as
|
|
81628
|
+
import { readFile as readFile22, writeFile as writeFile7 } from "node:fs/promises";
|
|
81629
|
+
import { resolve as resolve24, dirname as dirname12, basename as basename7 } from "node:path";
|
|
80996
81630
|
function defaultClock() {
|
|
80997
81631
|
return (/* @__PURE__ */ new Date()).toISOString();
|
|
80998
81632
|
}
|
|
@@ -81018,7 +81652,7 @@ async function approvePlan(options) {
|
|
|
81018
81652
|
}
|
|
81019
81653
|
let planRaw;
|
|
81020
81654
|
try {
|
|
81021
|
-
planRaw = await
|
|
81655
|
+
planRaw = await readFile22(planPath, "utf8");
|
|
81022
81656
|
} catch (err) {
|
|
81023
81657
|
throw new ReleaseError(
|
|
81024
81658
|
GATE_FAILED,
|
|
@@ -81122,18 +81756,18 @@ async function approvePlan(options) {
|
|
|
81122
81756
|
expiresAt
|
|
81123
81757
|
};
|
|
81124
81758
|
validateApprovalRecordSchema(approvalRecord);
|
|
81125
|
-
const planDir = dirname12(
|
|
81759
|
+
const planDir = dirname12(resolve24(planPath));
|
|
81126
81760
|
const releaseDir = basename7(planDir) === "plans" && basename7(planPath) === `${actualDigest}.json` ? dirname12(planDir) : planDir;
|
|
81127
|
-
if (plan.production?.mode === "github-npm-v1" && outputPath &&
|
|
81761
|
+
if (plan.production?.mode === "github-npm-v1" && outputPath && resolve24(outputPath) !== resolve24(releaseDir, "approval-record.json")) {
|
|
81128
81762
|
throw new ReleaseError(
|
|
81129
81763
|
GATE_FAILED,
|
|
81130
81764
|
"production approve requires the canonical approval-record.json alias next to the immutable plan authority; custom --output is supported only outside production",
|
|
81131
|
-
{ outputPath:
|
|
81765
|
+
{ outputPath: resolve24(outputPath), expected: resolve24(releaseDir, "approval-record.json") }
|
|
81132
81766
|
);
|
|
81133
81767
|
}
|
|
81134
81768
|
const json = JSON.stringify(approvalRecord, null, 2);
|
|
81135
81769
|
const approvalDigest = computeApprovalDigest(json);
|
|
81136
|
-
const immutableApprovalPath =
|
|
81770
|
+
const immutableApprovalPath = resolve24(
|
|
81137
81771
|
releaseDir,
|
|
81138
81772
|
"approvals",
|
|
81139
81773
|
actualDigest,
|
|
@@ -81145,7 +81779,7 @@ async function approvePlan(options) {
|
|
|
81145
81779
|
await writeFile7(immutableApprovalPath, json, { encoding: "utf8", flag: "wx", mode: 384 });
|
|
81146
81780
|
} catch (error) {
|
|
81147
81781
|
if (error.code !== "EEXIST") throw error;
|
|
81148
|
-
const existing = await
|
|
81782
|
+
const existing = await readFile22(immutableApprovalPath, "utf8");
|
|
81149
81783
|
if (existing !== json) {
|
|
81150
81784
|
throw new ReleaseError(
|
|
81151
81785
|
GATE_FAILED,
|
|
@@ -81154,7 +81788,7 @@ async function approvePlan(options) {
|
|
|
81154
81788
|
);
|
|
81155
81789
|
}
|
|
81156
81790
|
}
|
|
81157
|
-
const writePath = outputPath ??
|
|
81791
|
+
const writePath = outputPath ?? resolve24(releaseDir, "approval-record.json");
|
|
81158
81792
|
await prepareAuthorityDirectory(dirname12(writePath));
|
|
81159
81793
|
await assertAuthorityFileTarget(writePath);
|
|
81160
81794
|
await writeFile7(writePath, json, "utf8");
|
|
@@ -81356,7 +81990,7 @@ function defaultSleep(ms) {
|
|
|
81356
81990
|
if (process.env.RELEASE_SKILL_OBSERVE_RETRY_NO_WAIT === "1") {
|
|
81357
81991
|
return Promise.resolve();
|
|
81358
81992
|
}
|
|
81359
|
-
return new Promise((
|
|
81993
|
+
return new Promise((resolve28) => setTimeout(resolve28, ms));
|
|
81360
81994
|
}
|
|
81361
81995
|
function isPropagatingMissing(result) {
|
|
81362
81996
|
if (result == null) return true;
|
|
@@ -81445,8 +82079,8 @@ var reconcile_exports = {};
|
|
|
81445
82079
|
__export(reconcile_exports, {
|
|
81446
82080
|
reconcileRelease: () => reconcileRelease
|
|
81447
82081
|
});
|
|
81448
|
-
import { readFile as
|
|
81449
|
-
import { join as
|
|
82082
|
+
import { readFile as readFile23, mkdir as mkdir12 } from "node:fs/promises";
|
|
82083
|
+
import { join as join19 } from "node:path";
|
|
81450
82084
|
function defaultClock3() {
|
|
81451
82085
|
return (/* @__PURE__ */ new Date()).toISOString();
|
|
81452
82086
|
}
|
|
@@ -81475,7 +82109,7 @@ async function reconcileRelease(options) {
|
|
|
81475
82109
|
}
|
|
81476
82110
|
let planRaw;
|
|
81477
82111
|
try {
|
|
81478
|
-
planRaw = await
|
|
82112
|
+
planRaw = await readFile23(planPath, "utf8");
|
|
81479
82113
|
} catch (err) {
|
|
81480
82114
|
throw new ReleaseError(GATE_FAILED, `cannot read release plan: ${err.message}`, { planPath, cause: err.code });
|
|
81481
82115
|
}
|
|
@@ -81544,6 +82178,18 @@ async function reconcileRelease(options) {
|
|
|
81544
82178
|
`reconcile source command must be publish or reconcile, got "${sourceRun.command}"`
|
|
81545
82179
|
);
|
|
81546
82180
|
}
|
|
82181
|
+
let sourceAuthorityReceipt = null;
|
|
82182
|
+
if (plan.sourceAuthority) {
|
|
82183
|
+
const receiptResult = verifySourceAuthorityReceipt({ plan, run: sourceRun });
|
|
82184
|
+
if (!receiptResult.passed) {
|
|
82185
|
+
throw new ReleaseError(
|
|
82186
|
+
GATE_FAILED,
|
|
82187
|
+
`reconcile source run has no valid source-authority receipt: ${receiptResult.reason}`,
|
|
82188
|
+
{ gate: "source-authority", sourceRunId: sourceRun.runId }
|
|
82189
|
+
);
|
|
82190
|
+
}
|
|
82191
|
+
sourceAuthorityReceipt = receiptResult.receipt;
|
|
82192
|
+
}
|
|
81547
82193
|
let consumedApprovalPath = sourceRun.approvalPath;
|
|
81548
82194
|
let consumedApprovalDigest = sourceRun.approvalDigest;
|
|
81549
82195
|
if (plan.production) {
|
|
@@ -81554,7 +82200,7 @@ async function reconcileRelease(options) {
|
|
|
81554
82200
|
{ sourceRunId: sourceRun.runId }
|
|
81555
82201
|
);
|
|
81556
82202
|
}
|
|
81557
|
-
const sourceApprovalRaw = await
|
|
82203
|
+
const sourceApprovalRaw = await readFile23(consumedApprovalPath, "utf8").catch((error) => {
|
|
81558
82204
|
throw new ReleaseError(GATE_FAILED, "source run approval authority is unavailable", {
|
|
81559
82205
|
sourceRunId: sourceRun.runId,
|
|
81560
82206
|
cause: error.code
|
|
@@ -81671,9 +82317,9 @@ async function reconcileRelease(options) {
|
|
|
81671
82317
|
});
|
|
81672
82318
|
const defaultPpbObserveFn = /* @__PURE__ */ __name(async (repo, ref, expectedCommit, { githubHost = "github.com" } = {}) => {
|
|
81673
82319
|
try {
|
|
81674
|
-
const { execFile:
|
|
81675
|
-
const { promisify:
|
|
81676
|
-
const { stdout } = await
|
|
82320
|
+
const { execFile: execFile17 } = await import("node:child_process");
|
|
82321
|
+
const { promisify: promisify18 } = await import("node:util");
|
|
82322
|
+
const { stdout } = await promisify18(execFile17)(
|
|
81677
82323
|
"git",
|
|
81678
82324
|
["ls-remote", `https://${githubHost}/${repo}.git`, ref],
|
|
81679
82325
|
{ shell: false, encoding: "utf8", timeout: 3e4 }
|
|
@@ -81731,7 +82377,7 @@ async function reconcileRelease(options) {
|
|
|
81731
82377
|
if (approvalPath) {
|
|
81732
82378
|
let approvalRaw;
|
|
81733
82379
|
try {
|
|
81734
|
-
approvalRaw = await
|
|
82380
|
+
approvalRaw = await readFile23(approvalPath, "utf8");
|
|
81735
82381
|
} catch (err) {
|
|
81736
82382
|
throw new ReleaseError(
|
|
81737
82383
|
GATE_FAILED,
|
|
@@ -82094,6 +82740,7 @@ async function reconcileRelease(options) {
|
|
|
82094
82740
|
sourceRunDigest: sourceAuthorityDigest,
|
|
82095
82741
|
sourceRunPath,
|
|
82096
82742
|
status,
|
|
82743
|
+
...sourceAuthorityReceipt ? { sourceAuthorityReceipts: [sourceAuthorityReceipt] } : {},
|
|
82097
82744
|
checkpoints: planActions.map((action) => {
|
|
82098
82745
|
const value = actionResults.get(action.id);
|
|
82099
82746
|
const normalized = value === "deferred" ? "deferred" : value === "succeeded" ? "succeeded" : value === "skipped" ? "skipped" : value === "failed" ? "failed" : value === "uncertain" ? "uncertain" : "pending";
|
|
@@ -82350,7 +82997,7 @@ async function reconcileRelease(options) {
|
|
|
82350
82997
|
...normalized === "deferred" ? { reason: CONSUMER_VERIFICATION_DEFERRED, phase: "post-publish-verification" } : {}
|
|
82351
82998
|
};
|
|
82352
82999
|
});
|
|
82353
|
-
const runPath =
|
|
83000
|
+
const runPath = join19(runDir, "release-run.json");
|
|
82354
83001
|
const sourceRunDigest = sourceAuthorityDigest;
|
|
82355
83002
|
const runState = {
|
|
82356
83003
|
runId,
|
|
@@ -82365,6 +83012,7 @@ async function reconcileRelease(options) {
|
|
|
82365
83012
|
sourceRunDigest,
|
|
82366
83013
|
sourceRunPath,
|
|
82367
83014
|
status: overallStatus,
|
|
83015
|
+
...sourceAuthorityReceipt ? { sourceAuthorityReceipts: [sourceAuthorityReceipt] } : {},
|
|
82368
83016
|
checkpoints: planActions.map((a) => {
|
|
82369
83017
|
const status = actionResults.get(a.id) ?? "pending";
|
|
82370
83018
|
const normalized = status === "deferred" ? "deferred" : status === "succeeded" ? "succeeded" : status === "failed" ? "failed" : status === "skipped" ? "skipped" : status === "uncertain" ? "uncertain" : "pending";
|
|
@@ -82419,6 +83067,7 @@ var init_reconcile = __esm({
|
|
|
82419
83067
|
await init_run();
|
|
82420
83068
|
init_errors();
|
|
82421
83069
|
init_state_machine();
|
|
83070
|
+
init_source_authority();
|
|
82422
83071
|
init_contract();
|
|
82423
83072
|
init_observe_retry();
|
|
82424
83073
|
__name(defaultClock3, "defaultClock");
|
|
@@ -82432,10 +83081,10 @@ __export(push_snapshot_exports, {
|
|
|
82432
83081
|
createPushSnapshotAdapter: () => createPushSnapshotAdapter,
|
|
82433
83082
|
githubRepositoryUrl: () => githubRepositoryUrl
|
|
82434
83083
|
});
|
|
82435
|
-
import { execFile as
|
|
82436
|
-
import { promisify as
|
|
83084
|
+
import { execFile as execFileCb10 } from "node:child_process";
|
|
83085
|
+
import { promisify as promisify10 } from "node:util";
|
|
82437
83086
|
async function run3(command2, args2, options = {}) {
|
|
82438
|
-
return
|
|
83087
|
+
return execFile9(command2, args2, {
|
|
82439
83088
|
shell: false,
|
|
82440
83089
|
encoding: "utf8",
|
|
82441
83090
|
timeout: 12e4,
|
|
@@ -82687,12 +83336,12 @@ function createPushSnapshotAdapter(deps = {}) {
|
|
|
82687
83336
|
}
|
|
82688
83337
|
});
|
|
82689
83338
|
}
|
|
82690
|
-
var
|
|
83339
|
+
var execFile9, NAME3;
|
|
82691
83340
|
var init_push_snapshot = __esm({
|
|
82692
83341
|
"src/adapters/push-snapshot.mjs"() {
|
|
82693
83342
|
init_contract();
|
|
82694
83343
|
init_frozen();
|
|
82695
|
-
|
|
83344
|
+
execFile9 = promisify10(execFileCb10);
|
|
82696
83345
|
NAME3 = "push-snapshot";
|
|
82697
83346
|
__name(run3, "run");
|
|
82698
83347
|
__name(githubRepositoryUrl, "githubRepositoryUrl");
|
|
@@ -82708,10 +83357,10 @@ var git_github_exports = {};
|
|
|
82708
83357
|
__export(git_github_exports, {
|
|
82709
83358
|
createGitGithubAdapter: () => createGitGithubAdapter
|
|
82710
83359
|
});
|
|
82711
|
-
import { execFile as
|
|
82712
|
-
import { promisify as
|
|
83360
|
+
import { execFile as execFileCb11 } from "node:child_process";
|
|
83361
|
+
import { promisify as promisify11 } from "node:util";
|
|
82713
83362
|
async function run4(command2, args2, options = {}) {
|
|
82714
|
-
return
|
|
83363
|
+
return execFile10(command2, args2, {
|
|
82715
83364
|
shell: false,
|
|
82716
83365
|
encoding: "utf8",
|
|
82717
83366
|
timeout: 12e4,
|
|
@@ -82987,13 +83636,13 @@ function createGitGithubAdapter(deps = {}) {
|
|
|
82987
83636
|
}
|
|
82988
83637
|
});
|
|
82989
83638
|
}
|
|
82990
|
-
var
|
|
83639
|
+
var execFile10, NAME4;
|
|
82991
83640
|
var init_git_github = __esm({
|
|
82992
83641
|
"src/adapters/git-github.mjs"() {
|
|
82993
83642
|
init_contract();
|
|
82994
83643
|
init_frozen();
|
|
82995
83644
|
init_push_snapshot();
|
|
82996
|
-
|
|
83645
|
+
execFile10 = promisify11(execFileCb11);
|
|
82997
83646
|
NAME4 = "git-github";
|
|
82998
83647
|
__name(run4, "run");
|
|
82999
83648
|
__name(isNotFound2, "isNotFound");
|
|
@@ -83014,12 +83663,12 @@ __export(verify_exports, {
|
|
|
83014
83663
|
runSmokeTest: () => runSmokeTest,
|
|
83015
83664
|
verifyRelease: () => verifyRelease
|
|
83016
83665
|
});
|
|
83017
|
-
import { readFile as
|
|
83666
|
+
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";
|
|
83018
83667
|
import { realpathSync as realpathSync4 } from "node:fs";
|
|
83019
|
-
import { dirname as dirname13, join as
|
|
83020
|
-
import { tmpdir as
|
|
83021
|
-
import { execFile as
|
|
83022
|
-
import { promisify as
|
|
83668
|
+
import { dirname as dirname13, join as join20, relative as relative22, isAbsolute as isAbsolute18, resolve as resolve25, basename as basename8 } from "node:path";
|
|
83669
|
+
import { tmpdir as tmpdir3 } from "node:os";
|
|
83670
|
+
import { execFile as execFileCb12 } from "node:child_process";
|
|
83671
|
+
import { promisify as promisify12 } from "node:util";
|
|
83023
83672
|
function defaultClock4() {
|
|
83024
83673
|
return (/* @__PURE__ */ new Date()).toISOString();
|
|
83025
83674
|
}
|
|
@@ -83044,9 +83693,9 @@ function matchesSubset2(actual, expected) {
|
|
|
83044
83693
|
return true;
|
|
83045
83694
|
}
|
|
83046
83695
|
async function runSmokeTest(plan, root, options = {}) {
|
|
83047
|
-
const baseDir = options.baseDir ??
|
|
83696
|
+
const baseDir = options.baseDir ?? tmpdir3();
|
|
83048
83697
|
await mkdir13(baseDir, { recursive: true });
|
|
83049
|
-
const tmpDir = await
|
|
83698
|
+
const tmpDir = await mkdtemp4(join20(baseDir, "verify-smoke-"));
|
|
83050
83699
|
const npmExec = options.npmExecutor ?? defaultNpmExecutor;
|
|
83051
83700
|
const installFlags = [
|
|
83052
83701
|
"--ignore-scripts",
|
|
@@ -83094,7 +83743,7 @@ async function runSmokeTest(plan, root, options = {}) {
|
|
|
83094
83743
|
for (const { package: pkgName, registry, targetVersion, unitId, smokeBin, smokeArgs, smokeExpectedJson } of npmDistributions) {
|
|
83095
83744
|
const packageAtVersion = `${pkgName}@${targetVersion}`;
|
|
83096
83745
|
const installDir = resolveUnitScopedPath(tmpDir, unitId);
|
|
83097
|
-
await mkdir13(
|
|
83746
|
+
await mkdir13(join20(installDir, "node_modules"), { recursive: true });
|
|
83098
83747
|
const registryFlags = [...installFlags, "--registry", registry];
|
|
83099
83748
|
const installResult = await npmExec.install(
|
|
83100
83749
|
packageAtVersion,
|
|
@@ -83112,10 +83761,10 @@ async function runSmokeTest(plan, root, options = {}) {
|
|
|
83112
83761
|
}
|
|
83113
83762
|
};
|
|
83114
83763
|
}
|
|
83115
|
-
const installedPkgPath =
|
|
83764
|
+
const installedPkgPath = join20(installDir, "node_modules", pkgName, "package.json");
|
|
83116
83765
|
let installedPkg;
|
|
83117
83766
|
try {
|
|
83118
|
-
installedPkg = JSON.parse(await
|
|
83767
|
+
installedPkg = JSON.parse(await readFile24(installedPkgPath, "utf8"));
|
|
83119
83768
|
} catch {
|
|
83120
83769
|
return {
|
|
83121
83770
|
passed: false,
|
|
@@ -83146,7 +83795,7 @@ async function runSmokeTest(plan, root, options = {}) {
|
|
|
83146
83795
|
}
|
|
83147
83796
|
};
|
|
83148
83797
|
}
|
|
83149
|
-
const pkgRoot =
|
|
83798
|
+
const pkgRoot = join20(installDir, "node_modules", pkgName);
|
|
83150
83799
|
if (plan.skillResourceClosure) {
|
|
83151
83800
|
const expectedUnitReceipt = plan.skillResourceClosure.unitReceipts.find((item) => item.unitId === unitId);
|
|
83152
83801
|
if (!expectedUnitReceipt) {
|
|
@@ -83228,10 +83877,10 @@ async function runSmokeTest(plan, root, options = {}) {
|
|
|
83228
83877
|
}
|
|
83229
83878
|
};
|
|
83230
83879
|
}
|
|
83231
|
-
const binPath =
|
|
83232
|
-
const relBin =
|
|
83233
|
-
const
|
|
83234
|
-
if (isAbsolute18(relBin) || relBin === ".." || relBin.startsWith(`..${
|
|
83880
|
+
const binPath = resolve25(pkgRoot, binRelative);
|
|
83881
|
+
const relBin = relative22(pkgRoot, binPath);
|
|
83882
|
+
const sep6 = process.platform === "win32" ? "\\" : "/";
|
|
83883
|
+
if (isAbsolute18(relBin) || relBin === ".." || relBin.startsWith(`..${sep6}`)) {
|
|
83235
83884
|
return {
|
|
83236
83885
|
passed: false,
|
|
83237
83886
|
details: {
|
|
@@ -83243,10 +83892,10 @@ async function runSmokeTest(plan, root, options = {}) {
|
|
|
83243
83892
|
}
|
|
83244
83893
|
let binStat;
|
|
83245
83894
|
try {
|
|
83246
|
-
binStat = await
|
|
83247
|
-
const [pkgRootReal, binPathReal] = await Promise.all([
|
|
83248
|
-
const relReal =
|
|
83249
|
-
if (!binStat.isFile() || binStat.isSymbolicLink() || isAbsolute18(relReal) || relReal === ".." || relReal.startsWith(`..${
|
|
83895
|
+
binStat = await lstat14(binPath);
|
|
83896
|
+
const [pkgRootReal, binPathReal] = await Promise.all([realpath13(pkgRoot), realpath13(binPath)]);
|
|
83897
|
+
const relReal = relative22(pkgRootReal, binPathReal);
|
|
83898
|
+
if (!binStat.isFile() || binStat.isSymbolicLink() || isAbsolute18(relReal) || relReal === ".." || relReal.startsWith(`..${sep6}`)) {
|
|
83250
83899
|
throw new Error("bin is not a regular file inside the installed package");
|
|
83251
83900
|
}
|
|
83252
83901
|
} catch (err) {
|
|
@@ -83351,7 +84000,7 @@ async function runSmokeTest(plan, root, options = {}) {
|
|
|
83351
84000
|
skillResourceClosureReceipts
|
|
83352
84001
|
};
|
|
83353
84002
|
} finally {
|
|
83354
|
-
await
|
|
84003
|
+
await rm8(tmpDir, { recursive: true, force: true }).catch(() => {
|
|
83355
84004
|
});
|
|
83356
84005
|
}
|
|
83357
84006
|
}
|
|
@@ -83378,7 +84027,7 @@ async function verifyRelease(options) {
|
|
|
83378
84027
|
}
|
|
83379
84028
|
let planRaw;
|
|
83380
84029
|
try {
|
|
83381
|
-
planRaw = await
|
|
84030
|
+
planRaw = await readFile24(planPath, "utf8");
|
|
83382
84031
|
} catch (err) {
|
|
83383
84032
|
throw new ReleaseError(
|
|
83384
84033
|
GATE_FAILED,
|
|
@@ -83397,6 +84046,13 @@ async function verifyRelease(options) {
|
|
|
83397
84046
|
);
|
|
83398
84047
|
}
|
|
83399
84048
|
validatePlan(plan);
|
|
84049
|
+
if (plan.production?.mode === "github-npm-v1" && !plan.sourceAuthority) {
|
|
84050
|
+
throw new ReleaseError(
|
|
84051
|
+
CONFIG_MISSING,
|
|
84052
|
+
"production verify requires a frozen sourceAuthority binding; the release must be re-prepared before publish",
|
|
84053
|
+
{ gate: "source-authority" }
|
|
84054
|
+
);
|
|
84055
|
+
}
|
|
83400
84056
|
const runId = `verify-${Date.now()}`;
|
|
83401
84057
|
const requestedRunDir = runDirOpt ?? resolveDefaultRunDir(planPath, "verify", runId);
|
|
83402
84058
|
const runDir = plan.production ? await createProductionRunDir(requestedRunDir, planPath) : requestedRunDir;
|
|
@@ -83448,7 +84104,7 @@ async function verifyRelease(options) {
|
|
|
83448
84104
|
}
|
|
83449
84105
|
let approvalRaw;
|
|
83450
84106
|
try {
|
|
83451
|
-
approvalRaw = await
|
|
84107
|
+
approvalRaw = await readFile24(sourceRun.approvalPath, "utf8");
|
|
83452
84108
|
} catch (error) {
|
|
83453
84109
|
throw new ReleaseError(
|
|
83454
84110
|
GATE_FAILED,
|
|
@@ -83484,6 +84140,23 @@ async function verifyRelease(options) {
|
|
|
83484
84140
|
);
|
|
83485
84141
|
}
|
|
83486
84142
|
validateRunCheckpointMapping(sourceRun, plan.externalActions ?? []);
|
|
84143
|
+
if (plan.sourceAuthority) {
|
|
84144
|
+
await evidence.append({ phase: "source-authority-receipt", status: "started" });
|
|
84145
|
+
const receiptResult = verifySourceAuthorityReceipt({ plan, run: sourceRun });
|
|
84146
|
+
if (!receiptResult.passed) {
|
|
84147
|
+
await evidence.append({
|
|
84148
|
+
phase: "source-authority-receipt",
|
|
84149
|
+
status: "failed",
|
|
84150
|
+
reason: receiptResult.reason
|
|
84151
|
+
});
|
|
84152
|
+
throw new ReleaseError(
|
|
84153
|
+
GATE_FAILED,
|
|
84154
|
+
`source authority receipt verification failed: ${receiptResult.reason}`,
|
|
84155
|
+
{ reason: receiptResult.reason }
|
|
84156
|
+
);
|
|
84157
|
+
}
|
|
84158
|
+
await evidence.append({ phase: "source-authority-receipt", status: "passed" });
|
|
84159
|
+
}
|
|
83487
84160
|
const incompleteCheckpoints = sourceRun.checkpoints.filter(
|
|
83488
84161
|
(cp2) => cp2.status !== "succeeded" && cp2.status !== "skipped" && !((cp2.status === "failed" || cp2.status === "deferred") && isMarketplaceAction(cp2.actionType))
|
|
83489
84162
|
);
|
|
@@ -83508,7 +84181,7 @@ async function verifyRelease(options) {
|
|
|
83508
84181
|
const trustedVerifyRuns = [];
|
|
83509
84182
|
const planDir = dirname13(planPath);
|
|
83510
84183
|
const releaseDir = basename8(planDir) === "plans" ? dirname13(planDir) : planDir;
|
|
83511
|
-
const runsDir =
|
|
84184
|
+
const runsDir = resolve25(releaseDir, "runs");
|
|
83512
84185
|
let runsDirReal = null;
|
|
83513
84186
|
let authorityDirReal = null;
|
|
83514
84187
|
if (previousVerifyRun) {
|
|
@@ -83521,7 +84194,7 @@ async function verifyRelease(options) {
|
|
|
83521
84194
|
}
|
|
83522
84195
|
{
|
|
83523
84196
|
try {
|
|
83524
|
-
const runsDirStat = await
|
|
84197
|
+
const runsDirStat = await lstat14(runsDir);
|
|
83525
84198
|
if (runsDirStat.isSymbolicLink()) {
|
|
83526
84199
|
throw new ReleaseError(
|
|
83527
84200
|
GATE_FAILED,
|
|
@@ -83550,7 +84223,7 @@ async function verifyRelease(options) {
|
|
|
83550
84223
|
runsDirReal = null;
|
|
83551
84224
|
}
|
|
83552
84225
|
if (runsDirReal) {
|
|
83553
|
-
const entries = await
|
|
84226
|
+
const entries = await readdir12(runsDirReal, { withFileTypes: true });
|
|
83554
84227
|
for (const entry of entries) {
|
|
83555
84228
|
if (!entry.name.startsWith("verify-")) continue;
|
|
83556
84229
|
if (!entry.isDirectory() || entry.isSymbolicLink()) {
|
|
@@ -83560,8 +84233,8 @@ async function verifyRelease(options) {
|
|
|
83560
84233
|
{ entry: entry.name, runsDir: runsDirReal }
|
|
83561
84234
|
);
|
|
83562
84235
|
}
|
|
83563
|
-
const candidateDir =
|
|
83564
|
-
const candidateStat = await
|
|
84236
|
+
const candidateDir = resolve25(runsDirReal, entry.name);
|
|
84237
|
+
const candidateStat = await lstat14(candidateDir).catch(() => null);
|
|
83565
84238
|
if (!candidateStat || candidateStat.isSymbolicLink()) {
|
|
83566
84239
|
throw new ReleaseError(
|
|
83567
84240
|
GATE_FAILED,
|
|
@@ -83577,7 +84250,7 @@ async function verifyRelease(options) {
|
|
|
83577
84250
|
{ candidateDir, candidateReal, runsDir: runsDirReal }
|
|
83578
84251
|
);
|
|
83579
84252
|
}
|
|
83580
|
-
const candidatePath =
|
|
84253
|
+
const candidatePath = resolve25(candidateDir, "release-run.json");
|
|
83581
84254
|
try {
|
|
83582
84255
|
const candidate = await loadRun(candidatePath, { requireDigest: true });
|
|
83583
84256
|
if (candidate.status !== "VERIFIED") continue;
|
|
@@ -83769,16 +84442,16 @@ async function verifyRelease(options) {
|
|
|
83769
84442
|
evidence,
|
|
83770
84443
|
env: gateEnv ?? process.env,
|
|
83771
84444
|
fixedEnv: action.type === "claude-marketplace-install" ? {
|
|
83772
|
-
HOME:
|
|
83773
|
-
CLAUDE_CONFIG_DIR:
|
|
84445
|
+
HOME: resolve25(runDir, "consumers", `claude-${action.parameters.plugin}`),
|
|
84446
|
+
CLAUDE_CONFIG_DIR: resolve25(runDir, "consumers", `claude-${action.parameters.plugin}`, ".claude")
|
|
83774
84447
|
} : action.type === "codex-marketplace-install" ? {
|
|
83775
|
-
HOME:
|
|
83776
|
-
CODEX_HOME:
|
|
84448
|
+
HOME: resolve25(runDir, "consumers", `codex-${action.parameters.plugin}`),
|
|
84449
|
+
CODEX_HOME: resolve25(runDir, "consumers", `codex-${action.parameters.plugin}`)
|
|
83777
84450
|
} : action.type === "codebuddy-marketplace-install" ? {
|
|
83778
|
-
HOME:
|
|
84451
|
+
HOME: resolve25(runDir, "consumers", `codebuddy-${action.parameters.plugin}`)
|
|
83779
84452
|
} : {
|
|
83780
|
-
HOME:
|
|
83781
|
-
KIMI_CODE_HOME:
|
|
84453
|
+
HOME: resolve25(runDir, "consumers", `kimi-${action.parameters.plugin}`),
|
|
84454
|
+
KIMI_CODE_HOME: resolve25(runDir, "consumers", `kimi-${action.parameters.plugin}`)
|
|
83782
84455
|
}
|
|
83783
84456
|
}));
|
|
83784
84457
|
} else {
|
|
@@ -83948,7 +84621,7 @@ async function verifyRelease(options) {
|
|
|
83948
84621
|
assertTransition(PUBLISHED, VERIFIED);
|
|
83949
84622
|
await evidence.append({ phase: "verify", status: "completed", overallStatus: VERIFIED });
|
|
83950
84623
|
const sourceRunDigest = sourceRun.runDigest ?? computeRunDigest(sourceRun);
|
|
83951
|
-
const verifyRunPath =
|
|
84624
|
+
const verifyRunPath = join20(runDir, "release-run.json");
|
|
83952
84625
|
const verifyRunState = {
|
|
83953
84626
|
runId,
|
|
83954
84627
|
command: "verify",
|
|
@@ -84021,7 +84694,7 @@ async function verifyRelease(options) {
|
|
|
84021
84694
|
throw err;
|
|
84022
84695
|
}
|
|
84023
84696
|
}
|
|
84024
|
-
var
|
|
84697
|
+
var execFile11, VERIFICATION_RESOLVED_TYPES, ADAPTER_ACTION_TYPE_MAP2, defaultNpmExecutor;
|
|
84025
84698
|
var init_verify = __esm({
|
|
84026
84699
|
async "src/commands/verify.mjs"() {
|
|
84027
84700
|
await init_plan();
|
|
@@ -84029,6 +84702,7 @@ var init_verify = __esm({
|
|
|
84029
84702
|
await init_run();
|
|
84030
84703
|
await init_approval();
|
|
84031
84704
|
init_errors();
|
|
84705
|
+
init_source_authority();
|
|
84032
84706
|
init_state_machine();
|
|
84033
84707
|
init_public_path();
|
|
84034
84708
|
init_npm();
|
|
@@ -84036,7 +84710,7 @@ var init_verify = __esm({
|
|
|
84036
84710
|
init_skill_resource_closure();
|
|
84037
84711
|
init_checkpoints();
|
|
84038
84712
|
init_installation_contract();
|
|
84039
|
-
|
|
84713
|
+
execFile11 = promisify12(execFileCb12);
|
|
84040
84714
|
VERIFICATION_RESOLVED_TYPES = Object.freeze({
|
|
84041
84715
|
PASSED_AUTOMATIC: "PASSED_AUTOMATIC",
|
|
84042
84716
|
PASSED_MANUAL: "PASSED_MANUAL",
|
|
@@ -84064,10 +84738,10 @@ var init_verify = __esm({
|
|
|
84064
84738
|
const token = await resolveNpmRegistryAuthToken({
|
|
84065
84739
|
registry: normalizedRegistry,
|
|
84066
84740
|
cwd,
|
|
84067
|
-
exec:
|
|
84741
|
+
exec: execFile11,
|
|
84068
84742
|
env: process.env
|
|
84069
84743
|
});
|
|
84070
|
-
const userConfig =
|
|
84744
|
+
const userConfig = join20(cwd, ".release-skill-npmrc");
|
|
84071
84745
|
await writeFile8(
|
|
84072
84746
|
userConfig,
|
|
84073
84747
|
`registry=${normalizedRegistry}/
|
|
@@ -84085,7 +84759,7 @@ ${registryTokenKey(normalizedRegistry)}=${token}
|
|
|
84085
84759
|
"npm_config_userconfig"
|
|
84086
84760
|
]) delete env[name];
|
|
84087
84761
|
try {
|
|
84088
|
-
await
|
|
84762
|
+
await execFile11("npm", [
|
|
84089
84763
|
"install",
|
|
84090
84764
|
packageAtVersion,
|
|
84091
84765
|
...flags,
|
|
@@ -84102,12 +84776,12 @@ ${registryTokenKey(normalizedRegistry)}=${token}
|
|
|
84102
84776
|
} catch (err) {
|
|
84103
84777
|
return { success: false, error: err.message };
|
|
84104
84778
|
} finally {
|
|
84105
|
-
await
|
|
84779
|
+
await rm8(userConfig, { force: true }).catch(() => {
|
|
84106
84780
|
});
|
|
84107
84781
|
}
|
|
84108
84782
|
},
|
|
84109
84783
|
async runBin(binPath, args2 = [], options = {}) {
|
|
84110
|
-
return
|
|
84784
|
+
return execFile11(process.execPath, [binPath, ...args2], {
|
|
84111
84785
|
cwd: options.cwd,
|
|
84112
84786
|
env: options.env,
|
|
84113
84787
|
shell: false,
|
|
@@ -84127,10 +84801,10 @@ __export(publish_exports, {
|
|
|
84127
84801
|
classifyPreObservation: () => classifyPreObservation,
|
|
84128
84802
|
publishRelease: () => publishRelease
|
|
84129
84803
|
});
|
|
84130
|
-
import { readFile as
|
|
84131
|
-
import { isAbsolute as isAbsolute19, join as
|
|
84804
|
+
import { readFile as readFile25, mkdir as mkdir14 } from "node:fs/promises";
|
|
84805
|
+
import { isAbsolute as isAbsolute19, join as join21, relative as relative23 } from "node:path";
|
|
84132
84806
|
function assertInsideAssetRoot(assetRoot, candidate, label) {
|
|
84133
|
-
const rel =
|
|
84807
|
+
const rel = relative23(assetRoot, candidate);
|
|
84134
84808
|
if (rel === "" || isAbsolute19(rel) || rel === ".." || rel.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`)) {
|
|
84135
84809
|
throw new ReleaseError(GATE_FAILED, `${label} must be a child of the production asset root`);
|
|
84136
84810
|
}
|
|
@@ -84361,7 +85035,7 @@ async function publishRelease(options) {
|
|
|
84361
85035
|
const captureBaselineActual = typeof captureBaselineFn === "function" ? captureBaselineFn : captureBaseline;
|
|
84362
85036
|
let planRaw;
|
|
84363
85037
|
try {
|
|
84364
|
-
planRaw = await
|
|
85038
|
+
planRaw = await readFile25(planPath, "utf8");
|
|
84365
85039
|
} catch (err) {
|
|
84366
85040
|
throw new ReleaseError(GATE_FAILED, `cannot read release plan: ${err.message}`, { planPath, cause: err.code });
|
|
84367
85041
|
}
|
|
@@ -84398,6 +85072,13 @@ async function publishRelease(options) {
|
|
|
84398
85072
|
if (productionMode && !isProductionPlan) {
|
|
84399
85073
|
throw new ReleaseError(GATE_FAILED, "production publish requires a github-npm-v1 frozen plan");
|
|
84400
85074
|
}
|
|
85075
|
+
if (isProductionPlan && !plan.sourceAuthority) {
|
|
85076
|
+
throw new ReleaseError(
|
|
85077
|
+
CONFIG_MISSING,
|
|
85078
|
+
"production publish requires a frozen sourceAuthority binding; re-run prepare with project.sourceRepository configured",
|
|
85079
|
+
{ gate: "source-authority" }
|
|
85080
|
+
);
|
|
85081
|
+
}
|
|
84401
85082
|
const verifiedFrozenSnapshots = /* @__PURE__ */ new Map();
|
|
84402
85083
|
if (isProductionPlan) {
|
|
84403
85084
|
if (!plan.production.assetRoot || plan.production.assetRoot === ".") {
|
|
@@ -84519,7 +85200,7 @@ async function publishRelease(options) {
|
|
|
84519
85200
|
await evidence.append({ phase: "safety-gate", gate: "approval-load", status: "started" });
|
|
84520
85201
|
let approvalRaw;
|
|
84521
85202
|
try {
|
|
84522
|
-
approvalRaw = await
|
|
85203
|
+
approvalRaw = await readFile25(approvalPath, "utf8");
|
|
84523
85204
|
} catch (err) {
|
|
84524
85205
|
throw new ReleaseError(
|
|
84525
85206
|
GATE_FAILED,
|
|
@@ -84732,6 +85413,49 @@ async function publishRelease(options) {
|
|
|
84732
85413
|
});
|
|
84733
85414
|
}
|
|
84734
85415
|
}
|
|
85416
|
+
let sourceAuthorityReceipt = null;
|
|
85417
|
+
if (plan.sourceAuthority) {
|
|
85418
|
+
await evidence.append({ phase: "safety-gate", gate: "source-authority", status: "started" });
|
|
85419
|
+
const sa = plan.sourceAuthority;
|
|
85420
|
+
const frozenClosure = {
|
|
85421
|
+
algorithmVersion: sa.algorithmVersion,
|
|
85422
|
+
digest: sa.inputDigest,
|
|
85423
|
+
entries: sa.entries
|
|
85424
|
+
};
|
|
85425
|
+
const remoteResult = await verifyRemoteSourceContent({
|
|
85426
|
+
sourceRepository: sa.sourceRepository,
|
|
85427
|
+
defaultBranch: sa.defaultBranch,
|
|
85428
|
+
closure: frozenClosure,
|
|
85429
|
+
readRemoteFn: options.readRemoteSourceFn
|
|
85430
|
+
});
|
|
85431
|
+
if (!remoteResult.passed) {
|
|
85432
|
+
const errorCode = remoteResult.error?.code ?? GATE_FAILED;
|
|
85433
|
+
await evidence.append({
|
|
85434
|
+
phase: "safety-gate",
|
|
85435
|
+
gate: "source-authority",
|
|
85436
|
+
status: "failed",
|
|
85437
|
+
error: remoteResult.error
|
|
85438
|
+
});
|
|
85439
|
+
throw new ReleaseError(
|
|
85440
|
+
errorCode,
|
|
85441
|
+
`source authority content gate failed: ${remoteResult.error?.message}`,
|
|
85442
|
+
remoteResult.error
|
|
85443
|
+
);
|
|
85444
|
+
}
|
|
85445
|
+
sourceAuthorityReceipt = createSourceAuthorityReceipt({
|
|
85446
|
+
plan,
|
|
85447
|
+
result: "CONSISTENT",
|
|
85448
|
+
observation: remoteResult.observation,
|
|
85449
|
+
clock: clockFn
|
|
85450
|
+
});
|
|
85451
|
+
await evidence.append({
|
|
85452
|
+
phase: "safety-gate",
|
|
85453
|
+
gate: "source-authority",
|
|
85454
|
+
status: "passed",
|
|
85455
|
+
sourceRepository: sa.sourceRepository,
|
|
85456
|
+
defaultBranch: sa.defaultBranch
|
|
85457
|
+
});
|
|
85458
|
+
}
|
|
84735
85459
|
if (isProductionPlan && plan.status === "PREPARED") {
|
|
84736
85460
|
assertTransition("PREPARED", "APPROVED");
|
|
84737
85461
|
assertTransition("APPROVED", PUBLISHING);
|
|
@@ -84790,7 +85514,7 @@ async function publishRelease(options) {
|
|
|
84790
85514
|
}
|
|
84791
85515
|
}
|
|
84792
85516
|
await evidence.append({ phase: "safety-gate", gate: "global-preflight", status: "passed" });
|
|
84793
|
-
const runPath =
|
|
85517
|
+
const runPath = join21(runDir, "release-run.json");
|
|
84794
85518
|
const checkpoints = orderedActions.map((action) => {
|
|
84795
85519
|
if (isMarketplaceAction(action.type)) {
|
|
84796
85520
|
return {
|
|
@@ -84827,6 +85551,7 @@ async function publishRelease(options) {
|
|
|
84827
85551
|
...checkpoint.reason === CONSUMER_VERIFICATION_DEFERRED ? { reason: CONSUMER_VERIFICATION_DEFERRED, phase: checkpoint.phase ?? "post-publish-verification" } : {}
|
|
84828
85552
|
})),
|
|
84829
85553
|
startedAt,
|
|
85554
|
+
...sourceAuthorityReceipt ? { sourceAuthorityReceipts: [sourceAuthorityReceipt] } : {},
|
|
84830
85555
|
...finishedAt2 ? { finishedAt: finishedAt2 } : {}
|
|
84831
85556
|
}), "buildPersistedState");
|
|
84832
85557
|
let stateSequence = 0;
|
|
@@ -85035,6 +85760,7 @@ var init_publish = __esm({
|
|
|
85035
85760
|
init_checkpoints();
|
|
85036
85761
|
await init_run();
|
|
85037
85762
|
init_errors();
|
|
85763
|
+
init_source_authority();
|
|
85038
85764
|
init_state_machine();
|
|
85039
85765
|
init_contract();
|
|
85040
85766
|
init_observe_retry();
|
|
@@ -85057,8 +85783,8 @@ var init_publish = __esm({
|
|
|
85057
85783
|
});
|
|
85058
85784
|
|
|
85059
85785
|
// src/artifacts/policy.mjs
|
|
85060
|
-
import { readFile as
|
|
85061
|
-
import { join as
|
|
85786
|
+
import { readFile as readFile26 } from "node:fs/promises";
|
|
85787
|
+
import { join as join22 } from "node:path";
|
|
85062
85788
|
import { createHash as createHash11 } from "node:crypto";
|
|
85063
85789
|
function validateArtifactPolicy(policy) {
|
|
85064
85790
|
const ok = _validate(policy);
|
|
@@ -85154,10 +85880,10 @@ async function parseSafeYamlWithinRoot(root, policyPath) {
|
|
|
85154
85880
|
}
|
|
85155
85881
|
throw err;
|
|
85156
85882
|
}
|
|
85157
|
-
const fullPath =
|
|
85883
|
+
const fullPath = join22(root, policyPath);
|
|
85158
85884
|
let content;
|
|
85159
85885
|
try {
|
|
85160
|
-
content = await
|
|
85886
|
+
content = await readFile26(fullPath, "utf8");
|
|
85161
85887
|
} catch (err) {
|
|
85162
85888
|
throw new ReleaseError(
|
|
85163
85889
|
ARTIFACT_POLICY_INVALID,
|
|
@@ -85268,10 +85994,10 @@ var init_policy = __esm({
|
|
|
85268
85994
|
});
|
|
85269
85995
|
|
|
85270
85996
|
// src/artifacts/entry.mjs
|
|
85271
|
-
import { lstat as
|
|
85272
|
-
import { join as
|
|
85273
|
-
import { promisify as
|
|
85274
|
-
import { execFile as
|
|
85997
|
+
import { lstat as lstat15, readdir as readdir13, readFile as readFile27 } from "node:fs/promises";
|
|
85998
|
+
import { join as join23 } from "node:path";
|
|
85999
|
+
import { promisify as promisify13 } from "node:util";
|
|
86000
|
+
import { execFile as execFile12 } from "node:child_process";
|
|
85275
86001
|
function statToGitMode(stat9) {
|
|
85276
86002
|
if (stat9.isDirectory()) return "040000";
|
|
85277
86003
|
if (stat9.isSymbolicLink()) return "120000";
|
|
@@ -85289,12 +86015,12 @@ async function gitHashObject(root, absPath) {
|
|
|
85289
86015
|
}
|
|
85290
86016
|
async function enumerateTreeEntries(root, dirPath, relBase) {
|
|
85291
86017
|
const entries = [];
|
|
85292
|
-
const items = await
|
|
86018
|
+
const items = await readdir13(dirPath, { withFileTypes: true });
|
|
85293
86019
|
for (const item of items) {
|
|
85294
86020
|
if (SKIP_DIRS2.has(item.name)) continue;
|
|
85295
|
-
const absPath =
|
|
86021
|
+
const absPath = join23(dirPath, item.name);
|
|
85296
86022
|
const relPath = relBase ? `${relBase}/${item.name}` : item.name;
|
|
85297
|
-
const st = await
|
|
86023
|
+
const st = await lstat15(absPath);
|
|
85298
86024
|
if (st.isSymbolicLink()) {
|
|
85299
86025
|
throw new ReleaseError(
|
|
85300
86026
|
PATH_UNSAFE,
|
|
@@ -85313,7 +86039,7 @@ async function enumerateTreeEntries(root, dirPath, relBase) {
|
|
|
85313
86039
|
const subEntries = await enumerateTreeEntries(root, absPath, relPath);
|
|
85314
86040
|
entries.push(...subEntries);
|
|
85315
86041
|
} else {
|
|
85316
|
-
const content = await
|
|
86042
|
+
const content = await readFile27(absPath);
|
|
85317
86043
|
entries.push(
|
|
85318
86044
|
Object.freeze({
|
|
85319
86045
|
path: relPath,
|
|
@@ -85343,10 +86069,10 @@ async function readEntry({ root, path: path3, source = "worktree" } = {}) {
|
|
|
85343
86069
|
if (source !== "worktree") {
|
|
85344
86070
|
throw new ReleaseError(PATH_UNSAFE, `unsupported readEntry source: ${source}`, { source });
|
|
85345
86071
|
}
|
|
85346
|
-
const absPath =
|
|
86072
|
+
const absPath = join23(root, path3);
|
|
85347
86073
|
let st;
|
|
85348
86074
|
try {
|
|
85349
|
-
st = await
|
|
86075
|
+
st = await lstat15(absPath);
|
|
85350
86076
|
} catch (err) {
|
|
85351
86077
|
if (err.code === "ENOENT" || err.code === "ENOTDIR") {
|
|
85352
86078
|
return Object.freeze({ kind: "absent" });
|
|
@@ -85376,7 +86102,7 @@ async function readEntry({ root, path: path3, source = "worktree" } = {}) {
|
|
|
85376
86102
|
{ path: path3, nlink: st.nlink }
|
|
85377
86103
|
);
|
|
85378
86104
|
}
|
|
85379
|
-
const content = await
|
|
86105
|
+
const content = await readFile27(absPath);
|
|
85380
86106
|
return Object.freeze({
|
|
85381
86107
|
kind: "regular",
|
|
85382
86108
|
path: path3,
|
|
@@ -85392,7 +86118,7 @@ var init_entry = __esm({
|
|
|
85392
86118
|
"src/artifacts/entry.mjs"() {
|
|
85393
86119
|
init_digest();
|
|
85394
86120
|
init_errors();
|
|
85395
|
-
execFileAsync2 =
|
|
86121
|
+
execFileAsync2 = promisify13(execFile12);
|
|
85396
86122
|
SKIP_DIRS2 = /* @__PURE__ */ new Set([".git"]);
|
|
85397
86123
|
__name(statToGitMode, "statToGitMode");
|
|
85398
86124
|
__name(gitHashObject, "gitHashObject");
|
|
@@ -85403,8 +86129,8 @@ var init_entry = __esm({
|
|
|
85403
86129
|
});
|
|
85404
86130
|
|
|
85405
86131
|
// src/artifacts/inventory.mjs
|
|
85406
|
-
import { promisify as
|
|
85407
|
-
import { execFile as
|
|
86132
|
+
import { promisify as promisify14 } from "node:util";
|
|
86133
|
+
import { execFile as execFile13 } from "node:child_process";
|
|
85408
86134
|
import { access } from "node:fs/promises";
|
|
85409
86135
|
function isReservedPath(relPath) {
|
|
85410
86136
|
if (relPath === ".git" || relPath === "transactions" || relPath === "objects") {
|
|
@@ -85489,7 +86215,7 @@ var init_inventory = __esm({
|
|
|
85489
86215
|
"src/artifacts/inventory.mjs"() {
|
|
85490
86216
|
init_digest();
|
|
85491
86217
|
init_entry();
|
|
85492
|
-
execFileAsync3 =
|
|
86218
|
+
execFileAsync3 = promisify14(execFile13);
|
|
85493
86219
|
RESERVED_PREFIXES = Object.freeze([
|
|
85494
86220
|
".git/",
|
|
85495
86221
|
".release-skill/runs/",
|
|
@@ -85639,10 +86365,10 @@ var init_graph = __esm({
|
|
|
85639
86365
|
});
|
|
85640
86366
|
|
|
85641
86367
|
// src/artifacts/producer-registry.mjs
|
|
85642
|
-
import { readFile as
|
|
85643
|
-
import { join as
|
|
85644
|
-
import { mkdtemp as
|
|
85645
|
-
import { tmpdir as
|
|
86368
|
+
import { readFile as readFile28, readdir as readdir14, stat as stat6, mkdir as mkdir15, writeFile as writeFile9, rm as rm9 } from "node:fs/promises";
|
|
86369
|
+
import { join as join24 } from "node:path";
|
|
86370
|
+
import { mkdtemp as mkdtemp5 } from "node:fs/promises";
|
|
86371
|
+
import { tmpdir as tmpdir4 } from "node:os";
|
|
85646
86372
|
import { createHash as createHash12 } from "node:crypto";
|
|
85647
86373
|
import { readFileSync as readFileSync4 } from "node:fs";
|
|
85648
86374
|
function collectStaticImports(filePath, visited = /* @__PURE__ */ new Set()) {
|
|
@@ -85661,7 +86387,7 @@ function collectStaticImports(filePath, visited = /* @__PURE__ */ new Set()) {
|
|
|
85661
86387
|
const dir = abs.replace(/\/[^/]*$/, "");
|
|
85662
86388
|
while ((match = importRe.exec(source)) !== null) {
|
|
85663
86389
|
const spec = match[1];
|
|
85664
|
-
let resolved =
|
|
86390
|
+
let resolved = join24(dir, spec);
|
|
85665
86391
|
if (!resolved.endsWith(".mjs")) resolved += ".mjs";
|
|
85666
86392
|
results.push(...collectStaticImports(resolved, visited));
|
|
85667
86393
|
}
|
|
@@ -85669,10 +86395,10 @@ function collectStaticImports(filePath, visited = /* @__PURE__ */ new Set()) {
|
|
|
85669
86395
|
}
|
|
85670
86396
|
async function createBuiltInProducerRegistry() {
|
|
85671
86397
|
const producers = /* @__PURE__ */ new Map();
|
|
85672
|
-
const lockfilePath =
|
|
86398
|
+
const lockfilePath = join24(new URL("../../..", import.meta.url).pathname, "pnpm-lock.yaml");
|
|
85673
86399
|
let lockfileBytes;
|
|
85674
86400
|
try {
|
|
85675
|
-
lockfileBytes = await
|
|
86401
|
+
lockfileBytes = await readFile28(lockfilePath);
|
|
85676
86402
|
} catch {
|
|
85677
86403
|
lockfileBytes = Buffer.from("");
|
|
85678
86404
|
}
|
|
@@ -85689,7 +86415,7 @@ async function createBuiltInProducerRegistry() {
|
|
|
85689
86415
|
const allModuleBytes = await Promise.all(
|
|
85690
86416
|
allModulePaths.map(async (p) => {
|
|
85691
86417
|
try {
|
|
85692
|
-
return await
|
|
86418
|
+
return await readFile28(p);
|
|
85693
86419
|
} catch {
|
|
85694
86420
|
return Buffer.from("");
|
|
85695
86421
|
}
|
|
@@ -85706,16 +86432,16 @@ async function createBuiltInProducerRegistry() {
|
|
|
85706
86432
|
}
|
|
85707
86433
|
async function readDirEntries(dirPath, relBase = "") {
|
|
85708
86434
|
const entries = [];
|
|
85709
|
-
const items = await
|
|
86435
|
+
const items = await readdir14(dirPath, { withFileTypes: true });
|
|
85710
86436
|
for (const item of items) {
|
|
85711
86437
|
if (item.name === ".git") continue;
|
|
85712
|
-
const absPath =
|
|
86438
|
+
const absPath = join24(dirPath, item.name);
|
|
85713
86439
|
const relPath = relBase ? `${relBase}/${item.name}` : item.name;
|
|
85714
86440
|
const st = await stat6(absPath);
|
|
85715
86441
|
if (st.isDirectory()) {
|
|
85716
86442
|
entries.push(...await readDirEntries(absPath, relPath));
|
|
85717
86443
|
} else {
|
|
85718
|
-
const content = await
|
|
86444
|
+
const content = await readFile28(absPath);
|
|
85719
86445
|
entries.push(Object.freeze({
|
|
85720
86446
|
path: relPath,
|
|
85721
86447
|
type: "blob",
|
|
@@ -85732,11 +86458,11 @@ async function readDirEntries(dirPath, relBase = "") {
|
|
|
85732
86458
|
async function materializeEntries(entries, dirPath) {
|
|
85733
86459
|
for (const entry of entries) {
|
|
85734
86460
|
if (!entry.path) continue;
|
|
85735
|
-
const targetPath =
|
|
86461
|
+
const targetPath = join24(dirPath, entry.path);
|
|
85736
86462
|
if (entry.type === "tree" || entry.kind === "tree") {
|
|
85737
86463
|
await mkdir15(targetPath, { recursive: true });
|
|
85738
86464
|
} else {
|
|
85739
|
-
await mkdir15(
|
|
86465
|
+
await mkdir15(join24(targetPath, ".."), { recursive: true });
|
|
85740
86466
|
if (entry.content) {
|
|
85741
86467
|
await writeFile9(targetPath, entry.content);
|
|
85742
86468
|
}
|
|
@@ -85757,7 +86483,7 @@ async function verifyDeterminism(produce, runOptions, dir1, dir2) {
|
|
|
85757
86483
|
{ digest1, digest2 }
|
|
85758
86484
|
);
|
|
85759
86485
|
}
|
|
85760
|
-
await
|
|
86486
|
+
await rm9(dir1, { recursive: true, force: true }).catch(() => {
|
|
85761
86487
|
});
|
|
85762
86488
|
return { entries: entries2, outputDir: dir2 };
|
|
85763
86489
|
}
|
|
@@ -85780,7 +86506,7 @@ async function runProducerClosure({
|
|
|
85780
86506
|
graph,
|
|
85781
86507
|
inputSnapshot,
|
|
85782
86508
|
artifactIds,
|
|
85783
|
-
tempRootFactory = /* @__PURE__ */ __name(async () =>
|
|
86509
|
+
tempRootFactory = /* @__PURE__ */ __name(async () => mkdtemp5(join24(tmpdir4(), "producer-")), "tempRootFactory")
|
|
85784
86510
|
} = {}) {
|
|
85785
86511
|
const generatedSet = new Set(graph.topologicalOrder);
|
|
85786
86512
|
for (const id of artifactIds) {
|
|
@@ -85817,7 +86543,7 @@ async function runProducerClosure({
|
|
|
85817
86543
|
if (inputEntries) {
|
|
85818
86544
|
const first = inputEntries[0];
|
|
85819
86545
|
if (first && first.path) {
|
|
85820
|
-
const absPath = first.path.startsWith("/") ? first.path :
|
|
86546
|
+
const absPath = first.path.startsWith("/") ? first.path : join24(process.cwd(), first.path);
|
|
85821
86547
|
try {
|
|
85822
86548
|
const st = await stat6(absPath);
|
|
85823
86549
|
if (st.isDirectory()) {
|
|
@@ -85907,8 +86633,8 @@ var init_producer_registry = __esm({
|
|
|
85907
86633
|
});
|
|
85908
86634
|
|
|
85909
86635
|
// src/artifacts/git-authority.mjs
|
|
85910
|
-
import { promisify as
|
|
85911
|
-
import { execFile as
|
|
86636
|
+
import { promisify as promisify15 } from "node:util";
|
|
86637
|
+
import { execFile as execFile14 } from "node:child_process";
|
|
85912
86638
|
import { createHash as createHash13 } from "node:crypto";
|
|
85913
86639
|
async function git(cwd, ...args2) {
|
|
85914
86640
|
const { stdout } = await execFileAsync4("git", args2, { cwd, shell: false });
|
|
@@ -85943,7 +86669,7 @@ var init_git_authority = __esm({
|
|
|
85943
86669
|
"src/artifacts/git-authority.mjs"() {
|
|
85944
86670
|
init_errors();
|
|
85945
86671
|
init_entry();
|
|
85946
|
-
execFileAsync4 =
|
|
86672
|
+
execFileAsync4 = promisify15(execFile14);
|
|
85947
86673
|
__name(git, "git");
|
|
85948
86674
|
__name(sha256Hex3, "sha256Hex");
|
|
85949
86675
|
__name(readRepositoryIdentity, "readRepositoryIdentity");
|
|
@@ -86241,7 +86967,7 @@ var init_state = __esm({
|
|
|
86241
86967
|
});
|
|
86242
86968
|
|
|
86243
86969
|
// src/artifacts/artifact-plan.mjs
|
|
86244
|
-
import { writeFile as writeFile10, mkdir as mkdir16, readFile as
|
|
86970
|
+
import { writeFile as writeFile10, mkdir as mkdir16, readFile as readFile29, rename as rename3, open as open8 } from "node:fs/promises";
|
|
86245
86971
|
import { dirname as dirname14 } from "node:path";
|
|
86246
86972
|
function assemblePlan({
|
|
86247
86973
|
operation,
|
|
@@ -86928,10 +87654,10 @@ var init_adoption = __esm({
|
|
|
86928
87654
|
});
|
|
86929
87655
|
|
|
86930
87656
|
// src/artifacts/inspect.mjs
|
|
86931
|
-
import { promisify as
|
|
86932
|
-
import { execFile as
|
|
86933
|
-
import { readdir as
|
|
86934
|
-
import { join as
|
|
87657
|
+
import { promisify as promisify16 } from "node:util";
|
|
87658
|
+
import { execFile as execFile15 } from "node:child_process";
|
|
87659
|
+
import { readdir as readdir15, stat as stat7, readFile as readFile30 } from "node:fs/promises";
|
|
87660
|
+
import { join as join25 } from "node:path";
|
|
86935
87661
|
async function hasNestedGitRoots(root) {
|
|
86936
87662
|
try {
|
|
86937
87663
|
const { stdout } = await execFileAsync5(
|
|
@@ -86941,9 +87667,9 @@ async function hasNestedGitRoots(root) {
|
|
|
86941
87667
|
);
|
|
86942
87668
|
const dirs = stdout.split("\n").filter((s) => s.length > 0);
|
|
86943
87669
|
for (const dir of dirs) {
|
|
86944
|
-
const absDir =
|
|
87670
|
+
const absDir = join25(root, dir);
|
|
86945
87671
|
try {
|
|
86946
|
-
const nestedGit =
|
|
87672
|
+
const nestedGit = join25(absDir, ".git");
|
|
86947
87673
|
await stat7(nestedGit);
|
|
86948
87674
|
return true;
|
|
86949
87675
|
} catch {
|
|
@@ -87185,7 +87911,7 @@ var init_inspect = __esm({
|
|
|
87185
87911
|
init_artifact_plan();
|
|
87186
87912
|
init_entry_merge();
|
|
87187
87913
|
init_adoption();
|
|
87188
|
-
execFileAsync5 =
|
|
87914
|
+
execFileAsync5 = promisify16(execFile15);
|
|
87189
87915
|
__name(hasNestedGitRoots, "hasNestedGitRoots");
|
|
87190
87916
|
__name(hasPartialStage, "hasPartialStage");
|
|
87191
87917
|
__name(readDeclaredEntries, "readDeclaredEntries");
|
|
@@ -87202,8 +87928,8 @@ var init_inspect = __esm({
|
|
|
87202
87928
|
});
|
|
87203
87929
|
|
|
87204
87930
|
// src/artifacts/resolution.mjs
|
|
87205
|
-
import { mkdir as mkdir17, open as open9, readFile as
|
|
87206
|
-
import { join as
|
|
87931
|
+
import { mkdir as mkdir17, open as open9, readFile as readFile31, stat as stat8, lstat as lstat16, chmod as chmod4 } from "node:fs/promises";
|
|
87932
|
+
import { join as join26, resolve as resolve26, relative as relative24, isAbsolute as isAbsolute20, basename as basename9 } from "node:path";
|
|
87207
87933
|
function decodeBuffer(value, label) {
|
|
87208
87934
|
if (value == null) return null;
|
|
87209
87935
|
if (Buffer.isBuffer(value)) return value;
|
|
@@ -87305,13 +88031,13 @@ function assertSafeArtifactId(id) {
|
|
|
87305
88031
|
}
|
|
87306
88032
|
async function assertNoSymlinksInPath(root, artifactId) {
|
|
87307
88033
|
const levels = [
|
|
87308
|
-
|
|
87309
|
-
|
|
87310
|
-
|
|
88034
|
+
join26(root, ".release-skill"),
|
|
88035
|
+
join26(root, ".release-skill", "resolution"),
|
|
88036
|
+
join26(root, ".release-skill", "resolution", artifactId)
|
|
87311
88037
|
];
|
|
87312
88038
|
for (const dir of levels) {
|
|
87313
88039
|
try {
|
|
87314
|
-
const st = await
|
|
88040
|
+
const st = await lstat16(dir);
|
|
87315
88041
|
if (st.isSymbolicLink()) {
|
|
87316
88042
|
throw new ReleaseError(PATH_UNSAFE, `directory is a symlink: ${dir}`, { path: dir });
|
|
87317
88043
|
}
|
|
@@ -87323,10 +88049,10 @@ async function assertNoSymlinksInPath(root, artifactId) {
|
|
|
87323
88049
|
}
|
|
87324
88050
|
}
|
|
87325
88051
|
async function assertSafeResolvedPath(root, artifactId, resolvedPath) {
|
|
87326
|
-
const resolutionDir =
|
|
87327
|
-
const resolved =
|
|
88052
|
+
const resolutionDir = resolve26(root, ".release-skill", "resolution", artifactId);
|
|
88053
|
+
const resolved = resolve26(resolvedPath);
|
|
87328
88054
|
await assertNoSymlinksInPath(root, artifactId);
|
|
87329
|
-
const rel =
|
|
88055
|
+
const rel = relative24(resolutionDir, resolved);
|
|
87330
88056
|
if (rel.startsWith("..") || isAbsolute20(rel)) {
|
|
87331
88057
|
throw new ReleaseError(
|
|
87332
88058
|
PATH_UNSAFE,
|
|
@@ -87342,7 +88068,7 @@ async function assertSafeResolvedPath(root, artifactId, resolvedPath) {
|
|
|
87342
88068
|
{ resolvedPath, expected: `${artifactId}.resolved`, actual: filename }
|
|
87343
88069
|
);
|
|
87344
88070
|
}
|
|
87345
|
-
if (resolved !==
|
|
88071
|
+
if (resolved !== resolve26(resolutionDir, `${artifactId}.resolved`)) {
|
|
87346
88072
|
throw new ReleaseError(
|
|
87347
88073
|
PATH_UNSAFE,
|
|
87348
88074
|
"resolvedPath must be the exact materialized resolution file",
|
|
@@ -87351,7 +88077,7 @@ async function assertSafeResolvedPath(root, artifactId, resolvedPath) {
|
|
|
87351
88077
|
}
|
|
87352
88078
|
let st;
|
|
87353
88079
|
try {
|
|
87354
|
-
st = await
|
|
88080
|
+
st = await lstat16(resolvedPath);
|
|
87355
88081
|
} catch (err) {
|
|
87356
88082
|
throw new ReleaseError(
|
|
87357
88083
|
MISSING_PARAMETERS,
|
|
@@ -87486,13 +88212,13 @@ async function materializeResolution({
|
|
|
87486
88212
|
const template = buildConflictTemplate(artifact.conflict ?? {}, decodedBuffers);
|
|
87487
88213
|
const templateDigest = sha256Hex(template);
|
|
87488
88214
|
await assertNoSymlinksInPath(root, artifactId);
|
|
87489
|
-
const resolutionDir =
|
|
88215
|
+
const resolutionDir = join26(root, ".release-skill", "resolution", artifactId);
|
|
87490
88216
|
await mkdir17(resolutionDir, { recursive: true, mode: 448 });
|
|
87491
88217
|
const dirStat = await stat8(resolutionDir);
|
|
87492
88218
|
if ((dirStat.mode & 511) !== 448) {
|
|
87493
88219
|
await chmod4(resolutionDir, 448);
|
|
87494
88220
|
}
|
|
87495
|
-
const resolvedPath =
|
|
88221
|
+
const resolvedPath = join26(resolutionDir, `${artifactId}.resolved`);
|
|
87496
88222
|
const fh = await open9(resolvedPath, "wx", 384);
|
|
87497
88223
|
try {
|
|
87498
88224
|
await fh.write(template, 0, template.length);
|
|
@@ -87534,7 +88260,7 @@ async function submitResolution({
|
|
|
87534
88260
|
async function readAndValidateResolvedFile(resolvedPath) {
|
|
87535
88261
|
let content;
|
|
87536
88262
|
try {
|
|
87537
|
-
content = await
|
|
88263
|
+
content = await readFile31(resolvedPath);
|
|
87538
88264
|
} catch (err) {
|
|
87539
88265
|
throw new ReleaseError(MISSING_PARAMETERS, `cannot read resolved file: ${err.message}`, { resolvedPath, cause: err.code });
|
|
87540
88266
|
}
|
|
@@ -87702,8 +88428,8 @@ var artifacts_exports = {};
|
|
|
87702
88428
|
__export(artifacts_exports, {
|
|
87703
88429
|
runArtifactsCommand: () => runArtifactsCommand
|
|
87704
88430
|
});
|
|
87705
|
-
import { readFile as
|
|
87706
|
-
import { join as
|
|
88431
|
+
import { readFile as readFile32 } from "node:fs/promises";
|
|
88432
|
+
import { join as join27 } from "node:path";
|
|
87707
88433
|
async function runArtifactsCommand({ subcommand, args: args2, root } = {}) {
|
|
87708
88434
|
if (!VALID_SUBCOMMANDS.has(subcommand)) {
|
|
87709
88435
|
throw new ReleaseError(
|
|
@@ -87831,7 +88557,7 @@ async function handleAdopt({ args: args2, root }) {
|
|
|
87831
88557
|
{ subcommand: "adopt" }
|
|
87832
88558
|
);
|
|
87833
88559
|
}
|
|
87834
|
-
const planRaw = await
|
|
88560
|
+
const planRaw = await readFile32(planPath, "utf8");
|
|
87835
88561
|
const plan = JSON.parse(planRaw);
|
|
87836
88562
|
if (expectedDigest && plan.planDigest !== expectedDigest) {
|
|
87837
88563
|
throw new ReleaseError(
|
|
@@ -87846,7 +88572,7 @@ async function handleAdopt({ args: args2, root }) {
|
|
|
87846
88572
|
if (artifact.path) {
|
|
87847
88573
|
const entry = await readEntry({ root, path: artifact.path, source: "worktree" });
|
|
87848
88574
|
if (entry.kind === "regular") {
|
|
87849
|
-
const bytes = await
|
|
88575
|
+
const bytes = await readFile32(join27(root, artifact.path));
|
|
87850
88576
|
currentEntries.set(artifact.id, Object.freeze({ ...entry, bytes, content: bytes }));
|
|
87851
88577
|
} else {
|
|
87852
88578
|
currentEntries.set(artifact.id, entry);
|
|
@@ -87911,7 +88637,7 @@ async function handleBootstrap({ args: args2, root }) {
|
|
|
87911
88637
|
{ subcommand: "bootstrap" }
|
|
87912
88638
|
);
|
|
87913
88639
|
}
|
|
87914
|
-
const planRaw = await
|
|
88640
|
+
const planRaw = await readFile32(planPath, "utf8");
|
|
87915
88641
|
const adoptionPlan = JSON.parse(planRaw);
|
|
87916
88642
|
const currentEntries = /* @__PURE__ */ new Map();
|
|
87917
88643
|
for (const id of new Set((adoptionPlan.protectedHunks ?? []).map((h) => h.artifactId))) {
|
|
@@ -87923,12 +88649,12 @@ async function handleBootstrap({ args: args2, root }) {
|
|
|
87923
88649
|
if (entry.kind !== "regular") {
|
|
87924
88650
|
throw new ReleaseError("PLAN_STALE", `artifact is no longer a regular file: ${id}`, { id });
|
|
87925
88651
|
}
|
|
87926
|
-
const bytes = await
|
|
88652
|
+
const bytes = await readFile32(join27(root, artifactPath));
|
|
87927
88653
|
currentEntries.set(id, Object.freeze({ ...entry, bytes, content: bytes }));
|
|
87928
88654
|
}
|
|
87929
88655
|
let replacementBytes;
|
|
87930
88656
|
if (action === "replace" && replacementPath) {
|
|
87931
|
-
replacementBytes = await
|
|
88657
|
+
replacementBytes = await readFile32(replacementPath);
|
|
87932
88658
|
}
|
|
87933
88659
|
const updated = await discardBootstrapHunk({
|
|
87934
88660
|
adoptionPlan,
|
|
@@ -87966,7 +88692,7 @@ async function handleResolve({ args: args2, root }) {
|
|
|
87966
88692
|
{ subcommand: "resolve" }
|
|
87967
88693
|
);
|
|
87968
88694
|
}
|
|
87969
|
-
const planRaw = await
|
|
88695
|
+
const planRaw = await readFile32(planPath, "utf8");
|
|
87970
88696
|
const plan = JSON.parse(planRaw);
|
|
87971
88697
|
if (plan.planDigest !== expectedDigest) {
|
|
87972
88698
|
throw new ReleaseError(
|
|
@@ -88334,9 +89060,9 @@ var init_docs = __esm({
|
|
|
88334
89060
|
});
|
|
88335
89061
|
|
|
88336
89062
|
// bin/release-skill-cli.mjs
|
|
88337
|
-
import { basename as basename10, dirname as dirname15, join as
|
|
88338
|
-
import { execFile as
|
|
88339
|
-
import { promisify as
|
|
89063
|
+
import { basename as basename10, dirname as dirname15, join as join28, resolve as resolve27 } from "node:path";
|
|
89064
|
+
import { execFile as execFileCb13 } from "node:child_process";
|
|
89065
|
+
import { promisify as promisify17 } from "node:util";
|
|
88340
89066
|
|
|
88341
89067
|
// src/core/node-version.mjs
|
|
88342
89068
|
function parseNodeMajor(versionString) {
|
|
@@ -88373,11 +89099,11 @@ __name(computeReadinessStatus, "computeReadinessStatus");
|
|
|
88373
89099
|
init_errors();
|
|
88374
89100
|
init_redact();
|
|
88375
89101
|
registerPathRedactor(redactSensitivePaths);
|
|
88376
|
-
var
|
|
89102
|
+
var execFile16 = promisify17(execFileCb13);
|
|
88377
89103
|
var COMMANDS = /* @__PURE__ */ new Set(["help", "setup", "assess", "prepare", "approve", "publish", "reconcile", "verify", "artifacts", "docs"]);
|
|
88378
89104
|
async function checkDependency(command2, versionArgs = ["--version"]) {
|
|
88379
89105
|
try {
|
|
88380
|
-
const { stdout } = await
|
|
89106
|
+
const { stdout } = await execFile16(command2, versionArgs, {
|
|
88381
89107
|
shell: false,
|
|
88382
89108
|
encoding: "utf8",
|
|
88383
89109
|
timeout: 5e3
|
|
@@ -88588,7 +89314,7 @@ if (!command && (args.includes("--version") || args.includes("-v"))) {
|
|
|
88588
89314
|
} else {
|
|
88589
89315
|
const { readFileSync: readFileSync5 } = await import("node:fs");
|
|
88590
89316
|
const { fileURLToPath: fileURLToPath3 } = await import("node:url");
|
|
88591
|
-
const pkgPath =
|
|
89317
|
+
const pkgPath = join28(dirname15(fileURLToPath3(import.meta.url)), "..", "package.json");
|
|
88592
89318
|
pkg = JSON.parse(readFileSync5(pkgPath, "utf8"));
|
|
88593
89319
|
}
|
|
88594
89320
|
if (hasJson) {
|
|
@@ -88709,7 +89435,7 @@ if (!COMMANDS.has(command)) {
|
|
|
88709
89435
|
if (command === "setup") {
|
|
88710
89436
|
const rootIdx = args.indexOf("--root");
|
|
88711
89437
|
const rawRoot = rootIdx !== -1 && args[rootIdx + 1] ? args[rootIdx + 1] : process.cwd();
|
|
88712
|
-
const root =
|
|
89438
|
+
const root = resolve27(rawRoot);
|
|
88713
89439
|
const answersIdx = args.indexOf("--answers");
|
|
88714
89440
|
const answersPath = answersIdx !== -1 && args[answersIdx + 1] ? args[answersIdx + 1] : void 0;
|
|
88715
89441
|
const confirmationIdx = args.indexOf("--confirm-setup");
|
|
@@ -88744,7 +89470,7 @@ if (command === "setup") {
|
|
|
88744
89470
|
if (command === "assess") {
|
|
88745
89471
|
const rootIdx = args.indexOf("--root");
|
|
88746
89472
|
const rawRoot = rootIdx !== -1 && args[rootIdx + 1] ? args[rootIdx + 1] : process.cwd();
|
|
88747
|
-
const root =
|
|
89473
|
+
const root = resolve27(rawRoot);
|
|
88748
89474
|
const offline = args.includes("--offline") || !args.includes("--online");
|
|
88749
89475
|
const outputIdx = args.indexOf("--output");
|
|
88750
89476
|
const output = outputIdx !== -1 && args[outputIdx + 1] ? args[outputIdx + 1] : void 0;
|
|
@@ -88775,7 +89501,7 @@ if (command === "assess") {
|
|
|
88775
89501
|
if (command === "prepare") {
|
|
88776
89502
|
const rootIdx = args.indexOf("--root");
|
|
88777
89503
|
const rawRoot = rootIdx !== -1 && args[rootIdx + 1] ? args[rootIdx + 1] : process.cwd();
|
|
88778
|
-
const root =
|
|
89504
|
+
const root = resolve27(rawRoot);
|
|
88779
89505
|
const offline = args.includes("--offline") || !args.includes("--online");
|
|
88780
89506
|
let targetVersion;
|
|
88781
89507
|
for (const flag of ["--target-version", "--version"]) {
|
|
@@ -88790,9 +89516,9 @@ if (command === "prepare") {
|
|
|
88790
89516
|
const hookCache = !args.includes("--no-hook-cache");
|
|
88791
89517
|
const production = args.includes("--production");
|
|
88792
89518
|
const outputIdx = args.indexOf("--output");
|
|
88793
|
-
const output = outputIdx !== -1 && args[outputIdx + 1] ?
|
|
89519
|
+
const output = outputIdx !== -1 && args[outputIdx + 1] ? resolve27(args[outputIdx + 1]) : void 0;
|
|
88794
89520
|
const runDirIdx = args.indexOf("--run-dir");
|
|
88795
|
-
const runDir = runDirIdx !== -1 && args[runDirIdx + 1] ?
|
|
89521
|
+
const runDir = runDirIdx !== -1 && args[runDirIdx + 1] ? resolve27(args[runDirIdx + 1]) : void 0;
|
|
88796
89522
|
try {
|
|
88797
89523
|
const { prepareRelease: prepareRelease2 } = await init_prepare().then(() => prepare_exports);
|
|
88798
89524
|
const { readFile: readFileFs } = await import("node:fs/promises");
|
|
@@ -88845,7 +89571,7 @@ if (command === "approve") {
|
|
|
88845
89571
|
const actorIdx = args.indexOf("--actor");
|
|
88846
89572
|
const actor = actorIdx !== -1 && args[actorIdx + 1] ? args[actorIdx + 1] : void 0;
|
|
88847
89573
|
const outputIdx = args.indexOf("--output");
|
|
88848
|
-
const outputPath = outputIdx !== -1 && args[outputIdx + 1] ?
|
|
89574
|
+
const outputPath = outputIdx !== -1 && args[outputIdx + 1] ? resolve27(args[outputIdx + 1]) : void 0;
|
|
88849
89575
|
if (!planPath || !expectedDigest || !actor) {
|
|
88850
89576
|
const msg = "approve requires --plan <path>, --digest <sha256>, and --actor <name>";
|
|
88851
89577
|
if (hasJson) {
|
|
@@ -88857,10 +89583,10 @@ if (command === "approve") {
|
|
|
88857
89583
|
}
|
|
88858
89584
|
try {
|
|
88859
89585
|
const { approvePlan: approvePlan2 } = await init_approve().then(() => approve_exports);
|
|
88860
|
-
const resolvedPlanPath =
|
|
89586
|
+
const resolvedPlanPath = resolve27(planPath);
|
|
88861
89587
|
const planDir = dirname15(resolvedPlanPath);
|
|
88862
89588
|
const releaseDir = basename10(planDir) === "plans" && basename10(resolvedPlanPath) === `${expectedDigest}.json` ? dirname15(planDir) : planDir;
|
|
88863
|
-
const approvalPath = outputPath ??
|
|
89589
|
+
const approvalPath = outputPath ?? join28(releaseDir, "approval-record.json");
|
|
88864
89590
|
const record = await approvePlan2({ planPath, expectedDigest, actor, outputPath: approvalPath });
|
|
88865
89591
|
if (hasJson) {
|
|
88866
89592
|
console.log(JSON.stringify(record, null, 2));
|
|
@@ -88887,13 +89613,13 @@ if (command === "approve") {
|
|
|
88887
89613
|
if (command === "reconcile") {
|
|
88888
89614
|
const rootIdx = args.indexOf("--root");
|
|
88889
89615
|
const rawRoot = rootIdx !== -1 && args[rootIdx + 1] ? args[rootIdx + 1] : process.cwd();
|
|
88890
|
-
const root =
|
|
89616
|
+
const root = resolve27(rawRoot);
|
|
88891
89617
|
const planIdx = args.indexOf("--plan");
|
|
88892
|
-
const planPath = planIdx !== -1 && args[planIdx + 1] ?
|
|
89618
|
+
const planPath = planIdx !== -1 && args[planIdx + 1] ? resolve27(args[planIdx + 1]) : void 0;
|
|
88893
89619
|
const runIdx = args.indexOf("--run");
|
|
88894
|
-
const runPath = runIdx !== -1 && args[runIdx + 1] ?
|
|
89620
|
+
const runPath = runIdx !== -1 && args[runIdx + 1] ? resolve27(args[runIdx + 1]) : void 0;
|
|
88895
89621
|
const approvalIdx = args.indexOf("--approval");
|
|
88896
|
-
const approvalPath = approvalIdx !== -1 && args[approvalIdx + 1] ?
|
|
89622
|
+
const approvalPath = approvalIdx !== -1 && args[approvalIdx + 1] ? resolve27(args[approvalIdx + 1]) : void 0;
|
|
88897
89623
|
const confirmationIdx = args.indexOf("--confirm-production");
|
|
88898
89624
|
const productionConfirmation = confirmationIdx !== -1 && args[confirmationIdx + 1] ? args[confirmationIdx + 1] : void 0;
|
|
88899
89625
|
if (!planPath || !runPath) {
|
|
@@ -88952,11 +89678,11 @@ if (command === "reconcile") {
|
|
|
88952
89678
|
if (command === "verify") {
|
|
88953
89679
|
const rootIdx = args.indexOf("--root");
|
|
88954
89680
|
const rawRoot = rootIdx !== -1 && args[rootIdx + 1] ? args[rootIdx + 1] : process.cwd();
|
|
88955
|
-
const root =
|
|
89681
|
+
const root = resolve27(rawRoot);
|
|
88956
89682
|
const planIdx = args.indexOf("--plan");
|
|
88957
|
-
const planPath = planIdx !== -1 && args[planIdx + 1] ?
|
|
89683
|
+
const planPath = planIdx !== -1 && args[planIdx + 1] ? resolve27(args[planIdx + 1]) : void 0;
|
|
88958
89684
|
const runIdx = args.indexOf("--run");
|
|
88959
|
-
const runPath = runIdx !== -1 && args[runIdx + 1] ?
|
|
89685
|
+
const runPath = runIdx !== -1 && args[runIdx + 1] ? resolve27(args[runIdx + 1]) : void 0;
|
|
88960
89686
|
const verificationGatesAuthorized = args.includes("--acknowledge-gate-side-effects");
|
|
88961
89687
|
if (!planPath || !runPath) {
|
|
88962
89688
|
const msg = "verify requires --plan <path> and --run <path>";
|
|
@@ -89012,11 +89738,11 @@ if (command === "verify") {
|
|
|
89012
89738
|
if (command === "publish") {
|
|
89013
89739
|
const rootIdx = args.indexOf("--root");
|
|
89014
89740
|
const rawRoot = rootIdx !== -1 && args[rootIdx + 1] ? args[rootIdx + 1] : process.cwd();
|
|
89015
|
-
const root =
|
|
89741
|
+
const root = resolve27(rawRoot);
|
|
89016
89742
|
const planIdx = args.indexOf("--plan");
|
|
89017
|
-
const planPath = planIdx !== -1 && args[planIdx + 1] ?
|
|
89743
|
+
const planPath = planIdx !== -1 && args[planIdx + 1] ? resolve27(args[planIdx + 1]) : void 0;
|
|
89018
89744
|
const approvalIdx = args.indexOf("--approval");
|
|
89019
|
-
const approvalPath = approvalIdx !== -1 && args[approvalIdx + 1] ?
|
|
89745
|
+
const approvalPath = approvalIdx !== -1 && args[approvalIdx + 1] ? resolve27(args[approvalIdx + 1]) : void 0;
|
|
89020
89746
|
const confirmationIdx = args.indexOf("--confirm-production");
|
|
89021
89747
|
const productionConfirmation = confirmationIdx !== -1 && args[confirmationIdx + 1] ? args[confirmationIdx + 1] : void 0;
|
|
89022
89748
|
if (!planPath || !approvalPath || !productionConfirmation) {
|
|
@@ -89075,9 +89801,9 @@ if (command === "publish") {
|
|
|
89075
89801
|
if (command === "artifacts") {
|
|
89076
89802
|
const rootIdx = args.indexOf("--root");
|
|
89077
89803
|
const rawRoot = rootIdx !== -1 && args[rootIdx + 1] ? args[rootIdx + 1] : process.cwd();
|
|
89078
|
-
const root =
|
|
89804
|
+
const root = resolve27(rawRoot);
|
|
89079
89805
|
const outputIdx = args.indexOf("--output");
|
|
89080
|
-
const output = outputIdx !== -1 && args[outputIdx + 1] ?
|
|
89806
|
+
const output = outputIdx !== -1 && args[outputIdx + 1] ? resolve27(args[outputIdx + 1]) : void 0;
|
|
89081
89807
|
const subcommand = positional[1] ?? "status";
|
|
89082
89808
|
try {
|
|
89083
89809
|
const { runArtifactsCommand: runArtifactsCommand2 } = await Promise.resolve().then(() => (init_artifacts(), artifacts_exports));
|
|
@@ -89144,7 +89870,7 @@ if (command === "docs") {
|
|
|
89144
89870
|
);
|
|
89145
89871
|
}
|
|
89146
89872
|
}
|
|
89147
|
-
const root =
|
|
89873
|
+
const root = resolve27(rawRoot);
|
|
89148
89874
|
const valuedDocsFlags = /* @__PURE__ */ new Set(["--root", "--unit", "--confirm-refresh"]);
|
|
89149
89875
|
const booleanDocsFlags = /* @__PURE__ */ new Set(["--json", "--write", "--ack-local-document-write"]);
|
|
89150
89876
|
let docsSubcommand;
|