@pixerate/editor 0.140.4 → 0.142.1

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 (125) hide show
  1. package/dist/agent/canvasPlayback.d.cts +15 -0
  2. package/dist/agent/canvasPlayback.d.ts +15 -0
  3. package/dist/agent/index.cjs +173 -33
  4. package/dist/agent/index.d.cts +1 -0
  5. package/dist/agent/index.d.ts +1 -0
  6. package/dist/agent/index.js +147 -7
  7. package/dist/agent/providers.d.cts +12 -1
  8. package/dist/agent/providers.d.ts +12 -1
  9. package/dist/agent/types.d.cts +3 -0
  10. package/dist/agent/types.d.ts +3 -0
  11. package/dist/animation/index.cjs +2 -2
  12. package/dist/animation/index.js +1 -1
  13. package/dist/animation/presence.d.cts +1 -75
  14. package/dist/animation/presence.d.ts +1 -75
  15. package/dist/animation-editor/index.cjs +69 -19
  16. package/dist/animation-editor/index.d.cts +1 -0
  17. package/dist/animation-editor/index.d.ts +1 -0
  18. package/dist/animation-editor/index.js +54 -4
  19. package/dist/animation-editor/playback.d.cts +10 -0
  20. package/dist/animation-editor/playback.d.ts +10 -0
  21. package/dist/bridge/cli.cjs +3 -3
  22. package/dist/bridge/cli.js +2 -2
  23. package/dist/bridge/index.cjs +3 -3
  24. package/dist/bridge/index.js +2 -2
  25. package/dist/canvas/index.cjs +336 -646
  26. package/dist/canvas/index.d.cts +1 -0
  27. package/dist/canvas/index.d.ts +1 -0
  28. package/dist/canvas/index.js +44 -354
  29. package/dist/canvas/playback.d.cts +14 -0
  30. package/dist/canvas/playback.d.ts +14 -0
  31. package/dist/chart/index.cjs +255 -171
  32. package/dist/chart/index.d.cts +1 -0
  33. package/dist/chart/index.d.ts +1 -0
  34. package/dist/chart/index.js +244 -160
  35. package/dist/chart/playback.d.cts +22 -0
  36. package/dist/chart/playback.d.ts +22 -0
  37. package/dist/chunk-54GVEVXS.js +408 -0
  38. package/dist/{chunk-E747F3D5.js → chunk-CC6WKVIH.js} +86 -5
  39. package/dist/chunk-DW4CV5H4.js +591 -0
  40. package/dist/{chunk-UMS6YFA6.js → chunk-EAQ4BGNS.js} +1 -1
  41. package/dist/{chunk-AGCD3EHB.cjs → chunk-ENIZYNEF.cjs} +7 -7
  42. package/dist/{chunk-BSGPXPTW.js → chunk-PEEP2YR7.js} +1 -1
  43. package/dist/{chunk-VTY64I6H.cjs → chunk-QSM3MDDJ.cjs} +85 -85
  44. package/dist/{chunk-2RUNJYOX.cjs → chunk-QZFEX2N4.cjs} +86 -5
  45. package/dist/{chunk-RB62U6MS.js → chunk-RFBFTLVN.js} +27 -5
  46. package/dist/chunk-UBRYHNRU.cjs +591 -0
  47. package/dist/{chunk-GEY73RUW.cjs → chunk-UJGAA6AK.cjs} +1 -1
  48. package/dist/{chunk-LMSFXRAJ.js → chunk-VGJTUCWM.js} +1 -1
  49. package/dist/chunk-X2HQP7DF.cjs +408 -0
  50. package/dist/chunk-XH32BATE.cjs +68 -0
  51. package/dist/{chunk-HDK3T2QS.cjs → chunk-Y4BWZB6J.cjs} +29 -7
  52. package/dist/chunk-Y6SGC6KO.js +68 -0
  53. package/dist/commands/index.cjs +37 -1
  54. package/dist/commands/index.js +36 -0
  55. package/dist/commands/registry.d.cts +11 -0
  56. package/dist/commands/registry.d.ts +11 -0
  57. package/dist/diagram/index.cjs +7 -7
  58. package/dist/diagram/index.js +1 -1
  59. package/dist/image-editor/index.cjs +108 -16
  60. package/dist/image-editor/index.d.cts +1 -0
  61. package/dist/image-editor/index.d.ts +1 -0
  62. package/dist/image-editor/index.js +107 -15
  63. package/dist/image-editor/playback.d.cts +22 -0
  64. package/dist/image-editor/playback.d.ts +22 -0
  65. package/dist/index.cjs +7 -3
  66. package/dist/index.js +6 -2
  67. package/dist/paint-editor/index.cjs +73 -25
  68. package/dist/paint-editor/index.d.cts +1 -0
  69. package/dist/paint-editor/index.d.ts +1 -0
  70. package/dist/paint-editor/index.js +68 -20
  71. package/dist/paint-editor/playback.d.cts +16 -0
  72. package/dist/paint-editor/playback.d.ts +16 -0
  73. package/dist/parameters/index.cjs +32 -8
  74. package/dist/parameters/index.d.cts +1 -0
  75. package/dist/parameters/index.d.ts +1 -0
  76. package/dist/parameters/index.js +28 -4
  77. package/dist/parameters/playback.d.cts +10 -0
  78. package/dist/parameters/playback.d.ts +10 -0
  79. package/dist/spreadsheet/index.cjs +7 -3
  80. package/dist/spreadsheet/index.d.cts +1 -0
  81. package/dist/spreadsheet/index.d.ts +1 -0
  82. package/dist/spreadsheet/index.js +6 -2
  83. package/dist/spreadsheet/playback.d.cts +15 -0
  84. package/dist/spreadsheet/playback.d.ts +15 -0
  85. package/dist/tools/index.cjs +40 -3
  86. package/dist/tools/index.d.cts +3 -0
  87. package/dist/tools/index.d.ts +3 -0
  88. package/dist/tools/index.js +39 -2
  89. package/dist/tools/playback.d.cts +205 -0
  90. package/dist/tools/playback.d.ts +205 -0
  91. package/dist/tools/presence.d.cts +82 -0
  92. package/dist/tools/presence.d.ts +82 -0
  93. package/dist/tools/registry.d.cts +45 -6
  94. package/dist/tools/registry.d.ts +45 -6
  95. package/dist/tools/script.d.cts +77 -0
  96. package/dist/tools/script.d.ts +77 -0
  97. package/dist/tools/view.d.cts +2 -4
  98. package/dist/tools/view.d.ts +2 -4
  99. package/dist/vector/index.cjs +217 -100
  100. package/dist/vector/index.d.cts +1 -0
  101. package/dist/vector/index.d.ts +1 -0
  102. package/dist/vector/index.js +140 -23
  103. package/dist/vector/playback.d.cts +13 -0
  104. package/dist/vector/playback.d.ts +13 -0
  105. package/dist/video-editor/index.cjs +81 -28
  106. package/dist/video-editor/index.d.cts +1 -0
  107. package/dist/video-editor/index.d.ts +1 -0
  108. package/dist/video-editor/index.js +58 -5
  109. package/dist/video-editor/playback.d.cts +20 -0
  110. package/dist/video-editor/playback.d.ts +20 -0
  111. package/package.json +1 -1
  112. package/skills/pixerate-agent-tools/SKILL.md +13 -0
  113. package/skills/pixerate-animation-editor/SKILL.md +1 -0
  114. package/skills/pixerate-canvas/SKILL.md +3 -0
  115. package/skills/pixerate-chart/SKILL.md +1 -0
  116. package/skills/pixerate-image-editor/SKILL.md +2 -2
  117. package/skills/pixerate-paint-editor/SKILL.md +1 -0
  118. package/skills/pixerate-parameters/SKILL.md +1 -0
  119. package/skills/pixerate-spreadsheet/SKILL.md +1 -0
  120. package/skills/pixerate-vector/SKILL.md +5 -0
  121. package/skills/pixerate-video-editor/SKILL.md +1 -0
  122. package/dist/chunk-BTZS3KZY.js +0 -221
  123. package/dist/chunk-K73HMKQP.js +0 -0
  124. package/dist/chunk-LACYURUW.cjs +0 -1
  125. package/dist/chunk-MRD3NXKR.cjs +0 -221
