@playdrop/playdrop-cli 0.7.5 → 0.7.13

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 (46) hide show
  1. package/config/client-meta.json +3 -54
  2. package/dist/apps/build.js +6 -6
  3. package/dist/apps/upload.js +1 -3
  4. package/dist/captureRuntime.js +4 -1
  5. package/dist/catalogue.js +7 -6
  6. package/dist/commands/capture.js +5 -3
  7. package/dist/commands/create.js +26 -18
  8. package/dist/commands/devBrowser.js +5 -3
  9. package/dist/commands/devServer.js +80 -1
  10. package/node_modules/@playdrop/ai-client/package.json +1 -1
  11. package/node_modules/@playdrop/api-client/dist/client.d.ts +18 -1
  12. package/node_modules/@playdrop/api-client/dist/client.d.ts.map +1 -1
  13. package/node_modules/@playdrop/api-client/dist/domains/admin.d.ts +12 -1
  14. package/node_modules/@playdrop/api-client/dist/domains/admin.d.ts.map +1 -1
  15. package/node_modules/@playdrop/api-client/dist/domains/admin.js +106 -0
  16. package/node_modules/@playdrop/api-client/dist/domains/auth.d.ts +7 -1
  17. package/node_modules/@playdrop/api-client/dist/domains/auth.d.ts.map +1 -1
  18. package/node_modules/@playdrop/api-client/dist/domains/auth.js +63 -0
  19. package/node_modules/@playdrop/api-client/dist/index.d.ts +18 -1
  20. package/node_modules/@playdrop/api-client/dist/index.d.ts.map +1 -1
  21. package/node_modules/@playdrop/api-client/dist/index.js +42 -0
  22. package/node_modules/@playdrop/api-client/package.json +1 -1
  23. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js +1 -0
  24. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js.map +1 -1
  25. package/node_modules/@playdrop/boxel-core/package.json +1 -1
  26. package/node_modules/@playdrop/boxel-three/package.json +1 -1
  27. package/node_modules/@playdrop/config/client-meta.json +3 -54
  28. package/node_modules/@playdrop/config/dist/src/deployment.d.ts +1 -0
  29. package/node_modules/@playdrop/config/dist/src/deployment.d.ts.map +1 -1
  30. package/node_modules/@playdrop/config/dist/src/deployment.js +31 -0
  31. package/node_modules/@playdrop/config/dist/src/index.d.ts.map +1 -1
  32. package/node_modules/@playdrop/config/dist/src/index.js +4 -1
  33. package/node_modules/@playdrop/config/dist/src/server/fastify.d.ts.map +1 -1
  34. package/node_modules/@playdrop/config/dist/src/server/fastify.js +3 -0
  35. package/node_modules/@playdrop/config/dist/test/deployment.test.js +24 -0
  36. package/node_modules/@playdrop/config/dist/test/fastify.test.d.ts +2 -0
  37. package/node_modules/@playdrop/config/dist/test/fastify.test.d.ts.map +1 -0
  38. package/node_modules/@playdrop/config/dist/test/fastify.test.js +12 -0
  39. package/node_modules/@playdrop/config/dist/test/validateClientEnvironment.test.js +11 -14
  40. package/node_modules/@playdrop/config/dist/tsconfig.tsbuildinfo +1 -1
  41. package/node_modules/@playdrop/config/package.json +1 -1
  42. package/node_modules/@playdrop/types/dist/api.d.ts +95 -1
  43. package/node_modules/@playdrop/types/dist/api.d.ts.map +1 -1
  44. package/node_modules/@playdrop/types/dist/api.js +11 -0
  45. package/node_modules/@playdrop/vox-three/package.json +1 -1
  46. package/package.json +2 -2
