@stim-cli/server 1.24.0 → 1.25.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 CHANGED
@@ -49,8 +49,8 @@ and [device-host clients](#device-host-approval). The plain listing shows
49
49
  [Actions](#actions).
50
50
 
51
51
  `GET http://127.0.0.1:7787/health` answers requests from this machine with the
52
- server's name, versions, `stimBuild` (the digest of the bundled Stim's build,
53
- which offload compares between machines), protocol, `stimHome`, `startup`, `busy`
52
+ server's name, versions, `stimBuild` (the digest of the bundled Stim's build),
53
+ protocol, `stimHome`, `startup`, `busy`
54
54
  (the offloaded `builds` and `hostedSessions` running now) and the current
55
55
  Tailscale state. It answers HTTP 200 once `startup.state` is `ready`; while the
56
56
  state is `pending` or `degraded` (see the LaunchAgent notes below) it answers
@@ -1615,6 +1615,8 @@ connected since stim-server started keeps its directory when revoked.
1615
1615
  same Ruby selection and UTF-8 locale defaults as `pod install`; omitting
1616
1616
  `rubyVersion` uses the worker's default Ruby. It
1617
1617
  returns `toolchain` (`stimBuild`, a digest of the bundled Stim's built code;
1618
+ `compat`, the bundled Stim's build compatibility version, which a client
1619
+ compares instead of `stimBuild` when it is present;
1618
1620
  `os`, the OS stim-server runs on as Node names it (`darwin`, `linux`, `win32`);
1619
1621
  `arch`; `xcode`; `simulatorSdk`; `macosSdk` (from
1620
1622
  `xcrun --sdk macosx --show-sdk-version`); `cocoapods`; `runtimes`, the simulator
@@ -1652,8 +1654,10 @@ connected since stim-server started keeps its directory when revoked.
1652
1654
  architecture and target options. These are exact lookups, not a full inventory.
1653
1655
  With `react-native-peer-cache`, a React Native/Expo development offer can send
1654
1656
  `reactNativeArtifact: { project, fingerprint, isExpo, platform, toolchain, ios | android }`.
1655
- The query includes the caller's compatible toolchain and normalized native
1656
- build choices; the worker constructs its own receipt around compilation.
1657
+ The query includes the caller's compatible toolchain, whose `toolchain.compat`
1658
+ takes the place of `stimBuild` with `build-compat`, and normalized native
1659
+ build choices; a caller sends React Native and SwiftPM queries only to a
1660
+ server with `build-compat`; the worker constructs its own receipt around compilation.
1657
1661
  The returned identity is opaque, not an alias for the caller's local cache key.
1658
1662
  The completed receipt binds the worker-verified post-mutation fingerprint
1659
1663
  and native options to the toolchain checked before and after compilation.
@@ -1661,7 +1665,7 @@ connected since stim-server started keeps its directory when revoked.
1661
1665
  does not discard a matching archive. Older workers receive no new query
1662
1666
  parameters and continue through their normal build path.
1663
1667
  With `swiftpm-peer-cache`, `swiftpmArtifact` carries `project`, `sourceDigest`,
1664
- `stimBuild`, complete `inputs` (`ignored`, `outputs`, `localFiles`,
1668
+ `stimBuild` or, with `build-compat`, `compat` in its place, complete `inputs` (`ignored`, `outputs`, `localFiles`,
1665
1669
  `environment`) and `build` (`product`, `infoPlist`, `resources`, `assetCatalog`).
1666
1670
  Resource and catalog paths are repository-relative; the plist is
1667
1671
  project-relative. The worker verifies actual transferred files and full
@@ -1711,7 +1715,7 @@ connected since stim-server started keeps its directory when revoked.
1711
1715
  simulator runtime identifier, required for `ios`, null for `android`),
1712
1716
  `fingerprint`, `packageName`, `isExpo`, `optimizations`, `android` (for
1713
1717
  `android`: `variant`, `abi`, `gradleBuildCache`, `pch` and `compilerCache`,
1714
- `ccache` or `none`) and `stimBuild`, after the whole manifest of `repo` was
1718
+ `ccache` or `none`), `stimBuild` and, from a caller that saw `build-compat`, `compat`, after the whole manifest of `repo` was
1715
1719
  synced on this connection. A peer-cache-capable React Native caller can set
1716
1720
  `cacheArtifact: true` to retain a completed development archive when its cache
1717
1721
  write and remote policies allow it. With the `fingerprint-sources` feature, a
@@ -1728,7 +1732,8 @@ connected since stim-server started keeps its directory when revoked.
1728
1732
  `build-busy` while the offer would be declined, naming the reason, or while
