@pixerate/editor 0.147.0 → 0.149.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 (71) hide show
  1. package/dist/agent/index.cjs +8 -4
  2. package/dist/agent/index.js +6 -2
  3. package/dist/animation-editor/effect-tools.d.cts +5 -0
  4. package/dist/animation-editor/effect-tools.d.ts +5 -0
  5. package/dist/animation-editor/index.cjs +4 -4
  6. package/dist/animation-editor/index.js +4 -4
  7. package/dist/animation-editor/playback.d.cts +3 -2
  8. package/dist/animation-editor/playback.d.ts +3 -2
  9. package/dist/animation-editor/tools.d.cts +5 -0
  10. package/dist/animation-editor/tools.d.ts +5 -0
  11. package/dist/chart/index.cjs +2 -2
  12. package/dist/chart/index.js +2 -2
  13. package/dist/chart/playback.d.cts +2 -2
  14. package/dist/chart/playback.d.ts +2 -2
  15. package/dist/chart/tools.d.cts +5 -0
  16. package/dist/chart/tools.d.ts +5 -0
  17. package/dist/{chunk-HUHBJWTD.js → chunk-3EVMUYF4.js} +16 -0
  18. package/dist/{chunk-D2ENR3LB.cjs → chunk-FR7GHH2K.cjs} +33 -17
  19. package/dist/{chunk-SA37RU2O.js → chunk-OOV64UEB.js} +1 -1
  20. package/dist/{chunk-AG2EXVCR.cjs → chunk-ZCFHPORF.cjs} +2 -2
  21. package/dist/commands/index.cjs +2 -2
  22. package/dist/commands/index.js +1 -1
  23. package/dist/effects/authoring-session.d.cts +25 -0
  24. package/dist/effects/authoring-session.d.ts +25 -0
  25. package/dist/effects/authoring-tools.d.cts +31 -0
  26. package/dist/effects/authoring-tools.d.ts +31 -0
  27. package/dist/effects/authoring.d.cts +152 -0
  28. package/dist/effects/authoring.d.ts +152 -0
  29. package/dist/effects/conformance.d.cts +2 -0
  30. package/dist/effects/conformance.d.ts +2 -0
  31. package/dist/effects/fake.d.cts +2 -0
  32. package/dist/effects/fake.d.ts +2 -0
  33. package/dist/effects/index.cjs +1216 -9
  34. package/dist/effects/index.d.cts +3 -0
  35. package/dist/effects/index.d.ts +3 -0
  36. package/dist/effects/index.js +1210 -3
  37. package/dist/effects/types.d.cts +9 -2
  38. package/dist/effects/types.d.ts +9 -2
  39. package/dist/effects/ui.d.cts +8 -0
  40. package/dist/effects/ui.d.ts +8 -0
  41. package/dist/image-editor/index.cjs +4 -4
  42. package/dist/image-editor/index.js +4 -4
  43. package/dist/image-editor/playback.d.cts +2 -2
  44. package/dist/image-editor/playback.d.ts +2 -2
  45. package/dist/image-editor/provider-effect-tools.d.cts +5 -0
  46. package/dist/image-editor/provider-effect-tools.d.ts +5 -0
  47. package/dist/image-editor/tools.d.cts +5 -0
  48. package/dist/image-editor/tools.d.ts +5 -0
  49. package/dist/paint-editor/effect-tools.d.cts +5 -0
  50. package/dist/paint-editor/effect-tools.d.ts +5 -0
  51. package/dist/paint-editor/index.cjs +3 -3
  52. package/dist/paint-editor/index.js +3 -3
  53. package/dist/paint-editor/playback.d.cts +2 -2
  54. package/dist/paint-editor/playback.d.ts +2 -2
  55. package/dist/paint-editor/tools.d.cts +5 -0
  56. package/dist/paint-editor/tools.d.ts +5 -0
  57. package/dist/tools/index.cjs +7 -3
  58. package/dist/tools/index.js +6 -2
  59. package/dist/tools/playback.d.cts +28 -0
  60. package/dist/tools/playback.d.ts +28 -0
  61. package/dist/video-editor/effect-tools.d.cts +5 -0
  62. package/dist/video-editor/effect-tools.d.ts +5 -0
  63. package/dist/video-editor/index.cjs +4 -4
  64. package/dist/video-editor/index.js +4 -4
  65. package/dist/video-editor/playback.d.cts +3 -2
  66. package/dist/video-editor/playback.d.ts +3 -2
  67. package/dist/video-editor/tools.d.cts +5 -0
  68. package/dist/video-editor/tools.d.ts +5 -0
  69. package/package.json +1 -1
  70. package/skills/README.md +1 -0
  71. package/skills/pixerate-effect-authoring/SKILL.md +80 -0
@@ -14,7 +14,8 @@ export declare function parseVideoTimeRef(ref: PlaybackRef): VideoPlaybackTime |
14
14
  export declare function planVideoToolPlayback(tool: string, args: Record<string, any>): PlaybackStep[] | null;
