@volter/project 0.0.0-stage → 0.5.203

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.
Files changed (53) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +6 -0
  3. package/README.md +18 -3
  4. package/package.json +64 -4
  5. package/schemas/engine-api.json +57 -0
  6. package/schemas/engine-api.md +22 -0
  7. package/schemas/volter-project.schema.json +468 -0
  8. package/schemas/volter-settings.schema.json +149 -0
  9. package/src/adapter/adapter-module.ts +997 -0
  10. package/src/adapter/adapter-surface.ts +34 -0
  11. package/src/adapter/authoring-seam-contract.ts +224 -0
  12. package/src/adapter/authoring.ts +1336 -0
  13. package/src/adapter/binding.ts +445 -0
  14. package/src/adapter/debug-registry-ref.ts +19 -0
  15. package/src/adapter/editor-looks.ts +519 -0
  16. package/src/adapter/finders/finder-result.ts +29 -0
  17. package/src/adapter/finders/registry.ts +116 -0
  18. package/src/adapter/frame-capture.ts +80 -0
  19. package/src/adapter/host-context.ts +114 -0
  20. package/src/adapter/index.ts +209 -0
  21. package/src/adapter/ingest/contract-system-slots.ts +28 -0
  22. package/src/adapter/ingest/game-contract-seams.ts +86 -0
  23. package/src/adapter/ingest/game-contract.ts +506 -0
  24. package/src/adapter/ingest/mount-readiness.ts +140 -0
  25. package/src/adapter/loop-gate-report.ts +53 -0
  26. package/src/adapter/manifest-interpreter.ts +64 -0
  27. package/src/adapter/native-entry-surface.ts +100 -0
  28. package/src/adapter/physics-adapter-2d.ts +30 -0
  29. package/src/adapter/render-audio.ts +20 -0
  30. package/src/adapter/render-memory.ts +34 -0
  31. package/src/adapter/renderer-config.ts +84 -0
  32. package/src/adapter/root-adapter.ts +243 -0
  33. package/src/adapter/root-seam-contract.ts +61 -0
  34. package/src/adapter/root-stacking.ts +67 -0
  35. package/src/adapter/seam-evidence.ts +336 -0
  36. package/src/adapter/system-adapter.ts +865 -0
  37. package/src/adapter/system-seam-contract.ts +138 -0
  38. package/src/adapter/system-slot.ts +301 -0
  39. package/src/adapter/transform.ts +35 -0
  40. package/src/adapter/workspace-arrangement.ts +92 -0
  41. package/src/core/system-phase.ts +52 -0
  42. package/src/inspection.ts +281 -0
  43. package/src/manifest/configuration-kinds.ts +241 -0
  44. package/src/manifest/editor-port.ts +69 -0
  45. package/src/manifest/filename.ts +45 -0
  46. package/src/manifest/kind-modules.ts +58 -0
  47. package/src/manifest/load-file.ts +33 -0
  48. package/src/manifest/load.ts +380 -0
  49. package/src/manifest/locate.ts +55 -0
  50. package/src/manifest/runtime-environment.ts +48 -0
  51. package/src/manifest/schema.ts +690 -0
  52. package/src/settings/keys.ts +152 -0
  53. package/src/settings/schema.ts +151 -0
