stim 1.20.2 → 1.22.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 +141 -8
- package/dist/acquire-artifact-Co2k4f7O.mjs +171 -0
- package/dist/act-DsuqEkiM.mjs +2801 -0
- package/dist/activity-CMLmzp7o.mjs +1397 -0
- package/dist/{agent-device-usage-output-Dzgv6lgR.mjs → agent-device-usage-output-DUFaTMdd.mjs} +23 -67
- package/dist/{android-DCKZrNvV.mjs → android-ByRMUoiJ.mjs} +157 -93
- package/dist/{android-Mz_Inn3w.mjs → android-C7sVmyI9.mjs} +299 -116
- package/dist/{android-Dlzxshgp.mjs → android-DGkNqa_c.mjs} +5 -5
- package/dist/{android-HqP1_vB_.mjs → android-DR5lZ2Az.mjs} +2 -2
- package/dist/android-cas-compiler.mjs +2 -2
- package/dist/{android-cas-Bl-cLJBk.mjs → android-cas-ngferVq2.mjs} +7 -6
- package/dist/android-project-BCAAmMwz.mjs +12 -0
- package/dist/android-project-DVWyCbWU.d.mts +391 -0
- package/dist/api.d.mts +810 -64
- package/dist/api.mjs +782 -1
- package/dist/{artifact-HSwkIWEQ.mjs → artifact-8EY8SAPw.mjs} +240 -213
- package/dist/{artifact-D3czlUvT.mjs → artifact-DJPy518Y.mjs} +203 -164
- package/dist/artifact-platform-CXcmX_j3.mjs +27 -0
- package/dist/{browser-web-CA-F1GQo.mjs → browser-web-Bcv99PBM.mjs} +194 -64
- package/dist/budget-Cvwn54qV.mjs +9285 -0
- package/dist/{build-DYDbfkk5.mjs → build-CabC3G23.mjs} +153 -98
- package/dist/build-cache-Dv7RN200.mjs +602 -0
- package/dist/build-plan-DUC8Ka9y.mjs +248 -0
- package/dist/{cache-manifest-XH-fvDUj.mjs → cache-manifest-DSeQjt-Q.mjs} +2 -2
- package/dist/cache-manifest.mjs +1 -1
- package/dist/{ccache-zdKiYQ3E.mjs → ccache-Btwc36-I.mjs} +10 -9
- package/dist/{cdp-Dq_ypAlJ.mjs → cdp-3fwICjzi.mjs} +18 -5
- package/dist/{chrome-BnzZMqsR.mjs → chrome-Bbw689-6.mjs} +7 -4
- package/dist/{cli-CLP3diBm.mjs → cli-CHZa9Lvk.mjs} +20 -20
- package/dist/cli.mjs +1 -1
- package/dist/client-OyRoEuSr.mjs +1577 -0
- package/dist/collector-run.d.mts +4 -40
- package/dist/collector-run.mjs +9 -8
- package/dist/{command-output-BTy8hZ0F.mjs → command-output-gwpm28fu.mjs} +1 -1
- package/dist/config-DlrsduwG.mjs +955 -0
- package/dist/{created-devices-Dzd5C2LF.mjs → created-devices-x9rN6bhs.mjs} +14 -4
- package/dist/{dependency-state-DG0p31-y.mjs → dependency-state-1I9KZT1Y.mjs} +20 -5
- package/dist/{detached-entry-B9C_zeQC.mjs → detached-entry-BwNEtIrP.mjs} +1 -1
- package/dist/{dev-client-DAWVIGBu.mjs → dev-client-BSDR5h3F.mjs} +2 -2
- package/dist/{device-BECOiufl.mjs → device-B-L3Fbxy.mjs} +91 -34
- package/dist/device-DklWZLqb.mjs +1068 -0
- package/dist/{device-capacity-CBUAcRyQ.mjs → device-capacity-DK5_EwRS.mjs} +42 -13
- package/dist/device-host-worker.mjs +76 -79
- package/dist/{device-ios-COSi6oS1.mjs → device-ios-DoB6KFCO.mjs} +77 -51
- package/dist/{device-lease-run-Cw2M4z51.mjs → device-lease-run-xJPQ_QQG.mjs} +14 -26
- package/dist/{device-pool-Bf-pOhSw.mjs → device-pool-BMkdsefq.mjs} +5 -5
- package/dist/{doctor-kfMBnUw6.mjs → doctor-Bo7BXLux.mjs} +271 -320
- package/dist/{doctor-CB8oZKCk.mjs → doctor-D5_EzwfA.mjs} +186 -91
- package/dist/doctor-fingerprint-DZLoYFVb.mjs +16 -0
- package/dist/doctor-fingerprint.mjs +19 -0
- package/dist/doctor-thjWAV0z.mjs +2 -0
- package/dist/{doctor-watchman-BRyV2adA.mjs → doctor-watchman-N2wDotwQ.mjs} +40 -21
- package/dist/{eas-build-JyfqyHfC.mjs → eas-build-CwknaQYj.mjs} +53 -20
- package/dist/{build-plan-B7SZsc2N.mjs → eas-fallback-CSgAulr5.mjs} +41 -214
- package/dist/{watchman-CPQFZLXY.mjs → eas-session-ledger-DlY_serQ.mjs} +230 -11
- package/dist/{error-diagnostics-BR677IDM.mjs → error-diagnostics-DBWO2rxE.mjs} +172 -82
- package/dist/exec-DEoAhcze.mjs +858 -0
- package/dist/exec-DnYc4HGH.d.mts +78 -0
- package/dist/{gc-qWOMdnER.mjs → gc-CXxN-4SE.mjs} +1091 -1029
- package/dist/gc-DnNDQyaP.mjs +3 -0
- package/dist/{guide-G9cAbVAc.mjs → guide-Br0LEfKy.mjs} +1165 -297
- package/dist/{hosted-android-C3MHGld1.mjs → hosted-android-B-9f-jkd.mjs} +10 -8
- package/dist/{hosted-client-ZEKpS9vw.mjs → hosted-client-DZAPrcro.mjs} +34 -19
- package/dist/{hosted-ios-l-o3iM9J.mjs → hosted-ios-CsCS21hn.mjs} +1 -1
- package/dist/{hosted-logs-EzQM7-3Z.mjs → hosted-logs-FIRx9X2f.mjs} +77 -43
- package/dist/{hosted-macos-BACVAVqE.mjs → hosted-macos-_awYSpfv.mjs} +35 -22
- package/dist/{hosted-native-A4s1QPXe.mjs → hosted-native-BdzE668-.mjs} +49 -27
- package/dist/idle-C4cZ757K.d.mts +24 -0
- package/dist/{idle-shutdown-DtxhPTKe.mjs → idle-shutdown-DDg3SdvY.mjs} +11 -10
- package/dist/ios-CDvlmUs7.d.mts +24 -0
- package/dist/{ios-BwVCF7oA.mjs → ios-Ds1clbIt.mjs} +8 -8
- package/dist/{ios-device-D7pi2Sca.mjs → ios-device--h_-8ENa.mjs} +51 -26
- package/dist/{ios-device-B5veSDDQ.mjs → ios-device-BXZ0c7Kb.mjs} +1 -1
- package/dist/{ios-RkW4pnQf.mjs → ios-hcBpnEGk.mjs} +200 -93
- package/dist/{ios-Ce7bc7br.mjs → ios-pm4nL6By.mjs} +160 -108
- package/dist/{ios-project-K9hY_Jab.mjs → ios-project-CZhKODF3.mjs} +13 -13
- package/dist/ios-signing-BtAffm0A.mjs +489 -0
- package/dist/{ios-state-CBLe1xYw.mjs → ios-state-Dtw5K2aI.mjs} +1 -1
- package/dist/{ios-nOLJGVdy.mjs → ios-xtlRHaeB.mjs} +1 -1
- package/dist/{js-swap-Bb3nsS07.mjs → js-swap-Bwhh4S7V.mjs} +30 -25
- package/dist/{launch-C3qJ6Agb.mjs → launch-BjxemNpK.mjs} +85 -543
- package/dist/{launch-F4sOqAhB.mjs → launch-CCzXlc8r.mjs} +91 -90
- package/dist/logs-BfwwadsZ.mjs +479 -0
- package/dist/logs-jTS_lHSo.mjs +248 -0
- package/dist/{macos-D7uDvO-z.mjs → macos-DVlSSyUg.mjs} +1 -1
- package/dist/macos-NfV2D7dO.mjs +694 -0
- package/dist/macos-run.mjs +1 -1
- package/dist/maintenance-run.mjs +123 -248
- package/dist/{metro-DnCEjCxs.mjs → metro-DiXtA3Ty.mjs} +107 -30
- package/dist/metro-gateway-CKZqKqx7.mjs +209 -0
- package/dist/{named-ports-4WopRPg-.mjs → named-ports-DkEzOfzO.mjs} +42 -90
- package/dist/native-android-CqgnOgsT.mjs +645 -0
- package/dist/native-gradle-artifact-inputs-DHFnmrVf.mjs +270 -0
- package/dist/native-gradle-inputs-Dnh84Zbd.mjs +211 -0
- package/dist/native-inputs-TRTTTRxt.mjs +91 -0
- package/dist/native-run-NwUuxbkg.mjs +276 -0
- package/dist/{native-runtime-k8dTIrbK.mjs → native-runtime-B7KIafpM.mjs} +11 -9
- package/dist/native-source-Y0yLhFyQ.mjs +133 -0
- package/dist/{native-xcode-inputs-CykopJdM.mjs → native-xcode-inputs-D_VOfFL7.mjs} +26 -18
- package/dist/{native-xcode-ios-Bbf30Gm0.mjs → native-xcode-ios-BYDOHWLN.mjs} +104 -60
- package/dist/{ndjson-GOnbyvso.mjs → ndjson-CgE_o3Dl.mjs} +3 -3
- package/dist/offload-worker.d.mts +59 -41
- package/dist/offload-worker.mjs +478 -115
- package/dist/operation-exec-BW0em61G.mjs +171 -0
- package/dist/{ownership-DCtw_2IA.mjs → ownership-C5fo5Edb.mjs} +3 -3
- package/dist/{page-DRHy329N.mjs → page-DBL2PiUU.mjs} +12 -5
- package/dist/paths-BsJMoPP2.mjs +12 -0
- package/dist/paths-DQtTgsBf.mjs +42 -0
- package/dist/{placement-log-MOfPVgaM.mjs → placement-log-BnGgJRRZ.mjs} +5 -5
- package/dist/{plan-placement-V0TdzYXp.mjs → plan-placement-DIsMtN-d.mjs} +15 -11
- package/dist/{ports-DdSUicVo.mjs → ports-Cy1RkmuQ.mjs} +3 -3
- package/dist/prebuild-D4JoEAEs.mjs +484 -0
- package/dist/{project-_phNIJfs.mjs → project-wM_XFTvE.mjs} +65 -37
- package/dist/{pull-request-CQ8sPbZa.mjs → pull-request-W1IuLXDt.mjs} +102 -20
- package/dist/pull-request-eODyIqZF.d.mts +124 -0
- package/dist/pull-requests.d.mts +2 -120
- package/dist/pull-requests.mjs +2 -2
- package/dist/{react-native-android-CM1XRDwv.mjs → react-native-android-6OZ7MSM7.mjs} +121 -72
- package/dist/{gradle-DSrXb6lG.mjs → react-native-build-Dvd8hC21.mjs} +292 -15
- package/dist/react-native-doctor-DsoSF1Y9.mjs +234 -0
- package/dist/{react-native-ios-Dhq_eiYQ.mjs → react-native-ios-4u1Rn-GR.mjs} +71 -39
- package/dist/{recordings-D0d5aQt0.mjs → recordings-CQmfzAh7.mjs} +12 -9
- package/dist/registration-BcRgF6Ox.mjs +51 -0
- package/dist/{reload-C8JhxjSh.mjs → reload-BzkYabB-.mjs} +94 -47
- package/dist/reload-D7AVlb8N.mjs +2 -0
- package/dist/{remote-BiR6aYjy.mjs → remote-DjGDmlTZ.mjs} +26 -18
- package/dist/result-D2Ykz_iD.mjs +435 -0
- package/dist/{run-BtPgpKks.mjs → run-DidHghD1.mjs} +5 -5
- package/dist/selection-DSMbWEX2.mjs +620 -0
- package/dist/{server-bare-R2m_gsH8.mjs → server-bare-CafzuyFB.mjs} +3 -4
- package/dist/{server-command-CTtCkmcQ.mjs → server-command-C6QjeupS.mjs} +14 -7
- package/dist/{server-expo-DsguMGUF.mjs → server-expo-CrjB29pq.mjs} +54 -11
- package/dist/server-expo-D58c9L0M.mjs +2 -0
- package/dist/{settings-B717odTD.mjs → settings-C7O8A6ZI.mjs} +309 -119
- package/dist/settings-DpR-1Wnn.mjs +114 -0
- package/dist/settings-write-CzD60rOD.mjs +360 -0
- package/dist/settings.schema.json +176 -16
- package/dist/{simslim-CCr3rE-A.mjs → simslim-BNckWpXi.mjs} +14 -12
- package/dist/{slot-launch-DPt0m9Nd.mjs → slot-launch-CbfmNgM6.mjs} +15 -20
- package/dist/{spawn-entry-Dcb7sDUz.mjs → spawn-entry-jw19m8Nl.mjs} +0 -1
- package/dist/stage-Bps5oius.mjs +200 -0
- package/dist/{start-TXeMmmO2.mjs → start-Br-oxqMD.mjs} +1 -1
- package/dist/start-EojN4WFz.mjs +1364 -0
- package/dist/{state-D1Icyjlu.mjs → state--smjFSTL.mjs} +55 -13
- package/dist/{state-CG_OFoaA.mjs → state-08I3hw3_.mjs} +3 -2
- package/dist/{stats-BoY5sEPU.mjs → stats-D3GerlFW.mjs} +7 -13
- package/dist/stats-report-BzaPrRm6.mjs +16 -0
- package/dist/{status-BTA7kKiQ.mjs → status-BRROykC8.mjs} +7 -5
- package/dist/status-EvrK72L2.mjs +2 -0
- package/dist/{status-WgFbkRzj.mjs → status-WBDajew2.mjs} +554 -452
- package/dist/{status-watch-C23ILtf9.mjs → status-watch-Bg_u-pwR.mjs} +222 -25
- package/dist/status-worker.d.mts +1 -0
- package/dist/status-worker.mjs +19 -0
- package/dist/stim-desktop-D5OGpYZM.mjs +112 -0
- package/dist/{stop-DR6VoDIk.mjs → stop-DTZ9uTw3.mjs} +2 -2
- package/dist/{stop-DPEhunlw.mjs → stop-Dky10AEJ.mjs} +33 -23
- package/dist/{stop-BNmBMi1F.mjs → stop-Mv6W9FAk.mjs} +137 -98
- package/dist/supervisor-run.d.mts +8 -17
- package/dist/supervisor-run.mjs +56 -28
- package/dist/{support-CwjbFs9H.mjs → support-CNioewsd.mjs} +14 -14
- package/dist/{support-DMTqj3Hm.mjs → support-yUiOjnVY.mjs} +20 -13
- package/dist/swiftpm-artifact-inputs-DFcGsXDP.mjs +153 -0
- package/dist/swiftpm-macos-BIak-Rxv.mjs +532 -0
- package/dist/toolchain-BY8X8HXx.mjs +2 -0
- package/dist/toolchain-DpJMHq0n.mjs +876 -0
- package/dist/{trigger-CigAYjeL.mjs → trigger-Cbyc41d_.mjs} +21 -6
- package/dist/trigger-yb_nFzPF.mjs +2 -0
- package/dist/{warm-progress-BuY-Fvfn.mjs → warm-progress-CA3TgT3-.mjs} +263 -156
- package/dist/web-CZ07gd77.mjs +2 -0
- package/dist/{web-BDBMxDpx.mjs → web-DKx6yoFA.mjs} +20 -14
- package/dist/web-run.mjs +13 -12
- 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-state-DJt_MMvf.mjs → workspace-state-U08dEzhG.mjs} +62 -58
- package/dist/{workspaces-C36s2jb9.mjs → workspaces-CpANmBlq.mjs} +1723 -1286
- package/dist/{worktree-CgvJYJ-Q.mjs → worktree-CHecZ4Oq.mjs} +1097 -547
- package/dist/worktree-ZqZVjD9K.mjs +2 -0
- package/dist/xcode-BXn9-xYx.mjs +896 -0
- package/package.json +7 -5
- package/shim/android-audio/Main.java +24 -0
- package/shim/android-audio/README.md +17 -0
- package/shim/android-audio.jar +0 -0
- package/shim/android-optimizations.gradle +7 -5
- package/dist/activity-BSV745Kz.mjs +0 -629
- package/dist/api-qvOzWyfO.mjs +0 -154
- package/dist/api-run.mjs +0 -294
- package/dist/app-install-BIKtMfPq.mjs +0 -896
- package/dist/artifact-lifecycle-DzPpBYvK.mjs +0 -30
- package/dist/budget-f7516Zk0.mjs +0 -4106
- package/dist/build-facts-DcLv2HSd.d.mts +0 -111
- package/dist/cancellation-C_22VQTH.mjs +0 -24
- package/dist/client-qQAaXSUs.mjs +0 -1771
- package/dist/config-BYDxlMY3.mjs +0 -562
- package/dist/device-DuiPJQSn.mjs +0 -290
- package/dist/device-lease-BX1sJQ2E.mjs +0 -1224
- package/dist/device-remote-xRT0Vmo9.mjs +0 -1272
- package/dist/eas-session-ledger-Cm0Gwq2F.mjs +0 -207
- package/dist/exec-DqKo9GKJ.mjs +0 -268
- package/dist/git-DDfFzkMm.mjs +0 -45
- package/dist/launch-verify-B6Q8hZP-.mjs +0 -428
- package/dist/logs-BGrEUaEs.mjs +0 -383
- package/dist/macos-Ch5VJmcS.mjs +0 -584
- package/dist/metro-gateway-CX9Xlkq2.mjs +0 -103
- package/dist/miss-reason-mKzZ4VvN.mjs +0 -238
- package/dist/native-android-D5qc3-_v.mjs +0 -226
- package/dist/native-gradle-inputs-BsLRrl7u.mjs +0 -349
- package/dist/ndjson-Du3j0AQ9.d.mts +0 -17
- package/dist/plan-C4TjdPsR.mjs +0 -260
- package/dist/prebuild-DYbucPXy.mjs +0 -212
- package/dist/preview-78a9kR_-.mjs +0 -1011
- package/dist/react-native-build-CtCccJtb.mjs +0 -239
- package/dist/react-native-doctor-CfRnFfjs.mjs +0 -78
- package/dist/remote-cache-OyOyVIS3.mjs +0 -526
- package/dist/result-CaJg5Iat.mjs +0 -186
- package/dist/server-expo-Bigriskl.mjs +0 -2
- package/dist/settings-BORNaaCO.mjs +0 -402
- package/dist/settings-vk3mJGSm.d.mts +0 -13
- package/dist/spawn-claims-DVS5RkMS.mjs +0 -72
- package/dist/stage-KNTQopqv.mjs +0 -157
- package/dist/start-BWqzODpb.mjs +0 -1116
- package/dist/stim-desktop-BzBN2Em2.mjs +0 -63
- package/dist/swiftpm-macos-DRNVJWlb.mjs +0 -119
- package/dist/tailnet-Dh-qiYzG.mjs +0 -265
- package/dist/toolchain-BFkAcstd.mjs +0 -2
- package/dist/toolchain-DxSsNssu.mjs +0 -1657
- package/dist/trigger-9_USgmxz.mjs +0 -2
- package/dist/web-Dq-i3wzJ.mjs +0 -2
- package/dist/worktree-DpLdCHga.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
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { t as getExecutor } from "./exec-DqKo9GKJ.mjs";
|
|
2
|
-
//#region src/devices/stim-desktop.ts
|
|
3
|
-
const LAUNCH_SERVICES_LOOKUP = `ObjC.import('AppKit'); const url = $.NSWorkspace.sharedWorkspace.URLForApplicationWithBundleIdentifier('dev.stim.desktop'); url.isNil() ? '' : url.path.js`;
|
|
4
|
-
const SCHEME_HANDLER_LOOKUP = `ObjC.import('AppKit'); const url = $.NSWorkspace.sharedWorkspace.URLForApplicationToOpenURL($.NSURL.URLWithString('stim-desktop://workspace')); url.isNil() ? '' : url.path.js`;
|
|
5
|
-
const STIM_DESKTOP_INSTALLED = "Stim Desktop installed";
|
|
6
|
-
/**
|
|
7
|
-
* macOS `open` passes its environment to an app it launches, so Stim Desktop
|
|
8
|
-
* started by a command run under a scoped `STIM_HOME` would serve that home.
|
|
9
|
-
*/
|
|
10
|
-
const STIM_DESKTOP_OPEN_OPTIONS = {
|
|
11
|
-
timeoutMs: 5e3,
|
|
12
|
-
killSignal: "SIGKILL",
|
|
13
|
-
omitEnv: ["STIM_HOME"]
|
|
14
|
-
};
|
|
15
|
-
/** Stim Desktop sets `STIM_DESKTOP_APP` to its bundle path for every command it runs; a non-empty value means Desktop is installed. */
|
|
16
|
-
function stimDesktopInstalled(platform = process.platform, env = process.env) {
|
|
17
|
-
if (platform !== "darwin") return false;
|
|
18
|
-
if (env.STIM_DESKTOP_APP) return true;
|
|
19
|
-
return launchServicesFinds(LAUNCH_SERVICES_LOOKUP);
|
|
20
|
-
}
|
|
21
|
-
function launchServicesFinds(script) {
|
|
22
|
-
return Boolean(getExecutor().runFileQuiet("osascript", [
|
|
23
|
-
"-l",
|
|
24
|
-
"JavaScript",
|
|
25
|
-
"-e",
|
|
26
|
-
script
|
|
27
|
-
], {
|
|
28
|
-
timeoutMs: 5e3,
|
|
29
|
-
killSignal: "SIGKILL"
|
|
30
|
-
}));
|
|
31
|
-
}
|
|
32
|
-
function stimDesktopHandlesLinks(platform = process.platform, env = process.env) {
|
|
33
|
-
if (platform !== "darwin") return false;
|
|
34
|
-
if (env.STIM_DESKTOP_APP) return true;
|
|
35
|
-
return launchServicesFinds(SCHEME_HANDLER_LOOKUP);
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* The links that open this workspace for a human, or undefined when no app on this Mac handles
|
|
39
|
-
* `stim-desktop://`. `target` names the device Stim Desktop focuses when the user opens the workspace.
|
|
40
|
-
*/
|
|
41
|
-
function workspaceLinks(root, target, handlesLinks = stimDesktopHandlesLinks) {
|
|
42
|
-
if (!handlesLinks()) return void 0;
|
|
43
|
-
let desktop = `stim-desktop://workspace?path=${linkParam(root)}`;
|
|
44
|
-
if (target) desktop += `&platform=${target.platform}`;
|
|
45
|
-
if (target?.slot && target.slot !== "default") desktop += `&slot=${linkParam(target.slot)}`;
|
|
46
|
-
return { desktop };
|
|
47
|
-
}
|
|
48
|
-
const linkParam = (value) => encodeURIComponent(value).replaceAll("%2F", "/");
|
|
49
|
-
function workspaceLinkLine(links) {
|
|
50
|
-
return `Open in Stim Desktop: ${links.desktop}`;
|
|
51
|
-
}
|
|
52
|
-
function settingDefault(setting, desktopInstalled = stimDesktopInstalled) {
|
|
53
|
-
if (setting.desktopDefault !== void 0 && desktopInstalled()) return {
|
|
54
|
-
value: setting.desktopDefault,
|
|
55
|
-
reason: STIM_DESKTOP_INSTALLED
|
|
56
|
-
};
|
|
57
|
-
return {
|
|
58
|
-
value: setting.default,
|
|
59
|
-
reason: null
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
//#endregion
|
|
63
|
-
export { workspaceLinks as a, workspaceLinkLine as i, settingDefault as n, stimDesktopInstalled as r, STIM_DESKTOP_OPEN_OPTIONS as t };
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { t as getExecutor } from "./exec-DqKo9GKJ.mjs";
|
|
2
|
-
import { Dt as repoRoot } from "./settings-B717odTD.mjs";
|
|
3
|
-
import { a as spawnDeclared } from "./spawn-claims-DVS5RkMS.mjs";
|
|
4
|
-
import { s as macosToolchain } from "./toolchain-DxSsNssu.mjs";
|
|
5
|
-
import { i as validateInfoPlist, n as setBundleName, r as stageBundle, t as resolveBundleExtras } from "./stage-KNTQopqv.mjs";
|
|
6
|
-
import { t as logLines } from "./run-BtPgpKks.mjs";
|
|
7
|
-
import { existsSync, realpathSync } from "node:fs";
|
|
8
|
-
import { join, relative, resolve } from "node:path";
|
|
9
|
-
//#region src/integrations/swiftpm-macos.ts
|
|
10
|
-
function swiftpmMacosProject(root) {
|
|
11
|
-
return { prepare(settings) {
|
|
12
|
-
const macos = settings.macos;
|
|
13
|
-
if (!macos?.product || !macos.infoPlist) throw Object.assign(/* @__PURE__ */ new Error("Set macos.product and macos.infoPlist explicitly in .stim.json. See stim guide macos."), { code: "STIM_BAD_ARG" });
|
|
14
|
-
const { product, infoPlist } = macos;
|
|
15
|
-
const { bundleId } = validateInfoPlist(root, product, infoPlist);
|
|
16
|
-
const repository = realpathSync(repoRoot(root) ?? root);
|
|
17
|
-
const extras = resolveBundleExtras(root, repository, macos.resources, macos.assetCatalog);
|
|
18
|
-
return {
|
|
19
|
-
product,
|
|
20
|
-
arguments: macos.arguments ?? [],
|
|
21
|
-
bundleId,
|
|
22
|
-
async compile({ scratch, writer, note }) {
|
|
23
|
-
await tool(root, [
|
|
24
|
-
"build",
|
|
25
|
-
"-c",
|
|
26
|
-
"debug",
|
|
27
|
-
"--product",
|
|
28
|
-
product,
|
|
29
|
-
"--scratch-path",
|
|
30
|
-
scratch,
|
|
31
|
-
"--jobs",
|
|
32
|
-
"2"
|
|
33
|
-
], writer, note);
|
|
34
|
-
return tool(root, [
|
|
35
|
-
"build",
|
|
36
|
-
"-c",
|
|
37
|
-
"debug",
|
|
38
|
-
"--scratch-path",
|
|
39
|
-
scratch,
|
|
40
|
-
"--show-bin-path"
|
|
41
|
-
], writer, () => {}, true);
|
|
42
|
-
},
|
|
43
|
-
stage: (bin, bundle, id, displayName) => stageBundle(root, product, infoPlist, bin, bundle, id, extras, displayName),
|
|
44
|
-
validateFetched(bundle, id, displayName) {
|
|
45
|
-
const executable = join(bundle, "Contents", "MacOS", product);
|
|
46
|
-
const plist = JSON.parse(getExecutor().runFile("plutil", [
|
|
47
|
-
"-convert",
|
|
48
|
-
"json",
|
|
49
|
-
"-o",
|
|
50
|
-
"-",
|
|
51
|
-
join(bundle, "Contents", "Info.plist")
|
|
52
|
-
], { timeoutMs: 1e4 }));
|
|
53
|
-
if (plist.CFBundleIdentifier !== id || plist.CFBundleExecutable !== product || !existsSync(executable)) throw new Error("The fetched macOS bundle does not match the requested identity and executable.");
|
|
54
|
-
for (const destination of [...Object.keys(extras.resources), ...extras.assetCatalog ? ["Assets.car"] : []]) if (!existsSync(join(bundle, "Contents", "Resources", destination))) throw new Error(`The fetched macOS bundle lacks declared resource ${destination}.`);
|
|
55
|
-
if (displayName !== void 0) {
|
|
56
|
-
setBundleName(join(bundle, "Contents", "Info.plist"), displayName);
|
|
57
|
-
getExecutor().runFile("codesign", [
|
|
58
|
-
"--force",
|
|
59
|
-
"--sign",
|
|
60
|
-
"-",
|
|
61
|
-
bundle
|
|
62
|
-
], { timeoutMs: "unbounded" });
|
|
63
|
-
}
|
|
64
|
-
getExecutor().runFile("codesign", [
|
|
65
|
-
"--verify",
|
|
66
|
-
"--strict",
|
|
67
|
-
bundle
|
|
68
|
-
], { timeoutMs: "unbounded" });
|
|
69
|
-
},
|
|
70
|
-
offload: {
|
|
71
|
-
target: () => ({
|
|
72
|
-
platform: "macos",
|
|
73
|
-
local: macosToolchain()
|
|
74
|
-
}),
|
|
75
|
-
request: (id) => ({
|
|
76
|
-
platform: "macos",
|
|
77
|
-
product,
|
|
78
|
-
infoPlist: relative(root, resolve(root, infoPlist)),
|
|
79
|
-
bundleId: id,
|
|
80
|
-
resources: Object.fromEntries(Object.entries(extras.resources).map(([destination, source]) => [destination, relative(repository, source)])),
|
|
81
|
-
assetCatalog: extras.assetCatalog ? relative(repository, extras.assetCatalog) : null
|
|
82
|
-
})
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
} };
|
|
86
|
-
}
|
|
87
|
-
async function tool(root, args, writer, note, capture = false) {
|
|
88
|
-
const child = spawnDeclared(() => getExecutor().spawn("swift", args, {
|
|
89
|
-
cwd: root,
|
|
90
|
-
detached: true,
|
|
91
|
-
stdio: [
|
|
92
|
-
"ignore",
|
|
93
|
-
"pipe",
|
|
94
|
-
"pipe"
|
|
95
|
-
]
|
|
96
|
-
}));
|
|
97
|
-
let stdout = "";
|
|
98
|
-
child.stdout?.on("data", (chunk) => {
|
|
99
|
-
if (capture) stdout += chunk.toString("utf8");
|
|
100
|
-
});
|
|
101
|
-
const write = (msg) => {
|
|
102
|
-
writer.write({
|
|
103
|
-
src: "build",
|
|
104
|
-
platform: "macos",
|
|
105
|
-
level: "debug",
|
|
106
|
-
msg
|
|
107
|
-
});
|
|
108
|
-
note(msg);
|
|
109
|
-
};
|
|
110
|
-
if (child.stdout) logLines(child.stdout, write);
|
|
111
|
-
if (child.stderr) logLines(child.stderr, write);
|
|
112
|
-
await new Promise((done, reject) => {
|
|
113
|
-
child.once("error", reject);
|
|
114
|
-
child.once("close", (code) => code === 0 ? done() : reject(/* @__PURE__ */ new Error(`swift ${args[0]} failed (${code}). See stim logs --source build.`)));
|
|
115
|
-
});
|
|
116
|
-
return stdout.trim();
|
|
117
|
-
}
|
|
118
|
-
//#endregion
|
|
119
|
-
export { swiftpmMacosProject };
|
|
@@ -1,265 +0,0 @@
|
|
|
1
|
-
import { t as getExecutor } from "./exec-DqKo9GKJ.mjs";
|
|
2
|
-
import { a as updateWorkspaceState, r as readWorkspaceState$1, t as clearWorkspaceStateKey, x as workspaceDir } from "./workspace-state-DJt_MMvf.mjs";
|
|
3
|
-
import { a as formatElapsed } from "./command-output-BTy8hZ0F.mjs";
|
|
4
|
-
import { i as signalDeclaredSpawns, r as refuseDeclaredSpawns, t as allowDeclaredSpawns } from "./spawn-claims-DVS5RkMS.mjs";
|
|
5
|
-
import { a as withWorkspaceProcessLock } from "./named-ports-4WopRPg-.mjs";
|
|
6
|
-
import { endpoint, findPeer as findPeer$1, isJsonObject, parseMachine, parseMachine as parseMachine$1, pinnedEndpoint } from "@stim-cli/core/state";
|
|
7
|
-
import { WebSocket } from "ws";
|
|
8
|
-
//#region src/engine/native-run.ts
|
|
9
|
-
const NATIVE_RUN_LOCK = "native-run";
|
|
10
|
-
const NATIVE_RUN_WAIT_MS = 18e5;
|
|
11
|
-
const WAIT_HEARTBEAT_MS = 3e4;
|
|
12
|
-
const CANCEL_REQUEST_KEY = "nativeRunCancel";
|
|
13
|
-
function nativeRunHolder(holder) {
|
|
14
|
-
const { command, platform, slot } = holder.details;
|
|
15
|
-
return {
|
|
16
|
-
command: typeof command === "string" ? command : null,
|
|
17
|
-
platform: typeof platform === "string" ? platform : null,
|
|
18
|
-
slot: typeof slot === "string" ? slot : "default"
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
function describeNativeRunHolder(holder, now) {
|
|
22
|
-
const { command, slot } = nativeRunHolder(holder);
|
|
23
|
-
const started = Date.parse(holder.startedAt);
|
|
24
|
-
const facts = [`pid ${holder.owner.pid}`];
|
|
25
|
-
if (Number.isFinite(started)) facts.push(`running for ${formatElapsed(now - started)}`);
|
|
26
|
-
if (command === null) return `another Stim run (${facts.join(", ")})`;
|
|
27
|
-
if (command === "build") return `an artifact build (${facts.join(", ")})`;
|
|
28
|
-
return `\`stim ${command}${slot === "default" ? "" : ` --slot ${slot}`}\` (${facts.join(", ")})`;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Report a wait on the native-run lock: one line as soon as a holder is seen, a line for each new
|
|
32
|
-
* holder, and a heartbeat every WAIT_HEARTBEAT_MS while the same holder keeps it.
|
|
33
|
-
*/
|
|
34
|
-
function nativeRunWaitNotice({ write, now = Date.now, describe = describeNativeRunHolder }) {
|
|
35
|
-
let claimId = null;
|
|
36
|
-
let lastAt = 0;
|
|
37
|
-
return (holder, firstLine) => {
|
|
38
|
-
const at = now();
|
|
39
|
-
if (holder.claimId !== claimId) {
|
|
40
|
-
claimId = holder.claimId;
|
|
41
|
-
lastAt = at;
|
|
42
|
-
write(firstLine ?? `waiting for ${describe(holder, at)} in this workspace to finish`);
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
if (at - lastAt < WAIT_HEARTBEAT_MS) return;
|
|
46
|
-
lastAt = at;
|
|
47
|
-
write(`still waiting for ${describe(holder, at)}`);
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* What `stop` does about the run holding the native-run lock. A build is interrupted only when the stop
|
|
52
|
-
* leaves it nothing to deploy to: the whole workspace stops, the build targets the stopped slot, or the
|
|
53
|
-
* stopped slot is the workspace's only device. A build for another slot that stays is left running and
|
|
54
|
-
* the stop proceeds without the lock. Only an owner whose identity is proven live is signalled.
|
|
55
|
-
*/
|
|
56
|
-
function decideStopAction({ stopSlot, holder, ownerIdentity, deviceSlots }) {
|
|
57
|
-
if (holder.command === "macos" || holder.command === "build") {
|
|
58
|
-
if (stopSlot !== void 0) return { action: "proceed" };
|
|
59
|
-
return ownerIdentity === "same" ? { action: "interrupt" } : { action: "refuse" };
|
|
60
|
-
}
|
|
61
|
-
if (holder.command !== "ios" && holder.command !== "android") return { action: "wait" };
|
|
62
|
-
if (!(stopSlot === void 0 || holder.slot === stopSlot || deviceSlots.includes(stopSlot) && deviceSlots.every((slot) => slot === stopSlot))) return { action: "proceed" };
|
|
63
|
-
return ownerIdentity === "same" ? { action: "interrupt" } : { action: "refuse" };
|
|
64
|
-
}
|
|
65
|
-
function requestNativeRunCancel(root, claimId, pid = process.pid) {
|
|
66
|
-
updateWorkspaceState(root, (state) => ({
|
|
67
|
-
...state,
|
|
68
|
-
[CANCEL_REQUEST_KEY]: {
|
|
69
|
-
claimId,
|
|
70
|
-
pid,
|
|
71
|
-
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
72
|
-
}
|
|
73
|
-
}));
|
|
74
|
-
}
|
|
75
|
-
function cancelRequestFor(root, claimId) {
|
|
76
|
-
const request = readWorkspaceState$1(root)?.[CANCEL_REQUEST_KEY];
|
|
77
|
-
if (request?.claimId !== claimId || typeof request.pid !== "number") return null;
|
|
78
|
-
return { pid: request.pid };
|
|
79
|
-
}
|
|
80
|
-
function clearNativeRunCancel(root, claimId) {
|
|
81
|
-
try {
|
|
82
|
-
clearWorkspaceStateKey(root, CANCEL_REQUEST_KEY, (value) => value?.claimId === claimId);
|
|
83
|
-
} catch {}
|
|
84
|
-
}
|
|
85
|
-
let cancelled = null;
|
|
86
|
-
let cancellationSignal;
|
|
87
|
-
/** The active native run aborts this signal when it is cancelled. */
|
|
88
|
-
function runCancellationSignal() {
|
|
89
|
-
return cancellationSignal;
|
|
90
|
-
}
|
|
91
|
-
/** Why this process's native run was cancelled, or null while it was not. */
|
|
92
|
-
function runCancellation() {
|
|
93
|
-
return cancelled;
|
|
94
|
-
}
|
|
95
|
-
function cancelledFailure(platform, { code, message }) {
|
|
96
|
-
if (cancelled === null) return null;
|
|
97
|
-
return {
|
|
98
|
-
code: "STIM_CANCELLED",
|
|
99
|
-
message: `The ${platform} run was ${cancelled} before it finished.`,
|
|
100
|
-
remedy: `Run \`stim ${platform}\` again when you want the app on a device.`,
|
|
101
|
-
lines: [`it stopped at ${code ?? "an unfinished step"}${message ? `: ${message}` : ""}`]
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
function cancelOnInterrupt({ root, claim, write, exit, controller }) {
|
|
105
|
-
let signals = 0;
|
|
106
|
-
const onInterrupt = () => {
|
|
107
|
-
signals += 1;
|
|
108
|
-
if (signals > 1) {
|
|
109
|
-
exit(130);
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
const request = cancelRequestFor(root, claim.claimId);
|
|
113
|
-
cancelled = request ? `cancelled by \`stim stop\` (pid ${request.pid})` : "cancelled by an interrupt";
|
|
114
|
-
controller.abort();
|
|
115
|
-
refuseDeclaredSpawns(`the run was ${cancelled}`);
|
|
116
|
-
const signalled = signalDeclaredSpawns("SIGINT");
|
|
117
|
-
write(signalled > 0 ? `${cancelled}; stopping the running build tool` : request ? `${cancelled}; stopping before the next build tool or install` : cancelled);
|
|
118
|
-
if (signalled === 0 && !request) exit(130);
|
|
119
|
-
};
|
|
120
|
-
process.on("SIGINT", onInterrupt);
|
|
121
|
-
return () => {
|
|
122
|
-
process.off("SIGINT", onInterrupt);
|
|
123
|
-
allowDeclaredSpawns();
|
|
124
|
-
clearNativeRunCancel(root, claim.claimId);
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Run an `ios`, `android` or `macos` invocation under the workspace's native-run lock: the claim records the
|
|
129
|
-
* command, platform and slot, and a wait for another holder is reported on `write`. The first SIGINT
|
|
130
|
-
* forwards the interrupt to the running declared build tool; a run `stim stop` cancelled between build
|
|
131
|
-
* tools starts no further one; a terminal interrupt with no build tool running, or a second SIGINT, exits
|
|
132
|
-
* with 130 at once.
|
|
133
|
-
*/
|
|
134
|
-
function withNativeBuildRun(root, details, fn, { write, exit = (code) => process.exit(code) }) {
|
|
135
|
-
const notice = nativeRunWaitNotice({ write });
|
|
136
|
-
return withWorkspaceProcessLock(workspaceDir(root), NATIVE_RUN_LOCK, async (claim) => {
|
|
137
|
-
cancelled = null;
|
|
138
|
-
const controller = new AbortController();
|
|
139
|
-
cancellationSignal = controller.signal;
|
|
140
|
-
const dispose = cancelOnInterrupt({
|
|
141
|
-
root,
|
|
142
|
-
claim,
|
|
143
|
-
write,
|
|
144
|
-
exit,
|
|
145
|
-
controller
|
|
146
|
-
});
|
|
147
|
-
try {
|
|
148
|
-
return await fn(claim);
|
|
149
|
-
} finally {
|
|
150
|
-
dispose();
|
|
151
|
-
cancellationSignal = void 0;
|
|
152
|
-
}
|
|
153
|
-
}, {
|
|
154
|
-
external: true,
|
|
155
|
-
waitMs: NATIVE_RUN_WAIT_MS,
|
|
156
|
-
declareSpawns: true,
|
|
157
|
-
details: { ...details },
|
|
158
|
-
onHeld: (holder) => notice(holder)
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
//#endregion
|
|
162
|
-
//#region src/offload/tailnet.ts
|
|
163
|
-
const MAC_APP_TAILSCALE = "/Applications/Tailscale.app/Contents/MacOS/Tailscale";
|
|
164
|
-
const HELLO_TIMEOUT_MS = 1e4;
|
|
165
|
-
function isLapsed(credential) {
|
|
166
|
-
return credential.state === "pending" && !!credential.expiresAt && Date.parse(credential.expiresAt) <= Date.now();
|
|
167
|
-
}
|
|
168
|
-
function markApproved(credential) {
|
|
169
|
-
const { expiresAt: _expiresAt, ...rest } = credential;
|
|
170
|
-
return {
|
|
171
|
-
...rest,
|
|
172
|
-
state: "approved"
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
function pendingReport(credential) {
|
|
176
|
-
return {
|
|
177
|
-
state: "pending",
|
|
178
|
-
...credential.expiresAt ? { expiresAt: credential.expiresAt } : {}
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
function lapsedLine(machine, credential) {
|
|
182
|
-
return `${machine} did not approve this Mac before the request lapsed at ${credential.expiresAt}.`;
|
|
183
|
-
}
|
|
184
|
-
function requestedLine(credential) {
|
|
185
|
-
return `Requested at ${credential.requestedAt}${credential.expiresAt ? `; the request lapses at ${credential.expiresAt}` : ""}.`;
|
|
186
|
-
}
|
|
187
|
-
function parseTailscaleStatus(output) {
|
|
188
|
-
try {
|
|
189
|
-
const status = JSON.parse(output);
|
|
190
|
-
return isJsonObject(status) && status.BackendState === "Running" ? status : null;
|
|
191
|
-
} catch {
|
|
192
|
-
return null;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
function tailscaleStatus() {
|
|
196
|
-
for (const binary of ["tailscale", MAC_APP_TAILSCALE]) {
|
|
197
|
-
const output = getExecutor().runFileQuiet(binary, ["status", "--json"], { timeoutMs: 5e3 });
|
|
198
|
-
if (output !== null) return parseTailscaleStatus(output);
|
|
199
|
-
}
|
|
200
|
-
return null;
|
|
201
|
-
}
|
|
202
|
-
async function tailscaleStatusAsync() {
|
|
203
|
-
for (const binary of ["tailscale", MAC_APP_TAILSCALE]) {
|
|
204
|
-
let output;
|
|
205
|
-
try {
|
|
206
|
-
output = await getExecutor().runFileAsync(binary, ["status", "--json"], { timeoutMs: 5e3 });
|
|
207
|
-
} catch {
|
|
208
|
-
continue;
|
|
209
|
-
}
|
|
210
|
-
return parseTailscaleStatus(output);
|
|
211
|
-
}
|
|
212
|
-
return null;
|
|
213
|
-
}
|
|
214
|
-
function hello({ url, servername, host }, auth) {
|
|
215
|
-
return new Promise((resolve) => {
|
|
216
|
-
const socket = new WebSocket(url, {
|
|
217
|
-
handshakeTimeout: HELLO_TIMEOUT_MS,
|
|
218
|
-
servername,
|
|
219
|
-
headers: { Host: host }
|
|
220
|
-
});
|
|
221
|
-
const done = (reply) => {
|
|
222
|
-
clearTimeout(timer);
|
|
223
|
-
socket.removeAllListeners();
|
|
224
|
-
socket.on("error", () => {});
|
|
225
|
-
socket.close();
|
|
226
|
-
resolve(reply);
|
|
227
|
-
};
|
|
228
|
-
const timer = setTimeout(() => done({ failed: "no reply in time" }), HELLO_TIMEOUT_MS);
|
|
229
|
-
socket.on("open", () => {
|
|
230
|
-
socket.send(JSON.stringify({
|
|
231
|
-
id: 1,
|
|
232
|
-
method: "hello",
|
|
233
|
-
params: {
|
|
234
|
-
protocol: 1,
|
|
235
|
-
client: {
|
|
236
|
-
name: "stim",
|
|
237
|
-
version: "1"
|
|
238
|
-
},
|
|
239
|
-
auth
|
|
240
|
-
}
|
|
241
|
-
}));
|
|
242
|
-
});
|
|
243
|
-
socket.on("message", (data) => {
|
|
244
|
-
let message;
|
|
245
|
-
try {
|
|
246
|
-
message = JSON.parse(String(data));
|
|
247
|
-
} catch {
|
|
248
|
-
message = null;
|
|
249
|
-
}
|
|
250
|
-
if (isJsonObject(message) && ("result" in message || "error" in message)) return done(message);
|
|
251
|
-
done({ failed: "the reply was not a hello result" });
|
|
252
|
-
});
|
|
253
|
-
socket.on("error", (error) => done({ failed: error.message }));
|
|
254
|
-
socket.on("close", () => done({ failed: "the connection closed before a reply" }));
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
const realIo = {
|
|
258
|
-
status: tailscaleStatus,
|
|
259
|
-
hello
|
|
260
|
-
};
|
|
261
|
-
async function pinnedEndpoint$1(credential, status = tailscaleStatusAsync) {
|
|
262
|
-
return pinnedEndpoint(credential, parseMachine(credential.machine) ? await status() : null);
|
|
263
|
-
}
|
|
264
|
-
//#endregion
|
|
265
|
-
export { withNativeBuildRun as S, nativeRunHolder as _, markApproved as a, runCancellation as b, pinnedEndpoint$1 as c, NATIVE_RUN_LOCK as d, NATIVE_RUN_WAIT_MS as f, describeNativeRunHolder as g, decideStopAction as h, lapsedLine as i, realIo as l, clearNativeRunCancel as m, findPeer$1 as n, parseMachine$1 as o, cancelledFailure as p, isLapsed as r, pendingReport as s, endpoint as t, requestedLine as u, nativeRunWaitNotice as v, runCancellationSignal as x, requestNativeRunCancel as y };
|