stim 1.17.2 → 1.19.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.
Files changed (162) hide show
  1. package/README.md +50 -1
  2. package/dist/{activity-IRvJY_ru.mjs → activity-BSw0x84R.mjs} +4 -4
  3. package/dist/{agent-device-usage-output-BK41vnzN.mjs → agent-device-usage-output-Bjxu_VmX.mjs} +8 -8
  4. package/dist/{android-B9yaNKwa.mjs → android-BXc6BmEi.mjs} +658 -404
  5. package/dist/{android-B_YNZy61.mjs → android-BdQC6zs1.mjs} +9 -9
  6. package/dist/android-BvV1gGdN.mjs +4 -0
  7. package/dist/{android-DE4v59Mb.mjs → android-DE5g_5gv.mjs} +2 -2
  8. package/dist/{android-cas-ZFpjJBL_.mjs → android-cas-C87geAg-.mjs} +5 -5
  9. package/dist/android-cas-compiler.mjs +2 -2
  10. package/dist/api-DIf_s86s.mjs +150 -0
  11. package/dist/api-run.d.mts +1 -0
  12. package/dist/api-run.mjs +145 -0
  13. package/dist/api.d.mts +218 -0
  14. package/dist/api.mjs +2 -0
  15. package/dist/{app-install-VPkI5WEg.mjs → app-install-CFI4ptUL.mjs} +33 -13
  16. package/dist/{attempt-Bk2ouQVL.mjs → attempt-DW-mQqM7.mjs} +14 -4
  17. package/dist/{web-Dl0KSRHf.mjs → browser-web-CDhqQxhv.mjs} +138 -176
  18. package/dist/{budget-DfcgFdQB.mjs → budget-Dz-kyXLv.mjs} +1391 -58
  19. package/dist/build-facts-B87vo-Im.d.mts +142 -0
  20. package/dist/{cache-manifest-DnUHBJaU.mjs → cache-manifest-DiwKSyv9.mjs} +3 -3
  21. package/dist/cache-manifest.mjs +1 -1
  22. package/dist/{chrome-BrcVWQyD.mjs → chrome-BTUOo8p2.mjs} +1 -1
  23. package/dist/cli-C9Zvgbdc.mjs +68 -0
  24. package/dist/cli.mjs +1 -1
  25. package/dist/{client-SvBdgObD.mjs → client-CuUo8Nvg.mjs} +381 -49
  26. package/dist/collector-run.d.mts +6 -0
  27. package/dist/collector-run.mjs +9 -9
  28. package/dist/{command-output-CDAIFD-8.mjs → command-output-Bt8ygHE7.mjs} +2 -2
  29. package/dist/{config-D0DbpZtM.mjs → config-DC5jEtd1.mjs} +9 -5
  30. package/dist/{created-devices-CpvzBL25.mjs → created-devices-D0s26Hx5.mjs} +2 -2
  31. package/dist/{dependency-state-CLcBHH2M.mjs → dependency-state-DKaS1OM9.mjs} +2 -2
  32. package/dist/{detached-entry-CiTEgMR1.mjs → detached-entry-pB_IPfV4.mjs} +1 -1
  33. package/dist/{dev-client-B-XC4uRH.mjs → dev-client-CDY_zAmD.mjs} +2 -2
  34. package/dist/{device-C8IOoJPv.mjs → device-BHw0WlHl.mjs} +8 -8
  35. package/dist/{device-capacity-ZC4XSZ4R.mjs → device-capacity-BoN1jQkO.mjs} +25 -14
  36. package/dist/device-host-worker.mjs +19 -19
  37. package/dist/{gradle-dJpre3Yn.mjs → device-ios-B2ruohE-.mjs} +661 -107
  38. package/dist/{device-lease-DpoS36_u.mjs → device-lease-Cu7PtQpZ.mjs} +9 -9
  39. package/dist/{device-lease-run-B8YltIH_.mjs → device-lease-run-D38SnZtt.mjs} +4 -4
  40. package/dist/{device-pool-3o7s5lo4.mjs → device-pool-CP4rAsHx.mjs} +3 -3
  41. package/dist/{device-remote-hFSkpfQu.mjs → device-remote-B5GiUifk.mjs} +15 -16
  42. package/dist/{doctor-CFv1fCrF.mjs → doctor-PRJH94v6.mjs} +61 -34
  43. package/dist/doctor-watchman-wZhyTdp4.mjs +259 -0
  44. package/dist/{error-diagnostics-C-NMnhrk.mjs → error-diagnostics--v5HGOU0.mjs} +11 -11
  45. package/dist/{exec-CaErVv7t.mjs → exec-i8GDPwq9.mjs} +93 -6
  46. package/dist/{gc-DEmkg3Xh.mjs → gc-CyHMcKcn.mjs} +25 -471
  47. package/dist/{guide-CSmhMTf8.mjs → guide-dRaQJJk9.mjs} +681 -507
  48. package/dist/{hosted-android-E1Heoqnv.mjs → hosted-android-Bs7fytj7.mjs} +3 -3
  49. package/dist/{hosted-client-Bp4knSwu.mjs → hosted-client-C5G4h_OJ.mjs} +2 -2
  50. package/dist/{hosted-ios-BnbeYOUD.mjs → hosted-ios-Bik035eL.mjs} +1 -1
  51. package/dist/{hosted-logs-OcgIBvCT.mjs → hosted-logs-CI9Az9a4.mjs} +9 -9
  52. package/dist/{hosted-macos-DcxKjtfH.mjs → hosted-macos-DABm3ScO.mjs} +5 -5
  53. package/dist/{hosted-native-1Ebbig4w.mjs → hosted-native-DbV2aUVw.mjs} +13 -9
  54. package/dist/{idle-shutdown-IGyNV8Cr.mjs → idle-shutdown-DYiMBn34.mjs} +7 -8
  55. package/dist/{ios-DSfnPfse.mjs → ios-BWbHFZVz.mjs} +19 -7
  56. package/dist/{ios-Cr1h5gnO.mjs → ios-DCrkgXEM.mjs} +1 -1
  57. package/dist/ios-DYUr9LGc.mjs +8 -0
  58. package/dist/ios-ITYno9rO.mjs +2241 -0
  59. package/dist/{ios-device-pAN4t54-.mjs → ios-device-CJ_ZOGky.mjs} +3 -3
  60. package/dist/{ios-device-Ee7sDXfp.mjs → ios-device-CrW8aMb5.mjs} +1 -1
  61. package/dist/{ios-state-8L3lgum6.mjs → ios-state-By0XuLTQ.mjs} +1 -1
  62. package/dist/{launch-verify-lTnWZikR.mjs → launch-verify-DCveSE6d.mjs} +5 -5
  63. package/dist/{logs-BAaS7gS2.mjs → logs-Bao1HOMy.mjs} +13 -13
  64. package/dist/{macos-BIRQS90f.mjs → macos-ciyBdTY5.mjs} +194 -132
  65. package/dist/macos-nIOATJmR.mjs +2 -0
  66. package/dist/macos-run.mjs +1 -1
  67. package/dist/maintenance-run.mjs +349 -47
  68. package/dist/manifest-CX0d1IkZ.mjs +148 -0
  69. package/dist/{metro-g8NqiJp-.mjs → metro-DI2AjPF_.mjs} +196 -43
  70. package/dist/{metro-gateway-C-ijGI2F.mjs → metro-gateway-BxpJLIwh.mjs} +4 -4
  71. package/dist/{metro-store-CDDZHtPl.mjs → metro-store-BAHFcJm6.mjs} +16 -2
  72. package/dist/{build-plan-BDsSi09V.mjs → miss-reason-CjQCOKqq.mjs} +207 -249
  73. package/dist/{named-ports-C8m8EQs2.mjs → named-ports-B4iWH4E-.mjs} +70 -8
  74. package/dist/{native-runtime-BEK171xQ.mjs → native-runtime-BGxsbfny.mjs} +6 -6
  75. package/dist/{ndjson-PclOIwVY.mjs → ndjson-LGZAMsqa.mjs} +8 -4
  76. package/dist/offload-worker.d.mts +3 -45
  77. package/dist/offload-worker.mjs +11 -11
  78. package/dist/{ownership-DyRQru0q.mjs → ownership-EB0ySdGK.mjs} +3 -3
  79. package/dist/{page-QF_Ke10s.mjs → page-Bv9s2KwY.mjs} +1 -1
  80. package/dist/placement-log-Dxe34rJm.mjs +88 -0
  81. package/dist/plan-placement-BVY59qa8.mjs +290 -0
  82. package/dist/{ports-4nYqxPWC.mjs → ports-ByPc0_97.mjs} +3 -3
  83. package/dist/{prebuild-D7RUMkwN.mjs → prebuild-BKJ3wJI1.mjs} +5 -5
  84. package/dist/preview-BbSottmO.mjs +986 -0
  85. package/dist/{rolldown-runtime-BsOwBuO_.mjs → process-identity-Biv3arCO.mjs} +11 -1
  86. package/dist/project-B5eQ1USs.mjs +612 -0
  87. package/dist/{pull-request-pxnDCQzn.mjs → pull-request-IHNdMnG8.mjs} +1 -1
  88. package/dist/pull-requests.mjs +1 -1
  89. package/dist/react-native-ios-BMh2i25I.mjs +2 -0
  90. package/dist/react-native-ios-CSpIxexZ.mjs +2083 -0
  91. package/dist/{recordings-BNgsD1Tr.mjs → recordings-Bv8McZN4.mjs} +1 -1
  92. package/dist/{reload-DcRxj3qG.mjs → reload-rAPdqeRR.mjs} +14 -15
  93. package/dist/{remote-cache-Ci4DQYYj.mjs → remote-cache-N3hAEaAL.mjs} +5 -5
  94. package/dist/{run-CkE9y0nc.mjs → run-lAkle1-c.mjs} +5 -5
  95. package/dist/{server-bare-BkrSxSsZ.mjs → server-bare-CkIjnegq.mjs} +5 -6
  96. package/dist/server-expo-DGsdUGX2.mjs +2 -0
  97. package/dist/{server-expo-CHTyXD0G.mjs → server-expo-n3tUi3Em.mjs} +5 -6
  98. package/dist/{settings-SR9OmW9h.mjs → settings-2am7TSxp.mjs} +5 -5
  99. package/dist/{settings-Cfd-0r2d.mjs → settings-CxgngUZk.mjs} +116 -103
  100. package/dist/{settings-BBpMcDbD.mjs → settings-Djl-mpjX.mjs} +1 -1
  101. package/dist/settings.schema.json +198 -9
  102. package/dist/{simslim-BWNrc3M3.mjs → simslim-D9LkJxIO.mjs} +7 -7
  103. package/dist/{slot-launch-DmjBmpQV.mjs → slot-launch-HV_KtPIw.mjs} +6 -6
  104. package/dist/{spawn-claims-D0XfSe8u.mjs → spawn-claims-Kqiifsk2.mjs} +1 -1
  105. package/dist/{spawn-entry-jw19m8Nl.mjs → spawn-entry-Dcb7sDUz.mjs} +1 -0
  106. package/dist/{stage-CzaiwFsI.mjs → stage-BgaZJVZY.mjs} +14 -3
  107. package/dist/{start-AlfCPRVU.mjs → start-D8NbxNBb.mjs} +1 -1
  108. package/dist/{start-DUz3mYdb.mjs → start-DtxthMfI.mjs} +34 -27
  109. package/dist/{state-PeQiJuIu.mjs → state-D2KtnALG.mjs} +4 -4
  110. package/dist/{state-DyaNTgfR.mjs → state-Tp4uImDS.mjs} +5 -3
  111. package/dist/{state-B4PQFXMW.d.mts → state-lKh8shBp.d.mts} +2 -3
  112. package/dist/{stats-Bq4fJOdB.mjs → stats-8EJ5ivFT.mjs} +6 -6
  113. package/dist/{status-DlKvVJBE.mjs → status-BEeL6IKz.mjs} +6 -4
  114. package/dist/{status-BA2pehwf.mjs → status-BOyp0CUl.mjs} +31 -34
  115. package/dist/{stim-desktop-Cnz8CPnl.mjs → stim-desktop-C65jk_q2.mjs} +1 -1
  116. package/dist/{stim-installations-QMEI32v1.mjs → stim-installations-DbmUjsLv.mjs} +1 -1
  117. package/dist/stop-D0UIpZuh.mjs +72 -0
  118. package/dist/{stop-zF1y04f2.mjs → stop-DRipAg-e.mjs} +2 -2
  119. package/dist/{stop-DQIasgKp.mjs → stop-zDlknFoz.mjs} +79 -33
  120. package/dist/supervisor-run.d.mts +24 -22
  121. package/dist/supervisor-run.mjs +21 -22
  122. package/dist/{support-CsJNVfOc.mjs → support-CNqYkV0y.mjs} +7 -7
  123. package/dist/{support-WvD__tSV.mjs → support-DsNaFg6D.mjs} +5 -5
  124. package/dist/swiftpm-macos-aJzPAj1t.mjs +119 -0
  125. package/dist/{toolchain-DNyR3NPq.mjs → toolchain-C3xSoyUl.mjs} +475 -269
  126. package/dist/{trigger-Bemu8ytw.mjs → trigger-CAhmG-4s.mjs} +6 -6
  127. package/dist/trigger-CoalsMTV.mjs +2 -0
  128. package/dist/{warm-progress-DF4JRvYI.mjs → warm-progress-pFLB2e6P.mjs} +135 -38
  129. package/dist/{status-CzS4bPO9.mjs → watchman-BL1IdOtq.mjs} +75 -7
  130. package/dist/web-DFpFeZu5.mjs +2 -0
  131. package/dist/web-DbbrPUn0.mjs +127 -0
  132. package/dist/web-run.mjs +10 -10
  133. package/dist/{workspace-state-DqcCbpE7.mjs → workspace-state-CR9X86xJ.mjs} +3 -3
  134. package/dist/{ownership-BMLqyBgJ.mjs → workspaces-Djb2gfi9.mjs} +661 -23
  135. package/dist/{worktree-Be_7NLKy.mjs → worktree-BL4M1rhB.mjs} +252 -50
  136. package/dist/{worktree-j3IcFAI5.mjs → worktree-DV-A0LNL.mjs} +1 -1
  137. package/package.json +10 -5
  138. package/shim/bundle-response.cjs +2 -1
  139. package/shim/bundle-response.d.cts +1 -1
  140. package/shim/expo-metro-config.cjs +1 -1
  141. package/dist/build-progress-D0WkjCPd.mjs +0 -1036
  142. package/dist/build-slots-41v_d2x9.mjs +0 -142
  143. package/dist/cli-CYXb29oE.mjs +0 -51
  144. package/dist/deps-iKw0eD4P.mjs +0 -438
  145. package/dist/device-ios-C2Um-XUR.mjs +0 -412
  146. package/dist/errors-B6W7FkxQ.mjs +0 -15
  147. package/dist/guide-status-Du-ZQ3FD.mjs +0 -125
  148. package/dist/idle-BXG__1BA.mjs +0 -176
  149. package/dist/in-use-CvGOUn-x.mjs +0 -130
  150. package/dist/ios-BJ4XUSe1.mjs +0 -3867
  151. package/dist/native-run-D1Q56rAD.mjs +0 -158
  152. package/dist/preview-B-g9d7kV.mjs +0 -318
  153. package/dist/process-identity-BmRm1qV0.mjs +0 -12
  154. package/dist/project-D47Rh0ly.mjs +0 -276
  155. package/dist/server-expo-CeakhI8P.mjs +0 -2
  156. package/dist/state-BKa8wNN5.mjs +0 -148
  157. package/dist/stop-BIiM49EY.mjs +0 -48
  158. package/dist/stop-cause-rhmGfwvt.mjs +0 -97
  159. package/dist/trigger-CXts6qt1.mjs +0 -2
  160. package/dist/watchman-APYjXSQa.mjs +0 -48
  161. package/dist/workspace-process-lock-2mNzOlaB.mjs +0 -58
  162. package/dist/workspaces-Bcib97-6.mjs +0 -306
