sceneview-mcp 4.0.16 → 4.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.
@@ -1,57 +1,362 @@
1
+ import { LATEST_SCENEVIEW_RELEASE } from "./generated/version.js";
1
2
  const OBJECT_MAPPINGS = [
2
3
  // Furniture
3
- { keywords: ["table"], nodeType: "CubeNode", geometryType: "cube", defaultScale: 1.0, defaultPosition: [0, 0.4, 0], color: "Color(0.55f, 0.35f, 0.17f)", comment: "Table (flat cube)" },
4
- { keywords: ["chair"], nodeType: "ModelNode", defaultScale: 0.8, defaultPosition: [0, 0, -1], comment: "Chair (use GLB model)" },
5
- { keywords: ["desk"], nodeType: "CubeNode", geometryType: "cube", defaultScale: 1.2, defaultPosition: [0, 0.35, 0], color: "Color(0.55f, 0.35f, 0.17f)", comment: "Desk" },
6
- { keywords: ["shelf", "bookshelf"], nodeType: "CubeNode", geometryType: "cube", defaultScale: 1.5, defaultPosition: [2, 0.75, 0], color: "Color(0.55f, 0.35f, 0.17f)", comment: "Shelf" },
7
- { keywords: ["bed"], nodeType: "CubeNode", geometryType: "cube", defaultScale: 2.0, defaultPosition: [0, 0.25, 0], color: "Color.White", comment: "Bed" },
8
- { keywords: ["sofa", "couch"], nodeType: "CubeNode", geometryType: "cube", defaultScale: 1.8, defaultPosition: [0, 0.35, 0], color: "Color(0.3f, 0.3f, 0.6f)", comment: "Sofa" },
4
+ {
5
+ keywords: ["table"],
6
+ nodeType: "CubeNode",
7
+ geometryType: "cube",
8
+ defaultScale: 1.0,
9
+ defaultPosition: [0, 0.4, 0],
10
+ color: "Color(0.55f, 0.35f, 0.17f)",
11
+ comment: "Table (flat cube)",
12
+ },
13
+ {
14
+ keywords: ["chair"],
15
+ nodeType: "ModelNode",
16
+ defaultScale: 0.8,
17
+ defaultPosition: [0, 0, -1],
18
+ comment: "Chair (use GLB model)",
19
+ },
20
+ {
21
+ keywords: ["desk"],
22
+ nodeType: "CubeNode",
23
+ geometryType: "cube",
24
+ defaultScale: 1.2,
25
+ defaultPosition: [0, 0.35, 0],
26
+ color: "Color(0.55f, 0.35f, 0.17f)",
27
+ comment: "Desk",
28
+ },
29
+ {
30
+ keywords: ["shelf", "bookshelf"],
31
+ nodeType: "CubeNode",
32
+ geometryType: "cube",
33
+ defaultScale: 1.5,
34
+ defaultPosition: [2, 0.75, 0],
35
+ color: "Color(0.55f, 0.35f, 0.17f)",
36
+ comment: "Shelf",
37
+ },
38
+ {
39
+ keywords: ["bed"],
40
+ nodeType: "CubeNode",
41
+ geometryType: "cube",
42
+ defaultScale: 2.0,
43
+ defaultPosition: [0, 0.25, 0],
44
+ color: "Color.White",
45
+ comment: "Bed",
46
+ },
47
+ {
48
+ keywords: ["sofa", "couch"],
49
+ nodeType: "CubeNode",
50
+ geometryType: "cube",
51
+ defaultScale: 1.8,
52
+ defaultPosition: [0, 0.35, 0],
53
+ color: "Color(0.3f, 0.3f, 0.6f)",
54
+ comment: "Sofa",
55
+ },
9
56
  // Basic shapes
10
- { keywords: ["box", "cube", "crate"], nodeType: "CubeNode", geometryType: "cube", defaultScale: 0.5, defaultPosition: [0, 0.25, 0], color: "Color.Red", comment: "Box" },
11
- { keywords: ["sphere", "ball", "globe", "orb"], nodeType: "SphereNode", geometryType: "sphere", defaultScale: 0.5, defaultPosition: [0, 0.5, 0], color: "Color.Blue", comment: "Sphere" },
12
- { keywords: ["cylinder", "pillar", "column"], nodeType: "CylinderNode", geometryType: "cylinder", defaultScale: 0.5, defaultPosition: [0, 0.5, 0], color: "Color.Green", comment: "Cylinder" },
13
- { keywords: ["plane", "floor", "ground"], nodeType: "PlaneNode", geometryType: "plane", defaultScale: 5.0, defaultPosition: [0, 0, 0], color: "Color.DarkGray", comment: "Ground plane" },
14
- { keywords: ["wall"], nodeType: "CubeNode", geometryType: "cube", defaultScale: 3.0, defaultPosition: [0, 1.5, -3], color: "Color.LightGray", comment: "Wall" },
57
+ {
58
+ keywords: ["box", "cube", "crate"],
59
+ nodeType: "CubeNode",
60
+ geometryType: "cube",
61
+ defaultScale: 0.5,
62
+ defaultPosition: [0, 0.25, 0],
63
+ color: "Color.Red",
64
+ comment: "Box",
65
+ },
66
+ {
67
+ keywords: ["sphere", "ball", "globe", "orb"],
68
+ nodeType: "SphereNode",
69
+ geometryType: "sphere",
70
+ defaultScale: 0.5,
71
+ defaultPosition: [0, 0.5, 0],
72
+ color: "Color.Blue",
73
+ comment: "Sphere",
74
+ },
75
+ {
76
+ keywords: ["cylinder", "pillar", "column"],
77
+ nodeType: "CylinderNode",
78
+ geometryType: "cylinder",
79
+ defaultScale: 0.5,
80
+ defaultPosition: [0, 0.5, 0],
81
+ color: "Color.Green",
82
+ comment: "Cylinder",
83
+ },
84
+ {
85
+ keywords: ["plane", "floor", "ground"],
86
+ nodeType: "PlaneNode",
87
+ geometryType: "plane",
88
+ defaultScale: 5.0,
89
+ defaultPosition: [0, 0, 0],
90
+ color: "Color.DarkGray",
91
+ comment: "Ground plane",
92
+ },
93
+ {
94
+ keywords: ["wall"],
95
+ nodeType: "CubeNode",
96
+ geometryType: "cube",
97
+ defaultScale: 3.0,
98
+ defaultPosition: [0, 1.5, -3],
99
+ color: "Color.LightGray",
100
+ comment: "Wall",
101
+ },
15
102
  // Environment
16
- { keywords: ["tree", "plant"], nodeType: "ModelNode", defaultScale: 2.0, defaultPosition: [2, 0, 2], comment: "Tree (use GLB model)" },
17
- { keywords: ["car", "vehicle"], nodeType: "ModelNode", defaultScale: 2.0, defaultPosition: [0, 0, 0], comment: "Car (use GLB model)" },
18
- { keywords: ["house", "building"], nodeType: "ModelNode", defaultScale: 5.0, defaultPosition: [0, 0, -5], comment: "Building (use GLB model)" },
103
+ {
104
+ keywords: ["tree", "plant"],
105
+ nodeType: "ModelNode",
106
+ defaultScale: 2.0,
107
+ defaultPosition: [2, 0, 2],
108
+ comment: "Tree (use GLB model)",
109
+ },
110
+ {
111
+ keywords: ["car", "vehicle"],
112
+ nodeType: "ModelNode",
113
+ defaultScale: 2.0,
114
+ defaultPosition: [0, 0, 0],
115
+ comment: "Car (use GLB model)",
116
+ },
117
+ {
118
+ keywords: ["house", "building"],
119
+ nodeType: "ModelNode",
120
+ defaultScale: 5.0,
121
+ defaultPosition: [0, 0, -5],
122
+ comment: "Building (use GLB model)",
123
+ },
19
124
  // People / characters
20
- { keywords: ["person", "character", "human", "avatar"], nodeType: "ModelNode", defaultScale: 1.7, defaultPosition: [0, 0, 0], comment: "Character (use GLB model)" },
21
- { keywords: ["robot", "android"], nodeType: "ModelNode", defaultScale: 1.5, defaultPosition: [0, 0, 0], comment: "Robot (use GLB model)" },
125
+ {
126
+ keywords: ["person", "character", "human", "avatar"],
127
+ nodeType: "ModelNode",
128
+ defaultScale: 1.7,
129
+ defaultPosition: [0, 0, 0],
130
+ comment: "Character (use GLB model)",
131
+ },
132
+ {
133
+ keywords: ["robot", "android"],
134
+ nodeType: "ModelNode",
135
+ defaultScale: 1.5,
136
+ defaultPosition: [0, 0, 0],
137
+ comment: "Robot (use GLB model)",
138
+ },
22
139
  // Animals
23
- { keywords: ["dog", "puppy"], nodeType: "ModelNode", defaultScale: 0.6, defaultPosition: [1, 0, 0], comment: "Dog (use GLB model)" },
24
- { keywords: ["cat", "kitten"], nodeType: "ModelNode", defaultScale: 0.4, defaultPosition: [-1, 0, 0], comment: "Cat (use GLB model)" },
25
- { keywords: ["bird"], nodeType: "ModelNode", defaultScale: 0.2, defaultPosition: [0, 2, 0], comment: "Bird (use GLB model)" },
26
- { keywords: ["horse"], nodeType: "ModelNode", defaultScale: 2.5, defaultPosition: [0, 0, 2], comment: "Horse (use GLB model)" },
27
- { keywords: ["fish"], nodeType: "ModelNode", defaultScale: 0.3, defaultPosition: [0, 0.5, 0], comment: "Fish (use GLB model)" },
28
- { keywords: ["dinosaur", "dino", "t-rex"], nodeType: "ModelNode", defaultScale: 5.0, defaultPosition: [0, 0, -3], comment: "Dinosaur (use GLB model)" },
29
- { keywords: ["dragon"], nodeType: "ModelNode", defaultScale: 4.0, defaultPosition: [0, 2, -3], comment: "Dragon (use GLB model)" },
140
+ {
141
+ keywords: ["dog", "puppy"],
142
+ nodeType: "ModelNode",
143
+ defaultScale: 0.6,
144
+ defaultPosition: [1, 0, 0],
145
+ comment: "Dog (use GLB model)",
146
+ },
147
+ {
148
+ keywords: ["cat", "kitten"],
149
+ nodeType: "ModelNode",
150
+ defaultScale: 0.4,
151
+ defaultPosition: [-1, 0, 0],
152
+ comment: "Cat (use GLB model)",
153
+ },
154
+ {
155
+ keywords: ["bird"],
156
+ nodeType: "ModelNode",
157
+ defaultScale: 0.2,
158
+ defaultPosition: [0, 2, 0],
159
+ comment: "Bird (use GLB model)",
160
+ },
161
+ {
162
+ keywords: ["horse"],
163
+ nodeType: "ModelNode",
164
+ defaultScale: 2.5,
165
+ defaultPosition: [0, 0, 2],
166
+ comment: "Horse (use GLB model)",
167
+ },
168
+ {
169
+ keywords: ["fish"],
170
+ nodeType: "ModelNode",
171
+ defaultScale: 0.3,
172
+ defaultPosition: [0, 0.5, 0],
173
+ comment: "Fish (use GLB model)",
174
+ },
175
+ {
176
+ keywords: ["dinosaur", "dino", "t-rex"],
177
+ nodeType: "ModelNode",
178
+ defaultScale: 5.0,
179
+ defaultPosition: [0, 0, -3],
180
+ comment: "Dinosaur (use GLB model)",
181
+ },
182
+ {
183
+ keywords: ["dragon"],
184
+ nodeType: "ModelNode",
185
+ defaultScale: 4.0,
186
+ defaultPosition: [0, 2, -3],
187
+ comment: "Dragon (use GLB model)",
188
+ },
30
189
  // More vehicles
31
- { keywords: ["airplane", "plane", "jet"], nodeType: "ModelNode", defaultScale: 5.0, defaultPosition: [0, 5, 0], comment: "Airplane (use GLB model)" },
32
- { keywords: ["boat", "ship"], nodeType: "ModelNode", defaultScale: 4.0, defaultPosition: [0, 0, -3], comment: "Boat (use GLB model)" },
33
- { keywords: ["bicycle", "bike"], nodeType: "ModelNode", defaultScale: 1.2, defaultPosition: [2, 0, 0], comment: "Bicycle (use GLB model)" },
34
- { keywords: ["motorcycle", "motorbike"], nodeType: "ModelNode", defaultScale: 1.5, defaultPosition: [2, 0, 0], comment: "Motorcycle (use GLB model)" },
35
- { keywords: ["truck"], nodeType: "ModelNode", defaultScale: 3.0, defaultPosition: [0, 0, -2], comment: "Truck (use GLB model)" },
190
+ {
191
+ keywords: ["airplane", "plane", "jet"],
192
+ nodeType: "ModelNode",
193
+ defaultScale: 5.0,
194
+ defaultPosition: [0, 5, 0],
195
+ comment: "Airplane (use GLB model)",
196
+ },
197
+ {
198
+ keywords: ["boat", "ship"],
199
+ nodeType: "ModelNode",
200
+ defaultScale: 4.0,
201
+ defaultPosition: [0, 0, -3],
202
+ comment: "Boat (use GLB model)",
203
+ },
204
+ {
205
+ keywords: ["bicycle", "bike"],
206
+ nodeType: "ModelNode",
207
+ defaultScale: 1.2,
208
+ defaultPosition: [2, 0, 0],
209
+ comment: "Bicycle (use GLB model)",
210
+ },
211
+ {
212
+ keywords: ["motorcycle", "motorbike"],
213
+ nodeType: "ModelNode",
214
+ defaultScale: 1.5,
215
+ defaultPosition: [2, 0, 0],
216
+ comment: "Motorcycle (use GLB model)",
217
+ },
218
+ {
219
+ keywords: ["truck"],
220
+ nodeType: "ModelNode",
221
+ defaultScale: 3.0,
222
+ defaultPosition: [0, 0, -2],
223
+ comment: "Truck (use GLB model)",
224
+ },
36
225
  // More environment
37
- { keywords: ["flower", "rose"], nodeType: "ModelNode", defaultScale: 0.3, defaultPosition: [1, 0, 1], comment: "Flower (use GLB model)" },
38
- { keywords: ["rock", "stone", "boulder"], nodeType: "SphereNode", geometryType: "sphere", defaultScale: 0.8, defaultPosition: [1, 0.4, 1], color: "Color.Gray", comment: "Rock" },
39
- { keywords: ["mountain", "hill"], nodeType: "ModelNode", defaultScale: 10.0, defaultPosition: [0, 0, -10], comment: "Mountain (use GLB model)" },
40
- { keywords: ["fence"], nodeType: "CubeNode", geometryType: "cube", defaultScale: 2.0, defaultPosition: [3, 0.5, 0], color: "Color(0.55f, 0.35f, 0.17f)", comment: "Fence" },
41
- { keywords: ["bridge"], nodeType: "ModelNode", defaultScale: 5.0, defaultPosition: [0, 0, 0], comment: "Bridge (use GLB model)" },
226
+ {
227
+ keywords: ["flower", "rose"],
228
+ nodeType: "ModelNode",
229
+ defaultScale: 0.3,
230
+ defaultPosition: [1, 0, 1],
231
+ comment: "Flower (use GLB model)",
232
+ },
233
+ {
234
+ keywords: ["rock", "stone", "boulder"],
235
+ nodeType: "SphereNode",
236
+ geometryType: "sphere",
237
+ defaultScale: 0.8,
238
+ defaultPosition: [1, 0.4, 1],
239
+ color: "Color.Gray",
240
+ comment: "Rock",
241
+ },
242
+ {
243
+ keywords: ["mountain", "hill"],
244
+ nodeType: "ModelNode",
245
+ defaultScale: 10.0,
246
+ defaultPosition: [0, 0, -10],
247
+ comment: "Mountain (use GLB model)",
248
+ },
249
+ {
250
+ keywords: ["fence"],
251
+ nodeType: "CubeNode",
252
+ geometryType: "cube",
253
+ defaultScale: 2.0,
254
+ defaultPosition: [3, 0.5, 0],
255
+ color: "Color(0.55f, 0.35f, 0.17f)",
256
+ comment: "Fence",
257
+ },
258
+ {
259
+ keywords: ["bridge"],
260
+ nodeType: "ModelNode",
261
+ defaultScale: 5.0,
262
+ defaultPosition: [0, 0, 0],
263
+ comment: "Bridge (use GLB model)",
264
+ },
42
265
  // More furniture / objects
43
- { keywords: ["lamp", "light fixture"], nodeType: "ModelNode", defaultScale: 0.5, defaultPosition: [1, 0.8, 0], comment: "Lamp (use GLB model)" },
44
- { keywords: ["tv", "television", "screen", "monitor"], nodeType: "CubeNode", geometryType: "cube", defaultScale: 1.2, defaultPosition: [0, 0.8, -2], color: "Color.Black", comment: "TV/Screen (flat cube)" },
45
- { keywords: ["door", "gate"], nodeType: "CubeNode", geometryType: "cube", defaultScale: 2.0, defaultPosition: [0, 1, -3], color: "Color(0.55f, 0.35f, 0.17f)", comment: "Door" },
46
- { keywords: ["window"], nodeType: "CubeNode", geometryType: "cube", defaultScale: 1.0, defaultPosition: [2, 1.5, -3], color: "Color(0.7f, 0.85f, 1f)", comment: "Window" },
47
- { keywords: ["stairs", "staircase"], nodeType: "ModelNode", defaultScale: 2.0, defaultPosition: [3, 0, 0], comment: "Stairs (use GLB model)" },
48
- { keywords: ["book", "books"], nodeType: "CubeNode", geometryType: "cube", defaultScale: 0.2, defaultPosition: [0, 0.5, 0], color: "Color(0.6f, 0.1f, 0.1f)", comment: "Book" },
49
- { keywords: ["bottle", "vase"], nodeType: "CylinderNode", geometryType: "cylinder", defaultScale: 0.2, defaultPosition: [0, 0.3, 0], color: "Color(0.2f, 0.6f, 0.3f)", comment: "Bottle/Vase" },
50
- { keywords: ["trophy", "cup"], nodeType: "ModelNode", defaultScale: 0.3, defaultPosition: [0, 0.5, 0], comment: "Trophy (use GLB model)" },
266
+ {
267
+ keywords: ["lamp", "light fixture"],
268
+ nodeType: "ModelNode",
269
+ defaultScale: 0.5,
270
+ defaultPosition: [1, 0.8, 0],
271
+ comment: "Lamp (use GLB model)",
272
+ },
273
+ {
274
+ keywords: ["tv", "television", "screen", "monitor"],
275
+ nodeType: "CubeNode",
276
+ geometryType: "cube",
277
+ defaultScale: 1.2,
278
+ defaultPosition: [0, 0.8, -2],
279
+ color: "Color.Black",
280
+ comment: "TV/Screen (flat cube)",
281
+ },
282
+ {
283
+ keywords: ["door", "gate"],
284
+ nodeType: "CubeNode",
285
+ geometryType: "cube",
286
+ defaultScale: 2.0,
287
+ defaultPosition: [0, 1, -3],
288
+ color: "Color(0.55f, 0.35f, 0.17f)",
289
+ comment: "Door",
290
+ },
291
+ {
292
+ keywords: ["window"],
293
+ nodeType: "CubeNode",
294
+ geometryType: "cube",
295
+ defaultScale: 1.0,
296
+ defaultPosition: [2, 1.5, -3],
297
+ color: "Color(0.7f, 0.85f, 1f)",
298
+ comment: "Window",
299
+ },
300
+ {
301
+ keywords: ["stairs", "staircase"],
302
+ nodeType: "ModelNode",
303
+ defaultScale: 2.0,
304
+ defaultPosition: [3, 0, 0],
305
+ comment: "Stairs (use GLB model)",
306
+ },
307
+ {
308
+ keywords: ["book", "books"],
309
+ nodeType: "CubeNode",
310
+ geometryType: "cube",
311
+ defaultScale: 0.2,
312
+ defaultPosition: [0, 0.5, 0],
313
+ color: "Color(0.6f, 0.1f, 0.1f)",
314
+ comment: "Book",
315
+ },
316
+ {
317
+ keywords: ["bottle", "vase"],
318
+ nodeType: "CylinderNode",
319
+ geometryType: "cylinder",
320
+ defaultScale: 0.2,
321
+ defaultPosition: [0, 0.3, 0],
322
+ color: "Color(0.2f, 0.6f, 0.3f)",
323
+ comment: "Bottle/Vase",
324
+ },
325
+ {
326
+ keywords: ["trophy", "cup"],
327
+ nodeType: "ModelNode",
328
+ defaultScale: 0.3,
329
+ defaultPosition: [0, 0.5, 0],
330
+ comment: "Trophy (use GLB model)",
331
+ },
51
332
  // Food
52
- { keywords: ["pizza"], nodeType: "CylinderNode", geometryType: "cylinder", defaultScale: 0.3, defaultPosition: [0, 0.5, 0], color: "Color(0.9f, 0.7f, 0.2f)", comment: "Pizza (flat cylinder)" },
53
- { keywords: ["cake"], nodeType: "CylinderNode", geometryType: "cylinder", defaultScale: 0.3, defaultPosition: [0, 0.5, 0], color: "Color(1f, 0.85f, 0.7f)", comment: "Cake (cylinder)" },
54
- { keywords: ["apple", "fruit"], nodeType: "SphereNode", geometryType: "sphere", defaultScale: 0.08, defaultPosition: [0, 0.5, 0], color: "Color.Red", comment: "Apple/Fruit" },
333
+ {
334
+ keywords: ["pizza"],
335
+ nodeType: "CylinderNode",
336
+ geometryType: "cylinder",
337
+ defaultScale: 0.3,
338
+ defaultPosition: [0, 0.5, 0],
339
+ color: "Color(0.9f, 0.7f, 0.2f)",
340
+ comment: "Pizza (flat cylinder)",
341
+ },
342
+ {
343
+ keywords: ["cake"],
344
+ nodeType: "CylinderNode",
345
+ geometryType: "cylinder",
346
+ defaultScale: 0.3,
347
+ defaultPosition: [0, 0.5, 0],
348
+ color: "Color(1f, 0.85f, 0.7f)",
349
+ comment: "Cake (cylinder)",
350
+ },
351
+ {
352
+ keywords: ["apple", "fruit"],
353
+ nodeType: "SphereNode",
354
+ geometryType: "sphere",
355
+ defaultScale: 0.08,
356
+ defaultPosition: [0, 0.5, 0],
357
+ color: "Color.Red",
358
+ comment: "Apple/Fruit",
359
+ },
55
360
  ];
