@odori/cli 0.0.3 → 0.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.
Files changed (38) hide show
  1. package/dist/{chunk-RXLB2CXH.js → chunk-RHG23EWW.js} +457 -241
  2. package/dist/cli.js +1 -1
  3. package/dist/index.d.ts +45 -5
  4. package/dist/index.js +3 -3
  5. package/dist/registry-snapshot-JEVXYGS2.js +4868 -0
  6. package/package.json +3 -3
  7. package/src/assets.ts +90 -0
  8. package/src/brand-file.ts +16 -4
  9. package/src/cli.ts +38 -13
  10. package/src/commands/add.ts +37 -1
  11. package/src/commands/dev.ts +32 -2
  12. package/src/commands/doctor.ts +47 -2
  13. package/src/commands/exportVideo.ts +6 -0
  14. package/src/commands/{still.ts → frame.ts} +23 -9
  15. package/src/commands/update.ts +58 -7
  16. package/src/discovery.ts +63 -2
  17. package/src/index.ts +1 -1
  18. package/src/jobs.ts +1 -1
  19. package/src/registry-snapshot.json +1529 -327
  20. package/src/registry-source.ts +37 -2
  21. package/src/render.ts +8 -1
  22. package/src/server.ts +7 -1
  23. package/studio/src/Studio.tsx +6 -22
  24. package/studio/src/components/ExportPanel.tsx +90 -6
  25. package/studio/src/components/Inspector.tsx +101 -1
  26. package/studio/src/components/Navigator.tsx +149 -0
  27. package/studio/src/components/Settings.tsx +109 -0
  28. package/studio/src/components/Transport.tsx +98 -55
  29. package/studio/src/components/ui.tsx +16 -1
  30. package/studio/src/lib/highlight.ts +85 -0
  31. package/studio/src/settings.ts +87 -0
  32. package/studio/src/studio.css +350 -8
  33. package/studio/src/views/BrandsView.tsx +18 -1
  34. package/studio/src/views/ComponentsView.tsx +191 -26
  35. package/studio/src/views/HomeView.tsx +7 -4
  36. package/studio/src/views/VideosView.tsx +33 -6
  37. package/studio/src/virtual.d.ts +4 -1
  38. package/dist/registry-snapshot-BDP6PVYB.js +0 -3559
package/dist/cli.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  checkFlags,
3
3
  parseArgs,
4
4
  run
5
- } from "./chunk-RXLB2CXH.js";
5
+ } from "./chunk-RHG23EWW.js";
6
6
  export {
7
7
  checkFlags,
8
8
  parseArgs,
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ViteDevServer } from 'vite';
2
2
  import * as odori from 'odori';
3
- import { VideoEntry, RenderManifest, AudioCue, ManifestAudioCue, ExportJob } from 'odori';
3
+ import { VideoEntry, RenderManifest, AudioCue, ManifestAudioCue, ExportJob, Duration } from 'odori';
4
4
  import { Browser, Page } from 'playwright-core';
5
5
  export { parseArgs, run } from './cli.js';
6
6
 
@@ -72,6 +72,8 @@ type DiscoveredPreview = {
72
72
  relativeFile: string;
73
73
  importPath: string;
74
74
  identifier: string;
75
+ /** Video ids whose composition imports this component. Derived, not declared. */
76
+ usedBy?: string[];
75
77
  };
