stim 1.24.0 → 1.26.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 +1 -1
- package/dist/{acquire-artifact-CEs02U2o.mjs → acquire-artifact-DVsvSwf7.mjs} +1 -1
- package/dist/{act-Cyvm8xYc.mjs → act-C-BqJEpu.mjs} +158 -36
- package/dist/{activity-Dq3ZcdD8.mjs → activity-Lnb_EoRY.mjs} +4 -5
- package/dist/{agent-device-usage-output-CccomeE0.mjs → agent-device-usage-output-DbXy5tg8.mjs} +4 -4
- package/dist/{android-CX5IcRuf.mjs → android-B5P81yI-.mjs} +1 -1
- package/dist/{android-DcztblCT.mjs → android-CSbLRD53.mjs} +5 -5
- package/dist/{android-BZppyPe_.mjs → android-CiNQw3kq.mjs} +81 -52
- package/dist/{android-882m4hxX.mjs → android-DTAcRwBC.mjs} +81 -34
- package/dist/{android-cas-BtCOrNqb.mjs → android-cas-BTVhZ0Qs.mjs} +4 -4
- package/dist/{android-project-DVWyCbWU.d.mts → android-project-DUGMbq28.d.mts} +61 -3
- package/dist/api.d.mts +8 -5
- package/dist/api.mjs +27 -27
- package/dist/apk-signed-tail-B46U9hXc.mjs +142 -0
- package/dist/{artifact-BR5VNArK.mjs → artifact-BxREhAaV.mjs} +25 -19
- package/dist/{artifact-Bdt_n9Jc.mjs → artifact-CsAP6AGK.mjs} +36 -21
- package/dist/{attempt-DW-mQqM7.mjs → attempt-ClyJlZPT.mjs} +4 -2
- package/dist/{browser-web-ycg9qWB8.mjs → browser-web-rYPyqhTf.mjs} +11 -12
- package/dist/{budget-dPGuhNai.mjs → budget-k2mZGvvk.mjs} +242 -38
- package/dist/{build-CaF574eS.mjs → build-DPhApsjV.mjs} +28 -24
- package/dist/{build-cache-HFUQ9eLz.mjs → build-cache-DrXNCy3T.mjs} +123 -23
- package/dist/{build-plan-JsDUq4w1.mjs → build-plan-DrMMdayj.mjs} +5 -5
- package/dist/{cache-manifest-BPXRONJz.mjs → cache-manifest-BEZ9Bpl1.mjs} +1 -1
- package/dist/cache-manifest.mjs +1 -1
- package/dist/{ccache-CCn1S6qG.mjs → ccache-Bx5TbxwG.mjs} +6 -6
- package/dist/{cli-xqAidP7O.mjs → cli-BBKFGOFl.mjs} +19 -19
- package/dist/cli.mjs +1 -1
- package/dist/{client-18-ZowoT.mjs → client-D9CaRks-.mjs} +55 -71
- package/dist/collector-run.mjs +4 -4
- package/dist/{command-output-DxC0k2rk.mjs → command-output-BF5AR2dL.mjs} +1 -1
- package/dist/{config-BZhXY15H.mjs → config-BktkY_zC.mjs} +321 -15
- package/dist/{launch-BVlyQw3T.mjs → dependencies-Dw6wfQdv.mjs} +259 -256
- package/dist/{dependency-state-C56ll9hY.mjs → dependency-state-DFB41vfr.mjs} +1 -1
- package/dist/{dev-client-w_fok0Ek.mjs → dev-client-DXR_tPVY.mjs} +2 -2
- package/dist/{device-BktRGdjS.mjs → device-BK-zwyd_.mjs} +64 -33
- package/dist/{device-4RUugw5X.mjs → device-BcYeHSFu.mjs} +14 -14
- package/dist/{device-capacity-Ic-kdmEV.mjs → device-capacity-DCSvUF0l.mjs} +10 -17
- package/dist/device-host-worker.mjs +11 -13
- package/dist/{device-ios-DzpSlZyd.mjs → device-ios-BLGfXQeK.mjs} +68 -25
- package/dist/{device-lease-run-DUtkbqBQ.mjs → device-lease-run-BmvIl7bI.mjs} +5 -5
- package/dist/{device-pool-CgBHk401.mjs → device-pool-Dluix4H3.mjs} +3 -3
- package/dist/{doctor-DZgpqR6J.mjs → doctor-Bhg1ii70.mjs} +14 -14
- package/dist/{doctor-BZ6oxNum.mjs → doctor-Cp-BhzTS.mjs} +1 -1
- package/dist/{doctor-C33AzVfR.mjs → doctor-OnwP94ne.mjs} +81 -26
- package/dist/{doctor-fingerprint-zlujA1Gs.mjs → doctor-fingerprint-D3a04Mhu.mjs} +8 -2
- package/dist/doctor-fingerprint.mjs +1 -1
- package/dist/{doctor-watchman-B453A231.mjs → doctor-watchman-BStK05nt.mjs} +4 -4
- package/dist/{eas-build-CxKUNHsb.mjs → eas-build-Dsj93iM9.mjs} +2 -2
- package/dist/{eas-fallback-LMxk9Kw0.mjs → eas-fallback-FwkeqqGi.mjs} +13 -12
- package/dist/{eas-session-ledger-Ck6YXPAO.mjs → eas-session-ledger-B5vygTiD.mjs} +5 -5
- package/dist/{error-diagnostics-BkKCZq4P.mjs → error-diagnostics-BOOm9Db7.mjs} +8 -8
- package/dist/{errors-ccaPc4ox.mjs → errors-DHm_U5gv.mjs} +2 -1
- package/dist/{gc-DDWEAj0w.mjs → gc-C_79zvz4.mjs} +2 -2
- package/dist/{gc-yVKpAOKM.mjs → gc-ldgr-hXU.mjs} +74 -43
- package/dist/{guide-Bggftwc5.mjs → guide-D7K0X6KG.mjs} +374 -78
- package/dist/{hosted-android-D4dweBof.mjs → hosted-android-Bk54ej6n.mjs} +3 -3
- package/dist/{hosted-client-BBTVe3X6.mjs → hosted-client-fHO8yqzc.mjs} +5 -5
- package/dist/{hosted-ios-Sn0djzg8.mjs → hosted-ios-D55QhYaD.mjs} +1 -1
- package/dist/{hosted-logs-CYIZ5ubJ.mjs → hosted-logs-BfbmDM4M.mjs} +17 -11
- package/dist/hosted-logs-sync-B0pvmOk-.mjs +195 -0
- package/dist/{hosted-macos-CXjsUNBR.mjs → hosted-macos-CPl0OZ9h.mjs} +5 -5
- package/dist/{hosted-native-Doxbfzem.mjs → hosted-native-CpDB3-PO.mjs} +6 -7
- package/dist/{idle-shutdown-BInjLKqm.mjs → idle-shutdown-FfxL1KdG.mjs} +22 -9
- package/dist/{ios-BItP6lkn.mjs → ios-B7-lToDu.mjs} +8 -8
- package/dist/{ios-CVUFFZ6C.mjs → ios-WxpDJ5T1.mjs} +129 -14
- package/dist/{ios-device-BI38NFFH.mjs → ios-device-CsyryvpT.mjs} +1 -1
- package/dist/{ios-B1FXRCMX.mjs → ios-ftxdQbJS.mjs} +84 -51
- package/dist/{ios-project-KYqeJURj.mjs → ios-project-Ty5pHl9O.mjs} +6 -6
- package/dist/{ios-state-DlElquYD.mjs → ios-state-Cw7-WQf2.mjs} +1 -1
- package/dist/{js-swap-BvrQvXHY.mjs → js-swap-BMhXYVDS.mjs} +4 -4
- package/dist/{launch-SfzGH_s9.mjs → launch-DOp8RjDz.mjs} +32 -27
- package/dist/{logs-DXE32kyb.mjs → logs-dQDki6Tt.mjs} +9 -173
- package/dist/{logs-ovlU7m7N.mjs → logs-s1dRIG1E.mjs} +85 -36
- package/dist/{macos-B3BveDrU.mjs → macos-B0VEV3Gf.mjs} +1 -1
- package/dist/{macos-CCfhb-jT.mjs → macos-DBBPNnIA.mjs} +18 -19
- package/dist/macos-run.mjs +1 -1
- package/dist/maintenance-run.mjs +28 -11
- package/dist/{metro-Bu8LBfzS.mjs → metro-CjC10t6E.mjs} +2 -2
- package/dist/{metro-gateway-DtsOy-0P.mjs → metro-gateway-B6_PgD0L.mjs} +2 -3
- package/dist/{named-ports-BWDuU5oQ.mjs → named-ports-BG0j1X4g.mjs} +2 -2
- package/dist/{native-android-96BBizbq.mjs → native-android-CL2NGiik.mjs} +17 -17
- package/dist/{native-gradle-artifact-inputs-BcLYBZil.mjs → native-gradle-artifact-inputs-btSUulme.mjs} +3 -3
- package/dist/{native-run-BmH7U8pr.mjs → native-run-BfIDFKLH.mjs} +2 -3
- package/dist/{native-runtime-DgtJkzIa.mjs → native-runtime-Dq3RBcON.mjs} +6 -7
- package/dist/{native-xcode-inputs-irplbQb0.mjs → native-xcode-inputs-BW7H8JGu.mjs} +2 -2
- package/dist/{native-xcode-ios-BY-6hh6M.mjs → native-xcode-ios-CBXJAxfC.mjs} +18 -18
- package/dist/offload-worker.d.mts +7 -2
- package/dist/offload-worker.mjs +34 -23
- package/dist/{ownership-DxlZGDcV.mjs → ownership-BjYvMNX_.mjs} +2 -2
- package/dist/{phone-reverses-BdsdesVF.mjs → phone-reverses-lmj6kcPm.mjs} +3 -3
- package/dist/{placement-log-DUvqqsB-.mjs → placement-log-DIFPQAXp.mjs} +1 -1
- package/dist/{plan-placement-4axc0Hs7.mjs → plan-placement-IiiSQhtz.mjs} +3 -3
- package/dist/{ports-D-E_OiAO.mjs → ports-C2_w1Z0Z.mjs} +3 -3
- package/dist/prebuild-gmouvmJZ.mjs +1247 -0
- package/dist/{project-Dz-hWkb-.mjs → project-BUu6Is4k.mjs} +15 -16
- package/dist/{react-native-android-DOinxgwB.mjs → react-native-android-Cgg99REN.mjs} +48 -33
- package/dist/{react-native-build-AuCu-aAP.mjs → react-native-build-oNwqF5Wb.mjs} +8 -8
- package/dist/{react-native-doctor-2ivJUmwZ.mjs → react-native-doctor-BhA3KUte.mjs} +49 -8
- package/dist/{react-native-ios-D5zTIuH8.mjs → react-native-ios-B-nf4rjN.mjs} +40 -25
- package/dist/{recordings-CdPwYwvs.mjs → recordings-BldzVKq0.mjs} +1 -1
- package/dist/{reload-Ck9RJeSq.mjs → reload-C9OduiNc.mjs} +1 -1
- package/dist/{reload-C1TTVesC.mjs → reload-CCR7KC_l.mjs} +14 -14
- package/dist/{remote-DEZ7AOVq.mjs → remote-C8S7FlPF.mjs} +16 -7
- package/dist/{result-DqBrb12U.mjs → result-7F5hEwQJ.mjs} +17 -17
- package/dist/{run-BIwoU44q.mjs → run-BqB0v3pt.mjs} +1 -1
- package/dist/{selection-BLtvaqxc.mjs → selection-BNPBZ6T5.mjs} +157 -44
- package/dist/{server-bare-Z1ToVLPn.mjs → server-bare-A75rDIdD.mjs} +55 -3
- package/dist/{server-command-C0pmjNdG.mjs → server-command-CssKFOD7.mjs} +4 -4
- package/dist/{server-expo-Tt_hLRpy.mjs → server-expo-eQfOdydb.mjs} +8 -6
- package/dist/server-expo-wvcj5tiZ.mjs +2 -0
- package/dist/{settings-RKwY33wv.mjs → settings-CosW5X-S.mjs} +59 -61
- package/dist/{settings-kkt0vP4w.mjs → settings-OaGQF-ri.mjs} +1 -1
- package/dist/{settings-write--gj6MACV.mjs → settings-write-QjYfSrjF.mjs} +5 -5
- package/dist/settings.schema.json +71 -6
- package/dist/{simslim-CdWKT3vA.mjs → simslim-Bax1qcxu.mjs} +22 -6
- package/dist/{slot-launch-A1BgotaM.mjs → slot-launch-CYCEhfBY.mjs} +6 -6
- package/dist/{stage-ERTMh88n.mjs → stage-jKQ7CP_B.mjs} +1 -1
- package/dist/{start-Bmg_qmHi.mjs → start-C_wefNKB.mjs} +1 -1
- package/dist/{start-BKGrEhzG.mjs → start-_BdJ32cZ.mjs} +9 -10
- package/dist/{state-B1ig0Kqy.mjs → state-C1i2nMOP.mjs} +2 -3
- package/dist/{state-BfAltYJP.mjs → state-C4OdpOTF.mjs} +1 -2
- package/dist/{stats-B-ckuiUg.mjs → stats-tEpEEH-u.mjs} +4 -4
- package/dist/{status-Pw-807f0.mjs → status-B9M7x4CZ.mjs} +1 -1
- package/dist/{status-Fect2w9R.mjs → status-CRXz-Gtj.mjs} +1 -1
- package/dist/{status-DfFp6a76.mjs → status-DQrqodLj.mjs} +22 -23
- package/dist/{status-watch-XC7F-AMf.mjs → status-watch-B5wDIH_o.mjs} +4 -4
- package/dist/status-worker.mjs +1 -1
- package/dist/{stim-desktop-DS0mzR8U.mjs → stim-desktop-6Dqp-gjX.mjs} +1 -1
- package/dist/{stop-BFu7X_Do.mjs → stop-CmdNhGlC.mjs} +2 -2
- package/dist/{stop-CL1kDHds.mjs → stop-DRqQVqDJ.mjs} +74 -53
- package/dist/{stop-DhclRwOO.mjs → stop-ySNQHXMG.mjs} +4 -5
- package/dist/supervisor-run.d.mts +1 -0
- package/dist/supervisor-run.mjs +15 -16
- package/dist/{support-B3tzVhKn.mjs → support-BGSCBoib.mjs} +4 -4
- package/dist/{support-B1W-hmC2.mjs → support-CVOCp0Ft.mjs} +15 -12
- package/dist/{swiftpm-artifact-inputs-BWYPj9Sn.mjs → swiftpm-artifact-inputs-CfUzt_0Z.mjs} +1 -1
- package/dist/{swiftpm-macos-BVCP5mO4.mjs → swiftpm-macos-x6HPpl_2.mjs} +10 -10
- package/dist/toolchain-DoavrvIA.mjs +2 -0
- package/dist/toolchain-J4J8MrAr.mjs +2107 -0
- package/dist/trigger-DzJu208Q.mjs +2 -0
- package/dist/{trigger-CBMe2YLH.mjs → trigger-KVaWWNyn.mjs} +1 -1
- package/dist/{warm-progress-ol0ZypEu.mjs → warm-progress-DvhTX_eu.mjs} +3 -4
- package/dist/web-BFLueSh-.mjs +2 -0
- package/dist/{web-BH7peScT.mjs → web-Bihbf7-u.mjs} +8 -9
- package/dist/web-run.mjs +4 -4
- package/dist/{workspace-state-CeBpIZgr.mjs → workspace-state-pUg3_RRA.mjs} +45 -7
- package/dist/{workspaces-CSV2Orf4.mjs → workspaces-g2lhdBXF.mjs} +17 -17
- package/dist/{worktree-Dw8kfacb.mjs → worktree-BKuklFh_.mjs} +34 -31
- package/dist/{worktree-DEDUzO_L.mjs → worktree-Bm4cb-nU.mjs} +1 -1
- package/package.json +8 -8
- package/shim/bundle-response.cjs +53 -1
- package/shim/bundle-response.d.cts +1 -1
- package/shim/expo-metro-config.cjs +23 -1
- package/dist/created-devices-D2Aca-xu.mjs +0 -52
- package/dist/paths-DQtTgsBf.mjs +0 -42
- package/dist/prebuild-DmVCf5xb.mjs +0 -501
- package/dist/server-expo-CEntXzRw.mjs +0 -2
- package/dist/toolchain-BjgKdoEf.mjs +0 -2
- package/dist/toolchain-D3bmRMia.mjs +0 -897
- package/dist/trigger-BLsHgAGR.mjs +0 -2
- package/dist/web-BdOFlTJr.mjs +0 -2
- package/dist/xcode-DHu41qQ4.mjs +0 -910
|
@@ -2,7 +2,7 @@ import { t as getExecutor } from "./exec-VFRpu1iA.mjs";
|
|
|
2
2
|
import { t as resolveMaintenanceSettings } from "./settings-Djl-mpjX.mjs";
|
|
3
3
|
import { t as spawnEntry } from "./spawn-entry-jw19m8Nl.mjs";
|
|
4
4
|
import { n as windowsLauncherArgs } from "./detached-entry-KmieOKgN.mjs";
|
|
5
|
-
import { n as stampAttempt, r as due, t as capChildLog } from "./attempt-
|
|
5
|
+
import { n as stampAttempt, r as due, t as capChildLog } from "./attempt-ClyJlZPT.mjs";
|
|
6
6
|
import { readClaimSet } from "@stim-cli/core/ownership-claim";
|
|
7
7
|
import { closeSync, openSync } from "node:fs";
|
|
8
8
|
import { maintenanceChildLogFile, maintenanceRunClaims, readMaintenanceAttempt, readMaintenanceState } from "@stim-cli/core/state";
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { D as ownership_claim_exports, E as debugLog, l as WorkspaceProcessCleanupError, n as isTimeoutError, t as getExecutor } from "./exec-VFRpu1iA.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { E as workspaceDir, M as withDirLock, _ as ensureWorkspaceStorage, h as discoverAgentSessions, m as attributeAgentSessions, o as updateWorkspaceState, p as agentKey } from "./workspace-state-pUg3_RRA.mjs";
|
|
3
3
|
import { l as gitQuietAsync, o as git$1, s as gitAsync } from "./operation-exec-CUZifp6Z.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { V as ownedAvdDirectory } from "./android-882m4hxX.mjs";
|
|
4
|
+
import { Tt as linkedWorktreesOnDisk, bt as gitCommonDirOnDisk } from "./settings-CosW5X-S.mjs";
|
|
5
|
+
import { V as ownedAvdDirectory } from "./android-DTAcRwBC.mjs";
|
|
7
6
|
import { s as pullRequestLookups } from "./pull-request-CbNlkFok.mjs";
|
|
8
7
|
import { clearClaimChild, markClaimChildPending, releaseClaim, setClaimChild, tryAcquireClaim } from "@stim-cli/core/ownership-claim";
|
|
9
8
|
import { randomUUID } from "node:crypto";
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { E as upsertProject, O as withConfigLockAsync, p as getProject } from "./config-
|
|
3
|
-
import { f as refuseNoProject, l as phaseLine } from "./command-output-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { o as readWebRecord, r as cdpEndpoint } from "./state-B1ig0Kqy.mjs";
|
|
1
|
+
import { i as recordWorkspaceUse, k as workspaceLogsDir } from "./workspace-state-pUg3_RRA.mjs";
|
|
2
|
+
import { E as upsertProject, O as withConfigLockAsync, p as getProject } from "./config-BktkY_zC.mjs";
|
|
3
|
+
import { f as refuseNoProject, l as phaseLine } from "./command-output-BF5AR2dL.mjs";
|
|
4
|
+
import { Y as resolveProjectSettingsAsync, a as SETTING_SHAPE_REMEDY, tt as settingShapeErrors } from "./settings-CosW5X-S.mjs";
|
|
5
|
+
import { f as projectRegistry, n as findCommandWorkspace } from "./project-BUu6Is4k.mjs";
|
|
6
|
+
import { a as workspaceLinkLine, o as workspaceLinks } from "./stim-desktop-6Dqp-gjX.mjs";
|
|
7
|
+
import { o as readWebRecord, r as cdpEndpoint } from "./state-C1i2nMOP.mjs";
|
|
9
8
|
import { t as liveWebRecord } from "./page-CzEA_-5_.mjs";
|
|
10
|
-
import { n as ensureWorkspaceStorageSafely } from "./native-runtime-
|
|
9
|
+
import { n as ensureWorkspaceStorageSafely } from "./native-runtime-Dq3RBcON.mjs";
|
|
11
10
|
import chalk from "chalk";
|
|
12
11
|
//#region src/commands/web.ts
|
|
13
12
|
const printNote = (line) => console.error(line);
|
package/dist/web-run.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { D as ownership_claim_exports, S as process_identity_exports, o as cancellableSleep, t as getExecutor } from "./exec-VFRpu1iA.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { f as signalProcessTree } from "./metro-
|
|
2
|
+
import { Tt as recordCreatedDevice } from "./android-DTAcRwBC.mjs";
|
|
3
|
+
import { f as signalProcessTree } from "./metro-CjC10t6E.mjs";
|
|
4
4
|
import { r as createNdjsonWriter } from "./ndjson-CgE_o3Dl.mjs";
|
|
5
|
-
import { c as webClaimRoot, f as webLogFile, g as chromeProcessState, h as writeWebRecord, i as clearWebRecord, l as webDir, n as browserLogFile, p as webProfileDir, s as updateWebRecord, v as liveProfileHolder, y as removeSingletonFiles } from "./state-
|
|
6
|
-
import { l as probeWebDrivers } from "./activity-
|
|
5
|
+
import { c as webClaimRoot, f as webLogFile, g as chromeProcessState, h as writeWebRecord, i as clearWebRecord, l as webDir, n as browserLogFile, p as webProfileDir, s as updateWebRecord, v as liveProfileHolder, y as removeSingletonFiles } from "./state-C1i2nMOP.mjs";
|
|
6
|
+
import { l as probeWebDrivers } from "./activity-Lnb_EoRY.mjs";
|
|
7
7
|
import { t as connectOwnedBrowser } from "./cdp-BG3FJCCx.mjs";
|
|
8
8
|
import { t as relaunchWithLogFile } from "./detached-entry-KmieOKgN.mjs";
|
|
9
9
|
import { i as chromeArgs, n as DESKTOP_PAGE, r as PHONE_SCREEN } from "./chrome-BvV8ssI3.mjs";
|
|
@@ -1,12 +1,50 @@
|
|
|
1
1
|
import { S as process_identity_exports, t as getExecutor } from "./exec-VFRpu1iA.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { ot as workspaceHiddenSetting } from "./settings-RKwY33wv.mjs";
|
|
2
|
+
import { A as writeConfigSettingAsync, k as writeConfigSetting, m as getProjectSettings } from "./config-BktkY_zC.mjs";
|
|
3
|
+
import { st as workspaceHiddenSetting } from "./settings-CosW5X-S.mjs";
|
|
5
4
|
import { existsSync, mkdirSync, readFileSync, realpathSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
6
5
|
import { homedir } from "node:os";
|
|
7
6
|
import { dirname, isAbsolute, join, relative } from "node:path";
|
|
8
|
-
import {
|
|
7
|
+
import { buildCacheRoot as sharedBuildCache, ensurePrivateDir, withDirLock as withDirLock$1, withDirLockAsync as withDirLockAsync$1, workspaceId as workspaceId$1, workspaceName as workspaceName$1, workspaceStateDir as workspaceDir } from "@stim-cli/core";
|
|
8
|
+
import { WORKSPACE_AGENT_KEY, emulatorLogFile, isJsonObject, readJsonObject, readWorkspaceState, readWorkspaceState as readWorkspaceState$1, sharedCcache as sharedCcache$1, sharedCompilationCache as sharedCompilationCache$1, supervisorLogFile, supervisorPidFile, workspaceAgentDeviceDir, workspaceDerivedData, workspaceLastUsed, workspaceLogErrorIndex, workspaceLogsDir as workspaceLogsDir$1, workspaceMetadataFile, workspaceStateFile as workspaceStateFile$1, workspaceStateLock } from "@stim-cli/core/state";
|
|
9
|
+
import { join as join$1, resolve as resolve$1 } from "path";
|
|
9
10
|
import { readFile, readdir } from "node:fs/promises";
|
|
11
|
+
//#region src/workspace/paths.ts
|
|
12
|
+
function ensureWorkspaceStorage(projectRoot) {
|
|
13
|
+
const canonicalRoot = resolve$1(projectRoot);
|
|
14
|
+
const dir = workspaceDir(canonicalRoot);
|
|
15
|
+
const file = workspaceMetadataFile(canonicalRoot);
|
|
16
|
+
ensurePrivateDir(dir);
|
|
17
|
+
return withDirLock$1(join$1(dir, "metadata.lock"), () => {
|
|
18
|
+
if (!existsSync(file)) {
|
|
19
|
+
const metadata = {
|
|
20
|
+
projectRoot: canonicalRoot,
|
|
21
|
+
workspace: workspaceName$1(canonicalRoot),
|
|
22
|
+
version: 1
|
|
23
|
+
};
|
|
24
|
+
const tmp = `${file}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;
|
|
25
|
+
writeFileSync(tmp, `${JSON.stringify(metadata, null, 2)}\n`);
|
|
26
|
+
try {
|
|
27
|
+
renameSync(tmp, file);
|
|
28
|
+
} catch (error) {
|
|
29
|
+
rmSync(tmp, { force: true });
|
|
30
|
+
throw error;
|
|
31
|
+
}
|
|
32
|
+
return dir;
|
|
33
|
+
}
|
|
34
|
+
if (readJsonObject(file)?.projectRoot === canonicalRoot) return dir;
|
|
35
|
+
const error = /* @__PURE__ */ new Error(`Stim workspace collision at ${dir}: its workspace.json does not belong to ${canonicalRoot}.`);
|
|
36
|
+
error.code = "STIM_WORKSPACE_COLLISION";
|
|
37
|
+
throw error;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/** Initializes or validates workspace storage after asynchronously acquiring its metadata lock. */
|
|
41
|
+
function ensureWorkspaceStorageAsync(projectRoot, signal) {
|
|
42
|
+
signal?.throwIfAborted();
|
|
43
|
+
const dir = workspaceDir(resolve$1(projectRoot));
|
|
44
|
+
ensurePrivateDir(dir);
|
|
45
|
+
return withDirLockAsync$1(join$1(dir, "metadata.lock"), () => ensureWorkspaceStorage(projectRoot), { signal });
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
10
48
|
//#region src/agent-sessions.ts
|
|
11
49
|
const TITLE_MAX_LENGTH = 120;
|
|
12
50
|
const SESSION_ID = /^[A-Za-z0-9._:-]{1,128}$/;
|
|
@@ -255,7 +293,7 @@ function attributeAgentSessions(workspaces, sessions, now) {
|
|
|
255
293
|
//#region src/workspace/workspace-state.ts
|
|
256
294
|
function withWorkspaceStateLock(root, fn) {
|
|
257
295
|
const file = workspaceStateFile$1(root);
|
|
258
|
-
return withDirLock(workspaceStateLock(root), fn, { ensureParent: () => {
|
|
296
|
+
return withDirLock$1(workspaceStateLock(root), fn, { ensureParent: () => {
|
|
259
297
|
ensureWorkspaceStorage(root);
|
|
260
298
|
mkdirSync(dirname(file), { recursive: true });
|
|
261
299
|
} });
|
|
@@ -264,7 +302,7 @@ function withWorkspaceStateLock(root, fn) {
|
|
|
264
302
|
async function withWorkspaceStateLockAsync(root, fn, signal) {
|
|
265
303
|
await ensureWorkspaceStorageAsync(root, signal);
|
|
266
304
|
const file = workspaceStateFile$1(root);
|
|
267
|
-
return withDirLockAsync(workspaceStateLock(root), fn, {
|
|
305
|
+
return withDirLockAsync$1(workspaceStateLock(root), fn, {
|
|
268
306
|
ensureParent: () => mkdirSync(dirname(file), { recursive: true }),
|
|
269
307
|
signal
|
|
270
308
|
});
|
|
@@ -389,4 +427,4 @@ function workspaceUsePatch(now, env, commandCwd) {
|
|
|
389
427
|
};
|
|
390
428
|
}
|
|
391
429
|
//#endregion
|
|
392
|
-
export { recordWorkspaceUseAsync as a, withWorkspaceStateLock as c, writeWorkspaceState as d, writeWorkspaceStateAsync as f, discoverAgentSessions as h, recordWorkspaceUse as i, withWorkspaceStateLockAsync as l, attributeAgentSessions as m, clearWorkspaceStateKeys as n, updateWorkspaceState as o, agentKey as p, readWorkspaceState$1 as r, updateWorkspaceStateAsync as s, clearWorkspaceStateKey as t, workspaceLastUsed as u };
|
|
430
|
+
export { workspaceName$1 as A, supervisorPidFile as C, workspaceId$1 as D, workspaceDir as E, withDirLock$1 as M, withDirLockAsync$1 as N, workspaceLogErrorIndex as O, supervisorLogFile as S, workspaceDerivedData as T, ensureWorkspaceStorage as _, recordWorkspaceUseAsync as a, sharedCcache$1 as b, withWorkspaceStateLock as c, writeWorkspaceState as d, writeWorkspaceStateAsync as f, emulatorLogFile as g, discoverAgentSessions as h, recordWorkspaceUse as i, workspaceStateFile$1 as j, workspaceLogsDir$1 as k, withWorkspaceStateLockAsync as l, attributeAgentSessions as m, clearWorkspaceStateKeys as n, updateWorkspaceState as o, agentKey as p, readWorkspaceState$1 as r, updateWorkspaceStateAsync as s, clearWorkspaceStateKey as t, workspaceLastUsed as u, ensureWorkspaceStorageAsync as v, workspaceAgentDeviceDir as w, sharedCompilationCache$1 as x, sharedBuildCache as y };
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import { D as ownership_claim_exports, S as process_identity_exports, c as throwIfCancelled, d as workspaceProcessLockError, f as workspaceProcessLockPath, l as WorkspaceProcessCleanupError, m as declareSpawnsOn, o as cancellableSleep, t as getExecutor, u as withWorkspaceProcessLock, v as stopDeclaringSpawnsOn } from "./exec-VFRpu1iA.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { F as isOnMountedVolume, G as projectDeviceSlots, H as deviceSlotPlatforms, I as listMountedVolumes, L as measuredDirectorySizeAsync, O as withConfigLockAsync$1, P as formatBytes, _ as loadConfig$1, d as getConfigDir, g as isPathPrefix, j as acquireAvdClaim, p as getProject } from "./config-
|
|
2
|
+
import { A as workspaceName$1, E as workspaceDir, l as withWorkspaceStateLockAsync, r as readWorkspaceState$1, u as workspaceLastUsed, w as workspaceAgentDeviceDir } from "./workspace-state-pUg3_RRA.mjs";
|
|
3
|
+
import { F as isOnMountedVolume, G as projectDeviceSlots, H as deviceSlotPlatforms, I as listMountedVolumes, L as measuredDirectorySizeAsync, O as withConfigLockAsync$1, P as formatBytes, _ as loadConfig$1, d as getConfigDir, g as isPathPrefix, j as acquireAvdClaim, p as getProject } from "./config-BktkY_zC.mjs";
|
|
4
4
|
import { t as createLineReader } from "./process-output-Fpl8PYi8.mjs";
|
|
5
|
-
import { a as formatElapsed, l as phaseLine } from "./command-output-
|
|
5
|
+
import { a as formatElapsed, l as phaseLine } from "./command-output-BF5AR2dL.mjs";
|
|
6
6
|
import { t as runOperationFile } from "./operation-exec-CUZifp6Z.mjs";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { i as
|
|
12
|
-
import { c as pidExists, f as signalProcessTree, p as signalProcessTreeAsync } from "./metro-Bu8LBfzS.mjs";
|
|
13
|
-
import { _ as chromeProcessStateAsync, c as webClaimRoot, i as clearWebRecord, o as readWebRecord, p as webProfileDir, t as CDP_PORT_LABEL, u as webFacts, v as liveProfileHolder, y as removeSingletonFiles } from "./state-B1ig0Kqy.mjs";
|
|
7
|
+
import { Pt as repoRootAsync, dt as resolveTailscaleBinary } from "./settings-CosW5X-S.mjs";
|
|
8
|
+
import { a as macosRuntimeClaim, n as macosDir } from "./state-C4OdpOTF.mjs";
|
|
9
|
+
import { Ct as forgetCreatedDeviceAsync, H as ownedAvdMatchesConfiguration, K as ownedAvdSystemImage, L as listOrphanedAvdDirectories, S as deleteAvd, St as forgetCreatedDevice, Tt as recordCreatedDevice, V as ownedAvdDirectory, _t as parkSim, bt as removeParkedAfter, g as avdPathExists, ht as eraseParkedAfter, it as shutdownAndroidEmulator, j as listAdbDevicesAsync, lt as wipeAvdUserData, nt as resolveOwnedAvdSerialAsync, p as assertOwnedAvdStoppedAsync, st as waitForAndroidEmulatorShutdown, ut as isStimOwnedAvd, v as avdStorageRoots, wt as readCreatedDevices$1, yt as readParked } from "./android-DTAcRwBC.mjs";
|
|
10
|
+
import { c as pidExists, f as signalProcessTree, p as signalProcessTreeAsync } from "./metro-CjC10t6E.mjs";
|
|
11
|
+
import { _ as chromeProcessStateAsync, c as webClaimRoot, i as clearWebRecord, o as readWebRecord, p as webProfileDir, t as CDP_PORT_LABEL, u as webFacts, v as liveProfileHolder, y as removeSingletonFiles } from "./state-C1i2nMOP.mjs";
|
|
14
12
|
import { t as canonicalPath } from "./paths-BsJMoPP2.mjs";
|
|
15
|
-
import { N as listBuildLocks, d as readAgentDeviceRecords, t as agentDeviceDaemon } from "./activity-
|
|
16
|
-
import {
|
|
17
|
-
import { r as releaseBrowserPort } from "./named-ports-
|
|
13
|
+
import { N as listBuildLocks, d as readAgentDeviceRecords, t as agentDeviceDaemon } from "./activity-Lnb_EoRY.mjs";
|
|
14
|
+
import { C as renameIosSim, D as resolveOwnedIosSim, c as eraseIosSim, f as listAllIosSimsAsync, k as shutdownIosSim, o as deleteIosSim, p as listIosDeviceTypesAsync, s as deleteParkedIosSim, v as parkedSimName, y as parseRuntimeVersion } from "./ios-WxpDJ5T1.mjs";
|
|
15
|
+
import { r as releaseBrowserPort } from "./named-ports-BG0j1X4g.mjs";
|
|
18
16
|
import { createHash, randomUUID } from "node:crypto";
|
|
19
17
|
import { closeSync, existsSync, lstatSync, mkdirSync, openSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, rmdirSync, statSync, unlinkSync, watch, writeFileSync } from "node:fs";
|
|
20
18
|
import { isDeepStrictEqual } from "node:util";
|
|
@@ -23,24 +21,26 @@ import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "nod
|
|
|
23
21
|
import { ambientContext, ambientEnv, ambientWrite } from "@stim-cli/core";
|
|
24
22
|
import { buildSlotsDir, hostedNativeRecords, isJsonObject, macosAppState, parseHostedNativePlacement, readJsonFile, readMacosRecord, requireAutomaticMachine, tryAcquireBuildSlotClaim, unreadableHostedNative } from "@stim-cli/core/state";
|
|
25
23
|
import { basename as basename$1, dirname as dirname$1, isAbsolute as isAbsolute$1, join as join$1, relative as relative$1 } from "path";
|
|
24
|
+
import { request } from "node:https";
|
|
26
25
|
import chalk from "chalk";
|
|
27
26
|
import { existsSync as existsSync$1, lstatSync as lstatSync$1, readdirSync as readdirSync$1, statSync as statSync$1 } from "fs";
|
|
28
27
|
import { lstat, readFile, readdir, rm, stat, unlink } from "node:fs/promises";
|
|
29
28
|
import { resolve4 } from "node:dns/promises";
|
|
30
|
-
import { request } from "node:https";
|
|
31
29
|
//#region src/commands/gc/results.ts
|
|
32
|
-
function createGcResults() {
|
|
30
|
+
function createGcResults(observe) {
|
|
33
31
|
const results = [];
|
|
34
32
|
return {
|
|
35
33
|
record(kind, status, label, { id = null, bytes = null, detail = null } = {}) {
|
|
36
|
-
|
|
34
|
+
const result = {
|
|
37
35
|
kind,
|
|
38
36
|
status,
|
|
39
37
|
label,
|
|
40
38
|
id,
|
|
41
39
|
bytes,
|
|
42
40
|
detail
|
|
43
|
-
}
|
|
41
|
+
};
|
|
42
|
+
results.push(result);
|
|
43
|
+
observe?.(result);
|
|
44
44
|
},
|
|
45
45
|
take() {
|
|
46
46
|
return results.splice(0);
|
|
@@ -1,36 +1,34 @@
|
|
|
1
1
|
import { D as ownership_claim_exports, S as process_identity_exports, b as operationState, l as WorkspaceProcessCleanupError, m as declareSpawnsOn, n as isTimeoutError, t as getExecutor, v as stopDeclaringSpawnsOn } from "./exec-VFRpu1iA.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { E as upsertProject, G as projectDeviceSlots, L as measuredDirectorySizeAsync, O as withConfigLockAsync$1, S as removeProject, _ as loadConfig$1, a as clearDevice, d as getConfigDir, g as isPathPrefix, j as acquireAvdClaim, p as getProject } from "./config-
|
|
4
|
-
import { a as formatElapsed, h as shortUdid, i as formatDuration, l as phaseLine, p as releasedLeaseFact, u as plural } from "./command-output-
|
|
2
|
+
import { E as workspaceDir, a as recordWorkspaceUseAsync, l as withWorkspaceStateLockAsync, r as readWorkspaceState$1, w as workspaceAgentDeviceDir } from "./workspace-state-pUg3_RRA.mjs";
|
|
3
|
+
import { E as upsertProject, G as projectDeviceSlots, L as measuredDirectorySizeAsync, O as withConfigLockAsync$1, S as removeProject, _ as loadConfig$1, a as clearDevice, d as getConfigDir, g as isPathPrefix, j as acquireAvdClaim, p as getProject } from "./config-BktkY_zC.mjs";
|
|
4
|
+
import { a as formatElapsed, h as shortUdid, i as formatDuration, l as phaseLine, p as releasedLeaseFact, u as plural } from "./command-output-BF5AR2dL.mjs";
|
|
5
5
|
import { c as gitQuiet, o as git, r as childEnvironment, s as gitAsync, t as runOperationFile } from "./operation-exec-CUZifp6Z.mjs";
|
|
6
|
-
import { a as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { o as
|
|
14
|
-
import { Rn as runProcessOperation, S as withdrawDevServerStopRequest, Sr as discoverCaches, Vt as endRecordedSession, Yn as resolveEasCliBin, b as requestDevServerStop, c as readVolumeSpace, it as planCacheEmptying, l as readVolumeSpaceAsync, o as machineNumber, u as resolveBudget } from "./budget-dPGuhNai.mjs";
|
|
6
|
+
import { At as podsOutOfSync, B as readCommittedSettings, Bt as unpushedCommitsAsync, Ct as hasUncommittedWorkAsync, Dt as listWorktreesAsync, Ft as resolveFullRef, Gt as removeTemporaryEntryAsync, Ht as filesystemDevice, It as resolveFullRefAsync, J as resolveProjectSettings, Mt as removeWorktreeAsync, Ot as locallyKnownUpstream, Rt as restoreFileAsync, St as hasRemoteAsync, Vt as warmWorktreePaths, X as resolveSettings, _t as dirtyPathsAsync, a as SETTING_SHAPE_REMEDY, at as unknownSettingKeys, bt as gitCommonDirOnDisk, ft as branchExistsAsync, ht as depsOutOfSync, jt as readWorktreeExclude, mt as deleteBranchAsync, pt as cloneIgnoredEntries, q as resolveIosProjectDir, tt as settingShapeErrors, wt as isPodInstallChurn, xt as hasPopulatedSubmodulesAsync, yt as gitCommonDirAsync, zt as sourceCheckoutOf } from "./settings-CosW5X-S.mjs";
|
|
7
|
+
import { F as readRemoteSessionId, M as readMetroTunnel, O as clearManagedMetroTunnel, P as readRemoteSession, T as MODE_COMMAND, i as findProjectRoot$1, k as clearRemoteSession, o as isMobileProject } from "./project-BUu6Is4k.mjs";
|
|
8
|
+
import { t as macosAppPresent } from "./state-C4OdpOTF.mjs";
|
|
9
|
+
import { a as workspaceLinkLine, o as workspaceLinks } from "./stim-desktop-6Dqp-gjX.mjs";
|
|
10
|
+
import { ft as POOL_SETTING_REMEDY, vt as parkedMaxSetting } from "./android-DTAcRwBC.mjs";
|
|
11
|
+
import { c as pidExists, d as resolveProjectMetro, p as signalProcessTreeAsync, r as killMetroTreeAsync } from "./metro-CjC10t6E.mjs";
|
|
12
|
+
import { o as readWebRecord } from "./state-C1i2nMOP.mjs";
|
|
13
|
+
import { Dr as discoverCaches, Gt as endRecordedSession, S as withdrawDevServerStopRequest, Un as runProcessOperation, b as requestDevServerStop, c as readVolumeSpace, ct as planCacheEmptying, er as resolveEasCliBin, l as readVolumeSpaceAsync, o as machineNumber, u as resolveBudget } from "./budget-k2mZGvvk.mjs";
|
|
15
14
|
import { t as canonicalPath } from "./paths-BsJMoPP2.mjs";
|
|
16
|
-
import { p as cacheUser } from "./native-run-
|
|
17
|
-
import { A as teardownOwnedIosSim, C as withManagedTunnelRemovalLock, O as teardownOwnedAvd, a as collectWorkspaceOutputs, f as emptyWorkspaceDir, g as resolveSupervisorTarget, k as teardownOwnedBrowser, p as withIdleWorkspace, v as stopTunnel, x as withManagedRemoteWorktreeRemovalLock } from "./workspaces-
|
|
18
|
-
import { D as releaseWorkspaceLeases, t as agentDeviceDaemon } from "./activity-
|
|
19
|
-
import {
|
|
20
|
-
import { t as clearNamedPorts } from "./named-ports-
|
|
21
|
-
import { r as HEARTBEAT_INTERVAL_MS, x as podInstallCommand } from "./xcode-DHu41qQ4.mjs";
|
|
15
|
+
import { p as cacheUser } from "./native-run-BfIDFKLH.mjs";
|
|
16
|
+
import { A as teardownOwnedIosSim, C as withManagedTunnelRemovalLock, O as teardownOwnedAvd, a as collectWorkspaceOutputs, f as emptyWorkspaceDir, g as resolveSupervisorTarget, k as teardownOwnedBrowser, p as withIdleWorkspace, v as stopTunnel, x as withManagedRemoteWorktreeRemovalLock } from "./workspaces-g2lhdBXF.mjs";
|
|
17
|
+
import { D as releaseWorkspaceLeases, t as agentDeviceDaemon } from "./activity-Lnb_EoRY.mjs";
|
|
18
|
+
import { L as readHostMemoryPressure, R as readHostMemoryPressureAsync } from "./ios-WxpDJ5T1.mjs";
|
|
19
|
+
import { t as clearNamedPorts } from "./named-ports-BG0j1X4g.mjs";
|
|
22
20
|
import { t as resolveMaintenanceSettings } from "./settings-Djl-mpjX.mjs";
|
|
23
|
-
import {
|
|
24
|
-
import { i as stopHostedAndroid } from "./hosted-android-
|
|
25
|
-
import { r as stopHostedIos } from "./hosted-ios-
|
|
26
|
-
import { n as stopMacosApp } from "./stop-
|
|
27
|
-
import { n as verifyCollectorOwnership } from "./ownership-
|
|
28
|
-
import { n as removePhoneReverses } from "./phone-reverses-
|
|
29
|
-
import { a as discoverXcodeProject } from "./react-native-build-
|
|
30
|
-
import { n as hasInstalledDependencies, r as installedNpmTreeIsValid, t as dependencyState } from "./dependency-state-
|
|
31
|
-
import { a as forgetStatusMeasures, p as mergeStateAsync, t as startWarmProgress } from "./warm-progress-
|
|
21
|
+
import { D as runCaptured, O as runPodInstall, S as DEPS_ERROR, T as readPodState, Y as podInstallCommand, j as HEARTBEAT_INTERVAL_MS, w as podsAreStale } from "./toolchain-J4J8MrAr.mjs";
|
|
22
|
+
import { i as stopHostedAndroid } from "./hosted-android-Bk54ej6n.mjs";
|
|
23
|
+
import { r as stopHostedIos } from "./hosted-ios-D55QhYaD.mjs";
|
|
24
|
+
import { n as stopMacosApp } from "./stop-ySNQHXMG.mjs";
|
|
25
|
+
import { n as verifyCollectorOwnership } from "./ownership-BjYvMNX_.mjs";
|
|
26
|
+
import { n as removePhoneReverses } from "./phone-reverses-lmj6kcPm.mjs";
|
|
27
|
+
import { a as discoverXcodeProject } from "./react-native-build-oNwqF5Wb.mjs";
|
|
28
|
+
import { n as hasInstalledDependencies, r as installedNpmTreeIsValid, t as dependencyState } from "./dependency-state-DFB41vfr.mjs";
|
|
29
|
+
import { a as forgetStatusMeasures, p as mergeStateAsync, t as startWarmProgress } from "./warm-progress-DvhTX_eu.mjs";
|
|
32
30
|
import { o as pullRequestLookupAsync, r as endedPullRequest } from "./pull-request-CbNlkFok.mjs";
|
|
33
|
-
import { r as workspaceRecordingEnabled } from "./recordings-
|
|
31
|
+
import { r as workspaceRecordingEnabled } from "./recordings-BldzVKq0.mjs";
|
|
34
32
|
import { claimRemoveCommand, clearFreeClaimSet, readClaimSet, releaseClaim, tryAcquireClaim } from "@stim-cli/core/ownership-claim";
|
|
35
33
|
import { createHash, randomUUID } from "node:crypto";
|
|
36
34
|
import { existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
@@ -2440,18 +2438,23 @@ function deleteInBackground(trash) {
|
|
|
2440
2438
|
child.on?.("error", () => {});
|
|
2441
2439
|
child.unref?.();
|
|
2442
2440
|
const captured = child.pid === void 0 ? null : captureProcessIdentity(child.pid);
|
|
2441
|
+
if (captured?.ok === false && captured.reason.startsWith("NOT_FOUND")) {
|
|
2442
|
+
(0, ownership_claim_exports.clearClaimChild)(trash.claim);
|
|
2443
|
+
(0, ownership_claim_exports.releaseClaim)(trash.claim);
|
|
2444
|
+
return existsSync(trash.dir) ? "left" : "deleted";
|
|
2445
|
+
}
|
|
2443
2446
|
if (!captured?.ok || child.pid === void 0) throw new Error("the trash deletion process was not recorded");
|
|
2444
2447
|
(0, ownership_claim_exports.setClaimChild)(trash.claim, {
|
|
2445
2448
|
pid: child.pid,
|
|
2446
2449
|
processToken: captured.token
|
|
2447
2450
|
});
|
|
2448
|
-
return
|
|
2451
|
+
return "background";
|
|
2449
2452
|
} catch {
|
|
2450
2453
|
try {
|
|
2451
2454
|
(0, ownership_claim_exports.clearClaimChild)(trash.claim);
|
|
2452
2455
|
} catch {}
|
|
2453
2456
|
(0, ownership_claim_exports.releaseClaim)(trash.claim);
|
|
2454
|
-
return
|
|
2457
|
+
return "left";
|
|
2455
2458
|
}
|
|
2456
2459
|
}
|
|
2457
2460
|
/**
|
|
@@ -2461,7 +2464,7 @@ function deleteInBackground(trash) {
|
|
|
2461
2464
|
* `left` means the entry waits for gc with its claim released.
|
|
2462
2465
|
*/
|
|
2463
2466
|
async function disposeTrash(trash, operation) {
|
|
2464
|
-
if (!getExecutor().reportSignal?.()) return deleteInBackground(trash)
|
|
2467
|
+
if (!getExecutor().reportSignal?.()) return deleteInBackground(trash);
|
|
2465
2468
|
try {
|
|
2466
2469
|
await deleteTrashEntry(trash.dir, operation);
|
|
2467
2470
|
return "deleted";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as worktreeCommand, a as matchWorktreeEntry, c as reclaimKeys, d as removalBlockers, f as removalPath, g as warmedWorkspace, h as warmWorktreeTarget, i as excludeWatchmanCookies, l as registerRemove, m as removeWorktreeTarget, n as dependencyInstallCommand, o as nestedWorktrees, p as removalRemedy, r as excludePodChurn, s as porcelainPath, t as customIosDirs, u as registerWarm } from "./worktree-
|
|
1
|
+
import { _ as worktreeCommand, a as matchWorktreeEntry, c as reclaimKeys, d as removalBlockers, f as removalPath, g as warmedWorkspace, h as warmWorktreeTarget, i as excludeWatchmanCookies, l as registerRemove, m as removeWorktreeTarget, n as dependencyInstallCommand, o as nestedWorktrees, p as removalRemedy, r as excludePodChurn, s as porcelainPath, t as customIosDirs, u as registerWarm } from "./worktree-BKuklFh_.mjs";
|
|
2
2
|
export { customIosDirs, worktreeCommand as default, dependencyInstallCommand, excludePodChurn, excludeWatchmanCookies, matchWorktreeEntry, nestedWorktrees, porcelainPath, reclaimKeys, registerRemove, registerWarm, removalBlockers, removalPath, removalRemedy, removeWorktreeTarget, warmWorktreeTarget, warmedWorkspace };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stim",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.26.0",
|
|
4
4
|
"description": "Stim: fast, isolated React Native environments for coding agents",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|
|
@@ -52,12 +52,12 @@
|
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@expo/fingerprint": "^0.
|
|
56
|
-
"@stim-cli/agent-driver": "
|
|
57
|
-
"@stim-cli/agent-driver-agent-device": "
|
|
58
|
-
"@stim-cli/cache": "
|
|
59
|
-
"@stim-cli/core": "
|
|
60
|
-
"@stim-cli/metro": "
|
|
55
|
+
"@expo/fingerprint": "^0.21.5",
|
|
56
|
+
"@stim-cli/agent-driver": "1.26.0",
|
|
57
|
+
"@stim-cli/agent-driver-agent-device": "1.26.0",
|
|
58
|
+
"@stim-cli/cache": "1.26.0",
|
|
59
|
+
"@stim-cli/core": "1.26.0",
|
|
60
|
+
"@stim-cli/metro": "1.26.0",
|
|
61
61
|
"@xmldom/xmldom": "0.9.12",
|
|
62
62
|
"chalk": "^6.0.0",
|
|
63
63
|
"commander": "^15.0.0",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"ws": "^8.21.3"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@stim-cli/expo-build-cache": "1.
|
|
69
|
+
"@stim-cli/expo-build-cache": "1.26.0",
|
|
70
70
|
"@types/cross-spawn": "^6.0.6",
|
|
71
71
|
"@types/which": "^3.0.4",
|
|
72
72
|
"@types/ws": "^8.18.1",
|
package/shim/bundle-response.cjs
CHANGED
|
@@ -7,6 +7,8 @@ const LOOPBACK = new Set(['127.0.0.1', '::1', '::ffff:127.0.0.1']);
|
|
|
7
7
|
// https://github.com/facebook/metro/blob/main/packages/metro/src/Server.js (`writeChunk` with done, total, percent).
|
|
8
8
|
const PROGRESS_PART = /^\{"done":(\d+),"total":(\d+),"percent":(\d+)\}$/;
|
|
9
9
|
const PROGRESS_INTERVAL_MS = 1000;
|
|
10
|
+
const MANIFEST_PATHS = new Set(['/', '/manifest', '/index.exp']);
|
|
11
|
+
const observedServers = new WeakSet();
|
|
10
12
|
|
|
11
13
|
function clientPidFromLsof(output, clientPort, serverPort) {
|
|
12
14
|
const connection = new RegExp(`:${clientPort}->\\S*:${serverPort}$`);
|
|
@@ -28,9 +30,58 @@ function lookupClientPid(req, runLsof) {
|
|
|
28
30
|
.catch(() => null);
|
|
29
31
|
}
|
|
30
32
|
|
|
31
|
-
function
|
|
33
|
+
function manifestPlatform(req) {
|
|
34
|
+
if (req.method !== 'GET') return null;
|
|
35
|
+
let url;
|
|
36
|
+
try {
|
|
37
|
+
url = new URL(req.url, 'http://localhost');
|
|
38
|
+
} catch {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
if (!MANIFEST_PATHS.has(url.pathname)) return null;
|
|
42
|
+
const platform = url.searchParams.get('platform') || req.headers['expo-platform'] || req.headers['exponent-platform'];
|
|
43
|
+
return platform === 'ios' || platform === 'android' ? platform : null;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// @expo/cli mounts ManifestMiddleware ahead of Metro's middleware and answers without calling next(),
|
|
47
|
+
// so only a listener on the HTTP server itself sees a manifest request.
|
|
48
|
+
function observeManifestRequests(server, write) {
|
|
49
|
+
if (!server || observedServers.has(server)) return;
|
|
50
|
+
observedServers.add(server);
|
|
51
|
+
server.prependListener('request', (req, res) => {
|
|
52
|
+
const platform = manifestPlatform(req);
|
|
53
|
+
if (!platform || req.headers['x-stim-metro-warmup'] === '1') return;
|
|
54
|
+
const requestId = randomUUID();
|
|
55
|
+
const emit = (stage, statusCode) => {
|
|
56
|
+
try {
|
|
57
|
+
write({
|
|
58
|
+
ts: Date.now(),
|
|
59
|
+
src: 'metro',
|
|
60
|
+
level: 'debug',
|
|
61
|
+
event: `manifest_request_${stage}`,
|
|
62
|
+
platform,
|
|
63
|
+
requestId,
|
|
64
|
+
...(statusCode ? { statusCode } : {}),
|
|
65
|
+
msg: `${platform} manifest request ${stage}`,
|
|
66
|
+
});
|
|
67
|
+
} catch {}
|
|
68
|
+
};
|
|
69
|
+
emit('started');
|
|
70
|
+
let ended = false;
|
|
71
|
+
const finish = (complete) => {
|
|
72
|
+
if (ended) return;
|
|
73
|
+
ended = true;
|
|
74
|
+
emit(complete && res.statusCode === 200 ? 'finished' : 'failed', res.statusCode);
|
|
75
|
+
};
|
|
76
|
+
res.once('finish', () => finish(true));
|
|
77
|
+
res.once('close', () => finish(false));
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function bundleResponseMiddleware(write, { runLsof, manifests = false } = {}) {
|
|
32
82
|
return (req, res, next) => {
|
|
33
83
|
if (req.method === 'GET' && req.url === '/_stim/metro-warmup') {
|
|
84
|
+
if (manifests) observeManifestRequests(req.socket.server, write);
|
|
34
85
|
res.end('ready');
|
|
35
86
|
return;
|
|
36
87
|
}
|
|
@@ -59,6 +110,7 @@ function bundleResponseMiddleware(write, { runLsof } = {}) {
|
|
|
59
110
|
requestId,
|
|
60
111
|
...(progress ?? { statusCode }),
|
|
61
112
|
msg: progress ? `${platform} bundle ${progress.percent}%` : `${platform} bundle ${kind} ${stage}`,
|
|
113
|
+
...(stage === 'started' && !prefetch ? { url: `${url.pathname}${url.search}` } : {}),
|
|
62
114
|
...(pid ? { clientPid: pid } : {}),
|
|
63
115
|
});
|
|
64
116
|
} catch {}
|
|
@@ -2,5 +2,5 @@ import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
|
2
2
|
|
|
3
3
|
export function bundleResponseMiddleware(
|
|
4
4
|
write: (record: Record<string, unknown>) => unknown,
|
|
5
|
-
options?: { runLsof?: (args: string[]) => Promise<string
|
|
5
|
+
options?: { runLsof?: (args: string[]) => Promise<string>; manifests?: boolean },
|
|
6
6
|
): (req: IncomingMessage, res: ServerResponse, next: (error?: unknown) => unknown) => unknown;
|
|
@@ -4,6 +4,7 @@ const fs = require('node:fs');
|
|
|
4
4
|
const os = require('node:os');
|
|
5
5
|
const path = require('node:path');
|
|
6
6
|
const { execFile } = require('node:child_process');
|
|
7
|
+
const http = require('node:http');
|
|
7
8
|
const { createRequire } = require('node:module');
|
|
8
9
|
const { pathToFileURL } = require('node:url');
|
|
9
10
|
const { bundleResponseMiddleware } = require('./bundle-response.cjs');
|
|
@@ -17,6 +18,7 @@ const OK_PREFIX = 'stim-metro-store: sharing Metro transforms through ';
|
|
|
17
18
|
|
|
18
19
|
let announced = false;
|
|
19
20
|
let warned = false;
|
|
21
|
+
let armed = false;
|
|
20
22
|
|
|
21
23
|
function warn(reason) {
|
|
22
24
|
if (warned) return;
|
|
@@ -125,6 +127,25 @@ function runLsof(args) {
|
|
|
125
127
|
);
|
|
126
128
|
}
|
|
127
129
|
|
|
130
|
+
function armManifestObserver() {
|
|
131
|
+
const port = Number(process.env.STIM_METRO_PORT);
|
|
132
|
+
if (armed || !Number.isInteger(port) || port <= 0) return;
|
|
133
|
+
armed = true;
|
|
134
|
+
let attempts = 0;
|
|
135
|
+
const probe = () => {
|
|
136
|
+
const retry = () => {
|
|
137
|
+
if (++attempts < 240) setTimeout(probe, 250).unref();
|
|
138
|
+
};
|
|
139
|
+
const request = http.get({ host: '127.0.0.1', port, path: '/_stim/metro-warmup', timeout: 2000 }, (response) => {
|
|
140
|
+
response.resume();
|
|
141
|
+
if (response.statusCode !== 200) retry();
|
|
142
|
+
});
|
|
143
|
+
request.on('timeout', () => request.destroy());
|
|
144
|
+
request.on('error', retry);
|
|
145
|
+
};
|
|
146
|
+
setTimeout(probe, 0).unref();
|
|
147
|
+
}
|
|
148
|
+
|
|
128
149
|
function appendStore(config, defaultConfig) {
|
|
129
150
|
const output = config && typeof config === 'object' ? config : {};
|
|
130
151
|
const configuredStores = output.cacheStores != null ? output.cacheStores : defaultConfig.cacheStores;
|
|
@@ -139,8 +160,9 @@ function appendStore(config, defaultConfig) {
|
|
|
139
160
|
const enhanced = enhanceMiddleware ? enhanceMiddleware(middleware, metroServer) : middleware;
|
|
140
161
|
const observe = bundleResponseMiddleware(
|
|
141
162
|
(record) => process.stderr.write(`stim-bundle-response: ${JSON.stringify(record)}\n`),
|
|
142
|
-
{ runLsof: process.platform === 'darwin' ? runLsof : undefined },
|
|
163
|
+
{ runLsof: process.platform === 'darwin' ? runLsof : undefined, manifests: true },
|
|
143
164
|
);
|
|
165
|
+
armManifestObserver();
|
|
144
166
|
return (req, res, next) => observe(req, res, (error) => (error ? next(error) : enhanced(req, res, next)));
|
|
145
167
|
},
|
|
146
168
|
},
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { v as withDirLock$1, y as withDirLockAsync$1 } from "./paths-DQtTgsBf.mjs";
|
|
2
|
-
import { d as getConfigDir } from "./config-BZhXY15H.mjs";
|
|
3
|
-
import { renameSync, rmSync, writeFileSync } from "node:fs";
|
|
4
|
-
import { ensurePrivateDir } from "@stim-cli/core";
|
|
5
|
-
import { createdDevicesFile, createdDevicesLock, readCreatedDevices, readCreatedDevices as readCreatedDevices$1 } from "@stim-cli/core/state";
|
|
6
|
-
//#region src/devices/created-devices.ts
|
|
7
|
-
function update(platform, change) {
|
|
8
|
-
const dir = getConfigDir();
|
|
9
|
-
withDirLock$1(createdDevicesLock(), () => {
|
|
10
|
-
const current = readCreatedDevices();
|
|
11
|
-
const entries = new Set(current[platform]);
|
|
12
|
-
if (!change(entries)) return;
|
|
13
|
-
const next = {
|
|
14
|
-
version: 1,
|
|
15
|
-
ios: [...current.ios],
|
|
16
|
-
android: [...current.android],
|
|
17
|
-
web: [...current.web],
|
|
18
|
-
[platform]: [...entries]
|
|
19
|
-
};
|
|
20
|
-
const file = createdDevicesFile();
|
|
21
|
-
const tmp = `${file}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;
|
|
22
|
-
writeFileSync(tmp, `${JSON.stringify(next, null, 2)}\n`, { mode: 384 });
|
|
23
|
-
try {
|
|
24
|
-
renameSync(tmp, file);
|
|
25
|
-
} catch (error) {
|
|
26
|
-
rmSync(tmp, { force: true });
|
|
27
|
-
throw error;
|
|
28
|
-
}
|
|
29
|
-
}, { ensureParent: () => ensurePrivateDir(dir) });
|
|
30
|
-
}
|
|
31
|
-
function recordCreatedDevice(platform, id) {
|
|
32
|
-
update(platform, (entries) => entries.size !== entries.add(id).size);
|
|
33
|
-
}
|
|
34
|
-
function forgetCreatedDevice(platform, id) {
|
|
35
|
-
update(platform, (entries) => entries.delete(id));
|
|
36
|
-
}
|
|
37
|
-
/** Waits asynchronously for the ledger lock, then records the device. */
|
|
38
|
-
function recordCreatedDeviceAsync(platform, id) {
|
|
39
|
-
return withDirLockAsync$1(createdDevicesLock(), () => recordCreatedDevice(platform, id), { ensureParent: () => ensurePrivateDir(getConfigDir()) });
|
|
40
|
-
}
|
|
41
|
-
/** Waits asynchronously for the ledger lock, then atomically forgets the device. The synchronous transaction decides whether to commit the removal; cancellation stops admission. */
|
|
42
|
-
function forgetCreatedDeviceAsync(platform, id, signal, transaction = (forget) => {
|
|
43
|
-
forget();
|
|
44
|
-
return true;
|
|
45
|
-
}) {
|
|
46
|
-
return withDirLockAsync$1(createdDevicesLock(), () => transaction(() => forgetCreatedDevice(platform, id)), {
|
|
47
|
-
ensureParent: () => ensurePrivateDir(getConfigDir()),
|
|
48
|
-
signal
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
//#endregion
|
|
52
|
-
export { recordCreatedDeviceAsync as a, recordCreatedDevice as i, forgetCreatedDeviceAsync as n, readCreatedDevices$1 as r, forgetCreatedDevice as t };
|
package/dist/paths-DQtTgsBf.mjs
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { existsSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
2
|
-
import { buildCacheRoot as sharedBuildCache, ensurePrivateDir, withDirLock as withDirLock$1, withDirLockAsync as withDirLockAsync$1, workspaceId as workspaceId$1, workspaceName as workspaceName$1, workspaceStateDir as workspaceDir } from "@stim-cli/core";
|
|
3
|
-
import { emulatorLogFile, readJsonObject, sharedCcache as sharedCcache$1, sharedCompilationCache as sharedCompilationCache$1, supervisorLogFile, supervisorPidFile, workspaceAgentDeviceDir, workspaceDerivedData, workspaceLogErrorIndex, workspaceLogsDir as workspaceLogsDir$1, workspaceMetadataFile, workspaceStateFile as workspaceStateFile$1, workspaceStateLock } from "@stim-cli/core/state";
|
|
4
|
-
import { join, resolve } from "path";
|
|
5
|
-
//#region src/workspace/paths.ts
|
|
6
|
-
function ensureWorkspaceStorage(projectRoot) {
|
|
7
|
-
const canonicalRoot = resolve(projectRoot);
|
|
8
|
-
const dir = workspaceDir(canonicalRoot);
|
|
9
|
-
const file = workspaceMetadataFile(canonicalRoot);
|
|
10
|
-
ensurePrivateDir(dir);
|
|
11
|
-
return withDirLock$1(join(dir, "metadata.lock"), () => {
|
|
12
|
-
if (!existsSync(file)) {
|
|
13
|
-
const metadata = {
|
|
14
|
-
projectRoot: canonicalRoot,
|
|
15
|
-
workspace: workspaceName$1(canonicalRoot),
|
|
16
|
-
version: 1
|
|
17
|
-
};
|
|
18
|
-
const tmp = `${file}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;
|
|
19
|
-
writeFileSync(tmp, `${JSON.stringify(metadata, null, 2)}\n`);
|
|
20
|
-
try {
|
|
21
|
-
renameSync(tmp, file);
|
|
22
|
-
} catch (error) {
|
|
23
|
-
rmSync(tmp, { force: true });
|
|
24
|
-
throw error;
|
|
25
|
-
}
|
|
26
|
-
return dir;
|
|
27
|
-
}
|
|
28
|
-
if (readJsonObject(file)?.projectRoot === canonicalRoot) return dir;
|
|
29
|
-
const error = /* @__PURE__ */ new Error(`Stim workspace collision at ${dir}: its workspace.json does not belong to ${canonicalRoot}.`);
|
|
30
|
-
error.code = "STIM_WORKSPACE_COLLISION";
|
|
31
|
-
throw error;
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
/** Initializes or validates workspace storage after asynchronously acquiring its metadata lock. */
|
|
35
|
-
function ensureWorkspaceStorageAsync(projectRoot, signal) {
|
|
36
|
-
signal?.throwIfAborted();
|
|
37
|
-
const dir = workspaceDir(resolve(projectRoot));
|
|
38
|
-
ensurePrivateDir(dir);
|
|
39
|
-
return withDirLockAsync$1(join(dir, "metadata.lock"), () => ensureWorkspaceStorage(projectRoot), { signal });
|
|
40
|
-
}
|
|
41
|
-
//#endregion
|
|
42
|
-
export { workspaceStateLock as _, sharedCcache$1 as a, supervisorPidFile as c, workspaceDir as d, workspaceId$1 as f, workspaceStateFile$1 as g, workspaceName$1 as h, sharedBuildCache as i, workspaceAgentDeviceDir as l, workspaceLogsDir$1 as m, ensureWorkspaceStorage as n, sharedCompilationCache$1 as o, workspaceLogErrorIndex as p, ensureWorkspaceStorageAsync as r, supervisorLogFile as s, emulatorLogFile as t, workspaceDerivedData as u, withDirLock$1 as v, withDirLockAsync$1 as y };
|