@treasuryspatial/render-kit 0.1.1

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.
@@ -0,0 +1,711 @@
1
+ export const BASE_FIDELITY = [
2
+ '<fidelity>',
3
+ 'Match the camera framing, lens, and perspective from the input image for the initial render, until other instructions are given for camera/perspective/viewpoint.',
4
+ 'Preserve all massing, rooflines, openings, and facade edges exactly as drawn, until other instructions are given.',
5
+ 'Only add materials, lighting, vegetation, people, and era-appropriate surface details on top of the existing geometry.',
6
+ '</fidelity>',
7
+ ].join('\n');
8
+ export const LOCATION_PRESETS = {
9
+ none: {
10
+ label: 'None',
11
+ scene: '',
12
+ },
13
+ // Africa
14
+ dakar: {
15
+ label: 'Dakar',
16
+ scene: 'Dakar courtyard: sun-baked stucco and pastel facades, shaded arcades, patterned metal railings, clay tile accents; courtyard with stone or cement paving and drought-tolerant planting; adjacent street with worn asphalt, low curbs, and coastal West African street life cues.',
17
+ },
18
+ cape_town: {
19
+ label: 'Cape Town',
20
+ scene: 'Cape Town courtyard: Cape Dutch-inspired gables, whitewashed walls, timber shutters, terracotta roofs; courtyard with brick or stone paving and indigenous planting; adjacent street with clean asphalt, stone curbs, and subtle coastal light.',
21
+ },
22
+ porto_novo: {
23
+ label: 'Porto-Novo',
24
+ scene: 'Porto-Novo courtyard: Afro-Brazilian inspired facades, colorful plaster, arched colonnades, timber shutters; courtyard with patterned stone or tile paving; adjacent street with dusty asphalt, low curbs, and tropical street vegetation.',
25
+ },
26
+ rabat: {
27
+ label: 'Rabat',
28
+ scene: 'Rabat courtyard: whitewashed walls, carved stone details, green tile accents, arched openings; courtyard with zellij-like tile paving and citrus planting; adjacent street with clean stone sidewalks and low-rise Moroccan urban texture.',
29
+ },
30
+ abuja: {
31
+ label: 'Abuja',
32
+ scene: 'Abuja courtyard: contemporary African-modern plaster and stone, deep shade lines, vertical fins; courtyard with concrete or stone paving and native planting; adjacent street with wide asphalt lanes and minimal street clutter.',
33
+ },
34
+ addis_ababa: {
35
+ label: 'Addis Ababa',
36
+ scene: 'Addis Ababa courtyard: basalt stone walls, corrugated metal accents, warm plaster, timber windows; courtyard with stone paving and eucalyptus planting; adjacent street with mixed asphalt and stone edges.',
37
+ },
38
+ cairo: {
39
+ label: 'Cairo',
40
+ scene: 'Cairo courtyard: sandy limestone and plaster facades, mashrabiya screens, arched colonnades; courtyard with stone paving and shade trees; adjacent street with dusty asphalt, stone curbs, and layered urban texture.',
41
+ },
42
+ // Asia
43
+ harappan_valley: {
44
+ label: 'Harappan Valley',
45
+ scene: 'Harappan Valley courtyard: ancient Indus Valley brick compounds with rectilinear forms, baked brick walls, simple flat roofs, and orderly drainage channels; courtyard with compacted earth and stone paving; adjacent street with grid-like brick lanes and minimal ornament.',
46
+ },
47
+ delhi: {
48
+ label: 'Delhi',
49
+ scene: 'Delhi courtyard: red sandstone and pale plaster, jaali screens, shaded arcades, flat roofs with parapets; courtyard with terracotta or stone paving and hardy plantings; adjacent street with dust-hued asphalt, concrete curbs, and layered urban textures.',
50
+ },
51
+ islamabad: {
52
+ label: 'Islamabad',
53
+ scene: 'Islamabad courtyard: clean modernist lines, pale stone and concrete, shaded colonnades; courtyard with stone paving and clipped greenery; adjacent street with broad asphalt lanes and orderly planting.',
54
+ },
55
+ kathmandu: {
56
+ label: 'Kathmandu',
57
+ scene: 'Kathmandu courtyard: warm brick walls, carved timber windows, pagoda rooflines, muted plaster; courtyard with brick paving and stone inlays; adjacent street with narrow lanes and traditional Newar urban texture.',
58
+ },
59
+ thimphu: {
60
+ label: 'Thimphu',
61
+ scene: 'Thimphu courtyard: Bhutanese whitewashed walls with dark timber bands, carved window frames, sloped roofs; courtyard with stone paving and prayer flag hints; adjacent street with clean stone edges and mountain light.',
62
+ },
63
+ lhasa: {
64
+ label: 'Lhasa',
65
+ scene: 'Lhasa courtyard: thick white plaster walls, dark timber windows, flat roofs with prayer flag elements; courtyard with stone paving and windworn texture; adjacent street with stone slabs and high-altitude light.',
66
+ },
67
+ ulaanbaatar: {
68
+ label: 'Ulaanbaatar',
69
+ scene: 'Ulaanbaatar courtyard: brick and plaster facades with Soviet-modern influence, steep metal roofs, simple balconies; courtyard with stone or concrete paving; adjacent street with wide asphalt and strong winter light.',
70
+ },
71
+ astana: {
72
+ label: 'Astana',
73
+ scene: 'Astana courtyard: sleek modern glass and pale stone, sculptural forms, crisp detailing; courtyard with clean stone paving and minimal planting; adjacent street with broad boulevards and contemporary urban furniture.',
74
+ },
75
+ tokyo: {
76
+ label: 'Tokyo',
77
+ scene: 'Tokyo courtyard: compact concrete and glass facades, slender balconies, minimal detailing; courtyard with smooth paving and sparse greenery; adjacent street with clean asphalt, subtle signage, and tidy urban order.',
78
+ },
79
+ seoul: {
80
+ label: 'Seoul',
81
+ scene: 'Seoul courtyard: mix of modern concrete/glass and traditional hanok-inspired timber accents; courtyard with stone paving and planted edges; adjacent street with clean sidewalks and muted signage.',
82
+ },
83
+ beijing: {
84
+ label: 'Beijing',
85
+ scene: 'Beijing courtyard: grey brick walls, tiled roofs, timber frames, hutong-like proportions; courtyard with stone paving and simple plantings; adjacent street with wide stone sidewalks and traditional gate cues.',
86
+ },
87
+ kyoto: {
88
+ label: 'Kyoto',
89
+ scene: 'Kyoto courtyard: timber machiya facades, lattice screens, clay tile roofs, subdued earth tones; courtyard with stone paving and mossy planting; adjacent street with narrow stone sidewalks and calm urban texture.',
90
+ },
91
+ chiang_mai: {
92
+ label: 'Chiang Mai',
93
+ scene: 'Chiang Mai courtyard: teak timber and warm plaster, low eaves, Lanna-inspired detailing; courtyard with stone paving and lush planting; adjacent street with warm asphalt and tropical greenery.',
94
+ },
95
+ hanoi: {
96
+ label: 'Hanoi',
97
+ scene: 'Hanoi courtyard: French colonial plaster facades with shutters, balconies, and warm pastel tones; courtyard with patterned tile paving and greenery; adjacent street with narrow sidewalks and layered urban texture.',
98
+ },
99
+ singapore: {
100
+ label: 'Singapore',
101
+ scene: 'Singapore courtyard: sleek contemporary concrete/glass with deep shade, tropical planting, and clean lines; courtyard with smooth stone paving and dense greenery; adjacent street with pristine sidewalks and modern street furniture.',
102
+ },
103
+ colombo: {
104
+ label: 'Colombo',
105
+ scene: 'Colombo courtyard: tropical colonial plaster, verandas, timber shutters, warm stone details; courtyard with tile or stone paving and lush planting; adjacent street with warm asphalt and coastal humidity cues.',
106
+ },
107
+ doha: {
108
+ label: 'Doha',
109
+ scene: 'Doha courtyard: pale limestone, glass, and metal, strong shadow lines, modern Islamic geometric motifs; courtyard with stone paving and minimal planting; adjacent street with broad asphalt and desert haze.',
110
+ },
111
+ dubai: {
112
+ label: 'Dubai',
113
+ scene: 'Dubai courtyard: sleek glass and pale stone, modern vertical accents, shaded arcades; courtyard with polished stone paving and palm planting; adjacent street with wide lanes and bright desert light.',
114
+ },
115
+ bangkok: {
116
+ label: 'Bangkok',
117
+ scene: 'Bangkok courtyard: tropical modern concrete and white plaster, teak or bamboo screens, deep shade, glossy stone paving, lush planting beds; adjacent street with warm asphalt, painted curbs, and subtle Thai urban cues.',
118
+ },
119
+ hongkong: {
120
+ label: 'Hong Kong',
121
+ scene: 'Hong Kong courtyard: dense urban mix of concrete, granite, and glass, painted metal railings, compact balconies, vertical rhythm; courtyard with stone pavers and planter boxes; adjacent street with crisp signage, polished stone sidewalks, and high-density urban character.',
122
+ },
123
+ vladivostok: {
124
+ label: 'Vladivostok',
125
+ scene: 'Vladivostok courtyard: hilly port-city facades in muted plaster and brick, metal roofs, simple balconies; courtyard with stone paving; adjacent street with sloped asphalt and maritime urban cues.',
126
+ },
127
+ // Europe
128
+ barcelona: {
129
+ label: 'Barcelona',
130
+ scene: 'Barcelona (Eixample) courtyard: warm Mediterranean stucco and stone, wrought-iron balcony railings, terracotta roof tiles, light-colored stone window surrounds, inner courtyard paving, a few planters/trees appropriate to Barcelona; adjacent narrow urban street with realistic asphalt or cobble, sidewalk, and street furniture typical of the Eixample.',
131
+ },
132
+ stockholm: {
133
+ label: 'Stockholm',
134
+ scene: 'Stockholm courtyard: rendered plaster facades in muted ochre, terracotta, and pale grey tones typical of Ostermalm or Vasastan; copper or zinc standing-seam roofing with verdigris patina; painted timber window frames; restrained Art Nouveau or National Romantic ornament; inner courtyard cobblestone paving with central planting bed and birch or maple trees; adjacent urban street with granite setts, raised granite curbs, and period lampposts.',
135
+ },
136
+ copenhagen: {
137
+ label: 'Copenhagen',
138
+ scene: 'Copenhagen courtyard: warm Danish brick and pale limewash, copper or zinc roofs, tall timber windows, minimal Scandinavian detailing; inner courtyard with brick or granite setts and modest planting; adjacent street with granite curbs, cobbles, and understated Danish street furniture.',
139
+ },
140
+ berlin: {
141
+ label: 'Berlin',
142
+ scene: 'Berlin courtyard: mix of brick and stucco facades with contemporary infill, matte plaster in warm grey or beige, steel balconies, tall sash windows; inner courtyard with gravel and sparse plantings; adjacent street with asphalt, stone curbs, and utilitarian lighting.',
143
+ },
144
+ amsterdam: {
145
+ label: 'Amsterdam',
146
+ scene: 'Amsterdam courtyard: narrow brick facades with stepped or bell gables, dark timber trim, black iron railings; slate or clay tiles; inner courtyard with brick pavers and canal-town planting; adjacent street with brick paving, canal-style bollards, and subtle waterfront cues.',
147
+ },
148
+ london: {
149
+ label: 'London',
150
+ scene: 'London courtyard: Georgian and Victorian brick, pale stone lintels, sash windows, slate roofs, cast-iron railings; mews-like paving with stone setts; adjacent street with classic lampposts, granite curbs, and understated signage.',
151
+ },
152
+ paris: {
153
+ label: 'Paris',
154
+ scene: 'Paris courtyard: Haussmann limestone facades, wrought-iron balconies, mansard slate roofs with dormers, stone cornices; inner courtyard with pale stone paving and clipped greenery; adjacent street with Parisian street lamps and clean stone sidewalks.',
155
+ },
156
+ rome: {
157
+ label: 'Rome',
158
+ scene: 'Rome courtyard: warm travertine and stucco facades, arched openings, terracotta roof tiles; courtyard with cobblestone paving and classical planting; adjacent street with stone setts and historic urban texture.',
159
+ },
160
+ athens: {
161
+ label: 'Athens',
162
+ scene: 'Athens courtyard: pale stone and plaster facades, classical proportions, metal balconies; courtyard with stone paving and olive planting; adjacent street with warm asphalt and Mediterranean light.',
163
+ },
164
+ warsaw: {
165
+ label: 'Warsaw',
166
+ scene: 'Warsaw courtyard: restored historic facades in warm plaster tones, red tile roofs, modest ornament; courtyard with stone paving; adjacent street with granite curbs and orderly urban texture.',
167
+ },
168
+ ljubljana: {
169
+ label: 'Ljubljana',
170
+ scene: 'Ljubljana courtyard: pastel plaster facades, red tile roofs, modest classical detailing; courtyard with stone paving and green planting; adjacent street with tidy stone sidewalks and river-town calm.',
171
+ },
172
+ moscow: {
173
+ label: 'Moscow',
174
+ scene: 'Moscow courtyard: brick and plaster facades with classical proportions, metal balconies, muted ornament; courtyard with stone paving and sparse planting; adjacent street with wide asphalt lanes and strong winter light.',
175
+ },
176
+ helsinki: {
177
+ label: 'Helsinki',
178
+ scene: 'Helsinki courtyard: pale granite and plaster facades, clean Nordic detailing, copper accents; courtyard with stone paving and birch planting; adjacent street with granite setts and restrained signage.',
179
+ },
180
+ reykjavik: {
181
+ label: 'Reykjavik',
182
+ scene: 'Reykjavik courtyard: colorful timber or corrugated-metal facades, steep roofs, simple windows; courtyard with stone paving and rugged planting; adjacent street with crisp asphalt and North Atlantic light.',
183
+ },
184
+ oxford: {
185
+ label: 'Oxford',
186
+ scene: 'Oxford courtyard: honey-colored limestone, gothic tracery, slate roofs, historic college walls; courtyard with stone paving and clipped lawns; adjacent street with narrow stone sidewalks.',
187
+ },
188
+ edinburgh: {
189
+ label: 'Edinburgh',
190
+ scene: 'Edinburgh courtyard: dark stone facades, slate roofs, tall sash windows, iron railings; courtyard with stone setts; adjacent street with stone curbs and Scottish urban texture.',
191
+ },
192
+ istanbul: {
193
+ label: 'Istanbul',
194
+ scene: 'Istanbul courtyard: warm stone and plaster, timber bay windows, subtle Ottoman detailing, red tile roofs; patterned stone paving and shaded planting; adjacent street with worn stone, metal railings, and layered shopfront textures.',
195
+ },
196
+ // North America
197
+ san_francisco: {
198
+ label: 'San Francisco',
199
+ scene: 'San Francisco courtyard: painted timber facades, bay windows, ornate trims, slender balconies; courtyard with brick or stone paving and small trees; adjacent street with asphalt, steep grades, and street trees.',
200
+ },
201
+ chicago: {
202
+ label: 'Chicago',
203
+ scene: 'Chicago courtyard: brick and stone facades with steel lintels, tall windows, modest ornament; courtyard with concrete or stone paving; adjacent street with wide asphalt and utilitarian lighting.',
204
+ },
205
+ boston: {
206
+ label: 'Boston',
207
+ scene: 'Boston courtyard: red brick and brownstone facades, white trim, iron railings; courtyard with brick paving and clipped planting; adjacent street with stone curbs and historic urban texture.',
208
+ },
209
+ miami: {
210
+ label: 'Miami',
211
+ scene: 'Miami courtyard: light stucco, Art Deco hints, pastel accents, palm planting; courtyard with terrazzo or stone paving and lush greenery; adjacent street with warm asphalt and coastal light.',
212
+ },
213
+ havana: {
214
+ label: 'Havana',
215
+ scene: 'Havana courtyard: weathered pastel plaster, wrought-iron balconies, arched openings; courtyard with patterned tile paving and tropical planting; adjacent street with worn asphalt and classic urban texture.',
216
+ },
217
+ // South America
218
+ lima: {
219
+ label: 'Lima',
220
+ scene: 'Lima courtyard: coastal stucco facades in muted tones, wooden balconies, clay tile accents; courtyard with stone paving and hardy planting; adjacent street with dusty asphalt and soft ocean light.',
221
+ },
222
+ la_paz: {
223
+ label: 'La Paz',
224
+ scene: 'La Paz courtyard: high-altitude brick and plaster facades, simple metal railings, strong mountain light; courtyard with stone or concrete paving; adjacent street with sloped asphalt and rugged terrain cues.',
225
+ },
226
+ brasilia: {
227
+ label: 'Brasilia',
228
+ scene: 'Brasilia courtyard: modernist concrete and glass, bold pilotis, clean geometric lines; courtyard with smooth stone paving and minimal planting; adjacent street with broad boulevards and crisp modern order.',
229
+ },
230
+ // Oceania
231
+ canberra: {
232
+ label: 'Canberra',
233
+ scene: 'Canberra courtyard: modern civic brick and concrete, clean lines, shaded colonnades; courtyard with stone paving and eucalyptus planting; adjacent street with wide lanes and garden-city calm.',
234
+ },
235
+ wellington: {
236
+ label: 'Wellington',
237
+ scene: 'Wellington courtyard: timber and weatherboard facades, metal roofs, modest balconies; courtyard with stone paving and wind-swept planting; adjacent street with asphalt and coastal light.',
238
+ },
239
+ };
240
+ export const TIME_OF_DAY_PRESETS = {
241
+ dawn: 'Pre-dawn blue hour with cool ambient light, soft gradients, long faint shadows, and a subtle warm glow near the horizon.',
242
+ morning: 'Crisp morning light with a low sun angle, clean shadows, cool-to-warm balance, and a bright sky.',
243
+ noon: 'High midday sun, short shadows, neutral color temperature, strong clarity, and clean contrast.',
244
+ afternoon: 'Warm late-afternoon light with softer shadows, golden bounce, slight haze, and rich warmth.',
245
+ evening: 'Golden hour sliding into dusk, warm highlights, long shadows, and early window glow.',
246
+ night: 'Urban night lighting with cool ambient tones, warm streetlights, interior glow, and subtle reflections.',
247
+ };
248
+ export const ERA_PRESETS = {
249
+ today: {
250
+ label: 'today',
251
+ style: 'Photorealistic contemporary image with modern camera realism.',
252
+ endYear: 9999,
253
+ taskPrefix: 'Render a photorealistic architectural visualization of',
254
+ rendering: 'Photorealistic architectural visualization, PBR materials, subtle micro-surface detail, realistic scale.',
255
+ sceneCue: 'Modern streetscape cues and contemporary urban context.',
256
+ sceneRules: 'Use contemporary materials and infrastructure; modern signage, paving, and vehicles are appropriate.',
257
+ interpretation: 'Interpret the massing as contemporary architecture with realistic facade systems and materials.',
258
+ prohibitions: '',
259
+ },
260
+ early_20th: {
261
+ label: 'early 20th century',
262
+ style: 'Very early color photograph with subtle aging, slight fading, and gentle paper grain while staying crisp.',
263
+ endYear: 1930,
264
+ taskPrefix: 'Render as a very early color photograph of',
265
+ rendering: 'Early color photo look, slightly aged paper, restrained saturation, crisp focus.',
266
+ sceneCue: 'Period-appropriate streets and furnishings; early automobiles or trams only if explicitly requested; avoid modern signage.',
267
+ sceneRules: 'Reinterpret any modern location cues into early 1900s equivalents (stone, brick, early concrete); no contemporary glass curtain walls or neon.',
268
+ interpretation: 'Reinterpret the massing into early 20th-century architecture using era-appropriate materials and detailing; remove contemporary facade systems.',
269
+ prohibitions: 'Avoid modern signage, neon, glass curtain walls, and contemporary street hardware.',
270
+ },
271
+ nineteenth: {
272
+ label: '19th century',
273
+ style: 'High-quality early black-and-white photograph, sharp focus, slight vignette, and tiny grain artifacts.',
274
+ endYear: 1899,
275
+ taskPrefix: 'Render as a high-quality early black-and-white photograph of',
276
+ rendering: 'Black-and-white photo, sharp focus, slight vignette, fine grain.',
277
+ sceneCue: 'Cobblestone streets, gas lamps, horse-era cues; trams are acceptable, no automobiles.',
278
+ sceneRules: 'Replace modern materials with 19th-century equivalents (cobblestone, timber, stone); avoid asphalt, modern glass, steel railings, and contemporary signage.',
279
+ interpretation: 'Translate the courtyard massing into 19th-century urban fabric with masonry, timber, and period-appropriate openings; remove modern facade language.',
280
+ prohibitions: 'No automobiles, no asphalt, no modern signage, no contemporary glazing systems.',
281
+ },
282
+ eighteenth: {
283
+ label: '18th century',
284
+ style: '18th-century pencil and watercolor architectural sketch on aged paper.',
285
+ endYear: 1799,
286
+ taskPrefix: 'Render as an 18th-century pencil and watercolor architectural sketch of',
287
+ rendering: 'Graphite pencil linework with light watercolor washes, visible paper grain, soft edges, slight bleed; avoid inked outlines or cartoon styling.',
288
+ sceneCue: 'Pre-industrial street cues and materials; no modern elements.',
289
+ sceneRules: 'Translate any modern cues into pre-industrial materials (stone, timber, dirt paths); avoid modern infrastructure and manufactured finishes.',
290
+ interpretation: 'Reinterpret the massing as an 18th-century courtyard enclosure with period-appropriate proportions and materials; keep it conceptual and abstract.',
291
+ prohibitions: 'Avoid inked comic outlines, flat fills, and any modern architectural details.',
292
+ },
293
+ olden: {
294
+ label: 'olden days',
295
+ style: '14th-century panel painting (tempera) photographed as a real artwork with visible surface texture.',
296
+ endYear: 1699,
297
+ taskPrefix: 'Render as a 14th-century panel painting of',
298
+ rendering: 'Photorealistic reproduction of a 14th-century tempera painting on panel; show craquelure, varnish glare, wood grain, and pigment texture.',
299
+ sceneCue: 'Historic environment cues and natural materials; no modern elements.',
300
+ sceneRules: 'Use historic, organic materials; no asphalt, no modern signage, no manufactured street furniture; keep surfaces uneven and hand-built.',
301
+ interpretation: 'Reinterpret the massing as a medieval courtyard concept—abstracted enclosure, hand-built materials, simplified geometry.',
302
+ prohibitions: 'No modern perspective rendering, no contemporary materials, no sleek finishes.',
303
+ },
304
+ prehistory: {
305
+ label: 'prehistory',
306
+ style: 'Photorealistic photograph of a cave painting on rock.',
307
+ endYear: 0,
308
+ taskPrefix: 'Depict as a photorealistic cave painting of',
309
+ rendering: 'Photorealistic photo of cave wall art: raw stone texture, mineral streaks, soot, pigment stains, primitive marks, and handprints.',
310
+ sceneCue: 'No streets, no modern infrastructure; primitive settlement cues only.',
311
+ sceneRules: 'Ignore modern location cues entirely; depict only primitive settlement/context around the massing silhouette with earthy pigments and raw textures.',
312
+ interpretation: 'Translate the massing into a primitive enclosure or settlement abstraction; reduce architecture to symbolic outlines and spatial relationships.',
313
+ prohibitions: 'No modern architecture, no perspective rendering, no graphic illustration style.',
314
+ },
315
+ };
316
+ export const RENDER_TOGGLE_LABELS = {
317
+ people: 'people',
318
+ bicycles: 'bicycles',
319
+ cars: 'cars',
320
+ trams: 'trams',
321
+ landscaping: 'landscaping',
322
+ tech: 'tech innovations',
323
+ };
324
+ export const STYLE_OPTIONS = [
325
+ 'Zaha Hadid Architects',
326
+ 'Foster + Partners',
327
+ 'Bjarke Ingels Group (BIG)',
328
+ 'Frank Lloyd Wright',
329
+ 'Louis Kahn',
330
+ 'Le Corbusier',
331
+ 'Mies van der Rohe',
332
+ 'Renzo Piano',
333
+ 'Tadao Ando',
334
+ 'Rem Koolhaas',
335
+ 'Santiago Calatrava',
336
+ 'Antoni Gaudi',
337
+ ];
338
+ const DESIGNER_BIRTH_YEARS = {
339
+ 'Zaha Hadid Architects': 1950,
340
+ 'Foster + Partners': 1935,
341
+ 'Bjarke Ingels Group (BIG)': 1974,
342
+ 'Frank Lloyd Wright': 1867,
343
+ 'Louis Kahn': 1901,
344
+ 'Le Corbusier': 1887,
345
+ 'Mies van der Rohe': 1886,
346
+ 'Renzo Piano': 1937,
347
+ 'Tadao Ando': 1941,
348
+ 'Rem Koolhaas': 1944,
349
+ 'Santiago Calatrava': 1951,
350
+ 'Antoni Gaudi': 1852,
351
+ };
352
+ export const DEFAULT_LOCATION = 'barcelona';
353
+ export const DEFAULT_TIME_OF_DAY = 'afternoon';
354
+ export const DEFAULT_ERA = 'today';
355
+ export const DEFAULT_TOGGLES = {
356
+ people: false,
357
+ bicycles: false,
358
+ cars: false,
359
+ trams: false,
360
+ landscaping: false,
361
+ tech: false,
362
+ };
363
+ export const ERA_TOGGLE_RULES = {
364
+ today: {
365
+ people: true,
366
+ bicycles: true,
367
+ cars: true,
368
+ trams: true,
369
+ landscaping: true,
370
+ tech: true,
371
+ },
372
+ early_20th: {
373
+ people: true,
374
+ bicycles: true,
375
+ cars: true,
376
+ trams: true,
377
+ landscaping: true,
378
+ tech: false,
379
+ },
380
+ nineteenth: {
381
+ people: true,
382
+ bicycles: true,
383
+ cars: false,
384
+ trams: true,
385
+ landscaping: true,
386
+ tech: false,
387
+ },
388
+ eighteenth: {
389
+ people: true,
390
+ bicycles: true,
391
+ cars: false,
392
+ trams: false,
393
+ landscaping: true,
394
+ tech: false,
395
+ },
396
+ olden: {
397
+ people: true,
398
+ bicycles: false,
399
+ cars: false,
400
+ trams: false,
401
+ landscaping: true,
402
+ tech: false,
403
+ },
404
+ prehistory: {
405
+ people: true,
406
+ bicycles: false,
407
+ cars: false,
408
+ trams: false,
409
+ landscaping: true,
410
+ tech: false,
411
+ },
412
+ };
413
+ const normalizeLocationLabel = (label) => {
414
+ const trimmed = (label || '').trim();
415
+ if (!trimmed || trimmed.toLowerCase() === 'none')
416
+ return '';
417
+ return trimmed;
418
+ };
419
+ function buildToggleBlock(locationLabel, toggles) {
420
+ const safeLabel = normalizeLocationLabel(locationLabel);
421
+ const sceneRef = safeLabel ? `appropriate to ${safeLabel}` : 'appropriate to the scene';
422
+ const localeRef = safeLabel ? `for ${safeLabel}` : 'for the scene';
423
+ const climateRef = safeLabel ? `${safeLabel}'s climate` : 'the scene climate';
424
+ const lines = [];
425
+ if (toggles.people) {
426
+ lines.push(`People: add pedestrians ${sceneRef}, natural scale cues, candid poses, clothing suited to the locale and time of day.`);
427
+ }
428
+ if (toggles.bicycles) {
429
+ lines.push(`Bicycles: add bikes and cyclists ${localeRef}, with realistic racks and locking details.`);
430
+ }
431
+ if (toggles.cars) {
432
+ lines.push(`Cars: add local vehicle styles ${localeRef}, a mix of parked and moving traffic, subtle reflections, no oversized vehicles.`);
433
+ }
434
+ if (toggles.trams) {
435
+ lines.push('Trams: include light-rail or tram presence integrated into the street scene when it fits the context.');
436
+ }
437
+ if (toggles.landscaping) {
438
+ lines.push(`Landscaping: add heavy foliage in the courtyard and street edges with plant species suited to ${climateRef}.`);
439
+ }
440
+ if (toggles.tech) {
441
+ lines.push('Tech innovations: add subtle near-future elements (delivery robots, AVs, discreet sensors) while keeping realism and scale.');
442
+ }
443
+ if (lines.length === 0)
444
+ return '';
445
+ return ['<activity>', ...lines, '</activity>'].join('\n');
446
+ }
447
+ export function isDesignerOutOfEra(styleLabel, era) {
448
+ if (!styleLabel)
449
+ return false;
450
+ const birthYear = DESIGNER_BIRTH_YEARS[styleLabel];
451
+ if (!birthYear)
452
+ return false;
453
+ return ERA_PRESETS[era].endYear < birthYear;
454
+ }
455
+ export function buildRenderPrompt(context) {
456
+ const { location, timeOfDay, toggles, styleLabel, era } = context;
457
+ const preset = LOCATION_PRESETS[location];
458
+ const locationIsNone = location === 'none';
459
+ const timePrompt = TIME_OF_DAY_PRESETS[timeOfDay];
460
+ const eraPreset = ERA_PRESETS[era];
461
+ const toggleBlock = buildToggleBlock(locationIsNone ? '' : preset.label, toggles);
462
+ const designerNotBorn = isDesignerOutOfEra(styleLabel, era);
463
+ const safeStyleLabel = styleLabel && !designerNotBorn ? styleLabel : '';
464
+ const styleLine = safeStyleLabel
465
+ ? `Style reference: ${safeStyleLabel} (licensed by Treasury). Blend the overall aesthetic with this designer.`
466
+ : '';
467
+ const designerAnnotation = designerNotBorn && styleLabel
468
+ ? [
469
+ '<annotation>',
470
+ `Overlay the text "${styleLabel} not born yet" in DIN font on top of the image.`,
471
+ '</annotation>',
472
+ ].join('\n')
473
+ : '';
474
+ const taskLine = locationIsNone
475
+ ? `${eraPreset.taskPrefix} a courtyard and adjacent street from the provided massing/line model.`
476
+ : `${eraPreset.taskPrefix} a ${preset.label} courtyard and adjacent street from the provided massing/line model.`;
477
+ const sceneBlock = [
478
+ locationIsNone ? '' : preset.scene,
479
+ eraPreset.sceneCue,
480
+ eraPreset.sceneRules ?? '',
481
+ ]
482
+ .filter(Boolean)
483
+ .join(' ')
484
+ .trim();
485
+ const parts = [
486
+ '<task>',
487
+ taskLine,
488
+ 'Use the input image as the exact geometry and camera reference, until other instructions are given.',
489
+ '</task>',
490
+ '',
491
+ BASE_FIDELITY,
492
+ '',
493
+ styleLine ? '<style>' : '',
494
+ styleLine,
495
+ styleLine ? '</style>' : '',
496
+ '',
497
+ '<era>',
498
+ eraPreset.style,
499
+ '</era>',
500
+ '',
501
+ sceneBlock ? '<scene>' : '',
502
+ sceneBlock,
503
+ sceneBlock ? '</scene>' : '',
504
+ '',
505
+ eraPreset.interpretation ? '<interpretation>' : '',
506
+ eraPreset.interpretation ?? '',
507
+ eraPreset.interpretation ? '</interpretation>' : '',
508
+ '',
509
+ eraPreset.prohibitions ? '<avoid>' : '',
510
+ eraPreset.prohibitions ?? '',
511
+ eraPreset.prohibitions ? '</avoid>' : '',
512
+ '',
513
+ '<lighting>',
514
+ timePrompt,
515
+ '</lighting>',
516
+ '',
517
+ toggleBlock,
518
+ '',
519
+ '<rendering>',
520
+ eraPreset.rendering,
521
+ '</rendering>',
522
+ '',
523
+ designerAnnotation,
524
+ ].filter(Boolean);
525
+ return {
526
+ prompt: parts.join('\n'),
527
+ designerNotBorn,
528
+ eraStyle: eraPreset.style,
529
+ };
530
+ }
531
+ export function buildAdaptPrompt(text) {
532
+ const trimmed = text.trim();
533
+ if (!trimmed)
534
+ return '';
535
+ return ['<update>', trimmed, '</update>'].join('\n');
536
+ }
537
+ const interpolate = (template, values) => template.replace(/\{(\w+)\}/g, (_match, key) => values[key] ?? '');
538
+ const buildToggleBlockWithProfile = (locationLabel, toggles, toggleCopy) => {
539
+ const safeLabel = normalizeLocationLabel(locationLabel);
540
+ const sceneRef = safeLabel ? `appropriate to ${safeLabel}` : 'appropriate to the scene';
541
+ const localeRef = safeLabel ? `for ${safeLabel}` : 'for the scene';
542
+ const climateRef = safeLabel ? `${safeLabel}'s climate` : 'the scene climate';
543
+ const defaultCopy = {
544
+ people: `People: add pedestrians ${sceneRef}, natural scale cues, candid poses, clothing suited to the locale and time of day.`,
545
+ bicycles: `Bicycles: add bikes and cyclists ${localeRef}, with realistic racks and locking details.`,
546
+ cars: `Cars: add local vehicle styles ${localeRef}, a mix of parked and moving traffic, subtle reflections, no oversized vehicles.`,
547
+ trams: 'Trams: include light-rail or tram presence integrated into the scene when it fits the context.',
548
+ landscaping: `Landscaping: add planting and street-edge greenery suited to ${climateRef} and context.`,
549
+ tech: 'Tech innovations: add subtle near-future elements (delivery robots, AVs, discreet sensors) while keeping realism and scale.',
550
+ };
551
+ const lines = [];
552
+ Object.keys(toggles).forEach((key) => {
553
+ if (!toggles[key])
554
+ return;
555
+ const copy = toggleCopy?.[key] ?? defaultCopy[key];
556
+ if (copy)
557
+ lines.push(copy);
558
+ });
559
+ if (lines.length === 0)
560
+ return '';
561
+ return ['<activity>', ...lines, '</activity>'].join('\n');
562
+ };
563
+ export const COURTYARD_PROFILE = {
564
+ id: 'courtyard',
565
+ label: 'Courtyard',
566
+ description: 'Courtyard + adjacent street render prompts (DesignTool default).',
567
+ baseFidelity: BASE_FIDELITY,
568
+ locations: LOCATION_PRESETS,
569
+ eras: ERA_PRESETS,
570
+ timeOfDay: TIME_OF_DAY_PRESETS,
571
+ toggleLabels: RENDER_TOGGLE_LABELS,
572
+ eraToggleRules: ERA_TOGGLE_RULES,
573
+ defaultLocation: DEFAULT_LOCATION,
574
+ defaultEra: DEFAULT_ERA,
575
+ defaultTimeOfDay: DEFAULT_TIME_OF_DAY,
576
+ defaultToggles: DEFAULT_TOGGLES,
577
+ taskTemplate: '{taskPrefix} a {locationLabel} courtyard and adjacent street from the provided massing/line model.',
578
+ };
579
+ export const SPATIAL_LOCATION_PRESETS = {
580
+ none: {
581
+ label: 'None',
582
+ scene: '',
583
+ },
584
+ contextual: {
585
+ label: 'Contextual',
586
+ scene: 'Use the provided geometry as the primary subject. Add spatial context, materials, lighting, and entourage appropriate to the design intent and scale.',
587
+ },
588
+ interior: {
589
+ label: 'Interior',
590
+ scene: 'Interior spatial scene: walls, ceilings, floors, and lighting tuned for an interior environment. Emphasize realistic material response and bounce.',
591
+ },
592
+ exterior: {
593
+ label: 'Exterior',
594
+ scene: 'Exterior spatial scene: massing or facade context with realistic street scale, materials, and sky response.',
595
+ },
596
+ pavilion: {
597
+ label: 'Pavilion',
598
+ scene: 'Standalone pavilion or object in open context with a neutral ground plane and minimal surrounding clutter.',
599
+ },
600
+ landscape: {
601
+ label: 'Landscape',
602
+ scene: 'Landscape-scale scene: site context, terrain, planting, and long-view atmosphere appropriate to the program.',
603
+ },
604
+ };
605
+ export const SPATIAL_PROFILE = {
606
+ id: 'spatial',
607
+ label: 'Spatial',
608
+ description: 'Multi-paradigm spatial prompts (not courtyard-specific).',
609
+ baseFidelity: BASE_FIDELITY,
610
+ locations: SPATIAL_LOCATION_PRESETS,
611
+ eras: ERA_PRESETS,
612
+ timeOfDay: TIME_OF_DAY_PRESETS,
613
+ toggleLabels: RENDER_TOGGLE_LABELS,
614
+ eraToggleRules: ERA_TOGGLE_RULES,
615
+ defaultLocation: 'contextual',
616
+ defaultEra: DEFAULT_ERA,
617
+ defaultTimeOfDay: DEFAULT_TIME_OF_DAY,
618
+ defaultToggles: DEFAULT_TOGGLES,
619
+ taskTemplate: '{taskPrefix} a {locationLabel} spatial environment from the provided geometry.',
620
+ };
621
+ export const RENDER_PROFILES = {
622
+ courtyard: COURTYARD_PROFILE,
623
+ spatial: SPATIAL_PROFILE,
624
+ };
625
+ export const DEFAULT_RENDER_PROFILE_ID = 'spatial';
626
+ export const getRenderProfile = (id) => {
627
+ if (!id)
628
+ return undefined;
629
+ return RENDER_PROFILES[id];
630
+ };
631
+ export function buildRenderPromptWithProfile({ profile = COURTYARD_PROFILE, location, timeOfDay, era, toggles, styleLabel, overrides, }) {
632
+ const resolvedLocation = profile.locations[location] ?? profile.locations[profile.defaultLocation];
633
+ const resolvedEra = profile.eras[era] ?? profile.eras[profile.defaultEra];
634
+ const resolvedTime = profile.timeOfDay[timeOfDay] ?? profile.timeOfDay[profile.defaultTimeOfDay];
635
+ const resolvedLocationLabel = normalizeLocationLabel(resolvedLocation?.label ?? location);
636
+ const resolvedLocationScene = resolvedLocationLabel ? resolvedLocation?.scene ?? '' : '';
637
+ const toggleBlock = buildToggleBlockWithProfile(resolvedLocationLabel, toggles, profile.toggleCopy);
638
+ const designerNotBorn = isDesignerOutOfEra(styleLabel, era);
639
+ const safeStyleLabel = styleLabel && !designerNotBorn ? styleLabel : '';
640
+ const styleLine = safeStyleLabel
641
+ ? `Style reference: ${safeStyleLabel} (licensed by Treasury). Blend the overall aesthetic with this designer.`
642
+ : '';
643
+ const designerAnnotation = designerNotBorn && styleLabel
644
+ ? [
645
+ '<annotation>',
646
+ `Overlay the text "${styleLabel} not born yet" in DIN font on top of the image.`,
647
+ '</annotation>',
648
+ ].join('\n')
649
+ : '';
650
+ const taskTemplate = overrides?.taskTemplate ?? profile.taskTemplate;
651
+ const taskLine = interpolate(taskTemplate, {
652
+ taskPrefix: resolvedEra.taskPrefix,
653
+ locationLabel: resolvedLocationLabel,
654
+ locationScene: resolvedLocationScene,
655
+ })
656
+ .replace(/\s+/g, ' ')
657
+ .trim();
658
+ const sceneBlock = overrides?.scene
659
+ ? overrides.scene
660
+ : `${resolvedLocationScene} ${resolvedEra.sceneCue ?? ''} ${resolvedEra.sceneRules ?? ''}`.trim();
661
+ const interpretationBlock = overrides?.interpretation ?? resolvedEra.interpretation ?? '';
662
+ const prohibitionsBlock = overrides?.prohibitions ?? resolvedEra.prohibitions ?? '';
663
+ const renderingBlock = overrides?.rendering ?? resolvedEra.rendering;
664
+ const lightingBlock = overrides?.lighting ?? resolvedTime;
665
+ const fidelityBlock = overrides?.baseFidelity ?? profile.baseFidelity ?? BASE_FIDELITY;
666
+ const parts = [
667
+ '<task>',
668
+ taskLine || `${resolvedEra.taskPrefix} a spatial environment from the provided geometry.`,
669
+ 'Use the input image as the exact geometry and camera reference, until other instructions are given.',
670
+ '</task>',
671
+ '',
672
+ fidelityBlock,
673
+ '',
674
+ styleLine ? '<style>' : '',
675
+ styleLine,
676
+ styleLine ? '</style>' : '',
677
+ '',
678
+ '<era>',
679
+ overrides?.style ?? resolvedEra.style,
680
+ '</era>',
681
+ '',
682
+ sceneBlock ? '<scene>' : '',
683
+ sceneBlock,
684
+ sceneBlock ? '</scene>' : '',
685
+ '',
686
+ interpretationBlock ? '<interpretation>' : '',
687
+ interpretationBlock,
688
+ interpretationBlock ? '</interpretation>' : '',
689
+ '',
690
+ prohibitionsBlock ? '<avoid>' : '',
691
+ prohibitionsBlock,
692
+ prohibitionsBlock ? '</avoid>' : '',
693
+ '',
694
+ '<lighting>',
695
+ lightingBlock,
696
+ '</lighting>',
697
+ '',
698
+ toggleBlock,
699
+ '',
700
+ '<rendering>',
701
+ renderingBlock,
702
+ '</rendering>',
703
+ '',
704
+ designerAnnotation,
705
+ ].filter(Boolean);
706
+ return {
707
+ prompt: parts.join('\n'),
708
+ designerNotBorn,
709
+ eraStyle: resolvedEra.style,
710
+ };
711
+ }