Skip to content

v1.40.0

Latest

Choose a tag to compare

@janicduplessis janicduplessis released this 03 Nov 22:07
· 382 commits to main since this release
c5facd5

This release covers the thirteen npm packages (@stim-cli/core, @stim-cli/cache, @stim-cli/cache-s3, @stim-cli/agent-driver, @stim-cli/agent-driver-agent-device, @stim-cli/metro, @stim-cli/expo-build-cache, stim, @stim-cli/ci, @stim-cli/transport, @stim-cli/transport-tailscale, @stim-cli/transport-local and @stim-cli/server). No package publishes for the first time in this release. The release was frozen at 968e31ced (#4974). #4979 landed between the freeze and the version commit and has an entry below. Every commit since v1.39.0 has an entry below. Stim Desktop 0.3.0 ships with this version at the same commit; it carries the Desktop changes listed under 1.38.0 and 1.39.0 as well as those below, because no Desktop release shipped with either. No Stim Host release ships with this version; packages/server/host is unchanged since host-v0.1.1. The phone app ships through its own workflow.

New

  • The stim-daemon runs by default and stops idle workspaces on one clock. One stim-daemon per Stim home, started by start, ios, android, web, macos and revive, ticks every minute while anything runs and every five minutes otherwise. A workspace with no activity for idle.minutes (default 15, 0 never) has its Metro stopped (the port stays reserved), its owned simulators and emulators shut down and its regenerable build outputs deleted: DerivedData, Gradle outputs, git-ignored in-tree build directories and the Metro store. stim revive brings it back from the build cache. Activity is a Stim command, a Metro bundle or HMR request, an agent-device action, input forwarded by stim-server, stim device lock, or, on macOS, keyboard or mouse input in the Simulator, Device Hub or emulator window. Device and app logs no longer count. A workspace with a build, a live agent-device session or lease, or a live web share is never staged (Fixes #4845). New setting daemon.mode (on, report, off; env STIM_DAEMON); the daemon is off in CI and on Windows, where supervisors and command-time passes time the idle stop. stim status and stim doctor show the daemon. Fixes #4809 and #4823. (stim, @stim-cli/core, @stim-cli/server) 751e1f049 8004a36bf a6769283a
  • A pressure ladder frees disk and memory, and admission queues boots and builds. The daemon classifies the machine normal, high or critical each tick and, above normal, frees space from the longest-idle workspace first: idle stage, parked devices, shared caches, the dormant stage, node_modules and Pods of idle linked worktrees (critical only), then idle Gradle daemons, unpinned Gradle versions, temp leftovers and the worktree trash. A workspace idle for idle.dormantDays (default 3) goes dormant and its owned devices are deleted. Every boot and native build waits in a first-in-first-out queue under caps derived from cores and memory, and a waiting run prints its position. stim status shows the level, its reasons, the ladder's actions and waiting runs. disk.criticalFreeGb (default 6) replaces maintenance.criticalFreeDiskGb. Fixes #4816. (stim, @stim-cli/core) 1b795d107
  • stim gc previews and runs the ladder. stim gc shows each rung's sizes at the high and critical levels and each workspace's stage; stim gc --delete runs the ladder at high whatever the machine measures, and --cache all at critical. stim status, stim doctor, Stim Desktop (Machine page and Maintenance settings) and the guides show the daemon. Fixes #4837. (stim, @stim-cli/core, @stim-cli/server; Desktop ships with 0.3.0) 4ea04d782
  • Cleanup measures what a copy-on-write node_modules or Pods tree really holds. A new helper reads APFS private sizes, so status --json carries disk.nodeModulesPrivateBytes, gc --json carries buildState.dirs[].privateBytes, plain gc prints 1.6G (5M its own), and the ladder's critical rung deletes trees holding at least 256 MiB of their own bytes first and trees of unknown size after, and the dormant stage deletes only measured trees of at least 256 MiB. Clones below that stay. Fixes #4883. 4025a2134
  • stim gc reports other Stim homes and more disk. A home other than ~/.stim lists itself once in a machine-level list, so the real home's gc reports scratch homes and their owned simulators. gc also reports Gradle transforms of versions no registered project pins and Xcode DerivedData whose workspace is gone, and the idle stage and gc clear .dd, android/**/.cxx and other in-tree xcodebuild output. Deleting an owned simulator removes its leftover launchd folder. Fixes #4901, #4898, #4897 and #4925. a94aa9f9a a64904eed 927211cff 0b902f358
  • stim agent-device <args> drives the workspace's device through Stim. It runs the shared agent-device on the workspace's owned simulator, owned emulator, leased phone or hosted session with the right selectors and session name, revives an idle-stopped workspace first, refuses boot, shutdown and close --shutdown (Stim owns the lifecycle) and any selector that is not the workspace's, and reports each agent action to stim-server so viewers see it. New command, an explicit product decision of 2026-11-03. stim guide agent routes device interaction through it. Fixes #4875. (stim, @stim-cli/core, @stim-cli/server) 9aefb3e45
  • Web shares carry live presence and a second, view-only password. stim share --control takes --view-password [value], a second password that watches without controlling (--json adds viewAuth and viewPassword); equal passwords and --no-password with it refuse with STIM_BAD_ARG. Viewers see each other's touches, the host's and the agent's gestures with the target element's outline, and may choose a name (default Guest N). One finger holds a device's pointer until its up, so two viewers cannot interleave a gesture. A view session can enter the control password to upgrade. Host, Agent and Guest N are reserved names. Fixes #4873 and #4941. (stim, @stim-cli/server, @stim-cli/core; Desktop's share sheet offers the view password) a98b165f7 0c892ef7e
  • Share viewers stream H.264. A browser that supports WebCodecs H.264 gets the device at up to 60 fps with keyframe-on-join and congestion backoff; other browsers and a link ending in #jpeg keep JPEG at 10 fps. Hosted shares negotiate H.264 with the host. A hosted iOS share paced by a LaunchAgent host now sends 60 fps instead of about 23. Fixes #4826 and #4920. (@stim-cli/server) 7d0056cb3 8cb88d087
  • Share viewers and Stim clients can set and read the device clipboard, send two fingers and send arrow keys. New control-session methods input.clipboard.set (at most 8192 UTF-8 bytes, optional paste) and input.clipboard.get work on iOS simulators, Android emulators and leased Android phones, locally and hosted; a web page, a native macOS app and a physical iPhone refuse them. input.touch takes a second finger (x2, y2) for pinch and two-finger pan on iOS simulators and Android devices, and input.key takes left, right, up, down and escape on iOS and Android. The web viewer pastes and copies text, and Stim Desktop and the phone app paste and copy for devices they reach through stim-server. Clipboard text is never logged. Fixes #4922, #4923, #4924 and #4848; refs #4828. (@stim-cli/server, @stim-cli/core; Desktop ships with 0.3.0, the phone app through its own workflow) 74a9a2b98 c3b40f384 5e369a0e2 3cce873bb 98d0c61bf
  • Shares of hosted devices show the agent's actions and the other viewers. A new device-host.presence.subscribe carries a hosted session's agent-device actions to its share viewers. Refs #4876. Fixes #4953. (stim, @stim-cli/server) a1d6c4497
  • The share viewer matches Stim Desktop's device viewer. The page uses Desktop's top bar, canvas, button bar and colors (from apps/mobile/src/design/tokens.ts), credits "Shared with Stim by App & Flow", never scrolls, shows the roster as a stacked avatar button that opens a People list where a viewer can rename themselves, and draws the rotate icons as a device with a curved arrow. The login page labels its password and optional name fields (#4979, 8ddfd6c77). The password field is a masked text field instead of type=password, which is meant to stop browsers offering to save it (not verified in Chrome, Safari or Firefox; Firefox shows the typed characters). Fixes #4849, #4881, #4857, #4964, #4952, #4972 and #4854. (@stim-cli/server) 1a8536821 de033ac03 c15b2643a 76cb4df70 d98148ac6 968e31ced 8b7cd83e7
  • Rotating a share turns a portrait-only app's picture too, and the viewer no longer offers rotate on a hosted Android share, which the host refuses. Fixes #4862. (@stim-cli/server) 690860ea2
  • A reverse-proxy share link shows a not-found page instead of the proxy's empty 502 when the share ended or the link is wrong. The installed stim-server service keeps its loopback share listener bound under proxy exposure with share.publicUrl set, and answers a fixed 404 page for any request that is not a live share's; dist/share-viewer/not-running.html is a 503 page for the proxy to serve when Stim is down, with Caddy and nginx recipes in stim guide share (not validated against a real proxy). Fixes #4957. (@stim-cli/server) 6e0ee4669
  • Stim Desktop can stop one web share. share.stop takes an optional id, advertised by the share-stop-id hello feature; stim share stop still ends every share of the workspace. Fixes #4847. (@stim-cli/server, @stim-cli/core; Desktop ships with 0.3.0) f643f0df8
  • iosSimulatorApp and --simulator-app accept none, which creates, boots and owns the simulator and opens no app. 6e4f99826
  • stim ios slims a shut-down owned simulator as its first boot with SimSlim 0.10.0 or newer, instead of booting it stock and letting SimSlim shut it down and boot it again. Booting a new simulator measured 36.8 s against 56.0 s (median of six runs on a loaded machine). Fixes #4869. 5957079eb
  • stim doctor --fix brings a source checkout to a state worktrees can clone. It reinstalls stale dependencies, repairs broken Pods links and Pod version conflicts (pod install --clean-install, then pod update of only the named pods, never a tracked lockfile), and runs a missing prebuild, each step announced with its cost and confirmed in a terminal; without a terminal it prints the manual commands. A new source-prebuild-record-ios|android finding reports a gitignored ios/ or android/ with no finished prebuild record. Doctor also notes a source checkout whose React Native prebuilt flavor differs from the build, and worktree warm says that a left-out ios carry means Pods are installed privately and that npm ci replaces the carried node_modules clone. Fixes #4914, #4885, #4899 and #4900. 85b604523 91de105ac c145dfa31 2c9efe31a
  • stim share refuses at once on Windows with STIM_SHARE_REFUSED instead of waiting 60 s for a server it cannot reach. Fixes #4935. 109089007
  • Every merge to main publishes to the npm next dist-tag, at most every five minutes, as X.(Y+1).0-next.<UTC commit time>.g<short sha> for all thirteen packages (npm install --global stim@next), and a merge that changes apps/desktop publishes a notarized Stim Desktop prerelease on a Sparkle next channel. Desktop's Settings > App > Updates > Get prerelease updates is off by default and on for a prerelease build. The Release workflow's next-smoke check no longer waits on npm's propagation delay. Fixes #4861, #4940 and #4902. (repository workflows; Desktop ships with 0.3.0) d5fe899d1 5ed4b6fe9 2ac16c2fc

Removed (breaking)

  • The settings the resource model replaced are retired. stim settings set refuses each one and names its replacement, a config that still holds one keeps loading, and doctor and stim settings flag the leftover. The table is under Migration notes. The environment variable of each retired setting is no longer read (STIM_MAINTENANCE, STIM_MAINTENANCE_DEVICE_IDLE_DAYS, STIM_BUDGET_MIN_FREE_DISK_GB, STIM_BUDGET_HARD_FLOOR_DISK_GB, STIM_MAINTENANCE_CRITICAL_FREE_DISK_GB and the variables of the settings in the table's last row, such as STIM_MAINTENANCE_PRESSURE_CHECK_MINUTES and STIM_BUDGET_MAX_LIVE_WORKSPACES), and a governed command refuses while any of them is set. (stim, @stim-cli/core) 4ea04d782
  • Stim Desktop's autopilot timer and thresholds are removed from the Automatic Maintenance section of the App preferences; the daemon's level and last actions replace them. (Desktop ships with 0.3.0) 4ea04d782
  • stim gc --idle is gone, and in stim gc --json the idleDevices and worktreeDependencies sections are replaced by ladder. stim-server's gc method no longer takes idleMs. (stim, @stim-cli/server, @stim-cli/core) 4ea04d782
  • Maintenance no longer runs from every command. The detached maintenance child spawned by command hooks, supervisors and status --watch (STIM_MAINTENANCE_CHILD) is removed; the daemon runs the pass, and doctor, start, ios and android run it in their own process while no daemon holds the home. 751e1f049

Fixes

  • A stim-server whose Stim home is unreadable degrades instead of revoking every client. An unmounted external volume used to close every session with unauthorized, retire hosted sessions and make clients report the worker as revoked. The server now answers 503, refuses handshakes with the new home-unavailable code, keeps the sessions it has, and serves again when the home answers; a registry file that does not parse keeps it degraded until fixed. Fixes #4856. (@stim-cli/server, @stim-cli/core, stim) d11ed5f64
  • stim-server no longer exits when a child fails to spawn while it holds a device input claim. terminate signalled process group 0 for a child with no pid (for example after xcode-select pointed at a deleted Xcode), which dropped every client with exit 143. Fixes #4963. (@stim-cli/server) dbcb6d46b
  • Failed stim agent-device commands on a hosted session no longer end in Remote Diagnostics: unavailable ... HTTP 404, and a gone agent session is named. Fixes #4954. (stim, @stim-cli/server) 3e39a7441
  • More than five runs reserving a Metro port at once no longer refuse with STIM_BAD_ARG. A port lost to another claim leaves the candidates, so the loop ends within the 200-port range. Fixes #4842. 6c3c44fdb
  • Owned simulators and emulators are created inside the boot slot, so a burst of new workspaces no longer creates every device at once. Fixes #4877. 5bc8d3f6a
  • Queued boot admissions share one device listing, so a 16-workspace burst no longer repeats simctl list in every waiter. Refs #4865. 4982ea8e9
  • An iOS run builds its app while its new simulator waits to boot. Fixes #4917. 192f75140
  • The daemon's event loop no longer blocks for 5 to 8 s under memory pressure. The maintenance pass used a synchronous top -l 1; each tick phase is now timed in daemon_tick. Refs #4944. 2f0325e4b
  • Adopting a parked iOS simulator gives its privacy and keychain resets three minutes instead of the general 60 s simctl deadline, which privacy reset all could cross. Fixes #4819. eb5cf2761
  • The dormant stage reports the data size of the devices it deletes instead of 0K freed. Fixes #4864. 679fe3941
  • Owned devices with no dev server are timed from command-time passes on Windows. Fixes #4823. a6769283a
  • Internal only: the end-to-end harness for the resource model under scripts/resource-model-e2e/ and its follow-ups (bf2ccce42, f1f4e0854, b4832170c, eb6e76c16). No shipped behavior changes.
  • Test only: 13f7d0fd7, afb8484ae, b2a43daee, 08daea1fb, 3b20b47bc, 242949d01. These skip daemon-only and share-server cases on Windows, run the resource-model tests there, take the Stim home away in the pairing tests without renaming a watched directory, and wait for the control helper before revoking its device. No shipped behavior changes.

Docs

  • Design specs: the resource model (968e31ced) and multiplayer device presence 4688734a6. Refs #4871.
  • The guides (agent, lifecycle, settings, cleanup, facts, share, errors) and the website pages for settings, idle stop, disk pressure, gc, queue reclaim, stim share and stim agent-device describe the changes above.

Migration notes

  • Run the removal steps before the first governed command. start, ios, android, web, macos, revive and gc refuse with STIM_BAD_ARG while the environment sets a removed variable that used to change behavior, and while a config layer they read still holds a value that turned something off: maintenance.mode off or report, or metro.idleStopMinutes or devices.idleShutdownMinutes 0. Each refusal prints the commands to run, in order, for example stim settings set daemon.mode off, then stim settings unset maintenance.mode; stim doctor rates the same leftovers, and also maintenance.idleStopHours 0 until idle.dormantDays is set (that key is still read for hosted sessions, so it never refuses).

    Removed Replacement
    metro.idleStopMinutes, devices.idleShutdownMinutes idle.minutes
    devices.reclaimIdleMinutes the daemon's reclaim rule for a waiting boot
    maintenance.deviceIdleDays (STIM_MAINTENANCE_DEVICE_IDLE_DAYS) idle.dormantDays
    budget.minFreeDiskGb (STIM_BUDGET_MIN_FREE_DISK_GB) disk.minFreeGb (STIM_DISK_MIN_FREE_GB)
    budget.hardFloorDiskGb (STIM_BUDGET_HARD_FLOOR_DISK_GB) disk.hardFloorGb (STIM_DISK_HARD_FLOOR_GB)
    maintenance.criticalFreeDiskGb (STIM_MAINTENANCE_CRITICAL_FREE_DISK_GB) disk.criticalFreeGb
    maintenance.mode (STIM_MAINTENANCE) daemon.mode (STIM_DAEMON); report and off also govern the passes start, ios, android and gc run themselves
    budget.maxCommittedMemoryGb, budget.maxLiveWorkspaces, maintenance.pressureCheckMinutes, maintenance.sizeCheckMinutes, maintenance.maxLoadPerCore, maintenance.memoryPressureLevel, maintenance.memoryWarningMinutes, maintenance.minAvailableMemoryGb, maintenance.capTargetPercent, maintenance.idleCheckMinutes, maintenance.urgentFreeDiskGb, maintenance.pressureProtectMinutes none; the ladder's rules are fixed
  • Workspaces idle-stop and clear build outputs after 15 minutes without activity. The daemon deletes DerivedData, Gradle outputs, git-ignored in-tree build directories and the Metro store of an idle workspace (4.3 GB in the test run), and stim revive rebuilds from the cache. A workspace idle for three days (idle.dormantDays) has its owned devices deleted; the next stim ios or stim android recreates them. Set idle.minutes or idle.dormantDays to 0 to opt out, or daemon.mode off.

  • concurrency.maxBuilds and concurrency.maxDevices at 0 now mean derived, not unlimited. Builds run max(1, floor(cores/6)) at a time, boots two at a time, and booted devices max(2, floor((RAM - 4 GB)/1.5 GB)). A stim-server worker shares its build cap between its own and offloaded builds, so a worker with fewer than 12 cores (a 10-core Mac mini) runs one build at a time; set concurrency.maxBuilds on the worker to raise it. A run waits while every holder ahead of it is alive instead of refusing after a fixed 10 minutes, and refuses with STIM_AT_CAPACITY after 90 minutes in all, sooner when a holder cannot be verified; --wait <seconds> and --no-wait bound it.

  • A home with STIM_HOME set owns a device only when its ledger lists it. The pre-ledger config fallback applies only while STIM_HOME is unset, so a scoped home, hosted-session homes and STIM_HOME=~/.stim no longer shut down or delete a device they did not create.

  • start, ios and android refuse STIM_LOW_DISK only while free disk is still under disk.hardFloorGb after the ladder ran. Memory never refuses. A scoped STIM_HOME now runs the model with the same defaults (daemon on, disk floors applied).

  • STIM_BUILD_COMPAT stays 5, so 1.39.0 and 1.40.0 machines can offload builds to each other.

  • stim-server protocol changes are additive behind hello features (presence, device-clipboard, share-view-password, share-stop-id, hosted-presence) and one new refusal code, home-unavailable, which the phone app and Stim Desktop already retry. Update the phone app and Stim Desktop with the server to use the clipboard, view-only password and per-share stop; older clients keep working without them.

  • The npm next dist-tag moves with every merge to main. latest is unchanged by it. After 1.40.0 publishes, next carries 1.41.0-next.*.

Human review

These changes merged with review: needs-human; each PR carries a Human review: comment naming the lines no maintainer has approved yet: #4909 (second share password and per-session access), #4943 (login eviction and view-login rate limit), #4928 (a control session reads the device clipboard), #4949 (Desktop sends Mac clipboard text to the machine running a device), #4967 (a kept loopback listener under proxy exposure), #4867 (the npm next publish job in the release environment), #4942 (the Desktop next workflow, which holds signing secrets), #4890 (private-size measurement and dependency deletion) and #4907 (idle-stage deletion of .dd and .cxx).

QA

Skipping the pre-tag QA gate is the maintainer's standing default from 2026-10-26, and the maintainer asked for this release on 2026-11-03 without QA. This deviates from RELEASE.md section 3, which has no waiver for a stable version; the expedited RC lane is for prereleases only and was not used. The waiver covers only section 3. No section 3 QA round ran on any commit since v1.39.0.

Omitted before the tag, for this candidate: the rows that node scripts/release-qa-matrix.mjs v1.39.0 requires, the native suites test/e2e/native/run-native-e2e.mjs and test/e2e/native/run-cache-e2e.mjs, and test:compat. Per-change evidence is in the pull requests.

Run before the version commit, on the candidate (the freeze plus the version bump): pnpm install --frozen-lockfile, release:prep --check, build, CLI --version (1.40.0), --help and guide agent, the licenses regeneration that release:prep performs, and pnpm tarball inspection of the thirteen packages. The format, lint, typecheck, knip, RPC and unit checks run in the version pull request and its merge-queue run, per RELEASE.md section 2 step 2. Run after the version commit lands: the release gate of RELEASE.md section 4 step 4 on the exact release commit, and the Release workflow's own gates. The full Windows unit suite runs in Post-release validation, recorded, not gated.