stim 1.20.2 → 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 +88 -8
- 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-Dzgv6lgR.mjs → agent-device-usage-output-zh1vhbLp.mjs} +21 -65
- package/dist/{android-HqP1_vB_.mjs → android-BEJ8Jpl7.mjs} +2 -2
- package/dist/{android-DCKZrNvV.mjs → android-BLgbNqox.mjs} +128 -78
- package/dist/{android-Dlzxshgp.mjs → android-CV_GCELZ.mjs} +5 -5
- package/dist/{android-Mz_Inn3w.mjs → android-DUYkNF4u.mjs} +184 -102
- package/dist/{android-cas-Bl-cLJBk.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-HSwkIWEQ.mjs → artifact-B8T3S5gi.mjs} +223 -201
- package/dist/{artifact-D3czlUvT.mjs → artifact-DAuZ-FNU.mjs} +158 -148
- package/dist/{browser-web-CA-F1GQo.mjs → browser-web-QQzVjz3O.mjs} +26 -24
- package/dist/budget-Bs6SxxzO.mjs +9154 -0
- package/dist/{build-DYDbfkk5.mjs → build-CoPzQRNw.mjs} +144 -96
- package/dist/build-cache-DmyR9Zzc.mjs +602 -0
- package/dist/build-plan-CaFskB7_.mjs +188 -0
- package/dist/{cache-manifest-XH-fvDUj.mjs → cache-manifest-DkkqguoK.mjs} +2 -2
- package/dist/cache-manifest.mjs +1 -1
- package/dist/{ccache-zdKiYQ3E.mjs → ccache-BJRZ9pG3.mjs} +10 -9
- package/dist/{cdp-Dq_ypAlJ.mjs → cdp-CWmIUMbw.mjs} +18 -5
- package/dist/{chrome-BnzZMqsR.mjs → chrome-B6tfCta1.mjs} +7 -4
- package/dist/{cli-CLP3diBm.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 -40
- package/dist/collector-run.mjs +9 -8
- package/dist/{command-output-BTy8hZ0F.mjs → command-output-B1UrjZHL.mjs} +1 -1
- package/dist/config-CYcBF478.mjs +949 -0
- package/dist/{created-devices-Dzd5C2LF.mjs → created-devices-CqeBlrEn.mjs} +3 -3
- package/dist/{dependency-state-DG0p31-y.mjs → dependency-state-BbKQW83h.mjs} +20 -5
- package/dist/{detached-entry-B9C_zeQC.mjs → detached-entry-DFRyG1_o.mjs} +1 -1
- package/dist/{dev-client-DAWVIGBu.mjs → dev-client-UOeESKm6.mjs} +2 -2
- package/dist/device-DCxH7_By.mjs +1068 -0
- package/dist/{device-BECOiufl.mjs → device-ExJq8Ei7.mjs} +35 -35
- package/dist/{device-capacity-CBUAcRyQ.mjs → device-capacity-CMlqEcvw.mjs} +43 -13
- package/dist/device-host-worker.mjs +65 -61
- package/dist/{device-ios-COSi6oS1.mjs → device-ios-DRUeKaFV.mjs} +48 -45
- package/dist/{device-lease-run-Cw2M4z51.mjs → device-lease-run-C8raGFoP.mjs} +14 -26
- package/dist/{device-pool-Bf-pOhSw.mjs → device-pool-DMRpVX9a.mjs} +5 -5
- package/dist/doctor-BLHCYxzi.mjs +2 -0
- package/dist/{doctor-kfMBnUw6.mjs → doctor-DTvaDOda.mjs} +281 -317
- package/dist/{doctor-CB8oZKCk.mjs → doctor-Dhqebm0q.mjs} +183 -91
- package/dist/doctor-fingerprint.mjs +19 -0
- package/dist/{doctor-watchman-BRyV2adA.mjs → doctor-watchman-Cv1F10Kj.mjs} +40 -21
- package/dist/{eas-build-JyfqyHfC.mjs → eas-build-BomfRnFT.mjs} +53 -20
- package/dist/{build-plan-B7SZsc2N.mjs → eas-fallback-DJwZpy0c.mjs} +26 -208
- package/dist/{watchman-CPQFZLXY.mjs → eas-session-ledger-op6A54yi.mjs} +229 -11
- package/dist/{error-diagnostics-BR677IDM.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-qWOMdnER.mjs → gc-_-dCXdyL.mjs} +584 -796
- package/dist/git-C3iTsJaZ.mjs +73 -0
- package/dist/{guide-G9cAbVAc.mjs → guide-Yqwt2bd6.mjs} +941 -269
- package/dist/{hosted-android-C3MHGld1.mjs → hosted-android-Bw-honsd.mjs} +8 -6
- package/dist/{hosted-client-ZEKpS9vw.mjs → hosted-client-DB_gBPfY.mjs} +34 -19
- package/dist/{hosted-ios-l-o3iM9J.mjs → hosted-ios-CUvOf4Vr.mjs} +1 -1
- package/dist/{hosted-logs-EzQM7-3Z.mjs → hosted-logs-DL_P5AdN.mjs} +77 -43
- package/dist/{hosted-macos-BACVAVqE.mjs → hosted-macos-QI141yKk.mjs} +21 -17
- package/dist/{hosted-native-A4s1QPXe.mjs → hosted-native-Ksyjgzq-.mjs} +30 -21
- package/dist/idle-BVeRGroT.d.mts +24 -0
- package/dist/{idle-shutdown-DtxhPTKe.mjs → idle-shutdown-DaKmZi0z.mjs} +11 -10
- package/dist/{ios-BwVCF7oA.mjs → ios-CQ68hG9s.mjs} +8 -8
- package/dist/{ios-RkW4pnQf.mjs → ios-CpByZy12.mjs} +140 -80
- package/dist/{ios-device-B5veSDDQ.mjs → ios-device-CXGP1bsD.mjs} +1 -1
- package/dist/{ios-device-D7pi2Sca.mjs → ios-device-CwFMehUS.mjs} +51 -26
- package/dist/{ios-project-K9hY_Jab.mjs → ios-project-WuwwBdvW.mjs} +13 -13
- package/dist/{ios-nOLJGVdy.mjs → ios-qNJt4dFm.mjs} +1 -1
- package/dist/ios-signing-DTTIChGs.mjs +489 -0
- package/dist/{ios-state-CBLe1xYw.mjs → ios-state-DvFX-K_l.mjs} +1 -1
- package/dist/{ios-Ce7bc7br.mjs → ios-ubFsBzwq.mjs} +129 -86
- package/dist/{js-swap-Bb3nsS07.mjs → js-swap-Cc1dttps.mjs} +53 -26
- package/dist/{launch-F4sOqAhB.mjs → launch-CD1yVc7U.mjs} +91 -90
- package/dist/{launch-C3qJ6Agb.mjs → launch-Zq2mOSDy.mjs} +82 -541
- package/dist/logs-BS00Anxf.mjs +352 -0
- package/dist/logs-CMm05HxN.mjs +255 -0
- package/dist/{macos-D7uDvO-z.mjs → macos-B65--pPd.mjs} +1 -1
- package/dist/{macos-Ch5VJmcS.mjs → macos-C-0qJ6zq.mjs} +225 -212
- package/dist/macos-run.mjs +1 -1
- package/dist/maintenance-run.mjs +122 -247
- package/dist/{metro-DnCEjCxs.mjs → metro-DEXpIhHC.mjs} +67 -12
- package/dist/{metro-gateway-CX9Xlkq2.mjs → metro-gateway-BMJNlj3E.mjs} +20 -12
- package/dist/{named-ports-4WopRPg-.mjs → named-ports-BWTzt6mu.mjs} +8 -63
- package/dist/native-android-JACyjTZs.mjs +844 -0
- package/dist/{native-gradle-inputs-BsLRrl7u.mjs → native-gradle-inputs-Bep9JcSF.mjs} +128 -140
- package/dist/native-inputs-TRTTTRxt.mjs +91 -0
- package/dist/native-run-DY_RLx3C.mjs +277 -0
- package/dist/{native-runtime-k8dTIrbK.mjs → native-runtime-Dg1Q7tfF.mjs} +9 -8
- package/dist/{native-xcode-inputs-CykopJdM.mjs → native-xcode-inputs-CB2iQeWq.mjs} +27 -18
- package/dist/{native-xcode-ios-Bbf30Gm0.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 +197 -66
- package/dist/{ownership-DCtw_2IA.mjs → ownership-DEmM5vhh.mjs} +3 -3
- package/dist/{page-DRHy329N.mjs → page-CPaHeYqj.mjs} +7 -4
- package/dist/paths-BsJMoPP2.mjs +12 -0
- package/dist/paths-DQtTgsBf.mjs +42 -0
- package/dist/{placement-log-MOfPVgaM.mjs → placement-log-BqGbTa61.mjs} +5 -5
- package/dist/{plan-placement-V0TdzYXp.mjs → plan-placement-Bwj-IjY1.mjs} +6 -6
- package/dist/{ports-DdSUicVo.mjs → ports-D-MmCTdv.mjs} +3 -3
- package/dist/prebuild-uD_ipCxF.mjs +449 -0
- package/dist/{project-_phNIJfs.mjs → project-BZNjmW_8.mjs} +65 -37
- package/dist/{pull-request-CQ8sPbZa.mjs → pull-request-Lfetn8Kr.mjs} +2 -2
- 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-CM1XRDwv.mjs → react-native-android-DuzH0cn3.mjs} +74 -48
- package/dist/{gradle-DSrXb6lG.mjs → react-native-build-rhk4smwQ.mjs} +292 -15
- package/dist/react-native-doctor-CQpuIMso.mjs +234 -0
- package/dist/{react-native-ios-Dhq_eiYQ.mjs → react-native-ios-Bhq1rJeV.mjs} +46 -28
- package/dist/{recordings-D0d5aQt0.mjs → recordings-DYteQSu4.mjs} +12 -9
- package/dist/{reload-C8JhxjSh.mjs → reload-CmTRFJaX.mjs} +93 -47
- package/dist/reload-DzjSl5P_.mjs +2 -0
- package/dist/{remote-BiR6aYjy.mjs → remote-ByYkXdGD.mjs} +15 -10
- package/dist/result-DNiS-tTP.mjs +434 -0
- package/dist/{run-BtPgpKks.mjs → run-D23HmJMs.mjs} +4 -5
- package/dist/selection-CSl9i5qU.mjs +619 -0
- package/dist/{server-bare-R2m_gsH8.mjs → server-bare-CxTrvDg8.mjs} +3 -4
- package/dist/{server-command-CTtCkmcQ.mjs → server-command-CtzloH3v.mjs} +14 -7
- package/dist/server-expo-C-90EhcG.mjs +2 -0
- package/dist/{server-expo-DsguMGUF.mjs → server-expo-DT_F_uVI.mjs} +50 -9
- package/dist/{settings-B717odTD.mjs → settings-CsJDEXgK.mjs} +234 -24
- 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-CCr3rE-A.mjs → simslim-Cgk17SXV.mjs} +14 -12
- package/dist/{slot-launch-DPt0m9Nd.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-BWqzODpb.mjs → start-7lpH7hmN.mjs} +63 -44
- package/dist/{start-TXeMmmO2.mjs → start-RChynRDp.mjs} +1 -1
- package/dist/{state-D1Icyjlu.mjs → state-C4ZtUisW.mjs} +40 -13
- package/dist/{state-CG_OFoaA.mjs → state-XMziexv2.mjs} +3 -2
- package/dist/{stats-BoY5sEPU.mjs → stats-53T7OTb9.mjs} +7 -13
- package/dist/stats-report-BFfMpWWF.mjs +16 -0
- package/dist/{status-WgFbkRzj.mjs → status-BL7jVyAB.mjs} +535 -447
- package/dist/status-CSi6tlRq.mjs +2 -0
- package/dist/{status-BTA7kKiQ.mjs → status-DqEUSSxs.mjs} +6 -4
- package/dist/{status-watch-C23ILtf9.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-DR6VoDIk.mjs → stop-Bk_1qiV6.mjs} +2 -2
- package/dist/{stop-BNmBMi1F.mjs → stop-CPzlM1L-.mjs} +138 -98
- package/dist/{stop-DPEhunlw.mjs → stop-D7h6jAXQ.mjs} +11 -10
- package/dist/supervisor-run.d.mts +8 -17
- package/dist/supervisor-run.mjs +63 -27
- package/dist/{support-DMTqj3Hm.mjs → support-67vraa1Q.mjs} +18 -11
- package/dist/{support-CwjbFs9H.mjs → support-Dlu37g6H.mjs} +12 -12
- package/dist/{swiftpm-macos-DRNVJWlb.mjs → swiftpm-macos-p8WZbxKU.mjs} +35 -24
- package/dist/toolchain-DhKwp9iI.mjs +2 -0
- package/dist/toolchain-Hp9sCpK4.mjs +873 -0
- package/dist/{trigger-CigAYjeL.mjs → trigger-BAahxUPq.mjs} +20 -5
- package/dist/trigger-Bf3uDcpv.mjs +2 -0
- package/dist/{warm-progress-BuY-Fvfn.mjs → warm-progress-BHX5r0Ei.mjs} +250 -156
- package/dist/{web-BDBMxDpx.mjs → web-CJmIj6AI.mjs} +18 -13
- package/dist/web-DknQETPs.mjs +2 -0
- package/dist/web-run.mjs +11 -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-process-lock-1_1OoVW5.mjs +57 -0
- package/dist/{workspace-state-DJt_MMvf.mjs → workspace-state-Cjuigeeu.mjs} +62 -58
- package/dist/{workspaces-C36s2jb9.mjs → workspaces-BccMFmGQ.mjs} +1188 -1079
- package/dist/worktree-CK2MpJW5.mjs +2 -0
- package/dist/{worktree-CgvJYJ-Q.mjs → worktree-DQ6Zi2Mv.mjs} +304 -53
- package/dist/xcode-Zlx3qjEs.mjs +896 -0
- package/package.json +7 -5
- 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/miss-reason-mKzZ4VvN.mjs +0 -238
- package/dist/native-android-D5qc3-_v.mjs +0 -226
- 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/spawn-claims-DVS5RkMS.mjs +0 -72
- package/dist/stage-KNTQopqv.mjs +0 -157
- package/dist/stim-desktop-BzBN2Em2.mjs +0 -63
- 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
package/dist/{agent-device-usage-output-Dzgv6lgR.mjs → agent-device-usage-output-zh1vhbLp.mjs}
RENAMED
|
@@ -1,62 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { o as formatLongDuration } from "./command-output-
|
|
4
|
-
import { c as listWorkspaceDirs } from "./workspaces-
|
|
5
|
-
import {
|
|
6
|
-
import { existsSync,
|
|
7
|
-
import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
8
|
-
import { agentDeviceUsageFile, readAgentDeviceUsageCache, readSwiftpmCacheUsage, swiftpmCacheUsageFile } from "@stim-cli/core/state";
|
|
9
|
-
import { configDir } from "@stim-cli/core";
|
|
10
|
-
import { randomUUID } from "node:crypto";
|
|
1
|
+
import { p as process_identity_exports } from "./exec-_UbtCQcG.mjs";
|
|
2
|
+
import { P as formatBytes } from "./config-CYcBF478.mjs";
|
|
3
|
+
import { o as formatLongDuration } from "./command-output-B1UrjZHL.mjs";
|
|
4
|
+
import { M as canonical, N as measureDu, P as writeUsageCache, c as listWorkspaceDirs } from "./workspaces-BccMFmGQ.mjs";
|
|
5
|
+
import { c as parseAgentDeviceRecord, o as envDir, u as processMatches } from "./activity-BzVfHSrY.mjs";
|
|
6
|
+
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
11
7
|
import { homedir } from "node:os";
|
|
8
|
+
import { isAbsolute, join, relative, sep } from "node:path";
|
|
9
|
+
import { configDir } from "@stim-cli/core";
|
|
10
|
+
import { agentDeviceUsageFile, readAgentDeviceUsageCache, readSwiftpmCacheUsage, swiftpmCacheUsageFile } from "@stim-cli/core/state";
|
|
12
11
|
import chalk from "chalk";
|
|
13
|
-
//#region src/devices/report-only-usage.ts
|
|
14
|
-
function canonical(path) {
|
|
15
|
-
try {
|
|
16
|
-
return realpathSync.native(path);
|
|
17
|
-
} catch {
|
|
18
|
-
return resolve(path);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
function parseDu(output) {
|
|
22
|
-
const sizes = /* @__PURE__ */ new Map();
|
|
23
|
-
for (const line of output.split("\n")) {
|
|
24
|
-
const match = /^(\d+)\t(.+?)\r?$/.exec(line);
|
|
25
|
-
if (match) sizes.set(resolve(match[2]), Number(match[1]) * 1024);
|
|
26
|
-
}
|
|
27
|
-
return sizes;
|
|
28
|
-
}
|
|
29
|
-
async function measureDu(args) {
|
|
30
|
-
let output = "";
|
|
31
|
-
let complete = true;
|
|
32
|
-
try {
|
|
33
|
-
output = await getExecutor().runFileAsync("du", args, { timeoutMs: 2e4 });
|
|
34
|
-
} catch (error) {
|
|
35
|
-
complete = false;
|
|
36
|
-
const failure = error;
|
|
37
|
-
if (failure.status === 1 && !failure.code && typeof failure.stdout === "string") output = failure.stdout;
|
|
38
|
-
}
|
|
39
|
-
return {
|
|
40
|
-
sizes: parseDu(output),
|
|
41
|
-
complete
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
function writeUsageCache(file, value) {
|
|
45
|
-
const temporary = `${file}.${randomUUID()}.tmp`;
|
|
46
|
-
try {
|
|
47
|
-
mkdirSync(dirname(file), { recursive: true });
|
|
48
|
-
writeFileSync(temporary, JSON.stringify(value));
|
|
49
|
-
renameSync(temporary, file);
|
|
50
|
-
} catch {
|
|
51
|
-
try {
|
|
52
|
-
rmSync(temporary, { force: true });
|
|
53
|
-
} catch {}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
//#endregion
|
|
57
12
|
//#region src/devices/swiftpm-cache-usage.ts
|
|
58
|
-
async function getSwiftpmCacheUsage({ maxAgeMs = 6e5 } = {}) {
|
|
59
|
-
const
|
|
13
|
+
async function getSwiftpmCacheUsage({ maxAgeMs = 6e5, operation } = {}) {
|
|
14
|
+
const env = operation?.env ?? process.env;
|
|
15
|
+
const dir = canonical(process.platform === "darwin" ? join(env.HOME || env.USERPROFILE || homedir(), "Library", "Caches", "org.swift.swiftpm") : join(env.XDG_CACHE_HOME || join(env.HOME || env.USERPROFILE || homedir(), ".cache"), "org.swift.swiftpm"));
|
|
60
16
|
const cached = readSwiftpmCacheUsage();
|
|
61
17
|
const age = cached ? Date.now() - Date.parse(cached.measuredAt) : Infinity;
|
|
62
18
|
if (cached && cached.dir === dir && age >= 0 && age < maxAgeMs) return cached;
|
|
@@ -71,7 +27,7 @@ async function getSwiftpmCacheUsage({ maxAgeMs = 6e5 } = {}) {
|
|
|
71
27
|
bytes,
|
|
72
28
|
complete: bytes !== null
|
|
73
29
|
};
|
|
74
|
-
writeUsageCache(swiftpmCacheUsageFile(), usage);
|
|
30
|
+
writeUsageCache(swiftpmCacheUsageFile(), usage, operation?.signal);
|
|
75
31
|
return usage;
|
|
76
32
|
}
|
|
77
33
|
//#endregion
|
|
@@ -234,18 +190,18 @@ function readRunnerLock(dir) {
|
|
|
234
190
|
} catch {}
|
|
235
191
|
return "unreadable";
|
|
236
192
|
}
|
|
237
|
-
function discover() {
|
|
238
|
-
const runnerRoot = canonical(join(homedir(), ".agent-device", "apple-runner"));
|
|
193
|
+
function discover(env, cwd) {
|
|
194
|
+
const runnerRoot = canonical(join(env?.HOME || env?.USERPROFILE || homedir(), ".agent-device", "apple-runner"));
|
|
239
195
|
const hostedDir = canonical(join(configDir(), "server", "agent-device"));
|
|
240
196
|
const workspaceDirs = listWorkspaceDirs().map(({ dir, projectRoot }) => ({
|
|
241
197
|
dir: canonical(workspaceAgentDeviceDir(dir)),
|
|
242
198
|
projectRoot,
|
|
243
199
|
bytes: null
|
|
244
200
|
}));
|
|
245
|
-
const override = envDir("AGENT_DEVICE_STATE_DIR");
|
|
201
|
+
const override = envDir("AGENT_DEVICE_STATE_DIR", env, cwd);
|
|
246
202
|
const candidate = override ? canonical(override) : null;
|
|
247
203
|
const overlaps = candidate && [...workspaceDirs.map(({ dir }) => dir), hostedDir].some((dir) => contains(dir, candidate) || contains(candidate, dir));
|
|
248
|
-
const stateDir = candidate && !overlaps ? candidate : canonical(join(homedir(), ".agent-device"));
|
|
204
|
+
const stateDir = candidate && !overlaps ? candidate : canonical(join(env?.HOME || env?.USERPROFILE || homedir(), ".agent-device"));
|
|
249
205
|
const workspaces = workspaceDirs.filter(({ dir }) => existsSync(dir));
|
|
250
206
|
const roots = {
|
|
251
207
|
stateDir,
|
|
@@ -253,7 +209,7 @@ function discover() {
|
|
|
253
209
|
hostedDir,
|
|
254
210
|
workspaceDirs: workspaces.map(({ dir }) => dir).toSorted()
|
|
255
211
|
};
|
|
256
|
-
const leaseDir = envDir("AGENT_DEVICE_IOS_RUNNER_LEASE_DIR") ?? join(runnerRoot, "leases");
|
|
212
|
+
const leaseDir = envDir("AGENT_DEVICE_IOS_RUNNER_LEASE_DIR", env, cwd) ?? join(runnerRoot, "leases");
|
|
257
213
|
let leases = [];
|
|
258
214
|
let unreadable = false;
|
|
259
215
|
try {
|
|
@@ -332,8 +288,8 @@ function discover() {
|
|
|
332
288
|
absent
|
|
333
289
|
};
|
|
334
290
|
}
|
|
335
|
-
async function getAgentDeviceUsage({ maxAgeMs = MAX_AGE_MS } = {}) {
|
|
336
|
-
const tree = discover();
|
|
291
|
+
async function getAgentDeviceUsage({ maxAgeMs = MAX_AGE_MS, operation } = {}) {
|
|
292
|
+
const tree = discover(operation?.env, operation?.cwd);
|
|
337
293
|
const cached = readAgentDeviceUsageCache();
|
|
338
294
|
const age = cached ? Date.now() - Date.parse(cached.usage.measuredAt) : Infinity;
|
|
339
295
|
if (cached && age >= 0 && age < maxAgeMs && JSON.stringify(cached.roots) === JSON.stringify(tree.roots)) return cached.usage;
|
|
@@ -362,7 +318,7 @@ async function getAgentDeviceUsage({ maxAgeMs = MAX_AGE_MS } = {}) {
|
|
|
362
318
|
writeUsageCache(agentDeviceUsageFile(), {
|
|
363
319
|
...usage,
|
|
364
320
|
roots: tree.roots
|
|
365
|
-
});
|
|
321
|
+
}, operation?.signal);
|
|
366
322
|
return usage;
|
|
367
323
|
}
|
|
368
324
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as getExecutor } from "./exec-
|
|
2
|
-
import { u as androidToolCwd } from "./android-
|
|
1
|
+
import { t as getExecutor } from "./exec-_UbtCQcG.mjs";
|
|
2
|
+
import { u as androidToolCwd } from "./android-DUYkNF4u.mjs";
|
|
3
3
|
//#region src/collector/android.ts
|
|
4
4
|
const LEVEL_BY_LETTER = {
|
|
5
5
|
V: "debug",
|