@depths/waves 0.1.0 → 0.3.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.
package/dist/cli.mjs CHANGED
@@ -3,15 +3,15 @@ import {
3
3
  WavesEngine,
4
4
  __wavesVersion,
5
5
  getPromptPayload
6
- } from "./chunk-WGQITADJ.mjs";
6
+ } from "./chunk-QP54QRAP.mjs";
7
7
  import {
8
- VideoIRSchema,
8
+ VideoIRv2AuthoringSchema,
9
9
  WavesRenderError,
10
10
  __require,
11
11
  globalRegistry,
12
12
  registerBuiltInComponents,
13
13
  zodSchemaToJsonSchema
14
- } from "./chunk-TGAL5RQN.mjs";
14
+ } from "./chunk-YYS6AVTN.mjs";
15
15
 
16
16
  // src/cli.ts
17
17
  import fs from "fs/promises";
@@ -42,7 +42,7 @@ function parseArgs(argv) {
42
42
  const hasInlineValue = eq >= 0;
43
43
  const inlineValue = hasInlineValue ? arg.slice(eq + 1) : void 0;
44
44
  const next = argv[i + 1];
45
- const isBoolean = key === "help" || key === "pretty";
45
+ const isBoolean = key === "help" || key === "pretty" || key === "includeInternal" || key === "debugBounds" || key === "debugLabels";
46
46
  if (isBoolean) {
47
47
  flags[key] = true;
48
48
  continue;
@@ -81,11 +81,13 @@ Usage:
81
81
  waves <command> [options]
82
82
 
83
83
  Commands:
84
+ catalog Print the built-in component catalog
84
85
  prompt Print an agent-ready system prompt + schema payload
85
86
  schema Print JSON Schemas for IR/components
86
87
  write-ir Write a starter IR JSON file
87
88
  validate Validate an IR JSON file
88
89
  render Render MP4 from an IR JSON file
90
+ stills Render PNG/JPEG/WebP still frames from an IR JSON file
89
91
 
90
92
  Options:
91
93
  -h, --help Show help
@@ -122,21 +124,9 @@ async function importRegistrationModules(modules) {
122
124
  function stringifyJSON(value, pretty) {
123
125
  return JSON.stringify(value, null, pretty ? 2 : 0) + "\n";
124
126
  }
125
- function collectComponentTypes(ir) {
126
- const types = /* @__PURE__ */ new Set();
127
- for (const scene of ir.scenes) {
128
- walkComponent(scene, types);
129
- }
130
- return types;
131
- }
132
- function walkComponent(component, types) {
133
- types.add(component.type);
134
- const children = component.children;
135
- if (children?.length) {
136
- for (const child of children) {
137
- walkComponent(child, types);
138
- }
139
- }
127
+ function parseImageFormat(raw) {
128
+ if (raw === "png" || raw === "jpeg" || raw === "webp") return raw;
129
+ return null;
140
130
  }
141
131
  async function main(argv = process.argv.slice(2)) {
142
132
  const parsed = parseArgs(argv);
@@ -165,6 +155,66 @@ async function main(argv = process.argv.slice(2)) {
165
155
  return EXIT_USAGE;
166
156
  }
167
157
  registerBuiltInComponents();
158
+ if (parsed.command === "catalog") {
159
+ const format = (getFlagString(parsed.flags, "format") ?? "text").toLowerCase();
160
+ const includeInternal = Boolean(parsed.flags.includeInternal);
161
+ if (format !== "text" && format !== "json") {
162
+ process.stderr.write(`Invalid --format: ${format} (expected "text" or "json")
163
+ `);
164
+ return EXIT_USAGE;
165
+ }
166
+ const types = includeInternal ? globalRegistry.getTypes().sort() : globalRegistry.getTypesForLLM().sort();
167
+ const byCategory = {};
168
+ const items = [];
169
+ for (const t of types) {
170
+ const reg = globalRegistry.get(t);
171
+ if (!reg) continue;
172
+ const cat = reg.metadata.category;
173
+ if (!byCategory[cat]) byCategory[cat] = [];
174
+ byCategory[cat].push(t);
175
+ items.push({ type: t, kind: reg.metadata.kind, category: cat, description: reg.metadata.description });
176
+ }
177
+ if (format === "json") {
178
+ const payload = { categories: byCategory, items };
179
+ const json = stringifyJSON(payload, pretty);
180
+ const writeErr2 = await tryWriteOut(outPath, json);
181
+ if (writeErr2) {
182
+ process.stderr.write(`Failed to write ${outPath}: ${writeErr2}
183
+ `);
184
+ process.stdout.write(json);
185
+ return EXIT_IO;
186
+ }
187
+ process.stdout.write(json);
188
+ if (outPath) process.stderr.write(`Wrote ${outPath}
189
+ `);
190
+ return EXIT_OK;
191
+ }
192
+ const categories = Object.keys(byCategory).sort();
193
+ const lines = [];
194
+ lines.push(`waves catalog (v${__wavesVersion})`);
195
+ lines.push("");
196
+ for (const c of categories) {
197
+ lines.push(`${c}:`);
198
+ for (const t of byCategory[c].sort()) {
199
+ lines.push(`- ${t}`);
200
+ }
201
+ lines.push("");
202
+ }
203
+ const text = lines.join("\n");
204
+ const writeErr = await tryWriteOut(outPath, text.endsWith("\n") ? text : `${text}
205
+ `);
206
+ if (writeErr) {
207
+ process.stderr.write(`Failed to write ${outPath}: ${writeErr}
208
+ `);
209
+ process.stdout.write(text);
210
+ return EXIT_IO;
211
+ }
212
+ process.stdout.write(text.endsWith("\n") ? text : `${text}
213
+ `);
214
+ if (outPath) process.stderr.write(`Wrote ${outPath}
215
+ `);
216
+ return EXIT_OK;
217
+ }
168
218
  if (parsed.command === "prompt") {
169
219
  const format = (getFlagString(parsed.flags, "format") ?? "text").toLowerCase();
170
220
  const maxCharsRaw = getFlagString(parsed.flags, "maxChars");
@@ -208,12 +258,12 @@ async function main(argv = process.argv.slice(2)) {
208
258
  const kind = (getFlagString(parsed.flags, "kind") ?? "all").toLowerCase();
209
259
  let output;
210
260
  if (kind === "video-ir") {
211
- output = zodSchemaToJsonSchema(VideoIRSchema);
261
+ output = zodSchemaToJsonSchema(VideoIRv2AuthoringSchema);
212
262
  } else if (kind === "components") {
213
263
  output = globalRegistry.getJSONSchemaForLLM();
214
264
  } else if (kind === "all") {
215
265
  output = {
216
- videoIR: zodSchemaToJsonSchema(VideoIRSchema),
266
+ videoIR: zodSchemaToJsonSchema(VideoIRv2AuthoringSchema),
217
267
  components: globalRegistry.getJSONSchemaForLLM()
218
268
  };
219
269
  } else {
@@ -242,33 +292,75 @@ async function main(argv = process.argv.slice(2)) {
242
292
  return EXIT_USAGE;
243
293
  }
244
294
  const ir = template === "basic" ? {
245
- version: "1.0",
246
- video: { id: "main", width: 1920, height: 1080, fps: 30, durationInFrames: 90 },
247
- scenes: [
295
+ version: "2.0",
296
+ video: { id: "main", width: 1920, height: 1080, fps: 30, durationInFrames: 165 },
297
+ segments: [
248
298
  {
249
299
  id: "scene-1",
250
- type: "Scene",
251
- timing: { from: 0, durationInFrames: 90 },
252
- props: { background: { type: "color", value: "#000000" } },
253
- children: [
254
- {
255
- id: "title",
256
- type: "Text",
257
- timing: { from: 0, durationInFrames: 90 },
258
- props: { content: "Hello Waves", fontSize: 72, animation: "fade" }
259
- }
260
- ]
300
+ durationInFrames: 90,
301
+ transitionToNext: { type: "FadeTransition", durationInFrames: 15 },
302
+ root: {
303
+ id: "root",
304
+ type: "Scene",
305
+ props: { background: { type: "color", value: "#000000" } },
306
+ children: [
307
+ {
308
+ id: "title",
309
+ type: "SplitText",
310
+ props: { content: "Waves v0.2.0", fontSize: 96, splitBy: "word", stagger: 3, animation: "slideUp" }
311
+ },
312
+ {
313
+ id: "subtitle",
314
+ type: "TypewriterText",
315
+ props: { content: "Composite components + hybrid IR", fontSize: 48, position: "bottom", speed: 1.5 }
316
+ },
317
+ {
318
+ id: "wm",
319
+ type: "Watermark",
320
+ props: { type: "text", text: "@depths.ai", position: "bottomRight", opacity: 0.4, size: 60 }
321
+ }
322
+ ]
323
+ }
324
+ },
325
+ {
326
+ id: "scene-2",
327
+ durationInFrames: 90,
328
+ root: {
329
+ id: "root-2",
330
+ type: "Scene",
331
+ props: { background: { type: "color", value: "#0B1220" } },
332
+ children: [
333
+ {
334
+ id: "lower-third",
335
+ type: "ThirdLowerBanner",
336
+ props: { name: "Waves", title: "v0.2.0 \u2014 Composites + transitions", accentColor: "#3B82F6" }
337
+ },
338
+ {
339
+ id: "count",
340
+ type: "AnimatedCounter",
341
+ props: { from: 0, to: 35, suffix: " components", fontSize: 96, color: "#FFFFFF" }
342
+ },
343
+ {
344
+ id: "wm-2",
345
+ type: "Watermark",
346
+ props: { type: "text", text: "waves", position: "topLeft", opacity: 0.25, size: 52 }
347
+ }
348
+ ]
349
+ }
261
350
  }
262
351
  ]
263
352
  } : template === "minimal" ? {
264
- version: "1.0",
353
+ version: "2.0",
265
354
  video: { id: "main", width: 1920, height: 1080, fps: 30, durationInFrames: 60 },
266
- scenes: [
355
+ segments: [
267
356
  {
268
357
  id: "scene-1",
269
- type: "Scene",
270
- timing: { from: 0, durationInFrames: 60 },
271
- props: { background: { type: "color", value: "#000000" } }
358
+ durationInFrames: 60,
359
+ root: {
360
+ id: "root",
361
+ type: "Scene",
362
+ props: { background: { type: "color", value: "#000000" } }
363
+ }
272
364
  }
273
365
  ]
274
366
  } : null;
@@ -277,9 +369,9 @@ async function main(argv = process.argv.slice(2)) {
277
369
  `);
278
370
  return EXIT_USAGE;
279
371
  }
280
- const schemaCheck = VideoIRSchema.safeParse(ir);
372
+ const schemaCheck = VideoIRv2AuthoringSchema.safeParse(ir);
281
373
  if (!schemaCheck.success) {
282
- process.stderr.write("Internal error: generated template does not validate against VideoIRSchema\n");
374
+ process.stderr.write("Internal error: generated template does not validate against VideoIRv2AuthoringSchema\n");
283
375
  return EXIT_INTERNAL;
284
376
  }
285
377
  const json = stringifyJSON(ir, pretty);
@@ -333,20 +425,9 @@ async function main(argv = process.argv.slice(2)) {
333
425
  }
334
426
  return EXIT_VALIDATE;
335
427
  }
336
- const validator = new IRValidator();
428
+ const validator = new IRValidator(globalRegistry);
337
429
  const result = validator.validate(json);
338
430
  const errors = result.success ? [] : result.errors;
339
- if (result.success) {
340
- const types = collectComponentTypes(result.data);
341
- const unknownTypes = [...types].filter((t) => !globalRegistry.has(t)).sort();
342
- for (const t of unknownTypes) {
343
- errors.push({
344
- path: ["components", t],
345
- message: `Unknown component type: ${t}`,
346
- code: "UNKNOWN_COMPONENT_TYPE"
347
- });
348
- }
349
- }
350
431
  const ok = errors.length === 0;
351
432
  if (format === "json") {
352
433
  process.stdout.write(stringifyJSON(ok ? { success: true } : { success: false, errors }, pretty));
@@ -396,15 +477,19 @@ async function main(argv = process.argv.slice(2)) {
396
477
  const crfRaw = getFlagString(parsed.flags, "crf");
397
478
  const concurrencyRaw = getFlagString(parsed.flags, "concurrency");
398
479
  const publicDir = getFlagString(parsed.flags, "publicDir");
480
+ const debugBounds = Boolean(parsed.flags.debugBounds);
481
+ const debugLabels = Boolean(parsed.flags.debugLabels);
399
482
  const crf = crfRaw ? Number(crfRaw) : void 0;
400
483
  const concurrency = concurrencyRaw ? /^[0-9]+$/.test(concurrencyRaw) ? Number(concurrencyRaw) : concurrencyRaw : void 0;
401
- const engine = new WavesEngine(globalRegistry, new IRValidator());
484
+ const engine = new WavesEngine(globalRegistry, new IRValidator(globalRegistry));
402
485
  try {
486
+ const inputProps = debugBounds || debugLabels ? { __wavesDebugBounds: debugBounds, __wavesDebugLabels: debugLabels } : void 0;
403
487
  const opts = { outputPath, registrationModules };
404
488
  if (publicDir) opts.publicDir = publicDir;
405
489
  if (codec) opts.codec = codec;
406
490
  if (Number.isFinite(crf ?? Number.NaN)) opts.crf = crf;
407
491
  if (concurrency !== void 0) opts.concurrency = concurrency;
492
+ if (inputProps) opts.inputProps = inputProps;
408
493
  await engine.render(json, opts);
409
494
  } catch (err) {
410
495
  const message = err instanceof Error ? err.message : String(err);
@@ -419,6 +504,84 @@ async function main(argv = process.argv.slice(2)) {
419
504
  `);
420
505
  return EXIT_OK;
421
506
  }
507
+ if (parsed.command === "stills") {
508
+ const inputPath = getFlagString(parsed.flags, "in");
509
+ const outDir = getFlagString(parsed.flags, "outDir") ?? getFlagString(parsed.flags, "out");
510
+ if (!inputPath) {
511
+ process.stderr.write("Missing required --in <path>\n");
512
+ return EXIT_USAGE;
513
+ }
514
+ if (!outDir) {
515
+ process.stderr.write("Missing required --outDir <dir>\n");
516
+ return EXIT_USAGE;
517
+ }
518
+ let raw;
519
+ try {
520
+ raw = await fs.readFile(inputPath, "utf-8");
521
+ } catch (err) {
522
+ const message = err instanceof Error ? err.message : String(err);
523
+ process.stderr.write(`Failed to read ${inputPath}: ${message}
524
+ `);
525
+ return EXIT_IO;
526
+ }
527
+ let json;
528
+ try {
529
+ json = JSON.parse(raw);
530
+ } catch (err) {
531
+ const message = err instanceof Error ? err.message : String(err);
532
+ process.stderr.write(`Invalid JSON: ${message}
533
+ `);
534
+ return EXIT_VALIDATE;
535
+ }
536
+ const framesRaw = getFlagString(parsed.flags, "frames") ?? "0";
537
+ const frames = framesRaw.split(/[,\s]+/g).map((v) => v.trim()).filter(Boolean).map((v) => Number(v)).filter((n) => Number.isFinite(n));
538
+ if (frames.length === 0) {
539
+ process.stderr.write('Invalid --frames (expected comma-separated frame numbers, e.g. "0,30,60")\n');
540
+ return EXIT_USAGE;
541
+ }
542
+ const imageFormatRaw = (getFlagString(parsed.flags, "imageFormat") ?? "png").toLowerCase();
543
+ const imageFormat = parseImageFormat(imageFormatRaw);
544
+ if (!imageFormat) {
545
+ process.stderr.write(`Invalid --imageFormat: ${imageFormatRaw} (expected png|jpeg|webp)
546
+ `);
547
+ return EXIT_USAGE;
548
+ }
549
+ const scaleRaw = getFlagString(parsed.flags, "scale");
550
+ const jpegQualityRaw = getFlagString(parsed.flags, "jpegQuality");
551
+ const publicDir = getFlagString(parsed.flags, "publicDir");
552
+ const debugBounds = Boolean(parsed.flags.debugBounds);
553
+ const debugLabels = Boolean(parsed.flags.debugLabels);
554
+ const scale = scaleRaw ? Number(scaleRaw) : void 0;
555
+ const jpegQuality = jpegQualityRaw ? Number(jpegQualityRaw) : void 0;
556
+ const engine = new WavesEngine(globalRegistry, new IRValidator(globalRegistry));
557
+ try {
558
+ const inputProps = debugBounds || debugLabels ? { __wavesDebugBounds: debugBounds, __wavesDebugLabels: debugLabels } : void 0;
559
+ const opts = {
560
+ outputDir: outDir,
561
+ frames,
562
+ imageFormat,
563
+ registrationModules
564
+ };
565
+ if (publicDir) opts.publicDir = publicDir;
566
+ if (Number.isFinite(scale ?? Number.NaN)) opts.scale = scale;
567
+ if (Number.isFinite(jpegQuality ?? Number.NaN)) opts.jpegQuality = jpegQuality;
568
+ if (inputProps) opts.inputProps = inputProps;
569
+ const written = await engine.renderStills(json, opts);
570
+ for (const p of written) {
571
+ process.stderr.write(`Wrote ${p}
572
+ `);
573
+ }
574
+ } catch (err) {
575
+ const message = err instanceof Error ? err.message : String(err);
576
+ const context = err instanceof WavesRenderError ? err.context : void 0;
577
+ const payload = context ? stringifyJSON({ error: message, context }, pretty) : null;
578
+ process.stderr.write(`stills failed: ${message}
579
+ `);
580
+ if (payload) process.stderr.write(payload);
581
+ return EXIT_RENDER;
582
+ }
583
+ return EXIT_OK;
584
+ }
422
585
  process.stderr.write(`Unknown command: ${parsed.command}
423
586
  `);
424
587
  process.stderr.write(`Run: waves --help
package/dist/index.d.mts CHANGED
@@ -1,36 +1,41 @@
1
- import { V as VideoIR, C as ComponentRegistry } from './registry-hVIyqwS6.mjs';
2
- export { A as AssetPathSchema, a as AudioComponentIRSchema, b as AudioIR, B as BackgroundSpec, c as BackgroundSpecSchema, d as BaseComponentIR, e as BaseComponentIRSchema, f as ComponentIR, g as ComponentIRSchema, h as ComponentSchemas, S as SceneComponentIRSchema, i as SceneIR, T as TextComponentIRSchema, j as TextIR, k as TimingSpec, l as TimingSpecSchema, m as VideoIRSchema, n as globalRegistry, r as registerBuiltInComponents } from './registry-hVIyqwS6.mjs';
1
+ import { C as ComponentRegistry, V as VideoIRv2, a as CompiledVideoIR, b as ComponentKind, c as ComponentCategory } from './registry-C6H9G0df.mjs';
2
+ export { A as AssetPathSchema, B as BackgroundSpec, d as BackgroundSpecSchema, e as ComponentNode, f as ComponentNodeSchema, T as TimingSpec, g as TimingSpecSchema, h as TransitionSpec, i as TransitionSpecSchema, j as VideoIR, k as VideoIRSchema, l as VideoIRv2AuthoringSchema, m as VideoIRv2Schema, n as globalRegistry, r as registerBuiltInComponents } from './registry-C6H9G0df.mjs';
3
3
  import 'zod';
4
4
  import 'react';
5
5
 
6
- declare const __wavesVersion = "0.1.0";
6
+ declare const __wavesVersion = "0.2.0";
7
7
 
8
8
  interface ValidationError {
9
9
  path: string[];
10
10
  message: string;
11
11
  code: string;
12
12
  }
13
- interface ValidationResult {
14
- success: boolean;
15
- errors?: ValidationError[];
16
- }
17
13
  declare class IRValidator {
14
+ private readonly registry?;
15
+ constructor(registry?: ComponentRegistry | undefined);
18
16
  validateSchema(ir: unknown): {
19
17
  success: true;
20
- data: VideoIR;
18
+ data: VideoIRv2;
19
+ } | {
20
+ success: false;
21
+ errors: ValidationError[];
22
+ };
23
+ validateSemantics(latest: VideoIRv2): {
24
+ success: true;
25
+ data: CompiledVideoIR;
21
26
  } | {
22
27
  success: false;
23
28
  errors: ValidationError[];
24
29
  };
25
- validateSemantics(ir: VideoIR): ValidationResult;
26
30
  validate(ir: unknown): {
27
31
  success: true;
28
- data: VideoIR;
32
+ data: CompiledVideoIR;
29
33
  } | {
30
34
  success: false;
31
35
  errors: ValidationError[];
32
36
  };
33
37
  private validateComponentTimingRecursive;
38
+ private validateRegistryContracts;
34
39
  }
35
40
 
36
41
  interface RenderOptions {
@@ -41,12 +46,25 @@ interface RenderOptions {
41
46
  publicDir?: string;
42
47
  rootDir?: string;
43
48
  registrationModules?: string[];
49
+ inputProps?: Record<string, unknown>;
50
+ }
51
+ interface RenderStillsOptions {
52
+ outputDir: string;
53
+ frames: number[];
54
+ imageFormat?: 'png' | 'jpeg' | 'webp';
55
+ jpegQuality?: number;
56
+ scale?: number;
57
+ publicDir?: string;
58
+ rootDir?: string;
59
+ registrationModules?: string[];
60
+ inputProps?: Record<string, unknown>;
44
61
  }
45
62
  declare class WavesEngine {
46
63
  private readonly registry;
47
64
  private readonly validator;
48
65
  constructor(registry: ComponentRegistry, validator: IRValidator);
49
66
  render(ir: unknown, options: RenderOptions): Promise<void>;
67
+ renderStills(ir: unknown, options: RenderStillsOptions): Promise<string[]>;
50
68
  }
51
69
 
52
70
  declare class WavesError extends Error {
@@ -63,8 +81,18 @@ declare class WavesRenderError extends WavesError {
63
81
  type PromptPayload = {
64
82
  package: '@depths/waves';
65
83
  version: string;
66
- irVersion: '1.0';
84
+ irVersion: '2.0';
67
85
  systemPrompt: string;
86
+ catalog: {
87
+ categories: Record<string, string[]>;
88
+ items: Array<{
89
+ type: string;
90
+ kind: ComponentKind;
91
+ category: ComponentCategory;
92
+ description: string;
93
+ llmGuidance?: string;
94
+ }>;
95
+ };
68
96
  schemas: {
69
97
  videoIR: Record<string, unknown>;
70
98
  components: Record<string, unknown>;
@@ -86,4 +114,4 @@ declare function renderVideo(ir: unknown, options: {
86
114
  publicDir?: string;
87
115
  }): Promise<void>;
88
116
 
89
- export { ComponentRegistry, IRValidator, type PromptPayload, VideoIR, WavesEngine, WavesError, WavesRenderError, WavesValidationError, __wavesVersion, getPromptPayload, getSystemPrompt, renderVideo };
117
+ export { ComponentRegistry, IRValidator, type PromptPayload, VideoIRv2, WavesEngine, WavesError, WavesRenderError, WavesValidationError, __wavesVersion, getPromptPayload, getSystemPrompt, renderVideo };
package/dist/index.d.ts CHANGED
@@ -1,36 +1,41 @@
1
- import { V as VideoIR, C as ComponentRegistry } from './registry-hVIyqwS6.js';
2
- export { A as AssetPathSchema, a as AudioComponentIRSchema, b as AudioIR, B as BackgroundSpec, c as BackgroundSpecSchema, d as BaseComponentIR, e as BaseComponentIRSchema, f as ComponentIR, g as ComponentIRSchema, h as ComponentSchemas, S as SceneComponentIRSchema, i as SceneIR, T as TextComponentIRSchema, j as TextIR, k as TimingSpec, l as TimingSpecSchema, m as VideoIRSchema, n as globalRegistry, r as registerBuiltInComponents } from './registry-hVIyqwS6.js';
1
+ import { C as ComponentRegistry, V as VideoIRv2, a as CompiledVideoIR, b as ComponentKind, c as ComponentCategory } from './registry-C6H9G0df.js';
2
+ export { A as AssetPathSchema, B as BackgroundSpec, d as BackgroundSpecSchema, e as ComponentNode, f as ComponentNodeSchema, T as TimingSpec, g as TimingSpecSchema, h as TransitionSpec, i as TransitionSpecSchema, j as VideoIR, k as VideoIRSchema, l as VideoIRv2AuthoringSchema, m as VideoIRv2Schema, n as globalRegistry, r as registerBuiltInComponents } from './registry-C6H9G0df.js';
3
3
  import 'zod';
4
4
  import 'react';
5
5
 
6
- declare const __wavesVersion = "0.1.0";
6
+ declare const __wavesVersion = "0.2.0";
7
7
 
8
8
  interface ValidationError {
9
9
  path: string[];
10
10
  message: string;
11
11
  code: string;
12
12
  }
13
- interface ValidationResult {
14
- success: boolean;
15
- errors?: ValidationError[];
16
- }
17
13
  declare class IRValidator {
14
+ private readonly registry?;
15
+ constructor(registry?: ComponentRegistry | undefined);
18
16
  validateSchema(ir: unknown): {
19
17
  success: true;
20
- data: VideoIR;
18
+ data: VideoIRv2;
19
+ } | {
20
+ success: false;
21
+ errors: ValidationError[];
22
+ };
23
+ validateSemantics(latest: VideoIRv2): {
24
+ success: true;
25
+ data: CompiledVideoIR;
21
26
  } | {
22
27
  success: false;
23
28
  errors: ValidationError[];
24
29
  };
25
- validateSemantics(ir: VideoIR): ValidationResult;
26
30
  validate(ir: unknown): {
27
31
  success: true;
28
- data: VideoIR;
32
+ data: CompiledVideoIR;
29
33
  } | {
30
34
  success: false;
31
35
  errors: ValidationError[];
32
36
  };
33
37
  private validateComponentTimingRecursive;
38
+ private validateRegistryContracts;
34
39
  }
35
40
 
36
41
  interface RenderOptions {
@@ -41,12 +46,25 @@ interface RenderOptions {
41
46
  publicDir?: string;
42
47
  rootDir?: string;
43
48
  registrationModules?: string[];
49
+ inputProps?: Record<string, unknown>;
50
+ }
51
+ interface RenderStillsOptions {
52
+ outputDir: string;
53
+ frames: number[];
54
+ imageFormat?: 'png' | 'jpeg' | 'webp';
55
+ jpegQuality?: number;
56
+ scale?: number;
57
+ publicDir?: string;
58
+ rootDir?: string;
59
+ registrationModules?: string[];
60
+ inputProps?: Record<string, unknown>;
44
61
  }
45
62
  declare class WavesEngine {
46
63
  private readonly registry;
47
64
  private readonly validator;
48
65
  constructor(registry: ComponentRegistry, validator: IRValidator);
49
66
  render(ir: unknown, options: RenderOptions): Promise<void>;
67
+ renderStills(ir: unknown, options: RenderStillsOptions): Promise<string[]>;
50
68
  }
51
69
 
52
70
  declare class WavesError extends Error {
@@ -63,8 +81,18 @@ declare class WavesRenderError extends WavesError {
63
81
  type PromptPayload = {
64
82
  package: '@depths/waves';
65
83
  version: string;
66
- irVersion: '1.0';
84
+ irVersion: '2.0';
67
85
  systemPrompt: string;
86
+ catalog: {
87
+ categories: Record<string, string[]>;
88
+ items: Array<{
89
+ type: string;
90
+ kind: ComponentKind;
91
+ category: ComponentCategory;
92
+ description: string;
93
+ llmGuidance?: string;
94
+ }>;
95
+ };
68
96
  schemas: {
69
97
  videoIR: Record<string, unknown>;
70
98
  components: Record<string, unknown>;
@@ -86,4 +114,4 @@ declare function renderVideo(ir: unknown, options: {
86
114
  publicDir?: string;
87
115
  }): Promise<void>;
88
116
 
89
- export { ComponentRegistry, IRValidator, type PromptPayload, VideoIR, WavesEngine, WavesError, WavesRenderError, WavesValidationError, __wavesVersion, getPromptPayload, getSystemPrompt, renderVideo };
117
+ export { ComponentRegistry, IRValidator, type PromptPayload, VideoIRv2, WavesEngine, WavesError, WavesRenderError, WavesValidationError, __wavesVersion, getPromptPayload, getSystemPrompt, renderVideo };