@pixerate/editor 0.148.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 (51) 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/image-editor/index.cjs +4 -4
  24. package/dist/image-editor/index.js +4 -4
  25. package/dist/image-editor/playback.d.cts +2 -2
  26. package/dist/image-editor/playback.d.ts +2 -2
  27. package/dist/image-editor/provider-effect-tools.d.cts +5 -0
  28. package/dist/image-editor/provider-effect-tools.d.ts +5 -0
  29. package/dist/image-editor/tools.d.cts +5 -0
  30. package/dist/image-editor/tools.d.ts +5 -0
  31. package/dist/paint-editor/effect-tools.d.cts +5 -0
  32. package/dist/paint-editor/effect-tools.d.ts +5 -0
  33. package/dist/paint-editor/index.cjs +3 -3
  34. package/dist/paint-editor/index.js +3 -3
  35. package/dist/paint-editor/playback.d.cts +2 -2
  36. package/dist/paint-editor/playback.d.ts +2 -2
  37. package/dist/paint-editor/tools.d.cts +5 -0
  38. package/dist/paint-editor/tools.d.ts +5 -0
  39. package/dist/tools/index.cjs +7 -3
  40. package/dist/tools/index.js +6 -2
  41. package/dist/tools/playback.d.cts +28 -0
  42. package/dist/tools/playback.d.ts +28 -0
  43. package/dist/video-editor/effect-tools.d.cts +5 -0
  44. package/dist/video-editor/effect-tools.d.ts +5 -0
  45. package/dist/video-editor/index.cjs +4 -4
  46. package/dist/video-editor/index.js +4 -4
  47. package/dist/video-editor/playback.d.cts +3 -2
  48. package/dist/video-editor/playback.d.ts +3 -2
  49. package/dist/video-editor/tools.d.cts +5 -0
  50. package/dist/video-editor/tools.d.ts +5 -0
  51. package/package.json +1 -1
@@ -19,7 +19,7 @@ require('../chunk-4EFNS2HV.cjs');
19
19
 
20
20
 
21
21
 
22
- var _chunkAG2EXVCRcjs = require('../chunk-AG2EXVCR.cjs');
22
+ var _chunkZCFHPORFcjs = require('../chunk-ZCFHPORF.cjs');
23
23
 
24
24
 
25
25
 
@@ -55,7 +55,9 @@ var _chunkY4BWZB6Jcjs = require('../chunk-Y4BWZB6J.cjs');
55
55
 
56
56
 
57
57
 
58
- var _chunkD2ENR3LBcjs = require('../chunk-D2ENR3LB.cjs');
58
+
59
+
60
+ var _chunkFR7GHH2Kcjs = require('../chunk-FR7GHH2K.cjs');
59
61
 
60
62
 
61
63
 
@@ -588,7 +590,7 @@ function planCanvasPlaybackSteps(steps, nodes, rectOptions) {
588
590
  const node = placed.get(id);
589
591
  if (node) placed.set(id, { ...node, position });
590
592
  }
591
- const rect = _chunkD2ENR3LBcjs.unionRects.call(void 0, moved.map(([id]) => rectOf(id)));
593
+ const rect = _chunkFR7GHH2Kcjs.unionRects.call(void 0, moved.map(([id]) => rectOf(id)));
592
594
  if (rect) after.push({ type: "move", to: centre(rect) }, { type: "focus", rect }, { type: "wait", ms: 450 });
593
595
  break;
594
596
  }
