@hyprune/schema 0.5.2 → 0.7.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/CHANGELOG.md +156 -0
- package/README.md +73 -4
- package/bin/validate.mjs +15 -5
- package/examples/library-releases.json +11 -0
- package/examples/library.json +18 -0
- package/examples/object-character.json +69 -0
- package/examples/object-machine.json +338 -0
- package/examples/object-seat.json +59 -0
- package/examples/object.json +148 -0
- package/extensions/blueprint.schema.json +29 -0
- package/lib/validate.d.mts +29 -2
- package/lib/validate.mjs +494 -8
- package/package.json +1 -1
- package/v0.10/library.schema.json +93 -0
- package/v0.10/object.schema.json +1713 -0
- package/v0.20/ipc.schema.json +11800 -0
- package/v0.21/focus-history.schema.json +82 -0
- package/v0.21/guidance.schema.json +118 -0
- package/v0.21/ipc.schema.json +15726 -0
- package/v0.21/quests-personal.schema.json +448 -0
- package/v0.22/ipc.schema.json +17466 -0
- package/v0.8/common.schema.json +478 -0
- package/v0.8/world.schema.json +1261 -0
- package/v0.9/library-releases.schema.json +53 -0
- package/v0.9/library.schema.json +93 -0
- package/v0.9/object.schema.json +739 -0
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
{
|
|
2
|
+
"formatVersion": "0.10",
|
|
3
|
+
"id": "conveyor",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"name": "Conveyor",
|
|
6
|
+
"category": "machines",
|
|
7
|
+
"tags": [
|
|
8
|
+
"ci",
|
|
9
|
+
"pipeline"
|
|
10
|
+
],
|
|
11
|
+
"scene": "object.glb",
|
|
12
|
+
"license": "CC-BY-4.0",
|
|
13
|
+
"attribution": [
|
|
14
|
+
{
|
|
15
|
+
"path": ".",
|
|
16
|
+
"author": "Example Author",
|
|
17
|
+
"license": "CC-BY-4.0"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"bounds": {
|
|
21
|
+
"min": [
|
|
22
|
+
-2.2,
|
|
23
|
+
0,
|
|
24
|
+
-0.8
|
|
25
|
+
],
|
|
26
|
+
"max": [
|
|
27
|
+
2.2,
|
|
28
|
+
1.9,
|
|
29
|
+
0.8
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"traits": {
|
|
33
|
+
"decorative": {
|
|
34
|
+
"animations": [
|
|
35
|
+
{
|
|
36
|
+
"node": "belt-rollers",
|
|
37
|
+
"type": "spin",
|
|
38
|
+
"axis": [
|
|
39
|
+
1,
|
|
40
|
+
0,
|
|
41
|
+
0
|
|
42
|
+
],
|
|
43
|
+
"pivot": [
|
|
44
|
+
0,
|
|
45
|
+
0.6,
|
|
46
|
+
0
|
|
47
|
+
],
|
|
48
|
+
"period": 1.2
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
"collidable": {
|
|
53
|
+
"node": "proxy"
|
|
54
|
+
},
|
|
55
|
+
"movable": {
|
|
56
|
+
"surfaces": [
|
|
57
|
+
"floor"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"machine": {
|
|
61
|
+
"primary": "status",
|
|
62
|
+
"inputs": [
|
|
63
|
+
{
|
|
64
|
+
"id": "status",
|
|
65
|
+
"type": "enum",
|
|
66
|
+
"values": [
|
|
67
|
+
"idle",
|
|
68
|
+
"running",
|
|
69
|
+
"ok",
|
|
70
|
+
"fail"
|
|
71
|
+
],
|
|
72
|
+
"default": "idle",
|
|
73
|
+
"label": "Pipeline status",
|
|
74
|
+
"explain": "Lamp colour and belt motion: the belt runs while the pipeline runs."
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"id": "jobStarted",
|
|
78
|
+
"type": "event",
|
|
79
|
+
"label": "Job started",
|
|
80
|
+
"explain": "Each started job drops a crate onto the belt."
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"id": "queued",
|
|
84
|
+
"type": "int",
|
|
85
|
+
"min": 0,
|
|
86
|
+
"max": 64,
|
|
87
|
+
"default": 0,
|
|
88
|
+
"label": "Queued jobs",
|
|
89
|
+
"explain": "Crates waiting beside the entry, one per queued job."
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"id": "lastJob",
|
|
93
|
+
"type": "text",
|
|
94
|
+
"maxLength": 24,
|
|
95
|
+
"label": "Last job",
|
|
96
|
+
"explain": "The most recent job's name."
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
"drives": [
|
|
100
|
+
{
|
|
101
|
+
"input": "status",
|
|
102
|
+
"target": "state:lamp"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"input": "status",
|
|
106
|
+
"target": "animation:belt-rollers",
|
|
107
|
+
"map": {
|
|
108
|
+
"cases": [
|
|
109
|
+
{
|
|
110
|
+
"equals": "running",
|
|
111
|
+
"to": 1
|
|
112
|
+
}
|
|
113
|
+
],
|
|
114
|
+
"else": 0
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"input": "queued",
|
|
119
|
+
"target": "count:waiting"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"input": "lastJob",
|
|
123
|
+
"target": "label:sign"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"input": "jobStarted",
|
|
127
|
+
"target": "spawn:belt-in"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"input": "status",
|
|
131
|
+
"target": "effect:confetti",
|
|
132
|
+
"map": {
|
|
133
|
+
"becomes": "ok",
|
|
134
|
+
"from": "running"
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
"recipes": [
|
|
139
|
+
{
|
|
140
|
+
"name": "Pipeline summary JSON",
|
|
141
|
+
"fields": {
|
|
142
|
+
"status": "/pipelines/0/status",
|
|
143
|
+
"jobStarted": "/pipelines/0/jobs_started",
|
|
144
|
+
"queued": {
|
|
145
|
+
"countWhere": {
|
|
146
|
+
"array": "/jobs",
|
|
147
|
+
"pointer": "/status",
|
|
148
|
+
"equals": "queued"
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
"lastJob": "/pipelines/0/last_job/name"
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
"slots": {
|
|
158
|
+
"states": [
|
|
159
|
+
{
|
|
160
|
+
"id": "lamp",
|
|
161
|
+
"materials": [
|
|
162
|
+
"lamp-glass"
|
|
163
|
+
],
|
|
164
|
+
"palette": [
|
|
165
|
+
{
|
|
166
|
+
"id": "idle",
|
|
167
|
+
"colour": [
|
|
168
|
+
0.35,
|
|
169
|
+
0.45,
|
|
170
|
+
0.6
|
|
171
|
+
],
|
|
172
|
+
"emission": 0.5
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"id": "running",
|
|
176
|
+
"colour": [
|
|
177
|
+
1.0,
|
|
178
|
+
0.7,
|
|
179
|
+
0.2
|
|
180
|
+
],
|
|
181
|
+
"emission": 2
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"id": "ok",
|
|
185
|
+
"colour": [
|
|
186
|
+
0.3,
|
|
187
|
+
1.0,
|
|
188
|
+
0.45
|
|
189
|
+
],
|
|
190
|
+
"emission": 2
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"id": "fail",
|
|
194
|
+
"colour": [
|
|
195
|
+
1.0,
|
|
196
|
+
0.2,
|
|
197
|
+
0.15
|
|
198
|
+
],
|
|
199
|
+
"emission": 3
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"id": "stale",
|
|
203
|
+
"colour": [
|
|
204
|
+
0.4,
|
|
205
|
+
0.4,
|
|
206
|
+
0.4
|
|
207
|
+
],
|
|
208
|
+
"emission": 0.2
|
|
209
|
+
}
|
|
210
|
+
]
|
|
211
|
+
}
|
|
212
|
+
],
|
|
213
|
+
"labels": [
|
|
214
|
+
{
|
|
215
|
+
"id": "sign",
|
|
216
|
+
"pose": {
|
|
217
|
+
"position": [
|
|
218
|
+
0,
|
|
219
|
+
1.75,
|
|
220
|
+
0.81
|
|
221
|
+
],
|
|
222
|
+
"rotation": [
|
|
223
|
+
0,
|
|
224
|
+
0,
|
|
225
|
+
0,
|
|
226
|
+
1
|
|
227
|
+
]
|
|
228
|
+
},
|
|
229
|
+
"size": [
|
|
230
|
+
1.2,
|
|
231
|
+
0.3
|
|
232
|
+
],
|
|
233
|
+
"maxChars": 24,
|
|
234
|
+
"font": "mono"
|
|
235
|
+
}
|
|
236
|
+
],
|
|
237
|
+
"tracks": [
|
|
238
|
+
{
|
|
239
|
+
"id": "belt",
|
|
240
|
+
"speed": 0.6,
|
|
241
|
+
"points": [
|
|
242
|
+
{
|
|
243
|
+
"position": [
|
|
244
|
+
-2,
|
|
245
|
+
0.8,
|
|
246
|
+
0
|
|
247
|
+
],
|
|
248
|
+
"type": "line"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"position": [
|
|
252
|
+
2,
|
|
253
|
+
0.8,
|
|
254
|
+
0
|
|
255
|
+
],
|
|
256
|
+
"type": "line"
|
|
257
|
+
}
|
|
258
|
+
],
|
|
259
|
+
"items": {
|
|
260
|
+
"assets": [
|
|
261
|
+
"job-crate"
|
|
262
|
+
],
|
|
263
|
+
"max": 24,
|
|
264
|
+
"spacing": 0.45
|
|
265
|
+
},
|
|
266
|
+
"sink": true
|
|
267
|
+
}
|
|
268
|
+
],
|
|
269
|
+
"spawns": [
|
|
270
|
+
{
|
|
271
|
+
"id": "belt-in",
|
|
272
|
+
"pose": {
|
|
273
|
+
"position": [
|
|
274
|
+
-2,
|
|
275
|
+
0.8,
|
|
276
|
+
0
|
|
277
|
+
],
|
|
278
|
+
"rotation": [
|
|
279
|
+
0,
|
|
280
|
+
0.707,
|
|
281
|
+
0,
|
|
282
|
+
0.707
|
|
283
|
+
]
|
|
284
|
+
},
|
|
285
|
+
"track": "belt",
|
|
286
|
+
"items": [
|
|
287
|
+
"job-crate"
|
|
288
|
+
],
|
|
289
|
+
"maxRate": 2
|
|
290
|
+
}
|
|
291
|
+
],
|
|
292
|
+
"stacks": [
|
|
293
|
+
{
|
|
294
|
+
"id": "waiting",
|
|
295
|
+
"node": "crate",
|
|
296
|
+
"cap": 64,
|
|
297
|
+
"layout": {
|
|
298
|
+
"grid": [
|
|
299
|
+
4,
|
|
300
|
+
4,
|
|
301
|
+
4
|
|
302
|
+
],
|
|
303
|
+
"spacing": [
|
|
304
|
+
0.35,
|
|
305
|
+
0.35,
|
|
306
|
+
0.35
|
|
307
|
+
],
|
|
308
|
+
"fill": "xzy"
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
],
|
|
312
|
+
"effects": [
|
|
313
|
+
{
|
|
314
|
+
"id": "confetti",
|
|
315
|
+
"pose": {
|
|
316
|
+
"position": [
|
|
317
|
+
0,
|
|
318
|
+
2.0,
|
|
319
|
+
0
|
|
320
|
+
],
|
|
321
|
+
"rotation": [
|
|
322
|
+
0,
|
|
323
|
+
0,
|
|
324
|
+
0,
|
|
325
|
+
1
|
|
326
|
+
]
|
|
327
|
+
},
|
|
328
|
+
"kind": "burst",
|
|
329
|
+
"colour": [
|
|
330
|
+
1.0,
|
|
331
|
+
0.8,
|
|
332
|
+
0.2
|
|
333
|
+
],
|
|
334
|
+
"durationMs": 1500
|
|
335
|
+
}
|
|
336
|
+
]
|
|
337
|
+
}
|
|
338
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"formatVersion": "0.9",
|
|
3
|
+
"id": "bench",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"name": "Bench",
|
|
6
|
+
"category": "furniture",
|
|
7
|
+
"scene": "object.glb",
|
|
8
|
+
"license": "CC0-1.0",
|
|
9
|
+
"attribution": [
|
|
10
|
+
{
|
|
11
|
+
"path": ".",
|
|
12
|
+
"author": "Example Author",
|
|
13
|
+
"license": "CC0-1.0"
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"bounds": {
|
|
17
|
+
"min": [
|
|
18
|
+
-0.8,
|
|
19
|
+
0,
|
|
20
|
+
-0.25
|
|
21
|
+
],
|
|
22
|
+
"max": [
|
|
23
|
+
0.8,
|
|
24
|
+
0.85,
|
|
25
|
+
0.25
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
"traits": {
|
|
29
|
+
"collidable": {
|
|
30
|
+
"node": "proxy"
|
|
31
|
+
},
|
|
32
|
+
"movable": {},
|
|
33
|
+
"seat": {
|
|
34
|
+
"capacity": 2,
|
|
35
|
+
"anchors": [
|
|
36
|
+
{
|
|
37
|
+
"id": "left",
|
|
38
|
+
"position": [
|
|
39
|
+
-0.4,
|
|
40
|
+
0,
|
|
41
|
+
0.55
|
|
42
|
+
],
|
|
43
|
+
"yaw": 0,
|
|
44
|
+
"height": 0.45
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"id": "right",
|
|
48
|
+
"position": [
|
|
49
|
+
0.4,
|
|
50
|
+
0,
|
|
51
|
+
0.55
|
|
52
|
+
],
|
|
53
|
+
"yaw": 0,
|
|
54
|
+
"height": 0.45
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
{
|
|
2
|
+
"formatVersion": "0.9",
|
|
3
|
+
"id": "street-lantern",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"name": "Street lantern",
|
|
6
|
+
"description": "A post lantern with a softly bobbing flame and a bench seat at its foot.",
|
|
7
|
+
"category": "lighting",
|
|
8
|
+
"tags": [
|
|
9
|
+
"lamp",
|
|
10
|
+
"street"
|
|
11
|
+
],
|
|
12
|
+
"scene": "object.glb",
|
|
13
|
+
"license": "CC-BY-4.0",
|
|
14
|
+
"attribution": [
|
|
15
|
+
{
|
|
16
|
+
"path": ".",
|
|
17
|
+
"author": "Example Author",
|
|
18
|
+
"license": "CC-BY-4.0",
|
|
19
|
+
"source": "https://example.com/street-lantern"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"bounds": {
|
|
23
|
+
"min": [
|
|
24
|
+
-0.25,
|
|
25
|
+
0,
|
|
26
|
+
-0.25
|
|
27
|
+
],
|
|
28
|
+
"max": [
|
|
29
|
+
0.25,
|
|
30
|
+
2.4,
|
|
31
|
+
0.25
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"thumbnail": "thumbnail.png",
|
|
35
|
+
"lighting": {
|
|
36
|
+
"mode": "probe"
|
|
37
|
+
},
|
|
38
|
+
"traits": {
|
|
39
|
+
"decorative": {
|
|
40
|
+
"animations": [
|
|
41
|
+
{
|
|
42
|
+
"node": "flame",
|
|
43
|
+
"type": "bob",
|
|
44
|
+
"axis": [
|
|
45
|
+
0,
|
|
46
|
+
1,
|
|
47
|
+
0
|
|
48
|
+
],
|
|
49
|
+
"amplitude": 0.01,
|
|
50
|
+
"period": 3
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
"collidable": {
|
|
55
|
+
"node": "proxy"
|
|
56
|
+
},
|
|
57
|
+
"movable": {
|
|
58
|
+
"surfaces": [
|
|
59
|
+
"floor"
|
|
60
|
+
],
|
|
61
|
+
"upright": true,
|
|
62
|
+
"scale": [
|
|
63
|
+
0.75,
|
|
64
|
+
1.5
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"slots": {
|
|
69
|
+
"states": [
|
|
70
|
+
{
|
|
71
|
+
"id": "status",
|
|
72
|
+
"materials": [
|
|
73
|
+
"lamp-glass"
|
|
74
|
+
],
|
|
75
|
+
"palette": [
|
|
76
|
+
{
|
|
77
|
+
"id": "idle",
|
|
78
|
+
"colour": [
|
|
79
|
+
0.3,
|
|
80
|
+
0.5,
|
|
81
|
+
1.0
|
|
82
|
+
],
|
|
83
|
+
"emission": 1
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"id": "busy",
|
|
87
|
+
"colour": [
|
|
88
|
+
1.0,
|
|
89
|
+
0.7,
|
|
90
|
+
0.2
|
|
91
|
+
],
|
|
92
|
+
"emission": 2
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"id": "fault",
|
|
96
|
+
"colour": [
|
|
97
|
+
1.0,
|
|
98
|
+
0.2,
|
|
99
|
+
0.2
|
|
100
|
+
],
|
|
101
|
+
"emission": 3
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
"labels": [
|
|
107
|
+
{
|
|
108
|
+
"id": "title",
|
|
109
|
+
"pose": {
|
|
110
|
+
"position": [
|
|
111
|
+
0,
|
|
112
|
+
1.9,
|
|
113
|
+
0.26
|
|
114
|
+
],
|
|
115
|
+
"rotation": [
|
|
116
|
+
0,
|
|
117
|
+
0,
|
|
118
|
+
0,
|
|
119
|
+
1
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
"size": [
|
|
123
|
+
0.6,
|
|
124
|
+
0.15
|
|
125
|
+
],
|
|
126
|
+
"maxChars": 24
|
|
127
|
+
}
|
|
128
|
+
],
|
|
129
|
+
"effects": [
|
|
130
|
+
{
|
|
131
|
+
"id": "vent",
|
|
132
|
+
"pose": {
|
|
133
|
+
"position": [
|
|
134
|
+
0,
|
|
135
|
+
2.3,
|
|
136
|
+
0
|
|
137
|
+
],
|
|
138
|
+
"rotation": [
|
|
139
|
+
0,
|
|
140
|
+
0,
|
|
141
|
+
0,
|
|
142
|
+
1
|
|
143
|
+
]
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://hyprune.com/schema/extensions/blueprint.schema.json",
|
|
4
|
+
"title": "com.hyprune.blueprint 0.1 world manifest value",
|
|
5
|
+
"description": "Per-level blueprint SVGs in the frame of the package's com.hyprune.map 0.1 (RFC-0004 amendment). Levels are sorted by minY and must not overlap (maxY[i] <= minY[i+1]); each SVG is at most 65536 bytes, all levels together at most 262144 bytes, using the map SVG subset plus a class attribute from: grid floor wall stair opening screen mount area label route waypoint void outline. Consumers enforce those rules.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["version", "levels"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"version": {"const": "0.1"},
|
|
11
|
+
"levels": {
|
|
12
|
+
"type": "array",
|
|
13
|
+
"minItems": 1,
|
|
14
|
+
"maxItems": 6,
|
|
15
|
+
"items": {
|
|
16
|
+
"type": "object",
|
|
17
|
+
"additionalProperties": false,
|
|
18
|
+
"required": ["id", "name", "minY", "maxY", "path"],
|
|
19
|
+
"properties": {
|
|
20
|
+
"id": {"type": "string", "pattern": "^[a-z][a-z0-9-]{0,31}$"},
|
|
21
|
+
"name": {"type": "string", "minLength": 1, "maxLength": 64},
|
|
22
|
+
"minY": {"type": "number"},
|
|
23
|
+
"maxY": {"type": "number"},
|
|
24
|
+
"path": {"type": "string", "minLength": 1, "maxLength": 200, "pattern": "^(?!/)(?!.*(^|/)\\.\\.(/|$))[A-Za-z0-9_./-]+\\.svg$"}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
package/lib/validate.d.mts
CHANGED
|
@@ -1,17 +1,39 @@
|
|
|
1
1
|
// Type declarations for lib/validate.mjs.
|
|
2
2
|
|
|
3
3
|
/** Schema kinds `validate` accepts; `scene` checks a scene.gltf against its world format. */
|
|
4
|
-
export type ContractKind = 'world' | 'extension' | 'screen-type' | 'ipc' | 'scene';
|
|
4
|
+
export type ContractKind = 'world' | 'extension' | 'screen-type' | 'ipc' | 'scene' | 'object' | 'library' | 'library-releases';
|
|
5
5
|
|
|
6
6
|
export interface ValidationResult {
|
|
7
7
|
valid: boolean;
|
|
8
8
|
/** JSON-pointer-prefixed messages; empty when valid. */
|
|
9
9
|
errors: string[];
|
|
10
|
+
/** Kinds object, library and library-releases: advisory messages (never make a document invalid). */
|
|
11
|
+
warnings?: string[];
|
|
12
|
+
/** Kind object with a glTF: triangles drawn by the scene. */
|
|
13
|
+
triangles?: number;
|
|
10
14
|
}
|
|
11
15
|
|
|
12
16
|
export interface ValidateOptions {
|
|
13
17
|
/** For kind `scene`: the package's parsed world.json (lightmap checks). */
|
|
14
18
|
world?: unknown;
|
|
19
|
+
/**
|
|
20
|
+
* For kind `scene` from world 0.8: validate `value` as the glTF of this
|
|
21
|
+
* `world.objectAssets[].id` (extension rules, animation and collision node
|
|
22
|
+
* names, nesting) instead of the world's scene.gltf.
|
|
23
|
+
*/
|
|
24
|
+
asset?: string;
|
|
25
|
+
/** Kind object: the parsed scene glTF (or a GLB's JSON chunk) for node, material, variant, clip, budget and bounds checks. */
|
|
26
|
+
gltf?: unknown;
|
|
27
|
+
/** Kind object: the directory name, which must equal the object id. */
|
|
28
|
+
directory?: string;
|
|
29
|
+
/** Kind object: every file of the object directory (attribution coverage and limits); kind library: every file of the library. */
|
|
30
|
+
files?: ReadonlyArray<{ path: string; size: number }>;
|
|
31
|
+
/** Kind object: the thumbnail PNG's size. */
|
|
32
|
+
thumbnail?: { width: number; height: number; bytes: number };
|
|
33
|
+
/** Kind object: values that need decoded geometry or images. */
|
|
34
|
+
measured?: { bounds?: { min: number[]; max: number[] }; maxTextureSize?: number; gpuBytes?: number };
|
|
35
|
+
/** Kind library: each listed object's parsed object.json, keyed by directory name. */
|
|
36
|
+
objects?: Record<string, { id?: string; formatVersion?: string }>;
|
|
15
37
|
}
|
|
16
38
|
|
|
17
39
|
/**
|
|
@@ -19,7 +41,8 @@ export interface ValidateOptions {
|
|
|
19
41
|
* @param kind contract kind
|
|
20
42
|
* @param value parsed document (world.json, extension.json, an IPC frame, scene.gltf)
|
|
21
43
|
* @param method IPC only: the outstanding request's method, to validate a response's result
|
|
22
|
-
* @param version world format or IPC version, e.g. '0.7' or '0.19' (default '0.1')
|
|
44
|
+
* @param version world format or IPC version, e.g. '0.7' or '0.19' (default '0.1'); for objects and
|
|
45
|
+
* libraries the object format (default: the document's formatVersion)
|
|
23
46
|
* @throws on an unknown kind, version or method (usage errors, not validation failures)
|
|
24
47
|
*/
|
|
25
48
|
export function validate(kind: ContractKind, value: unknown, method?: string, version?: string, options?: ValidateOptions): ValidationResult;
|
|
@@ -33,5 +56,9 @@ export const worldFormats: readonly string[];
|
|
|
33
56
|
export const ipcProtocols: readonly string[];
|
|
34
57
|
/** Every contract version directory, oldest first. */
|
|
35
58
|
export const contractVersions: readonly string[];
|
|
59
|
+
/** Object manifest formats with a published schema (RFC-0011; world format numbering from 0.9). */
|
|
60
|
+
export const objectFormats: readonly string[];
|
|
61
|
+
/** RFC-0011 directory, asset and library limits the object and library checks apply. */
|
|
62
|
+
export const objectLimits: Readonly<Record<string, number>>;
|
|
36
63
|
/** glTF extensions a scene may list in extensionsRequired for a world format. */
|
|
37
64
|
export function sceneExtensions(version: string): string[];
|