@@ -0,0 +1,34 @@
1
+ /**
2
+ * `AdapterSurface` — the kinds of render surface a world can be (T7.1/T7.3/T6.2).
3
+ *
4
+ * Moved here from `runtime/game.ts`
5
+ * so `adapter/root-adapter.ts`'s kind-tagged `MountedRoot` types can name it
6
+ * without a value-level import cycle (`runtime/game.ts` type-imports from
7
+ * `adapter/root-adapter.ts` already). This is a leaf module — it imports
8
+ * nothing — so anything may import it with zero risk of a cycle.
9
+ * `runtime/game.ts` re-exports this SAME type (`export type { AdapterSurface }`),
10
+ * so no existing `import type { AdapterSurface } from '@volter/editor-game/runtime/game'` call site
11
+ * needed to change.
12
+ */
13
+ export type AdapterSurface = 'three' | 'canvas' | 'dom';
14
+
15
+ /**
16
+ * Exhaustiveness guard for `AdapterSurface` dispatch (v4 architecture-review
17
+ * §7.4-2: a hypothetical 4th kind must fail to COMPILE at every kind-dispatch
18
+ * site, not silently contribute nothing or silently default to an existing
19
+ * kind). Lives here — colocated with the kind vocabulary itself, not in a
20
+ * generic util module — so the three call sites that need it
21
+ * (`runtime/create-runtime.ts`'s mount loop, `editor/binding-resolver.ts`'s
22
+ * `resolveAllRoots`, `editor/play-mode.ts`'s `installMultiRootAuthoring`)
23
+ * import it from the same leaf module that defines `AdapterSurface`, keeping the
24
+ * type and its guard from drifting apart. The `never` parameter is the
25
+ * compile-time half of the guard (TS refuses to call this with anything the
26
+ * compiler hasn't already narrowed to zero remaining variants); the thrown
27
+ * Error is the runtime half, in case a value's static type lied (e.g. data
28
+ * crossing a JSON boundary).
29
+ */
30
+ export function assertNever(value: never, context?: string): never {
31
+ throw new Error(
32
+ `Unreachable${context ? ` ${context}` : ''}: unexpected value ${JSON.stringify(value)}`,
33
+ );
34
+ }
@@ -0,0 +1,224 @@
1
+ /** Compiler-derived proof requirements for the AuthoringAdapter protocol.
2
+ *
3
+ * This is intentionally adjacent to the interface. Coverage used to enumerate
4
+ * only top-level provider names, which allowed `{}` to count as a complete
5
+ * provider. These descriptors cover every nested member and encode the
6
+ * weakest evidence that can truthfully verify it.
7
+ */
8
+
9
+ import type {
10
+ AssetDropProvider,
11
+ AssetSubjectProvider,
12
+ AuthoringAdapter,
13
+ BoxEditProvider,
14
+ ColorSampleProvider,
15
+ ComponentInstancesProvider,
16
+ HierarchyProvider,
17
+ InspectorProvider,
18
+ PersistenceProvider,
19
+ PickProvider,
20
+ RectProvider,
21
+ RelatedSubjectsProvider,
22
+ SelectionProvider,
23
+ SpatialHandlesProvider,
24
+ StoriesProvider,
25
+ StructureProvider,
26
+ TextProvider,
27
+ TransformProvider,
28
+ TruthProvider,
29
+ } from './authoring';
30
+ import { defineSeamShape, type SeamShape } from './seam-evidence';
31
+
32
+ export const AUTHORING_ADAPTER_SHAPE = defineSeamShape<AuthoringAdapter>()({
33
+ capabilities: { optional: false, kind: 'value', required: 'shape' },
34
+ provenance: { optional: true, kind: 'value', required: 'shape' },
35
+ hierarchy: { optional: false, kind: 'value', required: 'operation' },
36
+ selection: { optional: true, kind: 'value', required: 'effect' },
37
+ transforms: { optional: true, kind: 'value', required: 'effect' },
38
+ inspector: { optional: true, kind: 'value', required: 'effect' },
39
+ assetSubject: { optional: true, kind: 'value', required: 'operation' },
40
+ related: { optional: true, kind: 'value', required: 'operation' },
41
+ instances: { optional: true, kind: 'value', required: 'effect' },
42
+ structure: { optional: true, kind: 'value', required: 'round-trip' },
43
+ persistence: { optional: true, kind: 'value', required: 'round-trip' },
44
+ pickable: { optional: true, kind: 'value', required: 'operation' },
45
+ rects: { optional: true, kind: 'value', required: 'operation' },
46
+ boxEdit: { optional: true, kind: 'value', required: 'effect' },
47
+ text: { optional: true, kind: 'value', required: 'effect' },
48
+ colorSample: { optional: true, kind: 'value', required: 'operation' },
49
+ stories: { optional: true, kind: 'value', required: 'effect' },
50
+ truth: { optional: true, kind: 'value', required: 'operation' },
51
+ spatialHandles: { optional: true, kind: 'value', required: 'effect' },
52
+ assetDrop: { optional: true, kind: 'value', required: 'round-trip' },
53
+ subscribe: { optional: true, kind: 'function', required: 'effect' },
54
+ });
55
+
56
+ export const HIERARCHY_PROVIDER_SHAPE = defineSeamShape<HierarchyProvider>()({
57
+ roots: { optional: false, kind: 'function', required: 'operation' },
58
+ node: { optional: false, kind: 'function', required: 'operation' },
59
+ crossSurfaceStructureSignature: { optional: true, kind: 'function', required: 'operation' },
60
+ // A PURE LOOKUP IS AN `operation`, and `effect` is reserved for a member
61
+ // whose truth is a side effect a receipt records (orchestrator ruling,
62
+ // 2026-09-19). `idForObject3D` was declared `effect` and could therefore
63
+ // never be verified: nothing it does is observable anywhere but in its own
64
+ // return value, so no consumer has a receipt to record and the hierarchy
65
+ // carrier graded `unverified` forever — a false sentence about a member
66
+ // that works. It is the inverse of `object3D` and is proven the same way,
67
+ // by a read probe that CALLS it and checks the answer against the walk
68
+ // (`coverage/authoring-read-probe.ts`).
69
+ object3D: { optional: true, kind: 'function', required: 'operation' },
70
+ idForObject3D: { optional: true, kind: 'function', required: 'operation' },
71
+ });
72
+
73
+ export const SELECTION_PROVIDER_SHAPE = defineSeamShape<SelectionProvider>()({
74
+ get: { optional: false, kind: 'function', required: 'operation' },
75
+ set: { optional: false, kind: 'function', required: 'effect' },
76
+ resolve: { optional: true, kind: 'function', required: 'operation' },
77
+ });
78
+
79
+ export const TRANSFORM_PROVIDER_SHAPE = defineSeamShape<TransformProvider>()({
80
+ dimensions: { optional: true, kind: 'function', required: 'operation' },
81
+ get: { optional: false, kind: 'function', required: 'operation' },
82
+ editability: { optional: true, kind: 'function', required: 'operation' },
83
+ beginEdit: { optional: false, kind: 'function', required: 'effect' },
84
+ apply: { optional: false, kind: 'function', required: 'effect' },
85
+ endEdit: { optional: false, kind: 'function', required: 'effect' },
86
+ remove: { optional: true, kind: 'function', required: 'round-trip' },
87
+ sourceCommit: { optional: true, kind: 'value', required: 'round-trip' },
88
+ });
89
+
90
+ export const INSPECTOR_PROVIDER_SHAPE = defineSeamShape<InspectorProvider>()({
91
+ properties: { optional: false, kind: 'function', required: 'operation' },
92
+ get: { optional: false, kind: 'function', required: 'operation' },
93
+ set: { optional: false, kind: 'function', required: 'effect' },
94
+ preview: { optional: true, kind: 'function', required: 'effect' },
95
+ editability: { optional: true, kind: 'function', required: 'operation' },
96
+ remove: { optional: true, kind: 'function', required: 'round-trip' },
97
+ });
98
+
99
+ export const ASSET_SUBJECT_PROVIDER_SHAPE = defineSeamShape<AssetSubjectProvider>()({
100
+ get: { optional: false, kind: 'function', required: 'operation' },
101
+ entries: { optional: true, kind: 'function', required: 'operation' },
102
+ });
103
+
104
+ export const RELATED_SUBJECTS_PROVIDER_SHAPE = defineSeamShape<RelatedSubjectsProvider>()({
105
+ links: { optional: false, kind: 'function', required: 'operation' },
106
+ });
107
+
108
+ export const COMPONENT_INSTANCES_PROVIDER_SHAPE = defineSeamShape<ComponentInstancesProvider>()({
109
+ describe: { optional: false, kind: 'function', required: 'operation' },
110
+ openComponent: { optional: true, kind: 'function', required: 'effect' },
111
+ revert: { optional: false, kind: 'function', required: 'round-trip' },
112
+ applyToComponent: { optional: false, kind: 'function', required: 'round-trip' },
113
+ });
114
+
115
+ export const STRUCTURE_PROVIDER_SHAPE = defineSeamShape<StructureProvider>()({
116
+ create: { optional: false, kind: 'function', required: 'round-trip' },
117
+ remove: { optional: false, kind: 'function', required: 'round-trip' },
118
+ duplicate: { optional: false, kind: 'function', required: 'round-trip' },
119
+ duplicateMany: { optional: true, kind: 'function', required: 'round-trip' },
120
+ reparent: { optional: false, kind: 'function', required: 'round-trip' },
121
+ reorder: { optional: true, kind: 'function', required: 'round-trip' },
122
+ creatableKinds: { optional: true, kind: 'function', required: 'operation' },
123
+ wrap: { optional: true, kind: 'function', required: 'round-trip' },
124
+ unwrap: { optional: true, kind: 'function', required: 'round-trip' },
125
+ group: { optional: true, kind: 'function', required: 'round-trip' },
126
+ ungroup: { optional: true, kind: 'function', required: 'round-trip' },
127
+ canUngroup: { optional: true, kind: 'function', required: 'operation' },
128
+ removeMany: { optional: true, kind: 'function', required: 'round-trip' },
129
+ copy: { optional: true, kind: 'function', required: 'effect' },
130
+ canCopy: { optional: true, kind: 'function', required: 'operation' },
131
+ cut: { optional: true, kind: 'function', required: 'round-trip' },
132
+ paste: { optional: true, kind: 'function', required: 'round-trip' },
133
+ canPaste: { optional: true, kind: 'function', required: 'operation' },
134
+ });
135
+
136
+ export const PERSISTENCE_PROVIDER_SHAPE = defineSeamShape<PersistenceProvider>()({
137
+ isDirty: { optional: false, kind: 'function', required: 'operation' },
138
+ lastError: { optional: true, kind: 'function', required: 'operation' },
139
+ save: { optional: false, kind: 'function', required: 'round-trip' },
140
+ destination: { optional: false, kind: 'value', required: 'shape' },
141
+ applyExternal: { optional: true, kind: 'function', required: 'effect' },
142
+ });
143
+
144
+ export const PICK_PROVIDER_SHAPE = defineSeamShape<PickProvider>()({
145
+ pick: { optional: false, kind: 'function', required: 'operation' },
146
+ candidates: { optional: true, kind: 'function', required: 'operation' },
147
+ });
148
+
149
+ export const STORIES_PROVIDER_SHAPE = defineSeamShape<StoriesProvider>()({
150
+ storiesFor: { optional: false, kind: 'function', required: 'operation' },
151
+ active: { optional: false, kind: 'function', required: 'operation' },
152
+ apply: { optional: false, kind: 'function', required: 'effect' },
153
+ isolate: { optional: true, kind: 'function', required: 'effect' },
154
+ title: { optional: true, kind: 'value', required: 'shape' },
155
+ unavailable: { optional: true, kind: 'function', required: 'operation' },
156
+ });
157
+
158
+ export const ASSET_DROP_PROVIDER_SHAPE = defineSeamShape<AssetDropProvider>()({
159
+ accepts: { optional: false, kind: 'function', required: 'operation' },
160
+ drop: { optional: false, kind: 'function', required: 'round-trip' },
161
+ });
162
+
163
+ export const RECT_PROVIDER_SHAPE = defineSeamShape<RectProvider>()({
164
+ rect: { optional: false, kind: 'function', required: 'operation' },
165
+ contextRects: { optional: true, kind: 'function', required: 'operation' },
166
+ emptyContainers: { optional: true, kind: 'function', required: 'operation' },
167
+ frame: { optional: true, kind: 'function', required: 'operation' },
168
+ });
169
+
170
+ export const BOX_EDIT_PROVIDER_SHAPE = defineSeamShape<BoxEditProvider>()({
171
+ begin: { optional: false, kind: 'function', required: 'effect' },
172
+ apply: { optional: false, kind: 'function', required: 'effect' },
173
+ end: { optional: false, kind: 'function', required: 'effect' },
174
+ gizmoOrigin: { optional: true, kind: 'function', required: 'operation' },
175
+ referencePoint: { optional: true, kind: 'function', required: 'operation' },
176
+ });
177
+
178
+ export const TEXT_PROVIDER_SHAPE = defineSeamShape<TextProvider>()({
179
+ get: { optional: false, kind: 'function', required: 'operation' },
180
+ set: { optional: false, kind: 'function', required: 'effect' },
181
+ });
182
+
183
+ export const COLOR_SAMPLE_PROVIDER_SHAPE = defineSeamShape<ColorSampleProvider>()({
184
+ backgroundChainAt: { optional: false, kind: 'function', required: 'operation' },
185
+ });
186
+
187
+ export const TRUTH_PROVIDER_SHAPE = defineSeamShape<TruthProvider>()({
188
+ resolve: { optional: false, kind: 'function', required: 'operation' },
189
+ });
190
+
191
+ export const SPATIAL_HANDLES_PROVIDER_SHAPE = defineSeamShape<SpatialHandlesProvider>()({
192
+ layers: { optional: false, kind: 'function', required: 'operation' },
193
+ preview: { optional: false, kind: 'function', required: 'effect' },
194
+ commit: { optional: false, kind: 'function', required: 'round-trip' },
195
+ });
196
+
197
+ type ObjectProviderKey = Exclude<
198
+ keyof AuthoringAdapter,
199
+ 'capabilities' | 'provenance' | 'hierarchy' | 'subscribe'
200
+ >;
201
+
202
+ /** The one nested-provider table. Its key type comes from AuthoringAdapter and
203
+ * each value is typed against that provider's own interface. */
204
+ export const AUTHORING_PROVIDER_SHAPES: {
205
+ readonly [K in ObjectProviderKey]: SeamShape<NonNullable<AuthoringAdapter[K]>>;
206
+ } = {
207
+ selection: SELECTION_PROVIDER_SHAPE,
208
+ transforms: TRANSFORM_PROVIDER_SHAPE,
209
+ inspector: INSPECTOR_PROVIDER_SHAPE,
210
+ assetSubject: ASSET_SUBJECT_PROVIDER_SHAPE,
211
+ related: RELATED_SUBJECTS_PROVIDER_SHAPE,
212
+ instances: COMPONENT_INSTANCES_PROVIDER_SHAPE,
213
+ structure: STRUCTURE_PROVIDER_SHAPE,
214
+ persistence: PERSISTENCE_PROVIDER_SHAPE,
215
+ pickable: PICK_PROVIDER_SHAPE,
216
+ rects: RECT_PROVIDER_SHAPE,
217
+ boxEdit: BOX_EDIT_PROVIDER_SHAPE,
218
+ text: TEXT_PROVIDER_SHAPE,
219
+ colorSample: COLOR_SAMPLE_PROVIDER_SHAPE,
220
+ stories: STORIES_PROVIDER_SHAPE,
221
+ truth: TRUTH_PROVIDER_SHAPE,
222
+ spatialHandles: SPATIAL_HANDLES_PROVIDER_SHAPE,
223
+ assetDrop: ASSET_DROP_PROVIDER_SHAPE,
224
+ };