@adea-ai/app-framework-release-tools 0.11.2 → 0.11.4

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.
@@ -0,0 +1,22 @@
1
+ export function isRecord(value) {
2
+ return typeof value === "object" && value !== null && !Array.isArray(value);
3
+ }
4
+ export function hasExactOwnKeys(value, expected) {
5
+ const actual = Reflect.ownKeys(value);
6
+ return actual.length === expected.length && actual.every((key) => typeof key === "string" && expected.includes(key));
7
+ }
8
+ export const UUID_SOURCE = /[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/.source;
9
+ const UUID = new RegExp(`^${UUID_SOURCE}$`, "i");
10
+ export function isUuid(value) {
11
+ return typeof value === "string" && UUID.test(value);
12
+ }
13
+ export function isGitSha(value) {
14
+ return typeof value === "string" && /^[a-f0-9]{40}$/.test(value);
15
+ }
16
+ export function isSha256Hex(value) {
17
+ return typeof value === "string" && /^[a-f0-9]{64}$/.test(value);
18
+ }
19
+ export function errorCode(error) {
20
+ const code = isRecord(error) || error instanceof Error ? error.code : void 0;
21
+ return typeof code === "string" ? code : void 0;
22
+ }
package/dist/cli.js CHANGED
@@ -7035,9 +7035,9 @@ import { delimiter, dirname as dirname12, join as join32 } from "path";
7035
7035
  // ../../src/installer/installer-ci-bootstrap.ts
7036
7036
  import { randomBytes as randomBytes2 } from "crypto";
7037
7037
  import { lstat as lstat10, mkdir as mkdir5, mkdtemp as mkdtemp6, realpath as realpath3, rm as rm6, writeFile as writeFile5 } from "fs/promises";
7038
- import { dirname as dirname4, isAbsolute as isAbsolute5, join as join19, relative as relative5, sep as sep3 } from "path";
7038
+ import { basename as basename6, dirname as dirname4, isAbsolute as isAbsolute5, join as join19, relative as relative5, sep as sep3 } from "path";
7039
7039
  import { fileURLToPath } from "url";
7040
- var bootstrapModules = [
7040
+ var installerCiBootstrapModules = [
7041
7041
  "app/value-guards.js",
7042
7042
  "installer/installer-ci-worker.js",
7043
7043
  "installer/installer-ci-preflight.js",
@@ -7061,10 +7061,11 @@ async function prepareInstallerCiBootstrap(env = process.env) {
7061
7061
  const parent = await realpath3(temp);
7062
7062
  if (/\s/.test(parent) || !(await lstat10(parent)).isDirectory())
7063
7063
  throw new Error("Runner temp cannot represent a Bun preload path");
7064
- const source = dirname4(dirname4(fileURLToPath(import.meta.url)));
7064
+ const moduleDirectory = dirname4(fileURLToPath(import.meta.url));
7065
+ const source = basename6(moduleDirectory) === "installer" ? dirname4(moduleDirectory) : moduleDirectory;
7065
7066
  const directory = await mkdtemp6(join19(parent, "framework-ci-"));
7066
7067
  try {
7067
- for (const name of bootstrapModules) {
7068
+ for (const name of installerCiBootstrapModules) {
7068
7069
  const contents = await readBoundedFile(join19(source, name), 2 * 1024 * 1024, "installer bootstrap module");
7069
7070
  await mkdir5(dirname4(join19(directory, name)), { recursive: true, mode: 448 });
7070
7071
  await writeFile5(join19(directory, name), contents, { flag: "wx", mode: 384 });
@@ -7808,7 +7809,7 @@ import { lstat as lstat18, mkdtemp as mkdtemp9, readFile as readFile10, realpath
7808
7809
  import { join as join31 } from "path";
7809
7810
 
7810
7811
  // ../../src/updates/install/update-handoff-plan.ts
7811
- import { basename as basename6 } from "path";
7812
+ import { basename as basename7 } from "path";
7812
7813
  function planUpdateHandoff(options) {
7813
7814
  const {
7814
7815
  descriptor,
@@ -7832,7 +7833,7 @@ function planUpdateHandoff(options) {
7832
7833
  if (!expected[platform] || !["native", "cef"].includes(renderer) || !isVerifiedReleaseForTrust(descriptor, trust) || descriptor.platform !== expected[platform][0] || descriptor.arch !== expected[platform][1] || approved !== true || approvedVersion !== descriptor.version || !isReleaseVersion(currentVersion) || !versionLessThan(currentVersion, descriptor.version))
7833
7834
  throw new Error("Invalid approved update");
7834
7835
  const name = isMacInstallerPlatform(platform) ? `${appName}.app` : "app";
7835
- if (!isCanonicalPath(target) || basename6(target) !== name)
7836
+ if (!isCanonicalPath(target) || basename7(target) !== name)
7836
7837
  throw new Error("Invalid update target");
7837
7838
  return Object.freeze({
7838
7839
  target,
@@ -8083,7 +8084,7 @@ async function extractBoundArchive(options, descriptor, verifyBeforeExtraction)
8083
8084
  import { createHash as createHash21 } from "crypto";
8084
8085
  import { constants as constants7 } from "fs";
8085
8086
  import { lstat as lstat14, open as open10, readdir as readdir9, readFile as readFile9, readlink as readlink2 } from "fs/promises";
8086
- import { basename as basename8, dirname as dirname6, join as join25 } from "path";
8087
+ import { basename as basename9, dirname as dirname6, join as join25 } from "path";
8087
8088
 
8088
8089
  // ../../src/updates/update-state-store.ts
8089
8090
  import { randomUUID as randomUUID2 } from "crypto";
@@ -8092,7 +8093,7 @@ import { open as open9, rename, unlink, writeFile as writeFile6 } from "fs/promi
8092
8093
  import { join as join24 } from "path";
8093
8094
 
8094
8095
  // ../../src/updates/locks/update-lock.ts
8095
- import { basename as basename7, dirname as dirname5, join as join23 } from "path";
8096
+ import { basename as basename8, dirname as dirname5, join as join23 } from "path";
8096
8097
 
8097
8098
  // ../../src/updates/locks/native-file-lock.ts
8098
8099
  import { constants as constants5 } from "fs";
@@ -8260,7 +8261,7 @@ async function tryAcquireWindows(path, mode) {
8260
8261
  function updateLockPath(target) {
8261
8262
  if (!isCanonicalPath(target))
8262
8263
  throw new Error("Invalid update lock target");
8263
- return join23(dirname5(target), `.${basename7(target)}.framework-update.lock`);
8264
+ return join23(dirname5(target), `.${basename8(target)}.framework-update.lock`);
8264
8265
  }
8265
8266
  async function tryAcquireUpdateLock(target) {
8266
8267
  return tryAcquireNativeFileLock(updateLockPath(target), "exclusive");
@@ -8373,7 +8374,7 @@ async function withUpdateLock(target, operation) {
8373
8374
  function updateStagingFor(target) {
8374
8375
  if (!isCanonicalPath(target))
8375
8376
  throw new Error("Invalid update target");
8376
- return join25(dirname6(target), `.${basename8(target)}.framework-update`);
8377
+ return join25(dirname6(target), `.${basename9(target)}.framework-update`);
8377
8378
  }
8378
8379
  async function readUpdateTreeVersion(tree) {
8379
8380
  const versionPath = join25(tree, ...process.platform === "darwin" ? ["Contents", "Resources"] : ["Resources"], "version.json");
@@ -8644,10 +8645,10 @@ async function swapUpdateTreeWhileLocked(options, exchangeOperation = exchangeDi
8644
8645
 
8645
8646
  // ../../src/updates/retention/retirement-inventory.ts
8646
8647
  import { lstat as lstat16, readdir as readdir11 } from "fs/promises";
8647
- import { basename as basename12, dirname as dirname10, join as join29 } from "path";
8648
+ import { basename as basename13, dirname as dirname10, join as join29 } from "path";
8648
8649
 
8649
8650
  // ../../src/updates/retention/update-retention-marker.ts
8650
- import { basename as basename9, dirname as dirname7, join as join26 } from "path";
8651
+ import { basename as basename10, dirname as dirname7, join as join26 } from "path";
8651
8652
  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}$/;
8652
8653
  var IDENTITY_COMPONENT = /^[1-9]\d{0,19}$/;
8653
8654
  function assertCanonicalTarget(target) {
@@ -8666,19 +8667,19 @@ function isTreeIdentity(value) {
8666
8667
  function updateRetentionIntentPath(target, generation) {
8667
8668
  assertCanonicalTarget(target);
8668
8669
  assertGeneration(generation);
8669
- return join26(dirname7(target), `.${basename9(target)}.framework-prune-${generation}.json`);
8670
+ return join26(dirname7(target), `.${basename10(target)}.framework-prune-${generation}.json`);
8670
8671
  }
8671
8672
 
8672
8673
  // ../../src/updates/retention/retention-prune-progress.ts
8673
- import { basename as basename11, dirname as dirname9, join as join28 } from "path";
8674
+ import { basename as basename12, dirname as dirname9, join as join28 } from "path";
8674
8675
 
8675
8676
  // ../../src/updates/retention/retirement-records.ts
8676
8677
  import { lstat as lstat15, readdir as readdir10, writeFile as writeFile7 } from "fs/promises";
8677
- import { basename as basename10, dirname as dirname8, join as join27 } from "path";
8678
+ import { basename as basename11, dirname as dirname8, join as join27 } from "path";
8678
8679
  function updateRetirementPaths(target, generation) {
8679
8680
  if (!isCanonicalPath(target) || !isUuid(generation))
8680
8681
  throw new Error("Invalid update retirement identity");
8681
- const prefix = `.${basename10(target)}.framework-retired-${generation}`;
8682
+ const prefix = `.${basename11(target)}.framework-retired-${generation}`;
8682
8683
  const container = join27(dirname8(target), prefix);
8683
8684
  return Object.freeze({
8684
8685
  container,
@@ -8687,15 +8688,15 @@ function updateRetirementPaths(target, generation) {
8687
8688
  healthTemporaryPrefix: ".healthy-",
8688
8689
  claim: join27(dirname8(target), `${prefix}.claim.json`),
8689
8690
  claimTemporaryPrefix: `${prefix}.claim-`,
8690
- cleanupMarker: join27(dirname8(target), `.${basename10(target)}.framework-update-cleanup.json`),
8691
- cleanupMarkerTemporaryPrefix: `.${basename10(target)}.framework-update-cleanup-`
8691
+ cleanupMarker: join27(dirname8(target), `.${basename11(target)}.framework-update-cleanup.json`),
8692
+ cleanupMarkerTemporaryPrefix: `.${basename11(target)}.framework-update-cleanup-`
8692
8693
  });
8693
8694
  }
8694
8695
  function parseOwner(value) {
8695
8696
  if (typeof value !== "object" || value === null || Array.isArray(value))
8696
8697
  return;
8697
8698
  const record = value;
8698
- if (record.schema !== 2 || typeof record.generation !== "string" || !isUuid(record.generation) || !isCanonicalPath(record.target) || typeof record.newVersion !== "string" || !isReleaseVersion(record.newVersion) || typeof record.previousVersion !== "string" || !isReleaseVersion(record.previousVersion) || !isTreeIdentity(record.previousTreeIdentity) || !isTreeIdentity(record.newTreeIdentity) || typeof record.container !== "string" || record.container !== `.${basename10(record.target)}.framework-retired-${record.generation}` || record.tree !== "tree" || !hasExactOwnKeys(record, [
8699
+ if (record.schema !== 2 || typeof record.generation !== "string" || !isUuid(record.generation) || !isCanonicalPath(record.target) || typeof record.newVersion !== "string" || !isReleaseVersion(record.newVersion) || typeof record.previousVersion !== "string" || !isReleaseVersion(record.previousVersion) || !isTreeIdentity(record.previousTreeIdentity) || !isTreeIdentity(record.newTreeIdentity) || typeof record.container !== "string" || record.container !== `.${basename11(record.target)}.framework-retired-${record.generation}` || record.tree !== "tree" || !hasExactOwnKeys(record, [
8699
8700
  "schema",
8700
8701
  "generation",
8701
8702
  "target",
@@ -8716,7 +8717,7 @@ function parseCleanupMarker(value) {
8716
8717
  if (typeof value !== "object" || value === null || Array.isArray(value))
8717
8718
  return;
8718
8719
  const record = value;
8719
- if (record.schema !== 1 || typeof record.generation !== "string" || !isUuid(record.generation) || !isCanonicalPath(record.target) || typeof record.version !== "string" || !isReleaseVersion(record.version) || typeof record.claim !== "string" || record.claim !== basename10(updateRetirementPaths(record.target, record.generation).claim) || record.phase !== "staging-cleanup" || Object.keys(record).length !== 6)
8720
+ if (record.schema !== 1 || typeof record.generation !== "string" || !isUuid(record.generation) || !isCanonicalPath(record.target) || typeof record.version !== "string" || !isReleaseVersion(record.version) || typeof record.claim !== "string" || record.claim !== basename11(updateRetirementPaths(record.target, record.generation).claim) || record.phase !== "staging-cleanup" || Object.keys(record).length !== 6)
8720
8721
  return;
8721
8722
  return record;
8722
8723
  }
@@ -8762,13 +8763,13 @@ function retentionPruneProgressPath(target, generation) {
8762
8763
  return `${base.claim.slice(0, -".claim.json".length)}.prune-progress.json`;
8763
8764
  }
8764
8765
  function pruneProgressNames(target, generation) {
8765
- return [basename11(retentionPruneProgressPath(target, generation))];
8766
+ return [basename12(retentionPruneProgressPath(target, generation))];
8766
8767
  }
8767
8768
  function assertNoUnresolvedRetentionPruneArtifacts(target, names, allowances = {}, message = "An update retirement cleanup marker requires recovery") {
8768
- const pruneMarkerPrefix = `.${basename11(target)}.framework-prune-`;
8769
- const pruneTemporaryPrefix = `..${basename11(target)}.framework-prune-`;
8770
- const retirementPrefix = `.${basename11(target)}.framework-retired-`;
8771
- const allowedRetentionIntentName = allowances.allowedRetentionIntentGeneration ? basename11(updateRetentionIntentPath(target, allowances.allowedRetentionIntentGeneration)) : undefined;
8769
+ const pruneMarkerPrefix = `.${basename12(target)}.framework-prune-`;
8770
+ const pruneTemporaryPrefix = `..${basename12(target)}.framework-prune-`;
8771
+ const retirementPrefix = `.${basename12(target)}.framework-retired-`;
8772
+ const allowedRetentionIntentName = allowances.allowedRetentionIntentGeneration ? basename12(updateRetentionIntentPath(target, allowances.allowedRetentionIntentGeneration)) : undefined;
8772
8773
  const allowedProgressName = allowances.allowedPruneProgressGeneration ? pruneProgressNames(target, allowances.allowedPruneProgressGeneration)[0] : undefined;
8773
8774
  if (names.some((name) => {
8774
8775
  const foldedName = name.toLowerCase();
@@ -8784,17 +8785,17 @@ function assertNoUnresolvedRetentionPruneArtifacts(target, names, allowances = {
8784
8785
 
8785
8786
  // ../../src/updates/retention/retirement-inventory.ts
8786
8787
  async function assertNoUpdateRetentionPruneArtifactsWhileLocked(target) {
8787
- if (!isCanonicalPath(target) || !basename12(target))
8788
+ if (!isCanonicalPath(target) || !basename13(target))
8788
8789
  throw new Error("Invalid update retention prune gate target");
8789
8790
  assertNoUnresolvedRetentionPruneArtifacts(target, await readdir11(dirname10(target)), {}, "update retention prune requires recovery before staging");
8790
8791
  }
8791
8792
 
8792
8793
  // ../../src/updates/retention/update-retirement.ts
8793
8794
  import { lstat as lstat17, mkdir as mkdir8, readdir as readdir12, rmdir, unlink as unlink2, writeFile as writeFile8 } from "fs/promises";
8794
- import { basename as basename13, dirname as dirname11, join as join30 } from "path";
8795
+ import { basename as basename14, dirname as dirname11, join as join30 } from "path";
8795
8796
  async function reconcileRetirementCleanupMarkerWhileLocked(options) {
8796
8797
  const { target, staging, currentVersion } = options;
8797
- const markerPath = join30(dirname11(target), `.${basename13(target)}.framework-update-cleanup.json`);
8798
+ const markerPath = join30(dirname11(target), `.${basename14(target)}.framework-update-cleanup.json`);
8798
8799
  const markerInfo = await pathInfo(markerPath);
8799
8800
  if (!markerInfo)
8800
8801
  return "none";
@@ -8806,7 +8807,7 @@ async function reconcileRetirementCleanupMarkerWhileLocked(options) {
8806
8807
  return "recovery-required";
8807
8808
  const paths = updateRetirementPaths(target, marker.generation);
8808
8809
  const owner = await readOwner(paths.claim);
8809
- if (!owner || owner.target !== target || owner.generation !== marker.generation || owner.newVersion !== marker.version || marker.claim !== basename13(paths.claim) || !await matchesOwnedTree(paths.tree, owner))
8810
+ if (!owner || owner.target !== target || owner.generation !== marker.generation || owner.newVersion !== marker.version || marker.claim !== basename14(paths.claim) || !await matchesOwnedTree(paths.tree, owner))
8810
8811
  return "recovery-required";
8811
8812
  const containerInfo = await pathInfo(paths.container);
8812
8813
  if (!containerInfo?.isDirectory() || containerInfo.isSymbolicLink())
@@ -9588,7 +9589,7 @@ async function discoverSignedRelease(options) {
9588
9589
 
9589
9590
  // ../../src/updates/install/update-download.ts
9590
9591
  import { mkdtemp as mkdtemp10, open as open12, realpath as realpath10, rm as rm10 } from "fs/promises";
9591
- import { basename as basename14, dirname as dirname13, join as join34, resolve as resolve15 } from "path";
9592
+ import { basename as basename15, dirname as dirname13, join as join34, resolve as resolve15 } from "path";
9592
9593
  async function downloadVerifiedRelease(options) {
9593
9594
  const { descriptor, maxBytes } = options;
9594
9595
  const timeout = options.timeoutMs ?? 120000;
@@ -9623,7 +9624,7 @@ async function downloadVerifiedRelease(options) {
9623
9624
  const root = options.createTemporaryDirectory ? await realpath10(resolve15(options.directory)) : resolve15(options.directory);
9624
9625
  const allocated = options.createTemporaryDirectory ? await options.createTemporaryDirectory(root) : await mkdtemp10(join34(root, "framework-update-"));
9625
9626
  const temporaryDirectory = resolve15(allocated);
9626
- if (dirname13(temporaryDirectory) !== root || !basename14(temporaryDirectory).startsWith("framework-update-"))
9627
+ if (dirname13(temporaryDirectory) !== root || !basename15(temporaryDirectory).startsWith("framework-update-"))
9627
9628
  throw new Error("Invalid update download directory");
9628
9629
  temporary = temporaryDirectory;
9629
9630
  const path = join34(temporary, "archive");
@@ -9933,7 +9934,7 @@ import {
9933
9934
  import { dirname as dirname14, join as join37, resolve as resolve17 } from "path";
9934
9935
  import { promisify as promisify4 } from "util";
9935
9936
  var shasum = /^[a-f0-9]{64}$/;
9936
- var basename15 = /^[a-zA-Z0-9][a-zA-Z0-9_.-]*$/;
9937
+ var basename16 = /^[a-zA-Z0-9][a-zA-Z0-9_.-]*$/;
9937
9938
  var validTag = /^v(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)$/;
9938
9939
  var exec = promisify4(execFile4);
9939
9940
  function requireThat2(condition, message) {
@@ -9946,7 +9947,7 @@ function record2(value) {
9946
9947
  }
9947
9948
  function validIdentity(value) {
9948
9949
  const { name, size, sha256 } = record2(value);
9949
- requireThat2(typeof name === "string" && basename15.test(name) && typeof size === "number" && Number.isSafeInteger(size) && size > 0 && typeof sha256 === "string" && shasum.test(sha256), "Invalid package artifact identity");
9950
+ requireThat2(typeof name === "string" && basename16.test(name) && typeof size === "number" && Number.isSafeInteger(size) && size > 0 && typeof sha256 === "string" && shasum.test(sha256), "Invalid package artifact identity");
9950
9951
  return { name, size, sha256 };
9951
9952
  }
9952
9953
  var inspectWithNativeTools = async (tool, args) => {
@@ -10051,7 +10052,7 @@ async function stageLinuxPackagePairWithInspection(options, inspect) {
10051
10052
  const receipt = record2(options.producer);
10052
10053
  const archive = validIdentity(expected.archive);
10053
10054
  const runtime = validIdentity(expected.runtime);
10054
- requireThat2(validTag.test(expected.tag) && /^[a-f0-9]{40}$/.test(expected.sourceSha) && basename15.test(expected.debName) && expected.debName.endsWith(".deb") && basename15.test(expected.appImageName) && expected.appImageName.endsWith(".AppImage") && archive.name.endsWith(".tar.zst") && /^[a-z0-9][a-z0-9+.-]+$/.test(expected.debPackage) && /^[A-Za-z0-9][A-Za-z0-9_.-]*\.desktop$/.test(expected.desktopId) && expected.desktopName.length > 0 && !/[\r\n]/.test(expected.desktopName) && Number.isSafeInteger(expected.runtime.size) && expected.runtime.size >= 64 && expected.runtime.size <= 64 * 1024 * 1024 && shasum.test(expected.runtime.sha256), "Invalid trusted Linux package policy");
10055
+ requireThat2(validTag.test(expected.tag) && /^[a-f0-9]{40}$/.test(expected.sourceSha) && basename16.test(expected.debName) && expected.debName.endsWith(".deb") && basename16.test(expected.appImageName) && expected.appImageName.endsWith(".AppImage") && archive.name.endsWith(".tar.zst") && /^[a-z0-9][a-z0-9+.-]+$/.test(expected.debPackage) && /^[A-Za-z0-9][A-Za-z0-9_.-]*\.desktop$/.test(expected.desktopId) && expected.desktopName.length > 0 && !/[\r\n]/.test(expected.desktopName) && Number.isSafeInteger(expected.runtime.size) && expected.runtime.size >= 64 && expected.runtime.size <= 64 * 1024 * 1024 && shasum.test(expected.runtime.sha256), "Invalid trusted Linux package policy");
10055
10056
  requireThat2(receipt.releaseAuthorized !== false && receipt.schema !== "private-linux-package-formats/v1" && receipt.tag === expected.tag && receipt.sourceSha === expected.sourceSha && receipt.platform === target.platform && receipt.updateArchiveSha256 === archive.sha256 && Array.isArray(receipt.artifacts) && receipt.artifacts.length === 2, "Package producer receipt names a different source, tag, platform or update archive");
10056
10057
  const names = [expected.debName, expected.appImageName];
10057
10058
  const artifacts = receipt.artifacts.map(validIdentity);
@@ -10139,7 +10140,7 @@ import {
10139
10140
  utimes,
10140
10141
  writeFile as writeFile13
10141
10142
  } from "fs/promises";
10142
- import { basename as basename16, dirname as dirname15, isAbsolute as isAbsolute7, join as join38, relative as relative6, resolve as resolve18 } from "path";
10143
+ import { basename as basename17, dirname as dirname15, isAbsolute as isAbsolute7, join as join38, relative as relative6, resolve as resolve18 } from "path";
10143
10144
  import { pipeline as pipeline2 } from "stream/promises";
10144
10145
  var component = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
10145
10146
  var commandName = /^[a-z0-9][a-z0-9@+._-]{0,63}$/;
@@ -10247,7 +10248,7 @@ async function buildLinuxFormats(input, host) {
10247
10248
  validatePolicy(policy);
10248
10249
  const requested = resolve18(input.output);
10249
10250
  const parent = await realpath12(dirname15(requested));
10250
- const output = join38(parent, basename16(requested));
10251
+ const output = join38(parent, basename17(requested));
10251
10252
  const work = await mkdtemp12(join38(parent, ".linux-formats-"));
10252
10253
  let outputOwned = false;
10253
10254
  try {
@@ -10418,7 +10419,7 @@ exec "$root/${installed}/${policy.launcher}" "$@"
10418
10419
  outputOwned = true;
10419
10420
  try {
10420
10421
  for (const item of artifacts)
10421
- await cp(join38(dest, item.name), join38(output, basename16(item.name)), {
10422
+ await cp(join38(dest, item.name), join38(output, basename17(item.name)), {
10422
10423
  force: false,
10423
10424
  errorOnExist: true
10424
10425
  });
@@ -10452,7 +10453,7 @@ import { createHash as createHash25 } from "crypto";
10452
10453
  import { constants as constants8 } from "fs";
10453
10454
  import { copyFile as copyFile2, lstat as lstat22, mkdtemp as mkdtemp13, open as open15, readFile as readFile13, readdir as readdir14, rm as rm13, writeFile as writeFile14 } from "fs/promises";
10454
10455
  import { tmpdir as tmpdir6 } from "os";
10455
- import { basename as basename17, isAbsolute as isAbsolute8, join as join39, resolve as resolve19 } from "path";
10456
+ import { basename as basename18, isAbsolute as isAbsolute8, join as join39, resolve as resolve19 } from "path";
10456
10457
  import { promisify as promisify5 } from "util";
10457
10458
 
10458
10459
  // src/library/windows-standalone-bootstrap.ts
@@ -10688,7 +10689,7 @@ async function buildStandaloneWindowsExe(options) {
10688
10689
  if (compilerIdentity.sha256 !== zigSha256)
10689
10690
  throw new Error("Pinned Zig compiler SHA-256 mismatch");
10690
10691
  const output = resolve19(options.output);
10691
- if (!basename17(output).endsWith("-Setup.exe"))
10692
+ if (!basename18(output).endsWith("-Setup.exe"))
10692
10693
  throw new Error("Expected final Windows Setup EXE filename");
10693
10694
  const root = resolve19(options.hutchMembers);
10694
10695
  const hidden = join39(root, ".installer");
@@ -11798,7 +11799,7 @@ var provideLivePorts = (program) => program.pipe(Effect28.provideService(Release
11798
11799
  import { createHash as createHash27 } from "crypto";
11799
11800
  import { createReadStream as createReadStream3 } from "fs";
11800
11801
  import { lstat as lstat23, mkdir as mkdir13, readFile as readFile14, readdir as readdir15, rm as rm14, writeFile as writeFile15 } from "fs/promises";
11801
- import { basename as basename18, dirname as dirname16, join as join42 } from "path";
11802
+ import { basename as basename19, dirname as dirname16, join as join42 } from "path";
11802
11803
 
11803
11804
  // src/library/stable-catalogs.ts
11804
11805
  function object2(value) {
@@ -12043,7 +12044,7 @@ var measure = async (path) => {
12043
12044
  const hash = createHash27("sha256");
12044
12045
  for await (const chunk of createReadStream3(path))
12045
12046
  hash.update(chunk);
12046
- return { name: basename18(path), size: st.size, sha256: hash.digest("hex") };
12047
+ return { name: basename19(path), size: st.size, sha256: hash.digest("hex") };
12047
12048
  };
12048
12049
  async function prepareStableCatalogCommand(args) {
12049
12050
  const [
@@ -12152,7 +12153,7 @@ async function packageChannelsCommand(args) {
12152
12153
  // src/commands/build-linux-formats.ts
12153
12154
  import { mkdtemp as mkdtemp14, rename as rename3, rm as rm16 } from "fs/promises";
12154
12155
  import { tmpdir as tmpdir7 } from "os";
12155
- import { basename as basename19, dirname as dirname18, isAbsolute as isAbsolute10, join as join44, resolve as resolve22 } from "path";
12156
+ import { basename as basename20, dirname as dirname18, isAbsolute as isAbsolute10, join as join44, resolve as resolve22 } from "path";
12156
12157
  import { Effect as Effect29 } from "effect";
12157
12158
 
12158
12159
  // src/library/verified-git-source.ts
@@ -12331,7 +12332,7 @@ var buildLinuxFormatsCommand = (args) => runCommand("Unable to build Linux forma
12331
12332
  feed: feedUrl(parsed.feed),
12332
12333
  keys: releaseVerificationKeys(config)
12333
12334
  }));
12334
- if (!verified.ok || verified.descriptor.sourceSha !== sourceSha || verified.descriptor.workflowSha !== sourceSha || verified.descriptor.runId !== expectedRunId || verified.descriptor.runAttempt !== Number(expectedAttempt) || verified.descriptor.tag !== tag || verified.descriptor.asset.name !== selected.payload || metadata.policy.bundleRoot !== config.appName.replaceAll(" ", "") || metadata.policy.desktopId !== config.appId || `${metadata.policy.artifactStem}-${tag}-${target.platform}.tar.zst` !== selected.payload || basename19(archive) !== selected.payload)
12335
+ if (!verified.ok || verified.descriptor.sourceSha !== sourceSha || verified.descriptor.workflowSha !== sourceSha || verified.descriptor.runId !== expectedRunId || verified.descriptor.runAttempt !== Number(expectedAttempt) || verified.descriptor.tag !== tag || verified.descriptor.asset.name !== selected.payload || metadata.policy.bundleRoot !== config.appName.replaceAll(" ", "") || metadata.policy.desktopId !== config.appId || `${metadata.policy.artifactStem}-${tag}-${target.platform}.tar.zst` !== selected.payload || basename20(archive) !== selected.payload)
12335
12336
  return yield* fail("Descriptor, source and Linux package identity differ");
12336
12337
  const receipt = yield* Effect29.callback((resume, signal) => {
12337
12338
  const promise = (async () => {
@@ -12622,7 +12623,7 @@ async function dailyBatchCommand(args, cwd) {
12622
12623
  }
12623
12624
 
12624
12625
  // src/commands/build-windows-standalone.ts
12625
- import { basename as basename20 } from "path";
12626
+ import { basename as basename21 } from "path";
12626
12627
  import { Effect as Effect30 } from "effect";
12627
12628
  var buildWindowsStandaloneCommand = (args) => runCommand("Unable to build the standalone Windows candidate; check hosted CircleCI provenance, exact filenames, and pinned tool inputs", Effect30.gen(function* () {
12628
12629
  const [configPath, tag, members, archive, zig, zigSha256, output, ...extra] = args;
@@ -12635,7 +12636,7 @@ var buildWindowsStandaloneCommand = (args) => runCommand("Unable to build the st
12635
12636
  if (!isRecord(config) || config.dailyReleaseProfile !== "desktop-v2" || typeof config.appName !== "string" || typeof config.appId !== "string" || !isRecord(config.platforms))
12636
12637
  return yield* fail("Expected a versioned Daily product configuration");
12637
12638
  const windows = config.platforms["windows-x64"];
12638
- if (!Array.isArray(windows) || windows.length !== 2 || typeof windows[0] !== "string" || typeof windows[1] !== "string" || !windows[0].endsWith("-Setup.exe") || !windows[1].endsWith(".tar.zst") || basename20(output) !== windows[0].replaceAll("{tag}", tag) || basename20(archive) !== windows[1].replaceAll("{tag}", tag))
12639
+ if (!Array.isArray(windows) || windows.length !== 2 || typeof windows[0] !== "string" || typeof windows[1] !== "string" || !windows[0].endsWith("-Setup.exe") || !windows[1].endsWith(".tar.zst") || basename21(output) !== windows[0].replaceAll("{tag}", tag) || basename21(archive) !== windows[1].replaceAll("{tag}", tag))
12639
12640
  return yield* fail("Windows candidate filenames do not match the protected product");
12640
12641
  const { appName, appId } = config;
12641
12642
  yield* step(() => buildStandaloneWindowsExe({
@@ -12648,7 +12649,7 @@ var buildWindowsStandaloneCommand = (args) => runCommand("Unable to build the st
12648
12649
  output
12649
12650
  }));
12650
12651
  const { stdout } = yield* ReleaseOutput;
12651
- stdout(JSON.stringify({ installer: basename20(output), signed: false }) + `
12652
+ stdout(JSON.stringify({ installer: basename21(output), signed: false }) + `
12652
12653
  `);
12653
12654
  }));
12654
12655
 
@@ -12955,7 +12956,7 @@ import { createReadStream as createReadStream5 } from "fs";
12955
12956
  import { constants as constants10, createWriteStream as createWriteStream2 } from "fs";
12956
12957
  import { lstat as lstat28, mkdtemp as mkdtemp15, open as open17, readFile as readFile19, realpath as realpath13, rm as rm19 } from "fs/promises";
12957
12958
  import { tmpdir as tmpdir8 } from "os";
12958
- import { basename as basename21, join as join47 } from "path";
12959
+ import { basename as basename22, join as join47 } from "path";
12959
12960
  import { pipeline as pipeline3 } from "stream/promises";
12960
12961
  import { pathToFileURL } from "url";
12961
12962
  function check4(ok, message) {
@@ -12994,7 +12995,7 @@ async function verifyRpmStage(stage) {
12994
12995
  check4(stage.architecture === "x86_64", "only x86_64 is supported");
12995
12996
  check4(/^[a-zA-Z0-9][a-zA-Z0-9._:-]*$/.test(stage.repoId), "invalid repository ID");
12996
12997
  if (stage.payload.expectedName !== undefined) {
12997
- check4(/^[a-zA-Z0-9][a-zA-Z0-9._+-]*$/.test(stage.payload.expectedName) && basename21(stage.payload.path) === stage.payload.expectedName, "portable payload filename does not match the configured name");
12998
+ check4(/^[a-zA-Z0-9][a-zA-Z0-9._+-]*$/.test(stage.payload.expectedName) && basename22(stage.payload.path) === stage.payload.expectedName, "portable payload filename does not match the configured name");
12998
12999
  }
12999
13000
  for (const artifact of [stage.payload, stage.rpm]) {
13000
13001
  check4(/^[0-9a-f]{64}$/.test(artifact.sha256), "expected SHA-256");
@@ -0,0 +1,9 @@
1
+ export function containsAsciiControl(value, includeSpace = !1) {
2
+ const maximum = includeSpace ? 32 : 31;
3
+ for (let index = 0;index < value.length; index++) {
4
+ const code = value.charCodeAt(index);
5
+ if (code <= maximum || code === 127)
6
+ return !0;
7
+ }
8
+ return !1;
9
+ }