@stim-cli/server 1.14.0 → 1.16.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 (52) hide show
  1. package/README.md +1773 -92
  2. package/dist/protocol-BHSl7bQ_.mjs +2772 -0
  3. package/dist/protocol.d.mts +2 -496
  4. package/dist/protocol.mjs +3 -2
  5. package/dist/protocol.schema.json +5388 -684
  6. package/dist/scrcpy/LICENSE +204 -0
  7. package/dist/scrcpy/NOTICE +22 -0
  8. package/dist/scrcpy/scrcpy-server +0 -0
  9. package/dist/stats-read.d.mts +1 -0
  10. package/dist/stats-read.mjs +46 -0
  11. package/dist/stim-frames/AndroidDeviceStream.swift +284 -0
  12. package/dist/stim-frames/DevToolsClient.swift +180 -0
  13. package/dist/stim-frames/DeviceFrameGeometry.swift +41 -0
  14. package/dist/stim-frames/DeviceFrameView.swift +167 -0
  15. package/dist/stim-frames/DuoCaptureSource.swift +132 -0
  16. package/dist/stim-frames/DuoDeviceProfile.swift +37 -0
  17. package/dist/stim-frames/DuoFrameRenderer.swift +111 -0
  18. package/dist/stim-frames/DuoHingeMonitor.swift +89 -0
  19. package/dist/stim-frames/DuoMesh.swift +100 -0
  20. package/dist/stim-frames/DuoModelView.swift +275 -0
  21. package/dist/stim-frames/DuoPoseClip.swift +140 -0
  22. package/dist/stim-frames/DuoScreenHitMesh.swift +200 -0
  23. package/dist/stim-frames/EmulatorFrameArtwork.swift +113 -0
  24. package/dist/stim-frames/EmulatorInput.swift +13 -2
  25. package/dist/stim-frames/EmulatorPosture.swift +2 -2
  26. package/dist/stim-frames/FrameArtwork.swift +37 -0
  27. package/dist/stim-frames/H264Decoder.swift +109 -0
  28. package/dist/stim-frames/InputMessages.swift +27 -6
  29. package/dist/stim-frames/KeyboardLayoutMap.swift +70 -0
  30. package/dist/stim-frames/MacosSource.swift +677 -0
  31. package/dist/stim-frames/OwnedAppWindowReader.swift +87 -0
  32. package/dist/stim-frames/OwnedAppWindows.swift +108 -0
  33. package/dist/stim-frames/PhoneSource.swift +315 -0
  34. package/dist/stim-frames/ProcessStream.swift +155 -0
  35. package/dist/stim-frames/ScrcpyProtocol.swift +167 -0
  36. package/dist/stim-frames/SimulatorDevelopmentOptions.swift +81 -0
  37. package/dist/stim-frames/SimulatorFrameArtwork.swift +118 -0
  38. package/dist/stim-frames/SimulatorHID.swift +70 -29
  39. package/dist/stim-frames/SimulatorHingeAngle.swift +56 -0
  40. package/dist/stim-frames/SimulatorPosture.swift +277 -0
  41. package/dist/stim-frames/SimulatorRotation.swift +28 -8
  42. package/dist/stim-frames/Siniulator-LICENSE.txt +21 -0
  43. package/dist/stim-frames/StoragePaths.swift +42 -0
  44. package/dist/stim-frames/VideoEncoder.swift +8 -6
  45. package/dist/stim-frames/WebPage.swift +301 -0
  46. package/dist/stim-frames/main.swift +651 -22
  47. package/dist/stim-host/Info.plist +28 -0
  48. package/dist/stim-host/stim-host.c +153 -0
  49. package/dist/stim-server-CvqlgkBK.mjs +14887 -0
  50. package/dist/stim-server.mjs +6 -4421
  51. package/package.json +3 -3
  52. package/dist/protocol-IroIg8Td.mjs +0 -865
