@gameslate/sdk 0.3.7 → 0.3.9

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,397 @@
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
+ /** what the inventory must hold, must not hold, or must hold exactly (any order) */
39
+ inventory: z.ZodOptional<z.ZodObject<{
40
+ has: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
41
+ lacks: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
42
+ exactly: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
43
+ }, "strip", z.ZodTypeAny, {
44
+ has: string[];
45
+ lacks: string[];
46
+ exactly?: string[] | undefined;
47
+ }, {
48
+ has?: string[] | undefined;
49
+ lacks?: string[] | undefined;
50
+ exactly?: string[] | undefined;
51
+ }>>;
52
+ /** the equipped item, or null for nothing */
53
+ equipped: z.ZodOptional<z.ZodNullable<z.ZodString>>;
54
+ /** flags that must read true or false (a flag the state doesn't report is a mismatch) */
55
+ flags: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
56
+ }, "strip", z.ZodTypeAny, {
57
+ counters: Record<string, number | {
58
+ min: number;
59
+ max: number;
60
+ }>;
61
+ flags: Record<string, boolean>;
62
+ inventory?: {
63
+ has: string[];
64
+ lacks: string[];
65
+ exactly?: string[] | undefined;
66
+ } | undefined;
67
+ roomId?: number | undefined;
68
+ phase?: string | undefined;
69
+ locationId?: string | undefined;
70
+ difficulty?: string | undefined;
71
+ variant?: string | undefined;
72
+ equipped?: string | null | undefined;
73
+ }, {
74
+ inventory?: {
75
+ has?: string[] | undefined;
76
+ lacks?: string[] | undefined;
77
+ exactly?: string[] | undefined;
78
+ } | undefined;
79
+ roomId?: number | undefined;
80
+ phase?: string | undefined;
81
+ locationId?: string | undefined;
82
+ difficulty?: string | undefined;
83
+ variant?: string | undefined;
84
+ counters?: Record<string, number | {
85
+ min: number;
86
+ max: number;
87
+ }> | undefined;
88
+ equipped?: string | null | undefined;
89
+ flags?: Record<string, boolean> | undefined;
90
+ }>;
91
+ } & {
92
+ times: z.ZodDefault<z.ZodNumber>;
93
+ }, "strip", z.ZodTypeAny, {
94
+ state: {
95
+ counters: Record<string, number | {
96
+ min: number;
97
+ max: number;
98
+ }>;
99
+ flags: Record<string, boolean>;
100
+ inventory?: {
101
+ has: string[];
102
+ lacks: string[];
103
+ exactly?: string[] | undefined;
104
+ } | undefined;
105
+ roomId?: number | undefined;
106
+ phase?: string | undefined;
107
+ locationId?: string | undefined;
108
+ difficulty?: string | undefined;
109
+ variant?: string | undefined;
110
+ equipped?: string | null | undefined;
111
+ };
112
+ times: number;
113
+ }, {
114
+ state: {
115
+ inventory?: {
116
+ has?: string[] | undefined;
117
+ lacks?: string[] | undefined;
118
+ exactly?: string[] | undefined;
119
+ } | undefined;
120
+ roomId?: number | undefined;
121
+ phase?: string | undefined;
122
+ locationId?: string | undefined;
123
+ difficulty?: string | undefined;
124
+ variant?: string | undefined;
125
+ counters?: Record<string, number | {
126
+ min: number;
127
+ max: number;
128
+ }> | undefined;
129
+ equipped?: string | null | undefined;
130
+ flags?: Record<string, boolean> | undefined;
131
+ };
132
+ times?: number | undefined;
133
+ }>]>>;
134
+ everyMs: z.ZodDefault<z.ZodNumber>;
135
+ maxTries: z.ZodDefault<z.ZodNumber>;
136
+ }, "strip", z.ZodTypeAny, {
137
+ press: string | string[];
138
+ holdMs: number;
139
+ everyMs: number;
140
+ maxTries: number;
141
+ until?: {
142
+ peek: string;
143
+ equals: number;
144
+ times: number;
145
+ } | {
146
+ state: {
147
+ counters: Record<string, number | {
148
+ min: number;
149
+ max: number;
150
+ }>;
151
+ flags: Record<string, boolean>;
152
+ inventory?: {
153
+ has: string[];
154
+ lacks: string[];
155
+ exactly?: string[] | undefined;
156
+ } | undefined;
157
+ roomId?: number | undefined;
158
+ phase?: string | undefined;
159
+ locationId?: string | undefined;
160
+ difficulty?: string | undefined;
161
+ variant?: string | undefined;
162
+ equipped?: string | null | undefined;
163
+ };
164
+ times: number;
165
+ } | undefined;
166
+ }, {
167
+ press: string | string[];
168
+ holdMs?: number | undefined;
169
+ until?: {
170
+ peek: string;
171
+ equals: number;
172
+ times?: number | undefined;
173
+ } | {
174
+ state: {
175
+ inventory?: {
176
+ has?: string[] | undefined;
177
+ lacks?: string[] | undefined;
178
+ exactly?: string[] | undefined;
179
+ } | undefined;
180
+ roomId?: number | undefined;
181
+ phase?: string | undefined;
182
+ locationId?: string | undefined;
183
+ difficulty?: string | undefined;
184
+ variant?: string | undefined;
185
+ counters?: Record<string, number | {
186
+ min: number;
187
+ max: number;
188
+ }> | undefined;
189
+ equipped?: string | null | undefined;
190
+ flags?: Record<string, boolean> | undefined;
191
+ };
192
+ times?: number | undefined;
193
+ } | undefined;
194
+ everyMs?: number | undefined;
195
+ maxTries?: number | undefined;
196
+ }>, z.ZodObject<{
197
+ waitFor: z.ZodUnion<[z.ZodObject<{
198
+ peek: z.ZodString;
199
+ equals: z.ZodNumber;
200
+ } & {
201
+ times: z.ZodDefault<z.ZodNumber>;
202
+ }, "strip", z.ZodTypeAny, {
203
+ peek: string;
204
+ equals: number;
205
+ times: number;
206
+ }, {
207
+ peek: string;
208
+ equals: number;
209
+ times?: number | undefined;
210
+ }>, z.ZodObject<{
211
+ state: z.ZodObject<{
212
+ phase: z.ZodOptional<z.ZodString>;
213
+ locationId: z.ZodOptional<z.ZodString>;
214
+ difficulty: z.ZodOptional<z.ZodString>;
215
+ variant: z.ZodOptional<z.ZodString>;
216
+ roomId: z.ZodOptional<z.ZodNumber>;
217
+ counters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodNumber, z.ZodObject<{
218
+ min: z.ZodNumber;
219
+ max: z.ZodNumber;
220
+ }, "strip", z.ZodTypeAny, {
221
+ min: number;
222
+ max: number;
223
+ }, {
224
+ min: number;
225
+ max: number;
226
+ }>]>>>;
227
+ /** what the inventory must hold, must not hold, or must hold exactly (any order) */
228
+ inventory: z.ZodOptional<z.ZodObject<{
229
+ has: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
230
+ lacks: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
231
+ exactly: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
232
+ }, "strip", z.ZodTypeAny, {
233
+ has: string[];
234
+ lacks: string[];
235
+ exactly?: string[] | undefined;
236
+ }, {
237
+ has?: string[] | undefined;
238
+ lacks?: string[] | undefined;
239
+ exactly?: string[] | undefined;
240
+ }>>;
241
+ /** the equipped item, or null for nothing */
242
+ equipped: z.ZodOptional<z.ZodNullable<z.ZodString>>;
243
+ /** flags that must read true or false (a flag the state doesn't report is a mismatch) */
244
+ flags: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
245
+ }, "strip", z.ZodTypeAny, {
246
+ counters: Record<string, number | {
247
+ min: number;
248
+ max: number;
249
+ }>;
250
+ flags: Record<string, boolean>;
251
+ inventory?: {
252
+ has: string[];
253
+ lacks: string[];
254
+ exactly?: string[] | undefined;
255
+ } | undefined;
256
+ roomId?: number | undefined;
257
+ phase?: string | undefined;
258
+ locationId?: string | undefined;
259
+ difficulty?: string | undefined;
260
+ variant?: string | undefined;
261
+ equipped?: string | null | undefined;
262
+ }, {
263
+ inventory?: {
264
+ has?: string[] | undefined;
265
+ lacks?: string[] | undefined;
266
+ exactly?: string[] | undefined;
267
+ } | undefined;
268
+ roomId?: number | undefined;
269
+ phase?: string | undefined;
270
+ locationId?: string | undefined;
271
+ difficulty?: string | undefined;
272
+ variant?: string | undefined;
273
+ counters?: Record<string, number | {
274
+ min: number;
275
+ max: number;
276
+ }> | undefined;
277
+ equipped?: string | null | undefined;
278
+ flags?: Record<string, boolean> | undefined;
279
+ }>;
280
+ } & {
281
+ times: z.ZodDefault<z.ZodNumber>;
282
+ }, "strip", z.ZodTypeAny, {
283
+ state: {
284
+ counters: Record<string, number | {
285
+ min: number;
286
+ max: number;
287
+ }>;
288
+ flags: Record<string, boolean>;
289
+ inventory?: {
290
+ has: string[];
291
+ lacks: string[];
292
+ exactly?: string[] | undefined;
293
+ } | undefined;
294
+ roomId?: number | undefined;
295
+ phase?: string | undefined;
296
+ locationId?: string | undefined;
297
+ difficulty?: string | undefined;
298
+ variant?: string | undefined;
299
+ equipped?: string | null | undefined;
300
+ };
301
+ times: number;
302
+ }, {
303
+ state: {
304
+ inventory?: {
305
+ has?: string[] | undefined;
306
+ lacks?: string[] | undefined;
307
+ exactly?: string[] | undefined;
308
+ } | undefined;
309
+ roomId?: number | undefined;
310
+ phase?: string | undefined;
311
+ locationId?: string | undefined;
312
+ difficulty?: string | undefined;
313
+ variant?: string | undefined;
314
+ counters?: Record<string, number | {
315
+ min: number;
316
+ max: number;
317
+ }> | undefined;
318
+ equipped?: string | null | undefined;
319
+ flags?: Record<string, boolean> | undefined;
320
+ };
321
+ times?: number | undefined;
322
+ }>]>;
323
+ timeoutMs: z.ZodDefault<z.ZodNumber>;
324
+ everyMs: z.ZodDefault<z.ZodNumber>;
325
+ }, "strip", z.ZodTypeAny, {
326
+ everyMs: number;
327
+ waitFor: {
328
+ peek: string;
329
+ equals: number;
330
+ times: number;
331
+ } | {
332
+ state: {
333
+ counters: Record<string, number | {
334
+ min: number;
335
+ max: number;
336
+ }>;
337
+ flags: Record<string, boolean>;
338
+ inventory?: {
339
+ has: string[];
340
+ lacks: string[];
341
+ exactly?: string[] | undefined;
342
+ } | undefined;
343
+ roomId?: number | undefined;
344
+ phase?: string | undefined;
345
+ locationId?: string | undefined;
346
+ difficulty?: string | undefined;
347
+ variant?: string | undefined;
348
+ equipped?: string | null | undefined;
349
+ };
350
+ times: number;
351
+ };
352
+ timeoutMs: number;
353
+ }, {
354
+ waitFor: {
355
+ peek: string;
356
+ equals: number;
357
+ times?: number | undefined;
358
+ } | {
359
+ state: {
360
+ inventory?: {
361
+ has?: string[] | undefined;
362
+ lacks?: string[] | undefined;
363
+ exactly?: string[] | undefined;
364
+ } | undefined;
365
+ roomId?: number | undefined;
366
+ phase?: string | undefined;
367
+ locationId?: string | undefined;
368
+ difficulty?: string | undefined;
369
+ variant?: string | undefined;
370
+ counters?: Record<string, number | {
371
+ min: number;
372
+ max: number;
373
+ }> | undefined;
374
+ equipped?: string | null | undefined;
375
+ flags?: Record<string, boolean> | undefined;
376
+ };
377
+ times?: number | undefined;
378
+ };
379
+ everyMs?: number | undefined;
380
+ timeoutMs?: number | undefined;
381
+ }>, z.ZodObject<{
382
+ frame: z.ZodString;
383
+ }, "strip", z.ZodTypeAny, {
384
+ frame: string;
385
+ }, {
386
+ frame: string;
387
+ }>, z.ZodObject<{
388
+ waitMs: z.ZodNumber;
389
+ }, "strip", z.ZodTypeAny, {
390
+ waitMs: number;
391
+ }, {
392
+ waitMs: number;
393
+ }>]>;
394
+ export type VerifyStep = z.infer<typeof StepSchema>;
3
395
  export declare const VerifySpecSchema: z.ZodObject<{
4
396
  /** the game id the daemon must report */
5
397
  game: z.ZodString;
@@ -32,6 +424,412 @@ export declare const VerifySpecSchema: z.ZodObject<{
32
424
  config?: string | undefined;
33
425
  port?: number | undefined;
34
426
  }>>;
427
+ /** any emulator, started with this command (the ROM on its command line, so the core finds it) */
428
+ emulator: z.ZodOptional<z.ZodObject<{
429
+ command: z.ZodArray<z.ZodString, "many">;
430
+ /** as for RetroArch: through GameSlate's launch wrapper where only a parent may read */
431
+ launchPrefix: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
432
+ }, "strip", z.ZodTypeAny, {
433
+ launchPrefix: string[];
434
+ command: string[];
435
+ }, {
436
+ command: string[];
437
+ launchPrefix?: string[] | undefined;
438
+ }>>;
439
+ /** GameSlate's `dist/gameslate.mjs`, whose `drive` commands run the steps */
440
+ gameslate: z.ZodOptional<z.ZodString>;
441
+ /** how to get to the moment: keys, waits on values, screenshots (docs/emulator-driving.md) */
442
+ steps: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodObject<{
443
+ /** a key (X keysym name) to press, once, or until a value matches; several keys take
444
+ * turns (a map where Start selects and A reads on through the briefing) */
445
+ press: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
446
+ holdMs: z.ZodDefault<z.ZodNumber>;
447
+ until: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
448
+ peek: z.ZodString;
449
+ equals: z.ZodNumber;
450
+ } & {
451
+ times: z.ZodDefault<z.ZodNumber>;
452
+ }, "strip", z.ZodTypeAny, {
453
+ peek: string;
454
+ equals: number;
455
+ times: number;
456
+ }, {
457
+ peek: string;
458
+ equals: number;
459
+ times?: number | undefined;
460
+ }>, z.ZodObject<{
461
+ state: z.ZodObject<{
462
+ phase: z.ZodOptional<z.ZodString>;
463
+ locationId: z.ZodOptional<z.ZodString>;
464
+ difficulty: z.ZodOptional<z.ZodString>;
465
+ variant: z.ZodOptional<z.ZodString>;
466
+ roomId: z.ZodOptional<z.ZodNumber>;
467
+ counters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodNumber, z.ZodObject<{
468
+ min: z.ZodNumber;
469
+ max: z.ZodNumber;
470
+ }, "strip", z.ZodTypeAny, {
471
+ min: number;
472
+ max: number;
473
+ }, {
474
+ min: number;
475
+ max: number;
476
+ }>]>>>;
477
+ /** what the inventory must hold, must not hold, or must hold exactly (any order) */
478
+ inventory: z.ZodOptional<z.ZodObject<{
479
+ has: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
480
+ lacks: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
481
+ exactly: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
482
+ }, "strip", z.ZodTypeAny, {
483
+ has: string[];
484
+ lacks: string[];
485
+ exactly?: string[] | undefined;
486
+ }, {
487
+ has?: string[] | undefined;
488
+ lacks?: string[] | undefined;
489
+ exactly?: string[] | undefined;
490
+ }>>;
491
+ /** the equipped item, or null for nothing */
492
+ equipped: z.ZodOptional<z.ZodNullable<z.ZodString>>;
493
+ /** flags that must read true or false (a flag the state doesn't report is a mismatch) */
494
+ flags: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
495
+ }, "strip", z.ZodTypeAny, {
496
+ counters: Record<string, number | {
497
+ min: number;
498
+ max: number;
499
+ }>;
500
+ flags: Record<string, boolean>;
501
+ inventory?: {
502
+ has: string[];
503
+ lacks: string[];
504
+ exactly?: string[] | undefined;
505
+ } | undefined;
506
+ roomId?: number | undefined;
507
+ phase?: string | undefined;
508
+ locationId?: string | undefined;
509
+ difficulty?: string | undefined;
510
+ variant?: string | undefined;
511
+ equipped?: string | null | undefined;
512
+ }, {
513
+ inventory?: {
514
+ has?: string[] | undefined;
515
+ lacks?: string[] | undefined;
516
+ exactly?: string[] | undefined;
517
+ } | undefined;
518
+ roomId?: number | undefined;
519
+ phase?: string | undefined;
520
+ locationId?: string | undefined;
521
+ difficulty?: string | undefined;
522
+ variant?: string | undefined;
523
+ counters?: Record<string, number | {
524
+ min: number;
525
+ max: number;
526
+ }> | undefined;
527
+ equipped?: string | null | undefined;
528
+ flags?: Record<string, boolean> | undefined;
529
+ }>;
530
+ } & {
531
+ times: z.ZodDefault<z.ZodNumber>;
532
+ }, "strip", z.ZodTypeAny, {
533
+ state: {
534
+ counters: Record<string, number | {
535
+ min: number;
536
+ max: number;
537
+ }>;
538
+ flags: Record<string, boolean>;
539
+ inventory?: {
540
+ has: string[];
541
+ lacks: string[];
542
+ exactly?: string[] | undefined;
543
+ } | undefined;
544
+ roomId?: number | undefined;
545
+ phase?: string | undefined;
546
+ locationId?: string | undefined;
547
+ difficulty?: string | undefined;
548
+ variant?: string | undefined;
549
+ equipped?: string | null | undefined;
550
+ };
551
+ times: number;
552
+ }, {
553
+ state: {
554
+ inventory?: {
555
+ has?: string[] | undefined;
556
+ lacks?: string[] | undefined;
557
+ exactly?: string[] | undefined;
558
+ } | undefined;
559
+ roomId?: number | undefined;
560
+ phase?: string | undefined;
561
+ locationId?: string | undefined;
562
+ difficulty?: string | undefined;
563
+ variant?: string | undefined;
564
+ counters?: Record<string, number | {
565
+ min: number;
566
+ max: number;
567
+ }> | undefined;
568
+ equipped?: string | null | undefined;
569
+ flags?: Record<string, boolean> | undefined;
570
+ };
571
+ times?: number | undefined;
572
+ }>]>>;
573
+ everyMs: z.ZodDefault<z.ZodNumber>;
574
+ maxTries: z.ZodDefault<z.ZodNumber>;
575
+ }, "strip", z.ZodTypeAny, {
576
+ press: string | string[];
577
+ holdMs: number;
578
+ everyMs: number;
579
+ maxTries: number;
580
+ until?: {
581
+ peek: string;
582
+ equals: number;
583
+ times: number;
584
+ } | {
585
+ state: {
586
+ counters: Record<string, number | {
587
+ min: number;
588
+ max: number;
589
+ }>;
590
+ flags: Record<string, boolean>;
591
+ inventory?: {
592
+ has: string[];
593
+ lacks: string[];
594
+ exactly?: string[] | undefined;
595
+ } | undefined;
596
+ roomId?: number | undefined;
597
+ phase?: string | undefined;
598
+ locationId?: string | undefined;
599
+ difficulty?: string | undefined;
600
+ variant?: string | undefined;
601
+ equipped?: string | null | undefined;
602
+ };
603
+ times: number;
604
+ } | undefined;
605
+ }, {
606
+ press: string | string[];
607
+ holdMs?: number | undefined;
608
+ until?: {
609
+ peek: string;
610
+ equals: number;
611
+ times?: number | undefined;
612
+ } | {
613
+ state: {
614
+ inventory?: {
615
+ has?: string[] | undefined;
616
+ lacks?: string[] | undefined;
617
+ exactly?: string[] | undefined;
618
+ } | undefined;
619
+ roomId?: number | undefined;
620
+ phase?: string | undefined;
621
+ locationId?: string | undefined;
622
+ difficulty?: string | undefined;
623
+ variant?: string | undefined;
624
+ counters?: Record<string, number | {
625
+ min: number;
626
+ max: number;
627
+ }> | undefined;
628
+ equipped?: string | null | undefined;
629
+ flags?: Record<string, boolean> | undefined;
630
+ };
631
+ times?: number | undefined;
632
+ } | undefined;
633
+ everyMs?: number | undefined;
634
+ maxTries?: number | undefined;
635
+ }>, z.ZodObject<{
636
+ waitFor: z.ZodUnion<[z.ZodObject<{
637
+ peek: z.ZodString;
638
+ equals: z.ZodNumber;
639
+ } & {
640
+ times: z.ZodDefault<z.ZodNumber>;
641
+ }, "strip", z.ZodTypeAny, {
642
+ peek: string;
643
+ equals: number;
644
+ times: number;
645
+ }, {
646
+ peek: string;
647
+ equals: number;
648
+ times?: number | undefined;
649
+ }>, z.ZodObject<{
650
+ state: z.ZodObject<{
651
+ phase: z.ZodOptional<z.ZodString>;
652
+ locationId: z.ZodOptional<z.ZodString>;
653
+ difficulty: z.ZodOptional<z.ZodString>;
654
+ variant: z.ZodOptional<z.ZodString>;
655
+ roomId: z.ZodOptional<z.ZodNumber>;
656
+ counters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodNumber, z.ZodObject<{
657
+ min: z.ZodNumber;
658
+ max: z.ZodNumber;
659
+ }, "strip", z.ZodTypeAny, {
660
+ min: number;
661
+ max: number;
662
+ }, {
663
+ min: number;
664
+ max: number;
665
+ }>]>>>;
666
+ /** what the inventory must hold, must not hold, or must hold exactly (any order) */
667
+ inventory: z.ZodOptional<z.ZodObject<{
668
+ has: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
669
+ lacks: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
670
+ exactly: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
671
+ }, "strip", z.ZodTypeAny, {
672
+ has: string[];
673
+ lacks: string[];
674
+ exactly?: string[] | undefined;
675
+ }, {
676
+ has?: string[] | undefined;
677
+ lacks?: string[] | undefined;
678
+ exactly?: string[] | undefined;
679
+ }>>;
680
+ /** the equipped item, or null for nothing */
681
+ equipped: z.ZodOptional<z.ZodNullable<z.ZodString>>;
682
+ /** flags that must read true or false (a flag the state doesn't report is a mismatch) */
683
+ flags: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
684
+ }, "strip", z.ZodTypeAny, {
685
+ counters: Record<string, number | {
686
+ min: number;
687
+ max: number;
688
+ }>;
689
+ flags: Record<string, boolean>;
690
+ inventory?: {
691
+ has: string[];
692
+ lacks: string[];
693
+ exactly?: string[] | undefined;
694
+ } | undefined;
695
+ roomId?: number | undefined;
696
+ phase?: string | undefined;
697
+ locationId?: string | undefined;
698
+ difficulty?: string | undefined;
699
+ variant?: string | undefined;
700
+ equipped?: string | null | undefined;
701
+ }, {
702
+ inventory?: {
703
+ has?: string[] | undefined;
704
+ lacks?: string[] | undefined;
705
+ exactly?: string[] | undefined;
706
+ } | undefined;
707
+ roomId?: number | undefined;
708
+ phase?: string | undefined;
709
+ locationId?: string | undefined;
710
+ difficulty?: string | undefined;
711
+ variant?: string | undefined;
712
+ counters?: Record<string, number | {
713
+ min: number;
714
+ max: number;
715
+ }> | undefined;
716
+ equipped?: string | null | undefined;
717
+ flags?: Record<string, boolean> | undefined;
718
+ }>;
719
+ } & {
720
+ times: z.ZodDefault<z.ZodNumber>;
721
+ }, "strip", z.ZodTypeAny, {
722
+ state: {
723
+ counters: Record<string, number | {
724
+ min: number;
725
+ max: number;
726
+ }>;
727
+ flags: Record<string, boolean>;
728
+ inventory?: {
729
+ has: string[];
730
+ lacks: string[];
731
+ exactly?: string[] | undefined;
732
+ } | undefined;
733
+ roomId?: number | undefined;
734
+ phase?: string | undefined;
735
+ locationId?: string | undefined;
736
+ difficulty?: string | undefined;
737
+ variant?: string | undefined;
738
+ equipped?: string | null | undefined;
739
+ };
740
+ times: number;
741
+ }, {
742
+ state: {
743
+ inventory?: {
744
+ has?: string[] | undefined;
745
+ lacks?: string[] | undefined;
746
+ exactly?: string[] | undefined;
747
+ } | undefined;
748
+ roomId?: number | undefined;
749
+ phase?: string | undefined;
750
+ locationId?: string | undefined;
751
+ difficulty?: string | undefined;
752
+ variant?: string | undefined;
753
+ counters?: Record<string, number | {
754
+ min: number;
755
+ max: number;
756
+ }> | undefined;
757
+ equipped?: string | null | undefined;
758
+ flags?: Record<string, boolean> | undefined;
759
+ };
760
+ times?: number | undefined;
761
+ }>]>;
762
+ timeoutMs: z.ZodDefault<z.ZodNumber>;
763
+ everyMs: z.ZodDefault<z.ZodNumber>;
764
+ }, "strip", z.ZodTypeAny, {
765
+ everyMs: number;
766
+ waitFor: {
767
+ peek: string;
768
+ equals: number;
769
+ times: number;
770
+ } | {
771
+ state: {
772
+ counters: Record<string, number | {
773
+ min: number;
774
+ max: number;
775
+ }>;
776
+ flags: Record<string, boolean>;
777
+ inventory?: {
778
+ has: string[];
779
+ lacks: string[];
780
+ exactly?: string[] | undefined;
781
+ } | undefined;
782
+ roomId?: number | undefined;
783
+ phase?: string | undefined;
784
+ locationId?: string | undefined;
785
+ difficulty?: string | undefined;
786
+ variant?: string | undefined;
787
+ equipped?: string | null | undefined;
788
+ };
789
+ times: number;
790
+ };
791
+ timeoutMs: number;
792
+ }, {
793
+ waitFor: {
794
+ peek: string;
795
+ equals: number;
796
+ times?: number | undefined;
797
+ } | {
798
+ state: {
799
+ inventory?: {
800
+ has?: string[] | undefined;
801
+ lacks?: string[] | undefined;
802
+ exactly?: string[] | undefined;
803
+ } | undefined;
804
+ roomId?: number | undefined;
805
+ phase?: string | undefined;
806
+ locationId?: string | undefined;
807
+ difficulty?: string | undefined;
808
+ variant?: string | undefined;
809
+ counters?: Record<string, number | {
810
+ min: number;
811
+ max: number;
812
+ }> | undefined;
813
+ equipped?: string | null | undefined;
814
+ flags?: Record<string, boolean> | undefined;
815
+ };
816
+ times?: number | undefined;
817
+ };
818
+ everyMs?: number | undefined;
819
+ timeoutMs?: number | undefined;
820
+ }>, z.ZodObject<{
821
+ frame: z.ZodString;
822
+ }, "strip", z.ZodTypeAny, {
823
+ frame: string;
824
+ }, {
825
+ frame: string;
826
+ }>, z.ZodObject<{
827
+ waitMs: z.ZodNumber;
828
+ }, "strip", z.ZodTypeAny, {
829
+ waitMs: number;
830
+ }, {
831
+ waitMs: number;
832
+ }>]>, "many">>;
35
833
  daemon: z.ZodDefault<z.ZodObject<{
36
834
  url: z.ZodDefault<z.ZodString>;
37
835
  }, "strip", z.ZodTypeAny, {
@@ -39,8 +837,21 @@ export declare const VerifySpecSchema: z.ZodObject<{
39
837
  }, {
40
838
  url?: string | undefined;
41
839
  }>>;
42
- /** the GameSlate page to screenshot beside the game */
43
- ui: z.ZodOptional<z.ZodString>;
840
+ /** the GameSlate page to screenshot beside the game: a URL (with its `#token=`), or the URL and
841
+ * the tabs to open and screenshot one by one at the moment */
842
+ ui: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, {
843
+ url: string;
844
+ tabs: ("Map" | "Inventory" | "Missions" | "Ref")[];
845
+ }, string>, z.ZodObject<{
846
+ url: z.ZodString;
847
+ tabs: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
848
+ }, "strip", z.ZodTypeAny, {
849
+ url: string;
850
+ tabs: string[];
851
+ }, {
852
+ url: string;
853
+ tabs?: string[] | undefined;
854
+ }>]>>;
44
855
  /** how long to let the game run before reading */
