stim 1.17.2 → 1.18.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/README.md +50 -1
- package/dist/{activity-IRvJY_ru.mjs → activity-BxnkDZDi.mjs} +4 -4
- package/dist/{agent-device-usage-output-BK41vnzN.mjs → agent-device-usage-output-CZ66YA4T.mjs} +8 -8
- package/dist/android-BKA16DTf.mjs +4 -0
- package/dist/{android-B9yaNKwa.mjs → android-BvwuMUJ9.mjs} +192 -98
- package/dist/{android-DE4v59Mb.mjs → android-CBwCNicO.mjs} +2 -2
- package/dist/{android-B_YNZy61.mjs → android-DC3ZLuw0.mjs} +9 -9
- package/dist/{android-cas-ZFpjJBL_.mjs → android-cas-BBFyr9CA.mjs} +5 -5
- package/dist/android-cas-compiler.mjs +2 -2
- package/dist/api-D0VtFhqk.mjs +152 -0
- package/dist/api-run.d.mts +1 -0
- package/dist/api-run.mjs +145 -0
- package/dist/api.d.mts +212 -0
- package/dist/api.mjs +2 -0
- package/dist/{app-install-VPkI5WEg.mjs → app-install-D-PUENug.mjs} +3 -3
- package/dist/{attempt-Bk2ouQVL.mjs → attempt-DW-mQqM7.mjs} +14 -4
- package/dist/{budget-DfcgFdQB.mjs → budget-DIhL2BKx.mjs} +1578 -58
- package/dist/build-facts-DcLv2HSd.d.mts +111 -0
- package/dist/{cache-manifest-DnUHBJaU.mjs → cache-manifest-BI7ozfmH.mjs} +3 -3
- package/dist/cache-manifest.mjs +1 -1
- package/dist/{chrome-BrcVWQyD.mjs → chrome-DJnmnS5q.mjs} +1 -1
- package/dist/cli-DNJMwADx.mjs +68 -0
- package/dist/cli.mjs +1 -1
- package/dist/{client-SvBdgObD.mjs → client-DzhapoMB.mjs} +139 -32
- package/dist/collector-run.mjs +9 -9
- package/dist/{command-output-CDAIFD-8.mjs → command-output-CBtzyIgF.mjs} +2 -2
- package/dist/{config-D0DbpZtM.mjs → config-CgYMahz7.mjs} +5 -5
- package/dist/{created-devices-CpvzBL25.mjs → created-devices-DKbeWsiK.mjs} +2 -2
- package/dist/{dependency-state-CLcBHH2M.mjs → dependency-state-xKoOypBm.mjs} +2 -2
- package/dist/{detached-entry-CiTEgMR1.mjs → detached-entry-BLfcgc4O.mjs} +1 -1
- package/dist/{dev-client-B-XC4uRH.mjs → dev-client-CLnIH02x.mjs} +2 -2
- package/dist/{device-C8IOoJPv.mjs → device-D7oCHGWi.mjs} +8 -8
- package/dist/{device-capacity-ZC4XSZ4R.mjs → device-capacity-EUOOYr8T.mjs} +13 -13
- package/dist/device-host-worker.mjs +19 -19
- package/dist/{device-ios-C2Um-XUR.mjs → device-ios-6MewKKnc.mjs} +13 -13
- package/dist/{device-lease-DpoS36_u.mjs → device-lease-Co-EwifR.mjs} +9 -9
- package/dist/{device-lease-run-B8YltIH_.mjs → device-lease-run-w1xhCqIW.mjs} +4 -4
- package/dist/{device-pool-3o7s5lo4.mjs → device-pool-F5WvRPtD.mjs} +3 -3
- package/dist/{device-remote-hFSkpfQu.mjs → device-remote-tHbd1fKy.mjs} +15 -15
- package/dist/{doctor-CFv1fCrF.mjs → doctor-B9ckYUoU.mjs} +33 -30
- package/dist/{error-diagnostics-C-NMnhrk.mjs → error-diagnostics-BRXOqDzG.mjs} +11 -11
- package/dist/{exec-CaErVv7t.mjs → exec-DWhCZDGm.mjs} +65 -2
- package/dist/{gc-DEmkg3Xh.mjs → gc-Dh6mXOKC.mjs} +23 -469
- package/dist/{gradle-dJpre3Yn.mjs → gradle-C6GKnunQ.mjs} +6 -6
- package/dist/{guide-status-Du-ZQ3FD.mjs → guide-status-Bhf9SJXc.mjs} +3 -3
- package/dist/{guide-CSmhMTf8.mjs → guide-tm6igAaa.mjs} +290 -53
- package/dist/{hosted-android-E1Heoqnv.mjs → hosted-android-Bv285t_t.mjs} +3 -3
- package/dist/{hosted-client-Bp4knSwu.mjs → hosted-client-C-rMtppF.mjs} +2 -2
- package/dist/{hosted-ios-BnbeYOUD.mjs → hosted-ios-D5mNmtj4.mjs} +1 -1
- package/dist/{hosted-logs-OcgIBvCT.mjs → hosted-logs-DN8Iz4mJ.mjs} +9 -9
- package/dist/{hosted-macos-DcxKjtfH.mjs → hosted-macos-B-wEjlwG.mjs} +5 -5
- package/dist/{hosted-native-1Ebbig4w.mjs → hosted-native-DeeOG8xZ.mjs} +6 -6
- package/dist/{idle-shutdown-IGyNV8Cr.mjs → idle-shutdown-jjtxAn5C.mjs} +7 -8
- package/dist/{ios-DSfnPfse.mjs → ios-B3SbOWdw.mjs} +19 -7
- package/dist/{ios-Cr1h5gnO.mjs → ios-Bvbf0SGY.mjs} +1 -1
- package/dist/{ios-BJ4XUSe1.mjs → ios-CPdkoKaa.mjs} +181 -95
- package/dist/ios-DNpdygiv.mjs +7 -0
- package/dist/{ios-device-Ee7sDXfp.mjs → ios-device-Bn7jWDB1.mjs} +1 -1
- package/dist/{ios-device-pAN4t54-.mjs → ios-device-vOaByMhw.mjs} +3 -3
- package/dist/{ios-state-8L3lgum6.mjs → ios-state-B2pES6Vs.mjs} +1 -1
- package/dist/{launch-verify-lTnWZikR.mjs → launch-verify-hskNcWkZ.mjs} +5 -5
- package/dist/{logs-BAaS7gS2.mjs → logs-1Ylc1Ri6.mjs} +13 -13
- package/dist/macos-Ck7OBMNY.mjs +2 -0
- package/dist/{macos-BIRQS90f.mjs → macos-DF6C7wUU.mjs} +118 -34
- package/dist/macos-run.mjs +1 -1
- package/dist/maintenance-run.mjs +349 -47
- package/dist/{metro-g8NqiJp-.mjs → metro-Dh8T4Ytd.mjs} +5 -5
- package/dist/{metro-gateway-C-ijGI2F.mjs → metro-gateway-CEUw9RMH.mjs} +4 -4
- package/dist/{metro-store-CDDZHtPl.mjs → metro-store-BAHFcJm6.mjs} +16 -2
- package/dist/{named-ports-C8m8EQs2.mjs → named-ports-BFIz1Shz.mjs} +61 -6
- package/dist/{native-run-D1Q56rAD.mjs → native-run-B06FkmZx.mjs} +4 -4
- package/dist/{native-runtime-BEK171xQ.mjs → native-runtime-D_603JiC.mjs} +6 -6
- package/dist/{ndjson-PclOIwVY.mjs → ndjson-LGZAMsqa.mjs} +8 -4
- package/dist/offload-worker.d.mts +3 -17
- package/dist/offload-worker.mjs +10 -11
- package/dist/{ownership-DyRQru0q.mjs → ownership-D6Se7gg_.mjs} +3 -3
- package/dist/{page-QF_Ke10s.mjs → page-Bv9s2KwY.mjs} +1 -1
- package/dist/placement-log-BcPhRwR4.mjs +84 -0
- package/dist/{build-plan-BDsSi09V.mjs → plan-placement-CtxkCO54.mjs} +122 -48
- package/dist/{ports-4nYqxPWC.mjs → ports-BLTtfBq-.mjs} +3 -3
- package/dist/{prebuild-D7RUMkwN.mjs → prebuild-juCyreaR.mjs} +5 -5
- package/dist/preview-D5V07Nrl.mjs +987 -0
- package/dist/{rolldown-runtime-BsOwBuO_.mjs → process-identity-Biv3arCO.mjs} +11 -1
- package/dist/{project-D47Rh0ly.mjs → project-C3ChRLZy.mjs} +4 -68
- package/dist/projects-DD7dBTCj.mjs +92 -0
- package/dist/{pull-request-pxnDCQzn.mjs → pull-request-u4vp7zmK.mjs} +1 -1
- package/dist/pull-requests.mjs +1 -1
- package/dist/{recordings-BNgsD1Tr.mjs → recordings-BAWltsVt.mjs} +1 -1
- package/dist/{reload-DcRxj3qG.mjs → reload-DvyWzVjJ.mjs} +15 -15
- package/dist/{remote-cache-Ci4DQYYj.mjs → remote-cache-BGg7aGIZ.mjs} +5 -5
- package/dist/{run-CkE9y0nc.mjs → run-vhtDgpHO.mjs} +5 -5
- package/dist/{server-bare-BkrSxSsZ.mjs → server-bare-B9E7S1aR.mjs} +4 -5
- package/dist/server-expo-Db9HBUoa.mjs +2 -0
- package/dist/{server-expo-CHTyXD0G.mjs → server-expo-DoBHhuzK.mjs} +5 -6
- package/dist/{settings-SR9OmW9h.mjs → settings-Byp2AQ_E.mjs} +6 -5
- package/dist/{settings-Cfd-0r2d.mjs → settings-CQyMElEP.mjs} +24 -763
- package/dist/{settings-BBpMcDbD.mjs → settings-Djl-mpjX.mjs} +1 -1
- package/dist/settings.schema.json +126 -3
- package/dist/{simslim-BWNrc3M3.mjs → simslim-EHBQ2R4G.mjs} +7 -7
- package/dist/{slot-launch-DmjBmpQV.mjs → slot-launch-C1nqh4mu.mjs} +6 -6
- package/dist/{spawn-claims-D0XfSe8u.mjs → spawn-claims-Kqiifsk2.mjs} +1 -1
- package/dist/{spawn-entry-jw19m8Nl.mjs → spawn-entry-Dcb7sDUz.mjs} +1 -0
- package/dist/{stage-CzaiwFsI.mjs → stage-g_WqWeaE.mjs} +14 -3
- package/dist/{start-DUz3mYdb.mjs → start-D-IeOyoK.mjs} +19 -19
- package/dist/{start-AlfCPRVU.mjs → start-NTc1Ifqs.mjs} +1 -1
- package/dist/{state-PeQiJuIu.mjs → state-BG-aAk4k.mjs} +4 -4
- package/dist/{state-B4PQFXMW.d.mts → state-lKh8shBp.d.mts} +2 -3
- package/dist/{state-DyaNTgfR.mjs → state-xnqpx3AD.mjs} +2 -2
- package/dist/{stats-Bq4fJOdB.mjs → stats-DY6ekz8F.mjs} +5 -5
- package/dist/{status-DlKvVJBE.mjs → status-BEeL6IKz.mjs} +6 -4
- package/dist/{status-BA2pehwf.mjs → status-DCjZeE-K.mjs} +33 -34
- package/dist/{status-CzS4bPO9.mjs → status-Dcr0Qexd.mjs} +5 -5
- package/dist/{stim-desktop-Cnz8CPnl.mjs → stim-desktop-Behws_fi.mjs} +1 -1
- package/dist/{stim-installations-QMEI32v1.mjs → stim-installations-aR_WsNOA.mjs} +1 -1
- package/dist/{stop-BIiM49EY.mjs → stop-BGhKMOuH.mjs} +5 -5
- package/dist/{stop-DQIasgKp.mjs → stop-BTjs3xbc.mjs} +17 -18
- package/dist/{stop-zF1y04f2.mjs → stop-DIJtD2GL.mjs} +2 -2
- package/dist/supervisor-run.d.mts +24 -22
- package/dist/supervisor-run.mjs +21 -22
- package/dist/{support-CsJNVfOc.mjs → support-BaayeYCf.mjs} +7 -7
- package/dist/{support-WvD__tSV.mjs → support-Bwvbrq5-.mjs} +5 -5
- package/dist/{toolchain-DNyR3NPq.mjs → toolchain-Bnyd_K3A.mjs} +471 -22
- package/dist/{trigger-Bemu8ytw.mjs → trigger-CJMhwXe8.mjs} +5 -5
- package/dist/trigger-DWAq9hkw.mjs +2 -0
- package/dist/{warm-progress-DF4JRvYI.mjs → warm-progress-CjB-MP6H.mjs} +7 -7
- package/dist/web-B6_bFDn7.mjs +2 -0
- package/dist/{web-Dl0KSRHf.mjs → web-DTU0uiWj.mjs} +22 -22
- package/dist/web-run.mjs +10 -10
- package/dist/{workspace-state-DqcCbpE7.mjs → workspace-state-C59dqG-Z.mjs} +3 -3
- package/dist/{ownership-BMLqyBgJ.mjs → workspaces-xXItD8Dj.mjs} +577 -23
- package/dist/{worktree-j3IcFAI5.mjs → worktree-BJfnU6r5.mjs} +1 -1
- package/dist/{worktree-Be_7NLKy.mjs → worktree-BSYlofkq.mjs} +234 -35
- package/dist/worktree-CsKYexJM.mjs +753 -0
- package/package.json +10 -5
- package/dist/build-progress-D0WkjCPd.mjs +0 -1036
- package/dist/build-slots-41v_d2x9.mjs +0 -142
- package/dist/cli-CYXb29oE.mjs +0 -51
- package/dist/deps-iKw0eD4P.mjs +0 -438
- package/dist/errors-B6W7FkxQ.mjs +0 -15
- package/dist/idle-BXG__1BA.mjs +0 -176
- package/dist/in-use-CvGOUn-x.mjs +0 -130
- package/dist/preview-B-g9d7kV.mjs +0 -318
- package/dist/process-identity-BmRm1qV0.mjs +0 -12
- package/dist/server-expo-CeakhI8P.mjs +0 -2
- package/dist/state-BKa8wNN5.mjs +0 -148
- package/dist/stop-cause-rhmGfwvt.mjs +0 -97
- package/dist/trigger-CXts6qt1.mjs +0 -2
- package/dist/watchman-APYjXSQa.mjs +0 -48
- package/dist/workspace-process-lock-2mNzOlaB.mjs +0 -58
- package/dist/workspaces-Bcib97-6.mjs +0 -306
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { O as listAdbDevices } from "./android-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { r as createNdjsonWriter } from "./ndjson-
|
|
12
|
-
import { n as dueIdleDevices, r as shutDownIdleDevices } from "./idle-shutdown-
|
|
1
|
+
import { n as ownership_claim_exports } from "./process-identity-Biv3arCO.mjs";
|
|
2
|
+
import { a as formatElapsed, l as phaseLine } from "./command-output-CBtzyIgF.mjs";
|
|
3
|
+
import { H as projectDeviceSlots, _ as loadConfig$1, d as getConfigDir, u as getConcurrencyLimits, z as deviceSlotPlatforms } from "./config-CgYMahz7.mjs";
|
|
4
|
+
import { x as workspaceLogsDir$1 } from "./workspace-state-C59dqG-Z.mjs";
|
|
5
|
+
import { H as recordCapacityWait, V as recordCapacityRefusal } from "./budget-DIhL2BKx.mjs";
|
|
6
|
+
import { I as canonicalPath, f as withIdleWorkspace } from "./workspaces-xXItD8Dj.mjs";
|
|
7
|
+
import { O as listAdbDevices } from "./android-DC3ZLuw0.mjs";
|
|
8
|
+
import { d as listAllIosSims, l as iosRuntimeMatches, v as parseRuntimeVersion } from "./ios-B3SbOWdw.mjs";
|
|
9
|
+
import { E as projectDeviceReclaimIdleMinutes } from "./settings-CQyMElEP.mjs";
|
|
10
|
+
import { a as withWorkspaceProcessLock, o as workspaceProcessLockError } from "./named-ports-BFIz1Shz.mjs";
|
|
11
|
+
import { r as createNdjsonWriter } from "./ndjson-LGZAMsqa.mjs";
|
|
12
|
+
import { n as dueIdleDevices, r as shutDownIdleDevices } from "./idle-shutdown-jjtxAn5C.mjs";
|
|
13
13
|
import { realpathSync } from "node:fs";
|
|
14
14
|
import { basename, join } from "node:path";
|
|
15
|
-
import { LOG_ROTATE_BYTES, workspaceId } from "@stim-cli/core";
|
|
16
15
|
import { DEVICE_RECLAIM_REASON } from "@stim-cli/core/state";
|
|
16
|
+
import { LOG_ROTATE_BYTES, workspaceId } from "@stim-cli/core";
|
|
17
17
|
import { setTimeout } from "node:timers/promises";
|
|
18
18
|
//#region src/devices/queue-reclaim.ts
|
|
19
19
|
async function reclaimIdleDevice(root, idleMs, out, now, skipped) {
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { a as
|
|
10
|
-
import { r as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { n as stopMacosAppHeld } from "./stop-
|
|
17
|
-
import {
|
|
18
|
-
import { createHash, randomUUID } from "node:crypto";
|
|
1
|
+
import { t as process_identity_exports } from "./process-identity-Biv3arCO.mjs";
|
|
2
|
+
import { t as getExecutor } from "./exec-DWhCZDGm.mjs";
|
|
3
|
+
import { t as spawnEntry } from "./spawn-entry-Dcb7sDUz.mjs";
|
|
4
|
+
import { D as withConfigLock$1, _ as loadConfig$1, c as ensureConfig } from "./config-CgYMahz7.mjs";
|
|
5
|
+
import { c as writeWorkspaceState, u as ensureWorkspaceStorage } from "./workspace-state-C59dqG-Z.mjs";
|
|
6
|
+
import { E as teardownOwnedAvd, O as teardownOwnedIosSim } from "./workspaces-xXItD8Dj.mjs";
|
|
7
|
+
import { t as forgetCreatedDevice } from "./created-devices-DKbeWsiK.mjs";
|
|
8
|
+
import { A as listAvds, B as ownedAvdSystemImage, D as hostSystemImageArch, E as getAvdNameForSerial, J as resolveOwnedAvdSerial, O as listAdbDevices, R as ownedAvdName, W as pickDefaultSystemImage, _ as avdStorageRoots, a as androidDeviceAbi, b as createOwnedAvd, d as androidToolPath, f as assertOwnedAvdStopped, h as avdPathExists, j as listInstalledSystemImages, k as listAvdDeviceProfiles, q as resetAdoptedAvd, t as DEFAULT_AVD_DEVICE_PROFILE, tt as waitForBoot, v as bootAndroidEmulator } from "./android-DC3ZLuw0.mjs";
|
|
9
|
+
import { C as resetIosPrivacy, M as readHostMemoryPressure, O as uninstallIosApp, S as resetIosKeychain, a as createOwnedIosSim, d as listAllIosSims, h as listUserApps, n as bootIosSim, w as resolveIosCreation } from "./ios-B3SbOWdw.mjs";
|
|
10
|
+
import { a as requiredMacosRecord, r as macosProcess } from "./state-xnqpx3AD.mjs";
|
|
11
|
+
import { r as createNdjsonWriter } from "./ndjson-LGZAMsqa.mjs";
|
|
12
|
+
import { i as countLiveOwnedDevices } from "./device-capacity-EUOOYr8T.mjs";
|
|
13
|
+
import { C as reverseMetroPorts, _ as installIosApp, b as launchAndroidReleaseApp, h as installAndroidApp, s as androidAppProcess, v as iosAppProcess, w as writeDebugHttpHost, x as launchIosApp, y as launchAndroidApp } from "./app-install-D-PUENug.mjs";
|
|
14
|
+
import { h as findAapt } from "./support-Bwvbrq5-.mjs";
|
|
15
|
+
import { n as parseLogcatLine, r as parsePidof, t as androidClockOffset } from "./android-CBwCNicO.mjs";
|
|
16
|
+
import { n as stopMacosAppHeld } from "./stop-BGhKMOuH.mjs";
|
|
17
|
+
import { n as parseLogStreamLine } from "./ios-Bvbf0SGY.mjs";
|
|
19
18
|
import { chmodSync, closeSync, copyFileSync, createReadStream, existsSync, lstatSync, mkdirSync, openSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, statfsSync, symlinkSync, writeFileSync } from "node:fs";
|
|
20
19
|
import { dirname, isAbsolute, join, posix, relative, sep } from "node:path";
|
|
21
|
-
import { LOG_ROTATE_BYTES, configDir, withDirLock } from "@stim-cli/core";
|
|
22
20
|
import { assertHostedDeviceLedger, hostedAppArea, hostedAppAttempt, hostedAppBlobs, hostedConsolePort, hostedMacosAppSlot, hostedMacosBundleId, hostedNativeLogsDir, isJsonObject, parseHostedOfferRequest, readHostedApp, readHostedAppMetadata, readHostedDevice, readHostedNativeLogsCheckpoint, readMacosRecord, readNdjsonGenerations } from "@stim-cli/core/state";
|
|
23
21
|
import { availableParallelism, freemem, homedir, loadavg } from "node:os";
|
|
22
|
+
import { LOG_ROTATE_BYTES, configDir, withDirLock } from "@stim-cli/core";
|
|
23
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
24
24
|
//#region src/device-host/android-app.ts
|
|
25
25
|
async function digest$1(path) {
|
|
26
26
|
const hash = createHash("sha256");
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { ct as dropParked, ft as parkedMaxSetting, ht as selectParked, pt as readParked, st as adoptParked } from "./android-
|
|
8
|
-
import {
|
|
9
|
-
import { v as
|
|
10
|
-
import {
|
|
11
|
-
import { a as deviceTypeMismatch, c as runtimeMismatch, n as DeviceAdmissionRefusal, p as withDeviceBootAdmission } from "./device-capacity-
|
|
1
|
+
import { n as ownership_claim_exports } from "./process-identity-Biv3arCO.mjs";
|
|
2
|
+
import { t as getExecutor } from "./exec-DWhCZDGm.mjs";
|
|
3
|
+
import { l as phaseLine } from "./command-output-CBtzyIgF.mjs";
|
|
4
|
+
import { C as saveConfig, D as withConfigLock, H as projectDeviceSlots, _ as loadConfig, a as clearDevice, d as getConfigDir, w as setDevice, z as deviceSlotPlatforms } from "./config-CgYMahz7.mjs";
|
|
5
|
+
import { y as workspaceId } from "./workspace-state-C59dqG-Z.mjs";
|
|
6
|
+
import { A as teardownParkedIosSim } from "./workspaces-xXItD8Dj.mjs";
|
|
7
|
+
import { ct as dropParked, ft as parkedMaxSetting, ht as selectParked, pt as readParked, st as adoptParked } from "./android-DC3ZLuw0.mjs";
|
|
8
|
+
import { C as resetIosPrivacy, M as readHostMemoryPressure, S as resetIosKeychain, T as resolveOwnedIosSim, a as createOwnedIosSim, d as listAllIosSims, g as ownedSimName, j as hostMemoryPressureAdvice, k as configuredIosSimulatorViewer, m as listIosRuntimes, n as bootIosSim, p as listIosDeviceTypes, u as iosSimulatorFailureAdvice, v as parseRuntimeVersion, w as resolveIosCreation, x as renameIosSim } from "./ios-B3SbOWdw.mjs";
|
|
9
|
+
import { v as iosSimSlimProfileSetting } from "./settings-CQyMElEP.mjs";
|
|
10
|
+
import { a as withWorkspaceProcessLock } from "./named-ports-BFIz1Shz.mjs";
|
|
11
|
+
import { a as deviceTypeMismatch, c as runtimeMismatch, n as DeviceAdmissionRefusal, p as withDeviceBootAdmission } from "./device-capacity-EUOOYr8T.mjs";
|
|
12
12
|
import chalk from "chalk";
|
|
13
13
|
//#region src/engine/device-ios.ts
|
|
14
14
|
function startIosBoot(udid, configure, label, out, simulatorApp, root, deviceSlotWait) {
|
|
@@ -37,13 +37,13 @@ function startIosBoot(udid, configure, label, out, simulatorApp, root, deviceSlo
|
|
|
37
37
|
var IosDeviceMismatchError = class extends Error {
|
|
38
38
|
remedy = "Run `stim worktree remove` (or `stim gc --delete`) to reap the current sim, then `stim ios` again to create the requested one, or pass `--slot <name>` to create it beside the current one.";
|
|
39
39
|
};
|
|
40
|
-
async function ensureOwnedIosDevice({ record, projectPath, slot, settingsRoot, label, settings, flags, note, out, reconcileIosSimulator }) {
|
|
40
|
+
async function ensureOwnedIosDevice({ record, projectPath, slot, settingsRoot, label, settings, flags, note, out, reconcileIosSimulator, simSnapshot }) {
|
|
41
41
|
const memoryAdvice = hostMemoryPressureAdvice(readHostMemoryPressure());
|
|
42
42
|
if (memoryAdvice) out(chalk.yellow(phaseLine("memory", memoryAdvice)));
|
|
43
43
|
const simslimProfile = iosSimSlimProfileSetting(settings, settingsRoot);
|
|
44
44
|
if (record?.deviceUdid) {
|
|
45
45
|
if (record.owned) {
|
|
46
|
-
const listed = listAllIosSims({ includeUnavailable: true });
|
|
46
|
+
const listed = simSnapshot ? simSnapshot.read() : listAllIosSims({ includeUnavailable: true });
|
|
47
47
|
const resolved = resolveOwnedIosSim(record.deviceUdid, listed);
|
|
48
48
|
if (resolved.notOwned) note(chalk.yellow(`Note: recorded sim is now named "${resolved.notOwned}", not Stim-owned -- creating a fresh owned sim instead of booting it.`));
|
|
49
49
|
else if (resolved.missing) {} else {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { n as declareSpawnsOn, o as stopDeclaringSpawnsOn } from "./spawn-claims-
|
|
8
|
-
import { createHash, randomBytes } from "node:crypto";
|
|
1
|
+
import { n as ownership_claim_exports } from "./process-identity-Biv3arCO.mjs";
|
|
2
|
+
import { t as getExecutor } from "./exec-DWhCZDGm.mjs";
|
|
3
|
+
import { a as formatElapsed, i as formatDuration, m as shortHash } from "./command-output-CBtzyIgF.mjs";
|
|
4
|
+
import { B as parseDeviceSlotKey, R as deviceSlotKey, W as validateDeviceSlot, d as getConfigDir } from "./config-CgYMahz7.mjs";
|
|
5
|
+
import { c as writeWorkspaceState, d as sharedBuildCache, n as clearWorkspaceStateKeys, o as withWorkspaceStateLock, r as readWorkspaceState, w as withDirLock$1 } from "./workspace-state-C59dqG-Z.mjs";
|
|
6
|
+
import { r as register } from "./cache-manifest-BI7ozfmH.mjs";
|
|
7
|
+
import { n as declareSpawnsOn, o as stopDeclaringSpawnsOn } from "./spawn-claims-Kqiifsk2.mjs";
|
|
9
8
|
import { existsSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
10
9
|
import { join } from "node:path";
|
|
11
|
-
import { existsSync as existsSync$1, mkdirSync as mkdirSync$1, readFileSync as readFileSync$1, rmSync as rmSync$1, writeFileSync as writeFileSync$1 } from "fs";
|
|
12
10
|
import { join as join$1 } from "path";
|
|
11
|
+
import { existsSync as existsSync$1, mkdirSync as mkdirSync$1, readFileSync as readFileSync$1, rmSync as rmSync$1, writeFileSync as writeFileSync$1 } from "fs";
|
|
13
12
|
import { artifactIn, buildCacheKey, resolveArtifact, storeArtifact } from "@stim-cli/core";
|
|
13
|
+
import { createHash, randomBytes } from "node:crypto";
|
|
14
14
|
import { isDeepStrictEqual } from "util";
|
|
15
15
|
import * as expoFingerprint from "@expo/fingerprint";
|
|
16
16
|
import { buildUploadTimeoutMs } from "@stim-cli/cache";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { a as parseLease, c as raiseLease, l as releaseRunLease, n as fileLeaseIo, p as takeLease, r as leaseIsExpired, t as deviceLeasePath } from "./device-lease-
|
|
4
|
-
import { a as VERIFY_TIMEOUT_MS, m as APP_READINESS_TIMEOUT_MS } from "./launch-verify-
|
|
1
|
+
import { a as formatElapsed, r as clockTime } from "./command-output-CBtzyIgF.mjs";
|
|
2
|
+
import { R as deviceSlotKey } from "./config-CgYMahz7.mjs";
|
|
3
|
+
import { a as parseLease, c as raiseLease, l as releaseRunLease, n as fileLeaseIo, p as takeLease, r as leaseIsExpired, t as deviceLeasePath } from "./device-lease-Co-EwifR.mjs";
|
|
4
|
+
import { a as VERIFY_TIMEOUT_MS, m as APP_READINESS_TIMEOUT_MS } from "./launch-verify-hskNcWkZ.mjs";
|
|
5
5
|
//#region src/engine/device-lease-run.ts
|
|
6
6
|
const LEASE_STEP_FLOOR_MS = 6e4;
|
|
7
7
|
const DEBUG_VERIFY_STEP_MS = VERIFY_TIMEOUT_MS + APP_READINESS_TIMEOUT_MS;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { R as deviceSlotKey } from "./config-
|
|
2
|
-
import { a as parseLease, f as selectPoolDevice, n as fileLeaseIo, r as leaseIsExpired, t as deviceLeasePath } from "./device-lease-
|
|
3
|
-
import { i as DEVICE_WAIT_POLL_MS, n as DEVICE_BUSY, o as leaseExpiryText } from "./device-lease-run-
|
|
1
|
+
import { R as deviceSlotKey } from "./config-CgYMahz7.mjs";
|
|
2
|
+
import { a as parseLease, f as selectPoolDevice, n as fileLeaseIo, r as leaseIsExpired, t as deviceLeasePath } from "./device-lease-Co-EwifR.mjs";
|
|
3
|
+
import { i as DEVICE_WAIT_POLL_MS, n as DEVICE_BUSY, o as leaseExpiryText } from "./device-lease-run-w1xhCqIW.mjs";
|
|
4
4
|
//#region src/engine/device-pool.ts
|
|
5
5
|
function heldPoolId(root, platform, now, io = fileLeaseIo, slot = "default") {
|
|
6
6
|
const record = io.readHolder(root)[deviceSlotKey(platform, slot)];
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { t as getExecutor } from "./exec-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { i as INSTALL_ERROR, o as LAUNCH_ERROR, u as devClientDeepLink } from "./app-install-
|
|
13
|
-
import { c as readMetroRecords, o as isBundleProof } from "./launch-verify-
|
|
14
|
-
import { t as compareStimVersions } from "./stim-installations-
|
|
15
|
-
import { c as nativeRunWaitNotice } from "./native-run-
|
|
1
|
+
import { t as getExecutor } from "./exec-DWhCZDGm.mjs";
|
|
2
|
+
import { a as formatElapsed } from "./command-output-CBtzyIgF.mjs";
|
|
3
|
+
import { d as getConfigDir } from "./config-CgYMahz7.mjs";
|
|
4
|
+
import { u as ownedDeviceLabel } from "./project-C3ChRLZy.mjs";
|
|
5
|
+
import { o as pidExists } from "./metro-Dh8T4Ytd.mjs";
|
|
6
|
+
import { C as workspaceStateFile, v as workspaceDir, w as withDirLock, x as workspaceLogsDir$1, y as workspaceId } from "./workspace-state-C59dqG-Z.mjs";
|
|
7
|
+
import { Ht as readMetroTunnel, Wt as readRemoteSession, zt as clearRemoteSession } from "./budget-DIhL2BKx.mjs";
|
|
8
|
+
import { S as probePublicHttp } from "./workspaces-xXItD8Dj.mjs";
|
|
9
|
+
import { E as sanitizeDeviceLabel } from "./ios-B3SbOWdw.mjs";
|
|
10
|
+
import { q as planMetroReach } from "./settings-CQyMElEP.mjs";
|
|
11
|
+
import { a as withWorkspaceProcessLock } from "./named-ports-BFIz1Shz.mjs";
|
|
12
|
+
import { i as INSTALL_ERROR, o as LAUNCH_ERROR, u as devClientDeepLink } from "./app-install-D-PUENug.mjs";
|
|
13
|
+
import { c as readMetroRecords, o as isBundleProof } from "./launch-verify-hskNcWkZ.mjs";
|
|
14
|
+
import { t as compareStimVersions } from "./stim-installations-aR_WsNOA.mjs";
|
|
15
|
+
import { c as nativeRunWaitNotice } from "./native-run-B06FkmZx.mjs";
|
|
16
16
|
import { existsSync, mkdirSync, realpathSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
17
17
|
import { dirname, join, resolve } from "node:path";
|
|
18
18
|
import { easMachineStateRoot, easMachineStateRoot as easMachineStateRoot$1, easSessionLedgerFile, easSessionLedgerLock, readEasSessionLedger, readEasSessionLedger as readEasSessionLedger$1, readJsonObject, validEasSessionClaim } from "@stim-cli/core/state";
|
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
import { t as getExecutor } from "./exec-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { _ as workspaceDerivedData, d as sharedBuildCache } from "./workspace-state-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { D as hostSystemImageArch, ft as parkedMaxSetting, o as androidHome, ot as POOL_SETTING_REMEDY } from "./android-
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { i as
|
|
16
|
-
import {
|
|
17
|
-
import { g as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import { n as
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import { n as
|
|
25
|
-
import {
|
|
1
|
+
import { t as getExecutor } from "./exec-DWhCZDGm.mjs";
|
|
2
|
+
import { d as quotedPath, f as refuseNoProject, l as phaseLine, u as plural } from "./command-output-CBtzyIgF.mjs";
|
|
3
|
+
import { _ as loadConfig$1, p as getProject, s as configCorruptRepair, u as getConcurrencyLimits } from "./config-CgYMahz7.mjs";
|
|
4
|
+
import { D as makeTemporaryDirectory, E as filesystemDevice, a as dirtyFingerprintFiles, h as locallyKnownUpstream, k as temporaryRoot, m as listWorktrees, s as gitCommonDir, x as resolveSourceCheckout, y as repoRoot } from "./worktree-CsKYexJM.mjs";
|
|
5
|
+
import { i as detectIsExpo, l as isPackageResolvable, n as appProjectProblem, s as findProjectRoot$1 } from "./project-C3ChRLZy.mjs";
|
|
6
|
+
import { _ as workspaceDerivedData, d as sharedBuildCache } from "./workspace-state-C59dqG-Z.mjs";
|
|
7
|
+
import { St as inspectWatchmanMemory, a as inspectBudget, n as budgetLine } from "./budget-DIhL2BKx.mjs";
|
|
8
|
+
import { M as listBuildSlots } from "./workspaces-xXItD8Dj.mjs";
|
|
9
|
+
import { C as diffFingerprintSources, D as fingerprintProject, h as listBuildLocks } from "./device-lease-Co-EwifR.mjs";
|
|
10
|
+
import { D as hostSystemImageArch, ft as parkedMaxSetting, o as androidHome, ot as POOL_SETTING_REMEDY } from "./android-DC3ZLuw0.mjs";
|
|
11
|
+
import { M as readHostMemoryPressure, b as pickDefaultIosCreation, j as hostMemoryPressureAdvice, l as iosRuntimeMatches, m as listIosRuntimes } from "./ios-B3SbOWdw.mjs";
|
|
12
|
+
import { F as resolveSettings, L as settingOrigin, M as remoteAndroidSetting, N as remoteIosSetting, Q as resolveOptimizations, U as unknownSettingKeys, V as settingsLayers, W as webSettings, X as compilerCacheFallbackMessage, i as SETTING_SHAPE_REMEDY, k as projectOptimizations, n as PATH_SETTINGS, r as SETTINGS_WITH_RESOLVE_TIME_FALLBACK, v as iosSimSlimProfileSetting, y as mergeSettingsLayers, z as settingShapeErrors } from "./settings-CQyMElEP.mjs";
|
|
13
|
+
import { o as offloadCheck, u as simulatorRuntime, v as inspectBuildMachines, w as realIo, x as inspectDeviceHostMachines } from "./client-DzhapoMB.mjs";
|
|
14
|
+
import { i as countLiveOwnedDevices } from "./device-capacity-EUOOYr8T.mjs";
|
|
15
|
+
import { N as projectCmakeLauncher, O as bundlerPin, b as detectXcodeMajor, i as macosToolchain, k as podInstallCommand, n as androidToolchain, r as iosToolchain, t as androidRequirements, v as ccacheEnabled } from "./toolchain-Bnyd_K3A.mjs";
|
|
16
|
+
import { f as resolveEasCliBin, i as checkEasAuth$1, l as ownerFromConfig, u as providerFromConfig } from "./remote-cache-BGg7aGIZ.mjs";
|
|
17
|
+
import { _ as easCliSupport, g as MIN_EAS_CLI_SIMULATOR_VERSION, s as readInstalledEasCliVersion, v as easCliUpgradeRemedy } from "./device-remote-tHbd1fKy.mjs";
|
|
18
|
+
import { n as inspectStimVersions, t as compareStimVersions } from "./stim-installations-aR_WsNOA.mjs";
|
|
19
|
+
import { n as simslimIsOnPath, r as MIN_EAS_CLI_BUILD_DOWNLOAD_VERSION } from "./simslim-EHBQ2R4G.mjs";
|
|
20
|
+
import { d as androidPathRoomRemedy, l as androidPathRoom, n as apkOutputsDir, t as androidSdkRefusal, u as androidPathRoomMessage } from "./gradle-C6GKnunQ.mjs";
|
|
21
|
+
import { r as resolveAndroidCompilerCache, t as readAndroidCasToolchain } from "./android-cas-BBFyr9CA.mjs";
|
|
22
|
+
import { g as resolveRuntime, m as resolveDeviceType } from "./support-BaayeYCf.mjs";
|
|
23
|
+
import { a as findChrome, t as CHROME_INSTALL_REMEDY } from "./chrome-DJnmnS5q.mjs";
|
|
24
|
+
import { n as hasInstalledDependencies, r as installedNpmTreeIsValid, t as dependencyState } from "./dependency-state-xKoOypBm.mjs";
|
|
25
|
+
import { r as maintenanceStatus, t as maintenanceLine } from "./status-BEeL6IKz.mjs";
|
|
26
|
+
import { n as recordDoctorRun } from "./guide-status-Bhf9SJXc.mjs";
|
|
26
27
|
import { existsSync, lstatSync, readFileSync, readdirSync, realpathSync, rmSync } from "node:fs";
|
|
27
28
|
import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
28
|
-
import { existsSync as existsSync$1, lstatSync as lstatSync$1, mkdirSync as mkdirSync$1, readFileSync as readFileSync$1, readdirSync as readdirSync$1, realpathSync as realpathSync$1, renameSync as renameSync$1, rmSync as rmSync$1, writeFileSync as writeFileSync$1 } from "fs";
|
|
29
|
-
import { homedir } from "os";
|
|
30
29
|
import { dirname as dirname$1, isAbsolute as isAbsolute$1, join as join$1, relative as relative$1, resolve as resolve$1, sep as sep$1 } from "path";
|
|
31
|
-
import { InvalidArgumentError } from "commander";
|
|
32
30
|
import { isJsonObject, maintenanceNdjsonFile, readHostedAppMetadata, readHostedSessions, readJsonObject, readStats, settingDefinition } from "@stim-cli/core/state";
|
|
33
31
|
import chalk from "chalk";
|
|
32
|
+
import { existsSync as existsSync$1, lstatSync as lstatSync$1, mkdirSync as mkdirSync$1, readFileSync as readFileSync$1, readdirSync as readdirSync$1, realpathSync as realpathSync$1, renameSync as renameSync$1, rmSync as rmSync$1, writeFileSync as writeFileSync$1 } from "fs";
|
|
33
|
+
import { InvalidArgumentError } from "commander";
|
|
34
|
+
import { homedir } from "os";
|
|
34
35
|
import * as expoFingerprint from "@expo/fingerprint";
|
|
35
36
|
//#region src/diagnostics/sandbox.ts
|
|
36
37
|
/**
|
|
@@ -1174,7 +1175,9 @@ function androidCcacheFindings(projectRoot, platform, lookupCcache) {
|
|
|
1174
1175
|
function checkAppProject(projectRoot) {
|
|
1175
1176
|
const problem = appProjectProblem(projectRoot);
|
|
1176
1177
|
if (!problem) return null;
|
|
1177
|
-
|
|
1178
|
+
const result = finding("cost", problem.kind === "unreadable" ? "This package.json does not parse" : "This directory is not a React Native or Expo app", `${problem.message} \`stim start\`, \`stim ios\` and \`stim android\` refuse here with STIM_NO_PROJECT, so nothing below was measured against an app.`, problem.remedy);
|
|
1179
|
+
if (problem.kind === "not-an-app") result.code = "not-an-app";
|
|
1180
|
+
return result;
|
|
1178
1181
|
}
|
|
1179
1182
|
function agentDeviceIsOnPath() {
|
|
1180
1183
|
try {
|
|
@@ -1550,7 +1553,7 @@ function doctorCommand(program, version, inspectVersions = inspectStimVersions,
|
|
|
1550
1553
|
const offloadTargets = () => [
|
|
1551
1554
|
...checksIos ? [{
|
|
1552
1555
|
platform: "ios",
|
|
1553
|
-
local: iosToolchain(),
|
|
1556
|
+
local: iosToolchain(root),
|
|
1554
1557
|
runtime: iosTargetRuntime(root),
|
|
1555
1558
|
cocoapodsPinned: bundlerPin(root) !== null
|
|
1556
1559
|
}] : [],
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { t as getExecutor } from "./exec-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { l as resolveProjectMetro } from "./metro-
|
|
5
|
-
import { r as readWorkspaceState$1, w as withDirLock } from "./workspace-state-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { o as androidHome, u as androidToolCwd } from "./android-
|
|
9
|
-
import { r as deviceConsoleLevel } from "./ios-device-
|
|
10
|
-
import { n as parseLogcatLine, t as androidClockOffset } from "./android-
|
|
11
|
-
import { createHash, randomUUID } from "node:crypto";
|
|
1
|
+
import { t as getExecutor } from "./exec-DWhCZDGm.mjs";
|
|
2
|
+
import { v as launchErrorPreview } from "./command-output-CBtzyIgF.mjs";
|
|
3
|
+
import { R as deviceSlotKey, p as getProject, z as deviceSlotPlatforms } from "./config-CgYMahz7.mjs";
|
|
4
|
+
import { l as resolveProjectMetro } from "./metro-Dh8T4Ytd.mjs";
|
|
5
|
+
import { r as readWorkspaceState$1, w as withDirLock } from "./workspace-state-C59dqG-Z.mjs";
|
|
6
|
+
import { Kt as readWorkspaceLaunches } from "./budget-DIhL2BKx.mjs";
|
|
7
|
+
import { a as parseLease, n as fileLeaseIo, t as deviceLeasePath } from "./device-lease-Co-EwifR.mjs";
|
|
8
|
+
import { o as androidHome, u as androidToolCwd } from "./android-DC3ZLuw0.mjs";
|
|
9
|
+
import { r as deviceConsoleLevel } from "./ios-device-Bn7jWDB1.mjs";
|
|
10
|
+
import { n as parseLogcatLine, t as androidClockOffset } from "./android-CBwCNicO.mjs";
|
|
12
11
|
import { existsSync, mkdirSync, readFileSync, readdirSync, renameSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
13
12
|
import { basename, dirname, join, resolve, sep } from "node:path";
|
|
14
13
|
import { NATIVE_CRASH_LOG_PREFIX, attachExpoErrorContext, readLogRecords, readLogTimeline } from "@stim-cli/core/state";
|
|
15
14
|
import { homedir } from "node:os";
|
|
15
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
16
16
|
//#region src/diagnostics/diagnostic-store.ts
|
|
17
17
|
/** Publishes an immutable diagnostic snapshot atomically; existing evidence wins. */
|
|
18
18
|
function writeDiagnosticOnce(path, content) {
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { execSync } from "child_process";
|
|
2
2
|
import spawn from "cross-spawn";
|
|
3
3
|
import which from "which";
|
|
4
|
+
import { basename } from "path";
|
|
5
|
+
import { createDebugLog, runId } from "@stim-cli/core/state";
|
|
6
|
+
//#region src/debug-log.ts
|
|
7
|
+
const debugLog = createDebugLog("cli", { base: () => ({ runId: runId() }) });
|
|
8
|
+
//#endregion
|
|
4
9
|
//#region src/exec.ts
|
|
5
10
|
const MAX_BUFFER = 67108864;
|
|
6
11
|
function nameTimeout(error, command, timeoutMs) {
|
|
7
12
|
if (error?.code === "ETIMEDOUT" && error instanceof Error) error.message = `Command timed out after ${timeoutMs}ms: ${command}`;
|
|
8
13
|
return error;
|
|
9
14
|
}
|
|
10
|
-
|
|
15
|
+
const defaultExecutor = {
|
|
11
16
|
run(cmd, { timeoutMs, killSignal, cwd, env } = {}) {
|
|
12
17
|
const opts = {
|
|
13
18
|
encoding: "utf-8",
|
|
@@ -130,8 +135,66 @@ let active = {
|
|
|
130
135
|
return which.sync(name, { nothrow: true });
|
|
131
136
|
}
|
|
132
137
|
};
|
|
138
|
+
/** The program a call runs, without its arguments: those can carry tokens. */
|
|
139
|
+
const programOf = (command) => basename(command.trim().split(/\s+/)[0] ?? "");
|
|
140
|
+
function outcomeOf(error) {
|
|
141
|
+
const { status, signal, code } = error ?? {};
|
|
142
|
+
return {
|
|
143
|
+
ok: false,
|
|
144
|
+
...typeof status === "number" ? { exit: status } : {},
|
|
145
|
+
...signal ? { signal } : {},
|
|
146
|
+
...code ? { code } : {}
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
function timedSync(fn, program) {
|
|
150
|
+
return (...args) => {
|
|
151
|
+
if (!debugLog.enabled()) return fn(...args);
|
|
152
|
+
const started = performance.now();
|
|
153
|
+
try {
|
|
154
|
+
const out = fn(...args);
|
|
155
|
+
debugLog.log("exec", {
|
|
156
|
+
program: program(...args),
|
|
157
|
+
ms: Math.round(performance.now() - started),
|
|
158
|
+
ok: true
|
|
159
|
+
});
|
|
160
|
+
return out;
|
|
161
|
+
} catch (error) {
|
|
162
|
+
debugLog.log("exec", {
|
|
163
|
+
program: program(...args),
|
|
164
|
+
ms: Math.round(performance.now() - started),
|
|
165
|
+
...outcomeOf(error)
|
|
166
|
+
});
|
|
167
|
+
throw error;
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
let active = {
|
|
172
|
+
...defaultExecutor,
|
|
173
|
+
run: timedSync((cmd, opts) => defaultExecutor.run(cmd, opts), programOf),
|
|
174
|
+
runFile: timedSync((file, args, opts) => defaultExecutor.runFile(file, args, opts), (file) => basename(file)),
|
|
175
|
+
async runFileAsync(file, args, opts) {
|
|
176
|
+
if (!debugLog.enabled()) return defaultExecutor.runFileAsync(file, args, opts);
|
|
177
|
+
const started = performance.now();
|
|
178
|
+
try {
|
|
179
|
+
const out = await defaultExecutor.runFileAsync(file, args, opts);
|
|
180
|
+
debugLog.log("exec", {
|
|
181
|
+
program: basename(file),
|
|
182
|
+
ms: Math.round(performance.now() - started),
|
|
183
|
+
ok: true
|
|
184
|
+
});
|
|
185
|
+
return out;
|
|
186
|
+
} catch (error) {
|
|
187
|
+
debugLog.log("exec", {
|
|
188
|
+
program: basename(file),
|
|
189
|
+
ms: Math.round(performance.now() - started),
|
|
190
|
+
...outcomeOf(error)
|
|
191
|
+
});
|
|
192
|
+
throw error;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
};
|
|
133
196
|
function getExecutor() {
|
|
134
197
|
return active;
|
|
135
198
|
}
|
|
136
199
|
//#endregion
|
|
137
|
-
export { getExecutor as t };
|
|
200
|
+
export { debugLog as n, getExecutor as t };
|