@@ -3972,6 +3972,54 @@ var AnimationEditorController = (_class = class {
3972
3972
  }
3973
3973
  }, _class);
3974
3974
 
3975
+ // src/animation-editor/playback.ts
3976
+ var str = (v) => typeof v === "string" && v.length > 0;
3977
+ function elementsOf(args) {
3978
+ const out = [];
3979
+ const add = (v) => str(v) && !out.includes(v) && out.push(v);
3980
+ const fromCommand = (c) => {
3981
+ if (!c || typeof c !== "object") return;
3982
+ const t = _nullishCoalesce(c.targets, () => ( c.target));
3983
+ if (Array.isArray(t)) t.forEach(add);
3984
+ else add(t);
3985
+ };
3986
+ fromCommand(args);
3987
+ fromCommand(args.command);
3988
+ if (Array.isArray(args.commands)) args.commands.forEach(fromCommand);
3989
+ const fromShot = (s) => {
3990
+ if (!s || typeof s !== "object") return;
3991
+ for (const key of ["run", "commands"]) {
3992
+ const list = s[key];
3993
+ if (Array.isArray(list)) list.forEach(fromCommand);
3994
+ }
3995
+ };
3996
+ if (Array.isArray(args.run)) args.run.forEach(fromCommand);
3997
+ if (Array.isArray(args.shots)) args.shots.forEach(fromShot);
3998
+ if (Array.isArray(args.ops)) {
3999
+ for (const op of args.ops) {
4000
+ fromShot(op);
4001
+ if (Array.isArray(_optionalChain([op, 'optionalAccess', _160 => _160.shots]))) op.shots.forEach(fromShot);
4002
+ }
4003
+ }
4004
+ return out.slice(0, 4);
4005
+ }
4006
+ function planAnimationToolPlayback(tool, args) {
4007
+ const steps = [];
4008
+ const shot = str(args.shot) ? args.shot : str(args.id) && /shot/.test(tool) ? args.id : null;
4009
+ if (shot) steps.push({ type: "target", ref: { kind: "shot", id: shot } }, { type: "press" }, { type: "release" });
4010
+ for (const id of elementsOf(args)) steps.push({ type: "target", ref: { kind: "element", id } });
4011
+ return steps.length ? steps : null;
4012
+ }
4013
+ function withAnimationPlayback(provider, surface = "animation") {
4014
+ const plan = (tool) => tool.plan || tool.playback !== void 0 ? tool : { ...tool, plan: (args) => planAnimationToolPlayback(tool.name, args) };
4015
+ const tools = provider.tools;
4016
+ return {
4017
+ ...provider,
4018
+ playbackSurface: _nullishCoalesce(provider.playbackSurface, () => ( surface)),
4019
+ tools: typeof tools === "function" ? () => tools().map(plan) : tools.map(plan)
4020
+ };
4021
+ }
4022
+
3975
4023
  // src/animation-editor/tools.ts
3976
4024
  var READ = { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false };
3977
4025
  var WRITE = { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false };
@@ -4132,7 +4180,7 @@ var MOTION_COMMAND_SCHEMA = {
4132
4180
  oneOf: MOTION_COMMAND_TYPES.map((type) => MOTION_COMMAND_TYPE_SCHEMAS[type])
4133
4181
  };
4134
4182
  var REF2 = (name, description) => ({ $ref: `#/$defs/${name}`, ...description ? { description } : {} });
4135
- var firstSentence = (text) => _nullishCoalesce(_optionalChain([/^.*?[.;](?=\s|$)/, 'access', _160 => _160.exec, 'call', _161 => _161(text), 'optionalAccess', _162 => _162[0]]), () => ( text));
4183
+ var firstSentence = (text) => _nullishCoalesce(_optionalChain([/^.*?[.;](?=\s|$)/, 'access', _161 => _161.exec, 'call', _162 => _162(text), 'optionalAccess', _163 => _163[0]]), () => ( text));
4136
4184
  var COMMAND_TYPE_LINES = MOTION_COMMAND_TYPES.map((type) => `${type}: ${firstSentence(_nullishCoalesce(MOTION_COMMAND_TYPE_SCHEMAS[type].description, () => ( "")))}`);
