@adea-ai/app-framework-release-tools 0.2.0 → 0.3.0

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/dist/index.js CHANGED
@@ -17,12 +17,15 @@ var __export = (target, all) => {
17
17
  // src/index.ts
18
18
  var exports_src = {};
19
19
  __export(exports_src, {
20
+ createDailyNativeReceipt: () => createDailyNativeReceipt,
20
21
  createGitHubPromotionProvider: () => createGitHubPromotionProvider,
21
22
  createGitHubReleasePublisher: () => createGitHubReleasePublisher,
22
23
  createMacosDmg: () => createMacosDmg,
24
+ desktopDailyProfile: () => desktopDailyProfile,
23
25
  fileIdentity: () => fileIdentity2,
24
26
  finalizeReleasePleaseDraft: () => finalizeReleasePleaseDraft,
25
27
  inspectStagedStep: () => inspectStagedStep,
28
+ planDailyReleaseMatrix: () => planDailyReleaseMatrix,
26
29
  planQualificationRun: () => planQualificationRun2,
27
30
  planReleaseAssets: () => planReleaseAssets2,
28
31
  publishFrameworkPackage: () => publishFrameworkPackage,
@@ -39,6 +42,7 @@ __export(exports_src, {
39
42
  stageBuildStep: () => stageBuildStep,
40
43
  stagePlatformArtifacts: () => stagePlatformArtifacts,
41
44
  stageReleaseDescriptors: () => stageReleaseDescriptors,
45
+ verifyDailyReleaseMatrix: () => verifyDailyReleaseMatrix,
42
46
  verifyImage: () => verifyImage,
43
47
  writeDescriptors: () => writeDescriptors
44
48
  });
@@ -1635,6 +1639,9 @@ var RELEASE_VERSION = /^\d+\.\d+\.\d+(?:-dev\.\d+)?$/;
1635
1639
  function isReleaseVersion(value) {
1636
1640
  return typeof value === "string" && value.length <= MAX_RELEASE_VERSION_LENGTH && RELEASE_VERSION.test(value);
1637
1641
  }
1642
+ function isReleaseTag(value) {
1643
+ return typeof value === "string" && value.startsWith("v") && isReleaseVersion(value.slice(1));
1644
+ }
1638
1645
 
1639
1646
  // ../../src/release/release-promotion.ts
1640
1647
  function order(a, b) {
@@ -3136,6 +3143,264 @@ var stageReleaseDescriptorsEffect = (options) => Effect15.gen(function* () {
3136
3143
  });
3137
3144
  var writeDescriptors = (directory, signed) => runReleaseLibrary(provideLibraryPorts()(writeDescriptorsEffect(directory, signed)));
3138
3145
  var stageReleaseDescriptors = (options) => runReleaseLibrary(provideLibraryPorts({ run: planGitHubRun(options.env, options.run) })(stageReleaseDescriptorsEffect(options)));
3146
+ // src/library/daily-matrix.ts
3147
+ import { join as join7 } from "path";
3148
+ import { Effect as Effect16 } from "effect";
3149
+
3150
+ // src/library/daily-native-evidence.ts
3151
+ var digest = (value) => typeof value === "string" && /^sha256:[a-f0-9]{64}$/.test(value);
3152
+ var record = (value, keys) => isRecord(value) && hasExactOwnKeys(value, keys);
3153
+ function assertDailyIdentity(identity) {
3154
+ if (!isReleaseTag(identity.tag) || !isGitSha(identity.sourceSha) || identity.workflowSha !== identity.sourceSha || typeof identity.runId !== "string" || !/^[1-9]\d{0,19}$/.test(identity.runId) || !Number.isSafeInteger(identity.runAttempt) || identity.runAttempt <= 0)
3155
+ throw new Error("Invalid exact Daily identity");
3156
+ }
3157
+ function validArtifact(value) {
3158
+ return record(value, ["name", "size", "digest"]) && typeof value.name === "string" && typeof value.size === "number" && Number.isSafeInteger(value.size) && value.size > 0 && digest(value.digest);
3159
+ }
3160
+ function originMatches(value, payloadName) {
3161
+ if (record(value, ["kind", "sourceSha"]))
3162
+ return value.kind === "published-installer" && isGitSha(value.sourceSha);
3163
+ return record(value, ["kind", "sourceSha", "payload"]) && value.kind === "private-from-verified-payload" && isGitSha(value.sourceSha) && validArtifact(value.payload) && value.payload.name === payloadName;
3164
+ }
3165
+ function observationsMatch(value, { identity, check, baselineNames }) {
3166
+ const version = identity.tag.slice(1);
3167
+ if (!record(value, check.format === "command" ? ["install", "command"] : ["install", "launch", "upgrade"]) || !record(value.install, ["version"]) || value.install.version !== version)
3168
+ return false;
3169
+ if (check.format === "command") {
3170
+ const cmd = value.command;
3171
+ return record(cmd, ["version", "probesPassed", "serviceStarted", "serviceStopped"]) && cmd.version === version && cmd.probesPassed === true && cmd.serviceStarted === true && cmd.serviceStopped === (check.platform === "windows-x64" ? "process-tree" : "sigterm");
3172
+ }
3173
+ const { launch, upgrade } = value;
3174
+ return record(launch, ["version", "ready"]) && launch.version === version && launch.ready === true && record(upgrade, [
3175
+ "baselineTag",
3176
+ "baselineAsset",
3177
+ "baselineOrigin",
3178
+ "baselineVersion",
3179
+ "upgradedVersion",
3180
+ "ready",
3181
+ "fixtureBefore",
3182
+ "fixtureAfter"
3183
+ ]) && isReleaseTag(upgrade.baselineTag) && versionLessThan(upgrade.baselineTag, identity.tag) && validArtifact(upgrade.baselineAsset) && upgrade.baselineAsset.name === baselineNames(upgrade.baselineTag).installer && originMatches(upgrade.baselineOrigin, baselineNames(upgrade.baselineTag).payload) && upgrade.baselineVersion === upgrade.baselineTag.slice(1) && upgrade.upgradedVersion === version && upgrade.ready === true && digest(upgrade.fixtureBefore) && upgrade.fixtureAfter === upgrade.fixtureBefore;
3184
+ }
3185
+ function validateDailyNativeEvidence(input, schema, context) {
3186
+ const { appId, identity, check, assets } = context;
3187
+ const [os, arch] = platformTargets[check.platform];
3188
+ if (!record(input, [
3189
+ "schema",
3190
+ "appId",
3191
+ "profile",
3192
+ "tag",
3193
+ "sourceSha",
3194
+ "workflowSha",
3195
+ "runId",
3196
+ "runAttempt",
3197
+ "check",
3198
+ "platform",
3199
+ "format",
3200
+ "host",
3201
+ "assets",
3202
+ "observations"
3203
+ ]) || input.schema !== schema || input.appId !== appId || input.profile !== "desktop-v1" || input.tag !== identity.tag || input.sourceSha !== identity.sourceSha || input.workflowSha !== identity.workflowSha || input.runId !== identity.runId || input.runAttempt !== identity.runAttempt || input.check !== check.name || input.platform !== check.platform || input.format !== check.format || !record(input.host, ["os", "arch"]) || input.host.os !== os || input.host.arch !== arch || !Array.isArray(input.assets) || input.assets.length !== assets.length)
3204
+ throw new Error(`Native receipt identity or result mismatch: ${check.name}`);
3205
+ for (const expected of assets) {
3206
+ const matches = input.assets.filter((item) => validArtifact(item) && item.name === expected.name);
3207
+ if (matches.length !== 1 || matches[0].size !== expected.size || matches[0].digest !== expected.digest)
3208
+ throw new Error(`Native receipt does not qualify staged bytes: ${check.name} / ${expected.name}`);
3209
+ }
3210
+ if (!observationsMatch(input.observations, context))
3211
+ throw new Error(`Missing or invalid native observations: ${check.name}`);
3212
+ return { host: { os, arch }, observations: input.observations };
3213
+ }
3214
+
3215
+ // src/library/daily-matrix.ts
3216
+ var desktopDailyProfile = "desktop-v1";
3217
+ var platforms = [
3218
+ "macos-arm64",
3219
+ "windows-x64",
3220
+ "linux-x64"
3221
+ ];
3222
+ var receiptLimit = 64 * 1024;
3223
+ function requireThat(ok, message) {
3224
+ if (!ok)
3225
+ throw new Error(message);
3226
+ }
3227
+ function planDailyReleaseMatrix(config, tag) {
3228
+ requireThat(isRecord(config) && config.dailyReleaseProfile === desktopDailyProfile && typeof config.appId === "string", "Missing supported Daily release profile");
3229
+ const parsed = parseReleaseConfig(config);
3230
+ const requirements = parsed.requirements(tag);
3231
+ const checks = [];
3232
+ for (const platform of platforms) {
3233
+ const pair = requirements.platforms[platform];
3234
+ requireThat(pair?.length === 2, `Expected installer and updater archive for ${platform}`);
3235
+ const [installer, archive] = pair;
3236
+ const suffix = platform === "macos-arm64" ? ".dmg" : platform === "windows-x64" ? "-Setup.zip" : "-Setup.tar.gz";
3237
+ requireThat(installer.endsWith(suffix) && archive.endsWith(".tar.zst"), `Unexpected desktop installer or updater format for ${platform}`);
3238
+ const format = platform === "macos-arm64" ? "dmg" : platform === "windows-x64" ? "windows-setup" : "portable-linux";
3239
+ checks.push({ name: `installer-${platform}`, platform, format, assets: pair });
3240
+ for (const command of parsed.commandArtifacts) {
3241
+ const name = requirements.commandArtifacts?.[command.kind]?.[platform];
3242
+ requireThat(name, `Missing command archive for ${platform}`);
3243
+ checks.push({
3244
+ name: `command-${command.kind}-${platform}`,
3245
+ platform,
3246
+ format: "command",
3247
+ assets: [name]
3248
+ });
3249
+ }
3250
+ }
3251
+ const linux = "linux-x64";
3252
+ const base = requirements.platforms[linux][1].slice(0, -".tar.zst".length);
3253
+ checks.push({ name: "deb-linux-x64", platform: linux, format: "deb", assets: [base + ".deb"] }, {
3254
+ name: "appimage-linux-x64",
3255
+ platform: linux,
3256
+ format: "appimage",
3257
+ assets: [base + ".AppImage"]
3258
+ });
3259
+ const names = checks.flatMap((check) => check.assets);
3260
+ discoveryPolicies(config, tag);
3261
+ const all = [...names, ...requirements.releaseAssets];
3262
+ requireThat(new Set(all).size === all.length, "Daily release assets are not unique");
3263
+ return { appId: config.appId, profile: desktopDailyProfile, assets: all, checks };
3264
+ }
3265
+ function priorDailyInstallerNames(config, tag, check) {
3266
+ const plan = planDailyReleaseMatrix(config, tag);
3267
+ return {
3268
+ installer: plan.checks.find((entry) => entry.name === check.name)?.assets[0],
3269
+ payload: plan.checks.find((entry) => entry.name === `installer-${check.platform}`)?.assets[1]
3270
+ };
3271
+ }
3272
+ function exactDirectory(root, names) {
3273
+ return Effect16.gen(function* () {
3274
+ const fs = yield* ReleaseFs;
3275
+ const stat = yield* step(() => fs.lstat(root));
3276
+ if (!stat.isDirectory() || stat.isSymbolicLink())
3277
+ return yield* fail("Expected real matrix input directory");
3278
+ const entries = yield* step(() => fs.readdir(root, { withFileTypes: true }));
3279
+ const expected = new Set(names);
3280
+ if (entries.length !== expected.size || entries.some((e) => !e.isFile() || !expected.has(e.name)))
3281
+ return yield* fail("Matrix directory must contain exactly the required regular files");
3282
+ });
3283
+ }
3284
+ function readNativeReceipt(path, label) {
3285
+ return Effect16.gen(function* () {
3286
+ const fs = yield* ReleaseFs;
3287
+ const stat = yield* step(() => fs.lstat(path));
3288
+ if (!stat.isFile() || stat.isSymbolicLink() || stat.size < 1 || stat.size > receiptLimit)
3289
+ return yield* fail(`Invalid native receipt size or type: ${label}`);
3290
+ const { file, before } = yield* Effect16.acquireRelease(step(() => openUnchangedFile(path, stat, "Native receipt changed before opening")), ({ file: opened }) => Effect16.promise(() => opened.close().catch(() => {
3291
+ return;
3292
+ })));
3293
+ const data = yield* step(async () => {
3294
+ const bytes = Buffer.alloc(before.size);
3295
+ let offset = 0;
3296
+ while (offset < bytes.length) {
3297
+ const { bytesRead } = await file.read(bytes, offset, bytes.length - offset, offset);
3298
+ if (!bytesRead)
3299
+ throw new Error("Native receipt changed during read");
3300
+ offset += bytesRead;
3301
+ }
3302
+ const after = await file.stat();
3303
+ if (!sameFile(before, after) || before.ctimeMs !== after.ctimeMs)
3304
+ throw new Error("Native receipt changed during read");
3305
+ return bytes.toString("utf8");
3306
+ });
3307
+ return yield* attempt(() => {
3308
+ try {
3309
+ return JSON.parse(data);
3310
+ } catch {
3311
+ throw new Error(`Invalid native receipt JSON: ${label}`);
3312
+ }
3313
+ });
3314
+ }).pipe(Effect16.scoped);
3315
+ }
3316
+ var verifyDailyReleaseMatrixEffect = (options) => Effect16.gen(function* () {
3317
+ const { config, identity, artifacts, receipts } = options;
3318
+ const { tag } = identity;
3319
+ yield* attempt(() => assertDailyIdentity(identity));
3320
+ const matrix = yield* attempt(() => planDailyReleaseMatrix(config, tag));
3321
+ yield* exactDirectory(artifacts, matrix.assets);
3322
+ yield* exactDirectory(receipts, matrix.checks.map((c) => c.name + ".json"));
3323
+ const inventory = new Map;
3324
+ for (const name of matrix.assets)
3325
+ inventory.set(name, yield* fileIdentityEffect(join7(artifacts, name), name));
3326
+ for (const check of matrix.checks) {
3327
+ const r = yield* readNativeReceipt(join7(receipts, check.name + ".json"), check.name);
3328
+ yield* attempt(() => validateDailyNativeEvidence(r, "framework/daily-native-receipt/v2", {
3329
+ appId: matrix.appId,
3330
+ identity,
3331
+ check,
3332
+ assets: check.assets.map((name) => inventory.get(name)),
3333
+ baselineNames: (priorTag) => priorDailyInstallerNames(config, priorTag, check)
3334
+ }));
3335
+ }
3336
+ return {
3337
+ profile: matrix.profile,
3338
+ appId: matrix.appId,
3339
+ identity,
3340
+ assets: [...inventory.values()]
3341
+ };
3342
+ });
3343
+ function verifyDailyReleaseMatrix(options) {
3344
+ return runReleaseLibrary(provideLibraryPorts()(verifyDailyReleaseMatrixEffect(options)));
3345
+ }
3346
+ // src/library/daily-native-receipt.ts
3347
+ import { join as join8 } from "path";
3348
+ import { Effect as Effect17 } from "effect";
3349
+ var createDailyNativeReceiptEffect = (options, worker) => Effect17.gen(function* () {
3350
+ const { config, identity, artifacts, checkName, report } = options;
3351
+ yield* attempt(() => assertDailyIdentity(identity));
3352
+ const matrix = yield* attempt(() => planDailyReleaseMatrix(config, identity.tag));
3353
+ const check = matrix.checks.find(({ name }) => name === checkName);
3354
+ if (!check)
3355
+ return yield* fail("Unknown Daily native check");
3356
+ const [os, arch] = platformTargets[check.platform];
3357
+ if (worker.os !== os || worker.arch !== arch)
3358
+ return yield* fail(`Daily native check requires ${check.platform}`);
3359
+ const fs = yield* ReleaseFs;
3360
+ const dir = yield* step(() => fs.lstat(artifacts));
3361
+ if (!dir.isDirectory() || dir.isSymbolicLink())
3362
+ return yield* fail("Expected real native artifact directory");
3363
+ const assets = yield* Effect17.forEach(check.assets, (name) => fileIdentityEffect(join8(artifacts, name), name));
3364
+ const evidence = yield* attempt(() => validateDailyNativeEvidence(report, "framework/daily-native-job/v1", {
3365
+ appId: matrix.appId,
3366
+ identity,
3367
+ check,
3368
+ assets,
3369
+ baselineNames: (tag) => priorDailyInstallerNames(config, tag, check)
3370
+ }));
3371
+ if ("upgrade" in evidence.observations) {
3372
+ if (!options.baselineArtifacts)
3373
+ return yield* fail("Daily desktop check requires the exact baseline installer");
3374
+ const baselineDirectory = options.baselineArtifacts;
3375
+ const info = yield* step(() => fs.lstat(baselineDirectory));
3376
+ if (!info.isDirectory() || info.isSymbolicLink())
3377
+ return yield* fail("Expected real native baseline directory");
3378
+ const { baselineAsset, baselineOrigin } = evidence.observations.upgrade;
3379
+ const proofFiles = baselineOrigin.kind === "private-from-verified-payload" ? [baselineAsset, baselineOrigin.payload] : [baselineAsset];
3380
+ for (const expected of proofFiles) {
3381
+ const observed = yield* fileIdentityEffect(join8(baselineDirectory, expected.name), expected.name);
3382
+ if (observed.size !== expected.size || observed.digest !== expected.digest)
3383
+ return yield* fail("Daily desktop baseline installer or prior payload differs from native observations");
3384
+ }
3385
+ }
3386
+ return {
3387
+ ...identity,
3388
+ ...evidence,
3389
+ schema: "framework/daily-native-receipt/v2",
3390
+ appId: matrix.appId,
3391
+ profile: matrix.profile,
3392
+ check: check.name,
3393
+ platform: check.platform,
3394
+ format: check.format,
3395
+ assets
3396
+ };
3397
+ });
3398
+ function createDailyNativeReceipt(options) {
3399
+ return runReleaseLibrary(provideLibraryPorts()(createDailyNativeReceiptEffect(options, {
3400
+ os: process.platform,
3401
+ arch: process.arch
3402
+ })));
3403
+ }
3139
3404
  // src/library/macos-dmg.ts
3140
3405
  import { execFileSync } from "child_process";
3141
3406
  import {
@@ -3147,8 +3412,8 @@ import {
3147
3412
  rmSync,
3148
3413
  symlinkSync
3149
3414
  } from "fs";
3150
- import { basename as basename4, dirname, join as join7, resolve as resolve6 } from "path";
3151
- import { Context as Context2, Effect as Effect16 } from "effect";
3415
+ import { basename as basename4, dirname, join as join9, resolve as resolve6 } from "path";
3416
+ import { Context as Context2, Effect as Effect18 } from "effect";
3152
3417
 
3153
3418
  // ../../src/release/macos-dmg.ts
3154
3419
  var MIB = 1024 * 1024;
@@ -3179,7 +3444,7 @@ function treeSize(root) {
3179
3444
  logicalBytes += info.size;
3180
3445
  else if (info.isDirectory())
3181
3446
  for (const name of readdirSync(path))
3182
- pending.push(join7(path, name));
3447
+ pending.push(join9(path, name));
3183
3448
  else if (!info.isSymbolicLink())
3184
3449
  throw new Error("Unsupported disk image entry");
3185
3450
  if (!Number.isSafeInteger(logicalBytes))
@@ -3187,16 +3452,16 @@ function treeSize(root) {
3187
3452
  }
3188
3453
  return { logicalBytes, entries };
3189
3454
  }
3190
- var verifyImageEffect = (image) => Effect16.gen(function* () {
3455
+ var verifyImageEffect = (image) => Effect18.gen(function* () {
3191
3456
  const host = yield* MacosHost;
3192
3457
  for (let tries = 1;; tries++) {
3193
- const verified = yield* attempt(() => host.run("/usr/bin/hdiutil", ["verify", image])).pipe(Effect16.as(true), Effect16.catchIf(() => tries < 6, () => Effect16.succeed(false)));
3458
+ const verified = yield* attempt(() => host.run("/usr/bin/hdiutil", ["verify", image])).pipe(Effect18.as(true), Effect18.catchIf(() => tries < 6, () => Effect18.succeed(false)));
3194
3459
  if (verified)
3195
3460
  return;
3196
3461
  host.wait(5000 * 2 ** (tries - 1));
3197
3462
  }
3198
3463
  });
3199
- var createMacosDmgEffect = (options) => Effect16.gen(function* () {
3464
+ var createMacosDmgEffect = (options) => Effect18.gen(function* () {
3200
3465
  const host = yield* MacosHost;
3201
3466
  if (host.platform !== "darwin")
3202
3467
  return yield* fail("Disk image creation requires macOS");
@@ -3205,11 +3470,11 @@ var createMacosDmgEffect = (options) => Effect16.gen(function* () {
3205
3470
  const info = yield* attempt(() => lstatSync(app));
3206
3471
  if (!app.endsWith(".app") || !info.isDirectory() || info.isSymbolicLink() || !output.endsWith(".dmg"))
3207
3472
  return yield* fail("Invalid disk image paths");
3208
- const staging = yield* Effect16.acquireRelease(attempt(() => mkdtempSync(join7(dirname(output), ".framework-dmg-"))), (path) => Effect16.sync(() => rmSync(path, { recursive: true, force: true })));
3209
- const payload = join7(staging, "payload"), image = join7(staging, "result.dmg");
3473
+ const staging = yield* Effect18.acquireRelease(attempt(() => mkdtempSync(join9(dirname(output), ".framework-dmg-"))), (path) => Effect18.sync(() => rmSync(path, { recursive: true, force: true })));
3474
+ const payload = join9(staging, "payload"), image = join9(staging, "result.dmg");
3210
3475
  yield* attempt(() => mkdirSync(payload));
3211
- yield* attempt(() => host.run("/usr/bin/ditto", [app, join7(payload, basename4(app))]));
3212
- yield* attempt(() => symlinkSync("/Applications", join7(payload, "Applications")));
3476
+ yield* attempt(() => host.run("/usr/bin/ditto", [app, join9(payload, basename4(app))]));
3477
+ yield* attempt(() => symlinkSync("/Applications", join9(payload, "Applications")));
3213
3478
  const capacityMiB = yield* attempt(() => dmgCapacityMiB(treeSize(payload)));
3214
3479
  yield* attempt(() => host.run("/usr/bin/hdiutil", [
3215
3480
  "create",
@@ -3226,31 +3491,31 @@ var createMacosDmgEffect = (options) => Effect16.gen(function* () {
3226
3491
  yield* verifyImageEffect(image);
3227
3492
  yield* attempt(() => linkSync(image, output));
3228
3493
  return { capacityMiB };
3229
- }).pipe(Effect16.scoped);
3494
+ }).pipe(Effect18.scoped);
3230
3495
  function verifyImage(image, io = liveHost) {
3231
- runReleaseLibrarySync(verifyImageEffect(image).pipe(Effect16.provideService(MacosHost, {
3496
+ runReleaseLibrarySync(verifyImageEffect(image).pipe(Effect18.provideService(MacosHost, {
3232
3497
  run: (command, args) => io.run(command, args),
3233
3498
  wait: (milliseconds) => io.wait(milliseconds),
3234
3499
  platform: process.platform
3235
3500
  })));
3236
3501
  }
3237
3502
  function createMacosDmg(options) {
3238
- return runReleaseLibrarySync(createMacosDmgEffect(options).pipe(Effect16.provideService(MacosHost, liveHost)));
3503
+ return runReleaseLibrarySync(createMacosDmgEffect(options).pipe(Effect18.provideService(MacosHost, liveHost)));
3239
3504
  }
3240
3505
  // src/library/qualification-run.ts
3241
- import { Effect as Effect19 } from "effect";
3506
+ import { Effect as Effect21 } from "effect";
3242
3507
 
3243
3508
  // src/library/local-release.ts
3244
3509
  import { createHash as createHash8 } from "crypto";
3245
3510
  import { constants as constants3 } from "fs";
3246
- import { dirname as dirname2, join as join9, resolve as resolve8 } from "path";
3247
- import { Cause as Cause2, Effect as Effect18, Exit as Exit3 } from "effect";
3511
+ import { dirname as dirname2, join as join11, resolve as resolve8 } from "path";
3512
+ import { Cause as Cause2, Effect as Effect20, Exit as Exit3 } from "effect";
3248
3513
 
3249
3514
  // ../../src/native/native-rename.ts
3250
3515
  import { randomUUID } from "crypto";
3251
3516
  import { mkdir as mkdir3, readFile as readFile5, rm as rm3, writeFile as writeFile3 } from "fs/promises";
3252
3517
  import { dlopen, FFIType, ptr } from "bun:ffi";
3253
- import { join as join8 } from "path";
3518
+ import { join as join10 } from "path";
3254
3519
 
3255
3520
  // ../../src/native/canonical-path.ts
3256
3521
  import { isAbsolute as isAbsolute2, resolve as resolve7 } from "path";
@@ -3329,8 +3594,8 @@ async function probeDirectoryExchange(parent, exchange = exchangeDirectories) {
3329
3594
  if (!isCanonicalPath(parent))
3330
3595
  throw new Error("Invalid directory exchange probe parent");
3331
3596
  const id = randomUUID();
3332
- const first = join8(parent, `.framework-exchange-probe-${id}-a`);
3333
- const second = join8(parent, `.framework-exchange-probe-${id}-b`);
3597
+ const first = join10(parent, `.framework-exchange-probe-${id}-a`);
3598
+ const second = join10(parent, `.framework-exchange-probe-${id}-b`);
3334
3599
  const marker = "exchange-probe";
3335
3600
  const firstValue = `${id}:first`;
3336
3601
  const secondValue = `${id}:second`;
@@ -3341,12 +3606,12 @@ async function probeDirectoryExchange(parent, exchange = exchangeDirectories) {
3341
3606
  firstCreated = true;
3342
3607
  await mkdir3(second, { mode: 448 });
3343
3608
  secondCreated = true;
3344
- await writeFile3(join8(first, marker), firstValue, { flag: "wx", mode: 384 });
3345
- await writeFile3(join8(second, marker), secondValue, { flag: "wx", mode: 384 });
3609
+ await writeFile3(join10(first, marker), firstValue, { flag: "wx", mode: 384 });
3610
+ await writeFile3(join10(second, marker), secondValue, { flag: "wx", mode: 384 });
3346
3611
  exchange(first, second);
3347
3612
  const [firstAfter, secondAfter] = await Promise.all([
3348
- readFile5(join8(first, marker), "utf8"),
3349
- readFile5(join8(second, marker), "utf8")
3613
+ readFile5(join10(first, marker), "utf8"),
3614
+ readFile5(join10(second, marker), "utf8")
3350
3615
  ]);
3351
3616
  if (firstAfter !== secondValue || secondAfter !== firstValue)
3352
3617
  throw new Error("Directory exchange did not exchange both probe trees");
@@ -3412,7 +3677,7 @@ function createFeedReleaseCutProvider(options) {
3412
3677
 
3413
3678
  // src/library/feed-state.ts
3414
3679
  import { createHash as createHash7 } from "crypto";
3415
- import { Effect as Effect17 } from "effect";
3680
+ import { Effect as Effect19 } from "effect";
3416
3681
 
3417
3682
  // ../../src/shared/discard-stream.ts
3418
3683
  function discardStream(stream) {
@@ -3572,11 +3837,11 @@ var json = (bytes) => {
3572
3837
  throw new Error("Invalid release feed response");
3573
3838
  }
3574
3839
  };
3575
- var feedObject = (feed, path, maximum) => Effect17.gen(function* () {
3840
+ var feedObject = (feed, path, maximum) => Effect19.gen(function* () {
3576
3841
  const { fetch: fetch2 } = yield* ReleaseFetch;
3577
3842
  return yield* step(() => readFeedObject(feed, path, fetch2, maximum));
3578
3843
  });
3579
- var readFeedLedgerEffect = (feed) => Effect17.gen(function* () {
3844
+ var readFeedLedgerEffect = (feed) => Effect19.gen(function* () {
3580
3845
  const bytes = yield* feedObject(feed, "index.json", MAX_LEDGER_BYTES);
3581
3846
  const ledger = bytes ? yield* attempt(() => parseReleaseLedger(json(bytes), feed.app)) : null;
3582
3847
  if (ledger && ledger.releases.length > 0)
@@ -3588,7 +3853,7 @@ var readFeedLedgerEffect = (feed) => Effect17.gen(function* () {
3588
3853
  }
3589
3854
  return ledger ?? { schema: 1, app: feed.app, releases: [] };
3590
3855
  });
3591
- var readFeedReleaseEffect = (feed, tag) => Effect17.gen(function* () {
3856
+ var readFeedReleaseEffect = (feed, tag) => Effect19.gen(function* () {
3592
3857
  const bytes = yield* feedObject(feed, `${tag}/release.json`, MAX_RELEASE_BYTES);
3593
3858
  if (!bytes)
3594
3859
  return null;
@@ -3638,10 +3903,10 @@ class ReleaseFeedSnapshotChanged extends Error {
3638
3903
  var snapshotChanged = step(async () => {
3639
3904
  throw new ReleaseFeedSnapshotChanged;
3640
3905
  });
3641
- var verifyFeedReleaseEffect = (options) => Effect17.gen(function* () {
3906
+ var verifyFeedReleaseEffect = (options) => Effect19.gen(function* () {
3642
3907
  const { config, feed, tag } = options;
3643
3908
  const { fetch: fetcher } = yield* ReleaseFetch;
3644
- const ledger = yield* readFeedLedgerEffect(feed).pipe(Effect17.catchIf(() => options.expectedLedger !== undefined, () => snapshotChanged));
3909
+ const ledger = yield* readFeedLedgerEffect(feed).pipe(Effect19.catchIf(() => options.expectedLedger !== undefined, () => snapshotChanged));
3645
3910
  if (options.expectedLedger && JSON.stringify(ledger) !== JSON.stringify(options.expectedLedger))
3646
3911
  return yield* snapshotChanged;
3647
3912
  const release = yield* readFeedReleaseEffect(feed, tag);
@@ -3704,13 +3969,13 @@ var timestamp2 = (value) => {
3704
3969
  throw new Error("Invalid release clock");
3705
3970
  return new Date(value).toISOString();
3706
3971
  };
3707
- var exactFiles = (directory, names) => Effect18.gen(function* () {
3972
+ var exactFiles = (directory, names) => Effect20.gen(function* () {
3708
3973
  const fs = yield* ReleaseFs;
3709
3974
  const entries = yield* step(() => fs.readdir(directory, { withFileTypes: true }));
3710
3975
  if (entries.length !== names.length || entries.some((entry) => !entry.isFile() || !names.includes(entry.name)))
3711
3976
  return yield* fail("Staged directory does not hold exactly the platform release files");
3712
3977
  });
3713
- var promised2 = Effect18.gen(function* () {
3978
+ var promised2 = Effect20.gen(function* () {
3714
3979
  const fs = yield* ReleaseFs;
3715
3980
  const { fetch: fetch2 } = yield* ReleaseFetch;
3716
3981
  const { run: git } = yield* ReleaseGit;
@@ -3720,7 +3985,7 @@ var promised2 = Effect18.gen(function* () {
3720
3985
  run: (effect) => runReleaseLibrary(provideLibraryPorts({ fs, fetch: fetch2, git })(effect))
3721
3986
  };
3722
3987
  });
3723
- var runLocalReleaseCutEffect = (options) => Effect18.gen(function* () {
3988
+ var runLocalReleaseCutEffect = (options) => Effect20.gen(function* () {
3724
3989
  const { kind, platform } = options;
3725
3990
  const parsed = parseReleaseConfig(options.config);
3726
3991
  const provenance = yield* resolveLocalProvenanceEffect({
@@ -3745,7 +4010,7 @@ var runLocalReleaseCutEffect = (options) => Effect18.gen(function* () {
3745
4010
  }));
3746
4011
  return { ...result, version: result.tag.slice(1), platform };
3747
4012
  });
3748
- var localTagProvenanceEffect = (options) => Effect18.gen(function* () {
4013
+ var localTagProvenanceEffect = (options) => Effect20.gen(function* () {
3749
4014
  const parsed = parseReleaseConfig(options.config);
3750
4015
  parsed.requirements(options.tag);
3751
4016
  const provenance = yield* resolveLocalProvenanceEffect({
@@ -3756,7 +4021,7 @@ var localTagProvenanceEffect = (options) => Effect18.gen(function* () {
3756
4021
  return yield* fail("Release tag does not belong to the source version");
3757
4022
  return { repository: provenance.repository };
3758
4023
  });
3759
- var stageLocalDescriptorsEffect = (options) => Effect18.gen(function* () {
4024
+ var stageLocalDescriptorsEffect = (options) => Effect20.gen(function* () {
3760
4025
  const { tag, platform } = options;
3761
4026
  const local = localConfig(options.config);
3762
4027
  if (!/^[1-9]\d{0,19}$/.test(options.runId) || !isGitSha(options.sourceSha))
@@ -3765,7 +4030,7 @@ var stageLocalDescriptorsEffect = (options) => Effect18.gen(function* () {
3765
4030
  const payloads = platformPayloads(local.requirements(tag), platform);
3766
4031
  const directory = resolve8(options.directory);
3767
4032
  yield* exactFiles(directory, payloads);
3768
- const assets = yield* Effect18.forEach(payloads, (name) => fileIdentityEffect(join9(directory, name), name), { concurrency: "unbounded" });
4033
+ const assets = yield* Effect20.forEach(payloads, (name) => fileIdentityEffect(join11(directory, name), name), { concurrency: "unbounded" });
3769
4034
  const signed = signDiscoveryDescriptors({
3770
4035
  policies: discoveryPolicies(local.config, tag).filter((policy) => policy.platform === platform),
3771
4036
  assets,
@@ -3783,7 +4048,7 @@ var stageLocalDescriptorsEffect = (options) => Effect18.gen(function* () {
3783
4048
  privateKey: options.privateKey
3784
4049
  });
3785
4050
  for (const asset of assets)
3786
- if (JSON.stringify(yield* fileIdentityEffect(join9(directory, asset.name), asset.name)) !== JSON.stringify(asset))
4051
+ if (JSON.stringify(yield* fileIdentityEffect(join11(directory, asset.name), asset.name)) !== JSON.stringify(asset))
3787
4052
  return yield* fail("Staged payload changed before signing");
3788
4053
  yield* writeDescriptorsEffect(directory, signed);
3789
4054
  return signed.map((value) => value.name);
@@ -3807,18 +4072,18 @@ var describe = (key, bytes, cacheControl) => ({
3807
4072
  contentType: "application/json",
3808
4073
  cacheControl
3809
4074
  });
3810
- var writeStagedTree = (out, feed, assets, documents) => Effect18.gen(function* () {
4075
+ var writeStagedTree = (out, feed, assets, documents) => Effect20.gen(function* () {
3811
4076
  const fs = yield* ReleaseFs;
3812
4077
  const root = resolve8(out);
3813
- const exists = yield* step(() => fs.lstat(root)).pipe(Effect18.as(true), Effect18.catchIf((failure) => errorCode(failure.original) === "ENOENT", () => Effect18.succeed(false)));
4078
+ const exists = yield* step(() => fs.lstat(root)).pipe(Effect20.as(true), Effect20.catchIf((failure) => errorCode(failure.original) === "ENOENT", () => Effect20.succeed(false)));
3814
4079
  if (exists)
3815
4080
  return yield* fail("Release output directory already exists");
3816
4081
  yield* step(() => fs.mkdir(dirname2(root), { recursive: true, mode: 448 }));
3817
- const staging = yield* step(() => fs.mkdtemp(join9(dirname2(root), ".release-staging-")));
3818
- const exit = yield* Effect18.exit(Effect18.gen(function* () {
4082
+ const staging = yield* step(() => fs.mkdtemp(join11(dirname2(root), ".release-staging-")));
4083
+ const exit = yield* Effect20.exit(Effect20.gen(function* () {
3819
4084
  const objects = [];
3820
4085
  for (const { key, path, artifact } of assets) {
3821
- const target = join9(staging, key);
4086
+ const target = join11(staging, key);
3822
4087
  yield* step(() => fs.mkdir(dirname2(target), { recursive: true, mode: 448 }));
3823
4088
  yield* step(() => fs.copyFile(path, target, constants3.COPYFILE_EXCL));
3824
4089
  if (JSON.stringify(yield* fileIdentityEffect(target, artifact.name)) !== JSON.stringify(artifact))
@@ -3832,13 +4097,13 @@ var writeStagedTree = (out, feed, assets, documents) => Effect18.gen(function* (
3832
4097
  });
3833
4098
  }
3834
4099
  for (const { key, bytes } of documents) {
3835
- const target = join9(staging, key);
4100
+ const target = join11(staging, key);
3836
4101
  yield* step(() => fs.mkdir(dirname2(target), { recursive: true, mode: 448 }));
3837
4102
  yield* step(() => fs.writeFile(target, bytes, { flag: "wx", mode: 384 }));
3838
4103
  objects.push(describe(key, bytes, MUTABLE));
3839
4104
  }
3840
4105
  const plan = { schema: 1, base: feed.base, objects };
3841
- yield* step(() => fs.writeFile(join9(staging, UPLOAD_PLAN), jsonBytes(plan), { flag: "wx", mode: 384 }));
4106
+ yield* step(() => fs.writeFile(join11(staging, UPLOAD_PLAN), jsonBytes(plan), { flag: "wx", mode: 384 }));
3842
4107
  yield* attempt(() => renameExclusive(staging, root));
3843
4108
  return plan;
3844
4109
  }));
@@ -3846,10 +4111,10 @@ var writeStagedTree = (out, feed, assets, documents) => Effect18.gen(function* (
3846
4111
  return exit.value;
3847
4112
  const error = Cause2.squash(exit.cause);
3848
4113
  const original = error instanceof ReleaseFailure ? error.original ?? error : error;
3849
- const cleanup = yield* Effect18.exit(step(() => fs.rm(staging, { recursive: true, force: true })));
4114
+ const cleanup = yield* Effect20.exit(step(() => fs.rm(staging, { recursive: true, force: true })));
3850
4115
  if (Exit3.isFailure(cleanup)) {
3851
4116
  const cleanupError = Cause2.squash(cleanup.cause);
3852
- return yield* Effect18.fail(new ReleaseFailure({
4117
+ return yield* Effect20.fail(new ReleaseFailure({
3853
4118
  reason: "cleanup",
3854
4119
  message: "Release staging failed and its private temporary tree could not be removed",
3855
4120
  original: new AggregateError([
@@ -3858,8 +4123,8 @@ var writeStagedTree = (out, feed, assets, documents) => Effect18.gen(function* (
3858
4123
  ], "Release staging failed and its private temporary tree could not be removed", { cause: original })
3859
4124
  }));
3860
4125
  }
3861
- return yield* Effect18.failCause(exit.cause);
3862
- }).pipe(Effect18.uninterruptible);
4126
+ return yield* Effect20.failCause(exit.cause);
4127
+ }).pipe(Effect20.uninterruptible);
3863
4128
  function releaseDocuments(feed, ledger, release) {
3864
4129
  return [
3865
4130
  { key: feedReleaseKey(feed, release.tag), bytes: jsonBytes(release) },
@@ -3876,7 +4141,7 @@ function releaseDocuments(feed, ledger, release) {
3876
4141
  }))
3877
4142
  ];
3878
4143
  }
3879
- var stageLocalReleaseEffect = (options) => Effect18.gen(function* () {
4144
+ var stageLocalReleaseEffect = (options) => Effect20.gen(function* () {
3880
4145
  const fs = yield* ReleaseFs;
3881
4146
  const { tag, sourceSha, platform } = options;
3882
4147
  const local = localConfig(options.config);
@@ -3886,12 +4151,12 @@ var stageLocalReleaseEffect = (options) => Effect18.gen(function* () {
3886
4151
  const directory = resolve8(options.directory);
3887
4152
  const names = [...payloads, ...policies.map((policy) => policy.name)];
3888
4153
  yield* exactFiles(directory, names);
3889
- const staged = yield* Effect18.forEach(names, (name) => fileIdentityEffect(join9(directory, name), name), { concurrency: "unbounded" });
4154
+ const staged = yield* Effect20.forEach(names, (name) => fileIdentityEffect(join11(directory, name), name), { concurrency: "unbounded" });
3890
4155
  for (const policy of policies) {
3891
4156
  const artifact = staged.find((asset) => asset.name === policy.name);
3892
4157
  if (artifact.size > 65536)
3893
4158
  return yield* fail("Signed descriptor is too large");
3894
- const bytes = yield* step(() => fs.readFile(join9(directory, policy.name)));
4159
+ const bytes = yield* step(() => fs.readFile(join11(directory, policy.name)));
3895
4160
  if ("sha256:" + createHash8("sha256").update(bytes).digest("hex") !== artifact.digest)
3896
4161
  return yield* fail("Signed descriptor changed");
3897
4162
  let parsed;
@@ -3913,7 +4178,7 @@ var stageLocalReleaseEffect = (options) => Effect18.gen(function* () {
3913
4178
  if (!verified.ok || verified.descriptor.tag !== tag || verified.descriptor.sourceSha !== sourceSha || verified.descriptor.workflowSha !== sourceSha || verified.descriptor.asset.name !== payload.name || verified.descriptor.asset.size !== payload.size || "sha256:" + verified.descriptor.asset.sha256 !== payload.digest)
3914
4179
  return yield* fail(`Untrusted signed descriptor: ${policy.name}`);
3915
4180
  }
3916
- const [ledger, remote] = yield* Effect18.all([readFeedLedgerEffect(feed), readFeedReleaseEffect(feed, tag)], { concurrency: "unbounded" });
4181
+ const [ledger, remote] = yield* Effect20.all([readFeedLedgerEffect(feed), readFeedReleaseEffect(feed, tag)], { concurrency: "unbounded" });
3917
4182
  const entry = ledger.releases.find((item) => item.tag === tag);
3918
4183
  if (Boolean(entry) !== Boolean(remote) || entry && remote && (entry.kind !== remote.channel || Date.parse(entry.publishedAt) !== Date.parse(remote.publishedAt)))
3919
4184
  return yield* fail("Inconsistent feed release; reconcile publication before retrying");
@@ -3931,7 +4196,7 @@ var stageLocalReleaseEffect = (options) => Effect18.gen(function* () {
3931
4196
  merged.push({ name: artifact.name, size: artifact.size, sha256: artifact.digest.slice(7) });
3932
4197
  uploads.push({
3933
4198
  key: feedAssetKey(feed, tag, artifact.name),
3934
- path: join9(directory, artifact.name),
4199
+ path: join11(directory, artifact.name),
3935
4200
  artifact
3936
4201
  });
3937
4202
  }
@@ -3964,7 +4229,7 @@ function stablePlatforms(config) {
3964
4229
  throw new Error("Invalid stablePlatforms in the release configuration");
3965
4230
  return value;
3966
4231
  }
3967
- var verifyLocalReleaseEffect = (options) => Effect18.gen(function* () {
4232
+ var verifyLocalReleaseEffect = (options) => Effect20.gen(function* () {
3968
4233
  const local = localConfig(options.config);
3969
4234
  const { release, platforms } = yield* verifyFeedReleaseEffect({
3970
4235
  config: local.config,
@@ -3980,7 +4245,7 @@ var verifyLocalReleaseEffect = (options) => Effect18.gen(function* () {
3980
4245
  missing: Object.keys(platformTargets).filter((platform) => !platforms.includes(platform))
3981
4246
  };
3982
4247
  });
3983
- var runLocalPromotionEffect = (options) => Effect18.gen(function* () {
4248
+ var runLocalPromotionEffect = (options) => Effect20.gen(function* () {
3984
4249
  const local = localConfig(options.config);
3985
4250
  const feed = local.feed;
3986
4251
  const required = stablePlatforms(local.config);
@@ -4038,7 +4303,7 @@ var runLocalPromotionEffect = (options) => Effect18.gen(function* () {
4038
4303
  const verification = qualified.get(selected.tag);
4039
4304
  const absent = Object.keys(platformTargets).filter((name) => !verification?.platforms.includes(name));
4040
4305
  const entry = ledger.releases.find((item) => item.tag === selected.tag);
4041
- const [currentLedger, remote] = await run(Effect18.all([readFeedLedgerEffect(feed), readFeedReleaseEffect(feed, selected.tag)], {
4306
+ const [currentLedger, remote] = await run(Effect20.all([readFeedLedgerEffect(feed), readFeedReleaseEffect(feed, selected.tag)], {
4042
4307
  concurrency: "unbounded"
4043
4308
  }));
4044
4309
  if (!entry || !remote || !verification || entry.kind === "dev" || JSON.stringify(currentLedger) !== JSON.stringify(ledger) || JSON.stringify(remote) !== JSON.stringify(verification.release))
@@ -4077,7 +4342,7 @@ var runLocalPromotionEffect = (options) => Effect18.gen(function* () {
4077
4342
 
4078
4343
  // src/library/qualification-run.ts
4079
4344
  var REFUSAL = "Qualification requires a GitHub release-assets run, a GitLab tag pipeline or a CircleCI tag workflow";
4080
- var tagRun = (options) => Effect19.gen(function* () {
4345
+ var tagRun = (options) => Effect21.gen(function* () {
4081
4346
  const { tag, sha, runId } = options;
4082
4347
  if (options.tagName !== tag || !isGitSha(sha) || !/^[1-9]\d{0,19}$/.test(runId ?? "") || !/^v\d+\.\d+\.\d+$/.test(tag) || tag.length > 65)
4083
4348
  return yield* fail(REFUSAL);
@@ -4091,7 +4356,7 @@ var tagRun = (options) => Effect19.gen(function* () {
4091
4356
  runAttempt: 1
4092
4357
  };
4093
4358
  });
4094
- var planQualificationRunEffect = (options) => Effect19.gen(function* () {
4359
+ var planQualificationRunEffect = (options) => Effect21.gen(function* () {
4095
4360
  const { env, config, tag } = options;
4096
4361
  if (env.GITHUB_ACTIONS === "true") {
4097
4362
  const plan = yield* planReleaseAssetsEffect({ env, config, tag });
@@ -4124,8 +4389,8 @@ var planQualificationRun2 = (options) => runReleaseLibrary(provideLibraryPorts({
4124
4389
  ...options.git ? { git: options.git } : {}
4125
4390
  })(planQualificationRunEffect(options)));
4126
4391
  // src/library/retained-build.ts
4127
- import { Effect as Effect20 } from "effect";
4128
- var id = (value) => Effect20.gen(function* () {
4392
+ import { Effect as Effect22 } from "effect";
4393
+ var id = (value) => Effect22.gen(function* () {
4129
4394
  if (typeof value === "number" && !Number.isSafeInteger(value))
4130
4395
  return yield* fail("Invalid GitHub identity");
4131
4396
  const text = String(value);
@@ -4133,7 +4398,7 @@ var id = (value) => Effect20.gen(function* () {
4133
4398
  return yield* fail("Invalid GitHub identity");
4134
4399
  return text;
4135
4400
  });
4136
- var selectRetainedReleaseBuildEffect = (options) => Effect20.gen(function* () {
4401
+ var selectRetainedReleaseBuildEffect = (options) => Effect22.gen(function* () {
4137
4402
  const { env, config, tag, platform } = options;
4138
4403
  if (!["macos-arm64", "windows-x64", "linux-x64"].includes(platform) || !isRecord(config) || typeof config.appName !== "string" || env.RELEASE_TAG !== tag)
4139
4404
  return yield* fail("Invalid retained build context");
@@ -4252,9 +4517,9 @@ var selectRetainedReleaseBuildEffect = (options) => Effect20.gen(function* () {
4252
4517
  var selectRetainedReleaseBuild = (options) => runReleaseLibrary(provideLibraryPorts({ run: planGitHubRun(options.env, options.run) })(selectRetainedReleaseBuildEffect(options)));
4253
4518
  // src/library/staging.ts
4254
4519
  import { createHash as createHash9 } from "crypto";
4255
- import { join as join10, resolve as resolve9 } from "path";
4256
- import { Effect as Effect21 } from "effect";
4257
- var copyHashed = (input, output, size) => Effect21.tryPromise({
4520
+ import { join as join12, resolve as resolve9 } from "path";
4521
+ import { Effect as Effect23 } from "effect";
4522
+ var copyHashed = (input, output, size) => Effect23.tryPromise({
4258
4523
  try: async (signal) => {
4259
4524
  const hash = createHash9("sha256");
4260
4525
  let copied = 0;
@@ -4283,15 +4548,14 @@ var copyHashed = (input, output, size) => Effect21.tryPromise({
4283
4548
  original: error
4284
4549
  })
4285
4550
  });
4286
- var stagePlatformArtifactsEffect = (options) => Effect21.gen(function* () {
4551
+ var stageExpectedFilesEffect = (options) => Effect23.gen(function* () {
4287
4552
  const fs = yield* ReleaseFs;
4288
- const requirements = parseReleaseConfig(options.config).requirements(options.tag);
4289
- const expected = platformPayloads(requirements, options.platform);
4290
- if (!expected.length || Object.keys(options.sources).length !== expected.length || expected.some((name) => !Object.hasOwn(options.sources, name)))
4291
- return yield* fail("Platform staging sources do not match release configuration");
4553
+ const { expected } = options;
4554
+ if (!expected.length || new Set(expected).size !== expected.length || expected.some((name) => !/^[a-zA-Z0-9][a-zA-Z0-9_.-]*$/.test(name)) || Object.keys(options.sources).length !== expected.length || expected.some((name) => !Object.hasOwn(options.sources, name)))
4555
+ return yield* fail("Staging sources do not match expected filenames");
4292
4556
  const directory = resolve9(options.directory);
4293
4557
  const created = [];
4294
- const stage = Effect21.forEach(expected, (name) => Effect21.gen(function* () {
4558
+ const stage = Effect23.forEach(expected, (name) => Effect23.gen(function* () {
4295
4559
  const sourcePath = options.sources[name];
4296
4560
  if (typeof sourcePath !== "string" || !sourcePath)
4297
4561
  return yield* fail("Invalid staging source");
@@ -4302,7 +4566,7 @@ var stagePlatformArtifactsEffect = (options) => Effect21.gen(function* () {
4302
4566
  const before = yield* step(() => input.stat());
4303
4567
  if (!before.isFile() || before.dev !== sourceInfo.dev || before.ino !== sourceInfo.ino || before.size !== sourceInfo.size)
4304
4568
  return yield* fail("Staging source changed");
4305
- const target = join10(directory, name);
4569
+ const target = join12(directory, name);
4306
4570
  const output = yield* scopedHandle(() => fs.open(target, "wx"));
4307
4571
  created.push(target);
4308
4572
  const copied = yield* copyHashed(input, output, before.size);
@@ -4311,13 +4575,20 @@ var stagePlatformArtifactsEffect = (options) => Effect21.gen(function* () {
4311
4575
  if (copied.size !== before.size || after.size !== before.size || after.mtimeMs !== before.mtimeMs || after.dev !== before.dev || after.ino !== before.ino)
4312
4576
  return yield* fail("Staging source changed");
4313
4577
  return { name, size: copied.size, digest: copied.digest };
4314
- }).pipe(Effect21.scoped), { concurrency: 1 });
4315
- return yield* stage.pipe(Effect21.onError(() => Effect21.promise(() => Promise.all(created.map((path) => fs.rm(path, { force: true }).catch(() => {}))))));
4578
+ }).pipe(Effect23.scoped), { concurrency: 1 });
4579
+ return yield* stage.pipe(Effect23.onError(() => Effect23.promise(() => Promise.all(created.map((path) => fs.rm(path, { force: true }).catch(() => {}))))));
4580
+ });
4581
+ var stagePlatformArtifactsEffect = (options) => Effect23.gen(function* () {
4582
+ const requirements = parseReleaseConfig(options.config).requirements(options.tag);
4583
+ const expected = platformPayloads(requirements, options.platform);
4584
+ if (!expected.length || Object.keys(options.sources).length !== expected.length || expected.some((name) => !Object.hasOwn(options.sources, name)))
4585
+ return yield* fail("Platform staging sources do not match release configuration");
4586
+ return yield* stageExpectedFilesEffect({ ...options, expected });
4316
4587
  });
4317
4588
  var stagePlatformArtifacts = (options) => runReleaseLibrary(provideLibraryPorts()(stagePlatformArtifactsEffect(options)));
4318
4589
  // src/library/steps.ts
4319
- import { join as join30 } from "path";
4320
- import { Effect as Effect22 } from "effect";
4590
+ import { join as join32 } from "path";
4591
+ import { Effect as Effect24 } from "effect";
4321
4592
 
4322
4593
  // ../../src/installer/installer-archive-members.ts
4323
4594
  import { createHash as createHash10 } from "crypto";
@@ -4446,11 +4717,11 @@ async function assertEmbeddedArchive(path, size, archive) {
4446
4717
  // ../../src/installer/installer-identity.ts
4447
4718
  import { lstat as lstat8, mkdtemp as mkdtemp4, readdir as readdir5, realpath } from "fs/promises";
4448
4719
  import { tmpdir as tmpdir4 } from "os";
4449
- import { basename as basename5, join as join12, resolve as resolve10, win32 } from "path";
4720
+ import { basename as basename5, join as join14, resolve as resolve10, win32 } from "path";
4450
4721
 
4451
4722
  // ../../src/installer/installer-image-mount.ts
4452
4723
  import { lstat as lstat7, mkdir as mkdir4, mkdtemp as mkdtemp3, readdir as readdir4, rm as rm4, stat } from "fs/promises";
4453
- import { dirname as dirname3, join as join11 } from "path";
4724
+ import { dirname as dirname3, join as join13 } from "path";
4454
4725
  var FAILED_ATTACH_PROBES = 5;
4455
4726
  var FAILED_ATTACH_PROBE_INTERVAL_MS = 500;
4456
4727
  async function containsMountAt(path, expectedDevice) {
@@ -4460,7 +4731,7 @@ async function containsMountAt(path, expectedDevice) {
4460
4731
  if (info.dev !== expectedDevice)
4461
4732
  return true;
4462
4733
  for (const name of await readdir4(path)) {
4463
- const child = join11(path, name), childInfo = await lstat7(child);
4734
+ const child = join13(path, name), childInfo = await lstat7(child);
4464
4735
  if (!childInfo.isDirectory() || childInfo.isSymbolicLink())
4465
4736
  continue;
4466
4737
  if (childInfo.dev !== info.dev || await containsMountAt(child, info.dev))
@@ -4654,8 +4925,8 @@ async function withInstallerImageRetries(options) {
4654
4925
  };
4655
4926
  const priorErrors = () => failedAttempts.map((attempt) => attempt.error);
4656
4927
  for (let attempt = 1;attempt <= maximumAttempts; attempt++) {
4657
- const directory = await mkdtemp3(join11(options.parent, options.prefix));
4658
- const mount = join11(directory, "mount");
4928
+ const directory = await mkdtemp3(join13(options.parent, options.prefix));
4929
+ const mount = join13(directory, "mount");
4659
4930
  const io = options.createIo?.(directory, mount) ?? defaultInstallerImageMountIo(options.run);
4660
4931
  let lifecycleStarted = false;
4661
4932
  try {
@@ -4855,7 +5126,7 @@ async function verifyInstallerPayload(options) {
4855
5126
  if (!Number.isSafeInteger(before.archive.size + 256 * 1024 * 1024))
4856
5127
  throw new Error("Installer archive exceeds bound");
4857
5128
  const env = environment(parent);
4858
- const temporary = await mkdtemp4(join12(tmpdir4(), "framework-installer-inspect-"));
5129
+ const temporary = await mkdtemp4(join14(tmpdir4(), "framework-installer-inspect-"));
4859
5130
  const cleanupIo = defaultInstallerImageMountIo(command);
4860
5131
  try {
4861
5132
  if (options.platform === "macos-arm64") {
@@ -4869,21 +5140,21 @@ async function verifyInstallerPayload(options) {
4869
5140
  const apps = (await readdir5(mount)).filter((name) => name.endsWith(".app"));
4870
5141
  if (apps.length !== 1)
4871
5142
  throw new Error("Installer application is missing or ambiguous");
4872
- const resources = join12(mount, apps[0], "Contents", "Resources");
4873
- const actualRoot = await realpath(mount), actualApp = await realpath(join12(mount, apps[0])), actualResources = await realpath(resources);
5143
+ const resources = join14(mount, apps[0], "Contents", "Resources");
5144
+ const actualRoot = await realpath(mount), actualApp = await realpath(join14(mount, apps[0])), actualResources = await realpath(resources);
4874
5145
  if (!isWithin(actualRoot, actualApp) || !isWithin(actualApp, actualResources))
4875
5146
  throw new Error("Installer resources escape mounted image");
4876
- const plist = join12(actualApp, "Contents", "Info.plist"), plistInfo = await lstat8(plist);
5147
+ const plist = join14(actualApp, "Contents", "Info.plist"), plistInfo = await lstat8(plist);
4877
5148
  if (!plistInfo.isFile() || plistInfo.isSymbolicLink() || plistInfo.size < 1 || plistInfo.size > 1024 * 1024)
4878
5149
  throw new Error("Invalid installer property list");
4879
5150
  const executable = (await command(["/usr/libexec/PlistBuddy", "-c", "Print :CFBundleExecutable", plist], env)).trim();
4880
5151
  if (!executable || executable === "." || executable === ".." || /[\\/]/.test(executable))
4881
5152
  throw new Error("Invalid installer executable name");
4882
- await assertInstallerExecutable(join12(actualApp, "Contents", "MacOS", executable), options.platform);
5153
+ await assertInstallerExecutable(join14(actualApp, "Contents", "MacOS", executable), options.platform);
4883
5154
  const archives = (await readdir5(actualResources)).filter((name) => name.endsWith(".tar.zst"));
4884
5155
  if (archives.length !== 1)
4885
5156
  throw new Error("Installer archive is missing or ambiguous");
4886
- const embedded = await identity(join12(actualResources, archives[0]));
5157
+ const embedded = await identity(join14(actualResources, archives[0]));
4887
5158
  if (embedded.size !== before.archive.size || embedded.digest !== before.archive.digest)
4888
5159
  throw new Error("Installer archive differs from release archive");
4889
5160
  }
@@ -4901,7 +5172,7 @@ async function verifyInstallerPayload(options) {
4901
5172
  const matches = names.filter((name) => candidates.includes(normalizeArchiveMember(name)));
4902
5173
  if (matches.length !== 1)
4903
5174
  throw new Error("Installer archive is missing or ambiguous");
4904
- const extracted = join12(temporary, "member");
5175
+ const extracted = join14(temporary, "member");
4905
5176
  const count = await extractArchiveMember({
4906
5177
  tar,
4907
5178
  archive: installerPath,
@@ -4912,7 +5183,7 @@ async function verifyInstallerPayload(options) {
4912
5183
  });
4913
5184
  if (options.platform === "windows-x64") {
4914
5185
  const setup = findArchiveMember(names, `${options.appName}-Setup.exe`, options.platform, "Installer executable is missing or ambiguous");
4915
- const executable = join12(temporary, "setup.exe");
5186
+ const executable = join14(temporary, "setup.exe");
4916
5187
  await extractArchiveMember({
4917
5188
  tar,
4918
5189
  archive: installerPath,
@@ -4949,18 +5220,18 @@ async function verifyInstallerPayload(options) {
4949
5220
 
4950
5221
  // ../../src/installer/installer-qualification-command.ts
4951
5222
  import { lstat as lstat18, writeFile as writeFile9 } from "fs/promises";
4952
- import { join as join27, resolve as resolve13 } from "path";
5223
+ import { join as join29, resolve as resolve13 } from "path";
4953
5224
 
4954
5225
  // ../../src/installer/installer-observation.ts
4955
5226
  import { randomBytes as randomBytes2 } from "crypto";
4956
5227
  import { chmod as chmod2, mkdir as mkdir9, readFile as readFile9, realpath as realpath8, writeFile as writeFile8 } from "fs/promises";
4957
5228
  import { createServer } from "net";
4958
- import { delimiter, dirname as dirname12, join as join26 } from "path";
5229
+ import { delimiter, dirname as dirname12, join as join28 } from "path";
4959
5230
 
4960
5231
  // ../../src/installer/installer-ci-bootstrap.ts
4961
5232
  import { randomBytes } from "crypto";
4962
5233
  import { lstat as lstat9, mkdir as mkdir5, mkdtemp as mkdtemp5, realpath as realpath2, rm as rm5, writeFile as writeFile4 } from "fs/promises";
4963
- import { dirname as dirname4, isAbsolute as isAbsolute4, join as join13, relative as relative4, sep as sep3 } from "path";
5234
+ import { dirname as dirname4, isAbsolute as isAbsolute4, join as join15, relative as relative4, sep as sep3 } from "path";
4964
5235
  import { fileURLToPath } from "url";
4965
5236
  var bootstrapModules = [
4966
5237
  "app/value-guards.js",
@@ -4987,23 +5258,23 @@ async function prepareInstallerCiBootstrap(env = process.env) {
4987
5258
  if (/\s/.test(parent) || !(await lstat9(parent)).isDirectory())
4988
5259
  throw new Error("Runner temp cannot represent a Bun preload path");
4989
5260
  const source = dirname4(dirname4(fileURLToPath(import.meta.url)));
4990
- const directory = await mkdtemp5(join13(parent, "framework-ci-"));
5261
+ const directory = await mkdtemp5(join15(parent, "framework-ci-"));
4991
5262
  try {
4992
5263
  for (const name of bootstrapModules) {
4993
- const contents = await readBoundedFile(join13(source, name), 2 * 1024 * 1024, "installer bootstrap module");
4994
- await mkdir5(dirname4(join13(directory, name)), { recursive: true, mode: 448 });
4995
- await writeFile4(join13(directory, name), contents, { flag: "wx", mode: 384 });
5264
+ const contents = await readBoundedFile(join15(source, name), 2 * 1024 * 1024, "installer bootstrap module");
5265
+ await mkdir5(dirname4(join15(directory, name)), { recursive: true, mode: 448 });
5266
+ await writeFile4(join15(directory, name), contents, { flag: "wx", mode: 384 });
4996
5267
  }
4997
- await writeFile4(join13(directory, "package.json"), `{"type":"module"}
5268
+ await writeFile4(join15(directory, "package.json"), `{"type":"module"}
4998
5269
  `, {
4999
5270
  flag: "wx",
5000
5271
  mode: 384
5001
5272
  });
5002
- const worker = join13(directory, "installer/installer-ci-worker.js");
5273
+ const worker = join15(directory, "installer/installer-ci-worker.js");
5003
5274
  return {
5004
5275
  directory,
5005
5276
  worker,
5006
- preflight: join13(directory, "installer/installer-ci-preflight.js"),
5277
+ preflight: join15(directory, "installer/installer-ci-preflight.js"),
5007
5278
  bunOptions: `--preload=${worker}`
5008
5279
  };
5009
5280
  } catch (error) {
@@ -5018,7 +5289,7 @@ async function preflightInstallerRuntime(options) {
5018
5289
  throw new Error("Runtime preflight requires a disposable hosted runner");
5019
5290
  const tempRoot = await realpath2(temp), bootstrapRoot = await realpath2(bootstrap.directory);
5020
5291
  const relativeBootstrap = relative4(tempRoot, bootstrapRoot);
5021
- if (!relativeBootstrap || relativeBootstrap === ".." || relativeBootstrap.startsWith(".." + sep3) || isAbsolute4(relativeBootstrap) || /\s/.test(bootstrapRoot) || bootstrap.worker !== join13(bootstrapRoot, "installer/installer-ci-worker.js") || bootstrap.preflight !== join13(bootstrapRoot, "installer/installer-ci-preflight.js") || bootstrap.bunOptions !== `--preload=${bootstrap.worker}`)
5292
+ if (!relativeBootstrap || relativeBootstrap === ".." || relativeBootstrap.startsWith(".." + sep3) || isAbsolute4(relativeBootstrap) || /\s/.test(bootstrapRoot) || bootstrap.worker !== join15(bootstrapRoot, "installer/installer-ci-worker.js") || bootstrap.preflight !== join15(bootstrapRoot, "installer/installer-ci-preflight.js") || bootstrap.bunOptions !== `--preload=${bootstrap.worker}`)
5022
5293
  throw new Error("Invalid installer bootstrap location");
5023
5294
  await runInstallerPreflight({
5024
5295
  env,
@@ -5038,7 +5309,7 @@ async function runInstallerPreflight(options) {
5038
5309
  const info = await lstat9(runtime);
5039
5310
  if (!info.isFile() || info.isSymbolicLink() || info.size < 4096)
5040
5311
  throw new Error("Invalid candidate Bun runtime");
5041
- const temporary = await mkdtemp5(join13(options.parent, "framework-preflight-"));
5312
+ const temporary = await mkdtemp5(join15(options.parent, "framework-preflight-"));
5042
5313
  try {
5043
5314
  const clean = {};
5044
5315
  for (const key of [
@@ -5063,11 +5334,11 @@ async function runInstallerPreflight(options) {
5063
5334
  BUN_OPTIONS: `--preload=${worker}`,
5064
5335
  FRAMEWORK_CI_WORKER_ENTRY: preflight,
5065
5336
  FRAMEWORK_CI_NONCE: nonce,
5066
- FRAMEWORK_CI_ACK: join13(temporary, "ack"),
5067
- FRAMEWORK_CI_PERMIT: join13(temporary, "permit"),
5337
+ FRAMEWORK_CI_ACK: join15(temporary, "ack"),
5338
+ FRAMEWORK_CI_PERMIT: join15(temporary, "permit"),
5068
5339
  FRAMEWORK_CI_ORIGIN: "http://127.0.0.1:48999",
5069
- FRAMEWORK_CI_OBSERVATION: join13(temporary, "observation"),
5070
- FRAMEWORK_CI_UNEXPECTED: join13(temporary, "unexpected"),
5340
+ FRAMEWORK_CI_OBSERVATION: join15(temporary, "observation"),
5341
+ FRAMEWORK_CI_UNEXPECTED: join15(temporary, "unexpected"),
5071
5342
  FRAMEWORK_CI_EXPECTED_READS: JSON.stringify([
5072
5343
  "https://example.invalid/framework-ci-sentinel"
5073
5344
  ])
@@ -5102,7 +5373,7 @@ async function runInstallerPreflight(options) {
5102
5373
  if (status !== 0 || !stdout.includes("framework installer preload preflight passed"))
5103
5374
  throw new Error("Candidate Bun runtime failed installer preflight");
5104
5375
  try {
5105
- await lstat9(join13(temporary, "unexpected"));
5376
+ await lstat9(join15(temporary, "unexpected"));
5106
5377
  throw new Error("Runtime preflight recorded unexpected activity");
5107
5378
  } catch (error) {
5108
5379
  if (errorCode(error) !== "ENOENT")
@@ -5115,7 +5386,7 @@ async function runInstallerPreflight(options) {
5115
5386
 
5116
5387
  // ../../src/installer/installer-extraction.ts
5117
5388
  import { chmod, lstat as lstat10, mkdir as mkdir6, mkdtemp as mkdtemp6, readdir as readdir6, realpath as realpath3 } from "fs/promises";
5118
- import { join as join14, resolve as resolve11, win32 as win322 } from "path";
5389
+ import { join as join16, resolve as resolve11, win32 as win322 } from "path";
5119
5390
  async function run(cmd, env) {
5120
5391
  return runInstallerCommand(cmd, env, {
5121
5392
  outputLimit: 8 * 1024 * 1024,
@@ -5123,7 +5394,7 @@ async function run(cmd, env) {
5123
5394
  failureMessage: "Installer preparation command failed"
5124
5395
  });
5125
5396
  }
5126
- async function digest(path) {
5397
+ async function digest2(path) {
5127
5398
  const info = await lstat10(path);
5128
5399
  if (!info.isFile() || info.isSymbolicLink() || !Number.isSafeInteger(info.size) || info.size < 1)
5129
5400
  throw new Error("Invalid extracted file");
@@ -5167,10 +5438,10 @@ async function prepareInstallerExecution(options) {
5167
5438
  archive: sourceArchive,
5168
5439
  env
5169
5440
  });
5170
- const directory = await mkdtemp6(join14(parent, "framework-installer-"));
5441
+ const directory = await mkdtemp6(join16(parent, "framework-installer-"));
5171
5442
  const imageIo = defaultInstallerImageMountIo(run);
5172
5443
  try {
5173
- const profile = join14(directory, "profile"), incoming = join14(directory, "incoming");
5444
+ const profile = join16(directory, "profile"), incoming = join16(directory, "incoming");
5174
5445
  await mkdir6(profile, { mode: 448 });
5175
5446
  await mkdir6(incoming, { mode: 448 });
5176
5447
  const clean = cleanEnv(env);
@@ -5186,31 +5457,31 @@ async function prepareInstallerExecution(options) {
5186
5457
  const appName = `${options.appName}.app`, apps = (await readdir6(mount)).filter((name) => name.endsWith(".app"));
5187
5458
  if (apps.length !== 1 || apps[0] !== appName)
5188
5459
  throw new Error("Unexpected installer application");
5189
- const sourceApp = await realpath3(join14(mount, appName)), mountRoot = await realpath3(mount);
5460
+ const sourceApp = await realpath3(join16(mount, appName)), mountRoot = await realpath3(mount);
5190
5461
  if (!isWithin(mountRoot, sourceApp))
5191
5462
  throw new Error("Installer application escapes image");
5192
- const app = join14(incoming, appName);
5463
+ const app = join16(incoming, appName);
5193
5464
  await run(["/usr/bin/ditto", sourceApp, app], clean);
5194
- const actualApp = await realpath3(app), resources = await realpath3(join14(actualApp, "Contents", "Resources"));
5465
+ const actualApp = await realpath3(app), resources = await realpath3(join16(actualApp, "Contents", "Resources"));
5195
5466
  if (!isWithin(await realpath3(incoming), actualApp) || !isWithin(actualApp, resources))
5196
5467
  throw new Error("Copied installer escapes profile");
5197
- const plist = join14(actualApp, "Contents", "Info.plist"), plistInfo = await lstat10(plist);
5468
+ const plist = join16(actualApp, "Contents", "Info.plist"), plistInfo = await lstat10(plist);
5198
5469
  if (!plistInfo.isFile() || plistInfo.isSymbolicLink() || plistInfo.size < 1 || plistInfo.size > 1024 * 1024)
5199
5470
  throw new Error("Invalid installer property list");
5200
5471
  const name = (await run(["/usr/libexec/PlistBuddy", "-c", "Print :CFBundleExecutable", plist], clean)).trim();
5201
5472
  if (!name || name === "." || name === ".." || /[\\/]/.test(name))
5202
5473
  throw new Error("Invalid installer executable");
5203
- const appExecutable = join14(actualApp, "Contents", "MacOS", name);
5204
- const sourceExecutable = join14(sourceApp, "Contents", "MacOS", name);
5474
+ const appExecutable = join16(actualApp, "Contents", "MacOS", name);
5475
+ const sourceExecutable = join16(sourceApp, "Contents", "MacOS", name);
5205
5476
  if (!isWithin(actualApp, await realpath3(appExecutable)) || !isWithin(sourceApp, await realpath3(sourceExecutable)))
5206
5477
  throw new Error("Installer executable escapes application");
5207
5478
  await assertInstallerExecutable(appExecutable, options.platform);
5208
- if (JSON.stringify(await digest(sourceExecutable)) !== JSON.stringify(await digest(appExecutable)))
5479
+ if (JSON.stringify(await digest2(sourceExecutable)) !== JSON.stringify(await digest2(appExecutable)))
5209
5480
  throw new Error("Copied installer executable differs");
5210
5481
  const archives = (await readdir6(resources)).filter((value) => value.endsWith(".tar.zst"));
5211
5482
  if (archives.length !== 1)
5212
5483
  throw new Error("Missing installer archive");
5213
- const embedded = await digest(join14(resources, archives[0]));
5484
+ const embedded = await digest2(join16(resources, archives[0]));
5214
5485
  if (embedded.size !== verified.archive.size || embedded.digest !== verified.archive.digest)
5215
5486
  throw new Error("Copied installer archive differs");
5216
5487
  return executable;
@@ -5225,9 +5496,9 @@ async function prepareInstallerExecution(options) {
5225
5496
  assertInstallerLayout(options.platform, options.appName, names);
5226
5497
  const find = (name) => findArchiveMember(names, name, options.platform, "Installer member missing or ambiguous");
5227
5498
  if (options.platform === "windows-x64") {
5228
- const subdirectory = join14(incoming, ".installer");
5499
+ const subdirectory = join16(incoming, ".installer");
5229
5500
  await mkdir6(subdirectory);
5230
- executable = join14(incoming, `${options.appName}-Setup.exe`);
5501
+ executable = join16(incoming, `${options.appName}-Setup.exe`);
5231
5502
  await extractArchiveMember({
5232
5503
  tar,
5233
5504
  archive: sourceInstaller,
@@ -5241,11 +5512,11 @@ async function prepareInstallerExecution(options) {
5241
5512
  tar,
5242
5513
  archive: sourceInstaller,
5243
5514
  member: find(`.installer/${options.appName}-Setup.metadata.json`),
5244
- destination: join14(subdirectory, `${options.appName}-Setup.metadata.json`),
5515
+ destination: join16(subdirectory, `${options.appName}-Setup.metadata.json`),
5245
5516
  maximum: 1024 * 1024,
5246
5517
  env: clean
5247
5518
  });
5248
- const embeddedPath = join14(subdirectory, `${options.appName}-Setup.tar.zst`);
5519
+ const embeddedPath = join16(subdirectory, `${options.appName}-Setup.tar.zst`);
5249
5520
  await extractArchiveMember({
5250
5521
  tar,
5251
5522
  archive: sourceInstaller,
@@ -5254,11 +5525,11 @@ async function prepareInstallerExecution(options) {
5254
5525
  maximum: verified.archive.size,
5255
5526
  env: clean
5256
5527
  });
5257
- const embedded = await digest(embeddedPath);
5528
+ const embedded = await digest2(embeddedPath);
5258
5529
  if (embedded.size !== verified.archive.size || embedded.digest !== verified.archive.digest)
5259
5530
  throw new Error("Copied installer archive differs");
5260
5531
  } else {
5261
- executable = join14(incoming, "installer");
5532
+ executable = join16(incoming, "installer");
5262
5533
  await extractArchiveMember({
5263
5534
  tar,
5264
5535
  archive: sourceInstaller,
@@ -5317,7 +5588,7 @@ function assertInstallerRendererObservation(value, offline = false) {
5317
5588
  import { createHash as createHash11 } from "crypto";
5318
5589
  import { lstat as lstat11, open as open5, realpath as realpath4, rm as rm6 } from "fs/promises";
5319
5590
  import { once } from "events";
5320
- import { join as join15, resolve as resolve12 } from "path";
5591
+ import { join as join17, resolve as resolve12 } from "path";
5321
5592
  import { createZstdDecompress } from "zlib";
5322
5593
  import { Parser } from "tar";
5323
5594
  function cleanEnv2(parent, forceLocal) {
@@ -5488,7 +5759,7 @@ async function verifyInstalledPayload(options) {
5488
5759
  const member = members.get(path);
5489
5760
  if (!member || member.count !== 1)
5490
5761
  throw new Error("Archive member missing or ambiguous");
5491
- const current = await installed(join15(root, name), root, limit);
5762
+ const current = await installed(join17(root, name), root, limit);
5492
5763
  if (member.size !== current.size || member.digest !== current.digest)
5493
5764
  throw new Error(`Installed file differs from archive: ${name}`);
5494
5765
  if (name === "Resources/version.json") {
@@ -5523,7 +5794,7 @@ async function extractCandidateRuntime(options) {
5523
5794
  const prefix = options.platform === "macos-arm64" ? `${options.appName}.app/Contents/MacOS` : `${options.appName.replaceAll(" ", "")}/bin`, suffix = options.platform === "windows-x64" ? ".exe" : "";
5524
5795
  const expected = `${prefix}/bun${suffix}`;
5525
5796
  const member = findArchiveMember(entries, expected, options.platform, "Runtime archive member missing or ambiguous");
5526
- const destination = join15(profile, `candidate-bun${suffix}`), output = await open5(destination, "wx", 448);
5797
+ const destination = join17(profile, `candidate-bun${suffix}`), output = await open5(destination, "wx", 448);
5527
5798
  const spawn = () => Bun.spawn({
5528
5799
  cmd: ["tar", "--zstd", "-xOf", archive, "--", member],
5529
5800
  env: tarEnv,
@@ -5730,7 +6001,7 @@ async function windowsRunningExecutable(pid) {
5730
6001
 
5731
6002
  // ../../src/updates/install/update-swap-stage.ts
5732
6003
  import { lstat as lstat17, mkdtemp as mkdtemp8, readFile as readFile8, realpath as realpath7, rm as rm8 } from "fs/promises";
5733
- import { join as join25 } from "path";
6004
+ import { join as join27 } from "path";
5734
6005
 
5735
6006
  // ../../src/updates/install/update-handoff-plan.ts
5736
6007
  import { basename as basename6 } from "path";
@@ -5772,7 +6043,7 @@ function planUpdateHandoff(options) {
5772
6043
  import { createHash as createHash12 } from "crypto";
5773
6044
  import { constants as constants4 } from "fs";
5774
6045
  import { lstat as lstat12, mkdir as mkdir7, mkdtemp as mkdtemp7, open as open6, readFile as readFile6, realpath as realpath6, rm as rm7, symlink } from "fs/promises";
5775
- import { isAbsolute as isAbsolute5, join as join16 } from "path";
6046
+ import { isAbsolute as isAbsolute5, join as join18 } from "path";
5776
6047
  import { Transform } from "stream";
5777
6048
  import { pipeline } from "stream/promises";
5778
6049
  import { createZstdDecompress as createZstdDecompress2 } from "zlib";
@@ -5818,8 +6089,8 @@ async function extractVerifiedUpdate(options) {
5818
6089
  const parent = await realpath6(options.directory);
5819
6090
  if (!(await lstat12(parent)).isDirectory())
5820
6091
  throw new Error("Invalid update staging directory");
5821
- directory = await mkdtemp7(join16(parent, "framework-update-extract-"));
5822
- const payloadRoot = join16(directory, "payload"), decompressed = join16(directory, "payload.tar");
6092
+ directory = await mkdtemp7(join18(parent, "framework-update-extract-"));
6093
+ const payloadRoot = join18(directory, "payload"), decompressed = join18(directory, "payload.tar");
5823
6094
  await mkdir7(payloadRoot, { mode: 448 });
5824
6095
  const entries = [], links = [], seen = new Set, fold = platform === "windows-x64";
5825
6096
  let invalid = false;
@@ -5937,14 +6208,14 @@ async function extractVerifiedUpdate(options) {
5937
6208
  if (invalid)
5938
6209
  throw new Error("Unsafe or unsupported update archive entry");
5939
6210
  if (links.length) {
5940
- const bin = join16(payloadRoot, archiveRoot, "bin"), cef = join16(bin, "cef");
5941
- for (const path of [join16(payloadRoot, archiveRoot), bin, cef]) {
6211
+ const bin = join18(payloadRoot, archiveRoot, "bin"), cef = join18(bin, "cef");
6212
+ for (const path of [join18(payloadRoot, archiveRoot), bin, cef]) {
5942
6213
  const value = await lstat12(path);
5943
6214
  if (!value.isDirectory() || value.isSymbolicLink())
5944
6215
  throw new Error("Invalid CEF link directory");
5945
6216
  }
5946
6217
  for (const link of links) {
5947
- const destination = join16(payloadRoot, link.path), target = join16(bin, link.target), value = await lstat12(target);
6218
+ const destination = join18(payloadRoot, link.path), target = join18(bin, link.target), value = await lstat12(target);
5948
6219
  if (!value.isFile() || value.isSymbolicLink())
5949
6220
  throw new Error("Invalid CEF link target");
5950
6221
  await symlink(link.target, destination);
@@ -5952,12 +6223,12 @@ async function extractVerifiedUpdate(options) {
5952
6223
  }
5953
6224
  await rm7(decompressed);
5954
6225
  assertPayloadLayout({ platform, renderer, appName, entries, sidecars });
5955
- const prefix = platform === "macos-arm64" ? join16(`${appName}.app`, "Contents") : appName.replaceAll(" ", "");
5956
- const resources = join16(payloadRoot, prefix, "Resources");
6226
+ const prefix = platform === "macos-arm64" ? join18(`${appName}.app`, "Contents") : appName.replaceAll(" ", "");
6227
+ const resources = join18(payloadRoot, prefix, "Resources");
5957
6228
  const bin = platform === "macos-arm64" ? "MacOS" : "bin", suffix = platform === "windows-x64" ? ".exe" : "";
5958
6229
  const executables = [
5959
- join16(bin, `launcher${suffix}`),
5960
- join16(bin, `bun${suffix}`),
6230
+ join18(bin, `launcher${suffix}`),
6231
+ join18(bin, `bun${suffix}`),
5961
6232
  ...sidecars.map((name) => sidecarBundlePath(name, platform))
5962
6233
  ];
5963
6234
  const critical = [
@@ -5967,21 +6238,21 @@ async function extractVerifiedUpdate(options) {
5967
6238
  "Resources/app/client/index.html"
5968
6239
  ];
5969
6240
  for (const path of critical) {
5970
- const item = await lstat12(join16(payloadRoot, prefix, path));
6241
+ const item = await lstat12(join18(payloadRoot, prefix, path));
5971
6242
  if (!item.isFile() || item.isSymbolicLink() || item.size < 1 || platform !== "windows-x64" && process.platform !== "win32" && executables.includes(path) && !(item.mode & 64))
5972
6243
  throw new Error("Invalid critical update file");
5973
6244
  }
5974
6245
  for (const name of ["version.json", "build.json"]) {
5975
- const metadata = await lstat12(join16(resources, name));
6246
+ const metadata = await lstat12(join18(resources, name));
5976
6247
  if (!metadata.isFile() || metadata.isSymbolicLink() || metadata.size < 1 || metadata.size > 1048576)
5977
6248
  throw new Error("Invalid update metadata");
5978
6249
  }
5979
- if (JSON.parse(await readFile6(join16(resources, "version.json"), "utf8")).version !== descriptor.version)
6250
+ if (JSON.parse(await readFile6(join18(resources, "version.json"), "utf8")).version !== descriptor.version)
5980
6251
  throw new Error("Update version mismatch");
5981
- assertBuildMetadata(JSON.parse(await readFile6(join16(resources, "build.json"), "utf8")), renderer);
6252
+ assertBuildMetadata(JSON.parse(await readFile6(join18(resources, "build.json"), "utf8")), renderer);
5982
6253
  return {
5983
6254
  directory,
5984
- payload: join16(payloadRoot, platform === "macos-arm64" ? `${appName}.app` : prefix)
6255
+ payload: join18(payloadRoot, platform === "macos-arm64" ? `${appName}.app` : prefix)
5985
6256
  };
5986
6257
  } catch (error) {
5987
6258
  if (directory)
@@ -5996,16 +6267,16 @@ async function extractVerifiedUpdate(options) {
5996
6267
  import { createHash as createHash13 } from "crypto";
5997
6268
  import { constants as constants7 } from "fs";
5998
6269
  import { lstat as lstat13, open as open9, readdir as readdir7, readFile as readFile7, readlink as readlink2 } from "fs/promises";
5999
- import { basename as basename8, dirname as dirname6, join as join19 } from "path";
6270
+ import { basename as basename8, dirname as dirname6, join as join21 } from "path";
6000
6271
 
6001
6272
  // ../../src/updates/update-state-store.ts
6002
6273
  import { randomUUID as randomUUID2 } from "crypto";
6003
6274
  import { constants as constants6 } from "fs";
6004
6275
  import { open as open8, rename, unlink, writeFile as writeFile5 } from "fs/promises";
6005
- import { join as join18 } from "path";
6276
+ import { join as join20 } from "path";
6006
6277
 
6007
6278
  // ../../src/updates/locks/update-lock.ts
6008
- import { basename as basename7, dirname as dirname5, join as join17 } from "path";
6279
+ import { basename as basename7, dirname as dirname5, join as join19 } from "path";
6009
6280
 
6010
6281
  // ../../src/updates/locks/native-file-lock.ts
6011
6282
  import { constants as constants5 } from "fs";
@@ -6173,7 +6444,7 @@ async function tryAcquireWindows(path, mode) {
6173
6444
  function updateLockPath(target) {
6174
6445
  if (!isCanonicalPath(target))
6175
6446
  throw new Error("Invalid update lock target");
6176
- return join17(dirname5(target), `.${basename7(target)}.framework-update.lock`);
6447
+ return join19(dirname5(target), `.${basename7(target)}.framework-update.lock`);
6177
6448
  }
6178
6449
  async function tryAcquireUpdateLock(target) {
6179
6450
  return tryAcquireNativeFileLock(updateLockPath(target), "exclusive");
@@ -6238,7 +6509,7 @@ function parseState(value) {
6238
6509
  return Object.freeze(record);
6239
6510
  }
6240
6511
  async function readUpdateStageState(staging) {
6241
- const text = await readSmallStateFile(join18(staging, "state.json"), 4096, "Invalid update staging state");
6512
+ const text = await readSmallStateFile(join20(staging, "state.json"), 4096, "Invalid update staging state");
6242
6513
  return text === undefined ? undefined : parseState(JSON.parse(text));
6243
6514
  }
6244
6515
  async function writeUpdateStageState(staging, state) {
@@ -6247,8 +6518,8 @@ async function writeUpdateStageState(staging, state) {
6247
6518
  async function replaceUpdateStageState(staging, state, durable) {
6248
6519
  if (typeof state.generation !== "string" || !isUuid(state.generation))
6249
6520
  throw new Error("Invalid update staging state");
6250
- const path = join18(staging, "state.json");
6251
- const temporary = join18(staging, `.state-${state.generation}-${randomUUID2()}.tmp`);
6521
+ const path = join20(staging, "state.json");
6522
+ const temporary = join20(staging, `.state-${state.generation}-${randomUUID2()}.tmp`);
6252
6523
  const contents = JSON.stringify(state) + `
6253
6524
  `;
6254
6525
  let renamed = false;
@@ -6286,10 +6557,10 @@ async function withUpdateLock(target, operation) {
6286
6557
  function updateStagingFor(target) {
6287
6558
  if (!isCanonicalPath(target))
6288
6559
  throw new Error("Invalid update target");
6289
- return join19(dirname6(target), `.${basename8(target)}.framework-update`);
6560
+ return join21(dirname6(target), `.${basename8(target)}.framework-update`);
6290
6561
  }
6291
6562
  async function readUpdateTreeVersion(tree) {
6292
- const versionPath = join19(tree, ...process.platform === "darwin" ? ["Contents", "Resources"] : ["Resources"], "version.json");
6563
+ const versionPath = join21(tree, ...process.platform === "darwin" ? ["Contents", "Resources"] : ["Resources"], "version.json");
6293
6564
  try {
6294
6565
  const value = JSON.parse(await readFile7(versionPath, "utf8"));
6295
6566
  if (typeof value !== "object" || value === null || typeof value.version !== "string")
@@ -6383,7 +6654,7 @@ async function readUpdateTreeDigest(tree, options = {}) {
6383
6654
  if (before.isDirectory()) {
6384
6655
  const names = (await limit(() => readdir7(path))).map((name) => ({ name, bytes: Buffer.from(name, "utf8") })).toSorted((left, right) => Buffer.compare(left.bytes, right.bytes)).map(({ name }) => name);
6385
6656
  const children = await Promise.all(names.map(async (name) => {
6386
- const childPath = join19(path, name);
6657
+ const childPath = join21(path, name);
6387
6658
  return list(childPath, relative ? `${relative}/${name}` : name, await limit(() => lstat13(childPath, { bigint: true })));
6388
6659
  }));
6389
6660
  return [{ kind: "directory", path, relative, before }, ...children.flat()];
@@ -6526,8 +6797,8 @@ async function swapUpdateTreeWhileLocked(options, exchangeOperation = exchangeDi
6526
6797
  const { target, staging } = options;
6527
6798
  if (dirname6(staging) !== dirname6(target) || staging === target)
6528
6799
  throw new Error("Invalid update swap context");
6529
- const candidate = join19(staging, "candidate");
6530
- const legacyOld = join19(staging, "old");
6800
+ const candidate = join21(staging, "candidate");
6801
+ const legacyOld = join21(staging, "old");
6531
6802
  if (await pathExists(legacyOld))
6532
6803
  throw new Error("A legacy update tree requires recovery before another swap");
6533
6804
  await assertDirectory(target);
@@ -6557,10 +6828,10 @@ async function swapUpdateTreeWhileLocked(options, exchangeOperation = exchangeDi
6557
6828
 
6558
6829
  // ../../src/updates/retention/retirement-inventory.ts
6559
6830
  import { lstat as lstat15, readdir as readdir9 } from "fs/promises";
6560
- import { basename as basename12, dirname as dirname10, join as join23 } from "path";
6831
+ import { basename as basename12, dirname as dirname10, join as join25 } from "path";
6561
6832
 
6562
6833
  // ../../src/updates/retention/update-retention-marker.ts
6563
- import { basename as basename9, dirname as dirname7, join as join20 } from "path";
6834
+ import { basename as basename9, dirname as dirname7, join as join22 } from "path";
6564
6835
  var LOWERCASE_UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
6565
6836
  var IDENTITY_COMPONENT = /^[1-9]\d{0,19}$/;
6566
6837
  function assertCanonicalTarget(target) {
@@ -6579,28 +6850,28 @@ function isTreeIdentity(value) {
6579
6850
  function updateRetentionIntentPath(target, generation) {
6580
6851
  assertCanonicalTarget(target);
6581
6852
  assertGeneration(generation);
6582
- return join20(dirname7(target), `.${basename9(target)}.framework-prune-${generation}.json`);
6853
+ return join22(dirname7(target), `.${basename9(target)}.framework-prune-${generation}.json`);
6583
6854
  }
6584
6855
 
6585
6856
  // ../../src/updates/retention/retention-prune-progress.ts
6586
- import { basename as basename11, dirname as dirname9, join as join22 } from "path";
6857
+ import { basename as basename11, dirname as dirname9, join as join24 } from "path";
6587
6858
 
6588
6859
  // ../../src/updates/retention/retirement-records.ts
6589
6860
  import { lstat as lstat14, readdir as readdir8, writeFile as writeFile6 } from "fs/promises";
6590
- import { basename as basename10, dirname as dirname8, join as join21 } from "path";
6861
+ import { basename as basename10, dirname as dirname8, join as join23 } from "path";
6591
6862
  function updateRetirementPaths(target, generation) {
6592
6863
  if (!isCanonicalPath(target) || !isUuid(generation))
6593
6864
  throw new Error("Invalid update retirement identity");
6594
6865
  const prefix = `.${basename10(target)}.framework-retired-${generation}`;
6595
- const container = join21(dirname8(target), prefix);
6866
+ const container = join23(dirname8(target), prefix);
6596
6867
  return Object.freeze({
6597
6868
  container,
6598
- tree: join21(container, "tree"),
6599
- healthReceipt: join21(container, "healthy.json"),
6869
+ tree: join23(container, "tree"),
6870
+ healthReceipt: join23(container, "healthy.json"),
6600
6871
  healthTemporaryPrefix: ".healthy-",
6601
- claim: join21(dirname8(target), `${prefix}.claim.json`),
6872
+ claim: join23(dirname8(target), `${prefix}.claim.json`),
6602
6873
  claimTemporaryPrefix: `${prefix}.claim-`,
6603
- cleanupMarker: join21(dirname8(target), `.${basename10(target)}.framework-update-cleanup.json`),
6874
+ cleanupMarker: join23(dirname8(target), `.${basename10(target)}.framework-update-cleanup.json`),
6604
6875
  cleanupMarkerTemporaryPrefix: `.${basename10(target)}.framework-update-cleanup-`
6605
6876
  });
6606
6877
  }
@@ -6704,10 +6975,10 @@ async function assertNoUpdateRetentionPruneArtifactsWhileLocked(target) {
6704
6975
 
6705
6976
  // ../../src/updates/retention/update-retirement.ts
6706
6977
  import { lstat as lstat16, mkdir as mkdir8, readdir as readdir10, rmdir, unlink as unlink2, writeFile as writeFile7 } from "fs/promises";
6707
- import { basename as basename13, dirname as dirname11, join as join24 } from "path";
6978
+ import { basename as basename13, dirname as dirname11, join as join26 } from "path";
6708
6979
  async function reconcileRetirementCleanupMarkerWhileLocked(options) {
6709
6980
  const { target, staging, currentVersion } = options;
6710
- const markerPath = join24(dirname11(target), `.${basename13(target)}.framework-update-cleanup.json`);
6981
+ const markerPath = join26(dirname11(target), `.${basename13(target)}.framework-update-cleanup.json`);
6711
6982
  const markerInfo = await pathInfo(markerPath);
6712
6983
  if (!markerInfo)
6713
6984
  return "none";
@@ -6748,7 +7019,7 @@ async function assertInstalledVersion(options) {
6748
7019
  const info = await lstat17(options.target);
6749
7020
  if (!info.isDirectory() || info.isSymbolicLink() || await realpath7(options.target) !== options.target)
6750
7021
  throw new Error("Invalid update install target");
6751
- const versionFile = join25(options.target, ...options.platform === "macos-arm64" ? ["Contents", "Resources"] : ["Resources"], "version.json");
7022
+ const versionFile = join27(options.target, ...options.platform === "macos-arm64" ? ["Contents", "Resources"] : ["Resources"], "version.json");
6752
7023
  const versionInfo = await lstat17(versionFile);
6753
7024
  if (!versionInfo.isFile() || versionInfo.size > 1024 * 1024)
6754
7025
  throw new Error("Installed update version mismatch");
@@ -6772,7 +7043,7 @@ async function stageUpdateSwap(options) {
6772
7043
  });
6773
7044
  const staging = updateStagingFor(plan.target);
6774
7045
  const preparing = await mkdtemp8(`${staging}.preparing-`);
6775
- const candidate = join25(staging, "candidate");
7046
+ const candidate = join27(staging, "candidate");
6776
7047
  let published = false;
6777
7048
  try {
6778
7049
  const extracted = await extractVerifiedUpdate({
@@ -6786,12 +7057,12 @@ async function stageUpdateSwap(options) {
6786
7057
  maxExpandedBytes: options.maxExpandedBytes,
6787
7058
  ...options.sidecars === undefined ? {} : { sidecars: options.sidecars }
6788
7059
  });
6789
- renameExclusive(extracted.payload, join25(preparing, "candidate"));
7060
+ renameExclusive(extracted.payload, join27(preparing, "candidate"));
6790
7061
  await rm8(extracted.directory, { recursive: true, force: true });
6791
- const candidateTreeIdentity = await readUpdateTreeIdentity(join25(preparing, "candidate"));
7062
+ const candidateTreeIdentity = await readUpdateTreeIdentity(join27(preparing, "candidate"));
6792
7063
  if (!candidateTreeIdentity)
6793
7064
  throw new Error("Update candidate tree identity could not be read");
6794
- const candidateTreeDigest = await readUpdateTreeDigest(join25(preparing, "candidate"));
7065
+ const candidateTreeDigest = await readUpdateTreeDigest(join27(preparing, "candidate"));
6795
7066
  await writeUpdateStageState(preparing, newUpdateStageState({
6796
7067
  version: plan.version,
6797
7068
  previousVersion: options.currentVersion,
@@ -6876,11 +7147,11 @@ function isolatedEnv(parent, profile, platform) {
6876
7147
  RUNNER_ENVIRONMENT: "github-hosted",
6877
7148
  HOME: profile,
6878
7149
  USERPROFILE: profile,
6879
- LOCALAPPDATA: join26(profile, "LocalAppData"),
6880
- XDG_DATA_HOME: join26(profile, ".local", "share"),
6881
- TMP: join26(profile, "tmp"),
6882
- TEMP: join26(profile, "tmp"),
6883
- TMPDIR: join26(profile, "tmp"),
7150
+ LOCALAPPDATA: join28(profile, "LocalAppData"),
7151
+ XDG_DATA_HOME: join28(profile, ".local", "share"),
7152
+ TMP: join28(profile, "tmp"),
7153
+ TEMP: join28(profile, "tmp"),
7154
+ TMPDIR: join28(profile, "tmp"),
6884
7155
  ELECTROBUN_INSTALLER_UI_AUTOCLOSE: "1"
6885
7156
  });
6886
7157
  if (platform === "windows-x64")
@@ -6975,15 +7246,15 @@ async function observeInstalledApp(options) {
6975
7246
  await preflightInstallerRuntime({ env: parent, runtime: candidate.path, bootstrap });
6976
7247
  stage("runtime-preflight-passed");
6977
7248
  for (const path of [
6978
- join26(prepared.profile, "LocalAppData"),
6979
- join26(prepared.profile, ".local", "share"),
6980
- join26(prepared.profile, "tmp")
7249
+ join28(prepared.profile, "LocalAppData"),
7250
+ join28(prepared.profile, ".local", "share"),
7251
+ join28(prepared.profile, "tmp")
6981
7252
  ])
6982
7253
  await mkdir9(path, { recursive: true, mode: 448 });
6983
7254
  const mac = options.platform === "macos-arm64", windows = options.platform === "windows-x64";
6984
- const installedRoot = mac ? join26(prepared.incoming, `${options.appName}.app`, "Contents") : join26(prepared.profile, windows ? "LocalAppData" : ".local/share", options.appId, "stable", "app");
6985
- const resources = join26(installedRoot, "Resources"), binary = join26(installedRoot, mac ? "MacOS" : "bin"), launcher = join26(binary, windows ? "launcher.exe" : "launcher"), runtime = join26(binary, windows ? "bun.exe" : "bun");
6986
- const worker = join26(resources, "app", "bun", "index.js");
7255
+ const installedRoot = mac ? join28(prepared.incoming, `${options.appName}.app`, "Contents") : join28(prepared.profile, windows ? "LocalAppData" : ".local/share", options.appId, "stable", "app");
7256
+ const resources = join28(installedRoot, "Resources"), binary = join28(installedRoot, mac ? "MacOS" : "bin"), launcher = join28(binary, windows ? "launcher.exe" : "launcher"), runtime = join28(binary, windows ? "bun.exe" : "bun");
7257
+ const worker = join28(resources, "app", "bun", "index.js");
6987
7258
  const sidecars = options.sidecars ?? [];
6988
7259
  let foreignHits = 0;
6989
7260
  const sentinel = policy ? Bun.serve({
@@ -7034,7 +7305,7 @@ async function observeInstalledApp(options) {
7034
7305
  throw new Error("Foreign network sentinel unavailable");
7035
7306
  foreignHits = 0;
7036
7307
  const nonce = randomBytes2(24).toString("hex");
7037
- const ack = join26(run.directory, "ack"), permit = join26(run.directory, "permit"), observation = join26(run.directory, "observation"), unexpected = join26(run.directory, "unexpected"), pidRecord = join26(run.directory, "worker-pid");
7308
+ const ack = join28(run.directory, "ack"), permit = join28(run.directory, "permit"), observation = join28(run.directory, "observation"), unexpected = join28(run.directory, "unexpected"), pidRecord = join28(run.directory, "worker-pid");
7038
7309
  const env = {
7039
7310
  ...baseEnv,
7040
7311
  FRAMEWORK_CI_NONCE: nonce,
@@ -7047,13 +7318,13 @@ async function observeInstalledApp(options) {
7047
7318
  };
7048
7319
  let launchRecord, expectedApp;
7049
7320
  if (mac && viaInstaller) {
7050
- const shimDir = join26(run.directory, "launch-shim");
7321
+ const shimDir = join28(run.directory, "launch-shim");
7051
7322
  await mkdir9(shimDir, { mode: 448 });
7052
- const path = join26(shimDir, "open");
7323
+ const path = join28(shimDir, "open");
7053
7324
  await writeFile8(path, shim, { flag: "wx", mode: 448 });
7054
7325
  await chmod2(path, 448);
7055
- expectedApp = join26(await realpath8(prepared.incoming), `${options.appName}.app`);
7056
- launchRecord = join26(run.directory, "launch-record");
7326
+ expectedApp = join28(await realpath8(prepared.incoming), `${options.appName}.app`);
7327
+ launchRecord = join28(run.directory, "launch-record");
7057
7328
  Object.assign(env, {
7058
7329
  PATH: shimDir + delimiter + (env.PATH ?? ""),
7059
7330
  FRAMEWORK_CI_EXPECTED_APP: expectedApp,
@@ -7089,7 +7360,7 @@ async function observeInstalledApp(options) {
7089
7360
  const error = installerErrorName(await Promise.race([installerStderr, Bun.sleep(2000).then(() => "")]));
7090
7361
  throw new Error(`Installer exited unsuccessfully (exit=${installer.exitCode}, signal=${installer.signalCode ?? "none"}, ` + `ready=${await pathExists(worker) && await pathExists(launcher)}, acknowledged=${await pathExists(ack)}, ` + `error=${error ?? "none"})`);
7091
7362
  }
7092
- const ready = await pathExists(worker) && await pathExists(launcher) && await pathExists(join26(resources, "version.json"));
7363
+ const ready = await pathExists(worker) && await pathExists(launcher) && await pathExists(join28(resources, "version.json"));
7093
7364
  if (installer && shouldLaunchInstalledApp({
7094
7365
  platform: options.platform,
7095
7366
  ready,
@@ -7265,7 +7536,7 @@ async function observeInstalledApp(options) {
7265
7536
  await swapAfterExit(target, staged.staging);
7266
7537
  stage("update-swapped");
7267
7538
  await preflightInstallerRuntime({ env: parent, runtime, bootstrap });
7268
- const directory = join26(prepared.directory, "update");
7539
+ const directory = join28(prepared.directory, "update");
7269
7540
  await mkdir9(directory, { mode: 448 });
7270
7541
  const updated = await observeRun({
7271
7542
  directory,
@@ -7314,7 +7585,7 @@ async function qualifyInstallerCommand(options) {
7314
7585
  const parsed = parseReleaseConfig(config), requirements = parsed.requirements(tag), policy = requirements.offlinePolicy, names = requirements.platforms[platform];
7315
7586
  if (!policy || !names || names.length !== 2)
7316
7587
  throw new Error("Installer qualification requires an explicit offline policy and payloads");
7317
- const directory = resolve13(options.directory), destination = join27(directory, `installer-test-${platform}.json`);
7588
+ const directory = resolve13(options.directory), destination = join29(directory, `installer-test-${platform}.json`);
7318
7589
  try {
7319
7590
  await lstat18(destination);
7320
7591
  throw new Error("Installer receipt already exists");
@@ -7330,8 +7601,8 @@ async function qualifyInstallerCommand(options) {
7330
7601
  appName: app.appName,
7331
7602
  appId: app.appId,
7332
7603
  version: plan.version,
7333
- installer: join27(directory, names[0]),
7334
- archive: join27(directory, names[1]),
7604
+ installer: join29(directory, names[0]),
7605
+ archive: join29(directory, names[1]),
7335
7606
  expectedReads: parsed.expectedReads,
7336
7607
  offlinePolicy: policy,
7337
7608
  sidecars: parsed.sidecars
@@ -7363,7 +7634,7 @@ async function qualifyInstallerCommand(options) {
7363
7634
 
7364
7635
  // ../../src/installer/installer-upgrade-command.ts
7365
7636
  import { lstat as lstat19, mkdir as mkdir10, rename as rename2, writeFile as writeFile10 } from "fs/promises";
7366
- import { join as join29, resolve as resolve15 } from "path";
7637
+ import { join as join31, resolve as resolve15 } from "path";
7367
7638
 
7368
7639
  // ../../src/installer/upgrade-asset-download.ts
7369
7640
  import { createHash as createHash14 } from "crypto";
@@ -7499,7 +7770,7 @@ async function discoverSignedRelease(options) {
7499
7770
 
7500
7771
  // ../../src/updates/install/update-download.ts
7501
7772
  import { mkdtemp as mkdtemp9, open as open11, realpath as realpath9, rm as rm9 } from "fs/promises";
7502
- import { basename as basename14, dirname as dirname13, join as join28, resolve as resolve14 } from "path";
7773
+ import { basename as basename14, dirname as dirname13, join as join30, resolve as resolve14 } from "path";
7503
7774
  async function downloadVerifiedRelease(options) {
7504
7775
  const { descriptor, maxBytes } = options;
7505
7776
  const timeout = options.timeoutMs ?? 120000;
@@ -7532,12 +7803,12 @@ async function downloadVerifiedRelease(options) {
7532
7803
  throw new Error("Release download size mismatch");
7533
7804
  }
7534
7805
  const root = options.createTemporaryDirectory ? await realpath9(resolve14(options.directory)) : resolve14(options.directory);
7535
- const allocated = options.createTemporaryDirectory ? await options.createTemporaryDirectory(root) : await mkdtemp9(join28(root, "framework-update-"));
7806
+ const allocated = options.createTemporaryDirectory ? await options.createTemporaryDirectory(root) : await mkdtemp9(join30(root, "framework-update-"));
7536
7807
  const temporaryDirectory = resolve14(allocated);
7537
7808
  if (dirname13(temporaryDirectory) !== root || !basename14(temporaryDirectory).startsWith("framework-update-"))
7538
7809
  throw new Error("Invalid update download directory");
7539
7810
  temporary = temporaryDirectory;
7540
- const path = join28(temporary, "archive");
7811
+ const path = join30(temporary, "archive");
7541
7812
  const file = await open11(path, "wx", 384);
7542
7813
  try {
7543
7814
  async function* writeChunks() {
@@ -7640,7 +7911,7 @@ async function qualifyUpgradeCommand(options) {
7640
7911
  const parsed = parseReleaseConfig(config), feed = feedUrl(parsed.feed), requirements = parsed.requirements(tag), names = requirements.platforms[platform];
7641
7912
  if (!requirements.offlinePolicy || !names || names.length !== 2)
7642
7913
  throw new Error("Upgrade qualification requires an explicit offline policy and payloads");
7643
- const directory = resolve15(options.directory), destination = join29(directory, `upgrade-test-${platform}.json`);
7914
+ const directory = resolve15(options.directory), destination = join31(directory, `upgrade-test-${platform}.json`);
7644
7915
  try {
7645
7916
  await lstat19(destination);
7646
7917
  throw new Error("Upgrade receipt already exists");
@@ -7663,7 +7934,7 @@ async function qualifyUpgradeCommand(options) {
7663
7934
  const channel = "daily";
7664
7935
  const trust = { ...base, channel };
7665
7936
  const discovery = discoveryName(config, channel, platform);
7666
- const signed = await readJsonFile(join29(directory, discovery), 65536, "staged descriptor");
7937
+ const signed = await readJsonFile(join31(directory, discovery), 65536, "staged descriptor");
7667
7938
  const verified = verifyReleaseDescriptor(signed, trust);
7668
7939
  if (!verified.ok || verified.descriptor.tag !== tag || verified.descriptor.asset.name !== names[1])
7669
7940
  throw new Error("Untrusted staged descriptor");
@@ -7686,7 +7957,7 @@ async function qualifyUpgradeCommand(options) {
7686
7957
  return null;
7687
7958
  if (previous.tag === tag || !versionLessThan(previous.version, descriptor.version))
7688
7959
  throw new Error("Previous release is not older than this release");
7689
- const work = join29(directory, `upgrade-${platform}`);
7960
+ const work = join31(directory, `upgrade-${platform}`);
7690
7961
  await mkdir10(work, { mode: 448 });
7691
7962
  const downloaded = await downloadVerifiedRelease({
7692
7963
  descriptor: previous,
@@ -7695,12 +7966,12 @@ async function qualifyUpgradeCommand(options) {
7695
7966
  timeoutMs: 600000,
7696
7967
  fetch: fetcher
7697
7968
  });
7698
- const previousArchive = join29(work, previous.asset.name);
7969
+ const previousArchive = join31(work, previous.asset.name);
7699
7970
  await rename2(downloaded.path, previousArchive);
7700
7971
  const installerName = parsed.requirements(previous.tag).platforms[platform]?.[0];
7701
7972
  if (!installerName)
7702
7973
  throw new Error("Previous release has no installer for this platform");
7703
- const previousInstaller = join29(work, installerName);
7974
+ const previousInstaller = join31(work, installerName);
7704
7975
  await downloadAsset({
7705
7976
  feed,
7706
7977
  tag: previous.tag,
@@ -7724,7 +7995,7 @@ async function qualifyUpgradeCommand(options) {
7724
7995
  update: {
7725
7996
  descriptor,
7726
7997
  trust,
7727
- archive: join29(directory, names[1]),
7998
+ archive: join31(directory, names[1]),
7728
7999
  maxCompressedBytes: MAX_COMPRESSED_BYTES2,
7729
8000
  maxExpandedBytes: MAX_EXPANDED_BYTES2
7730
8001
  }
@@ -7779,7 +8050,7 @@ function electrobunArtifacts(appName, platform) {
7779
8050
  }
7780
8051
 
7781
8052
  // src/library/steps.ts
7782
- var selectRetainedStepEffect = (context) => Effect22.gen(function* () {
8053
+ var selectRetainedStepEffect = (context) => Effect24.gen(function* () {
7783
8054
  const output = context.env.GITHUB_OUTPUT;
7784
8055
  if (!output)
7785
8056
  return yield* fail("Expected GITHUB_OUTPUT");
@@ -7791,7 +8062,7 @@ runId=${result.runId}
7791
8062
  ` : `reuse=false
7792
8063
  `));
7793
8064
  });
7794
- var stageBuildStepEffect = (context, directory, artifacts = "artifacts") => Effect22.gen(function* () {
8065
+ var stageBuildStepEffect = (context, directory, artifacts = "artifacts") => Effect24.gen(function* () {
7795
8066
  const fs = yield* ReleaseFs;
7796
8067
  const [installerAsset, archiveAsset] = platformAssets(context);
7797
8068
  const [installer, archive] = electrobunArtifacts(context.config.appName, context.platform);
@@ -7800,12 +8071,12 @@ var stageBuildStepEffect = (context, directory, artifacts = "artifacts") => Effe
7800
8071
  yield* step(() => fs.mkdir(directory, { recursive: true }));
7801
8072
  const packed = yield* scopedTempDirectory("framework-command-pack-");
7802
8073
  const sources = {
7803
- [installerAsset]: join30(artifacts, installer),
7804
- [archiveAsset]: join30(artifacts, archive)
8074
+ [installerAsset]: join32(artifacts, installer),
8075
+ [archiveAsset]: join32(artifacts, archive)
7805
8076
  };
7806
8077
  for (const policy of parsed.commandArtifacts) {
7807
8078
  const name = requirements.commandArtifacts[policy.kind][context.platform];
7808
- sources[name] = join30(packed, name);
8079
+ sources[name] = join32(packed, name);
7809
8080
  yield* step(() => packCommandArtifact({
7810
8081
  source: policy.build,
7811
8082
  archive: sources[name],
@@ -7814,8 +8085,8 @@ var stageBuildStepEffect = (context, directory, artifacts = "artifacts") => Effe
7814
8085
  }));
7815
8086
  }
7816
8087
  return yield* stagePlatformArtifactsEffect({ ...context, directory, sources });
7817
- }).pipe(Effect22.scoped);
7818
- var inspectStagedStepEffect = (context, directory) => Effect22.gen(function* () {
8088
+ }).pipe(Effect24.scoped);
8089
+ var inspectStagedStepEffect = (context, directory) => Effect24.gen(function* () {
7819
8090
  const fs = yield* ReleaseFs;
7820
8091
  const parsed = parseReleaseConfig(context.config);
7821
8092
  const requirements = parsed.requirements(context.tag);
@@ -7823,10 +8094,10 @@ var inspectStagedStepEffect = (context, directory) => Effect22.gen(function* ()
7823
8094
  const entries = yield* step(() => fs.readdir(directory, { withFileTypes: true }));
7824
8095
  if (entries.length !== assets.length || entries.some((entry) => !entry.isFile() || !assets.includes(entry.name)))
7825
8096
  return yield* fail("Staged platform directory contains unexpected files");
7826
- const [installer, archive] = platformAssets(context).map((name) => join30(directory, name));
8097
+ const [installer, archive] = platformAssets(context).map((name) => join32(directory, name));
7827
8098
  for (const policy of parsed.commandArtifacts)
7828
8099
  yield* step(() => readCommandArtifact({
7829
- archive: join30(directory, requirements.commandArtifacts[policy.kind][context.platform]),
8100
+ archive: join32(directory, requirements.commandArtifacts[policy.kind][context.platform]),
7830
8101
  executable: policy.executable,
7831
8102
  platform: context.platform
7832
8103
  }));
@@ -7842,12 +8113,12 @@ var inspectStagedStepEffect = (context, directory) => Effect22.gen(function* ()
7842
8113
  }))
7843
8114
  };
7844
8115
  });
7845
- var qualifyStepEffect = (context, directory) => Effect22.gen(function* () {
8116
+ var qualifyStepEffect = (context, directory) => Effect24.gen(function* () {
7846
8117
  const mode = stepRenderer(context.env);
7847
8118
  yield* step(() => qualifyCommandArtifactsCommand({ ...context, directory }));
7848
8119
  yield* step(() => qualifyInstallerCommand({ ...context, renderer: mode, directory }));
7849
8120
  });
7850
- var qualifyUpgradeStepEffect = (context, directory, onStage) => Effect22.suspend(() => {
8121
+ var qualifyUpgradeStepEffect = (context, directory, onStage) => Effect24.suspend(() => {
7851
8122
  const renderer = stepRenderer(context.env);
7852
8123
  return step(() => qualifyUpgradeCommand({ ...context, renderer, directory, ...onStage ? { onStage } : {} }));
7853
8124
  });
@@ -7858,12 +8129,15 @@ var inspectStagedStep = (context, directory) => run2(context, inspectStagedStepE
7858
8129
  var qualifyStep = (context, directory) => run2(context, qualifyStepEffect(context, directory));
7859
8130
  var qualifyUpgradeStep = (context, directory, onStage) => run2(context, qualifyUpgradeStepEffect(context, directory, onStage));
7860
8131
  export {
8132
+ createDailyNativeReceipt,
7861
8133
  createGitHubPromotionProvider,
7862
8134
  createGitHubReleasePublisher,
7863
8135
  createMacosDmg,
8136
+ desktopDailyProfile,
7864
8137
  fileIdentity2 as fileIdentity,
7865
8138
  finalizeReleasePleaseDraft,
7866
8139
  inspectStagedStep,
8140
+ planDailyReleaseMatrix,
7867
8141
  planQualificationRun2 as planQualificationRun,
7868
8142
  planReleaseAssets2 as planReleaseAssets,
7869
8143
  publishFrameworkPackage,
@@ -7880,6 +8154,7 @@ export {
7880
8154
  stageBuildStep,
7881
8155
  stagePlatformArtifacts,
7882
8156
  stageReleaseDescriptors,
8157
+ verifyDailyReleaseMatrix,
7883
8158
  verifyImage,
7884
8159
  writeDescriptors
7885
8160
  };