create-aura3d 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +27 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +70 -0
- package/dist/index.js.map +1 -0
- package/package.json +55 -0
- package/templates/cartoon-channel/README.md +42 -0
- package/templates/cartoon-channel/index.html +13 -0
- package/templates/cartoon-channel/package.json +21 -0
- package/templates/cartoon-channel/playwright.config.ts +13 -0
- package/templates/cartoon-channel/src/aura-assets.ts +14 -0
- package/templates/cartoon-channel/src/characters.ts +28 -0
- package/templates/cartoon-channel/src/contract.ts +1 -0
- package/templates/cartoon-channel/src/episode.ts +300 -0
- package/templates/cartoon-channel/src/main.ts +322 -0
- package/templates/cartoon-channel/src/render-plan.ts +405 -0
- package/templates/cartoon-channel/src/sets.ts +14 -0
- package/templates/cartoon-channel/tests/route-health.spec.ts +7 -0
- package/templates/cartoon-channel/tests/storyboard-playback.spec.ts +74 -0
- package/templates/cartoon-channel/tsconfig.json +12 -0
- package/templates/cinematic-scene/README.md +11 -0
- package/templates/cinematic-scene/index.html +13 -0
- package/templates/cinematic-scene/package.json +21 -0
- package/templates/cinematic-scene/playwright.config.ts +14 -0
- package/templates/cinematic-scene/public/aura-assets/hero-fixture.glb +0 -0
- package/templates/cinematic-scene/public/aura-assets/hero.thumb.svg +1 -0
- package/templates/cinematic-scene/src/aura-assets.ts +17 -0
- package/templates/cinematic-scene/src/main.ts +27 -0
- package/templates/cinematic-scene/tests/route-health.spec.ts +16 -0
- package/templates/cinematic-scene/tests/screenshot.spec.ts +56 -0
- package/templates/cinematic-scene/tsconfig.json +15 -0
- package/templates/fighting-game/README.md +64 -0
- package/templates/fighting-game/index.html +13 -0
- package/templates/fighting-game/package.json +21 -0
- package/templates/fighting-game/playwright.config.ts +12 -0
- package/templates/fighting-game/src/aura-assets.ts +11 -0
- package/templates/fighting-game/src/game/fighters.ts +152 -0
- package/templates/fighting-game/src/game/moves.ts +70 -0
- package/templates/fighting-game/src/game/stage.ts +98 -0
- package/templates/fighting-game/src/main.ts +417 -0
- package/templates/fighting-game/src/styles.css +124 -0
- package/templates/fighting-game/tests/gameplay-smoke.spec.ts +23 -0
- package/templates/fighting-game/tests/route-health.spec.ts +11 -0
- package/templates/fighting-game/tsconfig.json +19 -0
- package/templates/mini-game/README.md +10 -0
- package/templates/mini-game/index.html +13 -0
- package/templates/mini-game/package.json +21 -0
- package/templates/mini-game/playwright.config.ts +14 -0
- package/templates/mini-game/public/aura-assets/player-fixture.glb +0 -0
- package/templates/mini-game/public/aura-assets/player.thumb.svg +8 -0
- package/templates/mini-game/src/aura-assets.ts +17 -0
- package/templates/mini-game/src/main.ts +27 -0
- package/templates/mini-game/tests/route-health.spec.ts +16 -0
- package/templates/mini-game/tests/screenshot.spec.ts +63 -0
- package/templates/mini-game/tsconfig.json +15 -0
- package/templates/product-viewer/README.md +16 -0
- package/templates/product-viewer/index.html +16 -0
- package/templates/product-viewer/package.json +21 -0
- package/templates/product-viewer/playwright.config.ts +14 -0
- package/templates/product-viewer/public/aura-assets/product-fixture.glb +0 -0
- package/templates/product-viewer/public/aura-assets/product.thumb.svg +1 -0
- package/templates/product-viewer/src/aura-assets.ts +17 -0
- package/templates/product-viewer/src/main.ts +27 -0
- package/templates/product-viewer/tests/route-health.spec.ts +16 -0
- package/templates/product-viewer/tests/screenshot.spec.ts +60 -0
- package/templates/product-viewer/tsconfig.json +15 -0
- package/templates/prompt-cartoon-channel/README.md +42 -0
- package/templates/prompt-cartoon-channel/index.html +13 -0
- package/templates/prompt-cartoon-channel/package.json +21 -0
- package/templates/prompt-cartoon-channel/playwright.config.ts +13 -0
- package/templates/prompt-cartoon-channel/src/aura-assets.ts +14 -0
- package/templates/prompt-cartoon-channel/src/characters.ts +28 -0
- package/templates/prompt-cartoon-channel/src/contract.ts +1 -0
- package/templates/prompt-cartoon-channel/src/episode.ts +300 -0
- package/templates/prompt-cartoon-channel/src/main.ts +314 -0
- package/templates/prompt-cartoon-channel/src/render-plan.ts +405 -0
- package/templates/prompt-cartoon-channel/src/sets.ts +14 -0
- package/templates/prompt-cartoon-channel/tests/route-health.spec.ts +7 -0
- package/templates/prompt-cartoon-channel/tests/storyboard-playback.spec.ts +74 -0
- package/templates/prompt-cartoon-channel/tsconfig.json +12 -0
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import { compilePromptEpisodePlan, type AuraAssetRef } from "@aura3d/engine";
|
|
2
|
+
import { assets } from "./aura-assets";
|
|
3
|
+
import { AURAVOICE_AURA3D_PROMPT_ANIMATION_CONTRACT_ID } from "./contract";
|
|
4
|
+
|
|
5
|
+
export const episodeContractId = AURAVOICE_AURA3D_PROMPT_ANIMATION_CONTRACT_ID;
|
|
6
|
+
|
|
7
|
+
export type CartoonAssetKey = "miko" | "luma" | "glowBroom" | "glowStones" | "moonLilies";
|
|
8
|
+
|
|
9
|
+
type TypedCartoonAssets = Partial<Record<CartoonAssetKey, AuraAssetRef<"model">>>;
|
|
10
|
+
|
|
11
|
+
const typedCartoonAssets = assets as TypedCartoonAssets;
|
|
12
|
+
|
|
13
|
+
export const requiredCartoonCharacterAssets = ["miko", "luma"] as const;
|
|
14
|
+
export const optionalCartoonPropAssets = ["glowBroom", "glowStones", "moonLilies"] as const;
|
|
15
|
+
export const publicCartoonAssetInstructions = [
|
|
16
|
+
"npx @aura3d/cli@latest assets add ./assets/miko.glb --name miko",
|
|
17
|
+
"npx @aura3d/cli@latest assets add ./assets/luma.glb --name luma",
|
|
18
|
+
"npx @aura3d/cli@latest assets validate-cartoon"
|
|
19
|
+
] as const;
|
|
20
|
+
|
|
21
|
+
export const missingCartoonCharacterAssets = requiredCartoonCharacterAssets.filter((key) => !typedCartoonAssets[key]);
|
|
22
|
+
export const typedCartoonAssetSummary = {
|
|
23
|
+
requiredCharacterAssets: requiredCartoonCharacterAssets,
|
|
24
|
+
optionalPropAssets: optionalCartoonPropAssets,
|
|
25
|
+
typedCharacterAssetCount: requiredCartoonCharacterAssets.length - missingCartoonCharacterAssets.length,
|
|
26
|
+
missingCharacterAssets: missingCartoonCharacterAssets
|
|
27
|
+
} as const;
|
|
28
|
+
|
|
29
|
+
function typedAsset(key: CartoonAssetKey): AuraAssetRef<"model"> | undefined {
|
|
30
|
+
return typedCartoonAssets[key];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const youtubeDraftMetadata = {
|
|
34
|
+
contractId: episodeContractId,
|
|
35
|
+
title: "Moon Garden Cleanup | Aura3D Cartoon Channel",
|
|
36
|
+
description: "Two tiny robots clean a glowing moon garden with soft captions and reduced-flash visuals.",
|
|
37
|
+
tags: ["Aura3D", "kids cartoon", "moon garden", "robots"],
|
|
38
|
+
madeForKids: true,
|
|
39
|
+
thumbnailCaptureTime: 10,
|
|
40
|
+
defaultLanguage: "en",
|
|
41
|
+
privacyStatus: "private"
|
|
42
|
+
} as const;
|
|
43
|
+
|
|
44
|
+
export const episodeAudioCues = [
|
|
45
|
+
{
|
|
46
|
+
id: "music:moon-garden-lullaby",
|
|
47
|
+
role: "music",
|
|
48
|
+
path: "assets/audio/music/moon-garden-lullaby-loop.wav",
|
|
49
|
+
startTime: 0,
|
|
50
|
+
duration: 60,
|
|
51
|
+
gainDb: -18,
|
|
52
|
+
ducking: "under-dialogue"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: "ambience:moon-garden-night",
|
|
56
|
+
role: "ambience",
|
|
57
|
+
path: "assets/audio/ambience/moon-garden-night.wav",
|
|
58
|
+
startTime: 0,
|
|
59
|
+
duration: 60,
|
|
60
|
+
gainDb: -22,
|
|
61
|
+
ducking: "none"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: "sfx:glow-stone-chime",
|
|
65
|
+
role: "sfx",
|
|
66
|
+
path: "assets/audio/sfx/glow-stone-chime.wav",
|
|
67
|
+
startTime: 38.5,
|
|
68
|
+
duration: 1.25,
|
|
69
|
+
gainDb: -9,
|
|
70
|
+
ducking: "none"
|
|
71
|
+
}
|
|
72
|
+
] as const;
|
|
73
|
+
|
|
74
|
+
export const episodeSampleDescription = {
|
|
75
|
+
contractId: episodeContractId,
|
|
76
|
+
runtimeSeconds: 60,
|
|
77
|
+
shotCount: 3,
|
|
78
|
+
speakingCharacters: ["miko", "luma"],
|
|
79
|
+
captionSource: "captions are derived one-to-one from the AuraVoice dialogue track",
|
|
80
|
+
performanceSource: "body, facial, gesture, blocking, and gaze cues are generated from the cartoon director",
|
|
81
|
+
musicAmbience: ["music:moon-garden-lullaby", "ambience:moon-garden-night"],
|
|
82
|
+
sfxCue: "sfx:glow-stone-chime",
|
|
83
|
+
thumbnailCaptureTime: youtubeDraftMetadata.thumbnailCaptureTime,
|
|
84
|
+
thumbnailSource: "same Aura3D scene state and AuraVoice timestamp as the render queue capture",
|
|
85
|
+
typedAssetSource: "./src/aura-assets",
|
|
86
|
+
requiredTypedAssets: requiredCartoonCharacterAssets,
|
|
87
|
+
missingTypedAssets: missingCartoonCharacterAssets,
|
|
88
|
+
assetCommands: publicCartoonAssetInstructions,
|
|
89
|
+
reviewPackageRequiredPaths: ["video", "captions", "thumbnail", "timeline", "audio-stems", "evidence-json", "youtube-draft-metadata"],
|
|
90
|
+
accessibilityProof: ["captions", "reduced motion", "high contrast"]
|
|
91
|
+
} as const;
|
|
92
|
+
|
|
93
|
+
export const episode = compilePromptEpisodePlan({
|
|
94
|
+
episodeId: "moon-garden-cleanup-001",
|
|
95
|
+
title: "Moon Garden Cleanup",
|
|
96
|
+
prompt: "Two tiny robots clean a glowing moon garden.",
|
|
97
|
+
language: "en",
|
|
98
|
+
runtime: {
|
|
99
|
+
duration: 60,
|
|
100
|
+
frameRate: 30,
|
|
101
|
+
resolution: { width: 1920, height: 1080 },
|
|
102
|
+
aspectRatio: "16:9",
|
|
103
|
+
reducedMotion: true,
|
|
104
|
+
highContrast: true,
|
|
105
|
+
maxTimingDriftFrames: 1
|
|
106
|
+
},
|
|
107
|
+
route: "/",
|
|
108
|
+
characters: [
|
|
109
|
+
{
|
|
110
|
+
id: "miko",
|
|
111
|
+
name: "Miko",
|
|
112
|
+
role: "hero",
|
|
113
|
+
voiceId: "auravoice-miko-soft",
|
|
114
|
+
style: "round cyan robot",
|
|
115
|
+
...(typedAsset("miko") ? { asset: typedAsset("miko") } : {})
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
id: "luma",
|
|
119
|
+
name: "Luma",
|
|
120
|
+
role: "sidekick",
|
|
121
|
+
voiceId: "auravoice-luma-bright",
|
|
122
|
+
style: "small gold garden helper",
|
|
123
|
+
...(typedAsset("luma") ? { asset: typedAsset("luma") } : {})
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
locations: [
|
|
127
|
+
{
|
|
128
|
+
id: "moon-garden",
|
|
129
|
+
name: "Moon Garden",
|
|
130
|
+
description: "A tiny crater garden with glowing pebbles, sleepy flowers, and a blue planet skyline.",
|
|
131
|
+
mood: "soft neon bedtime"
|
|
132
|
+
}
|
|
133
|
+
],
|
|
134
|
+
props: [
|
|
135
|
+
{
|
|
136
|
+
id: "glow-broom",
|
|
137
|
+
name: "Glow Broom",
|
|
138
|
+
role: "hero-prop",
|
|
139
|
+
description: "A soft crescent broom that sweeps moon dust without sharp motion.",
|
|
140
|
+
ownerCharacterId: "miko",
|
|
141
|
+
locationId: "moon-garden",
|
|
142
|
+
...(typedAsset("glowBroom") ? { asset: typedAsset("glowBroom") } : {}),
|
|
143
|
+
primitiveFallback: "thin rounded cylinder handle with a crescent brush head",
|
|
144
|
+
styleNotes: ["cyan rim light", "oversized safe silhouette"],
|
|
145
|
+
safetyNotes: ["not a weapon", "slow sweeping arcs only"]
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
id: "glow-stones",
|
|
149
|
+
name: "Glow Stones",
|
|
150
|
+
role: "interactive",
|
|
151
|
+
description: "Small moon pebbles that pulse gently after cleanup.",
|
|
152
|
+
locationId: "moon-garden",
|
|
153
|
+
...(typedAsset("glowStones") ? { asset: typedAsset("glowStones") } : {}),
|
|
154
|
+
primitiveFallback: "small low-poly spheres with bloom",
|
|
155
|
+
styleNotes: ["warm yellow glow", "reduced-flash pulse"],
|
|
156
|
+
safetyNotes: ["no rapid flashing"]
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
id: "moon-lilies",
|
|
160
|
+
name: "Moon Lilies",
|
|
161
|
+
role: "set-dressing",
|
|
162
|
+
description: "Sleepy flowers that brighten when the garden is clean.",
|
|
163
|
+
locationId: "moon-garden",
|
|
164
|
+
...(typedAsset("moonLilies") ? { asset: typedAsset("moonLilies") } : {}),
|
|
165
|
+
primitiveFallback: "rounded petal cards around tiny stems",
|
|
166
|
+
styleNotes: ["soft white petals", "blue shadow edges"]
|
|
167
|
+
}
|
|
168
|
+
],
|
|
169
|
+
styleGuide: {
|
|
170
|
+
visualStyle: "rounded bedtime sci-fi cartoon with toy-like robot silhouettes",
|
|
171
|
+
palette: ["#081b2a", "#7de2ff", "#ffe18e", "#40ffbf", "#f8fff2"],
|
|
172
|
+
shapeLanguage: "circles, capsules, crescent props, and chunky moon-garden forms",
|
|
173
|
+
lighting: "soft blue night key, warm prop glows, no hard flashes",
|
|
174
|
+
cameraLanguage: "wide establishing shot, medium teamwork shot, gentle final push-in, cuts only at shot boundaries",
|
|
175
|
+
motionRules: [
|
|
176
|
+
"Keep brooms, waves, and glow pulses reduced-motion safe.",
|
|
177
|
+
"Mouth cards and GLB blendshapes sample AuraVoice visemes at the same frame rate as captions.",
|
|
178
|
+
"Do not change storyboard, shot, line, caption, or character ids during dubbing."
|
|
179
|
+
],
|
|
180
|
+
captionStyle: "bottom-center high-contrast rounded plate with line-safe captions",
|
|
181
|
+
continuityRules: [
|
|
182
|
+
"Miko stays cyan on screen-left unless shot blocking explicitly moves them.",
|
|
183
|
+
"Luma stays warm gold on screen-right unless shot blocking explicitly moves them.",
|
|
184
|
+
"Glow stones brighten only after the teamwork shot begins."
|
|
185
|
+
]
|
|
186
|
+
},
|
|
187
|
+
continuityRules: [
|
|
188
|
+
"Story bible ids, shot ids, caption ids, and AuraVoice line ids stay stable across language dubs.",
|
|
189
|
+
"Props can upgrade to typed GLBs only through generated ./aura-assets imports."
|
|
190
|
+
],
|
|
191
|
+
safety: {
|
|
192
|
+
childSafe: true,
|
|
193
|
+
captionRequired: true,
|
|
194
|
+
reducedMotionDefault: true,
|
|
195
|
+
highContrastDefault: true,
|
|
196
|
+
flashing: "reduced"
|
|
197
|
+
},
|
|
198
|
+
beats: [
|
|
199
|
+
{
|
|
200
|
+
id: "beat-open",
|
|
201
|
+
sceneId: "storyboard-moon-garden",
|
|
202
|
+
shotId: "shot-moon-garden-open",
|
|
203
|
+
locationId: "moon-garden",
|
|
204
|
+
summary: "Miko notices moon dust dimming the garden lights.",
|
|
205
|
+
visualIntent: "Wide moon-garden reveal with two robot silhouettes and readable bottom captions.",
|
|
206
|
+
duration: 20,
|
|
207
|
+
characters: ["miko", "luma"],
|
|
208
|
+
props: ["moon-lilies", "glow-stones"],
|
|
209
|
+
gestureByCharacterId: { miko: "gentle-point", luma: "soft-nod" },
|
|
210
|
+
blockingByCharacterId: {
|
|
211
|
+
miko: { position: [-0.8, 0.75, 0], layer: "midground" },
|
|
212
|
+
luma: { position: [0.8, 0.72, 0], layer: "midground" }
|
|
213
|
+
},
|
|
214
|
+
dialogue: [
|
|
215
|
+
{
|
|
216
|
+
speakerId: "miko",
|
|
217
|
+
text: "Luma, the moon lilies are losing their sparkle.",
|
|
218
|
+
emotion: "concerned",
|
|
219
|
+
delivery: "natural",
|
|
220
|
+
audioFile: "assets/audio/en/shot-moon-garden-open-line-1.wav"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
speakerId: "luma",
|
|
224
|
+
text: "Then we sweep softly and wake the glow stones.",
|
|
225
|
+
emotion: "happy",
|
|
226
|
+
delivery: "slow",
|
|
227
|
+
audioFile: "assets/audio/en/shot-moon-garden-open-line-2.wav"
|
|
228
|
+
}
|
|
229
|
+
]
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
id: "beat-teamwork",
|
|
233
|
+
sceneId: "storyboard-moon-garden",
|
|
234
|
+
shotId: "shot-glow-stone-teamwork",
|
|
235
|
+
locationId: "moon-garden",
|
|
236
|
+
summary: "The robots clean in rhythm while the glow stones pulse back on.",
|
|
237
|
+
visualIntent: "Medium two-shot with gentle broom arcs, stable character ids, and no flashing.",
|
|
238
|
+
duration: 22,
|
|
239
|
+
characters: ["miko", "luma"],
|
|
240
|
+
props: ["glow-broom", "glow-stones"],
|
|
241
|
+
gestureByCharacterId: { miko: "curious-lean", luma: "small-wave" },
|
|
242
|
+
blockingByCharacterId: {
|
|
243
|
+
miko: { position: [-0.55, 0.75, 0.05], layer: "foreground" },
|
|
244
|
+
luma: { position: [0.62, 0.72, -0.02], layer: "foreground" }
|
|
245
|
+
},
|
|
246
|
+
dialogue: [
|
|
247
|
+
{
|
|
248
|
+
speakerId: "miko",
|
|
249
|
+
text: "I will polish the blue stones one tiny circle at a time.",
|
|
250
|
+
emotion: "curious",
|
|
251
|
+
delivery: "natural",
|
|
252
|
+
audioFile: "assets/audio/en/shot-glow-stone-teamwork-line-1.wav"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
speakerId: "luma",
|
|
256
|
+
text: "And I will hum the garden's sleepy cleanup song.",
|
|
257
|
+
emotion: "happy",
|
|
258
|
+
delivery: "sing-song",
|
|
259
|
+
audioFile: "assets/audio/en/shot-glow-stone-teamwork-line-2.wav"
|
|
260
|
+
}
|
|
261
|
+
]
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
id: "beat-finish",
|
|
265
|
+
sceneId: "storyboard-moon-garden",
|
|
266
|
+
shotId: "shot-moon-garden-finish",
|
|
267
|
+
locationId: "moon-garden",
|
|
268
|
+
summary: "The moon garden glows again and the robots wave goodnight.",
|
|
269
|
+
visualIntent: "Soft push-in to a finished garden, thumbnail-safe framing, and final caption hold.",
|
|
270
|
+
duration: 18,
|
|
271
|
+
characters: ["miko", "luma"],
|
|
272
|
+
props: ["moon-lilies", "glow-stones"],
|
|
273
|
+
gestureByCharacterId: { miko: "small-wave", luma: "two-hand-wave" },
|
|
274
|
+
blockingByCharacterId: {
|
|
275
|
+
miko: { position: [-0.65, 0.75, 0], layer: "midground" },
|
|
276
|
+
luma: { position: [0.68, 0.72, 0], layer: "midground" }
|
|
277
|
+
},
|
|
278
|
+
dialogue: [
|
|
279
|
+
{
|
|
280
|
+
speakerId: "luma",
|
|
281
|
+
text: "The moon lilies are twinkling again.",
|
|
282
|
+
emotion: "excited",
|
|
283
|
+
delivery: "natural",
|
|
284
|
+
audioFile: "assets/audio/en/shot-moon-garden-finish-line-1.wav"
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
speakerId: "miko",
|
|
288
|
+
text: "Goodnight, little garden. Keep glowing.",
|
|
289
|
+
emotion: "happy",
|
|
290
|
+
delivery: "slow",
|
|
291
|
+
audioFile: "assets/audio/en/shot-moon-garden-finish-line-2.wav"
|
|
292
|
+
}
|
|
293
|
+
]
|
|
294
|
+
}
|
|
295
|
+
],
|
|
296
|
+
generatedAt: "2026-06-03T00:00:00.000Z"
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
export const storyBible = episode.storyBible;
|
|
300
|
+
export const shotList = storyBible.shotList;
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
import {
|
|
2
|
+
camera,
|
|
3
|
+
captionCueAtTime,
|
|
4
|
+
createAuraApp,
|
|
5
|
+
createShotPlaybackPlan,
|
|
6
|
+
effects,
|
|
7
|
+
game,
|
|
8
|
+
installShotPlayback,
|
|
9
|
+
labels,
|
|
10
|
+
lights,
|
|
11
|
+
material,
|
|
12
|
+
model,
|
|
13
|
+
primitives,
|
|
14
|
+
sampleAuraVoiceBridgeAtTime,
|
|
15
|
+
scene,
|
|
16
|
+
type AuraAssetRef
|
|
17
|
+
} from "@aura3d/engine";
|
|
18
|
+
import { assets } from "./aura-assets";
|
|
19
|
+
import {
|
|
20
|
+
episode,
|
|
21
|
+
episodeContractId,
|
|
22
|
+
missingCartoonCharacterAssets,
|
|
23
|
+
publicCartoonAssetInstructions,
|
|
24
|
+
requiredCartoonCharacterAssets,
|
|
25
|
+
typedCartoonAssetSummary,
|
|
26
|
+
type CartoonAssetKey
|
|
27
|
+
} from "./episode";
|
|
28
|
+
import {
|
|
29
|
+
accessibilityProofMetadata,
|
|
30
|
+
auraVoicePackage,
|
|
31
|
+
bridgeIssues,
|
|
32
|
+
bridgeSampleAtThumbnail,
|
|
33
|
+
captionFrameSyncSourceProof,
|
|
34
|
+
captionTimingProof,
|
|
35
|
+
deterministicScreenshotFixtures,
|
|
36
|
+
glbVisemeRuntimeExample,
|
|
37
|
+
promptAnimationEvidence,
|
|
38
|
+
primitiveMouthRuntimeExample,
|
|
39
|
+
phonemeVisemeDubSyncSourceProof,
|
|
40
|
+
publishReadiness,
|
|
41
|
+
renderOutputPackage,
|
|
42
|
+
renderPlan,
|
|
43
|
+
sampleRenderSourceWorkflow,
|
|
44
|
+
visemeFrameSyncSourceProof,
|
|
45
|
+
visemeTrack
|
|
46
|
+
} from "./render-plan";
|
|
47
|
+
|
|
48
|
+
declare global {
|
|
49
|
+
interface Window {
|
|
50
|
+
__AURA3D_CARTOON_TEMPLATE__?: {
|
|
51
|
+
readonly contractId: string;
|
|
52
|
+
readonly template: string;
|
|
53
|
+
readonly storyBible: unknown;
|
|
54
|
+
readonly shotIds: readonly string[];
|
|
55
|
+
readonly captionIds: readonly string[];
|
|
56
|
+
readonly playbackProbeTimes: readonly number[];
|
|
57
|
+
readonly playbackProbeSamples: readonly unknown[];
|
|
58
|
+
readonly renderQueueItems: number;
|
|
59
|
+
readonly typedAssets: unknown;
|
|
60
|
+
readonly requiredTypedAssets: readonly string[];
|
|
61
|
+
readonly missingTypedAssets: readonly string[];
|
|
62
|
+
readonly assetCommands: readonly string[];
|
|
63
|
+
readonly bridgeIssues: readonly unknown[];
|
|
64
|
+
readonly promptAnimationEvidence: unknown;
|
|
65
|
+
readonly publishReadiness: unknown;
|
|
66
|
+
readonly sourceProofs: unknown;
|
|
67
|
+
readonly sampleRenderSourceWorkflow: unknown;
|
|
68
|
+
sampleAt(time: number): unknown;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const firstStoryboardShot = episode.storyboard.scenes[0]?.shots[0];
|
|
74
|
+
const firstCaption = episode.captionTrack.cues[0];
|
|
75
|
+
const thumbnailCapture = renderOutputPackage.thumbnailCapture;
|
|
76
|
+
const thumbnailCaption = captionCueAtTime(episode.captionTrack, thumbnailCapture.time);
|
|
77
|
+
const storyBible = episode.storyBible;
|
|
78
|
+
const typedCartoonAssets = assets as Partial<Record<CartoonAssetKey, AuraAssetRef<"model">>>;
|
|
79
|
+
|
|
80
|
+
const captionOverlay = document.createElement("div");
|
|
81
|
+
captionOverlay.id = "caption-overlay";
|
|
82
|
+
captionOverlay.textContent = firstCaption?.text ?? firstStoryboardShot?.storyBeat ?? "Aura3D cartoon channel";
|
|
83
|
+
captionOverlay.style.cssText = [
|
|
84
|
+
"position:fixed",
|
|
85
|
+
"left:50%",
|
|
86
|
+
"bottom:28px",
|
|
87
|
+
"transform:translateX(-50%)",
|
|
88
|
+
"max-width:min(840px,calc(100vw - 32px))",
|
|
89
|
+
"padding:12px 18px",
|
|
90
|
+
"border-radius:14px",
|
|
91
|
+
"background:rgba(3,12,20,0.88)",
|
|
92
|
+
"color:#f8fff2",
|
|
93
|
+
"font:700 18px/1.35 ui-rounded, Trebuchet MS, sans-serif",
|
|
94
|
+
"letter-spacing:0.01em",
|
|
95
|
+
"text-align:center",
|
|
96
|
+
"box-shadow:0 10px 30px rgba(0,0,0,0.28)",
|
|
97
|
+
"z-index:10"
|
|
98
|
+
].join(";");
|
|
99
|
+
document.body.appendChild(captionOverlay);
|
|
100
|
+
|
|
101
|
+
const shotPlaybackPlan = createShotPlaybackPlan({
|
|
102
|
+
timeline: episode.shotTimeline,
|
|
103
|
+
performance: episode.performance,
|
|
104
|
+
captions: episode.captionTrack,
|
|
105
|
+
visemes: visemeTrack,
|
|
106
|
+
runtimeNodeByCharacterId: {
|
|
107
|
+
miko: "miko",
|
|
108
|
+
luma: "luma"
|
|
109
|
+
},
|
|
110
|
+
loop: true
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
const playbackProbeTimes = [1, 21, 43] as const;
|
|
114
|
+
const playbackProbeSamples = playbackProbeTimes.map((time) => sampleCartoonRouteAt(time));
|
|
115
|
+
captionOverlay.dataset.shotId = playbackProbeSamples[0]?.shotId ?? "";
|
|
116
|
+
captionOverlay.dataset.captionId = playbackProbeSamples[0]?.captionId ?? firstCaption?.captionId ?? "";
|
|
117
|
+
document.body.dataset.cartoonShotCount = String(episode.shotTimeline.shots.length);
|
|
118
|
+
document.body.dataset.cartoonCaptionCount = String(episode.captionTrack.cues.length);
|
|
119
|
+
document.body.dataset.cartoonStoryBibleProps = String(storyBible.props.length);
|
|
120
|
+
|
|
121
|
+
const app = createAuraApp("#app", {
|
|
122
|
+
scene: scene()
|
|
123
|
+
.background("#081b2a")
|
|
124
|
+
.add(createCharacterBody("miko", "Miko", "miko", [-0.8, 0.75, 0], [0.32, 0.42, 0.32], 0.72, "#7de2ff"))
|
|
125
|
+
.add(createMouthCard("miko:mouth", "Miko", [-0.8, 0.8, 0.32], "#f8fff2"))
|
|
126
|
+
.add(createCharacterBody("luma", "Luma", "luma", [0.8, 0.72, 0], [0.3, 0.38, 0.3], 0.68, "#ffe18e"))
|
|
127
|
+
.add(createMouthCard("luma:mouth", "Luma", [0.8, 0.77, 0.32], "#40ffbf"))
|
|
128
|
+
.add(
|
|
129
|
+
primitives
|
|
130
|
+
.box({ name: "moon garden path", material: material.pbr({ color: "#182d3f", roughness: 0.78 }) })
|
|
131
|
+
.position(0, 0.05, 0)
|
|
132
|
+
.scale([2.8, 0.04, 0.8])
|
|
133
|
+
)
|
|
134
|
+
.add(
|
|
135
|
+
primitives
|
|
136
|
+
.sphere({ name: "glow stones primitive fallback", material: material.emissive({ color: "#ffe18e", intensity: 0.42 }) })
|
|
137
|
+
.position(0.18, 0.16, 0.28)
|
|
138
|
+
.scale([0.16, 0.08, 0.16])
|
|
139
|
+
)
|
|
140
|
+
.add(
|
|
141
|
+
primitives
|
|
142
|
+
.box({ name: "moon lilies primitive fallback", material: material.pbr({ color: "#f8fff2", roughness: 0.5 }) })
|
|
143
|
+
.position(-0.38, 0.2, 0.18)
|
|
144
|
+
.scale([0.12, 0.24, 0.04])
|
|
145
|
+
)
|
|
146
|
+
.add(labels.hud({ text: firstCaption?.text ?? firstStoryboardShot?.storyBeat ?? "Aura3D cartoon channel", position: "bottom-center" }))
|
|
147
|
+
.add(lights.studio({ intensity: 1.2 }))
|
|
148
|
+
.add(effects.bloom({ intensity: 0.18, color: "#7de2ff" }))
|
|
149
|
+
.camera(camera.perspective({ position: [0, 1.4, 4.2], target: [0, 0.7, 0], fov: 42 })),
|
|
150
|
+
diagnostics: true,
|
|
151
|
+
metadata: {
|
|
152
|
+
contractId: episodeContractId,
|
|
153
|
+
template: "prompt-cartoon-channel",
|
|
154
|
+
runtimePlayback: "app.onFrame updates runtime nodes; createAuraApp is called once",
|
|
155
|
+
renderQueueItems: renderPlan.items.length,
|
|
156
|
+
renderPackageId: renderOutputPackage.packageId,
|
|
157
|
+
storyBibleId: storyBible.episodeId,
|
|
158
|
+
storyBibleProps: storyBible.props.map((prop) => prop.id),
|
|
159
|
+
styleGuide: storyBible.styleGuide.visualStyle,
|
|
160
|
+
shotListCount: storyBible.shotList.length,
|
|
161
|
+
playbackProbeSamples: playbackProbeSamples.map((sample) => ({
|
|
162
|
+
time: sample.time,
|
|
163
|
+
frame: sample.frame,
|
|
164
|
+
shotId: sample.shotId,
|
|
165
|
+
captionId: sample.captionId,
|
|
166
|
+
nodeUpdateCount: sample.nodeUpdates.length
|
|
167
|
+
})),
|
|
168
|
+
thumbnailCaptureSceneStateId: thumbnailCapture.sourceSceneStateId,
|
|
169
|
+
thumbnailCaptureTime: thumbnailCapture.time,
|
|
170
|
+
thumbnailCaptionId: thumbnailCaption?.captionId,
|
|
171
|
+
deterministicCaptureItems: renderPlan.items.filter((item) => item.sourceSceneState).length,
|
|
172
|
+
deterministicScreenshotFixtures,
|
|
173
|
+
typedAssets: typedCartoonAssetSummary,
|
|
174
|
+
requiredTypedAssets: requiredCartoonCharacterAssets,
|
|
175
|
+
missingTypedAssets: missingCartoonCharacterAssets,
|
|
176
|
+
assetCommands: publicCartoonAssetInstructions,
|
|
177
|
+
bridgeIssueCount: bridgeIssues.length,
|
|
178
|
+
bridgeSampleAtThumbnail: {
|
|
179
|
+
time: bridgeSampleAtThumbnail.time,
|
|
180
|
+
frame: bridgeSampleAtThumbnail.frame,
|
|
181
|
+
shotId: bridgeSampleAtThumbnail.shot?.shotId,
|
|
182
|
+
dialogueLineId: bridgeSampleAtThumbnail.dialogue?.lineId
|
|
183
|
+
},
|
|
184
|
+
promptAnimationEvidence: {
|
|
185
|
+
publishReady: promptAnimationEvidence.publishReady,
|
|
186
|
+
assetStatus: promptAnimationEvidence.assetStatus,
|
|
187
|
+
captions: promptAnimationEvidence.captions,
|
|
188
|
+
visemes: promptAnimationEvidence.visemes,
|
|
189
|
+
audio: promptAnimationEvidence.audio,
|
|
190
|
+
deterministicCapture: promptAnimationEvidence.deterministicCapture,
|
|
191
|
+
routeHealth: promptAnimationEvidence.routeHealth
|
|
192
|
+
},
|
|
193
|
+
publishReadiness: {
|
|
194
|
+
ready: publishReadiness.ready,
|
|
195
|
+
issueCount: publishReadiness.issues.length
|
|
196
|
+
},
|
|
197
|
+
captionTimingProof: {
|
|
198
|
+
status: captionTimingProof.status,
|
|
199
|
+
maxDriftFrames: captionTimingProof.maxDriftFrames,
|
|
200
|
+
coveredLineIds: captionTimingProof.coveredLineIds
|
|
201
|
+
},
|
|
202
|
+
captionFrameSyncSourceProof,
|
|
203
|
+
visemeFrameSyncSourceProof,
|
|
204
|
+
sampleRenderSourceWorkflow,
|
|
205
|
+
accessibilityProof: {
|
|
206
|
+
captions: accessibilityProofMetadata?.captions.status,
|
|
207
|
+
reducedMotion: accessibilityProofMetadata?.reducedMotion.status,
|
|
208
|
+
highContrast: accessibilityProofMetadata?.highContrast.status
|
|
209
|
+
},
|
|
210
|
+
primitiveMouthRuntimeExample,
|
|
211
|
+
glbVisemeRuntimeExample
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
window.__AURA3D_CARTOON_TEMPLATE__ = {
|
|
216
|
+
contractId: episodeContractId,
|
|
217
|
+
template: "prompt-cartoon-channel",
|
|
218
|
+
storyBible,
|
|
219
|
+
shotIds: episode.shotTimeline.shots.map((shot) => shot.shotId),
|
|
220
|
+
captionIds: episode.captionTrack.cues.map((caption) => caption.captionId),
|
|
221
|
+
playbackProbeTimes,
|
|
222
|
+
playbackProbeSamples,
|
|
223
|
+
renderQueueItems: renderPlan.items.length,
|
|
224
|
+
typedAssets: typedCartoonAssetSummary,
|
|
225
|
+
requiredTypedAssets: requiredCartoonCharacterAssets,
|
|
226
|
+
missingTypedAssets: missingCartoonCharacterAssets,
|
|
227
|
+
assetCommands: publicCartoonAssetInstructions,
|
|
228
|
+
bridgeIssues,
|
|
229
|
+
promptAnimationEvidence,
|
|
230
|
+
publishReadiness,
|
|
231
|
+
sourceProofs: {
|
|
232
|
+
captionFrameSyncSourceProof,
|
|
233
|
+
visemeFrameSyncSourceProof,
|
|
234
|
+
phonemeVisemeDubSyncSourceProof
|
|
235
|
+
},
|
|
236
|
+
sampleRenderSourceWorkflow,
|
|
237
|
+
sampleAt(time: number) {
|
|
238
|
+
return sampleCartoonRouteAt(time);
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
installShotPlayback(app, shotPlaybackPlan, {
|
|
243
|
+
primitiveMouthNodeByCharacterId: {
|
|
244
|
+
miko: "miko:mouth",
|
|
245
|
+
luma: "luma:mouth"
|
|
246
|
+
},
|
|
247
|
+
onCaption(caption, framePlan) {
|
|
248
|
+
captionOverlay.textContent = caption?.text ?? firstCaption?.text ?? "";
|
|
249
|
+
captionOverlay.dataset.shotId = framePlan.shotId ?? "";
|
|
250
|
+
captionOverlay.dataset.captionId = caption?.captionId ?? "";
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
function createCharacterBody(
|
|
255
|
+
id: "miko" | "luma",
|
|
256
|
+
name: string,
|
|
257
|
+
assetKey: CartoonAssetKey,
|
|
258
|
+
position: readonly [number, number, number],
|
|
259
|
+
fallbackScale: readonly [number, number, number],
|
|
260
|
+
modelScale: number,
|
|
261
|
+
color: string
|
|
262
|
+
) {
|
|
263
|
+
const asset = typedCartoonAssets[assetKey];
|
|
264
|
+
const runtime = game.runtimeNode(id, { tags: ["character", id, asset ? "typed-asset" : "primitive-fallback"] });
|
|
265
|
+
if (asset) {
|
|
266
|
+
return model(asset, { name: `${name} typed character asset` })
|
|
267
|
+
.position(position[0], position[1], position[2])
|
|
268
|
+
.scale(modelScale)
|
|
269
|
+
.runtime(runtime);
|
|
270
|
+
}
|
|
271
|
+
return primitives
|
|
272
|
+
.sphere({
|
|
273
|
+
name: `${name} primitive fallback body - add ${assetKey} with the Aura3D CLI`,
|
|
274
|
+
material: material.pbr({ color, roughness: 0.54 })
|
|
275
|
+
})
|
|
276
|
+
.position(position[0], position[1], position[2])
|
|
277
|
+
.scale(fallbackScale)
|
|
278
|
+
.runtime(runtime);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
function createMouthCard(id: "miko:mouth" | "luma:mouth", name: string, position: readonly [number, number, number], color: string) {
|
|
282
|
+
return primitives
|
|
283
|
+
.box({
|
|
284
|
+
name: `${name} primitive mouth card`,
|
|
285
|
+
material: material.emissive({ color, intensity: 0.32 })
|
|
286
|
+
})
|
|
287
|
+
.position(position[0], position[1], position[2])
|
|
288
|
+
.scale([0.22, 0.035, 0.025])
|
|
289
|
+
.runtime(game.runtimeNode(id, { tags: ["mouth", "primitive", name.toLowerCase()] }));
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
function sampleCartoonRouteAt(time: number) {
|
|
293
|
+
const bridgeSample = sampleAuraVoiceBridgeAtTime(auraVoicePackage, time);
|
|
294
|
+
const caption = captionCueAtTime(episode.captionTrack, time);
|
|
295
|
+
const speakingCharacterId = bridgeSample.dialogue?.speakerId;
|
|
296
|
+
return {
|
|
297
|
+
time,
|
|
298
|
+
frame: bridgeSample.frame,
|
|
299
|
+
shotId: bridgeSample.shot?.shotId,
|
|
300
|
+
sceneId: bridgeSample.shot?.sceneId,
|
|
301
|
+
captionId: caption?.captionId,
|
|
302
|
+
captionText: caption?.text,
|
|
303
|
+
cameraMove: bridgeSample.shot?.camera.move,
|
|
304
|
+
transitionOut: bridgeSample.shot?.transitionOut,
|
|
305
|
+
dialogueLineId: bridgeSample.dialogue?.lineId,
|
|
306
|
+
visemeId: bridgeSample.viseme?.primaryVisemeId,
|
|
307
|
+
nodeUpdates: (bridgeSample.shot?.characters ?? []).map((character) => ({
|
|
308
|
+
characterId: character.characterId,
|
|
309
|
+
action: speakingCharacterId === character.characterId ? "speak" : character.action,
|
|
310
|
+
emotion: character.emotion,
|
|
311
|
+
position: character.position
|
|
312
|
+
}))
|
|
313
|
+
};
|
|
314
|
+
}
|