@@ -2249,4 +2251,6 @@ function createCanvasComponentToolProvider(controller, options = { id: "canvas-c
2249
2251
 
2250
2252
 
2251
2253
 
2252
- 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.createCanvasComponentToolProvider = createCanvasComponentToolProvider; exports.createCaptureTool = _chunkN2FGYZ4Qcjs.createCaptureTool; exports.createCaptureToolProvider = _chunkN2FGYZ4Qcjs.createCaptureToolProvider; exports.createDocumentChartTools = createDocumentChartTools; exports.createEditorMcpToolProvider = createEditorMcpToolProvider; exports.createElementCaptureSurface = _chunkSVFEVKLFcjs.createElementCaptureSurface; exports.createInstantPresenceClock = _chunkUJGAA6AKcjs.createInstantPresenceClock; exports.createMcpServer = _chunkY4BWZB6Jcjs.createMcpServer; exports.createPlaybackToolProvider = _chunkD2ENR3LBcjs.createPlaybackToolProvider; exports.createRichTextToolProvider = createRichTextToolProvider; exports.createSpreadsheetToolProvider = createSpreadsheetToolProvider; 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.normalizeSide = normalizeSide; exports.parseSkillFrontmatter = _chunkY4BWZB6Jcjs.parseSkillFrontmatter; exports.planAgentCommand = planAgentCommand; exports.planCanvasPlaybackSteps = planCanvasPlaybackSteps; exports.planCanvasToolPlayback = planCanvasToolPlayback; exports.planToolCall = planToolCall; 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.toolCallToAgentCommand = toolCallToAgentCommand; 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.validateAgentCommand = validateAgentCommand; exports.validateJsonSchema = _chunkWOFXZ3XUcjs.validateJsonSchema;
2254
+
2255
+
2256
+ exports.AgentPlayback = _chunkFR7GHH2Kcjs.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 = _chunkFR7GHH2Kcjs.createAgentPlayback; exports.createCanvasComponentToolProvider = createCanvasComponentToolProvider; exports.createCaptureTool = _chunkN2FGYZ4Qcjs.createCaptureTool; exports.createCaptureToolProvider = _chunkN2FGYZ4Qcjs.createCaptureToolProvider; exports.createDocumentChartTools = createDocumentChartTools; exports.createEditorMcpToolProvider = createEditorMcpToolProvider; exports.createElementCaptureSurface = _chunkSVFEVKLFcjs.createElementCaptureSurface; exports.createInstantPresenceClock = _chunkUJGAA6AKcjs.createInstantPresenceClock; exports.createMcpServer = _chunkY4BWZB6Jcjs.createMcpServer; exports.createPlaybackToolProvider = _chunkFR7GHH2Kcjs.createPlaybackToolProvider; exports.createRichTextToolProvider = createRichTextToolProvider; exports.createSpreadsheetToolProvider = createSpreadsheetToolProvider; exports.createToolRegistry = _chunkY4BWZB6Jcjs.createToolRegistry; exports.derivePlaybackSteps = _chunkFR7GHH2Kcjs.derivePlaybackSteps; exports.elementToSvg = _chunkSVFEVKLFcjs.elementToSvg; exports.errorResult = _chunkY4BWZB6Jcjs.errorResult; exports.isUnsafeJsonKey = _chunk2BSBFBOAcjs.isUnsafeJsonKey; exports.listSkills = _chunkY4BWZB6Jcjs.listSkills; exports.locatePlaybackChrome = _chunkFR7GHH2Kcjs.locatePlaybackChrome; exports.normalizeSide = normalizeSide; exports.parseSkillFrontmatter = _chunkY4BWZB6Jcjs.parseSkillFrontmatter; exports.planAgentCommand = planAgentCommand; exports.planCanvasPlaybackSteps = planCanvasPlaybackSteps; exports.planCanvasToolPlayback = planCanvasToolPlayback; exports.planToolCall = planToolCall; exports.playbackRectFromClient = _chunkFR7GHH2Kcjs.playbackRectFromClient; exports.playbackRefsFromArgs = _chunkFR7GHH2Kcjs.playbackRefsFromArgs; exports.playbackRefsFromResult = _chunkFR7GHH2Kcjs.playbackRefsFromResult; exports.rasterizeElement = _chunkSVFEVKLFcjs.rasterizeElement; exports.readSkillFile = _chunkY4BWZB6Jcjs.readSkillFile; exports.readingTime = _chunkFR7GHH2Kcjs.readingTime; exports.realPresenceClock = _chunkUJGAA6AKcjs.realPresenceClock; exports.resolveCaptureRequest = _chunkN2FGYZ4Qcjs.resolveCaptureRequest; exports.runToolScript = _chunkZCFHPORFcjs.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.toolCallToAgentCommand = toolCallToAgentCommand; exports.toolResultError = _chunkZCFHPORFcjs.toolResultError; exports.toolResultValue = _chunkZCFHPORFcjs.toolResultValue; exports.toolsetInstructions = _chunkY4BWZB6Jcjs.toolsetInstructions; exports.toolsetName = _chunkY4BWZB6Jcjs.toolsetName; exports.tweenPresenceCursor = _chunkUJGAA6AKcjs.tweenPresenceCursor; exports.unionCaptureRects = _chunkN2FGYZ4Qcjs.unionCaptureRects; exports.unionRects = _chunkFR7GHH2Kcjs.unionRects; exports.unknownToolMessage = _chunkY4BWZB6Jcjs.unknownToolMessage; exports.validateAgentCommand = validateAgentCommand; exports.validateJsonSchema = _chunkWOFXZ3XUcjs.validateJsonSchema;
@@ -19,7 +19,7 @@ import {
19
19
  runToolScript,
20
20
  toolResultError,
21
21
  toolResultValue
22
- } from "../chunk-SA37RU2O.js";
22
+ } from "../chunk-OOV64UEB.js";
23
23
  import {
24
24
  JSON_RPC_ERRORS,
25
25
  MCP_PROTOCOL_VERSIONS,
@@ -51,11 +51,13 @@ import {
51
51
  createAgentPlayback,
52
52
  createPlaybackToolProvider,
53
53
  derivePlaybackSteps,
54
+ locatePlaybackChrome,
55
+ playbackRectFromClient,
54
56
  playbackRefsFromArgs,
55
57
  playbackRefsFromResult,
56
58
  readingTime,
57
59
  unionRects
58
- } from "../chunk-HUHBJWTD.js";
60
+ } from "../chunk-3EVMUYF4.js";
59
61
  import {
60
62
  CAPTURE_EXCLUDE_SELECTOR,
61
63
  CAPTURE_OVERLAY_SELECTORS,
@@ -2218,12 +2220,14 @@ export {
2218
2220
  errorResult,
2219
2221
  isUnsafeJsonKey,
2220
2222
  listSkills,
2223
+ locatePlaybackChrome,
2221
2224
  normalizeSide,
2222
2225
  parseSkillFrontmatter,
2223
2226
  planAgentCommand,
2224
2227
  planCanvasPlaybackSteps,
2225
2228
  planCanvasToolPlayback,
2226
2229
  planToolCall,
2230
+ playbackRectFromClient,
2227
2231
  playbackRefsFromArgs,
2228
2232
  playbackRefsFromResult,
2229
2233
  rasterizeElement,
@@ -12,6 +12,11 @@ export interface AnimationEffectsToolProviderOptions {
12
12
  namespace?: string;
13
13
  /** The scene cannot be edited: write tools are hidden. A string is the reason. */
14
14
  readOnly?: boolean | string | (() => boolean | string);
15
+ /**
16
+ * The agent playback surface its calls are acted out on (default `animation`, where `AnimationEditor` attaches).
17
+ * Set it when one registry holds several editors of this kind, each attached under its own surface id.
18
+ */
19
+ playbackSurface?: string;
15
20
  }
16
21
  /** The effect tools for an animation editor (see the module comment). */
17
22
  export declare function createAnimationEffectsToolProvider(controller: AnimationEditorController, options?: AnimationEffectsToolProviderOptions): AgentToolProvider;
@@ -12,6 +12,11 @@ export interface AnimationEffectsToolProviderOptions {
12
12
  namespace?: string;
13
13
  /** The scene cannot be edited: write tools are hidden. A string is the reason. */
14
14
  readOnly?: boolean | string | (() => boolean | string);
15
+ /**
16
+ * The agent playback surface its calls are acted out on (default `animation`, where `AnimationEditor` attaches).
17
+ * Set it when one registry holds several editors of this kind, each attached under its own surface id.
18
+ */
19
+ playbackSurface?: string;
15
20
  }
16
21
  /** The effect tools for an animation editor (see the module comment). */
17
22
  export declare function createAnimationEffectsToolProvider(controller: AnimationEditorController, options?: AnimationEffectsToolProviderOptions): AgentToolProvider;
@@ -4397,12 +4397,12 @@ function planAnimationToolPlayback(tool, args) {
4397
4397
  for (const id of elementsOf(args)) steps.push({ type: "target", ref: { kind: "element", id } });
4398
4398
  return steps.length ? steps : null;
4399
4399
  }
4400
- function withAnimationPlayback(provider, surface = "animation") {
4400
+ function withAnimationPlayback(provider, surface) {
4401
4401
  const plan = (tool) => tool.plan || tool.playback !== void 0 ? tool : { ...tool, plan: (args) => planAnimationToolPlayback(tool.name, args) };
4402
4402
  const tools = provider.tools;
4403
4403
  return {
4404
4404
  ...provider,
4405
- playbackSurface: _nullishCoalesce(provider.playbackSurface, () => ( surface)),
4405
+ playbackSurface: _nullishCoalesce(_nullishCoalesce(surface, () => ( provider.playbackSurface)), () => ( "animation")),
4406
4406
  tools: typeof tools === "function" ? () => tools().map(plan) : tools.map(plan)
4407
4407
  };
4408
4408
  }
@@ -5505,7 +5505,7 @@ function createAnimationEditorToolProvider(controller, options = {}) {
5505
5505
  }
5506
5506
  });
5507
5507
  }
5508
- });
5508
+ }, options.playbackSurface);
5509
5509
  }
5510
5510
 
