@volter/project 0.0.0-stage → 0.5.204
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 +202 -0
- package/NOTICE +6 -0
- package/README.md +18 -3
- package/package.json +64 -4
- package/schemas/engine-api.json +57 -0
- package/schemas/engine-api.md +22 -0
- package/schemas/volter-project.schema.json +468 -0
- package/schemas/volter-settings.schema.json +149 -0
- package/src/adapter/adapter-module.ts +997 -0
- package/src/adapter/adapter-surface.ts +34 -0
- package/src/adapter/authoring-seam-contract.ts +224 -0
- package/src/adapter/authoring.ts +1336 -0
- package/src/adapter/binding.ts +445 -0
- package/src/adapter/debug-registry-ref.ts +19 -0
- package/src/adapter/editor-looks.ts +519 -0
- package/src/adapter/finders/finder-result.ts +29 -0
- package/src/adapter/finders/registry.ts +116 -0
- package/src/adapter/frame-capture.ts +80 -0
- package/src/adapter/host-context.ts +114 -0
- package/src/adapter/index.ts +209 -0
- package/src/adapter/ingest/contract-system-slots.ts +28 -0
- package/src/adapter/ingest/game-contract-seams.ts +86 -0
- package/src/adapter/ingest/game-contract.ts +506 -0
- package/src/adapter/ingest/mount-readiness.ts +140 -0
- package/src/adapter/loop-gate-report.ts +53 -0
- package/src/adapter/manifest-interpreter.ts +64 -0
- package/src/adapter/native-entry-surface.ts +100 -0
- package/src/adapter/physics-adapter-2d.ts +30 -0
- package/src/adapter/render-audio.ts +20 -0
- package/src/adapter/render-memory.ts +34 -0
- package/src/adapter/renderer-config.ts +84 -0
- package/src/adapter/root-adapter.ts +243 -0
- package/src/adapter/root-seam-contract.ts +61 -0
- package/src/adapter/root-stacking.ts +67 -0
- package/src/adapter/seam-evidence.ts +336 -0
- package/src/adapter/system-adapter.ts +865 -0
- package/src/adapter/system-seam-contract.ts +138 -0
- package/src/adapter/system-slot.ts +301 -0
- package/src/adapter/transform.ts +35 -0
- package/src/adapter/workspace-arrangement.ts +92 -0
- package/src/core/system-phase.ts +52 -0
- package/src/inspection.ts +281 -0
- package/src/manifest/configuration-kinds.ts +241 -0
- package/src/manifest/editor-port.ts +69 -0
- package/src/manifest/filename.ts +45 -0
- package/src/manifest/kind-modules.ts +58 -0
- package/src/manifest/load-file.ts +33 -0
- package/src/manifest/load.ts +380 -0
- package/src/manifest/locate.ts +55 -0
- package/src/manifest/runtime-environment.ts +48 -0
- package/src/manifest/schema.ts +690 -0
- package/src/settings/keys.ts +152 -0
- package/src/settings/schema.ts +151 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a WebGL frame capture IS — the reading `SystemAdapters`'s frame-capture
|
|
3
|
+
* door answers with. The contract owns the shape; the instrument that records
|
|
4
|
+
* it shadow-patches a live WebGL2 context and is the game runtime's
|
|
5
|
+
* (`@volter/editor-game/runtime/dev/webgl-frame-capture`).
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/** The five WebGL2 draw entry points this instrument wraps. */
|
|
9
|
+
export type FrameCaptureEntryPoint =
|
|
10
|
+
| 'drawArrays'
|
|
11
|
+
| 'drawElements'
|
|
12
|
+
| 'drawArraysInstanced'
|
|
13
|
+
| 'drawElementsInstanced'
|
|
14
|
+
| 'drawRangeElements';
|
|
15
|
+
|
|
16
|
+
/** Per-draw attribution supplied by {@link WebGLFrameCapture.annotateNextDraw}
|
|
17
|
+
* (the render adapter derives it from the three.js object about to draw). */
|
|
18
|
+
export interface DrawAnnotation {
|
|
19
|
+
object: { name: string; type: string; entityId?: string };
|
|
20
|
+
geometry: { type: string; name: string; attributes: string[]; indexed: boolean };
|
|
21
|
+
material: { type: string; name: string };
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Where a draw rendered: the default framebuffer (canvas) or a bound FBO. */
|
|
25
|
+
export type DrawTarget =
|
|
26
|
+
| { kind: 'canvas' }
|
|
27
|
+
| {
|
|
28
|
+
kind: 'framebuffer';
|
|
29
|
+
/** Color-attachment width, or `null` when not cheaply queryable
|
|
30
|
+
* (texture attachment — raw WebGL2 has no size query). */
|
|
31
|
+
width: number | null;
|
|
32
|
+
height: number | null;
|
|
33
|
+
/** Capture-local identity tag (`framebuffer#N`), not a GL debug name. */
|
|
34
|
+
label: string | null;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export interface FrameCaptureDrawCall {
|
|
38
|
+
readonly index: number;
|
|
39
|
+
readonly entryPoint: FrameCaptureEntryPoint;
|
|
40
|
+
/** Decoded primitive mode, e.g. `'TRIANGLES'`, `'LINES'` (raw enum when
|
|
41
|
+
* unrecognised). */
|
|
42
|
+
readonly mode: string;
|
|
43
|
+
/** Vertex/index count passed to the draw. */
|
|
44
|
+
readonly count: number;
|
|
45
|
+
/** Instance count for the instanced entry points, else `null` (not 0 —
|
|
46
|
+
* a non-instanced draw has no instance count to report). */
|
|
47
|
+
readonly instanceCount: number | null;
|
|
48
|
+
/** Capture-local program identity (`program#N`), or `null` when no program
|
|
49
|
+
* was bound via `useProgram`. */
|
|
50
|
+
readonly programLabel: string | null;
|
|
51
|
+
readonly target: DrawTarget;
|
|
52
|
+
/** Shadow-tracked viewport `[x, y, w, h]` at draw time. */
|
|
53
|
+
readonly viewport: readonly [number, number, number, number];
|
|
54
|
+
readonly state: {
|
|
55
|
+
readonly blend: boolean;
|
|
56
|
+
readonly depthTest: boolean;
|
|
57
|
+
readonly depthWrite: boolean;
|
|
58
|
+
readonly cull: 'front' | 'back' | 'none';
|
|
59
|
+
readonly scissor: boolean;
|
|
60
|
+
};
|
|
61
|
+
/** The annotation this draw consumed, or `null` when none was pending
|
|
62
|
+
* (unattributed — e.g. a shadow/composer pass draw). */
|
|
63
|
+
readonly annotation: DrawAnnotation | null;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface FrameCapture {
|
|
67
|
+
readonly id: number;
|
|
68
|
+
/** Injected capture timestamp (ms) — see `createWebGLFrameCapture` options. */
|
|
69
|
+
readonly capturedAt: number;
|
|
70
|
+
readonly drawCalls: readonly FrameCaptureDrawCall[];
|
|
71
|
+
readonly totals: {
|
|
72
|
+
/** Draws RECORDED (excludes any dropped past the cap). */
|
|
73
|
+
readonly drawCalls: number;
|
|
74
|
+
/** Recorded draws with `annotation: null`. */
|
|
75
|
+
readonly unattributed: number;
|
|
76
|
+
/** Draws dropped because the cap was hit (0 when nothing was dropped). */
|
|
77
|
+
readonly truncated: number;
|
|
78
|
+
};
|
|
79
|
+
readonly notes: readonly string[];
|
|
80
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/** Host-provided surfaces for adapter mounting.
|
|
2
|
+
* Product-specific execution handles belong in that product's extension of
|
|
3
|
+
* these contexts; the shared project contract must not import its runtime.
|
|
4
|
+
*/
|
|
5
|
+
import type { AdapterSurface } from './adapter-surface';
|
|
6
|
+
|
|
7
|
+
/** The canvas/container the game renders into, plus its size. */
|
|
8
|
+
export interface HostSurface {
|
|
9
|
+
readonly canvas: HTMLCanvasElement;
|
|
10
|
+
readonly width: number;
|
|
11
|
+
readonly height: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The surface-INDEPENDENT half of every host context — see this file's header
|
|
16
|
+
* for ownership of product-specific extensions. Generic host code (a
|
|
17
|
+
* harness, a tier report, anything that must not care what it is mounting) can
|
|
18
|
+
* type against this; a real adapter always receives one of the per-surface
|
|
19
|
+
* contexts below.
|
|
20
|
+
*/
|
|
21
|
+
export interface HostContextBase {
|
|
22
|
+
/**
|
|
23
|
+
* No GPU/DOM/audio available (Node conformance tests). A first-party adapter
|
|
24
|
+
* skips postprocessing/render/audio/input-map loading but still builds the
|
|
25
|
+
* scene + Rapier + components, so its scene/authoring/physics can be exercised
|
|
26
|
+
* headlessly. Browser hosts leave this false/undefined → full behavior.
|
|
27
|
+
*/
|
|
28
|
+
readonly headless?: boolean;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* What a `three`-surface root is handed. This is the ONLY context carrying
|
|
33
|
+
* three's own objects — the split's entire point (see the header): a Pixi or
|
|
34
|
+
* React root is never handed a `WebGLRenderer` it cannot use. The objects are
|
|
35
|
+
* opaque here; `@volter/editor-threejs` names the Three-typed context, and a
|
|
36
|
+
* runtime names its own.
|
|
37
|
+
*/
|
|
38
|
+
export interface ThreeHostContext<Three = unknown, Renderer = unknown, Assets = unknown>
|
|
39
|
+
extends HostContextBase {
|
|
40
|
+
/** The ONE shared three instance — identity matters for capture (see ingest). */
|
|
41
|
+
readonly three: Three;
|
|
42
|
+
/** Canvas/container + size; a self-driven game may take the surface over. */
|
|
43
|
+
readonly surface: HostSurface;
|
|
44
|
+
/** Host renderer — host-driven games render through it. */
|
|
45
|
+
readonly renderer: Renderer;
|
|
46
|
+
/** Shared GLTF/texture cache. */
|
|
47
|
+
readonly assets: Assets;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* What a `canvas`-surface root is handed: a raw canvas + its
|
|
52
|
+
* logical size, plus the
|
|
53
|
+
* compositing hints the multi-root host computes once for every stacked
|
|
54
|
+
* surface. No `three`, no `renderer`, no `assets` — a Pixi root builds its own
|
|
55
|
+
* `PIXI.Application` and its own asset cache from this.
|
|
56
|
+
*/
|
|
57
|
+
export interface CanvasHostContext extends HostContextBase {
|
|
58
|
+
readonly canvas: HTMLCanvasElement;
|
|
59
|
+
readonly width: number;
|
|
60
|
+
readonly height: number;
|
|
61
|
+
/** DPR override (T6.1 slice 1, D5 §3 — "one DPR
|
|
62
|
+
* everywhere"): the roots-path host computes ONE dpr for every stacked
|
|
63
|
+
* surface and passes it here; omitted -> the canvas adapter's own
|
|
64
|
+
* default (`window.devicePixelRatio`, uncapped). */
|
|
65
|
+
readonly dpr?: number;
|
|
66
|
+
/** This root is stacked ABOVE another root (D5 §1): clear with alpha 0
|
|
67
|
+
* instead of an opaque background so the layer below shows through. */
|
|
68
|
+
readonly transparent?: boolean;
|
|
69
|
+
/** Capture tier cost (D5 §4) — the renderer's `preserveDrawingBuffer`. */
|
|
70
|
+
readonly preserveDrawingBuffer?: boolean;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* What a `dom`-surface root is handed (the shape `runtime/create-runtime.ts`
|
|
75
|
+
* used to spell `ReactRootHost`).
|
|
76
|
+
*
|
|
77
|
+
* `container` is the absolutely-positioned, z-ordered DOM-root layer `<div>`
|
|
78
|
+
* the host already created and stacked (same box/z-order rules as a canvas per
|
|
79
|
+
* D5 §1) — the adapter's `mount` renders its react tree INTO
|
|
80
|
+
* this exact element via `createRoot`; it must never create its own root
|
|
81
|
+
* element (the DOM analog of three's "the root's runtime renders into the
|
|
82
|
+
* surface it is handed" rule).
|
|
83
|
+
*
|
|
84
|
+
* `game` (inherited, and deliberately still optional): a
|
|
85
|
+
* `default-react` sibling mounted BESIDE an ingest root (`packages/editor/src/
|
|
86
|
+
* ingest-siblings.ts`) has no native `Game` to hand it — there is no
|
|
87
|
+
* first-party loop for the sibling to join, only the ingested
|
|
88
|
+
* root's own foreign runtime — so its host carries no `game` at all rather than
|
|
89
|
+
* fabricating an empty one (anti-shim rule); the sibling mounts its entry
|
|
90
|
+
* component bare, as every `dom` root renders. `mountOneReactRoot`
|
|
91
|
+
* (`runtime/create-runtime.ts`, the NATIVE multi-root runtime path) still
|
|
92
|
+
* ALWAYS supplies a real `game` — this optionality is reached only by the
|
|
93
|
+
* composite sibling's own hand-built host, never by weakening the native path's
|
|
94
|
+
* guarantee.
|
|
95
|
+
*/
|
|
96
|
+
export interface DomHostContext extends HostContextBase {
|
|
97
|
+
readonly container: HTMLElement;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Map an {@link AdapterSurface} to the host context that surface's roots are
|
|
102
|
+
* handed — the mirror image of `MountedRootFor<K>` (`root-adapter.ts`), and
|
|
103
|
+
* what makes `RootAdapter<K>.mount`'s PARAMETER K-typed. A hypothetical 4th
|
|
104
|
+
* surface resolves to `never` here, so it cannot be mounted until it declares
|
|
105
|
+
* its own context (the same fail-to-compile discipline `assertNever` gives the
|
|
106
|
+
* dispatch sites).
|
|
107
|
+
*/
|
|
108
|
+
export type HostContextFor<K extends AdapterSurface> = K extends 'three'
|
|
109
|
+
? ThreeHostContext
|
|
110
|
+
: K extends 'canvas'
|
|
111
|
+
? CanvasHostContext
|
|
112
|
+
: K extends 'dom'
|
|
113
|
+
? DomHostContext
|
|
114
|
+
: never;
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adapter interfaces — the seams the engine host and the editor DEPEND ON.
|
|
3
|
+
*
|
|
4
|
+
* host → RootAdapter ← { the editor's R3F root mounts, IngestRootAdapter, … }
|
|
5
|
+
* editor → AuthoringAdapter ← { ThreeAuthoringAdapter, ReactRootAuthoringAdapter, … }
|
|
6
|
+
* game → SystemAdapters (physics/networking/navigation/audio/camera/debug)
|
|
7
|
+
*
|
|
8
|
+
* The first-party Rapier/Colyseus stack is ONE implementer of these
|
|
9
|
+
* interfaces, not the engine's vocabulary.
|
|
10
|
+
*
|
|
11
|
+
* **This module is TYPE-ONLY, and must stay that way (P-6).** It used to
|
|
12
|
+
* value-export its own implementers — `createRapierPhysicsAdapter`,
|
|
13
|
+
* `createColyseusNetworkingAdapter`, `createNavigationAdapter` — so
|
|
14
|
+
* `import type { AuthoringAdapter } from './index'` was the only
|
|
15
|
+
* thing keeping the three/Rapier/Colyseus stack out of a Pixi or React
|
|
16
|
+
* consumer's module graph. A seam that ships its implementers is not a
|
|
17
|
+
* seam. Import an implementer from its OWN path instead:
|
|
18
|
+
*
|
|
19
|
+
* `@volter/threejs-runtime/adapter/rapier-physics-adapter` createRapierPhysicsAdapter
|
|
20
|
+
* `@volter/threejs-runtime/adapter/first-party-navigation-system` createNavigationAdapter
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
export type { AdapterSurface } from './adapter-surface';
|
|
24
|
+
export type {
|
|
25
|
+
AssetDropContext,
|
|
26
|
+
AssetDropProvider,
|
|
27
|
+
AssetSubjectProvider,
|
|
28
|
+
AuthoringAdapter,
|
|
29
|
+
AuthoringAssetSubject,
|
|
30
|
+
AuthoringCapabilities,
|
|
31
|
+
AuthoringProvenance,
|
|
32
|
+
AuthoringProviderKey,
|
|
33
|
+
AuthoringTruth,
|
|
34
|
+
BoxEditProvider,
|
|
35
|
+
BoxEditReferencePoint,
|
|
36
|
+
ColorSampleProvider,
|
|
37
|
+
ComponentInstanceApplyResult,
|
|
38
|
+
ComponentInstanceDescription,
|
|
39
|
+
ComponentInstanceOverride,
|
|
40
|
+
ComponentInstancesProvider,
|
|
41
|
+
DOMRectLike,
|
|
42
|
+
EditorNode,
|
|
43
|
+
EditorNodeRole,
|
|
44
|
+
HierarchyProvider,
|
|
45
|
+
InspectorProvider,
|
|
46
|
+
NodeCreationSite,
|
|
47
|
+
PersistenceProvider,
|
|
48
|
+
PickProvider,
|
|
49
|
+
PropertyDescriptor,
|
|
50
|
+
FrameCorners,
|
|
51
|
+
RectProvider,
|
|
52
|
+
RelatedSubjectLink,
|
|
53
|
+
RelatedSubjectsProvider,
|
|
54
|
+
SelectionProvider,
|
|
55
|
+
SelectionResolution,
|
|
56
|
+
SpatialDragHandle,
|
|
57
|
+
SpatialHandleGuide,
|
|
58
|
+
SpatialHandleLayer,
|
|
59
|
+
SpatialHandlesProvider,
|
|
60
|
+
SpatialPoint3,
|
|
61
|
+
StoriesProvider,
|
|
62
|
+
StoryRef,
|
|
63
|
+
StructuralClipboardOutcome,
|
|
64
|
+
StructuralIdsWrite,
|
|
65
|
+
StructuralIdWrite,
|
|
66
|
+
StructuralWriteOutcome,
|
|
67
|
+
StructureProvider,
|
|
68
|
+
CreatableKind,
|
|
69
|
+
TextProvider,
|
|
70
|
+
TransformChannel,
|
|
71
|
+
TransformEditability,
|
|
72
|
+
TransformProvider,
|
|
73
|
+
TransformSourceCommitProvider,
|
|
74
|
+
TruthProvider,
|
|
75
|
+
WriteAck,
|
|
76
|
+
WriteAnchorKind,
|
|
77
|
+
} from './authoring';
|
|
78
|
+
export {
|
|
79
|
+
AUTHORING_PROVIDER_KEYS,
|
|
80
|
+
emptyWriteAnchorKindCounts,
|
|
81
|
+
measureAuthoringProviders,
|
|
82
|
+
WRITE_ANCHOR_KINDS,
|
|
83
|
+
} from './authoring';
|
|
84
|
+
export {
|
|
85
|
+
AUTHORING_ADAPTER_SHAPE,
|
|
86
|
+
AUTHORING_PROVIDER_SHAPES,
|
|
87
|
+
HIERARCHY_PROVIDER_SHAPE,
|
|
88
|
+
} from './authoring-seam-contract';
|
|
89
|
+
export type {
|
|
90
|
+
EntryStaticSurface,
|
|
91
|
+
ObservationBinding,
|
|
92
|
+
ProjectBinding,
|
|
93
|
+
ProjectionBinding,
|
|
94
|
+
ProtocolFamily,
|
|
95
|
+
RootBinding,
|
|
96
|
+
RootBindingParts,
|
|
97
|
+
RootDeclaration,
|
|
98
|
+
SubstrateBinding,
|
|
99
|
+
TruthBinding,
|
|
100
|
+
} from './binding';
|
|
101
|
+
export { createRootBinding } from './binding';
|
|
102
|
+
export type {
|
|
103
|
+
CanvasHostContext,
|
|
104
|
+
DomHostContext,
|
|
105
|
+
HostContextBase,
|
|
106
|
+
HostContextFor,
|
|
107
|
+
HostSurface,
|
|
108
|
+
ThreeHostContext,
|
|
109
|
+
} from './host-context';
|
|
110
|
+
/** The offline-audio contract an `AudioAdapter.renderOffline` implements.
|
|
111
|
+
* Defined beside the render-mode harness that first needed it; re-exported
|
|
112
|
+
* here so a world binding the seam imports one name from one place. */
|
|
113
|
+
export type { OfflineAudioRenderer, RenderedAudio } from './render-audio';
|
|
114
|
+
export type {
|
|
115
|
+
MountedCanvasRoot,
|
|
116
|
+
MountedCanvasSubstrate,
|
|
117
|
+
MountedReactRoot,
|
|
118
|
+
MountedRoot,
|
|
119
|
+
MountedRootBase,
|
|
120
|
+
MountedThreeRoot,
|
|
121
|
+
RootAdapter,
|
|
122
|
+
RootStateObserver,
|
|
123
|
+
SurfaceAdapter,
|
|
124
|
+
SurfaceAdapterFor,
|
|
125
|
+
} from './root-adapter';
|
|
126
|
+
export {
|
|
127
|
+
MOUNTED_CANVAS_SURFACE_SHAPE,
|
|
128
|
+
MOUNTED_DOM_SURFACE_SHAPE,
|
|
129
|
+
MOUNTED_ROOT_BASE_SHAPE,
|
|
130
|
+
MOUNTED_THREE_SURFACE_SHAPE,
|
|
131
|
+
ROOT_ADAPTER_SHAPE,
|
|
132
|
+
ROOT_STATE_OBSERVER_SHAPE,
|
|
133
|
+
} from './root-seam-contract';
|
|
134
|
+
export type {
|
|
135
|
+
SeamEvidenceOutcome,
|
|
136
|
+
SeamEvidenceReceipt,
|
|
137
|
+
SeamEvidenceSource,
|
|
138
|
+
SeamEvidenceState,
|
|
139
|
+
SeamEvidenceVerdict,
|
|
140
|
+
SeamProofStage,
|
|
141
|
+
SeamShape,
|
|
142
|
+
} from './seam-evidence';
|
|
143
|
+
export {
|
|
144
|
+
defineSeamShape,
|
|
145
|
+
gradeSeamCarrier,
|
|
146
|
+
gradeSeamEvidence,
|
|
147
|
+
inspectSeamShape,
|
|
148
|
+
SEAM_PROOF_STAGES,
|
|
149
|
+
SeamEvidenceLedger,
|
|
150
|
+
seamStageAtLeast,
|
|
151
|
+
} from './seam-evidence';
|
|
152
|
+
export type {
|
|
153
|
+
AudioAdapter,
|
|
154
|
+
AudioDebugEvent,
|
|
155
|
+
AudioGraphNode,
|
|
156
|
+
AudioMeterFrame,
|
|
157
|
+
AudioMeterHandle,
|
|
158
|
+
AudioRecordingHandle,
|
|
159
|
+
AudioTransportState,
|
|
160
|
+
CameraAdapter,
|
|
161
|
+
CameraRuntimeCamera,
|
|
162
|
+
CameraRuntimeSnapshot,
|
|
163
|
+
CameraRuntimeTransition,
|
|
164
|
+
ConnectionState,
|
|
165
|
+
DebugAdapter,
|
|
166
|
+
NavCrowdAgentState,
|
|
167
|
+
NavigationAdapter,
|
|
168
|
+
NavPoint,
|
|
169
|
+
NetConditioning,
|
|
170
|
+
NetMessageEvent,
|
|
171
|
+
NetPeer,
|
|
172
|
+
NetPlayerIdentity,
|
|
173
|
+
NetConditioningLimits,
|
|
174
|
+
NetRates,
|
|
175
|
+
NetServerClient,
|
|
176
|
+
NetServerInspection,
|
|
177
|
+
NetServerRoom,
|
|
178
|
+
NetTypeTraffic,
|
|
179
|
+
NetEntityTraffic,
|
|
180
|
+
NetServerConfig,
|
|
181
|
+
NetworkingAdapter,
|
|
182
|
+
PhysicsAdapter,
|
|
183
|
+
PhysicsCarrier,
|
|
184
|
+
PhysicsColliderShape,
|
|
185
|
+
PhysicsColliderSnapshot,
|
|
186
|
+
PhysicsJointSnapshot,
|
|
187
|
+
PhysicsJointType,
|
|
188
|
+
RenderDebugAdapter,
|
|
189
|
+
ReplicationStats,
|
|
190
|
+
RoomInfo,
|
|
191
|
+
SystemAdapters,
|
|
192
|
+
Unsubscribe,
|
|
193
|
+
} from './system-adapter';
|
|
194
|
+
/** The two narrowings of the tagged `SystemAdapters['physics']` union — see
|
|
195
|
+
* `PhysicsAdapter`'s comment for why it is tagged at all. */
|
|
196
|
+
export { displayKeyedPhysics, nodeKeyedPhysics, physicsOwnerOf } from './system-adapter';
|
|
197
|
+
export {
|
|
198
|
+
AUDIO_ADAPTER_SHAPE,
|
|
199
|
+
CAMERA_ADAPTER_SHAPE,
|
|
200
|
+
DEBUG_ADAPTER_SHAPE,
|
|
201
|
+
NAVIGATION_ADAPTER_SHAPE,
|
|
202
|
+
NETWORKING_ADAPTER_SHAPE,
|
|
203
|
+
PHYSICS_2D_ADAPTER_SHAPE,
|
|
204
|
+
PHYSICS_ADAPTER_SHAPE,
|
|
205
|
+
RENDER_DEBUG_ADAPTER_SHAPE,
|
|
206
|
+
SYSTEM_ADAPTERS_SHAPE,
|
|
207
|
+
SYSTEM_PROVIDER_SHAPES,
|
|
208
|
+
} from './system-seam-contract';
|
|
209
|
+
export type { Transform, TransformOwner } from './transform';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THE TWO VERDICTS a declared system slot can carry besides an adapter: a
|
|
3
|
+
* positive ABSENCE with the game's own evidence, and a MALFORMED declaration
|
|
4
|
+
* with the reason it could not be honoured.
|
|
5
|
+
*
|
|
6
|
+
* They are the contract's because the entry-module surface names them
|
|
7
|
+
* (`./native-entry-surface.ts`'s `NativeSystemsBinding.absent`) and the
|
|
8
|
+
* coverage report reads them; the projection that produces them is the game
|
|
9
|
+
* runtime's (`@volter/editor-game/runtime/adapter/ingest/contract-system-adapters`).
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import type { VolterGameSystemAdapters } from './game-contract';
|
|
13
|
+
|
|
14
|
+
/** One system slot of the game contract, by name. */
|
|
15
|
+
export type ContractSystemSlot = keyof VolterGameSystemAdapters;
|
|
16
|
+
|
|
17
|
+
/** One slot the game positively answered as having nothing behind it. */
|
|
18
|
+
export interface ContractSystemEmptySlot {
|
|
19
|
+
readonly slot: ContractSystemSlot;
|
|
20
|
+
/** The game's own source-level evidence, verbatim. */
|
|
21
|
+
readonly evidence: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** One slot whose declaration could not be honoured, and why. */
|
|
25
|
+
export interface ContractSystemMalformedSlot {
|
|
26
|
+
readonly slot: ContractSystemSlot;
|
|
27
|
+
readonly reason: string;
|
|
28
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/** Exhaustive proof requirements for the game→host contract. Declarations are
|
|
2
|
+
* intentionally insufficient for lifecycle, navigation, commands, state, and
|
|
3
|
+
* system carriers: their consumers must produce stronger receipts. */
|
|
4
|
+
|
|
5
|
+
import { defineSeamShape } from '../seam-evidence';
|
|
6
|
+
import type {
|
|
7
|
+
VolterGameCommand,
|
|
8
|
+
VolterGameContract,
|
|
9
|
+
VolterGameHierarchyGroup,
|
|
10
|
+
VolterGameLifecycle,
|
|
11
|
+
VolterGameScene,
|
|
12
|
+
VolterGameScenes,
|
|
13
|
+
VolterGameStateProvider,
|
|
14
|
+
VolterGameSystemAdapters,
|
|
15
|
+
VolterGameSystemEmpty,
|
|
16
|
+
VolterGameSystems,
|
|
17
|
+
} from './game-contract';
|
|
18
|
+
|
|
19
|
+
export const GAME_CONTRACT_SHAPE = defineSeamShape<VolterGameContract>()({
|
|
20
|
+
contractVersion: { optional: false, kind: 'value', required: 'shape' },
|
|
21
|
+
root: { optional: true, kind: 'value', required: 'effect' },
|
|
22
|
+
presentation: { optional: true, kind: 'value', required: 'effect' },
|
|
23
|
+
world: { optional: true, kind: 'value', required: 'effect' },
|
|
24
|
+
ready: { optional: true, kind: 'value', required: 'effect' },
|
|
25
|
+
lifecycle: { optional: true, kind: 'value', required: 'effect' },
|
|
26
|
+
scenes: { optional: true, kind: 'value', required: 'effect' },
|
|
27
|
+
systems: { optional: true, kind: 'value', required: 'operation' },
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export const GAME_LIFECYCLE_SHAPE = defineSeamShape<VolterGameLifecycle>()({
|
|
31
|
+
start: { optional: true, kind: 'function', required: 'effect' },
|
|
32
|
+
pause: { optional: true, kind: 'function', required: 'effect' },
|
|
33
|
+
resume: { optional: true, kind: 'function', required: 'effect' },
|
|
34
|
+
dispose: { optional: true, kind: 'function', required: 'effect' },
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export const GAME_SCENES_SHAPE = defineSeamShape<VolterGameScenes>()({
|
|
38
|
+
list: { optional: false, kind: 'function', required: 'operation' },
|
|
39
|
+
current: { optional: false, kind: 'function', required: 'operation' },
|
|
40
|
+
goTo: { optional: false, kind: 'function', required: 'effect' },
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export const GAME_SCENE_SHAPE = defineSeamShape<VolterGameScene>()({
|
|
44
|
+
id: { optional: false, kind: 'value', required: 'shape' },
|
|
45
|
+
label: { optional: false, kind: 'value', required: 'shape' },
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export const GAME_COMMAND_SHAPE = defineSeamShape<VolterGameCommand>()({
|
|
49
|
+
name: { optional: false, kind: 'value', required: 'shape' },
|
|
50
|
+
description: { optional: true, kind: 'value', required: 'shape' },
|
|
51
|
+
argsJsonSchema: { optional: true, kind: 'value', required: 'shape' },
|
|
52
|
+
run: { optional: false, kind: 'function', required: 'effect' },
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
export const GAME_STATE_PROVIDER_SHAPE = defineSeamShape<VolterGameStateProvider>()({
|
|
56
|
+
name: { optional: false, kind: 'value', required: 'shape' },
|
|
57
|
+
tier: { optional: true, kind: 'value', required: 'shape' },
|
|
58
|
+
read: { optional: false, kind: 'function', required: 'operation' },
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
export const GAME_HIERARCHY_GROUP_SHAPE = defineSeamShape<VolterGameHierarchyGroup>()({
|
|
62
|
+
id: { optional: false, kind: 'value', required: 'shape' },
|
|
63
|
+
label: { optional: false, kind: 'value', required: 'shape' },
|
|
64
|
+
count: { optional: false, kind: 'value', required: 'operation' },
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
export const GAME_SYSTEMS_SHAPE = defineSeamShape<VolterGameSystems>()({
|
|
68
|
+
commands: { optional: true, kind: 'value', required: 'operation' },
|
|
69
|
+
state: { optional: true, kind: 'value', required: 'operation' },
|
|
70
|
+
hierarchy: { optional: true, kind: 'function', required: 'operation' },
|
|
71
|
+
systemAdapters: { optional: true, kind: 'value', required: 'operation' },
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
export const GAME_SYSTEM_ADAPTERS_SHAPE = defineSeamShape<VolterGameSystemAdapters>()({
|
|
75
|
+
physics: { optional: true, kind: 'value', required: 'effect' },
|
|
76
|
+
networking: { optional: true, kind: 'value', required: 'operation' },
|
|
77
|
+
navigation: { optional: true, kind: 'value', required: 'operation' },
|
|
78
|
+
audio: { optional: true, kind: 'value', required: 'effect' },
|
|
79
|
+
camera: { optional: true, kind: 'value', required: 'effect' },
|
|
80
|
+
renderDebug: { optional: true, kind: 'value', required: 'effect' },
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
export const GAME_SYSTEM_EMPTY_SHAPE = defineSeamShape<VolterGameSystemEmpty>()({
|
|
84
|
+
present: { optional: false, kind: 'value', required: 'shape' },
|
|
85
|
+
evidence: { optional: false, kind: 'value', required: 'claim' },
|
|
86
|
+
});
|