@pixerate/editor 0.148.0 → 0.150.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 (59) hide show
  1. package/dist/agent/index.cjs +11 -5
  2. package/dist/agent/index.js +9 -3
  3. package/dist/animation/index.cjs +4 -2
  4. package/dist/animation/index.js +3 -1
  5. package/dist/animation-editor/effect-tools.d.cts +5 -0
  6. package/dist/animation-editor/effect-tools.d.ts +5 -0
  7. package/dist/animation-editor/index.cjs +4 -4
  8. package/dist/animation-editor/index.js +4 -4
  9. package/dist/animation-editor/playback.d.cts +3 -2
  10. package/dist/animation-editor/playback.d.ts +3 -2
  11. package/dist/animation-editor/tools.d.cts +5 -0
  12. package/dist/animation-editor/tools.d.ts +5 -0
  13. package/dist/chart/index.cjs +9 -9
  14. package/dist/chart/index.js +3 -3
  15. package/dist/chart/playback.d.cts +2 -2
  16. package/dist/chart/playback.d.ts +2 -2
  17. package/dist/chart/tools.d.cts +5 -0
  18. package/dist/chart/tools.d.ts +5 -0
  19. package/dist/{chunk-HUHBJWTD.js → chunk-6DXDUVSL.js} +17 -1
  20. package/dist/{chunk-AG2EXVCR.cjs → chunk-ERAGQL2N.cjs} +2 -2
  21. package/dist/{chunk-D2ENR3LB.cjs → chunk-GMWNBSBS.cjs} +36 -20
  22. package/dist/{chunk-SA37RU2O.js → chunk-KMU6QJB7.js} +1 -1
  23. package/dist/{chunk-PEEP2YR7.js → chunk-O2ANJFUF.js} +23 -1
  24. package/dist/{chunk-UJGAA6AK.cjs → chunk-SWTUM32H.cjs} +23 -1
  25. package/dist/commands/index.cjs +3 -3
  26. package/dist/commands/index.js +2 -2
  27. package/dist/diagram/index.cjs +7 -7
  28. package/dist/diagram/index.js +1 -1
  29. package/dist/image-editor/index.cjs +29 -5
  30. package/dist/image-editor/index.js +28 -4
  31. package/dist/image-editor/playback.d.cts +22 -3
  32. package/dist/image-editor/playback.d.ts +22 -3
  33. package/dist/image-editor/provider-effect-tools.d.cts +5 -0
  34. package/dist/image-editor/provider-effect-tools.d.ts +5 -0
  35. package/dist/image-editor/tools.d.cts +5 -0
  36. package/dist/image-editor/tools.d.ts +5 -0
  37. package/dist/paint-editor/effect-tools.d.cts +5 -0
  38. package/dist/paint-editor/effect-tools.d.ts +5 -0
  39. package/dist/paint-editor/index.cjs +9 -9
  40. package/dist/paint-editor/index.js +4 -4
  41. package/dist/paint-editor/playback.d.cts +2 -2
  42. package/dist/paint-editor/playback.d.ts +2 -2
  43. package/dist/paint-editor/tools.d.cts +5 -0
  44. package/dist/paint-editor/tools.d.ts +5 -0
  45. package/dist/tools/index.cjs +10 -4
  46. package/dist/tools/index.js +9 -3
  47. package/dist/tools/playback.d.cts +28 -0
  48. package/dist/tools/playback.d.ts +28 -0
  49. package/dist/tools/presence.d.cts +17 -0
  50. package/dist/tools/presence.d.ts +17 -0
  51. package/dist/video-editor/effect-tools.d.cts +5 -0
  52. package/dist/video-editor/effect-tools.d.ts +5 -0
  53. package/dist/video-editor/index.cjs +4 -4
  54. package/dist/video-editor/index.js +4 -4
  55. package/dist/video-editor/playback.d.cts +3 -2
  56. package/dist/video-editor/playback.d.ts +3 -2
  57. package/dist/video-editor/tools.d.cts +5 -0
  58. package/dist/video-editor/tools.d.ts +5 -0
  59. package/package.json +1 -1
@@ -53,7 +53,7 @@ import {
53
53
  PresenceStore,
54
54
  realPresenceClock,
55
55
  tweenPresenceCursor
56
- } from "../chunk-PEEP2YR7.js";
56
+ } from "../chunk-O2ANJFUF.js";
57
57
  import "../chunk-FLOGD3QB.js";
58
58
  import {
59
59
  BRUSH_ID,
@@ -6046,7 +6046,7 @@ function withPaintPlayback(provider, options) {
6046
6046
  const tools = provider.tools;
6047
6047
  return {
6048
6048
  ...provider,
6049
- playbackSurface: provider.playbackSurface ?? options.surface ?? "paint",
6049
+ playbackSurface: options.surface ?? provider.playbackSurface ?? "paint",
6050
6050
  tools: typeof tools === "function" ? () => tools().map(plan) : tools.map(plan)
6051
6051
  };
6052
6052
  }
@@ -7836,7 +7836,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
7836
7836
  description: "Natural-media painting: paper and grain, dry and wet brushes, the brush library, strokes as data, pigment mixing, stencils, guides, layers and export.",
7837
7837
  skill: "pixerate-paint-editor",
7838
7838
  tools
7839
- }, { director: !!options.director });
7839
+ }, { director: !!options.director, surface: options.playbackSurface });
7840
7840
  }
