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