@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
package/dist/three/index.js
CHANGED
|
@@ -10,7 +10,7 @@ var SPRITE_FLOOR = 32;
|
|
|
10
10
|
var POINT_OBJECT_FLOOR = 16;
|
|
11
11
|
var VERIFIED_EXAMPLE_PATHS = {
|
|
12
12
|
gpuParticles: "examples/abyss-framework/src/scenes/Abyss.ts",
|
|
13
|
-
hudInstancing: "packages/create-threenative/templates/
|
|
13
|
+
hudInstancing: "packages/create-threenative/templates/rts/src/render/army.ts",
|
|
14
14
|
materialSharing: "packages/create-threenative/templates/starter/src/render/materials.ts",
|
|
15
15
|
staticMerge: "examples/native-cpu-load-test/src/main.ts"
|
|
16
16
|
};
|
|
@@ -416,6 +416,15 @@ var PLAYTEST_PROTOCOL_LIMITS = {
|
|
|
416
416
|
maxPayloadBytes: 1e6,
|
|
417
417
|
operationTimeoutMs: 5e3
|
|
418
418
|
};
|
|
419
|
+
var PLAYTEST_CLOCK_GLOBAL = "__THREENATIVE_PLAYTEST_CLOCK__";
|
|
420
|
+
function requestedPlaytestClockMode() {
|
|
421
|
+
const requested = globalThis[PLAYTEST_CLOCK_GLOBAL];
|
|
422
|
+
if (requested === void 0) return void 0;
|
|
423
|
+
if (requested === "wall-clock") return "wall-clock";
|
|
424
|
+
throw new Error(
|
|
425
|
+
`TN_PLAYTEST_CLOCK_UNSUPPORTED: '${PLAYTEST_CLOCK_GLOBAL}' is ${JSON.stringify(requested)}; this protocol knows 'wall-clock' and nothing else.`
|
|
426
|
+
);
|
|
427
|
+
}
|
|
419
428
|
function jsonByteLength(value) {
|
|
420
429
|
return new TextEncoder().encode(JSON.stringify(value)).byteLength;
|
|
421
430
|
}
|
|
@@ -814,7 +823,21 @@ function observeSceneResources(scene, camera) {
|
|
|
814
823
|
}
|
|
815
824
|
|
|
816
825
|
// src/three/observations.ts
|
|
826
|
+
function isResourceOnlySample(request) {
|
|
827
|
+
return request.entities?.length === 0 && request.include?.length === 1 && request.include[0] === "resources" && request.resources !== void 0 && request.geometry === void 0 && request.sceneNodes === void 0;
|
|
828
|
+
}
|
|
829
|
+
function sampleClock(input) {
|
|
830
|
+
return {
|
|
831
|
+
mode: input.clockMode,
|
|
832
|
+
...input.tick === void 0 ? { timeMs: performance.now() } : { tick: input.tick },
|
|
833
|
+
// Live observations carry wall time even when the producer also supplies its tick.
|
|
834
|
+
...input.clockMode === "wall-clock" ? { timeMs: performance.now() } : {}
|
|
835
|
+
};
|
|
836
|
+
}
|
|
817
837
|
function sampleThreeObservations(input, request) {
|
|
838
|
+
if (isResourceOnlySample(request)) {
|
|
839
|
+
return { clock: sampleClock(input), ...input.resources === void 0 ? {} : { resources: input.resources() } };
|
|
840
|
+
}
|
|
818
841
|
input.scene.updateMatrixWorld(true);
|
|
819
842
|
input.camera.updateMatrixWorld(true);
|
|
820
843
|
const rendererSize = input.renderer.getDrawingBufferSize(new Vector2());
|
|
@@ -822,10 +845,7 @@ function sampleThreeObservations(input, request) {
|
|
|
822
845
|
const renderPerformance = rendererPerformance(input.renderer);
|
|
823
846
|
const renderChain = input.renderChain?.();
|
|
824
847
|
return {
|
|
825
|
-
clock:
|
|
826
|
-
mode: input.clockMode,
|
|
827
|
-
...input.tick === void 0 ? { timeMs: performance.now() } : { tick: input.tick }
|
|
828
|
-
},
|
|
848
|
+
clock: sampleClock(input),
|
|
829
849
|
...input.diagnostics === void 0 ? {} : { diagnostics: input.diagnostics() },
|
|
830
850
|
entities,
|
|
831
851
|
...input.gameplay === void 0 ? {} : { gameplay: input.gameplay() },
|
|
@@ -875,18 +895,27 @@ function projectedBounds(object, camera, viewportWidth, viewportHeight) {
|
|
|
875
895
|
if (worldBounds.isEmpty()) return void 0;
|
|
876
896
|
const projection = new Matrix4().multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse);
|
|
877
897
|
if (!new Frustum().setFromProjectionMatrix(projection).intersectsBox(worldBounds)) return void 0;
|
|
878
|
-
const
|
|
879
|
-
const
|
|
880
|
-
const
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
898
|
+
const { near } = camera;
|
|
899
|
+
const inFront = (point) => point.z <= -near;
|
|
900
|
+
const viewCorner = (bits) => new Vector3(
|
|
901
|
+
bits & 4 ? worldBounds.max.x : worldBounds.min.x,
|
|
902
|
+
bits & 2 ? worldBounds.max.y : worldBounds.min.y,
|
|
903
|
+
bits & 1 ? worldBounds.max.z : worldBounds.min.z
|
|
904
|
+
).applyMatrix4(camera.matrixWorldInverse);
|
|
905
|
+
const clipped = [];
|
|
906
|
+
for (let bits = 0; bits < 8; bits += 1) {
|
|
907
|
+
const corner = viewCorner(bits);
|
|
908
|
+
if (inFront(corner)) clipped.push(corner);
|
|
909
|
+
for (const bit of [1, 2, 4]) {
|
|
910
|
+
if (bits & bit) continue;
|
|
911
|
+
const other = viewCorner(bits | bit);
|
|
912
|
+
if (inFront(corner) !== inFront(other)) {
|
|
913
|
+
clipped.push(corner.clone().lerp(other, (-near - corner.z) / (other.z - corner.z)));
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
if (clipped.length === 0) return void 0;
|
|
918
|
+
const points = clipped.map((point) => point.applyMatrix4(camera.projectionMatrix));
|
|
890
919
|
const minX = Math.min(...points.map(({ x }) => x));
|
|
891
920
|
const maxX = Math.max(...points.map(({ x }) => x));
|
|
892
921
|
const minY = Math.min(...points.map(({ y }) => y));
|
|
@@ -969,6 +998,7 @@ var BRIDGE_METHODS = /* @__PURE__ */ new Set([
|
|
|
969
998
|
"drainEvents",
|
|
970
999
|
"focus",
|
|
971
1000
|
"ready",
|
|
1001
|
+
"renderOnly",
|
|
972
1002
|
"sample"
|
|
973
1003
|
]);
|
|
974
1004
|
function connectDevicePlaytestBridge(bridge, endpoint) {
|
|
@@ -1020,6 +1050,15 @@ function connectNativeMailbox(bridge) {
|
|
|
1020
1050
|
const mailbox = globals.TN_PLAYTEST_MAILBOX;
|
|
1021
1051
|
const host = globals.__THREENATIVE_NATIVE__?.playtest;
|
|
1022
1052
|
if (typeof mailbox?.request !== "string" || typeof mailbox.response !== "string" || typeof host?.receive !== "function" || typeof host.respond !== "function") return void 0;
|
|
1053
|
+
if (typeof host.network === "function") {
|
|
1054
|
+
const describe = bridge.describe.bind(bridge);
|
|
1055
|
+
bridge.describe = async () => {
|
|
1056
|
+
const description = await describe();
|
|
1057
|
+
return { ...description, capabilities: [...description.capabilities, "runtime.network"] };
|
|
1058
|
+
};
|
|
1059
|
+
const sample = bridge.sample.bind(bridge);
|
|
1060
|
+
bridge.sample = async (request) => ({ ...await sample(request), network: host.network() });
|
|
1061
|
+
}
|
|
1023
1062
|
let closed = false;
|
|
1024
1063
|
let frame;
|
|
1025
1064
|
const nativePointers = /* @__PURE__ */ new Map();
|
|
@@ -1092,6 +1131,7 @@ async function dispatch(bridge, request, nativePointers) {
|
|
|
1092
1131
|
const operation = bridge[request.method];
|
|
1093
1132
|
if (typeof operation !== "function") throw new Error(`Bridge operation '${request.method}' is unavailable.`);
|
|
1094
1133
|
const result = await operation.call(bridge, request.argument);
|
|
1134
|
+
if (request.method === "advance") advanceHostClock(result);
|
|
1095
1135
|
if (result !== void 0) assertBounded(result);
|
|
1096
1136
|
return { id: request.id, ...result === void 0 ? {} : { result } };
|
|
1097
1137
|
} catch (error) {
|
|
@@ -1106,8 +1146,8 @@ function dispatchInput(method, argument, nativePointers) {
|
|
|
1106
1146
|
const code = argument.key;
|
|
1107
1147
|
const key = /^Key[A-Z]$/u.test(code) ? code.slice(3).toLowerCase() : code;
|
|
1108
1148
|
if (typeof host?.keyboard !== "function") throw new Error("Native playtest keyboard input is unavailable.");
|
|
1109
|
-
host.keyboard(method === "input.keyDown" ? "keydown" : "keyup", key, code);
|
|
1110
|
-
return null;
|
|
1149
|
+
const consumed = host.keyboard(method === "input.keyDown" ? "keydown" : "keyup", key, code);
|
|
1150
|
+
return consumed === true ? { consumedByUi: true } : null;
|
|
1111
1151
|
}
|
|
1112
1152
|
if (method === "input.pointer") {
|
|
1113
1153
|
if (typeof argument.x !== "number" || typeof argument.y !== "number" || typeof argument.buttons !== "number") {
|
|
@@ -1118,6 +1158,25 @@ function dispatchInput(method, argument, nativePointers) {
|
|
|
1118
1158
|
host.pointer(type, argument.x, argument.y, argument.buttons);
|
|
1119
1159
|
return null;
|
|
1120
1160
|
}
|
|
1161
|
+
if (method === "input.wheel") {
|
|
1162
|
+
const { x, y, deltaX, deltaY } = argument;
|
|
1163
|
+
if (![x, y, deltaX, deltaY].every((value) => typeof value === "number" && Number.isFinite(value))) {
|
|
1164
|
+
throw new Error("Device input.wheel requires finite x, y, deltaX and deltaY.");
|
|
1165
|
+
}
|
|
1166
|
+
if (typeof host?.wheel !== "function") throw new Error("Native playtest wheel input is unavailable.");
|
|
1167
|
+
host.wheel(x, y, deltaX, deltaY);
|
|
1168
|
+
return null;
|
|
1169
|
+
}
|
|
1170
|
+
if (method === "input.media") {
|
|
1171
|
+
const { dark, reducedMotion } = argument;
|
|
1172
|
+
if (![dark, reducedMotion].every((value) => value === -1 || value === 0 || value === 1)) {
|
|
1173
|
+
throw new Error("Device input.media requires dark and reducedMotion as -1, 0 or 1.");
|
|
1174
|
+
}
|
|
1175
|
+
if (typeof host?.media !== "function" || !host.media(dark, reducedMotion)) {
|
|
1176
|
+
throw new Error("Native playtest media emulation is unavailable: the host has no native-css UI attached to take it.");
|
|
1177
|
+
}
|
|
1178
|
+
return null;
|
|
1179
|
+
}
|
|
1121
1180
|
if (method === "input.pointers") {
|
|
1122
1181
|
if (typeof host?.pointer !== "function") {
|
|
1123
1182
|
throw new Error("Native playtest multi-pointer input is unavailable.");
|
|
@@ -1168,6 +1227,11 @@ function dispatchInput(method, argument, nativePointers) {
|
|
|
1168
1227
|
}
|
|
1169
1228
|
throw new Error(`Device input operation '${method}' is unavailable.`);
|
|
1170
1229
|
}
|
|
1230
|
+
function advanceHostClock(result) {
|
|
1231
|
+
const ticks = isRecord(result) ? result.ticks : void 0;
|
|
1232
|
+
if (typeof ticks !== "number" || !Number.isInteger(ticks) || ticks <= 0) return;
|
|
1233
|
+
globalThis.__THREENATIVE_NATIVE__?.playtestInput?.advanceClock?.(ticks);
|
|
1234
|
+
}
|
|
1171
1235
|
function parseNativePointers(value) {
|
|
1172
1236
|
if (!Array.isArray(value)) throw new Error("Device input.pointers requires a pointer array.");
|
|
1173
1237
|
const pointers = value.map((pointer, index) => {
|
|
@@ -1219,6 +1283,7 @@ function installThreePlaytestBridge(options) {
|
|
|
1219
1283
|
if (options.physics !== void 0 && options.tick === void 0)
|
|
1220
1284
|
throw new Error("A physics provider requires the authoritative tick provider, and therefore fixedStep.");
|
|
1221
1285
|
const recorder = options.physics === void 0 ? void 0 : new ThreePlaytestPhysicsRecorder(options.physics);
|
|
1286
|
+
const clockMode = () => options.clockMode ?? requestedPlaytestClockMode() ?? (options.fixedStep === void 0 ? "render-frame" : "fixed-step");
|
|
1222
1287
|
const host = globalThis;
|
|
1223
1288
|
const previous = host[PLAYTEST_BRIDGE_GLOBAL];
|
|
1224
1289
|
const registry = new ThreePlaytestEntityRegistry();
|
|
@@ -1239,6 +1304,7 @@ function installThreePlaytestBridge(options) {
|
|
|
1239
1304
|
...options.physics === void 0 ? [] : ["runtime.physics"],
|
|
1240
1305
|
...options.runtimeDiagnosticsSeries === void 0 ? [] : ["runtime.performance"],
|
|
1241
1306
|
...options.renderChain === void 0 ? [] : ["runtime.renderChain"],
|
|
1307
|
+
...options.renderCurrent === void 0 ? [] : ["runtime.renderOnly"],
|
|
1242
1308
|
...options.startup === void 0 ? [] : ["runtime.startup"],
|
|
1243
1309
|
...options.gameplayChannels?.().includes("runtime.contacts") === true ? ["runtime.contacts"] : [],
|
|
1244
1310
|
...options.gameplayChannels?.().includes("runtime.tags") === true ? ["runtime.tags"] : [],
|
|
@@ -1247,15 +1313,15 @@ function installThreePlaytestBridge(options) {
|
|
|
1247
1313
|
];
|
|
1248
1314
|
const bridge = {
|
|
1249
1315
|
...options.fixedStep === void 0 ? {} : {
|
|
1250
|
-
advance: async (ticks) => {
|
|
1316
|
+
advance: async (ticks, advanceOptions) => {
|
|
1251
1317
|
if (!Number.isInteger(ticks) || ticks <= 0) throw new Error("advance ticks must be a positive integer.");
|
|
1252
1318
|
const startTick = options.tick();
|
|
1253
|
-
await options.fixedStep(ticks);
|
|
1319
|
+
await options.fixedStep(ticks, advanceOptions);
|
|
1254
1320
|
const tick = options.tick();
|
|
1255
1321
|
const advanced = tick - startTick;
|
|
1256
|
-
if (advanced !== ticks)
|
|
1257
|
-
throw new Error(`fixedStep advanced ${advanced} actual ticks; expected ${ticks}.`);
|
|
1258
|
-
return { clock: { mode:
|
|
1322
|
+
if (clockMode() === "wall-clock" ? advanced < 1 : advanced !== ticks)
|
|
1323
|
+
throw new Error(clockMode() === "wall-clock" ? `wall-clock advance moved no tick in ${ticks} step(s) of wall time; the host presented no frame.` : `fixedStep advanced ${advanced} actual ticks; expected ${ticks}.`);
|
|
1324
|
+
return { clock: { mode: clockMode(), tick }, ticks: advanced };
|
|
1259
1325
|
}
|
|
1260
1326
|
},
|
|
1261
1327
|
applySetup: async (request) => {
|
|
@@ -1270,6 +1336,11 @@ function installThreePlaytestBridge(options) {
|
|
|
1270
1336
|
return events.slice(0, Math.min(limit, PLAYTEST_PROTOCOL_LIMITS.maxEventsPerDrain));
|
|
1271
1337
|
}
|
|
1272
1338
|
},
|
|
1339
|
+
...options.renderCurrent === void 0 ? {} : {
|
|
1340
|
+
renderOnly: async () => {
|
|
1341
|
+
await options.renderCurrent();
|
|
1342
|
+
}
|
|
1343
|
+
},
|
|
1273
1344
|
describe: () => ({
|
|
1274
1345
|
capabilities: capabilities(),
|
|
1275
1346
|
limits: PLAYTEST_PROTOCOL_LIMITS,
|
|
@@ -1283,10 +1354,11 @@ function installThreePlaytestBridge(options) {
|
|
|
1283
1354
|
return { ready: true, startup };
|
|
1284
1355
|
},
|
|
1285
1356
|
sample: (request) => {
|
|
1286
|
-
|
|
1357
|
+
const resourceOnly = isResourceOnlySample(request);
|
|
1358
|
+
if (!resourceOnly) syncEntities(registry, options.entities);
|
|
1287
1359
|
const snapshot = sampleThreeObservations({
|
|
1288
1360
|
camera: options.camera,
|
|
1289
|
-
clockMode:
|
|
1361
|
+
clockMode: clockMode(),
|
|
1290
1362
|
diagnostics: options.diagnostics,
|
|
1291
1363
|
gameplay: options.gameplay,
|
|
1292
1364
|
runtimeDiagnosticsSeries: options.runtimeDiagnosticsSeries,
|
|
@@ -1297,7 +1369,7 @@ function installThreePlaytestBridge(options) {
|
|
|
1297
1369
|
scene: options.scene,
|
|
1298
1370
|
tick: options.tick?.()
|
|
1299
1371
|
}, request);
|
|
1300
|
-
const components = options.components?.();
|
|
1372
|
+
const components = resourceOnly ? void 0 : options.components?.();
|
|
1301
1373
|
const withComponents = components === void 0 || Object.keys(components).length === 0 ? snapshot : { ...snapshot, components };
|
|
1302
1374
|
const result = recorder === void 0 || request.include?.includes("physicsDebugSeries") !== true ? withComponents : { ...withComponents, physicsDebugSeries: recorder.sample(request, options.tick()) };
|
|
1303
1375
|
assertJsonSafe(result);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@threenative/playtest",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Scenario-driven playtest harness for Three.js games. Runs on plain Three.js with zero ThreeNative dependencies.",
|
|
6
6
|
"keywords": [
|
|
@@ -81,7 +81,8 @@
|
|
|
81
81
|
"publint": "0.3.22",
|
|
82
82
|
"three": "0.185.1",
|
|
83
83
|
"tsup": "8.5.1",
|
|
84
|
-
"typescript": "
|
|
84
|
+
"typescript": "npm:@typescript/typescript6@6.0.2",
|
|
85
|
+
"@typescript/native": "npm:typescript@7.0.2"
|
|
85
86
|
},
|
|
86
87
|
"scripts": {
|
|
87
88
|
"build": "pnpm --workspace-root exec tsx scripts/generate-assertion-validators.ts --check && tsup --config tsup.config.ts && publint",
|
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
import { IPlaytestObservationSnapshot } from './protocol.js';
|
|
2
|
-
import { c as IPlaytestReport, w as IPlaytestProtocolDiagnostic, p as IPlaytestDiagnosticsPolicy, d as IPlaytestAssertionResult } from './diagnostics-Bpy15z5f.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
|
-
user?: string;
|
|
22
|
-
};
|
|
23
|
-
adbPath?: string;
|
|
24
|
-
/** @see IAndroidDriverOptions.touchRotation */
|
|
25
|
-
touchRotation?: number;
|
|
26
|
-
artifactDirectory: string;
|
|
27
|
-
/**
|
|
28
|
-
* Capture the run's `before.png`/`after.png` artifact frames. Default true. A scenario that
|
|
29
|
-
* asserts on a frame still captures one — this only drops the convenience captures every run
|
|
30
|
-
* takes whether or not anything reads them.
|
|
31
|
-
*/
|
|
32
|
-
captureArtifactScreenshots?: boolean;
|
|
33
|
-
browserArgs?: readonly string[];
|
|
34
|
-
/** Write a Chrome DevTools `.cpuprofile` for this run (browser and desktop targets). */
|
|
35
|
-
cpuProfilePath?: string;
|
|
36
|
-
device?: string;
|
|
37
|
-
desktop?: {
|
|
38
|
-
executable: string;
|
|
39
|
-
hostArgs?: readonly string[];
|
|
40
|
-
};
|
|
41
|
-
endpoint?: string;
|
|
42
|
-
headless: boolean;
|
|
43
|
-
ios?: {
|
|
44
|
-
appPath?: string;
|
|
45
|
-
bundleId: string;
|
|
46
|
-
transport: "device" | "simulator";
|
|
47
|
-
};
|
|
48
|
-
mailboxRoot?: string;
|
|
49
|
-
port?: number;
|
|
50
|
-
projectPath: string;
|
|
51
|
-
scenarioPath: string;
|
|
52
|
-
scenarioPaths?: readonly string[];
|
|
53
|
-
server?: IPlaytestServerConfig;
|
|
54
|
-
timeoutMs: number;
|
|
55
|
-
target?: "android" | "browser" | "desktop" | "ios";
|
|
56
|
-
trace: boolean;
|
|
57
|
-
url: string;
|
|
58
|
-
xcrunPath?: string;
|
|
59
|
-
}
|
|
60
|
-
interface IPlaytestFlagHelp {
|
|
61
|
-
default: string;
|
|
62
|
-
summary: string;
|
|
63
|
-
takesValue: boolean;
|
|
64
|
-
allowDashValue?: boolean;
|
|
65
|
-
repeatable?: boolean;
|
|
66
|
-
}
|
|
67
|
-
declare const PLAYTEST_FLAGS: {
|
|
68
|
-
readonly "--adb": {
|
|
69
|
-
readonly default: "auto-discover";
|
|
70
|
-
readonly summary: "absolute adb executable path";
|
|
71
|
-
readonly takesValue: true;
|
|
72
|
-
};
|
|
73
|
-
readonly "--touch-rotation": {
|
|
74
|
-
readonly default: "read from the device";
|
|
75
|
-
readonly summary: "Android raw-touch rotation (0-3) when the app's window and the display disagree";
|
|
76
|
-
readonly takesValue: true;
|
|
77
|
-
};
|
|
78
|
-
readonly "--allow-software": {
|
|
79
|
-
readonly default: "false";
|
|
80
|
-
readonly summary: "accept a software WebGPU adapter as evidence";
|
|
81
|
-
readonly takesValue: false;
|
|
82
|
-
};
|
|
83
|
-
readonly "--activity": {
|
|
84
|
-
readonly default: ".MystralActivity";
|
|
85
|
-
readonly summary: "Android launch activity";
|
|
86
|
-
readonly takesValue: true;
|
|
87
|
-
};
|
|
88
|
-
readonly "--user": {
|
|
89
|
-
readonly default: "current foreground Android user";
|
|
90
|
-
readonly summary: "Android user id for force-stop and launch";
|
|
91
|
-
readonly takesValue: true;
|
|
92
|
-
};
|
|
93
|
-
readonly "--app": {
|
|
94
|
-
readonly default: "required for iOS";
|
|
95
|
-
readonly summary: "built iOS .app bundle";
|
|
96
|
-
readonly takesValue: true;
|
|
97
|
-
};
|
|
98
|
-
readonly "--artifacts": {
|
|
99
|
-
readonly default: "artifacts/playtest";
|
|
100
|
-
readonly summary: "artifact output directory";
|
|
101
|
-
readonly takesValue: true;
|
|
102
|
-
};
|
|
103
|
-
readonly "--no-screenshots": {
|
|
104
|
-
readonly default: "false";
|
|
105
|
-
readonly summary: "skip the before/after artifact frames; scenarios that assert on a frame still capture one";
|
|
106
|
-
readonly takesValue: false;
|
|
107
|
-
};
|
|
108
|
-
readonly "--browser-arg": {
|
|
109
|
-
readonly allowDashValue: true;
|
|
110
|
-
readonly default: "none (repeatable)";
|
|
111
|
-
readonly repeatable: true;
|
|
112
|
-
readonly summary: "one additional Chromium argument";
|
|
113
|
-
readonly takesValue: true;
|
|
114
|
-
};
|
|
115
|
-
readonly "--browser-recipe": {
|
|
116
|
-
readonly default: "none";
|
|
117
|
-
readonly summary: "named browser recipe (webgpu)";
|
|
118
|
-
readonly takesValue: true;
|
|
119
|
-
};
|
|
120
|
-
readonly "--cpu-prof": {
|
|
121
|
-
readonly default: "none";
|
|
122
|
-
readonly summary: "write a Chrome DevTools .cpuprofile for this run (browser and desktop targets)";
|
|
123
|
-
readonly takesValue: true;
|
|
124
|
-
};
|
|
125
|
-
readonly "--bundle-id": {
|
|
126
|
-
readonly default: "dev.threenative.runtime";
|
|
127
|
-
readonly summary: "iOS application bundle identifier";
|
|
128
|
-
readonly takesValue: true;
|
|
129
|
-
};
|
|
130
|
-
readonly "--device": {
|
|
131
|
-
readonly default: "platform default";
|
|
132
|
-
readonly summary: "Android serial or iOS device identifier";
|
|
133
|
-
readonly takesValue: true;
|
|
134
|
-
};
|
|
135
|
-
readonly "--executable": {
|
|
136
|
-
readonly default: "required for desktop";
|
|
137
|
-
readonly summary: "native desktop game executable";
|
|
138
|
-
readonly takesValue: true;
|
|
139
|
-
};
|
|
140
|
-
readonly "--endpoint": {
|
|
141
|
-
readonly default: "http://127.0.0.1:41777/playtest";
|
|
142
|
-
readonly summary: "device bridge endpoint";
|
|
143
|
-
readonly takesValue: true;
|
|
144
|
-
};
|
|
145
|
-
readonly "--headed": {
|
|
146
|
-
readonly default: "false";
|
|
147
|
-
readonly summary: "show the browser window";
|
|
148
|
-
readonly takesValue: false;
|
|
149
|
-
};
|
|
150
|
-
readonly "--host-arg": {
|
|
151
|
-
readonly allowDashValue: true;
|
|
152
|
-
readonly default: "none";
|
|
153
|
-
readonly repeatable: true;
|
|
154
|
-
readonly summary: "argument passed to the native desktop host, repeatable";
|
|
155
|
-
readonly takesValue: true;
|
|
156
|
-
};
|
|
157
|
-
readonly "--mailbox-root": {
|
|
158
|
-
readonly default: "Android external files directory";
|
|
159
|
-
readonly summary: "native device mailbox directory";
|
|
160
|
-
readonly takesValue: true;
|
|
161
|
-
};
|
|
162
|
-
readonly "--ios-transport": {
|
|
163
|
-
readonly default: "simulator";
|
|
164
|
-
readonly summary: "iOS transport (simulator or device)";
|
|
165
|
-
readonly takesValue: true;
|
|
166
|
-
};
|
|
167
|
-
readonly "--project": {
|
|
168
|
-
readonly default: ".";
|
|
169
|
-
readonly summary: "project root used to resolve paths";
|
|
170
|
-
readonly takesValue: true;
|
|
171
|
-
};
|
|
172
|
-
readonly "--package": {
|
|
173
|
-
readonly default: "com.mystral.engine";
|
|
174
|
-
readonly summary: "Android application id";
|
|
175
|
-
readonly takesValue: true;
|
|
176
|
-
};
|
|
177
|
-
readonly "--scenario": {
|
|
178
|
-
readonly default: "required (or positional; repeatable)";
|
|
179
|
-
readonly repeatable: true;
|
|
180
|
-
readonly summary: "scenario JSON path or glob";
|
|
181
|
-
readonly takesValue: true;
|
|
182
|
-
};
|
|
183
|
-
readonly "--server-command": {
|
|
184
|
-
readonly default: "none";
|
|
185
|
-
readonly summary: "command for a managed app server";
|
|
186
|
-
readonly takesValue: true;
|
|
187
|
-
};
|
|
188
|
-
readonly "--server-timeout": {
|
|
189
|
-
readonly default: "15000";
|
|
190
|
-
readonly summary: "managed server readiness timeout in ms";
|
|
191
|
-
readonly takesValue: true;
|
|
192
|
-
};
|
|
193
|
-
readonly "--timeout": {
|
|
194
|
-
readonly default: "15000";
|
|
195
|
-
readonly summary: "page operation timeout in ms";
|
|
196
|
-
readonly takesValue: true;
|
|
197
|
-
};
|
|
198
|
-
readonly "--target": {
|
|
199
|
-
readonly default: "browser";
|
|
200
|
-
readonly summary: "execution target (browser, android, desktop, or ios)";
|
|
201
|
-
readonly takesValue: true;
|
|
202
|
-
};
|
|
203
|
-
readonly "--trace": {
|
|
204
|
-
readonly default: "false";
|
|
205
|
-
readonly summary: "write a Playwright trace";
|
|
206
|
-
readonly takesValue: false;
|
|
207
|
-
};
|
|
208
|
-
readonly "--url": {
|
|
209
|
-
readonly default: "http://127.0.0.1:5173 (or a free managed port)";
|
|
210
|
-
readonly summary: "application URL";
|
|
211
|
-
readonly takesValue: true;
|
|
212
|
-
};
|
|
213
|
-
readonly "--port": {
|
|
214
|
-
readonly default: "free when managing a server";
|
|
215
|
-
readonly summary: "managed server port (0 chooses a free port)";
|
|
216
|
-
readonly takesValue: true;
|
|
217
|
-
};
|
|
218
|
-
readonly "--xcrun": {
|
|
219
|
-
readonly default: "auto-discover";
|
|
220
|
-
readonly summary: "absolute xcrun executable path";
|
|
221
|
-
readonly takesValue: true;
|
|
222
|
-
};
|
|
223
|
-
};
|
|
224
|
-
declare class PlaytestCliUsageError extends Error {
|
|
225
|
-
constructor(message: string);
|
|
226
|
-
}
|
|
227
|
-
declare function formatUsage(): string;
|
|
228
|
-
declare function parseStandalonePlaytestArgs(argv: readonly string[], cwd?: string): IStandalonePlaytestConfig;
|
|
229
|
-
|
|
230
|
-
interface ILabeledPlaytestSample {
|
|
231
|
-
label: string;
|
|
232
|
-
signals: unknown[];
|
|
233
|
-
snapshot: IPlaytestObservationSnapshot;
|
|
234
|
-
}
|
|
235
|
-
interface IRunnerConsoleEntry {
|
|
236
|
-
source?: "browser-console" | "page-error" | "unhandled-rejection";
|
|
237
|
-
text: string;
|
|
238
|
-
type: string;
|
|
239
|
-
}
|
|
240
|
-
interface IMovementSampleInterval {
|
|
241
|
-
after: IPlaytestObservationSnapshot;
|
|
242
|
-
before: IPlaytestObservationSnapshot;
|
|
243
|
-
inputDriven: boolean;
|
|
244
|
-
}
|
|
245
|
-
interface IRunStepSamples {
|
|
246
|
-
afterInput?: IPlaytestObservationSnapshot;
|
|
247
|
-
afterStep?: IPlaytestObservationSnapshot;
|
|
248
|
-
inputDriven: boolean;
|
|
249
|
-
}
|
|
250
|
-
interface IStandalonePlaytestReport extends IPlaytestReport {
|
|
251
|
-
artifactDirectory: string;
|
|
252
|
-
/**
|
|
253
|
-
* What the run waited for before it observed anything, and what it settled on.
|
|
254
|
-
*
|
|
255
|
-
* `rule: "compile-settled"` means the sustained in-budget frame window was not required,
|
|
256
|
-
* because the operator declared a software adapter. A pass from such a run is not a smoothness
|
|
257
|
-
* measurement and must not be read as one, so the report says which rule applied rather than
|
|
258
|
-
* leaving a reader to assume the stricter one.
|
|
259
|
-
*/
|
|
260
|
-
startup?: {
|
|
261
|
-
compileSettled?: boolean;
|
|
262
|
-
phase: string;
|
|
263
|
-
progress: number;
|
|
264
|
-
rule: string;
|
|
265
|
-
timeline?: {
|
|
266
|
-
loadStartedMs?: number;
|
|
267
|
-
enteredMs?: number;
|
|
268
|
-
compileSettledMs?: number;
|
|
269
|
-
readyMs?: number;
|
|
270
|
-
};
|
|
271
|
-
};
|
|
272
|
-
debugColliders?: boolean;
|
|
273
|
-
input?: string;
|
|
274
|
-
movementThreshold?: number;
|
|
275
|
-
pass: boolean;
|
|
276
|
-
runtime: "native" | "web";
|
|
277
|
-
scenario: string;
|
|
278
|
-
target: string;
|
|
279
|
-
trivialityOptOutCount: number;
|
|
280
|
-
url: string;
|
|
281
|
-
}
|
|
282
|
-
declare class ManagedServerError extends Error {
|
|
283
|
-
readonly diagnostic: IPlaytestProtocolDiagnostic;
|
|
284
|
-
constructor(diagnostic: IPlaytestProtocolDiagnostic);
|
|
285
|
-
}
|
|
286
|
-
declare function failedDiagnosticsAssertion(policy: IPlaytestDiagnosticsPolicy): IPlaytestAssertionResult;
|
|
287
|
-
|
|
288
|
-
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 };
|