4137
4185
  var EASE_COMPACT = {
4138
4186
  description: `Easing: a preset, or a curve { "type": "cubic-bezier", x1, y1, x2, y2 }, { "type": "spring", stiffness, damping, mass, velocity } (spring presets are Figma's; with no "duration" it lasts until it settles) or { "type": "elastic", amplitude, period, mode }. Default: ease-out for entrances, ease-in-out for moves.`,
@@ -4540,9 +4588,9 @@ function createAnimationEditorToolProvider(controller, options = {}) {
4540
4588
  handler: ({ from = 0, to, limit = 200 }) => {
4541
4589
  const s = scene();
4542
4590
  const timeline = compileMotionScene(s);
4543
- const words = _nullishCoalesce(_optionalChain([s, 'access', _163 => _163.narration, 'optionalAccess', _164 => _164.words]), () => ( []));
4591
+ const words = _nullishCoalesce(_optionalChain([s, 'access', _164 => _164.narration, 'optionalAccess', _165 => _165.words]), () => ( []));
4544
4592
  const end = _nullishCoalesce(to, () => ( Math.max(timeline.duration, words.length ? _nullishCoalesce(words[words.length - 1].end, () => ( words[words.length - 1].start)) : 0)));
4545
- const shotAt = (ms) => _optionalChain([timeline, 'access', _165 => _165.shots, 'access', _166 => _166.find, 'call', _167 => _167((x) => ms >= x.start && ms < x.end), 'optionalAccess', _168 => _168.id]);
4593
+ const shotAt = (ms) => _optionalChain([timeline, 'access', _166 => _166.shots, 'access', _167 => _167.find, 'call', _168 => _168((x) => ms >= x.start && ms < x.end), 'optionalAccess', _169 => _169.id]);
4546
4594
  const beats = [];
4547
4595
  if (s.beat && s.beat.bpm > 0) {
4548
4596
  const first = Math.max(0, Math.ceil(motionBeatAt(s.beat, from).beat - 1e-9));
@@ -4864,7 +4912,7 @@ function createAnimationEditorToolProvider(controller, options = {}) {
4864
4912
  inputSchema: object({ shot: SHOT_ID, commands: { type: "array", items: REF2("command"), minItems: 1, description: "Commands to add." }, at: { type: "integer", minimum: 0, description: "Index in the run (default: the end)." } }, ["shot", "commands"]),
4865
4913
  annotations: { title: "Add commands to a shot", ...WRITE },
4866
4914
  handler: ({ shot, commands, at }) => {
4867
- const before = _nullishCoalesce(_optionalChain([scene, 'call', _169 => _169(), 'access', _170 => _170.shots, 'access', _171 => _171.find, 'call', _172 => _172((s) => s.id === shot), 'optionalAccess', _173 => _173.run, 'access', _174 => _174.length]), () => ( 0));
4915
+ const before = _nullishCoalesce(_optionalChain([scene, 'call', _170 => _170(), 'access', _171 => _171.shots, 'access', _172 => _172.find, 'call', _173 => _173((s) => s.id === shot), 'optionalAccess', _174 => _174.run, 'access', _175 => _175.length]), () => ( 0));
4868
4916
  const first = _nullishCoalesce(at, () => ( before));
4869
4917
  return apply({ op: "add_commands", shot, commands, at }, "Add commands", (s) => {
4870
4918
  const shots = describeMotionShots(s);
@@ -4998,7 +5046,7 @@ function createAnimationEditorToolProvider(controller, options = {}) {
4998
5046
  const finish = (tools) => tools.map((tool) => ({ ...tool, inputSchema: withDefs(tool.inputSchema) }));
4999
5047
  const reads = finish([getAnimation, getShot, describeCommand, findElements, getTextLayout, getMotionPath, getTimingGrid, checkAnimation, renderFrame, exportFlairMotion, exportFlairEffect, exportLottie, seekAnimation]);
5000
5048
  const writes = finish([setArtworkSvg, importPptx, setDrivers, setClip, copyAnimation, fitAnimation, importFlairEffect, insertShots, updateShot, deleteShots, moveShot, addCommands, updateCommand, deleteCommands, moveCommand, setSettings, setControls, editAnimation, writeAnimation, undo, redo]);
5001
- return {
5049
+ return withAnimationPlayback({
5002
5050
  id: _nullishCoalesce(options.id, () => ( "animation")),
5003
5051
  namespace: options.namespace,
5004
5052
  title: "Animation editor",
@@ -5015,7 +5063,7 @@ function createAnimationEditorToolProvider(controller, options = {}) {
5015
5063
  }
5016
5064
  });
5017
5065
  }
5018
- };
5066
+ });
5019
5067
  }
5020
5068
 
5021
5069
  // src/animation-editor/instructions.ts
@@ -5065,7 +5113,7 @@ var TIMING = /* @__PURE__ */ new Set(["duration", "delay", "stagger", "with", "e
5065
5113
  var COLORS = /* @__PURE__ */ new Set(["fill", "stroke", "color"]);
5066
5114
  var NODES = /* @__PURE__ */ new Set(["into", "path"]);
5067
5115
  function branch(type) {
5068
- return (_nullishCoalesce(MOTION_COMMAND_SCHEMA.oneOf, () => ( []))).find((b) => _optionalChain([b, 'access', _175 => _175.properties, 'optionalAccess', _176 => _176.type, 'optionalAccess', _177 => _177.const]) === type);
5116
+ return (_nullishCoalesce(MOTION_COMMAND_SCHEMA.oneOf, () => ( []))).find((b) => _optionalChain([b, 'access', _176 => _176.properties, 'optionalAccess', _177 => _177.type, 'optionalAccess', _178 => _178.const]) === type);
5069
5117
  }
5070
5118
  function unitOf(type, name) {
5071
5119
  if (name === "duration" || name === "delay" || name === "stagger") return "ms";
@@ -5100,7 +5148,7 @@ function kindOf(name, schema) {
5100
5148
  }
5101
5149
  function motionCommandFields(type) {
5102
5150
  const schema = branch(type);
5103
- if (!_optionalChain([schema, 'optionalAccess', _178 => _178.properties])) return [];
5151
+ if (!_optionalChain([schema, 'optionalAccess', _179 => _179.properties])) return [];
5104
5152
  const required = new Set(_nullishCoalesce(schema.required, () => ( [])));
5105
5153
  const fields = Object.entries(schema.properties).filter(([name]) => name !== "type").map(([name, s]) => {
5106
5154
  const kind = kindOf(name, s);
@@ -5157,7 +5205,7 @@ function defaultMotionCommand(type, targets, scene) {
5157
5205
  if (type === "wait") return { type: "wait", duration: 500 };
5158
5206
  if (!targets.length) return { error: "Pick a target first: click an element on the stage." };
5159
5207
  const nodes = [...indexMotionNodes(scene.artwork.nodes).values()];
5160
- const other = (pred) => _optionalChain([nodes, 'access', _179 => _179.find, 'call', _180 => _180((e) => !targets.includes(e.node.id) && pred(e)), 'optionalAccess', _181 => _181.node, 'access', _182 => _182.id]);
5208
+ const other = (pred) => _optionalChain([nodes, 'access', _180 => _180.find, 'call', _181 => _181((e) => !targets.includes(e.node.id) && pred(e)), 'optionalAccess', _182 => _182.node, 'access', _183 => _183.id]);
5161
5209
  const base = { targets: [...targets] };
5162
5210
  switch (type) {
5163
5211
  case "scale":
@@ -5188,8 +5236,8 @@ function defaultMotionCommand(type, targets, scene) {
5188
5236
  }
5189
5237
  case "effect": {
5190
5238
  for (const id of targets) {
5191
- const node = _optionalChain([nodes, 'access', _183 => _183.find, 'call', _184 => _184((e) => e.node.id === id), 'optionalAccess', _185 => _185.node]);
5192
- for (const effect of _nullishCoalesce(_optionalChain([node, 'optionalAccess', _186 => _186.effects]), () => ( []))) {
5239
+ const node = _optionalChain([nodes, 'access', _184 => _184.find, 'call', _185 => _185((e) => e.node.id === id), 'optionalAccess', _186 => _186.node]);
5240
+ for (const effect of _nullishCoalesce(_optionalChain([node, 'optionalAccess', _187 => _187.effects]), () => ( []))) {
5193
5241
  const param = Object.entries(effect.params).find(([, v]) => typeof v === "number");
5194
5242
  if (param) return { type, ...base, effect: effect.id, param: param[0], to: param[1] + 1 };
5195
5243
  }
@@ -5214,11 +5262,11 @@ function motionCommandRows(scene, shotId) {
5214
5262
  return scene.shots[index].run.map((command3, i) => {
5215
5263
  const t = timeline.commands.find((c) => c.shotIndex === index && c.command === i);
5216
5264
  const primitive = motionFlairPrimitive(command3);
5217
- return { index: i, command: command3, summary: motionCommandSummary(command3), start: _nullishCoalesce(_optionalChain([t, 'optionalAccess', _187 => _187.start]), () => ( 0)), end: _nullishCoalesce(_optionalChain([t, 'optionalAccess', _188 => _188.end]), () => ( 0)), ...primitive ? { flairPrimitive: primitive } : {} };
5265
+ return { index: i, command: command3, summary: motionCommandSummary(command3), start: _nullishCoalesce(_optionalChain([t, 'optionalAccess', _188 => _188.start]), () => ( 0)), end: _nullishCoalesce(_optionalChain([t, 'optionalAccess', _189 => _189.end]), () => ( 0)), ...primitive ? { flairPrimitive: primitive } : {} };
5218
5266
  });
5219
5267
  }
5220
5268
  function duplicateMotionCommandEdit(scene, shot, command3) {
5221
- const run = _nullishCoalesce(_optionalChain([scene, 'access', _189 => _189.shots, 'access', _190 => _190.find, 'call', _191 => _191((s) => s.id === shot), 'optionalAccess', _192 => _192.run]), () => ( []));
5269
+ const run = _nullishCoalesce(_optionalChain([scene, 'access', _190 => _190.shots, 'access', _191 => _191.find, 'call', _192 => _192((s) => s.id === shot), 'optionalAccess', _193 => _193.run]), () => ( []));
5222
5270
  return { op: "add_commands", shot, commands: run[command3] ? [structuredClone(run[command3])] : [], at: command3 + 1 };
5223
5271
  }
5224
5272
  var MOTION_EASE_CHOICES = [
@@ -5303,7 +5351,7 @@ function motionCueFromKey(key) {
5303
5351
  function motionCueChoices(scene, limit = 256) {
5304
5352
  const choices = [];
5305
5353
  const s = (ms) => `${(ms / 1e3).toFixed(2)} s`;
5306
- const end = Math.max(compileMotionScene(scene).duration, ..._nullishCoalesce(_optionalChain([scene, 'access', _193 => _193.narration, 'optionalAccess', _194 => _194.words, 'access', _195 => _195.map, 'call', _196 => _196((w) => _nullishCoalesce(w.end, () => ( w.start)))]), () => ( [0]))) + 2e3;
5354
+ const end = Math.max(compileMotionScene(scene).duration, ..._nullishCoalesce(_optionalChain([scene, 'access', _194 => _194.narration, 'optionalAccess', _195 => _195.words, 'access', _196 => _196.map, 'call', _197 => _197((w) => _nullishCoalesce(w.end, () => ( w.start)))]), () => ( [0]))) + 2e3;
5307
5355
  if (scene.beat && scene.beat.bpm > 0) {
5308
5356
  for (let beat = 0; choices.length < limit; beat++) {
5309
5357
  const time = motionBeatTime(scene.beat, beat);
@@ -5313,7 +5361,7 @@ function motionCueChoices(scene, limit = 256) {
5313
5361
  choices.push({ value: `beat:${beat}`, label: `Beat ${beat} (bar ${at.bar}.${at.beatInBar}) \xB7 ${s(time)}`, time });
5314
5362
  }
5315
5363
  }
5316
- _optionalChain([scene, 'access', _197 => _197.narration, 'optionalAccess', _198 => _198.words, 'access', _199 => _199.forEach, 'call', _200 => _200((w, i) => {
5364
+ _optionalChain([scene, 'access', _198 => _198.narration, 'optionalAccess', _199 => _199.words, 'access', _200 => _200.forEach, 'call', _201 => _201((w, i) => {
5317
5365
  if (choices.length < limit * 2) choices.push({ value: `word:${i}`, label: `Word ${i} \u201C${w.text}\u201D \xB7 ${s(w.start)}`, time: w.start });
5318
5366
  })]);
5319
5367
  return choices;
@@ -5322,7 +5370,7 @@ function motionShotCueTime(scene, cue) {
5322
5370
  return cue ? motionCueTime(scene, cue) : void 0;
5323
5371
  }
5324
5372
  function formatMotionNarration(narration) {
5325
- return (_nullishCoalesce(_optionalChain([narration, 'optionalAccess', _201 => _201.words]), () => ( []))).map((w) => `${w.start} ${w.text}`).join("\n");
5373
+ return (_nullishCoalesce(_optionalChain([narration, 'optionalAccess', _202 => _202.words]), () => ( []))).map((w) => `${w.start} ${w.text}`).join("\n");
5326
5374
  }
5327
5375
  function parseMotionNarration(text) {
5328
5376
  const lines = text.split("\n").map((l) => l.trim()).filter(Boolean);
@@ -5371,7 +5419,7 @@ function createAnimationEffectsToolProvider(controller, options = {}) {
5371
5419
  if (!r.ok) throw new Error(r.error);
5372
5420
  return { target, effect: info(r.effect), effects: controller.appliedEffects().filter((e) => e.targets.includes(target)).map(info), ...r.notes.length ? { notes: r.notes } : {} };
5373
5421
  };
5374
- return _chunkRUZQMYXHcjs.createEffectToolProvider.call(void 0, {
5422
+ return withAnimationPlayback(_chunkRUZQMYXHcjs.createEffectToolProvider.call(void 0, {
5375
5423
  id: _nullishCoalesce(options.id, () => ( "animation-effects")),
5376
5424
  namespace: options.namespace,
5377
5425
  title: "Animation effects",
@@ -5438,7 +5486,7 @@ function createAnimationEffectsToolProvider(controller, options = {}) {
5438
5486
  }
5439
5487
  }
5440
5488
  ]
5441
- });
5489
+ }));
5442
5490
  }
5443
5491
 
5444
5492
 
@@ -5593,4 +5641,6 @@ function createAnimationEffectsToolProvider(controller, options = {}) {
5593
5641
 
5594
5642
 
5595
5643
 
5596
- exports.ANIMATION_EDITOR_AGENT_INSTRUCTIONS = ANIMATION_EDITOR_AGENT_INSTRUCTIONS; exports.AnimationEditorController = AnimationEditorController; exports.FLAIR_EASES = FLAIR_EASES; exports.FLAIR_EXPORT_VERSION = FLAIR_EXPORT_VERSION; exports.MOTION_ADDITIVE_PROPERTIES = MOTION_ADDITIVE_PROPERTIES; exports.MOTION_BLENDS = MOTION_BLENDS; exports.MOTION_CAMERA_MS = MOTION_CAMERA_MS; exports.MOTION_CASCADES = MOTION_CASCADES; exports.MOTION_CLIP_TARGET = MOTION_CLIP_TARGET; exports.MOTION_COMMAND_FIELDS = MOTION_COMMAND_FIELDS; exports.MOTION_COMMAND_SCHEMA = MOTION_COMMAND_SCHEMA; exports.MOTION_COMMAND_TYPES = MOTION_COMMAND_TYPES; exports.MOTION_COMMAND_TYPE_SCHEMAS = MOTION_COMMAND_TYPE_SCHEMAS; exports.MOTION_DEFAULT_DURATIONS = MOTION_DEFAULT_DURATIONS; exports.MOTION_DEFAULT_HOLD = MOTION_DEFAULT_HOLD; exports.MOTION_DIRECTIONS = MOTION_DIRECTIONS; exports.MOTION_DRAW_EFFECT_ID = MOTION_DRAW_EFFECT_ID; exports.MOTION_DRAW_MS_PER_UNIT = MOTION_DRAW_MS_PER_UNIT; exports.MOTION_DRAW_RANGE = MOTION_DRAW_RANGE; exports.MOTION_DRIVEN_PROPERTIES = MOTION_DRIVEN_PROPERTIES; exports.MOTION_EASE_CHOICES = MOTION_EASE_CHOICES; exports.MOTION_EASE_IN_OUT = MOTION_EASE_IN_OUT; exports.MOTION_EASE_OUT = MOTION_EASE_OUT; exports.MOTION_EDIT_OPS = MOTION_EDIT_OPS; exports.MOTION_ENTER_STYLES = MOTION_ENTER_STYLES; exports.MOTION_EXIT_STYLES = MOTION_EXIT_STYLES; exports.MOTION_IRIS_SHAPES = MOTION_IRIS_SHAPES; exports.MOTION_ISSUE_CODES = _chunkEBDZWIOPcjs.MOTION_ISSUE_CODES; exports.MOTION_MIN_CHANGE_MS = MOTION_MIN_CHANGE_MS; exports.MOTION_REPEAT_MODES = MOTION_REPEAT_MODES; exports.MOTION_SPEED_RANGE = MOTION_SPEED_RANGE; exports.MOTION_SPLIT_ORIENTATIONS = MOTION_SPLIT_ORIENTATIONS; exports.MOTION_TEXT_STAGGER = MOTION_TEXT_STAGGER; exports.MOTION_TEXT_UNITS = MOTION_TEXT_UNITS; exports.MOTION_TRIGGERS = MOTION_TRIGGERS; exports.MotionSceneFormatError = MotionSceneFormatError; exports.activeSegment = activeSegment; exports.applyMotionControlValues = applyMotionControlValues; exports.applyMotionDrivers = applyMotionDrivers; exports.applyMotionEdits = applyMotionEdits; exports.checkMotionScene = checkMotionScene; exports.clipsShapeProblems = clipsShapeProblems; exports.commandShapeProblems = commandShapeProblems; exports.compileMotionScene = compileMotionScene; exports.createAnimationEditorToolProvider = createAnimationEditorToolProvider; exports.createAnimationEffectsToolProvider = createAnimationEffectsToolProvider; exports.createMotionScene = createMotionScene; exports.defaultMotionCommand = defaultMotionCommand; exports.describeMotionElements = describeMotionElements; exports.describeMotionShots = describeMotionShots; exports.driversShapeProblems = driversShapeProblems; exports.duplicateMotionCommandEdit = duplicateMotionCommandEdit; exports.fitMotionRect = fitMotionRect; exports.fitMotionScene = fitMotionScene; exports.fitMotionSceneEdits = fitMotionSceneEdits; exports.flairAtLeast = flairAtLeast; exports.flairCurveFor = flairCurveFor; exports.flairEaseFor = flairEaseFor; exports.formatMotionDrivers = formatMotionDrivers; exports.formatMotionNarration = formatMotionNarration; exports.freshShotId = freshShotId; exports.fromFlairSvgMotion = fromFlairSvgMotion; exports.fromFlairVectorEffect = fromFlairVectorEffect; exports.fromPptxAnimation = fromPptxAnimation; exports.highlightMotionSvg = highlightMotionSvg; exports.indexMotionNodes = indexMotionNodes; exports.interpolateMotionValue = interpolateMotionValue; exports.isMotionCommand = isMotionCommand; exports.isMotionShot = isMotionShot; exports.matchMotionNodes = matchMotionNodes; exports.motionAddTrackKey = motionAddTrackKey; exports.motionArtworkSvg = motionArtworkSvg; exports.motionBeatAt = motionBeatAt; exports.motionBeatTime = motionBeatTime; exports.motionBlurTimes = motionBlurTimes; exports.motionCascade = motionCascade; exports.motionClipAttrs = motionClipAttrs; exports.motionClipLayout = motionClipLayout; exports.motionCommandDuration = motionCommandDuration; exports.motionCommandFields = motionCommandFields; exports.motionCommandRepeat = motionCommandRepeat; exports.motionCommandRows = motionCommandRows; exports.motionCommandSlots = motionCommandSlots; exports.motionCommandSummary = motionCommandSummary; exports.motionCommandsFromEffect = motionCommandsFromEffect; exports.motionContactSheetSvg = motionContactSheetSvg; exports.motionCueChoices = motionCueChoices; exports.motionCueFromKey = motionCueFromKey; exports.motionCueKey = motionCueKey; exports.motionCueTime = motionCueTime; exports.motionCycleDuration = motionCycleDuration; exports.motionDrivenNodes = motionDrivenNodes; exports.motionDriverSources = motionDriverSources; exports.motionEaseKey = motionEaseKey; exports.motionEasingCurve = motionEasingCurve; exports.motionEasingGuides = motionEasingGuides; exports.motionEasingPath = motionEasingPath; exports.motionFieldEdit = motionFieldEdit; exports.motionFieldLabel = motionFieldLabel; exports.motionFlairPrimitive = motionFlairPrimitive; exports.motionFollowRoute = motionFollowRoute; exports.motionFrameAt = motionFrameAt; exports.motionFrameToSvg = motionFrameToSvg; exports.motionGhosts = motionGhosts; exports.motionIssue = _chunkEBDZWIOPcjs.motionIssue; exports.motionIssueKey = _chunkEBDZWIOPcjs.motionIssueKey; exports.motionIssueLine = _chunkEBDZWIOPcjs.motionIssueLine; exports.motionMovingIds = motionMovingIds; exports.motionNodeAtElement = motionNodeAtElement; exports.motionNodeClips = motionNodeClips; exports.motionNodeOffset = motionNodeOffset; exports.motionPartsFromVectorEffect = motionPartsFromVectorEffect; exports.motionPath = motionPath; exports.motionPathLength = motionPathLength; exports.motionPathsSvg = motionPathsSvg; exports.motionPropertyValue = motionPropertyValue; exports.motionRestValue = motionRestValue; exports.motionRevealClip = motionRevealClip; exports.motionRevealPadding = motionRevealPadding; exports.motionRulerTicks = motionRulerTicks; exports.motionSceneEffects = motionSceneEffects; exports.motionSceneShapeProblems = motionSceneShapeProblems; exports.motionSceneToJson = motionSceneToJson; exports.motionShotAt = motionShotAt; exports.motionShotCueTime = motionShotCueTime; exports.motionShotTimeScale = motionShotTimeScale; exports.motionStageSvg = motionStageSvg; exports.motionTextLayout = motionTextLayout; exports.motionTextUnits = motionTextUnits; exports.motionTrackKey = motionTrackKey; exports.namedWithSuggestion = _chunkEBDZWIOPcjs.namedWithSuggestion; exports.nextMotionEffectInstance = nextMotionEffectInstance; exports.parseMotionDrivers = parseMotionDrivers; exports.parseMotionFieldInput = parseMotionFieldInput; exports.parseMotionNarration = parseMotionNarration; exports.parseMotionScene = parseMotionScene; exports.resolveMotionCamera = resolveMotionCamera; exports.resolveMotionEditRefs = resolveMotionEditRefs; exports.segmentProgress = segmentProgress; exports.segmentValue = segmentValue; exports.shotShapeProblems = shotShapeProblems; exports.smoothMotionLegs = smoothMotionLegs; exports.smoothMotionTimes = smoothMotionTimes; exports.suggestName = _chunkEBDZWIOPcjs.suggestName; exports.toFlairEffectDocument = toFlairEffectDocument; exports.toFlairSvgMotion = toFlairSvgMotion; exports.toFlairVectorEffect = toFlairVectorEffect; exports.toLottie = toLottie; exports.trackValue = trackValue; exports.withMotionLayers = withMotionLayers; exports.withViewBox = withViewBox; exports.withoutMotionEffect = withoutMotionEffect;
5644
+
5645
+
5646
+ exports.ANIMATION_EDITOR_AGENT_INSTRUCTIONS = ANIMATION_EDITOR_AGENT_INSTRUCTIONS; exports.AnimationEditorController = AnimationEditorController; exports.FLAIR_EASES = FLAIR_EASES; exports.FLAIR_EXPORT_VERSION = FLAIR_EXPORT_VERSION; exports.MOTION_ADDITIVE_PROPERTIES = MOTION_ADDITIVE_PROPERTIES; exports.MOTION_BLENDS = MOTION_BLENDS; exports.MOTION_CAMERA_MS = MOTION_CAMERA_MS; exports.MOTION_CASCADES = MOTION_CASCADES; exports.MOTION_CLIP_TARGET = MOTION_CLIP_TARGET; exports.MOTION_COMMAND_FIELDS = MOTION_COMMAND_FIELDS; exports.MOTION_COMMAND_SCHEMA = MOTION_COMMAND_SCHEMA; exports.MOTION_COMMAND_TYPES = MOTION_COMMAND_TYPES; exports.MOTION_COMMAND_TYPE_SCHEMAS = MOTION_COMMAND_TYPE_SCHEMAS; exports.MOTION_DEFAULT_DURATIONS = MOTION_DEFAULT_DURATIONS; exports.MOTION_DEFAULT_HOLD = MOTION_DEFAULT_HOLD; exports.MOTION_DIRECTIONS = MOTION_DIRECTIONS; exports.MOTION_DRAW_EFFECT_ID = MOTION_DRAW_EFFECT_ID; exports.MOTION_DRAW_MS_PER_UNIT = MOTION_DRAW_MS_PER_UNIT; exports.MOTION_DRAW_RANGE = MOTION_DRAW_RANGE; exports.MOTION_DRIVEN_PROPERTIES = MOTION_DRIVEN_PROPERTIES; exports.MOTION_EASE_CHOICES = MOTION_EASE_CHOICES; exports.MOTION_EASE_IN_OUT = MOTION_EASE_IN_OUT; exports.MOTION_EASE_OUT = MOTION_EASE_OUT; exports.MOTION_EDIT_OPS = MOTION_EDIT_OPS; exports.MOTION_ENTER_STYLES = MOTION_ENTER_STYLES; exports.MOTION_EXIT_STYLES = MOTION_EXIT_STYLES; exports.MOTION_IRIS_SHAPES = MOTION_IRIS_SHAPES; exports.MOTION_ISSUE_CODES = _chunkEBDZWIOPcjs.MOTION_ISSUE_CODES; exports.MOTION_MIN_CHANGE_MS = MOTION_MIN_CHANGE_MS; exports.MOTION_REPEAT_MODES = MOTION_REPEAT_MODES; exports.MOTION_SPEED_RANGE = MOTION_SPEED_RANGE; exports.MOTION_SPLIT_ORIENTATIONS = MOTION_SPLIT_ORIENTATIONS; exports.MOTION_TEXT_STAGGER = MOTION_TEXT_STAGGER; exports.MOTION_TEXT_UNITS = MOTION_TEXT_UNITS; exports.MOTION_TRIGGERS = MOTION_TRIGGERS; exports.MotionSceneFormatError = MotionSceneFormatError; exports.activeSegment = activeSegment; exports.applyMotionControlValues = applyMotionControlValues; exports.applyMotionDrivers = applyMotionDrivers; exports.applyMotionEdits = applyMotionEdits; exports.checkMotionScene = checkMotionScene; exports.clipsShapeProblems = clipsShapeProblems; exports.commandShapeProblems = commandShapeProblems; exports.compileMotionScene = compileMotionScene; exports.createAnimationEditorToolProvider = createAnimationEditorToolProvider; exports.createAnimationEffectsToolProvider = createAnimationEffectsToolProvider; exports.createMotionScene = createMotionScene; exports.defaultMotionCommand = defaultMotionCommand; exports.describeMotionElements = describeMotionElements; exports.describeMotionShots = describeMotionShots; exports.driversShapeProblems = driversShapeProblems; exports.duplicateMotionCommandEdit = duplicateMotionCommandEdit; exports.fitMotionRect = fitMotionRect; exports.fitMotionScene = fitMotionScene; exports.fitMotionSceneEdits = fitMotionSceneEdits; exports.flairAtLeast = flairAtLeast; exports.flairCurveFor = flairCurveFor; exports.flairEaseFor = flairEaseFor; exports.formatMotionDrivers = formatMotionDrivers; exports.formatMotionNarration = formatMotionNarration; exports.freshShotId = freshShotId; exports.fromFlairSvgMotion = fromFlairSvgMotion; exports.fromFlairVectorEffect = fromFlairVectorEffect; exports.fromPptxAnimation = fromPptxAnimation; exports.highlightMotionSvg = highlightMotionSvg; exports.indexMotionNodes = indexMotionNodes; exports.interpolateMotionValue = interpolateMotionValue; exports.isMotionCommand = isMotionCommand; exports.isMotionShot = isMotionShot; exports.matchMotionNodes = matchMotionNodes; exports.motionAddTrackKey = motionAddTrackKey; exports.motionArtworkSvg = motionArtworkSvg; exports.motionBeatAt = motionBeatAt; exports.motionBeatTime = motionBeatTime; exports.motionBlurTimes = motionBlurTimes; exports.motionCascade = motionCascade; exports.motionClipAttrs = motionClipAttrs; exports.motionClipLayout = motionClipLayout; exports.motionCommandDuration = motionCommandDuration; exports.motionCommandFields = motionCommandFields; exports.motionCommandRepeat = motionCommandRepeat; exports.motionCommandRows = motionCommandRows; exports.motionCommandSlots = motionCommandSlots; exports.motionCommandSummary = motionCommandSummary; exports.motionCommandsFromEffect = motionCommandsFromEffect; exports.motionContactSheetSvg = motionContactSheetSvg; exports.motionCueChoices = motionCueChoices; exports.motionCueFromKey = motionCueFromKey; exports.motionCueKey = motionCueKey; exports.motionCueTime = motionCueTime; exports.motionCycleDuration = motionCycleDuration; exports.motionDrivenNodes = motionDrivenNodes; exports.motionDriverSources = motionDriverSources; exports.motionEaseKey = motionEaseKey; exports.motionEasingCurve = motionEasingCurve; exports.motionEasingGuides = motionEasingGuides; exports.motionEasingPath = motionEasingPath; exports.motionFieldEdit = motionFieldEdit; exports.motionFieldLabel = motionFieldLabel; exports.motionFlairPrimitive = motionFlairPrimitive; exports.motionFollowRoute = motionFollowRoute; exports.motionFrameAt = motionFrameAt; exports.motionFrameToSvg = motionFrameToSvg; exports.motionGhosts = motionGhosts; exports.motionIssue = _chunkEBDZWIOPcjs.motionIssue; exports.motionIssueKey = _chunkEBDZWIOPcjs.motionIssueKey; exports.motionIssueLine = _chunkEBDZWIOPcjs.motionIssueLine; exports.motionMovingIds = motionMovingIds; exports.motionNodeAtElement = motionNodeAtElement; exports.motionNodeClips = motionNodeClips; exports.motionNodeOffset = motionNodeOffset; exports.motionPartsFromVectorEffect = motionPartsFromVectorEffect; exports.motionPath = motionPath; exports.motionPathLength = motionPathLength; exports.motionPathsSvg = motionPathsSvg; exports.motionPropertyValue = motionPropertyValue; exports.motionRestValue = motionRestValue; exports.motionRevealClip = motionRevealClip; exports.motionRevealPadding = motionRevealPadding; exports.motionRulerTicks = motionRulerTicks; exports.motionSceneEffects = motionSceneEffects; exports.motionSceneShapeProblems = motionSceneShapeProblems; exports.motionSceneToJson = motionSceneToJson; exports.motionShotAt = motionShotAt; exports.motionShotCueTime = motionShotCueTime; exports.motionShotTimeScale = motionShotTimeScale; exports.motionStageSvg = motionStageSvg; exports.motionTextLayout = motionTextLayout; exports.motionTextUnits = motionTextUnits; exports.motionTrackKey = motionTrackKey; exports.namedWithSuggestion = _chunkEBDZWIOPcjs.namedWithSuggestion; exports.nextMotionEffectInstance = nextMotionEffectInstance; exports.parseMotionDrivers = parseMotionDrivers; exports.parseMotionFieldInput = parseMotionFieldInput; exports.parseMotionNarration = parseMotionNarration; exports.parseMotionScene = parseMotionScene; exports.planAnimationToolPlayback = planAnimationToolPlayback; exports.resolveMotionCamera = resolveMotionCamera; exports.resolveMotionEditRefs = resolveMotionEditRefs; exports.segmentProgress = segmentProgress; exports.segmentValue = segmentValue; exports.shotShapeProblems = shotShapeProblems; exports.smoothMotionLegs = smoothMotionLegs; exports.smoothMotionTimes = smoothMotionTimes; exports.suggestName = _chunkEBDZWIOPcjs.suggestName; exports.toFlairEffectDocument = toFlairEffectDocument; exports.toFlairSvgMotion = toFlairSvgMotion; exports.toFlairVectorEffect = toFlairVectorEffect; exports.toLottie = toLottie; exports.trackValue = trackValue; exports.withAnimationPlayback = withAnimationPlayback; exports.withMotionLayers = withMotionLayers; exports.withViewBox = withViewBox; exports.withoutMotionEffect = withoutMotionEffect;
@@ -29,3 +29,4 @@ export * from './instructions.cjs';
29
29
  export * from './form.cjs';
30
30
  export * from './effects.cjs';
31
31
  export * from './effect-tools.cjs';
32
+ export * from './playback.cjs';
@@ -29,3 +29,4 @@ export * from './instructions.js';
29
29
  export * from './form.js';
30
30
  export * from './effects.js';
31
31
  export * from './effect-tools.js';
32
+ export * from './playback.js';
@@ -3972,6 +3972,54 @@ var AnimationEditorController = class {
3972
3972
  }
3973
3973
  };
3974
3974
 
3975
+ // src/animation-editor/playback.ts
3976
+ var str = (v) => typeof v === "string" && v.length > 0;
3977
+ function elementsOf(args) {
3978
+ const out = [];
3979
+ const add = (v) => str(v) && !out.includes(v) && out.push(v);
3980
+ const fromCommand = (c) => {
3981
+ if (!c || typeof c !== "object") return;
3982
+ const t = c.targets ?? c.target;
3983
+ if (Array.isArray(t)) t.forEach(add);
3984
+ else add(t);
3985
+ };
3986
+ fromCommand(args);
3987
+ fromCommand(args.command);
3988
+ if (Array.isArray(args.commands)) args.commands.forEach(fromCommand);
3989
+ const fromShot = (s) => {
3990
+ if (!s || typeof s !== "object") return;
3991
+ for (const key of ["run", "commands"]) {
3992
+ const list = s[key];
3993
+ if (Array.isArray(list)) list.forEach(fromCommand);
3994
+ }
3995
+ };
3996
+ if (Array.isArray(args.run)) args.run.forEach(fromCommand);
3997
+ if (Array.isArray(args.shots)) args.shots.forEach(fromShot);
3998
+ if (Array.isArray(args.ops)) {
3999
+ for (const op of args.ops) {
4000
+ fromShot(op);
4001
+ if (Array.isArray(op?.shots)) op.shots.forEach(fromShot);
4002
+ }
4003
+ }
4004
+ return out.slice(0, 4);
4005
+ }
4006
+ function planAnimationToolPlayback(tool, args) {
4007
+ const steps = [];
4008
+ const shot = str(args.shot) ? args.shot : str(args.id) && /shot/.test(tool) ? args.id : null;
4009
+ if (shot) steps.push({ type: "target", ref: { kind: "shot", id: shot } }, { type: "press" }, { type: "release" });
4010
+ for (const id of elementsOf(args)) steps.push({ type: "target", ref: { kind: "element", id } });
4011
+ return steps.length ? steps : null;
4012
+ }
4013
+ function withAnimationPlayback(provider, surface = "animation") {
4014
+ const plan = (tool) => tool.plan || tool.playback !== void 0 ? tool : { ...tool, plan: (args) => planAnimationToolPlayback(tool.name, args) };
4015
+ const tools = provider.tools;
4016
+ return {
4017
+ ...provider,
4018
+ playbackSurface: provider.playbackSurface ?? surface,
4019
+ tools: typeof tools === "function" ? () => tools().map(plan) : tools.map(plan)
4020
+ };
4021
+ }
4022
+
3975
4023
  // src/animation-editor/tools.ts
3976
4024
  var READ = { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false };
3977
4025
  var WRITE = { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false };
@@ -4998,7 +5046,7 @@ function createAnimationEditorToolProvider(controller, options = {}) {
4998
5046
  const finish = (tools) => tools.map((tool) => ({ ...tool, inputSchema: withDefs(tool.inputSchema) }));
4999
5047
  const reads = finish([getAnimation, getShot, describeCommand, findElements, getTextLayout, getMotionPath, getTimingGrid, checkAnimation, renderFrame, exportFlairMotion, exportFlairEffect, exportLottie, seekAnimation]);
5000
5048
  const writes = finish([setArtworkSvg, importPptx, setDrivers, setClip, copyAnimation, fitAnimation, importFlairEffect, insertShots, updateShot, deleteShots, moveShot, addCommands, updateCommand, deleteCommands, moveCommand, setSettings, setControls, editAnimation, writeAnimation, undo, redo]);
5001
- return {
5049
+ return withAnimationPlayback({
5002
5050
  id: options.id ?? "animation",
5003
5051
  namespace: options.namespace,
5004
5052
  title: "Animation editor",
@@ -5015,7 +5063,7 @@ function createAnimationEditorToolProvider(controller, options = {}) {
5015
5063
  }
5016
5064
  });
5017
5065
  }
5018
- };
5066
+ });
5019
5067
  }
5020
5068
 
5021
5069
  // src/animation-editor/instructions.ts
@@ -5371,7 +5419,7 @@ function createAnimationEffectsToolProvider(controller, options = {}) {
5371
5419
  if (!r.ok) throw new Error(r.error);
5372
5420
  return { target, effect: info(r.effect), effects: controller.appliedEffects().filter((e) => e.targets.includes(target)).map(info), ...r.notes.length ? { notes: r.notes } : {} };
5373
5421
  };
5374
- return createEffectToolProvider({
5422
+ return withAnimationPlayback(createEffectToolProvider({
5375
5423
  id: options.id ?? "animation-effects",
5376
5424
  namespace: options.namespace,
5377
5425
  title: "Animation effects",
@@ -5438,7 +5486,7 @@ function createAnimationEffectsToolProvider(controller, options = {}) {
5438
5486
  }
5439
5487
  }
5440
5488
  ]
5441
- });
5489
+ }));
5442
5490
  }
5443
5491
  export {
5444
5492
  ANIMATION_EDITOR_AGENT_INSTRUCTIONS,
@@ -5577,6 +5625,7 @@ export {
5577
5625
  parseMotionFieldInput,
5578
5626
  parseMotionNarration,
5579
5627
  parseMotionScene,
5628
+ planAnimationToolPlayback,
5580
5629
  resolveMotionCamera,
5581
5630
  resolveMotionEditRefs,
5582
5631
  segmentProgress,
@@ -5590,6 +5639,7 @@ export {
5590
5639
  toFlairVectorEffect,
5591
5640
  toLottie,
5592
5641
  trackValue,
5642
+ withAnimationPlayback,
5593
5643
  withMotionLayers,
5594
5644
  withViewBox,
5595
5645
  withoutMotionEffect
@@ -0,0 +1,10 @@
1
+ import type { AgentToolProvider } from '../tools/registry.cjs';
2
+ import type { PlaybackStep } from '../tools/playback.cjs';
3
+ /** The cursor steps for one animation tool call (by bare name), or null to fall back to the ids it names. */
4
+ export declare function planAnimationToolPlayback(tool: string, args: Record<string, any>): PlaybackStep[] | null;
5
+ /**
6
+ * Gives an animation tool provider agent playback: each tool plans its steps with
7
+ * `planAnimationToolPlayback` and every call plays on `surface` (default `animation`, where
8
+ * `AnimationEditor` attaches itself).
9
+ */
10
+ export declare function withAnimationPlayback(provider: AgentToolProvider, surface?: string): AgentToolProvider;
@@ -0,0 +1,10 @@
1
+ import type { AgentToolProvider } from '../tools/registry.js';
2
+ import type { PlaybackStep } from '../tools/playback.js';
3
+ /** The cursor steps for one animation tool call (by bare name), or null to fall back to the ids it names. */
4
+ export declare function planAnimationToolPlayback(tool: string, args: Record<string, any>): PlaybackStep[] | null;
5
+ /**
6
+ * Gives an animation tool provider agent playback: each tool plans its steps with
7
+ * `planAnimationToolPlayback` and every call plays on `surface` (default `animation`, where
8
+ * `AnimationEditor` attaches itself).
9
+ */
10
+ export declare function withAnimationPlayback(provider: AgentToolProvider, surface?: string): AgentToolProvider;
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict"; function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
3
3
 
4
- var _chunkAGCD3EHBcjs = require('../chunk-AGCD3EHB.cjs');
5
- require('../chunk-HDK3T2QS.cjs');
4
+ var _chunkENIZYNEFcjs = require('../chunk-ENIZYNEF.cjs');
5
+ require('../chunk-Y4BWZB6J.cjs');
6
6
  require('../chunk-2BSBFBOA.cjs');
7
7
  require('../chunk-WOFXZ3XU.cjs');
8
8
 
@@ -23,7 +23,7 @@ args.forEach((arg, i) => {
23
23
  if (arg === "--origin" && args[i + 1]) origins.push(args[i + 1]);
24
24
  });
25
25
  var port = value("--port");
26
- void _chunkAGCD3EHBcjs.createToolBridge.call(void 0, {
26
+ void _chunkENIZYNEFcjs.createToolBridge.call(void 0, {
27
27
  name: _nullishCoalesce(value("--name"), () => ( "pixerate")),
28
28
  port: port !== void 0 ? Number(port) : void 0,
29
29
  token: _nullishCoalesce(value("--token"), () => ( process.env.PIXERATE_BRIDGE_TOKEN)),
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  createToolBridge
4
- } from "../chunk-UMS6YFA6.js";
5
- import "../chunk-RB62U6MS.js";
4
+ } from "../chunk-EAQ4BGNS.js";
5
+ import "../chunk-RFBFTLVN.js";
6
6
  import "../chunk-HF5QZS7Z.js";
7
7
  import "../chunk-V2ZCJRDM.js";
8
8
 
@@ -3,11 +3,11 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkAGCD3EHBcjs = require('../chunk-AGCD3EHB.cjs');
6
+ var _chunkENIZYNEFcjs = require('../chunk-ENIZYNEF.cjs');
7
7
 
8
8
 
9
9
 
10
- var _chunkHDK3T2QScjs = require('../chunk-HDK3T2QS.cjs');
10
+ var _chunkY4BWZB6Jcjs = require('../chunk-Y4BWZB6J.cjs');
11
11
  require('../chunk-2BSBFBOA.cjs');
12
12
  require('../chunk-WOFXZ3XU.cjs');
13
13
 
@@ -17,4 +17,4 @@ require('../chunk-WOFXZ3XU.cjs');
17
17
 
18
18
 
19
19
 
20
- exports.TOOL_BRIDGE_DEFAULT_PORT = _chunkHDK3T2QScjs.TOOL_BRIDGE_DEFAULT_PORT; exports.TOOL_BRIDGE_PROTOCOL = _chunkHDK3T2QScjs.TOOL_BRIDGE_PROTOCOL; exports.createToolBridge = _chunkAGCD3EHBcjs.createToolBridge; exports.defaultSkillsDir = _chunkAGCD3EHBcjs.defaultSkillsDir; exports.isLocalOrigin = _chunkAGCD3EHBcjs.isLocalOrigin; exports.loadSkillFiles = _chunkAGCD3EHBcjs.loadSkillFiles;
20
+ exports.TOOL_BRIDGE_DEFAULT_PORT = _chunkY4BWZB6Jcjs.TOOL_BRIDGE_DEFAULT_PORT; exports.TOOL_BRIDGE_PROTOCOL = _chunkY4BWZB6Jcjs.TOOL_BRIDGE_PROTOCOL; exports.createToolBridge = _chunkENIZYNEFcjs.createToolBridge; exports.defaultSkillsDir = _chunkENIZYNEFcjs.defaultSkillsDir; exports.isLocalOrigin = _chunkENIZYNEFcjs.isLocalOrigin; exports.loadSkillFiles = _chunkENIZYNEFcjs.loadSkillFiles;
@@ -3,11 +3,11 @@ import {
3
3
  defaultSkillsDir,
4
4
  isLocalOrigin,
5
5
  loadSkillFiles
6
- } from "../chunk-UMS6YFA6.js";
6
+ } from "../chunk-EAQ4BGNS.js";
7
7
  import {
8
8
  TOOL_BRIDGE_DEFAULT_PORT,
9
9
  TOOL_BRIDGE_PROTOCOL
10
- } from "../chunk-RB62U6MS.js";
10
+ } from "../chunk-RFBFTLVN.js";
11
11
  import "../chunk-HF5QZS7Z.js";
12
12
  import "../chunk-V2ZCJRDM.js";
13
13
  export {