@threenative/playtest 0.1.0 → 0.2.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.
@@ -1,549 +0,0 @@
1
- type PlaytestCapability = "browser.canvas" | "browser.console" | "browser.dom" | "browser.input" | "browser.network" | "browser.screenshot" | "browser.trace" | "camera.observe" | "entity.bounds" | "entity.observe" | "entity.setup" | "runtime.animation" | "runtime.audio" | "runtime.components" | "runtime.contacts" | "runtime.diagnostics" | "runtime.events" | "runtime.fixedStep" | "runtime.physics" | "runtime.resources" | "runtime.state" | "runtime.tags" | "runtime.ui" | "runtime.world";
2
- interface IPlaytestCapabilityDescriptor {
3
- description: string;
4
- name: PlaytestCapability;
5
- protocolVersion: 1;
6
- }
7
- declare const PLAYTEST_CAPABILITY_REGISTRY: readonly IPlaytestCapabilityDescriptor[];
8
- declare function unknownPlaytestCapabilities(capabilities: readonly string[]): string[];
9
- declare function missingPlaytestCapabilities(required: readonly string[], available: readonly string[]): string[];
10
-
11
- type PlaytestVec3 = [number, number, number];
12
- interface IPlaytestTransformSample {
13
- frame: number;
14
- position: PlaytestVec3;
15
- rotation?: readonly [number, number, number, number];
16
- tick: number;
17
- }
18
- interface IPlaytestFollowReport {
19
- after?: IPlaytestTransformSample;
20
- before?: IPlaytestTransformSample;
21
- entity: string;
22
- moved?: number;
23
- separation?: number;
24
- within: number;
25
- }
26
- interface IPlaytestReport {
27
- after?: IPlaytestTransformSample;
28
- assertionResults?: IPlaytestAssertionResult[];
29
- before?: IPlaytestTransformSample;
30
- diagnostics: IPlaytestDiagnostic[];
31
- distance: number;
32
- effectLog?: unknown;
33
- entity: string;
34
- expectAxis?: string;
35
- expectMoved: boolean;
36
- follow?: IPlaytestFollowReport;
37
- frames: number;
38
- movementDelta?: PlaytestVec3;
39
- observations?: IPlaytestObservations;
40
- pathLength?: number;
41
- }
42
-
43
- type PlaytestTarget = "web" | "desktop" | "bevy";
44
- type PlaytestInputDelivery = "deterministic" | "focused-dom";
45
- interface IPlaytestViewport {
46
- height: number;
47
- width: number;
48
- }
49
- interface IPlaytestStep {
50
- kind?: "input" | "wait";
51
- holdFrames?: number;
52
- holdTicks?: number;
53
- label?: string;
54
- overlayMessage?: {
55
- overlayId: string;
56
- payload: unknown;
57
- type: string;
58
- };
59
- pointerPosition?: {
60
- buttons?: number;
61
- x: number;
62
- y: number;
63
- };
64
- /** A string presses one key; an array describes the complete held-key set. */
65
- press?: string | readonly string[];
66
- release: boolean;
67
- screenshot?: string;
68
- waitFrames?: number;
69
- waitTicks?: number;
70
- window?: {
71
- height?: number;
72
- operation: "minimize" | "resize" | "restore";
73
- width?: number;
74
- };
75
- }
76
- interface IPlaytestMovementAssertion {
77
- axis?: string;
78
- closesDistanceToPosition?: {
79
- position: [number, number, number];
80
- min: number;
81
- };
82
- entity?: string;
83
- facesMovementWithinDegrees?: number;
84
- minAxisDelta?: {
85
- axis: string;
86
- min: number;
87
- };
88
- minResolvedAxisDelta?: {
89
- axis: string;
90
- min: number;
91
- };
92
- maxTiltDegrees?: number;
93
- minDistance?: number;
94
- minVelocity?: number;
95
- maxDistance?: number;
96
- pathLength?: number;
97
- notFacing?: {
98
- entity: string;
99
- minDegrees: number;
100
- };
101
- notFacingPosition?: {
102
- position: [number, number, number];
103
- minDegrees: number;
104
- };
105
- reachesPositionWithin?: {
106
- atStep?: string;
107
- position: [number, number, number];
108
- maxDistance: number;
109
- };
110
- rotationChanged?: boolean;
111
- }
112
- interface IPlaytestCameraAssertion {
113
- entity?: string;
114
- follows?: string;
115
- targetInViewport?: boolean;
116
- within?: number;
117
- }
118
- interface IPlaytestPathAssertion {
119
- atSteps?: Array<{
120
- equals?: unknown;
121
- label: string;
122
- textIncludes?: string;
123
- }>;
124
- changed?: boolean;
125
- equals?: unknown;
126
- gte?: number;
127
- id: string;
128
- allowTrivial?: boolean;
129
- path?: string;
130
- textIncludes?: string;
131
- throughoutSteps?: boolean;
132
- }
133
- interface IPlaytestResourcePathAlternative {
134
- changed?: boolean;
135
- equals?: unknown;
136
- gte?: number;
137
- path: string;
138
- textIncludes?: string;
139
- }
140
- interface IPlaytestResourcePathAssertion extends IPlaytestPathAssertion {
141
- anyOf?: never;
142
- }
143
- interface IPlaytestResourceAnyOfAssertion {
144
- anyOf: IPlaytestResourcePathAlternative[];
145
- atSteps?: never;
146
- changed?: never;
147
- equals?: never;
148
- gte?: never;
149
- id: string;
150
- allowTrivial?: never;
151
- path?: never;
152
- textIncludes?: never;
153
- throughoutSteps?: never;
154
- }
155
- type IPlaytestResourceAssertion = IPlaytestResourceAnyOfAssertion | IPlaytestResourcePathAssertion;
156
- interface IPlaytestComponentAssertion extends Omit<IPlaytestPathAssertion, "id" | "textIncludes" | "throughoutSteps"> {
157
- component: string;
158
- entity: string;
159
- }
160
- interface IPlaytestContactAssertion {
161
- atStep?: string;
162
- entity?: string;
163
- kind?: string;
164
- maxCount?: number;
165
- minCount?: number;
166
- requiredOn?: PlaytestTarget[];
167
- with?: string;
168
- }
169
- interface IPlaytestSignalAssertion {
170
- atStep?: string;
171
- entity?: string;
172
- maxCount?: number;
173
- minCount?: number;
174
- name: string;
175
- }
176
- interface IPlaytestSettledAssertion {
177
- atStep?: string;
178
- compareToStep?: string;
179
- entity: string;
180
- minBodies?: number;
181
- minMeanPoseDistance?: number;
182
- requiredOn?: PlaytestTarget[];
183
- }
184
- interface IPlaytestOccludedAssertion {
185
- entity?: string;
186
- target?: string;
187
- }
188
- interface IPlaytestOverlayNodeAssertion {
189
- attribute?: string;
190
- equals?: unknown;
191
- overlayId: string;
192
- selector: string;
193
- textIncludes?: string;
194
- visible?: boolean;
195
- }
196
- interface IPlaytestAnimationAssertion {
197
- advancedFrames?: number;
198
- clip?: string;
199
- entered?: boolean;
200
- entity?: string;
201
- }
202
- interface IPlaytestTagCountAssertion {
203
- count?: number;
204
- gte?: number;
205
- tag: string;
206
- }
207
- interface IPlaytestStateAssertion {
208
- entity: string;
209
- equals: string;
210
- }
211
- interface IPlaytestVisibilityAssertion {
212
- entity?: string;
213
- maxOffscreenRatio?: number;
214
- minProjectedPixels?: number;
215
- present?: boolean;
216
- }
217
- interface IPlaytestDiagnosticsAssertion {
218
- noConsoleErrors?: boolean;
219
- noNetworkErrors?: boolean;
220
- noRuntimeDiagnostics?: boolean;
221
- runtimeDiagnosticsOptOutReason?: string;
222
- runtimeReady?: boolean;
223
- }
224
- interface IPlaytestVisualAssertion {
225
- entityVisible?: {
226
- entity: string;
227
- minProjectedPixels: number;
228
- throughoutFrames?: boolean;
229
- };
230
- frameDiff?: {
231
- baselineImage?: string;
232
- maxChangedPixelRatio?: number;
233
- minChangedPixelRatio?: number;
234
- };
235
- region?: {
236
- height: number;
237
- maxLuminance?: number;
238
- minDarkPixelRatio?: number;
239
- minNonblankPixelRatio?: number;
240
- width: number;
241
- x: number;
242
- y: number;
243
- };
244
- }
245
- interface IPlaytestAerodynamicsAssertion {
246
- controls?: Array<{
247
- minAbs?: number;
248
- sign: "negative" | "positive";
249
- surface: string;
250
- }>;
251
- entity: string;
252
- minForceSamples?: number;
253
- torques?: Array<{
254
- axis: "x" | "y" | "z";
255
- label: string;
256
- minAbs?: number;
257
- relativeToLabel?: string;
258
- sign: "negative" | "positive";
259
- }>;
260
- }
261
- interface IPlaytestReachabilityAssertion {
262
- artifact: string;
263
- entities: string[];
264
- /** Loaded from artifact by loadPlaytestScenario; not authored in scenario JSON. */
265
- envelope?: {
266
- fallDistanceToGround: number;
267
- forwardReach: number;
268
- maxRise: number;
269
- };
270
- }
271
- interface IPlaytestWorldRuntimeAssertion {
272
- agent: string;
273
- core: string;
274
- randomState: number;
275
- rapier: string | null;
276
- step: number;
277
- }
278
- interface IPlaytestWorldAssertion {
279
- runtime?: IPlaytestWorldRuntimeAssertion;
280
- seed: number | null;
281
- }
282
- interface IPlaytestScenarioAssertions {
283
- aerodynamics?: IPlaytestAerodynamicsAssertion[];
284
- animation?: IPlaytestAnimationAssertion[];
285
- camera?: IPlaytestCameraAssertion;
286
- components?: IPlaytestComponentAssertion[];
287
- contacts?: IPlaytestContactAssertion[];
288
- diagnostics?: IPlaytestDiagnosticsAssertion;
289
- hud?: IPlaytestPathAssertion[];
290
- movement?: IPlaytestMovementAssertion;
291
- occluded?: IPlaytestOccludedAssertion[];
292
- overlayNodes?: IPlaytestOverlayNodeAssertion[];
293
- reachability?: IPlaytestReachabilityAssertion;
294
- resources?: IPlaytestResourceAssertion[];
295
- settled?: IPlaytestSettledAssertion[];
296
- signals?: IPlaytestSignalAssertion[];
297
- states?: IPlaytestStateAssertion[];
298
- tags?: IPlaytestTagCountAssertion[];
299
- visibility?: IPlaytestVisibilityAssertion[];
300
- visual?: IPlaytestVisualAssertion[];
301
- world?: IPlaytestWorldAssertion;
302
- }
303
- interface IPlaytestParityConfig {
304
- animation?: Array<{
305
- clip?: string;
306
- entity: string;
307
- requiredOn?: PlaytestTarget[];
308
- }>;
309
- axisDelta?: Partial<Record<"x" | "y" | "z", number>>;
310
- contacts?: {
311
- minSharedCount?: number;
312
- };
313
- movementDistance?: {
314
- maxDelta: number;
315
- };
316
- resources?: string[];
317
- targets?: PlaytestTarget[];
318
- }
319
- interface IPlaytestArtifactRequest {
320
- console?: boolean;
321
- contactSheet?: boolean;
322
- effectLog?: "focused" | boolean;
323
- network?: boolean;
324
- runtimeTrace?: boolean;
325
- screenshots?: "before-after" | "after" | false;
326
- }
327
- interface IPlaytestSetupEntityTransform {
328
- entity: string;
329
- position?: [number, number, number];
330
- rotation?: [number, number, number, number];
331
- scale?: [number, number, number];
332
- }
333
- interface IPlaytestSetupResource {
334
- id: string;
335
- path?: string;
336
- value: unknown;
337
- }
338
- interface IPlaytestScenarioSetup {
339
- entities?: IPlaytestSetupEntityTransform[];
340
- resources?: IPlaytestSetupResource[];
341
- }
342
- interface IPlaytestScenario {
343
- acceptanceId?: string;
344
- artifacts?: IPlaytestArtifactRequest;
345
- assert?: IPlaytestScenarioAssertions;
346
- inputDelivery?: PlaytestInputDelivery;
347
- name: string;
348
- parity?: IPlaytestParityConfig;
349
- schemaVersion: 1;
350
- setup?: IPlaytestScenarioSetup;
351
- sourcePath?: string;
352
- steps: IPlaytestStep[];
353
- subject?: string;
354
- target: PlaytestTarget;
355
- viewport: IPlaytestViewport;
356
- warmupFrames: number;
357
- }
358
- interface IPlaytestScenarioDiagnostic {
359
- code: "TN_PLAYTEST_SCENARIO_INVALID" | "TN_PLAYTEST_SCENARIO_NOT_FOUND" | "TN_PLAYTEST_SCENARIO_STEP_INVALID";
360
- fix?: {
361
- docs?: string;
362
- instruction: string;
363
- snippet?: string;
364
- };
365
- message: string;
366
- severity: "error";
367
- suggestion?: string;
368
- }
369
- declare class PlaytestScenarioError extends Error {
370
- readonly diagnostic: IPlaytestScenarioDiagnostic;
371
- constructor(diagnostic: IPlaytestScenarioDiagnostic);
372
- }
373
- declare function loadPlaytestScenario(projectPath: string, scenarioPath: string): Promise<IPlaytestScenario>;
374
- declare function oneShotScenario(options: {
375
- expectAxis?: string;
376
- expectMoved: boolean;
377
- follow?: {
378
- entityId: string;
379
- within: number;
380
- };
381
- frames: number;
382
- movementThreshold: number;
383
- press: string;
384
- subject: string;
385
- target?: PlaytestTarget;
386
- viewport?: IPlaytestViewport;
387
- }): IPlaytestScenario;
388
- declare function applyScenarioOverrides(scenario: IPlaytestScenario, overrides: {
389
- target?: PlaytestTarget;
390
- viewport?: IPlaytestViewport;
391
- }): IPlaytestScenario;
392
- declare function parsePlaytestTarget(value: string | undefined): PlaytestTarget | undefined;
393
- declare function parseViewport(value: string | undefined): IPlaytestViewport | undefined;
394
- declare function playtestStepHoldTicks(step: IPlaytestStep, fallback?: number): number;
395
- declare function playtestStepWaitTicks(step: IPlaytestStep): number;
396
- declare function invalidScenario(scenarioPath: string, message: string): PlaytestScenarioError;
397
- declare function rejectUnknownKeys(value: Record<string, unknown>, allowedKeys: readonly string[], scenarioPath: string, objectPath: string): void;
398
-
399
- type Vec3 = [number, number, number];
400
- interface IPlaytestAssertionSchemaField {
401
- description: string;
402
- name: string;
403
- required?: boolean;
404
- type: string;
405
- }
406
- interface IPlaytestAssertionSchemaEntry {
407
- cardinality: "array" | "object";
408
- description: string;
409
- example: unknown;
410
- fields: IPlaytestAssertionSchemaField[];
411
- kind: keyof NonNullable<IPlaytestScenario["assert"]>;
412
- observationPath: string;
413
- requiredCapabilities: readonly PlaytestCapability[];
414
- resultIdPrefix: string;
415
- supportedOn: readonly PlaytestTarget[];
416
- triviality: "not-applicable" | "reject-initial-value";
417
- }
418
- declare const PLAYTEST_ASSERTION_REGISTRY: readonly IPlaytestAssertionSchemaEntry[];
419
- interface IPlaytestSetupSchemaEntry {
420
- description: string;
421
- kind: keyof NonNullable<IPlaytestScenario["setup"]>;
422
- requiredCapabilities: readonly PlaytestCapability[];
423
- }
424
- declare const PLAYTEST_SETUP_REGISTRY: readonly IPlaytestSetupSchemaEntry[];
425
- declare function requiredPlaytestCapabilities(scenario: IPlaytestScenario): PlaytestCapability[];
426
- interface IPlaytestDiagnostic {
427
- artifactPath?: string;
428
- code: string;
429
- exportName?: string;
430
- gate?: "waived-headless";
431
- message: string;
432
- modulePath?: string;
433
- observedRuntimePath?: string;
434
- path?: string;
435
- resourceId?: string;
436
- severity: "error" | "warning";
437
- sourcePath?: string;
438
- suggestion?: string;
439
- systemId?: string;
440
- }
441
- interface IPlaytestAssertionResult {
442
- details?: Record<string, unknown>;
443
- id: string;
444
- pass: boolean;
445
- }
446
- interface IPlaytestObservations {
447
- animation?: unknown;
448
- components?: Record<string, Record<string, {
449
- after?: unknown;
450
- before?: unknown;
451
- }>>;
452
- componentSeries?: Array<{
453
- label: string;
454
- snapshots: Record<string, Record<string, unknown>>;
455
- tick: number;
456
- }>;
457
- console: Array<{
458
- text: string;
459
- type: string;
460
- }>;
461
- contacts?: unknown;
462
- debugColliderCount?: number;
463
- effectLog?: unknown;
464
- effectLogSeries?: Array<{
465
- label: string;
466
- snapshot: unknown;
467
- tick: number;
468
- }>;
469
- entityTransforms?: Record<string, {
470
- halfExtents?: Vec3;
471
- position?: Vec3;
472
- scale?: Vec3;
473
- }>;
474
- hud: Record<string, {
475
- after?: unknown;
476
- before?: unknown;
477
- }>;
478
- overlayNodes?: Record<string, {
479
- after?: unknown;
480
- before?: unknown;
481
- }>;
482
- network: Array<{
483
- method: string;
484
- url: string;
485
- }>;
486
- physicsDebug?: unknown;
487
- physicsDebugSeries?: Array<{
488
- label: string;
489
- snapshot: unknown;
490
- tick: number;
491
- }>;
492
- resources: Record<string, {
493
- after?: unknown;
494
- before?: unknown;
495
- }>;
496
- resourceSeries?: Array<{
497
- label: string;
498
- snapshots: Record<string, unknown>;
499
- tick: number;
500
- }>;
501
- runtimeObservations?: unknown;
502
- runtimeDiagnostics?: unknown;
503
- signals?: unknown[];
504
- signalSeries?: Array<{
505
- label: string;
506
- signals: unknown[];
507
- tick: number;
508
- }>;
509
- visibility?: Record<string, unknown>;
510
- visual?: {
511
- changedPixelRatio?: number;
512
- comparisonSource?: string;
513
- nonblankRegions?: Array<{
514
- darkPixelRatio?: number;
515
- height: number;
516
- nonblankPixelRatio: number;
517
- width: number;
518
- x: number;
519
- y: number;
520
- }>;
521
- runtimeDiagnosticsSeries?: unknown[];
522
- };
523
- }
524
- declare function evaluateRichPlaytestAssertions(input: {
525
- report: IPlaytestReport;
526
- scenario: IPlaytestScenario;
527
- }): {
528
- assertions: IPlaytestAssertionResult[];
529
- diagnostics: IPlaytestDiagnostic[];
530
- };
531
- declare function overlayNodeObservationKey(overlayId: string, selector: string): string;
532
-
533
- type PlaytestDiagnosticCode = "TN_PLAYTEST_BRIDGE_INCOMPATIBLE" | "TN_PLAYTEST_BRIDGE_CAPABILITY_UNKNOWN" | "TN_PLAYTEST_BRIDGE_MISSING" | "TN_PLAYTEST_BRIDGE_NOT_READY" | "TN_PLAYTEST_CAPABILITY_MISSING" | "TN_PLAYTEST_DEVICE_FAILED" | "TN_PLAYTEST_OBSERVATION_UNAVAILABLE" | "TN_PLAYTEST_OPERATION_TIMEOUT" | "TN_PLAYTEST_PAYLOAD_TOO_LARGE" | "TN_PLAYTEST_SERVER_FAILED" | "TN_PLAYTEST_UNSUPPORTED_ON_TARGET";
534
- interface IPlaytestProtocolDiagnostic {
535
- capability?: string;
536
- code: PlaytestDiagnosticCode;
537
- fix: {
538
- instruction: string;
539
- nextCommand?: string;
540
- };
541
- message: string;
542
- path?: string;
543
- severity: "error";
544
- }
545
- declare function playtestDiagnostic(code: PlaytestDiagnosticCode, message: string, instruction: string, details?: Pick<IPlaytestProtocolDiagnostic, "capability" | "path"> & {
546
- nextCommand?: string;
547
- }): IPlaytestProtocolDiagnostic;
548
-
549
- export { applyScenarioOverrides as $, type IPlaytestScenarioAssertions as A, type IPlaytestScenarioDiagnostic as B, type IPlaytestScenarioSetup as C, type IPlaytestSettledAssertion as D, type IPlaytestSetupEntityTransform as E, type IPlaytestSetupResource as F, type IPlaytestSetupSchemaEntry as G, type IPlaytestSignalAssertion as H, type IPlaytestAerodynamicsAssertion as I, type IPlaytestStateAssertion as J, type IPlaytestStep as K, type IPlaytestTagCountAssertion as L, type IPlaytestTransformSample as M, type IPlaytestViewport as N, type IPlaytestVisibilityAssertion as O, type IPlaytestVisualAssertion as P, type IPlaytestWorldAssertion as Q, type IPlaytestWorldRuntimeAssertion as R, PLAYTEST_ASSERTION_REGISTRY as S, PLAYTEST_CAPABILITY_REGISTRY as T, PLAYTEST_SETUP_REGISTRY as U, type PlaytestCapability as V, type PlaytestDiagnosticCode as W, type PlaytestInputDelivery as X, PlaytestScenarioError as Y, type PlaytestTarget as Z, type PlaytestVec3 as _, type IPlaytestAnimationAssertion as a, evaluateRichPlaytestAssertions as a0, invalidScenario as a1, loadPlaytestScenario as a2, missingPlaytestCapabilities as a3, oneShotScenario as a4, overlayNodeObservationKey as a5, parsePlaytestTarget as a6, parseViewport as a7, playtestDiagnostic as a8, playtestStepHoldTicks as a9, playtestStepWaitTicks as aa, rejectUnknownKeys as ab, requiredPlaytestCapabilities as ac, unknownPlaytestCapabilities as ad, type IPlaytestArtifactRequest as b, type IPlaytestAssertionResult as c, type IPlaytestAssertionSchemaEntry as d, type IPlaytestAssertionSchemaField as e, type IPlaytestCameraAssertion as f, type IPlaytestCapabilityDescriptor as g, type IPlaytestComponentAssertion as h, type IPlaytestContactAssertion as i, type IPlaytestDiagnostic as j, type IPlaytestDiagnosticsAssertion as k, type IPlaytestFollowReport as l, type IPlaytestMovementAssertion as m, type IPlaytestObservations as n, type IPlaytestOccludedAssertion as o, type IPlaytestOverlayNodeAssertion as p, type IPlaytestParityConfig as q, type IPlaytestPathAssertion as r, type IPlaytestProtocolDiagnostic as s, type IPlaytestReachabilityAssertion as t, type IPlaytestReport as u, type IPlaytestResourceAnyOfAssertion as v, type IPlaytestResourceAssertion as w, type IPlaytestResourcePathAlternative as x, type IPlaytestResourcePathAssertion as y, type IPlaytestScenario as z };
package/dist/index.d.ts DELETED
@@ -1,25 +0,0 @@
1
- export { I as IPlaytestAerodynamicsAssertion, a as IPlaytestAnimationAssertion, b as IPlaytestArtifactRequest, c as IPlaytestAssertionResult, d as IPlaytestAssertionSchemaEntry, e as IPlaytestAssertionSchemaField, f as IPlaytestCameraAssertion, g as IPlaytestCapabilityDescriptor, h as IPlaytestComponentAssertion, i as IPlaytestContactAssertion, j as IPlaytestDiagnostic, k as IPlaytestDiagnosticsAssertion, l as IPlaytestFollowReport, m as IPlaytestMovementAssertion, n as IPlaytestObservations, o as IPlaytestOccludedAssertion, p as IPlaytestOverlayNodeAssertion, q as IPlaytestParityConfig, r as IPlaytestPathAssertion, s as IPlaytestProtocolDiagnostic, t as IPlaytestReachabilityAssertion, u as IPlaytestReport, v as IPlaytestResourceAnyOfAssertion, w as IPlaytestResourceAssertion, x as IPlaytestResourcePathAlternative, y as IPlaytestResourcePathAssertion, z as IPlaytestScenario, A as IPlaytestScenarioAssertions, B as IPlaytestScenarioDiagnostic, C as IPlaytestScenarioSetup, D as IPlaytestSettledAssertion, E as IPlaytestSetupEntityTransform, F as IPlaytestSetupResource, G as IPlaytestSetupSchemaEntry, H as IPlaytestSignalAssertion, J as IPlaytestStateAssertion, K as IPlaytestStep, L as IPlaytestTagCountAssertion, M as IPlaytestTransformSample, N as IPlaytestViewport, O as IPlaytestVisibilityAssertion, P as IPlaytestVisualAssertion, Q as IPlaytestWorldAssertion, R as IPlaytestWorldRuntimeAssertion, S as PLAYTEST_ASSERTION_REGISTRY, T as PLAYTEST_CAPABILITY_REGISTRY, U as PLAYTEST_SETUP_REGISTRY, V as PlaytestCapability, W as PlaytestDiagnosticCode, X as PlaytestInputDelivery, Y as PlaytestScenarioError, Z as PlaytestTarget, _ as PlaytestVec3, $ as applyScenarioOverrides, a0 as evaluateRichPlaytestAssertions, a1 as invalidScenario, a2 as loadPlaytestScenario, a3 as missingPlaytestCapabilities, a4 as oneShotScenario, a5 as overlayNodeObservationKey, a6 as parsePlaytestTarget, a7 as parseViewport, a8 as playtestDiagnostic, a9 as playtestStepHoldTicks, aa as playtestStepWaitTicks, ab as rejectUnknownKeys, ac as requiredPlaytestCapabilities, ad as unknownPlaytestCapabilities } from './diagnostics-Ckm_5lrw.js';
2
- export { I as IPlaytestAdvanceResult, a as IPlaytestAnimationObservation, b as IPlaytestBridgeDescription, c as IPlaytestBridgeHost, d as IPlaytestBridgeReady, e as IPlaytestBridgeV1, f as IPlaytestContactObservation, g as IPlaytestDeviceRequest, h as IPlaytestDeviceResponse, i as IPlaytestEntityObservation, j as IPlaytestEntityTransform, k as IPlaytestGameplayObservation, l as IPlaytestObservationSnapshot, m as IPlaytestSampleRequest, n as IPlaytestSetupRequest, o as IPlaytestTagObservation, p as IPlaytestWorldObservation, q as IPlaytestWorldRuntimeObservation, J as JsonPrimitive, r as JsonValue, P as PLAYTEST_BRIDGE_GLOBAL, s as PLAYTEST_PROTOCOL_LIMITS, t as PLAYTEST_PROTOCOL_VERSION, u as PlaytestClockMode, v as assertJsonSafe, w as jsonByteLength } from './protocol-CeC1lz_G.js';
3
-
4
- type ReplayPointer = readonly [number, number, number, number, number];
5
- interface IReplayRecordingSample {
6
- readonly keys: readonly string[];
7
- readonly pointer?: ReplayPointer;
8
- readonly tick: number;
9
- }
10
- interface IReplayRecording {
11
- readonly input: readonly IReplayRecordingSample[];
12
- readonly randomState: number;
13
- readonly runtime: {
14
- agent: string;
15
- core: string;
16
- rapier: string | null;
17
- step: number;
18
- };
19
- readonly seed: number;
20
- readonly ticks: number;
21
- readonly version: 1;
22
- }
23
- declare function parseReplayRecording(value: unknown): IReplayRecording;
24
-
25
- export { type IReplayRecording, type IReplayRecordingSample, type ReplayPointer, parseReplayRecording };
@@ -1,130 +0,0 @@
1
- declare const PLAYTEST_BRIDGE_GLOBAL = "__THREENATIVE_PLAYTEST_BRIDGE__";
2
- declare const PLAYTEST_PROTOCOL_VERSION: 1;
3
- declare const PLAYTEST_PROTOCOL_LIMITS: {
4
- readonly maxEntitiesPerSample: 100;
5
- readonly maxEventsPerDrain: 1000;
6
- readonly maxPayloadBytes: 1000000;
7
- readonly operationTimeoutMs: 5000;
8
- };
9
- type JsonPrimitive = boolean | number | string | null;
10
- type JsonValue = JsonPrimitive | JsonValue[] | {
11
- [key: string]: JsonValue;
12
- };
13
- type PlaytestClockMode = "fixed-step" | "render-frame" | "wall-clock";
14
- interface IPlaytestBridgeDescription {
15
- capabilities: readonly string[];
16
- limits: typeof PLAYTEST_PROTOCOL_LIMITS;
17
- name: string;
18
- protocolVersion: typeof PLAYTEST_PROTOCOL_VERSION;
19
- }
20
- interface IPlaytestBridgeReady {
21
- ready: boolean;
22
- reason?: string;
23
- }
24
- interface IPlaytestEntityTransform {
25
- position?: [number, number, number];
26
- rotation?: [number, number, number, number];
27
- scale?: [number, number, number];
28
- }
29
- interface IPlaytestSetupRequest {
30
- entities?: Array<{
31
- entity: string;
32
- transform: IPlaytestEntityTransform;
33
- }>;
34
- resources?: Array<{
35
- id: string;
36
- path?: string;
37
- value: JsonValue;
38
- }>;
39
- }
40
- interface IPlaytestSampleRequest {
41
- entities?: readonly string[];
42
- include?: readonly string[];
43
- resources?: readonly string[];
44
- }
45
- interface IPlaytestEntityObservation {
46
- bounds?: {
47
- height: number;
48
- width: number;
49
- x: number;
50
- y: number;
51
- };
52
- id: string;
53
- transform?: IPlaytestEntityTransform;
54
- visible?: boolean;
55
- }
56
- interface IPlaytestAnimationObservation {
57
- advancedFrames: number;
58
- clip: string;
59
- }
60
- interface IPlaytestContactObservation {
61
- entity: string;
62
- kind: string;
63
- with: string;
64
- }
65
- interface IPlaytestTagObservation {
66
- count: number;
67
- }
68
- interface IPlaytestWorldRuntimeObservation {
69
- agent: string;
70
- core: string;
71
- randomState: number;
72
- rapier: string | null;
73
- step: number;
74
- }
75
- interface IPlaytestWorldObservation {
76
- runtime?: IPlaytestWorldRuntimeObservation;
77
- seed: number | null;
78
- }
79
- interface IPlaytestGameplayObservation {
80
- animation: Record<string, IPlaytestAnimationObservation>;
81
- contacts?: IPlaytestContactObservation[];
82
- states: Record<string, string>;
83
- tags?: Record<string, IPlaytestTagObservation>;
84
- world?: IPlaytestWorldObservation;
85
- }
86
- interface IPlaytestObservationSnapshot {
87
- clock: {
88
- mode: PlaytestClockMode;
89
- tick?: number;
90
- timeMs?: number;
91
- };
92
- diagnostics?: JsonValue[];
93
- components?: Record<string, Record<string, JsonValue>>;
94
- entities?: IPlaytestEntityObservation[];
95
- gameplay?: IPlaytestGameplayObservation;
96
- resources?: Record<string, JsonValue>;
97
- }
98
- interface IPlaytestAdvanceResult {
99
- clock: IPlaytestObservationSnapshot["clock"];
100
- ticks: number;
101
- }
102
- interface IPlaytestBridgeV1 {
103
- advance?(ticks: number): Promise<IPlaytestAdvanceResult>;
104
- applySetup?(request: IPlaytestSetupRequest): Promise<void>;
105
- describe(): IPlaytestBridgeDescription | Promise<IPlaytestBridgeDescription>;
106
- drainEvents?(limit?: number): Promise<JsonValue[]>;
107
- focus?(): boolean | Promise<boolean>;
108
- ready(): IPlaytestBridgeReady | Promise<IPlaytestBridgeReady>;
109
- sample(request: IPlaytestSampleRequest): IPlaytestObservationSnapshot | Promise<IPlaytestObservationSnapshot>;
110
- }
111
- /** Request/response envelope used by the host-neutral device transport. */
112
- interface IPlaytestDeviceRequest {
113
- argument?: JsonValue;
114
- id: string;
115
- method: string;
116
- }
117
- interface IPlaytestDeviceResponse {
118
- error?: {
119
- message: string;
120
- };
121
- id: string;
122
- result?: JsonValue;
123
- }
124
- interface IPlaytestBridgeHost {
125
- [PLAYTEST_BRIDGE_GLOBAL]?: IPlaytestBridgeV1;
126
- }
127
- declare function jsonByteLength(value: JsonValue): number;
128
- declare function assertJsonSafe(value: unknown, path?: string): asserts value is JsonValue;
129
-
130
- export { type IPlaytestAdvanceResult as I, type JsonPrimitive as J, PLAYTEST_BRIDGE_GLOBAL as P, type IPlaytestAnimationObservation as a, type IPlaytestBridgeDescription as b, type IPlaytestBridgeHost as c, type IPlaytestBridgeReady as d, type IPlaytestBridgeV1 as e, type IPlaytestContactObservation as f, type IPlaytestDeviceRequest as g, type IPlaytestDeviceResponse as h, type IPlaytestEntityObservation as i, type IPlaytestEntityTransform as j, type IPlaytestGameplayObservation as k, type IPlaytestObservationSnapshot as l, type IPlaytestSampleRequest as m, type IPlaytestSetupRequest as n, type IPlaytestTagObservation as o, type IPlaytestWorldObservation as p, type IPlaytestWorldRuntimeObservation as q, type JsonValue as r, PLAYTEST_PROTOCOL_LIMITS as s, PLAYTEST_PROTOCOL_VERSION as t, type PlaytestClockMode as u, assertJsonSafe as v, jsonByteLength as w };