5511
5511
  // src/animation-editor/instructions.ts
@@ -5928,7 +5928,7 @@ function createAnimationEffectsToolProvider(controller, options = {}) {
5928
5928
  }
5929
5929
  }
5930
5930
  ]
5931
- }));
5931
+ }), options.playbackSurface);
5932
5932
  }
5933
5933
 
5934
5934
 
@@ -4397,12 +4397,12 @@ function planAnimationToolPlayback(tool, args) {
4397
4397
  for (const id of elementsOf(args)) steps.push({ type: "target", ref: { kind: "element", id } });
4398
4398
  return steps.length ? steps : null;
4399
4399
  }
4400
- function withAnimationPlayback(provider, surface = "animation") {
4400
+ function withAnimationPlayback(provider, surface) {
4401
4401
  const plan = (tool) => tool.plan || tool.playback !== void 0 ? tool : { ...tool, plan: (args) => planAnimationToolPlayback(tool.name, args) };
4402
4402
  const tools = provider.tools;
4403
4403
  return {
4404
4404
  ...provider,
4405
- playbackSurface: provider.playbackSurface ?? surface,
4405
+ playbackSurface: surface ?? provider.playbackSurface ?? "animation",
4406
4406
  tools: typeof tools === "function" ? () => tools().map(plan) : tools.map(plan)
4407
4407
  };
4408
4408
  }
@@ -5505,7 +5505,7 @@ function createAnimationEditorToolProvider(controller, options = {}) {
5505
5505
  }
5506
5506
  });
5507
5507
  }
5508
- });
5508
+ }, options.playbackSurface);
5509
5509
  }
5510
5510
 
5511
5511
  // src/animation-editor/instructions.ts
@@ -5928,7 +5928,7 @@ function createAnimationEffectsToolProvider(controller, options = {}) {
5928
5928
  }
5929
5929
  }
5930
5930
  ]
5931
- }));
5931
+ }), options.playbackSurface);
5932
5932
  }