7841
7841
 
7842
7842
  // src/paint-editor/ui.ts
@@ -8554,7 +8554,7 @@ function createPaintEffectsToolProvider(controller, options = {}) {
8554
8554
  }
8555
8555
  }
8556
8556
  ]
8557
- }), { director: false });
8557
+ }), { director: false, surface: options.playbackSurface });
8558
8558
  }
8559
8559
  export {
8560
8560
  BLEND_MENU_GROUPS,
@@ -7,8 +7,8 @@ export declare function paintPlaybackPanel(tool: string): PaintPlaybackPanel | n
7
7
  /** The cursor steps for one paint tool call (by bare name), or null to fall back to the ids it names. */
8
8
  export declare function planPaintToolPlayback(tool: string, _args: Record<string, any>): PlaybackStep[] | null;
9
9
  /**
10
- * Gives a paint tool provider agent playback on `surface` (default `paint`, where `PaintEditor`
11
- * attaches). With a director, strokes, fills and replays play through it (`playback: 'self'`).
10
+ * Gives a paint tool provider agent playback on `surface`. An explicit `surface` wins over the
11
+ * provider's own `playbackSurface`; with neither, it is `paint` (where `PaintEditor` attaches). With a director, strokes, fills and replays play through it (`playback: 'self'`).
12
12
  */
13
13
  export declare function withPaintPlayback(provider: AgentToolProvider, options: {
14
14
  director: boolean;
@@ -7,8 +7,8 @@ export declare function paintPlaybackPanel(tool: string): PaintPlaybackPanel | n
7
7
  /** The cursor steps for one paint tool call (by bare name), or null to fall back to the ids it names. */
8
8
  export declare function planPaintToolPlayback(tool: string, _args: Record<string, any>): PlaybackStep[] | null;
9
9
  /**
10
- * Gives a paint tool provider agent playback on `surface` (default `paint`, where `PaintEditor`
11
- * attaches). With a director, strokes, fills and replays play through it (`playback: 'self'`).
10
+ * Gives a paint tool provider agent playback on `surface`. An explicit `surface` wins over the
11
+ * provider's own `playbackSurface`; with neither, it is `paint` (where `PaintEditor` attaches). With a director, strokes, fills and replays play through it (`playback: 'self'`).
12
12
  */
13
13
  export declare function withPaintPlayback(provider: AgentToolProvider, options: {
14
14
  director: boolean;
@@ -20,6 +20,11 @@ export interface PaintEditorToolProviderOptions {
20
20
  director?: PaintDirector;
21
21
  /** The agent's cursor (default `{ id: 'agent', name: 'Agent' }`). */
22
22
  actor?: PresenceActorInfo;
23
+ /**
24
+ * The agent playback surface its calls are acted out on (default `paint`, where `PaintEditor` attaches).
25
+ * Set it when one registry holds several editors of this kind, each attached under its own surface id.
26
+ */
27
+ playbackSurface?: string;
23
28
  }
24
29
  /** Agent tools for one paint editor. */
25
30
  export declare function createPaintEditorToolProvider(controller: PaintEditorController, options?: PaintEditorToolProviderOptions): AgentToolProvider;
@@ -20,6 +20,11 @@ export interface PaintEditorToolProviderOptions {
20
20
  director?: PaintDirector;
21
21
  /** The agent's cursor (default `{ id: 'agent', name: 'Agent' }`). */
22
22
  actor?: PresenceActorInfo;
23
+ /**
24
+ * The agent playback surface its calls are acted out on (default `paint`, where `PaintEditor` attaches).
25
+ * Set it when one registry holds several editors of this kind, each attached under its own surface id.
26
+ */
27
+ playbackSurface?: string;
23
28
  }
24
29
  /** Agent tools for one paint editor. */
25
30
  export declare function createPaintEditorToolProvider(controller: PaintEditorController, options?: PaintEditorToolProviderOptions): AgentToolProvider;
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkAG2EXVCRcjs = require('../chunk-AG2EXVCR.cjs');
5
+ var _chunkERAGQL2Ncjs = require('../chunk-ERAGQL2N.cjs');
6
6
 
7
7
 
8
8
 
@@ -38,7 +38,9 @@ var _chunkY4BWZB6Jcjs = require('../chunk-Y4BWZB6J.cjs');
38
38
 
39
39
 
40
40
 
41
- var _chunkD2ENR3LBcjs = require('../chunk-D2ENR3LB.cjs');
41
+
42
+
43
+ var _chunkGMWNBSBScjs = require('../chunk-GMWNBSBS.cjs');
42
44
 
43
45
 
44
46
 
@@ -88,7 +90,8 @@ var _chunk2BSBFBOAcjs = require('../chunk-2BSBFBOA.cjs');
88
90
 
89
91
 
90
92
 
91
- var _chunkUJGAA6AKcjs = require('../chunk-UJGAA6AK.cjs');
93
+
94
+ var _chunkSWTUM32Hcjs = require('../chunk-SWTUM32H.cjs');
92
95
 
93
96
 
94
97
  var _chunkWOFXZ3XUcjs = require('../chunk-WOFXZ3XU.cjs');
@@ -171,4 +174,7 @@ var _chunkWOFXZ3XUcjs = require('../chunk-WOFXZ3XU.cjs');
171
174
 
172
175
 
173
176
 
174
- exports.AgentPlayback = _chunkD2ENR3LBcjs.AgentPlayback; exports.CAPTURE_EXCLUDE_SELECTOR = _chunkSVFEVKLFcjs.CAPTURE_EXCLUDE_SELECTOR; exports.CAPTURE_OVERLAY_SELECTORS = _chunkSVFEVKLFcjs.CAPTURE_OVERLAY_SELECTORS; exports.EDITOR_CANVAS_TOOLS = _chunkSVFEVKLFcjs.EDITOR_CANVAS_TOOLS; exports.EDITOR_MCP_TOOLS = _chunkSVFEVKLFcjs.EDITOR_MCP_TOOLS; exports.EDITOR_PROMPT_TOOLS = _chunkSVFEVKLFcjs.EDITOR_PROMPT_TOOLS; exports.EDIT_OPERATION_REQUIRED_ARGUMENTS = _chunkSVFEVKLFcjs.EDIT_OPERATION_REQUIRED_ARGUMENTS; exports.EXPORT_EXCLUDED_SELECTORS = _chunkSVFEVKLFcjs.EXPORT_EXCLUDED_SELECTORS; exports.JSON_RPC_ERRORS = _chunkY4BWZB6Jcjs.JSON_RPC_ERRORS; exports.MCP_PROTOCOL_VERSIONS = _chunkY4BWZB6Jcjs.MCP_PROTOCOL_VERSIONS; exports.MCP_TOOL_CANVAS_ADD_NODE = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_ADD_NODE; exports.MCP_TOOL_CANVAS_CONNECT = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_CONNECT; exports.MCP_TOOL_CANVAS_HIGHLIGHT = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_HIGHLIGHT; exports.MCP_TOOL_CANVAS_LAYOUT = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_LAYOUT; exports.MCP_TOOL_CANVAS_REMOVE_NODES = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_REMOVE_NODES; exports.MCP_TOOL_CANVAS_SELECT = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_SELECT; exports.MCP_TOOL_CANVAS_UPDATE_NODE = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_UPDATE_NODE; exports.MCP_TOOL_EDIT_CANVAS = _chunkSVFEVKLFcjs.MCP_TOOL_EDIT_CANVAS; exports.MCP_TOOL_EDIT_PROMPT = _chunkSVFEVKLFcjs.MCP_TOOL_EDIT_PROMPT; exports.MCP_TOOL_GET_EDITOR_STATE = _chunkSVFEVKLFcjs.MCP_TOOL_GET_EDITOR_STATE; exports.MCP_TOOL_PROMPT_INSERT_TEXT = _chunkSVFEVKLFcjs.MCP_TOOL_PROMPT_INSERT_TEXT; exports.MCP_TOOL_PROMPT_REPLACE_RANGE = _chunkSVFEVKLFcjs.MCP_TOOL_PROMPT_REPLACE_RANGE; exports.MCP_TOOL_PROMPT_SELECT = _chunkSVFEVKLFcjs.MCP_TOOL_PROMPT_SELECT; exports.MCP_TOOL_PROMPT_SET_VARIABLE = _chunkSVFEVKLFcjs.MCP_TOOL_PROMPT_SET_VARIABLE; exports.MCP_TOOL_VIEW_EDITOR = _chunkSVFEVKLFcjs.MCP_TOOL_VIEW_EDITOR; exports.PRESENCE_COLORS = _chunkUJGAA6AKcjs.PRESENCE_COLORS; exports.PerformanceQueue = _chunkUJGAA6AKcjs.PerformanceQueue; exports.PresenceStore = _chunkUJGAA6AKcjs.PresenceStore; exports.TOOL_BRIDGE_DEFAULT_PORT = _chunkY4BWZB6Jcjs.TOOL_BRIDGE_DEFAULT_PORT; exports.TOOL_BRIDGE_PROTOCOL = _chunkY4BWZB6Jcjs.TOOL_BRIDGE_PROTOCOL; exports.TOOL_DISCOVERY_TOOLS = _chunkY4BWZB6Jcjs.TOOL_DISCOVERY_TOOLS; exports.TOOL_NAMESPACE_SEPARATOR = _chunkY4BWZB6Jcjs.TOOL_NAMESPACE_SEPARATOR; exports.ToolRegistry = _chunkY4BWZB6Jcjs.ToolRegistry; exports.ToolRegistryError = _chunkY4BWZB6Jcjs.ToolRegistryError; exports.ToolRegistryView = _chunkY4BWZB6Jcjs.ToolRegistryView; exports.UNSAFE_JSON_KEYS = _chunk2BSBFBOAcjs.UNSAFE_JSON_KEYS; exports.baseToolName = _chunkY4BWZB6Jcjs.baseToolName; exports.captureInputSchema = _chunkN2FGYZ4Qcjs.captureInputSchema; exports.captureOutputSize = _chunkN2FGYZ4Qcjs.captureOutputSize; exports.cloneElementWithStyles = _chunkSVFEVKLFcjs.cloneElementWithStyles; exports.connectToolBridge = _chunkY4BWZB6Jcjs.connectToolBridge; exports.createAgentPlayback = _chunkD2ENR3LBcjs.createAgentPlayback; exports.createCaptureTool = _chunkN2FGYZ4Qcjs.createCaptureTool; exports.createCaptureToolProvider = _chunkN2FGYZ4Qcjs.createCaptureToolProvider; exports.createElementCaptureSurface = _chunkSVFEVKLFcjs.createElementCaptureSurface; exports.createInstantPresenceClock = _chunkUJGAA6AKcjs.createInstantPresenceClock; exports.createMcpServer = _chunkY4BWZB6Jcjs.createMcpServer; exports.createPlaybackToolProvider = _chunkD2ENR3LBcjs.createPlaybackToolProvider; exports.createToolRegistry = _chunkY4BWZB6Jcjs.createToolRegistry; exports.derivePlaybackSteps = _chunkD2ENR3LBcjs.derivePlaybackSteps; exports.elementToSvg = _chunkSVFEVKLFcjs.elementToSvg; exports.errorResult = _chunkY4BWZB6Jcjs.errorResult; exports.isUnsafeJsonKey = _chunk2BSBFBOAcjs.isUnsafeJsonKey; exports.listSkills = _chunkY4BWZB6Jcjs.listSkills; exports.parseSkillFrontmatter = _chunkY4BWZB6Jcjs.parseSkillFrontmatter; exports.playbackRefsFromArgs = _chunkD2ENR3LBcjs.playbackRefsFromArgs; exports.playbackRefsFromResult = _chunkD2ENR3LBcjs.playbackRefsFromResult; exports.rasterizeElement = _chunkSVFEVKLFcjs.rasterizeElement; exports.readSkillFile = _chunkY4BWZB6Jcjs.readSkillFile; exports.readingTime = _chunkD2ENR3LBcjs.readingTime; exports.realPresenceClock = _chunkUJGAA6AKcjs.realPresenceClock; exports.resolveCaptureRequest = _chunkN2FGYZ4Qcjs.resolveCaptureRequest; exports.runToolScript = _chunkAG2EXVCRcjs.runToolScript; exports.searchTokens = _chunkY4BWZB6Jcjs.searchTokens; exports.searchTools = _chunkY4BWZB6Jcjs.searchTools; exports.stripPrototypeKeys = _chunk2BSBFBOAcjs.stripPrototypeKeys; exports.summarize = _chunkY4BWZB6Jcjs.summarize; exports.toCapturedImageData = _chunkN2FGYZ4Qcjs.toCapturedImageData; exports.toToolResult = _chunkY4BWZB6Jcjs.toToolResult; exports.toolResultError = _chunkAG2EXVCRcjs.toolResultError; exports.toolResultValue = _chunkAG2EXVCRcjs.toolResultValue; exports.toolsetInstructions = _chunkY4BWZB6Jcjs.toolsetInstructions; exports.toolsetName = _chunkY4BWZB6Jcjs.toolsetName; exports.tweenPresenceCursor = _chunkUJGAA6AKcjs.tweenPresenceCursor; exports.unionCaptureRects = _chunkN2FGYZ4Qcjs.unionCaptureRects; exports.unionRects = _chunkD2ENR3LBcjs.unionRects; exports.unknownToolMessage = _chunkY4BWZB6Jcjs.unknownToolMessage; exports.validateJsonSchema = _chunkWOFXZ3XUcjs.validateJsonSchema;
177
+
178
+
179
+
180
+ exports.AgentPlayback = _chunkGMWNBSBScjs.AgentPlayback; exports.CAPTURE_EXCLUDE_SELECTOR = _chunkSVFEVKLFcjs.CAPTURE_EXCLUDE_SELECTOR; exports.CAPTURE_OVERLAY_SELECTORS = _chunkSVFEVKLFcjs.CAPTURE_OVERLAY_SELECTORS; exports.EDITOR_CANVAS_TOOLS = _chunkSVFEVKLFcjs.EDITOR_CANVAS_TOOLS; exports.EDITOR_MCP_TOOLS = _chunkSVFEVKLFcjs.EDITOR_MCP_TOOLS; exports.EDITOR_PROMPT_TOOLS = _chunkSVFEVKLFcjs.EDITOR_PROMPT_TOOLS; exports.EDIT_OPERATION_REQUIRED_ARGUMENTS = _chunkSVFEVKLFcjs.EDIT_OPERATION_REQUIRED_ARGUMENTS; exports.EXPORT_EXCLUDED_SELECTORS = _chunkSVFEVKLFcjs.EXPORT_EXCLUDED_SELECTORS; exports.JSON_RPC_ERRORS = _chunkY4BWZB6Jcjs.JSON_RPC_ERRORS; exports.MCP_PROTOCOL_VERSIONS = _chunkY4BWZB6Jcjs.MCP_PROTOCOL_VERSIONS; exports.MCP_TOOL_CANVAS_ADD_NODE = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_ADD_NODE; exports.MCP_TOOL_CANVAS_CONNECT = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_CONNECT; exports.MCP_TOOL_CANVAS_HIGHLIGHT = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_HIGHLIGHT; exports.MCP_TOOL_CANVAS_LAYOUT = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_LAYOUT; exports.MCP_TOOL_CANVAS_REMOVE_NODES = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_REMOVE_NODES; exports.MCP_TOOL_CANVAS_SELECT = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_SELECT; exports.MCP_TOOL_CANVAS_UPDATE_NODE = _chunkSVFEVKLFcjs.MCP_TOOL_CANVAS_UPDATE_NODE; exports.MCP_TOOL_EDIT_CANVAS = _chunkSVFEVKLFcjs.MCP_TOOL_EDIT_CANVAS; exports.MCP_TOOL_EDIT_PROMPT = _chunkSVFEVKLFcjs.MCP_TOOL_EDIT_PROMPT; exports.MCP_TOOL_GET_EDITOR_STATE = _chunkSVFEVKLFcjs.MCP_TOOL_GET_EDITOR_STATE; exports.MCP_TOOL_PROMPT_INSERT_TEXT = _chunkSVFEVKLFcjs.MCP_TOOL_PROMPT_INSERT_TEXT; exports.MCP_TOOL_PROMPT_REPLACE_RANGE = _chunkSVFEVKLFcjs.MCP_TOOL_PROMPT_REPLACE_RANGE; exports.MCP_TOOL_PROMPT_SELECT = _chunkSVFEVKLFcjs.MCP_TOOL_PROMPT_SELECT; exports.MCP_TOOL_PROMPT_SET_VARIABLE = _chunkSVFEVKLFcjs.MCP_TOOL_PROMPT_SET_VARIABLE; exports.MCP_TOOL_VIEW_EDITOR = _chunkSVFEVKLFcjs.MCP_TOOL_VIEW_EDITOR; exports.PRESENCE_COLORS = _chunkSWTUM32Hcjs.PRESENCE_COLORS; exports.PerformanceQueue = _chunkSWTUM32Hcjs.PerformanceQueue; exports.PresenceStore = _chunkSWTUM32Hcjs.PresenceStore; exports.TOOL_BRIDGE_DEFAULT_PORT = _chunkY4BWZB6Jcjs.TOOL_BRIDGE_DEFAULT_PORT; exports.TOOL_BRIDGE_PROTOCOL = _chunkY4BWZB6Jcjs.TOOL_BRIDGE_PROTOCOL; exports.TOOL_DISCOVERY_TOOLS = _chunkY4BWZB6Jcjs.TOOL_DISCOVERY_TOOLS; exports.TOOL_NAMESPACE_SEPARATOR = _chunkY4BWZB6Jcjs.TOOL_NAMESPACE_SEPARATOR; exports.ToolRegistry = _chunkY4BWZB6Jcjs.ToolRegistry; exports.ToolRegistryError = _chunkY4BWZB6Jcjs.ToolRegistryError; exports.ToolRegistryView = _chunkY4BWZB6Jcjs.ToolRegistryView; exports.UNSAFE_JSON_KEYS = _chunk2BSBFBOAcjs.UNSAFE_JSON_KEYS; exports.baseToolName = _chunkY4BWZB6Jcjs.baseToolName; exports.captureInputSchema = _chunkN2FGYZ4Qcjs.captureInputSchema; exports.captureOutputSize = _chunkN2FGYZ4Qcjs.captureOutputSize; exports.cloneElementWithStyles = _chunkSVFEVKLFcjs.cloneElementWithStyles; exports.connectToolBridge = _chunkY4BWZB6Jcjs.connectToolBridge; exports.createAgentPlayback = _chunkGMWNBSBScjs.createAgentPlayback; exports.createCaptureTool = _chunkN2FGYZ4Qcjs.createCaptureTool; exports.createCaptureToolProvider = _chunkN2FGYZ4Qcjs.createCaptureToolProvider; exports.createElementCaptureSurface = _chunkSVFEVKLFcjs.createElementCaptureSurface; exports.createInstantPresenceClock = _chunkSWTUM32Hcjs.createInstantPresenceClock; exports.createMcpServer = _chunkY4BWZB6Jcjs.createMcpServer; exports.createPlaybackToolProvider = _chunkGMWNBSBScjs.createPlaybackToolProvider; exports.createToolRegistry = _chunkY4BWZB6Jcjs.createToolRegistry; exports.derivePlaybackSteps = _chunkGMWNBSBScjs.derivePlaybackSteps; exports.elementToSvg = _chunkSVFEVKLFcjs.elementToSvg; exports.errorResult = _chunkY4BWZB6Jcjs.errorResult; exports.isUnsafeJsonKey = _chunk2BSBFBOAcjs.isUnsafeJsonKey; exports.listSkills = _chunkY4BWZB6Jcjs.listSkills; exports.locatePlaybackChrome = _chunkGMWNBSBScjs.locatePlaybackChrome; exports.parseSkillFrontmatter = _chunkY4BWZB6Jcjs.parseSkillFrontmatter; exports.playbackRectFromClient = _chunkGMWNBSBScjs.playbackRectFromClient; exports.playbackRefsFromArgs = _chunkGMWNBSBScjs.playbackRefsFromArgs; exports.playbackRefsFromResult = _chunkGMWNBSBScjs.playbackRefsFromResult; exports.rasterizeElement = _chunkSVFEVKLFcjs.rasterizeElement; exports.readSkillFile = _chunkY4BWZB6Jcjs.readSkillFile; exports.readingTime = _chunkGMWNBSBScjs.readingTime; exports.realPresenceClock = _chunkSWTUM32Hcjs.realPresenceClock; exports.resolveCaptureRequest = _chunkN2FGYZ4Qcjs.resolveCaptureRequest; exports.runToolScript = _chunkERAGQL2Ncjs.runToolScript; exports.searchTokens = _chunkY4BWZB6Jcjs.searchTokens; exports.searchTools = _chunkY4BWZB6Jcjs.searchTools; exports.stripPrototypeKeys = _chunk2BSBFBOAcjs.stripPrototypeKeys; exports.summarize = _chunkY4BWZB6Jcjs.summarize; exports.toCapturedImageData = _chunkN2FGYZ4Qcjs.toCapturedImageData; exports.toToolResult = _chunkY4BWZB6Jcjs.toToolResult; exports.toolResultError = _chunkERAGQL2Ncjs.toolResultError; exports.toolResultValue = _chunkERAGQL2Ncjs.toolResultValue; exports.toolsetInstructions = _chunkY4BWZB6Jcjs.toolsetInstructions; exports.toolsetName = _chunkY4BWZB6Jcjs.toolsetName; exports.trackPresenceDrag = _chunkSWTUM32Hcjs.trackPresenceDrag; exports.tweenPresenceCursor = _chunkSWTUM32Hcjs.tweenPresenceCursor; exports.unionCaptureRects = _chunkN2FGYZ4Qcjs.unionCaptureRects; exports.unionRects = _chunkGMWNBSBScjs.unionRects; exports.unknownToolMessage = _chunkY4BWZB6Jcjs.unknownToolMessage; exports.validateJsonSchema = _chunkWOFXZ3XUcjs.validateJsonSchema;
@@ -2,7 +2,7 @@ import {
2
2
  runToolScript,
3
3
  toolResultError,
4
4
  toolResultValue
5
- } from "../chunk-SA37RU2O.js";
5
+ } from "../chunk-KMU6QJB7.js";
6
6
  import {
7
7
  JSON_RPC_ERRORS,
8
8
  MCP_PROTOCOL_VERSIONS,
@@ -34,11 +34,13 @@ import {
34
34
  createAgentPlayback,
35
35
  createPlaybackToolProvider,
36
36
  derivePlaybackSteps,
37
+ locatePlaybackChrome,
38
+ playbackRectFromClient,
37
39
  playbackRefsFromArgs,
38
40
  playbackRefsFromResult,
39
41
  readingTime,
40
42
  unionRects
41
- } from "../chunk-HUHBJWTD.js";
43
+ } from "../chunk-6DXDUVSL.js";
42
44
  import {
43
45
  CAPTURE_EXCLUDE_SELECTOR,
44
46
  CAPTURE_OVERLAY_SELECTORS,
@@ -87,8 +89,9 @@ import {
87
89
  PresenceStore,
88
90
  createInstantPresenceClock,
89
91
  realPresenceClock,
92
+ trackPresenceDrag,
90
93
  tweenPresenceCursor
91
- } from "../chunk-PEEP2YR7.js";
94
+ } from "../chunk-O2ANJFUF.js";
92
95
  import {
93
96
  validateJsonSchema
94
97
  } from "../chunk-V2ZCJRDM.js";
@@ -147,7 +150,9 @@ export {
147
150
  errorResult,
148
151
  isUnsafeJsonKey,
149
152
  listSkills,
153
+ locatePlaybackChrome,
150
154
  parseSkillFrontmatter,
155
+ playbackRectFromClient,
151
156
  playbackRefsFromArgs,
152
157
  playbackRefsFromResult,
153
158
  rasterizeElement,
@@ -166,6 +171,7 @@ export {
166
171
  toolResultValue,
167
172
  toolsetInstructions,
168
173
  toolsetName,
174
+ trackPresenceDrag,
169
175
  tweenPresenceCursor,
170
176
  unionCaptureRects,
171
177
  unionRects,
@@ -150,6 +150,34 @@ export declare function derivePlaybackSteps(args: unknown, defaultKind?: string)
150
150
  export declare function readingTime(text: string): number;
151
151
  /** Smallest rectangle around `rects`, or null. */
152
152
  export declare function unionRects(rects: readonly (PlaybackRect | null | undefined)[]): PlaybackRect | null;
153
+ /** A box in client (viewport) pixels, as `Element.getBoundingClientRect()` returns it. */
154
+ export interface PlaybackClientRect {
155
+ left: number;
156
+ top: number;
157
+ width: number;
158
+ height: number;
159
+ }
160
+ /**
161
+ * A client-pixel box (e.g. `element.getBoundingClientRect()`) in a surface's coordinates, through
162
+ * its `fromViewport` (identity without one). Null for an empty box (a hidden element).
163
+ */
164
+ export declare function playbackRectFromClient(rect: PlaybackClientRect | null | undefined, fromViewport?: (point: PlaybackPoint) => PlaybackPoint): PlaybackRect | null;
165
+ /**
166
+ * How a host's own chrome (a HUD, toolbar or panel over or beside an editor) answers a surface's
167
+ * refs. The canvas and element playback surfaces take these options; their own locator runs first.
168
+ */
169
+ export interface PlaybackChromeOptions {
170
+ /** Where `ref` is, in the surface's coordinates (flow units on a canvas, element pixels on an element surface), or null. */
171
+ locate?(ref: PlaybackRef): PlaybackRect | null;
172
+ /** The element that shows `ref` anywhere on the page, or null; its client box is mapped to surface coordinates. */
173
+ locateElement?(ref: PlaybackRef): {
174
+ getBoundingClientRect(): PlaybackClientRect;
175
+ } | null;
176
+ /** Show `ref` for an `open` step (switch to a tab, expand a panel). Without it, `open` steps are skipped. */
177
+ open?(ref: PlaybackRef): void | Promise<void>;
178
+ }
179
+ /** Finds `ref` through `chrome.locate`, then `chrome.locateElement` (mapped with `fromViewport`), or null. */
180
+ export declare function locatePlaybackChrome(ref: PlaybackRef, chrome: PlaybackChromeOptions | null | undefined, fromViewport?: (point: PlaybackPoint) => PlaybackPoint): PlaybackRect | null;
153
181
  /**
154
182
  * Acts out tool calls on attached surfaces. Install it on a registry (`registry.use(playback.middleware)`
155
183
  * or `playback.install(registry)`); editors attach their surfaces while mounted. Results never change:
@@ -150,6 +150,34 @@ export declare function derivePlaybackSteps(args: unknown, defaultKind?: string)
150
150
  export declare function readingTime(text: string): number;
151
151
  /** Smallest rectangle around `rects`, or null. */
152
152
  export declare function unionRects(rects: readonly (PlaybackRect | null | undefined)[]): PlaybackRect | null;
153
+ /** A box in client (viewport) pixels, as `Element.getBoundingClientRect()` returns it. */
154
+ export interface PlaybackClientRect {
155
+ left: number;
156
+ top: number;
157
+ width: number;
158
+ height: number;
159
+ }
160
+ /**
161
+ * A client-pixel box (e.g. `element.getBoundingClientRect()`) in a surface's coordinates, through
162
+ * its `fromViewport` (identity without one). Null for an empty box (a hidden element).
163
+ */
164
+ export declare function playbackRectFromClient(rect: PlaybackClientRect | null | undefined, fromViewport?: (point: PlaybackPoint) => PlaybackPoint): PlaybackRect | null;
165
+ /**
166
+ * How a host's own chrome (a HUD, toolbar or panel over or beside an editor) answers a surface's
167
+ * refs. The canvas and element playback surfaces take these options; their own locator runs first.
168
+ */
169
+ export interface PlaybackChromeOptions {
170
+ /** Where `ref` is, in the surface's coordinates (flow units on a canvas, element pixels on an element surface), or null. */
171
+ locate?(ref: PlaybackRef): PlaybackRect | null;
172
+ /** The element that shows `ref` anywhere on the page, or null; its client box is mapped to surface coordinates. */
173
+ locateElement?(ref: PlaybackRef): {
174
+ getBoundingClientRect(): PlaybackClientRect;
175
+ } | null;
176
+ /** Show `ref` for an `open` step (switch to a tab, expand a panel). Without it, `open` steps are skipped. */
177
+ open?(ref: PlaybackRef): void | Promise<void>;
178
+ }
179
+ /** Finds `ref` through `chrome.locate`, then `chrome.locateElement` (mapped with `fromViewport`), or null. */
180
+ export declare function locatePlaybackChrome(ref: PlaybackRef, chrome: PlaybackChromeOptions | null | undefined, fromViewport?: (point: PlaybackPoint) => PlaybackPoint): PlaybackRect | null;
153
181
  /**
154
182
  * Acts out tool calls on attached surfaces. Install it on a registry (`registry.use(playback.middleware)`
155
183
  * or `playback.install(registry)`); editors attach their surfaces while mounted. Results never change:
@@ -80,3 +80,20 @@ export declare class PerformanceQueue {
80
80
  constructor(presence: PresenceStore, options: PerformanceQueueOptions);
81
81
  run<T>(actor: PresenceActorInfo, perform: () => Promise<T>): Promise<T>;
82
82
  }
83
+ /** A box from where an agent's button went down to its cursor, in surface coordinates. */
84
+ export interface PresenceDragBox {
85
+ x: number;
86
+ y: number;
87
+ width: number;
88
+ height: number;
89
+ }
90
+ /**
91
+ * Follows a presence store for an agent's drag (press, move, release) and reports the box from
92
+ * the press to the cursor, so a surface can draw its own drag feedback (a crop box or a marquee
93
+ * being pulled out) under the agent's cursor. `onEnd` runs on release, or when the cursor leaves
94
+ * the surface mid-drag. Pass the result to `PresenceStore.subscribe`.
95
+ */
96
+ export declare function trackPresenceDrag(handlers: {
97
+ onDrag: (box: PresenceDragBox) => void;
98
+ onEnd: () => void;
99
+ }): (state: PresenceState) => void;
@@ -80,3 +80,20 @@ export declare class PerformanceQueue {
80
80
  constructor(presence: PresenceStore, options: PerformanceQueueOptions);
81
81
  run<T>(actor: PresenceActorInfo, perform: () => Promise<T>): Promise<T>;
82
82
  }
83
+ /** A box from where an agent's button went down to its cursor, in surface coordinates. */
84
+ export interface PresenceDragBox {
85
+ x: number;
86
+ y: number;
87
+ width: number;
88
+ height: number;
89
+ }
90
+ /**
91
+ * Follows a presence store for an agent's drag (press, move, release) and reports the box from
92
+ * the press to the cursor, so a surface can draw its own drag feedback (a crop box or a marquee
93
+ * being pulled out) under the agent's cursor. `onEnd` runs on release, or when the cursor leaves
94
+ * the surface mid-drag. Pass the result to `PresenceStore.subscribe`.
95
+ */
96
+ export declare function trackPresenceDrag(handlers: {
97
+ onDrag: (box: PresenceDragBox) => void;
98
+ onEnd: () => void;
99
+ }): (state: PresenceState) => void;
@@ -15,6 +15,11 @@ export interface VideoEffectsToolProviderOptions {
15
15
  namespace?: string;
16
16
  /** The project cannot be edited: write tools are hidden. A string is the reason. */
17
17
  readOnly?: boolean | string | (() => boolean | string);
18
+ /**
19
+ * The agent playback surface its calls are acted out on (default `video`, where `VideoTimeline` attaches).
20
+ * Set it when one registry holds several editors of this kind, each attached under its own surface id.
21
+ */
22
+ playbackSurface?: string;
18
23
  }
19
24
  /** A clip's effects as the tools report them: its effect clip picture, its effect transition, then its stack. */
20
25
  export declare function videoClipAppliedEffects(clip: VideoClip): AppliedEffectInfo[];
@@ -15,6 +15,11 @@ export interface VideoEffectsToolProviderOptions {
15
15
  namespace?: string;
16
16
  /** The project cannot be edited: write tools are hidden. A string is the reason. */
17
17
  readOnly?: boolean | string | (() => boolean | string);
18
+ /**
19
+ * The agent playback surface its calls are acted out on (default `video`, where `VideoTimeline` attaches).
20
+ * Set it when one registry holds several editors of this kind, each attached under its own surface id.
21
+ */
22
+ playbackSurface?: string;
18
23
  }
19
24
  /** A clip's effects as the tools report them: its effect clip picture, its effect transition, then its stack. */
20
25
  export declare function videoClipAppliedEffects(clip: VideoClip): AppliedEffectInfo[];
@@ -3267,12 +3267,12 @@ function planVideoToolPlayback(tool, args) {
3267
3267
  if (str2(args.marker)) return click({ kind: "marker", id: args.marker });
3268
3268
  return null;
3269
3269
  }
3270
- function withVideoPlayback(provider, surface = "video") {
3270
+ function withVideoPlayback(provider, surface) {
3271
3271
  const plan = (tool) => tool.plan || tool.playback !== void 0 ? tool : { ...tool, plan: (args) => planVideoToolPlayback(tool.name, args) };
3272
3272
  const tools = provider.tools;
3273
3273
  return {
3274
3274
  ...provider,
3275
- playbackSurface: _nullishCoalesce(provider.playbackSurface, () => ( surface)),
3275
+ playbackSurface: _nullishCoalesce(_nullishCoalesce(surface, () => ( provider.playbackSurface)), () => ( "video")),
3276
3276
  tools: typeof tools === "function" ? () => tools().map(plan) : tools.map(plan)
3277
3277
  };
3278
3278
  }
@@ -4686,7 +4686,7 @@ function createVideoEditorToolProvider(controller, options = {}) {
4686
4686
  }
4687
4687
  });
4688
4688
  }
4689
- });
4689
+ }, options.playbackSurface);
4690
4690
  }
