@threenative/playtest 0.1.0 → 0.3.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.
- package/LICENSE +21 -0
- package/README.md +22 -3
- package/dist/capture.d.ts +48 -0
- package/dist/capture.js +87 -0
- package/dist/diagnostics-D89qJhf0.d.ts +841 -0
- package/dist/index.d.ts +53 -21
- package/dist/index.js +3536 -1919
- package/dist/protocol.d.ts +264 -0
- package/dist/protocol.js +42 -0
- package/dist/runner/cli.d.ts +33 -2
- package/dist/runner/cli.js +10100 -3761
- package/dist/runner/index.d.ts +401 -210
- package/dist/runner/index.js +8268 -3341
- package/dist/shared-Ax3-pneQ.d.ts +261 -0
- package/dist/three/index.d.ts +154 -26
- package/dist/three/index.js +617 -16
- package/package.json +13 -3
- package/dist/diagnostics-Ckm_5lrw.d.ts +0 -549
- package/dist/protocol-CeC1lz_G.d.ts +0 -130
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import { IPlaytestObservationSnapshot } from './protocol.js';
|
|
2
|
+
import { c as IPlaytestReport, w as IPlaytestProtocolDiagnostic, p as IPlaytestDiagnosticsPolicy, d as IPlaytestAssertionResult } from './diagnostics-D89qJhf0.js';
|
|
3
|
+
|
|
4
|
+
interface IPlaytestServerConfig {
|
|
5
|
+
command: string;
|
|
6
|
+
cwd?: string;
|
|
7
|
+
timeoutMs?: number;
|
|
8
|
+
}
|
|
9
|
+
interface IStandalonePlaytestConfig {
|
|
10
|
+
/**
|
|
11
|
+
* Accept a software WebGPU adapter. Off by default: without `--enable-features=Vulkan`, or
|
|
12
|
+
* headless on a host whose GPU the browser will not reach, Chromium serves WebGPU from
|
|
13
|
+
* SwiftShader and nothing errors — the adapter answers, limits look healthy, and the run
|
|
14
|
+
* reports a CPU rasteriser's results. A run that cannot name a hardware adapter is not
|
|
15
|
+
* render evidence, so it fails unless the operator says otherwise.
|
|
16
|
+
*/
|
|
17
|
+
allowSoftwareAdapter?: boolean;
|
|
18
|
+
android?: {
|
|
19
|
+
activity: string;
|
|
20
|
+
packageName: string;
|
|
21
|
+
};
|
|
22
|
+
adbPath?: string;
|
|
23
|
+
/** @see IAndroidDriverOptions.touchRotation */
|
|
24
|
+
touchRotation?: number;
|
|
25
|
+
artifactDirectory: string;
|
|
26
|
+
/**
|
|
27
|
+
* Capture the run's `before.png`/`after.png` artifact frames. Default true. A scenario that
|
|
28
|
+
* asserts on a frame still captures one — this only drops the convenience captures every run
|
|
29
|
+
* takes whether or not anything reads them.
|
|
30
|
+
*/
|
|
31
|
+
captureArtifactScreenshots?: boolean;
|
|
32
|
+
browserArgs?: readonly string[];
|
|
33
|
+
device?: string;
|
|
34
|
+
desktop?: {
|
|
35
|
+
executable: string;
|
|
36
|
+
};
|
|
37
|
+
endpoint?: string;
|
|
38
|
+
headless: boolean;
|
|
39
|
+
ios?: {
|
|
40
|
+
appPath?: string;
|
|
41
|
+
bundleId: string;
|
|
42
|
+
transport: "device" | "simulator";
|
|
43
|
+
};
|
|
44
|
+
mailboxRoot?: string;
|
|
45
|
+
port?: number;
|
|
46
|
+
projectPath: string;
|
|
47
|
+
scenarioPath: string;
|
|
48
|
+
scenarioPaths?: readonly string[];
|
|
49
|
+
server?: IPlaytestServerConfig;
|
|
50
|
+
timeoutMs: number;
|
|
51
|
+
target?: "android" | "browser" | "desktop" | "ios";
|
|
52
|
+
trace: boolean;
|
|
53
|
+
url: string;
|
|
54
|
+
xcrunPath?: string;
|
|
55
|
+
}
|
|
56
|
+
interface IPlaytestFlagHelp {
|
|
57
|
+
default: string;
|
|
58
|
+
summary: string;
|
|
59
|
+
takesValue: boolean;
|
|
60
|
+
allowDashValue?: boolean;
|
|
61
|
+
repeatable?: boolean;
|
|
62
|
+
}
|
|
63
|
+
declare const PLAYTEST_FLAGS: {
|
|
64
|
+
readonly "--adb": {
|
|
65
|
+
readonly default: "auto-discover";
|
|
66
|
+
readonly summary: "absolute adb executable path";
|
|
67
|
+
readonly takesValue: true;
|
|
68
|
+
};
|
|
69
|
+
readonly "--touch-rotation": {
|
|
70
|
+
readonly default: "read from the device";
|
|
71
|
+
readonly summary: "Android raw-touch rotation (0-3) when the app's window and the display disagree";
|
|
72
|
+
readonly takesValue: true;
|
|
73
|
+
};
|
|
74
|
+
readonly "--allow-software": {
|
|
75
|
+
readonly default: "false";
|
|
76
|
+
readonly summary: "accept a software WebGPU adapter as evidence";
|
|
77
|
+
readonly takesValue: false;
|
|
78
|
+
};
|
|
79
|
+
readonly "--activity": {
|
|
80
|
+
readonly default: ".MystralActivity";
|
|
81
|
+
readonly summary: "Android launch activity";
|
|
82
|
+
readonly takesValue: true;
|
|
83
|
+
};
|
|
84
|
+
readonly "--app": {
|
|
85
|
+
readonly default: "required for iOS";
|
|
86
|
+
readonly summary: "built iOS .app bundle";
|
|
87
|
+
readonly takesValue: true;
|
|
88
|
+
};
|
|
89
|
+
readonly "--artifacts": {
|
|
90
|
+
readonly default: "artifacts/playtest";
|
|
91
|
+
readonly summary: "artifact output directory";
|
|
92
|
+
readonly takesValue: true;
|
|
93
|
+
};
|
|
94
|
+
readonly "--no-screenshots": {
|
|
95
|
+
readonly default: "false";
|
|
96
|
+
readonly summary: "skip the before/after artifact frames; scenarios that assert on a frame still capture one";
|
|
97
|
+
readonly takesValue: false;
|
|
98
|
+
};
|
|
99
|
+
readonly "--browser-arg": {
|
|
100
|
+
readonly allowDashValue: true;
|
|
101
|
+
readonly default: "none (repeatable)";
|
|
102
|
+
readonly repeatable: true;
|
|
103
|
+
readonly summary: "one additional Chromium argument";
|
|
104
|
+
readonly takesValue: true;
|
|
105
|
+
};
|
|
106
|
+
readonly "--browser-recipe": {
|
|
107
|
+
readonly default: "none";
|
|
108
|
+
readonly summary: "named browser recipe (webgpu)";
|
|
109
|
+
readonly takesValue: true;
|
|
110
|
+
};
|
|
111
|
+
readonly "--bundle-id": {
|
|
112
|
+
readonly default: "dev.threenative.runtime";
|
|
113
|
+
readonly summary: "iOS application bundle identifier";
|
|
114
|
+
readonly takesValue: true;
|
|
115
|
+
};
|
|
116
|
+
readonly "--device": {
|
|
117
|
+
readonly default: "platform default";
|
|
118
|
+
readonly summary: "Android serial or iOS device identifier";
|
|
119
|
+
readonly takesValue: true;
|
|
120
|
+
};
|
|
121
|
+
readonly "--executable": {
|
|
122
|
+
readonly default: "required for desktop";
|
|
123
|
+
readonly summary: "native desktop game executable";
|
|
124
|
+
readonly takesValue: true;
|
|
125
|
+
};
|
|
126
|
+
readonly "--endpoint": {
|
|
127
|
+
readonly default: "http://127.0.0.1:41777/playtest";
|
|
128
|
+
readonly summary: "device bridge endpoint";
|
|
129
|
+
readonly takesValue: true;
|
|
130
|
+
};
|
|
131
|
+
readonly "--headed": {
|
|
132
|
+
readonly default: "false";
|
|
133
|
+
readonly summary: "show the browser window";
|
|
134
|
+
readonly takesValue: false;
|
|
135
|
+
};
|
|
136
|
+
readonly "--mailbox-root": {
|
|
137
|
+
readonly default: "Android external files directory";
|
|
138
|
+
readonly summary: "native device mailbox directory";
|
|
139
|
+
readonly takesValue: true;
|
|
140
|
+
};
|
|
141
|
+
readonly "--ios-transport": {
|
|
142
|
+
readonly default: "simulator";
|
|
143
|
+
readonly summary: "iOS transport (simulator or device)";
|
|
144
|
+
readonly takesValue: true;
|
|
145
|
+
};
|
|
146
|
+
readonly "--project": {
|
|
147
|
+
readonly default: ".";
|
|
148
|
+
readonly summary: "project root used to resolve paths";
|
|
149
|
+
readonly takesValue: true;
|
|
150
|
+
};
|
|
151
|
+
readonly "--package": {
|
|
152
|
+
readonly default: "com.mystral.engine";
|
|
153
|
+
readonly summary: "Android application id";
|
|
154
|
+
readonly takesValue: true;
|
|
155
|
+
};
|
|
156
|
+
readonly "--scenario": {
|
|
157
|
+
readonly default: "required (or positional; repeatable)";
|
|
158
|
+
readonly repeatable: true;
|
|
159
|
+
readonly summary: "scenario JSON path or glob";
|
|
160
|
+
readonly takesValue: true;
|
|
161
|
+
};
|
|
162
|
+
readonly "--server-command": {
|
|
163
|
+
readonly default: "none";
|
|
164
|
+
readonly summary: "command for a managed app server";
|
|
165
|
+
readonly takesValue: true;
|
|
166
|
+
};
|
|
167
|
+
readonly "--server-timeout": {
|
|
168
|
+
readonly default: "15000";
|
|
169
|
+
readonly summary: "managed server readiness timeout in ms";
|
|
170
|
+
readonly takesValue: true;
|
|
171
|
+
};
|
|
172
|
+
readonly "--timeout": {
|
|
173
|
+
readonly default: "15000";
|
|
174
|
+
readonly summary: "page operation timeout in ms";
|
|
175
|
+
readonly takesValue: true;
|
|
176
|
+
};
|
|
177
|
+
readonly "--target": {
|
|
178
|
+
readonly default: "browser";
|
|
179
|
+
readonly summary: "execution target (browser, android, desktop, or ios)";
|
|
180
|
+
readonly takesValue: true;
|
|
181
|
+
};
|
|
182
|
+
readonly "--trace": {
|
|
183
|
+
readonly default: "false";
|
|
184
|
+
readonly summary: "write a Playwright trace";
|
|
185
|
+
readonly takesValue: false;
|
|
186
|
+
};
|
|
187
|
+
readonly "--url": {
|
|
188
|
+
readonly default: "http://127.0.0.1:5173 (or a free managed port)";
|
|
189
|
+
readonly summary: "application URL";
|
|
190
|
+
readonly takesValue: true;
|
|
191
|
+
};
|
|
192
|
+
readonly "--port": {
|
|
193
|
+
readonly default: "free when managing a server";
|
|
194
|
+
readonly summary: "managed server port (0 chooses a free port)";
|
|
195
|
+
readonly takesValue: true;
|
|
196
|
+
};
|
|
197
|
+
readonly "--xcrun": {
|
|
198
|
+
readonly default: "auto-discover";
|
|
199
|
+
readonly summary: "absolute xcrun executable path";
|
|
200
|
+
readonly takesValue: true;
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
declare class PlaytestCliUsageError extends Error {
|
|
204
|
+
constructor(message: string);
|
|
205
|
+
}
|
|
206
|
+
declare function formatUsage(): string;
|
|
207
|
+
declare function parseStandalonePlaytestArgs(argv: readonly string[], cwd?: string): IStandalonePlaytestConfig;
|
|
208
|
+
|
|
209
|
+
interface ILabeledPlaytestSample {
|
|
210
|
+
label: string;
|
|
211
|
+
signals: unknown[];
|
|
212
|
+
snapshot: IPlaytestObservationSnapshot;
|
|
213
|
+
}
|
|
214
|
+
interface IRunnerConsoleEntry {
|
|
215
|
+
source?: "browser-console" | "page-error" | "unhandled-rejection";
|
|
216
|
+
text: string;
|
|
217
|
+
type: string;
|
|
218
|
+
}
|
|
219
|
+
interface IMovementSampleInterval {
|
|
220
|
+
after: IPlaytestObservationSnapshot;
|
|
221
|
+
before: IPlaytestObservationSnapshot;
|
|
222
|
+
inputDriven: boolean;
|
|
223
|
+
}
|
|
224
|
+
interface IRunStepSamples {
|
|
225
|
+
afterInput?: IPlaytestObservationSnapshot;
|
|
226
|
+
afterStep?: IPlaytestObservationSnapshot;
|
|
227
|
+
inputDriven: boolean;
|
|
228
|
+
}
|
|
229
|
+
interface IStandalonePlaytestReport extends IPlaytestReport {
|
|
230
|
+
artifactDirectory: string;
|
|
231
|
+
/**
|
|
232
|
+
* What the run waited for before it observed anything, and what it settled on.
|
|
233
|
+
*
|
|
234
|
+
* `rule: "compile-settled"` means the sustained in-budget frame window was not required,
|
|
235
|
+
* because the operator declared a software adapter. A pass from such a run is not a smoothness
|
|
236
|
+
* measurement and must not be read as one, so the report says which rule applied rather than
|
|
237
|
+
* leaving a reader to assume the stricter one.
|
|
238
|
+
*/
|
|
239
|
+
startup?: {
|
|
240
|
+
compileSettled?: boolean;
|
|
241
|
+
phase: string;
|
|
242
|
+
progress: number;
|
|
243
|
+
rule: string;
|
|
244
|
+
};
|
|
245
|
+
debugColliders?: boolean;
|
|
246
|
+
input?: string;
|
|
247
|
+
movementThreshold?: number;
|
|
248
|
+
pass: boolean;
|
|
249
|
+
runtime: "native" | "web";
|
|
250
|
+
scenario: string;
|
|
251
|
+
target: string;
|
|
252
|
+
trivialityOptOutCount: number;
|
|
253
|
+
url: string;
|
|
254
|
+
}
|
|
255
|
+
declare class ManagedServerError extends Error {
|
|
256
|
+
readonly diagnostic: IPlaytestProtocolDiagnostic;
|
|
257
|
+
constructor(diagnostic: IPlaytestProtocolDiagnostic);
|
|
258
|
+
}
|
|
259
|
+
declare function failedDiagnosticsAssertion(policy: IPlaytestDiagnosticsPolicy): IPlaytestAssertionResult;
|
|
260
|
+
|
|
261
|
+
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 IPlaytestFlagHelp as e, type IPlaytestServerConfig as f, type IRunStepSamples as g, PlaytestCliUsageError as h, failedDiagnosticsAssertion as i, formatUsage as j, parseStandalonePlaytestArgs as p };
|
package/dist/three/index.d.ts
CHANGED
|
@@ -1,35 +1,147 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Camera, Scene, Object3D, Vector2 } from 'three';
|
|
2
|
+
import { IPlaytestSampleRequest, IPlaytestObservationSnapshot, IPlaytestBridgeV1, JsonValue, IPlaytestGameplayObservation, IPlaytestRuntimeDiagnosticsSample, IPlaytestRenderChainObservation, IPlaytestStartupObservation } from '../protocol.js';
|
|
3
|
+
|
|
4
|
+
type RenderAdvisorOwner = "framework" | "generated-src";
|
|
5
|
+
type RenderAdvisorSeverity = "info" | "warning";
|
|
6
|
+
type RenderAdvisorTransformSafety = "caller-declared-static" | "unknown";
|
|
7
|
+
interface IRenderAdvisorExamplePaths {
|
|
8
|
+
readonly gpuParticles: string;
|
|
9
|
+
readonly hudInstancing: string;
|
|
10
|
+
readonly materialSharing: string;
|
|
11
|
+
readonly staticMerge: string;
|
|
12
|
+
}
|
|
13
|
+
interface IRenderAdvisorObservedRendererCounters {
|
|
14
|
+
readonly drawCalls?: number;
|
|
15
|
+
readonly triangles?: number;
|
|
16
|
+
}
|
|
17
|
+
interface IRenderAdvisorObservedPass {
|
|
18
|
+
readonly cameraToken: string;
|
|
19
|
+
readonly depthToken?: string;
|
|
20
|
+
readonly equivalenceToken?: string;
|
|
21
|
+
readonly purpose?: "color" | "depth-prepass" | "other" | "post" | "shadow";
|
|
22
|
+
readonly renderCalls?: number;
|
|
23
|
+
readonly sceneToken: string;
|
|
24
|
+
readonly targetToken?: string;
|
|
25
|
+
}
|
|
26
|
+
interface IRenderAdvisorObservedInput {
|
|
27
|
+
readonly passes?: readonly IRenderAdvisorObservedPass[];
|
|
28
|
+
readonly renderer?: IRenderAdvisorObservedRendererCounters;
|
|
29
|
+
}
|
|
30
|
+
interface IRenderAdvisorInput {
|
|
31
|
+
readonly camera?: Camera;
|
|
32
|
+
readonly materialMutationSafety?: "caller-declared-stable" | "unknown";
|
|
33
|
+
readonly observed?: IRenderAdvisorObservedInput;
|
|
34
|
+
readonly particleWorkload?: "caller-declared-many-independent-objects" | "unknown";
|
|
35
|
+
readonly scene: Scene;
|
|
36
|
+
readonly spriteWorkload?: "caller-declared-camera-overlay" | "unknown";
|
|
37
|
+
readonly topN?: number;
|
|
38
|
+
readonly transformSafety?: RenderAdvisorTransformSafety;
|
|
39
|
+
readonly verifiedExamplePaths: IRenderAdvisorExamplePaths;
|
|
40
|
+
}
|
|
41
|
+
interface IRenderAdvisorGroup {
|
|
42
|
+
readonly constraintReasonCounts: Record<string, number>;
|
|
43
|
+
readonly eligibleDynamicCount: number;
|
|
44
|
+
readonly eligibleStaticCount: number;
|
|
45
|
+
readonly geometryIdentities: number;
|
|
46
|
+
readonly materialIdentities: number;
|
|
47
|
+
readonly memberCount: number;
|
|
48
|
+
}
|
|
49
|
+
interface IRenderAdvisorRecommendation {
|
|
50
|
+
readonly caveats: readonly string[];
|
|
51
|
+
readonly code: string;
|
|
52
|
+
readonly constraints: Record<string, number>;
|
|
53
|
+
readonly evidence: {
|
|
54
|
+
readonly metric: string;
|
|
55
|
+
readonly path: string;
|
|
56
|
+
};
|
|
57
|
+
readonly examplePath: string;
|
|
58
|
+
readonly expectedReducedCount?: number;
|
|
59
|
+
readonly observedCount: number;
|
|
60
|
+
readonly owner: RenderAdvisorOwner;
|
|
61
|
+
readonly severity: RenderAdvisorSeverity;
|
|
62
|
+
}
|
|
63
|
+
interface IRenderAdvisorReport {
|
|
64
|
+
readonly schemaVersion: 1;
|
|
65
|
+
readonly observed: {
|
|
66
|
+
readonly passes: {
|
|
67
|
+
readonly recorded: number;
|
|
68
|
+
readonly truncated: number;
|
|
69
|
+
};
|
|
70
|
+
readonly renderer: IRenderAdvisorObservedRendererCounters;
|
|
71
|
+
};
|
|
72
|
+
readonly passObservations: readonly {
|
|
73
|
+
readonly count: number;
|
|
74
|
+
readonly reasonCode: string;
|
|
75
|
+
}[];
|
|
76
|
+
readonly recommendations: readonly IRenderAdvisorRecommendation[];
|
|
77
|
+
readonly snapshot: {
|
|
78
|
+
readonly geometryIdentityCount: number;
|
|
79
|
+
readonly instancedRenderableCount: number;
|
|
80
|
+
readonly logicalObjectCount: number;
|
|
81
|
+
readonly logicalObjectCountIncludesRootScene: true;
|
|
82
|
+
readonly materialIdentityCount: number;
|
|
83
|
+
readonly pointsCount: number;
|
|
84
|
+
readonly renderableCount: number;
|
|
85
|
+
readonly spriteCount: number;
|
|
86
|
+
readonly visibleFlagRenderableCount: number;
|
|
87
|
+
};
|
|
88
|
+
readonly topGroups: readonly IRenderAdvisorGroup[];
|
|
89
|
+
}
|
|
90
|
+
declare function adviseThreeRenderWorkload(input: IRenderAdvisorInput): IRenderAdvisorReport;
|
|
3
91
|
|
|
4
92
|
interface IThreePlaytestEntity {
|
|
5
93
|
id: string;
|
|
6
94
|
object: Object3D;
|
|
7
95
|
path?: string;
|
|
8
96
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
97
|
+
|
|
98
|
+
interface IThreePlaytestRenderer {
|
|
99
|
+
getDrawingBufferSize(target: Vector2): Vector2;
|
|
100
|
+
info?: {
|
|
101
|
+
render?: {
|
|
102
|
+
drawCalls?: unknown;
|
|
103
|
+
calls?: unknown;
|
|
104
|
+
triangles?: unknown;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
15
107
|
}
|
|
16
|
-
declare function objectPath(object: Object3D): string;
|
|
17
108
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
109
|
+
/**
|
|
110
|
+
* Physics evidence for a project that drives its own simulation.
|
|
111
|
+
*
|
|
112
|
+
* The `settled` and `aerodynamics` assertions read a `physicsDebugSeries` whose snapshots have
|
|
113
|
+
* a specific interior shape -- `artifact.primitives[]` entries categorised `sleep` and
|
|
114
|
+
* `center-of-mass`, plus an `artifact.overflow.omittedBodies` count. That shape is a harness
|
|
115
|
+
* contract, not something a caller should have to rediscover by reading a failed assertion, so
|
|
116
|
+
* the bridge builds it here from a flat body list. A caller supplies what it already knows.
|
|
117
|
+
*/
|
|
118
|
+
interface IThreePlaytestPhysicsBody {
|
|
119
|
+
/** Body id. An assertion matches it exactly or by prefix, so `crate.3` matches entity `crate`. */
|
|
120
|
+
readonly id: string;
|
|
121
|
+
readonly position: readonly [number, number, number];
|
|
122
|
+
readonly sleeping: boolean;
|
|
28
123
|
}
|
|
29
|
-
interface
|
|
30
|
-
|
|
124
|
+
interface IThreePlaytestPhysics {
|
|
125
|
+
bodies(): readonly IThreePlaytestPhysicsBody[];
|
|
126
|
+
}
|
|
127
|
+
/** Retained bodies per labelled sample. Bodies past the limit are reported, never dropped. */
|
|
128
|
+
declare const PLAYTEST_PHYSICS_BODY_LIMIT = 100;
|
|
129
|
+
/** Labelled samples retained per run. */
|
|
130
|
+
declare const PLAYTEST_PHYSICS_SAMPLE_LIMIT = 100;
|
|
131
|
+
type PhysicsDebugSeries = NonNullable<IPlaytestObservationSnapshot["physicsDebugSeries"]>;
|
|
132
|
+
/**
|
|
133
|
+
* Retains one physics snapshot per scenario step label.
|
|
134
|
+
*
|
|
135
|
+
* Fails closed throughout: a duplicate label, an exhausted retention budget, and a malformed
|
|
136
|
+
* body all throw rather than yielding a series an assertion would read as merely empty. An
|
|
137
|
+
* assertion that cannot see its evidence must fail loudly; one that silently sees nothing is
|
|
138
|
+
* the vacuous pass this package exists to prevent.
|
|
139
|
+
*/
|
|
140
|
+
declare class ThreePlaytestPhysicsRecorder {
|
|
141
|
+
#private;
|
|
142
|
+
constructor(physics: IThreePlaytestPhysics);
|
|
143
|
+
sample(request: IPlaytestSampleRequest, tick: number): PhysicsDebugSeries;
|
|
31
144
|
}
|
|
32
|
-
declare function sampleThreeObservations(input: IThreeObservationInput, request: IPlaytestSampleRequest): IPlaytestObservationSnapshot;
|
|
33
145
|
|
|
34
146
|
interface IThreePlaytestResources {
|
|
35
147
|
read(): Record<string, JsonValue>;
|
|
@@ -38,15 +150,31 @@ interface IThreePlaytestResources {
|
|
|
38
150
|
interface IThreePlaytestBridgeOptions {
|
|
39
151
|
camera: Camera;
|
|
40
152
|
components?: () => Record<string, Record<string, JsonValue>>;
|
|
153
|
+
/**
|
|
154
|
+
* Runtime diagnostics for the current frame.
|
|
155
|
+
*
|
|
156
|
+
* An entry shaped `{ label: string, value: string | number | boolean }` is treated as a
|
|
157
|
+
* **readout** — publish your FPS counter, coin tally or backend name here freely, and a proof
|
|
158
|
+
* asserting `noRuntimeDiagnostics` will not fail because of it. Anything else counts as a
|
|
159
|
+
* runtime **error**, including an entry carrying `severity: "error"`, `type: "error"` or an
|
|
160
|
+
* `error` field. Ambiguous entries count as errors on purpose: this harness fails closed.
|
|
161
|
+
*/
|
|
41
162
|
diagnostics?: () => JsonValue[];
|
|
42
163
|
entities?: readonly IThreePlaytestEntity[] | (() => readonly IThreePlaytestEntity[]);
|
|
43
|
-
fixedStep?: (ticks: number) => Promise<void> | void;
|
|
164
|
+
fixedStep?: (ticks: number) => Promise<number | void> | number | void;
|
|
44
165
|
gameplay?: () => IPlaytestGameplayObservation;
|
|
45
|
-
gameplayChannels?: () => readonly ("runtime.contacts" | "runtime.tags")[];
|
|
166
|
+
gameplayChannels?: () => readonly ("runtime.contacts" | "runtime.tags" | "runtime.world")[];
|
|
167
|
+
runtimeDiagnosticsSeries?: () => readonly IPlaytestRuntimeDiagnosticsSample[];
|
|
46
168
|
events?: () => JsonValue[];
|
|
47
|
-
|
|
169
|
+
/** Physics bodies to retain per labelled step. Requires the authoritative tick provider. */
|
|
170
|
+
physics?: IThreePlaytestPhysics;
|
|
171
|
+
renderer: IThreePlaytestRenderer;
|
|
172
|
+
renderChain?: () => IPlaytestRenderChainObservation | undefined;
|
|
48
173
|
resources?: IThreePlaytestResources;
|
|
49
174
|
scene: Scene;
|
|
175
|
+
/** First-use startup progress, so a runner can wait for the world instead of the loader. */
|
|
176
|
+
startup?: () => IPlaytestStartupObservation;
|
|
177
|
+
tick?: () => number;
|
|
50
178
|
}
|
|
51
179
|
interface IThreePlaytestBridgeInstallation {
|
|
52
180
|
bridge: IPlaytestBridgeV1;
|
|
@@ -62,4 +190,4 @@ interface IDeviceBridgeInstallation {
|
|
|
62
190
|
declare function connectDevicePlaytestBridge(bridge: IPlaytestBridgeV1, endpoint: string): IDeviceBridgeInstallation;
|
|
63
191
|
declare function readPlaytestEndpoint(): string | undefined;
|
|
64
192
|
|
|
65
|
-
export { type IDeviceBridgeInstallation, type
|
|
193
|
+
export { type IDeviceBridgeInstallation, type IRenderAdvisorExamplePaths, type IRenderAdvisorInput, type IRenderAdvisorObservedInput, type IRenderAdvisorObservedPass, type IRenderAdvisorRecommendation, type IRenderAdvisorReport, type IThreePlaytestBridgeInstallation, type IThreePlaytestBridgeOptions, type IThreePlaytestEntity, type IThreePlaytestPhysics, type IThreePlaytestPhysicsBody, type IThreePlaytestResources, PLAYTEST_PHYSICS_BODY_LIMIT, PLAYTEST_PHYSICS_SAMPLE_LIMIT, ThreePlaytestPhysicsRecorder, adviseThreeRenderWorkload, connectDevicePlaytestBridge, installThreePlaytestBridge, readPlaytestEndpoint };
|