56
361
  // ── Text keywords ───────────────────────────────────────────────────────────
57
362
  const TEXT_KEYWORDS = ["label", "text", "sign", "title", "name", "caption", "annotation"];
@@ -81,9 +386,18 @@ function parseDescription(description) {
81
386
  let count = 1;
82
387
  if (match[1]) {
83
388
  const numWords = {
84
- one: 1, two: 2, three: 3, four: 4, five: 5,
85
- six: 6, seven: 7, eight: 8, nine: 9, ten: 10,
86
- a: 1, an: 1,
389
+ one: 1,
390
+ two: 2,
391
+ three: 3,
392
+ four: 4,
393
+ five: 5,
394
+ six: 6,
395
+ seven: 7,
396
+ eight: 8,
397
+ nine: 9,
398
+ ten: 10,
399
+ a: 1,
400
+ an: 1,
87
401
  };
88
402
  count = numWords[match[1].toLowerCase()] || parseInt(match[1]) || 1;
89
403
  }
@@ -121,21 +435,17 @@ function spreadPositions(count, basePos, spacing) {
121
435
  const positions = [];
122
436
  const halfSpan = ((count - 1) * spacing) / 2;
123
437
  for (let i = 0; i < count; i++) {
124
- positions.push([
125
- basePos[0] + i * spacing - halfSpan,
126
- basePos[1],
127
- basePos[2],
128
- ]);
438
+ positions.push([basePos[0] + i * spacing - halfSpan, basePos[1], basePos[2]]);
129
439
  }
130
440
  return positions;
131
441
  }
132
442
  /** Generate a material variable name from a color expression */
133
443
  function colorToVarName(color) {
134
- return color
444
+ return (color
135
445
  .replace("Color.", "")
136
446
  .replace(/Color\(.*\)/, "custom")
137
447
  .replace(/[^a-zA-Z0-9]/g, "")
138
- .toLowerCase() + "Mat";
448
+ .toLowerCase() + "Mat");
139
449
  }
140
450
  export function generateScene(description) {
141
451
  const parsed = parseDescription(description);
@@ -237,14 +547,19 @@ export function generateScene(description) {
237
547
  }
238
548
  // Build the code
239
549
  const isAR = parsed.isAR;
240
- dependencies.push(isAR ? "io.github.sceneview:arsceneview:${LATEST_SCENEVIEW_RELEASE}" : "io.github.sceneview:sceneview:${LATEST_SCENEVIEW_RELEASE}");
550
+ dependencies.push(isAR
551
+ ? `io.github.sceneview:arsceneview:${LATEST_SCENEVIEW_RELEASE}`
552
+ : `io.github.sceneview:sceneview:${LATEST_SCENEVIEW_RELEASE}`);
241
553
  // Build model instance declarations
242
554
  const modelElements = elements.filter((e) => e.type === "model");
243
555
  const uniqueModels = new Map();
244
556
  modelElements.forEach((e) => {
245
557
  const path = e.properties.modelPath;
246
558
  if (!uniqueModels.has(path)) {
247
- const varName = path.replace("models/", "").replace(".glb", "").replace(/[^a-zA-Z0-9]/g, "") + "Instance";
559
+ const varName = path
560
+ .replace("models/", "")
561
+ .replace(".glb", "")
562
+ .replace(/[^a-zA-Z0-9]/g, "") + "Instance";
248
563
  uniqueModels.set(path, varName);
249
564
  }
250
565
  });
@@ -319,9 +634,9 @@ export function generateScene(description) {
319
634
  lines.push(" modelLoader = modelLoader,");
320
635
  lines.push(" cameraManipulator = rememberCameraManipulator(),");
321
636
  if (!parsed.isDark) {
322
- lines.push(' environment = rememberEnvironment(environmentLoader) {');
637
+ lines.push(" environment = rememberEnvironment(environmentLoader) {");
323
638
  lines.push(' environmentLoader.createHDREnvironment("environments/sky_2k.hdr")');
324
- lines.push(' ?: createEnvironment(environmentLoader)');
639
+ lines.push(" ?: createEnvironment(environmentLoader)");
325
640
  lines.push(" },");
326
641
  lines.push(" mainLightNode = rememberMainLightNode(engine) { intensity = 100_000f }");
327
642
  }
@@ -454,7 +769,7 @@ export function generateScene(description) {
454
769
  notes.push("Free 3D models: https://sketchfab.com/features/free-3d-models (download as GLB)");
455
770
  }
456
771
  if (isAR) {
457
- notes.push("AR requires camera permission at runtime and ARCore on the device. See `get_platform_setup(\"android\", \"ar\")` for full setup.");
772
+ notes.push('AR requires camera permission at runtime and ARCore on the device. See `get_platform_setup("android", "ar")` for full setup.');
458
773
  }
459
774
  if (elements.length <= 2 && !hasModel && !hasGeometry) {
460
775
  notes.push("Only a light was generated. The description didn't match any known objects. Try mentioning specific objects like 'table', 'chair', 'sphere', 'cube', etc.");
@@ -479,7 +794,9 @@ export function formatGeneratedScene(result) {
479
794
  parts.push(`**Elements:** ${result.elements.length} nodes\n`);
480
795
  parts.push(`### Dependency\n`);
481
796
  parts.push("```kotlin");
482
- result.dependencies.forEach((d) => parts.push(`implementation("${d}")`));
797
+ result.dependencies.forEach((d) => {
798
+ parts.push(`implementation("${d}")`);
799
+ });
483
800
  parts.push("```\n");
484
801
  parts.push(`### Code\n`);
485
802
  parts.push("```kotlin");
@@ -487,7 +804,9 @@ export function formatGeneratedScene(result) {
487
804
  parts.push("```\n");
488
805
  if (result.notes.length > 0) {
489
806
  parts.push(`### Notes\n`);
490
- result.notes.forEach((n, i) => parts.push(`${i + 1}. ${n}`));
807
+ result.notes.forEach((n, i) => {
808
+ parts.push(`${i + 1}. ${n}`);
809
+ });
491
810
  }
492
811
  return parts.join("\n");
493
812
  }