15
15
  /**
16
16
  * Gives a video tool provider agent playback: each write tool plans its steps with
17
- * `planVideoToolPlayback` and every call plays on `surface` (default `video`, where `VideoTimeline`
18
- * attaches itself). `seek_video` (a read in name only) and `edit_video` (a batch) play too.
17
+ * `planVideoToolPlayback` and every call plays on `surface`. An explicit `surface` wins over the
18
+ * provider's own `playbackSurface`; with neither, it is `video` (where `VideoTimeline` attaches
19
+ * itself). `seek_video` (a read in name only) and `edit_video` (a batch) play too.
19
20
  */
20
21
  export declare function withVideoPlayback(provider: AgentToolProvider, surface?: string): AgentToolProvider;
@@ -29,6 +29,11 @@ export interface VideoEditorToolProviderOptions {
29
29
  framePixels?: (time: number) => VideoPixels | null | Promise<VideoPixels | null>;
30
30
  /** How long `get_video_scopes` waits for the preview to finish drawing a frame (ms, default 5000). */
31
31
  framePixelsTimeout?: number;
32
+ /**
33
+ * The agent playback surface its calls are acted out on (default `video`, where `VideoTimeline` attaches).
34
+ * Set it when one registry holds several editors of this kind, each attached under its own surface id.
35
+ */
36
+ playbackSurface?: string;
32
37
  }
33
38
  /** A sequence as agents see it: its length, the sequences it nests, who plays it, and (with `tracks`) its tracks and clips. */
