@oeave/bakery3 0.0.0-stage → 0.1.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.
Files changed (86) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +562 -2
  3. package/dist/animation-B1h0Ryvj.d.ts +97 -0
  4. package/dist/bake/index.d.ts +369 -0
  5. package/dist/bake/index.js +9 -0
  6. package/dist/bake/index.js.map +1 -0
  7. package/dist/bake-DaOlenyx.d.ts +1357 -0
  8. package/dist/catalog/index.d.ts +100 -0
  9. package/dist/catalog/index.js +154 -0
  10. package/dist/catalog/index.js.map +1 -0
  11. package/dist/catalog.gen-BM-aNf7n.d.ts +733 -0
  12. package/dist/chunk-25ZXSVQ3.js +1107 -0
  13. package/dist/chunk-25ZXSVQ3.js.map +1 -0
  14. package/dist/chunk-3G5QL4F4.js +145 -0
  15. package/dist/chunk-3G5QL4F4.js.map +1 -0
  16. package/dist/chunk-4E5VV4QY.js +12 -0
  17. package/dist/chunk-4E5VV4QY.js.map +1 -0
  18. package/dist/chunk-54WJDN5R.js +3286 -0
  19. package/dist/chunk-54WJDN5R.js.map +1 -0
  20. package/dist/chunk-6NYR73Y7.js +832 -0
  21. package/dist/chunk-6NYR73Y7.js.map +1 -0
  22. package/dist/chunk-6YVQANMW.js +1463 -0
  23. package/dist/chunk-6YVQANMW.js.map +1 -0
  24. package/dist/chunk-AF5BIELI.js +70 -0
  25. package/dist/chunk-AF5BIELI.js.map +1 -0
  26. package/dist/chunk-APBOWWSV.js +92 -0
  27. package/dist/chunk-APBOWWSV.js.map +1 -0
  28. package/dist/chunk-ARMTTZXZ.js +1157 -0
  29. package/dist/chunk-ARMTTZXZ.js.map +1 -0
  30. package/dist/chunk-CX4WTVGH.js +4492 -0
  31. package/dist/chunk-CX4WTVGH.js.map +1 -0
  32. package/dist/chunk-HQTUFVMM.js +1412 -0
  33. package/dist/chunk-HQTUFVMM.js.map +1 -0
  34. package/dist/chunk-MD2U6S4N.js +1952 -0
  35. package/dist/chunk-MD2U6S4N.js.map +1 -0
  36. package/dist/chunk-S4AJTLLN.js +23 -0
  37. package/dist/chunk-S4AJTLLN.js.map +1 -0
  38. package/dist/chunk-TGFNQBKC.js +551 -0
  39. package/dist/chunk-TGFNQBKC.js.map +1 -0
  40. package/dist/chunk-V3QINEEG.js +87 -0
  41. package/dist/chunk-V3QINEEG.js.map +1 -0
  42. package/dist/chunk-W6WQ5UP7.js +91 -0
  43. package/dist/chunk-W6WQ5UP7.js.map +1 -0
  44. package/dist/chunk-WBIAFIHV.js +346 -0
  45. package/dist/chunk-WBIAFIHV.js.map +1 -0
  46. package/dist/chunk-ZEBVAIJJ.js +156 -0
  47. package/dist/chunk-ZEBVAIJJ.js.map +1 -0
  48. package/dist/devtools/index.d.ts +536 -0
  49. package/dist/devtools/index.js +15 -0
  50. package/dist/devtools/index.js.map +1 -0
  51. package/dist/environments/index.d.ts +93 -0
  52. package/dist/environments/index.js +382 -0
  53. package/dist/environments/index.js.map +1 -0
  54. package/dist/hotspots/index.d.ts +111 -0
  55. package/dist/hotspots/index.js +285 -0
  56. package/dist/hotspots/index.js.map +1 -0
  57. package/dist/index.d.ts +944 -0
  58. package/dist/index.js +15 -0
  59. package/dist/index.js.map +1 -0
  60. package/dist/node/index.cjs +5115 -0
  61. package/dist/node/index.cjs.map +1 -0
  62. package/dist/node/index.d.cts +4862 -0
  63. package/dist/node/index.d.ts +576 -0
  64. package/dist/node/index.js +1279 -0
  65. package/dist/node/index.js.map +1 -0
  66. package/dist/prepare-C5qVvaw4.d.ts +112 -0
  67. package/dist/presets/index.d.ts +526 -0
  68. package/dist/presets/index.js +14 -0
  69. package/dist/presets/index.js.map +1 -0
  70. package/dist/r3f/index.d.ts +159 -0
  71. package/dist/r3f/index.js +592 -0
  72. package/dist/r3f/index.js.map +1 -0
  73. package/dist/room-S5TLCK4F.js +9 -0
  74. package/dist/room-S5TLCK4F.js.map +1 -0
  75. package/dist/rooms.gen-vhj6sFW5.d.ts +1434 -0
  76. package/dist/session-YCQS4MRH.js +9 -0
  77. package/dist/session-YCQS4MRH.js.map +1 -0
  78. package/dist/shapes/index.d.ts +222 -0
  79. package/dist/shapes/index.js +836 -0
  80. package/dist/shapes/index.js.map +1 -0
  81. package/dist/testRun-BIPXaVPb.d.ts +1130 -0
  82. package/dist/timeline-ChwgD7bT.d.ts +470 -0
  83. package/dist/tsl/index.d.ts +165 -0
  84. package/dist/tsl/index.js +310 -0
  85. package/dist/tsl/index.js.map +1 -0
  86. package/package.json +170 -4
