create-aura3d 1.3.1 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/dist/cli.js +0 -0
  2. package/dist/index.d.ts +1 -1
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +9 -2
  5. package/dist/index.js.map +1 -1
  6. package/package.json +11 -3
  7. package/templates/animation-channel/package.json +1 -1
  8. package/templates/animation-channel/tests/screenshot.spec.ts +16 -0
  9. package/templates/animation-studio/dist/episodes/prompt-to-scene-proof/two-robots-fixing-a-car.document.json +680 -0
  10. package/templates/animation-studio/dist/episodes/scene/episode-3d.webm +0 -0
  11. package/templates/animation-studio/dist/episodes/scene/frames/action.png +0 -0
  12. package/templates/animation-studio/dist/episodes/scene/frames/dialogue.png +0 -0
  13. package/templates/animation-studio/dist/episodes/scene/frames/final.png +0 -0
  14. package/templates/animation-studio/dist/episodes/scene/frames/first.png +0 -0
  15. package/templates/animation-studio/dist/episodes/scene/frames/mouth-closed.png +0 -0
  16. package/templates/animation-studio/dist/episodes/scene/frames/mouth-open.png +0 -0
  17. package/templates/animation-studio/dist/episodes/scene/render-live-summary.json +2021 -2542
  18. package/templates/animation-studio/dist/episodes/scene/skeleton-overlays/broken.png +0 -0
  19. package/templates/animation-studio/dist/episodes/scene/skeleton-overlays/chefs.png +0 -0
  20. package/templates/animation-studio/dist/episodes/scene/skeleton-overlays/customer.png +0 -0
  21. package/templates/animation-studio/dist/episodes/scene/skeleton-overlays/friend-1.png +0 -0
  22. package/templates/animation-studio/dist/episodes/scene/skeleton-overlays/friend-2.png +0 -0
  23. package/templates/animation-studio/dist/episodes/scene/skeleton-overlays/worker-1.png +0 -0
  24. package/templates/animation-studio/dist/episodes/scene/skeleton-overlays/worker-2.png +0 -0
  25. package/templates/animation-studio/dist/scene/working.document.json +219 -269
  26. package/templates/animation-studio/index.html +12 -0
  27. package/templates/animation-studio/node_modules.publish-aside/.vite/deps/_metadata.json +8 -0
  28. package/templates/animation-studio/node_modules.publish-aside/.vite/deps/package.json +3 -0
  29. package/templates/animation-studio/package-lock.json +1307 -55
  30. package/templates/animation-studio/package.json +11 -5
  31. package/templates/animation-studio/scripts/asset-motion-probe.ts +7 -1
  32. package/templates/animation-studio/scripts/render-live.ts +24 -0
  33. package/templates/animation-studio/src/director/prompt-to-scene.ts +73 -5
  34. package/templates/animation-studio/studio/dist/assets/index-C7f8tHfi.css +1 -0
  35. package/templates/animation-studio/studio/dist/assets/index-CLo3GXyN.js +43 -0
  36. package/templates/animation-studio/studio/dist/index.html +19 -0
  37. package/templates/animation-studio/studio/index.html +18 -0
  38. package/templates/animation-studio/studio/src/App.tsx +498 -0
  39. package/templates/animation-studio/studio/src/components/Console.tsx +372 -0
  40. package/templates/animation-studio/studio/src/components/Icon.tsx +90 -0
  41. package/templates/animation-studio/studio/src/components/Inspector.tsx +265 -0
  42. package/templates/animation-studio/studio/src/components/Outliner.tsx +210 -0
  43. package/templates/animation-studio/studio/src/components/Palette.tsx +204 -0
  44. package/templates/animation-studio/studio/src/components/Stage.tsx +344 -0
  45. package/templates/animation-studio/studio/src/components/Timeline.tsx +230 -0
  46. package/templates/animation-studio/studio/src/components/Topbar.tsx +66 -0
  47. package/templates/animation-studio/studio/src/main.tsx +10 -0
  48. package/templates/animation-studio/studio/src/state/backend.ts +108 -0
  49. package/templates/animation-studio/studio/src/state/fidelity.ts +110 -0
  50. package/templates/animation-studio/studio/src/state/mapDocument.ts +430 -0
  51. package/templates/animation-studio/studio/src/state/sceneTool.ts +66 -0
  52. package/templates/animation-studio/studio/src/state/types.ts +173 -0
  53. package/templates/animation-studio/studio/src/state/util.ts +46 -0
  54. package/templates/animation-studio/studio/src/styles.css +528 -0
  55. package/templates/animation-studio/studio/vite.config.ts +175 -0
  56. package/templates/animation-studio/tests/route-health.spec.ts +33 -0
  57. package/templates/animation-studio/tests/screenshot.spec.ts +30 -0
  58. package/templates/character-controller/package.json +3 -3
  59. package/templates/character-controller/src/main.ts +18 -1
  60. package/templates/cinematic-scene/package.json +1 -1
  61. package/templates/cinematic-scene/tests/screenshot.spec.ts +3 -1
  62. package/templates/episode-builder/package.json +1 -1
  63. package/templates/episode-builder/tests/screenshot.spec.ts +15 -0
  64. package/templates/fighting-game/package.json +1 -1
  65. package/templates/fighting-game/tests/screenshot.spec.ts +15 -0
  66. package/templates/mini-game/package.json +1 -1
  67. package/templates/product-viewer/package.json +1 -1
  68. package/templates/product-viewer/tests/screenshot.spec.ts +3 -1
  69. package/templates/prompt-animation-channel/package.json +1 -1
  70. package/templates/prompt-animation-channel/tests/screenshot.spec.ts +15 -0
  71. package/templates/three-compat-architecture-interior/index.html +16 -0
  72. package/templates/three-compat-architecture-interior/package.json +21 -0
  73. package/templates/three-compat-architecture-interior/playwright.config.ts +14 -0
  74. package/templates/three-compat-architecture-interior/src/main.ts +27 -0
  75. package/templates/three-compat-architecture-interior/tests/route-health.spec.ts +16 -0
  76. package/templates/three-compat-architecture-interior/tests/screenshot.spec.ts +15 -0
  77. package/templates/three-compat-architecture-interior/tsconfig.json +19 -0
  78. package/templates/three-compat-asset-inspector/index.html +16 -0
  79. package/templates/three-compat-asset-inspector/package.json +21 -0
  80. package/templates/three-compat-asset-inspector/playwright.config.ts +14 -0
  81. package/templates/three-compat-asset-inspector/src/main.ts +17 -0
  82. package/templates/three-compat-asset-inspector/tests/route-health.spec.ts +16 -0
  83. package/templates/three-compat-asset-inspector/tests/screenshot.spec.ts +15 -0
  84. package/templates/three-compat-asset-inspector/tsconfig.json +19 -0
  85. package/templates/three-compat-character-viewer/index.html +16 -0
  86. package/templates/three-compat-character-viewer/package.json +21 -0
  87. package/templates/three-compat-character-viewer/playwright.config.ts +14 -0
  88. package/templates/three-compat-character-viewer/src/main.ts +17 -0
  89. package/templates/three-compat-character-viewer/tests/route-health.spec.ts +16 -0
  90. package/templates/three-compat-character-viewer/tests/screenshot.spec.ts +15 -0
  91. package/templates/three-compat-character-viewer/tsconfig.json +19 -0
  92. package/templates/three-compat-custom-threejs-migration/index.html +16 -0
  93. package/templates/three-compat-custom-threejs-migration/package.json +21 -0
  94. package/templates/three-compat-custom-threejs-migration/playwright.config.ts +14 -0
  95. package/templates/three-compat-custom-threejs-migration/src/main.ts +16 -0
  96. package/templates/three-compat-custom-threejs-migration/tests/route-health.spec.ts +16 -0
  97. package/templates/three-compat-custom-threejs-migration/tests/screenshot.spec.ts +15 -0
  98. package/templates/three-compat-custom-threejs-migration/tsconfig.json +19 -0
  99. package/templates/three-compat-large-scene/index.html +16 -0
  100. package/templates/three-compat-large-scene/package.json +21 -0
  101. package/templates/three-compat-large-scene/playwright.config.ts +14 -0
  102. package/templates/three-compat-large-scene/src/main.ts +31 -0
  103. package/templates/three-compat-large-scene/tests/route-health.spec.ts +16 -0
  104. package/templates/three-compat-large-scene/tests/screenshot.spec.ts +15 -0
  105. package/templates/three-compat-large-scene/tsconfig.json +19 -0
  106. package/templates/three-compat-material-authoring/index.html +16 -0
  107. package/templates/three-compat-material-authoring/package.json +21 -0
  108. package/templates/three-compat-material-authoring/playwright.config.ts +14 -0
  109. package/templates/three-compat-material-authoring/src/main.ts +33 -0
  110. package/templates/three-compat-material-authoring/tests/route-health.spec.ts +16 -0
  111. package/templates/three-compat-material-authoring/tests/screenshot.spec.ts +15 -0
  112. package/templates/three-compat-material-authoring/tsconfig.json +19 -0
  113. package/templates/three-compat-postprocess-scene/index.html +16 -0
  114. package/templates/three-compat-postprocess-scene/package.json +21 -0
  115. package/templates/three-compat-postprocess-scene/playwright.config.ts +14 -0
  116. package/templates/three-compat-postprocess-scene/src/main.ts +17 -0
  117. package/templates/three-compat-postprocess-scene/tests/route-health.spec.ts +16 -0
  118. package/templates/three-compat-postprocess-scene/tests/screenshot.spec.ts +15 -0
  119. package/templates/three-compat-postprocess-scene/tsconfig.json +19 -0
  120. package/templates/three-compat-premium-product-viewer/index.html +16 -0
  121. package/templates/three-compat-premium-product-viewer/package.json +21 -0
  122. package/templates/three-compat-premium-product-viewer/playwright.config.ts +14 -0
  123. package/templates/three-compat-premium-product-viewer/src/main.ts +18 -0
  124. package/templates/three-compat-premium-product-viewer/tests/route-health.spec.ts +16 -0
  125. package/templates/three-compat-premium-product-viewer/tests/screenshot.spec.ts +15 -0
  126. package/templates/three-compat-premium-product-viewer/tsconfig.json +19 -0
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Scene-Tool command metadata + parser (autocomplete only).
3
+ *
4
+ * The Director Console no longer simulates mutations locally — Command mode runs the
5
+ * REAL agent-native Scene-Tool CLI (`animation-scene.ts`) via `POST /api/scene` (see
6
+ * `state/backend.ts`), and each committed/rejected card reflects the actual validated
7
+ * result + the resulting working-document revision. This module now only provides:
8
+ * - `VERBS` — the command catalog for the composer autocomplete + suggestion chips.
9
+ * - `parse` — a light tokenizer used to detect the verb (e.g. `render`) and flags.
10
+ * No mock mutations remain in the production path.
11
+ */
12
+
13
+ export interface VerbSpec {
14
+ verb: string;
15
+ tail: string;
16
+ desc: string;
17
+ }
18
+
19
+ // The REAL CLI grammar (animation-scene.ts) — every entry here, inserted verbatim with its
20
+ // placeholders filled, is accepted by the CLI's switch/flag parser. These strings are also
21
+ // surfaced verbatim to LLMs, so they must never advertise a syntax the validator rejects.
22
+ export const VERBS: VerbSpec[] = [
23
+ { verb: "new", tail: '--prompt "<scene>" [--full]', desc: "Start a new working scene from a prompt" },
24
+ { verb: "set", tail: '<studio|garage|office|kitchen|moon-garden|space-station|meadow> | --query "<setting>"', desc: "Choose the active set template" },
25
+ { verb: "cast add", tail: '--id <id> --query "<look>" [--scale <s>]', desc: "Cast a character (catalog resolve)" },
26
+ { verb: "prop add", tail: '--id <id> --query "<look>"', desc: "Register a prop from the catalog" },
27
+ { verb: "shot add", tail: "--id <id> --preset <preset> --duration <s>", desc: "Block a new shot" },
28
+ { verb: "shot remove", tail: "--id <id>", desc: "Remove a shot" },
29
+ { verb: "shot retime", tail: "--id <id> --duration <s>", desc: "Change a shot's duration" },
30
+ { verb: "camera", tail: "--shot <id> --preset <establishing|medium|two-shot|close-up>", desc: "Set a shot's camera" },
31
+ { verb: "dialogue", tail: '--line <id> --speaker <id> --text "<line>" --start <s>', desc: "Write a dialogue line" },
32
+ { verb: "block", tail: "--character <id> --shot <id> --to <x,z> [--clip <clip>]", desc: "Move a character in a shot" },
33
+ { verb: "gesture", tail: "--character <id> --shot <id> --clip <clip>", desc: "Queue a gesture clip for a character" },
34
+ { verb: "dress", tail: "--prop <id> --at <x,z> [--scale <s>]", desc: "Place a registered prop on the set" },
35
+ { verb: "scale", tail: "--character <id> --to <s>", desc: "Rescale a character" },
36
+ { verb: "show", tail: "", desc: "Print the scene summary" },
37
+ { verb: "validate", tail: "", desc: "Check scene coherence" },
38
+ { verb: "undo", tail: "", desc: "Undo the last committed edit" },
39
+ { verb: "render", tail: "[--shot <id>]", desc: "Render a low-fi preview (shot or full sequence)" }
40
+ ];
41
+
42
+ export interface ParsedCommand {
43
+ verb: string;
44
+ rest: string[];
45
+ flags: Record<string, string>;
46
+ raw: string;
47
+ isCommand: boolean;
48
+ }
49
+
50
+ /** Naive command parser — extracts the (possibly two-word) verb + flags for routing. */
51
+ export function parse(raw: string): ParsedCommand {
52
+ const t = raw.trim();
53
+ const flags: Record<string, string> = {};
54
+ const fre = /--([a-z]+)\s+("[^"]*"|\S+)/g;
55
+ let m: RegExpExecArray | null;
56
+ while ((m = fre.exec(t))) flags[m[1]] = m[2].replace(/^"|"$/g, "");
57
+ const head = t.replace(/--[a-z]+\s+("[^"]*"|\S+)/g, "").trim();
58
+ const toks = head.split(/\s+/).filter(Boolean);
59
+ let verb = toks[0] || "";
60
+ let rest = toks.slice(1);
61
+ if (["cast", "shot", "prop"].includes(verb) && rest[0]) {
62
+ verb += " " + rest[0];
63
+ rest = rest.slice(1);
64
+ }
65
+ return { verb, rest, flags, raw: t, isCommand: VERBS.some((v) => t.startsWith(v.verb.split(" ")[0])) };
66
+ }
@@ -0,0 +1,173 @@
1
+ /**
2
+ * UI-side view model for the Animation Studio shell.
3
+ *
4
+ * The single source of truth is the REAL runtime EpisodeDocument fetched from
5
+ * `GET /api/document`; it is mapped into the types below by `mapDocument.ts`.
6
+ * There is no seed / fixture — when no document exists the UI renders empty.
7
+ */
8
+
9
+ import type { CharacterFidelity, SceneFidelity } from "./fidelity";
10
+
11
+ export type SelectionType = "shot" | "cast" | "set" | "prop";
12
+ export type ViewMode = "Render" | "Wireframe" | "Storyboard";
13
+ export type ComposerMode = "Prompt" | "Command";
14
+ export type IconName = string;
15
+
16
+ export interface Selection {
17
+ type: SelectionType;
18
+ id: string;
19
+ }
20
+
21
+ /**
22
+ * Where a cast member came from — kept honest and visible (Phase E3):
23
+ * - `authored-fallback` — a built-in authored/placeholder character (NOT catalog evidence).
24
+ * - `catalog-resolved` — resolved from the federated catalog (carries source/license/url).
25
+ * - `user-uploaded` — a GLB the user dropped in (`cast add --file`).
26
+ */
27
+ export type CastSource = "authored-fallback" | "catalog-resolved" | "user-uploaded";
28
+
29
+ export interface CastMember {
30
+ id: string;
31
+ name: string;
32
+ kind: string;
33
+ color: string;
34
+ glyph: string;
35
+ lines: number;
36
+ /** Provenance class — drives the Outliner source label so fallback is never sold as catalog. */
37
+ source: CastSource;
38
+ /** Short human label for the source (e.g. catalog title / "authored" / "uploaded"). */
39
+ sourceLabel: string;
40
+ /** M7 — honest fidelity tier (A/B/C). C is "previz" — never presented as finished. */
41
+ fidelity: CharacterFidelity;
42
+ /** Default performance clip id (e.g. "idle"). */
43
+ defaultClip?: string;
44
+ /** Mouth morph target index for lip-sync; -1 when absent. */
45
+ mouthMorphIndex?: number;
46
+ /** Whether foot IK is enabled for this cast member. */
47
+ footIk?: boolean;
48
+ /** Read-only grade-aware performance intent label. */
49
+ gradeAwareIntent?: string;
50
+ }
51
+
52
+ export interface SetEntity {
53
+ id: string;
54
+ name: string;
55
+ meta: string;
56
+ icon: IconName;
57
+ }
58
+
59
+ export interface PropEntity {
60
+ id: string;
61
+ name: string;
62
+ meta: string;
63
+ icon: IconName;
64
+ }
65
+
66
+ export interface Shot {
67
+ id: string;
68
+ name: string;
69
+ start: number;
70
+ dur: number;
71
+ /** Real render thumbnail (/preview/frames/*.png) once a render exists, else "". */
72
+ frame: string;
73
+ cam: string;
74
+ who: string[];
75
+ color: string;
76
+ }
77
+
78
+ export interface Beat {
79
+ id: string;
80
+ shot: string;
81
+ who: string;
82
+ start: number;
83
+ dur: number;
84
+ text: string;
85
+ /* ---- Director per-beat acting plan (F1) — inspectable in the UI ---- */
86
+ /** Who the speaker is addressing (the other party), or "" when solo. */
87
+ listener: string;
88
+ /** What the speaker DOES (talk / gesture / point / nod / walk / run) — the real director clip. */
89
+ speakingIntent: string;
90
+ /** What the listener DOES in response (react / nod / idle) — never frozen. */
91
+ listenerIntent: string;
92
+ /** The camera framing for this beat (establishing / two-shot / medium / close-up). */
93
+ camera: string;
94
+ }
95
+
96
+ export interface TimelineSpan {
97
+ id: string;
98
+ start: number;
99
+ dur: number;
100
+ text: string;
101
+ color: string;
102
+ }
103
+
104
+ /** The UI view model derived from the real working document. */
105
+ export interface EpisodeDocument {
106
+ title: string;
107
+ cast: CastMember[];
108
+ sets: SetEntity[];
109
+ props: PropEntity[];
110
+ shots: Shot[];
111
+ beats: Beat[];
112
+ camera: TimelineSpan[];
113
+ /** Per-character gesture/reaction windows (gesture/point/nod/react/wave) for the timeline. */
114
+ gestures: TimelineSpan[];
115
+ fx: TimelineSpan[];
116
+ DUR: number;
117
+ /** M7 — scene-level fidelity tier (floor of the cast). C scene is labeled "previz". */
118
+ fidelity: SceneFidelity;
119
+ }
120
+
121
+ /* ---- Director Console transcript model ---- */
122
+
123
+ export type DiffOp = "+" | "~" | "!";
124
+ export type DiffKind = "add" | "mod" | "del";
125
+
126
+ export interface Diff {
127
+ op: DiffOp;
128
+ k: DiffKind;
129
+ /** May contain <b>…</b> emphasis (rendered as bold). */
130
+ t: string;
131
+ }
132
+
133
+ export type CmdState = "run" | "ok" | "bad";
134
+
135
+ export interface YouTurn {
136
+ type: "you";
137
+ id: string;
138
+ text: string;
139
+ }
140
+
141
+ export interface DirTurn {
142
+ type: "dir";
143
+ id: string;
144
+ /** Markdown-ish: **bold** emphasis is supported. */
145
+ think: string;
146
+ }
147
+
148
+ export interface CmdTurn {
149
+ type: "cmd";
150
+ id: string;
151
+ verb: string;
152
+ args: string;
153
+ state: CmdState;
154
+ diffs?: Diff[];
155
+ dur?: string;
156
+ hash?: string;
157
+ }
158
+
159
+ export interface RenderTurn {
160
+ type: "render";
161
+ id: string;
162
+ frame: string;
163
+ label: string;
164
+ shot: string;
165
+ meta: string;
166
+ }
167
+
168
+ export type Turn = YouTurn | DirTurn | CmdTurn | RenderTurn;
169
+
170
+ export interface Toast {
171
+ msg: string;
172
+ kind: "ok" | "tip";
173
+ }
@@ -0,0 +1,46 @@
1
+ /* Shared formatting + small text helpers (ported from the design source). */
2
+
3
+ /** mm:ss from seconds. */
4
+ export function fmt(s: number): string {
5
+ const m = Math.floor(s / 60);
6
+ const ss = Math.floor(s % 60);
7
+ return m + ":" + String(ss).padStart(2, "0");
8
+ }
9
+
10
+ /** Capitalise first letter. */
11
+ export function cap(s: string): string {
12
+ return s ? s.charAt(0).toUpperCase() + s.slice(1) : s;
13
+ }
14
+
15
+ /** **bold** -> <span class="hl"> for AURA reasoning. */
16
+ export function boldHtml(s: string): string {
17
+ return (s || "").replace(/\*\*([^*]+)\*\*/g, '<span class="hl">$1</span>');
18
+ }
19
+
20
+ /** Highlight command args: --flags (blue) and "quoted strings" (green). */
21
+ export function highlightArgs(s: string): string {
22
+ // Sentinels guard quoted strings from the --flag pass, then become .str spans.
23
+ const OPEN = String.fromCharCode(1);
24
+ const CLOSE = String.fromCharCode(2);
25
+ return s
26
+ .replace(/("[^"]*")/g, OPEN + '$1' + CLOSE)
27
+ .replace(/(--[a-z]+)/g, '<span class="flag">$1</span>')
28
+ .replace(new RegExp(OPEN + '([^' + CLOSE + ']*)' + CLOSE, 'g'), '<span class="str">$1</span>');
29
+ }
30
+
31
+ /** Short hex revision hash. */
32
+ export function hash(): string {
33
+ return Math.random().toString(16).slice(2, 8);
34
+ }
35
+
36
+ /** Darken a hex color (for avatar gradients). */
37
+ export function shade(hex: string): string {
38
+ const n = parseInt(hex.slice(1), 16);
39
+ let r = (n >> 16) & 255;
40
+ let g = (n >> 8) & 255;
41
+ let b = n & 255;
42
+ r = Math.round(r * 0.55);
43
+ g = Math.round(g * 0.55);
44
+ b = Math.round(b * 0.62);
45
+ return "#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
46
+ }