@vgai/engine 0.5.14 → 0.5.16
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/dist/adapter/adapter-module.d.ts +228 -17
- package/dist/adapter/adapter-module.d.ts.map +1 -1
- package/dist/adapter/adapter-module.js +224 -42
- package/dist/adapter/authoring-seam-contract.d.ts +530 -0
- package/dist/adapter/authoring-seam-contract.d.ts.map +1 -0
- package/dist/adapter/authoring-seam-contract.js +162 -0
- package/dist/adapter/authoring.d.ts +237 -50
- package/dist/adapter/authoring.d.ts.map +1 -1
- package/dist/adapter/authoring.js +2 -1
- package/dist/adapter/entrypoint-selection-source.d.ts +35 -0
- package/dist/adapter/entrypoint-selection-source.d.ts.map +1 -0
- package/dist/adapter/entrypoint-selection-source.js +151 -0
- package/dist/adapter/finders/scenes-from-entrypoint-selection.d.ts +7 -1
- package/dist/adapter/finders/scenes-from-entrypoint-selection.d.ts.map +1 -1
- package/dist/adapter/finders/scenes-from-entrypoint-selection.js +142 -21
- package/dist/adapter/first-party-systems.d.ts +13 -3
- package/dist/adapter/first-party-systems.d.ts.map +1 -1
- package/dist/adapter/first-party-systems.js +10 -3
- package/dist/adapter/index.d.ts +7 -2
- package/dist/adapter/index.d.ts.map +1 -1
- package/dist/adapter/index.js +4 -0
- package/dist/adapter/ingest/contract-system-adapters.d.ts +1 -1
- package/dist/adapter/ingest/contract-system-adapters.d.ts.map +1 -1
- package/dist/adapter/ingest/contract-system-adapters.js +13 -25
- package/dist/adapter/ingest/game-contract-seams.d.ts +214 -0
- package/dist/adapter/ingest/game-contract-seams.d.ts.map +1 -0
- package/dist/adapter/ingest/game-contract-seams.js +62 -0
- package/dist/adapter/ingest/game-contract.d.ts +5 -3
- package/dist/adapter/ingest/game-contract.d.ts.map +1 -1
- package/dist/adapter/ingest/game-contract.js +4 -1
- package/dist/adapter/ingest/merge-debug-adapters.d.ts +52 -0
- package/dist/adapter/ingest/merge-debug-adapters.d.ts.map +1 -0
- package/dist/adapter/ingest/merge-debug-adapters.js +141 -0
- package/dist/adapter/ingest/observation-debug-adapter.d.ts +56 -0
- package/dist/adapter/ingest/observation-debug-adapter.d.ts.map +1 -0
- package/dist/adapter/ingest/observation-debug-adapter.js +131 -0
- package/dist/adapter/ingest/scene-capture.d.ts +38 -13
- package/dist/adapter/ingest/scene-capture.d.ts.map +1 -1
- package/dist/adapter/ingest/scene-capture.js +101 -24
- package/dist/adapter/ingest/visible-capture-window.d.ts +22 -5
- package/dist/adapter/ingest/visible-capture-window.d.ts.map +1 -1
- package/dist/adapter/ingest/visible-capture-window.js +46 -7
- package/dist/adapter/native-debug-module.d.ts +43 -0
- package/dist/adapter/native-debug-module.d.ts.map +1 -0
- package/dist/adapter/native-debug-module.js +230 -0
- package/dist/adapter/object3d-authoring-subject.d.ts +32 -0
- package/dist/adapter/object3d-authoring-subject.d.ts.map +1 -0
- package/dist/adapter/object3d-authoring-subject.js +25 -0
- package/dist/adapter/root-adapter.d.ts +21 -56
- package/dist/adapter/root-adapter.d.ts.map +1 -1
- package/dist/adapter/root-adapter.js +4 -20
- package/dist/adapter/root-seam-contract.d.ts +124 -0
- package/dist/adapter/root-seam-contract.d.ts.map +1 -0
- package/dist/adapter/root-seam-contract.js +36 -0
- package/dist/adapter/seam-evidence.d.ts +118 -0
- package/dist/adapter/seam-evidence.d.ts.map +1 -0
- package/dist/adapter/seam-evidence.js +231 -0
- package/dist/adapter/setup-three-root-adapter.d.ts +2 -3
- package/dist/adapter/setup-three-root-adapter.d.ts.map +1 -1
- package/dist/adapter/setup-three-root-adapter.js +2 -3
- package/dist/adapter/system-adapter.d.ts +6 -1
- package/dist/adapter/system-adapter.d.ts.map +1 -1
- package/dist/adapter/system-seam-contract.d.ts +354 -0
- package/dist/adapter/system-seam-contract.d.ts.map +1 -0
- package/dist/adapter/system-seam-contract.js +95 -0
- package/dist/animation/xstate-animation-binding.d.ts +6 -0
- package/dist/animation/xstate-animation-binding.d.ts.map +1 -1
- package/dist/animation/xstate-animation-binding.js +142 -4
- package/dist/asset-formats/collider.d.ts +1 -1
- package/dist/asset-formats/mesh.d.ts +2 -2
- package/dist/asset-formats/particles.d.ts +1 -1
- package/dist/canvas-react/engine-bridge.d.ts +6 -6
- package/dist/canvas-react/engine-bridge.d.ts.map +1 -1
- package/dist/canvas-react/engine-bridge.js +2 -2
- package/dist/canvas-react/index.d.ts +2 -2
- package/dist/canvas-react/index.d.ts.map +1 -1
- package/dist/canvas-react/index.js +1 -1
- package/dist/canvas-react/pixi-react-adapter.d.ts +15 -9
- package/dist/canvas-react/pixi-react-adapter.d.ts.map +1 -1
- package/dist/canvas-react/pixi-react-adapter.js +43 -29
- package/dist/canvas-react/pixi-react-root-factory.d.ts.map +1 -1
- package/dist/canvas-react/pixi-react-root-factory.js +4 -0
- package/dist/canvas-react/world-context.d.ts +22 -12
- package/dist/canvas-react/world-context.d.ts.map +1 -1
- package/dist/canvas-react/world-context.js +12 -51
- package/dist/ecs/user-data.d.ts +5 -0
- package/dist/ecs/user-data.d.ts.map +1 -1
- package/dist/ecs/user-data.js +3 -0
- package/dist/input/input-manager.d.ts +49 -0
- package/dist/input/input-manager.d.ts.map +1 -1
- package/dist/input/input-manager.js +127 -0
- package/dist/manifest/schema.d.ts +9 -9
- package/dist/manifest/schema.js +1 -1
- package/dist/pixi/authoring.d.ts.map +1 -1
- package/dist/pixi/authoring.js +220 -1
- package/dist/pixi/ingest.d.ts +2 -1
- package/dist/pixi/ingest.d.ts.map +1 -1
- package/dist/pixi/ingest.js +4 -2
- package/dist/pixi/scene-capture.d.ts +9 -1
- package/dist/pixi/scene-capture.d.ts.map +1 -1
- package/dist/pixi/scene-capture.js +9 -6
- package/dist/render/particles-factory.d.ts +13 -6
- package/dist/render/particles-factory.d.ts.map +1 -1
- package/dist/render/particles-factory.js +6 -3
- package/dist/runtime/create-runtime.d.ts +23 -46
- package/dist/runtime/create-runtime.d.ts.map +1 -1
- package/dist/runtime/create-runtime.js +22 -67
- package/dist/runtime/game.d.ts +29 -71
- package/dist/runtime/game.d.ts.map +1 -1
- package/dist/runtime/game.js +15 -54
- package/dist/runtime/mount-game.d.ts.map +1 -1
- package/dist/runtime/mount-game.js +12 -1
- package/dist/runtime/mount-manifest.d.ts.map +1 -1
- package/dist/runtime/mount-manifest.js +4 -5
- package/dist/runtime/types.d.ts +18 -0
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/setup/setup-renderer.d.ts +3 -4
- package/dist/setup/setup-renderer.d.ts.map +1 -1
- package/dist/setup/setup-renderer.js +3 -4
- package/dist/world3d-react/engine-bridge.d.ts +1 -1
- package/dist/world3d-react/engine-bridge.js +1 -1
- package/dist/world3d-react/r3f-adapter.d.ts +7 -0
- package/dist/world3d-react/r3f-adapter.d.ts.map +1 -1
- package/dist/world3d-react/r3f-adapter.js +50 -21
- package/dist/world3d-react/r3f-root-factory.d.ts.map +1 -1
- package/dist/world3d-react/r3f-root-factory.js +4 -0
- package/dist/world3d-react/world-context.d.ts +9 -3
- package/dist/world3d-react/world-context.d.ts.map +1 -1
- package/dist/world3d-react/world-context.js +5 -18
- package/package.json +1 -1
- package/schemas/engine-capabilities.json +8 -8
- package/schemas/vgai-project.schema.json +1 -1
- package/src/adapter/adapter-module.ts +407 -50
- package/src/adapter/authoring-seam-contract.ts +211 -0
- package/src/adapter/authoring.ts +242 -50
- package/src/adapter/entrypoint-selection-source.ts +159 -0
- package/src/adapter/finders/scenes-from-entrypoint-selection.ts +159 -28
- package/src/adapter/first-party-systems.ts +17 -3
- package/src/adapter/index.ts +51 -1
- package/src/adapter/ingest/contract-system-adapters.ts +26 -30
- package/src/adapter/ingest/game-contract-seams.ts +85 -0
- package/src/adapter/ingest/game-contract.ts +9 -4
- package/src/adapter/ingest/merge-debug-adapters.ts +193 -0
- package/src/adapter/ingest/observation-debug-adapter.ts +158 -0
- package/src/adapter/ingest/scene-capture.ts +126 -23
- package/src/adapter/ingest/visible-capture-window.ts +63 -9
- package/src/adapter/native-debug-module.ts +307 -0
- package/src/adapter/object3d-authoring-subject.ts +50 -0
- package/src/adapter/root-adapter.ts +21 -56
- package/src/adapter/root-seam-contract.ts +56 -0
- package/src/adapter/seam-evidence.ts +336 -0
- package/src/adapter/setup-three-root-adapter.ts +4 -6
- package/src/adapter/system-adapter.ts +6 -1
- package/src/adapter/system-seam-contract.ts +121 -0
- package/src/animation/xstate-animation-binding.ts +151 -4
- package/src/canvas-react/engine-bridge.ts +6 -6
- package/src/canvas-react/index.ts +2 -1
- package/src/canvas-react/pixi-react-adapter.tsx +55 -34
- package/src/canvas-react/pixi-react-root-factory.tsx +4 -0
- package/src/canvas-react/world-context.ts +26 -101
- package/src/ecs/user-data.ts +5 -0
- package/src/input/input-manager.ts +122 -0
- package/src/manifest/schema.ts +1 -1
- package/src/pixi/authoring.ts +236 -1
- package/src/pixi/ingest.ts +9 -2
- package/src/pixi/scene-capture.ts +20 -5
- package/src/render/particles-factory.ts +16 -6
- package/src/runtime/create-runtime.ts +41 -106
- package/src/runtime/game.ts +41 -111
- package/src/runtime/mount-game.ts +19 -1
- package/src/runtime/mount-manifest.ts +4 -5
- package/src/runtime/types.ts +22 -0
- package/src/setup/setup-renderer.ts +3 -4
- package/src/world3d-react/engine-bridge.ts +1 -1
- package/src/world3d-react/r3f-adapter.tsx +64 -24
- package/src/world3d-react/r3f-root-factory.tsx +4 -0
- package/src/world3d-react/world-context.ts +11 -36
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ordinary module surface a native game may expose to its own debugger.
|
|
3
|
+
*
|
|
4
|
+
* A root entry re-exports one `debug` object from the project's command module:
|
|
5
|
+
*
|
|
6
|
+
* export { debug } from './commands';
|
|
7
|
+
*
|
|
8
|
+
* The command module imports no vgai API. Its functions are the application's
|
|
9
|
+
* own functions over its own stores; the native adapter merely projects that
|
|
10
|
+
* existing registry onto the session debug/input doors after the root mounts.
|
|
11
|
+
* Loading through the root entry is load-bearing: the functions close over the
|
|
12
|
+
* exact module graph the mounted application uses, never a separately evaluated
|
|
13
|
+
* copy of its stores.
|
|
14
|
+
*/
|
|
15
|
+
import { DebugError, getDebugRegistry, } from '../runtime/debug-registry';
|
|
16
|
+
export const NATIVE_INPUT_VALUE_TYPES = [
|
|
17
|
+
'digital',
|
|
18
|
+
'scalar',
|
|
19
|
+
'vector2',
|
|
20
|
+
'pointerDelta',
|
|
21
|
+
'pointerPosition',
|
|
22
|
+
];
|
|
23
|
+
function isRecord(value) {
|
|
24
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
25
|
+
}
|
|
26
|
+
function rejectUnknownKeys(value, allowed, at) {
|
|
27
|
+
const unknown = Object.keys(value).filter((key) => !allowed.includes(key));
|
|
28
|
+
if (unknown.length > 0) {
|
|
29
|
+
throw new Error(`${at} has unknown ${unknown.length === 1 ? 'key' : 'keys'}: ${unknown.join(', ')}`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function functionRecord(value, at) {
|
|
33
|
+
if (!isRecord(value))
|
|
34
|
+
throw new Error(`${at} must be an object of named functions.`);
|
|
35
|
+
const out = {};
|
|
36
|
+
for (const [name, candidate] of Object.entries(value)) {
|
|
37
|
+
if (!name)
|
|
38
|
+
throw new Error(`${at} contains an empty name.`);
|
|
39
|
+
if (typeof candidate !== 'function')
|
|
40
|
+
throw new Error(`${at}.${name} must be a function.`);
|
|
41
|
+
out[name] = candidate;
|
|
42
|
+
}
|
|
43
|
+
return out;
|
|
44
|
+
}
|
|
45
|
+
function parseActions(value) {
|
|
46
|
+
if (!isRecord(value)) {
|
|
47
|
+
throw new Error('debug.input.actions must be an object mapping action names to value types.');
|
|
48
|
+
}
|
|
49
|
+
const actions = {};
|
|
50
|
+
for (const [name, valueType] of Object.entries(value)) {
|
|
51
|
+
if (!name)
|
|
52
|
+
throw new Error('debug.input.actions contains an empty action name.');
|
|
53
|
+
if (!NATIVE_INPUT_VALUE_TYPES.includes(valueType)) {
|
|
54
|
+
throw new Error(`debug.input.actions.${name} must be one of ${NATIVE_INPUT_VALUE_TYPES.join(', ')}.`);
|
|
55
|
+
}
|
|
56
|
+
actions[name] = valueType;
|
|
57
|
+
}
|
|
58
|
+
return actions;
|
|
59
|
+
}
|
|
60
|
+
function parseInput(value) {
|
|
61
|
+
if (!isRecord(value))
|
|
62
|
+
throw new Error('debug.input must be an object.');
|
|
63
|
+
rejectUnknownKeys(value, ['actions', 'set', 'clear', 'tap', 'scheduleAtTick'], 'debug.input');
|
|
64
|
+
const set = value['set'];
|
|
65
|
+
const clear = value['clear'];
|
|
66
|
+
const tap = value['tap'];
|
|
67
|
+
const scheduleAtTick = value['scheduleAtTick'];
|
|
68
|
+
if (typeof set !== 'function')
|
|
69
|
+
throw new Error('debug.input.set must be a function.');
|
|
70
|
+
if (typeof clear !== 'function')
|
|
71
|
+
throw new Error('debug.input.clear must be a function.');
|
|
72
|
+
if (tap !== undefined && typeof tap !== 'function') {
|
|
73
|
+
throw new Error('debug.input.tap must be a function when provided.');
|
|
74
|
+
}
|
|
75
|
+
if (scheduleAtTick !== undefined && typeof scheduleAtTick !== 'function') {
|
|
76
|
+
throw new Error('debug.input.scheduleAtTick must be a function when provided.');
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
actions: parseActions(value['actions']),
|
|
80
|
+
set: set,
|
|
81
|
+
clear: clear,
|
|
82
|
+
...(typeof tap === 'function' ? { tap: tap } : {}),
|
|
83
|
+
...(typeof scheduleAtTick === 'function'
|
|
84
|
+
? {
|
|
85
|
+
scheduleAtTick: scheduleAtTick,
|
|
86
|
+
}
|
|
87
|
+
: {}),
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
/** Read the single native `debug` export from an already-loaded root module. */
|
|
91
|
+
export function nativeDebugBindingFromEntryModule(rootId, entryModule) {
|
|
92
|
+
if (!isRecord(entryModule) || entryModule['debug'] === undefined)
|
|
93
|
+
return null;
|
|
94
|
+
if (!isRecord(entryModule['debug'])) {
|
|
95
|
+
throw new Error(`Root "${rootId}" exports \`debug\`, but it is not an object.`);
|
|
96
|
+
}
|
|
97
|
+
const raw = entryModule['debug'];
|
|
98
|
+
rejectUnknownKeys(raw, ['commands', 'state', 'input'], `Root "${rootId}" debug export`);
|
|
99
|
+
const commands = raw['commands'] === undefined ? undefined : functionRecord(raw['commands'], 'debug.commands');
|
|
100
|
+
const state = raw['state'] === undefined ? undefined : functionRecord(raw['state'], 'debug.state');
|
|
101
|
+
const input = raw['input'] === undefined ? undefined : parseInput(raw['input']);
|
|
102
|
+
if (!commands && !state && !input) {
|
|
103
|
+
throw new Error(`Root "${rootId}" exports an empty \`debug\` object.`);
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
rootId,
|
|
107
|
+
debug: {
|
|
108
|
+
...(commands ? { commands } : {}),
|
|
109
|
+
...(state ? { state } : {}),
|
|
110
|
+
...(input ? { input } : {}),
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
function valueMatches(type, value) {
|
|
115
|
+
if (type === 'digital')
|
|
116
|
+
return typeof value === 'boolean';
|
|
117
|
+
if (type === 'scalar')
|
|
118
|
+
return typeof value === 'number' && Number.isFinite(value);
|
|
119
|
+
return (typeof value === 'object' &&
|
|
120
|
+
value !== null &&
|
|
121
|
+
typeof value.x === 'number' &&
|
|
122
|
+
Number.isFinite(value.x) &&
|
|
123
|
+
typeof value.y === 'number' &&
|
|
124
|
+
Number.isFinite(value.y));
|
|
125
|
+
}
|
|
126
|
+
function installInput(game, registry, binding, input) {
|
|
127
|
+
const trace = [];
|
|
128
|
+
let recording = false;
|
|
129
|
+
const requireAction = (action, value) => {
|
|
130
|
+
const type = input.actions[action];
|
|
131
|
+
if (!type) {
|
|
132
|
+
throw new DebugError('INPUT_ACTION_NOT_FOUND', `Native input has no action named "${action}".`, {
|
|
133
|
+
registered: Object.keys(input.actions),
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
if (!valueMatches(type, value)) {
|
|
137
|
+
throw new DebugError('INPUT_ACTION_VALUE_TYPE', `Native input action "${action}" expects ${type}, not ${typeof value}.`, { action, expected: type });
|
|
138
|
+
}
|
|
139
|
+
return type;
|
|
140
|
+
};
|
|
141
|
+
const apply = (action, value, tick) => {
|
|
142
|
+
requireAction(action, value);
|
|
143
|
+
input.set(action, value);
|
|
144
|
+
if (recording)
|
|
145
|
+
trace.push({ tick, action, value });
|
|
146
|
+
};
|
|
147
|
+
const unsupportedSource = (method) => {
|
|
148
|
+
throw new DebugError('NATIVE_INPUT_SOURCE_UNSUPPORTED', `${method} addresses an engine test source, but this game exposes an app-owned action store. Drive it by action name instead.`);
|
|
149
|
+
};
|
|
150
|
+
const target = {
|
|
151
|
+
setVirtualAction(action, value) {
|
|
152
|
+
apply(action, value, registry.getGameTick());
|
|
153
|
+
return { delivered: true };
|
|
154
|
+
},
|
|
155
|
+
tapVirtualAction(action) {
|
|
156
|
+
if (!input.tap) {
|
|
157
|
+
throw new DebugError('NATIVE_INPUT_TAP_UNSUPPORTED', `Native input for root "${binding.rootId}" does not export tap(); use setVirtualAction through the app-owned store.`);
|
|
158
|
+
}
|
|
159
|
+
requireAction(action, true);
|
|
160
|
+
input.tap(action);
|
|
161
|
+
return { delivered: true };
|
|
162
|
+
},
|
|
163
|
+
clearVirtualActions() {
|
|
164
|
+
input.clear();
|
|
165
|
+
},
|
|
166
|
+
scheduleActionAtTick(tick, action, value) {
|
|
167
|
+
const currentTick = registry.getGameTick();
|
|
168
|
+
if (!Number.isInteger(tick) || tick < currentTick) {
|
|
169
|
+
throw new DebugError('TICK_ALREADY_PASSED', `Cannot schedule native input for tick ${tick}; current tick is ${currentTick}.`, { tick, currentTick });
|
|
170
|
+
}
|
|
171
|
+
requireAction(action, value);
|
|
172
|
+
if (!input.scheduleAtTick) {
|
|
173
|
+
throw new DebugError('NATIVE_INPUT_SCHEDULE_UNSUPPORTED', `Native input for root "${binding.rootId}" does not export scheduleAtTick(); the adapter will not create a host scheduler for it.`);
|
|
174
|
+
}
|
|
175
|
+
input.scheduleAtTick(tick, action, value);
|
|
176
|
+
},
|
|
177
|
+
startInputRecording() {
|
|
178
|
+
trace.length = 0;
|
|
179
|
+
recording = true;
|
|
180
|
+
},
|
|
181
|
+
stopInputRecording() {
|
|
182
|
+
recording = false;
|
|
183
|
+
},
|
|
184
|
+
isInputRecording() {
|
|
185
|
+
return recording;
|
|
186
|
+
},
|
|
187
|
+
injectAxis() {
|
|
188
|
+
unsupportedSource('injectAxis');
|
|
189
|
+
},
|
|
190
|
+
injectVector2() {
|
|
191
|
+
unsupportedSource('injectVector2');
|
|
192
|
+
},
|
|
193
|
+
injectPointerDelta() {
|
|
194
|
+
unsupportedSource('injectPointerDelta');
|
|
195
|
+
},
|
|
196
|
+
injectPointerPosition() {
|
|
197
|
+
unsupportedSource('injectPointerPosition');
|
|
198
|
+
},
|
|
199
|
+
};
|
|
200
|
+
registry.setInputActionsSource(binding.rootId, () => Object.entries(input.actions).map(([name, valueType]) => ({ name, valueType })));
|
|
201
|
+
registry.setInputTraceSource(binding.rootId, () => ({
|
|
202
|
+
version: 1,
|
|
203
|
+
seed: null,
|
|
204
|
+
fixedDt: game.loop.fixedDt,
|
|
205
|
+
ticks: [...trace],
|
|
206
|
+
}));
|
|
207
|
+
registry.setVirtualInputTarget(binding.rootId, target);
|
|
208
|
+
}
|
|
209
|
+
/** Project native registries onto the existing session debugger after mount. */
|
|
210
|
+
export function installNativeDebugBindings(game, bindings) {
|
|
211
|
+
if (bindings.length === 0)
|
|
212
|
+
return;
|
|
213
|
+
const registry = getDebugRegistry(game);
|
|
214
|
+
if (!registry)
|
|
215
|
+
throw new Error('Cannot install native debug bindings: mounted Game has no debug registry.');
|
|
216
|
+
for (const binding of bindings) {
|
|
217
|
+
if (!game.world(binding.rootId)) {
|
|
218
|
+
throw new Error(`Native debug binding names unmounted root "${binding.rootId}".`);
|
|
219
|
+
}
|
|
220
|
+
const root = registry.forRoot(binding.rootId);
|
|
221
|
+
for (const [name, read] of Object.entries(binding.debug.state ?? {})) {
|
|
222
|
+
root.registerStateProvider(name, read, { tier: 'assisted' });
|
|
223
|
+
}
|
|
224
|
+
for (const [name, command] of Object.entries(binding.debug.commands ?? {})) {
|
|
225
|
+
root.registerCommand(name, { locus: 'client' }, command);
|
|
226
|
+
}
|
|
227
|
+
if (binding.debug.input)
|
|
228
|
+
installInput(game, registry, binding, binding.debug.input);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transient authoring identity for a native subject represented by an
|
|
3
|
+
* Object3D proxy.
|
|
4
|
+
*
|
|
5
|
+
* Some ecosystem-native objects are not Object3Ds themselves: Rapier bodies
|
|
6
|
+
* and joints are the first examples. A project library may already own a
|
|
7
|
+
* viewport proxy for one of those objects. This mark lets the ordinary
|
|
8
|
+
* Object3D authoring projection name and inspect that proxy without teaching
|
|
9
|
+
* the editor shell the library's nouns or creating a persisted sidecar.
|
|
10
|
+
*
|
|
11
|
+
* The mark is observation only. Its values are read from the native owner at
|
|
12
|
+
* the moment they are requested, and any authored change still belongs in the
|
|
13
|
+
* owning TS/TSX or ecosystem artifact.
|
|
14
|
+
*/
|
|
15
|
+
import type * as THREE from 'three';
|
|
16
|
+
import type { PropertyDescriptor } from './authoring';
|
|
17
|
+
export interface Object3DAuthoringSubjectField extends PropertyDescriptor {
|
|
18
|
+
/** Read the current value from the native subject. */
|
|
19
|
+
readonly value: () => unknown;
|
|
20
|
+
}
|
|
21
|
+
export interface Object3DAuthoringSubjectMark {
|
|
22
|
+
readonly label: string;
|
|
23
|
+
readonly kind: string;
|
|
24
|
+
readonly typeLabel?: string;
|
|
25
|
+
readonly fields?: () => readonly Object3DAuthoringSubjectField[];
|
|
26
|
+
/** Presentation-only selection feedback for proxies hidden by default. */
|
|
27
|
+
readonly selectionChanged?: (selected: boolean) => void;
|
|
28
|
+
}
|
|
29
|
+
export declare function object3DAuthoringSubjectOf(object: THREE.Object3D | null | undefined): Object3DAuthoringSubjectMark | null;
|
|
30
|
+
export declare function setObject3DAuthoringSubject(object: THREE.Object3D, mark: Object3DAuthoringSubjectMark): void;
|
|
31
|
+
export declare function clearObject3DAuthoringSubject(object: THREE.Object3D): void;
|
|
32
|
+
//# sourceMappingURL=object3d-authoring-subject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object3d-authoring-subject.d.ts","sourceRoot":"","sources":["../../src/adapter/object3d-authoring-subject.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAEpC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD,MAAM,WAAW,6BAA8B,SAAQ,kBAAkB;IACvE,sDAAsD;IACtD,QAAQ,CAAC,KAAK,EAAE,MAAM,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,SAAS,6BAA6B,EAAE,CAAC;IACjE,0EAA0E;IAC1E,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;CACzD;AAED,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,KAAK,CAAC,QAAQ,GAAG,IAAI,GAAG,SAAS,GACxC,4BAA4B,GAAG,IAAI,CAGrC;AAED,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,KAAK,CAAC,QAAQ,EACtB,IAAI,EAAE,4BAA4B,GACjC,IAAI,CAEN;AAED,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,GAAG,IAAI,CAE1E"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transient authoring identity for a native subject represented by an
|
|
3
|
+
* Object3D proxy.
|
|
4
|
+
*
|
|
5
|
+
* Some ecosystem-native objects are not Object3Ds themselves: Rapier bodies
|
|
6
|
+
* and joints are the first examples. A project library may already own a
|
|
7
|
+
* viewport proxy for one of those objects. This mark lets the ordinary
|
|
8
|
+
* Object3D authoring projection name and inspect that proxy without teaching
|
|
9
|
+
* the editor shell the library's nouns or creating a persisted sidecar.
|
|
10
|
+
*
|
|
11
|
+
* The mark is observation only. Its values are read from the native owner at
|
|
12
|
+
* the moment they are requested, and any authored change still belongs in the
|
|
13
|
+
* owning TS/TSX or ecosystem artifact.
|
|
14
|
+
*/
|
|
15
|
+
import { deleteUserData, getUserData, setUserData } from '../ecs/user-data';
|
|
16
|
+
export function object3DAuthoringSubjectOf(object) {
|
|
17
|
+
const mark = getUserData(object, 'authoringSubject');
|
|
18
|
+
return mark && typeof mark.label === 'string' && typeof mark.kind === 'string' ? mark : null;
|
|
19
|
+
}
|
|
20
|
+
export function setObject3DAuthoringSubject(object, mark) {
|
|
21
|
+
setUserData(object, 'authoringSubject', mark);
|
|
22
|
+
}
|
|
23
|
+
export function clearObject3DAuthoringSubject(object) {
|
|
24
|
+
deleteUserData(object, 'authoringSubject');
|
|
25
|
+
}
|
|
@@ -1,26 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* RootAdapter — the host ⇄ runtime contract. A ROOT is *anything that mounts*.
|
|
3
3
|
*
|
|
4
|
-
* This is the interface the
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* are peer implementers of THIS interface; the host has no branch on which.
|
|
9
|
-
*
|
|
10
|
-
* It was `GameAdapter` until WO-9 #60, and the rename is an ONTOLOGY fix, not
|
|
11
|
-
* taste. Under D20 a *game* is the manifest's whole `roots` array — that is
|
|
12
|
-
* what `runtime/game.ts`'s `Game` is. Every implementer of THIS interface
|
|
13
|
-
* adapts exactly ONE root. So `Game` and `GameAdapter` sat at different levels
|
|
14
|
-
* of the ontology while sharing a name-stem, which reads as though one were
|
|
15
|
-
* the adapter for the other. The surrounding vocabulary had already moved:
|
|
16
|
-
* `MountedRootBase`, `MountedRoot`, `MountedRootFor`, `RootStateObserver`,
|
|
17
|
-
* `SurfaceAdapterFor`, `RootInstance`, `mountManifestRoots` — and, decisively,
|
|
18
|
-
* the resolver that PRODUCES these (`resolveRootAdapter`, `RootAdapterSchema`,
|
|
19
|
-
* `resolveThreeRootAdapter`) already said root. The interface was the last
|
|
20
|
-
* holdout, out of step with its own resolver.
|
|
21
|
-
*
|
|
22
|
-
* The `K = 'three'` default below is KEPT deliberately (see the note on the
|
|
23
|
-
* interface).
|
|
4
|
+
* This is the interface the host depends on. `GameSetupFn` is private to one
|
|
5
|
+
* implementer (`SetupThreeRootAdapter`); first-party content and unmodified
|
|
6
|
+
* external games are peer root adapters. A game is the manifest's complete
|
|
7
|
+
* roots array, while each adapter owns exactly one root.
|
|
24
8
|
*/
|
|
25
9
|
import type { Container } from 'pixi.js';
|
|
26
10
|
import type * as THREE from 'three';
|
|
@@ -59,12 +43,9 @@ export interface RootStateObserver {
|
|
|
59
43
|
snapshot(): unknown;
|
|
60
44
|
}
|
|
61
45
|
/**
|
|
62
|
-
* Everything a mounted world provides
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
* `MountedThreeRoot` so a non-threejs world can carry its own kind-appropriate
|
|
66
|
-
* surface field (a pixi `stage`, a react `container`) instead of being
|
|
67
|
-
* force-fit through THREE `scene`/`camera` fields it doesn't have.
|
|
46
|
+
* Everything a mounted world provides except its render surface. Tagged
|
|
47
|
+
* mounted-root variants carry their native surface fields: a Three scene and
|
|
48
|
+
* camera, a Pixi stage, or a DOM container.
|
|
68
49
|
*/
|
|
69
50
|
export interface MountedRootBase {
|
|
70
51
|
/**
|
|
@@ -96,11 +77,8 @@ export interface MountedRootBase {
|
|
|
96
77
|
* field. */
|
|
97
78
|
readonly observe?: RootStateObserver;
|
|
98
79
|
}
|
|
99
|
-
/** A live, mounted
|
|
100
|
-
*
|
|
101
|
-
* which every pre-T7.5 threejs call site named; the alias is deleted, because
|
|
102
|
-
* what it aliased is one three ROOT and a game is the manifest's whole set of
|
|
103
|
-
* roots (D20). */
|
|
80
|
+
/** A live, mounted Three world. The host obtains `scene`/`camera` to render
|
|
81
|
+
* and author it. */
|
|
104
82
|
export interface MountedThreeRoot extends MountedRootBase {
|
|
105
83
|
readonly kind: 'three';
|
|
106
84
|
/** The live scene + camera the editor inspects/renders for authoring. */
|
|
@@ -141,38 +119,29 @@ export interface MountedReactRoot extends MountedRootBase {
|
|
|
141
119
|
readonly kind: 'dom';
|
|
142
120
|
readonly container: HTMLElement;
|
|
143
121
|
}
|
|
144
|
-
/** Every kind of live, mounted world
|
|
145
|
-
* is typed against now, replacing the THREE-only `MountedThreeRoot`. */
|
|
122
|
+
/** Every kind of live, mounted world. */
|
|
146
123
|
export type MountedRoot = MountedThreeRoot | MountedPixiRoot | MountedReactRoot;
|
|
147
124
|
/** Map a {@link AdapterSurface} to its mounted-world shape (mirrors `NodeOf`/
|
|
148
125
|
* `BodyOf`/`ColliderOf` in `ecs/behavior.ts`) — lets generic code over
|
|
149
126
|
* `K extends AdapterSurface` name the right surface without a manual union. */
|
|
150
127
|
export type MountedRootFor<K extends AdapterSurface> = K extends 'three' ? MountedThreeRoot : K extends 'canvas' ? MountedPixiRoot : K extends 'dom' ? MountedReactRoot : never;
|
|
151
128
|
/**
|
|
152
|
-
* The interface every
|
|
153
|
-
* {@link AdapterSurface}
|
|
154
|
-
*
|
|
155
|
-
* defaults to `'three'` so every pre-T7.5 implementer/call site
|
|
156
|
-
* (`RootAdapter`, unparameterized) keeps compiling unchanged.
|
|
129
|
+
* The interface every root implements to run on the host. Generic over
|
|
130
|
+
* {@link AdapterSurface} so `mount` receives and returns its native surface
|
|
131
|
+
* types. Bare `RootAdapter` denotes the first-party Three surface.
|
|
157
132
|
*
|
|
158
|
-
* `K` parameterizes
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
* `THREE.WebGLRenderer` it cannot use, and the production Pixi/React adapters
|
|
162
|
-
* could not be `RootAdapter`s at all (they were separate structural types over
|
|
163
|
-
* `CanvasHostContext`/`DomHostContext`, and `RootAdapter<'canvas'>` existed only in
|
|
164
|
-
* tests). With `HostContextFor<K>` the surface tag picks the context type, and
|
|
165
|
-
* those production adapters are now genuine `RootAdapter<K>` subtypes —
|
|
133
|
+
* `K` parameterizes both halves of `mount`: `HostContextFor<K>` selects the
|
|
134
|
+
* host context and `MountedRootFor<K>` selects the mounted result. Production
|
|
135
|
+
* adapters are genuine `RootAdapter<K>` subtypes —
|
|
166
136
|
* `Pixi2DRootAdapter extends RootAdapter<'canvas'>`, `ReactRootAdapter extends
|
|
167
137
|
* RootAdapter<'dom'>` (`runtime/create-runtime.ts`).
|
|
168
138
|
*/
|
|
169
139
|
/**
|
|
170
|
-
*
|
|
171
|
-
*
|
|
140
|
+
* The `= 'three'` default is type-level only: an author who writes bare
|
|
141
|
+
* `RootAdapter` for
|
|
172
142
|
* a pixi root gets a compile error on `mount`'s return type, because
|
|
173
143
|
* `MountedRootFor<'three'>` demands `scene`/`camera` a `MountedPixiRoot` has
|
|
174
|
-
* not got.
|
|
175
|
-
* be churn across ~125 bare call sites for no defect it could catch.
|
|
144
|
+
* not got.
|
|
176
145
|
*/
|
|
177
146
|
export interface RootAdapter<K extends AdapterSurface = 'three'> {
|
|
178
147
|
/** Stable id (telemetry/registry/conformance). */
|
|
@@ -184,17 +153,13 @@ export interface RootAdapter<K extends AdapterSurface = 'three'> {
|
|
|
184
153
|
/**
|
|
185
154
|
* One surface tag paired with an adapter typed FOR that surface (WO-34).
|
|
186
155
|
*
|
|
187
|
-
*
|
|
156
|
+
* A resolver that turns a manifest root into a mountable
|
|
188
157
|
* adapter handles every surface in one function, so its return type has to
|
|
189
158
|
* span all three. Returning the bare union `RootAdapter<'three'> |
|
|
190
159
|
* RootAdapter<'canvas'> | RootAdapter<'dom'>` does NOT work — a union of
|
|
191
160
|
* function types INTERSECTS its parameters, so `.mount(host)` becomes
|
|
192
161
|
* uncallable with any single host value (no one object is simultaneously a
|
|
193
|
-
* `ThreeHostContext`, a `CanvasHostContext` and a `DomHostContext`).
|
|
194
|
-
* workaround was to declare the whole channel `RootAdapter<'three'>` and
|
|
195
|
-
* re-assert the real kind at each call site with `as unknown as` — kind
|
|
196
|
-
* ERASURE: the surface tag the manifest already knew was thrown away and
|
|
197
|
-
* guessed back.
|
|
162
|
+
* `ThreeHostContext`, a `CanvasHostContext` and a `DomHostContext`).
|
|
198
163
|
*
|
|
199
164
|
* Carrying the tag ALONGSIDE the adapter fixes that structurally: this is a
|
|
200
165
|
* discriminated union on `surface`, so `switch (resolved.surface)` narrows
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root-adapter.d.ts","sourceRoot":"","sources":["../../src/adapter/root-adapter.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"root-adapter.d.ts","sourceRoot":"","sources":["../../src/adapter/root-adapter.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,25 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* RootAdapter — the host ⇄ runtime contract. A ROOT is *anything that mounts*.
|
|
3
3
|
*
|
|
4
|
-
* This is the interface the
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* are peer implementers of THIS interface; the host has no branch on which.
|
|
9
|
-
*
|
|
10
|
-
* It was `GameAdapter` until WO-9 #60, and the rename is an ONTOLOGY fix, not
|
|
11
|
-
* taste. Under D20 a *game* is the manifest's whole `roots` array — that is
|
|
12
|
-
* what `runtime/game.ts`'s `Game` is. Every implementer of THIS interface
|
|
13
|
-
* adapts exactly ONE root. So `Game` and `GameAdapter` sat at different levels
|
|
14
|
-
* of the ontology while sharing a name-stem, which reads as though one were
|
|
15
|
-
* the adapter for the other. The surrounding vocabulary had already moved:
|
|
16
|
-
* `MountedRootBase`, `MountedRoot`, `MountedRootFor`, `RootStateObserver`,
|
|
17
|
-
* `SurfaceAdapterFor`, `RootInstance`, `mountManifestRoots` — and, decisively,
|
|
18
|
-
* the resolver that PRODUCES these (`resolveRootAdapter`, `RootAdapterSchema`,
|
|
19
|
-
* `resolveThreeRootAdapter`) already said root. The interface was the last
|
|
20
|
-
* holdout, out of step with its own resolver.
|
|
21
|
-
*
|
|
22
|
-
* The `K = 'three'` default below is KEPT deliberately (see the note on the
|
|
23
|
-
* interface).
|
|
4
|
+
* This is the interface the host depends on. `GameSetupFn` is private to one
|
|
5
|
+
* implementer (`SetupThreeRootAdapter`); first-party content and unmodified
|
|
6
|
+
* external games are peer root adapters. A game is the manifest's complete
|
|
7
|
+
* roots array, while each adapter owns exactly one root.
|
|
24
8
|
*/
|
|
25
9
|
export {};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/** Exhaustive proof requirements for substrate mount/lifecycle seams. */
|
|
2
|
+
export declare const ROOT_ADAPTER_SHAPE: {
|
|
3
|
+
readonly id: {
|
|
4
|
+
readonly optional: false;
|
|
5
|
+
readonly kind: "value";
|
|
6
|
+
readonly required: "shape";
|
|
7
|
+
};
|
|
8
|
+
readonly mount: {
|
|
9
|
+
readonly optional: false;
|
|
10
|
+
readonly kind: "function";
|
|
11
|
+
readonly required: "effect";
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare const MOUNTED_ROOT_BASE_SHAPE: {
|
|
15
|
+
readonly drivesOwnLoop: {
|
|
16
|
+
readonly optional: false;
|
|
17
|
+
readonly kind: "value";
|
|
18
|
+
readonly required: "shape";
|
|
19
|
+
};
|
|
20
|
+
readonly update: {
|
|
21
|
+
readonly optional: true;
|
|
22
|
+
readonly kind: "function";
|
|
23
|
+
readonly required: "effect";
|
|
24
|
+
};
|
|
25
|
+
readonly fixedUpdate: {
|
|
26
|
+
readonly optional: true;
|
|
27
|
+
readonly kind: "function";
|
|
28
|
+
readonly required: "effect";
|
|
29
|
+
};
|
|
30
|
+
readonly setPaused: {
|
|
31
|
+
readonly optional: true;
|
|
32
|
+
readonly kind: "function";
|
|
33
|
+
readonly required: "effect";
|
|
34
|
+
};
|
|
35
|
+
readonly step: {
|
|
36
|
+
readonly optional: true;
|
|
37
|
+
readonly kind: "function";
|
|
38
|
+
readonly required: "effect";
|
|
39
|
+
};
|
|
40
|
+
readonly resize: {
|
|
41
|
+
readonly optional: true;
|
|
42
|
+
readonly kind: "function";
|
|
43
|
+
readonly required: "effect";
|
|
44
|
+
};
|
|
45
|
+
readonly dispose: {
|
|
46
|
+
readonly optional: false;
|
|
47
|
+
readonly kind: "function";
|
|
48
|
+
readonly required: "effect";
|
|
49
|
+
};
|
|
50
|
+
readonly authoring: {
|
|
51
|
+
readonly optional: true;
|
|
52
|
+
readonly kind: "value";
|
|
53
|
+
readonly required: "operation";
|
|
54
|
+
};
|
|
55
|
+
readonly systems: {
|
|
56
|
+
readonly optional: true;
|
|
57
|
+
readonly kind: "value";
|
|
58
|
+
readonly required: "operation";
|
|
59
|
+
};
|
|
60
|
+
readonly observe: {
|
|
61
|
+
readonly optional: true;
|
|
62
|
+
readonly kind: "value";
|
|
63
|
+
readonly required: "effect";
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
export declare const ROOT_STATE_OBSERVER_SHAPE: {
|
|
67
|
+
readonly subscribe: {
|
|
68
|
+
readonly optional: false;
|
|
69
|
+
readonly kind: "function";
|
|
70
|
+
readonly required: "effect";
|
|
71
|
+
};
|
|
72
|
+
readonly snapshot: {
|
|
73
|
+
readonly optional: false;
|
|
74
|
+
readonly kind: "function";
|
|
75
|
+
readonly required: "operation";
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
export declare const MOUNTED_THREE_SURFACE_SHAPE: {
|
|
79
|
+
readonly kind: {
|
|
80
|
+
readonly optional: false;
|
|
81
|
+
readonly kind: "value";
|
|
82
|
+
readonly required: "shape";
|
|
83
|
+
};
|
|
84
|
+
readonly scene: {
|
|
85
|
+
readonly optional: false;
|
|
86
|
+
readonly kind: "value";
|
|
87
|
+
readonly required: "effect";
|
|
88
|
+
};
|
|
89
|
+
readonly camera: {
|
|
90
|
+
readonly optional: false;
|
|
91
|
+
readonly kind: "value";
|
|
92
|
+
readonly required: "effect";
|
|
93
|
+
};
|
|
94
|
+
readonly rendererConfig: {
|
|
95
|
+
readonly optional: true;
|
|
96
|
+
readonly kind: "value";
|
|
97
|
+
readonly required: "shape";
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
export declare const MOUNTED_CANVAS_SURFACE_SHAPE: {
|
|
101
|
+
readonly kind: {
|
|
102
|
+
readonly optional: false;
|
|
103
|
+
readonly kind: "value";
|
|
104
|
+
readonly required: "shape";
|
|
105
|
+
};
|
|
106
|
+
readonly stage: {
|
|
107
|
+
readonly optional: false;
|
|
108
|
+
readonly kind: "value";
|
|
109
|
+
readonly required: "effect";
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
export declare const MOUNTED_DOM_SURFACE_SHAPE: {
|
|
113
|
+
readonly kind: {
|
|
114
|
+
readonly optional: false;
|
|
115
|
+
readonly kind: "value";
|
|
116
|
+
readonly required: "shape";
|
|
117
|
+
};
|
|
118
|
+
readonly container: {
|
|
119
|
+
readonly optional: false;
|
|
120
|
+
readonly kind: "value";
|
|
121
|
+
readonly required: "effect";
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
//# sourceMappingURL=root-seam-contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root-seam-contract.d.ts","sourceRoot":"","sources":["../../src/adapter/root-seam-contract.ts"],"names":[],"mappings":"AAAA,yEAAyE;AAazE,eAAO,MAAM,kBAAkB;;;;;;;;;;;CAG7B,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWlC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;CAGpC,CAAC;AAMH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;CAKtC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;;;CAGvC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;CAGpC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** Exhaustive proof requirements for substrate mount/lifecycle seams. */
|
|
2
|
+
import { defineSeamShape } from './seam-evidence';
|
|
3
|
+
export const ROOT_ADAPTER_SHAPE = defineSeamShape()({
|
|
4
|
+
id: { optional: false, kind: 'value', required: 'shape' },
|
|
5
|
+
mount: { optional: false, kind: 'function', required: 'effect' },
|
|
6
|
+
});
|
|
7
|
+
export const MOUNTED_ROOT_BASE_SHAPE = defineSeamShape()({
|
|
8
|
+
drivesOwnLoop: { optional: false, kind: 'value', required: 'shape' },
|
|
9
|
+
update: { optional: true, kind: 'function', required: 'effect' },
|
|
10
|
+
fixedUpdate: { optional: true, kind: 'function', required: 'effect' },
|
|
11
|
+
setPaused: { optional: true, kind: 'function', required: 'effect' },
|
|
12
|
+
step: { optional: true, kind: 'function', required: 'effect' },
|
|
13
|
+
resize: { optional: true, kind: 'function', required: 'effect' },
|
|
14
|
+
dispose: { optional: false, kind: 'function', required: 'effect' },
|
|
15
|
+
authoring: { optional: true, kind: 'value', required: 'operation' },
|
|
16
|
+
systems: { optional: true, kind: 'value', required: 'operation' },
|
|
17
|
+
observe: { optional: true, kind: 'value', required: 'effect' },
|
|
18
|
+
});
|
|
19
|
+
export const ROOT_STATE_OBSERVER_SHAPE = defineSeamShape()({
|
|
20
|
+
subscribe: { optional: false, kind: 'function', required: 'effect' },
|
|
21
|
+
snapshot: { optional: false, kind: 'function', required: 'operation' },
|
|
22
|
+
});
|
|
23
|
+
export const MOUNTED_THREE_SURFACE_SHAPE = defineSeamShape()({
|
|
24
|
+
kind: { optional: false, kind: 'value', required: 'shape' },
|
|
25
|
+
scene: { optional: false, kind: 'value', required: 'effect' },
|
|
26
|
+
camera: { optional: false, kind: 'value', required: 'effect' },
|
|
27
|
+
rendererConfig: { optional: true, kind: 'value', required: 'shape' },
|
|
28
|
+
});
|
|
29
|
+
export const MOUNTED_CANVAS_SURFACE_SHAPE = defineSeamShape()({
|
|
30
|
+
kind: { optional: false, kind: 'value', required: 'shape' },
|
|
31
|
+
stage: { optional: false, kind: 'value', required: 'effect' },
|
|
32
|
+
});
|
|
33
|
+
export const MOUNTED_DOM_SURFACE_SHAPE = defineSeamShape()({
|
|
34
|
+
kind: { optional: false, kind: 'value', required: 'shape' },
|
|
35
|
+
container: { optional: false, kind: 'value', required: 'effect' },
|
|
36
|
+
});
|