@a-company/atelier 0.28.2 → 0.29.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/index.js CHANGED
@@ -15,8 +15,8 @@ import {
15
15
  validateCommand,
16
16
  validateFile,
17
17
  variablesCommand
18
- } from "./chunk-LC7ICNMN.js";
19
- import "./chunk-C5DBTHXB.js";
18
+ } from "./chunk-JV7RGETS.js";
19
+ import "./chunk-JPZ4F4PW.js";
20
20
  export {
21
21
  assetsCommand,
22
22
  buildFfmpegArgs,
package/dist/mcp.cjs CHANGED
@@ -350,6 +350,18 @@ var ImageVisualSchema = import_zod7.z.object({
350
350
  spritesheet: SpritesheetConfigSchema.optional(),
351
351
  frameIndex: import_zod7.z.number().int().min(0).optional()
352
352
  });
353
+ var VideoVisualSchema = import_zod7.z.object({
354
+ type: import_zod7.z.literal("video"),
355
+ assetId: import_zod7.z.string().min(1, "assetId is required"),
356
+ src: import_zod7.z.string().optional(),
357
+ startFrame: import_zod7.z.number().int().min(0).optional(),
358
+ sourceOffset: import_zod7.z.number().min(0).optional(),
359
+ sourceEnd: import_zod7.z.number().positive().optional(),
360
+ playbackRate: import_zod7.z.number().positive().optional(),
361
+ volume: import_zod7.z.number().min(0).max(1).optional(),
362
+ muted: import_zod7.z.boolean().optional(),
363
+ objectFit: import_zod7.z.enum(["contain", "cover", "fill"]).optional()
364
+ });
353
365
  var GroupVisualSchema = import_zod7.z.object({
354
366
  type: import_zod7.z.literal("group")
355
367
  });
@@ -363,6 +375,7 @@ var VisualSchema = import_zod7.z.discriminatedUnion("type", [
363
375
  ShapeVisualSchema,
364
376
  TextVisualSchema,
365
377
  ImageVisualSchema,
378
+ VideoVisualSchema,
366
379
  GroupVisualSchema,
367
380
  RefVisualSchema
368
381
  ]);
@@ -482,7 +495,7 @@ var VariableSchema = import_zod12.z.object({
482
495
  default: import_zod12.z.unknown().optional(),
483
496
  description: import_zod12.z.string().optional()
484
497
  });
485
- var AssetTypeSchema = import_zod13.z.enum(["image", "svg", "font", "animation", "audio"]);
498
+ var AssetTypeSchema = import_zod13.z.enum(["image", "svg", "font", "animation", "audio", "video"]);
486
499
  var AssetSchema = import_zod13.z.object({
487
500
  type: AssetTypeSchema,
488
501
  src: import_zod13.z.string().min(1, "Asset src is required"),
@@ -493,6 +506,12 @@ var AssetSchema = import_zod13.z.object({
493
506
  frameCount: import_zod13.z.number().int().positive().optional(),
494
507
  frameWidth: import_zod13.z.number().positive(),
495
508
  frameHeight: import_zod13.z.number().positive()
509
+ }).optional(),
510
+ videoMeta: import_zod13.z.object({
511
+ duration: import_zod13.z.number().positive("videoMeta.duration must be positive"),
512
+ fps: import_zod13.z.number().positive("videoMeta.fps must be positive"),
513
+ width: import_zod13.z.number().int().positive(),
514
+ height: import_zod13.z.number().int().positive()
496
515
  }).optional()
497
516
  });
498
517
  var CanvasSchema = import_zod14.z.object({
@@ -1662,7 +1681,18 @@ function resolveFrame(doc, stateName, frame, overrideDeltas) {
1662
1681
  }
1663
1682
  }
1664
1683
  }
1665
- return { id: layer.id, layer, computedProperties };
1684
+ const resolvedLayer = { id: layer.id, layer, computedProperties };
1685
+ if (layer.visual.type === "video") {
1686
+ const video = layer.visual;
1687
+ const fps = doc.canvas.fps;
1688
+ const startFrame = video.startFrame ?? 0;
1689
+ const sourceOffset = video.sourceOffset ?? 0;
1690
+ const playbackRate = video.playbackRate ?? 1;
1691
+ const relativeFrame = Math.max(0, frame - startFrame);
1692
+ const sourceTime = relativeFrame / fps * playbackRate + sourceOffset;
1693
+ resolvedLayer.videoSourceTime = video.sourceEnd !== void 0 ? Math.min(sourceTime, video.sourceEnd) : sourceTime;
1694
+ }
1695
+ return resolvedLayer;
1666
1696
  });
1667
1697
  return { frame, stateName, layers: resolvedLayers };
1668
1698
  }