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
package/dist/supervisor-run.mjs
CHANGED
|
@@ -1,25 +1,184 @@
|
|
|
1
|
-
import { S as process_identity_exports, u as withWorkspaceProcessLock } from "./exec-
|
|
2
|
-
import { c as withWorkspaceStateLock, d as writeWorkspaceState, j as workspaceStateFile$1, k as workspaceLogsDir$1, n as clearWorkspaceStateKeys, o as updateWorkspaceState, r as readWorkspaceState$1 } from "./workspace-state-
|
|
3
|
-
import { G as projectDeviceSlots, T as setSupervisor, U as parseDeviceSlotKey, o as clearSupervisor, p as getProject } from "./config-
|
|
4
|
-
import {
|
|
5
|
-
import { D as clearExpoMetroTunnel, E as MODE_EXPO, N as readPidFile, R as writePidFile, T as MODE_COMMAND, d as nativeProjectIntegration, j as clearWorkspaceSupervisor, v as detectIsExpo, w as MODE_BARE } from "./project-
|
|
6
|
-
import { W as ownedAvdSerialResolver } from "./android-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { S as parseLease, _ as workspaceDeviceLastUseAt, b as leaseIsExpired, r as createActivityReader, v as deviceLeasePath, w as parseWorkspaceLeases } from "./activity-
|
|
1
|
+
import { S as process_identity_exports, u as withWorkspaceProcessLock } from "./exec-aULwtNly.mjs";
|
|
2
|
+
import { c as withWorkspaceStateLock, d as writeWorkspaceState, j as workspaceStateFile$1, k as workspaceLogsDir$1, n as clearWorkspaceStateKeys, o as updateWorkspaceState, r as readWorkspaceState$1 } from "./workspace-state-kIZrdlSg.mjs";
|
|
3
|
+
import { G as projectDeviceSlots, T as setSupervisor, U as parseDeviceSlotKey, o as clearSupervisor, p as getProject } from "./config-Cn94Jc0g.mjs";
|
|
4
|
+
import { $ as runnableMetroCommand, X as resolveProjectSettings } from "./settings-CY5JZlNN.mjs";
|
|
5
|
+
import { D as clearExpoMetroTunnel, E as MODE_EXPO, N as readPidFile, R as writePidFile, T as MODE_COMMAND, d as nativeProjectIntegration, j as clearWorkspaceSupervisor, v as detectIsExpo, w as MODE_BARE } from "./project-Sui52ywT.mjs";
|
|
6
|
+
import { W as ownedAvdSerialResolver } from "./android-CsPs-7Mg.mjs";
|
|
7
|
+
import { i as createNdjsonWriter } from "./ndjson-Dy2W4vRa.mjs";
|
|
8
|
+
import { C as devServerStopLevel, O as vanishedSupervisorMessage, w as devServerStopRecord, x as describeDevServerStop } from "./ccache-Bm_A1xX9.mjs";
|
|
9
|
+
import { d as parseWatchRoots, l as parseSubscriberNames, m as runWatchman, u as parseTriggerCount } from "./eas-session-ledger-CBFo_Uo1.mjs";
|
|
10
|
+
import { B as workspaceBuildInProgress, v as withIdleWorkspace } from "./workspaces-CmOcceDN.mjs";
|
|
11
|
+
import { S as parseLease, _ as workspaceDeviceLastUseAt, b as leaseIsExpired, r as createActivityReader, v as deviceLeasePath, w as parseWorkspaceLeases } from "./activity-DRMg4_mD.mjs";
|
|
12
12
|
import { t as describeError } from "./errors-DHm_U5gv.mjs";
|
|
13
|
-
import {
|
|
14
|
-
import { o as watchWorkspaceState, t as clearHostedMetro } from "./metro-
|
|
15
|
-
import { t as relaunchWithLogFile } from "./detached-entry-
|
|
16
|
-
import { n as dueIdleDevices, r as shutDownIdleDevices } from "./idle-shutdown-
|
|
17
|
-
import { t as triggerMaintenance } from "./trigger-
|
|
13
|
+
import { d as hostConnector, p as probeHostedSession } from "./hosted-client-DDRm9hPJ.mjs";
|
|
14
|
+
import { o as watchWorkspaceState, t as clearHostedMetro } from "./metro-request-DXyKjVDF.mjs";
|
|
15
|
+
import { t as relaunchWithLogFile } from "./detached-entry-BPlSaCwC.mjs";
|
|
16
|
+
import { n as dueIdleDevices, r as shutDownIdleDevices } from "./idle-shutdown-CQ0QwU9J.mjs";
|
|
17
|
+
import { t as triggerMaintenance } from "./trigger-DMou-X7j.mjs";
|
|
18
18
|
import { existsSync, readFileSync, realpathSync, statSync } from "node:fs";
|
|
19
19
|
import { dirname, isAbsolute, join, resolve, sep } from "node:path";
|
|
20
|
-
import { LOG_ROTATE_BYTES
|
|
21
|
-
import { DEV_SERVER_STOP_REQUEST_KEY,
|
|
20
|
+
import { LOG_ROTATE_BYTES } from "@stim-cli/core";
|
|
21
|
+
import { DEV_SERVER_STOP_REQUEST_KEY, HOSTED_METRO_LINKS_KEY, HOSTED_METRO_REQUESTS_KEY, IDLE_STOP_KEY, hostedAndroidPlacements, hostedIosPlacements, hostedMetroLinks, hostedMetroRequests, hostedNativeRecords, parseHostedNativePlacement, readDevServerStopRequest } from "@stim-cli/core/state";
|
|
22
22
|
import { fileURLToPath } from "node:url";
|
|
23
|
+
import { connect } from "node:net";
|
|
24
|
+
//#region src/supervisor/metro-links.ts
|
|
25
|
+
const IDLE_LINKS = 4;
|
|
26
|
+
const FRAME_BYTES = 32768;
|
|
27
|
+
const RETRY_MS = [
|
|
28
|
+
500,
|
|
29
|
+
1e3,
|
|
30
|
+
2e3,
|
|
31
|
+
5e3,
|
|
32
|
+
1e4
|
|
33
|
+
];
|
|
34
|
+
const METRO_RESET = 4410;
|
|
35
|
+
/**
|
|
36
|
+
* Keeps `IDLE_LINKS` authenticated connections open to `machine`, each offered to `session`'s Metro bridge there. The
|
|
37
|
+
* host pairs one with each connection the hosted device makes; this side then pipes it to loopback `metroPort` and
|
|
38
|
+
* opens a replacement. `onReady` runs when the host holds a link after holding none, and `onLost` when no linked
|
|
39
|
+
* connection to the host is left. Failures that a retry can fix are retried. A host that turns this machine away calls
|
|
40
|
+
* `onError` and stops the pool, and so does a refused link before the host ever held one; after that, refused links
|
|
41
|
+
* are retried, since a session the host restarted refuses links until its client attaches again.
|
|
42
|
+
*/
|
|
43
|
+
function openMetroLinks({ machine, session, metroPort, onReady, onLost, onError }) {
|
|
44
|
+
const connect$1 = hostConnector(machine);
|
|
45
|
+
const live = /* @__PURE__ */ new Set();
|
|
46
|
+
const linked = /* @__PURE__ */ new Set();
|
|
47
|
+
const waiting = /* @__PURE__ */ new Set();
|
|
48
|
+
const streams = /* @__PURE__ */ new Set();
|
|
49
|
+
let opening = 0;
|
|
50
|
+
let failures = 0;
|
|
51
|
+
let ready = false;
|
|
52
|
+
let linkedOnce = false;
|
|
53
|
+
let closed = false;
|
|
54
|
+
let retry;
|
|
55
|
+
const fill = () => {
|
|
56
|
+
if (closed || retry) return;
|
|
57
|
+
while (opening + waiting.size < IDLE_LINKS) {
|
|
58
|
+
opening++;
|
|
59
|
+
link();
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
const gone = (connection) => {
|
|
63
|
+
live.delete(connection);
|
|
64
|
+
waiting.delete(connection);
|
|
65
|
+
if (!linked.delete(connection) || closed || !ready || linked.size > 0) return;
|
|
66
|
+
ready = false;
|
|
67
|
+
onLost();
|
|
68
|
+
};
|
|
69
|
+
const failed = (message, refused) => {
|
|
70
|
+
if (closed) return;
|
|
71
|
+
if (refused === "host" || refused === "link" && !linkedOnce) {
|
|
72
|
+
stop();
|
|
73
|
+
onError(message);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (retry) return;
|
|
77
|
+
retry = setTimeout(() => {
|
|
78
|
+
retry = void 0;
|
|
79
|
+
fill();
|
|
80
|
+
}, RETRY_MS[Math.min(failures++, RETRY_MS.length - 1)]);
|
|
81
|
+
retry.unref();
|
|
82
|
+
};
|
|
83
|
+
const carry = (connection, ended) => {
|
|
84
|
+
const metro = connect({
|
|
85
|
+
host: "127.0.0.1",
|
|
86
|
+
port: metroPort
|
|
87
|
+
});
|
|
88
|
+
streams.add(metro);
|
|
89
|
+
metro.on("error", () => metro.destroy());
|
|
90
|
+
metro.once("close", (hadError) => {
|
|
91
|
+
streams.delete(metro);
|
|
92
|
+
ended();
|
|
93
|
+
connection.flushed().then(() => connection.close(hadError ? METRO_RESET : 1e3));
|
|
94
|
+
});
|
|
95
|
+
connection.onDropped((code) => code === 1e3 ? metro.end() : metro.resetAndDestroy());
|
|
96
|
+
let paused = false;
|
|
97
|
+
connection.onBinary((frame) => {
|
|
98
|
+
if (metro.write(frame) || paused) return;
|
|
99
|
+
paused = true;
|
|
100
|
+
connection.pause();
|
|
101
|
+
metro.once("drain", () => {
|
|
102
|
+
paused = false;
|
|
103
|
+
connection.resume();
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
metro.on("data", (chunk) => {
|
|
107
|
+
metro.pause();
|
|
108
|
+
(async () => {
|
|
109
|
+
for (let offset = 0; offset < chunk.length; offset += FRAME_BYTES) await connection.sendBinary(chunk.subarray(offset, offset + FRAME_BYTES));
|
|
110
|
+
if (!metro.destroyed) metro.resume();
|
|
111
|
+
})();
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
const link = async () => {
|
|
115
|
+
let connection;
|
|
116
|
+
try {
|
|
117
|
+
connection = await connect$1();
|
|
118
|
+
if (closed) return void connection.close();
|
|
119
|
+
live.add(connection);
|
|
120
|
+
if (!connection.supports("hosted-metro-link")) throw Object.assign(/* @__PURE__ */ new Error(`${machine} runs a stim-server that cannot link Metro. Update stim-server there, then retry.`), { code: "STIM_HOSTING_REFUSED" });
|
|
121
|
+
const each = connection;
|
|
122
|
+
let paired = false;
|
|
123
|
+
let ended = false;
|
|
124
|
+
each.onEvent((event) => {
|
|
125
|
+
if (event.event !== "device-host.metro.link.open" || paired || closed) return;
|
|
126
|
+
paired = true;
|
|
127
|
+
each.unwatch();
|
|
128
|
+
waiting.delete(each);
|
|
129
|
+
carry(each, () => {
|
|
130
|
+
ended = true;
|
|
131
|
+
gone(each);
|
|
132
|
+
});
|
|
133
|
+
fill();
|
|
134
|
+
});
|
|
135
|
+
let registered = false;
|
|
136
|
+
each.onDropped(() => {
|
|
137
|
+
if (paired || !registered) return;
|
|
138
|
+
gone(each);
|
|
139
|
+
fill();
|
|
140
|
+
});
|
|
141
|
+
const reply = await each.request("device-host.metro.link", { session });
|
|
142
|
+
if ("error" in reply) throw Object.assign(/* @__PURE__ */ new Error(`${machine} refused the Metro link: ${reply.error.message}`), { linkRefused: reply.error.code !== "closed" && reply.error.code !== "timeout" });
|
|
143
|
+
if (closed) return void each.close();
|
|
144
|
+
if (ended || each.failure) return void live.delete(each);
|
|
145
|
+
registered = true;
|
|
146
|
+
linked.add(each);
|
|
147
|
+
if (!paired) {
|
|
148
|
+
waiting.add(each);
|
|
149
|
+
each.watch();
|
|
150
|
+
}
|
|
151
|
+
failures = 0;
|
|
152
|
+
clearTimeout(retry);
|
|
153
|
+
retry = void 0;
|
|
154
|
+
if (!ready) {
|
|
155
|
+
ready = true;
|
|
156
|
+
linkedOnce = true;
|
|
157
|
+
onReady();
|
|
158
|
+
}
|
|
159
|
+
} catch (error) {
|
|
160
|
+
if (connection) live.delete(connection);
|
|
161
|
+
connection?.close();
|
|
162
|
+
const refused = typeof error !== "object" || error === null ? null : "code" in error && typeof error.code === "string" && error.code.startsWith("STIM_") ? "host" : "linkRefused" in error && error.linkRefused === true ? "link" : null;
|
|
163
|
+
failed(error instanceof Error ? error.message : String(error), refused);
|
|
164
|
+
} finally {
|
|
165
|
+
opening--;
|
|
166
|
+
fill();
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
function stop() {
|
|
170
|
+
closed = true;
|
|
171
|
+
clearTimeout(retry);
|
|
172
|
+
for (const connection of live) connection.close();
|
|
173
|
+
for (const stream of streams) stream.destroy();
|
|
174
|
+
live.clear();
|
|
175
|
+
linked.clear();
|
|
176
|
+
waiting.clear();
|
|
177
|
+
}
|
|
178
|
+
fill();
|
|
179
|
+
return { close: stop };
|
|
180
|
+
}
|
|
181
|
+
//#endregion
|
|
23
182
|
//#region src/supervisor/hosted-metro.ts
|
|
24
183
|
function reconcileHostedMetro(requests, active) {
|
|
25
184
|
const same = (session) => JSON.stringify(requests[session]) === JSON.stringify(active[session]);
|
|
@@ -30,7 +189,7 @@ function reconcileHostedMetro(requests, active) {
|
|
|
30
189
|
}
|
|
31
190
|
function watchHostedMetro(root, metroPort, processToken) {
|
|
32
191
|
const active = {};
|
|
33
|
-
const
|
|
192
|
+
const pools = /* @__PURE__ */ new Map();
|
|
34
193
|
let closed = false;
|
|
35
194
|
let running = Promise.resolve();
|
|
36
195
|
let probingAt = 0;
|
|
@@ -43,7 +202,7 @@ function watchHostedMetro(root, metroPort, processToken) {
|
|
|
43
202
|
...state,
|
|
44
203
|
supervisor: {
|
|
45
204
|
...state.supervisor,
|
|
46
|
-
|
|
205
|
+
hostedMetroLinks: true
|
|
47
206
|
}
|
|
48
207
|
} : state);
|
|
49
208
|
const readState = () => {
|
|
@@ -55,16 +214,36 @@ function watchHostedMetro(root, metroPort, processToken) {
|
|
|
55
214
|
}
|
|
56
215
|
return cached;
|
|
57
216
|
};
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
217
|
+
const unpublished = /* @__PURE__ */ new Map();
|
|
218
|
+
let republish;
|
|
219
|
+
const flush = () => {
|
|
220
|
+
clearTimeout(republish);
|
|
221
|
+
for (const [session, links] of unpublished) {
|
|
222
|
+
try {
|
|
223
|
+
updateWorkspaceState(root, (state) => {
|
|
224
|
+
const published = { ...hostedMetroLinks(state) };
|
|
225
|
+
if (state.supervisor?.processToken !== processToken) return state;
|
|
226
|
+
if (links) published[session] = links;
|
|
227
|
+
else delete published[session];
|
|
228
|
+
return {
|
|
229
|
+
...state,
|
|
230
|
+
[HOSTED_METRO_LINKS_KEY]: published
|
|
231
|
+
};
|
|
232
|
+
});
|
|
233
|
+
} catch {
|
|
234
|
+
if (closed) return;
|
|
235
|
+
republish = setTimeout(flush, 1e3);
|
|
236
|
+
republish.unref();
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
unpublished.delete(session);
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
const publish = (session, links) => {
|
|
243
|
+
unpublished.delete(session);
|
|
244
|
+
unpublished.set(session, links);
|
|
245
|
+
flush();
|
|
246
|
+
};
|
|
68
247
|
const reconcile = async () => {
|
|
69
248
|
if (closed) return;
|
|
70
249
|
observer.refresh();
|
|
@@ -83,45 +262,39 @@ function watchHostedMetro(root, metroPort, processToken) {
|
|
|
83
262
|
});
|
|
84
263
|
const actions = reconcileHostedMetro(requests, active);
|
|
85
264
|
for (const session of actions.close) {
|
|
86
|
-
|
|
87
|
-
|
|
265
|
+
pools.get(session)?.close();
|
|
266
|
+
pools.delete(session);
|
|
88
267
|
delete active[session];
|
|
89
268
|
publish(session, null);
|
|
90
269
|
}
|
|
91
270
|
for (const session of actions.open) {
|
|
92
271
|
const request = requests[session];
|
|
93
272
|
active[session] = request;
|
|
94
|
-
|
|
273
|
+
pools.set(session, openMetroLinks({
|
|
274
|
+
machine: request.machine,
|
|
275
|
+
session,
|
|
95
276
|
metroPort,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
const saved = hostedMetroGateways(state)[session];
|
|
102
|
-
await new Promise((resolve, reject) => {
|
|
103
|
-
bridge.server.once("error", reject);
|
|
104
|
-
bridge.server.listen(saved?.id === request.id ? saved.port ?? 0 : 0, request.address, () => {
|
|
105
|
-
bridge.server.removeListener("error", reject);
|
|
106
|
-
resolve();
|
|
277
|
+
onReady: () => {
|
|
278
|
+
if (active[session] === request) publish(session, {
|
|
279
|
+
id: request.id,
|
|
280
|
+
processToken,
|
|
281
|
+
ready: true
|
|
107
282
|
});
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
});
|
|
124
|
-
}
|
|
283
|
+
},
|
|
284
|
+
onLost: () => {
|
|
285
|
+
if (active[session] === request) publish(session, {
|
|
286
|
+
id: request.id,
|
|
287
|
+
processToken
|
|
288
|
+
});
|
|
289
|
+
},
|
|
290
|
+
onError: (message) => {
|
|
291
|
+
if (active[session] === request) publish(session, {
|
|
292
|
+
id: request.id,
|
|
293
|
+
processToken,
|
|
294
|
+
error: message
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
}));
|
|
125
298
|
}
|
|
126
299
|
if (!probing && Date.now() >= probingAt) {
|
|
127
300
|
clearTimeout(probeTimer);
|
|
@@ -154,9 +327,10 @@ function watchHostedMetro(root, metroPort, processToken) {
|
|
|
154
327
|
closed = true;
|
|
155
328
|
observer.close();
|
|
156
329
|
clearTimeout(probeTimer);
|
|
330
|
+
clearTimeout(republish);
|
|
157
331
|
clearInterval(timer);
|
|
158
332
|
await running;
|
|
159
|
-
|
|
333
|
+
for (const pool of pools.values()) pool.close();
|
|
160
334
|
};
|
|
161
335
|
}
|
|
162
336
|
//#endregion
|
|
@@ -628,7 +802,7 @@ async function runSupervisor({ root, port, tunnel = false, resetCache = false, i
|
|
|
628
802
|
try {
|
|
629
803
|
let start;
|
|
630
804
|
if (command) {
|
|
631
|
-
const startServer = startCommand ?? (await import("./server-command-
|
|
805
|
+
const startServer = startCommand ?? (await import("./server-command-qneHPcRI.mjs")).startCommandServer;
|
|
632
806
|
start = (opts) => startServer({
|
|
633
807
|
...opts,
|
|
634
808
|
command
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as getExecutor } from "./exec-
|
|
2
|
-
import { a as killOnAbort } from "./operation-exec-
|
|
3
|
-
import { C as emulatorDiskSpaceRemedy, E as findBuildTool, Q as profileNeedsFoldFeature, R as memoizeEmulatorProbe, T as extractEmulatorFailure, X as pickDefaultSystemImage, c as androidPoolNoCandidatesRefusal, k as hostSystemImageArch, l as androidSystemImageAbi, o as androidHome, s as androidPoolCandidates, w as emulatorFailureRemedy } from "./android-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { t as devClientScheme } from "./dev-client-
|
|
1
|
+
import { t as getExecutor } from "./exec-aULwtNly.mjs";
|
|
2
|
+
import { a as killOnAbort } from "./operation-exec-Dp4FuIGR.mjs";
|
|
3
|
+
import { C as emulatorDiskSpaceRemedy, E as findBuildTool, Q as profileNeedsFoldFeature, R as memoizeEmulatorProbe, T as extractEmulatorFailure, X as pickDefaultSystemImage, c as androidPoolNoCandidatesRefusal, k as hostSystemImageArch, l as androidSystemImageAbi, o as androidHome, s as androidPoolCandidates, w as emulatorFailureRemedy } from "./android-CsPs-7Mg.mjs";
|
|
4
|
+
import { yn as pickDevClientScheme } from "./ccache-Bm_A1xX9.mjs";
|
|
5
|
+
import { f as unknownAndroidDeviceProfileRefusal, l as layerNote, p as unknownAndroidSystemImageRefusal } from "./device-capacity-Cd8lMSn3.mjs";
|
|
6
|
+
import { t as devClientScheme } from "./dev-client-D-BW5uiq.mjs";
|
|
7
7
|
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
8
8
|
import { relative } from "node:path";
|
|
9
9
|
//#region src/commands/android/support.ts
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { k as workspaceLogsDir } from "./workspace-state-
|
|
2
|
-
import { h as shortUdid, l as phaseLine } from "./command-output-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { k as workspaceLogsDir } from "./workspace-state-kIZrdlSg.mjs";
|
|
2
|
+
import { h as shortUdid, l as phaseLine } from "./command-output-C8R1KIvi.mjs";
|
|
3
|
+
import { _ as inertSettingWarning, a as SETTING_SHAPE_REMEDY, b as iosProjectDirSetting, p as cacheProviderSettingError, rt as settingShapeErrors, st as unknownSettingKeys, x as iosProjectDirSettingError } from "./settings-CY5JZlNN.mjs";
|
|
4
|
+
import { q as describeDiagnostic } from "./toolchain-mLA_km-b.mjs";
|
|
5
|
+
import { P as parseIosSimulatorApp } from "./ios-B1DYuOjh.mjs";
|
|
5
6
|
import { p as resolveOptimizations } from "./errors-DHm_U5gv.mjs";
|
|
6
|
-
import {
|
|
7
|
-
import { l as
|
|
8
|
-
import { l as
|
|
9
|
-
import {
|
|
10
|
-
import { t as IosDeviceMismatchError } from "./device-ios-BLGfXQeK.mjs";
|
|
7
|
+
import { d as resolveBuildPlacement } from "./selection-CXgM_VK_.mjs";
|
|
8
|
+
import { l as parseDeviceWait } from "./device-lease-run-Mtzp4THX.mjs";
|
|
9
|
+
import { h as unknownIosRuntimeRefusal, l as layerNote, m as unknownIosDeviceTypeRefusal, t as DEFAULT_DEVICE_SLOT_WAIT_MS } from "./device-capacity-Cd8lMSn3.mjs";
|
|
10
|
+
import { t as IosDeviceMismatchError } from "./device-ios-Cc9ulihb.mjs";
|
|
11
11
|
import { basename, join } from "node:path";
|
|
12
12
|
import chalk from "chalk";
|
|
13
13
|
function buildLogFile(root) {
|
|
@@ -50,7 +50,7 @@ function resolveIosBuildSetup(remoteBuild, settings, warn, env) {
|
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
-
for (const key of unknownSettingKeys(settings)) warn("setting",
|
|
53
|
+
for (const key of unknownSettingKeys(settings)) warn("setting", inertSettingWarning(settings, key));
|
|
54
54
|
const cacheProviderError = cacheProviderSettingError(settings);
|
|
55
55
|
if (cacheProviderError) warn("cache", `${cacheProviderError} Using the local cache.`);
|
|
56
56
|
return {
|
|
@@ -265,7 +265,8 @@ function createIosDeviceWaitRun(stats, progress, signal) {
|
|
|
265
265
|
waiting = info !== null;
|
|
266
266
|
progress.waitingFor(info, "device-slot");
|
|
267
267
|
},
|
|
268
|
-
onWait: stats.addDeviceSlotWaitMs
|
|
268
|
+
onWait: stats.addDeviceSlotWaitMs,
|
|
269
|
+
onBootStart: () => progress.bootStarted()
|
|
269
270
|
},
|
|
270
271
|
record(next) {
|
|
271
272
|
if (waiting) outcome = next;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as getExecutor } from "./exec-
|
|
2
|
-
import { s as gitAsync } from "./operation-exec-
|
|
3
|
-
import { n as buildCacheKey } from "./build-cache-
|
|
1
|
+
import { t as getExecutor } from "./exec-aULwtNly.mjs";
|
|
2
|
+
import { s as gitAsync } from "./operation-exec-Dp4FuIGR.mjs";
|
|
3
|
+
import { n as buildCacheKey } from "./build-cache-CZULpXVl.mjs";
|
|
4
4
|
import { n as fingerprintNativeInputs, r as manifestDigest } from "./native-inputs-TRTTTRxt.mjs";
|
|
5
|
-
import { a as sourceManifest, r as nativeFileDigest } from "./native-source-
|
|
5
|
+
import { a as sourceManifest, r as nativeFileDigest } from "./native-source-D1AzWiuP.mjs";
|
|
6
6
|
import { createHash } from "node:crypto";
|
|
7
7
|
import { join, relative, resolve, sep } from "node:path";
|
|
8
8
|
import { isJsonObject } from "@stim-cli/core/state";
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { T as trackReportResource, _ as spawnDeclared, t as getExecutor } from "./exec-
|
|
2
|
-
import { y as sharedBuildCache } from "./workspace-state-
|
|
3
|
-
import {
|
|
4
|
-
import { r as register } from "./cache-manifest-
|
|
5
|
-
import {
|
|
6
|
-
import "./build-cache-
|
|
1
|
+
import { T as trackReportResource, _ as spawnDeclared, t as getExecutor } from "./exec-aULwtNly.mjs";
|
|
2
|
+
import { y as sharedBuildCache } from "./workspace-state-kIZrdlSg.mjs";
|
|
3
|
+
import { J as resolveCacheProviderConfig, Vt as repoRootAsync, it as settingValueAt, z as projectSettingsContextAsync } from "./settings-CY5JZlNN.mjs";
|
|
4
|
+
import { r as register } from "./cache-manifest-DEjqGGat.mjs";
|
|
5
|
+
import { m as macosToolchainAsync, ot as runCancellationSignal } from "./toolchain-mLA_km-b.mjs";
|
|
6
|
+
import "./build-cache-CZULpXVl.mjs";
|
|
7
7
|
import { l as artifactCachePolicy, p as resolveOptimizations } from "./errors-DHm_U5gv.mjs";
|
|
8
|
-
import {
|
|
9
|
-
import { r as
|
|
10
|
-
import {
|
|
11
|
-
import { t as
|
|
12
|
-
import { t as
|
|
13
|
-
import { n as swiftpmArtifactInputs, r as swiftpmArtifactSnapshot, t as readSwiftpmArtifactToolchain } from "./swiftpm-artifact-inputs-CfUzt_0Z.mjs";
|
|
8
|
+
import { r as nativeFileDigest } from "./native-source-D1AzWiuP.mjs";
|
|
9
|
+
import { a as validateInfoPlist, i as stageBundle, n as resolveBundleExtras, r as setBundleName, t as reidentifyBundle } from "./stage-CmugrSG5.mjs";
|
|
10
|
+
import { t as validateMacosArtifactPlatform } from "./artifact-platform-BO2Uvk_A.mjs";
|
|
11
|
+
import { t as logLines } from "./run-y2HwyNvg.mjs";
|
|
12
|
+
import { n as swiftpmArtifactInputs, r as swiftpmArtifactSnapshot, t as readSwiftpmArtifactToolchain } from "./swiftpm-artifact-inputs-Cj2UpmPN.mjs";
|
|
14
13
|
import { createHash } from "node:crypto";
|
|
15
14
|
import { createReadStream, createWriteStream, existsSync, realpathSync } from "node:fs";
|
|
16
15
|
import { tmpdir } from "node:os";
|