34
39
  export declare function describeVideoSequence(project: VideoProject, sequence: VideoSequence, tracks?: boolean): {
@@ -29,6 +29,11 @@ export interface VideoEditorToolProviderOptions {
29
29
  framePixels?: (time: number) => VideoPixels | null | Promise<VideoPixels | null>;
30
30
  /** How long `get_video_scopes` waits for the preview to finish drawing a frame (ms, default 5000). */
31
31
  framePixelsTimeout?: number;
32
+ /**
33
+ * The agent playback surface its calls are acted out on (default `video`, where `VideoTimeline` attaches).
34
+ * Set it when one registry holds several editors of this kind, each attached under its own surface id.
35
+ */
36
+ playbackSurface?: string;
32
37
  }
33
38
  /** A sequence as agents see it: its length, the sequences it nests, who plays it, and (with `tracks`) its tracks and clips. */
34
39
  export declare function describeVideoSequence(project: VideoProject, sequence: VideoSequence, tracks?: boolean): {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixerate/editor",
3
- "version": "0.147.0",
3
+ "version": "0.149.0",
4
4
  "description": "UI-agnostic rich text and media editing core library",
5
5
  "author": "Pixerate",
6
6
  "license": "MIT",
package/skills/README.md CHANGED
@@ -20,6 +20,7 @@ that uses the tools can load the matching skill.
20
20
  | [`pixerate-video-editor`](pixerate-video-editor/SKILL.md) | Non-linear video editing: tracks, clips, transitions, export. |
21
21
  | [`pixerate-generation`](pixerate-generation/SKILL.md) | Planning, estimating and running paid media generation. |
22
22
  | [`pixerate-parameters`](pixerate-parameters/SKILL.md) | Effect parameters, presets and keyframes. |
23
+ | [`pixerate-effect-authoring`](pixerate-effect-authoring/SKILL.md) | Authoring shaders and procedural effects: inspecting parameters and source code, setting values and presets, keyframing animation tracks, playback timing, and previewing. |
23
24
  | [`pixerate-color`](pixerate-color/SKILL.md) | Colour inspection, WCAG accessibility and contrast optimization, CVD simulation, palette audits, harmonies, and OKLab/OKLCH blends. |
24
25
 
25
26
  ## Using them
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: pixerate-effect-authoring
3
+ description: How to author and edit procedural effects, shaders, and filters through the effect authoring agent tools - inspecting effect schemas and current control values, reading and compiling shader source code, adjusting parameters with all-or-nothing validation, applying and saving presets, keyframing animation tracks with easing, configuring timeline playback duration and looping, scrubbing the playhead, and capturing visual previews. Use when asked to author, modify, or debug shaders or procedural effects, animate effect parameters over time, or when effect_authoring tools are available.
4
+ ---
5
+
6
+ # Pixerate effect authoring
7
+
8
+ An effect authoring session hosts an active effect definition (shader or procedural filter) and
9
+ exposes its controls, animated tracks, compile status, playback timing, and visual preview.
10
+ Control values can be static or animated via keyframes along a timeline. Each edit creates a
11
+ single undoable history step.
12
+
13
+ When an effect session is opened, tools allow inspecting the control schema, updating control
14
+ values, modifying shader code (for code-backed effects), saving and loading presets, managing
15
+ keyframe animation tracks with interpolation easing, seeking the playhead, and capturing rendered
16
+ preview frames.
17
+
18
+ For general error reporting and undo conventions, see `pixerate-agent-tools`.
19
+
20
+ ## Working method
21
+
22
+ 1. **Inspect first.** Run `effect_authoring_describe` to inspect the effect name, kind, source
23
+ language (`glsl`, `svg`, or null when the effect has no source to edit), control parameter schemas, current
24
+ values, existing tracks, and compile issues.
25
+ 2. **Read or update source code.** If `sourceLanguage` is non-null, use `effect_authoring_get_source`
26
+ to read the shader or script code. Use `effect_authoring_set_source` to recompile with new code
27
+ and immediately inspect any reported syntax or compilation issues with line numbers.
28
+ 3. **Adjust parameters.** Use `effect_authoring_set_values` to set one or more controls at once.
29
+ This runs all-or-nothing validation: any invalid control name or out-of-range value cancels the
30
+ change and returns a helpful error.
31
+ 4. **Animate with keyframes.** For controls that change over time, set keyframes using
32
+ `effect_authoring_set_keyframe` specifying `control`, `time` (ms), optional `value`, and `easing` (a preset name such as `ease-in-out`, or a `cubic-bezier`, `spring` or `elastic` curve object).
33
+ Use `effect_authoring_seek` to move the playhead across the timeline and check resolved values.
34
+ Use `effect_authoring_remove_keyframe` to delete specific points, or `effect_authoring_clear_track`
35
+ to revert a parameter to static behavior (both refuse a control that has no keyframes, and say which controls are animated).
36
+ 5. **Tune timing.** Use `effect_authoring_set_timing` to configure total `duration` in ms and
37
+ whether playback loops.
38
+ 6. **Save presets.** When an interesting look is achieved, save it with `effect_authoring_save_preset`
39
+ or restore known presets with `effect_authoring_apply_preset`.
40
+ 7. **Verify visually.** When `effect_authoring_view` is available, capture rendered preview frames
41
+ at specific times to visually confirm effect appearance.
42
+
43
+ ## Best practices
44
+
45
+ - **Batch parameter changes.** Set all related control values in a single `effect_authoring_set_values`
46
+ call so they apply cleanly in a single undo step.
47
+ - **Check compile issues.** When editing source code via `effect_authoring_set_source`, always verify
48
+ the returned `issues` array. Fix errors before attempting to preview or set controls.
49
+ - **Keyframe animation tracks.** Controls with active keyframes calculate their values dynamically
50
+ based on the playhead time. Setting a value on an animated control at the current playhead updates
51
+ or adds a keyframe at that time.
52
+ - **Safe exploration.** Use `effect_authoring_save_preset` before major shader or parameter
53
+ refactoring, and use `effect_authoring_undo` / `effect_authoring_redo` to step through changes.
54
+
55
+ ## Tools
56
+
57
+ | Tool | Description and usage |
58
+ | --- | --- |
59
+ | `effect_authoring_describe` | Reads the currently open effect session: name, kind, source language, controls schema and current values, presets, animated tracks with keyframe counts, duration, loop, and compile issues. |
60
+ | `effect_authoring_get_source` | Retrieves shader or script source code and language for code-backed effects. Refused if `sourceLanguage` is null. |
61
+ | `effect_authoring_set_source` | Recompiles the effect with new shader or script source code. Returns compiler issues with line numbers and messages. Available only when supported by the session. |
62
+ | `effect_authoring_set_values` | Sets one or more control values at the current playhead time as a single undo step. Rejects all changes if any control name or value is invalid. |
63
+ | `effect_authoring_reset_values` | Resets specified controls (or all controls if omitted) back to their schema defaults in a single undo step. |
64
+ | `effect_authoring_apply_preset` | Applies a built-in or user-saved preset by name, updating current control values in one undo step. |
65
+ | `effect_authoring_save_preset` | Saves the current control values as a user preset under the given name. Replaces an existing preset with the same name. |
66
+ | `effect_authoring_set_keyframe` | Adds or replaces a keyframe on a control track at a specific time in milliseconds, with optional value and easing curve. |
67
+ | `effect_authoring_remove_keyframe` | Deletes a keyframe at the exact millisecond timestamp from a control animation track. |
68
+ | `effect_authoring_clear_track` | Removes all keyframes from an animated control track. The control's value at the playhead becomes its static value. |
69
+ | `effect_authoring_set_timing` | Configures the effect's timeline duration in milliseconds and whether playback loops. |
70
+ | `effect_authoring_seek` | Moves the preview playhead to a specific timeline position in milliseconds (clamped to 0..duration) and returns values at that time. |
71
+ | `effect_authoring_undo` | Undoes the most recent edit in the authoring session. |
72
+ | `effect_authoring_redo` | Redoes the most recently undone edit in the authoring session. |
73
+ | `effect_authoring_view` | Captures a preview image of the effect at the current playhead or a specified timestamp. Available when preview capture is supported. |
74
+
75
+ ## Pitfalls
76
+
77
+ - Calling authoring tools when no authoring session is open returns an error explaining that a session must be opened first.
78
+ - Animated controls calculate their values dynamically from keyframes; clearing a track reverts the parameter to static behavior.
79
+ - Compiling invalid shader code produces issues in `effect_authoring_set_source`; inspect the line numbers and messages to correct syntax.
80
+ - Control values must match their schema types and bounds; colours must be `#rrggbb` (or `#rrggbbaa`), and numbers must fall within `[min, max]`.