1729
1733
  another build of the same client and repository runs, or while every one
1730
1734
  of this machine's `concurrency.maxBuilds` slots is held, and with
1731
- `build-refused` when `stimBuild` differs. The build runs `offload-worker.mjs` of the bundled Stim with
1735
+ `build-refused` when `compat` differs from this machine's, or, when either
1736
+ side has no `compat`, when `stimBuild` differs. The build runs `offload-worker.mjs` of the bundled Stim with
1732
1737
  `STIM_HOME` set to the repository's area. It makes the area's checkout
1733
1738
  hold exactly the manifest (a file git lists as untracked and not ignored,
1734
1739
  and not in the manifest, is deleted; ignored dependencies and generated
@@ -290,15 +290,21 @@ const swiftpmArtifactInputs = {
290
290
  }
291
291
  }
292
292
  };
293
+ const buildCompat = {
294
+ type: "integer",
295
+ minimum: 1,
296
+ description: "The Stim build compatibility version, sent to a stim-server with the build-compat feature."
297
+ };
298
+ const stimIdentity = [{ required: ["stimBuild"] }, { required: ["compat"] }];
293
299
  const swiftpmArtifactQuery = {
294
300
  type: "object",
295
301
  required: [
296
302
  "project",
297
303
  "sourceDigest",
298
- "stimBuild",
299
304
  "inputs",
300
305
  "build"
301
306
  ],
307
+ oneOf: stimIdentity,
302
308
  additionalProperties: false,
303
309
  properties: {
304
310
  project: { type: "string" },
@@ -308,6 +314,7 @@ const swiftpmArtifactQuery = {
308
314
  minLength: 1,
309
315
  maxLength: 256
310
316
  },
317
+ compat: buildCompat,
311
318
  inputs: swiftpmArtifactInputs,
312
319
  build: {
313
320
  type: "object",
@@ -379,13 +386,14 @@ const reactNativeArtifactQuery = {
379
386
  platform: { enum: ["ios", "android"] },
380
387
  toolchain: {
381
388
  type: "object",
382
- required: ["stimBuild"],
389
+ oneOf: stimIdentity,
383
390
  additionalProperties: false,
384
391
  properties: {
385
392
  stimBuild: {
386
393
  type: "string",
387
394
  minLength: 1
388
395
  },
396
+ compat: buildCompat,
389
397
  arch: {
390
398
  type: "string",
391
399
  minLength: 1
@@ -3304,6 +3312,10 @@ function protocolJsonSchema() {
3304
3312
  stimBuild: {
3305
3313
  type: "string",
3306
3314
  minLength: 1
3315
+ },
3316
+ compat: {
3317
+ ...buildCompat,
3318
+ description: "Compared instead of stimBuild by a machine whose build.offer toolchain reports compat."
3307
3319
  }
3308
3320
  }
3309
3321
  }),
package/dist/protocol.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { t as protocolJsonSchema } from "./protocol-B8Ztv1K4.mjs";
1
+ import { t as protocolJsonSchema } from "./protocol-VEZO2CyR.mjs";
2
2
  export * from "@stim-cli/core/protocol";
3
3
  export { protocolJsonSchema };
@@ -1280,6 +1280,7 @@
1280
1280
  "hosted-android-process",
1281
1281
  "hosted-metro-ports",
1282
1282
  "server-update",
1283
+ "build-compat",
1283
1284
  "status-views",
1284
1285
  "desktop-reports",
1285
1286
  "desktop-report-platform",
@@ -6885,8 +6886,17 @@
6885
6886
  },
6886
6887
  "toolchain": {
6887
6888
  "type": "object",
6888
- "required": [
6889
- "stimBuild"
6889
+ "oneOf": [
6890
+ {
6891
+ "required": [
6892
+ "stimBuild"
6893
+ ]
6894
+ },
6895
+ {
6896
+ "required": [
6897
+ "compat"
6898
+ ]
6899
+ }
6890
6900
  ],
6891
6901
  "additionalProperties": false,
6892
6902
  "properties": {
@@ -6894,6 +6904,11 @@
6894
6904
  "type": "string",
6895
6905
  "minLength": 1
6896
6906
  },
6907
+ "compat": {
6908
+ "type": "integer",
6909
+ "minimum": 1,
6910
+ "description": "The Stim build compatibility version, sent to a stim-server with the build-compat feature."
6911
+ },
6897
6912
  "arch": {
6898
6913
  "type": "string",
6899
6914
  "minLength": 1
@@ -7030,10 +7045,21 @@
7030
7045
  "required": [
7031
7046
  "project",
7032
7047
  "sourceDigest",
7033
- "stimBuild",
7034
7048
  "inputs",
7035
7049
  "build"
7036
7050
  ],
7051
+ "oneOf": [
7052
+ {
7053
+ "required": [
7054
+ "stimBuild"
7055
+ ]
7056
+ },
7057
+ {
7058
+ "required": [
7059
+ "compat"
7060
+ ]
7061
+ }
7062
+ ],
7037
7063
  "additionalProperties": false,
7038
7064
  "properties": {
7039
7065
  "project": {
@@ -7048,6 +7074,11 @@
7048
7074
  "minLength": 1,
7049
7075
  "maxLength": 256
7050
7076
  },
7077
+ "compat": {
7078
+ "type": "integer",
7079
+ "minimum": 1,
7080
+ "description": "The Stim build compatibility version, sent to a stim-server with the build-compat feature."
7081
+ },
7051
7082
  "inputs": {
7052
7083
  "type": "object",
7053
7084
  "required": [
@@ -7652,6 +7683,11 @@
7652
7683
  "stimBuild": {
7653
7684
  "type": "string",
7654
7685
  "minLength": 1
7686
+ },
7687
+ "compat": {
7688
+ "type": "integer",
7689
+ "minimum": 1,
7690
+ "description": "Compared instead of stimBuild by a machine whose build.offer toolchain reports compat."
7655
7691
  }
7656
7692
  }
7657
7693
  }
@@ -7934,8 +7970,17 @@
7934
7970
  },
7935
7971
  "toolchain": {
7936
7972
  "type": "object",
7937
- "required": [
7938
- "stimBuild"
7973
+ "oneOf": [
7974
+ {
7975
+ "required": [
7976
+ "stimBuild"
7977
+ ]
7978
+ },
7979
+ {
7980
+ "required": [
7981
+ "compat"
7982
+ ]
7983
+ }
7939
7984
  ],
7940
7985
  "additionalProperties": false,
7941
7986
  "properties": {
@@ -7943,6 +7988,11 @@
7943
7988
  "type": "string",
7944
7989
  "minLength": 1
7945
7990
  },
7991
+ "compat": {
7992
+ "type": "integer",
7993
+ "minimum": 1,
7994
+ "description": "The Stim build compatibility version, sent to a stim-server with the build-compat feature."
7995
+ },
7946
7996
  "arch": {
7947
7997
  "type": "string",
7948
7998
  "minLength": 1
@@ -8079,10 +8129,21 @@
8079
8129
  "required": [
8080
8130
  "project",
8081
8131
  "sourceDigest",
8082
- "stimBuild",
8083
8132
  "inputs",
8084
8133
  "build"
8085
8134
  ],
8135
+ "oneOf": [
8136
+ {
8137
+ "required": [
8138
+ "stimBuild"
8139
+ ]
8140
+ },
8141
+ {
8142
+ "required": [
8143
+ "compat"
8144
+ ]
8145
+ }
8146
+ ],
8086
8147
  "additionalProperties": false,
8087
8148
  "properties": {
8088
8149
  "project": {
@@ -8097,6 +8158,11 @@
8097
8158
  "minLength": 1,
8098
8159
  "maxLength": 256
8099
8160
  },
8161
+ "compat": {
8162
+ "type": "integer",
8163
+ "minimum": 1,
8164
+ "description": "The Stim build compatibility version, sent to a stim-server with the build-compat feature."
8165
+ },
8100
8166
  "inputs": {
8101
8167
  "type": "object",
8102
8168
  "required": [
@@ -1,4 +1,4 @@
1
- import { n as protocol_exports } from "./protocol-B8Ztv1K4.mjs";
1
+ import { n as protocol_exports } from "./protocol-VEZO2CyR.mjs";
2
2
  import { createRequire } from "node:module";
3
3
  import { execFile, execFileSync, spawn } from "node:child_process";
4
4
  import { appendFileSync, chmodSync, closeSync, constants, copyFileSync, cpSync, createReadStream, existsSync, futimesSync, lstatSync, mkdirSync, mkdtempSync, openSync, readFileSync, readSync, readdirSync, readlinkSync, realpathSync, renameSync, rmSync, rmdirSync, statSync, statfsSync, watch, writeFileSync, writeSync } from "node:fs";
@@ -3283,7 +3283,7 @@ function macosBuildOptions(params) {
3283
3283
  const artifactQuery = options.artifactInputs === void 0 ? null : swiftpmArtifactQuery({
3284
3284
  project: params.project,
3285
3285
  sourceDigest: params.fingerprint,
3286
- stimBuild: params.stimBuild,
3286
+ ...typeof params.compat === "number" ? { compat: params.compat } : { stimBuild: params.stimBuild },
3287
3287
  inputs: options.artifactInputs,
3288
3288
  build: {
3289
3289
  product: options.product,
@@ -3636,7 +3636,7 @@ var BuildHost = class {
3636
3636
  const query = swiftpmArtifactQuery({
3637
3637
  project: job.project,
3638
3638
  sourceDigest: job.expectedFingerprint,
3639
- stimBuild: job.stimBuild,
3639
+ ...typeof job.compat === "number" ? { compat: job.compat } : { stimBuild: job.stimBuild },
3640
3640
  inputs: options.artifactInputs,
3641
3641
  build: {
3642
3642
  product: options.product,
@@ -4352,7 +4352,11 @@ var BuildSession = class {
4352
4352
  for (const file of this.files.values()) if (!existsSync(this.blobPath(file.sha256))) return refusal("bad-request", `The blob of ${file.path} is missing; sync again.`);
4353
4353
  const toolchain = await this.host.toolchain(null, native?.provider);
4354
4354
  if (this.closed) return refusal("build-refused", "The connection closed.");
4355
- if (!toolchain || toolchain.stimBuild !== params.stimBuild) return refusal("build-refused", `This machine runs Stim build ${toolchain?.stimBuild ?? "unknown"}.`);
4355
+ const compat = typeof params.compat === "number" ? params.compat : void 0;
4356
+ if (!toolchain) return refusal("build-refused", "This machine runs Stim build unknown.");
4357
+ if (compat !== void 0 && toolchain.compat !== void 0) {
4358
+ if (toolchain.compat !== compat) return refusal("build-refused", `This machine runs Stim build ${toolchain.stimBuild ?? "unknown"} with build compatibility ${toolchain.compat}, not ${compat}.`);
4359
+ } else if (toolchain.stimBuild !== params.stimBuild) return refusal("build-refused", `This machine runs Stim build ${toolchain.stimBuild ?? "unknown"}.`);
4356
4360
  const launched = this.host.launch({
4357
4361
  client: this.client,
4358
4362
  repo: params.repo,
@@ -4368,6 +4372,7 @@ var BuildSession = class {
4368
4372
  isExpo: params.isExpo === true,
4369
4373
  cacheArtifact: params.cacheArtifact === true,
4370
4374
  stimBuild: params.stimBuild,
4375
+ ...compat !== void 0 && toolchain.compat !== void 0 ? { compat } : {},
4371
4376
  configuration: optional(params.configuration),
4372
4377
  scheme: optional(params.scheme),
4373
4378
  iosProjectPath: optional(params.iosProjectPath),
@@ -4,6 +4,6 @@ const encode = (version) => version.split(".", 3).reduce((sum, part) => sum * 1e
4
4
  if (encode(process.versions.node) < encode("22.12.0")) {
5
5
  process.stderr.write(`STIM_NODE_UNSUPPORTED: stim-server needs Node 22.12.0 or later; this is Node ${process.versions.node} at ${process.execPath}. To run stim-server where a project pins an older Node, see https://stim.appandflow.com/docs/requirements#older-node-pins\n`);
6
6
  process.exitCode = 1;
7
- } else import("./stim-server-Z40-_Git.mjs");
7
+ } else import("./stim-server-DowAx-6v.mjs");
8
8
  //#endregion
9
9
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stim-cli/server",
3
- "version": "1.24.0",
3
+ "version": "1.25.0",
4
4
  "description": "Serves Stim status to paired clients over Tailscale, and runs reload and stop for clients granted control.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -28,13 +28,13 @@
28
28
  "./protocol.schema.json": "./dist/protocol.schema.json"
29
29
  },
30
30
  "dependencies": {
31
- "@stim-cli/agent-driver": "^1.24.0",
32
- "@stim-cli/agent-driver-agent-device": "^1.24.0",
33
- "@stim-cli/cache": "^1.24.0",
34
- "@stim-cli/core": "^1.24.0",
35
- "@stim-cli/transport": "^1.24.0",
36
- "@stim-cli/transport-tailscale": "^1.24.0",
37
- "stim": "1.24.0",
31
+ "@stim-cli/agent-driver": "1.25.0",
32
+ "@stim-cli/agent-driver-agent-device": "1.25.0",
33
+ "@stim-cli/cache": "1.25.0",
34
+ "@stim-cli/core": "1.25.0",
35
+ "@stim-cli/transport": "1.25.0",
36
+ "@stim-cli/transport-tailscale": "1.25.0",
37
+ "stim": "1.25.0",
38
38
  "ws": "^8.21.3"
39
39
  },
40
40
  "devDependencies": {