@@ -0,0 +1,2772 @@
1
+ import "node:module";
2
+ import { ACTIONS, BUILD_REPO_PATTERN, CAPABILITIES, CONTROL_END_REASONS, DEVICE_POSTURES, ERROR_CODES, FEATURES, FRAME_EDGE, FRAME_FPS, INPUT_BUTTONS, INPUT_KEYS, KEY_MODIFIERS, LEGACY_PUSH_EVENTS, LOG_LEVELS, LOG_SOURCES, MAX_INPUT_TEXT, MAX_LOG_TAIL, NOTIFICATION_LEVELS, NOTIFICATION_SUPPRESSIONS, PLATFORMS, PROTOCOL_VERSION, PUSH_EVENTS, PUSH_TOKEN_PATTERN, RELOAD_PLATFORMS, REPLAY_MARKER_KINDS, REPLAY_RATES, ROTATE_DIRECTIONS, TOUCH_PHASES, VIDEO_CODECS } from "@stim-cli/core/protocol";
3
+ //#region \0rolldown/runtime.js
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __exportAll = (all, no_symbols) => {
9
+ let target = {};
10
+ for (var name in all) __defProp(target, name, {
11
+ get: all[name],
12
+ enumerable: true
13
+ });
14
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
15
+ return target;
16
+ };
17
+ var __copyProps = (to, from, except, desc) => {
18
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
19
+ key = keys[i];
20
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
21
+ get: ((k) => from[k]).bind(null, key),
22
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
23
+ });
24
+ }
25
+ return to;
26
+ };
27
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
28
+ //#endregion
29
+ //#region src/protocol.ts
30
+ var protocol_exports = /* @__PURE__ */ __exportAll({ protocolJsonSchema: () => protocolJsonSchema });
31
+ import * as import__stim_cli_core_protocol from "@stim-cli/core/protocol";
32
+ __reExport(protocol_exports, import__stim_cli_core_protocol);
33
+ const requestId = { type: ["integer", "string"] };
34
+ const protocolError = {
35
+ type: "object",
36
+ required: ["code", "message"],
37
+ additionalProperties: false,
38
+ properties: {
39
+ code: { enum: [...ERROR_CODES] },
40
+ message: { type: "string" }
41
+ }
42
+ };
43
+ const buildRepo = {
44
+ type: "string",
45
+ pattern: BUILD_REPO_PATTERN
46
+ };
47
+ const sha256 = {
48
+ type: "string",
49
+ pattern: "^[0-9a-f]{64}$"
50
+ };
51
+ const buildJob = {
52
+ type: "object",
53
+ required: ["job"],
54
+ additionalProperties: false,
55
+ properties: { job: { type: "string" } }
56
+ };
57
+ function request(method, params) {
58
+ return {
59
+ type: "object",
60
+ required: params ? [
61
+ "id",
62
+ "method",
63
+ "params"
64
+ ] : ["id", "method"],
65
+ additionalProperties: false,
66
+ properties: {
67
+ id: requestId,
68
+ method: { const: method },
69
+ params: params ?? {
70
+ type: "object",
71
+ maxProperties: 0
72
+ }
73
+ }
74
+ };
75
+ }
76
+ function session(properties, required = []) {
77
+ return {
78
+ type: "object",
79
+ required: ["session", ...required],
80
+ additionalProperties: false,
81
+ properties: {
82
+ session: { type: "string" },
83
+ ...properties
84
+ }
85
+ };
86
+ }
87
+ function optionalParams(method, params) {
88
+ return {
89
+ type: "object",
90
+ required: ["id", "method"],
91
+ additionalProperties: false,
92
+ properties: {
93
+ id: requestId,
94
+ method: { const: method },
95
+ params
96
+ }
97
+ };
98
+ }
99
+ /** The JSON Schema of every message on the wire, written to `dist/protocol.schema.json` at build time. */
100
+ function protocolJsonSchema() {
101
+ return {
102
+ $schema: "https://json-schema.org/draft/2020-12/schema",
103
+ title: "Stim server protocol",
104
+ description: `Messages exchanged over the stim-server WebSocket, protocol version ${PROTOCOL_VERSION}.`,
105
+ "x-stim-protocol": PROTOCOL_VERSION,
106
+ $defs: {
107
+ ProtocolError: protocolError,
108
+ HostedAppDelivery: {
109
+ type: "object",
110
+ required: [
111
+ "session",
112
+ "attempt",
113
+ "bundleId",
114
+ "mode",
115
+ "state",
116
+ "launched"
117
+ ],
118
+ additionalProperties: false,
119
+ properties: {
120
+ session: { type: "string" },
121
+ attempt: { type: "string" },
122
+ bundleId: { type: "string" },
123
+ mode: { enum: ["development", "release"] },
124
+ devClientScheme: {
125
+ type: "string",
126
+ pattern: "^[a-zA-Z][a-zA-Z0-9+.-]{0,127}$"
127
+ },
128
+ arguments: {
129
+ type: "array",
130
+ maxItems: 32,
131
+ items: {
132
+ type: "string",
133
+ maxLength: 1024,
134
+ pattern: "^[^\\u0000\\r\\n]*$"
135
+ }
136
+ },
137
+ state: { enum: [
138
+ "receiving",
139
+ "installing",
140
+ "installed",
141
+ "unknown"
142
+ ] },
143
+ launched: { enum: [
144
+ true,
145
+ "unverified",
146
+ null
147
+ ] },
148
+ notice: { type: "string" },
149
+ agent: { oneOf: [{
150
+ type: "object",
151
+ required: ["driver"],
152
+ additionalProperties: false,
153
+ properties: { driver: { const: "none" } }
154
+ }, {
155
+ type: "object",
156
+ required: [
157
+ "driver",
158
+ "path",
159
+ "token",
160
+ "scope"
161
+ ],
162
+ additionalProperties: false,
163
+ properties: {
164
+ driver: {
165
+ type: "string",
166
+ pattern: "^[a-z][a-z0-9-]{0,31}$",
167
+ not: { const: "none" }
168
+ },
169
+ path: {
170
+ type: "string",
171
+ pattern: "^/device-host/agent/[a-f0-9-]{36}/$"
172
+ },
173
+ token: {
174
+ type: "string",
175
+ pattern: "^[A-Za-z0-9_-]{32,256}$"
176
+ },
177
+ scope: {
178
+ type: "string",
179
+ pattern: "^[A-Za-z0-9._:-]{1,256}$"
180
+ },
181
+ lease: {
182
+ type: "object",
183
+ required: [
184
+ "tenant",
185
+ "runId",
186
+ "clientId",
187
+ "deviceKey"
188
+ ],
189
+ additionalProperties: false,
190
+ oneOf: [{
191
+ required: ["backend"],
192
+ properties: { deviceKey: { pattern: "^ios:mobile:[a-fA-F0-9-]{36}$" } }
193
+ }, {
194
+ not: { required: ["backend"] },
195
+ properties: { deviceKey: { pattern: "^[A-Za-z0-9_-]+(?:\\.[A-Za-z0-9_-]+)+@[1-9][0-9]{0,9}$" } }
196
+ }],
197
+ properties: {
198
+ tenant: {
199
+ type: "string",
200
+ pattern: "^[A-Za-z0-9._-]{1,128}$"
201
+ },
202
+ runId: {
203
+ type: "string",
204
+ pattern: "^[A-Za-z0-9._-]{1,128}$"
205
+ },
206
+ clientId: {
207
+ type: "string",
208
+ pattern: "^[A-Za-z0-9._-]{1,128}$"
209
+ },
210
+ backend: { const: "ios-instance" },
211
+ deviceKey: { type: "string" }
212
+ }
213
+ }
214
+ }
215
+ }] }
216
+ }
217
+ },
218
+ HostedAppOfferResult: {
219
+ type: "object",
220
+ required: ["delivery", "missing"],
221
+ additionalProperties: false,
222
+ properties: {
223
+ delivery: { $ref: "#/$defs/HostedAppDelivery" },
224
+ missing: {
225
+ type: "array",
226
+ items: {
227
+ type: "object",
228
+ required: [
229
+ "sha256",
230
+ "size",
231
+ "offset"
232
+ ],
233
+ additionalProperties: false,
234
+ properties: {
235
+ sha256,
236
+ size: {
237
+ type: "integer",
238
+ minimum: 0
239
+ },
240
+ offset: {
241
+ type: "integer",
242
+ minimum: 0
243
+ }
244
+ }
245
+ }
246
+ }
247
+ }
248
+ },
249
+ ServerUpdateProgress: {
250
+ type: "object",
251
+ required: [
252
+ "id",
253
+ "by",
254
+ "target",
255
+ "state",
256
+ "startedAt",
257
+ "missing",
258
+ "log"
259
+ ],
260
+ additionalProperties: false,
261
+ properties: {
262
+ id: { type: "string" },
263
+ by: {
264
+ type: "object",
265
+ required: ["id", "name"],
266
+ additionalProperties: false,
267
+ properties: {
268
+ id: { type: "string" },
269
+ name: { type: "string" }
270
+ }
271
+ },
272
+ target: { type: "string" },
273
+ state: { enum: ["uploading", "installing"] },
274
+ startedAt: { type: "string" },
275
+ missing: {
276
+ type: "array",
277
+ items: {
278
+ type: "object",
279
+ required: ["name", "offset"],
280
+ additionalProperties: false,
281
+ properties: {
282
+ name: { type: "string" },
283
+ offset: {
284
+ type: "integer",
285
+ minimum: 0
286
+ }
287
+ }
288
+ }
289
+ },
290
+ log: {
291
+ type: "array",
292
+ items: { type: "string" }
293
+ }
294
+ }
295
+ },
296
+ ServerUpdateStatus: {
297
+ type: "object",
298
+ required: [
299
+ "server",
300
+ "service",
301
+ "acceptsClientBuilds",
302
+ "running",
303
+ "last"
304
+ ],
305
+ additionalProperties: false,
306
+ properties: {
307
+ server: {
308
+ type: "object",
309
+ required: ["version", "stimBuild"],
310
+ additionalProperties: false,
311
+ properties: {
312
+ version: { type: "string" },
313
+ stimBuild: { type: ["string", "null"] }
314
+ }
315
+ },
316
+ service: { type: ["string", "null"] },
317
+ acceptsClientBuilds: { type: "boolean" },
318
+ running: { anyOf: [{ $ref: "#/$defs/ServerUpdateProgress" }, { type: "null" }] },
319
+ last: { anyOf: [{
320
+ type: "object",
321
+ required: [
322
+ "at",
323
+ "target",
324
+ "ok",
325
+ "message"
326
+ ],
327
+ additionalProperties: false,
328
+ properties: {
329
+ at: { type: "string" },
330
+ target: { type: "string" },
331
+ ok: { type: "boolean" },
332
+ message: { type: "string" }
333
+ }
334
+ }, { type: "null" }] }
335
+ }
336
+ },
337
+ MachineUpdateStatus: {
338
+ type: "object",
339
+ required: [
340
+ "remote",
341
+ "unreachable",
342
+ "upload"
343
+ ],
344
+ additionalProperties: false,
345
+ properties: {
346
+ remote: { anyOf: [{ $ref: "#/$defs/ServerUpdateStatus" }, { type: "null" }] },
347
+ unreachable: { type: ["string", "null"] },
348
+ upload: { anyOf: [{
349
+ type: "object",
350
+ required: [
351
+ "sent",
352
+ "total",
353
+ "error"
354
+ ],
355
+ additionalProperties: false,
356
+ properties: {
357
+ sent: {
358
+ type: "integer",
359
+ minimum: 0
360
+ },
361
+ total: {
362
+ type: "integer",
363
+ minimum: 0
364
+ },
365
+ error: { type: ["string", "null"] }
366
+ }
367
+ }, { type: "null" }] }
368
+ }
369
+ },
370
+ HostedAppChunkResult: {
371
+ type: "object",
372
+ required: ["offset"],
373
+ additionalProperties: false,
374
+ properties: { offset: {
375
+ type: "integer",
376
+ minimum: 0
377
+ } }
378
+ },
379
+ HostedAppHandoffResult: {
380
+ type: "object",
381
+ required: ["files", "bytes"],
382
+ additionalProperties: false,
383
+ properties: {
384
+ files: {
385
+ type: "integer",
386
+ minimum: 0
387
+ },
388
+ bytes: {
389
+ type: "integer",
390
+ minimum: 0
391
+ }
392
+ }
393
+ },
394
+ HostedDeviceOffer: {
395
+ type: "object",
396
+ required: [
397
+ "platform",
398
+ "choice",
399
+ "resources",
400
+ "declined",
401
+ "capacity"
402
+ ],
403
+ additionalProperties: false,
404
+ properties: {
405
+ platform: { enum: [
406
+ "ios",
407
+ "android",
408
+ "macos"
409
+ ] },
410
+ choice: {},
411
+ declined: {
412
+ type: ["string", "null"],
413
+ minLength: 1
414
+ },
415
+ resources: {
416
+ type: "object",
417
+ required: [
418
+ "cpus",
419
+ "loadPerCore",
420
+ "memoryFreeBytes",
421
+ "memoryPressure",
422
+ "workerDiskFreeBytes"
423
+ ],
424
+ additionalProperties: false,
425
+ properties: {
426
+ cpus: {
427
+ type: "integer",
428
+ minimum: 1
429
+ },
430
+ loadPerCore: {
431
+ type: "number",
432
+ minimum: 0
433
+ },
434
+ memoryFreeBytes: {
435
+ type: "number",
436
+ minimum: 0
437
+ },
438
+ memoryPressure: { enum: [
439
+ "normal",
440
+ "warning",
441
+ "critical",
442
+ null
443
+ ] },
444
+ workerDiskFreeBytes: {
445
+ type: ["number", "null"],
446
+ minimum: 0
447
+ }
448
+ }
449
+ },
450
+ capacity: {
451
+ type: "object",
452
+ required: [
453
+ "running",
454
+ "max",
455
+ "available"
456
+ ],
457
+ additionalProperties: false,
458
+ properties: {
459
+ running: {
460
+ type: "integer",
461
+ minimum: 0
462
+ },
463
+ max: {
464
+ type: "integer",
465
+ minimum: 0
466
+ },
467
+ available: {
468
+ type: ["integer", "null"],
469
+ minimum: 0
470
+ }
471
+ }
472
+ }
473
+ },
474
+ not: { properties: {
475
+ choice: { type: "null" },
476
+ declined: { type: "null" }
477
+ } },
478
+ oneOf: [
479
+ { properties: {
480
+ platform: { const: "ios" },
481
+ choice: { anyOf: [{ type: "null" }, {
482
+ type: "object",
483
+ required: [
484
+ "deviceTypeId",
485
+ "runtimeId",
486
+ "deviceType",
487
+ "runtime",
488
+ "architecture"
489
+ ],
490
+ additionalProperties: false,
491
+ properties: {
492
+ deviceTypeId: { type: "string" },
493
+ runtimeId: { type: "string" },
494
+ deviceType: { type: "string" },
495
+ runtime: { type: "string" },
496
+ architecture: { enum: ["arm64", "x86_64"] }
497
+ }
498
+ }] }
499
+ } },
500
+ { properties: {
501
+ platform: { const: "android" },
502
+ choice: { anyOf: [{ type: "null" }, {
503
+ type: "object",
504
+ required: [
505
+ "systemImage",
506
+ "deviceProfile",
507
+ "architecture"
508
+ ],
509
+ additionalProperties: false,
510
+ properties: {
511
+ systemImage: { type: "string" },
512
+ deviceProfile: { type: "string" },
513
+ architecture: { enum: ["arm64-v8a", "x86_64"] }
514
+ }
515
+ }] }
516
+ } },
517
+ { properties: {
518
+ platform: { const: "macos" },
519
+ choice: { anyOf: [{ type: "null" }, {
520
+ type: "object",
521
+ required: ["architecture", "macosVersion"],
522
+ additionalProperties: false,
523
+ properties: {
524
+ architecture: { enum: ["arm64", "x86_64"] },
525
+ macosVersion: {
526
+ type: "string",
527
+ pattern: "^\\d+(\\.\\d+){0,2}$"
528
+ }
529
+ }
530
+ }] }
531
+ } }
532
+ ]
533
+ },
534
+ HostedMetroResult: {
535
+ type: "object",
536
+ required: ["port"],
537
+ additionalProperties: false,
538
+ properties: { port: {
539
+ type: ["integer", "null"],
540
+ minimum: 1,
541
+ maximum: 65535
542
+ } }
543
+ },
544
+ HostedDeviceSession: {
545
+ type: "object",
546
+ required: [
547
+ "id",
548
+ "client",
549
+ "workspace",
550
+ "slot",
551
+ "platform",
552
+ "attempt",
553
+ "state",
554
+ "device",
555
+ "createdAt"
556
+ ],
557
+ additionalProperties: false,
558
+ properties: {
559
+ id: { type: "string" },
560
+ client: { type: "string" },
561
+ workspace: { type: "string" },
562
+ slot: { type: "string" },
563
+ platform: { enum: [
564
+ "ios",
565
+ "android",
566
+ "macos"
567
+ ] },
568
+ attempt: { type: "string" },
569
+ deviceType: { type: "string" },
570
+ runtime: { type: "string" },
571
+ systemImage: { type: "string" },
572
+ deviceProfile: { type: "string" },
573
+ consolePort: {
574
+ type: "integer",
575
+ minimum: 5554,
576
+ maximum: 5584,
577
+ multipleOf: 2
578
+ },
579
+ appSlot: {
580
+ type: "integer",
581
+ minimum: 1,
582
+ maximum: 64
583
+ },
584
+ state: { enum: [
585
+ "preparing",
586
+ "ready",
587
+ "stopping",
588
+ "stopped",
589
+ "unknown"
590
+ ] },
591
+ device: { anyOf: [
592
+ { type: "null" },
593
+ {
594
+ type: "object",
595
+ required: [
596
+ "udid",
597
+ "name",
598
+ "deviceTypeId",
599
+ "runtimeId",
600
+ "deviceType",
601
+ "runtime",
602
+ "architecture"
603
+ ],
604
+ additionalProperties: false,
605
+ properties: {
606
+ udid: { type: "string" },
607
+ name: { type: "string" },
608
+ deviceTypeId: { type: "string" },
609
+ runtimeId: { type: "string" },
610
+ deviceType: { type: "string" },
611
+ runtime: { type: "string" },
612
+ architecture: { enum: ["arm64", "x86_64"] }
613
+ }
614
+ },
615
+ {
616
+ type: "object",
617
+ required: [
618
+ "avdName",
619
+ "serial",
620
+ "consolePort",
621
+ "systemImage",
622
+ "deviceProfile",
623
+ "architecture"
624
+ ],
625
+ additionalProperties: false,
626
+ properties: {
627
+ avdName: { type: "string" },
628
+ serial: { type: "string" },
629
+ consolePort: {
630
+ type: "integer",
631
+ minimum: 5554,
632
+ maximum: 5584,
633
+ multipleOf: 2
634
+ },
635
+ systemImage: { type: "string" },
636
+ deviceProfile: { type: "string" },
637
+ architecture: { enum: ["arm64-v8a", "x86_64"] }
638
+ }
639
+ },
640
+ {
641
+ type: "object",
642
+ required: [
643
+ "architecture",
644
+ "macosVersion",
645
+ "appSlot"
646
+ ],
647
+ additionalProperties: false,
648
+ properties: {
649
+ architecture: { enum: ["arm64", "x86_64"] },
650
+ macosVersion: {
651
+ type: "string",
652
+ pattern: "^\\d+(\\.\\d+){0,2}$"
653
+ },
654
+ appSlot: {
655
+ type: "integer",
656
+ minimum: 1,
657
+ maximum: 64
658
+ }
659
+ }
660
+ }
661
+ ] },
662
+ createdAt: { type: "string" },
663
+ notice: { type: "string" },
664
+ appAttempt: { type: "string" },
665
+ metroPort: {
666
+ type: "integer",
667
+ minimum: 1,
668
+ maximum: 65535
669
+ }
670
+ },
671
+ oneOf: [{
672
+ required: ["appSlot"],
673
+ properties: {
674
+ platform: { const: "macos" },
675
+ device: { anyOf: [{ type: "null" }, { required: ["appSlot", "macosVersion"] }] }
676
+ }
677
+ }, {
678
+ properties: { platform: { enum: ["ios", "android"] } },
679
+ not: { required: ["appSlot"] }
680
+ }]
681
+ },
682
+ HelloParams: {
683
+ type: "object",
684
+ required: [
685
+ "protocol",
686
+ "client",
687
+ "auth"
688
+ ],
689
+ additionalProperties: false,
690
+ properties: {
691
+ protocol: { type: "integer" },
692
+ client: {
693
+ type: "object",
694
+ required: ["name", "version"],
695
+ properties: {
696
+ name: { type: "string" },
697
+ version: { type: "string" }
698
+ }
699
+ },
700
+ auth: { oneOf: [
701
+ {
702
+ type: "object",
703
+ required: ["pairingToken", "deviceName"],
704
+ additionalProperties: false,
705
+ properties: {
706
+ pairingToken: { type: "string" },
707
+ deviceName: {
708
+ type: "string",
709
+ minLength: 1
710
+ }
711
+ }
712
+ },
713
+ {
714
+ type: "object",
715
+ required: ["deviceToken"],
716
+ additionalProperties: false,
717
+ properties: { deviceToken: { type: "string" } }
718
+ },
719
+ {
720
+ type: "object",
721
+ required: ["request", "deviceName"],
722
+ additionalProperties: false,
723
+ properties: {
724
+ request: { enum: ["build", "device-host"] },
725
+ deviceName: {
726
+ type: "string",
727
+ minLength: 1
728
+ },
729
+ setupTicket: {
730
+ type: "string",
731
+ minLength: 43,
732
+ maxLength: 43,
733
+ pattern: "^[A-Za-z0-9_-]{43}$"
734
+ }
735
+ }
736
+ }
737
+ ] }
738
+ }
739
+ },
740
+ HelloResult: {
741
+ type: "object",
742
+ required: [
743
+ "protocol",
744
+ "server",
745
+ "capabilities",
746
+ "features",
747
+ "actions",
748
+ "device"
749
+ ],
750
+ additionalProperties: false,
751
+ properties: {
752
+ host: { anyOf: [{ type: "null" }, {
753
+ type: "object",
754
+ required: [
755
+ "name",
756
+ "screenRecording",
757
+ "accessibility"
758
+ ],
759
+ additionalProperties: false,
760
+ properties: {
761
+ name: { type: "string" },
762
+ screenRecording: { type: "boolean" },
763
+ accessibility: { type: "boolean" }
764
+ }
765
+ }] },
766
+ protocol: { type: "integer" },
767
+ server: {
768
+ type: "object",
769
+ required: [
770
+ "name",
771
+ "version",
772
+ "stim",
773
+ "home"
774
+ ],
775
+ additionalProperties: false,
776
+ properties: {
777
+ name: { type: "string" },
778
+ version: { type: "string" },
779
+ stim: { type: "string" },
780
+ home: { type: "string" }
781
+ }
782
+ },
783
+ capabilities: {
784
+ type: "array",
785
+ items: { enum: [...CAPABILITIES] }
786
+ },
787
+ features: {
788
+ type: "array",
789
+ items: { enum: [...FEATURES] }
790
+ },
791
+ actions: {
792
+ type: "array",
793
+ items: { enum: [...ACTIONS] }
794
+ },
795
+ device: {
796
+ type: "object",
797
+ required: ["id", "name"],
798
+ additionalProperties: false,
799
+ properties: {
800
+ id: { type: "string" },
801
+ name: { type: "string" }
802
+ }
803
+ },
804
+ deviceToken: { type: "string" },
805
+ approval: {
806
+ type: "object",
807
+ required: ["state", "expiresAt"],
808
+ additionalProperties: false,
809
+ properties: {
810
+ state: { const: "pending" },
811
+ expiresAt: { type: "string" }
812
+ }
813
+ }
814
+ }
815
+ },
816
+ LogRecord: {
817
+ type: "object",
818
+ description: "One record as `stim logs --json` prints it.",
819
+ properties: {
820
+ ts: { type: "number" },
821
+ src: { type: "string" },
822
+ level: { type: "string" },
823
+ msg: { type: "string" },
824
+ context: {
825
+ type: "array",
826
+ items: { type: "string" },
827
+ description: "With `errors`: the code frame and stack lines Expo printed after this error."
828
+ }
829
+ }
830
+ },
831
+ LogFilter: {
832
+ type: "object",
833
+ oneOf: [{ required: ["workspace"] }, { required: ["archive"] }],
834
+ additionalProperties: false,
835
+ properties: {
836
+ workspace: {
837
+ type: "string",
838
+ description: "An environment path from a status payload."
839
+ },
840
+ archive: {
841
+ type: "string",
842
+ minLength: 1,
843
+ pattern: "^(?!.*\\.\\.)[^/\\\\\\u0000]+$",
844
+ description: "An archived[].id from a status payload; omit workspace."
845
+ },
846
+ sources: {
847
+ type: "array",
848
+ minItems: 1,
849
+ items: { enum: [...LOG_SOURCES] }
850
+ },
851
+ level: { enum: [...LOG_LEVELS] },
852
+ slot: {
853
+ type: "string",
854
+ pattern: "^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$"
855
+ },
856
+ grep: {
857
+ type: "string",
858
+ pattern: "^[^\\u0000]*$",
859
+ description: "A regular expression matched against each message."
860
+ },
861
+ errors: { type: "boolean" },
862
+ tail: {
863
+ type: "integer",
864
+ minimum: 1,
865
+ maximum: MAX_LOG_TAIL,
866
+ default: MAX_LOG_TAIL
867
+ }
868
+ }
869
+ },
870
+ DeviceFrameArtwork: {
871
+ type: "object",
872
+ required: [
873
+ "width",
874
+ "height",
875
+ "aperture",
876
+ "cornerRadius",
877
+ "quarterTurns",
878
+ "background",
879
+ "foreground"
880
+ ],
881
+ additionalProperties: false,
882
+ properties: {
883
+ width: {
884
+ type: "number",
885
+ exclusiveMinimum: 0
886
+ },
887
+ height: {
888
+ type: "number",
889
+ exclusiveMinimum: 0
890
+ },
891
+ aperture: {
892
+ type: "object",
893
+ required: [
894
+ "x",
895
+ "y",
896
+ "width",
897
+ "height"
898
+ ],
899
+ additionalProperties: false,
900
+ properties: {
901
+ x: {
902
+ type: "number",
903
+ minimum: 0
904
+ },
905
+ y: {
906
+ type: "number",
907
+ minimum: 0
908
+ },
909
+ width: {
910
+ type: "number",
911
+ exclusiveMinimum: 0
912
+ },
913
+ height: {
914
+ type: "number",
915
+ exclusiveMinimum: 0
916
+ }
917
+ }
918
+ },
919
+ cornerRadius: {
920
+ type: "number",
921
+ minimum: 0
922
+ },
923
+ quarterTurns: {
924
+ type: "integer",
925
+ minimum: 0,
926
+ maximum: 3
927
+ },
928
+ background: {
929
+ type: "string",
930
+ contentEncoding: "base64"
931
+ },
932
+ foreground: {
933
+ type: "string",
934
+ contentEncoding: "base64"
935
+ }
936
+ }
937
+ },
938
+ MacosWindow: {
939
+ type: "object",
940
+ required: [
941
+ "id",
942
+ "title",
943
+ "frame"
944
+ ],
945
+ additionalProperties: false,
946
+ properties: {
947
+ id: {
948
+ type: "integer",
949
+ minimum: 0
950
+ },
951
+ title: { type: "string" },
952
+ frame: {
953
+ type: "object",
954
+ required: [
955
+ "x",
956
+ "y",
957
+ "width",
958
+ "height"
959
+ ],
960
+ additionalProperties: false,
961
+ properties: {
962
+ x: { type: "number" },
963
+ y: { type: "number" },
964
+ width: {
965
+ type: "number",
966
+ minimum: 0
967
+ },
968
+ height: {
969
+ type: "number",
970
+ minimum: 0
971
+ }
972
+ }
973
+ }
974
+ }
975
+ },
976
+ FrameTarget: {
977
+ type: "object",
978
+ required: ["platform"],
979
+ oneOf: [{
980
+ required: ["workspace"],
981
+ not: { required: ["archive"] }
982
+ }, {
983
+ required: ["archive", "at"],
984
+ not: { required: ["workspace"] },
985
+ properties: { physical: { const: false } }
986
+ }],
987
+ additionalProperties: false,
988
+ properties: {
989
+ workspace: {
990
+ type: "string",
991
+ description: "An environment path from a status payload."
992
+ },
993
+ archive: {
994
+ type: "string",
995
+ minLength: 1,
996
+ pattern: "^(?!.*\\.\\.)[^/\\\\\\u0000]+$",
997
+ description: "An archived[].id from a status payload; omit workspace."
998
+ },
999
+ platform: { enum: [...PLATFORMS] },
1000
+ slot: {
1001
+ type: "string",
1002
+ minLength: 1,
1003
+ default: "default"
1004
+ },
1005
+ physical: {
1006
+ type: "boolean",
1007
+ default: false
1008
+ },
1009
+ deviceFrame: {
1010
+ type: "boolean",
1011
+ default: false
1012
+ },
1013
+ duoFrame: {
1014
+ type: "boolean",
1015
+ default: false
1016
+ },
1017
+ fps: {
1018
+ type: "integer",
1019
+ minimum: 1,
1020
+ maximum: FRAME_FPS.video,
1021
+ default: FRAME_FPS.default,
1022
+ description: `At most ${FRAME_FPS.max} unless the result offers video.`
1023
+ },
1024
+ maxEdge: {
1025
+ type: "integer",
1026
+ minimum: FRAME_EDGE.min,
1027
+ maximum: FRAME_EDGE.max,
1028
+ default: FRAME_EDGE.default
1029
+ },
1030
+ video: {
1031
+ type: "array",
1032
+ items: { enum: [...VIDEO_CODECS] }
1033
+ },
1034
+ at: {
1035
+ type: "number",
1036
+ description: "Start replaying the footage recorded at this time; needs video."
1037
+ },
1038
+ rate: { enum: [...REPLAY_RATES] }
1039
+ }
1040
+ },
1041
+ ActionParams: { oneOf: [{
1042
+ type: "object",
1043
+ required: ["action", "workspace"],
1044
+ additionalProperties: false,
1045
+ properties: {
1046
+ action: { const: "reload" },
1047
+ workspace: {
1048
+ type: "string",
1049
+ description: "An environment path from a status payload."
1050
+ },
1051
+ platform: { enum: [...RELOAD_PLATFORMS] }
1052
+ }
1053
+ }, {
1054
+ type: "object",
1055
+ required: ["action", "workspace"],
1056
+ additionalProperties: false,
1057
+ properties: {
1058
+ action: { const: "stop" },
1059
+ workspace: {
1060
+ type: "string",
1061
+ description: "An environment path from a status payload."
1062
+ }
1063
+ }
1064
+ }] },
1065
+ ActionResult: {
1066
+ type: "object",
1067
+ required: [
1068
+ "action",
1069
+ "workspace",
1070
+ "output"
1071
+ ],
1072
+ additionalProperties: false,
1073
+ properties: {
1074
+ action: { enum: [...ACTIONS] },
1075
+ workspace: { type: "string" },
1076
+ output: {
1077
+ type: "object",
1078
+ description: "The JSON the command printed."
1079
+ }
1080
+ }
1081
+ },
1082
+ ControlBeginParams: {
1083
+ type: "object",
1084
+ required: ["workspace", "platform"],
1085
+ additionalProperties: false,
1086
+ properties: {
1087
+ workspace: {
1088
+ type: "string",
1089
+ description: "An environment path from a status payload."
1090
+ },
1091
+ platform: { enum: [...PLATFORMS] },
1092
+ slot: {
1093
+ type: "string",
1094
+ minLength: 1,
1095
+ default: "default"
1096
+ },
1097
+ physical: {
1098
+ type: "boolean",
1099
+ default: false
1100
+ },
1101
+ takeOver: {
1102
+ type: "boolean",
1103
+ default: false
1104
+ }
1105
+ }
1106
+ },
1107
+ SimulatorOptions: {
1108
+ type: "object",
1109
+ required: ["canShake", "slowAnimations"],
1110
+ additionalProperties: false,
1111
+ properties: {
1112
+ canShake: { type: "boolean" },
1113
+ slowAnimations: { type: ["boolean", "null"] }
1114
+ }
1115
+ },
1116
+ ControlBeginResult: {
1117
+ type: "object",
1118
+ required: [
1119
+ "session",
1120
+ "platform",
1121
+ "lease",
1122
+ "postures"
1123
+ ],
1124
+ additionalProperties: false,
1125
+ properties: {
1126
+ session: { type: "string" },
1127
+ platform: { enum: [...PLATFORMS] },
1128
+ lease: { oneOf: [{ type: "null" }, {
1129
+ type: "object",
1130
+ required: ["grantedAt", "expiresAt"],
1131
+ additionalProperties: false,
1132
+ properties: {
1133
+ grantedAt: {
1134
+ type: ["string", "null"],
1135
+ format: "date-time"
1136
+ },
1137
+ expiresAt: {
1138
+ type: "string",
1139
+ format: "date-time"
1140
+ }
1141
+ }
1142
+ }] },
1143
+ postures: {
1144
+ type: "array",
1145
+ items: { enum: [...DEVICE_POSTURES] },
1146
+ uniqueItems: true
1147
+ },
1148
+ simulator: { $ref: "#/$defs/SimulatorOptions" }
1149
+ }
1150
+ },
1151
+ BuildPlanParams: {
1152
+ type: "object",
1153
+ required: ["workspace", "platform"],
1154
+ additionalProperties: false,
1155
+ properties: {
1156
+ workspace: {
1157
+ type: "string",
1158
+ description: "An environment path from a status payload."
1159
+ },
1160
+ platform: { enum: ["ios", "android"] },
1161
+ slot: {
1162
+ type: "string",
1163
+ pattern: "^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$",
1164
+ default: "default"
1165
+ }
1166
+ }
1167
+ },
1168
+ WorkspaceParams: {
1169
+ type: "object",
1170
+ additionalProperties: false,
1171
+ properties: { workspace: {
1172
+ type: "string",
1173
+ description: "An environment path from a status payload."
1174
+ } }
1175
+ },
1176
+ UsageHistory: {
1177
+ type: "object",
1178
+ required: [
1179
+ "intervalMs",
1180
+ "endAt",
1181
+ "environments",
1182
+ "devices"
1183
+ ],
1184
+ additionalProperties: false,
1185
+ properties: {
1186
+ intervalMs: { type: "integer" },
1187
+ endAt: { type: "integer" },
1188
+ environments: {
1189
+ type: "array",
1190
+ items: {
1191
+ type: "object",
1192
+ required: [
1193
+ "workspace",
1194
+ "cpuPercent",
1195
+ "memoryMb"
1196
+ ],
1197
+ additionalProperties: false,
1198
+ properties: {
1199
+ workspace: { type: "string" },
1200
+ cpuPercent: {
1201
+ type: "array",
1202
+ items: { type: ["number", "null"] }
1203
+ },
1204
+ memoryMb: {
1205
+ type: "array",
1206
+ items: { type: ["number", "null"] }
1207
+ }
1208
+ }
1209
+ }
1210
+ },
1211
+ devices: {
1212
+ type: "array",
1213
+ items: {
1214
+ type: "object",
1215
+ required: [
1216
+ "kind",
1217
+ "id",
1218
+ "workspace",
1219
+ "cpuPercent",
1220
+ "memoryMb"
1221
+ ],
1222
+ additionalProperties: false,
1223
+ properties: {
1224
+ kind: { enum: ["simulator", "emulator"] },
1225
+ id: { type: "string" },
1226
+ workspace: { type: ["string", "null"] },
1227
+ slot: { type: "string" },
1228
+ cpuPercent: {
1229
+ type: "array",
1230
+ items: { type: ["number", "null"] }
1231
+ },
1232
+ memoryMb: {
1233
+ type: "array",
1234
+ items: { type: ["number", "null"] }
1235
+ }
1236
+ }
1237
+ }
1238
+ }
1239
+ }
1240
+ },
1241
+ NotificationEntry: {
1242
+ type: "object",
1243
+ required: [
1244
+ "seq",
1245
+ "at",
1246
+ "id",
1247
+ "category",
1248
+ "title",
1249
+ "body",
1250
+ "quiet",
1251
+ "target"
1252
+ ],
1253
+ additionalProperties: false,
1254
+ properties: {
1255
+ seq: {
1256
+ type: "integer",
1257
+ minimum: 1
1258
+ },
1259
+ at: {
1260
+ type: "string",
1261
+ format: "date-time"
1262
+ },
1263
+ id: { type: "string" },
1264
+ category: { enum: [...PUSH_EVENTS] },
1265
+ title: { type: "string" },
1266
+ body: { type: "string" },
1267
+ quiet: { type: "boolean" },
1268
+ target: {
1269
+ type: "object",
1270
+ required: ["kind"],
1271
+ properties: {
1272
+ kind: { enum: [
1273
+ "machine",
1274
+ "workspace",
1275
+ "device",
1276
+ "build",
1277
+ "url"
1278
+ ] },
1279
+ path: { type: "string" },
1280
+ platform: { enum: [...PLATFORMS] },
1281
+ slot: { type: "string" },
1282
+ url: { type: "string" }
1283
+ }
1284
+ },
1285
+ suppressed: { enum: [...NOTIFICATION_SUPPRESSIONS] }
1286
+ }
1287
+ },
1288
+ MachineDetails: {
1289
+ type: "object",
1290
+ required: [
1291
+ "gc",
1292
+ "stats",
1293
+ "buildMachines",
1294
+ "measuredAt"
1295
+ ],
1296
+ additionalProperties: false,
1297
+ properties: {
1298
+ gc: {
1299
+ type: ["object", "null"],
1300
+ description: "The payload of the `stim gc --json` dry run."
1301
+ },
1302
+ gcError: { type: "string" },
1303
+ stats: {
1304
+ type: ["object", "null"],
1305
+ description: "The payload of `stim stats --json`."
1306
+ },
1307
+ statsError: { type: "string" },
1308
+ buildMachines: {
1309
+ type: ["array", "null"],
1310
+ description: "`buildMachines` from `stim doctor --json --platform ios`.",
1311
+ items: { type: "object" }
1312
+ },
1313
+ buildMachinesError: { type: "string" },
1314
+ buildMachinesAt: { type: "string" },
1315
+ buildMachinesPending: { type: "boolean" },
1316
+ buildClients: {
1317
+ type: "array",
1318
+ description: "The builds this Mac ran for each client as a build machine, from the audit log.",
1319
+ items: {
1320
+ type: "object",
1321
+ required: [
1322
+ "id",
1323
+ "name",
1324
+ "builds",
1325
+ "failed",
1326
+ "buildMs",
1327
+ "today",
1328
+ "lastAt"
1329
+ ],
1330
+ additionalProperties: false,
1331
+ properties: {
1332
+ id: { type: "string" },
1333
+ name: { type: "string" },
1334
+ builds: { type: "integer" },
1335
+ failed: { type: "integer" },
1336
+ buildMs: { type: "integer" },
1337
+ today: {
1338
+ type: "object",
1339
+ required: [
1340
+ "builds",
1341
+ "failed",
1342
+ "buildMs"
1343
+ ],
1344
+ additionalProperties: false,
1345
+ properties: {
1346
+ builds: { type: "integer" },
1347
+ failed: { type: "integer" },
1348
+ buildMs: { type: "integer" }
1349
+ }
1350
+ },
1351
+ lastAt: { type: "string" }
1352
+ }
1353
+ }
1354
+ },
1355
+ measuredAt: { type: "string" }
1356
+ }
1357
+ },
1358
+ MachineHistory: {
1359
+ type: "object",
1360
+ required: ["intervalMs", "samples"],
1361
+ additionalProperties: false,
1362
+ properties: {
1363
+ intervalMs: { type: "integer" },
1364
+ samples: {
1365
+ type: "array",
1366
+ items: {
1367
+ type: "object",
1368
+ required: [
1369
+ "at",
1370
+ "cpu",
1371
+ "memoryUsedBytes",
1372
+ "memoryPressure",
1373
+ "diskFreeBytes"
1374
+ ],
1375
+ additionalProperties: false,
1376
+ properties: {
1377
+ at: { type: "integer" },
1378
+ cpu: { type: ["number", "null"] },
1379
+ memoryUsedBytes: { type: ["number", "null"] },
1380
+ memoryPressure: { enum: [
1381
+ 0,
1382
+ 1,
1383
+ 2,
1384
+ null
1385
+ ] },
1386
+ diskFreeBytes: { type: ["number", "null"] }
1387
+ }
1388
+ }
1389
+ }
1390
+ }
1391
+ },
1392
+ MachineUsage: {
1393
+ type: "object",
1394
+ required: [
1395
+ "volumes",
1396
+ "memory",
1397
+ "load",
1398
+ "cpu",
1399
+ "sampledAt"
1400
+ ],
1401
+ additionalProperties: false,
1402
+ properties: {
1403
+ volumes: {
1404
+ type: "array",
1405
+ items: {
1406
+ type: "object",
1407
+ required: [
1408
+ "mount",
1409
+ "holds",
1410
+ "freeBytes",
1411
+ "totalBytes"
1412
+ ],
1413
+ additionalProperties: false,
1414
+ properties: {
1415
+ mount: { type: "string" },
1416
+ holds: {
1417
+ type: "array",
1418
+ items: { type: "string" }
1419
+ },
1420
+ freeBytes: { type: "number" },
1421
+ totalBytes: { type: "number" }
1422
+ }
1423
+ }
1424
+ },
1425
+ memory: {
1426
+ type: "object",
1427
+ required: [
1428
+ "totalBytes",
1429
+ "usedBytes",
1430
+ "pressure"
1431
+ ],
1432
+ additionalProperties: false,
1433
+ properties: {
1434
+ totalBytes: { type: "number" },
1435
+ usedBytes: { type: ["number", "null"] },
1436
+ pressure: { enum: [
1437
+ "normal",
1438
+ "warning",
1439
+ "critical",
1440
+ null
1441
+ ] }
1442
+ }
1443
+ },
1444
+ load: {
1445
+ type: "object",
1446
+ required: [
1447
+ "avg1",
1448
+ "avg5",
1449
+ "avg15",
1450
+ "cpus"
1451
+ ],
1452
+ additionalProperties: false,
1453
+ properties: {
1454
+ avg1: { type: "number" },
1455
+ avg5: { type: "number" },
1456
+ avg15: { type: "number" },
1457
+ cpus: { type: "integer" }
1458
+ }
1459
+ },
1460
+ cpu: {
1461
+ type: "object",
1462
+ required: ["usage", "cores"],
1463
+ additionalProperties: false,
1464
+ properties: {
1465
+ usage: { type: ["number", "null"] },
1466
+ cores: { type: "integer" }
1467
+ }
1468
+ },
1469
+ sampledAt: {
1470
+ type: "string",
1471
+ format: "date-time"
1472
+ }
1473
+ }
1474
+ },
1475
+ ClientRequest: { oneOf: [
1476
+ request("device-host.offer", {
1477
+ type: "object",
1478
+ required: ["platform"],
1479
+ additionalProperties: false,
1480
+ properties: {
1481
+ platform: { enum: [
1482
+ "ios",
1483
+ "android",
1484
+ "macos"
1485
+ ] },
1486
+ deviceType: {
1487
+ type: "string",
1488
+ minLength: 1,
1489
+ maxLength: 256
1490
+ },
1491
+ runtime: {
1492
+ type: "string",
1493
+ minLength: 1,
1494
+ maxLength: 256
1495
+ },
1496
+ systemImage: {
1497
+ type: "string",
1498
+ minLength: 1,
1499
+ maxLength: 256
1500
+ },
1501
+ deviceProfile: {
1502
+ type: "string",
1503
+ minLength: 1,
1504
+ maxLength: 256
1505
+ }
1506
+ },
1507
+ oneOf: [
1508
+ {
1509
+ properties: { platform: { const: "ios" } },
1510
+ not: { anyOf: [{ required: ["systemImage"] }, { required: ["deviceProfile"] }] }
1511
+ },
1512
+ {
1513
+ properties: { platform: { const: "android" } },
1514
+ not: { anyOf: [{ required: ["deviceType"] }, { required: ["runtime"] }] }
1515
+ },
1516
+ {
1517
+ properties: { platform: { const: "macos" } },
1518
+ not: { anyOf: [
1519
+ { required: ["deviceType"] },
1520
+ { required: ["runtime"] },
1521
+ { required: ["systemImage"] },
1522
+ { required: ["deviceProfile"] }
1523
+ ] }
1524
+ }
1525
+ ]
1526
+ }),
1527
+ request("device-host.reserve", {
1528
+ type: "object",
1529
+ required: [
1530
+ "workspace",
1531
+ "slot",
1532
+ "platform",
1533
+ "attempt"
1534
+ ],
1535
+ additionalProperties: false,
1536
+ properties: {
1537
+ workspace: {
1538
+ type: "string",
1539
+ minLength: 1,
1540
+ maxLength: 4096
1541
+ },
1542
+ slot: {
1543
+ type: "string",
1544
+ pattern: "^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$"
1545
+ },
1546
+ platform: { enum: [
1547
+ "ios",
1548
+ "android",
1549
+ "macos"
1550
+ ] },
1551
+ attempt: {
1552
+ type: "string",
1553
+ pattern: "^[a-zA-Z0-9_-]{1,128}$"
1554
+ },
1555
+ deviceType: {
1556
+ type: "string",
1557
+ minLength: 1,
1558
+ maxLength: 256
1559
+ },
1560
+ runtime: {
1561
+ type: "string",
1562
+ minLength: 1,
1563
+ maxLength: 256
1564
+ },
1565
+ systemImage: {
1566
+ type: "string",
1567
+ minLength: 1,
1568
+ maxLength: 256
1569
+ },
1570
+ deviceProfile: {
1571
+ type: "string",
1572
+ minLength: 1,
1573
+ maxLength: 256
1574
+ }
1575
+ },
1576
+ oneOf: [
1577
+ {
1578
+ properties: { platform: { const: "ios" } },
1579
+ not: { anyOf: [{ required: ["systemImage"] }, { required: ["deviceProfile"] }] }
1580
+ },
1581
+ {
1582
+ properties: { platform: { const: "android" } },
1583
+ not: { anyOf: [{ required: ["deviceType"] }, { required: ["runtime"] }] }
1584
+ },
1585
+ {
1586
+ properties: { platform: { const: "macos" } },
1587
+ not: { anyOf: [
1588
+ { required: ["deviceType"] },
1589
+ { required: ["runtime"] },
1590
+ { required: ["systemImage"] },
1591
+ { required: ["deviceProfile"] }
1592
+ ] }
1593
+ }
1594
+ ]
1595
+ }),
1596
+ request("device-host.attach", { oneOf: [{
1597
+ type: "object",
1598
+ required: ["session"],
1599
+ additionalProperties: false,
1600
+ properties: { session: { type: "string" } }
1601
+ }, {
1602
+ type: "object",
1603
+ required: ["attempt"],
1604
+ additionalProperties: false,
1605
+ properties: { attempt: { type: "string" } }
1606
+ }] }),
1607
+ request("device-host.stop", session({})),
1608
+ request("device-host.app.offer", session({
1609
+ attempt: {
1610
+ type: "string",
1611
+ pattern: "^[a-zA-Z0-9_-]{1,128}$"
1612
+ },
1613
+ bundleId: { type: "string" },
1614
+ mode: { enum: ["development", "release"] },
1615
+ devClientScheme: {
1616
+ type: "string",
1617
+ pattern: "^[a-zA-Z][a-zA-Z0-9+.-]{0,127}$"
1618
+ },
1619
+ arguments: {
1620
+ type: "array",
1621
+ maxItems: 32,
1622
+ items: {
1623
+ type: "string",
1624
+ maxLength: 1024,
1625
+ pattern: "^[^\\u0000\\r\\n]*$"
1626
+ }
1627
+ },
1628
+ manifest: {
1629
+ type: "object",
1630
+ required: ["sha256", "size"],
1631
+ additionalProperties: false,
1632
+ properties: {
1633
+ sha256,
1634
+ size: {
1635
+ type: "integer",
1636
+ minimum: 1,
1637
+ maximum: 8 * 1024 ** 2
1638
+ }
1639
+ }
1640
+ }
1641
+ }, [
1642
+ "attempt",
1643
+ "bundleId",
1644
+ "mode",
1645
+ "manifest"
1646
+ ])),
1647
+ request("device-host.app.chunk", session({
1648
+ attempt: { type: "string" },
1649
+ sha256,
1650
+ offset: {
1651
+ type: "integer",
1652
+ minimum: 0
1653
+ },
1654
+ data: {
1655
+ type: "string",
1656
+ maxLength: 43692
1657
+ }
1658
+ }, [
1659
+ "attempt",
1660
+ "sha256",
1661
+ "offset",
1662
+ "data"
1663
+ ])),
1664
+ request("device-host.app.handoff", session({
1665
+ attempt: { type: "string" },
1666
+ build: {
1667
+ type: "object",
1668
+ required: ["handoff", "sha256"],
1669
+ additionalProperties: false,
1670
+ properties: {
1671
+ handoff: sha256,
1672
+ sha256
1673
+ }
1674
+ }
1675
+ }, ["attempt", "build"])),
1676
+ request("device-host.app.launch", session({ attempt: { type: "string" } }, ["attempt"])),
1677
+ request("device-host.app.attach", session({ attempt: { type: "string" } }, ["attempt"])),
1678
+ request("device-host.logs.query", session({ cursor: {
1679
+ type: "object",
1680
+ maxProperties: 16,
1681
+ additionalProperties: {
1682
+ type: "integer",
1683
+ minimum: 0
1684
+ }
1685
+ } })),
1686
+ request("device-host.metro.open", session({
1687
+ gatewayPort: {
1688
+ type: "integer",
1689
+ minimum: 1,
1690
+ maximum: 65535
1691
+ },
1692
+ secret: {
1693
+ type: "string",
1694
+ pattern: "^[a-f0-9]{64}$"
1695
+ }
1696
+ }, ["gatewayPort", "secret"])),
1697
+ request("device-host.metro.close", session({})),
1698
+ request("device-host.frames.subscribe", session({
1699
+ fps: {
1700
+ type: "integer",
1701
+ minimum: 1,
1702
+ maximum: FRAME_FPS.video
1703
+ },
1704
+ maxEdge: {
1705
+ type: "integer",
1706
+ minimum: FRAME_EDGE.min,
1707
+ maximum: FRAME_EDGE.max
1708
+ },
1709
+ video: {
1710
+ type: "array",
1711
+ items: { type: "string" }
1712
+ },
1713
+ deviceFrame: { type: "boolean" }
1714
+ })),
1715
+ request("device-host.frames.keyframe", {
1716
+ type: "object",
1717
+ required: ["subscription"],
1718
+ additionalProperties: false,
1719
+ properties: { subscription: { type: "string" } }
1720
+ }),
1721
+ request("device-host.frames.congested", {
1722
+ type: "object",
1723
+ required: ["subscription"],
1724
+ additionalProperties: false,
1725
+ properties: { subscription: { type: "string" } }
1726
+ }),
1727
+ request("device-host.unsubscribe", {
1728
+ type: "object",
1729
+ required: ["subscription"],
1730
+ additionalProperties: false,
1731
+ properties: { subscription: { type: "string" } }
1732
+ }),
1733
+ request("device-host.control.begin", session({ takeOver: { type: "boolean" } })),
1734
+ request("device-host.control.end", session({})),
1735
+ request("device-host.input.touch", session({
1736
+ phase: { enum: [...TOUCH_PHASES] },
1737
+ x: {
1738
+ type: "number",
1739
+ minimum: 0,
1740
+ maximum: 1
1741
+ },
1742
+ y: {
1743
+ type: "number",
1744
+ minimum: 0,
1745
+ maximum: 1
1746
+ },
1747
+ display: {
1748
+ type: "integer",
1749
+ minimum: 0,
1750
+ maximum: 3
1751
+ },
1752
+ duoRevision: {
1753
+ type: "string",
1754
+ format: "uuid"
1755
+ }
1756
+ }, [
1757
+ "phase",
1758
+ "x",
1759
+ "y"
1760
+ ])),
1761
+ request("device-host.input.text", session({ text: {
1762
+ type: "string",
1763
+ minLength: 1,
1764
+ maxLength: MAX_INPUT_TEXT,
1765
+ pattern: "^[\\x20-\\x7e\\n\\t\\b]+$"
1766
+ } }, ["text"])),
1767
+ request("device-host.input.scroll", session({
1768
+ x: {
1769
+ type: "number",
1770
+ minimum: 0,
1771
+ maximum: 1
1772
+ },
1773
+ y: {
1774
+ type: "number",
1775
+ minimum: 0,
1776
+ maximum: 1
1777
+ },
1778
+ deltaX: {
1779
+ type: "number",
1780
+ minimum: -1e3,
1781
+ maximum: 1e3
1782
+ },
1783
+ deltaY: {
1784
+ type: "number",
1785
+ minimum: -1e3,
1786
+ maximum: 1e3
1787
+ }
1788
+ }, [
1789
+ "x",
1790
+ "y",
1791
+ "deltaX",
1792
+ "deltaY"
1793
+ ])),
1794
+ request("device-host.input.key", session({
1795
+ key: { enum: [...INPUT_KEYS] },
1796
+ modifiers: {
1797
+ type: "array",
1798
+ maxItems: 4,
1799
+ uniqueItems: true,
1800
+ items: { enum: [...KEY_MODIFIERS] }
1801
+ }
1802
+ }, ["key"])),
1803
+ request("device-host.input.window", session({ window: { oneOf: [{ type: "null" }, {
1804
+ type: "integer",
1805
+ minimum: 0,
1806
+ maximum: 4294967295
1807
+ }] } }, ["window"])),
1808
+ request("device-host.input.button", session({ button: { enum: [...INPUT_BUTTONS] } }, ["button"])),
1809
+ request("device-host.input.rotate", session({ direction: { enum: [...ROTATE_DIRECTIONS] } }, ["direction"])),
1810
+ request("device-host.input.posture", session({ posture: { enum: [...DEVICE_POSTURES] } }, ["posture"])),
1811
+ request("hello", { $ref: "#/$defs/HelloParams" }),
1812
+ optionalParams("route.setup", {
1813
+ type: "object",
1814
+ maxProperties: 0
1815
+ }),
1816
+ request("status.subscribe"),
1817
+ request("logs.query", { $ref: "#/$defs/LogFilter" }),
1818
+ request("logs.subscribe", { $ref: "#/$defs/LogFilter" }),
1819
+ request("frames.subscribe", { $ref: "#/$defs/FrameTarget" }),
1820
+ request("frames.keyframe", {
1821
+ type: "object",
1822
+ required: ["subscription"],
1823
+ additionalProperties: false,
1824
+ properties: { subscription: { type: "string" } }
1825
+ }),
1826
+ request("frames.seek", {
1827
+ type: "object",
1828
+ required: [
1829
+ "subscription",
1830
+ "at",
1831
+ "rate"
1832
+ ],
1833
+ additionalProperties: false,
1834
+ properties: {
1835
+ subscription: { type: "string" },
1836
+ at: {
1837
+ type: "number",
1838
+ description: "Epoch milliseconds on the Mac clock."
1839
+ },
1840
+ rate: { enum: [...REPLAY_RATES] }
1841
+ }
1842
+ }),
1843
+ request("frames.live", {
1844
+ type: "object",
1845
+ required: ["subscription"],
1846
+ additionalProperties: false,
1847
+ properties: { subscription: { type: "string" } }
1848
+ }),
1849
+ request("replay.range", {
1850
+ type: "object",
1851
+ required: ["platform"],
1852
+ oneOf: [{ required: ["workspace"] }, { required: ["archive"] }],
1853
+ additionalProperties: false,
1854
+ properties: {
1855
+ workspace: { type: "string" },
1856
+ archive: {
1857
+ type: "string",
1858
+ minLength: 1,
1859
+ pattern: "^(?!.*\\.\\.)[^/\\\\\\u0000]+$"
1860
+ },
1861
+ platform: { enum: [...RELOAD_PLATFORMS] },
1862
+ slot: {
1863
+ type: "string",
1864
+ minLength: 1
1865
+ }
1866
+ }
1867
+ }),
1868
+ request("replay.keyframe", {
1869
+ type: "object",
1870
+ required: ["platform", "at"],
1871
+ oneOf: [{ required: ["workspace"] }, { required: ["archive"] }],
1872
+ additionalProperties: false,
1873
+ properties: {
1874
+ workspace: { type: "string" },
1875
+ archive: {
1876
+ type: "string",
1877
+ minLength: 1,
1878
+ pattern: "^(?!.*\\.\\.)[^/\\\\\\u0000]+$"
1879
+ },
1880
+ platform: { enum: [...RELOAD_PLATFORMS] },
1881
+ slot: {
1882
+ type: "string",
1883
+ minLength: 1
1884
+ },
1885
+ at: {
1886
+ type: "number",
1887
+ description: "Epoch milliseconds on the Mac clock."
1888
+ }
1889
+ }
1890
+ }),
1891
+ request("recording.set", {
1892
+ type: "object",
1893
+ required: ["enabled"],
1894
+ additionalProperties: false,
1895
+ properties: { enabled: { type: "boolean" } }
1896
+ }),
1897
+ request("build.plan", { $ref: "#/$defs/BuildPlanParams" }),
1898
+ request("machine.get"),
1899
+ optionalParams("machine.history", {
1900
+ type: "object",
1901
+ additionalProperties: false,
1902
+ properties: { sinceMs: { type: "number" } }
1903
+ }),
1904
+ request("machine.details"),
1905
+ optionalParams("stats.get", { $ref: "#/$defs/WorkspaceParams" }),
1906
+ optionalParams("settings.get", { $ref: "#/$defs/WorkspaceParams" }),
1907
+ request("workspace.files", {
1908
+ type: "object",
1909
+ required: ["workspace", "group"],
1910
+ additionalProperties: false,
1911
+ properties: {
1912
+ workspace: {
1913
+ type: "string",
1914
+ minLength: 1,
1915
+ maxLength: 4096
1916
+ },
1917
+ group: { enum: ["changed", "untracked"] }
1918
+ }
1919
+ }),
1920
+ request("workspace.diff", {
1921
+ type: "object",
1922
+ required: ["workspace", "path"],
1923
+ additionalProperties: false,
1924
+ properties: {
1925
+ workspace: {
1926
+ type: "string",
1927
+ minLength: 1,
1928
+ maxLength: 4096
1929
+ },
1930
+ path: {
1931
+ type: "string",
1932
+ minLength: 1,
1933
+ maxLength: 4096
1934
+ }
1935
+ }
1936
+ }),
1937
+ request("unsubscribe", {
1938
+ type: "object",
1939
+ required: ["subscription"],
1940
+ additionalProperties: false,
1941
+ properties: { subscription: { type: "string" } }
1942
+ }),
1943
+ request("action", { $ref: "#/$defs/ActionParams" }),
1944
+ request("control.begin", { $ref: "#/$defs/ControlBeginParams" }),
1945
+ request("control.end", session({})),
1946
+ request("input.touch", session({
1947
+ phase: { enum: [...TOUCH_PHASES] },
1948
+ x: {
1949
+ type: "number",
1950
+ minimum: 0,
1951
+ maximum: 1
1952
+ },
1953
+ y: {
1954
+ type: "number",
1955
+ minimum: 0,
1956
+ maximum: 1
1957
+ },
1958
+ display: {
1959
+ type: "integer",
1960
+ minimum: 0,
1961
+ maximum: 3
1962
+ }
1963
+ }, [
1964
+ "phase",
1965
+ "x",
1966
+ "y"
1967
+ ])),
1968
+ request("input.text", session({ text: {
1969
+ type: "string",
1970
+ minLength: 1,
1971
+ maxLength: MAX_INPUT_TEXT,
1972
+ pattern: "^[\\x20-\\x7e\\n\\t\\b]+$"
1973
+ } }, ["text"])),
1974
+ request("input.scroll", session({
1975
+ x: {
1976
+ type: "number",
1977
+ minimum: 0,
1978
+ maximum: 1
1979
+ },
1980
+ y: {
1981
+ type: "number",
1982
+ minimum: 0,
1983
+ maximum: 1
1984
+ },
1985
+ deltaX: {
1986
+ type: "number",
1987
+ minimum: -1e3,
1988
+ maximum: 1e3
1989
+ },
1990
+ deltaY: {
1991
+ type: "number",
1992
+ minimum: -1e3,
1993
+ maximum: 1e3
1994
+ }
1995
+ }, [
1996
+ "x",
1997
+ "y",
1998
+ "deltaX",
1999
+ "deltaY"
2000
+ ])),
2001
+ request("input.key", session({
2002
+ key: { enum: [...INPUT_KEYS] },
2003
+ modifiers: {
2004
+ type: "array",
2005
+ maxItems: 4,
2006
+ uniqueItems: true,
2007
+ items: { enum: [...KEY_MODIFIERS] }
2008
+ }
2009
+ }, ["key"])),
2010
+ request("input.window", session({ window: { oneOf: [{ type: "null" }, {
2011
+ type: "integer",
2012
+ minimum: 0,
2013
+ maximum: 4294967295
2014
+ }] } }, ["window"])),
2015
+ request("input.button", session({ button: { enum: [...INPUT_BUTTONS] } }, ["button"])),
2016
+ request("input.rotate", session({ direction: { enum: [...ROTATE_DIRECTIONS] } }, ["direction"])),
2017
+ request("input.posture", session({ posture: { enum: [...DEVICE_POSTURES] } }, ["posture"])),
2018
+ request("input.simulator", { oneOf: [session({ action: { enum: ["read", "shake"] } }, ["action"]), session({
2019
+ action: { const: "slow-animations" },
2020
+ enabled: { type: "boolean" }
2021
+ }, ["action", "enabled"])] }),
2022
+ request("push.register", {
2023
+ type: "object",
2024
+ required: [
2025
+ "token",
2026
+ "events",
2027
+ "ref"
2028
+ ],
2029
+ additionalProperties: false,
2030
+ properties: {
2031
+ token: {
2032
+ type: "string",
2033
+ pattern: PUSH_TOKEN_PATTERN,
2034
+ description: "An Expo push token."
2035
+ },
2036
+ events: {
2037
+ type: "array",
2038
+ minItems: 1,
2039
+ uniqueItems: true,
2040
+ items: { enum: [...PUSH_EVENTS, ...LEGACY_PUSH_EVENTS] }
2041
+ },
2042
+ levels: {
2043
+ type: "object",
2044
+ additionalProperties: false,
2045
+ properties: Object.fromEntries(PUSH_EVENTS.map((event) => [event, { enum: [...NOTIFICATION_LEVELS] }]))
2046
+ },
2047
+ agentOnly: {
2048
+ type: "boolean",
2049
+ default: false
2050
+ },
2051
+ ref: {
2052
+ type: "string",
2053
+ minLength: 1,
2054
+ maxLength: 128
2055
+ },
2056
+ stuckMinutes: {
2057
+ type: "integer",
2058
+ minimum: 1,
2059
+ maximum: 240,
2060
+ default: 15
2061
+ },
2062
+ quietHours: {
2063
+ type: "object",
2064
+ required: [
2065
+ "start",
2066
+ "end",
2067
+ "timeZone"
2068
+ ],
2069
+ additionalProperties: false,
2070
+ properties: {
2071
+ start: {
2072
+ type: "integer",
2073
+ minimum: 0,
2074
+ maximum: 1439
2075
+ },
2076
+ end: {
2077
+ type: "integer",
2078
+ minimum: 0,
2079
+ maximum: 1439
2080
+ },
2081
+ timeZone: {
2082
+ type: "string",
2083
+ minLength: 1,
2084
+ maxLength: 64,
2085
+ description: "An IANA time zone."
2086
+ }
2087
+ }
2088
+ }
2089
+ }
2090
+ }),
2091
+ request("push.unregister"),
2092
+ request("notifications.list", {
2093
+ type: "object",
2094
+ additionalProperties: false,
2095
+ properties: { since: {
2096
+ type: "integer",
2097
+ minimum: 0
2098
+ } }
2099
+ }),
2100
+ request("build.offer", {
2101
+ type: "object",
2102
+ required: ["repo"],
2103
+ additionalProperties: false,
2104
+ properties: {
2105
+ repo: buildRepo,
2106
+ lockfile: sha256
2107
+ }
2108
+ }),
2109
+ request("build.sync", {
2110
+ type: "object",
2111
+ required: [
2112
+ "repo",
2113
+ "files",
2114
+ "done"
2115
+ ],
2116
+ additionalProperties: false,
2117
+ properties: {
2118
+ repo: buildRepo,
2119
+ files: {
2120
+ type: "array",
2121
+ items: {
2122
+ type: "object",
2123
+ required: [
2124
+ "path",
2125
+ "kind",
2126
+ "size",
2127
+ "sha256"
2128
+ ],
2129
+ additionalProperties: false,
2130
+ properties: {
2131
+ path: {
2132
+ type: "string",
2133
+ minLength: 1
2134
+ },
2135
+ kind: { enum: [
2136
+ "file",
2137
+ "exec",
2138
+ "link"
2139
+ ] },
2140
+ size: {
2141
+ type: "integer",
2142
+ minimum: 0
2143
+ },
2144
+ sha256
2145
+ }
2146
+ }
2147
+ },
2148
+ done: { type: "boolean" }
2149
+ }
2150
+ }),
2151
+ request("build.start", {
2152
+ type: "object",
2153
+ required: [
2154
+ "repo",
2155
+ "project",
2156
+ "platform",
2157
+ "fingerprint",
2158
+ "stimBuild"
2159
+ ],
2160
+ additionalProperties: false,
2161
+ oneOf: [{
2162
+ properties: {
2163
+ platform: { const: "macos" },
2164
+ macos: { type: "object" }
2165
+ },
2166
+ required: ["macos"]
2167
+ }, {
2168
+ properties: { platform: { enum: ["ios", "android"] } },
2169
+ required: [
2170
+ "configuration",
2171
+ "scheme",
2172
+ "runtime",
2173
+ "packageName",
2174
+ "isExpo",
2175
+ "optimizations"
2176
+ ]
2177
+ }],
2178
+ properties: {
2179
+ repo: buildRepo,
2180
+ project: {
2181
+ type: "string",
2182
+ description: "The app directory relative to the repository root."
2183
+ },
2184
+ platform: { enum: [
2185
+ "ios",
2186
+ "android",
2187
+ "macos"
2188
+ ] },
2189
+ configuration: { type: ["string", "null"] },
2190
+ scheme: { type: ["string", "null"] },
2191
+ runtime: {
2192
+ type: ["string", "null"],
2193
+ minLength: 1
2194
+ },
2195
+ fingerprint: {
2196
+ type: "string",
2197
+ minLength: 1
2198
+ },
2199
+ packageName: { type: ["string", "null"] },
2200
+ isExpo: { type: "boolean" },
2201
+ optimizations: { type: ["object", "null"] },
2202
+ android: {
2203
+ type: ["object", "null"],
2204
+ required: [
2205
+ "variant",
2206
+ "abi",
2207
+ "gradleBuildCache",
2208
+ "pch",
2209
+ "compilerCache"
2210
+ ],
2211
+ additionalProperties: false,
2212
+ properties: {
2213
+ variant: { type: ["string", "null"] },
2214
+ abi: { type: ["string", "null"] },
2215
+ gradleBuildCache: { type: "boolean" },
2216
+ pch: { enum: [
2217
+ "auto",
2218
+ "on",
2219
+ "off"
2220
+ ] },
2221
+ compilerCache: { enum: ["ccache", "none"] }
2222
+ }
2223
+ },
2224
+ macos: {
2225
+ type: ["object", "null"],
2226
+ required: [
2227
+ "product",
2228
+ "infoPlist",
2229
+ "bundleId"
2230
+ ],
2231
+ additionalProperties: false,
2232
+ properties: {
2233
+ product: {
2234
+ type: "string",
2235
+ pattern: "^[A-Za-z0-9_.-]{1,100}$"
2236
+ },
2237
+ infoPlist: {
2238
+ type: "string",
2239
+ minLength: 1
2240
+ },
2241
+ bundleId: {
2242
+ type: "string",
2243
+ pattern: "^[A-Za-z0-9][A-Za-z0-9.-]{0,199}$"
2244
+ },
2245
+ resources: {
2246
+ type: "object",
2247
+ maxProperties: 256,
2248
+ additionalProperties: { type: "string" }
2249
+ },
2250
+ assetCatalog: {
2251
+ type: ["string", "null"],
2252
+ minLength: 1
2253
+ }
2254
+ }
2255
+ },
2256
+ stimBuild: {
2257
+ type: "string",
2258
+ minLength: 1
2259
+ }
2260
+ }
2261
+ }),
2262
+ request("build.cancel", buildJob),
2263
+ request("build.artifact", buildJob),
2264
+ request("build.attach", buildJob),
2265
+ request("server.update.status"),
2266
+ request("machines.update.start", {
2267
+ type: "object",
2268
+ required: ["machine"],
2269
+ additionalProperties: false,
2270
+ properties: { machine: {
2271
+ type: "string",
2272
+ minLength: 1
2273
+ } }
2274
+ }),
2275
+ request("machines.update.status", {
2276
+ type: "object",
2277
+ required: ["machine"],
2278
+ additionalProperties: false,
2279
+ properties: { machine: {
2280
+ type: "string",
2281
+ minLength: 1
2282
+ } }
2283
+ }),
2284
+ request("server.update.start", { oneOf: [{
2285
+ type: "object",
2286
+ required: ["release"],
2287
+ additionalProperties: false,
2288
+ properties: { release: {
2289
+ type: "string",
2290
+ pattern: "^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$"
2291
+ } }
2292
+ }, {
2293
+ type: "object",
2294
+ required: ["packages"],
2295
+ additionalProperties: false,
2296
+ properties: { packages: {
2297
+ type: "array",
2298
+ minItems: 1,
2299
+ maxItems: 8,
2300
+ items: {
2301
+ type: "object",
2302
+ required: [
2303
+ "name",
2304
+ "size",
2305
+ "sha256"
2306
+ ],
2307
+ additionalProperties: false,
2308
+ properties: {
2309
+ name: {
2310
+ type: "string",
2311
+ pattern: "^[A-Za-z0-9][A-Za-z0-9._-]{0,127}\\.tgz$"
2312
+ },
2313
+ size: {
2314
+ type: "integer",
2315
+ minimum: 1,
2316
+ maximum: 64 * 1024 ** 2
2317
+ },
2318
+ sha256
2319
+ }
2320
+ }
2321
+ } }
2322
+ }] }),
2323
+ request("server.update.chunk", {
2324
+ type: "object",
2325
+ required: [
2326
+ "id",
2327
+ "name",
2328
+ "offset",
2329
+ "data"
2330
+ ],
2331
+ additionalProperties: false,
2332
+ properties: {
2333
+ id: { type: "string" },
2334
+ name: { type: "string" },
2335
+ offset: {
2336
+ type: "integer",
2337
+ minimum: 0
2338
+ },
2339
+ data: {
2340
+ type: "string",
2341
+ maxLength: 32768
2342
+ }
2343
+ }
2344
+ })
2345
+ ] },
2346
+ ServerResponse: { oneOf: [{
2347
+ type: "object",
2348
+ required: ["id", "result"],
2349
+ additionalProperties: false,
2350
+ properties: {
2351
+ id: requestId,
2352
+ result: { anyOf: [
2353
+ { $ref: "#/$defs/HostedDeviceOffer" },
2354
+ { $ref: "#/$defs/HostedDeviceSession" },
2355
+ { $ref: "#/$defs/HostedAppDelivery" },
2356
+ { $ref: "#/$defs/HostedMetroResult" },
2357
+ { $ref: "#/$defs/HostedAppOfferResult" },
2358
+ { $ref: "#/$defs/HostedAppChunkResult" },
2359
+ { $ref: "#/$defs/HostedAppHandoffResult" },
2360
+ { $ref: "#/$defs/ServerUpdateStatus" },
2361
+ { $ref: "#/$defs/ServerUpdateProgress" },
2362
+ { $ref: "#/$defs/MachineUpdateStatus" },
2363
+ { $ref: "#/$defs/HelloResult" },
2364
+ { $ref: "#/$defs/ControlBeginResult" },
2365
+ { $ref: "#/$defs/SimulatorOptions" },
2366
+ { $ref: "#/$defs/ActionResult" },
2367
+ { $ref: "#/$defs/MachineUsage" },
2368
+ { $ref: "#/$defs/MachineHistory" },
2369
+ { $ref: "#/$defs/MachineDetails" },
2370
+ {
2371
+ type: "object",
2372
+ required: [
2373
+ "log",
2374
+ "cursor",
2375
+ "notifications"
2376
+ ],
2377
+ additionalProperties: false,
2378
+ properties: {
2379
+ log: { type: "string" },
2380
+ cursor: { type: "integer" },
2381
+ notifications: {
2382
+ type: "array",
2383
+ items: { $ref: "#/$defs/NotificationEntry" }
2384
+ }
2385
+ }
2386
+ },
2387
+ {
2388
+ type: "object",
2389
+ required: ["at"],
2390
+ additionalProperties: false,
2391
+ properties: { at: { type: "number" } }
2392
+ },
2393
+ {
2394
+ type: "object",
2395
+ required: [
2396
+ "enabled",
2397
+ "recording",
2398
+ "spans",
2399
+ "markers"
2400
+ ],
2401
+ additionalProperties: false,
2402
+ properties: {
2403
+ enabled: { type: "boolean" },
2404
+ recording: { type: "boolean" },
2405
+ spans: {
2406
+ type: "array",
2407
+ items: {
2408
+ type: "object",
2409
+ required: ["start", "end"],
2410
+ additionalProperties: false,
2411
+ properties: {
2412
+ start: { type: "number" },
2413
+ end: { type: "number" }
2414
+ }
2415
+ }
2416
+ },
2417
+ markers: {
2418
+ type: "array",
2419
+ items: {
2420
+ type: "object",
2421
+ required: [
2422
+ "at",
2423
+ "kind",
2424
+ "label"
2425
+ ],
2426
+ additionalProperties: false,
2427
+ properties: {
2428
+ at: { type: "number" },
2429
+ kind: { enum: [...REPLAY_MARKER_KINDS] },
2430
+ command: { type: "string" },
2431
+ label: { type: "string" }
2432
+ }
2433
+ }
2434
+ }
2435
+ }
2436
+ },
2437
+ {
2438
+ type: "object",
2439
+ required: [
2440
+ "start",
2441
+ "end",
2442
+ "at",
2443
+ "width",
2444
+ "height",
2445
+ "data"
2446
+ ],
2447
+ additionalProperties: false,
2448
+ properties: {
2449
+ start: { type: "number" },
2450
+ end: { type: "number" },
2451
+ at: { type: "number" },
2452
+ width: { type: "integer" },
2453
+ height: { type: "integer" },
2454
+ posture: { enum: ["folded", "unfolded"] },
2455
+ data: {
2456
+ type: "string",
2457
+ contentEncoding: "base64",
2458
+ description: "One Annex-B H.264 access unit."
2459
+ }
2460
+ }
2461
+ },
2462
+ {
2463
+ type: "object",
2464
+ required: ["enabled", "recordingsDeleted"],
2465
+ additionalProperties: false,
2466
+ properties: {
2467
+ enabled: { type: "boolean" },
2468
+ recordingsDeleted: {
2469
+ type: "array",
2470
+ items: { type: "string" }
2471
+ }
2472
+ }
2473
+ },
2474
+ {
2475
+ type: "object",
2476
+ required: ["subscription"],
2477
+ additionalProperties: false,
2478
+ properties: {
2479
+ subscription: { type: "string" },
2480
+ video: { enum: [...VIDEO_CODECS] }
2481
+ }
2482
+ },
2483
+ {
2484
+ type: "object",
2485
+ required: ["records"],
2486
+ additionalProperties: false,
2487
+ properties: { records: {
2488
+ type: "array",
2489
+ items: { $ref: "#/$defs/LogRecord" }
2490
+ } }
2491
+ },
2492
+ {
2493
+ type: "object",
2494
+ description: "The payload of `stim stats --json`, `stim settings --json` or `stim ios|android --plan --json`, or {} for unsubscribe."
2495
+ }
2496
+ ] }
2497
+ }
2498
+ }, {
2499
+ type: "object",
2500
+ required: ["id", "error"],
2501
+ additionalProperties: false,
2502
+ properties: {
2503
+ id: { type: [
2504
+ "integer",
2505
+ "string",
2506
+ "null"
2507
+ ] },
2508
+ error: { $ref: "#/$defs/ProtocolError" }
2509
+ }
2510
+ }] },
2511
+ ServerEvent: { oneOf: [
2512
+ {
2513
+ type: "object",
2514
+ required: [
2515
+ "event",
2516
+ "subscription",
2517
+ "current",
2518
+ "windows",
2519
+ "pinned"
2520
+ ],
2521
+ additionalProperties: false,
2522
+ properties: {
2523
+ event: { const: "macos-windows" },
2524
+ subscription: { type: "string" },
2525
+ current: { oneOf: [{ type: "null" }, { $ref: "#/$defs/MacosWindow" }] },
2526
+ windows: {
2527
+ type: "array",
2528
+ items: { $ref: "#/$defs/MacosWindow" }
2529
+ },
2530
+ pinned: { type: "boolean" }
2531
+ }
2532
+ },
2533
+ {
2534
+ type: "object",
2535
+ required: [
2536
+ "event",
2537
+ "subscription",
2538
+ "artwork"
2539
+ ],
2540
+ additionalProperties: false,
2541
+ properties: {
2542
+ event: { const: "device-frame" },
2543
+ platform: { enum: [...PLATFORMS] },
2544
+ slot: { type: "string" },
2545
+ subscription: { type: "string" },
2546
+ artwork: { oneOf: [{ type: "null" }, { $ref: "#/$defs/DeviceFrameArtwork" }] }
2547
+ }
2548
+ },
2549
+ {
2550
+ type: "object",
2551
+ required: ["event", "job"],
2552
+ additionalProperties: false,
2553
+ properties: {
2554
+ event: { const: "build.progress" },
2555
+ job: { type: "string" },
2556
+ phase: { type: "string" },
2557
+ msg: { type: "string" },
2558
+ record: { type: "object" },
2559
+ outcome: {
2560
+ type: "object",
2561
+ required: ["ok"],
2562
+ properties: { ok: { type: "boolean" } }
2563
+ }
2564
+ }
2565
+ },
2566
+ {
2567
+ type: "object",
2568
+ required: [
2569
+ "event",
2570
+ "log",
2571
+ "notification"
2572
+ ],
2573
+ additionalProperties: false,
2574
+ properties: {
2575
+ event: { const: "notification" },
2576
+ log: { type: "string" },
2577
+ notification: { $ref: "#/$defs/NotificationEntry" }
2578
+ }
2579
+ },
2580
+ {
2581
+ type: "object",
2582
+ required: [
2583
+ "event",
2584
+ "subscription",
2585
+ "payload"
2586
+ ],
2587
+ additionalProperties: false,
2588
+ properties: {
2589
+ event: { const: "status" },
2590
+ subscription: { type: "string" },
2591
+ payload: {
2592
+ type: "object",
2593
+ description: "A full payload, as `stim status --watch --json` prints it."
2594
+ },
2595
+ usage: { $ref: "#/$defs/UsageHistory" },
2596
+ ownLeases: {
2597
+ type: "array",
2598
+ items: { type: "string" }
2599
+ }
2600
+ }
2601
+ },
2602
+ {
2603
+ type: "object",
2604
+ required: [
2605
+ "event",
2606
+ "subscription",
2607
+ "records"
2608
+ ],
2609
+ additionalProperties: false,
2610
+ properties: {
2611
+ event: { const: "logs" },
2612
+ subscription: { type: "string" },
2613
+ records: {
2614
+ type: "array",
2615
+ items: { $ref: "#/$defs/LogRecord" }
2616
+ }
2617
+ }
2618
+ },
2619
+ {
2620
+ type: "object",
2621
+ required: ["event", "subscription"],
2622
+ additionalProperties: false,
2623
+ properties: {
2624
+ event: { const: "logs-ended" },
2625
+ subscription: { type: "string" }
2626
+ }
2627
+ },
2628
+ {
2629
+ type: "object",
2630
+ required: [
2631
+ "event",
2632
+ "subscription",
2633
+ "platform",
2634
+ "slot",
2635
+ "mime",
2636
+ "width",
2637
+ "height",
2638
+ "capturedAt",
2639
+ "data"
2640
+ ],
2641
+ additionalProperties: false,
2642
+ properties: {
2643
+ event: { const: "frame" },
2644
+ subscription: { type: "string" },
2645
+ platform: { enum: [...PLATFORMS] },
2646
+ slot: { type: "string" },
2647
+ mime: { const: "image/jpeg" },
2648
+ width: { type: "integer" },
2649
+ height: { type: "integer" },
2650
+ capturedAt: {
2651
+ type: "string",
2652
+ format: "date-time"
2653
+ },
2654
+ data: {
2655
+ type: "string",
2656
+ contentEncoding: "base64"
2657
+ },
2658
+ posture: { enum: ["folded", "unfolded"] },
2659
+ artworkTurns: {
2660
+ type: "integer",
2661
+ minimum: 0,
2662
+ maximum: 3
2663
+ },
2664
+ duo: {
2665
+ type: "object",
2666
+ required: [
2667
+ "revision",
2668
+ "screenID",
2669
+ "angle",
2670
+ "orientation"
2671
+ ],
2672
+ additionalProperties: false,
2673
+ properties: {
2674
+ revision: {
2675
+ type: "string",
2676
+ format: "uuid"
2677
+ },
2678
+ screenID: {
2679
+ type: "integer",
2680
+ minimum: 0,
2681
+ maximum: 4294967295
2682
+ },
2683
+ angle: {
2684
+ type: "number",
2685
+ minimum: 0,
2686
+ maximum: 180
2687
+ },
2688
+ orientation: {
2689
+ type: "integer",
2690
+ minimum: 1,
2691
+ maximum: 4
2692
+ }
2693
+ }
2694
+ }
2695
+ }
2696
+ },
2697
+ {
2698
+ type: "object",
2699
+ required: [
2700
+ "event",
2701
+ "subscription",
2702
+ "delayed"
2703
+ ],
2704
+ additionalProperties: false,
2705
+ properties: {
2706
+ event: { const: "frame-delayed" },
2707
+ platform: { enum: [...PLATFORMS] },
2708
+ slot: { type: "string" },
2709
+ subscription: { type: "string" },
2710
+ delayed: { type: "boolean" },
2711
+ reason: { type: "string" }
2712
+ }
2713
+ },
2714
+ {
2715
+ type: "object",
2716
+ required: [
2717
+ "event",
2718
+ "subscription",
2719
+ "at"
2720
+ ],
2721
+ additionalProperties: false,
2722
+ properties: {
2723
+ event: { const: "replay-ended" },
2724
+ subscription: { type: "string" },
2725
+ at: { type: "number" }
2726
+ }
2727
+ },
2728
+ {
2729
+ type: "object",
2730
+ required: [
2731
+ "event",
2732
+ "session",
2733
+ "reason",
2734
+ "message"
2735
+ ],
2736
+ additionalProperties: false,
2737
+ properties: {
2738
+ event: { const: "control-ended" },
2739
+ platform: { enum: [...PLATFORMS] },
2740
+ slot: { type: "string" },
2741
+ session: { type: "string" },
2742
+ reason: { enum: [...CONTROL_END_REASONS] },
2743
+ message: { type: "string" }
2744
+ }
2745
+ },
2746
+ {
2747
+ type: "object",
2748
+ required: [
2749
+ "event",
2750
+ "subscription",
2751
+ "error"
2752
+ ],
2753
+ additionalProperties: false,
2754
+ properties: {
2755
+ event: { const: "error" },
2756
+ platform: { enum: [...PLATFORMS] },
2757
+ slot: { type: "string" },
2758
+ subscription: { type: "string" },
2759
+ error: { $ref: "#/$defs/ProtocolError" }
2760
+ }
2761
+ }
2762
+ ] }
2763
+ },
2764
+ oneOf: [
2765
+ { $ref: "#/$defs/ClientRequest" },
2766
+ { $ref: "#/$defs/ServerResponse" },
2767
+ { $ref: "#/$defs/ServerEvent" }
2768
+ ]
2769
+ };
2770
+ }
2771
+ //#endregion
2772
+ export { protocol_exports as n, protocolJsonSchema as t };