@absolutejs/absolute 0.20.0-beta.105 → 0.20.0-beta.106

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.
@@ -25838,6 +25838,7 @@ var defaultRun3 = async (command, options = {}) => {
25838
25838
  const process2 = Bun.spawn(command, {
25839
25839
  cwd: options.cwd,
25840
25840
  env: options.env,
25841
+ signal: options.signal,
25841
25842
  stderr: "pipe",
25842
25843
  stdin: "ignore",
25843
25844
  stdout: "pipe"
@@ -25925,6 +25926,7 @@ var releaseMarker = (release) => {
25925
25926
  var waitForSimulatorMarker = async (options) => {
25926
25927
  const startedAt = performance.now();
25927
25928
  const poll = async () => {
25929
+ options.signal?.throwIfAborted();
25928
25930
  if (performance.now() - startedAt >= READY_TIMEOUT_MS)
25929
25931
  throw new Error("The installed iOS Release app launched but its embedded content did not become ready.");
25930
25932
  const logs = await options.run([
@@ -25963,7 +25965,12 @@ var launchSimulator = async (options) => {
25963
25965
  return Math.round(performance.now() - startedAt);
25964
25966
  };
25965
25967
  var runAbsoluteIosSimulatorReleaseAcceptance = async (options) => {
25966
- const run = options.run ?? defaultRun3;
25968
+ const baseRun = options.run ?? defaultRun3;
25969
+ const run = (command, commandOptions = {}) => baseRun(command, {
25970
+ ...commandOptions,
25971
+ ...options.signal ? { signal: options.signal } : {}
25972
+ });
25973
+ options.signal?.throwIfAborted();
25967
25974
  const xcodebuild = options.xcodebuild ?? "/usr/bin/xcodebuild";
25968
25975
  const xcrun = options.xcrun ?? "/usr/bin/xcrun";
25969
25976
  const startedAt = performance.now();
@@ -26061,7 +26068,12 @@ var observeDeviceLaunch = async (options) => {
26061
26068
  "--device",
26062
26069
  options.device,
26063
26070
  options.appId
26064
- ], { stderr: "pipe", stdin: "ignore", stdout: "pipe" });
26071
+ ], {
26072
+ signal: options.signal,
26073
+ stderr: "pipe",
26074
+ stdin: "ignore",
26075
+ stdout: "pipe"
26076
+ });
26065
26077
  const stdoutReader = process2.stdout.getReader();
26066
26078
  const stderrReader = process2.stderr.getReader();
26067
26079
  const requireMarker = async (reader) => {
@@ -26148,7 +26160,12 @@ var inspectTestFlightInstallation = async (options) => {
26148
26160
  var runAbsoluteIosDeviceReleaseAcceptance = async (options) => {
26149
26161
  if (!options.networkUnavailableConfirmed)
26150
26162
  throw new TypeError("Physical iOS offline acceptance requires explicit confirmation that Airplane Mode is enabled and Wi-Fi is disabled in Settings.");
26151
- const run = options.run ?? defaultRun3;
26163
+ const baseRun = options.run ?? defaultRun3;
26164
+ const run = (command, commandOptions = {}) => baseRun(command, {
26165
+ ...commandOptions,
26166
+ ...options.signal ? { signal: options.signal } : {}
26167
+ });
26168
+ options.signal?.throwIfAborted();
26152
26169
  const xcrun = options.xcrun ?? "/usr/bin/xcrun";
26153
26170
  const startedAt = performance.now();
26154
26171
  await requireSuccess3(run, [
@@ -26167,7 +26184,11 @@ var runAbsoluteIosDeviceReleaseAcceptance = async (options) => {
26167
26184
  xcrun
26168
26185
  };
26169
26186
  const installMs = options.distribution === "registered-device" ? await installRegisteredDeviceRelease(installation) : await inspectTestFlightInstallation(installation);
26170
- const observe = options.observeLaunch ?? ((launch2) => observeDeviceLaunch({ ...launch2, xcrun }));
26187
+ const observe = options.observeLaunch ?? ((launch2) => observeDeviceLaunch({
26188
+ ...launch2,
26189
+ ...options.signal ? { signal: options.signal } : {},
26190
+ xcrun
26191
+ }));
26171
26192
  const marker = releaseMarker(options.release);
26172
26193
  const launchMs = await observe({
26173
26194
  appId: options.release.metadata.appId,
@@ -27324,7 +27345,7 @@ import {
27324
27345
 
27325
27346
  // src/mobile/remoteMacWire.ts
27326
27347
  var ABSOLUTE_REMOTE_MAC_EVENT_PREFIX = "ABSOLUTE_REMOTE_MAC\t";
27327
- var ABSOLUTE_REMOTE_MAC_PROTOCOL_VERSION = 3;
27348
+ var ABSOLUTE_REMOTE_MAC_PROTOCOL_VERSION = 4;
27328
27349
 
27329
27350
  // src/mobile/remoteMacProtocol.ts
27330
27351
  var PROFILE_FORMAT = 1;
@@ -27868,6 +27889,45 @@ var absoluteRemoteReleaseInputSyncCommands = (project) => {
27868
27889
  tar: ["tar", "-cf", "-", "-C", project.config.bundleDirectory, "."]
27869
27890
  };
27870
27891
  };
27892
+ var syncAbsoluteRemoteMacAcceptanceRelease = async (project, release, options = {}) => {
27893
+ options.signal?.throwIfAborted();
27894
+ const destination = posix.join(project.remoteProjectRoot, ".absolutejs", "mobile", "acceptance", "ios", release.metadata.releaseId);
27895
+ const staging = `${destination}.incoming-${randomUUID4()}`;
27896
+ const script = [
27897
+ "set -eu",
27898
+ "umask 077",
27899
+ `rm -rf ${shellQuote(staging)}`,
27900
+ `mkdir -p ${shellQuote(staging)}`,
27901
+ `tar -xf - -C ${shellQuote(staging)}`,
27902
+ `test -f ${shellQuote(posix.join(staging, "release.json"))}`,
27903
+ `rm -rf ${shellQuote(destination)}`,
27904
+ `mkdir -p ${shellQuote(posix.dirname(destination))}`,
27905
+ `mv ${shellQuote(staging)} ${shellQuote(destination)}`
27906
+ ].join("; ");
27907
+ const archive = Bun.spawn(["tar", "-cf", "-", "-C", release.releaseRoot, "."], {
27908
+ signal: options.signal,
27909
+ stderr: "pipe",
27910
+ stdout: "pipe"
27911
+ });
27912
+ const upload = Bun.spawn([
27913
+ ...absoluteRemoteMacSshBase(project.profile),
27914
+ "/bin/sh -lc",
27915
+ shellQuote(script)
27916
+ ], {
27917
+ signal: options.signal,
27918
+ stderr: "pipe",
27919
+ stdin: archive.stdout,
27920
+ stdout: "pipe"
27921
+ });
27922
+ const [archiveExit, uploadExit, archiveError, uploadError] = await Promise.all([
27923
+ archive.exited,
27924
+ upload.exited,
27925
+ new Response(archive.stderr).text(),
27926
+ new Response(upload.stderr).text()
27927
+ ]);
27928
+ if (archiveExit !== 0 || uploadExit !== 0)
27929
+ throw new Error(`Remote iOS acceptance artifact synchronization failed: ${(archiveError || uploadError).trim()}`);
27930
+ };
27871
27931
  var syncAbsoluteRemoteMacReleaseInputs = async (project, options = {}) => {
27872
27932
  options.signal?.throwIfAborted();
27873
27933
  const commands = absoluteRemoteReleaseInputSyncCommands(project);
@@ -27938,11 +27998,28 @@ var retrieveAbsoluteRemoteIosRelease = async (project, metadata, outputDirectory
27938
27998
  ]);
27939
27999
  if (downloadExit !== 0)
27940
28000
  throw new Error(`Remote iOS release retrieval failed: ${downloadError.trim()}`);
28001
+ let registeredArtifactPath;
28002
+ if (metadata.registeredDevice) {
28003
+ registeredArtifactPath = join10(staging, "App.registered-device.ipa");
28004
+ const registeredDownload = Bun.spawn([
28005
+ ...absoluteRemoteMacSshBase(project.profile),
28006
+ "/bin/sh -lc",
28007
+ shellQuote(`cat ${shellQuote(posix.join(releaseRoot, metadata.registeredDevice.artifact))}`)
28008
+ ], { stderr: "pipe", stdout: "pipe" });
28009
+ const [registeredExit, registeredError] = await Promise.all([
28010
+ registeredDownload.exited,
28011
+ new Response(registeredDownload.stderr).text(),
28012
+ writeRemoteArtifact(registeredArtifactPath, registeredDownload.stdout)
28013
+ ]);
28014
+ if (registeredExit !== 0)
28015
+ throw new Error(`Remote iOS registered-device artifact retrieval failed: ${registeredError.trim()}`);
28016
+ }
27941
28017
  return await installAbsoluteIosRelease({
27942
28018
  artifactPath,
27943
28019
  metadata,
27944
28020
  outputDirectory,
27945
- projectRoot: project.projectRoot
28021
+ projectRoot: project.projectRoot,
28022
+ ...registeredArtifactPath ? { registeredArtifactPath } : {}
27946
28023
  });
27947
28024
  } finally {
27948
28025
  await rm8(staging, { force: true, recursive: true }).catch(() => {
@@ -28040,6 +28117,7 @@ var buildAbsoluteRemoteIosRelease = async (options) => {
28040
28117
  shellQuote(encodedConfig),
28041
28118
  ...options.allowUnsigned ? ["--unsigned"] : [],
28042
28119
  ...options.prepareBuildNumber ? ["--request-build-number"] : [],
28120
+ ...options.registeredDeviceArtifact ? ["--registered-device-artifact"] : [],
28043
28121
  ...options.developmentTeam ? ["--development-team", shellQuote(options.developmentTeam)] : []
28044
28122
  ].join(" ");
28045
28123
  const process2 = (options.transport?.spawn ?? defaultTransport.spawn)([
@@ -28144,6 +28222,178 @@ var buildAbsoluteRemoteIosRelease = async (options) => {
28144
28222
  }
28145
28223
  }
28146
28224
  };
28225
+ var requireRemoteIosReleaseAcceptance = (value, release, distribution) => {
28226
+ if (typeof value !== "object" || value === null)
28227
+ throw new TypeError("Remote Mac returned invalid iOS release evidence.");
28228
+ const result = value;
28229
+ let expectedExactness = "archive-equivalent";
28230
+ if (distribution === "simulator-release")
28231
+ expectedExactness = "source-equivalent";
28232
+ if (distribution === "testflight")
28233
+ expectedExactness = "store-delivered";
28234
+ const expectedDistribution = distribution === "testflight" ? "apple-processed" : distribution;
28235
+ const expectedTarget = distribution === "simulator-release" ? "simulator" : "device";
28236
+ if (result.status !== "pass" || result.embeddedLocal !== true || result.releaseId !== release.metadata.releaseId || result.engine !== release.metadata.engine || result.marketingVersion !== release.metadata.marketingVersion || result.artifactSha256 !== release.metadata.sha256 || result.artifactBytes !== release.metadata.bytes || result.signed !== release.metadata.signed || result.artifactExactness !== expectedExactness || result.distribution !== expectedDistribution || result.target !== expectedTarget || (distribution === "simulator-release" ? result.networkUnavailable !== "not-proven" : result.networkUnavailable !== "user-confirmed") || (release.metadata.buildNumber === undefined ? result.buildNumber !== undefined : result.buildNumber !== release.metadata.buildNumber) || !["durationMs", "installMs", "launchMs", "relaunchMs"].every((field2) => typeof result[field2] === "number" && Number.isFinite(result[field2]) && result[field2] >= 0))
28237
+ throw new TypeError("Remote Mac iOS release evidence does not match the immutable release or requested lane.");
28238
+ return value;
28239
+ };
28240
+ var runAbsoluteRemoteIosReleaseAcceptance = async (options) => {
28241
+ options.signal?.throwIfAborted();
28242
+ if (options.distribution !== "simulator-release" && !options.deviceIdentifier)
28243
+ throw new TypeError("Remote physical iOS release acceptance requires a device identifier.");
28244
+ if (options.distribution !== "simulator-release" && !options.networkUnavailableConfirmed)
28245
+ throw new TypeError("Remote physical iOS release acceptance requires explicit network-unavailable confirmation.");
28246
+ const operation = new AbortController;
28247
+ const abort = () => operation.abort(options.signal?.reason ?? new Error("Remote iOS release acceptance cancelled."));
28248
+ options.signal?.addEventListener("abort", abort, { once: true });
28249
+ const startedAt = performance.now();
28250
+ const leaseStartedAt = performance.now();
28251
+ let lease;
28252
+ try {
28253
+ lease = await (options.acquireLease ?? ((project, signal) => acquireAbsoluteRemoteMacReleaseLease(project, {
28254
+ signal,
28255
+ transport: options.transport
28256
+ })))(options.project, operation.signal);
28257
+ } catch (error) {
28258
+ options.signal?.removeEventListener("abort", abort);
28259
+ throw error;
28260
+ }
28261
+ const leaseDuration = performance.now() - leaseStartedAt;
28262
+ options.onPhaseTiming?.({
28263
+ durationMs: leaseDuration,
28264
+ phase: "remote-release-acceptance-lease"
28265
+ });
28266
+ let heartbeat;
28267
+ const heartbeatTimer = setInterval(() => {
28268
+ if (heartbeat)
28269
+ return;
28270
+ heartbeat = lease.heartbeat().catch((error) => operation.abort(error)).finally(() => {
28271
+ heartbeat = undefined;
28272
+ });
28273
+ }, REMOTE_RELEASE_LEASE_HEARTBEAT_MS);
28274
+ unrefTimer(heartbeatTimer);
28275
+ try {
28276
+ const syncStartedAt = performance.now();
28277
+ if (options.syncProject)
28278
+ await options.syncProject(options.project);
28279
+ else
28280
+ await syncAbsoluteRemoteMacProject(options.project, {
28281
+ signal: operation.signal
28282
+ });
28283
+ operation.signal.throwIfAborted();
28284
+ if (options.syncReleaseInputs)
28285
+ await options.syncReleaseInputs(options.project);
28286
+ else
28287
+ await syncAbsoluteRemoteMacReleaseInputs(options.project, {
28288
+ signal: operation.signal
28289
+ });
28290
+ operation.signal.throwIfAborted();
28291
+ if (options.syncRelease)
28292
+ await options.syncRelease(options.project, options.release);
28293
+ else
28294
+ await syncAbsoluteRemoteMacAcceptanceRelease(options.project, options.release, { signal: operation.signal });
28295
+ operation.signal.throwIfAborted();
28296
+ const syncDuration = performance.now() - syncStartedAt;
28297
+ options.onPhaseTiming?.({
28298
+ durationMs: syncDuration,
28299
+ phase: "remote-release-acceptance-sync"
28300
+ });
28301
+ const agent = await (options.installAgent ?? installAbsoluteRemoteMacAgent)(options.project);
28302
+ const encodedConfig = Buffer.from(JSON.stringify(portableMobileConfig(options.project))).toString("base64url");
28303
+ const remoteCommand = [
28304
+ `cd ${shellQuote(options.project.remoteProjectRoot)}`,
28305
+ "&&",
28306
+ "exec",
28307
+ shellQuote(options.project.profile.bunPath),
28308
+ shellQuote(agent.remotePath),
28309
+ "--test-ios-release",
28310
+ "--mobile-config",
28311
+ shellQuote(encodedConfig),
28312
+ "--release-id",
28313
+ shellQuote(options.release.metadata.releaseId),
28314
+ "--distribution",
28315
+ shellQuote(options.distribution),
28316
+ ...options.deviceIdentifier ? ["--device", shellQuote(options.deviceIdentifier)] : [],
28317
+ ...options.simulatorUdid ? ["--simulator-udid", shellQuote(options.simulatorUdid)] : [],
28318
+ ...options.networkUnavailableConfirmed ? ["--network-unavailable-confirmed"] : []
28319
+ ].join(" ");
28320
+ const process2 = (options.transport?.spawn ?? defaultTransport.spawn)([
28321
+ ...absoluteRemoteMacSshBase(options.project.profile),
28322
+ "/bin/sh -lc",
28323
+ shellQuote(remoteCommand)
28324
+ ], { signal: operation.signal });
28325
+ const killOnAbort = () => process2.kill();
28326
+ operation.signal.addEventListener("abort", killOnAbort, { once: true });
28327
+ let failure;
28328
+ let accepted;
28329
+ const stdoutDone = consumeLines2(process2.stdout, (line) => {
28330
+ if (!line.startsWith(ABSOLUTE_REMOTE_MAC_EVENT_PREFIX))
28331
+ return;
28332
+ try {
28333
+ const event = JSON.parse(line.slice(ABSOLUTE_REMOTE_MAC_EVENT_PREFIX.length));
28334
+ if (event.v !== ABSOLUTE_REMOTE_MAC_PROTOCOL_VERSION)
28335
+ throw new Error("Remote Mac protocol version mismatch.");
28336
+ if (event.type === "log")
28337
+ options.log?.(event.message);
28338
+ if (event.type === "timing") {
28339
+ const durationMs = Reflect.get(event, "durationMs");
28340
+ const phase = Reflect.get(event, "phase");
28341
+ if (typeof durationMs === "number" && typeof phase === "string")
28342
+ options.onPhaseTiming?.({ durationMs, phase });
28343
+ }
28344
+ if (event.type === "fatal")
28345
+ failure = new Error(event.error);
28346
+ if (event.type === "release-acceptance") {
28347
+ if (!event.targetId || typeof event.targetId !== "string")
28348
+ throw new TypeError("Remote Mac returned an invalid iOS acceptance target.");
28349
+ accepted = {
28350
+ result: requireRemoteIosReleaseAcceptance(event.result, options.release, options.distribution),
28351
+ targetId: event.targetId
28352
+ };
28353
+ }
28354
+ } catch (error) {
28355
+ failure = error instanceof Error ? error : new Error("Remote Mac emitted invalid iOS release evidence.");
28356
+ process2.kill();
28357
+ }
28358
+ });
28359
+ const stderrDone = consumeLines2(process2.stderr, (line) => options.log?.(`[remote] ${line}`));
28360
+ const exitCode = await process2.exited;
28361
+ operation.signal.removeEventListener("abort", killOnAbort);
28362
+ try {
28363
+ process2.stdin.end();
28364
+ } catch {}
28365
+ await Promise.all([stdoutDone, stderrDone]);
28366
+ operation.signal.throwIfAborted();
28367
+ if (failure)
28368
+ throw failure;
28369
+ if (exitCode !== 0)
28370
+ throw new Error(`Remote iOS release acceptance agent exited with status ${exitCode}.`);
28371
+ if (!accepted)
28372
+ throw new Error("Remote iOS release acceptance agent returned no evidence.");
28373
+ const total = performance.now() - startedAt;
28374
+ options.log?.(`Remote Mac ${options.project.profile.name} completed ${options.distribution} acceptance for ${options.release.metadata.releaseId} in ${total.toFixed(2)}ms (agent ${agent.uploaded ? "uploaded" : "cache hit"}).`);
28375
+ return {
28376
+ ...accepted,
28377
+ timings: {
28378
+ "remote-release-acceptance-lease": leaseDuration,
28379
+ "remote-release-acceptance-sync": syncDuration,
28380
+ total
28381
+ }
28382
+ };
28383
+ } finally {
28384
+ clearInterval(heartbeatTimer);
28385
+ await heartbeat?.catch(() => {
28386
+ return;
28387
+ });
28388
+ options.signal?.removeEventListener("abort", abort);
28389
+ try {
28390
+ await lease.release();
28391
+ options.log?.("Released Remote Mac release acceptance lease.");
28392
+ } catch (error) {
28393
+ options.log?.(`Remote Mac acceptance lease cleanup failed and will recover after expiry: ${error instanceof Error ? error.message : String(error)}`);
28394
+ }
28395
+ }
28396
+ };
28147
28397
  var startAbsoluteRemoteExpoIosDevSession = async (options) => {
28148
28398
  let session = await startAbsoluteRemoteDevSession({
28149
28399
  certificateAuthorityPath: options.certificateAuthorityPath,
@@ -42376,6 +42626,7 @@ export {
42376
42626
  runAbsoluteAndroidUpgradeConformance,
42377
42627
  runAbsoluteIosDeviceReleaseAcceptance,
42378
42628
  runAbsoluteIosSimulatorReleaseAcceptance,
42629
+ runAbsoluteRemoteIosReleaseAcceptance,
42379
42630
  runWithAbsoluteMobileProducer,
42380
42631
  serializeAbsoluteMobileAuthEnvironment,
42381
42632
  startAbsoluteExpoDevSession,
@@ -42385,6 +42636,7 @@ export {
42385
42636
  startAbsoluteRemoteExpoIosDevSession,
42386
42637
  startAbsoluteRemoteIosDevSession,
42387
42638
  syncAbsoluteExpoWebAssets,
42639
+ syncAbsoluteRemoteMacAcceptanceRelease,
42388
42640
  syncAbsoluteRemoteMacProject,
42389
42641
  syncAbsoluteRemoteMacReleaseInputs,
42390
42642
  testAbsoluteIosPhysicalDevice,
@@ -42401,5 +42653,5 @@ export {
42401
42653
  writeAbsoluteMobileUpdateRegistry
42402
42654
  };
42403
42655
 
42404
- //# debugId=E34FAEF09492010764756E2164756E21
42656
+ //# debugId=45962AF96688DC1364756E2164756E21
42405
42657
  //# sourceMappingURL=index.js.map