@gameslate/sdk 0.3.7 → 0.3.8

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.
@@ -1,5 +1,277 @@
1
1
  import { z } from 'zod';
2
2
  import { type GameState } from '../types.js';
3
+ declare const StepSchema: z.ZodUnion<[z.ZodObject<{
4
+ /** a key (X keysym name) to press, once, or until a value matches; several keys take
5
+ * turns (a map where Start selects and A reads on through the briefing) */
6
+ press: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
7
+ holdMs: z.ZodDefault<z.ZodNumber>;
8
+ until: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
9
+ peek: z.ZodString;
10
+ equals: z.ZodNumber;
11
+ } & {
12
+ times: z.ZodDefault<z.ZodNumber>;
13
+ }, "strip", z.ZodTypeAny, {
14
+ peek: string;
15
+ equals: number;
16
+ times: number;
17
+ }, {
18
+ peek: string;
19
+ equals: number;
20
+ times?: number | undefined;
21
+ }>, z.ZodObject<{
22
+ state: z.ZodObject<{
23
+ phase: z.ZodOptional<z.ZodString>;
24
+ locationId: z.ZodOptional<z.ZodString>;
25
+ difficulty: z.ZodOptional<z.ZodString>;
26
+ variant: z.ZodOptional<z.ZodString>;
27
+ roomId: z.ZodOptional<z.ZodNumber>;
28
+ counters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodNumber, z.ZodObject<{
29
+ min: z.ZodNumber;
30
+ max: z.ZodNumber;
31
+ }, "strip", z.ZodTypeAny, {
32
+ min: number;
33
+ max: number;
34
+ }, {
35
+ min: number;
36
+ max: number;
37
+ }>]>>>;
38
+ }, "strip", z.ZodTypeAny, {
39
+ counters: Record<string, number | {
40
+ min: number;
41
+ max: number;
42
+ }>;
43
+ roomId?: number | undefined;
44
+ phase?: string | undefined;
45
+ locationId?: string | undefined;
46
+ difficulty?: string | undefined;
47
+ variant?: string | undefined;
48
+ }, {
49
+ roomId?: number | undefined;
50
+ phase?: string | undefined;
51
+ locationId?: string | undefined;
52
+ difficulty?: string | undefined;
53
+ variant?: string | undefined;
54
+ counters?: Record<string, number | {
55
+ min: number;
56
+ max: number;
57
+ }> | undefined;
58
+ }>;
59
+ } & {
60
+ times: z.ZodDefault<z.ZodNumber>;
61
+ }, "strip", z.ZodTypeAny, {
62
+ state: {
63
+ counters: Record<string, number | {
64
+ min: number;
65
+ max: number;
66
+ }>;
67
+ roomId?: number | undefined;
68
+ phase?: string | undefined;
69
+ locationId?: string | undefined;
70
+ difficulty?: string | undefined;
71
+ variant?: string | undefined;
72
+ };
73
+ times: number;
74
+ }, {
75
+ state: {
76
+ roomId?: number | undefined;
77
+ phase?: string | undefined;
78
+ locationId?: string | undefined;
79
+ difficulty?: string | undefined;
80
+ variant?: string | undefined;
81
+ counters?: Record<string, number | {
82
+ min: number;
83
+ max: number;
84
+ }> | undefined;
85
+ };
86
+ times?: number | undefined;
87
+ }>]>>;
88
+ everyMs: z.ZodDefault<z.ZodNumber>;
89
+ maxTries: z.ZodDefault<z.ZodNumber>;
90
+ }, "strip", z.ZodTypeAny, {
91
+ press: string | string[];
92
+ holdMs: number;
93
+ everyMs: number;
94
+ maxTries: number;
95
+ until?: {
96
+ peek: string;
97
+ equals: number;
98
+ times: number;
99
+ } | {
100
+ state: {
101
+ counters: Record<string, number | {
102
+ min: number;
103
+ max: number;
104
+ }>;
105
+ roomId?: number | undefined;
106
+ phase?: string | undefined;
107
+ locationId?: string | undefined;
108
+ difficulty?: string | undefined;
109
+ variant?: string | undefined;
110
+ };
111
+ times: number;
112
+ } | undefined;
113
+ }, {
114
+ press: string | string[];
115
+ holdMs?: number | undefined;
116
+ until?: {
117
+ peek: string;
118
+ equals: number;
119
+ times?: number | undefined;
120
+ } | {
121
+ state: {
122
+ roomId?: number | undefined;
123
+ phase?: string | undefined;
124
+ locationId?: string | undefined;
125
+ difficulty?: string | undefined;
126
+ variant?: string | undefined;
127
+ counters?: Record<string, number | {
128
+ min: number;
129
+ max: number;
130
+ }> | undefined;
131
+ };
132
+ times?: number | undefined;
133
+ } | undefined;
134
+ everyMs?: number | undefined;
135
+ maxTries?: number | undefined;
136
+ }>, z.ZodObject<{
137
+ waitFor: z.ZodUnion<[z.ZodObject<{
138
+ peek: z.ZodString;
139
+ equals: z.ZodNumber;
140
+ } & {
141
+ times: z.ZodDefault<z.ZodNumber>;
142
+ }, "strip", z.ZodTypeAny, {
143
+ peek: string;
144
+ equals: number;
145
+ times: number;
146
+ }, {
147
+ peek: string;
148
+ equals: number;
149
+ times?: number | undefined;
150
+ }>, z.ZodObject<{
151
+ state: z.ZodObject<{
152
+ phase: z.ZodOptional<z.ZodString>;
153
+ locationId: z.ZodOptional<z.ZodString>;
154
+ difficulty: z.ZodOptional<z.ZodString>;
155
+ variant: z.ZodOptional<z.ZodString>;
156
+ roomId: z.ZodOptional<z.ZodNumber>;
157
+ counters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodNumber, z.ZodObject<{
158
+ min: z.ZodNumber;
159
+ max: z.ZodNumber;
160
+ }, "strip", z.ZodTypeAny, {
161
+ min: number;
162
+ max: number;
163
+ }, {
164
+ min: number;
165
+ max: number;
166
+ }>]>>>;
167
+ }, "strip", z.ZodTypeAny, {
168
+ counters: Record<string, number | {
169
+ min: number;
170
+ max: number;
171
+ }>;
172
+ roomId?: number | undefined;
173
+ phase?: string | undefined;
174
+ locationId?: string | undefined;
175
+ difficulty?: string | undefined;
176
+ variant?: string | undefined;
177
+ }, {
178
+ roomId?: number | undefined;
179
+ phase?: string | undefined;
180
+ locationId?: string | undefined;
181
+ difficulty?: string | undefined;
182
+ variant?: string | undefined;
183
+ counters?: Record<string, number | {
184
+ min: number;
185
+ max: number;
186
+ }> | undefined;
187
+ }>;
188
+ } & {
189
+ times: z.ZodDefault<z.ZodNumber>;
190
+ }, "strip", z.ZodTypeAny, {
191
+ state: {
192
+ counters: Record<string, number | {
193
+ min: number;
194
+ max: number;
195
+ }>;
196
+ roomId?: number | undefined;
197
+ phase?: string | undefined;
198
+ locationId?: string | undefined;
199
+ difficulty?: string | undefined;
200
+ variant?: string | undefined;
201
+ };
202
+ times: number;
203
+ }, {
204
+ state: {
205
+ roomId?: number | undefined;
206
+ phase?: string | undefined;
207
+ locationId?: string | undefined;
208
+ difficulty?: string | undefined;
209
+ variant?: string | undefined;
210
+ counters?: Record<string, number | {
211
+ min: number;
212
+ max: number;
213
+ }> | undefined;
214
+ };
215
+ times?: number | undefined;
216
+ }>]>;
217
+ timeoutMs: z.ZodDefault<z.ZodNumber>;
218
+ everyMs: z.ZodDefault<z.ZodNumber>;
219
+ }, "strip", z.ZodTypeAny, {
220
+ everyMs: number;
221
+ waitFor: {
222
+ peek: string;
223
+ equals: number;
224
+ times: number;
225
+ } | {
226
+ state: {
227
+ counters: Record<string, number | {
228
+ min: number;
229
+ max: number;
230
+ }>;
231
+ roomId?: number | undefined;
232
+ phase?: string | undefined;
233
+ locationId?: string | undefined;
234
+ difficulty?: string | undefined;
235
+ variant?: string | undefined;
236
+ };
237
+ times: number;
238
+ };
239
+ timeoutMs: number;
240
+ }, {
241
+ waitFor: {
242
+ peek: string;
243
+ equals: number;
244
+ times?: number | undefined;
245
+ } | {
246
+ state: {
247
+ roomId?: number | undefined;
248
+ phase?: string | undefined;
249
+ locationId?: string | undefined;
250
+ difficulty?: string | undefined;
251
+ variant?: string | undefined;
252
+ counters?: Record<string, number | {
253
+ min: number;
254
+ max: number;
255
+ }> | undefined;
256
+ };
257
+ times?: number | undefined;
258
+ };
259
+ everyMs?: number | undefined;
260
+ timeoutMs?: number | undefined;
261
+ }>, z.ZodObject<{
262
+ frame: z.ZodString;
263
+ }, "strip", z.ZodTypeAny, {
264
+ frame: string;
265
+ }, {
266
+ frame: string;
267
+ }>, z.ZodObject<{
268
+ waitMs: z.ZodNumber;
269
+ }, "strip", z.ZodTypeAny, {
270
+ waitMs: number;
271
+ }, {
272
+ waitMs: number;
273
+ }>]>;
274
+ export type VerifyStep = z.infer<typeof StepSchema>;
3
275
  export declare const VerifySpecSchema: z.ZodObject<{
4
276
  /** the game id the daemon must report */
5
277
  game: z.ZodString;
@@ -32,6 +304,292 @@ export declare const VerifySpecSchema: z.ZodObject<{
32
304
  config?: string | undefined;
33
305
  port?: number | undefined;
34
306
  }>>;
307
+ /** any emulator, started with this command (the ROM on its command line, so the core finds it) */
308
+ emulator: z.ZodOptional<z.ZodObject<{
309
+ command: z.ZodArray<z.ZodString, "many">;
310
+ /** as for RetroArch: through GameSlate's launch wrapper where only a parent may read */
311
+ launchPrefix: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
312
+ }, "strip", z.ZodTypeAny, {
313
+ launchPrefix: string[];
314
+ command: string[];
315
+ }, {
316
+ command: string[];
317
+ launchPrefix?: string[] | undefined;
318
+ }>>;
319
+ /** GameSlate's `dist/gameslate.mjs`, whose `drive` commands run the steps */
320
+ gameslate: z.ZodOptional<z.ZodString>;
321
+ /** how to get to the moment: keys, waits on values, screenshots (docs/emulator-driving.md) */
322
+ steps: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodObject<{
323
+ /** a key (X keysym name) to press, once, or until a value matches; several keys take
324
+ * turns (a map where Start selects and A reads on through the briefing) */
325
+ press: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
326
+ holdMs: z.ZodDefault<z.ZodNumber>;
327
+ until: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
328
+ peek: z.ZodString;
329
+ equals: z.ZodNumber;
330
+ } & {
331
+ times: z.ZodDefault<z.ZodNumber>;
332
+ }, "strip", z.ZodTypeAny, {
333
+ peek: string;
334
+ equals: number;
335
+ times: number;
336
+ }, {
337
+ peek: string;
338
+ equals: number;
339
+ times?: number | undefined;
340
+ }>, z.ZodObject<{
341
+ state: z.ZodObject<{
342
+ phase: z.ZodOptional<z.ZodString>;
343
+ locationId: z.ZodOptional<z.ZodString>;
344
+ difficulty: z.ZodOptional<z.ZodString>;
345
+ variant: z.ZodOptional<z.ZodString>;
346
+ roomId: z.ZodOptional<z.ZodNumber>;
347
+ counters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodNumber, z.ZodObject<{
348
+ min: z.ZodNumber;
349
+ max: z.ZodNumber;
350
+ }, "strip", z.ZodTypeAny, {
351
+ min: number;
352
+ max: number;
353
+ }, {
354
+ min: number;
355
+ max: number;
356
+ }>]>>>;
357
+ }, "strip", z.ZodTypeAny, {
358
+ counters: Record<string, number | {
359
+ min: number;
360
+ max: number;
361
+ }>;
362
+ roomId?: number | undefined;
363
+ phase?: string | undefined;
364
+ locationId?: string | undefined;
365
+ difficulty?: string | undefined;
366
+ variant?: string | undefined;
367
+ }, {
368
+ roomId?: number | undefined;
369
+ phase?: string | undefined;
370
+ locationId?: string | undefined;
371
+ difficulty?: string | undefined;
372
+ variant?: string | undefined;
373
+ counters?: Record<string, number | {
374
+ min: number;
375
+ max: number;
376
+ }> | undefined;
377
+ }>;
378
+ } & {
379
+ times: z.ZodDefault<z.ZodNumber>;
380
+ }, "strip", z.ZodTypeAny, {
381
+ state: {
382
+ counters: Record<string, number | {
383
+ min: number;
384
+ max: number;
385
+ }>;
386
+ roomId?: number | undefined;
387
+ phase?: string | undefined;
388
+ locationId?: string | undefined;
389
+ difficulty?: string | undefined;
390
+ variant?: string | undefined;
391
+ };
392
+ times: number;
393
+ }, {
394
+ state: {
395
+ roomId?: number | undefined;
396
+ phase?: string | undefined;
397
+ locationId?: string | undefined;
398
+ difficulty?: string | undefined;
399
+ variant?: string | undefined;
400
+ counters?: Record<string, number | {
401
+ min: number;
402
+ max: number;
403
+ }> | undefined;
404
+ };
405
+ times?: number | undefined;
406
+ }>]>>;
407
+ everyMs: z.ZodDefault<z.ZodNumber>;
408
+ maxTries: z.ZodDefault<z.ZodNumber>;
409
+ }, "strip", z.ZodTypeAny, {
410
+ press: string | string[];
411
+ holdMs: number;
412
+ everyMs: number;
413
+ maxTries: number;
414
+ until?: {
415
+ peek: string;
416
+ equals: number;
417
+ times: number;
418
+ } | {
419
+ state: {
420
+ counters: Record<string, number | {
421
+ min: number;
422
+ max: number;
423
+ }>;
424
+ roomId?: number | undefined;
425
+ phase?: string | undefined;
426
+ locationId?: string | undefined;
427
+ difficulty?: string | undefined;
428
+ variant?: string | undefined;
429
+ };
430
+ times: number;
431
+ } | undefined;
432
+ }, {
433
+ press: string | string[];
434
+ holdMs?: number | undefined;
435
+ until?: {
436
+ peek: string;
437
+ equals: number;
438
+ times?: number | undefined;
439
+ } | {
440
+ state: {
441
+ roomId?: number | undefined;
442
+ phase?: string | undefined;
443
+ locationId?: string | undefined;
444
+ difficulty?: string | undefined;
445
+ variant?: string | undefined;
446
+ counters?: Record<string, number | {
447
+ min: number;
448
+ max: number;
449
+ }> | undefined;
450
+ };
451
+ times?: number | undefined;
452
+ } | undefined;
453
+ everyMs?: number | undefined;
454
+ maxTries?: number | undefined;
455
+ }>, z.ZodObject<{
456
+ waitFor: z.ZodUnion<[z.ZodObject<{
457
+ peek: z.ZodString;
458
+ equals: z.ZodNumber;
459
+ } & {
460
+ times: z.ZodDefault<z.ZodNumber>;
461
+ }, "strip", z.ZodTypeAny, {
462
+ peek: string;
463
+ equals: number;
464
+ times: number;
465
+ }, {
466
+ peek: string;
467
+ equals: number;
468
+ times?: number | undefined;
469
+ }>, z.ZodObject<{
470
+ state: z.ZodObject<{
471
+ phase: z.ZodOptional<z.ZodString>;
472
+ locationId: z.ZodOptional<z.ZodString>;
473
+ difficulty: z.ZodOptional<z.ZodString>;
474
+ variant: z.ZodOptional<z.ZodString>;
475
+ roomId: z.ZodOptional<z.ZodNumber>;
476
+ counters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodNumber, z.ZodObject<{
477
+ min: z.ZodNumber;
478
+ max: z.ZodNumber;
479
+ }, "strip", z.ZodTypeAny, {
480
+ min: number;
481
+ max: number;
482
+ }, {
483
+ min: number;
484
+ max: number;
485
+ }>]>>>;
486
+ }, "strip", z.ZodTypeAny, {
487
+ counters: Record<string, number | {
488
+ min: number;
489
+ max: number;
490
+ }>;
491
+ roomId?: number | undefined;
492
+ phase?: string | undefined;
493
+ locationId?: string | undefined;
494
+ difficulty?: string | undefined;
495
+ variant?: string | undefined;
496
+ }, {
497
+ roomId?: number | undefined;
498
+ phase?: string | undefined;
499
+ locationId?: string | undefined;
500
+ difficulty?: string | undefined;
501
+ variant?: string | undefined;
502
+ counters?: Record<string, number | {
503
+ min: number;
504
+ max: number;
505
+ }> | undefined;
506
+ }>;
507
+ } & {
508
+ times: z.ZodDefault<z.ZodNumber>;
509
+ }, "strip", z.ZodTypeAny, {
510
+ state: {
511
+ counters: Record<string, number | {
512
+ min: number;
513
+ max: number;
514
+ }>;
515
+ roomId?: number | undefined;
516
+ phase?: string | undefined;
517
+ locationId?: string | undefined;
518
+ difficulty?: string | undefined;
519
+ variant?: string | undefined;
520
+ };
521
+ times: number;
522
+ }, {
523
+ state: {
524
+ roomId?: number | undefined;
525
+ phase?: string | undefined;
526
+ locationId?: string | undefined;
527
+ difficulty?: string | undefined;
528
+ variant?: string | undefined;
529
+ counters?: Record<string, number | {
530
+ min: number;
531
+ max: number;
532
+ }> | undefined;
533
+ };
534
+ times?: number | undefined;
535
+ }>]>;
536
+ timeoutMs: z.ZodDefault<z.ZodNumber>;
537
+ everyMs: z.ZodDefault<z.ZodNumber>;
538
+ }, "strip", z.ZodTypeAny, {
539
+ everyMs: number;
540
+ waitFor: {
541
+ peek: string;
542
+ equals: number;
543
+ times: number;
544
+ } | {
545
+ state: {
546
+ counters: Record<string, number | {
547
+ min: number;
548
+ max: number;
549
+ }>;
550
+ roomId?: number | undefined;
551
+ phase?: string | undefined;
552
+ locationId?: string | undefined;
553
+ difficulty?: string | undefined;
554
+ variant?: string | undefined;
555
+ };
556
+ times: number;
557
+ };
558
+ timeoutMs: number;
559
+ }, {
560
+ waitFor: {
561
+ peek: string;
562
+ equals: number;
563
+ times?: number | undefined;
564
+ } | {
565
+ state: {
566
+ roomId?: number | undefined;
567
+ phase?: string | undefined;
568
+ locationId?: string | undefined;
569
+ difficulty?: string | undefined;
570
+ variant?: string | undefined;
571
+ counters?: Record<string, number | {
572
+ min: number;
573
+ max: number;
574
+ }> | undefined;
575
+ };
576
+ times?: number | undefined;
577
+ };
578
+ everyMs?: number | undefined;
579
+ timeoutMs?: number | undefined;
580
+ }>, z.ZodObject<{
581
+ frame: z.ZodString;
582
+ }, "strip", z.ZodTypeAny, {
583
+ frame: string;
584
+ }, {
585
+ frame: string;
586
+ }>, z.ZodObject<{
587
+ waitMs: z.ZodNumber;
588
+ }, "strip", z.ZodTypeAny, {
589
+ waitMs: number;
590
+ }, {
591
+ waitMs: number;
592
+ }>]>, "many">>;
35
593
  daemon: z.ZodDefault<z.ZodObject<{
36
594
  url: z.ZodDefault<z.ZodString>;
37
595
  }, "strip", z.ZodTypeAny, {
@@ -39,8 +597,21 @@ export declare const VerifySpecSchema: z.ZodObject<{
39
597
  }, {
40
598
  url?: string | undefined;
41
599
  }>>;
42
- /** the GameSlate page to screenshot beside the game */
43
- ui: z.ZodOptional<z.ZodString>;
600
+ /** the GameSlate page to screenshot beside the game: a URL (with its `#token=`), or the URL and
601
+ * the tabs to open and screenshot one by one at the moment */
602
+ ui: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, {
603
+ url: string;
604
+ tabs: ("Map" | "Inventory" | "Missions" | "Ref")[];
605
+ }, string>, z.ZodObject<{
606
+ url: z.ZodString;
607
+ tabs: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
608
+ }, "strip", z.ZodTypeAny, {
609
+ url: string;
610
+ tabs: string[];
611
+ }, {
612
+ url: string;
613
+ tabs?: string[] | undefined;
614
+ }>]>>;
44
615
  /** how long to let the game run before reading */