@@ -0,0 +1,4862 @@
1
+ /**
2
+ * Animation: authored as keyframes, shipped as baked frames.
3
+ *
4
+ * The SDK's `Timeline` is keyframes, easings and orbit segments; this is
5
+ * not. What travels is one exact value per output frame, and the renderer
6
+ * sets one keyframe per frame with linear interpolation, so there is nothing
7
+ * left for it to interpolate and nothing for the two sides to disagree
8
+ * about. Easing curves and orbit math exist in one implementation, and the
9
+ * browser preview and the traced frame agree on where everything is at
10
+ * frame N. It costs little: 10 s at 30 fps of camera motion is 300 frames of
11
+ * 7 floats.
12
+ */
13
+ /**
14
+ * What a channel drives. The camera is not an object id: it may never have
15
+ * been in the scene graph at all (see `CameraSpec`). Neither is the
16
+ * environment: `scene.environment`, its intensity and rotation, and the
17
+ * scene's ambient light are scene state, not objects (see `EnvironmentSpec`).
18
+ */
19
+ type AnimationTarget = {
20
+ type: 'camera';
21
+ } | {
22
+ type: 'object';
23
+ objectId: string;
24
+ } | {
25
+ type: 'environment';
26
+ };
27
+ /**
28
+ * One animated property, sampled at every frame.
29
+ *
30
+ * `values` is flat: `frameCount * size` numbers, row-major, frame 0's
31
+ * components and then frame 1's. Nested arrays would cost two bytes of JSON
32
+ * per frame per channel, which for a long sequence is the larger part of
33
+ * the manifest.
34
+ */
35
+ type AnimationChannel = {
36
+ target: AnimationTarget;
37
+ /**
38
+ * `position` | `quaternion` | `scale` | `fov` | `color` | `emissive` |
39
+ * `emissiveIntensity` | `roughness` | `metalness` | `opacity` | `intensity`
40
+ * | `target` | `groundColor`, and on the environment target the four in
41
+ * `ENVIRONMENT_CHANNEL_PROPERTIES`.
42
+ *
43
+ * `target` is a directional or spot light's aim, a WORLD point, as three's
44
+ * `light.target` holds it. Such a light is aimed from its position to its
45
+ * target at every frame, as three aims it, so animating either one turns
46
+ * the beam; `quaternion` on one is refused, because three ignores a
47
+ * directional or spot light's rotation.
48
+ *
49
+ * A property the renderer does not implement is refused with the name,
50
+ * the object's path and a fix, never dropped.
51
+ */
52
+ property: string;
53
+ /** Components per frame: 3 position/scale/color, 4 quaternion, 1 scalar. */
54
+ size: number;
55
+ values: number[];
56
+ };
57
+ /**
58
+ * The baked sequence.
59
+ *
60
+ * Frame `i` is sampled at `i / fps` seconds, so a `frameCount / fps` second
61
+ * clip never repeats its first pose at the end, which is what makes a 360
62
+ * degree orbit loop without a duplicated frame.
63
+ */
64
+ type AnimationSpec = {
65
+ fps: number;
66
+ frameCount: number;
67
+ channels: AnimationChannel[];
68
+ /**
69
+ * Where the browser actually put things: see `WorldCheck`. Optional on the
70
+ * wire so an older worker reads straight through it; a worker that
71
+ * implements it refuses a clip whose frames disagree with the browser's.
72
+ */
73
+ checks?: WorldCheck[];
74
+ };
75
+ /**
76
+ * A target's world matrix at a few of the clip's frames, straight off three
77
+ * (`Object3D.matrixWorld` after a seek; the camera's pose composed), in
78
+ * three's own Y-up frame, column-major, sixteen numbers per frame.
79
+ *
80
+ * The channels say what the browser did; this says where it ended up. The
81
+ * worker rebuilds every animated object from the channels through its own
82
+ * up-axis conversion and parent chain, then sets each of these frames, reads
83
+ * its own world matrices back, and refuses the job if they do not match the
84
+ * browser's: a refusal instead of a plausible clip with the motion in the
85
+ * wrong place. Five frames are enough (a convention error shows on the
86
+ * first, an axis error on any, a drift on the last) and cost eighty numbers
87
+ * per target.
88
+ */
89
+ type WorldCheck = {
90
+ target: AnimationTarget;
91
+ /** Frame indices, ascending, each in `[0, frameCount)`. */
92
+ frames: number[];
93
+ /** `frames.length * 16` numbers. */
94
+ matrices: number[];
95
+ };
96
+
97
+ /**
98
+ * Room presets: a staged interior the renderer rebuilds by itself.
99
+ *
100
+ * A room preset is a whole set: walls with windows, a floor, a pedestal,
101
+ * the furniture along the walls, the foliage outside the glass that dapples
102
+ * the sunlight, a designed lighting rig per mode. The browser shows a
103
+ * compressed stand-in of it (one small GLB from the preset library) so the
104
+ * developer can frame their product inside it; none of that geometry is
105
+ * captured. The manifest carries only this record (which room, which build
106
+ * of it, which lighting, which surfaces, which stand, where it sits), and
107
+ * the worker rebuilds the room from its own full-resolution copy of the
108
+ * definition. A room render uploads exactly what a bare product render
109
+ * uploads: the product.
110
+ *
111
+ * Two versions guard the pixels. `build` is the content hash of the
112
+ * published room definition the SDK previewed; a worker whose copy hashes
113
+ * differently refuses rather than rendering a room that is not the one on
114
+ * screen. `ROOM_PRESET_VERSION` covers the worker's room builder.
115
+ */
116
+
117
+ declare const ROOM_LIGHTING_MODES: readonly ["day", "golden", "overcast", "night"];
118
+ type RoomLightingMode = (typeof ROOM_LIGHTING_MODES)[number];
119
+ /** A preset material plus an optional sRGB hex tint multiplied into albedo. */
120
+ type RoomSurfaceChoice = {
121
+ material: string;
122
+ /** `#rrggbb`. Plaster and paint take a tint well; a plank floor less so. */
123
+ color?: string;
124
+ };
125
+ /**
126
+ * What the manifest says about the room. Every field except `name`, `build`,
127
+ * `lighting` and `matrix` is an override on the published defaults; absent
128
+ * means "the room's own".
129
+ */
130
+ type RoomPresetSpec = {
131
+ /** The published room, e.g. `loft_golden`. */
132
+ name: string;
133
+ /** Content hash (12 hex) of the published definition. See above. */
134
+ build: string;
135
+ lighting: RoomLightingMode;
136
+ surfaces?: {
137
+ floor?: RoomSurfaceChoice;
138
+ walls?: RoomSurfaceChoice;
139
+ ceiling?: RoomSurfaceChoice;
140
+ /** Window sills: stone or timber. No tint; sills are never painted. */
141
+ sill?: {
142
+ material: string;
143
+ };
144
+ };
145
+ /**
146
+ * What the product stands on. `null` puts nothing under it (the developer
147
+ * placed their own stand, or the product sits on the floor); absent keeps
148
+ * the room's stand. `material` applies to a baked pedestal only; a table
149
+ * used as a stand keeps the finish it came with.
150
+ */
151
+ pedestal?: {
152
+ type: string;
153
+ material?: string;
154
+ } | null;
155
+ /**
156
+ * How much of the room the browser shipped, so the worker does not build
157
+ * it twice. Normally none of the room's geometry crosses the wire.
158
+ *
159
+ * `true`: the whole stand-in is in the GLB, the shell, the stand and the
160
+ * furniture. A bake can then lightmap the room's own surfaces, because a
161
+ * lightmap has to land on a mesh the page holds. The worker builds only
162
+ * what the stand-in cannot carry: the sky, the sun, the portals, the
163
+ * foliage outside the glass, the fixtures' light and the panes.
164
+ *
165
+ * `'stand'`: only the stand is in the GLB, and the worker builds the room
166
+ * around it at full quality. This is what a bake into a prebaked room
167
+ * asks for: that bake lightmaps nothing of the room but the stand, so the
168
+ * light bouncing around the product should come off the real room, not
169
+ * off the browser's compressed preview of it.
170
+ */
171
+ standIn?: boolean | 'stand';
172
+ /**
173
+ * The HDRI outside the windows: an `HDRI_PRESETS` name to put another map
174
+ * there than the room's published one for this mode, turned so its sun
175
+ * sits where the room's sun is; `null` for nothing outside (the mode's
176
+ * plain sky); absent keeps the room's own. In day and golden the room's
177
+ * sun lamp still casts the direct light; the map is the sky's light and
178
+ * the view, projected onto the ground.
179
+ */
180
+ hdri?: string | null;
181
+ /**
182
+ * Pictures of the developer's own in the room's frames, one entry per
183
+ * picture the room hangs, in the order it hangs them. A `sha256:` asset
184
+ * hash puts that image in that frame; `null` or a short list leaves the
185
+ * rest as published.
186
+ *
187
+ * The frame does not move. A picture's moulding, its passepartout and the
188
+ * opening they leave were built to the published image's shape, and the
189
+ * browser shows that geometry while the developer frames the shot, so a
190
+ * replacement is cropped to fill the opening (the way `object-fit: cover`
191
+ * fills a box) rather than resizing the frame around it.
192
+ */
193
+ pictures?: (string | null)[];
194
+ /** The room group's world matrix, three.js column-major. */
195
+ matrix: Matrix4;
196
+ };
197
+
198
+ /**
199
+ * One node. `inputs` are ids of earlier nodes: the array arrives
200
+ * topologically sorted, so the worker builds it in one pass. Constants are
201
+ * nodes too, so every input is a reference and nothing is written twice.
202
+ */
203
+ type ShaderGraphNode = {
204
+ id: string;
205
+ op: string;
206
+ inputs?: string[];
207
+ params?: Record<string, number | string | boolean | number[]>;
208
+ };
209
+ /**
210
+ * Which BSDF slot a graph output drives. Everything not listed here falls
211
+ * back to the material's static properties.
212
+ */
213
+ type ShaderSlot = 'color' | 'opacity' | 'alphaTest' | 'roughness' | 'metalness' | 'normal' | 'emissive' | 'ao' | 'clearcoat' | 'clearcoatRoughness' | 'sheen' | 'sheenRoughness' | 'iridescence' | 'iridescenceIOR' | 'iridescenceThickness' | 'transmission' | 'thickness' | 'ior' | 'specularIntensity' | 'specularColor' | 'anisotropy';
214
+ type ShaderGraph = {
215
+ version: number;
216
+ /** Topologically sorted: a node's inputs always precede it. */
217
+ nodes: ShaderGraphNode[];
218
+ /** Which node feeds which BSDF slot. */
219
+ outputs: Partial<Record<ShaderSlot, string>>;
220
+ };
221
+ /**
222
+ * The static, non-graph half of the material: plain PBR values for every
223
+ * slot no node drives. Captured in full because the glTF exporter does not
224
+ * understand node materials, so the worker rebuilds this material from
225
+ * scratch rather than patching whatever the exporter guessed.
226
+ */
227
+ type ShaderMaterialProperties = {
228
+ color?: string;
229
+ roughness?: number;
230
+ metalness?: number;
231
+ emissive?: string;
232
+ emissiveIntensity?: number;
233
+ opacity?: number;
234
+ transparent?: boolean;
235
+ alphaTest?: number;
236
+ ior?: number;
237
+ transmission?: number;
238
+ thickness?: number;
239
+ attenuationColor?: string;
240
+ attenuationDistance?: number;
241
+ clearcoat?: number;
242
+ clearcoatRoughness?: number;
243
+ sheen?: number;
244
+ sheenColor?: string;
245
+ sheenRoughness?: number;
246
+ specularIntensity?: number;
247
+ specularColor?: string;
248
+ iridescence?: number;
249
+ iridescenceIOR?: number;
250
+ anisotropy?: number;
251
+ doubleSided?: boolean;
252
+ };
253
+ /**
254
+ * One node material, ready to rebuild. Matched to the mesh by the material's
255
+ * uuid, which the SDK stamps through the exporter the same way object ids
256
+ * are.
257
+ */
258
+ type MaterialShaderSpec = {
259
+ materialId: string;
260
+ name?: string;
261
+ /** Which BSDF family the material declared. */
262
+ base: 'standard' | 'physical' | 'basic';
263
+ properties?: ShaderMaterialProperties;
264
+ graph: ShaderGraph;
265
+ };
266
+
267
+ /**
268
+ * The scene manifest: a GLB plus a versioned sidecar.
269
+ *
270
+ * glTF carries geometry, materials, textures, cameras, lights, skins and
271
+ * morph targets well. What it does not carry is the state the running
272
+ * application was in at the moment somebody pressed Render: which objects
273
+ * were hidden, which of four cameras was live, what the renderer's tone
274
+ * mapping was set to, which materials the SDK could not translate and what
275
+ * the developer wants done about them. So the GLB is an asset and this is
276
+ * the contract. `protocolVersion` is versioned independently of the SDK, of
277
+ * the renderer and of the material translator, which is what makes a render
278
+ * from six months ago reproducible.
279
+ *
280
+ * Everything here is JSON (no class instances, no functions) because it
281
+ * travels from the browser through the control plane to the render worker
282
+ * and is stored verbatim for replay.
283
+ */
284
+
285
+ /** `sha256:<64 hex>`: how every immutable blob is named. See asset.ts. */
286
+ type AssetHash = string;
287
+ type Vec3 = [number, number, number];
288
+ /** glTF order: x, y, z, w. Any conversion to another order happens in the worker. */
289
+ type Quat = [number, number, number, number];
290
+ type Matrix4 = number[];
291
+ /**
292
+ * The active camera.
293
+ *
294
+ * Written out in full rather than referenced into the GLB by name: a live
295
+ * R3F camera is frequently not in the scene graph the exporter walked (it
296
+ * is held by `useThree`, or by drei's controls), so it travels as data.
297
+ */
298
+ type CameraSpec = {
299
+ type: 'perspective';
300
+ /** Vertical FOV in degrees, matching three's `PerspectiveCamera.fov`. */
301
+ fov: number;
302
+ /**
303
+ * The viewport's aspect ratio at capture time.
304
+ *
305
+ * The render matches vertical fov, so a wider output shows more at the
306
+ * sides rather than cropping the top and bottom. Recorded so the
307
+ * control plane can default the output to the viewport's own shape.
308
+ */
309
+ aspect?: number;
310
+ near: number;
311
+ far: number;
312
+ position: Vec3;
313
+ quaternion: Quat;
314
+ /** three's `.zoom`, which scales the projection and is easy to forget. */
315
+ zoom?: number;
316
+ /** Present when the developer named a camera; only ever a label. */
317
+ name?: string;
318
+ /** Physical-camera extras. Depth of field is off unless `fStop` is set. */
319
+ focus?: {
320
+ fStop: number;
321
+ focalDistance: number;
322
+ };
323
+ } | {
324
+ type: 'orthographic';
325
+ left: number;
326
+ right: number;
327
+ top: number;
328
+ bottom: number;
329
+ near: number;
330
+ far: number;
331
+ position: Vec3;
332
+ quaternion: Quat;
333
+ zoom?: number;
334
+ name?: string;
335
+ };
336
+ /**
337
+ * What the application had done to the scene by render time.
338
+ *
339
+ * Visibility is an explicit hidden list rather than "export only what is
340
+ * visible" on purpose: the GLB is content-addressed and cached, and a
341
+ * configurator that toggles one part between renders would otherwise miss
342
+ * the cache every time. Ship one GLB with every variant in it, then hide
343
+ * per render: the first render uploads the model, the next one uploads a
344
+ * few KB.
345
+ */
346
+ type RuntimeState = {
347
+ /** Object ids (see `objectId` in capture) the SDK found with `visible === false`. */
348
+ hiddenObjectIds?: string[];
349
+ /**
350
+ * Transform overrides, for objects the application moved after export or
351
+ * that were exported from a shared cached GLB.
352
+ */
353
+ transforms?: Array<{
354
+ objectId: string;
355
+ position?: Vec3;
356
+ quaternion?: Quat;
357
+ scale?: Vec3;
358
+ }>;
359
+ /** Morph target influences, by object. */
360
+ morphs?: Array<{
361
+ objectId: string;
362
+ influences: number[];
363
+ }>;
364
+ /** Current skeletal pose as bone-local matrices. */
365
+ poses?: Array<{
366
+ objectId: string;
367
+ boneMatrices: Matrix4[];
368
+ }>;
369
+ /**
370
+ * `InstancedMesh` transforms. Written here rather than baked into the GLB
371
+ * so changing a layout does not re-upload the geometry.
372
+ *
373
+ * `matrices` is flat: `count * 16` numbers, column-major, exactly as three
374
+ * stores `instanceMatrix.array`. Nested arrays would add two bytes of JSON
375
+ * per instance, which for a large scatter is a measurable part of the
376
+ * manifest.
377
+ */
378
+ instances?: Array<{
379
+ objectId: string;
380
+ count: number;
381
+ matrices: number[];
382
+ }>;
383
+ /**
384
+ * Opaque application state, echoed back on the render record. Never read
385
+ * by the renderer; it exists so a stored render can say which sofa.
386
+ */
387
+ productState?: Record<string, unknown>;
388
+ };
389
+ type EnvironmentSpec = {
390
+ /** An HDRI/EXR the SDK found on `scene.environment`, content-addressed. */
391
+ hdri?: AssetHash;
392
+ /** three's `Scene.environmentIntensity`. */
393
+ intensity?: number;
394
+ /** three's `Scene.environmentRotation`, radians, XYZ euler. */
395
+ rotation?: Vec3;
396
+ /**
397
+ * The scene's `AmbientLight`s as one flat term. It ADDS to the HDRI, as it
398
+ * does in three, and like three's it lights diffuse surfaces only: a
399
+ * mirror reflects the environment and nothing of this.
400
+ */
401
+ ambient?: {
402
+ color: string;
403
+ intensity: number;
404
+ };
405
+ /**
406
+ * Background. `transparent` is the default: a still that composites is
407
+ * worth more to a catalog pipeline than one with a baked backdrop.
408
+ */
409
+ background?: {
410
+ type: 'transparent';
411
+ } | {
412
+ type: 'color';
413
+ color: string;
414
+ } | {
415
+ type: 'environment';
416
+ blurriness?: number;
417
+ };
418
+ /** The scene's fog, when it has one the renderer can trace. */
419
+ fog?: FogSpec;
420
+ };
421
+ /**
422
+ * three's `FogExp2`, which the renderer traces as a volume filling the scene:
423
+ * air that scatters the light passing through it, so a lamp or an emissive
424
+ * mesh sits in a glow and throws visible beams.
425
+ *
426
+ * `density` is three's own number. three fades a surface by
427
+ * `exp(-(density · d)²)`; a real volume thins light by `exp(-σ · d)`. The
428
+ * two cannot agree at every distance, so the renderer uses σ = `density`,
429
+ * which makes them agree where three's fog has taken all but 1/e of the
430
+ * surface: nearer than that the render is a little foggier than the
431
+ * viewport, further a little clearer.
432
+ *
433
+ * `color` is the fog's TINT (`#rrggbb`, as three holds it): its hue colors
434
+ * the scattered light, its brightness is ignored. How bright traced fog
435
+ * looks is decided by the light in it, which a rasterizer's fog color has to
436
+ * guess. A linear `Fog` has no volume it corresponds to and is not carried;
437
+ * the compatibility report says so.
438
+ */
439
+ type FogSpec = {
440
+ color: string;
441
+ density: number;
442
+ };
443
+ /**
444
+ * Lights the SDK lifted out of the scene graph.
445
+ *
446
+ * Exported here as well as in the GLB because glTF's punctual-lights
447
+ * extension has no notion of three's intensity-unit drift, no area lights
448
+ * and no IES. The sidecar is where the good version lives and the GLB copy
449
+ * is the fallback.
450
+ */
451
+ type LightSpec = {
452
+ objectId: string;
453
+ type: 'directional' | 'point' | 'spot' | 'area' | 'hemisphere';
454
+ color: string;
455
+ /**
456
+ * three's own value, unconverted. The worker owns the unit conversion so
457
+ * the physics is written down in one place.
458
+ */
459
+ intensity: number;
460
+ /**
461
+ * World position. A hemisphere light's is its up axis instead (three
462
+ * normalizes it; absent is `[0, 1, 0]`).
463
+ */
464
+ position?: Vec3;
465
+ /**
466
+ * World point a directional, spot or area light aims at, as three's
467
+ * `light.target` (or `lookAt`) does. Absent aims a directional or spot
468
+ * light at the origin and leaves an area light facing straight down.
469
+ */
470
+ target?: Vec3;
471
+ /**
472
+ * Hemisphere lights only: the color from below (`groundColor`). `color` is
473
+ * the sky. Absent is black, a sky with no ground bounce.
474
+ */
475
+ groundColor?: string;
476
+ distance?: number;
477
+ decay?: number;
478
+ angle?: number;
479
+ penumbra?: number;
480
+ /** Area lights only, in world units. */
481
+ size?: {
482
+ width: number;
483
+ height: number;
484
+ };
485
+ /** Angular diameter in degrees: the shadow-softness dial for a sun. */
486
+ angleDeg?: number;
487
+ /** An IES profile, content-addressed. */
488
+ ies?: AssetHash;
489
+ castShadow?: boolean;
490
+ };
491
+ /**
492
+ * The renderer's own color settings, copied verbatim.
493
+ *
494
+ * This is the difference between a render that looks like the developer's
495
+ * app and one that is subtly, unfixably wrong. three's defaults changed in
496
+ * r152 and again in r155; reading the live renderer beats assuming any of
497
+ * them.
498
+ */
499
+ type ColorSpec = {
500
+ outputColorSpace: 'srgb' | 'srgb-linear' | 'display-p3';
501
+ toneMapping: 'none' | 'linear' | 'reinhard' | 'cineon' | 'aces-filmic' | 'agx' | 'neutral';
502
+ toneMappingExposure: number;
503
+ };
504
+ /**
505
+ * What to do with a material the renderer cannot be given honestly.
506
+ *
507
+ * Arbitrary GLSL does not translate, and the answer is to say so rather
508
+ * than quietly render gray. A fallback is the developer's explicit
509
+ * override, from `<Bakery3Material render={...}>` or from
510
+ * `material.userData.bakery3.fallback`.
511
+ */
512
+ type MaterialFallback = {
513
+ /** The material's uuid in the exported GLB. */
514
+ materialId: string;
515
+ type: 'physical';
516
+ color?: string;
517
+ metalness?: number;
518
+ roughness?: number;
519
+ clearcoat?: number;
520
+ clearcoatRoughness?: number;
521
+ transmission?: number;
522
+ thickness?: number;
523
+ ior?: number;
524
+ emissive?: string;
525
+ emissiveIntensity?: number;
526
+ opacity?: number;
527
+ sheen?: number;
528
+ sheenColor?: string;
529
+ iridescence?: number;
530
+ anisotropy?: number;
531
+ };
532
+ type CompatibilitySeverity = 'info' | 'warning' | 'error';
533
+ /**
534
+ * One thing the SDK could not promise to reproduce: what it is, where it
535
+ * lives in the tree, why, and the fix, without opening a debugger.
536
+ */
537
+ type CompatibilityIssue = {
538
+ code: string;
539
+ severity: CompatibilitySeverity;
540
+ message: string;
541
+ /** `<Car>/<Body>/<Paint>`: the path a developer can actually find. */
542
+ path?: string;
543
+ objectId?: string;
544
+ materialId?: string;
545
+ materialName?: string;
546
+ materialType?: string;
547
+ /** Deep link into the docs. */
548
+ docs?: string;
549
+ };
550
+ type CompatibilityReport = {
551
+ /** 0 to 1. Objects that will render faithfully, weighted by triangle count. */
552
+ score: number;
553
+ issues: CompatibilityIssue[];
554
+ /** Rolled up for the devtools panel and the render record. */
555
+ counts: {
556
+ info: number;
557
+ warning: number;
558
+ error: number;
559
+ };
560
+ };
561
+ /** Presets, not raw renderer settings. Most scenes need only these. */
562
+ type QualityPreset = 'preview' | 'studio' | 'ultra';
563
+ type OutputFormat = 'png' | 'jpeg' | 'webp' | 'exr' | 'mp4' | 'webm' | 'png-sequence';
564
+ /** `frames.json`, at the head of a `png-sequence` tar. */
565
+ type FrameSequenceIndex = {
566
+ fps: number;
567
+ frameCount: number;
568
+ width: number;
569
+ height: number;
570
+ bitDepth: 8 | 16;
571
+ /** In frame order, one per frame: `frameFileName(0)` onwards. */
572
+ files: string[];
573
+ };
574
+ type OutputSpec = {
575
+ width: number;
576
+ height: number;
577
+ format: OutputFormat;
578
+ /** JPEG/WebP only, 1 to 100. */
579
+ quality?: number;
580
+ /**
581
+ * PNG and `png-sequence` only: bits per channel, 16 unless 8 is asked
582
+ * for (`PNG_BIT_DEPTH_DEFAULT`).
583
+ */
584
+ bitDepth?: 8 | 16;
585
+ /** Force an opaque background even when the environment is transparent. */
586
+ opaque?: boolean;
587
+ };
588
+ /**
589
+ * Escape hatch under the presets. Present so an expert is never blocked,
590
+ * absent from the quickstart so a beginner is never asked to become a
591
+ * rendering expert to get one image.
592
+ */
593
+ type AdvancedRenderSettings = {
594
+ samples?: number;
595
+ maxBounces?: number;
596
+ diffuseBounces?: number;
597
+ glossyBounces?: number;
598
+ transmissionBounces?: number;
599
+ /** Adaptive sampling noise floor: the real cost dial once denoising is on. */
600
+ adaptiveThreshold?: number;
601
+ denoise?: boolean;
602
+ denoiser?: 'OPTIX' | 'OPENIMAGEDENOISE';
603
+ /** Pays for itself with many emitters, costs overhead with few. */
604
+ lightTree?: boolean;
605
+ /**
606
+ * Light that reaches a surface through glass: the bright pool under a
607
+ * tumbler, the focus line beneath a lens. Off by default: with no caustic
608
+ * paths a transmissive object casts a solid shadow, which is also what the
609
+ * viewport's shadow maps draw, and tracing them costs samples a product
610
+ * shot rarely needs.
611
+ *
612
+ * `'soft'` lets the path tracer find caustic paths itself, with the glossy
613
+ * filter and the indirect clamp (both of which exist to hide caustics)
614
+ * switched off. Unbiased, and slow to converge: a hard light through
615
+ * curved glass stays grainy at studio samples.
616
+ *
617
+ * `'sharp'` adds a dedicated shadow-caustic solver on top: every scene
618
+ * lamp casts caustics, every transmissive mesh is a caster, and every
619
+ * other mesh (the shadow catcher included) receives them. This is what
620
+ * makes a glass on a table converge at normal sample counts. It handles a
621
+ * single refractive object between a lamp and a surface; light from an
622
+ * HDRI or an emissive mesh still goes the `'soft'` way.
623
+ *
624
+ * The solver takes over lamp light through a caster rather than adding to
625
+ * the traced paths, and it only follows light that goes straight through.
626
+ * A faceted stone, whose light leaves after internal reflections, comes
627
+ * back under `'sharp'` with no caustic at all. Cut gems want `'soft'`.
628
+ *
629
+ * Absent is off. There is no boolean on purpose: `caustics: true` would
630
+ * have to mean one of the two. Changes pixels, so it is in the cache key.
631
+ */
632
+ caustics?: 'soft' | 'sharp';
633
+ /**
634
+ * A ceiling on how bright one indirect sample may be, in scene radiance.
635
+ * Absent is the renderer's own default, which `caustics` switches off: a
636
+ * caustic's focus is a very bright indirect sample, and capping it dims
637
+ * the focus. That is right for a still and wrong for a clip, because the
638
+ * rare uncapped hit lands on different pixels every frame, the denoiser
639
+ * smears each one into a soft patch, and the patches boil. For caustics
640
+ * in motion, start at 30 (the pool under a lens is still its full
641
+ * brightness there) and trace larger than you publish.
642
+ *
643
+ * Set, it wins over what `caustics` would have chosen. Changes pixels, so
644
+ * it is in the cache key, present only when set.
645
+ */
646
+ clampIndirect?: number;
647
+ /**
648
+ * Multiplies the converted energy of every light lifted from the scene
649
+ * graph (directional, point, spot, area and the ambient dome) and leaves
650
+ * the HDRI environment alone. The worker's unit table is physics and stays
651
+ * fixed; this dial is for the residual gap, where a viewport (legacy-lights
652
+ * intensities, usually) reads brighter than the physically converted lamps
653
+ * do. One scalar, so the ratio between the scene's lights is preserved.
654
+ * Default 1. Changes pixels, so it is in the cache key.
655
+ */
656
+ lightScale?: number;
657
+ /**
658
+ * Ground the product with a traced shadow catcher. Defaults on for
659
+ * transparent/solid output and off for a visible environment background.
660
+ */
661
+ shadowCatcher?: boolean;
662
+ /** Catcher size, as a multiple of the model's largest dimension. */
663
+ shadowPad?: number;
664
+ /**
665
+ * The renderer's view transform override. Changes pixels, so it is in the
666
+ * cache key. Pinning one also switches off `toneCurveEmulation`: an
667
+ * explicit name is a statement about what the render should look like.
668
+ */
669
+ viewTransform?: string;
670
+ /**
671
+ * Reproduce three's tone mapping exactly instead of substituting the
672
+ * nearest native view transform. On by default, and it is what makes a
673
+ * traced frame the same color as the viewport it came from.
674
+ *
675
+ * Turn it off to get the substitution: a wider, more forgiving curve for a
676
+ * scene whose viewport was never the reference. Changes pixels, so it is
677
+ * in the cache key.
678
+ */
679
+ toneCurveEmulation?: boolean;
680
+ /** Seconds. The worker stops the render rather than billing an unbounded job. */
681
+ timeoutSeconds?: number;
682
+ };
683
+ /**
684
+ * Everything one render needs, minus the bytes.
685
+ *
686
+ * Typically a few KB. The heavy things (the GLB, textures, the HDRI) are
687
+ * `sha256:` references that the control plane resolves against storage the
688
+ * SDK already filled (see asset.ts).
689
+ */
690
+ type SceneManifest = {
691
+ protocolVersion: string;
692
+ sdkVersion: string;
693
+ /** The exported GLB. */
694
+ sceneAsset: AssetHash;
695
+ /**
696
+ * Extra blobs this scene needs that are not inside the GLB: an HDRI, an
697
+ * IES profile, a texture the SDK stripped out to keep the GLB cacheable.
698
+ */
699
+ assets?: AssetHash[];
700
+ camera: CameraSpec;
701
+ runtime?: RuntimeState;
702
+ environment?: EnvironmentSpec;
703
+ lights?: LightSpec[];
704
+ color: ColorSpec;
705
+ fallbacks?: MaterialFallback[];
706
+ /**
707
+ * Node materials, as portable shader graphs (see shader.ts). The GLB still
708
+ * carries the mesh; the material the exporter wrote for it is a stand-in
709
+ * that the worker replaces wholesale with the rebuilt graph.
710
+ */
711
+ shaders?: MaterialShaderSpec[];
712
+ /**
713
+ * Baked per-frame motion (see animation.ts). Present only for a video,
714
+ * and its presence is what makes this a 3.0 manifest.
715
+ *
716
+ * Not inside `runtime` on purpose: runtime is the one state the
717
+ * application was in when Render was pressed, and every field in it is a
718
+ * single value. A sequence is a different kind of thing.
719
+ */
720
+ animation?: AnimationSpec;
721
+ /**
722
+ * A room preset around the product (see room.ts). Its geometry, lights
723
+ * and sky are not in the GLB or in `lights`: the worker rebuilds all of it
724
+ * from the published definition, so a product in a room uploads only the
725
+ * product. Presence makes this a 4.0 manifest.
726
+ */
727
+ room?: RoomPresetSpec;
728
+ compatibility?: CompatibilityReport;
729
+ /**
730
+ * What the scene weighs, measured by the SDK at capture. The control plane
731
+ * prices with it (a dense scene traces slower per pixel and unwraps slower
732
+ * per object), so the quote a job is accepted under is the same one
733
+ * `estimate()` gave with the same numbers. Operational, not visual: it is
734
+ * outside every cache key.
735
+ */
736
+ stats?: {
737
+ triangles: number;
738
+ /** Bytes of texture the manifest's shader graphs sample, when known. */
739
+ textureBytes?: number;
740
+ /**
741
+ * Distinct materials that emit light: a standard material with a
742
+ * non-black emissive color, an unlit material (rendered as emission), or
743
+ * a node material with an emission graph. The worker turns its light
744
+ * tree on from this. Only the SDK can count them, since the GLB's
745
+ * materials are opaque to the control plane.
746
+ */
747
+ emitters?: number;
748
+ /**
749
+ * How much of the sky above the camera the scene's geometry hides, 0 for
750
+ * an open set and 1 inside a closed room (`SceneComplexity`). Walls keep
751
+ * light bouncing, which is most of what makes an interior slow to render,
752
+ * so the quote reads it. A preset room's stand-in counts, though it is not
753
+ * uploaded: it stands for the room the renderer builds.
754
+ */
755
+ enclosure?: number;
756
+ /** Meshes the scene draws, instances counted: how full it is. */
757
+ objects?: number;
758
+ };
759
+ /**
760
+ * Where the scene came from. Diagnostics only, but "which three version"
761
+ * is the first question every support conversation starts with.
762
+ */
763
+ source?: {
764
+ three?: string;
765
+ r3f?: string;
766
+ renderer?: string;
767
+ userAgent?: string;
768
+ };
769
+ };
770
+ /** A manifest plus what to make from it. This is the render request body. */
771
+ type RenderSpec = {
772
+ manifest: SceneManifest;
773
+ quality: QualityPreset;
774
+ output: OutputSpec;
775
+ advanced?: AdvancedRenderSettings;
776
+ /**
777
+ * Hard ceiling in USD. Exceeded at estimate time means the job is refused
778
+ * before it is admitted: `RenderBudgetExceeded`, not a surprise bill.
779
+ */
780
+ maxCost?: number;
781
+ /** Emit a low-sample preview partway through. On by default for `studio`. */
782
+ preview?: boolean;
783
+ /** Echoed on the render record and every webhook. */
784
+ metadata?: Record<string, unknown>;
785
+ /**
786
+ * A resubmit with the same key returns the existing render while it is
787
+ * running or once it has completed, never a second charge. This is what
788
+ * makes the SDK's own retries safe. A key whose render failed, was
789
+ * cancelled or expired is free again: nothing was charged, and the
790
+ * resubmit renders.
791
+ */
792
+ idempotencyKey?: string;
793
+ /**
794
+ * `high` puts this render ahead of the account's other waiting work in
795
+ * the same lane: the hero shot before the rest of the queue. It never
796
+ * jumps a lane; a person waiting still goes first.
797
+ */
798
+ priority?: 'normal' | 'high';
799
+ };
800
+
801
+ /**
802
+ * How good a bake should be. The worker chooses sample counts and margins
803
+ * from this, the way `QualityPreset` maps to `QualitySettings`.
804
+ */
805
+ type BakeQuality = 'preview' | 'standard' | 'high';
806
+ /** The sides a lightmap or a stand-in texture may have, in texels. */
807
+ declare const BAKE_TEXTURE_SIZES: readonly [256, 512, 1024, 2048];
808
+ type BakeTextureSize = (typeof BAKE_TEXTURE_SIZES)[number];
809
+ /** Atlas sides. 4096² is 16.8M texels, inside the texel ceiling on its own. */
810
+ declare const BAKE_ATLAS_SIZES: readonly [1024, 2048, 4096];
811
+ type BakeAtlasSize = (typeof BAKE_ATLAS_SIZES)[number];
812
+ /**
813
+ * One lightmap for every baked object, rather than one each.
814
+ *
815
+ * A room of sixty objects lit from sixty textures is sixty texture binds and
816
+ * sixty downloads; lit from one atlas it is one of each, which is what an
817
+ * interactive scene wants. The atlas holds the same texels the separate maps
818
+ * would, and is priced as they are.
819
+ *
820
+ * Every object is baked into a square of its own: the side its world-space
821
+ * surface earns, capped by `textureSize` and `sizes` as usual, times the
822
+ * square root of its `weight`, rounded to a power of two. The squares are
823
+ * laid into the map with no waste, and the map is filled: when the squares
824
+ * would cover under a quarter of it every side doubles, and when they would
825
+ * not fit the largest are halved until they do. So `textureSize`, `sizes`
826
+ * and `weights` set relative shares, kept to within a power of two, and
827
+ * `size` sets the texels there are to share.
828
+ *
829
+ * A hero product is `weights: { [heroId]: 4 }`: twice the side and four times
830
+ * the area its surface alone would earn. Weights round to the nearest power
831
+ * of two in side: 1.5 to 2.8 doubles it, 2.9 to 5.6 quadruples it.
832
+ */
833
+ type BakeAtlas = {
834
+ size: BakeAtlasSize;
835
+ /** Per-object density multipliers, keyed by objectId. Default 1. */
836
+ weights?: Record<string, number>;
837
+ };
838
+ /**
839
+ * What a group of objects is replaced with in the baked scene.
840
+ *
841
+ * A lightmap keeps the developer's geometry and changes its light. That is
842
+ * right for a product and wrong for a bookcase of forty books at the back of
843
+ * the room: forty draw calls, forty lightmaps and forty unwraps to light
844
+ * something the viewer reads as one lit shape. A stand-in is that one shape,
845
+ * with the detail it lost baked on: the color of the surface it replaces, a
846
+ * normal map for the relief it no longer has, and the irradiance traced at
847
+ * the real surface. The real objects stay in the traced scene, so they still
848
+ * cast their shadows and bounce their light onto everything else; they are
849
+ * only absent from what is delivered.
850
+ *
851
+ * `'lowpoly'` the objects, shrink-wrapped into one skin and reduced to
852
+ * `triangles`. The default.
853
+ * `'box'` the box round them, turned about the vertical to fit.
854
+ * Right for anything that reads as a box from where it is
855
+ * seen: a bookcase, a cabinet, a radiator.
856
+ * `'billboard'` one upright picture of them that turns to face the
857
+ * camera. For a potted plant: half a million triangles of
858
+ * leaves that no lightmap suits and no box resembles.
859
+ * `{ objectId }` a mesh of the developer's own, in the captured scene and
860
+ * hidden (so nothing traces it), used as the stand-in's
861
+ * shape exactly as authored.
862
+ * `'decimate'` one object, the same object with fewer triangles: its own
863
+ * parts, silhouette, texture uvs and materials kept, reduced
864
+ * to `triangles` by collapsing edges. For the product itself
865
+ * (a 146k-triangle shoe), where a skin would melt laces and
866
+ * eyelets together and a baked color would turn metal and
867
+ * gloss into paint. Only its light is baked, in one pass at
868
+ * the real surface; the stand-in wears the replaced object's
869
+ * own materials at their own resolution. One entry per
870
+ * object.
871
+ */
872
+ type BakeSimplifyTo = 'lowpoly' | 'box' | 'billboard' | 'decimate' | {
873
+ objectId: string;
874
+ };
875
+ type BakeSimplify = {
876
+ /**
877
+ * objectIds the stand-in replaces. They are not in `include`: a replaced
878
+ * object gets no lightmap of its own, which is where the saving is.
879
+ */
880
+ objects: string[];
881
+ to: BakeSimplifyTo;
882
+ /** `'lowpoly'` only: the triangle budget. Default `BAKE_SIMPLIFY_TRIANGLES`. */
883
+ triangles?: number;
884
+ /** The stand-in's texture side. Default `textureSize`. */
885
+ textureSize?: BakeTextureSize;
886
+ };
887
+ /**
888
+ * A plane under the baked objects carrying the difference they make to the
889
+ * light on it, and nothing else.
890
+ *
891
+ * A preset room is the same room for every customer, so its lightmaps are a
892
+ * library asset, baked once and served from the preset library
893
+ * (`BakeBundle.room`). What that prebaked room cannot know is the product
894
+ * standing in it: the contact shadow under a vase is what makes it look like
895
+ * it is in the room rather than pasted over it.
896
+ *
897
+ * So the bake traces one small plane just above the floor twice, with the
898
+ * product and its stand present and again with them hidden, and ships the
899
+ * ratio: 1 where they changed nothing, darker where they blocked light. The
900
+ * viewer lays it over the floor and multiplies. A ratio, not irradiance,
901
+ * because it has to compose with a floor lightmap traced at another time and
902
+ * another resolution.
903
+ *
904
+ * It only darkens. Light the product throws onto the floor (a red vase's
905
+ * bounce) is in neither the prebaked room nor this plane; that is the
906
+ * approximation this mode makes.
907
+ */
908
+ type BakeShadow = {
909
+ /**
910
+ * Scene units, Y-up: the plane's centre, on the surface it lies over.
911
+ *
912
+ * Absent is the usual case: the worker measures the footprint of whatever
913
+ * casts, then finds the surface beneath with rays cast straight down and
914
+ * the casters hidden. A plinth is often modelled a centimetre into the
915
+ * floor, so the bottom of its bounds is inside the slab, where a plane
916
+ * would be lit in neither trace.
917
+ */
918
+ center?: [number, number, number];
919
+ /**
920
+ * Metres. Absent takes the casters' footprint plus the room a shadow needs
921
+ * to spread into.
922
+ */
923
+ width?: number;
924
+ height?: number;
925
+ /**
926
+ * How far above the surface the plane sits, in metres. Small enough to
927
+ * read as contact, large enough that nothing z-fights with the floor.
928
+ */
929
+ lift?: number;
930
+ /** Texels a side. Default `BAKE_SHADOW_SIZE`. */
931
+ textureSize?: BakeTextureSize;
932
+ /**
933
+ * objectIds whose shadow this is: hidden for the second trace. Absent
934
+ * means every object the bake includes.
935
+ */
936
+ cast?: string[];
937
+ /**
938
+ * objectIds the plane is placed beneath and sized to cover. Absent means
939
+ * the casters, which is the usual case.
940
+ *
941
+ * The two lists come apart when a product stands on something this bake is
942
+ * lightmapping anyway. A vase on a plinth casts on the plinth's top, and
943
+ * the plinth's own lightmap carries that. What the plinth must not do is
944
+ * cast into this plane: the prebaked room was lit with the plinth standing
945
+ * in it, so its shadow is already on that floor, and casting it again
946
+ * would lay it down twice.
947
+ *
948
+ * So the plinth spans but does not cast. It is present in both traces and
949
+ * divides out of the ratio exactly, leaving only what the vase adds; and
950
+ * because it is hidden while the surface beneath is looked for, the plane
951
+ * still lands on the floor rather than on the plinth's top.
952
+ */
953
+ spans?: string[];
954
+ };
955
+ /**
956
+ * What the bake produced for `BakeSettings.shadow`.
957
+ *
958
+ * `uri` is a ratio in 0..1 per channel, linear, one value per texel: what
959
+ * fraction of the light still arrives with the product there. Lay the plane
960
+ * at `center` + `lift` on its up axis, map this across it, and multiply.
961
+ */
962
+ type BakedShadow = {
963
+ uri: string;
964
+ format: 'exr' | 'png';
965
+ size: number;
966
+ center: [number, number, number];
967
+ width: number;
968
+ height: number;
969
+ lift: number;
970
+ /**
971
+ * The darkest ratio in the map, for a panel and for a sanity check: a
972
+ * shadow that came out 1.0 everywhere means nothing was cast.
973
+ */
974
+ darkest: number;
975
+ };
976
+ /**
977
+ * What to bake and how well.
978
+ *
979
+ * `include` is explicit and authoritative: the SDK decides which objects can
980
+ * take a lightmap (it can see the live materials; the worker cannot) and the
981
+ * worker bakes exactly that list. An id the worker cannot find is a refusal
982
+ * with the id and a fix, never a silent skip.
983
+ */
984
+ type BakeSettings = {
985
+ quality: BakeQuality;
986
+ /**
987
+ * Per-object resolution ceiling. The worker may choose a smaller size for
988
+ * a small object (by world-space surface area) so a screw does not cost
989
+ * what a wall costs. It never chooses larger.
990
+ */
991
+ textureSize: BakeTextureSize;
992
+ /** objectIds to bake, from the same id space as `RuntimeState`. */
993
+ include: string[];
994
+ /** Per-object override of `textureSize`, keyed by objectId. */
995
+ sizes?: Record<string, BakeTextureSize>;
996
+ /**
997
+ * Bake every object into one shared lightmap of `atlas.size`² texels
998
+ * instead of one texture each: see `BakeAtlas`. `textureSize` and `sizes`
999
+ * then set each object's relative share of the map rather than its own
1000
+ * texture.
1001
+ */
1002
+ atlas?: BakeAtlas;
1003
+ /** Seam dilation in pixels. Default 4. */
1004
+ margin?: number;
1005
+ /**
1006
+ * Also produce the portable baked GLB: every baked object with an unlit
1007
+ * material (`KHR_materials_unlit`) whose one texture is the finished
1008
+ * surface (color, direct and bounced light, reflections as seen from
1009
+ * `view`, through the scene's tone curve). Loads anywhere with no lights
1010
+ * and no SDK. A second bake pass per object, so it roughly doubles GPU
1011
+ * time and is opt-in.
1012
+ */
1013
+ deliverGlb?: boolean;
1014
+ /**
1015
+ * Objects whose `uv1` is the developer's own layout, not one a previous
1016
+ * bake wrote. Present, the worker may use an object's own layout instead
1017
+ * of unwrapping it: its `uv1` when listed here, its texture `uv` when the
1018
+ * mesh is too fragmented or too dense to unwrap well. Either is used only
1019
+ * when it passes the worker's test (inside the unit square, no stacked
1020
+ * islands, enough texels an island, an even density), and the result says
1021
+ * so with `BakeUv` `channel`. Absent, every object is unwrapped.
1022
+ */
1023
+ existingUv?: {
1024
+ uv1: string[];
1025
+ };
1026
+ /**
1027
+ * Where the scene is looked at from, for seam placement only.
1028
+ *
1029
+ * The unwrap puts island boundaries on the side of each object that faces
1030
+ * away from this point, on its underside, or where it is hidden behind
1031
+ * other geometry, never across the surface this viewpoint sees. Nothing
1032
+ * about the lighting depends on it.
1033
+ *
1034
+ * It is not the manifest camera. The camera is excluded from the bake
1035
+ * cache key so that orbiting and baking again is free, and a seam layout
1036
+ * that followed the exact camera would make every orbit a re-cut. The SDK
1037
+ * sends the camera quantized (`quantizeBakeView`): direction in 30° steps,
1038
+ * distance in octaves around the baked objects, so nearby viewpoints share
1039
+ * a bake and only a real change of side re-cuts.
1040
+ *
1041
+ * Absent: seams prefer the underside and hard edges alone.
1042
+ */
1043
+ view?: BakeView;
1044
+ /**
1045
+ * Where the reflection probe is taken, and what is hidden from it.
1046
+ *
1047
+ * Every bake delivers one. The lightmap replaces a baked surface's
1048
+ * diffuse, but the objects the bake is for (the product kept live on its
1049
+ * plinth, so it can turn and change finish) still reflect the scene's own
1050
+ * environment map, which in a baked room is not the room. The probe is the
1051
+ * room as seen from where those objects stand, with those objects hidden
1052
+ * so they do not reflect themselves, and the SDK puts it on their
1053
+ * materials as `envMap`.
1054
+ *
1055
+ * The SDK decides both fields: the objects it hides are the ones that
1056
+ * could have been baked and were deliberately left out. An object that
1057
+ * cannot take a lightmap at all (a glass sphere, an instanced hedge) is
1058
+ * scenery and stays in the map, so the product reflects the glass beside
1059
+ * it. Absent, the worker takes the probe from the center of the baked
1060
+ * objects and hides nothing.
1061
+ */
1062
+ probe?: BakeProbe;
1063
+ /**
1064
+ * Groups of objects to deliver as a stand-in rather than light as they
1065
+ * are: see `BakeSimplify`. In request order; stand-in `n` of the bundle is
1066
+ * entry `n` here.
1067
+ */
1068
+ simplify?: BakeSimplify[];
1069
+ /**
1070
+ * Trace a shadow plane under the baked objects: see `BakeShadow`. What a
1071
+ * bake of a product standing in a prebaked room needs, and the only part
1072
+ * of that room the bake has to pay for.
1073
+ */
1074
+ shadow?: BakeShadow;
1075
+ /**
1076
+ * How a preset room in the scene is lit.
1077
+ *
1078
+ * `'full'` (the default) bakes the room's own surfaces along with
1079
+ * everything else.
1080
+ *
1081
+ * `'preset'` says the room is unmodified, so its lightmaps are a library
1082
+ * asset and this bake covers only what the library cannot know: the
1083
+ * product, the stand it is on, and the shadow it casts. The SDK only asks
1084
+ * for it when the room really is unmodified, and the worker records which
1085
+ * room the result stands on (`BakeBundle.room`).
1086
+ */
1087
+ room?: 'full' | 'preset';
1088
+ };
1089
+ /** A viewpoint, in the scene's own (Y-up, meters) coordinates. */
1090
+ type BakeView = {
1091
+ position: [number, number, number];
1092
+ };
1093
+ /** The reflection probe's request: where, and what not to see. */
1094
+ type BakeProbe = {
1095
+ /** Scene units, Y-up: the center of the objects the probe is for. */
1096
+ position: [number, number, number];
1097
+ /** objectIds hidden from the probe: the objects it will be applied to. */
1098
+ hide: string[];
1099
+ };
1100
+ /**
1101
+ * A manifest plus what to bake from it: the bake request body. The manifest
1102
+ * is the ordinary capture, camera included but unused by the bake itself, so
1103
+ * two captures that differ only by viewpoint hit the same bake cache entry.
1104
+ */
1105
+ type BakeSpec = {
1106
+ manifest: SceneManifest;
1107
+ bake: BakeSettings;
1108
+ advanced?: {
1109
+ timeoutSeconds?: number;
1110
+ };
1111
+ /**
1112
+ * Triangles in the objects `bake.include` names, for the quote only.
1113
+ *
1114
+ * The estimate has two triangle terms: syncing the whole scene (priced from
1115
+ * the manifest's own count) and unwrapping the objects being baked (priced
1116
+ * from this). Without it the unwrap term is priced against the whole
1117
+ * scene, which over-quotes a partial bake of a big room. The SDK sends it;
1118
+ * a request without it is quoted the higher way.
1119
+ *
1120
+ * Deliberately not inside `bake`: that object is the bake cache key, and a
1121
+ * number that only moves a price must not move what is cached.
1122
+ */
1123
+ bakedTriangles?: number;
1124
+ /**
1125
+ * Hard ceiling in USD, refused at estimate time. The same contract as
1126
+ * `RenderSpec.maxCost`.
1127
+ */
1128
+ maxCost?: number;
1129
+ metadata?: Record<string, unknown>;
1130
+ idempotencyKey?: string;
1131
+ };
1132
+ /**
1133
+ * The second UV set for one object, in the live geometry's own vertex order.
1134
+ *
1135
+ * `values` alone: `2 * vertexCount` floats, writable straight into a `uv1`
1136
+ * BufferAttribute on the existing geometry. The common case, and the one
1137
+ * that leaves the developer's geometry object untouched.
1138
+ *
1139
+ * `topology`: the unwrap needed vertex splits. `vertexSource[i]` names the
1140
+ * original vertex that new vertex `i` was copied from, so every original
1141
+ * attribute (custom ones included) can be gathered through it and nothing
1142
+ * the developer authored is lost in the rebuild. `index` is the new triangle
1143
+ * list over the new vertices.
1144
+ */
1145
+ type BakeUv = {
1146
+ values: number[];
1147
+ } | {
1148
+ topology: {
1149
+ vertexSource: number[];
1150
+ index: number[];
1151
+ values: number[];
1152
+ };
1153
+ }
1154
+ /**
1155
+ * The lightmap is laid on a uv set the mesh already has: `0` is its
1156
+ * texture uv (three's `uv`, glTF `TEXCOORD_0`), `1` its second set (`uv1`,
1157
+ * `TEXCOORD_1`). Nothing is shipped and nothing is rebuilt: the SDK points
1158
+ * the lightmap at that attribute (`texture.channel`). Such a lightmap is
1159
+ * written in the glTF orientation (v = 0 at the top), the one the
1160
+ * attribute is in; every unwrap the worker ships itself is bottom-up.
1161
+ * Only sent to an SDK that asked for it (`BakeSettings.existingUv`).
1162
+ */
1163
+ | {
1164
+ channel: 0 | 1;
1165
+ };
1166
+ /**
1167
+ * One baked object. `uri` is resolved against the bundle's own location: a
1168
+ * relative path on disk, an absolute URL from a server.
1169
+ */
1170
+ type BakedObject = {
1171
+ objectId: string;
1172
+ /** The object's name at capture time, for humans reading a bundle. */
1173
+ name?: string;
1174
+ /** HDR diffuse irradiance (direct + indirect, no albedo), linear. */
1175
+ lightmap: {
1176
+ uri: string;
1177
+ format: 'exr' | 'png';
1178
+ size: number;
1179
+ };
1180
+ /** Small LDR thumbnail for pickers and panels. */
1181
+ preview?: {
1182
+ uri: string;
1183
+ };
1184
+ uv: BakeUv;
1185
+ /**
1186
+ * How the surface was cut, measured by the worker, so a panel can say
1187
+ * "2 islands, seams out of view" and mean it.
1188
+ *
1189
+ * `cut: 'hidden'` is the viewpoint-aware layout; `'angle'` is the plain
1190
+ * angle-limited fallback, used when the hidden-seam layout failed its
1191
+ * checks for this object (the job log says so too). `seamsInView` is the
1192
+ * fraction of seam length across smooth surface whose both sides face
1193
+ * `BakeSettings.view`; 0 is the goal. Seams on creases are not counted,
1194
+ * because they do not show.
1195
+ */
1196
+ layout?: {
1197
+ islands: number;
1198
+ seamsInView?: number;
1199
+ /**
1200
+ * `'uv0'`/`'uv1'`: the object's own uv set, chosen over an unwrap
1201
+ * because it passed the worker's layout test.
1202
+ */
1203
+ cut: 'hidden' | 'angle' | 'uv0' | 'uv1';
1204
+ };
1205
+ /**
1206
+ * In an atlas bake: the fraction of the shared map this object's islands
1207
+ * cover, which is what its budget and weight actually bought it.
1208
+ */
1209
+ atlasShare?: number;
1210
+ };
1211
+ /**
1212
+ * One stand-in, ready to be put in the scene: see `BakeSimplify`.
1213
+ *
1214
+ * A mesh carries its geometry inline, in the scene's own coordinates (world
1215
+ * space, Y-up, meters), because it is a few hundred vertices and a loader
1216
+ * for it would weigh more than it does. `uv` is the one unwrap every map
1217
+ * uses. `tangent` (xyzw) is the frame the normal map was baked in; a viewer
1218
+ * that derives tangents from uv derivatives instead will be close, not
1219
+ * exact. `color` is an sRGB PNG and `normal` a linear one, both the right
1220
+ * way up for an ordinary image loader (`flipY` on); `lightmap` follows the
1221
+ * lightmap contract above.
1222
+ *
1223
+ * A billboard is an upright rectangle `width` by `height` centered on
1224
+ * `center`, to be turned about the vertical to face the camera, and `map` is
1225
+ * linear radiance with alpha: the objects as traced from `BakeSettings.view`'s
1226
+ * side, lit by the whole scene, with everything else cut away. It goes
1227
+ * through the viewer's own tone mapping like everything around it.
1228
+ */
1229
+ type BakedProxy = {
1230
+ kind: 'mesh';
1231
+ /** Index into `settings.simplify`. */
1232
+ index: number;
1233
+ replaces: string[];
1234
+ name?: string;
1235
+ geometry: {
1236
+ position: number[];
1237
+ normal: number[];
1238
+ uv: number[];
1239
+ tangent?: number[];
1240
+ index: number[];
1241
+ };
1242
+ color: {
1243
+ uri: string;
1244
+ };
1245
+ normal: {
1246
+ uri: string;
1247
+ };
1248
+ lightmap: {
1249
+ uri: string;
1250
+ format: 'exr';
1251
+ size: number;
1252
+ };
1253
+ /** The replaced surfaces' roughness and metalness, area weighted. */
1254
+ roughness: number;
1255
+ metalness: number;
1256
+ layout?: BakedObject['layout'];
1257
+ } | {
1258
+ /** `to: 'decimate'`: the replaced object with fewer triangles. */
1259
+ kind: 'decimated';
1260
+ index: number;
1261
+ /** The one object it replaces, whose materials it wears. */
1262
+ replaces: [string];
1263
+ name?: string;
1264
+ /**
1265
+ * In the scene's frame, like a mesh stand-in's. `uv` is the object's
1266
+ * own texture uv, carried through the decimation, in the glTF
1267
+ * orientation its texture maps expect; `uv1` is present when the
1268
+ * lightmap needed an unwrap of its own. `groups` are its material
1269
+ * slots, in the order of the replaced mesh's materials.
1270
+ */
1271
+ geometry: {
1272
+ position: number[];
1273
+ normal: number[];
1274
+ uv: number[];
1275
+ uv1?: number[];
1276
+ /** Its vertex colors (glTF COLOR_0), linear RGB, when it had them. */
1277
+ color?: number[];
1278
+ index: number[];
1279
+ groups?: Array<{
1280
+ start: number;
1281
+ count: number;
1282
+ materialIndex: number;
1283
+ }>;
1284
+ };
1285
+ lightmap: {
1286
+ uri: string;
1287
+ format: 'exr';
1288
+ size: number;
1289
+ };
1290
+ /** The uv set the lightmap reads: 0 is `uv`, 1 is `uv1`. */
1291
+ lightmapChannel: 0 | 1;
1292
+ triangles: {
1293
+ from: number;
1294
+ to: number;
1295
+ };
1296
+ layout?: BakedObject['layout'];
1297
+ } | {
1298
+ kind: 'billboard';
1299
+ index: number;
1300
+ replaces: string[];
1301
+ name?: string;
1302
+ center: [number, number, number];
1303
+ width: number;
1304
+ height: number;
1305
+ map: {
1306
+ uri: string;
1307
+ format: 'exr';
1308
+ width: number;
1309
+ height: number;
1310
+ };
1311
+ };
1312
+ /**
1313
+ * An object the bake did not produce, with the reason and the fix, per
1314
+ * object: "the bake finished" must never quietly mean "except for the glass
1315
+ * and the instanced chairs".
1316
+ */
1317
+ type BakeSkip = {
1318
+ objectId: string;
1319
+ name?: string;
1320
+ code: string;
1321
+ message: string;
1322
+ why?: string;
1323
+ fix?: string;
1324
+ /**
1325
+ * The object was baked; this is a complaint about how well.
1326
+ *
1327
+ * An ordinary entry here means a lightmap was not made and the object is
1328
+ * still lit the way it was. A `warning` means one was made and is worse
1329
+ * than it should be. `BakeCoarseUnwrap` is the case: a surface whose
1330
+ * geometry is far finer than the map it earns cuts into more islands than
1331
+ * the map has room for, and the result is padding with a little light in
1332
+ * it.
1333
+ */
1334
+ warning?: true;
1335
+ };
1336
+ /**
1337
+ * Everything one bake produced. The bundle file is written last, so an
1338
+ * interrupted bake never looks finished.
1339
+ */
1340
+ type BakeBundle = {
1341
+ bundleVersion: 1;
1342
+ /** The `BAKE_VERSION` that produced this. */
1343
+ bakeVersion: number;
1344
+ settings: BakeSettings;
1345
+ objects: BakedObject[];
1346
+ skipped: BakeSkip[];
1347
+ /**
1348
+ * When `settings.atlas` was set: the one lightmap every object's
1349
+ * `lightmap.uri` names, so a loader can fetch it once and share it. Each
1350
+ * object's `uv` is already in the atlas's space.
1351
+ */
1352
+ atlas?: {
1353
+ uri: string;
1354
+ format: 'exr' | 'png';
1355
+ size: number;
1356
+ preview?: {
1357
+ uri: string;
1358
+ };
1359
+ /** Fraction of the map's texels some island maps to: packing efficiency. */
1360
+ coverage?: number;
1361
+ };
1362
+ /**
1363
+ * The stand-ins `settings.simplify` asked for. One that could not be built
1364
+ * is in `skipped` under the id `simplify[n]`, and the objects it would have
1365
+ * replaced are left as they were.
1366
+ */
1367
+ proxies?: BakedProxy[];
1368
+ /** The shadow plane `settings.shadow` asked for. */
1369
+ shadow?: BakedShadow;
1370
+ /**
1371
+ * The prebaked room this bake stands its objects in: an unmodified preset
1372
+ * room whose own lightmaps are a library asset, not something this bake
1373
+ * paid for. The SDK fetches that bundle and applies it underneath this
1374
+ * one. Absent from an ordinary bake, which lights everything it covers.
1375
+ */
1376
+ room?: {
1377
+ /** The preset and the lighting it was baked under. */
1378
+ name: string;
1379
+ lighting: string;
1380
+ /**
1381
+ * The published room's build hash, which is what makes the prebake this
1382
+ * room and not a later edit of it.
1383
+ */
1384
+ build: string;
1385
+ /** Where the prebaked bundle is, on the preset library. */
1386
+ uri: string;
1387
+ };
1388
+ /** The portable unlit GLB, when `deliverGlb` was set. */
1389
+ glb?: {
1390
+ uri: string;
1391
+ };
1392
+ /**
1393
+ * The reflection probe: a linear HDR equirectangular map of the scene from
1394
+ * `position`, in three's own equirect convention (load it, set
1395
+ * `EquirectangularReflectionMapping`, and it is an `envMap`). `hidden` are
1396
+ * the objects it was taken without, which are the ones to put it on.
1397
+ */
1398
+ probe?: {
1399
+ uri: string;
1400
+ format: 'exr';
1401
+ width: number;
1402
+ height: number;
1403
+ position: [number, number, number];
1404
+ hidden: string[];
1405
+ /**
1406
+ * The probe as an LDR picture, for a panel, a drawer or a figure: the
1407
+ * same map through `exposure` (chosen by the worker to put its mean at
1408
+ * middle gray), Reinhard and sRGB. A label on the file, not something to
1409
+ * light with.
1410
+ */
1411
+ preview?: {
1412
+ uri: string;
1413
+ exposure?: number;
1414
+ };
1415
+ };
1416
+ stats?: {
1417
+ texels: number;
1418
+ gpuSeconds?: number;
1419
+ /**
1420
+ * Where those seconds went, by step (`scene`, `probe`, `unwrap`,
1421
+ * `trace`, `repair`, `denoise`, `export`, `standIns`), summed over the
1422
+ * objects.
1423
+ */
1424
+ seconds?: Record<string, number>;
1425
+ };
1426
+ };
1427
+ /**
1428
+ * A bundle without its uv arrays and stand-in geometry: what a job result
1429
+ * carries once the files are in storage. The arrays are the bulk of a bundle
1430
+ * (a dense room's are megabytes) and belong in `bundle.json`, which the SDK
1431
+ * reads from storage.
1432
+ */
1433
+ type BakeBundleSummary = Omit<BakeBundle, 'objects' | 'proxies'> & {
1434
+ objects: Array<Omit<BakedObject, 'uv'>>;
1435
+ /** Stand-ins without their geometry, for the same reason. */
1436
+ proxies?: Array<DistributiveOmit<BakedProxy, 'geometry'>>;
1437
+ };
1438
+ type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
1439
+
1440
+ /**
1441
+ * A batch: a customer's declared body of work.
1442
+ *
1443
+ * A catalog is products x finishes x cameras, a few thousand stills. The
1444
+ * customer opens a batch, adds items in pages, closes it, and reads one
1445
+ * ledger back. On the control plane every item is a render row with a
1446
+ * `batchId`, staged behind the queue proper and fed into it a page at a
1447
+ * time, so everything that holds for a render (the claim, the reservation,
1448
+ * single billing, webhooks, retention) holds for an item because it is one.
1449
+ */
1450
+
1451
+ declare const BATCH_STATES: readonly ["open", "sealed", "paused", "completed", "cancelled"];
1452
+ type BatchState = (typeof BATCH_STATES)[number];
1453
+ /**
1454
+ * How many items are in each state. `staged` items are admitted: priced,
1455
+ * reserved, waiting behind the queue proper. `queued` are in the queue and
1456
+ * `running` hold a worker. `refused` failed for a reason a retry would not
1457
+ * change (the scene's fault, or ours to explain); `failed` ran out of
1458
+ * attempts on an infrastructure failure. `adopted` were already completed
1459
+ * under the same key when they were added and cost nothing.
1460
+ */
1461
+ type BatchCounts = {
1462
+ staged: number;
1463
+ queued: number;
1464
+ running: number;
1465
+ completed: number;
1466
+ failed: number;
1467
+ refused: number;
1468
+ cancelled: number;
1469
+ adopted: number;
1470
+ };
1471
+ type BatchCost = {
1472
+ /** Sum of estimatedCost over admitted items. */
1473
+ estimated: number;
1474
+ /** Sum of maximumCost over admitted items: what admission reserved. */
1475
+ maximum: number;
1476
+ /** Sum of what completed items actually cost, so far. */
1477
+ actual: number;
1478
+ };
1479
+ type BatchRecord = {
1480
+ id: string;
1481
+ key: string;
1482
+ name?: string;
1483
+ kind: 'render' | 'bake';
1484
+ state: BatchState;
1485
+ lane: 'batch' | 'normal';
1486
+ maxParallel?: number;
1487
+ /** The customer's ceiling for the whole batch. */
1488
+ maxCost?: number;
1489
+ counts: BatchCounts;
1490
+ /** Every item ever admitted, adopted included. */
1491
+ total: number;
1492
+ /** How many are terminal. `done === total` once sealed is `completed`. */
1493
+ done: number;
1494
+ cost: BatchCost;
1495
+ /** Why it is paused, when it is: the breaker names the top refusal codes. */
1496
+ pausedReason?: string;
1497
+ createdAt: number;
1498
+ sealedAt?: number;
1499
+ finishedAt?: number;
1500
+ };
1501
+ type BatchOpenRequest = {
1502
+ /**
1503
+ * Stable across re-runs: the same key re-opens the same batch while it is
1504
+ * not terminal, and items already completed under their keys are adopted
1505
+ * rather than rendered again.
1506
+ */
1507
+ key: string;
1508
+ name?: string;
1509
+ kind?: 'render' | 'bake';
1510
+ /**
1511
+ * The ceiling for the whole batch, in dollars. A page that would take the
1512
+ * batch's maximum past it is refused whole.
1513
+ */
1514
+ maxCost?: number;
1515
+ /**
1516
+ * `batch` (the default) never runs ahead of a person in a configurator;
1517
+ * `normal` is the API's ordinary lane.
1518
+ */
1519
+ lane?: 'batch' | 'normal';
1520
+ /** Fewer parallel items than the plan allows, for a gentler budget. */
1521
+ maxParallel?: number;
1522
+ };
1523
+ type BatchItemRequest = {
1524
+ /**
1525
+ * The item's idempotency key, scoped to the project like every other
1526
+ * render's. `sku/finish/camera@v3` is the shape the docs suggest.
1527
+ */
1528
+ key: string;
1529
+ spec: RenderSpec | BakeSpec;
1530
+ metadata?: Record<string, unknown>;
1531
+ /** A ceiling for this one item, under the batch's. */
1532
+ maxCost?: number;
1533
+ };
1534
+ type BatchAddRequest = {
1535
+ items: BatchItemRequest[];
1536
+ /**
1537
+ * Price everything, admit nothing: the whole catalog's numbers before a
1538
+ * dollar is reserved.
1539
+ */
1540
+ dryRun?: boolean;
1541
+ };
1542
+ type BatchItemOutcome = {
1543
+ key: string;
1544
+ /** The render's id, when it was admitted or adopted. */
1545
+ id?: string;
1546
+ estimatedCost: number;
1547
+ maximumCost: number;
1548
+ /** Already completed under this key: attached at no cost. */
1549
+ adopted?: boolean;
1550
+ /**
1551
+ * Why this item, alone, was not admitted (a bad spec, an item over its own
1552
+ * maxCost). The page's other items are unaffected.
1553
+ */
1554
+ error?: RenderError;
1555
+ };
1556
+ type BatchAddResponse = {
1557
+ batch: BatchRecord;
1558
+ items: BatchItemOutcome[];
1559
+ };
1560
+ /** One line of `GET /v1/batches/:id/export`: the ledger, item by item. */
1561
+ type BatchExportLine = {
1562
+ key: string;
1563
+ id: string;
1564
+ state: string;
1565
+ resultUrl?: string;
1566
+ error?: RenderError;
1567
+ cost?: number;
1568
+ versions?: Record<string, unknown>;
1569
+ metadata?: Record<string, unknown>;
1570
+ };
1571
+
1572
+ /**
1573
+ * Render job states and the events that carry them.
1574
+ *
1575
+ * Every transition is timestamped, idempotent and observable. Idempotent is
1576
+ * the load-bearing word: a worker that retries a stage must not bill twice
1577
+ * and must not emit `render.completed` twice, so the control plane treats a
1578
+ * transition to a state it is already in as a no-op rather than an error.
1579
+ */
1580
+ declare const RENDER_STATES: readonly ["created", "uploading", "validating", "queued", "starting", "preparing", "rendering_preview", "rendering", "encoding", "uploading_result", "completed", "failed", "cancelled", "expired"];
1581
+ type RenderState = (typeof RENDER_STATES)[number];
1582
+ type RenderResult = {
1583
+ /**
1584
+ * Signed, private, and only good until `expiresAt` (24 hours). Copy the
1585
+ * bytes into your own storage if you keep them; `getRender(id)` hands out
1586
+ * fresh URLs until the project's retention deletes the files.
1587
+ */
1588
+ url: string;
1589
+ /**
1590
+ * Millisecond epoch at which `url` (and `previewUrl`) stop working. The
1591
+ * URLs are signed when the render is read, so reading it again with
1592
+ * `getRender(id)` returns fresh ones. Absent from an API that predates it.
1593
+ */
1594
+ expiresAt?: number;
1595
+ width: number;
1596
+ height: number;
1597
+ format: string;
1598
+ bytes: number;
1599
+ /** What was actually charged, in USD. Not the estimate. */
1600
+ cost: number;
1601
+ /** Everything needed to reproduce this exact image later. */
1602
+ versions: {
1603
+ protocol: string;
1604
+ sdk: string;
1605
+ translator: string;
1606
+ qualityPreset: string;
1607
+ };
1608
+ };
1609
+ /**
1610
+ * Which queue a render waits in inside its account.
1611
+ *
1612
+ * `interactive` is a person waiting: every browser-token render, and the
1613
+ * SDK's `render()` by default. `normal` is the API default. `batch` is an
1614
+ * item of a batch. A lane above always dispatches before a lane below, so a
1615
+ * configurator's visitor never waits behind an overnight catalog.
1616
+ */
1617
+ declare const RENDER_LANES: readonly ["interactive", "normal", "batch"];
1618
+ type RenderLane = (typeof RENDER_LANES)[number];
1619
+ type RenderRecord = {
1620
+ id: string;
1621
+ state: RenderState;
1622
+ progress: number;
1623
+ /**
1624
+ * A video's frames traced so far and in all, while it renders. Updated
1625
+ * every ten seconds or so; absent for a still and once the render ends.
1626
+ */
1627
+ frames?: {
1628
+ done: number;
1629
+ total: number;
1630
+ };
1631
+ /** Which of the account's queues it waits in. */
1632
+ lane?: RenderLane;
1633
+ /**
1634
+ * How many times a worker has been handed this render. 1 is the normal
1635
+ * case; more means an infrastructure failure was retried for you.
1636
+ */
1637
+ attempts?: number;
1638
+ /** The batch this render belongs to, and its key within it. */
1639
+ batchId?: string;
1640
+ batchKey?: string;
1641
+ /** A low-sample image, available long before the final one. */
1642
+ previewUrl?: string;
1643
+ result?: RenderResult;
1644
+ error?: RenderError;
1645
+ estimate?: CostEstimate;
1646
+ createdAt: number;
1647
+ updatedAt: number;
1648
+ metadata?: Record<string, unknown>;
1649
+ };
1650
+ /**
1651
+ * A finished bake, as `GET /v1/bakes/:id` answers it.
1652
+ *
1653
+ * The bundle's uv arrays are behind `bundleUrl`, not here: a dense room's
1654
+ * are megabytes, and the SDK reads them once from storage. `files` is every
1655
+ * name the bundle uses, resolved to a signed URL, so a loader can take
1656
+ * `bundle.objects[i].lightmap.uri` and look it up without knowing where the
1657
+ * files live. All of them expire together, at `expiresAt`.
1658
+ */
1659
+ type BakeResult = {
1660
+ /** Signed GET for bundle.json: the BakeBundle, uv arrays and all. */
1661
+ bundleUrl: string;
1662
+ /** Every file the bundle names, by that name, as a signed GET. */
1663
+ files: Record<string, string>;
1664
+ /** Millisecond epoch at which the URLs stop working. */
1665
+ expiresAt: number;
1666
+ /**
1667
+ * The bundle without its uv arrays: what a panel shows before it fetches
1668
+ * anything.
1669
+ */
1670
+ summary: BakeBundleSummary;
1671
+ /** Every file's size together, in bytes. */
1672
+ bytes: number;
1673
+ cost: number;
1674
+ versions: Record<string, string | number>;
1675
+ };
1676
+ type BakeRecord = {
1677
+ id: string;
1678
+ state: RenderState;
1679
+ progress: number;
1680
+ result?: BakeResult;
1681
+ error?: RenderError;
1682
+ estimate?: CostEstimate;
1683
+ createdAt: number;
1684
+ updatedAt: number;
1685
+ metadata?: Record<string, unknown>;
1686
+ };
1687
+ /**
1688
+ * Cost, before anything expensive happens.
1689
+ *
1690
+ * `maximum` is what `maxCost` is compared against, so a developer who sets
1691
+ * a ceiling gets a refusal rather than a bill somewhere between the two
1692
+ * numbers.
1693
+ */
1694
+ type CostEstimate = {
1695
+ estimatedCost: number;
1696
+ maximumCost: number;
1697
+ estimatedSeconds: number;
1698
+ compatibilityScore: number;
1699
+ };
1700
+ /**
1701
+ * A failure a developer can act on.
1702
+ *
1703
+ * `code` is stable and machine-readable; `message`, `why` and `fix` are for
1704
+ * the developer. A traceback is never any of them.
1705
+ */
1706
+ type RenderError = {
1707
+ code: RenderErrorCode;
1708
+ message: string;
1709
+ why?: string;
1710
+ fix?: string;
1711
+ docs?: string;
1712
+ /** Where in the scene, when the failure has a location. */
1713
+ path?: string;
1714
+ /** Whether resubmitting unchanged could plausibly work. */
1715
+ retryable: boolean;
1716
+ /**
1717
+ * The control plane tried this render again and gave up: every attempt
1718
+ * failed the same retryable way. We have been told, and
1719
+ * `POST /v1/renders/:id/retry` tries once more on request.
1720
+ */
1721
+ attemptsExhausted?: boolean;
1722
+ };
1723
+ declare const RENDER_ERROR_CODES: readonly ["RenderBudgetExceeded", "UnsupportedMaterial", "SceneTooLarge", "TextureTooLarge", "AssetNotFound", "AssetUploadIncomplete", "ProtocolVersionUnsupported", "RoomPresetUnknown", "RoomPresetBuildMismatch", "CompatibilityPreflightFailed", "OutOfVideoMemory", "RenderTimeout", "WorkerFailure", "WorkerLost", "RendererCrashed", "UploadFailed", "ResultLost", "CapacityUnavailable", "QueueFull", "QueueTimeout", "BatchBudgetExceeded", "BatchClosed", "ImportRefused", "ImportFailed", "PlanRequired", "InsufficientBalance", "QuotaExceeded", "ConcurrencyLimitReached", "RateLimited", "Unauthorized", "TokenExpired", "OriginNotAllowed", "InvalidRequest"];
1724
+ type RenderErrorCode = (typeof RENDER_ERROR_CODES)[number];
1725
+ /** Webhook event names. */
1726
+ declare const WEBHOOK_EVENTS: readonly ["render.created", "render.started", "render.preview", "render.completed", "render.failed", "render.cancelled", "render.retrying", "video.started", "video.frame.completed", "video.completed", "bake.created", "bake.started", "bake.completed", "bake.failed", "bake.cancelled", "bake.retrying", "batch.progress", "batch.completed", "batch.paused"];
1727
+ type WebhookEvent = (typeof WEBHOOK_EVENTS)[number];
1728
+ /**
1729
+ * What a webhook carries. A `render.*` event has `render`; a `bake.*` event
1730
+ * has `bake`. Never both: a receiver switches on `event` and reads the one
1731
+ * record the event is about.
1732
+ */
1733
+ type WebhookPayload = {
1734
+ event: WebhookEvent;
1735
+ /** Millisecond epoch. Signed together with the body; see the docs. */
1736
+ sentAt: number;
1737
+ render?: RenderRecord;
1738
+ bake?: BakeRecord;
1739
+ /** A `batch.*` event carries the batch's ledger instead. */
1740
+ batch?: BatchRecord;
1741
+ };
1742
+
1743
+ type AssetKind = 'scene' | 'texture' | 'hdri' | 'ies' | 'geometry' | 'animation';
1744
+ type AssetDescriptor = {
1745
+ hash: string;
1746
+ kind: AssetKind;
1747
+ bytes: number;
1748
+ contentType: string;
1749
+ /** Diagnostics and the devtools' upload list; never used for addressing. */
1750
+ name?: string;
1751
+ };
1752
+ /** Request body for "which of these do you already have?". */
1753
+ type AssetCheckRequest = {
1754
+ assets: AssetDescriptor[];
1755
+ };
1756
+ /**
1757
+ * The answer, plus a signed PUT for each miss.
1758
+ *
1759
+ * The presigned URL is a capability, not a credential: one object, one
1760
+ * method, one expiry. It lets the browser upload straight to storage without
1761
+ * the control plane ever touching the bytes.
1762
+ */
1763
+ type AssetCheckResponse = {
1764
+ /** Hashes already in storage. Do not upload these. */
1765
+ present: string[];
1766
+ /** One signed PUT per hash that is missing. */
1767
+ uploads: Array<{
1768
+ hash: string;
1769
+ url: string;
1770
+ /**
1771
+ * Headers the signature covers. A presigned PUT is signed over an exact
1772
+ * header set, so sending more or fewer than these is a 403. Pass them
1773
+ * through verbatim.
1774
+ */
1775
+ headers?: Record<string, string>;
1776
+ expiresAt: number;
1777
+ }>;
1778
+ };
1779
+
1780
+ /**
1781
+ * What a GLB says about itself, read from its JSON chunk alone.
1782
+ *
1783
+ * A scene the SDK captured arrives with everything the control plane needs
1784
+ * beside it: a triangle count to price with, a camera, a compatibility
1785
+ * report. A model fetched by URL arrives with nothing, and the renderer is
1786
+ * the wrong place to find out it cannot be read: that is a refusal at three
1787
+ * in the morning, a thousand times. So the import reads the file's own
1788
+ * table of contents, which is the first chunk and a few hundred KB at most,
1789
+ * and answers before anything is admitted:
1790
+ *
1791
+ * - how heavy it is (triangles, per node instance, the way it will trace);
1792
+ * - where it is (the world bounds, from accessor min/max through the node
1793
+ * transforms), which is what lets a camera be FRAMED instead of guessed;
1794
+ * - which cameras it carries, by name;
1795
+ * - what in it the renderer cannot read (a required extension its importer
1796
+ * does not implement), by name and with the fix.
1797
+ *
1798
+ * Pure, no dependencies, no binary chunk: nothing here decodes geometry.
1799
+ */
1800
+
1801
+ type GlbCamera = {
1802
+ /** The node's name, or the camera's. What a caller asks for it by. */
1803
+ name: string;
1804
+ /** As it stands in the file, in world space. `aspect` is the file's own, when it gives one. */
1805
+ camera: CameraSpec;
1806
+ };
1807
+ type GlbFacts = {
1808
+ bytes: number;
1809
+ /** Counted per node instance: a mesh two nodes show is traced twice. */
1810
+ triangles: number;
1811
+ meshes: number;
1812
+ materials: number;
1813
+ textures: number;
1814
+ /** Punctual lights the file carries. They render as its author set them. */
1815
+ lights: number;
1816
+ animations: number;
1817
+ /** World bounds of everything with geometry, or null for a file with none. */
1818
+ bounds: {
1819
+ min: Vec3;
1820
+ max: Vec3;
1821
+ } | null;
1822
+ cameras: GlbCamera[];
1823
+ /** Named nodes, in file order, bounded. */
1824
+ objects: string[];
1825
+ extensionsUsed: string[];
1826
+ extensionsRequired: string[];
1827
+ generator?: string;
1828
+ /** `error` issues mean the renderer cannot read the file as authored. */
1829
+ issues: CompatibilityIssue[];
1830
+ };
1831
+
1832
+ /**
1833
+ * Importing an asset by URL: `POST /v1/assets/import`.
1834
+ *
1835
+ * Every other asset is pushed: the browser hashes it and PUTs it on a
1836
+ * presigned URL. A catalog that already sits on a CDN should not be pulled
1837
+ * through somebody's laptop to be pushed again, so this one is pulled: the
1838
+ * control plane fetches the public URL once, stores the bytes content
1839
+ * addressed exactly as an upload would have, and answers with the hash and
1840
+ * what the file says about itself. The result is an ordinary asset, and
1841
+ * everything after it (the manifest, the cache keys, the render) is the
1842
+ * ordinary path.
1843
+ *
1844
+ * Fetching a URL a customer names is the one thing here a stranger could aim
1845
+ * somewhere else, so the route takes a secret key only (never a browser
1846
+ * token), and the fetch is fenced: https, public addresses only, no
1847
+ * credentials in the URL, and a size limit.
1848
+ */
1849
+
1850
+ type AssetImportKind = 'scene' | 'hdri';
1851
+ type AssetImportRequest = {
1852
+ /** `https://`, public, no credentials in it. */
1853
+ url: string;
1854
+ /** `scene` (a GLB, the default) or `hdri` (a Radiance .hdr or an OpenEXR). */
1855
+ kind?: AssetImportKind;
1856
+ };
1857
+ type AssetImportResponse = {
1858
+ hash: AssetHash;
1859
+ kind: AssetImportKind;
1860
+ bytes: number;
1861
+ /**
1862
+ * True when nothing was downloaded: the URL answered 304 to the validator
1863
+ * kept from the last import, so the stored bytes are still what it serves.
1864
+ */
1865
+ unchanged: boolean;
1866
+ /** For a `scene`: what the GLB says about itself. */
1867
+ facts?: GlbFacts;
1868
+ };
1869
+
1870
+ /**
1871
+ * Errors a developer can act on.
1872
+ *
1873
+ * "Render failed" is a bad error. A traceback is a worse one. Every failure
1874
+ * that reaches the developer carries what went wrong, where, why, and what to
1875
+ * do about it, and `code` stays stable so the failure can also be branched on
1876
+ * in code.
1877
+ */
1878
+
1879
+ /**
1880
+ * Codes the SDK can raise that the render protocol does not: a fault on the
1881
+ * way (`NetworkError`), a fault before anything left the browser
1882
+ * (`CaptureFailed`), the two refusals a batch page can meet as a whole (over
1883
+ * the batch's own ceiling, or after it was sealed), and the two ends of a job
1884
+ * that are not faults in the scene: it was cancelled (`Cancelled`), or its
1885
+ * files were deleted before it was read (`Expired`).
1886
+ */
1887
+ type Bakery3ErrorCode = RenderErrorCode | 'NetworkError' | 'CaptureFailed' | 'BatchBudgetExceeded' | 'BatchClosed' | 'Cancelled' | 'Expired';
1888
+ declare class Bakery3Error extends Error {
1889
+ readonly code: Bakery3ErrorCode;
1890
+ readonly why?: string;
1891
+ readonly fix?: string;
1892
+ readonly docs?: string;
1893
+ readonly path?: string;
1894
+ readonly retryable: boolean;
1895
+ constructor(init: {
1896
+ code: Bakery3ErrorCode;
1897
+ message: string;
1898
+ why?: string;
1899
+ fix?: string;
1900
+ docs?: string;
1901
+ path?: string;
1902
+ retryable?: boolean;
1903
+ });
1904
+ static from(error: RenderError): Bakery3Error;
1905
+ /**
1906
+ * The multi-line form, for a console or a devtools panel.
1907
+ *
1908
+ * `Error.message` stays one line so it reads correctly everywhere a message
1909
+ * is expected to be one: a log aggregator, a toast, a test name. `stack`
1910
+ * starts with this form, so an uncaught error prints its fix.
1911
+ */
1912
+ toDisplayString(): string;
1913
+ }
1914
+ /**
1915
+ * A whole page of batch items was refused.
1916
+ *
1917
+ * Admission is per page: the control plane prices the page, checks it against
1918
+ * the account's balance and the batch's own `maxCost`, and either admits
1919
+ * every item or none. A `402 InsufficientBalance`, a `402 BatchBudgetExceeded`
1920
+ * or a `409 BatchClosed` means nothing in the page was admitted. The `Batch`
1921
+ * keeps those items buffered, so after a top-up (or a higher ceiling)
1922
+ * `flush()` sends exactly the same page again.
1923
+ *
1924
+ * `admitted` is what earlier pages of the same flush already got through:
1925
+ * those items are the server's now, and this error carries their outcomes so
1926
+ * a caller does not lose them because a later page was refused.
1927
+ */
1928
+ declare class BatchPageRefused extends Bakery3Error {
1929
+ /** The page that was refused whole, still in the batch's buffer. */
1930
+ readonly page: BatchItemRequest[];
1931
+ /** Outcomes of the pages this flush admitted before the refusal. */
1932
+ readonly admitted: BatchItemOutcome[];
1933
+ constructor(cause: Bakery3Error, page: BatchItemRequest[], admitted: BatchItemOutcome[]);
1934
+ }
1935
+
1936
+ /**
1937
+ * The HTTP client for the control plane.
1938
+ *
1939
+ * Small on purpose: a handful of endpoints, one auth header, one error shape.
1940
+ * The interesting work happens in the browser (capture, hashing) and on the
1941
+ * render workers; this is the thin part in between.
1942
+ *
1943
+ * The one piece of policy it carries is the retry: a 429 or a 503 is the
1944
+ * control plane saying "not now", and it is answered with a bounded, jittered
1945
+ * wait rather than an error the developer has to write a loop around. Only
1946
+ * requests that are safe to repeat are repeated (see `RequestOptions.retry`).
1947
+ *
1948
+ * In production no secret key reaches this file. The browser holds a
1949
+ * short-lived, project-scoped, origin-restricted, spend-capped token minted by
1950
+ * the developer's own server. `token` is a function rather than a string so
1951
+ * it can be fetched again when one expires, which for a five-minute token in
1952
+ * a long configurator session is routine.
1953
+ *
1954
+ * `apiKey` is the other door, and it is open on purpose: a key works from the
1955
+ * browser so the first render is one paste away, and `warnIfKeyIsExposed`
1956
+ * says once, with the replacement code, why it must not stay there.
1957
+ *
1958
+ * Neither is needed to construct a client: `check()` and `inspect()` never
1959
+ * touch the network, and a React tree whose environment variable is unset
1960
+ * must still mount. A missing credential is refused at the first request,
1961
+ * with what to pass instead.
1962
+ */
1963
+
1964
+ /** What `/v1/estimate` prices: a still or a clip, or a bake. */
1965
+ type EstimateRequest = (Pick<RenderSpec, 'quality' | 'output' | 'advanced'> & {
1966
+ /** Triangle count and texture footprint, so an estimate can be given
1967
+ * before anything has been uploaded. `room` says the scene stands in a
1968
+ * preset room, which the renderer builds around it; `enclosure` and
1969
+ * `objects` say how walled in and how full it is from the camera
1970
+ * (`SceneComplexity`), which is what makes an interior cost more. */
1971
+ scene?: {
1972
+ triangles?: number;
1973
+ textureBytes?: number;
1974
+ fog?: boolean;
1975
+ room?: boolean;
1976
+ enclosure?: number;
1977
+ objects?: number;
1978
+ };
1979
+ /** Frames in a clip; the control plane prices a video per frame. */
1980
+ frames?: number;
1981
+ }) | {
1982
+ /** The settings a bake request would carry. Texels (objects × size²)
1983
+ * are what the control plane prices. */
1984
+ bake: Pick<BakeSettings, 'quality' | 'textureSize' | 'include' | 'sizes' | 'atlas' | 'deliverGlb' | 'simplify' | 'shadow'> & {
1985
+ /** The scene is a room interior: a ray that misses keeps going,
1986
+ * which is most of what such a bake costs. */
1987
+ enclosed?: boolean;
1988
+ };
1989
+ /** Triangles in the objects the bake would cover: what the unwrap runs
1990
+ * over, and priced separately from the scene's own count. */
1991
+ bakedTriangles?: number;
1992
+ scene?: {
1993
+ triangles?: number;
1994
+ textureBytes?: number;
1995
+ fog?: boolean;
1996
+ };
1997
+ };
1998
+ /** A browser token: the string, or the JSON `tokens.create()` answers with. */
1999
+ type MintedToken = string | {
2000
+ token: string;
2001
+ expiresAt?: number;
2002
+ };
2003
+ type TokenProvider = () => MintedToken | Promise<MintedToken>;
2004
+ /**
2005
+ * One of the two, never both. Neither is allowed too, for a client that only
2006
+ * checks scenes; its first request is refused with what to pass.
2007
+ *
2008
+ * The `?: never` arms turn passing both into a type error at the call site
2009
+ * rather than a runtime throw later: the two are different integrations, and
2010
+ * a codebase carrying both is one that has not finished moving off the key.
2011
+ */
2012
+ type ClientAuth = {
2013
+ /** Mints a browser token, usually from your own `/api/bakery3-token`. */
2014
+ token: TokenProvider;
2015
+ apiKey?: never;
2016
+ } | {
2017
+ /**
2018
+ * A `bk_sk_` key used directly, for local testing, a Node script, or a
2019
+ * server-rendered call.
2020
+ *
2021
+ * From a browser this ships the key to every visitor. The SDK allows it
2022
+ * so the first render is one paste away, warns about it in the console,
2023
+ * and expects `token` by the time you deploy.
2024
+ *
2025
+ * `undefined` (an environment variable that is not set) is accepted
2026
+ * here and refused at the first request, with that said.
2027
+ */
2028
+ apiKey: string | undefined;
2029
+ token?: never;
2030
+ } | {
2031
+ token?: undefined;
2032
+ apiKey?: undefined;
2033
+ };
2034
+ /**
2035
+ * How a 429 or a 503 is waited out. Bounded: after `maxTries` the error is
2036
+ * the developer's. The defaults are the SDK's; a test shortens the delays.
2037
+ */
2038
+ type RetryPolicy = {
2039
+ /** Attempts in total, the first included. Default 5. */
2040
+ maxTries?: number;
2041
+ /** The first wait, before jitter and doubling. Default 500 ms. */
2042
+ baseDelayMs?: number;
2043
+ /** No single wait is longer than this, `Retry-After` included. Default 30 s. */
2044
+ maxDelayMs?: number;
2045
+ };
2046
+ type ClientOptions = ClientAuth & {
2047
+ baseUrl?: string;
2048
+ fetch?: typeof fetch;
2049
+ retry?: RetryPolicy;
2050
+ };
2051
+ /** Per-request knobs, for the client's own methods. */
2052
+ type RequestOptions = {
2053
+ /**
2054
+ * Whether a 429/503 may be answered by sending the request again.
2055
+ *
2056
+ * Every GET is. A POST is only when repeating it cannot do a second thing:
2057
+ * a batch page (its items carry keys), a batch action, a render that
2058
+ * carries an `idempotencyKey`. `POST /v1/renders` without one is not: a
2059
+ * second copy would be a second charge, which no amount of backoff is
2060
+ * worth.
2061
+ */
2062
+ retry?: boolean;
2063
+ /** Cuts a long-poll short. */
2064
+ signal?: AbortSignal;
2065
+ };
2066
+ /** `GET /v1/batches/:id/items`: the render record plus the item's key. */
2067
+ type BatchItemRecord = RenderRecord & {
2068
+ key: string;
2069
+ };
2070
+ type BatchItemsPage = {
2071
+ items: BatchItemRecord[];
2072
+ cursor: string | null;
2073
+ };
2074
+ type BatchAction = 'close' | 'pause' | 'resume' | 'cancel' | 'retry';
2075
+ declare class Bakery3Client {
2076
+ private readonly baseUrl;
2077
+ private readonly auth;
2078
+ /**
2079
+ * The fetch this client sends with: the one passed in `options.fetch`, or
2080
+ * the global. Uploads and bundle reads use it too, so a test, a proxy or a
2081
+ * runtime with its own fetch sees every request the SDK makes.
2082
+ */
2083
+ readonly fetch: typeof fetch;
2084
+ /** Cached until it expires. Re-minting per render would add a round trip to
2085
+ * the developer's own server on the critical path of every click. */
2086
+ private cached;
2087
+ /** One token fetch at a time. React's StrictMode mounts twice, and two
2088
+ * renders at once both find the cache empty: they share this one. */
2089
+ private minting;
2090
+ /**
2091
+ * The browser token each render, bake and batch was created with, by id.
2092
+ *
2093
+ * A token can only read the rows it created. Once it has spent its
2094
+ * allowance or expired, the API still lets it read and cancel those rows
2095
+ * (for 24 hours past expiry) but not create more, and a freshly minted
2096
+ * token cannot read them at all. So a job polls with the token that
2097
+ * started it, whatever the local cache thinks of that token's expiry.
2098
+ */
2099
+ private readonly owners;
2100
+ private readonly retry;
2101
+ private readonly sendVersion;
2102
+ constructor(options?: ClientOptions);
2103
+ /**
2104
+ * Why this client cannot make a request, or null when it can. The same
2105
+ * error its first request would throw, for a panel or a status line that
2106
+ * wants to say so before anyone presses Render.
2107
+ */
2108
+ credentialError(): Bakery3Error | null;
2109
+ token(force?: boolean): Promise<string>;
2110
+ private mint;
2111
+ checkAssets(body: AssetCheckRequest): Promise<AssetCheckResponse>;
2112
+ /**
2113
+ * `POST /v1/assets/import`: have the service fetch a public URL into the
2114
+ * project's assets. Secret key only. Safe to repeat: the same bytes are the
2115
+ * same asset, and an unchanged URL is answered without a download.
2116
+ */
2117
+ importAsset(body: AssetImportRequest): Promise<AssetImportResponse>;
2118
+ estimate(body: EstimateRequest): Promise<CostEstimate>;
2119
+ createRender(body: RenderSpec): Promise<RenderRecord>;
2120
+ /**
2121
+ * A render's record, with fresh signed URLs for its result and preview.
2122
+ * Read with the token that created it, when this client created it.
2123
+ */
2124
+ getRender(id: string, options?: {
2125
+ signal?: AbortSignal;
2126
+ }): Promise<RenderRecord>;
2127
+ cancelRender(id: string): Promise<RenderRecord>;
2128
+ /**
2129
+ * `POST /v1/renders/:id/retry`: one more attempt for a dead-lettered render.
2130
+ * Answers 201 with a new render linked to the old one, or 409 when the
2131
+ * render is not dead-lettered. Not repeated on a 429/503: it creates a
2132
+ * render, and a duplicate would be a duplicate charge.
2133
+ */
2134
+ retryRender(id: string): Promise<RenderRecord>;
2135
+ createBake(body: BakeSpec): Promise<BakeRecord>;
2136
+ getBake(id: string, options?: {
2137
+ signal?: AbortSignal;
2138
+ }): Promise<BakeRecord>;
2139
+ cancelBake(id: string): Promise<BakeRecord>;
2140
+ /** `POST /v1/batches`. The key is the idempotency key: the same key
2141
+ * re-opens the same batch (200) while it is not terminal. */
2142
+ openBatch(body: BatchOpenRequest): Promise<BatchRecord>;
2143
+ /**
2144
+ * `GET /v1/batches/:id`. With `wait`, long-polls for up to that many
2145
+ * seconds (at most 25) until the counts change: the one poll a batch needs.
2146
+ */
2147
+ getBatch(id: string, options?: {
2148
+ wait?: number;
2149
+ signal?: AbortSignal;
2150
+ }): Promise<BatchRecord>;
2151
+ /**
2152
+ * `POST /v1/batches/:id/items`: one page, at most `BATCH_PAGE_SIZE`.
2153
+ *
2154
+ * Every item carries its own key, so the page is safe to send twice: the
2155
+ * second copy adopts what the first admitted. A refusal of the whole page
2156
+ * (402 InsufficientBalance / BatchBudgetExceeded, 409 BatchClosed) throws;
2157
+ * a problem with one item comes back inside `items[i].error` with a 200.
2158
+ */
2159
+ addBatchItems(id: string, body: BatchAddRequest): Promise<BatchAddResponse>;
2160
+ /** `GET /v1/batches/:id/items?state=&cursor=&limit=`. */
2161
+ listBatchItems(id: string, options?: {
2162
+ state?: RenderState;
2163
+ cursor?: string;
2164
+ limit?: number;
2165
+ }): Promise<BatchItemsPage>;
2166
+ /**
2167
+ * `GET /v1/batches/:id/export`: the ledger as NDJSON, one line per item,
2168
+ * yielded as it streams so a ten-thousand-item batch is never one string.
2169
+ */
2170
+ exportBatch(id: string): AsyncIterable<BatchExportLine>;
2171
+ /** `POST /v1/batches/:id/{close,pause,resume,cancel,retry}`. Every one is a
2172
+ * state transition the control plane treats idempotently, so all repeat. */
2173
+ batchAction(id: string, action: BatchAction): Promise<BatchRecord>;
2174
+ private post;
2175
+ /** A request about a row this client may have created, with its token. */
2176
+ private read;
2177
+ /** Remember which token created a row, so the row is read with it. */
2178
+ private remember;
2179
+ /**
2180
+ * One authenticated JSON request, with the 401 re-mint and the 429/503
2181
+ * backoff. Public for the server SDK, which shares the transport; the
2182
+ * typed methods above are the API.
2183
+ */
2184
+ request<T>(method: string, path: string, body?: unknown, options?: RequestOptions): Promise<T>;
2185
+ /** A JSON request, and the credential that got the answer. */
2186
+ private call;
2187
+ private send;
2188
+ private fetchOnce;
2189
+ /**
2190
+ * Exponential with full jitter, or the server's own `Retry-After` when it
2191
+ * sent one: a server that says "in 3 s" knows more than a formula does.
2192
+ * Both are capped, so a header naming next Tuesday does not hang a page.
2193
+ */
2194
+ private delayFor;
2195
+ }
2196
+
2197
+ /**
2198
+ * A batch, from the customer's side.
2199
+ *
2200
+ * const batch = await bakery3.batches.open({ key: 'fall-2026-v3', maxCost: 600 });
2201
+ * for await (const item of source) await batch.write(item); // a full page sends itself
2202
+ * await batch.close(); // the tail is flushed, then sealed: the total is known
2203
+ * await batch.wait({ onProgress: (p) => console.log(`${p.completed}/${p.total}`) });
2204
+ * for await (const item of batch.items({ state: 'failed' })) console.error(item.key);
2205
+ *
2206
+ * Two things this class is careful about, because they are the whole reason
2207
+ * the batch exists rather than a loop over `render()`:
2208
+ *
2209
+ * - Memory. `write` buffers a few KB of manifest per item and sends a page
2210
+ * the moment one is full, by count or by bytes, so awaiting it is the
2211
+ * backpressure and nothing here ever holds the catalog. (`add` and
2212
+ * `flush` are the same two steps taken by hand.) A refused page stays
2213
+ * buffered: the caller tops up and flushes again, and the same items go,
2214
+ * under the same keys.
2215
+ * - One poll loop. `wait` long-polls the batch record; it never polls a
2216
+ * render. Items are read by state with a cursor when they are wanted.
2217
+ */
2218
+
2219
+ /** The slice of the client a batch drives: what a mock has to provide. */
2220
+ type BatchTransport = {
2221
+ getBatch(id: string, options?: {
2222
+ wait?: number;
2223
+ signal?: AbortSignal;
2224
+ }): Promise<BatchRecord>;
2225
+ addBatchItems(id: string, body: BatchAddRequest): Promise<{
2226
+ batch: BatchRecord;
2227
+ items: BatchItemOutcome[];
2228
+ }>;
2229
+ listBatchItems(id: string, options?: {
2230
+ state?: RenderState;
2231
+ cursor?: string;
2232
+ limit?: number;
2233
+ }): Promise<BatchItemsPage>;
2234
+ exportBatch(id: string): AsyncIterable<BatchExportLine>;
2235
+ batchAction(id: string, action: 'close' | 'pause' | 'resume' | 'cancel' | 'retry'): Promise<BatchRecord>;
2236
+ };
2237
+ /**
2238
+ * The counts, the cost and where the batch stands: what a status line
2239
+ * prints. Flat on purpose (`p.completed`, not `p.counts.completed`).
2240
+ */
2241
+ type BatchProgress = BatchCounts & {
2242
+ id: string;
2243
+ state: BatchState;
2244
+ /** Every item ever admitted, adopted included. Final once sealed. */
2245
+ total: number;
2246
+ /** How many are terminal. */
2247
+ done: number;
2248
+ cost: BatchCost;
2249
+ pausedReason?: string;
2250
+ };
2251
+ type FlushOptions = {
2252
+ /** Price the pages, admit nothing: the buffer stays for a real flush. */
2253
+ dryRun?: boolean;
2254
+ };
2255
+ type WaitOptions = {
2256
+ /** Called after every poll that returned, whether or not the counts moved. */
2257
+ onProgress?: (progress: BatchProgress) => void;
2258
+ signal?: AbortSignal;
2259
+ };
2260
+ declare class Batch {
2261
+ readonly id: string;
2262
+ readonly key: string;
2263
+ private latest;
2264
+ /** The flush in flight, or the last one, settled either way. */
2265
+ private flushing;
2266
+ private readonly buffer;
2267
+ /** `buffer[i]` as JSON is about `sizes[i]` bytes. Kept beside it so a
2268
+ * page can be closed on bytes without serializing anything twice. */
2269
+ private readonly sizes;
2270
+ private bytes;
2271
+ private readonly client;
2272
+ /** The clock `wait()` measures its patience with. A test turns it. */
2273
+ private clock;
2274
+ /** @internal `bakery3.batches.open()` and `.get()` make these. */
2275
+ constructor(client: BatchTransport, record: BatchRecord);
2276
+ /** Buffer an item. Nothing is sent until `flush()`. */
2277
+ add(item: BatchItemRequest): this;
2278
+ /**
2279
+ * `add`, and send a page when one is full. Awaiting it is the
2280
+ * backpressure: a loop over a file, a cursor or a generator of any length
2281
+ * holds one page at most.
2282
+ *
2283
+ * for await (const item of source) await batch.write(item);
2284
+ * await batch.close();
2285
+ */
2286
+ write(item: BatchItemRequest): Promise<void>;
2287
+ /** Items added and not yet sent. */
2288
+ get buffered(): number;
2289
+ /** About how many bytes of JSON those items are. */
2290
+ get bufferedBytes(): number;
2291
+ /**
2292
+ * Price items without buffering or admitting them: the estimate, the
2293
+ * maximum and any refusal, per item, in the order given. Paged like a
2294
+ * flush. An item already completed under its key is quoted as adopted, at
2295
+ * nothing, which makes this the price of a re-run too.
2296
+ */
2297
+ quote(items: BatchItemRequest[]): Promise<BatchItemOutcome[]>;
2298
+ /**
2299
+ * Send the buffer in pages: `BATCH_PAGE_SIZE` items or `BATCH_PAGE_BYTES`
2300
+ * of JSON, whichever a page reaches first.
2301
+ *
2302
+ * Returns one outcome per item sent: admitted, adopted, or refused alone
2303
+ * (`outcome.error`). A page refused whole throws `BatchPageRefused` and
2304
+ * leaves that page and everything behind it in the buffer, so the caller
2305
+ * can top up and call `flush()` again; the error carries the outcomes of
2306
+ * the pages that did get through.
2307
+ */
2308
+ flush(options?: FlushOptions): Promise<BatchItemOutcome[]>;
2309
+ private flushNow;
2310
+ /** Seal: no more items. `completed` fires once the last one is terminal.
2311
+ * Anything still buffered is flushed first, because closing over unsent
2312
+ * items would quietly drop the tail of a catalog. */
2313
+ close(): Promise<BatchRecord>;
2314
+ /** Stop feeding the queue; running items finish. */
2315
+ pause(): Promise<BatchRecord>;
2316
+ resume(): Promise<BatchRecord>;
2317
+ /** Cancel every non-terminal item. What completed stays completed: it rendered. */
2318
+ cancel(): Promise<BatchRecord>;
2319
+ /** Re-queue every dead-lettered item, one new attempt each. */
2320
+ retry(): Promise<BatchRecord>;
2321
+ /** The latest record this batch has seen. No request. */
2322
+ record(): BatchRecord;
2323
+ /** Fetch the record now. */
2324
+ refresh(): Promise<BatchRecord>;
2325
+ /** Counts and cost from the latest record. No request. */
2326
+ progress(): BatchProgress;
2327
+ /**
2328
+ * Wait for the batch to finish: one long-poll loop on the batch record
2329
+ * until it is `completed` or `cancelled` (or sealed with every item
2330
+ * terminal). Never a poll per render.
2331
+ *
2332
+ * A paused batch is waited on, not given up on (someone may resume it from
2333
+ * the console), and `onProgress` sees `pausedReason` meanwhile. Pass
2334
+ * `signal` to stop waiting; the batch itself is untouched.
2335
+ *
2336
+ * A fault that clears is ridden out. One that does not (five minutes with
2337
+ * not one poll through) rejects with an error that says so and carries the
2338
+ * last fault's code. The batch renders on regardless, and `wait()` can be
2339
+ * called again.
2340
+ */
2341
+ wait(options?: WaitOptions): Promise<BatchRecord>;
2342
+ /** Every item, or every item in one state, walked with the cursor. */
2343
+ items(options?: {
2344
+ state?: RenderState;
2345
+ }): AsyncIterable<BatchItemRecord>;
2346
+ /** The ledger, line by line, as the server streams it. */
2347
+ export(): AsyncIterable<BatchExportLine>;
2348
+ private apply;
2349
+ }
2350
+
2351
+ /**
2352
+ * A set of pictures: what every many-pictures call hands back.
2353
+ *
2354
+ * `render({ cameras })` and `renderVariants()` in the browser, and
2355
+ * `renderBatch()` from Node, all record into a batch and return one of
2356
+ * these, so a set of three and a catalog of six thousand are the same object
2357
+ * with the same guarantees: one ceiling for all of it, one poll for all of
2358
+ * it, results walked a page at a time and never held.
2359
+ *
2360
+ * No three.js here: the server entry imports this file.
2361
+ */
2362
+
2363
+ /** One finished picture of a set. */
2364
+ type RenderSetImage = {
2365
+ /** The item's key: `variant/finish/camera`, as recorded. */
2366
+ key: string;
2367
+ /** The render's id. */
2368
+ id: string;
2369
+ variant?: string;
2370
+ finish?: string;
2371
+ camera?: string;
2372
+ /** The shot this is, for a set recorded with shots. */
2373
+ shot?: string;
2374
+ /** `'video'` when the url is a clip. */
2375
+ kind?: 'image' | 'video';
2376
+ /** Signed and expiring. Copy the bytes; do not serve from it. */
2377
+ url: string;
2378
+ width: number;
2379
+ height: number;
2380
+ /** What this picture cost. Nothing, when it was adopted from an earlier run. */
2381
+ cost: number;
2382
+ metadata?: Record<string, unknown>;
2383
+ result: RenderResult;
2384
+ };
2385
+ /** One picture that did not render, and why. */
2386
+ type RenderSetFailure = {
2387
+ key: string;
2388
+ id: string;
2389
+ variant?: string;
2390
+ finish?: string;
2391
+ camera?: string;
2392
+ shot?: string;
2393
+ error: Bakery3Error;
2394
+ metadata?: Record<string, unknown>;
2395
+ };
2396
+ /** One picture turned down when it was submitted: it has no render and never will. */
2397
+ type RenderSetRefusal = {
2398
+ key: string;
2399
+ variant?: string;
2400
+ finish?: string;
2401
+ camera?: string;
2402
+ shot?: string;
2403
+ error: RenderError;
2404
+ };
2405
+ /** What a recording did, in numbers small enough to keep. */
2406
+ type Recorded = {
2407
+ variants: number;
2408
+ images: number;
2409
+ /** Already rendered under their keys in an earlier run. Cost nothing. */
2410
+ adopted: number;
2411
+ /** Turned down alone at admission (a spec that does not parse, an item over its own ceiling). */
2412
+ refused: number;
2413
+ /** The first of those, with their reasons. Capped, because a broken pipeline refuses every item. */
2414
+ refusals: RenderSetRefusal[];
2415
+ };
2416
+ declare class RenderSet {
2417
+ /** The batch underneath: pause, resume, retry, the export. */
2418
+ readonly batch: Batch;
2419
+ readonly id: string;
2420
+ readonly key: string;
2421
+ /** What the call that made this set recorded. Empty for a set fetched by id. */
2422
+ readonly recorded: Recorded;
2423
+ /** Item key → position, for a set small enough to have asked for an order. */
2424
+ private order?;
2425
+ constructor(batch: Batch, recorded?: Recorded);
2426
+ /** Counts and cost from the latest record. No request. */
2427
+ progress(): BatchProgress;
2428
+ /**
2429
+ * Until every picture is terminal. One long-poll on the set, however many
2430
+ * pictures it has. Resolves with the final counts: pictures that failed
2431
+ * are in `failures()`, they do not reject the wait.
2432
+ */
2433
+ wait(options?: WaitOptions): Promise<BatchProgress>;
2434
+ /**
2435
+ * Every finished picture, a page at a time. Safe on a set of any size,
2436
+ * and safe to call before the set is done: it walks what has completed
2437
+ * so far.
2438
+ */
2439
+ images(): AsyncIterable<RenderSetImage>;
2440
+ /**
2441
+ * Every picture that did not render, with the reason and the fix.
2442
+ * `error.retryable` tells the two kinds apart: false is a refusal, the
2443
+ * scene's fault and the same next time; true ran out of attempts on a
2444
+ * fault of ours, and `set.batch.retry()` queues it again.
2445
+ */
2446
+ failures(): AsyncIterable<RenderSetFailure>;
2447
+ /**
2448
+ * Wait, then every picture in one array, in camera order for a
2449
+ * `render({ cameras })`: one picture per camera, or a rejection. Rejects
2450
+ * with `RenderSetRefused` when a picture was turned down at submission
2451
+ * (it has no render, and the array would be one short with every later
2452
+ * picture in the wrong place), and otherwise with the first failure, as
2453
+ * `job.result()` does. The pictures that did render are still there:
2454
+ * walk `images()`, each named by its `camera`.
2455
+ *
2456
+ * It collects, so it is for a handful of pictures. For a catalog, walk
2457
+ * `images()`.
2458
+ */
2459
+ result(options?: WaitOptions): Promise<RenderSetImage[]>;
2460
+ /** Cancel every picture that has not finished. What completed, completed. */
2461
+ cancel(): Promise<void>;
2462
+ /** @internal */
2463
+ ordered(keys: string[]): this;
2464
+ }
2465
+
2466
+ /**
2467
+ * The test run: a few products, every camera, small and fast.
2468
+ *
2469
+ * Before six thousand pictures are paid for, three products are worth
2470
+ * looking at: are the cameras where they were meant to be, is the room the
2471
+ * right way round, does the finish list hide what it should. A test run is
2472
+ * the real run's own options with three changes, made here so the browser
2473
+ * and the server make the same ones:
2474
+ *
2475
+ * - A sample of the products. From an array: the first, the middle and the
2476
+ * last, because a catalog is usually sorted and its ends differ most.
2477
+ * From anything else (a generator, a cursor): the first three, since a
2478
+ * list that is never collected has no middle to ask for.
2479
+ * - Preview quality at a small size, the long edge 512 unless told
2480
+ * otherwise, the aspect kept, so the framing is the real run's framing.
2481
+ * - Its own keys. A test is looked at and thrown away; if it shared the real
2482
+ * run's keys, the real run would adopt these little previews as finished
2483
+ * pictures. Every test also differs from the last one, so a test after a
2484
+ * fix shows the fix and not yesterday's frame.
2485
+ *
2486
+ * No three.js here: the server entry imports this file.
2487
+ */
2488
+
2489
+ type TestRunOptions = {
2490
+ /** How many products. Default 3. */
2491
+ products?: number;
2492
+ /** The long edge of each picture, in pixels. Default 512. */
2493
+ size?: number;
2494
+ /** The ceiling for the test, in dollars. Default 5. */
2495
+ maxCost?: number;
2496
+ };
2497
+
2498
+ /**
2499
+ * Cameras without a scene graph: where to stand to photograph a box.
2500
+ *
2501
+ * In the browser a camera is an object the developer placed. From a server
2502
+ * there is a model's bounds (`GlbFacts.bounds`, read at import) and nothing
2503
+ * else, so a view is described the way a photographer would: from which
2504
+ * side, how high, how tight. `framedCamera` turns that into the same
2505
+ * `CameraSpec` a captured camera becomes.
2506
+ *
2507
+ * No three.js here: the server entry imports this file.
2508
+ */
2509
+
2510
+ /** Where to look from: degrees around the model from its front (+Z, where glTF says a model faces) toward its right (+X), and degrees above the horizon. */
2511
+ type Angle = {
2512
+ azimuthDeg: number;
2513
+ elevationDeg?: number;
2514
+ };
2515
+ /** The framings with names. */
2516
+ declare const VIEW_WORDS: {
2517
+ readonly front: {
2518
+ readonly azimuthDeg: 0;
2519
+ readonly elevationDeg: 6;
2520
+ };
2521
+ readonly 'three-quarter': {
2522
+ readonly azimuthDeg: 35;
2523
+ readonly elevationDeg: 14;
2524
+ };
2525
+ readonly side: {
2526
+ readonly azimuthDeg: 90;
2527
+ readonly elevationDeg: 6;
2528
+ };
2529
+ readonly back: {
2530
+ readonly azimuthDeg: 180;
2531
+ readonly elevationDeg: 6;
2532
+ };
2533
+ readonly 'three-quarter-back': {
2534
+ readonly azimuthDeg: 145;
2535
+ readonly elevationDeg: 14;
2536
+ };
2537
+ readonly top: {
2538
+ readonly azimuthDeg: 0;
2539
+ readonly elevationDeg: 88;
2540
+ };
2541
+ };
2542
+ type ViewWord = keyof typeof VIEW_WORDS;
2543
+
2544
+ declare const HDRI_PRESETS: {
2545
+ readonly pergola_walkway: {
2546
+ readonly label: "Pergola Walkway";
2547
+ readonly description: "A garden walkway under a vine-covered pergola, high sun, greenery on every side.";
2548
+ readonly category: "day";
2549
+ readonly groundHeight: 1.6;
2550
+ readonly skyIrradiance: 1.7631801999999999;
2551
+ readonly preview: {
2552
+ readonly file: "pergola_walkway_1k.hdr";
2553
+ readonly resolution: 1024;
2554
+ };
2555
+ readonly render: {
2556
+ readonly file: "pergola_walkway_4k.exr";
2557
+ readonly resolution: 4096;
2558
+ };
2559
+ };
2560
+ readonly sunny_country_road: {
2561
+ readonly label: "Sunny Country Road";
2562
+ readonly description: "A dirt road between fields under a high midday sun.";
2563
+ readonly category: "day";
2564
+ readonly groundHeight: 1.6;
2565
+ readonly skyIrradiance: 1.0989418;
2566
+ readonly preview: {
2567
+ readonly file: "sunny_country_road_1k.hdr";
2568
+ readonly resolution: 1024;
2569
+ };
2570
+ readonly render: {
2571
+ readonly file: "sunny_country_road_4k.exr";
2572
+ readonly resolution: 4096;
2573
+ };
2574
+ };
2575
+ readonly "horn-koppe_spring": {
2576
+ readonly label: "Horn-Koppe Spring";
2577
+ readonly description: "Alpine meadow in spring, snow on the peaks, a high clear sun.";
2578
+ readonly category: "day";
2579
+ readonly groundHeight: 1.6;
2580
+ readonly skyIrradiance: 1.4612264;
2581
+ readonly preview: {
2582
+ readonly file: "horn-koppe_spring_1k.hdr";
2583
+ readonly resolution: 1024;
2584
+ };
2585
+ readonly render: {
2586
+ readonly file: "horn-koppe_spring_4k.exr";
2587
+ readonly resolution: 4096;
2588
+ };
2589
+ };
2590
+ readonly grasslands_sunset: {
2591
+ readonly label: "Grasslands Late Sun";
2592
+ readonly description: "Open grassland with the sun low but still white, a long afternoon.";
2593
+ readonly category: "day";
2594
+ readonly groundHeight: 1.6;
2595
+ readonly skyIrradiance: 3.9029496;
2596
+ readonly preview: {
2597
+ readonly file: "grasslands_sunset_1k.hdr";
2598
+ readonly resolution: 1024;
2599
+ };
2600
+ readonly render: {
2601
+ readonly file: "grasslands_sunset_4k.exr";
2602
+ readonly resolution: 4096;
2603
+ };
2604
+ };
2605
+ readonly je_gray_02: {
2606
+ readonly label: "Grey Park";
2607
+ readonly description: "A shaded park path, the sun low behind trees, a soft, cool day.";
2608
+ readonly category: "day";
2609
+ readonly groundHeight: 1.6;
2610
+ readonly skyIrradiance: 0.21612759999999998;
2611
+ readonly preview: {
2612
+ readonly file: "je_gray_02_1k.hdr";
2613
+ readonly resolution: 1024;
2614
+ };
2615
+ readonly render: {
2616
+ readonly file: "je_gray_02_4k.exr";
2617
+ readonly resolution: 4096;
2618
+ };
2619
+ };
2620
+ readonly qwantani_sunset: {
2621
+ readonly label: "Qwantani Sunset";
2622
+ readonly description: "Sunset over the veld: a warm horizon and a clear deep sky above.";
2623
+ readonly category: "golden";
2624
+ readonly groundHeight: 1.6;
2625
+ readonly skyIrradiance: 2.3187784;
2626
+ readonly preview: {
2627
+ readonly file: "qwantani_sunset_1k.hdr";
2628
+ readonly resolution: 1024;
2629
+ };
2630
+ readonly render: {
2631
+ readonly file: "qwantani_sunset_4k.exr";
2632
+ readonly resolution: 4096;
2633
+ };
2634
+ };
2635
+ readonly venice_sunset: {
2636
+ readonly label: "Venice Sunset";
2637
+ readonly description: "The lagoon at sunset, water and sky both gold.";
2638
+ readonly category: "golden";
2639
+ readonly groundHeight: 1.6;
2640
+ readonly skyIrradiance: 2.1780174;
2641
+ readonly preview: {
2642
+ readonly file: "venice_sunset_1k.hdr";
2643
+ readonly resolution: 1024;
2644
+ };
2645
+ readonly render: {
2646
+ readonly file: "venice_sunset_4k.exr";
2647
+ readonly resolution: 4096;
2648
+ };
2649
+ };
2650
+ readonly bambanani_sunset: {
2651
+ readonly label: "Bambanani Sunset";
2652
+ readonly description: "A township street at sunset, the sun red and low.";
2653
+ readonly category: "golden";
2654
+ readonly groundHeight: 1.6;
2655
+ readonly skyIrradiance: 3.300283399999999;
2656
+ readonly preview: {
2657
+ readonly file: "bambanani_sunset_1k.hdr";
2658
+ readonly resolution: 1024;
2659
+ };
2660
+ readonly render: {
2661
+ readonly file: "bambanani_sunset_4k.exr";
2662
+ readonly resolution: 4096;
2663
+ };
2664
+ };
2665
+ readonly umhlanga_sunrise: {
2666
+ readonly label: "Umhlanga Sunrise";
2667
+ readonly description: "Sunrise over the sea, the sun just clear of the horizon.";
2668
+ readonly category: "golden";
2669
+ readonly groundHeight: 1.6;
2670
+ readonly skyIrradiance: 3.3150258000000004;
2671
+ readonly preview: {
2672
+ readonly file: "umhlanga_sunrise_1k.hdr";
2673
+ readonly resolution: 1024;
2674
+ };
2675
+ readonly render: {
2676
+ readonly file: "umhlanga_sunrise_4k.exr";
2677
+ readonly resolution: 4096;
2678
+ };
2679
+ };
2680
+ readonly flamingo_pan: {
2681
+ readonly label: "Flamingo Pan";
2682
+ readonly description: "A salt pan at sunset, the sun on the horizon and a violet sky.";
2683
+ readonly category: "golden";
2684
+ readonly groundHeight: 1.6;
2685
+ readonly skyIrradiance: 3.1940932;
2686
+ readonly preview: {
2687
+ readonly file: "flamingo_pan_1k.hdr";
2688
+ readonly resolution: 1024;
2689
+ };
2690
+ readonly render: {
2691
+ readonly file: "flamingo_pan_4k.exr";
2692
+ readonly resolution: 4096;
2693
+ };
2694
+ };
2695
+ readonly minedump_flats: {
2696
+ readonly label: "Minedump Flats";
2697
+ readonly description: "Flat scrub at sunset under a hazy, dusty sky.";
2698
+ readonly category: "golden";
2699
+ readonly groundHeight: 1.6;
2700
+ readonly skyIrradiance: 2.9883286;
2701
+ readonly preview: {
2702
+ readonly file: "minedump_flats_1k.hdr";
2703
+ readonly resolution: 1024;
2704
+ };
2705
+ readonly render: {
2706
+ readonly file: "minedump_flats_4k.exr";
2707
+ readonly resolution: 4096;
2708
+ };
2709
+ };
2710
+ readonly sunset_fairway: {
2711
+ readonly label: "Sunset Fairway";
2712
+ readonly description: "A golf fairway at dusk, the sun already down and the sky lit from below.";
2713
+ readonly category: "golden";
2714
+ readonly groundHeight: 1.6;
2715
+ readonly skyIrradiance: 2.7264117999999997;
2716
+ readonly preview: {
2717
+ readonly file: "sunset_fairway_1k.hdr";
2718
+ readonly resolution: 1024;
2719
+ };
2720
+ readonly render: {
2721
+ readonly file: "sunset_fairway_4k.exr";
2722
+ readonly resolution: 4096;
2723
+ };
2724
+ };
2725
+ readonly the_sky_is_on_fire: {
2726
+ readonly label: "Sky on Fire";
2727
+ readonly description: "A blazing red-orange sunset over open country.";
2728
+ readonly category: "golden";
2729
+ readonly groundHeight: 1.6;
2730
+ readonly skyIrradiance: 2.4784194;
2731
+ readonly preview: {
2732
+ readonly file: "the_sky_is_on_fire_1k.hdr";
2733
+ readonly resolution: 1024;
2734
+ };
2735
+ readonly render: {
2736
+ readonly file: "the_sky_is_on_fire_4k.exr";
2737
+ readonly resolution: 4096;
2738
+ };
2739
+ };
2740
+ readonly dalkey_view: {
2741
+ readonly label: "Dalkey View";
2742
+ readonly description: "A coastal hillside under a bright overcast sky.";
2743
+ readonly category: "overcast";
2744
+ readonly groundHeight: 1.6;
2745
+ readonly skyIrradiance: 4.501861400000001;
2746
+ readonly preview: {
2747
+ readonly file: "dalkey_view_1k.hdr";
2748
+ readonly resolution: 1024;
2749
+ };
2750
+ readonly render: {
2751
+ readonly file: "dalkey_view_4k.exr";
2752
+ readonly resolution: 4096;
2753
+ };
2754
+ };
2755
+ readonly afrikaans_church_exterior: {
2756
+ readonly label: "Church Square";
2757
+ readonly description: "A quiet square under heavy cloud, a white church across it.";
2758
+ readonly category: "overcast";
2759
+ readonly groundHeight: 1.6;
2760
+ readonly skyIrradiance: 4.194848599999999;
2761
+ readonly preview: {
2762
+ readonly file: "afrikaans_church_exterior_1k.hdr";
2763
+ readonly resolution: 1024;
2764
+ };
2765
+ readonly render: {
2766
+ readonly file: "afrikaans_church_exterior_4k.exr";
2767
+ readonly resolution: 4096;
2768
+ };
2769
+ };
2770
+ readonly quarry_cloudy: {
2771
+ readonly label: "Cloudy Quarry";
2772
+ readonly description: "A stone quarry under an even grey sky.";
2773
+ readonly category: "overcast";
2774
+ readonly groundHeight: 1.6;
2775
+ readonly skyIrradiance: 3.9304787999999995;
2776
+ readonly preview: {
2777
+ readonly file: "quarry_cloudy_1k.hdr";
2778
+ readonly resolution: 1024;
2779
+ };
2780
+ readonly render: {
2781
+ readonly file: "quarry_cloudy_4k.exr";
2782
+ readonly resolution: 4096;
2783
+ };
2784
+ };
2785
+ readonly moonless_golf: {
2786
+ readonly label: "Moonless Golf Course";
2787
+ readonly description: "A moonless night over a golf course, a faint glow from the town.";
2788
+ readonly category: "night";
2789
+ readonly groundHeight: 1.6;
2790
+ readonly skyIrradiance: 0.5007998;
2791
+ readonly preview: {
2792
+ readonly file: "moonless_golf_1k.hdr";
2793
+ readonly resolution: 1024;
2794
+ };
2795
+ readonly render: {
2796
+ readonly file: "moonless_golf_4k.exr";
2797
+ readonly resolution: 4096;
2798
+ };
2799
+ };
2800
+ readonly preller_drive: {
2801
+ readonly label: "Preller Drive";
2802
+ readonly description: "A suburban street at night, sodium street lamps and dark trees.";
2803
+ readonly category: "night";
2804
+ readonly groundHeight: 1.6;
2805
+ readonly skyIrradiance: 0.5283702;
2806
+ readonly preview: {
2807
+ readonly file: "preller_drive_1k.hdr";
2808
+ readonly resolution: 1024;
2809
+ };
2810
+ readonly render: {
2811
+ readonly file: "preller_drive_4k.exr";
2812
+ readonly resolution: 4096;
2813
+ };
2814
+ };
2815
+ readonly satara_night: {
2816
+ readonly label: "Satara Night";
2817
+ readonly description: "A bush camp at night, a few lamps and a starry sky.";
2818
+ readonly category: "night";
2819
+ readonly groundHeight: 1.6;
2820
+ readonly skyIrradiance: 0.25447;
2821
+ readonly preview: {
2822
+ readonly file: "satara_night_1k.hdr";
2823
+ readonly resolution: 1024;
2824
+ };
2825
+ readonly render: {
2826
+ readonly file: "satara_night_4k.exr";
2827
+ readonly resolution: 4096;
2828
+ };
2829
+ };
2830
+ readonly ferndale_studio_11: {
2831
+ readonly label: "Ferndale Studio 11";
2832
+ readonly description: "High-contrast studio environment with broad soft sources.";
2833
+ readonly category: "studio";
2834
+ readonly groundHeight: 1.2;
2835
+ readonly skyIrradiance: 1.2286402;
2836
+ readonly preview: {
2837
+ readonly file: "ferndale_studio_11_1k.hdr";
2838
+ readonly resolution: 1024;
2839
+ };
2840
+ readonly render: {
2841
+ readonly file: "ferndale_studio_11_4k.exr";
2842
+ readonly resolution: 4096;
2843
+ };
2844
+ };
2845
+ readonly ferndale_studio_12: {
2846
+ readonly label: "Ferndale Studio 12";
2847
+ readonly description: "Balanced product studio with shaped highlights.";
2848
+ readonly category: "studio";
2849
+ readonly groundHeight: 1.2;
2850
+ readonly skyIrradiance: 1.2324262000000001;
2851
+ readonly preview: {
2852
+ readonly file: "ferndale_studio_12_1k.hdr";
2853
+ readonly resolution: 1024;
2854
+ };
2855
+ readonly render: {
2856
+ readonly file: "ferndale_studio_12_4k.exr";
2857
+ readonly resolution: 4096;
2858
+ };
2859
+ };
2860
+ readonly monochrome_studio_02: {
2861
+ readonly label: "Monochrome Studio 02";
2862
+ readonly description: "Neutral monochrome studio for material-focused renders.";
2863
+ readonly category: "studio";
2864
+ readonly groundHeight: 1.2;
2865
+ readonly skyIrradiance: 0.9193722;
2866
+ readonly preview: {
2867
+ readonly file: "monochrome_studio_02_1k.hdr";
2868
+ readonly resolution: 1024;
2869
+ };
2870
+ readonly render: {
2871
+ readonly file: "monochrome_studio_02_4k.exr";
2872
+ readonly resolution: 4096;
2873
+ };
2874
+ };
2875
+ readonly studio_kontrast_04: {
2876
+ readonly label: "Studio Kontrast 04";
2877
+ readonly description: "Directional studio contrast with crisp reflections.";
2878
+ readonly category: "studio";
2879
+ readonly groundHeight: 1.2;
2880
+ readonly skyIrradiance: 2.9173432;
2881
+ readonly preview: {
2882
+ readonly file: "studio_kontrast_04_1k.hdr";
2883
+ readonly resolution: 1024;
2884
+ };
2885
+ readonly render: {
2886
+ readonly file: "studio_kontrast_04_4k.exr";
2887
+ readonly resolution: 4096;
2888
+ };
2889
+ };
2890
+ readonly studio_small_03: {
2891
+ readonly label: "Small Studio 03";
2892
+ readonly description: "Compact studio environment with close softboxes.";
2893
+ readonly category: "studio";
2894
+ readonly groundHeight: 1.2;
2895
+ readonly skyIrradiance: 13.877922599999998;
2896
+ readonly preview: {
2897
+ readonly file: "studio_small_03_1k.hdr";
2898
+ readonly resolution: 1024;
2899
+ };
2900
+ readonly render: {
2901
+ readonly file: "studio_small_03_4k.exr";
2902
+ readonly resolution: 4096;
2903
+ };
2904
+ };
2905
+ };
2906
+ type HdriPresetName = keyof typeof HDRI_PRESETS;
2907
+
2908
+ /**
2909
+ * Generated by the preset library's sync script and by every room publish.
2910
+ * Do not edit.
2911
+ *
2912
+ * The rooms the SDK can offer. `build` is the content hash of the published
2913
+ * room definition; the manifest repeats it and the renderer refuses any
2914
+ * other, so what was framed in the browser is what gets traced.
2915
+ */
2916
+ type RoomPresetLighting = 'day' | 'golden' | 'overcast' | 'night';
2917
+ declare const ROOM_PRESETS: {
2918
+ readonly atelier_skylight: {
2919
+ readonly label: "Skylight Atelier";
2920
+ readonly description: "Concrete floor, tall plaster walls and two roof lights pouring foliage-broken sun straight down onto a low plinth.";
2921
+ readonly build: "94fc05030ebb";
2922
+ readonly presetsVersion: 1;
2923
+ readonly size: {
2924
+ readonly width: 5.5;
2925
+ readonly height: 3.4;
2926
+ readonly depth: 5.5;
2927
+ };
2928
+ readonly lighting: "day";
2929
+ readonly surfaces: {
2930
+ readonly floor: {
2931
+ readonly material: "polished_concrete";
2932
+ readonly color: "#ffffff";
2933
+ };
2934
+ readonly walls: {
2935
+ readonly material: "white_plaster";
2936
+ readonly color: "#f2efe8";
2937
+ };
2938
+ readonly ceiling: {
2939
+ readonly material: "matte_paint";
2940
+ readonly color: "#f5f4f0";
2941
+ };
2942
+ readonly sill: {
2943
+ readonly material: "travertine";
2944
+ };
2945
+ };
2946
+ readonly stand: {
2947
+ readonly type: "pedestal_plinth";
2948
+ readonly material: "carrara_marble";
2949
+ readonly x: 0;
2950
+ readonly z: -0.2;
2951
+ readonly rotationDeg: 0;
2952
+ readonly top: 0.3;
2953
+ readonly size: {
2954
+ readonly x: 0.9;
2955
+ readonly y: 0.3;
2956
+ readonly z: 0.9;
2957
+ };
2958
+ };
2959
+ readonly camera: {
2960
+ readonly position: readonly [-1.7918, 1.38, 1.4709];
2961
+ readonly target: readonly [0, 0.55, -0.2];
2962
+ readonly lensMm: 38;
2963
+ readonly fstop: 2.4000000953674316;
2964
+ };
2965
+ readonly preview: {
2966
+ readonly glb: "rooms/atelier_skylight/room.glb";
2967
+ readonly bytes: 1590368;
2968
+ readonly triangles: 70882;
2969
+ readonly textures: 21;
2970
+ };
2971
+ readonly complexity: {
2972
+ readonly enclosure: 1;
2973
+ readonly objects: 60;
2974
+ };
2975
+ readonly prebaked: readonly [];
2976
+ readonly plants: readonly ["potted_dracaena_01", "potted_monstera_01"];
2977
+ readonly pictures: readonly [];
2978
+ readonly previewBrightness: {
2979
+ readonly day: 0.775;
2980
+ readonly golden: 0.775;
2981
+ readonly overcast: 0.723;
2982
+ readonly night: 0.7;
2983
+ };
2984
+ readonly previewFill: {
2985
+ readonly day: {
2986
+ readonly sky: readonly [0.861, 1.012, 1.285];
2987
+ readonly ground: readonly [0.861, 1.012, 1.285];
2988
+ };
2989
+ readonly golden: {
2990
+ readonly sky: readonly [0.881, 1.021, 1.138];
2991
+ readonly ground: readonly [0.881, 1.021, 1.138];
2992
+ };
2993
+ readonly overcast: {
2994
+ readonly sky: readonly [0.997, 0.997, 1.041];
2995
+ readonly ground: readonly [0.997, 0.997, 1.041];
2996
+ };
2997
+ readonly night: {
2998
+ readonly sky: readonly [1.418, 0.905, 0.707];
2999
+ readonly ground: readonly [1.418, 0.905, 0.707];
3000
+ };
3001
+ };
3002
+ readonly exposure: {
3003
+ readonly day: 1.741;
3004
+ readonly golden: 1.741;
3005
+ readonly overcast: 1.866;
3006
+ readonly night: 2.144;
3007
+ };
3008
+ readonly hdri: {
3009
+ readonly day: null;
3010
+ readonly golden: null;
3011
+ readonly overcast: null;
3012
+ readonly night: null;
3013
+ };
3014
+ readonly skyIrradiance: {
3015
+ readonly day: 8.595;
3016
+ readonly golden: 5.273;
3017
+ readonly overcast: 3.286;
3018
+ readonly night: 0.011;
3019
+ };
3020
+ };
3021
+ readonly beam_loft: {
3022
+ readonly label: "Beam Loft";
3023
+ readonly description: "A tall plaster room under oak beams: three paned windows on the east side over a slatted oak ledge, dark boards, a pale modular sofa, a leather lounge chair and an opal globe on a long cord.";
3024
+ readonly build: "306f502d2191";
3025
+ readonly presetsVersion: 1;
3026
+ readonly size: {
3027
+ readonly width: 9;
3028
+ readonly height: 3.7;
3029
+ readonly depth: 7.6;
3030
+ };
3031
+ readonly lighting: "day";
3032
+ readonly surfaces: {
3033
+ readonly floor: {
3034
+ readonly material: "plank_flooring_04";
3035
+ readonly color: "#b7aea4";
3036
+ };
3037
+ readonly walls: {
3038
+ readonly material: "white_plaster";
3039
+ readonly color: "#eeebe5";
3040
+ };
3041
+ readonly ceiling: {
3042
+ readonly material: "white_plaster";
3043
+ readonly color: "#f2f0eb";
3044
+ };
3045
+ readonly sill: {
3046
+ readonly material: "coated_pine";
3047
+ };
3048
+ };
3049
+ readonly stand: {
3050
+ readonly type: "coffee_table_round_01";
3051
+ readonly material: null;
3052
+ readonly x: 0.2;
3053
+ readonly z: -1.5;
3054
+ readonly rotationDeg: 0;
3055
+ readonly top: 0.491;
3056
+ readonly size: {
3057
+ readonly x: 1.3013;
3058
+ readonly y: 0.491;
3059
+ readonly z: 1.3013;
3060
+ };
3061
+ };
3062
+ readonly camera: {
3063
+ readonly position: readonly [-1.7117, 1.3, 2.7937];
3064
+ readonly target: readonly [0.2, 0.741, -1.5];
3065
+ readonly lensMm: 21;
3066
+ readonly fstop: 5.599999904632568;
3067
+ };
3068
+ readonly preview: {
3069
+ readonly glb: "rooms/beam_loft/room.glb";
3070
+ readonly bytes: 2350456;
3071
+ readonly triangles: 102810;
3072
+ readonly textures: 37;
3073
+ };
3074
+ readonly complexity: {
3075
+ readonly enclosure: 1;
3076
+ readonly objects: 51;
3077
+ };
3078
+ readonly prebaked: readonly [];
3079
+ readonly plants: readonly ["potted_dracaena_01", "potted_plant_01"];
3080
+ readonly pictures: readonly [];
3081
+ readonly previewBrightness: {
3082
+ readonly day: 1.877;
3083
+ readonly golden: 2.176;
3084
+ readonly overcast: 0.381;
3085
+ readonly night: 0.191;
3086
+ };
3087
+ readonly previewFill: {
3088
+ readonly day: {
3089
+ readonly sky: readonly [0.976, 1.001, 1.058];
3090
+ readonly ground: readonly [1.076, 0.986, 0.914];
3091
+ };
3092
+ readonly golden: {
3093
+ readonly sky: readonly [1.242, 0.96, 0.686];
3094
+ readonly ground: readonly [1.355, 0.936, 0.586];
3095
+ };
3096
+ readonly overcast: {
3097
+ readonly sky: readonly [0.964, 1.004, 1.071];
3098
+ readonly ground: readonly [1.062, 0.989, 0.925];
3099
+ };
3100
+ readonly night: {
3101
+ readonly sky: readonly [1.466, 0.899, 0.627];
3102
+ readonly ground: readonly [1.59, 0.872, 0.533];
3103
+ };
3104
+ };
3105
+ readonly exposure: {
3106
+ readonly day: 1.741;
3107
+ readonly golden: 1.741;
3108
+ readonly overcast: 1.866;
3109
+ readonly night: 2.144;
3110
+ };
3111
+ readonly hdri: {
3112
+ readonly day: {
3113
+ readonly name: "horn-koppe_spring";
3114
+ readonly rotationDeg: 352;
3115
+ readonly groundHeight: 1.6;
3116
+ };
3117
+ readonly golden: {
3118
+ readonly name: "umhlanga_sunrise";
3119
+ readonly rotationDeg: 330;
3120
+ readonly groundHeight: 1.6;
3121
+ };
3122
+ readonly overcast: {
3123
+ readonly name: "dalkey_view";
3124
+ readonly rotationDeg: 0;
3125
+ readonly groundHeight: 1.6;
3126
+ };
3127
+ readonly night: {
3128
+ readonly name: "preller_drive";
3129
+ readonly rotationDeg: 0;
3130
+ readonly groundHeight: 1.6;
3131
+ };
3132
+ };
3133
+ readonly skyIrradiance: {
3134
+ readonly day: 8.707;
3135
+ readonly golden: 5.273;
3136
+ readonly overcast: 3.286;
3137
+ readonly night: 0.011;
3138
+ };
3139
+ };
3140
+ readonly conservatory_day: {
3141
+ readonly label: "Conservatory";
3142
+ readonly description: "Travertine and white plaster under a foliage-broken roof light, three east windows of morning sun, and all five plants of the set standing around a vase on a marble cylinder.";
3143
+ readonly build: "5d7e79e6a4fc";
3144
+ readonly presetsVersion: 1;
3145
+ readonly size: {
3146
+ readonly width: 5.6;
3147
+ readonly height: 3.4;
3148
+ readonly depth: 5.6;
3149
+ };
3150
+ readonly lighting: "day";
3151
+ readonly surfaces: {
3152
+ readonly floor: {
3153
+ readonly material: "travertine";
3154
+ readonly color: "#ffffff";
3155
+ };
3156
+ readonly walls: {
3157
+ readonly material: "white_plaster";
3158
+ readonly color: "#f9f3fa";
3159
+ };
3160
+ readonly ceiling: {
3161
+ readonly material: "matte_paint";
3162
+ readonly color: "#f5f4f0";
3163
+ };
3164
+ readonly sill: {
3165
+ readonly material: "travertine";
3166
+ };
3167
+ };
3168
+ readonly stand: {
3169
+ readonly type: "pedestal_cylinder";
3170
+ readonly material: "carrara_marble";
3171
+ readonly x: 0;
3172
+ readonly z: -0.15;
3173
+ readonly rotationDeg: 0;
3174
+ readonly top: 0.95;
3175
+ readonly size: {
3176
+ readonly x: 0.42;
3177
+ readonly y: 0.95;
3178
+ readonly z: 0.42;
3179
+ };
3180
+ };
3181
+ readonly camera: {
3182
+ readonly position: readonly [-0.2066, 1.3, -0.9848];
3183
+ readonly target: readonly [0, 1.2, -0.15];
3184
+ readonly lensMm: 26;
3185
+ readonly fstop: 4;
3186
+ };
3187
+ readonly preview: {
3188
+ readonly glb: "rooms/conservatory_day/room.glb";
3189
+ readonly bytes: 3067924;
3190
+ readonly triangles: 170081;
3191
+ readonly textures: 35;
3192
+ };
3193
+ readonly complexity: {
3194
+ readonly enclosure: 1;
3195
+ readonly objects: 54;
3196
+ };
3197
+ readonly prebaked: readonly [];
3198
+ readonly plants: readonly ["potted_bird_of_paradise_01", "potted_monstera_01", "potted_monstera_02", "potted_plant_04"];
3199
+ readonly pictures: readonly [];
3200
+ readonly previewBrightness: {
3201
+ readonly day: 1.551;
3202
+ readonly golden: 1.551;
3203
+ readonly overcast: 1.447;
3204
+ readonly night: 1.399;
3205
+ };
3206
+ readonly previewFill: {
3207
+ readonly day: {
3208
+ readonly sky: readonly [0.966, 1, 1.104];
3209
+ readonly ground: readonly [0.966, 1, 1.104];
3210
+ };
3211
+ readonly golden: {
3212
+ readonly sky: readonly [0.966, 1, 1.104];
3213
+ readonly ground: readonly [0.966, 1, 1.104];
3214
+ };
3215
+ readonly overcast: {
3216
+ readonly sky: readonly [1.001, 0.996, 1.036];
3217
+ readonly ground: readonly [1.001, 0.996, 1.036];
3218
+ };
3219
+ readonly night: {
3220
+ readonly sky: readonly [1.467, 0.898, 0.636];
3221
+ readonly ground: readonly [1.467, 0.898, 0.636];
3222
+ };
3223
+ };
3224
+ readonly exposure: {
3225
+ readonly day: 1.741;
3226
+ readonly golden: 1.741;
3227
+ readonly overcast: 1.866;
3228
+ readonly night: 2.144;
3229
+ };
3230
+ readonly hdri: {
3231
+ readonly day: {
3232
+ readonly name: "grasslands_sunset";
3233
+ readonly rotationDeg: 299.3;
3234
+ readonly groundHeight: 1.6;
3235
+ };
3236
+ readonly golden: {
3237
+ readonly name: "qwantani_sunset";
3238
+ readonly rotationDeg: 299;
3239
+ readonly groundHeight: 1.6;
3240
+ };
3241
+ readonly overcast: {
3242
+ readonly name: "dalkey_view";
3243
+ readonly rotationDeg: 0;
3244
+ readonly groundHeight: 1.6;
3245
+ };
3246
+ readonly night: {
3247
+ readonly name: "moonless_golf";
3248
+ readonly rotationDeg: 0;
3249
+ readonly groundHeight: 1.6;
3250
+ };
3251
+ };
3252
+ readonly skyIrradiance: {
3253
+ readonly day: 8.707;
3254
+ readonly golden: 8.707;
3255
+ readonly overcast: 3.286;
3256
+ readonly night: 0.011;
3257
+ };
3258
+ };
3259
+ readonly dining_golden: {
3260
+ readonly label: "Golden Hour Dining";
3261
+ readonly description: "Painted brick and dark planks, low sun through rippled cast glass, a walnut table set for four off to one side and a bird of paradise holding the light.";
3262
+ readonly build: "8def5bc58527";
3263
+ readonly presetsVersion: 1;
3264
+ readonly size: {
3265
+ readonly width: 7;
3266
+ readonly height: 3.3;
3267
+ readonly depth: 5.2;
3268
+ };
3269
+ readonly lighting: "golden";
3270
+ readonly surfaces: {
3271
+ readonly floor: {
3272
+ readonly material: "oak_veneer_05";
3273
+ readonly color: "#ffffff";
3274
+ };
3275
+ readonly walls: {
3276
+ readonly material: "matte_paint";
3277
+ readonly color: "#efe6d9";
3278
+ };
3279
+ readonly ceiling: {
3280
+ readonly material: "matte_paint";
3281
+ readonly color: "#f5f4f0";
3282
+ };
3283
+ readonly sill: {
3284
+ readonly material: "polished_concrete";
3285
+ };
3286
+ };
3287
+ readonly stand: {
3288
+ readonly type: "round_wooden_table_01";
3289
+ readonly material: null;
3290
+ readonly x: 0.69;
3291
+ readonly z: -0.38;
3292
+ readonly rotationDeg: 0;
3293
+ readonly top: 1.005;
3294
+ readonly size: {
3295
+ readonly x: 1.3993;
3296
+ readonly y: 1.005;
3297
+ readonly z: 1.3993;
3298
+ };
3299
+ };
3300
+ readonly camera: {
3301
+ readonly position: readonly [0.9851, 1.21, -0.0142];
3302
+ readonly target: readonly [0.69, 1.255, -0.38];
3303
+ readonly lensMm: 24;
3304
+ readonly fstop: 4;
3305
+ };
3306
+ readonly preview: {
3307
+ readonly glb: "rooms/dining_golden/room.glb";
3308
+ readonly bytes: 996512;
3309
+ readonly triangles: 28327;
3310
+ readonly textures: 24;
3311
+ };
3312
+ readonly complexity: {
3313
+ readonly enclosure: 1;
3314
+ readonly objects: 53;
3315
+ };
3316
+ readonly prebaked: readonly [];
3317
+ readonly plants: readonly ["potted_bird_of_paradise_01", "potted_plant_04"];
3318
+ readonly pictures: readonly [];
3319
+ readonly previewBrightness: {
3320
+ readonly day: 0.31;
3321
+ readonly golden: 0.31;
3322
+ readonly overcast: 0.289;
3323
+ readonly night: 0.28;
3324
+ };
3325
+ readonly previewFill: {
3326
+ readonly day: {
3327
+ readonly sky: readonly [1.331, 0.939, 0.631];
3328
+ readonly ground: readonly [1.331, 0.939, 0.631];
3329
+ };
3330
+ readonly golden: {
3331
+ readonly sky: readonly [1.338, 0.937, 0.63];
3332
+ readonly ground: readonly [1.338, 0.937, 0.63];
3333
+ };
3334
+ readonly overcast: {
3335
+ readonly sky: readonly [1.297, 0.934, 0.775];
3336
+ readonly ground: readonly [1.297, 0.934, 0.775];
3337
+ };
3338
+ readonly night: {
3339
+ readonly sky: readonly [1.466, 0.899, 0.627];
3340
+ readonly ground: readonly [1.466, 0.899, 0.627];
3341
+ };
3342
+ };
3343
+ readonly exposure: {
3344
+ readonly day: 1.741;
3345
+ readonly golden: 1.741;
3346
+ readonly overcast: 1.866;
3347
+ readonly night: 2.144;
3348
+ };
3349
+ readonly hdri: {
3350
+ readonly day: {
3351
+ readonly name: "pergola_walkway";
3352
+ readonly rotationDeg: 59.7;
3353
+ readonly groundHeight: 1.6;
3354
+ };
3355
+ readonly golden: {
3356
+ readonly name: "bambanani_sunset";
3357
+ readonly rotationDeg: 104;
3358
+ readonly groundHeight: 1.6;
3359
+ };
3360
+ readonly overcast: {
3361
+ readonly name: "dalkey_view";
3362
+ readonly rotationDeg: 0;
3363
+ readonly groundHeight: 1.6;
3364
+ };
3365
+ readonly night: {
3366
+ readonly name: "moonless_golf";
3367
+ readonly rotationDeg: 0;
3368
+ readonly groundHeight: 1.6;
3369
+ };
3370
+ };
3371
+ readonly skyIrradiance: {
3372
+ readonly day: 5.273;
3373
+ readonly golden: 5.273;
3374
+ readonly overcast: 3.286;
3375
+ readonly night: 0.011;
3376
+ };
3377
+ };
3378
+ readonly gallery_day: {
3379
+ readonly label: "Daylight Gallery";
3380
+ readonly description: "White plaster and oak, three tall west windows with foliage-dappled midday sun, shelves of ceramics behind the centerpiece.";
3381
+ readonly build: "833d6eaec67f";
3382
+ readonly presetsVersion: 1;
3383
+ readonly size: {
3384
+ readonly width: 6;
3385
+ readonly height: 3.2;
3386
+ readonly depth: 5;
3387
+ };
3388
+ readonly lighting: "day";
3389
+ readonly surfaces: {
3390
+ readonly floor: {
3391
+ readonly material: "oak_floor";
3392
+ readonly color: "#ffffff";
3393
+ };
3394
+ readonly walls: {
3395
+ readonly material: "white_plaster";
3396
+ readonly color: "#f4f1ea";
3397
+ };
3398
+ readonly ceiling: {
3399
+ readonly material: "matte_paint";
3400
+ readonly color: "#f5f4f0";
3401
+ };
3402
+ readonly sill: {
3403
+ readonly material: "travertine";
3404
+ };
3405
+ };
3406
+ readonly stand: {
3407
+ readonly type: "pedestal_block";
3408
+ readonly material: "carrara_marble";
3409
+ readonly x: 0.18;
3410
+ readonly z: -0.36;
3411
+ readonly rotationDeg: 0;
3412
+ readonly top: 1;
3413
+ readonly size: {
3414
+ readonly x: 0.4;
3415
+ readonly y: 1;
3416
+ readonly z: 0.4;
3417
+ };
3418
+ };
3419
+ readonly camera: {
3420
+ readonly position: readonly [0.3653, 1.17, -0.0055];
3421
+ readonly target: readonly [0.18, 1.25, -0.36];
3422
+ readonly lensMm: 34;
3423
+ readonly fstop: 4;
3424
+ };
3425
+ readonly preview: {
3426
+ readonly glb: "rooms/gallery_day/room.glb";
3427
+ readonly bytes: 2100876;
3428
+ readonly triangles: 118960;
3429
+ readonly textures: 21;
3430
+ };
3431
+ readonly complexity: {
3432
+ readonly enclosure: 1;
3433
+ readonly objects: 67;
3434
+ };
3435
+ readonly prebaked: readonly [];
3436
+ readonly plants: readonly ["potted_plant_01", "potted_plant_04"];
3437
+ readonly pictures: readonly [];
3438
+ readonly previewBrightness: {
3439
+ readonly day: 0.093;
3440
+ readonly golden: 0.098;
3441
+ readonly overcast: 0.043;
3442
+ readonly night: 0.093;
3443
+ };
3444
+ readonly previewFill: {
3445
+ readonly day: {
3446
+ readonly sky: readonly [1.101, 0.978, 0.915];
3447
+ readonly ground: readonly [1.101, 0.978, 0.915];
3448
+ };
3449
+ readonly golden: {
3450
+ readonly sky: readonly [1.1, 0.979, 0.914];
3451
+ readonly ground: readonly [1.1, 0.979, 0.914];
3452
+ };
3453
+ readonly overcast: {
3454
+ readonly sky: readonly [1.266, 0.942, 0.791];
3455
+ readonly ground: readonly [1.266, 0.942, 0.791];
3456
+ };
3457
+ readonly night: {
3458
+ readonly sky: readonly [1.42, 0.91, 0.651];
3459
+ readonly ground: readonly [1.42, 0.91, 0.651];
3460
+ };
3461
+ };
3462
+ readonly exposure: {
3463
+ readonly day: 1.741;
3464
+ readonly golden: 1.741;
3465
+ readonly overcast: 1.866;
3466
+ readonly night: 2.144;
3467
+ };
3468
+ readonly hdri: {
3469
+ readonly day: {
3470
+ readonly name: "sunny_country_road";
3471
+ readonly rotationDeg: 127;
3472
+ readonly groundHeight: 1.6;
3473
+ };
3474
+ readonly golden: {
3475
+ readonly name: "qwantani_sunset";
3476
+ readonly rotationDeg: 127;
3477
+ readonly groundHeight: 1.6;
3478
+ };
3479
+ readonly overcast: {
3480
+ readonly name: "dalkey_view";
3481
+ readonly rotationDeg: 0;
3482
+ readonly groundHeight: 1.6;
3483
+ };
3484
+ readonly night: {
3485
+ readonly name: "moonless_golf";
3486
+ readonly rotationDeg: 0;
3487
+ readonly groundHeight: 1.6;
3488
+ };
3489
+ };
3490
+ readonly skyIrradiance: {
3491
+ readonly day: 8.212;
3492
+ readonly golden: 8.212;
3493
+ readonly overcast: 3.286;
3494
+ readonly night: 0.011;
3495
+ };
3496
+ };
3497
+ readonly living_evening: {
3498
+ readonly label: "Evening Living Room";
3499
+ readonly description: "Warm greige and hardwood after dark: a channel-tufted sofa under a washed wall, a plaster console opposite, monstera and palm in the corners.";
3500
+ readonly build: "14a4e4f17110";
3501
+ readonly presetsVersion: 1;
3502
+ readonly size: {
3503
+ readonly width: 6.4;
3504
+ readonly height: 3;
3505
+ readonly depth: 5.4;
3506
+ };
3507
+ readonly lighting: "night";
3508
+ readonly surfaces: {
3509
+ readonly floor: {
3510
+ readonly material: "wooden_floor_02";
3511
+ readonly color: "#ffffff";
3512
+ };
3513
+ readonly walls: {
3514
+ readonly material: "matte_paint";
3515
+ readonly color: "#e5ded2";
3516
+ };
3517
+ readonly ceiling: {
3518
+ readonly material: "matte_paint";
3519
+ readonly color: "#f5f4f0";
3520
+ };
3521
+ readonly sill: {
3522
+ readonly material: "travertine";
3523
+ };
3524
+ };
3525
+ readonly stand: {
3526
+ readonly type: "pedestal_cylinder";
3527
+ readonly material: "carrara_marble";
3528
+ readonly x: 0.75;
3529
+ readonly z: -0.15;
3530
+ readonly rotationDeg: 0;
3531
+ readonly top: 0.95;
3532
+ readonly size: {
3533
+ readonly x: 0.42;
3534
+ readonly y: 0.95;
3535
+ readonly z: 0.42;
3536
+ };
3537
+ };
3538
+ readonly camera: {
3539
+ readonly position: readonly [1.8407, 0.78, 1.0613];
3540
+ readonly target: readonly [0.75, 1.2, -0.15];
3541
+ readonly lensMm: 32;
3542
+ readonly fstop: 3.200000047683716;
3543
+ };
3544
+ readonly preview: {
3545
+ readonly glb: "rooms/living_evening/room.glb";
3546
+ readonly bytes: 4354704;
3547
+ readonly triangles: 236876;
3548
+ readonly textures: 21;
3549
+ };
3550
+ readonly complexity: {
3551
+ readonly enclosure: 1;
3552
+ readonly objects: 95;
3553
+ };
3554
+ readonly prebaked: readonly [];
3555
+ readonly plants: readonly ["potted_monstera_02", "potted_palm_01"];
3556
+ readonly pictures: readonly [{
3557
+ readonly wall: "north";
3558
+ readonly size: 0.7;
3559
+ }];
3560
+ readonly previewBrightness: {
3561
+ readonly day: 0.114;
3562
+ readonly golden: 0.114;
3563
+ readonly overcast: 0.106;
3564
+ readonly night: 0.103;
3565
+ };
3566
+ readonly previewFill: {
3567
+ readonly day: {
3568
+ readonly sky: readonly [1.177, 0.96, 0.871];
3569
+ readonly ground: readonly [1.177, 0.96, 0.871];
3570
+ };
3571
+ readonly golden: {
3572
+ readonly sky: readonly [1.352, 0.932, 0.631];
3573
+ readonly ground: readonly [1.352, 0.932, 0.631];
3574
+ };
3575
+ readonly overcast: {
3576
+ readonly sky: readonly [1.404, 0.911, 0.688];
3577
+ readonly ground: readonly [1.404, 0.911, 0.688];
3578
+ };
3579
+ readonly night: {
3580
+ readonly sky: readonly [1.488, 0.894, 0.615];
3581
+ readonly ground: readonly [1.488, 0.894, 0.615];
3582
+ };
3583
+ };
3584
+ readonly exposure: {
3585
+ readonly day: 1.741;
3586
+ readonly golden: 1.741;
3587
+ readonly overcast: 1.866;
3588
+ readonly night: 2.144;
3589
+ };
3590
+ readonly hdri: {
3591
+ readonly day: {
3592
+ readonly name: "pergola_walkway";
3593
+ readonly rotationDeg: 79.7;
3594
+ readonly groundHeight: 1.6;
3595
+ };
3596
+ readonly golden: {
3597
+ readonly name: "qwantani_sunset";
3598
+ readonly rotationDeg: 136;
3599
+ readonly groundHeight: 1.6;
3600
+ };
3601
+ readonly overcast: {
3602
+ readonly name: "dalkey_view";
3603
+ readonly rotationDeg: 0;
3604
+ readonly groundHeight: 1.6;
3605
+ };
3606
+ readonly night: {
3607
+ readonly name: "moonless_golf";
3608
+ readonly rotationDeg: 0;
3609
+ readonly groundHeight: 1.6;
3610
+ };
3611
+ };
3612
+ readonly skyIrradiance: {
3613
+ readonly day: 8.595;
3614
+ readonly golden: 5.273;
3615
+ readonly overcast: 3.286;
3616
+ readonly night: 0.011;
3617
+ };
3618
+ };
3619
+ readonly loft_golden: {
3620
+ readonly label: "Golden Hour Loft";
3621
+ readonly description: "Painted brick and dark planks, two big steel-framed windows of rippled cast glass, low warm sun and a hint of haze.";
3622
+ readonly build: "4a50da011646";
3623
+ readonly presetsVersion: 1;
3624
+ readonly size: {
3625
+ readonly width: 7;
3626
+ readonly height: 3.6;
3627
+ readonly depth: 5.5;
3628
+ };
3629
+ readonly lighting: "golden";
3630
+ readonly surfaces: {
3631
+ readonly floor: {
3632
+ readonly material: "plank_flooring_04";
3633
+ readonly color: "#ffffff";
3634
+ };
3635
+ readonly walls: {
3636
+ readonly material: "white_plaster";
3637
+ readonly color: "#f0e7da";
3638
+ };
3639
+ readonly ceiling: {
3640
+ readonly material: "matte_paint";
3641
+ readonly color: "#f5f4f0";
3642
+ };
3643
+ readonly sill: {
3644
+ readonly material: "polished_concrete";
3645
+ };
3646
+ };
3647
+ readonly stand: {
3648
+ readonly type: "pedestal_cylinder";
3649
+ readonly material: "carrara_marble";
3650
+ readonly x: 0.1;
3651
+ readonly z: -0.3;
3652
+ readonly rotationDeg: 0;
3653
+ readonly top: 0.95;
3654
+ readonly size: {
3655
+ readonly x: 0.42;
3656
+ readonly y: 0.95;
3657
+ readonly z: 0.42;
3658
+ };
3659
+ };
3660
+ readonly camera: {
3661
+ readonly position: readonly [0.7923, 1.3, 0.6924];
3662
+ readonly target: readonly [0.1, 1.2, -0.3];
3663
+ readonly lensMm: 35;
3664
+ readonly fstop: 2;
3665
+ };
3666
+ readonly preview: {
3667
+ readonly glb: "rooms/loft_golden/room.glb";
3668
+ readonly bytes: 3545780;
3669
+ readonly triangles: 164621;
3670
+ readonly textures: 23;
3671
+ };
3672
+ readonly complexity: {
3673
+ readonly enclosure: 1;
3674
+ readonly objects: 53;
3675
+ };
3676
+ readonly prebaked: readonly [];
3677
+ readonly plants: readonly ["potted_monstera_01", "potted_palm_01"];
3678
+ readonly pictures: readonly [];
3679
+ readonly previewBrightness: {
3680
+ readonly day: 1.034;
3681
+ readonly golden: 1.034;
3682
+ readonly overcast: 0.965;
3683
+ readonly night: 0.933;
3684
+ };
3685
+ readonly previewFill: {
3686
+ readonly day: {
3687
+ readonly sky: readonly [1.239, 0.956, 0.735];
3688
+ readonly ground: readonly [1.239, 0.956, 0.735];
3689
+ };
3690
+ readonly golden: {
3691
+ readonly sky: readonly [1.414, 0.896, 0.816];
3692
+ readonly ground: readonly [1.414, 0.896, 0.816];
3693
+ };
3694
+ readonly overcast: {
3695
+ readonly sky: readonly [0.953, 1.019, 0.947];
3696
+ readonly ground: readonly [0.953, 1.019, 0.947];
3697
+ };
3698
+ readonly night: {
3699
+ readonly sky: readonly [1.41, 0.915, 0.639];
3700
+ readonly ground: readonly [1.41, 0.915, 0.639];
3701
+ };
3702
+ };
3703
+ readonly exposure: {
3704
+ readonly day: 1.741;
3705
+ readonly golden: 1.741;
3706
+ readonly overcast: 1.866;
3707
+ readonly night: 2.144;
3708
+ };
3709
+ readonly hdri: {
3710
+ readonly day: {
3711
+ readonly name: "pergola_walkway";
3712
+ readonly rotationDeg: 63.7;
3713
+ readonly groundHeight: 1.6;
3714
+ };
3715
+ readonly golden: {
3716
+ readonly name: "the_sky_is_on_fire";
3717
+ readonly rotationDeg: 45.4;
3718
+ readonly groundHeight: 1.6;
3719
+ };
3720
+ readonly overcast: {
3721
+ readonly name: "dalkey_view";
3722
+ readonly rotationDeg: 0;
3723
+ readonly groundHeight: 1.6;
3724
+ };
3725
+ readonly night: {
3726
+ readonly name: "moonless_golf";
3727
+ readonly rotationDeg: 0;
3728
+ readonly groundHeight: 1.6;
3729
+ };
3730
+ };
3731
+ readonly skyIrradiance: {
3732
+ readonly day: 5.273;
3733
+ readonly golden: 5.273;
3734
+ readonly overcast: 3.286;
3735
+ readonly night: 0.011;
3736
+ };
3737
+ };
3738
+ readonly noir_parlour: {
3739
+ readonly label: "Noir Parlour";
3740
+ readonly description: "Charcoal walls in frame mouldings above a dado rail, a pale skirting, grey oak boards, two leather lounge chairs under a pair of white pendants and a print between them.";
3741
+ readonly build: "c444e081de93";
3742
+ readonly presetsVersion: 1;
3743
+ readonly size: {
3744
+ readonly width: 7.6;
3745
+ readonly height: 3.4;
3746
+ readonly depth: 6.2;
3747
+ };
3748
+ readonly lighting: "golden";
3749
+ readonly surfaces: {
3750
+ readonly floor: {
3751
+ readonly material: "wooden_floor_02";
3752
+ readonly color: "#7d7872";
3753
+ };
3754
+ readonly walls: {
3755
+ readonly material: "matte_paint";
3756
+ readonly color: "#2b2b2f";
3757
+ };
3758
+ readonly ceiling: {
3759
+ readonly material: "matte_paint";
3760
+ readonly color: "#3b3b40";
3761
+ };
3762
+ readonly sill: {
3763
+ readonly material: "polished_concrete";
3764
+ };
3765
+ };
3766
+ readonly stand: {
3767
+ readonly type: "oval_side_table";
3768
+ readonly material: null;
3769
+ readonly x: 0;
3770
+ readonly z: -1.9;
3771
+ readonly rotationDeg: 0;
3772
+ readonly top: 0.6048;
3773
+ readonly size: {
3774
+ readonly x: 0.562;
3775
+ readonly y: 0.605;
3776
+ readonly z: 0.34;
3777
+ };
3778
+ };
3779
+ readonly camera: {
3780
+ readonly position: readonly [0, 1.15, 2.5];
3781
+ readonly target: readonly [0, 0.8548, -1.9];
3782
+ readonly lensMm: 28;
3783
+ readonly fstop: 4;
3784
+ };
3785
+ readonly preview: {
3786
+ readonly glb: "rooms/noir_parlour/room.glb";
3787
+ readonly bytes: 1399740;
3788
+ readonly triangles: 55172;
3789
+ readonly textures: 20;
3790
+ };
3791
+ readonly complexity: {
3792
+ readonly enclosure: 1;
3793
+ readonly objects: 55;
3794
+ };
3795
+ readonly prebaked: readonly [];
3796
+ readonly plants: readonly ["potted_dracaena_01"];
3797
+ readonly pictures: readonly [{
3798
+ readonly wall: "north";
3799
+ readonly size: 1.25;
3800
+ }];
3801
+ readonly previewBrightness: {
3802
+ readonly day: 0.362;
3803
+ readonly golden: 0.367;
3804
+ readonly overcast: 0.111;
3805
+ readonly night: 0.168;
3806
+ };
3807
+ readonly previewFill: {
3808
+ readonly day: {
3809
+ readonly sky: readonly [1.021, 0.994, 0.999];
3810
+ readonly ground: readonly [1.101, 0.982, 0.884];
3811
+ };
3812
+ readonly golden: {
3813
+ readonly sky: readonly [1.22, 0.963, 0.723];
3814
+ readonly ground: readonly [1.308, 0.945, 0.636];
3815
+ };
3816
+ readonly overcast: {
3817
+ readonly sky: readonly [1.083, 0.979, 0.964];
3818
+ readonly ground: readonly [1.167, 0.965, 0.852];
3819
+ };
3820
+ readonly night: {
3821
+ readonly sky: readonly [1.486, 0.894, 0.618];
3822
+ readonly ground: readonly [1.584, 0.873, 0.54];
3823
+ };
3824
+ };
3825
+ readonly exposure: {
3826
+ readonly day: 1.741;
3827
+ readonly golden: 1.741;
3828
+ readonly overcast: 1.866;
3829
+ readonly night: 2.144;
3830
+ };
3831
+ readonly hdri: {
3832
+ readonly day: {
3833
+ readonly name: "horn-koppe_spring";
3834
+ readonly rotationDeg: 114;
3835
+ readonly groundHeight: 1.6;
3836
+ };
3837
+ readonly golden: {
3838
+ readonly name: "bambanani_sunset";
3839
+ readonly rotationDeg: 136;
3840
+ readonly groundHeight: 1.6;
3841
+ };
3842
+ readonly overcast: {
3843
+ readonly name: "dalkey_view";
3844
+ readonly rotationDeg: 0;
3845
+ readonly groundHeight: 1.6;
3846
+ };
3847
+ readonly night: {
3848
+ readonly name: "satara_night";
3849
+ readonly rotationDeg: 0;
3850
+ readonly groundHeight: 1.6;
3851
+ };
3852
+ };
3853
+ readonly skyIrradiance: {
3854
+ readonly day: 8.34;
3855
+ readonly golden: 5.529;
3856
+ readonly overcast: 3.286;
3857
+ readonly night: 0.011;
3858
+ };
3859
+ };
3860
+ readonly plaster_atelier: {
3861
+ readonly label: "Plaster Atelier";
3862
+ readonly description: "Raw plaster, a concrete floor and one tall opening on the west side that lays a slab of sun across the room. A low white sofa against a travertine wall, a dome pendant, a palm in the corner.";
3863
+ readonly build: "6ee46115fa42";
3864
+ readonly presetsVersion: 1;
3865
+ readonly size: {
3866
+ readonly width: 10;
3867
+ readonly height: 3.8;
3868
+ readonly depth: 7.6;
3869
+ };
3870
+ readonly lighting: "day";
3871
+ readonly surfaces: {
3872
+ readonly floor: {
3873
+ readonly material: "polished_concrete";
3874
+ readonly color: "#e2e0dc";
3875
+ };
3876
+ readonly walls: {
3877
+ readonly material: "white_plaster";
3878
+ readonly color: "#dcd7ce";
3879
+ };
3880
+ readonly ceiling: {
3881
+ readonly material: "white_plaster";
3882
+ readonly color: "#f1efea";
3883
+ };
3884
+ readonly sill: {
3885
+ readonly material: "polished_concrete";
3886
+ };
3887
+ };
3888
+ readonly stand: {
3889
+ readonly type: "pedestal_cylinder";
3890
+ readonly material: "travertine";
3891
+ readonly x: -1.7;
3892
+ readonly z: -1;
3893
+ readonly rotationDeg: 0;
3894
+ readonly top: 0.95;
3895
+ readonly size: {
3896
+ readonly x: 0.42;
3897
+ readonly y: 0.95;
3898
+ readonly z: 0.42;
3899
+ };
3900
+ };
3901
+ readonly camera: {
3902
+ readonly position: readonly [-2.6356, 1.2, 3.4017];
3903
+ readonly target: readonly [-1.7, 1.2, -1];
3904
+ readonly lensMm: 24;
3905
+ readonly fstop: 5.599999904632568;
3906
+ };
3907
+ readonly preview: {
3908
+ readonly glb: "rooms/plaster_atelier/room.glb";
3909
+ readonly bytes: 3991680;
3910
+ readonly triangles: 187489;
3911
+ readonly textures: 30;
3912
+ };
3913
+ readonly complexity: {
3914
+ readonly enclosure: 1;
3915
+ readonly objects: 37;
3916
+ };
3917
+ readonly prebaked: readonly [];
3918
+ readonly plants: readonly ["potted_palm_01", "potted_plant_01"];
3919
+ readonly pictures: readonly [];
3920
+ readonly previewBrightness: {
3921
+ readonly day: 1.478;
3922
+ readonly golden: 1.742;
3923
+ readonly overcast: 0.314;
3924
+ readonly night: 0.182;
3925
+ };
3926
+ readonly previewFill: {
3927
+ readonly day: {
3928
+ readonly sky: readonly [0.975, 1.002, 1.058];
3929
+ readonly ground: readonly [0.993, 1.001, 1.015];
3930
+ };
3931
+ readonly golden: {
3932
+ readonly sky: readonly [1.223, 0.964, 0.704];
3933
+ readonly ground: readonly [1.244, 0.961, 0.674];
3934
+ };
3935
+ readonly overcast: {
3936
+ readonly sky: readonly [0.964, 1.004, 1.071];
3937
+ readonly ground: readonly [0.982, 1.003, 1.027];
3938
+ };
3939
+ readonly night: {
3940
+ readonly sky: readonly [1.427, 0.909, 0.647];
3941
+ readonly ground: readonly [1.449, 0.905, 0.618];
3942
+ };
3943
+ };
3944
+ readonly exposure: {
3945
+ readonly day: 1.741;
3946
+ readonly golden: 1.741;
3947
+ readonly overcast: 1.866;
3948
+ readonly night: 2.144;
3949
+ };
3950
+ readonly hdri: {
3951
+ readonly day: {
3952
+ readonly name: "sunny_country_road";
3953
+ readonly rotationDeg: 122;
3954
+ readonly groundHeight: 1.6;
3955
+ };
3956
+ readonly golden: {
3957
+ readonly name: "venice_sunset";
3958
+ readonly rotationDeg: 136;
3959
+ readonly groundHeight: 1.6;
3960
+ };
3961
+ readonly overcast: {
3962
+ readonly name: "dalkey_view";
3963
+ readonly rotationDeg: 0;
3964
+ readonly groundHeight: 1.6;
3965
+ };
3966
+ readonly night: {
3967
+ readonly name: "preller_drive";
3968
+ readonly rotationDeg: 0;
3969
+ readonly groundHeight: 1.6;
3970
+ };
3971
+ };
3972
+ readonly skyIrradiance: {
3973
+ readonly day: 8.633;
3974
+ readonly golden: 5.273;
3975
+ readonly overcast: 3.286;
3976
+ readonly night: 0.011;
3977
+ };
3978
+ };
3979
+ readonly slat_lounge: {
3980
+ readonly label: "Oak Slat Lounge";
3981
+ readonly description: "Oak battens either side of a charcoal wall, a low sofa under a large print, and tall windows behind sheers on the east side.";
3982
+ readonly build: "d4b3a554137d";
3983
+ readonly presetsVersion: 1;
3984
+ readonly size: {
3985
+ readonly width: 8.4;
3986
+ readonly height: 3;
3987
+ readonly depth: 6.4;
3988
+ };
3989
+ readonly lighting: "day";
3990
+ readonly surfaces: {
3991
+ readonly floor: {
3992
+ readonly material: "wooden_floor_02";
3993
+ readonly color: "#e6e2dc";
3994
+ };
3995
+ readonly walls: {
3996
+ readonly material: "matte_paint";
3997
+ readonly color: "#e9e6e0";
3998
+ };
3999
+ readonly ceiling: {
4000
+ readonly material: "matte_paint";
4001
+ readonly color: "#f5f4f0";
4002
+ };
4003
+ readonly sill: {
4004
+ readonly material: "polished_concrete";
4005
+ };
4006
+ };
4007
+ readonly stand: {
4008
+ readonly type: "coffee_table_round_01";
4009
+ readonly material: null;
4010
+ readonly x: -0.7;
4011
+ readonly z: -0.7;
4012
+ readonly rotationDeg: 0;
4013
+ readonly top: 0.491;
4014
+ readonly size: {
4015
+ readonly x: 1.3013;
4016
+ readonly y: 0.491;
4017
+ readonly z: 1.3013;
4018
+ };
4019
+ };
4020
+ readonly camera: {
4021
+ readonly position: readonly [-2.75, 1.2, 2.8507];
4022
+ readonly target: readonly [-0.7, 0.741, -0.7];
4023
+ readonly lensMm: 24;
4024
+ readonly fstop: 5.599999904632568;
4025
+ };
4026
+ readonly preview: {
4027
+ readonly glb: "rooms/slat_lounge/room.glb";
4028
+ readonly bytes: 2042948;
4029
+ readonly triangles: 122153;
4030
+ readonly textures: 30;
4031
+ };
4032
+ readonly complexity: {
4033
+ readonly enclosure: 1;
4034
+ readonly objects: 77;
4035
+ };
4036
+ readonly prebaked: readonly [];
4037
+ readonly plants: readonly ["potted_bird_of_paradise_01", "potted_monstera_02"];
4038
+ readonly pictures: readonly [{
4039
+ readonly wall: "north";
4040
+ readonly size: 1.25;
4041
+ }];
4042
+ readonly previewBrightness: {
4043
+ readonly day: 0.346;
4044
+ readonly golden: 0.383;
4045
+ readonly overcast: 0.121;
4046
+ readonly night: 0.191;
4047
+ };
4048
+ readonly previewFill: {
4049
+ readonly day: {
4050
+ readonly sky: readonly [1.05, 0.987, 0.978];
4051
+ readonly ground: readonly [1.088, 0.982, 0.915];
4052
+ };
4053
+ readonly golden: {
4054
+ readonly sky: readonly [1.273, 0.952, 0.672];
4055
+ readonly ground: readonly [1.314, 0.944, 0.628];
4056
+ };
4057
+ readonly overcast: {
4058
+ readonly sky: readonly [1.213, 0.952, 0.844];
4059
+ readonly ground: readonly [1.254, 0.946, 0.789];
4060
+ };
4061
+ readonly night: {
4062
+ readonly sky: readonly [1.46, 0.901, 0.63];
4063
+ readonly ground: readonly [1.504, 0.892, 0.587];
4064
+ };
4065
+ };
4066
+ readonly exposure: {
4067
+ readonly day: 1.741;
4068
+ readonly golden: 1.741;
4069
+ readonly overcast: 1.866;
4070
+ readonly night: 2.144;
4071
+ };
4072
+ readonly hdri: {
4073
+ readonly day: {
4074
+ readonly name: "pergola_walkway";
4075
+ readonly rotationDeg: 317.7;
4076
+ readonly groundHeight: 1.6;
4077
+ };
4078
+ readonly golden: {
4079
+ readonly name: "qwantani_sunset";
4080
+ readonly rotationDeg: 332;
4081
+ readonly groundHeight: 1.6;
4082
+ };
4083
+ readonly overcast: {
4084
+ readonly name: "dalkey_view";
4085
+ readonly rotationDeg: 0;
4086
+ readonly groundHeight: 1.6;
4087
+ };
4088
+ readonly night: {
4089
+ readonly name: "moonless_golf";
4090
+ readonly rotationDeg: 0;
4091
+ readonly groundHeight: 1.6;
4092
+ };
4093
+ };
4094
+ readonly skyIrradiance: {
4095
+ readonly day: 8.468;
4096
+ readonly golden: 5.273;
4097
+ readonly overcast: 3.286;
4098
+ readonly night: 0.011;
4099
+ };
4100
+ };
4101
+ readonly studio_night: {
4102
+ readonly label: "Night Studio";
4103
+ readonly description: "Warm greige walls after dark: IES downlights, a lit cove channel round the ceiling and one accent spot carrying the centerpiece.";
4104
+ readonly build: "029ba7cafdae";
4105
+ readonly presetsVersion: 1;
4106
+ readonly size: {
4107
+ readonly width: 5;
4108
+ readonly height: 3;
4109
+ readonly depth: 4.4;
4110
+ };
4111
+ readonly lighting: "night";
4112
+ readonly surfaces: {
4113
+ readonly floor: {
4114
+ readonly material: "polished_concrete";
4115
+ readonly color: "#ffffff";
4116
+ };
4117
+ readonly walls: {
4118
+ readonly material: "matte_paint";
4119
+ readonly color: "#e6dfd3";
4120
+ };
4121
+ readonly ceiling: {
4122
+ readonly material: "matte_paint";
4123
+ readonly color: "#f5f4f0";
4124
+ };
4125
+ readonly sill: {
4126
+ readonly material: "carrara_marble";
4127
+ };
4128
+ };
4129
+ readonly stand: {
4130
+ readonly type: null;
4131
+ readonly material: null;
4132
+ readonly x: 0;
4133
+ readonly z: 0;
4134
+ readonly rotationDeg: 0;
4135
+ readonly top: 0;
4136
+ readonly size: null;
4137
+ };
4138
+ readonly camera: {
4139
+ readonly position: readonly [-1.5455, 0.83, 1.2695];
4140
+ readonly target: readonly [0, 0.25, 0];
4141
+ readonly lensMm: 38;
4142
+ readonly fstop: 2;
4143
+ };
4144
+ readonly preview: {
4145
+ readonly glb: "rooms/studio_night/room.glb";
4146
+ readonly bytes: 4232484;
4147
+ readonly triangles: 183407;
4148
+ readonly textures: 21;
4149
+ };
4150
+ readonly complexity: {
4151
+ readonly enclosure: 1;
4152
+ readonly objects: 57;
4153
+ };
4154
+ readonly prebaked: readonly [];
4155
+ readonly plants: readonly ["potted_palm_01", "potted_plant_04"];
4156
+ readonly pictures: readonly [];
4157
+ readonly previewBrightness: {
4158
+ readonly day: 0.517;
4159
+ readonly golden: 0.517;
4160
+ readonly overcast: 0.482;
4161
+ readonly night: 0.466;
4162
+ };
4163
+ readonly previewFill: {
4164
+ readonly day: {
4165
+ readonly sky: readonly [1.318, 0.927, 0.781];
4166
+ readonly ground: readonly [1.318, 0.927, 0.781];
4167
+ };
4168
+ readonly golden: {
4169
+ readonly sky: readonly [1.374, 0.92, 0.69];
4170
+ readonly ground: readonly [1.374, 0.92, 0.69];
4171
+ };
4172
+ readonly overcast: {
4173
+ readonly sky: readonly [1.439, 0.904, 0.657];
4174
+ readonly ground: readonly [1.439, 0.904, 0.657];
4175
+ };
4176
+ readonly night: {
4177
+ readonly sky: readonly [1.486, 0.894, 0.616];
4178
+ readonly ground: readonly [1.486, 0.894, 0.616];
4179
+ };
4180
+ };
4181
+ readonly exposure: {
4182
+ readonly day: 1.741;
4183
+ readonly golden: 1.741;
4184
+ readonly overcast: 1.866;
4185
+ readonly night: 2.144;
4186
+ };
4187
+ readonly hdri: {
4188
+ readonly day: {
4189
+ readonly name: "pergola_walkway";
4190
+ readonly rotationDeg: 79.7;
4191
+ readonly groundHeight: 1.6;
4192
+ };
4193
+ readonly golden: {
4194
+ readonly name: "qwantani_sunset";
4195
+ readonly rotationDeg: 136;
4196
+ readonly groundHeight: 1.6;
4197
+ };
4198
+ readonly overcast: {
4199
+ readonly name: "dalkey_view";
4200
+ readonly rotationDeg: 0;
4201
+ readonly groundHeight: 1.6;
4202
+ };
4203
+ readonly night: {
4204
+ readonly name: "satara_night";
4205
+ readonly rotationDeg: 0;
4206
+ readonly groundHeight: 1.6;
4207
+ };
4208
+ };
4209
+ readonly skyIrradiance: {
4210
+ readonly day: 8.595;
4211
+ readonly golden: 5.273;
4212
+ readonly overcast: 3.286;
4213
+ readonly night: 0.011;
4214
+ };
4215
+ };
4216
+ readonly walnut_salon: {
4217
+ readonly label: "Walnut Salon";
4218
+ readonly description: "A long wall of walnut veneer and slatted bays under a lit cove, a pale modular sofa in front of it, three disc pendants at different heights and a charcoal wall with a print on the east side.";
4219
+ readonly build: "ce8b1acc2907";
4220
+ readonly presetsVersion: 1;
4221
+ readonly size: {
4222
+ readonly width: 10;
4223
+ readonly height: 3.2;
4224
+ readonly depth: 7;
4225
+ };
4226
+ readonly lighting: "night";
4227
+ readonly surfaces: {
4228
+ readonly floor: {
4229
+ readonly material: "polished_concrete";
4230
+ readonly color: "#cfccc6";
4231
+ };
4232
+ readonly walls: {
4233
+ readonly material: "matte_paint";
4234
+ readonly color: "#ddd7cd";
4235
+ };
4236
+ readonly ceiling: {
4237
+ readonly material: "matte_paint";
4238
+ readonly color: "#e4e1db";
4239
+ };
4240
+ readonly sill: {
4241
+ readonly material: "polished_concrete";
4242
+ };
4243
+ };
4244
+ readonly stand: {
4245
+ readonly type: "coffee_table_round_01";
4246
+ readonly material: null;
4247
+ readonly x: 0.2;
4248
+ readonly z: -1.2;
4249
+ readonly rotationDeg: 0;
4250
+ readonly top: 0.491;
4251
+ readonly size: {
4252
+ readonly x: 1.3013;
4253
+ readonly y: 0.491;
4254
+ readonly z: 1.3013;
4255
+ };
4256
+ };
4257
+ readonly camera: {
4258
+ readonly position: readonly [0.2, 1.45, 3.2];
4259
+ readonly target: readonly [0.2, 0.741, -1.2];
4260
+ readonly lensMm: 24;
4261
+ readonly fstop: 5.599999904632568;
4262
+ };
4263
+ readonly preview: {
4264
+ readonly glb: "rooms/walnut_salon/room.glb";
4265
+ readonly bytes: 1958456;
4266
+ readonly triangles: 121487;
4267
+ readonly textures: 36;
4268
+ };
4269
+ readonly complexity: {
4270
+ readonly enclosure: 1;
4271
+ readonly objects: 117;
4272
+ };
4273
+ readonly prebaked: readonly [];
4274
+ readonly plants: readonly ["potted_bird_of_paradise_01", "potted_monstera_02"];
4275
+ readonly pictures: readonly [{
4276
+ readonly wall: "east";
4277
+ readonly size: 1.3;
4278
+ }];
4279
+ readonly previewBrightness: {
4280
+ readonly day: 0.295;
4281
+ readonly golden: 0.295;
4282
+ readonly overcast: 0.13;
4283
+ readonly night: 0.313;
4284
+ };
4285
+ readonly previewFill: {
4286
+ readonly day: {
4287
+ readonly sky: readonly [1.112, 0.975, 0.922];
4288
+ readonly ground: readonly [1.145, 0.971, 0.859];
4289
+ };
4290
+ readonly golden: {
4291
+ readonly sky: readonly [1.301, 0.944, 0.67];
4292
+ readonly ground: readonly [1.336, 0.938, 0.623];
4293
+ };
4294
+ readonly overcast: {
4295
+ readonly sky: readonly [1.35, 0.925, 0.716];
4296
+ readonly ground: readonly [1.386, 0.919, 0.665];
4297
+ };
4298
+ readonly night: {
4299
+ readonly sky: readonly [1.427, 0.909, 0.645];
4300
+ readonly ground: readonly [1.464, 0.902, 0.599];
4301
+ };
4302
+ };
4303
+ readonly exposure: {
4304
+ readonly day: 1.741;
4305
+ readonly golden: 1.741;
4306
+ readonly overcast: 1.866;
4307
+ readonly night: 2.144;
4308
+ };
4309
+ readonly hdri: {
4310
+ readonly day: {
4311
+ readonly name: "pergola_walkway";
4312
+ readonly rotationDeg: 59.7;
4313
+ readonly groundHeight: 1.6;
4314
+ };
4315
+ readonly golden: {
4316
+ readonly name: "qwantani_sunset";
4317
+ readonly rotationDeg: 132;
4318
+ readonly groundHeight: 1.6;
4319
+ };
4320
+ readonly overcast: {
4321
+ readonly name: "dalkey_view";
4322
+ readonly rotationDeg: 0;
4323
+ readonly groundHeight: 1.6;
4324
+ };
4325
+ readonly night: {
4326
+ readonly name: "moonless_golf";
4327
+ readonly rotationDeg: 0;
4328
+ readonly groundHeight: 1.6;
4329
+ };
4330
+ };
4331
+ readonly skyIrradiance: {
4332
+ readonly day: 8.468;
4333
+ readonly golden: 5.273;
4334
+ readonly overcast: 3.286;
4335
+ readonly night: 0.011;
4336
+ };
4337
+ };
4338
+ };
4339
+ type RoomPresetName = keyof typeof ROOM_PRESETS;
4340
+
4341
+ /**
4342
+ * A catalog from a server: models by URL, shots per product, no browser.
4343
+ *
4344
+ * import { Bakery3Server } from '@oeave/bakery3/node';
4345
+ * const api = new Bakery3Server(process.env.BAKERY3_SECRET_KEY!);
4346
+ *
4347
+ * const run = await api.renderBatch({
4348
+ * key: 'fall-2026',
4349
+ * products: [{ id: 'chair-aria', url: 'https://cdn.shop.com/models/chair-aria.glb' }],
4350
+ * shots: [
4351
+ * 'three-quarter',
4352
+ * { kind: 'video', from: 'three-quarter', to: 'three-quarter-back', seconds: 4 },
4353
+ * { id: 'low', azimuthDeg: -30, elevationDeg: 4 },
4354
+ * ],
4355
+ * room: { preset: 'loft_golden' },
4356
+ * maxCost: 600,
4357
+ * });
4358
+ *
4359
+ * A shot is a picture or a clip of a product from an angle: degrees around
4360
+ * the model from its front and degrees above the horizon, or a word for one.
4361
+ * The camera is framed from the model's own bounds, read when the model is
4362
+ * imported, so a vase and a sofa both fill the frame from the same word and
4363
+ * nothing is asked of the file itself. A clip is the camera carried from one
4364
+ * angle to another over `seconds`, one framed camera per frame.
4365
+ *
4366
+ * Settings come in three layers: the run's, then a product's, then a shot's,
4367
+ * the nearer winning. So one `room` at the top is every shot's room, a
4368
+ * product that wants the studio instead says `room: null, environment: {…}`,
4369
+ * and one shot in it can still be a close-up at 2048² in a jpeg.
4370
+ *
4371
+ * The model's bytes never pass through this process. Each URL is handed to
4372
+ * `POST /v1/assets/import`; the service fetches it once, stores it content
4373
+ * addressed like any upload, and answers with the hash and what the GLB says
4374
+ * about itself. A model that did not change since the last run is not
4375
+ * downloaded again. What this process sends is a few KB of manifest per shot.
4376
+ *
4377
+ * A manifest built here describes a model, cameras and light. A scene whose
4378
+ * look lives in code exists only where that code runs, so it is recorded
4379
+ * there, with `renderVariants()` in the page. Both kinds of item can share a
4380
+ * batch.
4381
+ *
4382
+ * No three.js here.
4383
+ */
4384
+
4385
+ /**
4386
+ * Where to look from: a word, or degrees. `'room'` is the framing a preset
4387
+ * room was published with, from level or above: never looking up at the
4388
+ * product.
4389
+ */
4390
+ type View = ViewWord | 'room' | Angle;
4391
+ type BatchEnvironment = {
4392
+ /** A studio or a sky from the preset library. */
4393
+ preset?: HdriPresetName;
4394
+ /**
4395
+ * Or an HDRI of your own: a public https URL of a .hdr or .exr, imported
4396
+ * like the models.
4397
+ */
4398
+ url?: string;
4399
+ /** How strongly it lights the product. Default 1 (0.6 for the default studio). */
4400
+ intensity?: number;
4401
+ /** Turn the environment about the vertical, in degrees. */
4402
+ rotationDeg?: number;
4403
+ };
4404
+ type BatchRoom = {
4405
+ /** A room from the preset library. */
4406
+ preset: RoomPresetName;
4407
+ /** Default: the mode the room was designed under. */
4408
+ mode?: RoomPresetLighting;
4409
+ /**
4410
+ * What the product stands on. `'auto'` (the default) goes by its size: the
4411
+ * room's own pedestal for a small thing, the low plinth for a mid-sized
4412
+ * one, the floor for furniture and anything that would overhang. `'own'`
4413
+ * and `'floor'` say so yourself.
4414
+ */
4415
+ stand?: 'auto' | 'own' | 'floor';
4416
+ /**
4417
+ * Where the room's own camera sees the product from, in degrees from the
4418
+ * product's front. The room is turned about the product to make it so.
4419
+ * Default 30: a three-quarter view from the side the room is open to.
4420
+ */
4421
+ viewFromDeg?: number;
4422
+ };
4423
+ /**
4424
+ * What every shot can say about how it is taken. Set on the run for all of
4425
+ * them, on a product for its own, on a shot for that one; the nearest wins.
4426
+ */
4427
+ type ShotSettings = {
4428
+ /**
4429
+ * A preset room to stand in. `null` says no room, where a wider layer had
4430
+ * one.
4431
+ */
4432
+ room?: BatchRoom | null;
4433
+ /**
4434
+ * The light and backdrop when there is no room. Default: the
4435
+ * `studio_small_03` preset at 0.6.
4436
+ */
4437
+ environment?: BatchEnvironment;
4438
+ /**
4439
+ * `'transparent'` (the default, with a traced shadow), a `#rrggbb`, or
4440
+ * `'environment'`. A video has no alpha: `'transparent'` is `#f4f4f5` there
4441
+ * (a `png-sequence` keeps it).
4442
+ */
4443
+ background?: 'transparent' | 'environment' | `#${string}`;
4444
+ /** Default `'studio'`. */
4445
+ quality?: QualityPreset;
4446
+ /** Pixels. Default: the quality preset's long edge, square. */
4447
+ width?: number;
4448
+ height?: number;
4449
+ /**
4450
+ * `png` (the default), `jpeg` or `webp` for an image; `mp4` (the default),
4451
+ * `webm` or `png-sequence` (every frame a PNG with alpha, in one tar) for a
4452
+ * video.
4453
+ */
4454
+ format?: OutputSpec['format'];
4455
+ /** JPEG/WebP only, 1 to 100. */
4456
+ imageQuality?: number;
4457
+ /**
4458
+ * Vertical field of view in degrees. Default 30, or the room's own lens in
4459
+ * a room.
4460
+ */
4461
+ fov?: number;
4462
+ /**
4463
+ * Room around the model, as a share of its size. Default 0.12, or 0.9 in
4464
+ * a room.
4465
+ */
4466
+ margin?: number;
4467
+ /** Frames a second, for a video. Default 30, at most 60. */
4468
+ fps?: number;
4469
+ /** Renderer settings beyond the quality preset. */
4470
+ advanced?: RenderSpec['advanced'];
4471
+ /**
4472
+ * How the pictures are developed. Default: sRGB, ACES filmic, exposure 1
4473
+ * (a room's own exposure in a room).
4474
+ */
4475
+ color?: Partial<ColorSpec>;
4476
+ };
4477
+ type ImageShot = ShotSettings & {
4478
+ kind?: 'image';
4479
+ /** Default: the view's word, or `az35-el14` for degrees. Ends the item's key. */
4480
+ id?: string;
4481
+ /** Where from. Default `'three-quarter'`, or `'room'` in a room. */
4482
+ view?: View;
4483
+ /**
4484
+ * Instead of a view: a camera inside the model, by its node name, as the
4485
+ * file has it.
4486
+ */
4487
+ camera?: string;
4488
+ };
4489
+ type VideoShot = ShotSettings & {
4490
+ kind: 'video';
4491
+ /** Default `orbit-<from>-<to>`. */
4492
+ id?: string;
4493
+ /** The camera is carried from here. */
4494
+ from: View;
4495
+ /**
4496
+ * To here, azimuth as written: `{ azimuthDeg: 395 }` from 35 is a full
4497
+ * turn.
4498
+ */
4499
+ to: View;
4500
+ /** Default 4. At most 30. */
4501
+ seconds?: number;
4502
+ };
4503
+ /** A word or an angle is an image from that view. */
4504
+ type Shot = ViewWord | 'room' | Angle | ImageShot | VideoShot;
4505
+ type BatchProduct = ShotSettings & {
4506
+ /** Starts every shot's key. Stable across re-runs. */
4507
+ id: string;
4508
+ /** A public https URL of a binary glTF (.glb). */
4509
+ url: string;
4510
+ /** This product's shots, instead of the run's. */
4511
+ shots?: Shot[];
4512
+ /** Echoed on every shot of this product, its webhooks and the ledger. */
4513
+ metadata?: Record<string, unknown>;
4514
+ };
4515
+ type RenderBatchProgress = BatchProgress & {
4516
+ /** The product just recorded, or skipped. */
4517
+ product: string;
4518
+ /** Products recorded so far. */
4519
+ products: number;
4520
+ /** Shots recorded so far, clips included. */
4521
+ images: number;
4522
+ /** Products skipped so far. */
4523
+ skipped: number;
4524
+ };
4525
+ /** A product left out of a run, with the reason. */
4526
+ type ProductSkip = {
4527
+ id: string;
4528
+ url: string;
4529
+ error: Bakery3Error;
4530
+ };
4531
+ type RenderBatchRecorded = Recorded & {
4532
+ /**
4533
+ * Products whose model could not be imported or read. The run went on
4534
+ * without them.
4535
+ */
4536
+ skipped: number;
4537
+ /** The first of those, with their reasons. */
4538
+ skips: ProductSkip[];
4539
+ };
4540
+ type RenderBatchOptions = ShotSettings & {
4541
+ /** Names the run. The same key re-opens it while it is unfinished. */
4542
+ key: string;
4543
+ /** A label for the console. Default: the key. */
4544
+ name?: string;
4545
+ /**
4546
+ * An array, a generator, a database cursor. Pulled as it is needed, never
4547
+ * collected.
4548
+ */
4549
+ products: Iterable<BatchProduct> | AsyncIterable<BatchProduct>;
4550
+ /**
4551
+ * Every product's shots, unless it has its own. Default: one image,
4552
+ * `'three-quarter'` (`'room'` in a room).
4553
+ */
4554
+ shots?: Shot[];
4555
+ /**
4556
+ * Appended to every key as `@version`. Bump it to trace again what already
4557
+ * rendered.
4558
+ */
4559
+ version?: string;
4560
+ /** The ceiling for the whole run, in USD. */
4561
+ maxCost: number;
4562
+ /** A ceiling per shot, in USD. A shot quoted above it is refused. */
4563
+ maxCostPerImage?: number;
4564
+ /**
4565
+ * `'batch'` (the default) never runs ahead of a person in a configurator;
4566
+ * `'normal'` is the API's ordinary lane.
4567
+ */
4568
+ lane?: 'batch' | 'normal';
4569
+ /** Fewer parallel shots than the plan allows, for a gentler budget. */
4570
+ maxParallel?: number;
4571
+ /** Imports in flight at once. Default 4, at most 16. */
4572
+ concurrency?: number;
4573
+ /** Called after each product is recorded or skipped. */
4574
+ onProgress?: (progress: RenderBatchProgress) => void;
4575
+ /**
4576
+ * Stops between products. What was recorded stays admitted; call again to
4577
+ * go on.
4578
+ */
4579
+ signal?: AbortSignal;
4580
+ };
4581
+ type RenderBatchRecording = RenderBatchRecorded & {
4582
+ estimated: number;
4583
+ maximum: number;
4584
+ };
4585
+
4586
+ /**
4587
+ * Webhook signature verification.
4588
+ *
4589
+ * A webhook endpoint is a public URL that causes writes in the developer's
4590
+ * database. Verifying is not optional, so it is one function with no options
4591
+ * and no way to get it subtly wrong.
4592
+ *
4593
+ * const event = await verifyWebhook({
4594
+ * body: await request.text(),
4595
+ * signature: request.headers.get('bakery3-signature'),
4596
+ * secret: process.env.BAKERY3_WEBHOOK_SECRET!,
4597
+ * });
4598
+ *
4599
+ * Pass the raw body, not a parsed and re-stringified object. Re-serializing
4600
+ * JSON changes key order and whitespace and therefore the signature, and it
4601
+ * is the single most common reason a correct implementation fails.
4602
+ */
4603
+
4604
+ /**
4605
+ * Verify a webhook request and return its payload. Throws a `Bakery3Error`
4606
+ * (`Unauthorized`) when the header is missing, malformed, older than five
4607
+ * minutes, or signed with another secret.
4608
+ */
4609
+ declare function verifyWebhook(input: {
4610
+ /** The request body exactly as received, as text. */
4611
+ body: string;
4612
+ /**
4613
+ * The `bakery3-signature` header. `headers.get()` gives `null` when the
4614
+ * request has none, and that is refused like a bad signature.
4615
+ */
4616
+ signature: string | null | undefined;
4617
+ /** The signing secret from your webhook settings. */
4618
+ secret: string;
4619
+ /** Test seam. Never pass this in production. */
4620
+ now?: number;
4621
+ }): Promise<WebhookPayload>;
4622
+
4623
+ /**
4624
+ * @oeave/bakery3/node: the server half.
4625
+ *
4626
+ * The secret key lives here and only here. It never reaches a browser and is
4627
+ * never an argument to anything in `@oeave/bakery3`. This module mints the
4628
+ * short-lived, narrow token that goes in its place, verifies webhooks, and
4629
+ * calls the API with the secret key for the things a browser may not do.
4630
+ *
4631
+ * import { Bakery3Server } from '@oeave/bakery3/node';
4632
+ *
4633
+ * const bakery3 = new Bakery3Server(process.env.BAKERY3_SECRET_KEY!);
4634
+ *
4635
+ * export async function POST() {
4636
+ * return Response.json(
4637
+ * await bakery3.tokens.create({
4638
+ * expiresInSeconds: 300,
4639
+ * maxRenders: 1,
4640
+ * maxCost: 1,
4641
+ * allowedOrigins: ['https://shop.example.com'],
4642
+ * })
4643
+ * );
4644
+ * }
4645
+ *
4646
+ * That endpoint is the entire server-side integration.
4647
+ */
4648
+
4649
+ type BrowserTokenOptions = {
4650
+ /**
4651
+ * How long the token lives, in seconds. Default 300. Keep it short: a
4652
+ * browser token is a capability handed to a page, and the shorter its life
4653
+ * the less a leaked one is worth. Five minutes is plenty, because the
4654
+ * browser SDK re-mints on a 401 without the developer writing anything.
4655
+ */
4656
+ expiresInSeconds?: number;
4657
+ /** Hard ceiling on renders this token can start. Default 5. */
4658
+ maxRenders?: number;
4659
+ /** Hard ceiling on spend across all of them, in USD. Default 2. */
4660
+ maxCost?: number;
4661
+ /**
4662
+ * Origins allowed to spend it. Set this in production: it is what stops a
4663
+ * token lifted out of one page's network tab from working anywhere else.
4664
+ */
4665
+ allowedOrigins?: string[];
4666
+ /** Your own user/session id. Shows up in the usage ledger for attribution. */
4667
+ subject?: string;
4668
+ };
4669
+ type BrowserToken = {
4670
+ /** The token itself, a `bk_pt_` string. Hand it to the browser SDK. */
4671
+ token: string;
4672
+ /** When it stops working, as a Unix timestamp in milliseconds. */
4673
+ expiresAt: number;
4674
+ /** The project the token renders into. */
4675
+ projectId: string;
4676
+ };
4677
+ type Bakery3ServerOptions = {
4678
+ /** The API's base URL. Only for a self-hosted or test deployment. */
4679
+ baseUrl?: string;
4680
+ /** A `fetch` to use instead of the global one. */
4681
+ fetch?: typeof fetch;
4682
+ /** How a 429/503 is waited out. The browser SDK's defaults otherwise. */
4683
+ retry?: RetryPolicy;
4684
+ };
4685
+ /** A run's pictures, plus which products were left out and why. */
4686
+ type RenderBatchRun = RenderSet & {
4687
+ readonly recorded: RenderBatchRecorded;
4688
+ };
4689
+ declare class Bakery3Server {
4690
+ readonly tokens: TokensApi;
4691
+ readonly renders: RendersApi;
4692
+ readonly batches: BatchesApi;
4693
+ readonly assets: AssetsApi;
4694
+ private readonly secretKey;
4695
+ private readonly options;
4696
+ private transport;
4697
+ /**
4698
+ * @param secretKey Your `bk_sk_` key, as a string, from a server-only
4699
+ * environment variable. Not the browser SDK's `{ apiKey }` object.
4700
+ *
4701
+ * The key is checked on the first request, not here. A route module that
4702
+ * builds its client at the top level is evaluated by `next build`, often
4703
+ * where the server's secrets are not set, and a constructor that threw
4704
+ * there would fail the build over a key the build never uses.
4705
+ */
4706
+ constructor(secretKey: string, options?: Bakery3ServerOptions);
4707
+ /**
4708
+ * The same transport the browser SDK uses (one error shape, the same
4709
+ * 429/503 backoff) with the secret key as the bearer. It has nothing to
4710
+ * re-mint, so a 401 here is a 401. Made on first use, after the key is
4711
+ * checked.
4712
+ */
4713
+ private client;
4714
+ /**
4715
+ * Render a catalog of models that already sit on a CDN: one call, no
4716
+ * browser, and none of the models' bytes through this process. Needs a
4717
+ * plan that includes imports (see https://bakery3.com/docs/catalog#plans).
4718
+ *
4719
+ * const run = await api.renderBatch({
4720
+ * key: 'fall-2026',
4721
+ * products: [{ id: 'chair-aria', url: 'https://cdn.shop.com/models/chair-aria.glb' }],
4722
+ * shots: ['three-quarter', 'front', { kind: 'video', from: 'front', to: 'back', seconds: 4 }],
4723
+ * room: { preset: 'loft_golden' },
4724
+ * maxCost: 600,
4725
+ * });
4726
+ * await run.wait(); // or let a webhook tell you, and exit now
4727
+ *
4728
+ * Resolves once every product is recorded and the run is sealed. The
4729
+ * shots render on from there; this process does not have to stay up.
4730
+ * A product whose model cannot be imported is skipped and listed in
4731
+ * `run.recorded.skips`, and the run goes on. Calling it again with the
4732
+ * same `key` resumes a recording that stopped, re-downloads no model that
4733
+ * did not change, and adopts every shot that already rendered.
4734
+ *
4735
+ * What a model by URL cannot carry (node materials, a shader-lit set) is
4736
+ * recorded where that code runs; see `renderVariants()` in `@oeave/bakery3`.
4737
+ */
4738
+ renderBatch(options: RenderBatchOptions): Promise<RenderBatchRun>;
4739
+ /**
4740
+ * What `renderBatch()` would cost. The models are imported (that is how
4741
+ * they are priced); nothing is rendered or charged.
4742
+ */
4743
+ quoteBatch(options: Omit<RenderBatchOptions, 'maxCost'> & {
4744
+ maxCost?: number;
4745
+ }): Promise<RenderBatchRecording>;
4746
+ /**
4747
+ * Look before paying: three products (the first, the middle and the last
4748
+ * of an array; the first three of anything else), every shot, at preview
4749
+ * quality and a small size, in the ordinary lane so they come back in
4750
+ * about a minute. A clip is cut to two seconds at twelve frames. Same
4751
+ * options as `renderBatch()`. The test run has keys of its own, so the
4752
+ * real run never adopts these previews as finished shots.
4753
+ *
4754
+ * const test = await api.testBatch(options);
4755
+ * for (const shot of await test.result()) console.log(shot.variant, shot.shot, shot.url);
4756
+ */
4757
+ testBatch(options: Omit<RenderBatchOptions, 'maxCost'> & {
4758
+ maxCost?: number;
4759
+ }, test?: TestRunOptions): Promise<RenderBatchRun>;
4760
+ /**
4761
+ * A run by id, from another process, a webhook handler, or tomorrow
4762
+ * morning.
4763
+ */
4764
+ getRenderSet(id: string): Promise<RenderSet>;
4765
+ private openRun;
4766
+ }
4767
+ declare class AssetsApi {
4768
+ private readonly client;
4769
+ constructor(client: () => Bakery3Client);
4770
+ /**
4771
+ * Have the service fetch a public https URL into the project's assets,
4772
+ * and say what it found: the hash to put in a manifest, and for a model
4773
+ * its triangles, bounds, cameras and anything the renderer cannot read.
4774
+ *
4775
+ * Secret key only, which is why it is here and not in the browser SDK.
4776
+ * What is fetched is fenced on the service's side: https, public
4777
+ * addresses only, no credentials, a size limit, and the file must be a
4778
+ * model or an HDRI. An unchanged URL is answered without a download
4779
+ * (`unchanged: true`).
4780
+ */
4781
+ import(url: string, options?: {
4782
+ kind?: AssetImportKind;
4783
+ }): Promise<AssetImportResponse>;
4784
+ }
4785
+ type Request = <T>(method: string, path: string, body?: unknown) => Promise<T>;
4786
+ declare class TokensApi {
4787
+ private readonly request;
4788
+ constructor(request: Request);
4789
+ /**
4790
+ * Mint a browser token.
4791
+ *
4792
+ * Everything about it is a ceiling rather than a grant: it cannot outlive
4793
+ * its expiry, cannot start more renders than `maxRenders`, cannot spend past
4794
+ * `maxCost`, cannot be used from an origin outside `allowedOrigins`, and
4795
+ * cannot perform a single billing or admin operation. That last one is not
4796
+ * a policy: those routes require a `bk_sk_` key and this is not one.
4797
+ */
4798
+ create(options?: BrowserTokenOptions): Promise<BrowserToken>;
4799
+ /** Revoke a token before its expiry. */
4800
+ revoke(token: string): Promise<void>;
4801
+ }
4802
+ declare class RendersApi {
4803
+ private readonly request;
4804
+ private readonly client;
4805
+ constructor(request: Request, client: () => Bakery3Client);
4806
+ /**
4807
+ * Render from a manifest you already have: a batch job, a re-render, a
4808
+ * queued webhook. The browser flow is `@oeave/bakery3`; this is the API.
4809
+ * Repeated on a 429/503 only when `spec.idempotencyKey` makes that safe.
4810
+ */
4811
+ create(spec: RenderSpec): Promise<RenderRecord>;
4812
+ /** A render's record, with its state, cost and result URLs. */
4813
+ get(id: string): Promise<RenderRecord>;
4814
+ /** Cancel a render that has not finished. Already terminal is a no-op. */
4815
+ cancel(id: string): Promise<RenderRecord>;
4816
+ /**
4817
+ * One more attempt for a render that failed with `attemptsExhausted`.
4818
+ * Returns the new render, linked to the old one; a render that is not in
4819
+ * that state answers 409.
4820
+ */
4821
+ retry(id: string): Promise<RenderRecord>;
4822
+ /**
4823
+ * Delete a render now rather than when retention would: the result, the
4824
+ * preview, and every signed URL that pointed at them. The record survives
4825
+ * as `expired`, so the receipt is still readable. A live render is
4826
+ * cancelled first.
4827
+ */
4828
+ delete(id: string): Promise<RenderRecord>;
4829
+ /** The project's renders, newest first, a page at a time. */
4830
+ list(options?: {
4831
+ limit?: number;
4832
+ cursor?: string;
4833
+ }): Promise<{
4834
+ renders: RenderRecord[];
4835
+ cursor: string | null;
4836
+ }>;
4837
+ /** The quote for a spec: a likely cost and a maximum, in USD. */
4838
+ estimate(spec: Pick<RenderSpec, 'quality' | 'output' | 'advanced'>): Promise<CostEstimate>;
4839
+ }
4840
+ /**
4841
+ * Batches from a server: manifests you already have, added by the hundred
4842
+ * and rendered behind one cost ceiling. `renderBatch()` builds on this.
4843
+ *
4844
+ * const batch = await api.batches.open({ key: 'fall-2026-v3', lane: 'batch', maxCost: 600 });
4845
+ * for await (const line of readLines('manifests.jsonl')) {
4846
+ * const item = JSON.parse(line);
4847
+ * batch.add({ key: item.key, spec: item.spec, metadata: item.metadata });
4848
+ * if (batch.buffered >= 100) await batch.flush();
4849
+ * }
4850
+ * await batch.close();
4851
+ * await batch.wait({ onProgress: (p) => console.log(`${p.completed}/${p.total}`) });
4852
+ */
4853
+ declare class BatchesApi {
4854
+ private readonly client;
4855
+ constructor(client: () => Bakery3Client);
4856
+ /** Open, or re-open by key. */
4857
+ open(request: BatchOpenRequest): Promise<Batch>;
4858
+ /** A batch by id, with its latest counts. */
4859
+ get(id: string): Promise<Batch>;
4860
+ }
4861
+
4862
+ export { type Angle, Bakery3Error, Bakery3Server, type Bakery3ServerOptions, Batch, type BatchAddRequest, type BatchAddResponse, type BatchEnvironment, type BatchExportLine, type BatchItemOutcome, type BatchItemRecord, type BatchItemRequest, type BatchItemsPage, type BatchOpenRequest, BatchPageRefused, type BatchProduct, type BatchProgress, type BatchRecord, type BatchRoom, type BrowserToken, type BrowserTokenOptions, type CostEstimate, type FlushOptions, type FrameSequenceIndex, type ImageShot, type ProductSkip, type Recorded, type RenderBatchOptions, type RenderBatchProgress, type RenderBatchRecorded, type RenderBatchRun, type RenderRecord, RenderSet, type RenderSetFailure, type RenderSetImage, type RenderSpec, type RetryPolicy, type Shot, type ShotSettings, type TestRunOptions, type VideoShot, type View, type ViewWord, type WaitOptions, verifyWebhook };