@threenative/core 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 +45 -0
- package/capabilities.json +3542 -0
- package/dist/audio-Dp2mXpD3.d.ts +94 -0
- package/dist/canvas-layer-CtrZHgIh.d.ts +608 -0
- package/dist/game-CYIaKhgl.d.ts +980 -0
- package/dist/hot.d.ts +33 -5
- package/dist/hot.js +10 -2
- package/dist/index.d.ts +1480 -41
- package/dist/index.js +12604 -1104
- package/dist/playtest.d.ts +36 -5
- package/dist/playtest.js +160 -468
- package/dist/react.d.ts +175 -0
- package/dist/react.js +635 -0
- package/dist/ui-layer.d.ts +306 -0
- package/dist/ui-layer.js +425 -0
- package/dist/world.d.ts +55 -0
- package/dist/world.js +175 -0
- package/mcp/assets.mjs +5 -0
- package/mcp/engine-server.mjs +253 -0
- package/mcp/engine.mjs +23 -0
- package/mcp/install.mjs +77 -0
- package/mcp/launch.mjs +72 -0
- package/mcp/sculpt.mjs +5 -0
- package/mcp/servers.mjs +59 -0
- package/package.json +49 -6
- package/patches/three@0.185.1.patch +287 -0
- package/scripts/apply-three-patch.mjs +297 -0
- package/scripts/bundle-engine-mcp.mjs +15 -0
- package/scripts/ensure-mcp.mjs +36 -0
- package/scripts/generate-version.mjs +13 -0
- package/scripts/postinstall.mjs +6 -0
- package/dist/audio-3vkjtiuo.d.ts +0 -35
- package/dist/game-DRPs3M7r.d.ts +0 -269
package/dist/playtest.d.ts
CHANGED
|
@@ -1,11 +1,42 @@
|
|
|
1
|
-
import { JsonValue } from '@threenative/playtest';
|
|
2
|
-
import { b as
|
|
1
|
+
import { JsonValue } from '@threenative/playtest/protocol';
|
|
2
|
+
import { b as IGamePluginHooks } from './game-CYIaKhgl.js';
|
|
3
3
|
import 'three';
|
|
4
|
+
import './canvas-layer-CtrZHgIh.js';
|
|
5
|
+
import 'three/webgpu';
|
|
4
6
|
import 'zustand/vanilla';
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Install the playtest bridge into a portable game.
|
|
10
|
+
* @situation expose movement and world observations to a playtest
|
|
11
|
+
* @situation connect a game to the ThreeNative scenario runner
|
|
12
|
+
* @constraint install once in the game's plugin list
|
|
13
|
+
* @example const game = defineGame({ plugins: [playtest()] });
|
|
14
|
+
*/
|
|
15
|
+
declare function playtest<TState extends Record<string, unknown> = Record<string, unknown>, TPhysics = undefined>(options?: IPlaytestOptions): IGamePluginHooks<TState, TPhysics>;
|
|
16
|
+
declare const PLAYTEST_ATTACH_TIMEOUT_MS = 30000;
|
|
17
|
+
/**
|
|
18
|
+
* Resolves when a runner first calls `describe()`, the handshake every runner performs before
|
|
19
|
+
* it observes anything.
|
|
20
|
+
*
|
|
21
|
+
* Without this, a scenario races the game: a proof that does finite work at startup can finish
|
|
22
|
+
* before the runner takes its first observation, and the assertion then reports
|
|
23
|
+
* TN_PLAYTEST_ASSERTION_TRIVIAL or a zero-delta failure depending only on how fast the device
|
|
24
|
+
* booted. Opt-in, because a game that holds for a runner that never arrives is worse than the
|
|
25
|
+
* race for every non-test caller.
|
|
26
|
+
*
|
|
27
|
+
* Fails closed: if no runner attaches within the timeout, setup throws rather than quietly
|
|
28
|
+
* starting anyway and reproducing the race it was added to remove.
|
|
29
|
+
*/
|
|
30
|
+
/** The global a playtest runner sets before the page loads, so a game can tell one is coming. */
|
|
31
|
+
declare const PLAYTEST_RUNNER_EXPECTED_GLOBAL = "__THREENATIVE_PLAYTEST_RUNNER_EXPECTED__";
|
|
32
|
+
interface IPlaytestOptions {
|
|
8
33
|
readonly events?: () => JsonValue[];
|
|
34
|
+
/**
|
|
35
|
+
* Hold the frame loop until a runner attaches. Default false.
|
|
36
|
+
*/
|
|
37
|
+
readonly holdUntilAttached?: boolean;
|
|
38
|
+
/** Milliseconds to wait when `holdUntilAttached` is set. Default {@link PLAYTEST_ATTACH_TIMEOUT_MS}. */
|
|
39
|
+
readonly attachTimeoutMs?: number;
|
|
9
40
|
}
|
|
10
41
|
|
|
11
|
-
export { type
|
|
42
|
+
export { type IPlaytestOptions, PLAYTEST_ATTACH_TIMEOUT_MS, PLAYTEST_RUNNER_EXPECTED_GLOBAL, playtest };
|