45
856
  settleMs: z.ZodDefault<z.ZodNumber>;
46
857
  timeoutMs: z.ZodDefault<z.ZodNumber>;
@@ -60,17 +871,47 @@ export declare const VerifySpecSchema: z.ZodObject<{
60
871
  min: number;
61
872
  max: number;
62
873
  }>]>>>;
874
+ /** what the inventory must hold, must not hold, or must hold exactly (any order) */
875
+ inventory: z.ZodOptional<z.ZodObject<{
876
+ has: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
877
+ lacks: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
878
+ exactly: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
879
+ }, "strip", z.ZodTypeAny, {
880
+ has: string[];
881
+ lacks: string[];
882
+ exactly?: string[] | undefined;
883
+ }, {
884
+ has?: string[] | undefined;
885
+ lacks?: string[] | undefined;
886
+ exactly?: string[] | undefined;
887
+ }>>;
888
+ /** the equipped item, or null for nothing */
889
+ equipped: z.ZodOptional<z.ZodNullable<z.ZodString>>;
890
+ /** flags that must read true or false (a flag the state doesn't report is a mismatch) */
891
+ flags: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
63
892
  }, "strip", z.ZodTypeAny, {
64
893
  counters: Record<string, number | {
65
894
  min: number;
66
895
  max: number;
67
896
  }>;
897
+ flags: Record<string, boolean>;
898
+ inventory?: {
899
+ has: string[];
900
+ lacks: string[];
901
+ exactly?: string[] | undefined;
902
+ } | undefined;
68
903
  roomId?: number | undefined;
69
904
  phase?: string | undefined;
70
905
  locationId?: string | undefined;
71
906
  difficulty?: string | undefined;
72
907
  variant?: string | undefined;
908
+ equipped?: string | null | undefined;
73
909
  }, {
910
+ inventory?: {
911
+ has?: string[] | undefined;
912
+ lacks?: string[] | undefined;
913
+ exactly?: string[] | undefined;
914
+ } | undefined;
74
915
  roomId?: number | undefined;
75
916
  phase?: string | undefined;
76
917
  locationId?: string | undefined;
@@ -80,6 +921,8 @@ export declare const VerifySpecSchema: z.ZodObject<{
80
921
  min: number;
81
922
  max: number;
82
923
  }> | undefined;
924
+ equipped?: string | null | undefined;
925
+ flags?: Record<string, boolean> | undefined;
83
926
  }>;
