@threenative/playtest 0.3.3 → 0.3.5
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.
- package/README.md +40 -2
- package/dist/capture.d.ts +30 -1
- package/dist/capture.js +92 -2
- package/dist/diagnostics-BhS6v2n1.d.ts +800 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.js +1890 -140
- package/dist/protocol.d.ts +50 -2
- package/dist/protocol.js +10 -1
- package/dist/runner/cli.d.ts +4 -2
- package/dist/runner/cli.js +11425 -8070
- package/dist/runner/index.d.ts +163 -314
- package/dist/runner/index.js +12077 -9409
- package/dist/{diagnostics-Bpy15z5f.d.ts → schema-base-B5mr_Yr9.d.ts} +137 -440
- package/dist/shared-DK12BZyS.d.ts +489 -0
- package/dist/three/index.d.ts +19 -2
- package/dist/three/index.js +99 -27
- package/package.json +3 -2
- package/dist/shared-eFOF5bZO.d.ts +0 -288
|
@@ -0,0 +1,489 @@
|
|
|
1
|
+
import { e as IPlaytestScenario, j as IPlaytestPerformanceAssertion } from './schema-base-B5mr_Yr9.js';
|
|
2
|
+
import { IPlaytestSetupRequest, JsonValue, IPlaytestBridgeDescription, IPlaytestBridgeReady, IPlaytestSampleRequest, IPlaytestObservationSnapshot } from './protocol.js';
|
|
3
|
+
import { Page } from 'playwright';
|
|
4
|
+
import { p as IPlaytestSetupApplication, o as IPlaytestProtocolDiagnostic, I as IPlaytestReport, l as IPlaytestDiagnosticsPolicy, a as IPlaytestAssertionResult } from './diagnostics-BhS6v2n1.js';
|
|
5
|
+
|
|
6
|
+
/** The only seam between assertion orchestration and an application bridge. */
|
|
7
|
+
interface IBridgeTransport {
|
|
8
|
+
readonly capabilities: readonly string[];
|
|
9
|
+
call<T>(method: string, argument?: unknown, timeoutMs?: number, options?: unknown): Promise<T>;
|
|
10
|
+
close(): Promise<void>;
|
|
11
|
+
waitForBridge(timeoutMs: number): Promise<boolean>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The budget for one `advance` call: the round-trip allowance plus time for the ticks themselves.
|
|
15
|
+
*
|
|
16
|
+
* Every other bridge method is a request and a reply, so `operationTimeoutMs` fits. `advance` runs
|
|
17
|
+
* the game loop N times before replying, so its honest bound grows with N. Fixed at 5 s it failed
|
|
18
|
+
* `starter-game-over` — 600 ticks in one call — on a two-core runner, and reported it as
|
|
19
|
+
* `TN_PLAYTEST_OPERATION_TIMEOUT`, which reads as a hung page rather than a slow one.
|
|
20
|
+
*/
|
|
21
|
+
declare function advanceTimeoutMs(ticks: number, perTickMs?: number): number;
|
|
22
|
+
declare class PlaytestBridgeError extends Error {
|
|
23
|
+
readonly diagnostic: IPlaytestProtocolDiagnostic;
|
|
24
|
+
constructor(diagnostic: IPlaytestProtocolDiagnostic);
|
|
25
|
+
}
|
|
26
|
+
interface IPlaytestBridgeClient {
|
|
27
|
+
/** `render: true` draws a world frame per tick; the default advances without drawing. Browser bridges only. */
|
|
28
|
+
advance(ticks: number, options?: {
|
|
29
|
+
render?: boolean;
|
|
30
|
+
}): Promise<void>;
|
|
31
|
+
applySetup(request: IPlaytestSetupRequest): Promise<void>;
|
|
32
|
+
close(): Promise<void>;
|
|
33
|
+
drainEvents(limit?: number): Promise<JsonValue[]>;
|
|
34
|
+
description: IPlaytestBridgeDescription;
|
|
35
|
+
/** Setup applied before the handshake released a held game, when the scenario declared setup. */
|
|
36
|
+
setupApplication?: IPlaytestSetupApplication;
|
|
37
|
+
/** Re-reads the bridge's readiness, including startup progress when it reports any. */
|
|
38
|
+
readiness(): Promise<IPlaytestBridgeReady>;
|
|
39
|
+
/** Draws the current world once without advancing it. Requires `runtime.renderOnly`. */
|
|
40
|
+
renderOnly(): Promise<void>;
|
|
41
|
+
sample(request: IPlaytestSampleRequest): Promise<IPlaytestObservationSnapshot>;
|
|
42
|
+
}
|
|
43
|
+
declare class PlaywrightTransport implements IBridgeTransport {
|
|
44
|
+
private readonly page;
|
|
45
|
+
private readonly operationTimeoutMs;
|
|
46
|
+
readonly capabilities: readonly ["browser.canvas", "browser.console", "browser.dom", "browser.input", "browser.network", "browser.screenshot", "browser.trace", "runtime.diagnostics", "runtime.ui"];
|
|
47
|
+
constructor(page: Page, operationTimeoutMs?: number);
|
|
48
|
+
call<T>(method: string, argument?: unknown, timeoutMs?: number, options?: unknown): Promise<T>;
|
|
49
|
+
close(): Promise<void>;
|
|
50
|
+
waitForBridge(timeoutMs: number): Promise<boolean>;
|
|
51
|
+
}
|
|
52
|
+
declare function connectPlaytestBridge(page: Page, scenario: IPlaytestScenario, timeoutMs?: number): Promise<IPlaytestBridgeClient | undefined>;
|
|
53
|
+
/**
|
|
54
|
+
* How long to wait for the page to install its playtest bridge — and for the handshake to answer.
|
|
55
|
+
*
|
|
56
|
+
* The bridge appears during application startup, not during a request/response round trip, so
|
|
57
|
+
* `operationTimeoutMs` is the wrong budget for it by construction — the same mistake, in the same
|
|
58
|
+
* direction, as timing a bulk `advance` with it. On a software-rendered two-core runner the
|
|
59
|
+
* scaffolded starter spends seconds in first-use compilation before the bridge exists, and the run
|
|
60
|
+
* was reported as `TN_PLAYTEST_BRIDGE_MISSING` with `frames: 0`: not a page without a bridge, a
|
|
61
|
+
* page that had not finished booting yet.
|
|
62
|
+
*
|
|
63
|
+
* One operation plus the startup budget, matching `advanceTimeoutMs`. A page that genuinely
|
|
64
|
+
* installs no bridge still fails with the same diagnostic, just later.
|
|
65
|
+
*/
|
|
66
|
+
declare function bridgeWaitTimeoutMs(operationMs?: number): number;
|
|
67
|
+
declare function connectPlaytestBridgeTransport(transport: IBridgeTransport, scenario: IPlaytestScenario, timeoutMs?: number, target?: string): Promise<IPlaytestBridgeClient | undefined>;
|
|
68
|
+
|
|
69
|
+
/** Capture the largest rendered canvas bounds without waiting for locator screenshot stability. */
|
|
70
|
+
declare function captureVisualSurface(page: Page, artifactPath?: string): Promise<Buffer | undefined>;
|
|
71
|
+
/**
|
|
72
|
+
* The core bridge is installed before an async scene load completes, so its describe/ready
|
|
73
|
+
* handshake can finish one browser frame before the fixed-step loop starts. Retry only that
|
|
74
|
+
* exact startup race; a stopped loop that does not recover remains a runner failure.
|
|
75
|
+
*/
|
|
76
|
+
declare function advanceFixedStep(page: Page, bridge: Pick<IPlaytestBridgeClient, "advance">, ticks: number, render?: boolean): Promise<void>;
|
|
77
|
+
declare function playtestStepDrivesMovement(step: IPlaytestScenario["steps"][number], hasHeldInput: boolean): boolean;
|
|
78
|
+
interface ICompletionWindow {
|
|
79
|
+
label: string;
|
|
80
|
+
setupSnapshot?: IPlaytestObservationSnapshot;
|
|
81
|
+
provenance?: {
|
|
82
|
+
requestedDisplay: string;
|
|
83
|
+
qualified: false;
|
|
84
|
+
browserArgs?: readonly string[];
|
|
85
|
+
nativeVsync?: string;
|
|
86
|
+
};
|
|
87
|
+
metric: "application-completion-interval";
|
|
88
|
+
clock: "wall-clock";
|
|
89
|
+
source: string;
|
|
90
|
+
timebase: string;
|
|
91
|
+
epoch: number;
|
|
92
|
+
startTick: number;
|
|
93
|
+
startMs: number;
|
|
94
|
+
endMs: number;
|
|
95
|
+
durationMs: number;
|
|
96
|
+
intervalCount: number;
|
|
97
|
+
dropped: {
|
|
98
|
+
min: number;
|
|
99
|
+
max: number;
|
|
100
|
+
};
|
|
101
|
+
completionIntervalP50Ms: number;
|
|
102
|
+
samples: {
|
|
103
|
+
sequence: number;
|
|
104
|
+
completedAtMs: number;
|
|
105
|
+
}[];
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
interface ICpuWindow {
|
|
109
|
+
label: string;
|
|
110
|
+
frames: number;
|
|
111
|
+
/** Stack sampling perturbs these counters: diagnostic runs never qualify as benchmarks. */
|
|
112
|
+
profile?: {
|
|
113
|
+
kind: "perf-record";
|
|
114
|
+
path: string;
|
|
115
|
+
recorderScope: "native-process" | "main-thread";
|
|
116
|
+
};
|
|
117
|
+
startTick: number;
|
|
118
|
+
endTick: number;
|
|
119
|
+
startUs: number;
|
|
120
|
+
endUs: number;
|
|
121
|
+
updates: number;
|
|
122
|
+
renders: number;
|
|
123
|
+
mainThread: {
|
|
124
|
+
pid: number;
|
|
125
|
+
tid: number;
|
|
126
|
+
starttime: string;
|
|
127
|
+
cpuNs: number;
|
|
128
|
+
cpuMs: number;
|
|
129
|
+
cpuMsPerFrame: number;
|
|
130
|
+
instructions: number;
|
|
131
|
+
instructionsPerFrame: number;
|
|
132
|
+
cycles: number;
|
|
133
|
+
cyclesPerFrame: number;
|
|
134
|
+
};
|
|
135
|
+
processTree: {
|
|
136
|
+
cpuMs: number;
|
|
137
|
+
pids: number[];
|
|
138
|
+
};
|
|
139
|
+
host: {
|
|
140
|
+
load: number[];
|
|
141
|
+
governors: Record<string, string>;
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
interface IPlaytestServerConfig {
|
|
146
|
+
command: string;
|
|
147
|
+
cwd?: string;
|
|
148
|
+
timeoutMs?: number;
|
|
149
|
+
}
|
|
150
|
+
interface IStandalonePlaytestConfig {
|
|
151
|
+
/**
|
|
152
|
+
* Accept a software WebGPU adapter. Off by default: without `--enable-features=Vulkan`, or
|
|
153
|
+
* headless on a host whose GPU the browser will not reach, Chromium serves WebGPU from
|
|
154
|
+
* SwiftShader and nothing errors — the adapter answers, limits look healthy, and the run
|
|
155
|
+
* reports a CPU rasteriser's results. A run that cannot name a hardware adapter is not
|
|
156
|
+
* render evidence, so it fails unless the operator says otherwise.
|
|
157
|
+
*/
|
|
158
|
+
allowSoftwareAdapter?: boolean;
|
|
159
|
+
android?: {
|
|
160
|
+
activity: string;
|
|
161
|
+
packageName: string;
|
|
162
|
+
user?: string;
|
|
163
|
+
};
|
|
164
|
+
adbPath?: string;
|
|
165
|
+
/** @see IAndroidDriverOptions.touchRotation */
|
|
166
|
+
touchRotation?: number;
|
|
167
|
+
/**
|
|
168
|
+
* The built artifact this run is about to exercise, for `--build-report` to hash. Set by
|
|
169
|
+
* `--artifact`; desktop and iOS already name theirs, so the flag is refused there.
|
|
170
|
+
*/
|
|
171
|
+
artifactPath?: string;
|
|
172
|
+
artifactDirectory: string;
|
|
173
|
+
/**
|
|
174
|
+
* The `<artifact>.build-report.json` a `threenative build` published beside the artifact, carrying
|
|
175
|
+
* the profile's `performanceBudget`. Resolved and proved against the artifact under test before
|
|
176
|
+
* anything launches; its budget is merged into every scenario's `assert.performance`.
|
|
177
|
+
*/
|
|
178
|
+
buildReportPath?: string;
|
|
179
|
+
/**
|
|
180
|
+
* Capture the run's `before.png`/`after.png` artifact frames. Default true. A scenario that
|
|
181
|
+
* asserts on a frame still captures one — this only drops the convenience captures every run
|
|
182
|
+
* takes whether or not anything reads them.
|
|
183
|
+
*/
|
|
184
|
+
captureArtifactScreenshots?: boolean;
|
|
185
|
+
browserArgs?: readonly string[];
|
|
186
|
+
/** Write a Chrome DevTools `.cpuprofile` for this run (browser and desktop targets). */
|
|
187
|
+
cpuProfilePath?: string;
|
|
188
|
+
device?: string;
|
|
189
|
+
desktop?: {
|
|
190
|
+
executable: string;
|
|
191
|
+
hostArgs?: readonly string[];
|
|
192
|
+
};
|
|
193
|
+
endpoint?: string;
|
|
194
|
+
headless: boolean;
|
|
195
|
+
ios?: {
|
|
196
|
+
appPath?: string;
|
|
197
|
+
bundleId: string;
|
|
198
|
+
transport: "device" | "simulator";
|
|
199
|
+
};
|
|
200
|
+
judgeMarkerUrl?: string;
|
|
201
|
+
/**
|
|
202
|
+
* Measure the game as it plays, instead of counting the scenario's own ticks.
|
|
203
|
+
*
|
|
204
|
+
* Injects `__THREENATIVE_PLAYTEST_CLOCK__ = "wall-clock"` ahead of every page script, so the
|
|
205
|
+
* host's frame pump moves the simulation and `advance` names the span its ticks cover — the
|
|
206
|
+
* browser half of what the native production profile's `--live-clock` already does there. It is
|
|
207
|
+
* a measurement opt-in and never a scenario semantics change: a deterministic scenario is still
|
|
208
|
+
* a count of ticks, and a run that takes this flag reports the clock it measured on.
|
|
209
|
+
*/
|
|
210
|
+
liveClock?: boolean;
|
|
211
|
+
mailboxRoot?: string;
|
|
212
|
+
/**
|
|
213
|
+
* The performance ceilings the build report declared, already proved against the artifact under
|
|
214
|
+
* test. Merged into each scenario's `assert.performance`; absent when no report was passed.
|
|
215
|
+
*/
|
|
216
|
+
performanceBudget?: IPlaytestPerformanceAssertion;
|
|
217
|
+
port?: number;
|
|
218
|
+
projectPath: string;
|
|
219
|
+
scenarioPath: string;
|
|
220
|
+
scenarioPaths?: readonly string[];
|
|
221
|
+
server?: IPlaytestServerConfig;
|
|
222
|
+
timeoutMs: number;
|
|
223
|
+
target?: "android" | "browser" | "desktop" | "ios";
|
|
224
|
+
trace: boolean;
|
|
225
|
+
url: string;
|
|
226
|
+
xcrunPath?: string;
|
|
227
|
+
}
|
|
228
|
+
interface IPlaytestFlagHelp {
|
|
229
|
+
default: string;
|
|
230
|
+
summary: string;
|
|
231
|
+
takesValue: boolean;
|
|
232
|
+
allowDashValue?: boolean;
|
|
233
|
+
repeatable?: boolean;
|
|
234
|
+
}
|
|
235
|
+
declare const PLAYTEST_FLAGS: {
|
|
236
|
+
readonly "--adb": {
|
|
237
|
+
readonly default: "auto-discover";
|
|
238
|
+
readonly summary: "absolute adb executable path";
|
|
239
|
+
readonly takesValue: true;
|
|
240
|
+
};
|
|
241
|
+
readonly "--touch-rotation": {
|
|
242
|
+
readonly default: "read from the device";
|
|
243
|
+
readonly summary: "Android raw-touch rotation (0-3) when the app's window and the display disagree";
|
|
244
|
+
readonly takesValue: true;
|
|
245
|
+
};
|
|
246
|
+
readonly "--allow-software": {
|
|
247
|
+
readonly default: "false";
|
|
248
|
+
readonly summary: "accept a software WebGPU adapter as evidence";
|
|
249
|
+
readonly takesValue: false;
|
|
250
|
+
};
|
|
251
|
+
readonly "--activity": {
|
|
252
|
+
readonly default: ".MystralActivity";
|
|
253
|
+
readonly summary: "Android launch activity";
|
|
254
|
+
readonly takesValue: true;
|
|
255
|
+
};
|
|
256
|
+
readonly "--user": {
|
|
257
|
+
readonly default: "current foreground Android user";
|
|
258
|
+
readonly summary: "Android user id for force-stop and launch";
|
|
259
|
+
readonly takesValue: true;
|
|
260
|
+
};
|
|
261
|
+
readonly "--app": {
|
|
262
|
+
readonly default: "required for iOS";
|
|
263
|
+
readonly summary: "built iOS .app bundle";
|
|
264
|
+
readonly takesValue: true;
|
|
265
|
+
};
|
|
266
|
+
readonly "--artifact": {
|
|
267
|
+
readonly default: "none (browser and android: with --build-report)";
|
|
268
|
+
readonly summary: "the built artifact this run exercises, hashed to prove the build report describes it";
|
|
269
|
+
readonly takesValue: true;
|
|
270
|
+
};
|
|
271
|
+
readonly "--artifacts": {
|
|
272
|
+
readonly default: "artifacts/playtest";
|
|
273
|
+
readonly summary: "artifact output directory";
|
|
274
|
+
readonly takesValue: true;
|
|
275
|
+
};
|
|
276
|
+
readonly "--build-report": {
|
|
277
|
+
readonly default: "none";
|
|
278
|
+
readonly summary: "the <artifact>.build-report.json threenative build published; its performanceBudget bounds every scenario, and a stale or foreign report refuses the run";
|
|
279
|
+
readonly takesValue: true;
|
|
280
|
+
};
|
|
281
|
+
readonly "--no-screenshots": {
|
|
282
|
+
readonly default: "false";
|
|
283
|
+
readonly summary: "skip the before/after artifact frames; scenarios that assert on a frame still capture one";
|
|
284
|
+
readonly takesValue: false;
|
|
285
|
+
};
|
|
286
|
+
readonly "--browser-arg": {
|
|
287
|
+
readonly allowDashValue: true;
|
|
288
|
+
readonly default: "none (repeatable)";
|
|
289
|
+
readonly repeatable: true;
|
|
290
|
+
readonly summary: "one additional Chromium argument";
|
|
291
|
+
readonly takesValue: true;
|
|
292
|
+
};
|
|
293
|
+
readonly "--browser-recipe": {
|
|
294
|
+
readonly default: "none";
|
|
295
|
+
readonly summary: "named browser recipe (webgpu)";
|
|
296
|
+
readonly takesValue: true;
|
|
297
|
+
};
|
|
298
|
+
readonly "--cpu-prof": {
|
|
299
|
+
readonly default: "none";
|
|
300
|
+
readonly summary: "write a Chrome DevTools .cpuprofile for this run (browser and desktop targets)";
|
|
301
|
+
readonly takesValue: true;
|
|
302
|
+
};
|
|
303
|
+
readonly "--bundle-id": {
|
|
304
|
+
readonly default: "dev.threenative.runtime";
|
|
305
|
+
readonly summary: "iOS application bundle identifier";
|
|
306
|
+
readonly takesValue: true;
|
|
307
|
+
};
|
|
308
|
+
readonly "--device": {
|
|
309
|
+
readonly default: "platform default";
|
|
310
|
+
readonly summary: "Android serial or iOS device identifier";
|
|
311
|
+
readonly takesValue: true;
|
|
312
|
+
};
|
|
313
|
+
readonly "--executable": {
|
|
314
|
+
readonly default: "required for desktop";
|
|
315
|
+
readonly summary: "native desktop game executable";
|
|
316
|
+
readonly takesValue: true;
|
|
317
|
+
};
|
|
318
|
+
readonly "--endpoint": {
|
|
319
|
+
readonly default: "http://127.0.0.1:41777/playtest";
|
|
320
|
+
readonly summary: "device bridge endpoint";
|
|
321
|
+
readonly takesValue: true;
|
|
322
|
+
};
|
|
323
|
+
readonly "--headed": {
|
|
324
|
+
readonly default: "false";
|
|
325
|
+
readonly summary: "show the browser window";
|
|
326
|
+
readonly takesValue: false;
|
|
327
|
+
};
|
|
328
|
+
readonly "--judge-marker-url": {
|
|
329
|
+
readonly default: "none";
|
|
330
|
+
readonly summary: "judge-owned loopback marker URL whose POST failures are not network errors";
|
|
331
|
+
readonly takesValue: true;
|
|
332
|
+
};
|
|
333
|
+
readonly "--live-clock": {
|
|
334
|
+
readonly default: "false";
|
|
335
|
+
readonly summary: "measure the game on its own frame clock (browser and desktop targets); a standing scene is unmeasurable on counted ticks";
|
|
336
|
+
readonly takesValue: false;
|
|
337
|
+
};
|
|
338
|
+
readonly "--host-arg": {
|
|
339
|
+
readonly allowDashValue: true;
|
|
340
|
+
readonly default: "none";
|
|
341
|
+
readonly repeatable: true;
|
|
342
|
+
readonly summary: "argument passed to the native desktop host, repeatable";
|
|
343
|
+
readonly takesValue: true;
|
|
344
|
+
};
|
|
345
|
+
readonly "--mailbox-root": {
|
|
346
|
+
readonly default: "Android external files directory";
|
|
347
|
+
readonly summary: "native device mailbox directory";
|
|
348
|
+
readonly takesValue: true;
|
|
349
|
+
};
|
|
350
|
+
readonly "--ios-transport": {
|
|
351
|
+
readonly default: "simulator";
|
|
352
|
+
readonly summary: "iOS transport (simulator or device)";
|
|
353
|
+
readonly takesValue: true;
|
|
354
|
+
};
|
|
355
|
+
readonly "--project": {
|
|
356
|
+
readonly default: ".";
|
|
357
|
+
readonly summary: "project root used to resolve paths";
|
|
358
|
+
readonly takesValue: true;
|
|
359
|
+
};
|
|
360
|
+
readonly "--package": {
|
|
361
|
+
readonly default: "com.mystral.engine";
|
|
362
|
+
readonly summary: "Android application id";
|
|
363
|
+
readonly takesValue: true;
|
|
364
|
+
};
|
|
365
|
+
readonly "--scenario": {
|
|
366
|
+
readonly default: "required (or positional; repeatable)";
|
|
367
|
+
readonly repeatable: true;
|
|
368
|
+
readonly summary: "scenario JSON path or glob";
|
|
369
|
+
readonly takesValue: true;
|
|
370
|
+
};
|
|
371
|
+
readonly "--server-command": {
|
|
372
|
+
readonly default: "none";
|
|
373
|
+
readonly summary: "command for a managed app server";
|
|
374
|
+
readonly takesValue: true;
|
|
375
|
+
};
|
|
376
|
+
readonly "--server-timeout": {
|
|
377
|
+
readonly default: "15000";
|
|
378
|
+
readonly summary: "managed server readiness timeout in ms";
|
|
379
|
+
readonly takesValue: true;
|
|
380
|
+
};
|
|
381
|
+
readonly "--timeout": {
|
|
382
|
+
readonly default: "15000";
|
|
383
|
+
readonly summary: "page operation timeout in ms";
|
|
384
|
+
readonly takesValue: true;
|
|
385
|
+
};
|
|
386
|
+
readonly "--target": {
|
|
387
|
+
readonly default: "browser";
|
|
388
|
+
readonly summary: "execution target (browser, android, desktop, or ios)";
|
|
389
|
+
readonly takesValue: true;
|
|
390
|
+
};
|
|
391
|
+
readonly "--trace": {
|
|
392
|
+
readonly default: "false";
|
|
393
|
+
readonly summary: "write a Playwright trace";
|
|
394
|
+
readonly takesValue: false;
|
|
395
|
+
};
|
|
396
|
+
readonly "--url": {
|
|
397
|
+
readonly default: "http://127.0.0.1:5173 (or a free managed port)";
|
|
398
|
+
readonly summary: "application URL";
|
|
399
|
+
readonly takesValue: true;
|
|
400
|
+
};
|
|
401
|
+
readonly "--port": {
|
|
402
|
+
readonly default: "free when managing a server";
|
|
403
|
+
readonly summary: "managed server port (0 chooses a free port)";
|
|
404
|
+
readonly takesValue: true;
|
|
405
|
+
};
|
|
406
|
+
readonly "--xcrun": {
|
|
407
|
+
readonly default: "auto-discover";
|
|
408
|
+
readonly summary: "absolute xcrun executable path";
|
|
409
|
+
readonly takesValue: true;
|
|
410
|
+
};
|
|
411
|
+
};
|
|
412
|
+
declare class PlaytestCliUsageError extends Error {
|
|
413
|
+
constructor(message: string);
|
|
414
|
+
}
|
|
415
|
+
declare function formatUsage(): string;
|
|
416
|
+
declare function parseStandalonePlaytestArgs(argv: readonly string[], cwd?: string): IStandalonePlaytestConfig;
|
|
417
|
+
|
|
418
|
+
interface ILabeledPlaytestSample {
|
|
419
|
+
label: string;
|
|
420
|
+
signals: unknown[];
|
|
421
|
+
snapshot: IPlaytestObservationSnapshot;
|
|
422
|
+
}
|
|
423
|
+
interface IRunnerConsoleEntry {
|
|
424
|
+
source?: "browser-console" | "page-error" | "unhandled-rejection";
|
|
425
|
+
text: string;
|
|
426
|
+
type: string;
|
|
427
|
+
}
|
|
428
|
+
interface IMovementSampleInterval {
|
|
429
|
+
after: IPlaytestObservationSnapshot;
|
|
430
|
+
before: IPlaytestObservationSnapshot;
|
|
431
|
+
inputDriven: boolean;
|
|
432
|
+
}
|
|
433
|
+
interface IRunStepSamples {
|
|
434
|
+
afterInput?: IPlaytestObservationSnapshot;
|
|
435
|
+
afterStep?: IPlaytestObservationSnapshot;
|
|
436
|
+
inputDriven: boolean;
|
|
437
|
+
}
|
|
438
|
+
interface IStandalonePlaytestReport extends IPlaytestReport {
|
|
439
|
+
artifactDirectory: string;
|
|
440
|
+
acquisition?: {
|
|
441
|
+
requestUrls: readonly string[];
|
|
442
|
+
cpuWindows?: readonly ICpuWindow[];
|
|
443
|
+
completionWindow?: ICompletionWindow;
|
|
444
|
+
};
|
|
445
|
+
/**
|
|
446
|
+
* The clock this run measured on, as the protocol names it: `fixed-step` for the default
|
|
447
|
+
* tick-counted scenario, `wall-clock` when `--live-clock` put the host's own frame pump in
|
|
448
|
+
* charge. A frame rate is only the rate of the clock that produced it, so every report says
|
|
449
|
+
* which one this was — the same field the native production profile carries.
|
|
450
|
+
*/
|
|
451
|
+
clock: "fixed-step" | "wall-clock";
|
|
452
|
+
/**
|
|
453
|
+
* What the run waited for before it observed anything, and what it settled on.
|
|
454
|
+
*
|
|
455
|
+
* `rule: "compile-settled"` means the sustained in-budget frame window was not required,
|
|
456
|
+
* because the operator declared a software adapter: the wait still ran to full readiness, but
|
|
457
|
+
* a CPU rasteriser reaches it on the bounded window rather than on five sustained frames. A
|
|
458
|
+
* pass from such a run is not a smoothness measurement and must not be read as one, so the
|
|
459
|
+
* report says which rule applied rather than leaving a reader to assume the stricter one.
|
|
460
|
+
*/
|
|
461
|
+
startup?: {
|
|
462
|
+
compileSettled?: boolean;
|
|
463
|
+
phase: string;
|
|
464
|
+
progress: number;
|
|
465
|
+
rule: string;
|
|
466
|
+
timeline?: {
|
|
467
|
+
loadStartedMs?: number;
|
|
468
|
+
enteredMs?: number;
|
|
469
|
+
compileSettledMs?: number;
|
|
470
|
+
readyMs?: number;
|
|
471
|
+
};
|
|
472
|
+
};
|
|
473
|
+
debugColliders?: boolean;
|
|
474
|
+
input?: string;
|
|
475
|
+
movementThreshold?: number;
|
|
476
|
+
pass: boolean;
|
|
477
|
+
runtime: "native" | "web";
|
|
478
|
+
scenario: string;
|
|
479
|
+
target: string;
|
|
480
|
+
trivialityOptOutCount: number;
|
|
481
|
+
url: string;
|
|
482
|
+
}
|
|
483
|
+
declare class ManagedServerError extends Error {
|
|
484
|
+
readonly diagnostic: IPlaytestProtocolDiagnostic;
|
|
485
|
+
constructor(diagnostic: IPlaytestProtocolDiagnostic);
|
|
486
|
+
}
|
|
487
|
+
declare function failedDiagnosticsAssertion(policy: IPlaytestDiagnosticsPolicy): IPlaytestAssertionResult;
|
|
488
|
+
|
|
489
|
+
export { type IStandalonePlaytestConfig as I, ManagedServerError as M, PLAYTEST_FLAGS as P, type IStandalonePlaytestReport as a, type IRunnerConsoleEntry as b, type ILabeledPlaytestSample as c, type IMovementSampleInterval as d, type IPlaytestBridgeClient as e, type IBridgeTransport as f, type IPlaytestFlagHelp as g, type IPlaytestServerConfig as h, type IRunStepSamples as i, PlaytestBridgeError as j, PlaytestCliUsageError as k, PlaywrightTransport as l, advanceFixedStep as m, advanceTimeoutMs as n, bridgeWaitTimeoutMs as o, captureVisualSurface as p, connectPlaytestBridge as q, connectPlaytestBridgeTransport as r, failedDiagnosticsAssertion as s, formatUsage as t, parseStandalonePlaytestArgs as u, playtestStepDrivesMovement as v };
|
package/dist/three/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Camera, Scene, Object3D, Vector2 } from 'three';
|
|
2
|
-
import { IPlaytestSampleRequest, IPlaytestObservationSnapshot, IPlaytestBridgeV1, JsonValue, IPlaytestGameplayObservation, IPlaytestRuntimeDiagnosticsSample, IPlaytestRenderChainObservation, IPlaytestStartupObservation, IPlaytestSceneObservation } from '../protocol.js';
|
|
2
|
+
import { IPlaytestSampleRequest, IPlaytestObservationSnapshot, IPlaytestBridgeV1, PlaytestClockMode, JsonValue, IPlaytestGameplayObservation, IPlaytestRuntimeDiagnosticsSample, IPlaytestRenderChainObservation, IPlaytestStartupObservation, IPlaytestSceneObservation } from '../protocol.js';
|
|
3
3
|
|
|
4
4
|
type RenderAdvisorOwner = "framework" | "generated-src";
|
|
5
5
|
type RenderAdvisorSeverity = "info" | "warning";
|
|
@@ -149,6 +149,15 @@ interface IThreePlaytestResources {
|
|
|
149
149
|
}
|
|
150
150
|
interface IThreePlaytestBridgeOptions {
|
|
151
151
|
camera: Camera;
|
|
152
|
+
/**
|
|
153
|
+
* The clock this producer is actually running on, reported verbatim in every observation.
|
|
154
|
+
*
|
|
155
|
+
* `wall-clock` is a producer that lets its own frame pump move the simulation, which is the only
|
|
156
|
+
* way to observe a game *playing*: on that clock `advance` delivers the span of wall time the tick
|
|
157
|
+
* count names and reports the ticks that clock really ran, instead of stepping the loop itself.
|
|
158
|
+
* A production profile asks for it; a deterministic scenario never does.
|
|
159
|
+
*/
|
|
160
|
+
clockMode?: PlaytestClockMode;
|
|
152
161
|
components?: () => Record<string, Record<string, JsonValue>>;
|
|
153
162
|
/**
|
|
154
163
|
* Runtime diagnostics for the current frame.
|
|
@@ -161,7 +170,15 @@ interface IThreePlaytestBridgeOptions {
|
|
|
161
170
|
*/
|
|
162
171
|
diagnostics?: () => JsonValue[];
|
|
163
172
|
entities?: readonly IThreePlaytestEntity[] | (() => readonly IThreePlaytestEntity[]);
|
|
164
|
-
fixedStep?: (ticks: number
|
|
173
|
+
fixedStep?: (ticks: number, options?: {
|
|
174
|
+
render?: boolean;
|
|
175
|
+
}) => Promise<number | void> | number | void;
|
|
176
|
+
/**
|
|
177
|
+
* Draw the current world once without advancing it, for a capture taken while the loop is driven
|
|
178
|
+
* and presents nothing between ticks. Optional: a bridge without it advertises no
|
|
179
|
+
* `runtime.renderOnly`, and a capture that needs a render-only frame is never sent one.
|
|
180
|
+
*/
|
|
181
|
+
renderCurrent?: () => Promise<number | void> | number | void;
|
|
165
182
|
gameplay?: () => IPlaytestGameplayObservation;
|
|
166
183
|
gameplayChannels?: () => readonly ("runtime.contacts" | "runtime.tags" | "runtime.transitions" | "runtime.world")[];
|
|
167
184
|
runtimeDiagnosticsSeries?: () => readonly IPlaytestRuntimeDiagnosticsSample[];
|