stim 1.20.1 → 1.21.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 +94 -11
- package/dist/acquire-artifact-CD4lbiWE.mjs +153 -0
- package/dist/act-DHAw2A2S.mjs +2667 -0
- package/dist/activity-BzVfHSrY.mjs +1376 -0
- package/dist/{agent-device-usage-output-VPaOgGaF.mjs → agent-device-usage-output-zh1vhbLp.mjs} +21 -66
- package/dist/{android-CZh6ElG5.mjs → android-BEJ8Jpl7.mjs} +3 -3
- package/dist/{android-CLbBJ2ve.mjs → android-BLgbNqox.mjs} +128 -79
- package/dist/{android-eXfIjKJr.mjs → android-CV_GCELZ.mjs} +5 -5
- package/dist/{android-DE8-JfGW.mjs → android-DUYkNF4u.mjs} +188 -106
- package/dist/{android-cas-BFpS84v2.mjs → android-cas-Ct5b1xCK.mjs} +7 -6
- package/dist/android-cas-compiler.mjs +2 -2
- package/dist/android-project-BCAAmMwz.mjs +12 -0
- package/dist/api.d.mts +740 -8
- package/dist/api.mjs +585 -1
- package/dist/{artifact-Ctb2jpw6.mjs → artifact-B8T3S5gi.mjs} +223 -201
- package/dist/{artifact-DXk_Fle_.mjs → artifact-DAuZ-FNU.mjs} +158 -148
- package/dist/{browser-web-xQWC2RWl.mjs → browser-web-QQzVjz3O.mjs} +28 -26
- package/dist/budget-Bs6SxxzO.mjs +9154 -0
- package/dist/{build-COBA1tBc.mjs → build-CoPzQRNw.mjs} +144 -101
- package/dist/build-cache-DmyR9Zzc.mjs +602 -0
- package/dist/build-plan-CaFskB7_.mjs +188 -0
- package/dist/{cache-manifest-qA3dT2x2.mjs → cache-manifest-DkkqguoK.mjs} +10 -5
- package/dist/cache-manifest.mjs +1 -1
- package/dist/{ccache-CtbqWxIC.mjs → ccache-BJRZ9pG3.mjs} +10 -9
- package/dist/{cdp-Dq_ypAlJ.mjs → cdp-CWmIUMbw.mjs} +18 -5
- package/dist/{chrome-Dp2lMLBe.mjs → chrome-B6tfCta1.mjs} +7 -4
- package/dist/{cli-sGqlPu1n.mjs → cli-0DYf8QhQ.mjs} +20 -20
- package/dist/cli.mjs +1 -1
- package/dist/client-B7QVOlCr.d.mts +253 -0
- package/dist/client-UXD70ZbM.mjs +1406 -0
- package/dist/collector-run.d.mts +4 -39
- package/dist/collector-run.mjs +9 -9
- package/dist/{command-output-CPDq_90S.mjs → command-output-B1UrjZHL.mjs} +1 -1
- package/dist/config-CYcBF478.mjs +949 -0
- package/dist/{created-devices-CXBMtoj5.mjs → created-devices-CqeBlrEn.mjs} +3 -3
- package/dist/{dependency-state-B2m8eqsS.mjs → dependency-state-BbKQW83h.mjs} +20 -5
- package/dist/{detached-entry-BXq4fIl-.mjs → detached-entry-DFRyG1_o.mjs} +1 -1
- package/dist/{dev-client-BqYjMIaC.mjs → dev-client-UOeESKm6.mjs} +2 -2
- package/dist/device-DCxH7_By.mjs +1068 -0
- package/dist/{device-D4DqjSZZ.mjs → device-ExJq8Ei7.mjs} +35 -36
- package/dist/{device-capacity-DrwHwR97.mjs → device-capacity-CMlqEcvw.mjs} +43 -14
- package/dist/device-host-worker.mjs +65 -62
- package/dist/{device-ios-DE8KJd3b.mjs → device-ios-DRUeKaFV.mjs} +49 -49
- package/dist/{device-lease-run-Baelt3nc.mjs → device-lease-run-C8raGFoP.mjs} +14 -26
- package/dist/{device-pool-DtK9S6AD.mjs → device-pool-DMRpVX9a.mjs} +5 -5
- package/dist/doctor-BLHCYxzi.mjs +2 -0
- package/dist/{doctor-Dunu3Nv1.mjs → doctor-DTvaDOda.mjs} +317 -344
- package/dist/{doctor-DiP9HsIP.mjs → doctor-Dhqebm0q.mjs} +183 -91
- package/dist/doctor-fingerprint.mjs +19 -0
- package/dist/{doctor-watchman-XJzT8tK-.mjs → doctor-watchman-Cv1F10Kj.mjs} +40 -23
- package/dist/{eas-build-0gadvrca.mjs → eas-build-BomfRnFT.mjs} +53 -20
- package/dist/{build-plan-CRjAA6Qi.mjs → eas-fallback-DJwZpy0c.mjs} +26 -208
- package/dist/{watchman-CqmaGcIb.mjs → eas-session-ledger-op6A54yi.mjs} +229 -11
- package/dist/{error-diagnostics-BhQtoLrZ.mjs → error-diagnostics-Bf0rZvG9.mjs} +172 -82
- package/dist/exec-H20xSg2T.d.mts +65 -0
- package/dist/exec-_UbtCQcG.mjs +750 -0
- package/dist/gc-C-WwL0yi.mjs +3 -0
- package/dist/{gc-D5cz5G0k.mjs → gc-_-dCXdyL.mjs} +625 -786
- package/dist/git-C3iTsJaZ.mjs +73 -0
- package/dist/{guide-DakjcoUt.mjs → guide-Yqwt2bd6.mjs} +990 -280
- package/dist/{hosted-android-C-D8Dj0_.mjs → hosted-android-Bw-honsd.mjs} +8 -6
- package/dist/{hosted-client--hNFgixu.mjs → hosted-client-DB_gBPfY.mjs} +47 -24
- package/dist/{hosted-ios-Chx9XQyI.mjs → hosted-ios-CUvOf4Vr.mjs} +1 -1
- package/dist/{hosted-logs-Bkz0Hxzh.mjs → hosted-logs-DL_P5AdN.mjs} +77 -43
- package/dist/{hosted-macos-ckTjN-0V.mjs → hosted-macos-QI141yKk.mjs} +21 -15
- package/dist/{hosted-native-3KXZ5-qn.mjs → hosted-native-Ksyjgzq-.mjs} +31 -20
- package/dist/idle-BVeRGroT.d.mts +24 -0
- package/dist/{idle-shutdown-DhAUyf5s.mjs → idle-shutdown-DaKmZi0z.mjs} +11 -10
- package/dist/{ios-BDBN-xpf.mjs → ios-CQ68hG9s.mjs} +8 -8
- package/dist/{ios-o896T9PE.mjs → ios-CpByZy12.mjs} +141 -81
- package/dist/{ios-device-B1B14xND.mjs → ios-device-CXGP1bsD.mjs} +1 -1
- package/dist/{ios-device-BWHKGaJq.mjs → ios-device-CwFMehUS.mjs} +60 -35
- package/dist/{ios-project-BeOXKPt2.mjs → ios-project-WuwwBdvW.mjs} +13 -13
- package/dist/{ios-VGvNdsv2.mjs → ios-qNJt4dFm.mjs} +1 -1
- package/dist/ios-signing-DTTIChGs.mjs +489 -0
- package/dist/{ios-state-BsXMwo5y.mjs → ios-state-DvFX-K_l.mjs} +1 -1
- package/dist/{ios-CQ8bHQXB.mjs → ios-ubFsBzwq.mjs} +129 -86
- package/dist/{js-swap-Z_mSuRrx.mjs → js-swap-Cc1dttps.mjs} +60 -33
- package/dist/{launch-V1zqiOYn.mjs → launch-CD1yVc7U.mjs} +92 -91
- package/dist/{launch-BootbMk4.mjs → launch-Zq2mOSDy.mjs} +87 -545
- package/dist/logs-BS00Anxf.mjs +352 -0
- package/dist/logs-CMm05HxN.mjs +255 -0
- package/dist/macos-B65--pPd.mjs +2 -0
- package/dist/{macos-D7irBW3A.mjs → macos-C-0qJ6zq.mjs} +244 -215
- package/dist/macos-run.mjs +1 -1
- package/dist/maintenance-run.mjs +122 -247
- package/dist/{metro-_ZIE3Axg.mjs → metro-DEXpIhHC.mjs} +71 -17
- package/dist/{metro-gateway-BzlQZQmU.mjs → metro-gateway-BMJNlj3E.mjs} +20 -12
- package/dist/{named-ports-O1TIl7tx.mjs → named-ports-BWTzt6mu.mjs} +8 -64
- package/dist/native-android-JACyjTZs.mjs +844 -0
- package/dist/{native-gradle-inputs-BQnIdAlL.mjs → native-gradle-inputs-Bep9JcSF.mjs} +128 -147
- package/dist/native-inputs-TRTTTRxt.mjs +91 -0
- package/dist/native-run-DY_RLx3C.mjs +277 -0
- package/dist/{native-runtime-D024BAvm.mjs → native-runtime-Dg1Q7tfF.mjs} +10 -10
- package/dist/{native-xcode-inputs-UElfGs59.mjs → native-xcode-inputs-CB2iQeWq.mjs} +28 -20
- package/dist/{native-xcode-ios-CjS-nDVY.mjs → native-xcode-ios-CXX39F7o.mjs} +96 -47
- package/dist/{ndjson-GOnbyvso.mjs → ndjson-CgE_o3Dl.mjs} +3 -3
- package/dist/offload-worker.d.mts +1 -46
- package/dist/offload-worker.mjs +213 -86
- package/dist/{ownership-BrjepDiv.mjs → ownership-DEmM5vhh.mjs} +3 -3
- package/dist/{page-Bv9s2KwY.mjs → page-CPaHeYqj.mjs} +7 -4
- package/dist/paths-BsJMoPP2.mjs +12 -0
- package/dist/paths-DQtTgsBf.mjs +42 -0
- package/dist/{placement-log-BItXET1x.mjs → placement-log-BqGbTa61.mjs} +5 -5
- package/dist/{plan-placement-B466UYMU.mjs → plan-placement-Bwj-IjY1.mjs} +6 -6
- package/dist/{ports-BFRL6JTj.mjs → ports-D-MmCTdv.mjs} +3 -3
- package/dist/prebuild-uD_ipCxF.mjs +449 -0
- package/dist/{project-DX8fXyw_.mjs → project-BZNjmW_8.mjs} +65 -38
- package/dist/{pull-request-vOhLNmIb.mjs → pull-request-Lfetn8Kr.mjs} +5 -18
- package/dist/pull-request-zjCSAryH.d.mts +120 -0
- package/dist/pull-requests.d.mts +1 -119
- package/dist/pull-requests.mjs +1 -1
- package/dist/{react-native-android-CuXM3QS8.mjs → react-native-android-DuzH0cn3.mjs} +83 -53
- package/dist/{gradle-CZZo1TSA.mjs → react-native-build-rhk4smwQ.mjs} +292 -15
- package/dist/react-native-doctor-CQpuIMso.mjs +234 -0
- package/dist/{react-native-ios-DtVO4qf2.mjs → react-native-ios-Bhq1rJeV.mjs} +46 -28
- package/dist/{recordings-Bk-VivUV.mjs → recordings-DYteQSu4.mjs} +12 -9
- package/dist/{reload-D9V7D8gP.mjs → reload-CmTRFJaX.mjs} +95 -49
- package/dist/reload-DzjSl5P_.mjs +2 -0
- package/dist/{remote-CZiTijxG.mjs → remote-ByYkXdGD.mjs} +15 -10
- package/dist/result-DNiS-tTP.mjs +434 -0
- package/dist/{run-ClC8UVB5.mjs → run-D23HmJMs.mjs} +4 -5
- package/dist/selection-CSl9i5qU.mjs +619 -0
- package/dist/{server-bare-dWjAarki.mjs → server-bare-CxTrvDg8.mjs} +3 -4
- package/dist/{server-command-DnJYLnr4.mjs → server-command-CtzloH3v.mjs} +14 -7
- package/dist/server-expo-C-90EhcG.mjs +2 -0
- package/dist/{server-expo-CUuzP9Mp.mjs → server-expo-DT_F_uVI.mjs} +51 -15
- package/dist/{settings-Bbztm4oV.mjs → settings-CsJDEXgK.mjs} +301 -132
- package/dist/{settings-vk3mJGSm.d.mts → settings-DkdmlelE.d.mts} +6 -4
- package/dist/settings-T1gtc3bf.mjs +114 -0
- package/dist/settings-write-HyVZ8eQ8.mjs +359 -0
- package/dist/settings.schema.json +163 -16
- package/dist/{simslim-ChMfe8rg.mjs → simslim-Cgk17SXV.mjs} +14 -13
- package/dist/{slot-launch-CeCRr6MK.mjs → slot-launch-DF8VfT64.mjs} +15 -20
- package/dist/{spawn-entry-Dcb7sDUz.mjs → spawn-entry-jw19m8Nl.mjs} +0 -1
- package/dist/stage-BIS0ydsV.mjs +183 -0
- package/dist/{start-CRkG-mZ7.mjs → start-7lpH7hmN.mjs} +66 -48
- package/dist/{start-mh6bS27z.mjs → start-RChynRDp.mjs} +1 -1
- package/dist/{state-lqxdOH_g.mjs → state-C4ZtUisW.mjs} +41 -14
- package/dist/{state-BUpAmt2r.mjs → state-XMziexv2.mjs} +3 -2
- package/dist/{stats-CaB1MxMi.mjs → stats-53T7OTb9.mjs} +7 -13
- package/dist/stats-report-BFfMpWWF.mjs +16 -0
- package/dist/{status-C7vzkInu.mjs → status-BL7jVyAB.mjs} +538 -467
- package/dist/status-CSi6tlRq.mjs +2 -0
- package/dist/{status-BDGHwkCs.mjs → status-DqEUSSxs.mjs} +6 -4
- package/dist/{status-watch-ZaVqRdtW.mjs → status-watch-GDCfqpTE.mjs} +187 -22
- package/dist/status-worker.d.mts +1 -0
- package/dist/status-worker.mjs +19 -0
- package/dist/stim-desktop-C12we7lz.mjs +112 -0
- package/dist/{stop-BU7JaFCg.mjs → stop-Bk_1qiV6.mjs} +2 -2
- package/dist/{stop-BO80KJoT.mjs → stop-CPzlM1L-.mjs} +138 -99
- package/dist/{stop-Cftw_sXJ.mjs → stop-D7h6jAXQ.mjs} +11 -10
- package/dist/supervisor-run.d.mts +8 -17
- package/dist/supervisor-run.mjs +63 -28
- package/dist/{support-Ca6PZbpr.mjs → support-67vraa1Q.mjs} +18 -11
- package/dist/{support-Co0wk8Cv.mjs → support-Dlu37g6H.mjs} +12 -12
- package/dist/{swiftpm-macos-siFSkmCO.mjs → swiftpm-macos-p8WZbxKU.mjs} +35 -24
- package/dist/toolchain-DhKwp9iI.mjs +2 -0
- package/dist/toolchain-Hp9sCpK4.mjs +873 -0
- package/dist/{trigger-C0MWBi8O.mjs → trigger-BAahxUPq.mjs} +20 -5
- package/dist/trigger-Bf3uDcpv.mjs +2 -0
- package/dist/{warm-progress-5FAXkXIg.mjs → warm-progress-BHX5r0Ei.mjs} +252 -176
- package/dist/{web-BTjzE8mc.mjs → web-CJmIj6AI.mjs} +18 -13
- package/dist/web-DknQETPs.mjs +2 -0
- package/dist/web-run.mjs +16 -17
- package/dist/windows-report.d.mts +1 -0
- package/dist/windows-report.mjs +18 -0
- package/dist/windows-report.ps1 +43 -0
- package/dist/workspace-process-lock-1_1OoVW5.mjs +57 -0
- package/dist/{workspace-state-CvgTFe-h.mjs → workspace-state-Cjuigeeu.mjs} +70 -56
- package/dist/{workspaces-C4kqIOlx.mjs → workspaces-BccMFmGQ.mjs} +1188 -1080
- package/dist/worktree-CK2MpJW5.mjs +2 -0
- package/dist/{worktree-DtRsh6go.mjs → worktree-DQ6Zi2Mv.mjs} +368 -110
- package/dist/xcode-Zlx3qjEs.mjs +896 -0
- package/package.json +7 -5
- package/shim/android-optimizations.gradle +7 -5
- package/dist/activity-BaMpUQ4-.mjs +0 -629
- package/dist/api-run.mjs +0 -296
- package/dist/api-zuX3ynYN.mjs +0 -154
- package/dist/app-install-Cg9YJy3x.mjs +0 -873
- package/dist/artifact-lifecycle-DzPpBYvK.mjs +0 -30
- package/dist/budget-RFbwFpG5.mjs +0 -4109
- package/dist/build-facts-DcLv2HSd.d.mts +0 -111
- package/dist/client-zqjFd79D.mjs +0 -1779
- package/dist/config-D0LhTY3S.mjs +0 -524
- package/dist/device-BgNj-qVj.mjs +0 -290
- package/dist/device-lease-C309csaB.mjs +0 -1228
- package/dist/device-remote-DjsNw8DD.mjs +0 -1272
- package/dist/eas-session-ledger-DJDeL4Uq.mjs +0 -205
- package/dist/exec-B81Qodjn.mjs +0 -254
- package/dist/launch-verify-Dl78EVgR.mjs +0 -428
- package/dist/logs-Bh4eqCCc.mjs +0 -384
- package/dist/macos-kivF8qKz.mjs +0 -2
- package/dist/miss-reason-SuTptY-I.mjs +0 -238
- package/dist/native-android-D94RlJ-X.mjs +0 -226
- package/dist/ndjson-Du3j0AQ9.d.mts +0 -17
- package/dist/plan-Jwu_vr-F.mjs +0 -260
- package/dist/prebuild-DB_zLOLc.mjs +0 -213
- package/dist/preview-BRLFRhTz.mjs +0 -1004
- package/dist/process-identity-Biv3arCO.mjs +0 -40
- package/dist/react-native-build-JUF31S8U.mjs +0 -239
- package/dist/react-native-doctor-BQHqiXaQ.mjs +0 -78
- package/dist/remote-cache-fxcl5C-L.mjs +0 -526
- package/dist/result-BrfgXtdO.mjs +0 -186
- package/dist/server-expo-Dvkd7JcF.mjs +0 -2
- package/dist/settings-BuKMOANA.mjs +0 -402
- package/dist/spawn-claims-Kqiifsk2.mjs +0 -72
- package/dist/stage-BNKKdDNc.mjs +0 -157
- package/dist/stim-desktop-8GQX2OV8.mjs +0 -63
- package/dist/tailnet-D7-tE_ug.mjs +0 -265
- package/dist/toolchain-B12psPA2.mjs +0 -2
- package/dist/toolchain-SqehyPLw.mjs +0 -1657
- package/dist/trigger-SHLOWJ4O.mjs +0 -2
- package/dist/web-CHN5gh34.mjs +0 -2
- package/dist/worktree-Cgnm6vZt.mjs +0 -2
- package/dist/{api-run.d.mts → doctor-fingerprint.d.mts} +0 -0
- package/dist/{errors-DzkMYh8Q.mjs → errors-ccaPc4ox.mjs} +2 -2
package/README.md
CHANGED
|
@@ -33,21 +33,35 @@ stim stop
|
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
`stim doctor` never loads `fingerprint.config.js` or runs an `eas` from the
|
|
36
|
-
project tree.
|
|
37
|
-
|
|
38
|
-
`
|
|
36
|
+
project tree. On a checkout without its own dependencies, it skips the
|
|
37
|
+
fingerprint parity check when Expo packages resolve from outside the app or when
|
|
38
|
+
the check would need `npx react-native config`, as it does for Android or a
|
|
39
|
+
project without an `ios` directory. Its linked-library check can
|
|
40
|
+
still run installed Expo packages on the main checkout, as a build does.
|
|
41
|
+
`worktree warm`, `start`, `ios`, and `android` run project code.
|
|
39
42
|
|
|
40
43
|
Stim builds or restores the app, installs it, launches it, and checks launch
|
|
41
44
|
readiness. Plain output streams progress and reports the complete result. Use
|
|
42
45
|
`--json` when a script needs structured data.
|
|
43
46
|
|
|
47
|
+
For native Xcode simulator builds, a local and configured-provider miss can
|
|
48
|
+
reuse an exact completed artifact from an enabled paired build worker. Reuse
|
|
49
|
+
checks the full source, toolchain, SDK, architecture and target cache key and
|
|
50
|
+
verifies the downloaded archive. It needs no compilation slot. An explicit
|
|
51
|
+
local build and remote build mode off skip peer lookup; other project types
|
|
52
|
+
keep their existing cache paths. See `stim guide settings` for placement.
|
|
53
|
+
|
|
44
54
|
## Native Android build workers
|
|
45
55
|
|
|
46
56
|
Native Gradle apps can use an approved build worker after declaring that
|
|
47
57
|
Git-visible source and exact additional ignored files are sufficient. See
|
|
48
|
-
`stim guide lifecycle native-android` for `android.offloadInputs`, generated
|
|
49
|
-
|
|
50
|
-
|
|
58
|
+
`stim guide lifecycle native-android` for `android.offloadInputs`, generated output ownership,
|
|
59
|
+
and supported input boundaries. Workers remain uncached. Local builds can opt
|
|
60
|
+
into APK caching through a separate complete `android.artifactInputs` declaration.
|
|
61
|
+
A configured cache provider with a `files` capability can share the verified APK
|
|
62
|
+
and its receipt between machines. Private input files and environment values
|
|
63
|
+
stay local; the declaration never authorizes their transfer. Gradle
|
|
64
|
+
keeps its own incremental and task caches in both cases.
|
|
51
65
|
|
|
52
66
|
## Programmatic API
|
|
53
67
|
|
|
@@ -77,16 +91,64 @@ already running server. `run` builds, installs and launches.
|
|
|
77
91
|
`build({ platform: 'ios' })` returns a retained simulator app without starting
|
|
78
92
|
a device or runtime; Android returns an APK and macOS returns an app bundle.
|
|
79
93
|
Build-only preserves existing sessions and uses the same cache and build locks.
|
|
94
|
+
Successful builds include `result.facts.links.workspace`, an HTTPS workspace link
|
|
95
|
+
agents can share with an already-paired phone or Desktop, including when the
|
|
96
|
+
build machine has no Desktop app installed.
|
|
80
97
|
Each result is a separate copy kept in the workspace until `stim worktree remove`.
|
|
81
98
|
Run results preserve the CLI's launch evidence, including `'bundling'` and
|
|
82
99
|
`'unverified'` results.
|
|
83
100
|
|
|
84
|
-
|
|
85
|
-
|
|
101
|
+
`reload({ platform?: 'ios' | 'android' | 'web', signal? })` requests a JavaScript
|
|
102
|
+
reload in a live app or reloads the owned Chrome page, returning the flat
|
|
103
|
+
`stim reload --json` facts. Select a platform when more than one is live.
|
|
104
|
+
Dispatch does not prove completion; verify the expected UI and inspect logs.
|
|
105
|
+
A Metro broadcast can reach other connected clients. Reload uses a 60 second
|
|
106
|
+
execution budget and 35 second cleanup budget, with the report timeout and
|
|
107
|
+
cleanup refusals described below. Cancellation stops pending work but cannot
|
|
108
|
+
retract a request already sent. Reload never retries automatically.
|
|
109
|
+
|
|
110
|
+
`setSetting(key, text, { scope?, signal? })` and `unsetSetting(key, { scope?, signal? })`
|
|
111
|
+
share the CLI's validation and return its JSON write result, including masked
|
|
112
|
+
sensitive values. Values use CLI text syntax, including JSON for arrays and
|
|
113
|
+
objects. Config lock waits and device-pool probes are asynchronous. Cancellation
|
|
114
|
+
prevents a pending write; a committed write finishes its recording cleanup
|
|
115
|
+
before settling. Recording changes serialize through cleanup within the home.
|
|
116
|
+
|
|
117
|
+
All operations run in the importing process. `settings()` and `stats()`
|
|
118
|
+
read the `stim settings --json` and `stim stats --json` payloads. All
|
|
119
|
+
use the client's own home and leave the caller's cwd, environment,
|
|
120
|
+
output, signal handlers and exit listeners as they were. The API and CLI call
|
|
86
121
|
the same native lifecycle operations. Progress is silent unless `onProgress`
|
|
87
122
|
is provided; its `message` is an output chunk. Operations accept `signal`.
|
|
88
|
-
Cancellation
|
|
123
|
+
Cancellation drains the operation's owned work, and does not replace `stop()`.
|
|
89
124
|
Call cleanup with a fresh signal after cancellation or partial failure.
|
|
125
|
+
Cancelling `stop()` while it waits for another native operation ends that wait.
|
|
126
|
+
Once teardown starts, it finishes cleanup before rejecting with `STIM_CANCELLED`;
|
|
127
|
+
its config, workspace-state, and lease lock waits are asynchronous.
|
|
128
|
+
|
|
129
|
+
`doctor({ platform?, record? })` and `gc({ cache?, olderThan?, worktrees? })` read their CLI
|
|
130
|
+
JSON reports with a 60 second execution budget and optional `signal`. Doctor
|
|
131
|
+
never repairs; its `stim.runningPath` is null. By default it does not record a
|
|
132
|
+
check. Pass `record: true` to register the supported iOS/Android project and record
|
|
133
|
+
its checked platforms after the report and owned cleanup succeed. Recording waits
|
|
134
|
+
asynchronously for the config lock, honors `signal`, and rejects unavailable state.
|
|
135
|
+
GC never
|
|
136
|
+
deletes or shuts down idle devices. Reads can refresh their own usage caches
|
|
137
|
+
and existing pending remote approvals. An explicit `home` or `STIM_HOME` keeps
|
|
138
|
+
the CLI's scoped-home restrictions. Expiry rejects with `STIM_REPORT_TIMEOUT`
|
|
139
|
+
after owned cleanup; a caller abort rejects with
|
|
140
|
+
`STIM_CANCELLED`. Throwing from report progress also cancels the read.
|
|
141
|
+
If child identity cannot be verified after a one-second retry budget, cleanup
|
|
142
|
+
refuses with `STIM_CLAIM_UNAVAILABLE` instead of a cancellation or timeout
|
|
143
|
+
error. Child cleanup errors name the launcher PID; unverifiable processes and descendants
|
|
144
|
+
are left untouched. On POSIX, a launcher that exited before identity capture can only
|
|
145
|
+
finish successfully once its process group is proven gone.
|
|
146
|
+
After a termination request, cleanup waits at most one second for a child to
|
|
147
|
+
close. Overall cleanup has a 35 second budget, including temporary-worktree
|
|
148
|
+
removal; unfinished cleanup returns `STIM_CLAIM_UNAVAILABLE` and leaves
|
|
149
|
+
unresolved resources in place. Credential refresh waits asynchronously and
|
|
150
|
+
checks cancellation before writing.
|
|
151
|
+
On Windows, report probes require the built-in Windows PowerShell for process-tree containment.
|
|
90
152
|
|
|
91
153
|
`home` and `buildCache` accept absolute paths. Omit them to use normal Stim
|
|
92
154
|
settings. A cache used by concurrent writers needs the same coordinating Stim
|
|
@@ -95,8 +157,29 @@ Ownership checks and cache locks remain active. `stop()` acts on this workspace,
|
|
|
95
157
|
including resources from earlier runs, so use a dedicated workspace in CI.
|
|
96
158
|
|
|
97
159
|
Stim failures are `StimError` instances with `code`, `message`, `remedy`, and
|
|
98
|
-
`details`. An exception thrown by `onProgress`
|
|
99
|
-
propagated unchanged
|
|
160
|
+
`details`. An exception thrown by `onProgress` stops further progress and is
|
|
161
|
+
propagated unchanged: `build()` or `run()` is cancelled, and
|
|
162
|
+
`stop()` or read finishes its work first.
|
|
163
|
+
`logs({ tail, sources, minLevel, slot, since, grep, errorsOnly })` reads the same
|
|
164
|
+
merged records as `stim logs --json`, including crash capture and agent actions.
|
|
165
|
+
Pass `tail` to bound the returned records. `followLogs(options, onRecord)` emits
|
|
166
|
+
that backfill and new records, then returns a stop function; aborting its signal
|
|
167
|
+
also stops it. An optional third callback receives initial records instead of
|
|
168
|
+
`onRecord`; its promise is awaited before the next batch. With that callback and
|
|
169
|
+
no `tail`, timeline batches hold at most 500 records. Agent attribution still
|
|
170
|
+
retains its matching records during backfill. These reads run in process and yield between log chunks.
|
|
171
|
+
Local follow uses filesystem hints with a ten-second repair scan. While a
|
|
172
|
+
directory watch is unavailable, it retries and scans every 500 ms; Expo error
|
|
173
|
+
context uses a timer only while pending. Agent-action and active hosted log
|
|
174
|
+
sampling are unchanged.
|
|
175
|
+
Attachment schedules one 500 ms recovery scan. A moved directory on Windows can
|
|
176
|
+
require the ten-second repair scan.
|
|
177
|
+
Hosted targets join and leave the follow stream from local state notifications;
|
|
178
|
+
missed notifications are reconciled about every 10 seconds. Active hosts still
|
|
179
|
+
serve bounded log queries.
|
|
180
|
+
Tail selection bounds matching timeline and agent records; agent attribution
|
|
181
|
+
still reads each retained session generation to establish device ownership.
|
|
182
|
+
|
|
100
183
|
`diagnostics()` returns the workspace log directory and up to 200 local records,
|
|
101
184
|
even if no run has succeeded. It does not fetch remote logs or capture new crashes.
|
|
102
185
|
See [the API reference](https://stim.appandflow.com/docs/programmatic-api) or
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { I as waitForSharedBuild } from "./activity-BzVfHSrY.mjs";
|
|
2
|
+
import { rmSync } from "node:fs";
|
|
3
|
+
//#region src/engine/artifact-lifecycle.ts
|
|
4
|
+
async function runArtifactLifecycle(phases) {
|
|
5
|
+
try {
|
|
6
|
+
const resolved = await phases.resolve();
|
|
7
|
+
if (resolved.kind === "ready") return resolved.artifact;
|
|
8
|
+
const cached = resolved.kind === "cached" ? resolved.artifact : await phases.claim?.() ?? null;
|
|
9
|
+
if (cached !== null) {
|
|
10
|
+
const reused = await phases.reuse(cached);
|
|
11
|
+
if (reused !== null) return reused;
|
|
12
|
+
}
|
|
13
|
+
const { build } = phases;
|
|
14
|
+
const placement = await build.placement?.select() ?? null;
|
|
15
|
+
if (placement === null) await build.admit();
|
|
16
|
+
const preparation = await build.prepare();
|
|
17
|
+
const late = await build.revalidate(preparation);
|
|
18
|
+
if (late !== null) return late.ready;
|
|
19
|
+
if (build.placement && placement !== null) {
|
|
20
|
+
const offloaded = await build.placement.acquire(placement, preparation);
|
|
21
|
+
if (offloaded !== null) return offloaded.ready;
|
|
22
|
+
await build.admit();
|
|
23
|
+
}
|
|
24
|
+
const artifact = await build.compile(placement, preparation);
|
|
25
|
+
if (await build.validate(preparation) === "cacheable") await build.store(artifact);
|
|
26
|
+
return build.finish ? await build.finish(artifact) : artifact;
|
|
27
|
+
} finally {
|
|
28
|
+
phases.release();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/engine/cleanup-scope.ts
|
|
33
|
+
function drain(pending, report) {
|
|
34
|
+
const kept = [];
|
|
35
|
+
for (const cleanup of pending.toReversed()) try {
|
|
36
|
+
cleanup();
|
|
37
|
+
} catch (error) {
|
|
38
|
+
kept.unshift(cleanup);
|
|
39
|
+
report(error);
|
|
40
|
+
}
|
|
41
|
+
return kept;
|
|
42
|
+
}
|
|
43
|
+
function createCleanupScope(report) {
|
|
44
|
+
let pending = [];
|
|
45
|
+
return {
|
|
46
|
+
defer: (cleanup) => {
|
|
47
|
+
pending.push(cleanup);
|
|
48
|
+
return () => {
|
|
49
|
+
pending = pending.filter((entry) => entry !== cleanup);
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
transfer: () => {
|
|
53
|
+
let handed = pending;
|
|
54
|
+
pending = [];
|
|
55
|
+
return () => {
|
|
56
|
+
handed = drain(handed, report);
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
release: () => {
|
|
60
|
+
pending = drain(pending, report);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region src/engine/acquire-artifact.ts
|
|
66
|
+
async function acquireArtifact(adapter, { root, logFile, deps }) {
|
|
67
|
+
const owned = createCleanupScope((error) => adapter.temporaryReleaseFailed(error));
|
|
68
|
+
let closeOffload = null;
|
|
69
|
+
let buildLock = null;
|
|
70
|
+
let buildSlot = null;
|
|
71
|
+
const releaseLock = () => {
|
|
72
|
+
if (!buildLock) return;
|
|
73
|
+
const held = buildLock;
|
|
74
|
+
buildLock = null;
|
|
75
|
+
try {
|
|
76
|
+
deps.releaseBuildLock(held);
|
|
77
|
+
} catch (error) {
|
|
78
|
+
adapter.releaseFailed(`the build lock at ${held.path}`, error);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
const releaseSlot = () => {
|
|
82
|
+
if (!buildSlot) return;
|
|
83
|
+
const held = buildSlot;
|
|
84
|
+
buildSlot = null;
|
|
85
|
+
try {
|
|
86
|
+
deps.releaseBuildSlot(held);
|
|
87
|
+
} catch (error) {
|
|
88
|
+
adapter.releaseFailed("the build slot", error);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
const run = {
|
|
92
|
+
own: (directory) => owned.defer(() => rmSync(directory, {
|
|
93
|
+
recursive: true,
|
|
94
|
+
force: true
|
|
95
|
+
})),
|
|
96
|
+
openOffload: (close) => {
|
|
97
|
+
closeOffload = close;
|
|
98
|
+
},
|
|
99
|
+
claimSharedBuild: async (options) => {
|
|
100
|
+
const shared = await waitForSharedBuild({
|
|
101
|
+
...options,
|
|
102
|
+
platform: adapter.platform,
|
|
103
|
+
root,
|
|
104
|
+
logFile,
|
|
105
|
+
command: adapter.command,
|
|
106
|
+
acquire: deps.acquireBuildLock,
|
|
107
|
+
wait: deps.waitForBuild,
|
|
108
|
+
now: deps.now
|
|
109
|
+
});
|
|
110
|
+
if (!shared.refusal) buildLock = shared.lock;
|
|
111
|
+
return shared;
|
|
112
|
+
},
|
|
113
|
+
takeBuildSlot: async (options) => {
|
|
114
|
+
buildSlot = await deps.acquireBuildSlot({
|
|
115
|
+
...options,
|
|
116
|
+
root,
|
|
117
|
+
logFile
|
|
118
|
+
});
|
|
119
|
+
return buildSlot;
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
try {
|
|
123
|
+
return {
|
|
124
|
+
ok: true,
|
|
125
|
+
artifact: await runArtifactLifecycle({
|
|
126
|
+
...adapter.lifecycle(run),
|
|
127
|
+
release: () => {
|
|
128
|
+
const close = closeOffload;
|
|
129
|
+
closeOffload = null;
|
|
130
|
+
try {
|
|
131
|
+
close?.();
|
|
132
|
+
} finally {
|
|
133
|
+
releaseLock();
|
|
134
|
+
releaseSlot();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}),
|
|
138
|
+
release: owned.transfer()
|
|
139
|
+
};
|
|
140
|
+
} catch (error) {
|
|
141
|
+
await adapter.settleFailed?.();
|
|
142
|
+
const failure = adapter.refuse(error);
|
|
143
|
+
if (failure === null) throw error;
|
|
144
|
+
return {
|
|
145
|
+
ok: false,
|
|
146
|
+
failure
|
|
147
|
+
};
|
|
148
|
+
} finally {
|
|
149
|
+
owned.release();
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
//#endregion
|
|
153
|
+
export { acquireArtifact as t };
|