stim 1.20.0 → 1.20.2
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/README.md +6 -3
- package/dist/{activity-BrGh9EAI.mjs → activity-BSV745Kz.mjs} +4 -4
- package/dist/{agent-device-usage-output-DVyv_hWj.mjs → agent-device-usage-output-Dzgv6lgR.mjs} +5 -6
- package/dist/{android-Brx6EKvJ.mjs → android-DCKZrNvV.mjs} +37 -38
- package/dist/{android-0vv-OruW.mjs → android-Dlzxshgp.mjs} +5 -5
- package/dist/{android-CK3fpEyZ.mjs → android-HqP1_vB_.mjs} +3 -3
- package/dist/{android-BsYNR81W.mjs → android-Mz_Inn3w.mjs} +12 -12
- package/dist/{android-cas-DCAuXryb.mjs → android-cas-Bl-cLJBk.mjs} +4 -4
- package/dist/android-cas-compiler.mjs +1 -1
- package/dist/{api-zuX3ynYN.mjs → api-qvOzWyfO.mjs} +1 -1
- package/dist/api-run.mjs +19 -21
- package/dist/api.mjs +1 -1
- package/dist/{app-install-0LgaQRT7.mjs → app-install-BIKtMfPq.mjs} +71 -48
- package/dist/{artifact-DClXJNWx.mjs → artifact-D3czlUvT.mjs} +13 -13
- package/dist/{artifact-CnC0mfov.mjs → artifact-HSwkIWEQ.mjs} +12 -12
- package/dist/{browser-web-CzBmhmgs.mjs → browser-web-CA-F1GQo.mjs} +18 -18
- package/dist/{budget-BONq9vXY.mjs → budget-f7516Zk0.mjs} +23 -26
- package/dist/{build-BixRI6sB.mjs → build-DYDbfkk5.mjs} +28 -33
- package/dist/{build-plan-CP0tckNU.mjs → build-plan-B7SZsc2N.mjs} +17 -17
- package/dist/{cache-manifest-qA3dT2x2.mjs → cache-manifest-XH-fvDUj.mjs} +10 -5
- package/dist/cache-manifest.mjs +1 -1
- package/dist/cancellation-C_22VQTH.mjs +24 -0
- package/dist/{ccache-CjHQ5F8g.mjs → ccache-zdKiYQ3E.mjs} +7 -7
- package/dist/{chrome-Dp2lMLBe.mjs → chrome-BnzZMqsR.mjs} +1 -1
- package/dist/{cli-B2R8wH1F.mjs → cli-CLP3diBm.mjs} +20 -20
- package/dist/cli.mjs +1 -1
- package/dist/{client-BLy1Pw2V.mjs → client-qQAaXSUs.mjs} +21 -29
- package/dist/collector-run.d.mts +7 -6
- package/dist/collector-run.mjs +6 -7
- package/dist/{command-output-BjPN99ZB.mjs → command-output-BTy8hZ0F.mjs} +1 -1
- package/dist/{config-D0LhTY3S.mjs → config-BYDxlMY3.mjs} +43 -5
- package/dist/{created-devices-HU_DAb_Q.mjs → created-devices-Dzd5C2LF.mjs} +2 -2
- package/dist/{dependency-state-B2m8eqsS.mjs → dependency-state-DG0p31-y.mjs} +2 -2
- package/dist/{detached-entry-BXq4fIl-.mjs → detached-entry-B9C_zeQC.mjs} +1 -1
- package/dist/{dev-client-ClATaJoH.mjs → dev-client-DAWVIGBu.mjs} +2 -2
- package/dist/{device-DVCwAFlX.mjs → device-BECOiufl.mjs} +13 -14
- package/dist/{device-B7lsC0K1.mjs → device-DuiPJQSn.mjs} +8 -8
- package/dist/{device-capacity-Ca_ke1LE.mjs → device-capacity-CBUAcRyQ.mjs} +10 -11
- package/dist/device-host-worker.mjs +16 -17
- package/dist/{device-ios-CRUqPxKw.mjs → device-ios-COSi6oS1.mjs} +12 -15
- package/dist/{device-lease-DHOBXGgS.mjs → device-lease-BX1sJQ2E.mjs} +15 -18
- package/dist/{device-lease-run-CvDeHTkG.mjs → device-lease-run-Cw2M4z51.mjs} +4 -4
- package/dist/{device-pool-L2-5GxMy.mjs → device-pool-Bf-pOhSw.mjs} +3 -3
- package/dist/{device-remote-Bmg42063.mjs → device-remote-xRT0Vmo9.mjs} +14 -14
- package/dist/{doctor-C2MSuMMg.mjs → doctor-CB8oZKCk.mjs} +13 -13
- package/dist/{doctor-DPAqhVCK.mjs → doctor-kfMBnUw6.mjs} +78 -69
- package/dist/{doctor-watchman-CB4NnVZm.mjs → doctor-watchman-BRyV2adA.mjs} +9 -10
- package/dist/{eas-build-Dw_ec2Km.mjs → eas-build-JyfqyHfC.mjs} +5 -5
- package/dist/{eas-session-ledger-DZlC-Fq3.mjs → eas-session-ledger-Cm0Gwq2F.mjs} +6 -4
- package/dist/{error-diagnostics-Du7I_GuY.mjs → error-diagnostics-BR677IDM.mjs} +10 -10
- package/dist/{exec-B81Qodjn.mjs → exec-DqKo9GKJ.mjs} +22 -8
- package/dist/{gc-PWp34zGb.mjs → gc-qWOMdnER.mjs} +75 -24
- package/dist/git-DDfFzkMm.mjs +45 -0
- package/dist/{gradle-C2OEKCCI.mjs → gradle-DSrXb6lG.mjs} +6 -6
- package/dist/{guide-Dai9lphv.mjs → guide-G9cAbVAc.mjs} +81 -178
- package/dist/{hosted-android-DQ-Agsd8.mjs → hosted-android-C3MHGld1.mjs} +3 -3
- package/dist/{hosted-client-Io01s5By.mjs → hosted-client-ZEKpS9vw.mjs} +19 -11
- package/dist/{hosted-ios-DIxFnYp-.mjs → hosted-ios-l-o3iM9J.mjs} +1 -1
- package/dist/{hosted-logs-DP-ABU_M.mjs → hosted-logs-EzQM7-3Z.mjs} +7 -7
- package/dist/{hosted-macos-Aziw9T_9.mjs → hosted-macos-BACVAVqE.mjs} +10 -8
- package/dist/{hosted-native-BdAQi21M.mjs → hosted-native-A4s1QPXe.mjs} +13 -11
- package/dist/{idle-shutdown-DdMqoSUB.mjs → idle-shutdown-DtxhPTKe.mjs} +7 -7
- package/dist/{ios-BZ9dg2Fr.mjs → ios-BwVCF7oA.mjs} +8 -8
- package/dist/{ios-CZuv6gRv.mjs → ios-Ce7bc7br.mjs} +29 -29
- package/dist/{ios-CXLIUxXJ.mjs → ios-RkW4pnQf.mjs} +21 -17
- package/dist/{ios-device-B1B14xND.mjs → ios-device-B5veSDDQ.mjs} +1 -1
- package/dist/{ios-device-BreZOpM0.mjs → ios-device-D7pi2Sca.mjs} +14 -14
- package/dist/{ios-VGvNdsv2.mjs → ios-nOLJGVdy.mjs} +1 -1
- package/dist/{ios-project-B9drt_aY.mjs → ios-project-K9hY_Jab.mjs} +8 -8
- package/dist/{ios-state-CjrL2qv-.mjs → ios-state-CBLe1xYw.mjs} +1 -1
- package/dist/{js-swap-C8icNYIY.mjs → js-swap-Bb3nsS07.mjs} +13 -13
- package/dist/{launch-YrbqaIFj.mjs → launch-C3qJ6Agb.mjs} +46 -45
- package/dist/{launch-DxH0THLP.mjs → launch-F4sOqAhB.mjs} +21 -21
- package/dist/{launch-verify-BzRdbuO1.mjs → launch-verify-B6Q8hZP-.mjs} +11 -11
- package/dist/{logs-DHaRNfg7.mjs → logs-BGrEUaEs.mjs} +10 -11
- package/dist/{macos-V_3Ui7g4.mjs → macos-Ch5VJmcS.mjs} +40 -24
- package/dist/macos-D7uDvO-z.mjs +2 -0
- package/dist/macos-run.mjs +1 -1
- package/dist/maintenance-run.mjs +7 -7
- package/dist/{metro-D_j9sN-B.mjs → metro-DnCEjCxs.mjs} +8 -9
- package/dist/{metro-gateway-BBJldOdi.mjs → metro-gateway-CX9Xlkq2.mjs} +3 -3
- package/dist/{miss-reason-BPAzZS0r.mjs → miss-reason-mKzZ4VvN.mjs} +3 -3
- package/dist/{named-ports-C2lvoPsb.mjs → named-ports-4WopRPg-.mjs} +4 -5
- package/dist/{native-android-lHzaew7r.mjs → native-android-D5qc3-_v.mjs} +10 -10
- package/dist/{native-gradle-inputs-BQnIdAlL.mjs → native-gradle-inputs-BsLRrl7u.mjs} +3 -10
- package/dist/{native-runtime-BRmWL7ru.mjs → native-runtime-k8dTIrbK.mjs} +7 -8
- package/dist/{native-xcode-inputs-eutS19jU.mjs → native-xcode-inputs-CykopJdM.mjs} +7 -9
- package/dist/{native-xcode-ios-DP3cHLwu.mjs → native-xcode-ios-Bbf30Gm0.mjs} +15 -15
- package/dist/offload-worker.mjs +34 -38
- package/dist/{ownership-DXzMMSx6.mjs → ownership-DCtw_2IA.mjs} +3 -3
- package/dist/{page-Bv9s2KwY.mjs → page-DRHy329N.mjs} +1 -1
- package/dist/{placement-log-reFbjqEr.mjs → placement-log-MOfPVgaM.mjs} +1 -1
- package/dist/{plan-BDk2AeY_.mjs → plan-C4TjdPsR.mjs} +10 -10
- package/dist/{plan-placement-D_YYlE6N.mjs → plan-placement-V0TdzYXp.mjs} +3 -3
- package/dist/{ports-jzvAJXXL.mjs → ports-DdSUicVo.mjs} +3 -3
- package/dist/{prebuild-Bw44QxVh.mjs → prebuild-DYbucPXy.mjs} +7 -8
- package/dist/{preview-BaBJ72Al.mjs → preview-78a9kR_-.mjs} +31 -24
- package/dist/{project-B8_duAzW.mjs → project-_phNIJfs.mjs} +110 -47
- package/dist/{pull-request-vOhLNmIb.mjs → pull-request-CQ8sPbZa.mjs} +5 -18
- package/dist/pull-requests.mjs +1 -1
- package/dist/{react-native-android-chm1DMlA.mjs → react-native-android-CM1XRDwv.mjs} +34 -30
- package/dist/{react-native-build-oAw6gQeW.mjs → react-native-build-CtCccJtb.mjs} +6 -6
- package/dist/{react-native-doctor-DYXoh-6I.mjs → react-native-doctor-CfRnFfjs.mjs} +5 -5
- package/dist/{react-native-ios-SCTK_CT5.mjs → react-native-ios-Dhq_eiYQ.mjs} +14 -14
- package/dist/{recordings-Bk-VivUV.mjs → recordings-D0d5aQt0.mjs} +1 -1
- package/dist/{reload-D34GkY78.mjs → reload-C8JhxjSh.mjs} +17 -17
- package/dist/{remote-BU9UyhCJ.mjs → remote-BiR6aYjy.mjs} +7 -7
- package/dist/{remote-cache-Bsts6f6Y.mjs → remote-cache-OyOyVIS3.mjs} +4 -4
- package/dist/{result-BDoRk1k3.mjs → result-CaJg5Iat.mjs} +8 -8
- package/dist/{run-qvff78hv.mjs → run-BtPgpKks.mjs} +3 -3
- package/dist/{server-bare-dWjAarki.mjs → server-bare-R2m_gsH8.mjs} +3 -3
- package/dist/{server-command-7XIKlWtO.mjs → server-command-CTtCkmcQ.mjs} +5 -5
- package/dist/server-expo-Bigriskl.mjs +2 -0
- package/dist/{server-expo-CsYu2aKL.mjs → server-expo-DsguMGUF.mjs} +5 -10
- package/dist/{settings-Bbztm4oV.mjs → settings-B717odTD.mjs} +74 -115
- package/dist/{settings-CT3E71-i.mjs → settings-BORNaaCO.mjs} +5 -5
- package/dist/settings.schema.json +1 -1
- package/dist/{simslim-ChMfe8rg.mjs → simslim-CCr3rE-A.mjs} +2 -3
- package/dist/{slot-launch-B9hn96wd.mjs → slot-launch-DPt0m9Nd.mjs} +6 -6
- package/dist/{spawn-claims-Kqiifsk2.mjs → spawn-claims-DVS5RkMS.mjs} +1 -1
- package/dist/{stage-BNKKdDNc.mjs → stage-KNTQopqv.mjs} +9 -9
- package/dist/{start-CdvcTaXr.mjs → start-BWqzODpb.mjs} +19 -20
- package/dist/{start-CbQCSnXQ.mjs → start-TXeMmmO2.mjs} +1 -1
- package/dist/{state-Boo0IMJq.mjs → state-CG_OFoaA.mjs} +2 -2
- package/dist/{state-DI84A-uu.mjs → state-D1Icyjlu.mjs} +8 -7
- package/dist/{stats-BIIDrjA8.mjs → stats-BoY5sEPU.mjs} +5 -5
- package/dist/{status-BDGHwkCs.mjs → status-BTA7kKiQ.mjs} +1 -1
- package/dist/{status-DARMkc9q.mjs → status-WgFbkRzj.mjs} +30 -47
- package/dist/{status-watch-DvmI3SmN.mjs → status-watch-C23ILtf9.mjs} +4 -4
- package/dist/{stim-desktop-8GQX2OV8.mjs → stim-desktop-BzBN2Em2.mjs} +1 -1
- package/dist/{stop-iNemHsJC.mjs → stop-BNmBMi1F.mjs} +18 -19
- package/dist/{stop-WQPQHLuy.mjs → stop-DPEhunlw.mjs} +6 -6
- package/dist/{stop-CCZS-C9m.mjs → stop-DR6VoDIk.mjs} +2 -2
- package/dist/supervisor-run.mjs +16 -17
- package/dist/{support-DCco5fut.mjs → support-CwjbFs9H.mjs} +9 -9
- package/dist/{support-CnE_SIjt.mjs → support-DMTqj3Hm.mjs} +6 -6
- package/dist/{swiftpm-macos-afeNUExW.mjs → swiftpm-macos-DRNVJWlb.mjs} +9 -9
- package/dist/{tailnet-CoJUb2tB.mjs → tailnet-Dh-qiYzG.mjs} +5 -5
- package/dist/toolchain-BFkAcstd.mjs +2 -0
- package/dist/{toolchain-DqyDXs30.mjs → toolchain-DxSsNssu.mjs} +10 -10
- package/dist/trigger-9_USgmxz.mjs +2 -0
- package/dist/{trigger-C0MWBi8O.mjs → trigger-CigAYjeL.mjs} +2 -2
- package/dist/{warm-progress-C3ASD6z5.mjs → warm-progress-BuY-Fvfn.mjs} +43 -61
- package/dist/{watchman-CQl51YZu.mjs → watchman-CPQFZLXY.mjs} +6 -6
- package/dist/{web-B3eldHFH.mjs → web-BDBMxDpx.mjs} +9 -9
- package/dist/web-Dq-i3wzJ.mjs +2 -0
- package/dist/web-run.mjs +14 -14
- package/dist/{workspace-state-CSIFuuDa.mjs → workspace-state-DJt_MMvf.mjs} +16 -6
- package/dist/{workspaces-D2xSHBDY.mjs → workspaces-C36s2jb9.mjs} +15 -16
- package/dist/{worktree-BxDqaTev.mjs → worktree-CgvJYJ-Q.mjs} +96 -89
- package/dist/{worktree-q7_OZNY0.mjs → worktree-DpLdCHga.mjs} +1 -1
- package/package.json +6 -7
- package/dist/macos-C0iljhsN.mjs +0 -2
- package/dist/process-identity-Biv3arCO.mjs +0 -40
- package/dist/server-expo-DV43vep4.mjs +0 -2
- package/dist/toolchain-BIupIro1.mjs +0 -2
- package/dist/trigger-SHLOWJ4O.mjs +0 -2
- package/dist/web-BLXpOe6b.mjs +0 -2
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import { c as pinnedEndpoint$1 } from "./tailnet-
|
|
2
|
-
import {
|
|
1
|
+
import { c as pinnedEndpoint$1 } from "./tailnet-Dh-qiYzG.mjs";
|
|
2
|
+
import { r as throwIfCancelled, t as cancellableSleep } from "./cancellation-C_22VQTH.mjs";
|
|
3
|
+
import { t as BuildConnection, x as configuredMachines } from "./client-qQAaXSUs.mjs";
|
|
3
4
|
import { lstatSync, readFileSync, readdirSync, readlinkSync } from "node:fs";
|
|
4
5
|
import { join } from "node:path";
|
|
5
|
-
import { HOSTED_APP_CHUNK_BYTES, hostedMacosAppSlot, isJsonObject, readDeviceHostMachines } from "@stim-cli/core/state";
|
|
6
|
+
import { DEVICE_HOST_LIMITS, HOSTED_APP_CHUNK_BYTES, hostedMacosAppSlot, hostedWorkerSettleMs, isJsonObject, readDeviceHostMachines } from "@stim-cli/core/state";
|
|
6
7
|
import { createHash } from "node:crypto";
|
|
7
8
|
//#region src/device-host/hosted-client.ts
|
|
8
9
|
const CONNECT_TIMEOUT_MS = 1e4;
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
10
|
+
const HOSTED_POLL_MARGIN_MS = 45e3;
|
|
11
|
+
const HOSTED_REQUEST_MARGIN_MS = 5e3;
|
|
12
|
+
const workerBoundMs = (deadlineMs) => deadlineMs + hostedWorkerSettleMs();
|
|
13
|
+
const SESSION_TIMEOUT_MS = hostedWorkerSettleMs() + workerBoundMs(DEVICE_HOST_LIMITS.logsMs) + workerBoundMs(DEVICE_HOST_LIMITS.stopMs) + HOSTED_POLL_MARGIN_MS;
|
|
14
|
+
const PREPARE_TIMEOUT_MS = workerBoundMs(DEVICE_HOST_LIMITS.prepareMs) + HOSTED_POLL_MARGIN_MS;
|
|
15
|
+
const INSTALL_TIMEOUT_MS = workerBoundMs(DEVICE_HOST_LIMITS.prepareMs) + HOSTED_POLL_MARGIN_MS;
|
|
16
|
+
const OFFER_TIMEOUT_MS = workerBoundMs(DEVICE_HOST_LIMITS.offerMs) + HOSTED_REQUEST_MARGIN_MS;
|
|
14
17
|
const sha256 = (content) => createHash("sha256").update(content).digest("hex");
|
|
15
18
|
function credentialRefusal(message, remedy = "Run stim doctor.") {
|
|
16
19
|
return Object.assign(new Error(message), {
|
|
@@ -128,11 +131,16 @@ async function probeSession(placement, timeoutMs) {
|
|
|
128
131
|
host?.connection.close();
|
|
129
132
|
}
|
|
130
133
|
}
|
|
131
|
-
async function settle(host, session, passing, timeoutMs, platform = "macos") {
|
|
134
|
+
async function settle(host, session, passing, timeoutMs, platform = "macos", signal) {
|
|
132
135
|
const deadline = Date.now() + timeoutMs;
|
|
136
|
+
const what = `wait for hosted session ${session.id}`;
|
|
133
137
|
while (passing.includes(session.state)) {
|
|
138
|
+
throwIfCancelled(signal, what);
|
|
134
139
|
if (Date.now() > deadline) throw new Error(`The hosted session ${session.id} on ${host.machine} stayed ${session.state}.`);
|
|
135
|
-
await
|
|
140
|
+
await cancellableSleep(500, {
|
|
141
|
+
signal,
|
|
142
|
+
what
|
|
143
|
+
});
|
|
136
144
|
session = await attach(host, session.id, void 0, platform);
|
|
137
145
|
}
|
|
138
146
|
return session;
|
|
@@ -199,4 +207,4 @@ async function upload(host, ids, missing, content) {
|
|
|
199
207
|
}
|
|
200
208
|
}
|
|
201
209
|
//#endregion
|
|
202
|
-
export {
|
|
210
|
+
export { attach as a, connectHost as c, probeHostedSession as d, requireHostedAppMode as f, upload as g, unknownSession as h, SESSION_TIMEOUT_MS as i, heldNoLonger as l, sha256 as m, OFFER_TIMEOUT_MS as n, bundleManifest as o, settle as p, PREPARE_TIMEOUT_MS as r, call as s, INSTALL_TIMEOUT_MS as t, hostedSession as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as prepareHostedNative, r as stopHostedNative, t as placeHostedNative } from "./hosted-native-
|
|
1
|
+
import { n as prepareHostedNative, r as stopHostedNative, t as placeHostedNative } from "./hosted-native-A4s1QPXe.mjs";
|
|
2
2
|
//#region src/device-host/hosted-ios.ts
|
|
3
3
|
async function prepareHostedIos(machine, selectors, recorded, mode) {
|
|
4
4
|
return await prepareHostedNative(machine, selectors, recorded, "ios", false, mode);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { w as workspaceLogsDir$1, x as workspaceDir } from "./workspace-state-
|
|
4
|
-
import { l as phaseLine } from "./command-output-
|
|
5
|
-
import { o as parseMachine$1 } from "./tailnet-
|
|
1
|
+
import { K as validateDeviceSlot, z as deviceSlotFileKey } from "./config-BYDxlMY3.mjs";
|
|
2
|
+
import { t as getExecutor } from "./exec-DqKo9GKJ.mjs";
|
|
3
|
+
import { w as workspaceLogsDir$1, x as workspaceDir } from "./workspace-state-DJt_MMvf.mjs";
|
|
4
|
+
import { l as phaseLine } from "./command-output-BTy8hZ0F.mjs";
|
|
5
|
+
import { o as parseMachine$1 } from "./tailnet-Dh-qiYzG.mjs";
|
|
6
6
|
import { r as createNdjsonWriter } from "./ndjson-GOnbyvso.mjs";
|
|
7
|
-
import { n as macosDir } from "./state-
|
|
8
|
-
import {
|
|
7
|
+
import { n as macosDir } from "./state-CG_OFoaA.mjs";
|
|
8
|
+
import { s as call } from "./hosted-client-ZEKpS9vw.mjs";
|
|
9
9
|
import { mkdirSync, readFileSync, realpathSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
10
10
|
import { dirname, join } from "node:path";
|
|
11
11
|
import { isJsonObject, parseHostedAgentGrant, parseHostedLogsCursor } from "@stim-cli/core/state";
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { l as phaseLine } from "./command-output-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { l as phaseLine } from "./command-output-BTy8hZ0F.mjs";
|
|
2
|
+
import { x as runCancellationSignal } from "./tailnet-Dh-qiYzG.mjs";
|
|
3
|
+
import { t as cancellableSleep } from "./cancellation-C_22VQTH.mjs";
|
|
4
|
+
import { n as macosDir } from "./state-CG_OFoaA.mjs";
|
|
5
|
+
import { a as attach, c as connectHost, g as upload, h as unknownSession, i as SESSION_TIMEOUT_MS, l as heldNoLonger, m as sha256, o as bundleManifest, p as settle, r as PREPARE_TIMEOUT_MS, s as call, t as INSTALL_TIMEOUT_MS, u as hostedSession } from "./hosted-client-ZEKpS9vw.mjs";
|
|
6
|
+
import { i as agentAccess, r as closeAgentConnection, t as pullHostedMacosLogs } from "./hosted-logs-EzQM7-3Z.mjs";
|
|
5
7
|
import { rmSync } from "node:fs";
|
|
6
8
|
import { join } from "node:path";
|
|
7
9
|
import { hostedMacosBundleId, parseHostedMacosDevice, validHostedAppArguments } from "@stim-cli/core/state";
|
|
@@ -18,8 +20,8 @@ async function placeHostedMacos(host, { root, bundle, bundleId, handoff, argumen
|
|
|
18
20
|
let session = null;
|
|
19
21
|
if (recorded) {
|
|
20
22
|
try {
|
|
21
|
-
session = await settle(host, await attach(host, recorded.session), ["preparing"], PREPARE_TIMEOUT_MS);
|
|
22
|
-
session = await settle(host, session, ["stopping"], SESSION_TIMEOUT_MS);
|
|
23
|
+
session = await settle(host, await attach(host, recorded.session), ["preparing"], PREPARE_TIMEOUT_MS, "macos", runCancellationSignal());
|
|
24
|
+
session = await settle(host, session, ["stopping"], SESSION_TIMEOUT_MS, "macos", runCancellationSignal());
|
|
23
25
|
} catch (error) {
|
|
24
26
|
if (!heldNoLonger(error)) throw error;
|
|
25
27
|
}
|
|
@@ -50,7 +52,7 @@ async function placeHostedMacos(host, { root, bundle, bundleId, handoff, argumen
|
|
|
50
52
|
}
|
|
51
53
|
};
|
|
52
54
|
reserved(placement);
|
|
53
|
-
session = await settle(host, session, ["preparing"], PREPARE_TIMEOUT_MS);
|
|
55
|
+
session = await settle(host, session, ["preparing"], PREPARE_TIMEOUT_MS, "macos", runCancellationSignal());
|
|
54
56
|
if (session.state === "unknown") throw unknownSession(host, session);
|
|
55
57
|
if (session.state !== "ready") throw new Error(`The hosted session ${session.id} on ${host.machine} is ${session.state}.`);
|
|
56
58
|
const device = parseHostedMacosDevice(session.device);
|
|
@@ -97,7 +99,7 @@ async function placeHostedMacos(host, { root, bundle, bundleId, handoff, argumen
|
|
|
97
99
|
while (delivery.state !== "installed") {
|
|
98
100
|
if (delivery.state === "unknown") throw new Error(`${host.machine} could not install or launch the app${typeof delivery.notice === "string" ? `: ${delivery.notice}` : ""}.`);
|
|
99
101
|
if (Date.now() > deadline) throw new Error(`${host.machine} did not finish installing the app.`);
|
|
100
|
-
await
|
|
102
|
+
await cancellableSleep(500);
|
|
101
103
|
delivery = await call(host, "device-host.app.attach", ids);
|
|
102
104
|
}
|
|
103
105
|
const appliedArguments = validHostedAppArguments(delivery.arguments) ? delivery.arguments : [];
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { r as readWorkspaceState$1, x as workspaceDir } from "./workspace-state-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { a as
|
|
5
|
-
import {
|
|
1
|
+
import { r as readWorkspaceState$1, x as workspaceDir } from "./workspace-state-DJt_MMvf.mjs";
|
|
2
|
+
import { x as runCancellationSignal } from "./tailnet-Dh-qiYzG.mjs";
|
|
3
|
+
import { t as cancellableSleep } from "./cancellation-C_22VQTH.mjs";
|
|
4
|
+
import { a as attach, c as connectHost, f as requireHostedAppMode, g as upload, h as unknownSession, i as SESSION_TIMEOUT_MS, l as heldNoLonger, m as sha256, n as OFFER_TIMEOUT_MS, o as bundleManifest, p as settle, r as PREPARE_TIMEOUT_MS, s as call, t as INSTALL_TIMEOUT_MS, u as hostedSession } from "./hosted-client-ZEKpS9vw.mjs";
|
|
5
|
+
import { i as agentAccess, n as pullHostedNativeLogs, r as closeAgentConnection } from "./hosted-logs-EzQM7-3Z.mjs";
|
|
6
|
+
import { a as requireHostedMetro, i as requestHostedMetro, n as closeHostedMetro } from "./metro-gateway-CX9Xlkq2.mjs";
|
|
7
|
+
import { s as writeHostedNative } from "./ios-state-CBLe1xYw.mjs";
|
|
6
8
|
import { readFileSync, rmSync } from "node:fs";
|
|
7
9
|
import { join } from "node:path";
|
|
8
10
|
import { hostedNativeRecords, isJsonObject, parseHostedAndroidDevice, parseHostedChoice, parseHostedDevice, parseHostedNativeOffer, parseHostedNativePlacement, requireAutomaticMachine, unreadableHostedNative } from "@stim-cli/core/state";
|
|
@@ -24,8 +26,8 @@ async function prepareHostedNative(machine, selectors, recorded, platform = "ios
|
|
|
24
26
|
if (recorded) {
|
|
25
27
|
let session = null;
|
|
26
28
|
try {
|
|
27
|
-
session = await settle(host, await attach(host, recorded.session, void 0, platform), ["preparing"], PREPARE_TIMEOUT_MS, platform);
|
|
28
|
-
session = await settle(host, session, ["stopping"], SESSION_TIMEOUT_MS, platform);
|
|
29
|
+
session = await settle(host, await attach(host, recorded.session, void 0, platform), ["preparing"], PREPARE_TIMEOUT_MS, platform, runCancellationSignal());
|
|
30
|
+
session = await settle(host, session, ["stopping"], SESSION_TIMEOUT_MS, platform, runCancellationSignal());
|
|
29
31
|
} catch (error) {
|
|
30
32
|
if (!heldNoLonger(error)) throw error;
|
|
31
33
|
}
|
|
@@ -49,7 +51,7 @@ async function prepareHostedNative(machine, selectors, recorded, platform = "ios
|
|
|
49
51
|
const offer = await call(host, "device-host.offer", {
|
|
50
52
|
platform,
|
|
51
53
|
...selectors
|
|
52
|
-
},
|
|
54
|
+
}, OFFER_TIMEOUT_MS);
|
|
53
55
|
const parsedOffer = parseHostedNativeOffer(offer);
|
|
54
56
|
const choice = platform === "ios" ? offer.platform === "ios" ? parseHostedChoice(offer.choice) : null : parsedOffer?.platform === "android" ? parsedOffer.choice : null;
|
|
55
57
|
if (typeof offer.declined === "string") throw new Error(offer.declined);
|
|
@@ -109,7 +111,7 @@ async function placeHostedNative(target, { root, slot, bundle, handoff, bundleId
|
|
|
109
111
|
}
|
|
110
112
|
};
|
|
111
113
|
reserved(placement);
|
|
112
|
-
session = await settle(host, session, ["preparing"], PREPARE_TIMEOUT_MS, platform);
|
|
114
|
+
session = await settle(host, session, ["preparing"], PREPARE_TIMEOUT_MS, platform, runCancellationSignal());
|
|
113
115
|
if (session.state !== "ready") throw unknownSession(host, session);
|
|
114
116
|
const device = platform === "ios" ? parseHostedDevice(session.device) : parseHostedAndroidDevice(session.device);
|
|
115
117
|
if (!device || device.architecture !== target.choice.architecture || "avdName" in device && "systemImage" in target.choice && (device.systemImage !== target.choice.systemImage || device.deviceProfile !== target.choice.deviceProfile)) throw new Error(platform === "ios" ? "The reserved simulator does not match the offered architecture." : "The reserved emulator does not match the offered architecture or selectors.");
|
|
@@ -182,7 +184,7 @@ async function placeHostedNative(target, { root, slot, bundle, handoff, bundleId
|
|
|
182
184
|
break;
|
|
183
185
|
} catch (offerError) {
|
|
184
186
|
if (!String(offerError).includes("native operation in progress") || Date.now() >= fallbackDeadline) throw offerError;
|
|
185
|
-
await
|
|
187
|
+
await cancellableSleep(Math.min(500, Math.max(0, fallbackDeadline - Date.now())));
|
|
186
188
|
}
|
|
187
189
|
}
|
|
188
190
|
}
|
|
@@ -194,7 +196,7 @@ async function placeHostedNative(target, { root, slot, bundle, handoff, bundleId
|
|
|
194
196
|
while (delivery.state !== "installed") {
|
|
195
197
|
if (delivery.state === "unknown") throw new Error(typeof delivery.notice === "string" ? delivery.notice : "App installation or launch is unknown.");
|
|
196
198
|
if (Date.now() > deadline) throw new Error("App installation did not finish.");
|
|
197
|
-
await
|
|
199
|
+
await cancellableSleep(500);
|
|
198
200
|
delivery = await call(host, "device-host.app.attach", ids);
|
|
199
201
|
}
|
|
200
202
|
if (typeof delivery.notice === "string") note(delivery.notice);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as updateWorkspaceState, r as readWorkspaceState$1 } from "./workspace-state-
|
|
3
|
-
import { o as formatLongDuration } from "./command-output-
|
|
4
|
-
import { T as canonicalPath, b as teardownOwnedIosSim, v as teardownOwnedAvd } from "./workspaces-
|
|
5
|
-
import { f as collectOwnedDeviceActivity, g as workspaceBuildInProgress } from "./budget-
|
|
6
|
-
import { m as workspaceDeviceLastUseAt } from "./activity-
|
|
7
|
-
import { d as listAllIosSims } from "./ios-
|
|
1
|
+
import { B as deviceSlotKey, _ as loadConfig$1 } from "./config-BYDxlMY3.mjs";
|
|
2
|
+
import { a as updateWorkspaceState, r as readWorkspaceState$1 } from "./workspace-state-DJt_MMvf.mjs";
|
|
3
|
+
import { o as formatLongDuration } from "./command-output-BTy8hZ0F.mjs";
|
|
4
|
+
import { T as canonicalPath, b as teardownOwnedIosSim, v as teardownOwnedAvd } from "./workspaces-C36s2jb9.mjs";
|
|
5
|
+
import { f as collectOwnedDeviceActivity, g as workspaceBuildInProgress } from "./budget-f7516Zk0.mjs";
|
|
6
|
+
import { m as workspaceDeviceLastUseAt } from "./activity-BSV745Kz.mjs";
|
|
7
|
+
import { d as listAllIosSims } from "./ios-RkW4pnQf.mjs";
|
|
8
8
|
import { DEVICE_IDLE_SHUTDOWN_KEY, DEVICE_RECLAIM_REASON, readDeviceIdleShutdowns } from "@stim-cli/core/state";
|
|
9
9
|
//#region src/devices/idle-shutdown.ts
|
|
10
10
|
const SIM_LIST_TIMEOUT_MS = 1e4;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { h as shortUdid, i as formatDuration, l as phaseLine, m as shortHash } from "./command-output-
|
|
2
|
-
import {
|
|
3
|
-
import { n as ensureWorkspaceStorageSafely } from "./native-runtime-
|
|
4
|
-
import { t as devClientScheme } from "./dev-client-
|
|
5
|
-
import { f as podAction, h as resolveDeviceType, i as deviceLabel, m as resolveConfiguration, n as buildLogFile, s as iosConfigurationSetting, t as appNameFromPath, u as isReleaseConfiguration, v as resolveRuntime } from "./support-
|
|
6
|
-
import { a as lastBuildRecord, i as iosFacts, n as cacheDescription, s as writeLastBuild } from "./ios-project-
|
|
7
|
-
import { n as registerIos, r as runIosOperation, t as iosCommand } from "./ios-
|
|
8
|
-
import { a as collectorEntry, o as replaceCollector } from "./launch-
|
|
1
|
+
import { h as shortUdid, i as formatDuration, l as phaseLine, m as shortHash } from "./command-output-BTy8hZ0F.mjs";
|
|
2
|
+
import { E as pickDevClientScheme, O as schemesFromInfoPlist } from "./app-install-BIKtMfPq.mjs";
|
|
3
|
+
import { n as ensureWorkspaceStorageSafely } from "./native-runtime-k8dTIrbK.mjs";
|
|
4
|
+
import { t as devClientScheme } from "./dev-client-DAWVIGBu.mjs";
|
|
5
|
+
import { f as podAction, h as resolveDeviceType, i as deviceLabel, m as resolveConfiguration, n as buildLogFile, s as iosConfigurationSetting, t as appNameFromPath, u as isReleaseConfiguration, v as resolveRuntime } from "./support-CwjbFs9H.mjs";
|
|
6
|
+
import { a as lastBuildRecord, i as iosFacts, n as cacheDescription, s as writeLastBuild } from "./ios-project-K9hY_Jab.mjs";
|
|
7
|
+
import { n as registerIos, r as runIosOperation, t as iosCommand } from "./ios-Ce7bc7br.mjs";
|
|
8
|
+
import { a as collectorEntry, o as replaceCollector } from "./launch-C3qJ6Agb.mjs";
|
|
9
9
|
export { appNameFromPath, buildLogFile, cacheDescription, collectorEntry, iosCommand as default, devClientScheme, deviceLabel, ensureWorkspaceStorageSafely, formatDuration, iosConfigurationSetting, iosFacts, isReleaseConfiguration, lastBuildRecord, phaseLine, pickDevClientScheme, podAction, registerIos, replaceCollector, resolveConfiguration, resolveDeviceType, resolveRuntime, runIosOperation, schemesFromInfoPlist, shortHash, shortUdid, writeLastBuild };
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { C as iosSigningIdentitySha1Setting, I as projectSettingsContext, L as publicUrlSetting, N as metroWarmupUrlSetting, S as iosSigningIdentitySettingError, _ as iosLanHostSetting, a as SETTING_SHAPE_REMEDY, g as deviceReclaimIdleMinutesSetting, j as metroPortSetting, tt as tunnelModeSetting, v as iosLanHostSettingError, w as iosSigningIdentitySha1SettingError, x as iosSigningIdentitySetting } from "./settings-
|
|
3
|
-
import { i as recordWorkspaceUse, w as workspaceLogsDir$1 } from "./workspace-state-
|
|
4
|
-
import { _ as stepTimer, g as stepClock, i as formatDuration, l as phaseLine } from "./command-output-
|
|
5
|
-
import { I as workspaceDevServerMode, t as NO_PROJECT_REFUSAL } from "./project-
|
|
6
|
-
import { at as POOL_SETTING_REMEDY, dt as parkedMaxSetting } from "./android-
|
|
7
|
-
import { At as createRunRecorder, It as statsProjectKey$1, Ot as startBuildProgress, kt as tapBuildLog, yt as NO_BUILD_PROGRESS } from "./budget-
|
|
8
|
-
import { S as withNativeBuildRun, b as runCancellation, p as cancelledFailure, x as runCancellationSignal } from "./tailnet-
|
|
1
|
+
import { K as validateDeviceSlot, U as parseDeviceSlotOption, z as deviceSlotFileKey } from "./config-BYDxlMY3.mjs";
|
|
2
|
+
import { C as iosSigningIdentitySha1Setting, I as projectSettingsContext, L as publicUrlSetting, N as metroWarmupUrlSetting, S as iosSigningIdentitySettingError, _ as iosLanHostSetting, a as SETTING_SHAPE_REMEDY, g as deviceReclaimIdleMinutesSetting, j as metroPortSetting, tt as tunnelModeSetting, v as iosLanHostSettingError, w as iosSigningIdentitySha1SettingError, x as iosSigningIdentitySetting } from "./settings-B717odTD.mjs";
|
|
3
|
+
import { i as recordWorkspaceUse, w as workspaceLogsDir$1 } from "./workspace-state-DJt_MMvf.mjs";
|
|
4
|
+
import { _ as stepTimer, g as stepClock, i as formatDuration, l as phaseLine } from "./command-output-BTy8hZ0F.mjs";
|
|
5
|
+
import { I as workspaceDevServerMode, t as NO_PROJECT_REFUSAL } from "./project-_phNIJfs.mjs";
|
|
6
|
+
import { at as POOL_SETTING_REMEDY, dt as parkedMaxSetting } from "./android-Mz_Inn3w.mjs";
|
|
7
|
+
import { At as createRunRecorder, It as statsProjectKey$1, Ot as startBuildProgress, kt as tapBuildLog, yt as NO_BUILD_PROGRESS } from "./budget-f7516Zk0.mjs";
|
|
8
|
+
import { S as withNativeBuildRun, b as runCancellation, p as cancelledFailure, x as runCancellationSignal } from "./tailnet-Dh-qiYzG.mjs";
|
|
9
9
|
import { d as optimizationBuildProfile, l as artifactCachePolicy } from "./errors-DzkMYh8Q.mjs";
|
|
10
|
-
import { o as exitAfterFlush } from "./remote-cache-
|
|
11
|
-
import { d as simulatorRuntime, f as setRemoteLogSink, g as parseBuildMachineOption } from "./client-
|
|
12
|
-
import { i as createIosSimSnapshot } from "./ios-
|
|
13
|
-
import { r as DEFAULT_METRO_PORT } from "./app-install-
|
|
14
|
-
import { r as isPhysicalDeviceRequest, t as ensureDevServer } from "./native-runtime-
|
|
15
|
-
import { _ as COMPILATION_CACHE_NOT_RUN } from "./toolchain-
|
|
16
|
-
import "./dev-client-
|
|
17
|
-
import { f as waitFlagConflict, o as leaseExpiryText } from "./device-lease-run-
|
|
18
|
-
import { r as hostedMetroSettings } from "./metro-gateway-
|
|
19
|
-
import { i as writeDevicePlacement } from "./ios-state-
|
|
20
|
-
import { a as refusePlan, i as printPlan, n as planFlagRefusal } from "./build-plan-
|
|
21
|
-
import { r as siblingPlatformSlots, t as launchSlotScope } from "./slot-launch-
|
|
22
|
-
import { S as ownedSessionName, n as binOnPath } from "./device-remote-
|
|
23
|
-
import { r as isEasBuildFailure } from "./eas-build-
|
|
24
|
-
import { t as didSetUpDevice } from "./device-
|
|
10
|
+
import { o as exitAfterFlush } from "./remote-cache-OyOyVIS3.mjs";
|
|
11
|
+
import { d as simulatorRuntime, f as setRemoteLogSink, g as parseBuildMachineOption } from "./client-qQAaXSUs.mjs";
|
|
12
|
+
import { i as createIosSimSnapshot } from "./ios-RkW4pnQf.mjs";
|
|
13
|
+
import { r as DEFAULT_METRO_PORT } from "./app-install-BIKtMfPq.mjs";
|
|
14
|
+
import { r as isPhysicalDeviceRequest, t as ensureDevServer } from "./native-runtime-k8dTIrbK.mjs";
|
|
15
|
+
import { _ as COMPILATION_CACHE_NOT_RUN } from "./toolchain-DxSsNssu.mjs";
|
|
16
|
+
import "./dev-client-DAWVIGBu.mjs";
|
|
17
|
+
import { f as waitFlagConflict, o as leaseExpiryText } from "./device-lease-run-Cw2M4z51.mjs";
|
|
18
|
+
import { r as hostedMetroSettings } from "./metro-gateway-CX9Xlkq2.mjs";
|
|
19
|
+
import { i as writeDevicePlacement } from "./ios-state-CBLe1xYw.mjs";
|
|
20
|
+
import { a as refusePlan, i as printPlan, n as planFlagRefusal } from "./build-plan-B7SZsc2N.mjs";
|
|
21
|
+
import { r as siblingPlatformSlots, t as launchSlotScope } from "./slot-launch-DPt0m9Nd.mjs";
|
|
22
|
+
import { S as ownedSessionName, n as binOnPath } from "./device-remote-xRT0Vmo9.mjs";
|
|
23
|
+
import { r as isEasBuildFailure } from "./eas-build-JyfqyHfC.mjs";
|
|
24
|
+
import { t as didSetUpDevice } from "./device-BECOiufl.mjs";
|
|
25
25
|
import { t as unsupportedPlan } from "./project-plan-BPwbLwQu.mjs";
|
|
26
|
-
import { _ as resolveIosWait, a as deviceModelRefusal, b as resolveSimulatorAppFlag, c as iosProjectPathError, d as ownedSimFailure, g as resolveIosBuildSetup, h as resolveDeviceType, i as deviceLabel, m as resolveConfiguration, n as buildLogFile, r as createIosDeviceWaitRun, u as isReleaseConfiguration, v as resolveRuntime, x as simulatorBuildArch, y as resolveSchemeSelection } from "./support-
|
|
27
|
-
import { a as lastBuildRecord, o as reportIosResult, s as writeLastBuild } from "./ios-project-
|
|
28
|
-
import { t as acquireIosArtifact } from "./artifact-
|
|
29
|
-
import { a as iosPlacementBudget, i as hostedIosSelectors, n as connectIosTarget, o as selectIosPlacement, r as hostedIosMetroNote, t as connectIosBackend } from "./remote-
|
|
30
|
-
import { a as iosPoolCandidates, c as isWirelessIosDevice, f as resolveIosPhysicalDevice, o as iosPoolNoCandidatesRefusal, r as iosDeviceBounds } from "./ios-device-
|
|
31
|
-
import { i as DEFAULT_DEPS, l as lanOriginUrlFor, s as chooseLanAddress, t as finishIosRun } from "./launch-
|
|
26
|
+
import { _ as resolveIosWait, a as deviceModelRefusal, b as resolveSimulatorAppFlag, c as iosProjectPathError, d as ownedSimFailure, g as resolveIosBuildSetup, h as resolveDeviceType, i as deviceLabel, m as resolveConfiguration, n as buildLogFile, r as createIosDeviceWaitRun, u as isReleaseConfiguration, v as resolveRuntime, x as simulatorBuildArch, y as resolveSchemeSelection } from "./support-CwjbFs9H.mjs";
|
|
27
|
+
import { a as lastBuildRecord, o as reportIosResult, s as writeLastBuild } from "./ios-project-K9hY_Jab.mjs";
|
|
28
|
+
import { t as acquireIosArtifact } from "./artifact-HSwkIWEQ.mjs";
|
|
29
|
+
import { a as iosPlacementBudget, i as hostedIosSelectors, n as connectIosTarget, o as selectIosPlacement, r as hostedIosMetroNote, t as connectIosBackend } from "./remote-BiR6aYjy.mjs";
|
|
30
|
+
import { a as iosPoolCandidates, c as isWirelessIosDevice, f as resolveIosPhysicalDevice, o as iosPoolNoCandidatesRefusal, r as iosDeviceBounds } from "./ios-device-D7pi2Sca.mjs";
|
|
31
|
+
import { i as DEFAULT_DEPS, l as lanOriginUrlFor, s as chooseLanAddress, t as finishIosRun } from "./launch-C3qJ6Agb.mjs";
|
|
32
32
|
import { basename, join } from "node:path";
|
|
33
33
|
import { hostedIosStatus, parseMachine } from "@stim-cli/core/state";
|
|
34
34
|
import { workspaceId } from "@stim-cli/core";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { N as formatBytes, _ as loadConfig$1 } from "./config-BYDxlMY3.mjs";
|
|
2
|
+
import { t as getExecutor } from "./exec-DqKo9GKJ.mjs";
|
|
3
3
|
import { n as stripAnsi, r as waitForChild, t as createLineReader } from "./process-output-Fpl8PYi8.mjs";
|
|
4
|
-
import { n as settingDefault, t as STIM_DESKTOP_OPEN_OPTIONS } from "./stim-desktop-
|
|
5
|
-
import { it as isStimOwnedSim } from "./android-
|
|
6
|
-
import { r as recordCreatedDevice, t as forgetCreatedDevice } from "./created-devices-
|
|
4
|
+
import { n as settingDefault, t as STIM_DESKTOP_OPEN_OPTIONS } from "./stim-desktop-BzBN2Em2.mjs";
|
|
5
|
+
import { it as isStimOwnedSim } from "./android-Mz_Inn3w.mjs";
|
|
6
|
+
import { r as recordCreatedDevice, t as forgetCreatedDevice } from "./created-devices-Dzd5C2LF.mjs";
|
|
7
7
|
import { closeSync, existsSync, lstatSync, mkdtempSync, openSync, readSync, readdirSync, rmSync, writeFileSync } from "node:fs";
|
|
8
8
|
import { dirname, isAbsolute, join, resolve } from "node:path";
|
|
9
|
-
import { IOS_SIMULATOR_APPS, settingDefinition } from "@stim-cli/core/state";
|
|
9
|
+
import { IOS_SIMULATOR_APPS, isJsonObject, settingDefinition } from "@stim-cli/core/state";
|
|
10
10
|
import { createHash } from "node:crypto";
|
|
11
11
|
import { tmpdir, totalmem } from "node:os";
|
|
12
12
|
//#region src/engine/installed-artifact.ts
|
|
@@ -577,10 +577,15 @@ function listIosDeviceTypes() {
|
|
|
577
577
|
timeoutMs: 3e4,
|
|
578
578
|
killSignal: "SIGKILL"
|
|
579
579
|
});
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
580
|
+
const data = JSON.parse(out);
|
|
581
|
+
return isJsonObject(data) ? deviceTypesOf(data.devicetypes) : [];
|
|
582
|
+
}
|
|
583
|
+
function deviceTypesOf(value) {
|
|
584
|
+
if (!Array.isArray(value)) return [];
|
|
585
|
+
return value.flatMap((entry) => isJsonObject(entry) && typeof entry.identifier === "string" && typeof entry.name === "string" ? [{
|
|
586
|
+
identifier: entry.identifier,
|
|
587
|
+
name: entry.name
|
|
588
|
+
}] : []);
|
|
584
589
|
}
|
|
585
590
|
function rankIphone(name) {
|
|
586
591
|
const gen = /^iPhone\s+(\d+)/i.exec(name);
|
|
@@ -817,7 +822,7 @@ function listUserApps(udid) {
|
|
|
817
822
|
"-o",
|
|
818
823
|
"-",
|
|
819
824
|
plist
|
|
820
|
-
]));
|
|
825
|
+
], { timeoutMs: 1e4 }));
|
|
821
826
|
} finally {
|
|
822
827
|
rmSync(dir, {
|
|
823
828
|
recursive: true,
|
|
@@ -874,15 +879,14 @@ async function listIosRuntimesAsync() {
|
|
|
874
879
|
return parseIosRuntimes(await getExecutor().runFileAsync("xcrun", LIST_RUNTIMES_ARGS, LIST_RUNTIMES_OPTIONS));
|
|
875
880
|
}
|
|
876
881
|
function parseIosRuntimes(out) {
|
|
877
|
-
|
|
882
|
+
const data = JSON.parse(out);
|
|
883
|
+
if (!isJsonObject(data) || !Array.isArray(data.runtimes)) return [];
|
|
884
|
+
return data.runtimes.flatMap((r) => isJsonObject(r) && r.isAvailable === true && r.platform === "iOS" && typeof r.identifier === "string" && typeof r.name === "string" && typeof r.version === "string" ? [{
|
|
878
885
|
identifier: r.identifier,
|
|
879
886
|
name: r.name,
|
|
880
887
|
version: r.version,
|
|
881
|
-
supportedDeviceTypes: (r.supportedDeviceTypes
|
|
882
|
-
|
|
883
|
-
name: d.name
|
|
884
|
-
}))
|
|
885
|
-
}));
|
|
888
|
+
supportedDeviceTypes: deviceTypesOf(r.supportedDeviceTypes)
|
|
889
|
+
}] : []);
|
|
886
890
|
}
|
|
887
891
|
//#endregion
|
|
888
892
|
export { configuredIosSimulatorViewer as A, resetIosKeychain as C, sanitizeDeviceLabel as D, resolveOwnedIosSim as E, memoryCulpritAdvice as F, memoryCulpritFindings as I, readMemoryCulprits as L, hostMemoryPressureAdvice as M, memoryCulpritsUnder as N, shutdownIosSim as O, readHostMemoryPressure as P, deviceHoldsApk as R, renameIosSim as S, resolveIosCreation as T, ownedSimName as _, createOwnedIosSim as a, parseSimctlList as b, eraseIosSim as c, listAllIosSims as d, listAllIosSimsAsync as f, listUserApps as g, listIosRuntimesAsync as h, createIosSimSnapshot as i, parseIosSimulatorApp as j, uninstallIosApp as k, iosRuntimeMatches as l, listIosRuntimes as m, bootIosSim as n, deleteIosSim as o, listIosDeviceTypes as p, clearIosAppData as r, deleteParkedIosSim as s, IOS_BOOT_TIMEOUT_MS as t, iosSimulatorFailureAdvice as u, parkedSimName as v, resetIosPrivacy as w, pickDefaultIosCreation as x, parseRuntimeVersion as y, deviceHoldsBundle as z };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as getExecutor } from "./exec-
|
|
2
|
-
import { n as TOOL_ERROR_PREFIX } from "./ios-device-
|
|
3
|
-
import { i as INSTALL_ERROR } from "./app-install-
|
|
1
|
+
import { t as getExecutor } from "./exec-DqKo9GKJ.mjs";
|
|
2
|
+
import { n as TOOL_ERROR_PREFIX } from "./ios-device-B5veSDDQ.mjs";
|
|
3
|
+
import { i as INSTALL_ERROR, l as appProcessFromPid } from "./app-install-BIKtMfPq.mjs";
|
|
4
4
|
import { mkdtempSync, readFileSync, rmSync } from "node:fs";
|
|
5
5
|
import { join } from "node:path";
|
|
6
6
|
import { tmpdir } from "node:os";
|
|
@@ -364,9 +364,9 @@ function iosDeviceProcess({ udid, appName }, { exec = null } = {}) {
|
|
|
364
364
|
"--json-output",
|
|
365
365
|
out
|
|
366
366
|
], { timeoutMs: DEVICECTL_TIMEOUT_MS });
|
|
367
|
-
return deviceProcessPid(parseDeviceProcesses(readFileSync(out, "utf-8")), appName);
|
|
367
|
+
return appProcessFromPid(deviceProcessPid(parseDeviceProcesses(readFileSync(out, "utf-8")), appName));
|
|
368
368
|
} catch {
|
|
369
|
-
return;
|
|
369
|
+
return { state: "unknown" };
|
|
370
370
|
} finally {
|
|
371
371
|
rmSync(dir, {
|
|
372
372
|
recursive: true,
|
|
@@ -427,8 +427,8 @@ async function awaitIosDeviceLaunch({ udid, bundleId, appName, collectorPid = nu
|
|
|
427
427
|
for (;;) {
|
|
428
428
|
const records = collectorRecordsFor(readRecords(), collectorPid);
|
|
429
429
|
const ended = records.find((entry) => typeof entry.event === "string" && COLLECTOR_ENDED_EVENTS.has(entry.event));
|
|
430
|
-
const
|
|
431
|
-
if (
|
|
430
|
+
const running = probeProcess();
|
|
431
|
+
if (running.state === "running") return { pid: running.pid };
|
|
432
432
|
if (ended) {
|
|
433
433
|
const evidence = launchEvidence(records);
|
|
434
434
|
const lines = evidence.slice(-6);
|
|
@@ -482,22 +482,22 @@ async function verifyIosDeviceReleaseLaunch({ udid, appName, waitMs = 3e3, probe
|
|
|
482
482
|
}));
|
|
483
483
|
const startedAt = now();
|
|
484
484
|
await sleep(Math.max(0, waitMs));
|
|
485
|
-
const
|
|
485
|
+
const running = probeProcess();
|
|
486
486
|
const waitedMs = now() - startedAt;
|
|
487
|
-
if (
|
|
487
|
+
if (running.state === "unknown") return {
|
|
488
488
|
verified: false,
|
|
489
489
|
reason: "probe-failed",
|
|
490
490
|
waitedMs
|
|
491
491
|
};
|
|
492
|
-
return
|
|
492
|
+
return running.state === "running" ? {
|
|
493
|
+
verified: true,
|
|
494
|
+
waitedMs,
|
|
495
|
+
pid: running.pid
|
|
496
|
+
} : {
|
|
493
497
|
verified: false,
|
|
494
498
|
reason: "exited",
|
|
495
499
|
waitedMs,
|
|
496
500
|
pid: null
|
|
497
|
-
} : {
|
|
498
|
-
verified: true,
|
|
499
|
-
waitedMs,
|
|
500
|
-
pid
|
|
501
501
|
};
|
|
502
502
|
}
|
|
503
503
|
const LOCAL_NETWORK_PROHIBITED = /_NSURLErrorNWPathKey=unsatisfied \(Local network prohibited\)/;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { y as workspaceAgentDeviceDir } from "./workspace-state-
|
|
2
|
-
import { i as formatDuration, l as phaseLine } from "./command-output-
|
|
3
|
-
import { i as workspaceLinkLine } from "./stim-desktop-
|
|
4
|
-
import { Dt as recordFinishedBuild } from "./budget-
|
|
5
|
-
import { a as easAuthNote, n as UPLOAD_TIMEOUT_MS, r as cacheLevel, s as isEasAuthFailureText } from "./remote-cache-
|
|
6
|
-
import "./launch-verify-
|
|
7
|
-
import { S as compilationCacheActivityLine, _ as COMPILATION_CACHE_NOT_RUN } from "./toolchain-
|
|
8
|
-
import { i as deviceLabel } from "./support-
|
|
1
|
+
import { y as workspaceAgentDeviceDir } from "./workspace-state-DJt_MMvf.mjs";
|
|
2
|
+
import { i as formatDuration, l as phaseLine } from "./command-output-BTy8hZ0F.mjs";
|
|
3
|
+
import { i as workspaceLinkLine } from "./stim-desktop-BzBN2Em2.mjs";
|
|
4
|
+
import { Dt as recordFinishedBuild } from "./budget-f7516Zk0.mjs";
|
|
5
|
+
import { a as easAuthNote, n as UPLOAD_TIMEOUT_MS, r as cacheLevel, s as isEasAuthFailureText } from "./remote-cache-OyOyVIS3.mjs";
|
|
6
|
+
import "./launch-verify-B6Q8hZP-.mjs";
|
|
7
|
+
import { S as compilationCacheActivityLine, _ as COMPILATION_CACHE_NOT_RUN } from "./toolchain-DxSsNssu.mjs";
|
|
8
|
+
import { i as deviceLabel } from "./support-CwjbFs9H.mjs";
|
|
9
9
|
import { buildDiagnostics } from "@stim-cli/core/state";
|
|
10
10
|
import chalk from "chalk";
|
|
11
11
|
//#region src/commands/ios/result.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as updateWorkspaceState, r as readWorkspaceState$1 } from "./workspace-state-
|
|
1
|
+
import { a as updateWorkspaceState, r as readWorkspaceState$1 } from "./workspace-state-DJt_MMvf.mjs";
|
|
2
2
|
import { HOSTED_METRO_REQUESTS_KEY, hostedMetroRequests, hostedNativeRecords, isJsonObject, parseHostedNativePlacement, unreadableHostedNative } from "@stim-cli/core/state";
|
|
3
3
|
//#region src/device-host/ios-state.ts
|
|
4
4
|
function readHostedNative(root, platform, slot) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as getExecutor } from "./exec-
|
|
2
|
-
import { Ft as
|
|
1
|
+
import { t as getExecutor } from "./exec-DqKo9GKJ.mjs";
|
|
2
|
+
import { Ft as makeTemporaryDirectory, It as removeTemporaryEntry } from "./settings-B717odTD.mjs";
|
|
3
3
|
import { r as waitForChild, t as createLineReader } from "./process-output-Fpl8PYi8.mjs";
|
|
4
|
-
import { t as cleanLine } from "./server-expo-
|
|
5
|
-
import { M as startBuildHeartbeat, P as tailLines, y as HEARTBEAT_INTERVAL_MS } from "./toolchain-
|
|
4
|
+
import { t as cleanLine } from "./server-expo-DsguMGUF.mjs";
|
|
5
|
+
import { M as startBuildHeartbeat, P as tailLines, y as HEARTBEAT_INTERVAL_MS } from "./toolchain-DxSsNssu.mjs";
|
|
6
6
|
import { existsSync, mkdirSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs";
|
|
7
7
|
import { basename, join } from "node:path";
|
|
8
8
|
import { randomUUID } from "node:crypto";
|
|
@@ -116,7 +116,7 @@ function readPlistKey(e, plist, key, format) {
|
|
|
116
116
|
"-o",
|
|
117
117
|
"-",
|
|
118
118
|
plist
|
|
119
|
-
]);
|
|
119
|
+
], { timeoutMs: 1e4 });
|
|
120
120
|
} catch (err) {
|
|
121
121
|
if (/No value at that key path/.test(describe(err))) return null;
|
|
122
122
|
throw err;
|
|
@@ -237,14 +237,14 @@ async function swapJsBundle({ root, iosDir, isExpo, cachedAppPath, logWriter = n
|
|
|
237
237
|
"-R",
|
|
238
238
|
cachedAppPath,
|
|
239
239
|
appCopy
|
|
240
|
-
]);
|
|
240
|
+
], { timeoutMs: "unbounded" });
|
|
241
241
|
} catch {
|
|
242
242
|
removeTemporaryEntry(appCopy);
|
|
243
243
|
e.runFile("cp", [
|
|
244
244
|
"-R",
|
|
245
245
|
cachedAppPath,
|
|
246
246
|
appCopy
|
|
247
|
-
]);
|
|
247
|
+
], { timeoutMs: "unbounded" });
|
|
248
248
|
}
|
|
249
249
|
} catch (err) {
|
|
250
250
|
return fail("copy", `could not copy ${cachedAppPath} aside: ${describe(err)}`);
|
|
@@ -353,8 +353,8 @@ async function swapJsBundle({ root, iosDir, isExpo, cachedAppPath, logWriter = n
|
|
|
353
353
|
e.runFile(hermesc, hermescArgs({
|
|
354
354
|
bundle: bundleOutput,
|
|
355
355
|
out: hbc
|
|
356
|
-
}));
|
|
357
|
-
e.runFile("mv", [hbc, bundleOutput]);
|
|
356
|
+
}), { timeoutMs: "unbounded" });
|
|
357
|
+
e.runFile("mv", [hbc, bundleOutput], { timeoutMs: 3e4 });
|
|
358
358
|
hermes = true;
|
|
359
359
|
} catch (err) {
|
|
360
360
|
return fail("hermesc", `hermesc failed on ${bundleOutput}: ${describe(err)}`);
|
|
@@ -362,12 +362,12 @@ async function swapJsBundle({ root, iosDir, isExpo, cachedAppPath, logWriter = n
|
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
364
|
try {
|
|
365
|
-
e.runFile("cp", [bundleOutput, join(appCopy, JS_BUNDLE_NAME)]);
|
|
365
|
+
e.runFile("cp", [bundleOutput, join(appCopy, JS_BUNDLE_NAME)], { timeoutMs: "unbounded" });
|
|
366
366
|
e.runFile("cp", [
|
|
367
367
|
"-R",
|
|
368
368
|
`${assetsDest}/.`,
|
|
369
369
|
`${appCopy}/`
|
|
370
|
-
]);
|
|
370
|
+
], { timeoutMs: "unbounded" });
|
|
371
371
|
} catch (err) {
|
|
372
372
|
return fail("replace", `could not replace the JS bundle inside ${appCopy}: ${describe(err)}`);
|
|
373
373
|
}
|
|
@@ -384,7 +384,7 @@ async function swapJsBundle({ root, iosDir, isExpo, cachedAppPath, logWriter = n
|
|
|
384
384
|
catalog: catalogDir,
|
|
385
385
|
out: catalogBundle,
|
|
386
386
|
target: catalogTarget
|
|
387
|
-
}));
|
|
387
|
+
}), { timeoutMs: "unbounded" });
|
|
388
388
|
if (!exists(join(catalogBundle, "Assets.car"))) return fail("actool", `actool wrote no Assets.car into ${catalogBundle}`, tailLines(output.split("\n"), LAST_LINES));
|
|
389
389
|
writeFileSync(join(catalogBundle, "Info.plist"), ASSET_CATALOG_BUNDLE_INFO_PLIST);
|
|
390
390
|
}
|
|
@@ -405,7 +405,7 @@ async function swapJsBundle({ root, iosDir, isExpo, cachedAppPath, logWriter = n
|
|
|
405
405
|
"--sign",
|
|
406
406
|
"-",
|
|
407
407
|
appCopy
|
|
408
|
-
]);
|
|
408
|
+
], { timeoutMs: "unbounded" });
|
|
409
409
|
} catch (err) {
|
|
410
410
|
return fail("codesign", `codesign --force --sign - ${appCopy} failed: ${describe(err)}`);
|
|
411
411
|
}
|