@pixerate/editor 0.233.0 → 0.235.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.
Files changed (38) hide show
  1. package/dist/animation-editor/controller.d.cts +25 -0
  2. package/dist/animation-editor/controller.d.ts +25 -0
  3. package/dist/animation-editor/index.cjs +159 -50
  4. package/dist/animation-editor/index.d.cts +1 -0
  5. package/dist/animation-editor/index.d.ts +1 -0
  6. package/dist/animation-editor/index.js +115 -6
  7. package/dist/animation-editor/layers.d.cts +2 -0
  8. package/dist/animation-editor/layers.d.ts +2 -0
  9. package/dist/animation-editor/sequence.d.cts +33 -0
  10. package/dist/animation-editor/sequence.d.ts +33 -0
  11. package/dist/canvas/editorDocument.d.cts +49 -4
  12. package/dist/canvas/editorDocument.d.ts +49 -4
  13. package/dist/canvas/index.cjs +47 -20
  14. package/dist/canvas/index.js +40 -13
  15. package/dist/{chunk-I277KJLQ.js → chunk-G3RUKJ5C.js} +105 -1
  16. package/dist/{chunk-6RZVFYGJ.cjs → chunk-JWCKJNDR.cjs} +105 -1
  17. package/dist/effects/index.cjs +19 -11
  18. package/dist/effects/index.d.cts +1 -0
  19. package/dist/effects/index.d.ts +1 -0
  20. package/dist/effects/index.js +9 -1
  21. package/dist/effects/template-tools.d.cts +25 -0
  22. package/dist/effects/template-tools.d.ts +25 -0
  23. package/dist/effects/templates.d.cts +30 -1
  24. package/dist/effects/templates.d.ts +30 -1
  25. package/dist/video-editor/controller.d.cts +26 -0
  26. package/dist/video-editor/controller.d.ts +26 -0
  27. package/dist/video-editor/index.cjs +187 -42
  28. package/dist/video-editor/index.d.cts +1 -0
  29. package/dist/video-editor/index.d.ts +1 -0
  30. package/dist/video-editor/index.js +145 -0
  31. package/dist/video-editor/sequence.d.cts +38 -0
  32. package/dist/video-editor/sequence.d.ts +38 -0
  33. package/package.json +1 -1
  34. package/skills/pixerate-animation-editor/SKILL.md +10 -0
  35. package/skills/pixerate-animation-motion-graphics/SKILL.md +4 -0
  36. package/skills/pixerate-canvas/SKILL.md +2 -2
  37. package/skills/pixerate-video-editor/SKILL.md +11 -0
  38. package/skills/pixerate-video-montage/SKILL.md +2 -0
@@ -24,7 +24,11 @@ var _chunkA7PQNIBXcjs = require('../chunk-A7PQNIBX.cjs');
24
24
 
25
25
 
26
26
 
27
- var _chunk6RZVFYGJcjs = require('../chunk-6RZVFYGJ.cjs');
27
+
28
+
29
+
30
+
31
+ var _chunkJWCKJNDRcjs = require('../chunk-JWCKJNDR.cjs');
28
32
 
29
33
 
30
34
  var _chunkPY4GWSE2cjs = require('../chunk-PY4GWSE2.cjs');