76
78
  type DiscoveredBrandModule = {
77
79
  name: string;
@@ -87,11 +89,25 @@ type DiscoveredAudio = {
87
89
  relativeFile: string;
88
90
  bytes: number;
89
91
  };
92
+ /**
93
+ * A directory naming itself, from a `category.json` beside the components it
94
+ * holds. The path is what the filesystem already says; this is only how that
95
+ * level should read and where it should sit among its siblings.
96
+ */
97
+ type DiscoveredCategory = {
98
+ /** Directory path under the components directory: `product-ui/forms`. */
99
+ path: string;
100
+ /** What to call it. Without one, the directory name is read as words. */
101
+ name?: string;
102
+ /** Sort position among siblings. Unset sorts after, alphabetically. */
103
+ order?: number;
104
+ };
90
105
  type ProjectGraph = {
91
106
  videos: DiscoveredVideo[];
92
107
  previews: DiscoveredPreview[];
93
108
  brands: DiscoveredBrandModule[];
94
109
  audio: DiscoveredAudio[];
110
+ categories: DiscoveredCategory[];
95
111
  sourceHash: string;
96
112
  };
97
113
  /**
@@ -244,7 +260,10 @@ type RenderPage = {
244
260
  declare const openRenderPage: (origin: string, target: RenderTarget, config: ResolvedConfig) => Promise<RenderPage>;
245
261
  /** Seek through the readiness handshake instead of guessing with timeouts. */
246
262
  declare const seekTo: (page: Page, frame: number) => Promise<void>;
247
- declare const readTimeline: (page: Page) => Promise<odori.CompiledTimeline>;
263
+ declare const readTimeline: (page: Page) => Promise<odori.CompiledTimeline | {
264
+ scenes: never[];
265
+ durationInFrames: number;
266
+ }>;
248
267
  declare const readAudio: (page: Page) => Promise<odori.AudioTrack>;
249
268
  declare const probeSignatures: (page: Page, frames: number[]) => Promise<string[]>;
250
269
  /** Kept for callers that only want to know an encoder exists. */
@@ -271,6 +290,13 @@ type RenderOptions = {
271
290
  /** Container and codec. Defaults to H.264 in MP4. */
272
291
  format?: VideoFormat;
273
292
  skipUnchangedFrames?: boolean;
293
+ /**
294
+ * Mix the composition's cues into the file. Defaults to true, because the
295
+ * score is part of the video. Set false for a silent cut: a loop for a
296
+ * landing page, a clip going into an editor that has its own audio, or a
297
+ * reviewer who just wants the picture.
298
+ */
299
+ audio?: boolean;
274
300
  /** Reuse encoded chunks whose frames still look identical. */
275
301
  cache?: boolean;
276
302
  signal?: AbortSignal;
@@ -318,6 +344,7 @@ type JobRender = {
318
344
  quality?: string;
319
345
  scale?: number;
320
346
  preset?: string;
347
+ audio?: boolean;
321
348
  };
322
349
  type JobRecord = {
323
350
  job: ExportJob;
@@ -519,6 +546,7 @@ declare const runJob: (config: ResolvedConfig, origin: string, record: JobRecord
519
546
  quality?: Quality;
520
547
  scale?: number;
521
548
  format?: VideoFormat;
549
+ audio?: boolean;
522
550
  skipUnchangedFrames?: boolean;
523
551
  signal?: AbortSignal;
524
552
  onProgress?: (job: ExportJob) => void;
@@ -531,6 +559,8 @@ declare const exportCommand: (id: string, options?: {
531
559
  quality?: string;
532
560
  scale?: number;
533
561
  format?: string;
562
+ /** False writes the picture with no audio track. */
563
+ audio?: boolean;
534
564
  skipUnchangedFrames?: boolean;
535
565
  retry?: string;
536
566
  }) => Promise<ExportJob>;
@@ -568,8 +598,18 @@ type PlanOptions = {
568
598
  declare const planChunks: ({ durationInFrames, scenes, concurrency, maxChunkFrames, }: PlanOptions) => ChunkPlan;
569
599
  declare const chunkFrames: (chunk: FrameChunk) => number[];
570
600
 
571
- declare const stillCommand: (id: string, options?: {
572
- frame?: number;
601
+ /**
602
+ * One frame of a video, as a PNG.
603
+ *
604
+ * `at` is a duration like everything else in Odori: a bare number is seconds,
605
+ * and `120f` is frame 120. Which frame that resolves to depends on the
606
+ * video's frame rate, and the frame rate belongs to the video's layout, so
607
+ * the position is checked for shape first and resolved once the video is
608
+ * loaded. A typo still costs nothing: no discovery, no dev server, no
609
+ * browser.
610
+ */
611
+ declare const frameCommand: (id: string, options?: {
612
+ at?: Duration;
573
613
  output?: string;
574
614
  input?: Record<string, unknown>;
575
615
  }) => Promise<string>;
@@ -645,4 +685,4 @@ declare const newCommand: (name: string, options?: {
645
685
  /** Add the videos source root and configuration to an existing project. */
646
686
  declare const initCommand: (root?: string) => Promise<void>;
647
687
 
648
- export { CHROME_BUILD, type ChunkPlan, type CompileResult, type ComponentStatus, type Context, type DeterminismFinding, type DiffLine, FORMATS, type FrameChunk, JobQueue, type JobRecord, type LoadedVideo, type MixInput, type OdoriConfig, type ProjectGraph, type RenderOptions, type RenderTarget, type RenderTimings, type ResolvedBinary, type ResolvedConfig, type StudioServer, type VideoFormat, addCommand, alphaWarning, appendJobLog, buildAudioFilter, cacheRoot, cancelJob, checkDeterminism, chunkFrames, clearPrepareCache, compileInBrowser, componentStatus, countChanges, createContext, createIntegrityResolver, createJob, defaultConcurrency, defineConfig, devCommand, diffCommand, diffLines, discoverProject, ensureFfmpeg, exportCommand, exportQueue, fileKey, findVideo, formatDiff, formatNames, freezeManifest, generateImports, initCommand, inspectCommand, installBrowser, installFfmpeg, jobsCommand, listCommand, listJobs, loadConfig, loadVideos, localCandidates, newCommand, openRenderPage, outputName, planChunks, prepareCacheKey, probeSignatures, readAudio, readJob, readPrepareCache, readTimeline, reconcileJobs, renderMovie, renderStill, renderToolchain, resolveBrowser, resolveChromePath, resolveCueFile, resolveFfmpeg, resolveFormat, runJob, runPrepare, seekTo, startStudioServer, stillCommand, targetFor, testCommand, updateCommand, updateJob, withServer, writeGenerated, writePrepareCache };
688
+ export { CHROME_BUILD, type ChunkPlan, type CompileResult, type ComponentStatus, type Context, type DeterminismFinding, type DiffLine, FORMATS, type FrameChunk, JobQueue, type JobRecord, type LoadedVideo, type MixInput, type OdoriConfig, type ProjectGraph, type RenderOptions, type RenderTarget, type RenderTimings, type ResolvedBinary, type ResolvedConfig, type StudioServer, type VideoFormat, addCommand, alphaWarning, appendJobLog, buildAudioFilter, cacheRoot, cancelJob, checkDeterminism, chunkFrames, clearPrepareCache, compileInBrowser, componentStatus, countChanges, createContext, createIntegrityResolver, createJob, defaultConcurrency, defineConfig, devCommand, diffCommand, diffLines, discoverProject, ensureFfmpeg, exportCommand, exportQueue, fileKey, findVideo, formatDiff, formatNames, frameCommand, freezeManifest, generateImports, initCommand, inspectCommand, installBrowser, installFfmpeg, jobsCommand, listCommand, listJobs, loadConfig, loadVideos, localCandidates, newCommand, openRenderPage, outputName, planChunks, prepareCacheKey, probeSignatures, readAudio, readJob, readPrepareCache, readTimeline, reconcileJobs, renderMovie, renderStill, renderToolchain, resolveBrowser, resolveChromePath, resolveCueFile, resolveFfmpeg, resolveFormat, runJob, runPrepare, seekTo, startStudioServer, targetFor, testCommand, updateCommand, updateJob, withServer, writeGenerated, writePrepareCache };
package/dist/index.js CHANGED
@@ -30,6 +30,7 @@ import {
30
30
  findVideo,
31
31
  formatDiff,
32
32
  formatNames,
33
+ frameCommand,
33
34
  freezeManifest,
34
35
  generateImports,
35
36
  initCommand,
@@ -67,7 +68,6 @@ import {
67
68
  runPrepare,
68
69
  seekTo,
69
70
  startStudioServer,
70
- stillCommand,
71
71
  targetFor,
72
72
  testCommand,
73
73
  updateCommand,
@@ -75,7 +75,7 @@ import {
75
75
  withServer,
76
76
  writeGenerated,
77
77
  writePrepareCache
78
- } from "./chunk-RXLB2CXH.js";
78
+ } from "./chunk-RHG23EWW.js";
79
79
  export {
80
80
  CHROME_BUILD,
81
81
  FORMATS,
@@ -108,6 +108,7 @@ export {
108
108
  findVideo,
109
109
  formatDiff,
110
110
  formatNames,
111
+ frameCommand,
111
112
  freezeManifest,
112
113
  generateImports,
113
114
  initCommand,
@@ -145,7 +146,6 @@ export {
145
146
  runPrepare,
146
147
  seekTo,
147
148
  startStudioServer,
148
- stillCommand,
149
149
  targetFor,
150
150
  testCommand,
151
151
  updateCommand,