stim 1.8.0 → 1.9.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 (80) hide show
  1. package/README.md +23 -155
  2. package/dist/{android-BRgBYzU0.mjs → android-BPGizezh.mjs} +112 -135
  3. package/dist/{android-DeYdjjBP.mjs → android-DEgo4oCo.mjs} +2 -2
  4. package/dist/{android-DWssqHQ8.mjs → android-_y4Ohi5z.mjs} +54 -15
  5. package/dist/android-cas-compiler.mjs +2 -2
  6. package/dist/{android-cas-SWIjzeuL.mjs → android-cas-eiExNLf7.mjs} +21 -14
  7. package/dist/app-install-Uf3a83Tv.mjs +819 -0
  8. package/dist/{build-lock-CgtsB6TV.mjs → build-lock-DPXPLgTc.mjs} +120 -24
  9. package/dist/build-progress-CVqkfPC6.mjs +188 -0
  10. package/dist/{cache-manifest-CYJi8-Hx.mjs → cache-manifest-Dg7OnMrp.mjs} +4 -4
  11. package/dist/cache-manifest.mjs +1 -1
  12. package/dist/cli.mjs +22 -19
  13. package/dist/collector-run.d.mts +2 -0
  14. package/dist/collector-run.mjs +10 -9
  15. package/dist/{command-output-B3ycpsYv.mjs → command-output-gByVmIjy.mjs} +11 -2
  16. package/dist/{config-B7iyKWkL.mjs → config-Cp9lM3wX.mjs} +187 -57
  17. package/dist/{dependency-state-D0M7oKA7.mjs → dependency-state-Bq5DcLGn.mjs} +2 -2
  18. package/dist/{deps-oCXVNEqQ.mjs → deps-Cip5vUm1.mjs} +8 -5
  19. package/dist/{detached-entry-Bpo6ZY_I.mjs → detached-entry-KEu0_AXL.mjs} +1 -1
  20. package/dist/{device-BUoZyMoR.mjs → dev-client-HyqISM0h.mjs} +1178 -635
  21. package/dist/{device-RdujjHLB.mjs → device-D4U-xLty.mjs} +13 -20
  22. package/dist/{device-lease-Ffz_M5t0.mjs → device-lease-Crs-HkJY.mjs} +16 -9
  23. package/dist/{device-pool-BxRwdufO.mjs → device-pool-CnTAz8X1.mjs} +7 -7
  24. package/dist/{device-remote-ByN8P6CB.mjs → device-remote-AQ5rQPqr.mjs} +482 -35
  25. package/dist/{doctor-BMt156qe.mjs → doctor-B_Ei3bZu.mjs} +95 -107
  26. package/dist/{error-diagnostics-D1Kaf-eT.mjs → error-diagnostics-Vfz83GCF.mjs} +22 -16
  27. package/dist/exec-jIAlgilk.mjs +132 -0
  28. package/dist/{gc-v2YcoJvm.mjs → gc-Ckw8RQHi.mjs} +763 -126
  29. package/dist/{guide-BTAlD1_y.mjs → guide-BiAbhs1J.mjs} +891 -501
  30. package/dist/{guide-status-Craq9z0t.mjs → guide-status-BAMVU0ZA.mjs} +5 -3
  31. package/dist/{ios-BcCiI4TS.mjs → ios-BL2NFckr.mjs} +43 -20
  32. package/dist/{ios-BP04pY5f.mjs → ios-BzUJWk1K.mjs} +141 -175
  33. package/dist/{ios-device-CauFJiYx.mjs → ios-device-D972i9wf.mjs} +149 -52
  34. package/dist/{ios-device-CFXA46ez.mjs → ios-device-DPsSm0v_.mjs} +3 -2
  35. package/dist/launch-verify-Q_OtW1Rf.mjs +365 -0
  36. package/dist/{logs-CakdBTtm.mjs → logs-CI9NQSK7.mjs} +18 -13
  37. package/dist/{logs-query-BGL-Pl12.mjs → logs-query-Cqma3WIu.mjs} +36 -28
  38. package/dist/{metro-C7bcJ0uo.mjs → metro-DrLHaMn2.mjs} +78 -8
  39. package/dist/{named-ports-DzMOlmaX.mjs → named-ports-CmLQSIRj.mjs} +4 -4
  40. package/dist/{ndjson-BZwI1NBv.mjs → ndjson-9uFNRwfe.mjs} +36 -3
  41. package/dist/{ownership-Cp52QAK1.mjs → ownership-D15Op8vN.mjs} +3 -3
  42. package/dist/{ownership-wolE-0Do.mjs → ownership-DCQPuWEc.mjs} +26 -7
  43. package/dist/{ports-BIbJaKNW.mjs → ports-BNKoWVWZ.mjs} +3 -3
  44. package/dist/{process-output-Dl5uKE03.mjs → process-output-Fpl8PYi8.mjs} +1 -1
  45. package/dist/{project-DDZWf_16.mjs → project-DS112DYB.mjs} +8 -3
  46. package/dist/{reload-BdypPbjM.mjs → reload-ZNJUo1pl.mjs} +12 -13
  47. package/dist/{server-bare-BQkyxa_b.mjs → server-bare-DWkkcIxV.mjs} +2 -2
  48. package/dist/{server-expo-BVAA1OqJ.mjs → server-expo-B_lctBR3.mjs} +8 -7
  49. package/dist/server-expo-CeILEu86.mjs +2 -0
  50. package/dist/settings-BKNh5rl4.mjs +376 -0
  51. package/dist/{settings-BXXorVM2.mjs → settings-D030k0t4.mjs} +464 -152
  52. package/dist/settings.schema.json +989 -0
  53. package/dist/{teardown-BJqEzPo_.mjs → sim-pool-KaIsp2Ft.mjs} +14 -419
  54. package/dist/simslim-B_LsGLuJ.mjs +259 -0
  55. package/dist/{slot-launch-ZUUe0TQP.mjs → slot-launch-DU9A-gYw.mjs} +4 -4
  56. package/dist/spawn-claims-Dn3C_N6w.mjs +49 -0
  57. package/dist/{start-CmxtOKjU.mjs → start-DYkkKF0s.mjs} +27 -31
  58. package/dist/{state-DZobzxLW.mjs → state-NcJzMEBF.mjs} +5 -3
  59. package/dist/{stats-CLg5RuDS.mjs → stats-B63-JVAY.mjs} +4 -4
  60. package/dist/{stats-BYcZ6n1h.mjs → stats-DG9e66Rz.mjs} +66 -5
  61. package/dist/status-S6ehL4Ui.mjs +932 -0
  62. package/dist/{stop-C8JW6kKp.mjs → stop-BO28HGqF.mjs} +101 -25
  63. package/dist/{stop-B1kOpYei.mjs → stop-T1R-cZRz.mjs} +2 -2
  64. package/dist/supervisor-run.mjs +52 -34
  65. package/dist/{workspace-process-lock-BYfZz_S-.mjs → workspace-process-lock-DWaiRD0e.mjs} +14 -9
  66. package/dist/{workspace-state-BT5E3SA2.mjs → workspace-state-DF2gCFhx.mjs} +52 -29
  67. package/dist/worktree-DKhSF0UX.mjs +2 -0
  68. package/dist/{worktree-CFLA-6MX.mjs → worktree-LGB-UwgG.mjs} +603 -59
  69. package/dist/{worktree-FG_ZKKdb.mjs → worktree-R_cUlE7s.mjs} +62 -41
  70. package/dist/{xcode-B6YaWeg0.mjs → xcode-BZqyxh3e.mjs} +216 -58
  71. package/package.json +5 -6
  72. package/skill/SKILL.md +2 -0
  73. package/dist/app-install-BDbsSgCl.mjs +0 -1175
  74. package/dist/build-slots-C-oAHRT1.mjs +0 -151
  75. package/dist/dev-client-BmT-ioFI.mjs +0 -797
  76. package/dist/exec-B29XNuhP.mjs +0 -77
  77. package/dist/reclaim-KJ-0uWEF.mjs +0 -361
  78. package/dist/server-expo-YDDG3eP7.mjs +0 -2
  79. package/dist/status-DdkLki47.mjs +0 -426
  80. package/dist/{metro-store-CDDZHtPl.mjs → metro-store-DzeWkfqW.mjs} +1 -1