45
616
  settleMs: z.ZodDefault<z.ZodNumber>;
46
617
  timeoutMs: z.ZodDefault<z.ZodNumber>;
@@ -109,12 +680,61 @@ export declare const VerifySpecSchema: z.ZodObject<{
109
680
  signed?: boolean | undefined;
110
681
  }>, "many">>;
111
682
  }, "strip", z.ZodTypeAny, {
683
+ steps: ({
684
+ press: string | string[];
685
+ holdMs: number;
686
+ everyMs: number;
687
+ maxTries: number;
688
+ until?: {
689
+ peek: string;
690
+ equals: number;
691
+ times: number;
692
+ } | {
693
+ state: {
694
+ counters: Record<string, number | {
695
+ min: number;
696
+ max: number;
697
+ }>;
698
+ roomId?: number | undefined;
699
+ phase?: string | undefined;
700
+ locationId?: string | undefined;
701
+ difficulty?: string | undefined;
702
+ variant?: string | undefined;
703
+ };
704
+ times: number;
705
+ } | undefined;
706
+ } | {
707
+ everyMs: number;
708
+ waitFor: {
709
+ peek: string;
710
+ equals: number;
711
+ times: number;
712
+ } | {
713
+ state: {
714
+ counters: Record<string, number | {
715
+ min: number;
716
+ max: number;
717
+ }>;
718
+ roomId?: number | undefined;
719
+ phase?: string | undefined;
720
+ locationId?: string | undefined;
721
+ difficulty?: string | undefined;
722
+ variant?: string | undefined;
723
+ };
724
+ times: number;
725
+ };
726
+ timeoutMs: number;
727
+ } | {
728
+ frame: string;
729
+ } | {
730
+ waitMs: number;
731
+ })[];
732
+ timeoutMs: number;
112
733
  game: string;
113
734
  daemon: {
114
735
  url: string;
115
736
  };
116
737
  settleMs: number;
117
- timeoutMs: number;
118
738
  expect: {
119
739
  counters: Record<string, number | {
120
740
  min: number;
@@ -141,7 +761,18 @@ export declare const VerifySpecSchema: z.ZodObject<{
141
761
  port: number;
142
762
  config?: string | undefined;
143
763
  } | undefined;
144
- ui?: string | undefined;
764
+ emulator?: {
765
+ launchPrefix: string[];
766
+ command: string[];
767
+ } | undefined;
768
+ gameslate?: string | undefined;
769
+ ui?: {
770
+ url: string;
771
+ tabs: ("Map" | "Inventory" | "Missions" | "Ref")[];
772
+ } | {
773
+ url: string;
774
+ tabs: string[];
775
+ } | undefined;
145
776
  }, {
146
777
  game: string;
147
778
  expect: {
@@ -155,6 +786,56 @@ export declare const VerifySpecSchema: z.ZodObject<{
155
786
  max: number;
156
787
  }> | undefined;
157
788
  };
789
+ steps?: ({
790
+ press: string | string[];
791
+ holdMs?: number | undefined;
792
+ until?: {
793
+ peek: string;
794
+ equals: number;
795
+ times?: number | undefined;
796
+ } | {
797
+ state: {
798
+ roomId?: number | undefined;
799
+ phase?: string | undefined;
800
+ locationId?: string | undefined;
801
+ difficulty?: string | undefined;
802
+ variant?: string | undefined;
803
+ counters?: Record<string, number | {
804
+ min: number;
805
+ max: number;
806
+ }> | undefined;
807
+ };
808
+ times?: number | undefined;
809
+ } | undefined;
810
+ everyMs?: number | undefined;
811
+ maxTries?: number | undefined;
812
+ } | {
813
+ waitFor: {
814
+ peek: string;
815
+ equals: number;
816
+ times?: number | undefined;
817
+ } | {
818
+ state: {
819
+ roomId?: number | undefined;
820
+ phase?: string | undefined;
821
+ locationId?: string | undefined;
822
+ difficulty?: string | undefined;
823
+ variant?: string | undefined;
824
+ counters?: Record<string, number | {
825
+ min: number;
826
+ max: number;
827
+ }> | undefined;
828
+ };
829
+ times?: number | undefined;
830
+ };
831
+ everyMs?: number | undefined;
832
+ timeoutMs?: number | undefined;
833
+ } | {
834
+ frame: string;
835
+ } | {
836
+ waitMs: number;
837
+ })[] | undefined;
838
+ timeoutMs?: number | undefined;
158
839
  retroarch?: {
159
840
  binary: string;
160
841
  core: string;
@@ -164,12 +845,19 @@ export declare const VerifySpecSchema: z.ZodObject<{
164
845
  config?: string | undefined;
165
846
  port?: number | undefined;
166
847
  } | undefined;
848
+ emulator?: {
849
+ command: string[];
850
+ launchPrefix?: string[] | undefined;
851
+ } | undefined;
852
+ gameslate?: string | undefined;
167
853
  daemon?: {
168
854
  url?: string | undefined;
169
855
  } | undefined;
170
- ui?: string | undefined;
856
+ ui?: string | {
857
+ url: string;
858
+ tabs?: string[] | undefined;
859
+ } | undefined;
171
860
  settleMs?: number | undefined;
172
- timeoutMs?: number | undefined;
173
861
  memory?: {
174
862
  counter: string;
175
863
  size: 2 | 1 | 4;
@@ -179,6 +867,12 @@ export declare const VerifySpecSchema: z.ZodObject<{
179
867
  }>;
180
868
  export type VerifySpec = z.infer<typeof VerifySpecSchema>;
181
869
  type MemoryCheck = VerifySpec['memory'][number];
870
+ /**
871
+ * `${NAME}` in any string of a spec, from the environment, so a spec can be shared without one
872
+ * machine's paths (`"${GOPHER64}"`, `"${N64_ROMS}/Mario Kart 64 (U).z64"`). Throws on a name that
873
+ * isn't set.
874
+ */
875
+ export declare function expandEnv(value: unknown, env: Record<string, string | undefined>): unknown;
182
876
  /** What doesn't match: one line each. */
183
877
  export declare function stateMismatches(expect: VerifySpec['expect'], state: GameState): string[];
184
878
  /** RetroArch's network command reading a value with RetroAchievements' addressing. */
@@ -187,10 +881,13 @@ export declare function readCoreRamCommand(check: Pick<MemoryCheck, 'address' |
187
881
  export declare function valueFromReply(reply: string, check: Pick<MemoryCheck, 'address' | 'size' | 'signed'>): number | string;
188
882
  /** The effects a run needs. */
189
883
  export interface VerifyEffects {
190
- /** starts the game; resolves once it's running */
884
+ /** starts the game; resolves once it's running, with the emulator's pid when it started one */
191
885
  launch(spec: VerifySpec): Promise<{
886
+ pid?: number;
192
887
  stop(): void;
193
888
  }>;
889
+ /** a `gameslate drive` command's output */
890
+ drive(spec: VerifySpec, args: string[]): Promise<string>;
194
891
  wait(ms: number): Promise<void>;
195
892
  /** the daemon's next full state for `game` */
196
893
  state(spec: VerifySpec): Promise<unknown>;
@@ -205,6 +902,6 @@ export interface VerifyResult {
205
902
  screenshots: string[];
206
903
  state: GameState | null;
207
904
  }
208
- /** Runs one check: start the game, let it settle, compare, screenshot, stop. */
905
+ /** Runs one check: start the game, drive it to its moment, let it settle, compare, screenshot, stop. */
209
906
  export declare function runVerify(spec: VerifySpec, effects: VerifyEffects): Promise<VerifyResult>;
210
907
  export {};