stim 1.18.0 → 1.20.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 +21 -4
- package/dist/{activity-BxnkDZDi.mjs → activity-BrGh9EAI.mjs} +3 -3
- package/dist/{agent-device-usage-output-CZ66YA4T.mjs → agent-device-usage-output-DVyv_hWj.mjs} +7 -7
- package/dist/android-0vv-OruW.mjs +6 -0
- package/dist/android-Brx6EKvJ.mjs +1258 -0
- package/dist/{android-DC3ZLuw0.mjs → android-BsYNR81W.mjs} +103 -45
- package/dist/{android-CBwCNicO.mjs → android-CK3fpEyZ.mjs} +2 -2
- package/dist/{android-cas-BBFyr9CA.mjs → android-cas-DCAuXryb.mjs} +9 -5
- package/dist/android-cas-compiler.mjs +1 -1
- package/dist/api-run.mjs +159 -8
- package/dist/{api-D0VtFhqk.mjs → api-zuX3ynYN.mjs} +9 -7
- package/dist/api.d.mts +104 -4
- package/dist/api.mjs +1 -1
- package/dist/{app-install-D-PUENug.mjs → app-install-0LgaQRT7.mjs} +39 -18
- package/dist/artifact-CnC0mfov.mjs +807 -0
- package/dist/artifact-DClXJNWx.mjs +772 -0
- package/dist/artifact-lifecycle-DzPpBYvK.mjs +30 -0
- package/dist/{web-DTU0uiWj.mjs → browser-web-CzBmhmgs.mjs} +136 -174
- package/dist/{budget-DIhL2BKx.mjs → budget-BONq9vXY.mjs} +3096 -3244
- package/dist/build-BixRI6sB.mjs +462 -0
- package/dist/build-plan-CP0tckNU.mjs +553 -0
- package/dist/{cache-manifest-BI7ozfmH.mjs → cache-manifest-qA3dT2x2.mjs} +1 -1
- package/dist/cache-manifest.mjs +1 -1
- package/dist/ccache-CjHQ5F8g.mjs +142 -0
- package/dist/{chrome-DJnmnS5q.mjs → chrome-Dp2lMLBe.mjs} +1 -1
- package/dist/{cli-DNJMwADx.mjs → cli-B2R8wH1F.mjs} +20 -20
- package/dist/cli.mjs +1 -1
- package/dist/{client-DzhapoMB.mjs → client-BLy1Pw2V.mjs} +172 -165
- package/dist/collector-run.d.mts +10 -0
- package/dist/collector-run.mjs +7 -7
- package/dist/{command-output-CBtzyIgF.mjs → command-output-BjPN99ZB.mjs} +2 -2
- package/dist/{config-CgYMahz7.mjs → config-D0LhTY3S.mjs} +13 -13
- package/dist/{created-devices-DKbeWsiK.mjs → created-devices-HU_DAb_Q.mjs} +7 -6
- package/dist/{dependency-state-xKoOypBm.mjs → dependency-state-B2m8eqsS.mjs} +2 -2
- package/dist/{detached-entry-BLfcgc4O.mjs → detached-entry-BXq4fIl-.mjs} +1 -1
- package/dist/{dev-client-CLnIH02x.mjs → dev-client-ClATaJoH.mjs} +2 -2
- package/dist/{device-D7oCHGWi.mjs → device-B7lsC0K1.mjs} +8 -8
- package/dist/device-DVCwAFlX.mjs +727 -0
- package/dist/{device-capacity-EUOOYr8T.mjs → device-capacity-Ca_ke1LE.mjs} +25 -15
- package/dist/device-host-worker.mjs +38 -18
- package/dist/{device-ios-6MewKKnc.mjs → device-ios-CRUqPxKw.mjs} +12 -11
- package/dist/{device-lease-Co-EwifR.mjs → device-lease-DHOBXGgS.mjs} +135 -22
- package/dist/{device-lease-run-w1xhCqIW.mjs → device-lease-run-CvDeHTkG.mjs} +4 -4
- package/dist/{device-pool-F5WvRPtD.mjs → device-pool-L2-5GxMy.mjs} +3 -3
- package/dist/{device-remote-tHbd1fKy.mjs → device-remote-Bmg42063.mjs} +17 -69
- package/dist/doctor-C2MSuMMg.mjs +515 -0
- package/dist/{doctor-B9ckYUoU.mjs → doctor-DPAqhVCK.mjs} +334 -721
- package/dist/doctor-watchman-CB4NnVZm.mjs +260 -0
- package/dist/{simslim-EHBQ2R4G.mjs → eas-build-Dw_ec2Km.mjs} +6 -152
- package/dist/{stim-installations-aR_WsNOA.mjs → eas-session-ledger-DZlC-Fq3.mjs} +57 -4
- package/dist/{error-diagnostics-BRXOqDzG.mjs → error-diagnostics-Du7I_GuY.mjs} +17 -12
- package/dist/errors-DzkMYh8Q.mjs +205 -0
- package/dist/{exec-DWhCZDGm.mjs → exec-B81Qodjn.mjs} +69 -15
- package/dist/{gc-Dh6mXOKC.mjs → gc-PWp34zGb.mjs} +23 -22
- package/dist/{gradle-C6GKnunQ.mjs → gradle-C2OEKCCI.mjs} +50 -125
- package/dist/{guide-tm6igAaa.mjs → guide-Dai9lphv.mjs} +862 -538
- package/dist/{hosted-android-Bv285t_t.mjs → hosted-android-DQ-Agsd8.mjs} +5 -5
- package/dist/{hosted-client-C-rMtppF.mjs → hosted-client-Io01s5By.mjs} +9 -3
- package/dist/{hosted-ios-D5mNmtj4.mjs → hosted-ios-DIxFnYp-.mjs} +3 -3
- package/dist/{hosted-logs-DN8Iz4mJ.mjs → hosted-logs-DP-ABU_M.mjs} +8 -8
- package/dist/{hosted-macos-B-wEjlwG.mjs → hosted-macos-Aziw9T_9.mjs} +7 -6
- package/dist/{hosted-native-DeeOG8xZ.mjs → hosted-native-BdAQi21M.mjs} +23 -16
- package/dist/{idle-shutdown-jjtxAn5C.mjs → idle-shutdown-DdMqoSUB.mjs} +7 -7
- package/dist/ios-BZ9dg2Fr.mjs +9 -0
- package/dist/{ios-B3SbOWdw.mjs → ios-CXLIUxXJ.mjs} +180 -24
- package/dist/ios-CZuv6gRv.mjs +1112 -0
- package/dist/{ios-Bvbf0SGY.mjs → ios-VGvNdsv2.mjs} +1 -1
- package/dist/{ios-device-Bn7jWDB1.mjs → ios-device-B1B14xND.mjs} +1 -1
- package/dist/{ios-device-vOaByMhw.mjs → ios-device-BreZOpM0.mjs} +3 -3
- package/dist/ios-project-B9drt_aY.mjs +197 -0
- package/dist/{ios-state-B2pES6Vs.mjs → ios-state-CjrL2qv-.mjs} +1 -1
- package/dist/js-swap-C8icNYIY.mjs +432 -0
- package/dist/launch-DxH0THLP.mjs +745 -0
- package/dist/launch-YrbqaIFj.mjs +1530 -0
- package/dist/{launch-verify-hskNcWkZ.mjs → launch-verify-BzRdbuO1.mjs} +26 -7
- package/dist/{logs-1Ylc1Ri6.mjs → logs-DHaRNfg7.mjs} +11 -11
- package/dist/macos-C0iljhsN.mjs +2 -0
- package/dist/{macos-DF6C7wUU.mjs → macos-V_3Ui7g4.mjs} +125 -155
- package/dist/macos-run.mjs +1 -1
- package/dist/maintenance-run.mjs +13 -10
- package/dist/{metro-Dh8T4Ytd.mjs → metro-D_j9sN-B.mjs} +209 -43
- package/dist/{metro-gateway-CEUw9RMH.mjs → metro-gateway-BBJldOdi.mjs} +2 -2
- package/dist/miss-reason-BPAzZS0r.mjs +238 -0
- package/dist/{named-ports-BFIz1Shz.mjs → named-ports-C2lvoPsb.mjs} +12 -5
- package/dist/native-android-lHzaew7r.mjs +226 -0
- package/dist/native-gradle-inputs-BQnIdAlL.mjs +356 -0
- package/dist/{native-runtime-D_603JiC.mjs → native-runtime-BRmWL7ru.mjs} +9 -8
- package/dist/native-xcode-inputs-eutS19jU.mjs +307 -0
- package/dist/native-xcode-ios-DP3cHLwu.mjs +434 -0
- package/dist/{ndjson-LGZAMsqa.mjs → ndjson-GOnbyvso.mjs} +6 -6
- package/dist/offload-worker.d.mts +12 -6
- package/dist/offload-worker.mjs +409 -73
- package/dist/{ownership-D6Se7gg_.mjs → ownership-DXzMMSx6.mjs} +2 -2
- package/dist/{placement-log-BcPhRwR4.mjs → placement-log-reFbjqEr.mjs} +7 -3
- package/dist/plan-BDk2AeY_.mjs +260 -0
- package/dist/plan-placement-D_YYlE6N.mjs +73 -0
- package/dist/{ports-BLTtfBq-.mjs → ports-jzvAJXXL.mjs} +3 -3
- package/dist/{prebuild-juCyreaR.mjs → prebuild-Bw44QxVh.mjs} +4 -4
- package/dist/{preview-D5V07Nrl.mjs → preview-BaBJ72Al.mjs} +51 -34
- package/dist/project-B8_duAzW.mjs +1067 -0
- package/dist/project-plan-BPwbLwQu.mjs +10 -0
- package/dist/{pull-request-u4vp7zmK.mjs → pull-request-vOhLNmIb.mjs} +1 -1
- package/dist/pull-requests.mjs +1 -1
- package/dist/react-native-android-chm1DMlA.mjs +921 -0
- package/dist/react-native-build-oAw6gQeW.mjs +239 -0
- package/dist/react-native-doctor-DYXoh-6I.mjs +78 -0
- package/dist/react-native-ios-SCTK_CT5.mjs +595 -0
- package/dist/{recordings-BAWltsVt.mjs → recordings-Bk-VivUV.mjs} +1 -1
- package/dist/{reload-DvyWzVjJ.mjs → reload-D34GkY78.mjs} +17 -14
- package/dist/remote-BU9UyhCJ.mjs +192 -0
- package/dist/{remote-cache-BGg7aGIZ.mjs → remote-cache-Bsts6f6Y.mjs} +5 -5
- package/dist/result-BDoRk1k3.mjs +186 -0
- package/dist/{run-vhtDgpHO.mjs → run-qvff78hv.mjs} +3 -3
- package/dist/{server-bare-B9E7S1aR.mjs → server-bare-dWjAarki.mjs} +6 -6
- package/dist/server-command-7XIKlWtO.mjs +69 -0
- package/dist/{server-expo-DoBHhuzK.mjs → server-expo-CsYu2aKL.mjs} +107 -82
- package/dist/server-expo-DV43vep4.mjs +2 -0
- package/dist/settings-Bbztm4oV.mjs +1503 -0
- package/dist/{settings-Byp2AQ_E.mjs → settings-CT3E71-i.mjs} +6 -7
- package/dist/{state-lKh8shBp.d.mts → settings-vk3mJGSm.d.mts} +4 -2
- package/dist/settings.schema.json +156 -6
- package/dist/simslim-ChMfe8rg.mjs +149 -0
- package/dist/{slot-launch-C1nqh4mu.mjs → slot-launch-B9hn96wd.mjs} +6 -6
- package/dist/{stage-g_WqWeaE.mjs → stage-BNKKdDNc.mjs} +6 -3
- package/dist/start-CbQCSnXQ.mjs +2 -0
- package/dist/{start-D-IeOyoK.mjs → start-CdvcTaXr.mjs} +113 -77
- package/dist/{state-xnqpx3AD.mjs → state-Boo0IMJq.mjs} +4 -2
- package/dist/{state-BG-aAk4k.mjs → state-DI84A-uu.mjs} +29 -10
- package/dist/{stats-DY6ekz8F.mjs → stats-BIIDrjA8.mjs} +6 -6
- package/dist/{status-BEeL6IKz.mjs → status-BDGHwkCs.mjs} +3 -1
- package/dist/{status-DCjZeE-K.mjs → status-DARMkc9q.mjs} +80 -294
- package/dist/status-watch-DvmI3SmN.mjs +296 -0
- package/dist/{stim-desktop-Behws_fi.mjs → stim-desktop-8GQX2OV8.mjs} +1 -1
- package/dist/{stop-DIJtD2GL.mjs → stop-CCZS-C9m.mjs} +2 -2
- package/dist/stop-WQPQHLuy.mjs +72 -0
- package/dist/{stop-BTjs3xbc.mjs → stop-iNemHsJC.mjs} +81 -33
- package/dist/supervisor-run.d.mts +7 -2
- package/dist/supervisor-run.mjs +32 -20
- package/dist/{support-Bwvbrq5-.mjs → support-CnE_SIjt.mjs} +17 -7
- package/dist/{support-BaayeYCf.mjs → support-DCco5fut.mjs} +61 -8
- package/dist/swiftpm-macos-afeNUExW.mjs +119 -0
- package/dist/{native-run-B06FkmZx.mjs → tailnet-CoJUb2tB.mjs} +113 -6
- package/dist/toolchain-BIupIro1.mjs +2 -0
- package/dist/{toolchain-Bnyd_K3A.mjs → toolchain-DqyDXs30.mjs} +225 -315
- package/dist/{trigger-CJMhwXe8.mjs → trigger-C0MWBi8O.mjs} +3 -3
- package/dist/trigger-SHLOWJ4O.mjs +2 -0
- package/dist/{warm-progress-CjB-MP6H.mjs → warm-progress-C3ASD6z5.mjs} +134 -37
- package/dist/{status-Dcr0Qexd.mjs → watchman-CQl51YZu.mjs} +75 -7
- package/dist/web-B3eldHFH.mjs +123 -0
- package/dist/web-BLXpOe6b.mjs +2 -0
- package/dist/web-run.mjs +10 -10
- package/dist/{workspace-state-C59dqG-Z.mjs → workspace-state-CSIFuuDa.mjs} +33 -33
- package/dist/{workspaces-xXItD8Dj.mjs → workspaces-D2xSHBDY.mjs} +1297 -1211
- package/dist/{worktree-BSYlofkq.mjs → worktree-BxDqaTev.mjs} +102 -63
- package/dist/worktree-q7_OZNY0.mjs +2 -0
- package/package.json +8 -6
- package/shim/bundle-response.cjs +2 -1
- package/shim/bundle-response.d.cts +1 -1
- package/shim/expo-metro-config.cjs +1 -1
- package/shim/native-android.gradle +101 -0
- package/dist/android-BKA16DTf.mjs +0 -4
- package/dist/android-BvwuMUJ9.mjs +0 -3572
- package/dist/guide-status-Bhf9SJXc.mjs +0 -125
- package/dist/ios-CPdkoKaa.mjs +0 -3953
- package/dist/ios-DNpdygiv.mjs +0 -7
- package/dist/macos-Ck7OBMNY.mjs +0 -2
- package/dist/metro-store-BAHFcJm6.mjs +0 -106
- package/dist/plan-placement-CtxkCO54.mjs +0 -1859
- package/dist/project-C3ChRLZy.mjs +0 -212
- package/dist/projects-DD7dBTCj.mjs +0 -92
- package/dist/server-expo-Db9HBUoa.mjs +0 -2
- package/dist/settings-CQyMElEP.mjs +0 -701
- package/dist/start-NTc1Ifqs.mjs +0 -2
- package/dist/stop-BGhKMOuH.mjs +0 -48
- package/dist/trigger-DWAq9hkw.mjs +0 -2
- package/dist/web-B6_bFDn7.mjs +0 -2
- package/dist/worktree-BJfnU6r5.mjs +0 -2
- package/dist/worktree-CsKYexJM.mjs +0 -753
|
@@ -1,42 +1,41 @@
|
|
|
1
1
|
import { t as process_identity_exports } from "./process-identity-Biv3arCO.mjs";
|
|
2
|
-
import { t as getExecutor } from "./exec-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { a as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { f as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import
|
|
23
|
-
import "./
|
|
24
|
-
import { i as
|
|
25
|
-
import {
|
|
26
|
-
import { r as
|
|
27
|
-
import { t as
|
|
28
|
-
import { n as maintenanceLines, r as maintenanceStatus } from "./status-BEeL6IKz.mjs";
|
|
2
|
+
import { t as getExecutor } from "./exec-B81Qodjn.mjs";
|
|
3
|
+
import { B as parseDeviceSlotKey, F as volumeRootFor, H as projectDeviceSlots, R as deviceSlotKey, _ as loadConfig$1, d as getConfigDir, j as formatBytes } from "./config-D0LhTY3S.mjs";
|
|
4
|
+
import { Et as repoRoot, bt as linkedWorktreesOnDisk, ht as gitCommonDirOnDisk, mt as gitCommonDir, q as resolveSettings } from "./settings-Bbztm4oV.mjs";
|
|
5
|
+
import { i as listLeaseFiles, r as leaseIsExpired, s as parseWorkspaceLeases } from "./device-lease-DHOBXGgS.mjs";
|
|
6
|
+
import { C as workspaceLogErrorIndex, r as readWorkspaceState$1, w as workspaceLogsDir$1 } from "./workspace-state-CSIFuuDa.mjs";
|
|
7
|
+
import { a as formatElapsed, i as formatDuration, r as clockTime, u as plural } from "./command-output-BjPN99ZB.mjs";
|
|
8
|
+
import { F as readWorkspaceLaunches, N as readRemoteSession, _ as detectIsExpo, c as projectShortcut, i as findServerWorkspace, j as readMetroTunnel, l as detectPlatforms, v as detectTutorial, x as readAppJson } from "./project-B8_duAzW.mjs";
|
|
9
|
+
import { F as ownedAvdDeviceProfile, O as listAdbDevices, at as POOL_SETTING_REMEDY, dt as parkedMaxSetting, ft as readParked, z as ownedAvdSerialResolver } from "./android-BsYNR81W.mjs";
|
|
10
|
+
import { a as listeningPidsByPort, c as processCwd, i as listeningPids, l as processCwds, p as isMetroRunning, s as pidExists, u as resolveProjectMetro } from "./metro-D_j9sN-B.mjs";
|
|
11
|
+
import { P as resolveSupervisorTarget } from "./workspaces-D2xSHBDY.mjs";
|
|
12
|
+
import { Ct as bundlingActivity, It as statsProjectKey$1, Mt as readStats$1, St as buildStatusLine, Tt as parseActiveBuild, bt as activeBuildState, it as readFootprints, mt as metroLastStop, o as machineNumber, rt as attributeMachineUsage, ut as describeMetroLastStop, vt as ACTIVE_BUILD_KEY, xt as buildReport } from "./budget-BONq9vXY.mjs";
|
|
13
|
+
import { a as parseNdjsonLine } from "./ndjson-GOnbyvso.mjs";
|
|
14
|
+
import { a as readWebPage, o as readWebRecord, u as webFacts } from "./state-DI84A-uu.mjs";
|
|
15
|
+
import { C as statusActivity, E as withWebFacts, S as remoteDeviceState, T as unprovisionedWorktrees, _ as gitSummaryText, b as poolLine, c as activityLabel, d as capacity, f as deviceLeaseLines, h as environmentState, l as addReverseMissingIssue, m as diskLine, p as deviceLeaseStates, u as applyMachineMemory, v as metroReverseTargets, w as tightVolumes, x as remoteDeviceLine, y as parseDfFree } from "./watchman-CQl51YZu.mjs";
|
|
16
|
+
import { d as readWebActivity, f as tailLines, i as createDeviceProcessTables, r as createActivityReader } from "./activity-BrGh9EAI.mjs";
|
|
17
|
+
import { b as parseSimctlList, f as listAllIosSimsAsync } from "./ios-CXLIUxXJ.mjs";
|
|
18
|
+
import { m as hasMetroReverse } from "./app-install-0LgaQRT7.mjs";
|
|
19
|
+
import { u as probeHostedSession } from "./hosted-client-Io01s5By.mjs";
|
|
20
|
+
import { r as readEasSessionLedger$1 } from "./eas-session-ledger-DZlC-Fq3.mjs";
|
|
21
|
+
import { d as readIosDevices, s as isReachable } from "./ios-device-BreZOpM0.mjs";
|
|
22
|
+
import "./hosted-macos-Aziw9T_9.mjs";
|
|
23
|
+
import { i as readSupervisorState } from "./stop-iNemHsJC.mjs";
|
|
24
|
+
import { i as createStatusMeasurer, n as workspacePhase, r as applyStatusMeasures, s as mergeState } from "./warm-progress-C3ASD6z5.mjs";
|
|
25
|
+
import { r as workspaceRecordingEnabled } from "./recordings-Bk-VivUV.mjs";
|
|
26
|
+
import { n as maintenanceLines, r as maintenanceStatus } from "./status-BDGHwkCs.mjs";
|
|
27
|
+
import { a as watchStatusSources, i as watchPayload, n as WATCH_LIGHT_INTERVAL_MS, r as createRefreshScheduler, t as WATCH_FALLBACK_MS } from "./status-watch-DvmI3SmN.mjs";
|
|
29
28
|
import { t as watchStdoutReader } from "./stdout-reader-C8yjre1x.mjs";
|
|
30
|
-
import { t as triggerMaintenance } from "./trigger-
|
|
31
|
-
import { mkdirSync, readFileSync,
|
|
29
|
+
import { t as triggerMaintenance } from "./trigger-C0MWBi8O.mjs";
|
|
30
|
+
import { mkdirSync, readFileSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
32
31
|
import { join, posix, resolve } from "node:path";
|
|
33
32
|
import { basename as basename$1, dirname as dirname$1, join as join$1 } from "path";
|
|
34
33
|
import { DEVICE_RECLAIM_REASON, ERROR_SOURCES, archiveRoot, archivedUsage, bundleMarkerPlatform, countErrorEntries, gitMergeCacheDir, hostedAndroidPlacements, hostedAndroidRecords, hostedAndroidStatus, hostedIosPlacements, hostedIosRecords, hostedIosStatus, linkReplacedArchives, logFiles, macosAppState, parseHostedAndroidPlacement, parseHostedIosPlacement, queryLogs, readArchives, readBuildDetail, readBuildHistory, readDeviceIdleShutdowns, readDevicePlacement, readIdleStop, readLastBuilds, readMacosRecord, recordMatches, sortByTs, unreadableHostedAndroid, unreadableHostedIos, withDerivedFacts, withGitChip, withStateReadCache } from "@stim-cli/core/state";
|
|
35
|
-
import chalk from "chalk";
|
|
36
34
|
import { closeSync as closeSync$1, existsSync as existsSync$1, fstatSync as fstatSync$1, openSync as openSync$1, readFileSync as readFileSync$1, readSync as readSync$1, renameSync as renameSync$1, rmSync as rmSync$1, statSync as statSync$1, writeFileSync as writeFileSync$1 } from "fs";
|
|
37
35
|
import { rotatedLogPath } from "@stim-cli/core";
|
|
38
36
|
import { homedir, totalmem } from "os";
|
|
39
37
|
import { createHash, randomUUID } from "node:crypto";
|
|
38
|
+
import chalk from "chalk";
|
|
40
39
|
//#region src/device-host/hosted-native-status.ts
|
|
41
40
|
function hostedNativeProbe(placement, probe, slot, platform) {
|
|
42
41
|
const label = platform === "ios" ? "iOS" : "Android";
|
|
@@ -118,252 +117,6 @@ async function readHostedMacosStatus(record, options) {
|
|
|
118
117
|
return applyHostedMacosProbe(record, await probeHostedSession(record.host, options));
|
|
119
118
|
}
|
|
120
119
|
//#endregion
|
|
121
|
-
//#region src/status-watch.ts
|
|
122
|
-
const WATCH_FALLBACK_MS = 3e4;
|
|
123
|
-
const WATCH_LIGHT_INTERVAL_MS = 15e3;
|
|
124
|
-
const WATCH_SIMCTL_INTERVAL_MS = 5e3;
|
|
125
|
-
const ADB_RESTART_MIN_MS = 1e3;
|
|
126
|
-
const ADB_RESTART_MAX_MS = 6e4;
|
|
127
|
-
const SIMCTL_TIMEOUT_MS = 1e4;
|
|
128
|
-
/**
|
|
129
|
-
* Coalesces change signals into refreshes: a burst of full triggers runs `run('full')` once after `debounceMs` of
|
|
130
|
-
* quiet, at most one run is in flight, and a trigger that arrives during a run causes exactly one more run after it.
|
|
131
|
-
* A `light` trigger runs `run('light')` no sooner than `debounceMs` from the trigger and `lightIntervalMs` from the
|
|
132
|
-
* start of the previous run, unless a queued full run covers it; later light triggers do not postpone it.
|
|
133
|
-
*/
|
|
134
|
-
function createRefreshScheduler({ debounceMs, lightIntervalMs = 0, run }) {
|
|
135
|
-
let timer = null;
|
|
136
|
-
let queued = "full";
|
|
137
|
-
let running = false;
|
|
138
|
-
let pending = null;
|
|
139
|
-
let stopped = false;
|
|
140
|
-
let lastRunAt = -Infinity;
|
|
141
|
-
const fire = async () => {
|
|
142
|
-
timer = null;
|
|
143
|
-
running = true;
|
|
144
|
-
lastRunAt = Date.now();
|
|
145
|
-
try {
|
|
146
|
-
await run(queued);
|
|
147
|
-
} finally {
|
|
148
|
-
running = false;
|
|
149
|
-
if (pending) {
|
|
150
|
-
const next = pending;
|
|
151
|
-
pending = null;
|
|
152
|
-
trigger(next);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
function trigger(kind = "full", delayMs = debounceMs) {
|
|
157
|
-
if (stopped) return;
|
|
158
|
-
if (running) {
|
|
159
|
-
pending = pending === "full" ? "full" : kind;
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
if (kind === "light") {
|
|
163
|
-
if (timer) return;
|
|
164
|
-
queued = "light";
|
|
165
|
-
timer = setTimeout(() => void fire(), Math.max(delayMs, lastRunAt + lightIntervalMs - Date.now()));
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
if (timer) clearTimeout(timer);
|
|
169
|
-
queued = "full";
|
|
170
|
-
timer = setTimeout(() => void fire(), delayMs);
|
|
171
|
-
}
|
|
172
|
-
return {
|
|
173
|
-
trigger,
|
|
174
|
-
stop() {
|
|
175
|
-
stopped = true;
|
|
176
|
-
if (timer) clearTimeout(timer);
|
|
177
|
-
timer = null;
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* Which refresh a change to `name` in a watched `$STIM_HOME` directory needs: `light` for a log append or a running
|
|
183
|
-
* build's detail, which can change only the log-derived fields, `full` for anything else that can change the payload,
|
|
184
|
-
* null for none. A null name means the platform did not report one.
|
|
185
|
-
*/
|
|
186
|
-
function statusChange(dir, name) {
|
|
187
|
-
if (dir === "archive" && (name?.startsWith(".incoming-") || name?.startsWith(".removing-") || name?.startsWith(".lock"))) return null;
|
|
188
|
-
if (name?.includes(".lock")) return null;
|
|
189
|
-
if (dir === "logs") return "light";
|
|
190
|
-
if (name === null) return "full";
|
|
191
|
-
switch (dir) {
|
|
192
|
-
case "home":
|
|
193
|
-
if (name === "maintenance") return "light";
|
|
194
|
-
return name.startsWith("config.json") || name === "archive" || name === "workspaces" || name === "device-locks" ? "full" : null;
|
|
195
|
-
case "workspace":
|
|
196
|
-
if (name.startsWith("build-detail.json")) return "light";
|
|
197
|
-
return name.startsWith("state.json") || name.startsWith("ended-agents.json") || name === "logs" ? "full" : null;
|
|
198
|
-
case "maintenance": return name === "state.json" ? "light" : null;
|
|
199
|
-
case "eas": return name.startsWith("sessions.json") ? "full" : null;
|
|
200
|
-
default: return "full";
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
/** A stable summary of every simulator's state, or null when the listing is unreadable. */
|
|
204
|
-
function simulatorSignature(simctlJson) {
|
|
205
|
-
try {
|
|
206
|
-
return parseSimctlList(simctlJson, { includeUnavailable: true }).map((sim) => `${sim.udid}:${sim.state}`).toSorted().join(",");
|
|
207
|
-
} catch {
|
|
208
|
-
return null;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
/**
|
|
212
|
-
* Calls `onChange` when anything `stim status` reports may have changed:
|
|
213
|
-
* `$STIM_HOME` files, adb device arrivals and departures, and simulator
|
|
214
|
-
* state. simctl has no push API reachable from Node, so it is polled.
|
|
215
|
-
*/
|
|
216
|
-
function watchStatusSources({ home, onChange, platform = process.platform, simctlIntervalMs = WATCH_SIMCTL_INTERVAL_MS }) {
|
|
217
|
-
let stopped = false;
|
|
218
|
-
const watchers = /* @__PURE__ */ new Map();
|
|
219
|
-
const desiredDirs = () => {
|
|
220
|
-
const dirs = /* @__PURE__ */ new Map([
|
|
221
|
-
[home, "home"],
|
|
222
|
-
[join(home, "archive"), "archive"],
|
|
223
|
-
[join(home, "workspaces"), "workspaces"],
|
|
224
|
-
[join(home, "maintenance"), "maintenance"],
|
|
225
|
-
[join(home, "device-locks"), "leases"],
|
|
226
|
-
[easMachineStateRoot$1(), "eas"]
|
|
227
|
-
]);
|
|
228
|
-
let names = [];
|
|
229
|
-
try {
|
|
230
|
-
names = readdirSync(join(home, "workspaces"));
|
|
231
|
-
} catch {}
|
|
232
|
-
for (const name of names) {
|
|
233
|
-
const dir = join(home, "workspaces", name);
|
|
234
|
-
dirs.set(dir, "workspace");
|
|
235
|
-
dirs.set(join(dir, "logs"), "logs");
|
|
236
|
-
}
|
|
237
|
-
return dirs;
|
|
238
|
-
};
|
|
239
|
-
const reconcile = () => {
|
|
240
|
-
if (stopped) return;
|
|
241
|
-
const desired = desiredDirs();
|
|
242
|
-
for (const [dir, watcher] of watchers) if (!desired.has(dir)) {
|
|
243
|
-
watcher.close();
|
|
244
|
-
watchers.delete(dir);
|
|
245
|
-
}
|
|
246
|
-
for (const [dir, kind] of desired) {
|
|
247
|
-
if (watchers.has(dir)) continue;
|
|
248
|
-
try {
|
|
249
|
-
const watcher = watch(dir, (_event, name) => {
|
|
250
|
-
const change = statusChange(kind, name === null ? null : String(name));
|
|
251
|
-
if (!change) return;
|
|
252
|
-
if (kind === "home" || kind === "workspaces" || kind === "workspace") {
|
|
253
|
-
listingStaleBefore = Date.now();
|
|
254
|
-
reconcile();
|
|
255
|
-
}
|
|
256
|
-
onChange(change);
|
|
257
|
-
});
|
|
258
|
-
watcher.on("error", () => {
|
|
259
|
-
watcher.close();
|
|
260
|
-
watchers.delete(dir);
|
|
261
|
-
});
|
|
262
|
-
watchers.set(dir, watcher);
|
|
263
|
-
} catch {}
|
|
264
|
-
}
|
|
265
|
-
};
|
|
266
|
-
const adb = trackAdbDevices(() => onChange("full"));
|
|
267
|
-
let simctl = null;
|
|
268
|
-
let listing = null;
|
|
269
|
-
let listingStaleBefore = 0;
|
|
270
|
-
let simTimer = null;
|
|
271
|
-
if (platform === "darwin") {
|
|
272
|
-
let last = null;
|
|
273
|
-
const check = () => {
|
|
274
|
-
if (simctl || stopped) return;
|
|
275
|
-
const startedAt = Date.now();
|
|
276
|
-
let out = "";
|
|
277
|
-
const child = getExecutor().spawn("xcrun", [
|
|
278
|
-
"simctl",
|
|
279
|
-
"list",
|
|
280
|
-
"devices",
|
|
281
|
-
"--json"
|
|
282
|
-
], {
|
|
283
|
-
stdio: [
|
|
284
|
-
"ignore",
|
|
285
|
-
"pipe",
|
|
286
|
-
"ignore"
|
|
287
|
-
],
|
|
288
|
-
timeout: SIMCTL_TIMEOUT_MS,
|
|
289
|
-
killSignal: "SIGKILL"
|
|
290
|
-
});
|
|
291
|
-
simctl = child;
|
|
292
|
-
child.stdout?.on("data", (chunk) => out += chunk.toString());
|
|
293
|
-
child.on("error", () => {
|
|
294
|
-
simctl = null;
|
|
295
|
-
});
|
|
296
|
-
child.on("close", () => {
|
|
297
|
-
simctl = null;
|
|
298
|
-
const signature = simulatorSignature(out);
|
|
299
|
-
if (signature === null || stopped) return;
|
|
300
|
-
listing = {
|
|
301
|
-
at: startedAt,
|
|
302
|
-
json: out
|
|
303
|
-
};
|
|
304
|
-
if (last !== null && signature !== last) onChange("full");
|
|
305
|
-
last = signature;
|
|
306
|
-
});
|
|
307
|
-
};
|
|
308
|
-
check();
|
|
309
|
-
simTimer = setInterval(check, simctlIntervalMs);
|
|
310
|
-
}
|
|
311
|
-
reconcile();
|
|
312
|
-
return {
|
|
313
|
-
reconcile,
|
|
314
|
-
simulatorListing: () => listing && listing.at > listingStaleBefore && Date.now() - listing.at <= 2 * simctlIntervalMs ? listing.json : null,
|
|
315
|
-
stop() {
|
|
316
|
-
stopped = true;
|
|
317
|
-
for (const watcher of watchers.values()) watcher.close();
|
|
318
|
-
watchers.clear();
|
|
319
|
-
if (simTimer) clearInterval(simTimer);
|
|
320
|
-
simctl?.kill("SIGKILL");
|
|
321
|
-
adb.stop();
|
|
322
|
-
}
|
|
323
|
-
};
|
|
324
|
-
}
|
|
325
|
-
/**
|
|
326
|
-
* Runs `adb track-devices` and calls `onChange` on every device list it
|
|
327
|
-
* reports. adb exits when its server restarts, so the tracker restarts with a
|
|
328
|
-
* doubling delay that resets once a run lasts a minute.
|
|
329
|
-
*/
|
|
330
|
-
function trackAdbDevices(onChange) {
|
|
331
|
-
const exec = getExecutor();
|
|
332
|
-
const resolved = androidToolPath("adb");
|
|
333
|
-
const adb = resolved === "adb" ? exec.findExecutable("adb") : resolved;
|
|
334
|
-
if (!adb) return { stop() {} };
|
|
335
|
-
let child = null;
|
|
336
|
-
let restart = null;
|
|
337
|
-
let delay = ADB_RESTART_MIN_MS;
|
|
338
|
-
let stopped = false;
|
|
339
|
-
const start = () => {
|
|
340
|
-
restart = null;
|
|
341
|
-
if (stopped) return;
|
|
342
|
-
const startedAt = Date.now();
|
|
343
|
-
const current = exec.spawn(adb, ["track-devices"], { stdio: [
|
|
344
|
-
"ignore",
|
|
345
|
-
"pipe",
|
|
346
|
-
"ignore"
|
|
347
|
-
] });
|
|
348
|
-
child = current;
|
|
349
|
-
current.stdout?.on("data", () => onChange());
|
|
350
|
-
current.on("error", () => {});
|
|
351
|
-
current.on("close", () => {
|
|
352
|
-
if (child === current) child = null;
|
|
353
|
-
if (stopped) return;
|
|
354
|
-
if (Date.now() - startedAt >= ADB_RESTART_MAX_MS) delay = ADB_RESTART_MIN_MS;
|
|
355
|
-
restart = setTimeout(start, delay);
|
|
356
|
-
delay = Math.min(delay * 2, ADB_RESTART_MAX_MS);
|
|
357
|
-
});
|
|
358
|
-
};
|
|
359
|
-
start();
|
|
360
|
-
return { stop() {
|
|
361
|
-
stopped = true;
|
|
362
|
-
if (restart) clearTimeout(restart);
|
|
363
|
-
child?.kill("SIGTERM");
|
|
364
|
-
} };
|
|
365
|
-
}
|
|
366
|
-
//#endregion
|
|
367
120
|
//#region src/diagnostics/error-index.ts
|
|
368
121
|
const INDEX_VERSION = 7;
|
|
369
122
|
const HEAD_BYTES = 1024;
|
|
@@ -556,6 +309,7 @@ function writeIndex(file, index) {
|
|
|
556
309
|
//#endregion
|
|
557
310
|
//#region src/workspace/git-summary.ts
|
|
558
311
|
const GIT_TIMEOUT_MS = 3e3;
|
|
312
|
+
const GIT_CONCURRENCY = 6;
|
|
559
313
|
const MERGE_BUDGET_MS = 250;
|
|
560
314
|
const MERGE_TIMEOUT_BACKOFF_MS = 3e5;
|
|
561
315
|
const ORIGIN_PREFIX = "refs/remotes/origin/";
|
|
@@ -596,7 +350,11 @@ function inPrivacyProtectedFolder(path, home) {
|
|
|
596
350
|
"Library/CloudStorage"
|
|
597
351
|
].map((dir) => posix.join(home, dir)), "/Volumes"].some((dir) => path === dir || path.startsWith(`${dir}/`));
|
|
598
352
|
}
|
|
353
|
+
const gitQueue = [];
|
|
354
|
+
let gitRunning = 0;
|
|
599
355
|
async function git(path, args) {
|
|
356
|
+
if (gitRunning < GIT_CONCURRENCY) gitRunning++;
|
|
357
|
+
else await new Promise((proceed) => gitQueue.push(proceed));
|
|
600
358
|
try {
|
|
601
359
|
return await getExecutor().runFileAsync("git", [
|
|
602
360
|
"--no-optional-locks",
|
|
@@ -606,6 +364,10 @@ async function git(path, args) {
|
|
|
606
364
|
], { timeoutMs: GIT_TIMEOUT_MS });
|
|
607
365
|
} catch {
|
|
608
366
|
return null;
|
|
367
|
+
} finally {
|
|
368
|
+
const next = gitQueue.shift();
|
|
369
|
+
if (next) next();
|
|
370
|
+
else gitRunning--;
|
|
609
371
|
}
|
|
610
372
|
}
|
|
611
373
|
async function defaultBranchOf(repository) {
|
|
@@ -752,7 +514,7 @@ function gitFilesStamp(worktree, refs) {
|
|
|
752
514
|
};
|
|
753
515
|
}
|
|
754
516
|
/**
|
|
755
|
-
* Reads every worktree's git summary
|
|
517
|
+
* Reads every worktree's git summary, at most six git calls at a time, each bounded by a timeout once it starts. A worktree `skip` rejects, or
|
|
756
518
|
* one git cannot answer in time, maps to null. After every read, merge verdicts missing from the cache are judged one
|
|
757
519
|
* at a time; no new judgement starts 250 ms after the first, and a verdict for the same HEAD judged at an older
|
|
758
520
|
* default-branch commit stands in, because a merged branch stays merged. A judgement that timed out is not retried
|
|
@@ -791,7 +553,8 @@ async function readWorktreeGit(worktrees, { skip, maxAgeMs = 0 }) {
|
|
|
791
553
|
status: out === null ? null : parseGitStatus(out),
|
|
792
554
|
target,
|
|
793
555
|
files,
|
|
794
|
-
refs
|
|
556
|
+
refs,
|
|
557
|
+
at: Date.now()
|
|
795
558
|
};
|
|
796
559
|
}));
|
|
797
560
|
const budget = {};
|
|
@@ -803,7 +566,7 @@ async function readWorktreeGit(worktrees, { skip, maxAgeMs = 0 }) {
|
|
|
803
566
|
}
|
|
804
567
|
if (!read.status) {
|
|
805
568
|
if (read.files?.missing) recent.set(read.path, {
|
|
806
|
-
at:
|
|
569
|
+
at: read.at,
|
|
807
570
|
files: read.files.stamp,
|
|
808
571
|
refs: read.refs,
|
|
809
572
|
git: null
|
|
@@ -823,7 +586,7 @@ async function readWorktreeGit(worktrees, { skip, maxAgeMs = 0 }) {
|
|
|
823
586
|
};
|
|
824
587
|
const settled = !merge?.deferred && refs.upstream === read.refs.upstream && refs.target === read.refs.target;
|
|
825
588
|
recent.set(read.path, {
|
|
826
|
-
at:
|
|
589
|
+
at: read.at,
|
|
827
590
|
files: settled ? read.files?.stamp ?? null : null,
|
|
828
591
|
refs,
|
|
829
592
|
git: summary
|
|
@@ -1100,6 +863,14 @@ function androidStatusLines(record, slotLabel) {
|
|
|
1100
863
|
if (record?.host?.agent.driver === "agent-device") out.push(chalk.dim(` agent: ${record.host.agent.command}`));
|
|
1101
864
|
return out;
|
|
1102
865
|
}
|
|
866
|
+
function doctorRunTimes(proj) {
|
|
867
|
+
const runs = {};
|
|
868
|
+
for (const platform of ["ios", "android"]) {
|
|
869
|
+
const at = proj.doctorRuns?.[platform]?.at;
|
|
870
|
+
if (typeof at === "string") runs[platform] = { at };
|
|
871
|
+
}
|
|
872
|
+
return Object.keys(runs).length ? runs : void 0;
|
|
873
|
+
}
|
|
1103
874
|
function formatGb(mb) {
|
|
1104
875
|
return `${(mb / 1024).toFixed(1)} GB`;
|
|
1105
876
|
}
|
|
@@ -1133,7 +904,8 @@ async function readStatusFacts(gitMaxAgeMs, simctlListing, cachedArchives) {
|
|
|
1133
904
|
};
|
|
1134
905
|
}));
|
|
1135
906
|
processes.catch(() => {});
|
|
1136
|
-
const
|
|
907
|
+
const watching = gitMaxAgeMs > 0;
|
|
908
|
+
const gitRead = watching ? readGitInto(worktrees, orphanWorktrees, gitMaxAgeMs) : null;
|
|
1137
909
|
const androidRuntimeOf = androidRuntimeReader();
|
|
1138
910
|
const devices = projects.map(([, proj]) => ({
|
|
1139
911
|
androidRuntimes: Object.fromEntries(projectDeviceSlots(proj).slice(1).map(({ slot, platforms }) => [slot, platforms.android?.owned && platforms.android.avdName ? androidRuntimeOf(platforms.android.avdName) : null])),
|
|
@@ -1247,15 +1019,23 @@ async function readStatusFacts(gitMaxAgeMs, simctlListing, cachedArchives) {
|
|
|
1247
1019
|
state.live ||= macos.state === "running" || macos.state === "orphaned" || macos.build.state === "running";
|
|
1248
1020
|
}
|
|
1249
1021
|
Object.assign(state, builds, workspacePhase(state.live, saved, { now: leaseNow }), {
|
|
1250
|
-
platforms:
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1022
|
+
platforms: (() => {
|
|
1023
|
+
const context = {
|
|
1024
|
+
projectPath: path,
|
|
1025
|
+
gitCommonDir: gitCommonDirOnDisk(path),
|
|
1026
|
+
repoRoot: state.worktree?.path ?? path
|
|
1027
|
+
};
|
|
1028
|
+
return detectPlatforms(path, {
|
|
1029
|
+
context,
|
|
1030
|
+
settings: resolveSettings(context)
|
|
1031
|
+
});
|
|
1032
|
+
})(),
|
|
1255
1033
|
recording: { enabled: workspaceRecordingEnabled(path, proj, cfg, process.env) }
|
|
1256
1034
|
});
|
|
1257
1035
|
const tutorial = detectTutorial(readAppJson(path));
|
|
1258
1036
|
if (tutorial) state.tutorial = tutorial;
|
|
1037
|
+
const doctorRuns = doctorRunTimes(proj);
|
|
1038
|
+
if (doctorRuns) state.doctorRuns = doctorRuns;
|
|
1259
1039
|
}
|
|
1260
1040
|
const physicalDevices = physicalDeviceStates(leaseFiles, parseWorkspaceLeases(saved?.deviceLeases), {
|
|
1261
1041
|
root: path,
|
|
@@ -1266,6 +1046,7 @@ async function readStatusFacts(gitMaxAgeMs, simctlListing, cachedArchives) {
|
|
|
1266
1046
|
if (state && physicalDevices.length) state.physicalDevices = physicalDevices;
|
|
1267
1047
|
labelOnlyRoots.push(Boolean(proj.worktreeRoot && !proj.bundleId && !state?.metro && !state?.ios && !state?.android && !state?.web && !state?.macos));
|
|
1268
1048
|
}
|
|
1049
|
+
if (!watching) await readGitInto(worktrees, orphanWorktrees, gitMaxAgeMs, new Set(states.flatMap((state) => state.live && state.worktree ? [state.worktree.path] : [])));
|
|
1269
1050
|
applyStatusMeasures(states, worktrees);
|
|
1270
1051
|
readLogDerivedFacts(states);
|
|
1271
1052
|
const tables = createDeviceProcessTables();
|
|
@@ -1351,6 +1132,8 @@ function readLogDerivedFacts(states) {
|
|
|
1351
1132
|
const detail = record.phase === "compile" ? readBuildDetail(state.path, record.claim.claimId) : null;
|
|
1352
1133
|
if (detail) state.build.detail = detail;
|
|
1353
1134
|
else delete state.build.detail;
|
|
1135
|
+
const activity = bundlingActivity(state.build.activity, state.build.platform, state.metro?.bundle);
|
|
1136
|
+
if (activity) state.build.activity = activity;
|
|
1354
1137
|
}
|
|
1355
1138
|
}
|
|
1356
1139
|
}
|
|
@@ -1407,7 +1190,7 @@ async function refreshLightFacts(snapshot, machine) {
|
|
|
1407
1190
|
busy: true
|
|
1408
1191
|
});
|
|
1409
1192
|
}
|
|
1410
|
-
function renderStatus({ archived, archivedUsage: usage, projects, states, labelOnlyRoots, leases, leaseNow, orphanWorktrees, simsAvailable, simctlError, cwdRoot, machine }, json) {
|
|
1193
|
+
function renderStatus({ archived, archivedUsage: usage, projects, states, labelOnlyRoots, leases, leaseNow, orphanWorktrees, simsAvailable, simctlError, cwdRoot, machine }, json, settle = (payload) => payload) {
|
|
1411
1194
|
const out = [];
|
|
1412
1195
|
const totalMemoryMb = Math.round(totalmem() / 1048576);
|
|
1413
1196
|
const cap = capacity(states, totalMemoryMb);
|
|
@@ -1424,7 +1207,7 @@ function renderStatus({ archived, archivedUsage: usage, projects, states, labelO
|
|
|
1424
1207
|
});
|
|
1425
1208
|
const maintenance = maintenanceStatus();
|
|
1426
1209
|
if (json) {
|
|
1427
|
-
|
|
1210
|
+
const payload = {
|
|
1428
1211
|
environments: states.map((state, i) => withDerivedFacts(labelOnlyRoots[i] ? {
|
|
1429
1212
|
...state,
|
|
1430
1213
|
labelOnly: true
|
|
@@ -1437,7 +1220,8 @@ function renderStatus({ archived, archivedUsage: usage, projects, states, labelO
|
|
|
1437
1220
|
simctlAvailable: simsAvailable,
|
|
1438
1221
|
machine,
|
|
1439
1222
|
maintenance
|
|
1440
|
-
}
|
|
1223
|
+
};
|
|
1224
|
+
out.push(JSON.stringify(settle(payload)));
|
|
1441
1225
|
return out;
|
|
1442
1226
|
}
|
|
1443
1227
|
out.push(...maintenanceLines(maintenance).map((line) => chalk.dim(line)));
|
|
@@ -1541,6 +1325,7 @@ function renderStatus({ archived, archivedUsage: usage, projects, states, labelO
|
|
|
1541
1325
|
}
|
|
1542
1326
|
async function watchStatus(json) {
|
|
1543
1327
|
let last = null;
|
|
1328
|
+
let lastPayload = null;
|
|
1544
1329
|
let archiveStamp = null;
|
|
1545
1330
|
let archives;
|
|
1546
1331
|
let snapshot = null;
|
|
@@ -1552,6 +1337,7 @@ async function watchStatus(json) {
|
|
|
1552
1337
|
run: async (kind) => {
|
|
1553
1338
|
triggerMaintenance("status-watch");
|
|
1554
1339
|
let text;
|
|
1340
|
+
let payload = null;
|
|
1555
1341
|
try {
|
|
1556
1342
|
if (kind === "light" && snapshot) await refreshLightFacts(snapshot, json);
|
|
1557
1343
|
else {
|
|
@@ -1566,7 +1352,7 @@ async function watchStatus(json) {
|
|
|
1566
1352
|
snapshot = await readStatus(WATCH_GIT_MAX_AGE_MS, sources?.simulatorListing(), archives);
|
|
1567
1353
|
}
|
|
1568
1354
|
measurer.schedule(snapshot.states, snapshot.worktrees);
|
|
1569
|
-
text = renderStatus(snapshot, json).join("\n");
|
|
1355
|
+
text = renderStatus(snapshot, json, (full) => payload = watchPayload(lastPayload, full)).join("\n");
|
|
1570
1356
|
} catch (error) {
|
|
1571
1357
|
console.error(chalk.red(String(error?.message || error)));
|
|
1572
1358
|
return;
|
|
@@ -1575,6 +1361,7 @@ async function watchStatus(json) {
|
|
|
1575
1361
|
}
|
|
1576
1362
|
if (text === last) return;
|
|
1577
1363
|
last = text;
|
|
1364
|
+
lastPayload = payload;
|
|
1578
1365
|
process.stdout.write(`${!json && process.stdout.isTTY ? "\x1B[2J\x1B[H" : ""}${text}\n`);
|
|
1579
1366
|
}
|
|
1580
1367
|
});
|
|
@@ -1598,11 +1385,11 @@ async function watchStatus(json) {
|
|
|
1598
1385
|
scheduler.trigger("full", 0);
|
|
1599
1386
|
await new Promise(() => {});
|
|
1600
1387
|
}
|
|
1601
|
-
async function readGitInto(worktrees, orphans, maxAgeMs) {
|
|
1388
|
+
async function readGitInto(worktrees, orphans, maxAgeMs, only) {
|
|
1602
1389
|
const home = homedir();
|
|
1603
1390
|
const byPath = await readWorktreeGit(worktrees, {
|
|
1604
1391
|
maxAgeMs,
|
|
1605
|
-
skip: (w) => process.platform === "darwin" && orphans.includes(w) && inPrivacyProtectedFolder(w.path, home)
|
|
1392
|
+
skip: (w) => only !== void 0 && !only.has(w.path) || process.platform === "darwin" && orphans.includes(w) && inPrivacyProtectedFolder(w.path, home)
|
|
1606
1393
|
});
|
|
1607
1394
|
for (const worktree of worktrees) worktree.git = byPath.get(worktree.path) ?? null;
|
|
1608
1395
|
}
|
|
@@ -1789,8 +1576,7 @@ function readVolumes(projectPath) {
|
|
|
1789
1576
|
])];
|
|
1790
1577
|
const volumes = [];
|
|
1791
1578
|
for (const volume of roots) {
|
|
1792
|
-
const
|
|
1793
|
-
const disk = parseDfFree(getExecutor().runQuiet(`df -k ${quoted}`, { timeoutMs: 5e3 }));
|
|
1579
|
+
const disk = parseDfFree(getExecutor().runFileQuiet("df", ["-k", volume], { timeoutMs: 5e3 }));
|
|
1794
1580
|
if (disk) volumes.push({
|
|
1795
1581
|
volume,
|
|
1796
1582
|
disk
|