@@ -0,0 +1,132 @@
1
+ import { execSync } from "child_process";
2
+ import spawn from "cross-spawn";
3
+ import which from "which";
4
+ //#region src/exec.ts
5
+ const MAX_BUFFER = 67108864;
6
+ function nameTimeout(error, command, timeoutMs) {
7
+ if (error?.code === "ETIMEDOUT" && error instanceof Error) error.message = `Command timed out after ${timeoutMs}ms: ${command}`;
8
+ return error;
9
+ }
10
+ let active = {
11
+ run(cmd, { timeoutMs, killSignal, cwd } = {}) {
12
+ const opts = {
13
+ encoding: "utf-8",
14
+ stdio: [
15
+ "pipe",
16
+ "pipe",
17
+ "pipe"
18
+ ],
19
+ maxBuffer: MAX_BUFFER
20
+ };
21
+ if (timeoutMs) opts.timeout = timeoutMs;
22
+ if (killSignal) opts.killSignal = killSignal;
23
+ if (cwd) opts.cwd = cwd;
24
+ try {
25
+ return String(execSync(cmd, opts)).trim();
26
+ } catch (error) {
27
+ throw nameTimeout(error, cmd, timeoutMs);
28
+ }
29
+ },
30
+ runFile(file, args = [], { timeoutMs, killSignal, cwd, env, omitEnv } = {}) {
31
+ const opts = {
32
+ encoding: "utf-8",
33
+ stdio: [
34
+ "pipe",
35
+ "pipe",
36
+ "pipe"
37
+ ],
38
+ maxBuffer: MAX_BUFFER
39
+ };
40
+ if (timeoutMs) opts.timeout = timeoutMs;
41
+ if (killSignal) opts.killSignal = killSignal;
42
+ if (cwd) opts.cwd = cwd;
43
+ if (env || omitEnv?.length) {
44
+ const childEnv = {
45
+ ...process.env,
46
+ ...env
47
+ };
48
+ for (const key of omitEnv ?? []) delete childEnv[key];
49
+ opts.env = childEnv;
50
+ }
51
+ const result = spawn.sync(file, args, opts);
52
+ if (result.error) throw nameTimeout(Object.assign(result.error, result), [file, ...args].join(" "), timeoutMs);
53
+ if (result.status !== 0) {
54
+ const stderr = String(result.stderr ?? "");
55
+ const message = `Command failed: ${[file, ...args].join(" ")}${stderr ? `\n${stderr}` : ""}`;
56
+ throw Object.assign(new Error(message), result);
57
+ }
58
+ return String(result.stdout).trim();
59
+ },
60
+ runFileAsync(file, args = [], { timeoutMs, killSignal, cwd, env, omitEnv } = {}) {
61
+ const command = [file, ...args].join(" ");
62
+ return new Promise((resolve, reject) => {
63
+ const opts = { stdio: [
64
+ "ignore",
65
+ "pipe",
66
+ "pipe"
67
+ ] };
68
+ if (cwd) opts.cwd = cwd;
69
+ if (env || omitEnv?.length) {
70
+ const childEnv = {
71
+ ...process.env,
72
+ ...env
73
+ };
74
+ for (const key of omitEnv ?? []) delete childEnv[key];
75
+ opts.env = childEnv;
76
+ }
77
+ const child = spawn(file, args, opts);
78
+ const stdout = [];
79
+ const stderr = [];
80
+ let timedOut = false;
81
+ const timer = timeoutMs ? setTimeout(() => {
82
+ timedOut = true;
83
+ child.kill(killSignal ?? "SIGTERM");
84
+ }, timeoutMs) : void 0;
85
+ child.stdout?.on("data", (chunk) => stdout.push(chunk));
86
+ child.stderr?.on("data", (chunk) => stderr.push(chunk));
87
+ child.on("error", (error) => {
88
+ clearTimeout(timer);
89
+ reject(error);
90
+ });
91
+ child.on("close", (status, signal) => {
92
+ clearTimeout(timer);
93
+ const out = Buffer.concat(stdout).toString("utf-8");
94
+ const err = Buffer.concat(stderr).toString("utf-8");
95
+ const result = {
96
+ status,
97
+ signal,
98
+ stdout: out,
99
+ stderr: err
100
+ };
101
+ if (timedOut) reject(nameTimeout(Object.assign(new Error(command), result, { code: "ETIMEDOUT" }), command, timeoutMs));
102
+ else if (status !== 0) reject(Object.assign(/* @__PURE__ */ new Error(`Command failed: ${command}${err ? `\n${err}` : ""}`), result));
103
+ else resolve(out.trim());
104
+ });
105
+ });
106
+ },
107
+ runQuiet(cmd, opts) {
108
+ try {
109
+ return this.run(cmd, opts);
110
+ } catch {
111
+ return null;
112
+ }
113
+ },
114
+ runFileQuiet(file, args, opts) {
115
+ try {
116
+ return this.runFile(file, args, opts);
117
+ } catch {
118
+ return null;
119
+ }
120
+ },
121
+ spawn(cmd, args = [], opts = {}) {
122
+ return spawn(cmd, args, opts);
123
+ },
124
+ findExecutable(name) {
125
+ return which.sync(name, { nothrow: true });
126
+ }
127
+ };
128
+ function getExecutor() {
129
+ return active;
130
+ }
131
+ //#endregion
132
+ export { getExecutor as t };