@@ -1,44 +1,222 @@
1
- import { t as getExecutor } from "./exec-CaErVv7t.mjs";
2
- import { E as upsertProject, H as projectDeviceSlots, S as removeProject, _ as loadConfig$1, a as clearDevice, d as getConfigDir, g as isPathPrefix, k as acquireAvdClaim, p as getProject } from "./config-D0DbpZtM.mjs";
3
- import { n as ownership_claim_exports, t as process_identity_exports } from "./process-identity-BmRm1qV0.mjs";
4
- import { a as pullRequestLookup, r as endedPullRequest } from "./pull-request-pxnDCQzn.mjs";
5
- import { a as formatElapsed, h as shortUdid, i as formatDuration, l as phaseLine, p as releasedLeaseFact, u as plural } from "./command-output-CDAIFD-8.mjs";
6
- import { $ as cloneIgnoredEntries, A as readCommittedSettings, H as unknownSettingKeys, P as resolveSettings, Q as branchExists, R as settingShapeErrors, St as warmWorktreePaths, _t as resolveFullRef, at as gitCommonDirOnDisk, bt as sourceCheckoutOf, ct as hasUncommittedWork, dt as listWorktrees, et as deleteBranch, ft as locallyKnownUpstream, ht as removeWorktree, i as SETTING_SHAPE_REMEDY, it as gitCommonDir, lt as isPodInstallChurn, mt as readWorktreeExclude, ot as hasPopulatedSubmodules, pt as podsOutOfSync, rt as dirtyPaths, st as hasRemote, tt as depsOutOfSync, xt as unpushedCommits, yt as restoreFile } from "./settings-Cfd-0r2d.mjs";
7
- import { n as appProjectProblem, s as findProjectRoot$1 } from "./project-D47Rh0ly.mjs";
8
- import { l as resolveProjectMetro, o as pidExists, r as killMetroTree, u as signalProcessTree } from "./metro-g8NqiJp-.mjs";
9
- import { g as workspaceAgentDeviceDir, i as recordWorkspaceUse, r as readWorkspaceState$1, v as workspaceDir } from "./workspace-state-DqcCbpE7.mjs";
10
- import { o as readWebRecord } from "./state-PeQiJuIu.mjs";
11
- import { a as machineNumber } from "./budget-DfcgFdQB.mjs";
12
- import { n as withIdleWorkspace, t as emptyWorkspaceDir } from "./in-use-CvGOUn-x.mjs";
13
- import { t as agentDeviceDaemon } from "./activity-IRvJY_ru.mjs";
14
- import { u as releaseWorkspaceLeases } from "./device-lease-DpoS36_u.mjs";
15
- import { a as clearRemoteSession, c as readMetroTunnel, d as readRemoteSessionId, i as clearManagedMetroTunnel, u as readRemoteSession } from "./state-BKa8wNN5.mjs";
16
- import { ft as parkedMaxSetting, ot as POOL_SETTING_REMEDY } from "./android-B_YNZy61.mjs";
17
- import { a as workspaceLinks, i as workspaceLinkLine } from "./stim-desktop-Cnz8CPnl.mjs";
18
- import { g as teardownOwnedIosSim, h as teardownOwnedBrowser, i as stopTunnel, l as withManagedTunnelRemovalLock, m as teardownOwnedAvd, s as withManagedRemoteWorktreeRemovalLock, t as resolveSupervisorTarget } from "./ownership-BMLqyBgJ.mjs";
19
- import { t as clearNamedPorts } from "./named-ports-C8m8EQs2.mjs";
20
- import { l as withdrawDevServerStopRequest, s as requestDevServerStop } from "./stop-cause-rhmGfwvt.mjs";
21
- import { C as podInstallCommand, u as HEARTBEAT_INTERVAL_MS } from "./toolchain-DNyR3NPq.mjs";
22
- import { n as verifyCollectorOwnership } from "./ownership-DyRQru0q.mjs";
23
- import { t as stopMacosApp } from "./stop-BIiM49EY.mjs";
24
- import { a as runPodInstall, i as runCaptured, n as podsAreStale, r as readPodState, t as DEPS_ERROR } from "./deps-iKw0eD4P.mjs";
25
- import { i as stopHostedAndroid } from "./hosted-android-E1Heoqnv.mjs";
26
- import { f as resolveEasCliBin } from "./remote-cache-Ci4DQYYj.mjs";
27
- import { i as endRecordedSession } from "./device-remote-hFSkpfQu.mjs";
28
- import { n as hasInstalledDependencies, r as installedNpmTreeIsValid, t as dependencyState } from "./dependency-state-CLcBHH2M.mjs";
29
- import { a as forgetStatusMeasures, s as mergeState, t as startWarmProgress } from "./warm-progress-DF4JRvYI.mjs";
30
- import { r as workspaceRecordingEnabled } from "./recordings-BNgsD1Tr.mjs";
31
- import { r as stopHostedIos } from "./hosted-ios-BnbeYOUD.mjs";
32
- import { createHash, randomUUID } from "node:crypto";
1
+ import { n as ownership_claim_exports, t as process_identity_exports } from "./process-identity-Biv3arCO.mjs";
2
+ import { t as getExecutor } from "./exec-i8GDPwq9.mjs";
3
+ import { a as formatElapsed, h as shortUdid, i as formatDuration, l as phaseLine, p as releasedLeaseFact, u as plural } from "./command-output-Bt8ygHE7.mjs";
4
+ import { E as upsertProject, H as projectDeviceSlots, S as removeProject, _ as loadConfig$1, a as clearDevice, d as getConfigDir, g as isPathPrefix, k as acquireAvdClaim, p as getProject } from "./config-DC5jEtd1.mjs";
5
+ import { g as workspaceAgentDeviceDir, i as recordWorkspaceUse, r as readWorkspaceState$1, v as workspaceDir } from "./workspace-state-CR9X86xJ.mjs";
6
+ import { C as clearRemoteSession, E as readMetroTunnel, O as readRemoteSession, S as clearManagedMetroTunnel, a as isMobileProject, k as readRemoteSessionId, r as findProjectRoot } from "./project-B5eQ1USs.mjs";
7
+ import { $ as depsOutOfSync, B as settingShapeErrors, I as resolveSettings, Q as deleteBranch, W as unknownSettingKeys, X as branchExists, Z as cloneIgnoredEntries, _t as restoreFile, at as hasRemote, bt as warmWorktreePaths, dt as podsOutOfSync, ft as readWorktreeExclude, ht as resolveFullRef, i as SETTING_SHAPE_REMEDY, it as hasPopulatedSubmodules, j as readCommittedSettings, lt as listWorktrees, nt as gitCommonDir, ot as hasUncommittedWork, pt as removeWorktree, rt as gitCommonDirOnDisk, st as isPodInstallChurn, tt as dirtyPaths, ut as locallyKnownUpstream, vt as sourceCheckoutOf, yt as unpushedCommits } from "./settings-CxgngUZk.mjs";
8
+ import { d as signalProcessTree, r as killMetroTree, s as pidExists, u as resolveProjectMetro } from "./metro-DI2AjPF_.mjs";
9
+ import { o as readWebRecord } from "./state-D2KtnALG.mjs";
10
+ import { b as withdrawDevServerStopRequest, o as machineNumber, v as requestDevServerStop } from "./budget-Dz-kyXLv.mjs";
11
+ import { D as teardownOwnedAvd, O as teardownOwnedBrowser, d as emptyWorkspaceDir, f as withIdleWorkspace, g as stopTunnel, k as teardownOwnedIosSim, m as resolveSupervisorTarget, x as withManagedTunnelRemovalLock, y as withManagedRemoteWorktreeRemovalLock } from "./workspaces-Djb2gfi9.mjs";
12
+ import { t as agentDeviceDaemon } from "./activity-BSw0x84R.mjs";
13
+ import { u as releaseWorkspaceLeases } from "./device-lease-Cu7PtQpZ.mjs";
14
+ import { ft as parkedMaxSetting, ot as POOL_SETTING_REMEDY } from "./android-BdQC6zs1.mjs";
15
+ import { a as workspaceLinks, i as workspaceLinkLine } from "./stim-desktop-C65jk_q2.mjs";
16
+ import { t as clearNamedPorts } from "./named-ports-B4iWH4E-.mjs";
17
+ import { t as macosAppPresent } from "./state-Tp4uImDS.mjs";
18
+ import { c as podsAreStale, d as runCaptured, f as runPodInstall, h as HEARTBEAT_INTERVAL_MS, j as podInstallCommand, l as readPodState, s as DEPS_ERROR } from "./toolchain-C3xSoyUl.mjs";
19
+ import { i as stopHostedAndroid } from "./hosted-android-Bs7fytj7.mjs";
20
+ import { f as resolveEasCliBin } from "./remote-cache-N3hAEaAL.mjs";
21
+ import { i as endRecordedSession } from "./device-remote-B5GiUifk.mjs";
22
+ import { n as verifyCollectorOwnership } from "./ownership-EB0ySdGK.mjs";
23
+ import { r as stopHostedIos } from "./hosted-ios-Bik035eL.mjs";
24
+ import { n as stopMacosApp } from "./stop-D0UIpZuh.mjs";
25
+ import { a as pullRequestLookup, r as endedPullRequest } from "./pull-request-IHNdMnG8.mjs";
26
+ import { a as forgetStatusMeasures, s as mergeState, t as startWarmProgress } from "./warm-progress-pFLB2e6P.mjs";
27
+ import { r as workspaceRecordingEnabled } from "./recordings-Bv8McZN4.mjs";
28
+ import { n as hasInstalledDependencies, r as installedNpmTreeIsValid, t as dependencyState } from "./dependency-state-DKaS1OM9.mjs";
33
29
  import { chmodSync, existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, statSync, utimesSync, writeFileSync } from "node:fs";