4691
4691
 
4692
4692
  // src/video-editor/effect-tools.ts
@@ -4861,7 +4861,7 @@ function createVideoEffectsToolProvider(controller, options = {}) {
4861
4861
  }
4862
4862
  }
4863
4863
  ]
4864
- }));
4864
+ }), options.playbackSurface);
4865
4865
  }
4866
4866
 
4867
4867
 
@@ -3267,12 +3267,12 @@ function planVideoToolPlayback(tool, args) {
3267
3267
  if (str2(args.marker)) return click({ kind: "marker", id: args.marker });
3268
3268
  return null;
3269
3269
  }
3270
- function withVideoPlayback(provider, surface = "video") {
3270
+ function withVideoPlayback(provider, surface) {
3271
3271
  const plan = (tool) => tool.plan || tool.playback !== void 0 ? tool : { ...tool, plan: (args) => planVideoToolPlayback(tool.name, args) };
3272
3272
  const tools = provider.tools;
3273
3273
  return {
3274
3274
  ...provider,
3275
- playbackSurface: provider.playbackSurface ?? surface,
3275
+ playbackSurface: surface ?? provider.playbackSurface ?? "video",
3276
3276
  tools: typeof tools === "function" ? () => tools().map(plan) : tools.map(plan)
3277
3277
  };
3278
3278
  }
@@ -4686,7 +4686,7 @@ function createVideoEditorToolProvider(controller, options = {}) {
4686
4686
  }
4687
4687
  });
4688
4688
  }
4689
- });
4689
+ }, options.playbackSurface);
4690
4690
  }
4691
4691
 
4692
4692
  // src/video-editor/effect-tools.ts
@@ -4861,7 +4861,7 @@ function createVideoEffectsToolProvider(controller, options = {}) {
4861
4861
  }
4862
4862
  }
4863
4863
  ]
4864
- }));
4864
+ }), options.playbackSurface);
4865
4865
  }
4866
4866
  export {
4867
4867
  VIDEO_BLEND_MODES,
@@ -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;
@@ -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.148.0",
3
+ "version": "0.150.0",
4
4
  "description": "UI-agnostic rich text and media editing core library",
5
5
  "author": "Pixerate",
6
6
  "license": "MIT",