84
927
  /** values to read through the emulator too: each must equal the plugin's counter */
85
928
  memory: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodObject<{
@@ -109,22 +952,92 @@ export declare const VerifySpecSchema: z.ZodObject<{
109
952
  signed?: boolean | undefined;
110
953
  }>, "many">>;
111
954
  }, "strip", z.ZodTypeAny, {
955
+ steps: ({
956
+ press: string | string[];
957
+ holdMs: number;
958
+ everyMs: number;
959
+ maxTries: number;
960
+ until?: {
961
+ peek: string;
962
+ equals: number;
963
+ times: number;
964
+ } | {
965
+ state: {
966
+ counters: Record<string, number | {
967
+ min: number;
968
+ max: number;
969
+ }>;
970
+ flags: Record<string, boolean>;
971
+ inventory?: {
972
+ has: string[];
973
+ lacks: string[];
974
+ exactly?: string[] | undefined;
975
+ } | undefined;
976
+ roomId?: number | undefined;
977
+ phase?: string | undefined;
978
+ locationId?: string | undefined;
979
+ difficulty?: string | undefined;
980
+ variant?: string | undefined;
981
+ equipped?: string | null | undefined;
982
+ };
983
+ times: number;
984
+ } | undefined;
985
+ } | {
986
+ everyMs: number;
987
+ waitFor: {
988
+ peek: string;
989
+ equals: number;
990
+ times: number;
991
+ } | {
992
+ state: {
993
+ counters: Record<string, number | {
994
+ min: number;
995
+ max: number;
996
+ }>;
997
+ flags: Record<string, boolean>;
998
+ inventory?: {
999
+ has: string[];
1000
+ lacks: string[];
1001
+ exactly?: string[] | undefined;
1002
+ } | undefined;
1003
+ roomId?: number | undefined;
1004
+ phase?: string | undefined;
1005
+ locationId?: string | undefined;
1006
+ difficulty?: string | undefined;
1007
+ variant?: string | undefined;
1008
+ equipped?: string | null | undefined;
1009
+ };
1010
+ times: number;
1011
+ };
1012
+ timeoutMs: number;
1013
+ } | {
1014
+ frame: string;
1015
+ } | {
1016
+ waitMs: number;
1017
+ })[];
1018
+ timeoutMs: number;
112
1019
  game: string;
113
1020
  daemon: {
114
1021
  url: string;
115
1022
  };
116
1023
  settleMs: number;
117
- timeoutMs: number;
118
1024
  expect: {
119
1025
  counters: Record<string, number | {
120
1026
  min: number;
121
1027
  max: number;
122
1028
  }>;
1029
+ flags: Record<string, boolean>;
1030
+ inventory?: {
1031
+ has: string[];
1032
+ lacks: string[];
1033
+ exactly?: string[] | undefined;
1034
+ } | undefined;
123
1035
  roomId?: number | undefined;
124
1036
  phase?: string | undefined;
125
1037
  locationId?: string | undefined;
126
1038
  difficulty?: string | undefined;
127
1039
  variant?: string | undefined;
1040
+ equipped?: string | null | undefined;
128
1041
  };
129
1042
  memory: {
130
1043
  counter: string;
@@ -141,10 +1054,26 @@ export declare const VerifySpecSchema: z.ZodObject<{
141
1054
  port: number;
142
1055
  config?: string | undefined;
143
1056
  } | undefined;
144
- ui?: string | undefined;
1057
+ emulator?: {
1058
+ launchPrefix: string[];
1059
+ command: string[];
1060
+ } | undefined;
1061
+ gameslate?: string | undefined;
1062
+ ui?: {
1063
+ url: string;
1064
+ tabs: ("Map" | "Inventory" | "Missions" | "Ref")[];
1065
+ } | {
1066
+ url: string;
1067
+ tabs: string[];
1068
+ } | undefined;
145
1069
  }, {
146
1070
  game: string;
147
1071
  expect: {
1072
+ inventory?: {
1073
+ has?: string[] | undefined;
1074
+ lacks?: string[] | undefined;
1075
+ exactly?: string[] | undefined;
1076
+ } | undefined;
148
1077
  roomId?: number | undefined;
149
1078
  phase?: string | undefined;
150
1079
  locationId?: string | undefined;
@@ -154,7 +1083,73 @@ export declare const VerifySpecSchema: z.ZodObject<{
154
1083
  min: number;
155
1084
  max: number;
156
1085
  }> | undefined;
1086
+ equipped?: string | null | undefined;
1087
+ flags?: Record<string, boolean> | undefined;
157
1088
  };
1089
+ steps?: ({
1090
+ press: string | string[];
1091
+ holdMs?: number | undefined;
1092
+ until?: {
1093
+ peek: string;
1094
+ equals: number;
1095
+ times?: number | undefined;
1096
+ } | {
1097
+ state: {
1098
+ inventory?: {
1099
+ has?: string[] | undefined;
1100
+ lacks?: string[] | undefined;
1101
+ exactly?: string[] | undefined;
1102
+ } | undefined;
1103
+ roomId?: number | undefined;
1104
+ phase?: string | undefined;
1105
+ locationId?: string | undefined;
1106
+ difficulty?: string | undefined;
1107
+ variant?: string | undefined;
1108
+ counters?: Record<string, number | {
1109
+ min: number;
1110
+ max: number;
1111
+ }> | undefined;
1112
+ equipped?: string | null | undefined;
1113
+ flags?: Record<string, boolean> | undefined;
1114
+ };
1115
+ times?: number | undefined;
1116
+ } | undefined;
1117
+ everyMs?: number | undefined;
1118
+ maxTries?: number | undefined;
1119
+ } | {
1120
+ waitFor: {
1121
+ peek: string;
1122
+ equals: number;
1123
+ times?: number | undefined;
1124
+ } | {
1125
+ state: {
1126
+ inventory?: {
1127
+ has?: string[] | undefined;
1128
+ lacks?: string[] | undefined;
1129
+ exactly?: string[] | undefined;
1130
+ } | undefined;
1131
+ roomId?: number | undefined;
1132
+ phase?: string | undefined;
1133
+ locationId?: string | undefined;
1134
+ difficulty?: string | undefined;
1135
+ variant?: string | undefined;
1136
+ counters?: Record<string, number | {
1137
+ min: number;
1138
+ max: number;
1139
+ }> | undefined;
1140
+ equipped?: string | null | undefined;
1141
+ flags?: Record<string, boolean> | undefined;
1142
+ };
1143
+ times?: number | undefined;
1144
+ };
1145
+ everyMs?: number | undefined;
1146
+ timeoutMs?: number | undefined;
1147
+ } | {
1148
+ frame: string;
1149
+ } | {
1150
+ waitMs: number;
1151
+ })[] | undefined;
1152
+ timeoutMs?: number | undefined;
158
1153
  retroarch?: {
159
1154
  binary: string;
160
1155
  core: string;
@@ -164,12 +1159,19 @@ export declare const VerifySpecSchema: z.ZodObject<{
164
1159
  config?: string | undefined;
165
1160
  port?: number | undefined;
166
1161
  } | undefined;
1162
+ emulator?: {
1163
+ command: string[];
1164
+ launchPrefix?: string[] | undefined;
1165
+ } | undefined;
1166
+ gameslate?: string | undefined;
167
1167
  daemon?: {
168
1168
  url?: string | undefined;
169
1169
  } | undefined;
170
- ui?: string | undefined;
1170
+ ui?: string | {
1171
+ url: string;
1172
+ tabs?: string[] | undefined;
1173
+ } | undefined;
171
1174
  settleMs?: number | undefined;
172
- timeoutMs?: number | undefined;
173
1175
  memory?: {
174
1176
  counter: string;
175
1177
  size: 2 | 1 | 4;
@@ -179,6 +1181,12 @@ export declare const VerifySpecSchema: z.ZodObject<{
179
1181
  }>;
180
1182
  export type VerifySpec = z.infer<typeof VerifySpecSchema>;
181
1183
  type MemoryCheck = VerifySpec['memory'][number];
1184
+ /**
1185
+ * `${NAME}` in any string of a spec, from the environment, so a spec can be shared without one
1186
+ * machine's paths (`"${GOPHER64}"`, `"${N64_ROMS}/Mario Kart 64 (U).z64"`). Throws on a name that
1187
+ * isn't set.
1188
+ */
1189
+ export declare function expandEnv(value: unknown, env: Record<string, string | undefined>): unknown;
182
1190
  /** What doesn't match: one line each. */
183
1191
  export declare function stateMismatches(expect: VerifySpec['expect'], state: GameState): string[];
184
1192
  /** RetroArch's network command reading a value with RetroAchievements' addressing. */
@@ -187,10 +1195,13 @@ export declare function readCoreRamCommand(check: Pick<MemoryCheck, 'address' |
187
1195
  export declare function valueFromReply(reply: string, check: Pick<MemoryCheck, 'address' | 'size' | 'signed'>): number | string;
188
1196
  /** The effects a run needs. */
189
1197
  export interface VerifyEffects {
190
- /** starts the game; resolves once it's running */
1198
+ /** starts the game; resolves once it's running, with the emulator's pid when it started one */
191
1199
  launch(spec: VerifySpec): Promise<{
1200
+ pid?: number;
192
1201
  stop(): void;
193
1202
  }>;
1203
+ /** a `gameslate drive` command's output */
1204
+ drive(spec: VerifySpec, args: string[]): Promise<string>;
194
1205
  wait(ms: number): Promise<void>;
195
1206
  /** the daemon's next full state for `game` */
196
1207
  state(spec: VerifySpec): Promise<unknown>;
@@ -205,6 +1216,6 @@ export interface VerifyResult {
205
1216
  screenshots: string[];
206
1217
  state: GameState | null;
207
1218
  }
208
- /** Runs one check: start the game, let it settle, compare, screenshot, stop. */
1219
+ /** Runs one check: start the game, drive it to its moment, let it settle, compare, screenshot, stop. */
209
1220
  export declare function runVerify(spec: VerifySpec, effects: VerifyEffects): Promise<VerifyResult>;
210
1221
  export {};