@@ -223,14 +227,14 @@ function checkSlot(templateId, slot, issues) {
223
227
  if (!slot || typeof slot.name !== "string" || !/^[A-Za-z][\w-]*$/.test(slot.name)) return at('needs a name of letters, digits, "-" and "_", starting with a letter');
224
228
  if (!_chunkJAOSL334cjs.EFFECT_TEMPLATE_SLOT_TYPES.includes(slot.type)) return at(`type "${slot.type}" is not one of ${_chunkJAOSL334cjs.EFFECT_TEMPLATE_SLOT_TYPES.join(", ")}`);
225
229
  if (typeof slot.label !== "string" || !slot.label) at("needs a label");
226
- if (_chunk6RZVFYGJcjs.isSubjectTemplateSlot.call(void 0, slot)) {
230
+ if (_chunkJWCKJNDRcjs.isSubjectTemplateSlot.call(void 0, slot)) {
227
231
  if (typeof slot.hasDefault !== "boolean") at("a subject slot needs hasDefault (a boolean)");
228
232
  if ("default" in slot) at("a subject slot describes hasDefault, not its default");
229
233
  return;
230
234
  }
231
235
  const fallback = slot.default;
232
236
  if (fallback === void 0) return at("needs a default");
233
- const problem = _chunk6RZVFYGJcjs.templateValueProblem.call(void 0, slot, fallback);
237
+ const problem = _chunkJWCKJNDRcjs.templateValueProblem.call(void 0, slot, fallback);
234
238
  if (problem) at(`its default does not fit: ${problem}`);
235
239
  if (slot.type === "number" && slot.min !== void 0 && slot.max !== void 0 && slot.min > slot.max) at("min is above max");
236
240
  }
@@ -276,11 +280,11 @@ async function checkTemplates(provider, list, issues) {
276
280
  const result = await provider.instantiateTemplate(id);
277
281
  if (!result.ok) at(`instantiateTemplate with the defaults failed: ${result.errors.join(" ")}`);
278
282
  else {
279
- for (const p of _chunk6RZVFYGJcjs.checkEffectSequence.call(void 0, result.sequence, list)) at(`with the defaults, ${p}`);
283
+ for (const p of _chunkJWCKJNDRcjs.checkEffectSequence.call(void 0, result.sequence, list)) at(`with the defaults, ${p}`);
280
284
  if (_optionalChain([result, 'access', _15 => _15.sequence, 'optionalAccess', _16 => _16.shots, 'optionalAccess', _17 => _17.length]) !== summary.shots) at(`listTemplates says ${summary.shots} shots; the sequence has ${_optionalChain([result, 'access', _18 => _18.sequence, 'optionalAccess', _19 => _19.shots, 'optionalAccess', _20 => _20.length])}`);
281
285
  if (!Array.isArray(result.openSlots) || !Array.isArray(result.notes)) at("instantiateTemplate needs openSlots and notes lists");
282
286
  else {
283
- const open = Array.isArray(_optionalChain([result, 'access', _21 => _21.sequence, 'optionalAccess', _22 => _22.shots])) ? _chunk6RZVFYGJcjs.effectSequenceSlots.call(void 0, result.sequence) : [];
287
+ const open = Array.isArray(_optionalChain([result, 'access', _21 => _21.sequence, 'optionalAccess', _22 => _22.shots])) ? _chunkJWCKJNDRcjs.effectSequenceSlots.call(void 0, result.sequence) : [];
284
288
  if (open.some((s) => !result.openSlots.includes(s))) at(`openSlots ${JSON.stringify(result.openSlots)} misses slots the sequence leaves open (${open.join(", ")})`);
285
289
  }
286
290
  }
@@ -498,7 +502,7 @@ function fill(t, values) {
498
502
  const slots = new Map(t.slots.map((s) => [s.name, s]));
499
503
  const valueOf = (name) => {
500
504
  const s = slots.get(name);
501
- return _nullishCoalesce(values[name], () => ( (_chunk6RZVFYGJcjs.isSubjectTemplateSlot.call(void 0, s) ? s.subjectDefault : s.default)));
505
+ return _nullishCoalesce(values[name], () => ( (_chunkJWCKJNDRcjs.isSubjectTemplateSlot.call(void 0, s) ? s.subjectDefault : s.default)));
502
506
  };
503
507
  const walk = (v, key) => {
504
508
  if (typeof v === "string") {
@@ -525,16 +529,16 @@ function fakeTemplateMethods() {
525
529
  return t;
526
530
  };
527
531
  return {
528
- listTemplates: (options) => _chunk6RZVFYGJcjs.searchTemplateSummaries.call(void 0, TEMPLATES.map((t) => t.summary), options).map((s) => structuredClone(s)),
532
+ listTemplates: (options) => _chunkJWCKJNDRcjs.searchTemplateSummaries.call(void 0, TEMPLATES.map((t) => t.summary), options).map((s) => structuredClone(s)),
529
533
  describeTemplate: (id) => structuredClone(describeOf(get(id))),
530
534
  instantiateTemplate(id, values = {}, options = {}) {
531
535
  const t = get(id);
532
- const errors = _chunk6RZVFYGJcjs.checkTemplateValues.call(void 0, describeOf(t).slots, values);
533
- if (options.name !== void 0 && (typeof options.name !== "string" || !_chunk6RZVFYGJcjs.EFFECT_SEQUENCE_NAME.test(options.name))) errors.push(`The sequence name is lowercase words and dashes (like "${t.summary.id.replace(/^fake\./, "")}").`);
536
+ const errors = _chunkJWCKJNDRcjs.checkTemplateValues.call(void 0, describeOf(t).slots, values);
537
+ if (options.name !== void 0 && (typeof options.name !== "string" || !_chunkJWCKJNDRcjs.EFFECT_SEQUENCE_NAME.test(options.name))) errors.push(`The sequence name is lowercase words and dashes (like "${t.summary.id.replace(/^fake\./, "")}").`);
534
538
  if (errors.length) return { ok: false, errors };
535
539
  const sequence = fill(t, values);
536
540
  if (options.name) sequence.name = options.name;
537
- return { ok: true, sequence, openSlots: _chunk6RZVFYGJcjs.effectSequenceSlots.call(void 0, sequence), notes: [] };
541
+ return { ok: true, sequence, openSlots: _chunkJWCKJNDRcjs.effectSequenceSlots.call(void 0, sequence), notes: [] };
538
542
  }
539
543
  };
540
544
  }
@@ -1607,4 +1611,8 @@ function createEffectAuthoringToolProvider(host, options) {
1607
1611
 
1608
1612
 
1609
1613
 
1610
- exports.CAMERA_MOVE_MAX_MS = _chunkJAOSL334cjs.CAMERA_MOVE_MAX_MS; exports.CAMERA_MOVE_ROLES = _chunkJAOSL334cjs.CAMERA_MOVE_ROLES; exports.EFFECT_ERROR_CODES = _chunkJAOSL334cjs.EFFECT_ERROR_CODES; exports.EFFECT_KINDS = _chunkJAOSL334cjs.EFFECT_KINDS; exports.EFFECT_LAYER_ROLES = _chunkJAOSL334cjs.EFFECT_LAYER_ROLES; exports.EFFECT_LAYER_USES = _chunk6RZVFYGJcjs.EFFECT_LAYER_USES; exports.EFFECT_SEQUENCE_NAME = _chunk6RZVFYGJcjs.EFFECT_SEQUENCE_NAME; exports.EFFECT_SUBJECT_KINDS = _chunkJAOSL334cjs.EFFECT_SUBJECT_KINDS; exports.EFFECT_TEMPLATE_SLOT_TYPES = _chunkJAOSL334cjs.EFFECT_TEMPLATE_SLOT_TYPES; exports.EFFECT_TRANSITION_MS = _chunkJAOSL334cjs.EFFECT_TRANSITION_MS; exports.EFFECT_USES = _chunkJAOSL334cjs.EFFECT_USES; exports.EFFECT_USE_LABELS = EFFECT_USE_LABELS; exports.EffectControlError = _chunkJAOSL334cjs.EffectControlError; exports.EffectDisposedError = _chunkJAOSL334cjs.EffectDisposedError; exports.EffectError = _chunkJAOSL334cjs.EffectError; exports.EffectRendererPool = _chunkPY4GWSE2cjs.EffectRendererPool; exports.EffectUnsupportedError = _chunkJAOSL334cjs.EffectUnsupportedError; exports.EffectsSlot = _chunkJAOSL334cjs.EffectsSlot; exports.NoEffectsProviderError = _chunkJAOSL334cjs.NoEffectsProviderError; exports.UnknownEffectError = _chunkJAOSL334cjs.UnknownEffectError; exports.UnknownTemplateError = _chunkJAOSL334cjs.UnknownTemplateError; exports.applyEffectMask = _chunkJAOSL334cjs.applyEffectMask; exports.cameraBoxOfView = _chunkJAOSL334cjs.cameraBoxOfView; exports.cameraMoveField = _chunkJAOSL334cjs.cameraMoveField; exports.cameraMoveIdList = _chunkJAOSL334cjs.cameraMoveIdList; exports.cameraMoveParts = _chunkJAOSL334cjs.cameraMoveParts; exports.cameraMovesFor = _chunkJAOSL334cjs.cameraMovesFor; exports.cameraViewOfBox = _chunkJAOSL334cjs.cameraViewOfBox; exports.checkEffectProvider = checkEffectProvider; exports.checkEffectSequence = _chunk6RZVFYGJcjs.checkEffectSequence; exports.checkTemplateValues = _chunk6RZVFYGJcjs.checkTemplateValues; exports.countEffectTags = _chunkJAOSL334cjs.countEffectTags; exports.createEffectAuthoringSession = _chunkA7PQNIBXcjs.createEffectAuthoringSession; exports.createEffectAuthoringToolProvider = createEffectAuthoringToolProvider; exports.createEffectPixels = _chunkJAOSL334cjs.createEffectPixels; exports.createEffectToolProvider = _chunkJAOSL334cjs.createEffectToolProvider; exports.createFakeEffectProvider = createFakeEffectProvider; exports.effectControlField = effectControlField; exports.effectFieldValue = effectFieldValue; exports.effectFontFamilies = effectFontFamilies; exports.effectLayerInput = _chunk6RZVFYGJcjs.effectLayerInput; exports.effectLayerOffered = _chunk6RZVFYGJcjs.effectLayerOffered; exports.effectLayerRole = _chunk6RZVFYGJcjs.effectLayerRole; exports.effectOffered = _chunkJAOSL334cjs.effectOffered; exports.effectParameterFields = effectParameterFields; exports.effectSampleInputs = effectSampleInputs; exports.effectSamplePicture = effectSamplePicture; exports.effectSequenceEffects = _chunk6RZVFYGJcjs.effectSequenceEffects; exports.effectSequenceSlots = _chunk6RZVFYGJcjs.effectSequenceSlots; exports.effectSubjectKind = _chunk6RZVFYGJcjs.effectSubjectKind; exports.effectSubjectProblem = _chunk6RZVFYGJcjs.effectSubjectProblem; exports.effectValueErrors = _chunkJAOSL334cjs.effectValueErrors; exports.encodeEffectFloat = _chunkJAOSL334cjs.encodeEffectFloat; exports.groupEffectsByCategory = groupEffectsByCategory; exports.hasEffectTags = _chunkJAOSL334cjs.hasEffectTags; exports.isCameraView = _chunkJAOSL334cjs.isCameraView; exports.isEffectError = _chunkJAOSL334cjs.isEffectError; exports.isEffectFontControl = isEffectFontControl; exports.isEffectPixels = _chunkJAOSL334cjs.isEffectPixels; exports.isSubjectTemplateSlot = _chunk6RZVFYGJcjs.isSubjectTemplateSlot; exports.linearToSrgb = _chunkJAOSL334cjs.linearToSrgb; exports.normaliseEffectTag = _chunkJAOSL334cjs.normaliseEffectTag; exports.renderEffectThumbnail = renderEffectThumbnail; exports.resolveCameraMoveSpec = _chunkJAOSL334cjs.resolveCameraMoveSpec; exports.resolveEffectValues = _chunkJAOSL334cjs.resolveEffectValues; exports.sampleCameraViews = _chunkJAOSL334cjs.sampleCameraViews; exports.sampleEffectCameraMove = _chunkJAOSL334cjs.sampleEffectCameraMove; exports.searchEffectSummaries = _chunkJAOSL334cjs.searchEffectSummaries; exports.searchTemplateSummaries = _chunk6RZVFYGJcjs.searchTemplateSummaries; exports.srgbToLinear = _chunkJAOSL334cjs.srgbToLinear; exports.templateDefaultValues = _chunk6RZVFYGJcjs.templateDefaultValues; exports.templateSlotSchema = _chunk6RZVFYGJcjs.templateSlotSchema; exports.templateSlotSummary = _chunk6RZVFYGJcjs.templateSlotSummary; exports.templateSlotTakes = _chunk6RZVFYGJcjs.templateSlotTakes; exports.templateValueProblem = _chunk6RZVFYGJcjs.templateValueProblem; exports.templateValuesSchema = _chunk6RZVFYGJcjs.templateValuesSchema;
1614
+
1615
+
1616
+
1617
+
1618
+ exports.CAMERA_MOVE_MAX_MS = _chunkJAOSL334cjs.CAMERA_MOVE_MAX_MS; exports.CAMERA_MOVE_ROLES = _chunkJAOSL334cjs.CAMERA_MOVE_ROLES; exports.EFFECT_ERROR_CODES = _chunkJAOSL334cjs.EFFECT_ERROR_CODES; exports.EFFECT_KINDS = _chunkJAOSL334cjs.EFFECT_KINDS; exports.EFFECT_LAYER_ROLES = _chunkJAOSL334cjs.EFFECT_LAYER_ROLES; exports.EFFECT_LAYER_USES = _chunkJWCKJNDRcjs.EFFECT_LAYER_USES; exports.EFFECT_SEQUENCE_NAME = _chunkJWCKJNDRcjs.EFFECT_SEQUENCE_NAME; exports.EFFECT_SUBJECT_KINDS = _chunkJAOSL334cjs.EFFECT_SUBJECT_KINDS; exports.EFFECT_TEMPLATE_SLOT_TYPES = _chunkJAOSL334cjs.EFFECT_TEMPLATE_SLOT_TYPES; exports.EFFECT_TRANSITION_MS = _chunkJAOSL334cjs.EFFECT_TRANSITION_MS; exports.EFFECT_USES = _chunkJAOSL334cjs.EFFECT_USES; exports.EFFECT_USE_LABELS = EFFECT_USE_LABELS; exports.EffectControlError = _chunkJAOSL334cjs.EffectControlError; exports.EffectDisposedError = _chunkJAOSL334cjs.EffectDisposedError; exports.EffectError = _chunkJAOSL334cjs.EffectError; exports.EffectRendererPool = _chunkPY4GWSE2cjs.EffectRendererPool; exports.EffectUnsupportedError = _chunkJAOSL334cjs.EffectUnsupportedError; exports.EffectsSlot = _chunkJAOSL334cjs.EffectsSlot; exports.NoEffectsProviderError = _chunkJAOSL334cjs.NoEffectsProviderError; exports.UnknownEffectError = _chunkJAOSL334cjs.UnknownEffectError; exports.UnknownTemplateError = _chunkJAOSL334cjs.UnknownTemplateError; exports.applyEffectMask = _chunkJAOSL334cjs.applyEffectMask; exports.cameraBoxOfView = _chunkJAOSL334cjs.cameraBoxOfView; exports.cameraMoveField = _chunkJAOSL334cjs.cameraMoveField; exports.cameraMoveIdList = _chunkJAOSL334cjs.cameraMoveIdList; exports.cameraMoveParts = _chunkJAOSL334cjs.cameraMoveParts; exports.cameraMovesFor = _chunkJAOSL334cjs.cameraMovesFor; exports.cameraViewOfBox = _chunkJAOSL334cjs.cameraViewOfBox; exports.checkEffectProvider = checkEffectProvider; exports.checkEffectSequence = _chunkJWCKJNDRcjs.checkEffectSequence; exports.checkTemplateValues = _chunkJWCKJNDRcjs.checkTemplateValues; exports.countEffectTags = _chunkJAOSL334cjs.countEffectTags; exports.createEffectAuthoringSession = _chunkA7PQNIBXcjs.createEffectAuthoringSession; exports.createEffectAuthoringToolProvider = createEffectAuthoringToolProvider; exports.createEffectPixels = _chunkJAOSL334cjs.createEffectPixels; exports.createEffectToolProvider = _chunkJAOSL334cjs.createEffectToolProvider; exports.createFakeEffectProvider = createFakeEffectProvider; exports.effectControlField = effectControlField; exports.effectFieldValue = effectFieldValue; exports.effectFontFamilies = effectFontFamilies; exports.effectLayerInput = _chunkJWCKJNDRcjs.effectLayerInput; exports.effectLayerOffered = _chunkJWCKJNDRcjs.effectLayerOffered; exports.effectLayerRole = _chunkJWCKJNDRcjs.effectLayerRole; exports.effectLayerSpan = _chunkJWCKJNDRcjs.effectLayerSpan; exports.effectOffered = _chunkJAOSL334cjs.effectOffered; exports.effectParameterFields = effectParameterFields; exports.effectSampleInputs = effectSampleInputs; exports.effectSamplePicture = effectSamplePicture; exports.effectSequenceEffects = _chunkJWCKJNDRcjs.effectSequenceEffects; exports.effectSequenceSlots = _chunkJWCKJNDRcjs.effectSequenceSlots; exports.effectSequenceTiming = _chunkJWCKJNDRcjs.effectSequenceTiming; exports.effectSubjectKind = _chunkJWCKJNDRcjs.effectSubjectKind; exports.effectSubjectProblem = _chunkJWCKJNDRcjs.effectSubjectProblem; exports.effectTemplateTools = _chunkJWCKJNDRcjs.effectTemplateTools; exports.effectValueErrors = _chunkJAOSL334cjs.effectValueErrors; exports.encodeEffectFloat = _chunkJAOSL334cjs.encodeEffectFloat; exports.fillEffectTemplate = _chunkJWCKJNDRcjs.fillEffectTemplate; exports.groupEffectsByCategory = groupEffectsByCategory; exports.hasEffectTags = _chunkJAOSL334cjs.hasEffectTags; exports.isCameraView = _chunkJAOSL334cjs.isCameraView; exports.isEffectError = _chunkJAOSL334cjs.isEffectError; exports.isEffectFontControl = isEffectFontControl; exports.isEffectPixels = _chunkJAOSL334cjs.isEffectPixels; exports.isSubjectTemplateSlot = _chunkJWCKJNDRcjs.isSubjectTemplateSlot; exports.linearToSrgb = _chunkJAOSL334cjs.linearToSrgb; exports.normaliseEffectTag = _chunkJAOSL334cjs.normaliseEffectTag; exports.renderEffectThumbnail = renderEffectThumbnail; exports.resolveCameraMoveSpec = _chunkJAOSL334cjs.resolveCameraMoveSpec; exports.resolveEffectValues = _chunkJAOSL334cjs.resolveEffectValues; exports.sampleCameraViews = _chunkJAOSL334cjs.sampleCameraViews; exports.sampleEffectCameraMove = _chunkJAOSL334cjs.sampleEffectCameraMove; exports.searchEffectSummaries = _chunkJAOSL334cjs.searchEffectSummaries; exports.searchTemplateSummaries = _chunkJWCKJNDRcjs.searchTemplateSummaries; exports.srgbToLinear = _chunkJAOSL334cjs.srgbToLinear; exports.templateDefaultValues = _chunkJWCKJNDRcjs.templateDefaultValues; exports.templateSlotSchema = _chunkJWCKJNDRcjs.templateSlotSchema; exports.templateSlotSummary = _chunkJWCKJNDRcjs.templateSlotSummary; exports.templateSlotTakes = _chunkJWCKJNDRcjs.templateSlotTakes; exports.templateValueProblem = _chunkJWCKJNDRcjs.templateValueProblem; exports.templateValuesSchema = _chunkJWCKJNDRcjs.templateValuesSchema;
@@ -11,6 +11,7 @@ export * from './templates.cjs';
11
11
  export * from './conformance.cjs';
12
12
  export * from './fake.cjs';
13
13
  export * from './tools.cjs';
14
+ export * from './template-tools.cjs';
14
15
  export * from './ui.cjs';
15
16
  export * from './pool.cjs';
16
17
  export * from './authoring.cjs';
@@ -11,6 +11,7 @@ export * from './templates.js';
11
11
  export * from './conformance.js';
12
12
  export * from './fake.js';
13
13
  export * from './tools.js';
14
+ export * from './template-tools.js';
14
15
  export * from './ui.js';
15
16
  export * from './pool.js';
16
17
  export * from './authoring.js';
@@ -12,10 +12,14 @@ import {
12
12
  effectLayerInput,
13
13
  effectLayerOffered,
14
14
  effectLayerRole,
15
+ effectLayerSpan,
15
16
  effectSequenceEffects,
16
17
  effectSequenceSlots,
18
+ effectSequenceTiming,
17
19
  effectSubjectKind,
18
20
  effectSubjectProblem,
21
+ effectTemplateTools,
22
+ fillEffectTemplate,
19
23
  isSubjectTemplateSlot,
20
24
  searchTemplateSummaries,
21
25
  templateDefaultValues,
@@ -24,7 +28,7 @@ import {
24
28
  templateSlotTakes,
25
29
  templateValueProblem,
26
30
  templateValuesSchema
27
- } from "../chunk-I277KJLQ.js";
31
+ } from "../chunk-G3RUKJ5C.js";
28
32
  import {
29
33
  EffectRendererPool
30
34
  } from "../chunk-EHLOCVWB.js";
@@ -1574,16 +1578,20 @@ export {
1574
1578
  effectLayerInput,
1575
1579
  effectLayerOffered,
1576
1580
  effectLayerRole,
1581
+ effectLayerSpan,
1577
1582
  effectOffered,
1578
1583
  effectParameterFields,
1579
1584
  effectSampleInputs,
1580
1585
  effectSamplePicture,
1581
1586
  effectSequenceEffects,
1582
1587
  effectSequenceSlots,
1588
+ effectSequenceTiming,
1583
1589
  effectSubjectKind,
1584
1590
  effectSubjectProblem,
1591
+ effectTemplateTools,
1585
1592
  effectValueErrors,
1586
1593
  encodeEffectFloat,
1594
+ fillEffectTemplate,
1587
1595
  groupEffectsByCategory,
1588
1596
  hasEffectTags,
1589
1597
  isCameraView,
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Agent tools for the provider's sequence templates, shared by the editors that can load an
3
+ * `EffectSequence`: `list_templates`, `describe_template` and `fill_template`. An editor gives
4
+ * them to its effect tool provider (`extraTools`) with an `EffectTemplateToolHost` that says what
5
+ * filling makes there and does it as one undo step.
6
+ */
7
+ import type { AgentTool } from '../tools/registry.cjs';
8
+ import type { JsonSchema } from '../tools/schema.cjs';
9
+ import type { EffectToolContext } from './tools.cjs';
10
+ import type { EffectProvider } from './types.cjs';
11
+ export interface EffectTemplateToolHost {
12
+ /** The current provider, or `null`. */
13
+ provider(): EffectProvider | null;
14
+ /** Added to `fill_template`'s description: what filling makes in this editor and what it returns. */
15
+ fillDetails: string;
16
+ /** Arguments `fill_template` takes in this editor besides `template`, `values` and `name`. */
17
+ fillOptions?: Record<string, JsonSchema>;
18
+ /** Fills the template and loads it as one undo step; returns what it made. Throws a sentence when it cannot. */
19
+ fill(template: string, values: Record<string, unknown>, options: {
20
+ name?: string;
21
+ [option: string]: unknown;
22
+ }): Promise<Record<string, unknown>>;
23
+ }
24
+ /** The template tools (see the module comment). */
25
+ export declare function effectTemplateTools(host: EffectTemplateToolHost, ctx: EffectToolContext): AgentTool[];
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Agent tools for the provider's sequence templates, shared by the editors that can load an
3
+ * `EffectSequence`: `list_templates`, `describe_template` and `fill_template`. An editor gives
4
+ * them to its effect tool provider (`extraTools`) with an `EffectTemplateToolHost` that says what
5
+ * filling makes there and does it as one undo step.
6
+ */
7
+ import type { AgentTool } from '../tools/registry.js';
8
+ import type { JsonSchema } from '../tools/schema.js';
9
+ import type { EffectToolContext } from './tools.js';
10
+ import type { EffectProvider } from './types.js';
11
+ export interface EffectTemplateToolHost {
12
+ /** The current provider, or `null`. */
13
+ provider(): EffectProvider | null;
14
+ /** Added to `fill_template`'s description: what filling makes in this editor and what it returns. */
15
+ fillDetails: string;
16
+ /** Arguments `fill_template` takes in this editor besides `template`, `values` and `name`. */
17
+ fillOptions?: Record<string, JsonSchema>;
18
+ /** Fills the template and loads it as one undo step; returns what it made. Throws a sentence when it cannot. */
19
+ fill(template: string, values: Record<string, unknown>, options: {
20
+ name?: string;
21
+ [option: string]: unknown;
22
+ }): Promise<Record<string, unknown>>;
23
+ }
24
+ /** The template tools (see the module comment). */
25
+ export declare function effectTemplateTools(host: EffectTemplateToolHost, ctx: EffectToolContext): AgentTool[];
@@ -4,7 +4,7 @@
4
4
  * a sequence before loading it, and which input a layer's subject feeds. Dependency-free.
5
5
  */
6
6
  import type { JsonSchema } from '../tools/schema.cjs';
7
- import { type EffectDescription, type EffectLayer, type EffectLayerRole, type EffectSequence, type EffectSubjectKind, type EffectSummary, type EffectTemplateSearchOptions, type EffectTemplateSlot, type EffectTemplateSummary } from './types.cjs';
7
+ import { type EffectDescription, type EffectProvider, type EffectTemplateDescription, type EffectTemplateOptions, type EffectLayer, type EffectLayerRole, type EffectSequence, type EffectSubjectKind, type EffectSummary, type EffectTemplateSearchOptions, type EffectTemplateSlot, type EffectTemplateSummary } from './types.cjs';
8
8
  export declare const EFFECT_SEQUENCE_NAME: RegExp;
9
9
  /** True for a subject slot (`image`, `video`, `svg`). */
10
10
  export declare const isSubjectTemplateSlot: (slot: Pick<EffectTemplateSlot, "type">) => boolean;
@@ -54,3 +54,32 @@ export declare function checkEffectSequence(sequence: unknown, catalog?: readonl
54
54
  export declare function effectSequenceEffects(sequence: EffectSequence): string[];
55
55
  /** Subject slots a sequence leaves for the host (`{ slot }` subjects), each once. */
56
56
  export declare function effectSequenceSlots(sequence: EffectSequence): string[];
57
+ /** A filled template, checked and ready for an editor to load. */
58
+ export interface FilledEffectTemplate {
59
+ template: EffectTemplateDescription;
60
+ sequence: EffectSequence;
61
+ openSlots: string[];
62
+ notes: string[];
63
+ }
64
+ /**
65
+ * Fills a provider template for an editor: checks the provider has templates, checks `values`
66
+ * against the slots first (every problem at once, as sentences), fills it, and checks the
67
+ * sequence against the provider's catalog before anything is loaded. Throws an `Error` whose
68
+ * message says what is wrong and what to call instead; never returns a sequence that names
69
+ * effects the provider does not list.
70
+ */
71
+ export declare function fillEffectTemplate(provider: EffectProvider | null | undefined, id: string, values?: unknown, options?: EffectTemplateOptions): Promise<FilledEffectTemplate>;
72
+ /** Where a layer of a sequence shows, in ms from the sequence's start, given each shot's start and the total length. */
73
+ export declare function effectLayerSpan(layer: Pick<EffectLayer, 'from' | 'until'>, shotIndex: number, shotStarts: readonly number[], total: number): {
74
+ start: number;
75
+ end: number;
76
+ };
77
+ /**
78
+ * When each shot of a sequence starts and how long it all lasts (ms): a shot plays its lead-in (the
79
+ * longer of its transition and its camera move in, when the move says its `ms`) and then holds.
80
+ */
81
+ export declare function effectSequenceTiming(sequence: EffectSequence): {
82
+ starts: number[];
83
+ leadIns: number[];
84
+ total: number;
85
+ };
@@ -4,7 +4,7 @@
4
4
  * a sequence before loading it, and which input a layer's subject feeds. Dependency-free.
5
5
  */
6
6
  import type { JsonSchema } from '../tools/schema.js';
7
- import { type EffectDescription, type EffectLayer, type EffectLayerRole, type EffectSequence, type EffectSubjectKind, type EffectSummary, type EffectTemplateSearchOptions, type EffectTemplateSlot, type EffectTemplateSummary } from './types.js';
7
+ import { type EffectDescription, type EffectProvider, type EffectTemplateDescription, type EffectTemplateOptions, type EffectLayer, type EffectLayerRole, type EffectSequence, type EffectSubjectKind, type EffectSummary, type EffectTemplateSearchOptions, type EffectTemplateSlot, type EffectTemplateSummary } from './types.js';
8
8
  export declare const EFFECT_SEQUENCE_NAME: RegExp;
9
9
  /** True for a subject slot (`image`, `video`, `svg`). */
10
10
  export declare const isSubjectTemplateSlot: (slot: Pick<EffectTemplateSlot, "type">) => boolean;
@@ -54,3 +54,32 @@ export declare function checkEffectSequence(sequence: unknown, catalog?: readonl
54
54
  export declare function effectSequenceEffects(sequence: EffectSequence): string[];
55
55
  /** Subject slots a sequence leaves for the host (`{ slot }` subjects), each once. */
56
56
  export declare function effectSequenceSlots(sequence: EffectSequence): string[];
57
+ /** A filled template, checked and ready for an editor to load. */
58
+ export interface FilledEffectTemplate {
59
+ template: EffectTemplateDescription;
60
+ sequence: EffectSequence;
61
+ openSlots: string[];
62
+ notes: string[];
63
+ }
64
+ /**
65
+ * Fills a provider template for an editor: checks the provider has templates, checks `values`
66
+ * against the slots first (every problem at once, as sentences), fills it, and checks the
67
+ * sequence against the provider's catalog before anything is loaded. Throws an `Error` whose
68
+ * message says what is wrong and what to call instead; never returns a sequence that names
69
+ * effects the provider does not list.
70
+ */
71
+ export declare function fillEffectTemplate(provider: EffectProvider | null | undefined, id: string, values?: unknown, options?: EffectTemplateOptions): Promise<FilledEffectTemplate>;
72
+ /** Where a layer of a sequence shows, in ms from the sequence's start, given each shot's start and the total length. */
73
+ export declare function effectLayerSpan(layer: Pick<EffectLayer, 'from' | 'until'>, shotIndex: number, shotStarts: readonly number[], total: number): {
74
+ start: number;
75
+ end: number;
76
+ };
77
+ /**
78
+ * When each shot of a sequence starts and how long it all lasts (ms): a shot plays its lead-in (the
79
+ * longer of its transition and its camera move in, when the move says its `ms`) and then holds.
80
+ */
81
+ export declare function effectSequenceTiming(sequence: EffectSequence): {
82
+ starts: number[];
83
+ leadIns: number[];
84
+ total: number;
85
+ };
@@ -52,6 +52,22 @@ export interface VideoEditorOptions {
52
52
  }
53
53
  /** What `applyClipEffect` and the other effect edits return: the edit result plus what they made or changed. */
54
54
  /** What setting or clearing a clip's camera move did: its camera now, the keys baked per property, any cuts and when each move plays (clip ms). */
55
+ /** What filling a template did (see `fillTemplate`). */
56
+ export type VideoTemplateResult = {
57
+ ok: true;
58
+ template: string;
59
+ tracks: string[];
60
+ clips: string[];
61
+ assets: string[];
62
+ start: number;
63
+ end: number;
64
+ placeholders: Record<string, string[]>;
65
+ openSlots: string[];
66
+ notes: string[];
67
+ } | {
68
+ ok: false;
69
+ error: string;
70
+ };
55
71
  export type VideoCameraMoveResult = {
56
72
  ok: true;
57
73
  clip: string;
@@ -257,6 +273,16 @@ export declare class VideoEditorController {
257
273
  useEffects(provider: EffectProvider): () => void;
258
274
  /** The provider's description of an effect, checked for `place` (rejects without a provider or for an unknown id). */
259
275
  describeEffect(effect: string, place?: VideoEffectPlace): Promise<EffectDescription>;
276
+ /**
277
+ * Fills a provider sequence template and puts it on the timeline at `at` (default the end), on
278
+ * new tracks above the others (see `videoEditsFromSequence`). Values are checked first and every
279
+ * problem is refused at once. One undo step. Returns the new tracks, clips and assets, where it
280
+ * starts and ends, the placeholder clips standing in for open slots, and notes.
281
+ */
282
+ fillTemplate(template: string, values?: Record<string, unknown>, options?: {
283
+ name?: string;
284
+ at?: number;
285
+ }): Promise<VideoTemplateResult>;
260
286
  private refused;
261
287
  private effectEdit;
262
288
  private clipOrThrow;
@@ -52,6 +52,22 @@ export interface VideoEditorOptions {
52
52
  }
53
53
  /** What `applyClipEffect` and the other effect edits return: the edit result plus what they made or changed. */
54
54
  /** What setting or clearing a clip's camera move did: its camera now, the keys baked per property, any cuts and when each move plays (clip ms). */
55
+ /** What filling a template did (see `fillTemplate`). */
56
+ export type VideoTemplateResult = {
57
+ ok: true;
58
+ template: string;
59
+ tracks: string[];
60
+ clips: string[];
61
+ assets: string[];
62
+ start: number;
63
+ end: number;
64
+ placeholders: Record<string, string[]>;
65
+ openSlots: string[];
66
+ notes: string[];
67
+ } | {
68
+ ok: false;
69
+ error: string;
70
+ };
55
71
  export type VideoCameraMoveResult = {
56
72
  ok: true;
57
73
  clip: string;
@@ -257,6 +273,16 @@ export declare class VideoEditorController {
257
273
  useEffects(provider: EffectProvider): () => void;
258
274
  /** The provider's description of an effect, checked for `place` (rejects without a provider or for an unknown id). */
259
275
  describeEffect(effect: string, place?: VideoEffectPlace): Promise<EffectDescription>;
276
+ /**
277
+ * Fills a provider sequence template and puts it on the timeline at `at` (default the end), on
278
+ * new tracks above the others (see `videoEditsFromSequence`). Values are checked first and every
279
+ * problem is refused at once. One undo step. Returns the new tracks, clips and assets, where it
280
+ * starts and ends, the placeholder clips standing in for open slots, and notes.
281
+ */
282
+ fillTemplate(template: string, values?: Record<string, unknown>, options?: {
283
+ name?: string;
284
+ at?: number;
285
+ }): Promise<VideoTemplateResult>;
260
286
  private refused;
261
287
  private effectEdit;
262
288
  private clipOrThrow;