34
30
  import { basename, dirname, join, relative } from "node:path";
35
- import { existsSync as existsSync$1, realpathSync as realpathSync$1, rmSync as rmSync$1 } from "fs";
36
31
  import { basename as basename$1, dirname as dirname$1, isAbsolute as isAbsolute$1, join as join$1, relative as relative$1, resolve as resolve$1 } from "path";
37
- import { withDirLock, workspaceName } from "@stim-cli/core";
38
32
  import { LAST_BUILD_KEYS, archiveDir, archiveEnabled, archiveLock, archiveRoot, archivedUsage, countErrorEntries, endedAgentSessionOf, listRecordedDevices, loadConfig, queryLogs, readArchives, readBuildHistory, readJsonObject, readLastBuilds, readMacosRecord, readPullRequestCache, readWorkspaceState, recordingEnabled, sortByTs } from "@stim-cli/core/state";
39
- import { claimRemoveCommand, clearFreeClaimSet, readClaimSet, releaseClaim, tryAcquireClaim } from "@stim-cli/core/ownership-claim";
40
33
  import { homedir } from "node:os";
41
34
  import chalk from "chalk";
35
+ import { existsSync as existsSync$1, readFileSync as readFileSync$1, readdirSync as readdirSync$1, readlinkSync as readlinkSync$1, realpathSync as realpathSync$1, renameSync as renameSync$1, rmSync as rmSync$1, symlinkSync as symlinkSync$1, unlinkSync as unlinkSync$1, writeFileSync as writeFileSync$1 } from "fs";
36
+ import { withDirLock, workspaceName } from "@stim-cli/core";
37
+ import { claimRemoveCommand, clearFreeClaimSet, readClaimSet, releaseClaim, tryAcquireClaim } from "@stim-cli/core/ownership-claim";
38
+ import { createHash, randomUUID } from "node:crypto";
39
+ import { createHash as createHash$1 } from "crypto";
40
+ //#region src/workspace/pods-relocate.ts
41
+ const CHECKSUMS_HEADER = "SPEC CHECKSUMS:\n";
42
+ const GENERATED_DIRS = [
43
+ "Target Support Files",
44
+ "Pods.xcodeproj",
45
+ "Local Podspecs"
46
+ ];
47
+ function normalize$1(text) {
48
+ return text.replace(/\r\n/g, "\n").trimEnd() + "\n";
49
+ }
50
+ function splitChecksums(text) {
51
+ const start = text.indexOf(`\n${CHECKSUMS_HEADER}`);
52
+ if (start === -1) return null;
53
+ const bodyStart = start + 1 + 16;
54
+ const lines = text.slice(bodyStart).split("\n");
55
+ const entries = /* @__PURE__ */ new Map();
56
+ let used = 0;
57
+ for (const line of lines) {
58
+ const match = /^ {2}"?([^":\s]+)"?: ([0-9a-f]{40})$/.exec(line);
59
+ if (!match) break;
60
+ entries.set(match[1], match[2]);
61
+ used += line.length + 1;
62
+ }
63
+ return {
64
+ before: text.slice(0, bodyStart),
65
+ entries,
66
+ after: text.slice(bodyStart + used)
67
+ };
68
+ }
69
+ function pathPattern(root, flags = "") {
70
+ const escaped = root.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
71
+ return new RegExp(`(?:(?<![\\p{L}\\p{N}_.-])|(?<=-[IFL]))${escaped}(?![\\p{L}\\p{N}_.-])`, `u${flags}`);
72
+ }
73
+ function sha1(text) {
74
+ return createHash$1("sha1").update(text).digest("hex");
75
+ }
76
+ function relocatePath(text, from, to) {
77
+ return text.replace(pathPattern(from, "g"), () => to);
78
+ }
79
+ /**
80
+ * Decides whether a carried Pods directory differs from the checkout's Podfile.lock only by
81
+ * checksums of podspecs that embed the source checkout's absolute path. Any other difference,
82
+ * a missing podspec, a podspec that does not embed the path, or a carried checksum that does
83
+ * not match the carried podspec refuses.
84
+ */
85
+ function planPodsRelocation({ podfileLock, manifest, sourceRoot, readPodspec }) {
86
+ const lock = splitChecksums(normalize$1(podfileLock));
87
+ const carried = splitChecksums(normalize$1(manifest));
88
+ if (!lock || !carried) return { ok: false };
89
+ if (lock.before !== carried.before || lock.after !== carried.after) return { ok: false };
90
+ if (lock.entries.size !== carried.entries.size) return { ok: false };
91
+ const pods = [];
92
+ for (const [pod, checksum] of lock.entries) {
93
+ const carriedChecksum = carried.entries.get(pod);
94
+ if (carriedChecksum === void 0) return { ok: false };
95
+ if (carriedChecksum === checksum) continue;
96
+ if (!/^[\w.+-]+$/.test(pod)) return { ok: false };
97
+ const podspec = readPodspec(pod);
98
+ if (podspec === null || sha1(podspec) !== carriedChecksum) return { ok: false };
99
+ if (!pathPattern(sourceRoot).test(podspec)) return { ok: false };
100
+ pods.push(pod);
101
+ }
102
+ return pods.length > 0 ? {
103
+ ok: true,
104
+ pods
105
+ } : { ok: false };
106
+ }
107
+ function walkTextFiles(dir, visit) {
108
+ for (const entry of readdirSync$1(dir, { withFileTypes: true })) {
109
+ const path = join$1(dir, entry.name);
110
+ if (entry.isDirectory()) walkTextFiles(path, visit);
111
+ else if (entry.isFile()) visit(path);
112
+ }
113
+ }
114
+ function sourceNamer(sourceRoot, targetRoot, encoding) {
115
+ const encode = (value) => Buffer.from(value, "utf-8").toString(encoding);
116
+ const pattern = pathPattern(encode(sourceRoot));
117
+ const nested = targetRoot.startsWith(`${sourceRoot}/`) ? pathPattern(encode(targetRoot), "g") : null;
118
+ return (text) => pattern.test(nested ? text.replace(nested, "") : text);
119
+ }
120
+ function findPath(dir, text, bytes) {
121
+ for (const entry of readdirSync$1(dir, { withFileTypes: true })) {
122
+ const path = join$1(dir, entry.name);
123
+ if (entry.isSymbolicLink() && text(readlinkSync$1(path))) return path;
124
+ if (entry.isDirectory()) {
125
+ const found = findPath(path, text, bytes);
126
+ if (found) return found;
127
+ } else if (entry.isFile() && bytes(readFileSync$1(path).toString("latin1"))) return path;
128
+ }
129
+ return null;
130
+ }
131
+ function walkSymlinks(dir, visit) {
132
+ for (const entry of readdirSync$1(dir, { withFileTypes: true })) {
133
+ const path = join$1(dir, entry.name);
134
+ if (entry.isSymbolicLink()) visit(path);
135
+ else if (entry.isDirectory()) walkSymlinks(path, visit);
136
+ }
137
+ }
138
+ /**
139
+ * Makes a Pods directory cloned from `sourceRoot` read as one CocoaPods generated for
140
+ * `targetRoot`: it rewrites the source path in the generated text files and absolute symlinks,
141
+ * then points Pods/Manifest.lock at the checkout's Podfile.lock. When the locks already match,
142
+ * `pod install` would be skipped over Pods that still name the source path, so the same rewrite
143
+ * runs for them. Manifest.lock is removed before any rewrite and written back last, only after
144
+ * no file or symlink in Pods names the source path, so a refused, failed or interrupted run
145
+ * leaves it differing or absent and `pod install` still runs. `canRelocate: false` only
146
+ * withholds a matching Manifest.lock from Pods that name the source path.
147
+ */
148
+ function relocatePods({ podsDir, podfileLockPath, sourceRoot, targetRoot, canRelocate = true }) {
149
+ const manifestPath = join$1(podsDir, "Manifest.lock");
150
+ if (!existsSync$1(manifestPath) || !existsSync$1(podfileLockPath)) return { ok: false };
151
+ const podfileLock = readFileSync$1(podfileLockPath, "utf-8");
152
+ const manifest = readFileSync$1(manifestPath, "utf-8");
153
+ const pattern = pathPattern(sourceRoot);
154
+ const textNamesSource = sourceNamer(sourceRoot, targetRoot, "utf-8");
155
+ const bytesNameSource = sourceNamer(sourceRoot, targetRoot, "latin1");
156
+ let pods = [];
157
+ if (normalize$1(podfileLock) === normalize$1(manifest)) {
158
+ let names;
159
+ try {
160
+ names = findPath(podsDir, textNamesSource, bytesNameSource);
161
+ } catch (error) {
162
+ unlinkSync$1(manifestPath);
163
+ throw error;
164
+ }
165
+ if (!names) return { ok: false };
166
+ unlinkSync$1(manifestPath);
167
+ if (!canRelocate) return {
168
+ ok: false,
169
+ withheld: true
170
+ };
171
+ } else {
172
+ if (!canRelocate) return { ok: false };
173
+ const plan = planPodsRelocation({
174
+ podfileLock,
175
+ manifest,
176
+ sourceRoot,
177
+ readPodspec: (pod) => {
178
+ try {
179
+ return readFileSync$1(join$1(podsDir, "Local Podspecs", `${pod}.podspec.json`), "utf-8");
180
+ } catch {
181
+ return null;
182
+ }
183
+ }
184
+ });
185
+ if (!plan.ok) return plan;
186
+ pods = plan.pods;
187
+ }
188
+ for (const name of GENERATED_DIRS) {
189
+ const dir = join$1(podsDir, name);
190
+ if (!existsSync$1(dir)) continue;
191
+ walkTextFiles(dir, (file) => {
192
+ const buffer = readFileSync$1(file);
193
+ if (buffer.includes(0)) return;
194
+ const text = buffer.toString("utf-8");
195
+ if (!pattern.test(text)) return;
196
+ writeFileSync$1(file, relocatePath(text, sourceRoot, targetRoot));
197
+ });
198
+ }
199
+ walkSymlinks(podsDir, (link) => {
200
+ const target = readlinkSync$1(link);
201
+ if (!pattern.test(target)) return;
202
+ const next = `${link}.stim-relocate`;
203
+ symlinkSync$1(relocatePath(target, sourceRoot, targetRoot), next);
204
+ try {
205
+ renameSync$1(next, link);
206
+ } catch (error) {
207
+ unlinkSync$1(next);
208
+ throw error;
209
+ }
210
+ });
211
+ const leftover = findPath(podsDir, textNamesSource, bytesNameSource);
212
+ if (leftover) throw new Error(`${leftover} still names ${sourceRoot}`);
213
+ writeFileSync$1(manifestPath, podfileLock);
214
+ return {
215
+ ok: true,
216
+ pods
217
+ };
218
+ }
219
+ //#endregion
42
220
  //#region src/archive.ts
