stim 1.26.0 → 1.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{acquire-artifact-DVsvSwf7.mjs → acquire-artifact-CKByBnTD.mjs} +2 -2
- package/dist/{act-C-BqJEpu.mjs → act-8iswyfRa.mjs} +319 -126
- package/dist/{activity-Lnb_EoRY.mjs → activity-DRMg4_mD.mjs} +6 -6
- package/dist/{agent-device-usage-output-DbXy5tg8.mjs → agent-device-usage-output-tE90fDdo.mjs} +5 -5
- package/dist/{android-CiNQw3kq.mjs → android-CHmSU4B4.mjs} +101 -45
- package/dist/{android-DTAcRwBC.mjs → android-CsPs-7Mg.mjs} +23 -18
- package/dist/{android-B5P81yI-.mjs → android-D577ApKG.mjs} +37 -15
- package/dist/{android-CSbLRD53.mjs → android-YWCbmkVK.mjs} +5 -5
- package/dist/{android-cas-BTVhZ0Qs.mjs → android-cas-_aDifWW0.mjs} +4 -4
- package/dist/android-cas-compiler.mjs +1 -1
- package/dist/api.d.mts +14 -4
- package/dist/api.mjs +39 -29
- package/dist/{apk-signed-tail-B46U9hXc.mjs → apk-signed-tail-CQbwM0qO.mjs} +2 -2
- package/dist/{artifact-CsAP6AGK.mjs → artifact-DYtHjxsn.mjs} +19 -24
- package/dist/{artifact-BxREhAaV.mjs → artifact-bFkfD3vf.mjs} +18 -23
- package/dist/{artifact-platform-CMRc0M_r.mjs → artifact-platform-BO2Uvk_A.mjs} +1 -1
- package/dist/auto-placement-BVqs8AJi.mjs +350 -0
- package/dist/{browser-web-rYPyqhTf.mjs → browser-web-BUaLcafY.mjs} +16 -16
- package/dist/{build-DPhApsjV.mjs → build-cQURy_KW.mjs} +35 -31
- package/dist/{build-cache-DrXNCy3T.mjs → build-cache-CZULpXVl.mjs} +43 -21
- package/dist/{build-plan-DrMMdayj.mjs → build-plan-CxoYfxsc.mjs} +7 -6
- package/dist/{cache-manifest-BEZ9Bpl1.mjs → cache-manifest-DEjqGGat.mjs} +1 -1
- package/dist/cache-manifest.mjs +1 -1
- package/dist/{budget-k2mZGvvk.mjs → ccache-Bm_A1xX9.mjs} +562 -1604
- package/dist/{cdp-BG3FJCCx.mjs → cdp-C3svvXiE.mjs} +1 -1
- package/dist/{chrome-BvV8ssI3.mjs → chrome-DyDWurWG.mjs} +1 -1
- package/dist/{cli-BBKFGOFl.mjs → cli-CpbaLDa7.mjs} +24 -23
- package/dist/cli.mjs +1 -1
- package/dist/{client-D9CaRks-.mjs → client-YxCer6ab.mjs} +84 -65
- package/dist/collector-run.d.mts +10 -9
- package/dist/collector-run.mjs +42 -27
- package/dist/{command-output-BF5AR2dL.mjs → command-output-C8R1KIvi.mjs} +1 -1
- package/dist/{config-BktkY_zC.mjs → config-Cn94Jc0g.mjs} +23 -4
- package/dist/{dependencies-Dw6wfQdv.mjs → dependencies-DKeMzwXY.mjs} +108 -60
- package/dist/{dependency-state-DFB41vfr.mjs → dependency-state-CojA2o0t.mjs} +14 -7
- package/dist/{detached-entry-KmieOKgN.mjs → detached-entry-BPlSaCwC.mjs} +1 -1
- package/dist/{dev-client-DXR_tPVY.mjs → dev-client-D-BW5uiq.mjs} +2 -2
- package/dist/{device-BK-zwyd_.mjs → device-CgXfbcz5.mjs} +25 -24
- package/dist/{device-capacity-DCSvUF0l.mjs → device-capacity-Cd8lMSn3.mjs} +175 -22
- package/dist/{device-BcYeHSFu.mjs → device-eeK95Lir.mjs} +16 -16
- package/dist/device-host-worker.mjs +22 -20
- package/dist/{device-ios-BLGfXQeK.mjs → device-ios-Cc9ulihb.mjs} +251 -23
- package/dist/{device-lease-run-BmvIl7bI.mjs → device-lease-run-Mtzp4THX.mjs} +5 -5
- package/dist/{device-pool-Dluix4H3.mjs → device-pool-eRz6DtCg.mjs} +3 -3
- package/dist/{doctor-Bhg1ii70.mjs → doctor-Bz_ouYAW.mjs} +28 -16
- package/dist/{doctor-Cp-BhzTS.mjs → doctor-C2QyhejJ.mjs} +1 -1
- package/dist/{doctor-fingerprint-D3a04Mhu.mjs → doctor-fingerprint-o7ZI9YLn.mjs} +1 -1
- package/dist/doctor-fingerprint.mjs +1 -1
- package/dist/{doctor-watchman-BStK05nt.mjs → doctor-watchman-BTW82PDC.mjs} +5 -5
- package/dist/{doctor-OnwP94ne.mjs → doctor-xf7ht-5n.mjs} +76 -32
- package/dist/{eas-build-Dsj93iM9.mjs → eas-build-Dm6q68QY.mjs} +4 -4
- package/dist/eas-fallback-DajNpxf-.mjs +87 -0
- package/dist/{eas-session-ledger-B5vygTiD.mjs → eas-session-ledger-CBFo_Uo1.mjs} +37 -8
- package/dist/{error-diagnostics-BOOm9Db7.mjs → error-diagnostics-D1QfyJzQ.mjs} +51 -25
- package/dist/{exec-VFRpu1iA.mjs → exec-aULwtNly.mjs} +57 -6
- package/dist/{gc-ldgr-hXU.mjs → gc-DM5oMm-J.mjs} +161 -45
- package/dist/{gc-C_79zvz4.mjs → gc-PLFwb0k4.mjs} +2 -2
- package/dist/{guide-D7K0X6KG.mjs → guide-C4I46XAk.mjs} +674 -213
- package/dist/{hosted-android-Bk54ej6n.mjs → hosted-android-DlaKLbW0.mjs} +6 -7
- package/dist/{hosted-client-fHO8yqzc.mjs → hosted-client-DDRm9hPJ.mjs} +51 -20
- package/dist/{hosted-logs-BfbmDM4M.mjs → hosted-logs-bSebOKbz.mjs} +8 -8
- package/dist/{hosted-logs-sync-B0pvmOk-.mjs → hosted-logs-sync-B0c53W_c.mjs} +5 -5
- package/dist/{hosted-macos-CPl0OZ9h.mjs → hosted-macos-B7-8Pv4H.mjs} +6 -6
- package/dist/{hosted-native-CpDB3-PO.mjs → hosted-native-CDe33CSr.mjs} +22 -18
- package/dist/{idle-shutdown-FfxL1KdG.mjs → idle-shutdown-CQ0QwU9J.mjs} +7 -8
- package/dist/{ios-WxpDJ5T1.mjs → ios-B1DYuOjh.mjs} +27 -11
- package/dist/{ios-B7-lToDu.mjs → ios-B1HvafEG.mjs} +8 -8
- package/dist/{ios-ENC4sRPA.mjs → ios-CsRVik64.mjs} +7 -1
- package/dist/{ios-device-CsyryvpT.mjs → ios-device-B4elVFKi.mjs} +3 -3
- package/dist/{ios-device-B6HK951C.mjs → ios-device-CiBA-er9.mjs} +1 -1
- package/dist/{ios-project-Ty5pHl9O.mjs → ios-project-CR4mZ7CH.mjs} +22 -9
- package/dist/{ios-signing-4c_qXvQm.mjs → ios-signing-BJzvDPfU.mjs} +2 -2
- package/dist/{ios-state-Cw7-WQf2.mjs → ios-state-BPHqMDdZ.mjs} +1 -1
- package/dist/{ios-ftxdQbJS.mjs → ios-tg4tp3q1.mjs} +94 -37
- package/dist/{js-swap-BMhXYVDS.mjs → js-swap-CVpSW1fn.mjs} +8 -7
- package/dist/{launch-DOp8RjDz.mjs → launch-DoySmhjz.mjs} +42 -38
- package/dist/lightened-DFAJgfIk.mjs +171 -0
- package/dist/{logs-s1dRIG1E.mjs → logs-BGsW7iPe.mjs} +46 -21
- package/dist/{logs-dQDki6Tt.mjs → logs-DI5ILkYB.mjs} +7 -7
- package/dist/{macos-DBBPNnIA.mjs → macos-Bo9st9Di.mjs} +73 -38
- package/dist/{macos-B0VEV3Gf.mjs → macos-C12RMJQF.mjs} +1 -1
- package/dist/macos-run.mjs +1 -1
- package/dist/maintenance-run.mjs +7 -7
- package/dist/{metro-CjC10t6E.mjs → metro-BnhXV2Mj.mjs} +4 -4
- package/dist/{metro-gateway-B6_PgD0L.mjs → metro-request-DXyKjVDF.mjs} +26 -47
- package/dist/{named-ports-BG0j1X4g.mjs → named-ports-Phoi2POD.mjs} +3 -3
- package/dist/{native-android-CL2NGiik.mjs → native-android-vxgtLD7w.mjs} +17 -18
- package/dist/{native-gradle-artifact-inputs-btSUulme.mjs → native-gradle-artifact-inputs-BN96IVw8.mjs} +5 -5
- package/dist/{native-runtime-Dq3RBcON.mjs → native-runtime-DG4Rodzj.mjs} +9 -8
- package/dist/{native-source-D-4Dh4JU.mjs → native-source-D1AzWiuP.mjs} +1 -1
- package/dist/{native-xcode-inputs-BW7H8JGu.mjs → native-xcode-inputs-BKarCoKg.mjs} +3 -3
- package/dist/{native-xcode-ios-CBXJAxfC.mjs → native-xcode-ios-8A-efGa5.mjs} +17 -17
- package/dist/{ndjson-CgE_o3Dl.mjs → ndjson-Dy2W4vRa.mjs} +2 -2
- package/dist/offload-worker.mjs +23 -24
- package/dist/{operation-exec-CUZifp6Z.mjs → operation-exec-Dp4FuIGR.mjs} +1 -1
- package/dist/{ownership-BjYvMNX_.mjs → ownership-DJCq48IJ.mjs} +3 -3
- package/dist/{page-CzEA_-5_.mjs → page-CQJlcj3x.mjs} +2 -2
- package/dist/{phone-reverses-lmj6kcPm.mjs → phone-reverses-BzTa8g1F.mjs} +18 -4
- package/dist/{placement-log-DIFPQAXp.mjs → placement-log-Cvhta5ib.mjs} +3 -3
- package/dist/{plan-placement-IiiSQhtz.mjs → plan-placement-WkZdccuN.mjs} +36 -10
- package/dist/{ports-C2_w1Z0Z.mjs → ports-UV4mJgyC.mjs} +3 -3
- package/dist/{prebuild-gmouvmJZ.mjs → prebuild-k8d_tqOq.mjs} +16 -17
- package/dist/{project-BUu6Is4k.mjs → project-Sui52ywT.mjs} +17 -17
- package/dist/{pull-request-CbNlkFok.mjs → pull-request-BzLmzAIQ.mjs} +2 -2
- package/dist/pull-requests.mjs +1 -1
- package/dist/{react-native-android-Cgg99REN.mjs → react-native-android-DANlGGQf.mjs} +32 -26
- package/dist/{react-native-build-oNwqF5Wb.mjs → react-native-build-jUHnIfZ9.mjs} +9 -9
- package/dist/{react-native-doctor-BhA3KUte.mjs → react-native-doctor-DCWRjS7K.mjs} +6 -6
- package/dist/{react-native-ios-B-nf4rjN.mjs → react-native-ios-BwMsFMXi.mjs} +23 -17
- package/dist/{recordings-BldzVKq0.mjs → recordings-iy0mkm7b.mjs} +1 -1
- package/dist/{registration-CN6nlhcD.mjs → registration-BwCe64PH.mjs} +1 -1
- package/dist/{reload-C9OduiNc.mjs → reload-Bj7QyuDy.mjs} +1 -1
- package/dist/{reload-CCR7KC_l.mjs → reload-c_uEyc_X.mjs} +16 -16
- package/dist/{remote-C8S7FlPF.mjs → remote-DFlpAqdV.mjs} +23 -10
- package/dist/{result-7F5hEwQJ.mjs → result-BIcXREyC.mjs} +32 -21
- package/dist/{run-BqB0v3pt.mjs → run-y2HwyNvg.mjs} +3 -3
- package/dist/{selection-BNPBZ6T5.mjs → selection-CXgM_VK_.mjs} +37 -29
- package/dist/{server-bare-A75rDIdD.mjs → server-bare-2N4vSRZG.mjs} +2 -2
- package/dist/{server-command-CssKFOD7.mjs → server-command-qneHPcRI.mjs} +6 -6
- package/dist/{server-expo-eQfOdydb.mjs → server-expo-Ccm9zB0o.mjs} +4 -4
- package/dist/server-expo-WulkyAwT.mjs +2 -0
- package/dist/{settings-CosW5X-S.mjs → settings-CY5JZlNN.mjs} +375 -62
- package/dist/{settings-OaGQF-ri.mjs → settings-Cfd_Q6ys.mjs} +24 -3
- package/dist/settings-payload-DwQiEMCn.mjs +257 -0
- package/dist/settings-write-CJpjkeAd.mjs +185 -0
- package/dist/settings.schema.json +51 -33
- package/dist/{simslim-Bax1qcxu.mjs → simslim-DCQwzoPy.mjs} +2 -2
- package/dist/{slot-launch-CYCEhfBY.mjs → slot-launch-BpmanOnk.mjs} +6 -6
- package/dist/{stage-jKQ7CP_B.mjs → stage-CmugrSG5.mjs} +2 -2
- package/dist/{start-C_wefNKB.mjs → start-CHH3zgIU.mjs} +1 -1
- package/dist/{start-_BdJ32cZ.mjs → start-DYLk6GXn.mjs} +27 -22
- package/dist/{state-C1i2nMOP.mjs → state-B2QJbDwz.mjs} +4 -4
- package/dist/{state-C4OdpOTF.mjs → state-BXC1Lfxw.mjs} +2 -2
- package/dist/{stats-tEpEEH-u.mjs → stats-DxKqhcGp.mjs} +5 -5
- package/dist/{stats-report-n2U5plhk.mjs → stats-report-B86Cv7Uc.mjs} +1 -1
- package/dist/{status-CRXz-Gtj.mjs → status-7ULDEJ1e.mjs} +1 -1
- package/dist/{status-DQrqodLj.mjs → status-BHCkOZga.mjs} +51 -28
- package/dist/{status-B9M7x4CZ.mjs → status-D_Ljc89p.mjs} +1 -1
- package/dist/{status-watch-B5wDIH_o.mjs → status-watch-BmsPqYSU.mjs} +18 -7
- package/dist/status-worker.mjs +1 -1
- package/dist/{stim-desktop-6Dqp-gjX.mjs → stim-desktop-CbWo21kb.mjs} +2 -2
- package/dist/{stop-DRqQVqDJ.mjs → stop-D-dGE9gh.mjs} +21 -20
- package/dist/{stop-ySNQHXMG.mjs → stop-DQvE-P76.mjs} +10 -6
- package/dist/{stop-CmdNhGlC.mjs → stop-b2pouxAO.mjs} +2 -2
- package/dist/supervisor-run.mjs +237 -63
- package/dist/{support-BGSCBoib.mjs → support-04IhBUTT.mjs} +6 -6
- package/dist/{support-CVOCp0Ft.mjs → support-BtlJKjyQ.mjs} +12 -11
- package/dist/{swiftpm-artifact-inputs-CfUzt_0Z.mjs → swiftpm-artifact-inputs-Cj2UpmPN.mjs} +4 -4
- package/dist/{swiftpm-macos-x6HPpl_2.mjs → swiftpm-macos-BhF2stxY.mjs} +11 -12
- package/dist/{toolchain-J4J8MrAr.mjs → toolchain-mLA_km-b.mjs} +321 -15
- package/dist/{toolchain-DoavrvIA.mjs → toolchain-qktiV8xc.mjs} +1 -1
- package/dist/{trigger-KVaWWNyn.mjs → trigger-DMou-X7j.mjs} +2 -2
- package/dist/trigger-qp2ji5wE.mjs +2 -0
- package/dist/{warm-progress-DvhTX_eu.mjs → warm-progress-B0Vpuvpl.mjs} +731 -727
- package/dist/{web-Bihbf7-u.mjs → web-BYmK0TjL.mjs} +9 -9
- package/dist/web-CrVLVQZY.mjs +2 -0
- package/dist/web-run.mjs +9 -9
- package/dist/windows-report.mjs +1 -1
- package/dist/{workspace-state-pUg3_RRA.mjs → workspace-state-kIZrdlSg.mjs} +3 -3
- package/dist/{workspaces-g2lhdBXF.mjs → workspaces-CmOcceDN.mjs} +1879 -74
- package/dist/{worktree-BKuklFh_.mjs → worktree-2dk5edza.mjs} +933 -534
- package/dist/worktree-nliAoHxB.mjs +2 -0
- package/package.json +7 -7
- package/dist/ccache-Bx5TbxwG.mjs +0 -143
- package/dist/eas-fallback-FwkeqqGi.mjs +0 -381
- package/dist/hosted-ios-D55QhYaD.mjs +0 -15
- package/dist/native-run-BfIDFKLH.mjs +0 -275
- package/dist/server-expo-wvcj5tiZ.mjs +0 -2
- package/dist/settings-write-QjYfSrjF.mjs +0 -360
- package/dist/trigger-DzJu208Q.mjs +0 -2
- package/dist/web-BFLueSh-.mjs +0 -2
- package/dist/worktree-Bm4cb-nU.mjs +0 -2
|
@@ -1,18 +1,61 @@
|
|
|
1
|
-
import { D as ownership_claim_exports, d as workspaceProcessLockError, u as withWorkspaceProcessLock } from "./exec-
|
|
2
|
-
import { G as projectDeviceSlots, H as deviceSlotPlatforms, O as withConfigLockAsync$1, _ as loadConfig$1, d as getConfigDir, u as getConcurrencyLimits } from "./config-
|
|
3
|
-
import { a as formatElapsed, l as phaseLine } from "./command-output-
|
|
4
|
-
import { g as deviceReclaimIdleMinutesSetting } from "./settings-
|
|
5
|
-
import { A as listAdbDevices, j as listAdbDevicesAsync } from "./android-
|
|
6
|
-
import {
|
|
1
|
+
import { D as ownership_claim_exports, d as workspaceProcessLockError, u as withWorkspaceProcessLock } from "./exec-aULwtNly.mjs";
|
|
2
|
+
import { G as projectDeviceSlots, H as deviceSlotPlatforms, O as withConfigLockAsync$1, _ as loadConfig$1, d as getConfigDir, u as getConcurrencyLimits } from "./config-Cn94Jc0g.mjs";
|
|
3
|
+
import { a as formatElapsed, l as phaseLine } from "./command-output-C8R1KIvi.mjs";
|
|
4
|
+
import { g as deviceReclaimIdleMinutesSetting } from "./settings-CY5JZlNN.mjs";
|
|
5
|
+
import { A as listAdbDevices, j as listAdbDevicesAsync } from "./android-CsPs-7Mg.mjs";
|
|
6
|
+
import { ot as recordCapacityRefusal, st as recordCapacityWait, v as withIdleWorkspace } from "./workspaces-CmOcceDN.mjs";
|
|
7
7
|
import { t as canonicalPath } from "./paths-BsJMoPP2.mjs";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { i as writeIdleShutdownEvent, n as dueIdleDevices, r as shutDownIdleDevices } from "./idle-shutdown-FfxL1KdG.mjs";
|
|
8
|
+
import { d as listAllIosSims, f as listAllIosSimsAsync, l as iosRuntimeMatches, y as parseRuntimeVersion } from "./ios-B1DYuOjh.mjs";
|
|
9
|
+
import { i as writeIdleShutdownEvent, n as dueIdleDevices, r as shutDownIdleDevices } from "./idle-shutdown-CQ0QwU9J.mjs";
|
|
11
10
|
import { realpathSync } from "node:fs";
|
|
12
11
|
import { basename, join } from "node:path";
|
|
13
12
|
import { workspaceId } from "@stim-cli/core";
|
|
14
13
|
import { DEVICE_RECLAIM_REASON, automaticMachineEnabled } from "@stim-cli/core/state";
|
|
15
14
|
import { setTimeout } from "node:timers/promises";
|
|
15
|
+
//#region src/workspace/display-label.ts
|
|
16
|
+
function baseLabel({ root, label }) {
|
|
17
|
+
return label || basename(root);
|
|
18
|
+
}
|
|
19
|
+
function pathSegments(root) {
|
|
20
|
+
return root.split(/[\\/]+/).filter(Boolean).toReversed();
|
|
21
|
+
}
|
|
22
|
+
function workspaceLabels(workspaces) {
|
|
23
|
+
const labels = /* @__PURE__ */ new Map();
|
|
24
|
+
const groups = /* @__PURE__ */ new Map();
|
|
25
|
+
for (const workspace of workspaces) {
|
|
26
|
+
const base = baseLabel(workspace);
|
|
27
|
+
const group = groups.get(base) ?? [];
|
|
28
|
+
if (!group.some(({ root }) => root === workspace.root)) group.push(workspace);
|
|
29
|
+
groups.set(base, group);
|
|
30
|
+
}
|
|
31
|
+
for (const [base, group] of groups) {
|
|
32
|
+
const [only] = group;
|
|
33
|
+
if (group.length === 1 && only) {
|
|
34
|
+
labels.set(only.root, base);
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
const segments = group.map(({ root }) => pathSegments(root));
|
|
38
|
+
const longest = Math.max(...segments.map((parts) => parts.length));
|
|
39
|
+
let depth = 0;
|
|
40
|
+
while (depth < longest && segments.every((parts) => parts[depth] === segments[0]?.[depth])) depth++;
|
|
41
|
+
const suffixes = segments.map((parts) => parts[depth]);
|
|
42
|
+
const distinct = new Set(suffixes).size === group.length;
|
|
43
|
+
group.forEach(({ root }, index) => {
|
|
44
|
+
const suffix = distinct ? suffixes[index] : root;
|
|
45
|
+
labels.set(root, suffix ? `${base} (${suffix})` : base);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
return labels;
|
|
49
|
+
}
|
|
50
|
+
function workspaceDisplayLabel(root, config) {
|
|
51
|
+
const registered = Object.entries(config?.projects ?? {}).map(([path, project]) => ({
|
|
52
|
+
root: path,
|
|
53
|
+
label: project.label
|
|
54
|
+
}));
|
|
55
|
+
const own = registered.find((entry) => entry.root === root);
|
|
56
|
+
return workspaceLabels([...registered, own ?? { root }]).get(root) ?? basename(root);
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
16
59
|
//#region src/devices/queue-reclaim.ts
|
|
17
60
|
async function reclaimIdleDevice(root, idleMs, out, now, skipped) {
|
|
18
61
|
try {
|
|
@@ -26,7 +69,7 @@ async function reclaimIdleDevice(root, idleMs, out, now, skipped) {
|
|
|
26
69
|
}).toSorted((a, b) => b.idleForMs - a.idleForMs).find(({ device }) => !skipped.has(`${device.kind}:${device.id}`));
|
|
27
70
|
if (!candidate) return 0;
|
|
28
71
|
const { device, idleForMs } = candidate;
|
|
29
|
-
const label =
|
|
72
|
+
const label = workspaceDisplayLabel(device.project, loadConfig$1());
|
|
30
73
|
const log = (event) => {
|
|
31
74
|
writeIdleShutdownEvent(device.project, event);
|
|
32
75
|
if (event.level === "warn") out(`${"device".padEnd(11)} ${event.msg}`);
|
|
@@ -167,6 +210,31 @@ function listed(source, empty, absent = () => false) {
|
|
|
167
210
|
throw new DeviceCountUnavailable("", { cause: error });
|
|
168
211
|
}
|
|
169
212
|
}
|
|
213
|
+
async function listedAwait(read, empty, absent = () => false) {
|
|
214
|
+
try {
|
|
215
|
+
return await read() ?? empty;
|
|
216
|
+
} catch (error) {
|
|
217
|
+
if (absent(error)) return empty;
|
|
218
|
+
throw new DeviceCountUnavailable("", { cause: error });
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
async function readInventoryAsync({ sims = () => process.platform === "darwin" ? listAllIosSimsAsync({ timeoutMs: LISTING_TIMEOUT_MS }) : [], adb = () => listAdbDevicesAsync({ timeoutMs: LISTING_TIMEOUT_MS }), config = loadConfig$1, booting = readBootingDevices }) {
|
|
222
|
+
try {
|
|
223
|
+
const recorded = await listedAwait(() => typeof config === "function" ? config() : config, null);
|
|
224
|
+
return {
|
|
225
|
+
booting: await listedAwait(() => typeof booting === "function" ? booting() : booting, []),
|
|
226
|
+
sims: await listedAwait(() => typeof sims === "function" ? sims() : sims, [], toolAbsent),
|
|
227
|
+
adb: recordsOwnedEmulator(recorded) ? await listedAwait(() => typeof adb === "function" ? adb() : adb, NO_ADB, toolAbsent) : NO_ADB,
|
|
228
|
+
config: recorded
|
|
229
|
+
};
|
|
230
|
+
} catch (error) {
|
|
231
|
+
if (error instanceof DeviceCountUnavailable) {
|
|
232
|
+
if ((0, ownership_claim_exports.isClaimRefusal)(error.cause)) throw error.cause;
|
|
233
|
+
return uncountedRefusal(error.cause);
|
|
234
|
+
}
|
|
235
|
+
throw error;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
170
238
|
function readInventory({ sims = listSimsForCount, adb = listAdbForCount, config = loadConfig$1, booting = readBootingDevices }) {
|
|
171
239
|
try {
|
|
172
240
|
const recorded = listed(config, null);
|
|
@@ -205,6 +273,15 @@ async function listedAsync(source, empty) {
|
|
|
205
273
|
throw new DeviceCountUnavailable("", { cause: error });
|
|
206
274
|
}
|
|
207
275
|
}
|
|
276
|
+
async function countLiveOwnedDevicesFrom(sources, { exclude = [] } = {}) {
|
|
277
|
+
try {
|
|
278
|
+
const inventory = await readInventoryAsync(sources);
|
|
279
|
+
return "code" in inventory ? { unknown: inventory.message } : inventoryKeys(inventory, exclude).size;
|
|
280
|
+
} catch (error) {
|
|
281
|
+
if ((0, ownership_claim_exports.isClaimRefusal)(error)) return { unknown: error.message };
|
|
282
|
+
throw error;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
208
285
|
async function countLiveOwnedDevicesAsync(operation) {
|
|
209
286
|
try {
|
|
210
287
|
operation.signal.throwIfAborted();
|
|
@@ -308,21 +385,93 @@ const DEFAULT_DEVICE_SLOT_WAIT_MS = 6e5;
|
|
|
308
385
|
function deviceSlotWaitingLine({ count, max, holders, elapsedMs, queue }) {
|
|
309
386
|
return `${"device".padEnd(11)} waiting for a device slot (${count}/${max} in use${holders.length ? `: ${holders.join(", ")}` : ""}), ${formatElapsed(elapsedMs)} elapsed -- stim guide lifecycle concurrency${queue ? `; ${queue}` : ""}`;
|
|
310
387
|
}
|
|
311
|
-
function
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
388
|
+
function unrecordedHolder(label) {
|
|
389
|
+
return {
|
|
390
|
+
label,
|
|
391
|
+
workspace: null,
|
|
392
|
+
slot: null
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
function slotHolders(inventory, keys) {
|
|
396
|
+
const owners = /* @__PURE__ */ new Map();
|
|
397
|
+
const projects = Object.entries(inventory.config?.projects ?? {});
|
|
398
|
+
const labels = workspaceLabels(projects.map(([root, project]) => ({
|
|
399
|
+
root,
|
|
400
|
+
label: project.label
|
|
401
|
+
})));
|
|
402
|
+
for (const [root, project] of projects) {
|
|
403
|
+
const label = labels.get(root) ?? basename(root);
|
|
404
|
+
for (const { slot, platforms } of projectDeviceSlots(project)) {
|
|
405
|
+
if (platforms.ios?.deviceUdid) owners.set(deviceKey("ios", platforms.ios.deviceUdid), {
|
|
406
|
+
label,
|
|
407
|
+
workspace: root,
|
|
408
|
+
slot
|
|
409
|
+
});
|
|
410
|
+
if (platforms.android?.avdName) owners.set(deviceKey("android", platforms.android.avdName), {
|
|
411
|
+
label,
|
|
412
|
+
workspace: root,
|
|
413
|
+
slot
|
|
414
|
+
});
|
|
415
|
+
}
|
|
316
416
|
}
|
|
317
417
|
for (const sim of inventory.sims) {
|
|
318
418
|
const key = deviceKey("ios", sim.udid);
|
|
319
|
-
if (!
|
|
419
|
+
if (!owners.has(key)) owners.set(key, unrecordedHolder(sim.name));
|
|
320
420
|
}
|
|
421
|
+
const booting = /* @__PURE__ */ new Set();
|
|
321
422
|
for (const device of inventory.booting) {
|
|
322
423
|
const key = deviceKey(device.platform, device.key);
|
|
323
|
-
|
|
424
|
+
booting.add(key);
|
|
425
|
+
if (!owners.has(key)) owners.set(key, unrecordedHolder(device.displayName ?? device.key));
|
|
426
|
+
}
|
|
427
|
+
return [...keys].map((key) => {
|
|
428
|
+
const { label, workspace, slot } = owners.get(key) ?? unrecordedHolder(key.slice(key.indexOf(":") + 1));
|
|
429
|
+
const platform = key.startsWith("android:") ? "android" : "ios";
|
|
430
|
+
return booting.has(key) ? {
|
|
431
|
+
platform,
|
|
432
|
+
label,
|
|
433
|
+
workspace,
|
|
434
|
+
slot,
|
|
435
|
+
booting: true
|
|
436
|
+
} : {
|
|
437
|
+
platform,
|
|
438
|
+
label,
|
|
439
|
+
workspace,
|
|
440
|
+
slot
|
|
441
|
+
};
|
|
442
|
+
}).toSorted((a, b) => a.label.localeCompare(b.label) || a.platform.localeCompare(b.platform));
|
|
443
|
+
}
|
|
444
|
+
function deviceHolders(inventory, keys) {
|
|
445
|
+
return [...new Set(slotHolders(inventory, keys).map((holder) => holder.label))].toSorted();
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* `concurrency.maxDevices` usage for status: the owned devices the cap counts and who holds each. `sims` is the
|
|
449
|
+
* listing status already read; an unknown count reports why instead of failing.
|
|
450
|
+
*/
|
|
451
|
+
async function deviceSlotUsage(max, sources = {}) {
|
|
452
|
+
try {
|
|
453
|
+
const inventory = await readInventoryAsync(sources);
|
|
454
|
+
if ("code" in inventory) return {
|
|
455
|
+
max,
|
|
456
|
+
inUse: null,
|
|
457
|
+
unknown: inventory.message,
|
|
458
|
+
holders: []
|
|
459
|
+
};
|
|
460
|
+
const keys = inventoryKeys(inventory);
|
|
461
|
+
return {
|
|
462
|
+
max,
|
|
463
|
+
inUse: keys.size,
|
|
464
|
+
holders: slotHolders(inventory, keys)
|
|
465
|
+
};
|
|
466
|
+
} catch (error) {
|
|
467
|
+
if ((0, ownership_claim_exports.isClaimRefusal)(error)) return {
|
|
468
|
+
max,
|
|
469
|
+
inUse: null,
|
|
470
|
+
unknown: error.message,
|
|
471
|
+
holders: []
|
|
472
|
+
};
|
|
473
|
+
throw error;
|
|
324
474
|
}
|
|
325
|
-
return [...new Set([...keys].map((key) => names.get(key) ?? key.slice(key.indexOf(":") + 1)))].toSorted();
|
|
326
475
|
}
|
|
327
476
|
function liveWaiters() {
|
|
328
477
|
const root = join(getConfigDir(), "device-waits");
|
|
@@ -394,7 +543,7 @@ async function admissionTransaction(action, lockWaitMs, out, signal) {
|
|
|
394
543
|
}
|
|
395
544
|
}
|
|
396
545
|
/** Boots an owned device under the Stim home's cap, reserving capacity before releasing admission. */
|
|
397
|
-
async function withDeviceBootAdmission(device, boot, { root, max = getConcurrencyLimits().maxDevices, sources = {}, lockWaitMs = ADMISSION_LOCK_WAIT_MS, out = () => {}, waitMs = DEFAULT_DEVICE_SLOT_WAIT_MS, noWait = false, automatic = false, displayName =
|
|
546
|
+
async function withDeviceBootAdmission(device, boot, { root, max = getConcurrencyLimits().maxDevices, sources = {}, lockWaitMs = ADMISSION_LOCK_WAIT_MS, out = () => {}, waitMs = DEFAULT_DEVICE_SLOT_WAIT_MS, noWait = false, automatic = false, displayName = workspaceDisplayLabel(root, loadConfig$1()), reclaimIdleMinutes = deviceReclaimIdleMinutesSetting({}), now = Date.now, signal, sleep = (ms) => setTimeout(ms, void 0, { signal }), waitingFor = () => {}, onWait = () => {}, onBootStart = () => {} }) {
|
|
398
547
|
const requireMembership = () => {
|
|
399
548
|
if (automatic && !automaticMachineEnabled("device", "local")) throw new DeviceAdmissionRefusal({
|
|
400
549
|
code: "STIM_HOSTING_REFUSED",
|
|
@@ -404,7 +553,10 @@ async function withDeviceBootAdmission(device, boot, { root, max = getConcurrenc
|
|
|
404
553
|
};
|
|
405
554
|
signal?.throwIfAborted();
|
|
406
555
|
requireMembership();
|
|
407
|
-
if (!max || max <= 0)
|
|
556
|
+
if (!max || max <= 0) {
|
|
557
|
+
onBootStart();
|
|
558
|
+
return boot();
|
|
559
|
+
}
|
|
408
560
|
const workspace = workspaceId(root);
|
|
409
561
|
device = {
|
|
410
562
|
...device,
|
|
@@ -466,7 +618,7 @@ async function withDeviceBootAdmission(device, boot, { root, max = getConcurrenc
|
|
|
466
618
|
if ((typeof booting === "function" ? booting() : booting).some((entry) => deviceKey(entry.platform, entry.key) === own)) return admit();
|
|
467
619
|
return wait(lastInventory);
|
|
468
620
|
}
|
|
469
|
-
const inventory =
|
|
621
|
+
const inventory = await readInventoryAsync(sources);
|
|
470
622
|
if ("code" in inventory) throw new DeviceAdmissionRefusal(inventory);
|
|
471
623
|
const keys = inventoryKeys(inventory);
|
|
472
624
|
const own = deviceKey(device.platform, device.key);
|
|
@@ -543,6 +695,7 @@ async function withDeviceBootAdmission(device, boot, { root, max = getConcurrenc
|
|
|
543
695
|
}
|
|
544
696
|
}
|
|
545
697
|
requireMembership();
|
|
698
|
+
onBootStart();
|
|
546
699
|
return await boot();
|
|
547
700
|
} finally {
|
|
548
701
|
(0, ownership_claim_exports.releaseClaim)(marker);
|
|
@@ -612,4 +765,4 @@ function unknownAndroidDeviceProfileRefusal(requested, profiles) {
|
|
|
612
765
|
};
|
|
613
766
|
}
|
|
614
767
|
//#endregion
|
|
615
|
-
export { countLiveOwnedDevicesAsync as a,
|
|
768
|
+
export { countLiveOwnedDevicesAsync as a, deviceTypeMismatch as c, runtimeMismatch as d, unknownAndroidDeviceProfileRefusal as f, withDeviceBootAdmission as g, unknownIosRuntimeRefusal as h, countLiveOwnedDevices as i, layerNote as l, unknownIosDeviceTypeRefusal as m, DeviceAdmissionRefusal as n, countLiveOwnedDevicesFrom as o, unknownAndroidSystemImageRefusal as p, checkDeviceCapacity as r, deviceSlotUsage as s, DEFAULT_DEVICE_SLOT_WAIT_MS as t, peekDeviceSlots as u };
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { b as operationState, t as getExecutor } from "./exec-
|
|
2
|
-
import { G as projectDeviceSlots, V as deviceSlotKey, W as parseDeviceSlotOption, _ as loadConfig$1, p as getProject } from "./config-
|
|
1
|
+
import { b as operationState, t as getExecutor } from "./exec-aULwtNly.mjs";
|
|
2
|
+
import { G as projectDeviceSlots, V as deviceSlotKey, W as parseDeviceSlotOption, _ as loadConfig$1, p as getProject } from "./config-Cn94Jc0g.mjs";
|
|
3
3
|
import { t as createLineReader } from "./process-output-Fpl8PYi8.mjs";
|
|
4
|
-
import { r as clockTime } from "./command-output-
|
|
5
|
-
import {
|
|
6
|
-
import { f as projectRegistry, g as selectNativeXcodeProject, i as findProjectRoot$1, p as NativeXcodeError, t as NO_PROJECT_REFUSAL } from "./project-
|
|
7
|
-
import { A as listAdbDevices, O as getAvdNameForSerialAsync, R as memoizeEmulatorProbe, Y as physicalDeviceModel, Z as probeEmulatorSerial, c as androidPoolNoCandidatesRefusal, rt as resolvePhysicalDevice, s as androidPoolCandidates } from "./android-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { a as discoverXcodeProject } from "./react-native-build-
|
|
12
|
-
import { l as parseDeviceWait, p as waitForDevice } from "./device-lease-run-
|
|
13
|
-
import { m as resolveConfiguration, y as resolveSchemeSelection } from "./support-
|
|
14
|
-
import { n as findSigningIdentities, o as parsePlist, s as parseProvisioningProfilePlist, t as decodeProvisioningProfile } from "./ios-signing-
|
|
15
|
-
import { t as selectFromPool } from "./device-pool-
|
|
16
|
-
import { a as iosPoolCandidates, c as isWirelessIosDevice, f as resolveIosPhysicalDevice, l as listIosDevices, o as iosPoolNoCandidatesRefusal } from "./ios-device-
|
|
17
|
-
import { i as nativeXcodePackages, t as nativeXcodeHasPackages } from "./native-xcode-inputs-
|
|
4
|
+
import { r as clockTime } from "./command-output-C8R1KIvi.mjs";
|
|
5
|
+
import { X as resolveProjectSettings, Y as resolveIosProjectDir, an as makeTemporaryDirectory, it as settingValueAt, on as removeTemporaryEntry } from "./settings-CY5JZlNN.mjs";
|
|
6
|
+
import { f as projectRegistry, g as selectNativeXcodeProject, i as findProjectRoot$1, p as NativeXcodeError, t as NO_PROJECT_REFUSAL } from "./project-Sui52ywT.mjs";
|
|
7
|
+
import { A as listAdbDevices, O as getAvdNameForSerialAsync, R as memoizeEmulatorProbe, Y as physicalDeviceModel, Z as probeEmulatorSerial, c as androidPoolNoCandidatesRefusal, rt as resolvePhysicalDevice, s as androidPoolCandidates } from "./android-CsPs-7Mg.mjs";
|
|
8
|
+
import { En as runProcessOperation } from "./ccache-Bm_A1xX9.mjs";
|
|
9
|
+
import { H as resolveScheme, K as xcodebuildArgs } from "./toolchain-mLA_km-b.mjs";
|
|
10
|
+
import { C as parseLeaseDuration, D as releaseWorkspaceLeases, j as takeLease, y as fileLeaseIo } from "./activity-DRMg4_mD.mjs";
|
|
11
|
+
import { a as discoverXcodeProject } from "./react-native-build-jUHnIfZ9.mjs";
|
|
12
|
+
import { l as parseDeviceWait, p as waitForDevice } from "./device-lease-run-Mtzp4THX.mjs";
|
|
13
|
+
import { m as resolveConfiguration, y as resolveSchemeSelection } from "./support-BtlJKjyQ.mjs";
|
|
14
|
+
import { n as findSigningIdentities, o as parsePlist, s as parseProvisioningProfilePlist, t as decodeProvisioningProfile } from "./ios-signing-BJzvDPfU.mjs";
|
|
15
|
+
import { t as selectFromPool } from "./device-pool-eRz6DtCg.mjs";
|
|
16
|
+
import { a as iosPoolCandidates, c as isWirelessIosDevice, f as resolveIosPhysicalDevice, l as listIosDevices, o as iosPoolNoCandidatesRefusal } from "./ios-device-B4elVFKi.mjs";
|
|
17
|
+
import { i as nativeXcodePackages, t as nativeXcodeHasPackages } from "./native-xcode-inputs-BKarCoKg.mjs";
|
|
18
18
|
import { existsSync, readdirSync, realpathSync, statSync } from "node:fs";
|
|
19
19
|
import { homedir } from "node:os";
|
|
20
20
|
import { join } from "node:path";
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { t as getExecutor } from "./exec-
|
|
2
|
-
import { _ as ensureWorkspaceStorage, d as writeWorkspaceState } from "./workspace-state-
|
|
3
|
-
import { O as withConfigLockAsync$1, _ as loadConfig$1, c as ensureConfig } from "./config-
|
|
4
|
-
import { i as macosProcess, o as requiredMacosRecord } from "./state-
|
|
5
|
-
import { A as listAdbDevices, Ct as forgetCreatedDeviceAsync, D as getAvdNameForSerial, F as listAvdsAsync, I as listInstalledSystemImages, K as ownedAvdSystemImage, M as listAvdDeviceProfiles, O as getAvdNameForSerialAsync, U as ownedAvdName, X as pickDefaultSystemImage, a as androidDeviceAbi, ct as waitForBoot, d as androidToolPath, f as assertOwnedAvdStopped, g as avdPathExists, k as hostSystemImageArch, nt as resolveOwnedAvdSerialAsync, t as DEFAULT_AVD_DEVICE_PROFILE, tt as resetAdoptedAvd, v as avdStorageRoots, x as createOwnedAvd, y as bootAndroidEmulator } from "./android-
|
|
6
|
-
import { a as parsePidof, i as parseLogcatLine, t as androidClockOffset } from "./android-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
1
|
+
import { t as getExecutor } from "./exec-aULwtNly.mjs";
|
|
2
|
+
import { _ as ensureWorkspaceStorage, d as writeWorkspaceState } from "./workspace-state-kIZrdlSg.mjs";
|
|
3
|
+
import { O as withConfigLockAsync$1, _ as loadConfig$1, c as ensureConfig } from "./config-Cn94Jc0g.mjs";
|
|
4
|
+
import { i as macosProcess, o as requiredMacosRecord } from "./state-BXC1Lfxw.mjs";
|
|
5
|
+
import { A as listAdbDevices, Ct as forgetCreatedDeviceAsync, D as getAvdNameForSerial, F as listAvdsAsync, I as listInstalledSystemImages, K as ownedAvdSystemImage, M as listAvdDeviceProfiles, O as getAvdNameForSerialAsync, U as ownedAvdName, X as pickDefaultSystemImage, a as androidDeviceAbi, ct as waitForBoot, d as androidToolPath, f as assertOwnedAvdStopped, g as avdPathExists, k as hostSystemImageArch, nt as resolveOwnedAvdSerialAsync, t as DEFAULT_AVD_DEVICE_PROFILE, tt as resetAdoptedAvd, v as avdStorageRoots, x as createOwnedAvd, y as bootAndroidEmulator } from "./android-CsPs-7Mg.mjs";
|
|
6
|
+
import { a as parsePidof, i as parseLogcatLine, t as androidClockOffset } from "./android-D577ApKG.mjs";
|
|
7
|
+
import { i as createNdjsonWriter } from "./ndjson-Dy2W4vRa.mjs";
|
|
8
|
+
import { _n as reverseMetroPorts, dn as installIosApp, fn as iosAppProcess, hn as launchIosApp, ln as installAndroidApp, mn as launchAndroidReleaseApp, pn as launchAndroidApp, tn as androidAppProcess, vn as writeDebugHttpHost } from "./ccache-Bm_A1xX9.mjs";
|
|
9
|
+
import { ht as teardownOwnedIosSim, pt as teardownOwnedAvd } from "./workspaces-CmOcceDN.mjs";
|
|
10
|
+
import { E as resolveIosCreation, R as readHostMemoryPressure, T as resetIosPrivacy, a as createOwnedIosSim, d as listAllIosSims, g as listUserApps, j as uninstallIosApp, n as bootIosSim, w as resetIosKeychain } from "./ios-B1DYuOjh.mjs";
|
|
11
|
+
import { i as stopMacosAppHeld, n as stopHostedBundleInstances } from "./stop-DQvE-P76.mjs";
|
|
12
12
|
import { t as spawnEntry } from "./spawn-entry-jw19m8Nl.mjs";
|
|
13
|
-
import { i as countLiveOwnedDevices } from "./device-capacity-
|
|
14
|
-
import { _ as findAapt } from "./support-
|
|
15
|
-
import { t as waitForMacosRegistration } from "./registration-
|
|
16
|
-
import { n as parseLogStreamLine } from "./ios-
|
|
13
|
+
import { i as countLiveOwnedDevices } from "./device-capacity-Cd8lMSn3.mjs";
|
|
14
|
+
import { _ as findAapt } from "./support-04IhBUTT.mjs";
|
|
15
|
+
import { t as waitForMacosRegistration } from "./registration-BwCe64PH.mjs";
|
|
16
|
+
import { n as parseLogStreamLine } from "./ios-CsRVik64.mjs";
|
|
17
17
|
import { createHash, randomUUID } from "node:crypto";
|
|
18
18
|
import { chmodSync, closeSync, copyFileSync, createReadStream, existsSync, lstatSync, mkdirSync, openSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, statfsSync, symlinkSync, writeFileSync } from "node:fs";
|
|
19
19
|
import { availableParallelism, freemem, homedir, loadavg } from "node:os";
|
|
@@ -232,7 +232,7 @@ function collectHostedNativeLogs({ home, platform, since, final, query, parse, t
|
|
|
232
232
|
//#endregion
|
|
233
233
|
//#region src/device-host/android-logs.ts
|
|
234
234
|
/** Captures bounded logcat output from the installed app on this home's exact ledger-owned serial. */
|
|
235
|
-
function collectHostedAndroidLogs(home, session, attempt, since, final = false) {
|
|
235
|
+
async function collectHostedAndroidLogs(home, session, attempt, since, final = false) {
|
|
236
236
|
const deadline = Date.now() + 1e4;
|
|
237
237
|
const device = readHostedDevice(home, "android");
|
|
238
238
|
assertHostedAndroidSerial(home, device);
|
|
@@ -240,9 +240,9 @@ function collectHostedAndroidLogs(home, session, attempt, since, final = false)
|
|
|
240
240
|
if (app.state !== "installed") return false;
|
|
241
241
|
const exec = getExecutor();
|
|
242
242
|
const adb = androidToolPath("adb");
|
|
243
|
-
const clockOffsetMs = androidClockOffset(device.serial, { exec: {
|
|
243
|
+
const clockOffsetMs = await androidClockOffset(device.serial, { exec: {
|
|
244
244
|
...exec,
|
|
245
|
-
|
|
245
|
+
runFileAsync: (file, args, options) => exec.runFileAsync(file === "adb" ? adb : file, args, options)
|
|
246
246
|
} }) ?? 0;
|
|
247
247
|
const previous = readHostedNativeLogsCheckpoint(home, "android");
|
|
248
248
|
let current = null;
|
|
@@ -953,11 +953,12 @@ async function runHostedMacosApp(mode, request, app) {
|
|
|
953
953
|
if (device.appSlot !== request.appSlot) throw new Error("The hosted macOS app slot changed.");
|
|
954
954
|
assertHostedDeviceLedger(home, `macos-${device.appSlot}`, "macos");
|
|
955
955
|
const runRoot = join(realpathSync(home), "macos-app");
|
|
956
|
+
const area = realpathSync(join(home, ".."));
|
|
956
957
|
if (mode === "stop") {
|
|
957
958
|
if (requiredMacosRecord(runRoot)) await stopMacosAppHeld(runRoot);
|
|
959
|
+
await stopHostedBundleInstances(area);
|
|
958
960
|
const bundleId = preferenceIdentity(home, device.appSlot);
|
|
959
961
|
if (bundleId) removePreferences(bundleId);
|
|
960
|
-
const area = realpathSync(join(home, ".."));
|
|
961
962
|
assertInside(area, home);
|
|
962
963
|
removeAppData(realpathSync(home), join(home, "app-home"));
|
|
963
964
|
const apps = join(home, "..", "apps");
|
|
@@ -1035,6 +1036,7 @@ async function runHostedMacosApp(mode, request, app) {
|
|
|
1035
1036
|
bundle
|
|
1036
1037
|
], options);
|
|
1037
1038
|
if (requiredMacosRecord(runRoot)) await stopMacosAppHeld(runRoot);
|
|
1039
|
+
await stopHostedBundleInstances(area);
|
|
1038
1040
|
const previousId = preferenceIdentity(home, device.appSlot);
|
|
1039
1041
|
if (previousId && previousId !== bundleId) removePreferences(previousId);
|
|
1040
1042
|
mkdirSync(runRoot, {
|
|
@@ -1226,7 +1228,7 @@ async function main() {
|
|
|
1226
1228
|
if (input.platform === "macos" && !hostedMacosAppSlot(input.appSlot)) throw new Error("Invalid hosted macOS app slot.");
|
|
1227
1229
|
if (input.mode === "logs") {
|
|
1228
1230
|
if (input.platform !== "ios" && input.platform !== "android" || !process.env.STIM_HOME || typeof input.since !== "number" || !Number.isFinite(input.since)) throw new Error("Invalid hosted native log request.");
|
|
1229
|
-
const more = (input.platform === "android" ? collectHostedAndroidLogs : collectHostedIosLogs)(process.env.STIM_HOME, input.session, input.attempt, input.since, input.final === true);
|
|
1231
|
+
const more = await (input.platform === "android" ? collectHostedAndroidLogs : collectHostedIosLogs)(process.env.STIM_HOME, input.session, input.attempt, input.since, input.final === true);
|
|
1230
1232
|
process.stdout.write(`${JSON.stringify({ more })}\n`);
|
|
1231
1233
|
return;
|
|
1232
1234
|
}
|