5933
5933
  export {
5934
5934
  ANIMATION_EDITOR_AGENT_INSTRUCTIONS,
@@ -4,7 +4,8 @@ import type { PlaybackStep } from '../tools/playback.cjs';
4
4
  export declare function planAnimationToolPlayback(tool: string, args: Record<string, any>): PlaybackStep[] | null;
5
5
  /**
6
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).
7
+ * `planAnimationToolPlayback` and every call plays on `surface`. An explicit `surface` wins over
8
+ * the provider's own `playbackSurface`; with neither, it is `animation` (where `AnimationEditor`
9
+ * attaches itself).
9
10
  */
10
11
  export declare function withAnimationPlayback(provider: AgentToolProvider, surface?: string): AgentToolProvider;
@@ -4,7 +4,8 @@ import type { PlaybackStep } from '../tools/playback.js';
4
4
  export declare function planAnimationToolPlayback(tool: string, args: Record<string, any>): PlaybackStep[] | null;
5
5
  /**
6
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).
7
+ * `planAnimationToolPlayback` and every call plays on `surface`. An explicit `surface` wins over
8
+ * the provider's own `playbackSurface`; with neither, it is `animation` (where `AnimationEditor`
9
+ * attaches itself).
9
10
  */
10
11
  export declare function withAnimationPlayback(provider: AgentToolProvider, surface?: string): AgentToolProvider;
@@ -20,6 +20,11 @@ export interface AnimationEditorToolProviderOptions {
20
20
  data: string;
21
21
  mimeType: string;
22
22
  };
23
+ /**
24
+ * The agent playback surface its calls are acted out on (default `animation`, where `AnimationEditor` 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
  /**
25
30
  * Full JSON Schema of each command type: every field with its range, default and meaning, self-contained.
@@ -20,6 +20,11 @@ export interface AnimationEditorToolProviderOptions {
20
20
  data: string;
21
21
  mimeType: string;
22
22
  };
23
+ /**
24
+ * The agent playback surface its calls are acted out on (default `animation`, where `AnimationEditor` 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
  /**
25
30
  * Full JSON Schema of each command type: every field with its range, default and meaning, self-contained.
@@ -1158,7 +1158,7 @@ function withChartPlayback(provider, options) {
1158
1158
  const tools = provider.tools;
1159
1159
  return {
1160
1160
  ...provider,
1161
- playbackSurface: _nullishCoalesce(_nullishCoalesce(provider.playbackSurface, () => ( options.surface)), () => ( "chart")),
1161
+ playbackSurface: _nullishCoalesce(_nullishCoalesce(options.surface, () => ( provider.playbackSurface)), () => ( "chart")),
1162
1162
  tools: typeof tools === "function" ? () => tools().map(plan) : tools.map(plan)
1163
1163
  };
1164
1164
  }
@@ -1746,7 +1746,7 @@ function createChartToolProvider(controller, options = {}) {
1746
1746
  }
1747
1747
  });
1748
1748
  }
1749
- }, { director: !!options.director });
1749
+ }, { director: !!options.director, surface: options.playbackSurface });
1750
1750
  }
1751
1751
 
1752
1752
  // src/chart/stream.ts
@@ -1158,7 +1158,7 @@ function withChartPlayback(provider, options) {
1158
1158
  const tools = provider.tools;
1159
1159
  return {
1160
1160
  ...provider,
1161
- playbackSurface: provider.playbackSurface ?? options.surface ?? "chart",
1161
+ playbackSurface: options.surface ?? provider.playbackSurface ?? "chart",
1162
1162
  tools: typeof tools === "function" ? () => tools().map(plan) : tools.map(plan)
1163
1163
  };
1164
1164
  }
@@ -1746,7 +1746,7 @@ function createChartToolProvider(controller, options = {}) {
1746
1746
  }
1747
1747
  });
1748
1748
  }
1749
- }, { director: !!options.director });
1749
+ }, { director: !!options.director, surface: options.playbackSurface });
1750
1750
  }
1751
1751
 
1752
1752
  // src/chart/stream.ts
@@ -13,8 +13,8 @@ export declare function locateChartPoint(spec: ChartSpec, scene: ChartScene, ref
13
13
  /** The cursor steps for one chart tool call (by bare name), or null to fall back to the ids it names. */
14
14
  export declare function planChartToolPlayback(tool: string, args: Record<string, any>): PlaybackStep[] | null;
15
15
  /**
16
- * Gives a chart tool provider agent playback on `surface` (default `chart`, where `ChartEditor`
17
- * attaches). With a director, value changes and selections play through it (`playback: 'self'`).
16
+ * Gives a chart tool provider agent playback on `surface`. An explicit `surface` wins over the
17
+ * provider's own `playbackSurface`; with neither, it is `chart` (where `ChartEditor` attaches). With a director, value changes and selections play through it (`playback: 'self'`).
18
18
  */
19
19
  export declare function withChartPlayback(provider: AgentToolProvider, options: {
20
20
  director: boolean;
@@ -13,8 +13,8 @@ export declare function locateChartPoint(spec: ChartSpec, scene: ChartScene, ref
13
13
  /** The cursor steps for one chart tool call (by bare name), or null to fall back to the ids it names. */
14
14
  export declare function planChartToolPlayback(tool: string, args: Record<string, any>): PlaybackStep[] | null;
15
15
  /**
16
- * Gives a chart tool provider agent playback on `surface` (default `chart`, where `ChartEditor`
17
- * attaches). With a director, value changes and selections play through it (`playback: 'self'`).
16
+ * Gives a chart tool provider agent playback on `surface`. An explicit `surface` wins over the
17
+ * provider's own `playbackSurface`; with neither, it is `chart` (where `ChartEditor` attaches). With a director, value changes and selections play through it (`playback: 'self'`).
18
18
  */
19
19
  export declare function withChartPlayback(provider: AgentToolProvider, options: {
20
20
  director: boolean;
@@ -39,6 +39,11 @@ export interface ChartToolProviderOptions {
39
39
  data: string;
40
40
  mimeType: string;
41
41
  };
42
+ /**
43
+ * The agent playback surface its calls are acted out on (default `chart`, where `ChartEditor` attaches).
44
+ * Set it when one registry holds several editors of this kind, each attached under its own surface id.
45
+ */
46
+ playbackSurface?: string;
42
47
  }
43
48
  /**
44
49
  * When to look at the chart, for `render_chart`'s description (after vectorcraft's
@@ -39,6 +39,11 @@ export interface ChartToolProviderOptions {
39
39
  data: string;
40
40
  mimeType: string;
41
41
  };
42
+ /**
43
+ * The agent playback surface its calls are acted out on (default `chart`, where `ChartEditor` attaches).
44
+ * Set it when one registry holds several editors of this kind, each attached under its own surface id.
45
+ */
46
+ playbackSurface?: string;
42
47
  }
43
48
  /**
44
49
  * When to look at the chart, for `render_chart`'s description (after vectorcraft's
@@ -80,6 +80,20 @@ function unionRects(rects) {
80
80
  const y = Math.min(...list.map((r) => r.y));
81
81
  return { x, y, width: Math.max(...list.map((r) => r.x + r.width)) - x, height: Math.max(...list.map((r) => r.y + r.height)) - y };
82
82
  }
83
+ function playbackRectFromClient(rect, fromViewport) {
84
+ if (!rect || !(rect.width > 0) || !(rect.height > 0)) return null;
85
+ const map = fromViewport ?? ((p) => p);
86
+ const a = map({ x: rect.left, y: rect.top });
87
+ const b = map({ x: rect.left + rect.width, y: rect.top + rect.height });
88
+ return { x: Math.min(a.x, b.x), y: Math.min(a.y, b.y), width: Math.abs(b.x - a.x), height: Math.abs(b.y - a.y) };
89
+ }
90
+ function locatePlaybackChrome(ref, chrome, fromViewport) {
91
+ if (!chrome) return null;
92
+ const own = chrome.locate?.(ref);
93
+ if (own) return own;
94
+ const el = chrome.locateElement?.(ref);
95
+ return el ? playbackRectFromClient(el.getBoundingClientRect(), fromViewport) : null;
96
+ }
83
97
  function normalizePlan(plan) {
84
98
  if (!plan) return null;
85
99
  if (Array.isArray(plan)) return plan.length ? { steps: plan } : null;
@@ -441,6 +455,8 @@ export {
441
455
  derivePlaybackSteps,
442
456
  readingTime,
443
457
  unionRects,
458
+ playbackRectFromClient,
459
+ locatePlaybackChrome,
444
460
  AgentPlayback,
445
461
  createAgentPlayback,
446
462
  createPlaybackToolProvider
@@ -80,10 +80,24 @@ function unionRects(rects) {
80
80
  const y = Math.min(...list.map((r) => r.y));
81
81
  return { x, y, width: Math.max(...list.map((r) => r.x + r.width)) - x, height: Math.max(...list.map((r) => r.y + r.height)) - y };
82
82
  }
83
+ function playbackRectFromClient(rect, fromViewport) {
84
+ if (!rect || !(rect.width > 0) || !(rect.height > 0)) return null;
85
+ const map = _nullishCoalesce(fromViewport, () => ( ((p) => p)));
86
+ const a = map({ x: rect.left, y: rect.top });
87
+ const b = map({ x: rect.left + rect.width, y: rect.top + rect.height });
88
+ return { x: Math.min(a.x, b.x), y: Math.min(a.y, b.y), width: Math.abs(b.x - a.x), height: Math.abs(b.y - a.y) };
89
+ }
90
+ function locatePlaybackChrome(ref, chrome, fromViewport) {
91
+ if (!chrome) return null;
92
+ const own = _optionalChain([chrome, 'access', _3 => _3.locate, 'optionalCall', _4 => _4(ref)]);
93
+ if (own) return own;
94
+ const el = _optionalChain([chrome, 'access', _5 => _5.locateElement, 'optionalCall', _6 => _6(ref)]);
95
+ return el ? playbackRectFromClient(el.getBoundingClientRect(), fromViewport) : null;
96
+ }
83
97
  function normalizePlan(plan) {
84
98
  if (!plan) return null;
85
99
  if (Array.isArray(plan)) return plan.length ? { steps: plan } : null;
86
- return _optionalChain([plan, 'access', _3 => _3.steps, 'optionalAccess', _4 => _4.length]) || plan.surface || plan.readOnly !== void 0 ? plan : null;
100
+ return _optionalChain([plan, 'access', _7 => _7.steps, 'optionalAccess', _8 => _8.length]) || plan.surface || plan.readOnly !== void 0 ? plan : null;
87
101
  }
88
102
  var isErrorResult = (value) => !!value && typeof value === "object" && value.isError === true;
89
103
  var center = (r) => ({ x: r.x + r.width / 2, y: r.y + r.height / 2 });
@@ -150,7 +164,7 @@ var AgentPlayback = (_class = class {
150
164
  say(text, options = {}) {
151
165
  const actor = this.actorState(options.actor);
152
166
  const surface = actor.surface ? this.surfaces.get(actor.surface) : void 0;
153
- if (!_optionalChain([surface, 'optionalAccess', _5 => _5.presence, 'access', _6 => _6.get, 'call', _7 => _7(actor.info.id)])) return null;
167
+ if (!_optionalChain([surface, 'optionalAccess', _9 => _9.presence, 'access', _10 => _10.get, 'call', _11 => _11(actor.info.id)])) return null;
154
168
  surface.presence.set({ id: actor.info.id, message: text });
155
169
  return actor.surface;
156
170
  }
@@ -170,7 +184,7 @@ var AgentPlayback = (_class = class {
170
184
  if (!actor) {
171
185
  actor = { info: { ...base, color: _nullishCoalesce(base.color, () => ( _chunkUJGAA6AKcjs.PRESENCE_COLORS[this.actors.size % _chunkUJGAA6AKcjs.PRESENCE_COLORS.length])) }, queue: Promise.resolve(), version: 0 };
172
186
  this.actors.set(base.id, actor);
173
- } else if (_optionalChain([info, 'optionalAccess', _8 => _8.name]) && info.name !== actor.info.name) actor.info = { ...actor.info, name: info.name };
187
+ } else if (_optionalChain([info, 'optionalAccess', _12 => _12.name]) && info.name !== actor.info.name) actor.info = { ...actor.info, name: info.name };
174
188
  return actor;
175
189
  }
176
190
  enqueue(actor, run) {
@@ -195,26 +209,26 @@ var AgentPlayback = (_class = class {
195
209
  if (tool.plan) {
196
210
  try {
197
211
  const state = {
198
- surfaceId: _nullishCoalesce(_optionalChain([fallback, 'optionalAccess', _9 => _9[0]]), () => ( null)),
199
- locate: (ref) => _nullishCoalesce(_optionalChain([fallback, 'optionalAccess', _10 => _10[1], 'access', _11 => _11.locate, 'optionalCall', _12 => _12(ref)]), () => ( null))
212
+ surfaceId: _nullishCoalesce(_optionalChain([fallback, 'optionalAccess', _13 => _13[0]]), () => ( null)),
213
+ locate: (ref) => _nullishCoalesce(_optionalChain([fallback, 'optionalAccess', _14 => _14[1], 'access', _15 => _15.locate, 'optionalCall', _16 => _16(ref)]), () => ( null))
200
214
  };
201
215
  planned = normalizePlan(tool.plan(call.args, state));
202
216
  } catch (e2) {
203
217
  planned = null;
204
218
  }
205
219
  }
206
- const readOnly = _nullishCoalesce(_optionalChain([planned, 'optionalAccess', _13 => _13.readOnly]), () => ( _optionalChain([tool, 'access', _14 => _14.annotations, 'optionalAccess', _15 => _15.readOnlyHint]) === true));
220
+ const readOnly = _nullishCoalesce(_optionalChain([planned, 'optionalAccess', _17 => _17.readOnly]), () => ( _optionalChain([tool, 'access', _18 => _18.annotations, 'optionalAccess', _19 => _19.readOnlyHint]) === true));
207
221
  if (readOnly && this.reads === "skip") return next();
208
- const found = this.surfaceFor(call.provider, _optionalChain([planned, 'optionalAccess', _16 => _16.surface]));
222
+ const found = this.surfaceFor(call.provider, _optionalChain([planned, 'optionalAccess', _20 => _20.surface]));
209
223
  if (!found) return next();
210
224
  const [surfaceId, surface] = found;
211
- const steps = _optionalChain([planned, 'optionalAccess', _17 => _17.steps, 'optionalAccess', _18 => _18.length]) ? planned.steps : derivePlaybackSteps(call.args, surface.defaultKind);
225
+ const steps = _optionalChain([planned, 'optionalAccess', _21 => _21.steps, 'optionalAccess', _22 => _22.length]) ? planned.steps : derivePlaybackSteps(call.args, surface.defaultKind);
212
226
  const glance = readOnly && this.reads === "glance";
213
227
  const played = glance ? steps.filter((s) => GLANCE_STEPS.has(s.type)) : steps;
214
228
  if (!played.some((s) => s.type !== "commit")) return next();
215
229
  return this.enqueue(actor, async () => {
216
230
  if (surface.visible && !surface.visible()) {
217
- await _optionalChain([surface, 'access', _19 => _19.reveal, 'optionalCall', _20 => _20()]);
231
+ await _optionalChain([surface, 'access', _23 => _23.reveal, 'optionalCall', _24 => _24()]);
218
232
  if (surface.visible && !surface.visible()) return next();
219
233
  }
220
234
  return this.play({ call, next, actor, surfaceId, surface, steps: played, readOnly, glance });
@@ -228,22 +242,22 @@ var AgentPlayback = (_class = class {
228
242
  const pace = () => Math.max(0.1, this.speed) * (run.glance ? 1.6 : 1);
229
243
  const wait = (ms) => instant() || ms <= 0 ? Promise.resolve() : this.clock.wait(ms / pace());
230
244
  const presence = surface.presence;
231
- const locate = (ref) => finiteRect(_nullishCoalesce(_optionalChain([surface, 'access', _21 => _21.locate, 'optionalCall', _22 => _22(ref.kind === "item" ? { kind: _nullishCoalesce(surface.defaultKind, () => ( "item")), id: ref.id } : ref)]), () => ( null)));
245
+ const locate = (ref) => finiteRect(_nullishCoalesce(_optionalChain([surface, 'access', _25 => _25.locate, 'optionalCall', _26 => _26(ref.kind === "item" ? { kind: _nullishCoalesce(surface.defaultKind, () => ( "item")), id: ref.id } : ref)]), () => ( null)));
232
246
  const record = (step) => {
233
247
  for (const list of this.recordings) list.push({ actor: id, surface: surfaceId, tool: call.name, step });
234
248
  };
235
249
  this.running++;
236
250
  if (this.running === 1) this.listeners.forEach((l) => l());
237
251
  try {
238
- if (actor.surface && actor.surface !== surfaceId) _optionalChain([this, 'access', _23 => _23.surfaces, 'access', _24 => _24.get, 'call', _25 => _25(actor.surface), 'optionalAccess', _26 => _26.presence, 'access', _27 => _27.remove, 'call', _28 => _28(id)]);
252
+ if (actor.surface && actor.surface !== surfaceId) _optionalChain([this, 'access', _27 => _27.surfaces, 'access', _28 => _28.get, 'call', _29 => _29(actor.surface), 'optionalAccess', _30 => _30.presence, 'access', _31 => _31.remove, 'call', _32 => _32(id)]);
239
253
  if (!presence.get(id)) {
240
- const bounds = _nullishCoalesce(_optionalChain([surface, 'access', _29 => _29.bounds, 'optionalCall', _30 => _30()]), () => ( null));
254
+ const bounds = _nullishCoalesce(_optionalChain([surface, 'access', _33 => _33.bounds, 'optionalCall', _34 => _34()]), () => ( null));
241
255
  let at = actor.viewport && surface.fromViewport ? surface.fromViewport(actor.viewport) : null;
242
256
  if (at && bounds) at = { x: Math.min(bounds.x + bounds.width, Math.max(bounds.x, at.x)), y: Math.min(bounds.y + bounds.height, Math.max(bounds.y, at.y)) };
243
257
  at ??= bounds ? { x: bounds.x + bounds.width - 48, y: bounds.y + 32 } : null;
244
258
  if (!at) {
245
259
  const first = run.steps.find((s) => s.type === "move" || s.type === "target" || s.type === "drag");
246
- const rect = _optionalChain([first, 'optionalAccess', _31 => _31.type]) === "target" ? locate(first.ref) : null;
260
+ const rect = _optionalChain([first, 'optionalAccess', _35 => _35.type]) === "target" ? locate(first.ref) : null;
247
261
  at = first && first.type !== "target" ? first.to : rect ? center(rect) : { x: 0, y: 0 };
248
262
  }
249
263
  presence.set({ id, name: _nullishCoalesce(actor.info.name, () => ( id)), color: actor.info.color, x: at.x, y: at.y, pressed: false });
@@ -251,7 +265,7 @@ var AgentPlayback = (_class = class {
251
265
  actor.surface = surfaceId;
252
266
  actor.version++;
253
267
  const argRefs = playbackRefsFromArgs(call.args, surface.defaultKind);
254
- if (!readOnly) _optionalChain([surface, 'access', _32 => _32.beginGesture, 'optionalCall', _33 => _33(`agent:${id}:${++this.calls}`)]);
268
+ if (!readOnly) _optionalChain([surface, 'access', _36 => _36.beginGesture, 'optionalCall', _37 => _37(`agent:${id}:${++this.calls}`)]);
255
269
  let result;
256
270
  let committed = false;
257
271
  try {
@@ -287,11 +301,11 @@ var AgentPlayback = (_class = class {
287
301
  await wait(900);
288
302
  throw error;
289
303
  } finally {
290
- if (!readOnly) _optionalChain([surface, 'access', _34 => _34.endGesture, 'optionalCall', _35 => _35()]);
304
+ if (!readOnly) _optionalChain([surface, 'access', _38 => _38.endGesture, 'optionalCall', _39 => _39()]);
291
305
  presence.set({ id, pressed: false });
292
306
  }
293
307
  if (isErrorResult(result)) {
294
- const text = _nullishCoalesce(_optionalChain([result, 'access', _36 => _36.content, 'optionalAccess', _37 => _37.find, 'call', _38 => _38((c) => c.type === "text"), 'optionalAccess', _39 => _39.text]), () => ( "The tool failed."));
308
+ const text = _nullishCoalesce(_optionalChain([result, 'access', _40 => _40.content, 'optionalAccess', _41 => _41.find, 'call', _42 => _42((c) => c.type === "text"), 'optionalAccess', _43 => _43.text]), () => ( "The tool failed."));
295
309
  presence.set({ id, message: `\u2717 ${text}`.slice(0, 140) });
296
310
  await wait(900);
297
311
  } else if (!readOnly) {
@@ -444,4 +458,6 @@ function createPlaybackToolProvider(playback, options = {}) {
444
458
 
445
459
 
446
460
 
447
- exports.playbackRefsFromArgs = playbackRefsFromArgs; exports.playbackRefsFromResult = playbackRefsFromResult; exports.derivePlaybackSteps = derivePlaybackSteps; exports.readingTime = readingTime; exports.unionRects = unionRects; exports.AgentPlayback = AgentPlayback; exports.createAgentPlayback = createAgentPlayback; exports.createPlaybackToolProvider = createPlaybackToolProvider;
461
+
462
+
463
+ exports.playbackRefsFromArgs = playbackRefsFromArgs; exports.playbackRefsFromResult = playbackRefsFromResult; exports.derivePlaybackSteps = derivePlaybackSteps; exports.readingTime = readingTime; exports.unionRects = unionRects; exports.playbackRectFromClient = playbackRectFromClient; exports.locatePlaybackChrome = locatePlaybackChrome; exports.AgentPlayback = AgentPlayback; exports.createAgentPlayback = createAgentPlayback; exports.createPlaybackToolProvider = createPlaybackToolProvider;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  readingTime
3
- } from "./chunk-HUHBJWTD.js";
3
+ } from "./chunk-3EVMUYF4.js";
4
4
 
5
5
  // src/tools/script.ts
6
6
  function toolResultValue(result) {
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkD2ENR3LBcjs = require('./chunk-D2ENR3LB.cjs');
3
+ var _chunkFR7GHH2Kcjs = require('./chunk-FR7GHH2K.cjs');
4
4
 
5
5
  // src/tools/script.ts
6
6
  function toolResultValue(result) {
@@ -36,7 +36,7 @@ async function runToolScript(source, script, options = {}) {
36
36
  if (step.say) {
37
37
  emit({ type: "say", step: i, text: step.say });
38
38
  _optionalChain([options, 'access', _6 => _6.playback, 'optionalAccess', _7 => _7.say, 'call', _8 => _8(step.say, options.actor ? { actor: options.actor } : {})]);
39
- await pause(_chunkD2ENR3LBcjs.readingTime.call(void 0, step.say));
39
+ await pause(_chunkFR7GHH2Kcjs.readingTime.call(void 0, step.say));
40
40
  }
41
41
  if (!step.tool) continue;
42
42
  if (control.stopped) return finish(false);
@@ -29,7 +29,7 @@ var _chunkGLQQ2VILcjs = require('../chunk-GLQQ2VIL.cjs');
29
29
  var _chunk4EFNS2HVcjs = require('../chunk-4EFNS2HV.cjs');
30
30
 
31
31
 
32
- var _chunkD2ENR3LBcjs = require('../chunk-D2ENR3LB.cjs');
32
+ var _chunkFR7GHH2Kcjs = require('../chunk-FR7GHH2K.cjs');
33
33
  require('../chunk-UJGAA6AK.cjs');
34
34
 
35
35
 
@@ -608,7 +608,7 @@ function createCommandToolProvider(registry, options = {}) {
608
608
  const surface = _nullishCoalesce(_nullishCoalesce(spec.playbackSurface, () => ( spec.scope)), () => ( (id.includes(".") ? id.slice(0, id.indexOf(".")) : void 0)));
609
609
  const planned = _optionalChain([spec, 'access', _24 => _24.plan, 'optionalCall', _25 => _25(context(), _nullishCoalesce(params, () => ( {})))]);
610
610
  const own = !planned ? [] : Array.isArray(planned) ? planned : planned.steps;
611
- const steps = own.length ? own : _chunkD2ENR3LBcjs.derivePlaybackSteps.call(void 0, params);
611
+ const steps = own.length ? own : _chunkFR7GHH2Kcjs.derivePlaybackSteps.call(void 0, params);
612
612
  return {
613
613
  steps,
614
614
  ...surface ? { surface } : {},
@@ -29,7 +29,7 @@ import {
29
29
  } from "../chunk-7KZ2HKKC.js";
30
30
  import {
31
31
  derivePlaybackSteps
32
- } from "../chunk-HUHBJWTD.js";
32
+ } from "../chunk-3EVMUYF4.js";
33
33
  import "../chunk-PEEP2YR7.js";
34
34
  import {
35
35
  validateJsonSchema
@@ -9300,12 +9300,12 @@ function planImageToolPlayback(tool, args) {
9300
9300
  }
9301
9301
  return steps.length ? steps : null;
9302
9302
  }
9303
- function withImagePlayback(provider, surface = "image") {
9303
+ function withImagePlayback(provider, surface) {
9304
9304
  const plan = (tool) => tool.plan || tool.playback !== void 0 ? tool : { ...tool, plan: (args) => planImageToolPlayback(tool.name, args) };
9305
9305
  const tools = provider.tools;
9306
9306
  return {
9307
9307
  ...provider,
9308
- playbackSurface: _nullishCoalesce(provider.playbackSurface, () => ( surface)),
9308
+ playbackSurface: _nullishCoalesce(_nullishCoalesce(surface, () => ( provider.playbackSurface)), () => ( "image")),
9309
9309
  tools: typeof tools === "function" ? () => tools().map(plan) : tools.map(plan)
9310
9310
  };
9311
9311
  }
@@ -13275,7 +13275,7 @@ function createImageEditorToolProvider(controller, options = {}) {
13275
13275
  ..._chunkGNK7SESQcjs.createPigmentTools.call(void 0, ),
13276
13276
  ...createImagePsdTools(controller)
13277
13277
  ]
13278
- });
13278
+ }, options.playbackSurface);
13279
13279
  }
13280
13280
 
13281
13281
  // src/image-editor/curve-editing.ts
@@ -15172,7 +15172,7 @@ function createImageEffectsToolProvider(controller, options = {}) {
15172
15172
  }
15173
15173
  }
15174
15174
  ]
15175
- }));
15175
+ }), options.playbackSurface);
15176
15176
  }
15177
15177
 
15178
15178
 
@@ -9300,12 +9300,12 @@ function planImageToolPlayback(tool, args) {
9300
9300
  }
9301
9301
  return steps.length ? steps : null;
9302
9302
  }
9303
- function withImagePlayback(provider, surface = "image") {
9303
+ function withImagePlayback(provider, surface) {
9304
9304
  const plan = (tool) => tool.plan || tool.playback !== void 0 ? tool : { ...tool, plan: (args) => planImageToolPlayback(tool.name, args) };
9305
9305
  const tools = provider.tools;
9306
9306
  return {
9307
9307
  ...provider,
9308
- playbackSurface: provider.playbackSurface ?? surface,
9308
+ playbackSurface: surface ?? provider.playbackSurface ?? "image",
9309
9309
  tools: typeof tools === "function" ? () => tools().map(plan) : tools.map(plan)
9310
9310
  };
9311
9311
  }
@@ -13275,7 +13275,7 @@ function createImageEditorToolProvider(controller, options = {}) {
13275
13275
  ...createPigmentTools(),
13276
13276
  ...createImagePsdTools(controller)
13277
13277
  ]
13278
- });
13278
+ }, options.playbackSurface);
13279
13279
  }
13280
13280
 
13281
13281
  // src/image-editor/curve-editing.ts
@@ -15172,7 +15172,7 @@ function createImageEffectsToolProvider(controller, options = {}) {
15172
15172
  }
15173
15173
  }
15174
15174
  ]
15175
- }));
15175
+ }), options.playbackSurface);
15176
15176
  }
15177
15177
  export {
15178
15178
  ADJUSTMENT_KEYS,
@@ -16,7 +16,7 @@ export declare function createImagePlaybackLocator(controller: Pick<ImageEditorC
16
16
  export declare function planImageToolPlayback(tool: string, args: Record<string, any>): PlaybackStep[] | null;
17
17
  /**
18
18
  * Gives an image tool provider agent playback: each write tool plans its steps with
19
- * `planImageToolPlayback` and every call plays on the `surface` (default `image`, where
20
- * `ImageEditor` attaches itself).
19
+ * `planImageToolPlayback` and every call plays on `surface`. An explicit `surface` wins over the
20
+ * provider's own `playbackSurface`; with neither, it is `image` (where `ImageEditor` attaches itself).
21
21
  */
22
22
  export declare function withImagePlayback(provider: AgentToolProvider, surface?: string): AgentToolProvider;
@@ -16,7 +16,7 @@ export declare function createImagePlaybackLocator(controller: Pick<ImageEditorC
16
16
  export declare function planImageToolPlayback(tool: string, args: Record<string, any>): PlaybackStep[] | null;
17
17
  /**
18
18
  * Gives an image tool provider agent playback: each write tool plans its steps with
19
- * `planImageToolPlayback` and every call plays on the `surface` (default `image`, where
20
- * `ImageEditor` attaches itself).
19
+ * `planImageToolPlayback` and every call plays on `surface`. An explicit `surface` wins over the
20
+ * provider's own `playbackSurface`; with neither, it is `image` (where `ImageEditor` attaches itself).
21
21
  */
22
22
  export declare function withImagePlayback(provider: AgentToolProvider, surface?: string): AgentToolProvider;
@@ -16,6 +16,11 @@ export interface ImageEffectsToolProviderOptions {
16
16
  namespace?: string;
17
17
  /** The document cannot be edited: write tools are hidden. A string is the reason. */
18
18
  readOnly?: boolean | string | (() => boolean | string);
19
+ /**
20
+ * The agent playback surface its calls are acted out on (default `image`, where `ImageEditor` attaches).
21
+ * Set it when one registry holds several editors of this kind, each attached under its own surface id.
22
+ */
23
+ playbackSurface?: string;
19
24
  }
20
25
  /** A layer's provider effects as the tools report them: an effect layer's own effect, then its effect smart filters. */
21
26
  export declare function imageLayerAppliedEffects(layer: ImageLayer): AppliedEffectInfo[];
@@ -16,6 +16,11 @@ export interface ImageEffectsToolProviderOptions {
16
16
  namespace?: string;
17
17
  /** The document cannot be edited: write tools are hidden. A string is the reason. */
18
18
  readOnly?: boolean | string | (() => boolean | string);
19
+ /**
20
+ * The agent playback surface its calls are acted out on (default `image`, where `ImageEditor` attaches).
21
+ * Set it when one registry holds several editors of this kind, each attached under its own surface id.
22
+ */
23
+ playbackSurface?: string;
19
24
  }
20
25
  /** A layer's provider effects as the tools report them: an effect layer's own effect, then its effect smart filters. */
21
26
  export declare function imageLayerAppliedEffects(layer: ImageLayer): AppliedEffectInfo[];
@@ -5,6 +5,11 @@ export interface ImageEditorToolProviderOptions {
5
5
  id?: string;
6
6
  /** Tool-name prefix (`<namespace>__<name>`); defaults to the provider id, `''` for bare names. */
7
7
  namespace?: string;
8
+ /**
9
+ * The agent playback surface its calls are acted out on (default `image`, where `ImageEditor` attaches).
10
+ * Set it when one registry holds several editors of this kind, each attached under its own surface id.
11
+ */
12
+ playbackSurface?: string;
8
13
  }
9
14
  /**
10
15
  * Agent tools for an image editor, for a `ToolRegistry`:
@@ -5,6 +5,11 @@ export interface ImageEditorToolProviderOptions {
5
5
  id?: string;
6
6
  /** Tool-name prefix (`<namespace>__<name>`); defaults to the provider id, `''` for bare names. */
7
7
  namespace?: string;
8
+ /**
9
+ * The agent playback surface its calls are acted out on (default `image`, where `ImageEditor` attaches).
10
+ * Set it when one registry holds several editors of this kind, each attached under its own surface id.
11
+ */
12
+ playbackSurface?: string;
8
13
  }
9
14
  /**
10
15
  * Agent tools for an image editor, for a `ToolRegistry`:
@@ -13,6 +13,11 @@ export interface PaintEffectsToolProviderOptions {
13
13
  namespace?: string;
14
14
  /** The painting cannot be edited: write tools are hidden. A string is the reason. */
15
15
  readOnly?: boolean | string | (() => boolean | string);
16
+ /**
17
+ * The agent playback surface its calls are acted out on (default `paint`, where `PaintEditor` attaches).
18
+ * Set it when one registry holds several editors of this kind, each attached under its own surface id.
19
+ */
20
+ playbackSurface?: string;
16
21
  }
17
22
  /** The target id of the effect paper. */
18
23
  export declare const PAPER_TARGET = "paper";
@@ -13,6 +13,11 @@ export interface PaintEffectsToolProviderOptions {
13
13
  namespace?: string;
14
14
  /** The painting cannot be edited: write tools are hidden. A string is the reason. */
15
15
  readOnly?: boolean | string | (() => boolean | string);
16
+ /**
17
+ * The agent playback surface its calls are acted out on (default `paint`, where `PaintEditor` attaches).
18
+ * Set it when one registry holds several editors of this kind, each attached under its own surface id.
19
+ */
20
+ playbackSurface?: string;
16
21
  }
17
22
  /** The target id of the effect paper. */
18
23
  export declare const PAPER_TARGET = "paper";
@@ -6046,7 +6046,7 @@ function withPaintPlayback(provider, options) {
6046
6046
  const tools = provider.tools;
6047
6047
  return {
6048
6048
  ...provider,
6049
- playbackSurface: _nullishCoalesce(_nullishCoalesce(provider.playbackSurface, () => ( options.surface)), () => ( "paint")),
6049
+ playbackSurface: _nullishCoalesce(_nullishCoalesce(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
 
8560
8560
 
@@ -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 _chunkZCFHPORFcjs = require('../chunk-ZCFHPORF.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 _chunkFR7GHH2Kcjs = require('../chunk-FR7GHH2K.cjs');
42
44
 
43
45
 
44
46
 
@@ -171,4 +173,6 @@ var _chunkWOFXZ3XUcjs = require('../chunk-WOFXZ3XU.cjs');
171
173
 
172
174
 
173
175
 
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;
176
+
177
+
178
+ exports.AgentPlayback = _chunkFR7GHH2Kcjs.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 = _chunkFR7GHH2Kcjs.createAgentPlayback; exports.createCaptureTool = _chunkN2FGYZ4Qcjs.createCaptureTool; exports.createCaptureToolProvider = _chunkN2FGYZ4Qcjs.createCaptureToolProvider; exports.createElementCaptureSurface = _chunkSVFEVKLFcjs.createElementCaptureSurface; exports.createInstantPresenceClock = _chunkUJGAA6AKcjs.createInstantPresenceClock; exports.createMcpServer = _chunkY4BWZB6Jcjs.createMcpServer; exports.createPlaybackToolProvider = _chunkFR7GHH2Kcjs.createPlaybackToolProvider; exports.createToolRegistry = _chunkY4BWZB6Jcjs.createToolRegistry; exports.derivePlaybackSteps = _chunkFR7GHH2Kcjs.derivePlaybackSteps; exports.elementToSvg = _chunkSVFEVKLFcjs.elementToSvg; exports.errorResult = _chunkY4BWZB6Jcjs.errorResult; exports.isUnsafeJsonKey = _chunk2BSBFBOAcjs.isUnsafeJsonKey; exports.listSkills = _chunkY4BWZB6Jcjs.listSkills; exports.locatePlaybackChrome = _chunkFR7GHH2Kcjs.locatePlaybackChrome; exports.parseSkillFrontmatter = _chunkY4BWZB6Jcjs.parseSkillFrontmatter; exports.playbackRectFromClient = _chunkFR7GHH2Kcjs.playbackRectFromClient; exports.playbackRefsFromArgs = _chunkFR7GHH2Kcjs.playbackRefsFromArgs; exports.playbackRefsFromResult = _chunkFR7GHH2Kcjs.playbackRefsFromResult; exports.rasterizeElement = _chunkSVFEVKLFcjs.rasterizeElement; exports.readSkillFile = _chunkY4BWZB6Jcjs.readSkillFile; exports.readingTime = _chunkFR7GHH2Kcjs.readingTime; exports.realPresenceClock = _chunkUJGAA6AKcjs.realPresenceClock; exports.resolveCaptureRequest = _chunkN2FGYZ4Qcjs.resolveCaptureRequest; exports.runToolScript = _chunkZCFHPORFcjs.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 = _chunkZCFHPORFcjs.toolResultError; exports.toolResultValue = _chunkZCFHPORFcjs.toolResultValue; exports.toolsetInstructions = _chunkY4BWZB6Jcjs.toolsetInstructions; exports.toolsetName = _chunkY4BWZB6Jcjs.toolsetName; exports.tweenPresenceCursor = _chunkUJGAA6AKcjs.tweenPresenceCursor; exports.unionCaptureRects = _chunkN2FGYZ4Qcjs.unionCaptureRects; exports.unionRects = _chunkFR7GHH2Kcjs.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-OOV64UEB.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-3EVMUYF4.js";
42
44
  import {
43
45
  CAPTURE_EXCLUDE_SELECTOR,
44
46
  CAPTURE_OVERLAY_SELECTORS,
@@ -147,7 +149,9 @@ export {
147
149
  errorResult,
148
150
  isUnsafeJsonKey,
149
151
  listSkills,
152
+ locatePlaybackChrome,
150
153
  parseSkillFrontmatter,
154
+ playbackRectFromClient,
151
155
  playbackRefsFromArgs,
152
156
  playbackRefsFromResult,
153
157
  rasterizeElement,
@@ -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:
@@ -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.149.0",
4
4
  "description": "UI-agnostic rich text and media editing core library",
5
5
  "author": "Pixerate",
6
6
  "license": "MIT",