43
221
  const DAY = 864e5;
44
222
  const KINDS = [
@@ -860,16 +1038,18 @@ async function reclaimIdleProject(path, workspaceExisted, { archive, deleteOwned
860
1038
  skippedDevices.push(remote.failed);
861
1039
  failedDevices.push(remote.failed);
862
1040
  }
863
- const hosted = readMacosRecord(path)?.host;
864
- if (hosted) try {
865
- await stopMacosApp(path);
866
- } catch (error) {
867
- const failed = {
868
- name: `hosted macOS session ${hosted.session} on ${hosted.machine}`,
869
- reason: String(error?.message ?? error)
870
- };
871
- skippedDevices.push(failed);
872
- failedDevices.push(failed);
1041
+ if (macosAppPresent(path)) {
1042
+ const hosted = readMacosRecord(path)?.host;
1043
+ try {
1044
+ await stopMacosApp(path);
1045
+ } catch (error) {
1046
+ const failed = {
1047
+ name: hosted ? `hosted macOS session ${hosted.session} on ${hosted.machine}` : "macOS app",
1048
+ reason: String(error?.message ?? error)
1049
+ };
1050
+ skippedDevices.push(failed);
1051
+ failedDevices.push(failed);
1052
+ }
873
1053
  }
874
1054
  const tunnel = await reclaimMetroTunnel(path, { stopMetroTunnel });
875
1055
  if (tunnel.failed) {
@@ -1724,6 +1904,26 @@ function dependencyInstallCommand(target, dir = ".") {
1724
1904
  else if (existsSync$1(resolve$1(installRoot, "package-lock.json"))) command = "npm ci";
1725
1905
  return `cd '${installRoot.replaceAll("'", "'\\''")}' && ${command}`;
1726
1906
  }
1907
+ function relocateCarriedPods(root, target, copied) {
1908
+ const canRelocate = depsOutOfSync(root, target, copied).length === 0;
1909
+ for (const rel of copied) {
1910
+ if (rel !== "Pods" && !rel.endsWith("/Pods")) continue;
1911
+ const iosDir = rel === "Pods" ? "" : rel.slice(0, -5);
1912
+ try {
1913
+ const result = relocatePods({
1914
+ podsDir: join$1(target, rel),
1915
+ podfileLockPath: join$1(target, iosDir, "Podfile.lock"),
1916
+ sourceRoot: root,
1917
+ targetRoot: target,
1918
+ canRelocate
1919
+ });
1920
+ if (result.ok) console.error(chalk.dim(phaseLine("carry", result.pods.length > 0 ? `moved ${rel} to this checkout's path; ${result.pods.join(", ")} checksum depends on the checkout path, so pod install is not needed` : `moved ${rel} to this checkout's path; the locks match, so pod install is not needed`)));
1921
+ else if (result.withheld) console.error(chalk.yellow(phaseLine("carry", `${rel} names the source checkout's path; removed ${rel}/Manifest.lock so pod install runs`)));
1922
+ } catch (error) {
1923
+ console.error(chalk.yellow(phaseLine("carry", `could not move ${rel} to this checkout's path: ${error.message}. pod install will run`)));
1924
+ }
1925
+ }
1926
+ }
1727
1927
  function reportCarriedStateHealth(root, target, copied) {
1728
1928
  const outOfSync = depsOutOfSync(root, target, copied);
1729
1929
  for (const d of outOfSync.filter((dependency) => dependency.reason === "installed")) {
@@ -1751,7 +1951,7 @@ function reportRefreshFailure(failure) {
1751
1951
  process.exitCode = 1;
1752
1952
  }
1753
1953
  function mainCheckoutAppDir(root, target) {
1754
- const app = findProjectRoot$1(process.cwd());
1954
+ const app = findProjectRoot(process.cwd());
1755
1955
  if (!app) return root;
1756
1956
  const rel = relative$1(target, app);
1757
1957
  if (!rel || rel.startsWith("..") || isAbsolute$1(rel)) return root;
@@ -1763,15 +1963,15 @@ function mainCheckoutAppDir(root, target) {
1763
1963
  * root can declare react-native without being the app.
1764
1964
  */
1765
1965
  function warmedWorkspace(root, target, cwd) {
1766
- const nearest = findProjectRoot$1(cwd);
1767
- const app = nearest && isPathPrefix(target, nearest) && appProjectProblem(nearest) === null ? nearest : null;
1966
+ const nearest = findProjectRoot(cwd);
1967
+ const app = nearest && isPathPrefix(target, nearest) && isMobileProject(nearest) ? nearest : null;
1768
1968
  if (app && app !== target) return app;
1769
1969
  const apps = /* @__PURE__ */ new Set();
1770
1970
  for (const path of Object.keys(loadConfig$1()?.projects ?? {})) {
1771
1971
  const rel = relative$1(root, path);
1772
1972
  if (rel.startsWith("..") || isAbsolute$1(rel)) continue;
1773
1973
  const mapped = resolve$1(target, rel);
1774
- if (appProjectProblem(mapped) === null) apps.add(mapped);
1974
+ if (isMobileProject(mapped)) apps.add(mapped);
1775
1975
  }
1776
1976
  return apps.size === 1 ? [...apps][0] : app;
1777
1977
  }
@@ -1788,9 +1988,10 @@ function registerWarm(worktree) {
1788
1988
  let workspace = null;
1789
1989
  try {
1790
1990
  const { root, target, common } = warmWorktreePaths(process.cwd());
1791
- const app = findProjectRoot$1(process.cwd());
1991
+ const app = findProjectRoot(process.cwd());
1792
1992
  if (app) recordWorkspaceUse(app);
1793
1993
  workspace = warmedWorkspace(root, target, process.cwd());
1994
+ if (workspace && workspace !== app) recordWorkspaceUse(workspace);
1794
1995
  if (!workspace) console.error(chalk.dim(phaseLine("project", "no single app to register here; run warm from the app directory to list it in status while it warms")));
1795
1996
  else {
1796
1997
  registerWarmedWorkspace(workspace);
@@ -1834,6 +2035,7 @@ function registerWarm(worktree) {
1834
2035
  for (const entry of result.failed) console.error(chalk.yellow(phaseLine("carry", `could not copy ${entry.file}: ${entry.error}`)));
1835
2036
  if (result.copied.length) {
1836
2037
  console.error(chalk.dim(phaseLine("carry", `copied ${carriedFileList(result.copied)} from ${root}`)));
2038
+ relocateCarriedPods(root, target, result.copied);
1837
2039
  reportCarriedStateHealth(root, target, result.copied);
1838
2040
  }
1839
2041
  console.error(phaseLine("carry", `${result.failed.length ? "incomplete" : "complete"}: ${result.copied.length} ignored entries copied, ${result.skipped.length} kept, ${result.failed.length} failed`));
@@ -1,2 +1,2 @@
1
- import { a as porcelainPath, c as registerWarm, d as removalRemedy, f as removeWorktreeTarget, i as matchWorktreeEntry, l as removalBlockers, m as worktreeCommand, n as excludePodChurn, o as reclaimKeys, p as warmedWorkspace, r as excludeWatchmanCookies, s as registerRemove, t as dependencyInstallCommand, u as removalPath } from "./worktree-Be_7NLKy.mjs";
1
+ import { a as porcelainPath, c as registerWarm, d as removalRemedy, f as removeWorktreeTarget, i as matchWorktreeEntry, l as removalBlockers, m as worktreeCommand, n as excludePodChurn, o as reclaimKeys, p as warmedWorkspace, r as excludeWatchmanCookies, s as registerRemove, t as dependencyInstallCommand, u as removalPath } from "./worktree-BL4M1rhB.mjs";
2
2
  export { worktreeCommand as default, dependencyInstallCommand, excludePodChurn, excludeWatchmanCookies, matchWorktreeEntry, porcelainPath, reclaimKeys, registerRemove, registerWarm, removalBlockers, removalPath, removalRemedy, removeWorktreeTarget, warmedWorkspace };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stim",
3
- "version": "1.17.2",
3
+ "version": "1.19.0",
4
4
  "description": "Stim: fast, isolated React Native environments for coding agents",
5
5
  "keywords": [
6
6
  "agent",
@@ -34,6 +34,11 @@
34
34
  ],
35
35
  "type": "module",
36
36
  "exports": {
37
+ ".": {
38
+ "types": "./dist/api.d.mts",
39
+ "module-sync": "./dist/api.mjs",
40
+ "default": "./dist/api.mjs"
41
+ },
37
42
  "./package.json": "./package.json",
38
43
  "./cache-manifest": {
39
44
  "types": "./dist/cache-manifest.d.mts",
@@ -48,9 +53,9 @@
48
53
  },
49
54
  "dependencies": {
50
55
  "@expo/fingerprint": "^0.20.10",
51
- "@stim-cli/cache": "^1.17.2",
52
- "@stim-cli/core": "^1.17.2",
53
- "@stim-cli/metro": "^1.17.2",
56
+ "@stim-cli/cache": "^1.19.0",
57
+ "@stim-cli/core": "^1.19.0",
58
+ "@stim-cli/metro": "^1.19.0",
54
59
  "chalk": "^6.0.0",
55
60
  "commander": "^15.0.0",
56
61
  "cross-spawn": "^7.0.6",
@@ -58,7 +63,7 @@
58
63
  "ws": "^8.21.3"
59
64
  },
60
65
  "devDependencies": {
61
- "@stim-cli/expo-build-cache": "1.17.2",
66
+ "@stim-cli/expo-build-cache": "1.19.0",
62
67
  "@types/cross-spawn": "^6.0.6",
63
68
  "@types/which": "^3.0.4",
64
69
  "@types/ws": "^8.18.1",
@@ -89,7 +89,8 @@ function bundleResponseMiddleware(write, { runLsof } = {}) {
89
89
  };
90
90
  res.once('finish', () => finish(true));
91
91
  res.once('close', () => finish(false));
92
- return next();
92
+ // oxlint-disable-next-line promise/no-callback-in-promise -- Connect routes asynchronous errors through next(error).
93
+ return clientPid ? clientPid.then(() => next()).catch(next) : next();
93
94
  };
94
95
  }
95
96
 
@@ -3,4 +3,4 @@ import type { IncomingMessage, ServerResponse } from 'node:http';
3
3
  export function bundleResponseMiddleware(
4
4
  write: (record: Record<string, unknown>) => unknown,
5
5
  options?: { runLsof?: (args: string[]) => Promise<string> },
6
- ): (req: IncomingMessage, res: ServerResponse, next: () => unknown) => unknown;
6
+ ): (req: IncomingMessage, res: ServerResponse, next: (error?: unknown) => unknown) => unknown;
@@ -141,7 +141,7 @@ function appendStore(config, defaultConfig) {
141
141
  (record) => process.stderr.write(`stim-bundle-response: ${JSON.stringify(record)}\n`),
142
142
  { runLsof: process.platform === 'darwin' ? runLsof : undefined },
143
143
  );
144
- return (req, res, next) => observe(req, res, () => enhanced(req, res, next));
144
+ return (req, res, next) => observe(req, res, (error) => (error ? next(error) : enhanced(req, res, next)));
145
145
  },
146
146
  },
147
147
  };