@@ -1,60 +1,9 @@
1
1
  {
2
- "version": "0.7.5",
2
+ "version": "0.7.13",
3
3
  "build": 1,
4
- "platforms": {
5
- "ios": {
6
- "minimumVersion": "16.0"
7
- },
8
- "macos": {
9
- "minimumVersion": "10.15"
10
- },
11
- "linux": {
12
- "minimumVersion": "any"
13
- },
14
- "windows": {
15
- "minimumVersion": "any"
16
- },
17
- "android": {
18
- "minimumVersion": "any"
19
- },
20
- "browser": {
21
- "minimumVersion": "any"
22
- },
23
- "unknown": {
24
- "minimumVersion": "any"
25
- }
26
- },
27
4
  "clients": {
28
- "web": {
29
- "minimumVersion": "0.7.5",
30
- "minimumBuild": 1
31
- },
32
- "admin": {
33
- "minimumVersion": "0.7.5",
34
- "minimumBuild": 1
35
- },
36
- "apple": {
37
- "minimumVersion": "0.3.10",
38
- "minimumBuild": 1
39
- },
40
- "apple-playdrop": {
41
- "minimumVersion": "0.3.10",
42
- "minimumBuild": 1
43
- },
44
- "apple-games": {
45
- "minimumVersion": "0.3.10",
46
- "minimumBuild": 1
47
- },
48
- "apple-music": {
49
- "minimumVersion": "0.3.10",
50
- "minimumBuild": 1
51
- },
52
- "android-games": {
53
- "minimumVersion": "0.7.5",
54
- "minimumBuild": 1
55
- },
56
- "cli": {
57
- "minimumVersion": "0.7.5"
5
+ "all": {
6
+ "minimumVersion": "0.7.4"
58
7
  }
59
8
  }
60
9
  }
@@ -10,6 +10,7 @@ export interface StructuredLogFields {
10
10
  deploy_role: PlaydropDeployRole;
11
11
  public_surface: PlaydropPublicSurface;
12
12
  }
13
+ export declare function isCurrentSlotActive(env?: NodeJS.ProcessEnv): boolean | null;
13
14
  export declare function parseDeployRole(value: unknown): PlaydropDeployRole | null;
14
15
  export declare function parseDeploySlot(value: unknown): PlaydropDeploySlot | null;
15
16
  export declare function parsePublicSurface(value: unknown): PlaydropPublicSurface | null;
@@ -1 +1 @@
1
- {"version":3,"file":"deployment.d.ts","sourceRoot":"","sources":["../../src/deployment.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,SAAS,CAAC;AACpD,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,OAAO,CAAC;AAClD,MAAM,MAAM,qBAAqB,GAAG,kBAAkB,GAAG,kBAAkB,CAAC;AAM5E,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,kBAAkB,GAAG,MAAM,CAAC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,kBAAkB,CAAC;IAChC,cAAc,EAAE,qBAAqB,CAAC;CACvC;AA4ED,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,kBAAkB,GAAG,IAAI,CAMzE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,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAU7E;AAED,wBAAgB,gBAAgB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAM7E;AAED,wBAAgB,qBAAqB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAMlF;AAED,wBAAgB,eAAe,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAM5E;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,mBAAmB,CAYrH"}
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.isCurrentSlotActive = isCurrentSlotActive;
6
7
  exports.parseDeployRole = parseDeployRole;
7
8
  exports.parseDeploySlot = parseDeploySlot;
8
9
  exports.parsePublicSurface = parsePublicSurface;
@@ -85,6 +86,32 @@ function parseBoolean(value) {
85
86
  }
86
87
  return null;
87
88
  }
89
+ function resolveSlotStatePath(env = process.env) {
90
+ const raw = typeof env['PLAYDROP_SLOT_STATE_PATH'] === 'string' ? env['PLAYDROP_SLOT_STATE_PATH'].trim() : '';
91
+ return raw.length > 0 ? raw : null;
92
+ }
93
+ function readActiveSlotFromStateFile(env = process.env) {
94
+ const slotStatePath = resolveSlotStatePath(env);
95
+ if (!slotStatePath) {
96
+ return null;
97
+ }
98
+ try {
99
+ const raw = fs_1.default.readFileSync(slotStatePath, 'utf8');
100
+ const parsed = JSON.parse(raw);
101
+ return parseDeploySlot(parsed?.activeSlot);
102
+ }
103
+ catch {
104
+ return null;
105
+ }
106
+ }
107
+ function isCurrentSlotActive(env = process.env) {
108
+ const slot = resolveDeploySlot(env);
109
+ const activeSlot = readActiveSlotFromStateFile(env);
110
+ if (!slot || !activeSlot) {
111
+ return null;
112
+ }
113
+ return slot === activeSlot;
114
+ }
88
115
  function parseDeployRole(value) {
89
116
  const normalized = normalizeValue(value);
90
117
  if (!normalized || !DEPLOY_ROLE_VALUES.has(normalized)) {
@@ -137,6 +164,10 @@ function isBackgroundWorkEnabled(env = process.env) {
137
164
  if (explicit !== null) {
138
165
  return explicit;
139
166
  }
167
+ const currentSlotActive = isCurrentSlotActive(env);
168
+ if (currentSlotActive !== null) {
169
+ return currentSlotActive;
170
+ }
140
171
  return resolveDeployRole(env) === 'prod';
141
172
  }
142
173
  function resolveSeoIndexingMode(env = process.env) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EAEjB,sBAAsB,EAEvB,MAAM,SAAS,CAAC;AAsBjB,wBAAgB,cAAc,IAAI,gBAAgB,CAMjD;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,wBAAgB,qBAAqB,IAAI,MAAM,CAG9C;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AAEjC,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUxF;AAoBD,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,iBAAiB,GAAG,sBAAsB,CAqEzF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EAEjB,sBAAsB,EAEvB,MAAM,SAAS,CAAC;AAsBjB,wBAAgB,cAAc,IAAI,gBAAgB,CAMjD;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,wBAAgB,qBAAqB,IAAI,MAAM,CAG9C;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AAEjC,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUxF;AAwBD,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,iBAAiB,GAAG,sBAAsB,CAqEzF"}
@@ -100,6 +100,9 @@ function collectMissingHeaders(info) {
100
100
  })
101
101
  .map((entry) => entry.header);
102
102
  }
103
+ function resolveClientRule(meta, clientKey) {
104
+ return meta.clients[clientKey] ?? meta.clients['all'];
105
+ }
103
106
  function validateClientEnvironment(info) {
104
107
  const normalized = normalizeRuntimeInfo(info);
105
108
  if (!normalized) {
@@ -112,7 +115,7 @@ function validateClientEnvironment(info) {
112
115
  }
113
116
  const meta = loadClientMeta();
114
117
  const clientKey = normalized.client;
115
- const clientRule = meta.clients[clientKey];
118
+ const clientRule = resolveClientRule(meta, clientKey);
116
119
  if (!clientRule) {
117
120
  return {
118
121
  ok: false,
@@ -1 +1 @@
1
- {"version":3,"file":"fastify.d.ts","sourceRoot":"","sources":["../../../src/server/fastify.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,YAAY,EACZ,cAAc,EACd,oBAAoB,EAEpB,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAQjB,O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UAYxC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;gBACjB,MAAM;gBACN;QACV,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG;YACpB,KAAK,EAAE,MAAM,CAAC;SACf,CAAC;KACH;eACU,MAAM,MAAM;aACd,QAAQ;;;;;kBATiB,CAAC;eAAoB,CAAA;mBACtC,CAAC;gBACf,CAAC;yBACK,CAAC;sBACQ,CAAC;;;;;;;;;;sBAaG,CAAC;;;;;;;UAhBjB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;gBACjB,MAAM;gBACN;QACV,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG;YACpB,KAAK,EAAE,MAAM,CAAC;SACf,CAAC;KACH;eACU,MAAM,MAAM;EAW1B;AAED,wBAAgB,yBAAyB,CAAC,MAAM,EAAE;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,oBAAoB,CAAC,gBAAgB,CAAC,CAoBzC;AAED,wBAAgB,gCAAgC,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI,CAsC3E;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,cAAc,GAAG,iBAAiB,CAiB5E;AAED,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,uBAAuB,GAC/B,uBAAuB,CAkEzB;AAED,wBAAgB,gBAAgB,CAC9B,MAAM,GAAE,CAAC,OAAO,EAAE,cAAc,KAAK,iBAAqC,EAC1E,SAAS,GAAE,eAA2C,EACtD,SAAS,GAAE,CAAC,OAAO,EAAE,uBAAuB,KAAK,uBAA2C,GAC3F,WAAW,CAkBb;AAED,eAAO,MAAM,qBAAqB,aAAqB,CAAC"}
@@ -71,6 +71,9 @@ function buildFastifyLogger(service) {
71
71
  }
72
72
  function buildFastifyServerOptions(params) {
73
73
  return {
74
+ routerOptions: {
75
+ maxParamLength: 2048,
76
+ },
74
77
  logger: buildFastifyLogger(params.service),
75
78
  disableRequestLogging: true,
76
79
  requestIdHeader: 'x-request-id',
@@ -4,6 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const strict_1 = __importDefault(require("node:assert/strict"));
7
+ const node_fs_1 = __importDefault(require("node:fs"));
8
+ const node_os_1 = __importDefault(require("node:os"));
9
+ const node_path_1 = __importDefault(require("node:path"));
7
10
  const node_test_1 = __importDefault(require("node:test"));
8
11
  const deployment_1 = require("../src/deployment");
9
12
  (0, node_test_1.default)('deploy role parsing stays strict', () => {
@@ -43,6 +46,27 @@ const deployment_1 = require("../src/deployment");
43
46
  strict_1.default.equal((0, deployment_1.resolveSeoIndexingMode)(env), 'noindex');
44
47
  strict_1.default.equal((0, deployment_1.isBackgroundWorkEnabled)(env), false);
45
48
  });
49
+ (0, node_test_1.default)('background work follows the runtime slot-state file when present', () => {
50
+ const tempDir = node_fs_1.default.mkdtempSync(node_path_1.default.join(node_os_1.default.tmpdir(), 'playdrop-slot-state-'));
51
+ const slotStatePath = node_path_1.default.join(tempDir, 'slot-state.json');
52
+ try {
53
+ node_fs_1.default.writeFileSync(slotStatePath, JSON.stringify({ activeSlot: 'green' }));
54
+ const env = {
55
+ NODE_ENV: 'production',
56
+ PLAYDROP_DEPLOY_ROLE: 'prod',
57
+ PLAYDROP_SLOT: 'green',
58
+ PLAYDROP_SLOT_STATE_PATH: slotStatePath,
59
+ };
60
+ strict_1.default.equal((0, deployment_1.isCurrentSlotActive)(env), true);
61
+ strict_1.default.equal((0, deployment_1.isBackgroundWorkEnabled)(env), true);
62
+ node_fs_1.default.writeFileSync(slotStatePath, JSON.stringify({ activeSlot: 'blue' }));
63
+ strict_1.default.equal((0, deployment_1.isCurrentSlotActive)(env), false);
64
+ strict_1.default.equal((0, deployment_1.isBackgroundWorkEnabled)(env), false);
65
+ }
66
+ finally {
67
+ node_fs_1.default.rmSync(tempDir, { recursive: true, force: true });
68
+ }
69
+ });
46
70
  (0, node_test_1.default)('explicit origin overrides win over derived defaults', () => {
47
71
  const env = {
48
72
  PLAYDROP_PUBLIC_ORIGIN: 'https://blue.playdrop.ai/',
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=fastify.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fastify.test.d.ts","sourceRoot":"","sources":["../../test/fastify.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const strict_1 = __importDefault(require("node:assert/strict"));
7
+ const node_test_1 = __importDefault(require("node:test"));
8
+ const fastify_1 = require("../src/server/fastify");
9
+ (0, node_test_1.default)('buildFastifyServerOptions allows long path params for encrypted auth tokens', () => {
10
+ const options = (0, fastify_1.buildFastifyServerOptions)({ service: 'api-server' });
11
+ strict_1.default.equal(options.routerOptions?.maxParamLength, 2048);
12
+ });
@@ -23,8 +23,8 @@ function runtime(overrides = {}) {
23
23
  });
24
24
  (0, node_test_1.default)('enforces minimum build when version matches requirement', () => {
25
25
  const meta = (0, index_1.loadClientMeta)();
26
- const requiredVersion = meta.clients['web']?.minimumVersion ?? meta.version;
27
- const requiredBuild = meta.clients['web']?.minimumBuild;
26
+ const requiredVersion = meta.clients['all']?.minimumVersion ?? meta.version;
27
+ const requiredBuild = meta.clients['all']?.minimumBuild;
28
28
  if (typeof requiredBuild !== 'number') {
29
29
  strict_1.default.equal(true, true);
30
30
  return;
@@ -45,19 +45,16 @@ function runtime(overrides = {}) {
45
45
  strict_1.default.equal(result.code, 'unsupported_client_version');
46
46
  }
47
47
  });
48
- (0, node_test_1.default)('enforces platform minimum version', () => {
48
+ (0, node_test_1.default)('accepts supported clients without platform-specific floors', () => {
49
49
  const info = runtime({ platform: 'ios', platformVersion: '15.5', client: 'apple-playdrop' });
50
50
  const result = (0, index_1.validateClientEnvironment)(info);
51
- strict_1.default.equal(result.ok, false);
52
- if (!result.ok) {
53
- strict_1.default.equal(result.code, 'unsupported_platform_version');
54
- }
51
+ strict_1.default.equal(result.ok, true);
55
52
  });
56
53
  (0, node_test_1.default)('accepts product-specific Apple client ids that meet the minimum version', () => {
57
54
  const meta = (0, index_1.loadClientMeta)();
58
55
  for (const clientName of ['apple-games', 'apple-music']) {
59
- const requiredVersion = meta.clients[clientName]?.minimumVersion ?? meta.version;
60
- const requiredBuild = meta.clients[clientName]?.minimumBuild ?? meta.build;
56
+ const requiredVersion = meta.clients['all']?.minimumVersion ?? meta.version;
57
+ const requiredBuild = meta.clients['all']?.minimumBuild ?? meta.build;
61
58
  const info = runtime({
62
59
  client: clientName,
63
60
  clientVersion: requiredVersion,
@@ -71,8 +68,8 @@ function runtime(overrides = {}) {
71
68
  });
72
69
  (0, node_test_1.default)('accepts android-games as a first-class client identity', () => {
73
70
  const meta = (0, index_1.loadClientMeta)();
74
- const requiredVersion = meta.clients['android-games']?.minimumVersion ?? meta.version;
75
- const requiredBuild = meta.clients['android-games']?.minimumBuild ?? meta.build;
71
+ const requiredVersion = meta.clients['all']?.minimumVersion ?? meta.version;
72
+ const requiredBuild = meta.clients['all']?.minimumBuild ?? meta.build;
76
73
  const info = runtime({
77
74
  client: 'android-games',
78
75
  clientVersion: requiredVersion,
@@ -85,8 +82,8 @@ function runtime(overrides = {}) {
85
82
  });
86
83
  (0, node_test_1.default)('keeps accepting the legacy Apple client id during rollout', () => {
87
84
  const meta = (0, index_1.loadClientMeta)();
88
- const requiredVersion = meta.clients['apple']?.minimumVersion ?? meta.version;
89
- const requiredBuild = meta.clients['apple']?.minimumBuild ?? meta.build;
85
+ const requiredVersion = meta.clients['all']?.minimumVersion ?? meta.version;
86
+ const requiredBuild = meta.clients['all']?.minimumBuild ?? meta.build;
90
87
  const info = runtime({
91
88
  client: 'apple',
92
89
  clientVersion: requiredVersion,
@@ -99,7 +96,7 @@ function runtime(overrides = {}) {
99
96
  });
100
97
  (0, node_test_1.default)('does not require a build floor for newer cli versions once the version is supported', () => {
101
98
  const meta = (0, index_1.loadClientMeta)();
102
- const requiredVersion = meta.clients['cli']?.minimumVersion ?? meta.version;
99
+ const requiredVersion = meta.clients['all']?.minimumVersion ?? meta.version;
103
100
  const info = runtime({
104
101
  client: 'cli',
105
102
  clientVersion: requiredVersion,