@synthetic-ai/premiere-mcp 2.0.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 (104) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/LICENSE +21 -0
  3. package/README.md +242 -0
  4. package/cep-plugin/.debug +8 -0
  5. package/cep-plugin/CSInterface.js +70 -0
  6. package/cep-plugin/CSXS/manifest.xml +49 -0
  7. package/cep-plugin/host.jsx +7 -0
  8. package/cep-plugin/index.html +419 -0
  9. package/cep-plugin/main.js +327 -0
  10. package/cep-plugin/premiere.jsx +24947 -0
  11. package/cep-plugin/synthetic-logo.png +0 -0
  12. package/dist/bridge/file-bridge.d.ts +29 -0
  13. package/dist/bridge/file-bridge.js +145 -0
  14. package/dist/bridge/script-builder.d.ts +19 -0
  15. package/dist/bridge/script-builder.js +408 -0
  16. package/dist/http-server.d.ts +21 -0
  17. package/dist/http-server.js +140 -0
  18. package/dist/index.d.ts +3 -0
  19. package/dist/index.js +70 -0
  20. package/dist/resources/extendscript-reference.d.ts +2 -0
  21. package/dist/resources/extendscript-reference.js +219 -0
  22. package/dist/server.d.ts +4 -0
  23. package/dist/server.js +276 -0
  24. package/dist/tools/advanced.d.ts +530 -0
  25. package/dist/tools/advanced.js +923 -0
  26. package/dist/tools/audio-advanced.d.ts +847 -0
  27. package/dist/tools/audio-advanced.js +1653 -0
  28. package/dist/tools/audio.d.ts +84 -0
  29. package/dist/tools/audio.js +123 -0
  30. package/dist/tools/captions.d.ts +30 -0
  31. package/dist/tools/captions.js +73 -0
  32. package/dist/tools/clipboard.d.ts +153 -0
  33. package/dist/tools/clipboard.js +381 -0
  34. package/dist/tools/color-advanced.d.ts +821 -0
  35. package/dist/tools/color-advanced.js +772 -0
  36. package/dist/tools/discovery.d.ts +128 -0
  37. package/dist/tools/discovery.js +445 -0
  38. package/dist/tools/effects.d.ts +211 -0
  39. package/dist/tools/effects.js +554 -0
  40. package/dist/tools/export-presets.d.ts +333 -0
  41. package/dist/tools/export-presets.js +490 -0
  42. package/dist/tools/export.d.ts +320 -0
  43. package/dist/tools/export.js +618 -0
  44. package/dist/tools/health.d.ts +9 -0
  45. package/dist/tools/health.js +25 -0
  46. package/dist/tools/inspection.d.ts +179 -0
  47. package/dist/tools/inspection.js +1089 -0
  48. package/dist/tools/keyframes.d.ts +253 -0
  49. package/dist/tools/keyframes.js +611 -0
  50. package/dist/tools/markers.d.ts +117 -0
  51. package/dist/tools/markers.js +206 -0
  52. package/dist/tools/media.d.ts +297 -0
  53. package/dist/tools/media.js +493 -0
  54. package/dist/tools/metadata.d.ts +178 -0
  55. package/dist/tools/metadata.js +278 -0
  56. package/dist/tools/multicam.d.ts +199 -0
  57. package/dist/tools/multicam.js +212 -0
  58. package/dist/tools/playback.d.ts +34 -0
  59. package/dist/tools/playback.js +63 -0
  60. package/dist/tools/playhead.d.ts +77 -0
  61. package/dist/tools/playhead.js +185 -0
  62. package/dist/tools/project-manager.d.ts +65 -0
  63. package/dist/tools/project-manager.js +81 -0
  64. package/dist/tools/project.d.ts +390 -0
  65. package/dist/tools/project.js +596 -0
  66. package/dist/tools/scripting.d.ts +98 -0
  67. package/dist/tools/scripting.js +434 -0
  68. package/dist/tools/selection.d.ts +120 -0
  69. package/dist/tools/selection.js +334 -0
  70. package/dist/tools/sequence-advanced.d.ts +84 -0
  71. package/dist/tools/sequence-advanced.js +471 -0
  72. package/dist/tools/sequence-settings.d.ts +397 -0
  73. package/dist/tools/sequence-settings.js +967 -0
  74. package/dist/tools/sequence.d.ts +211 -0
  75. package/dist/tools/sequence.js +378 -0
  76. package/dist/tools/source-monitor.d.ts +95 -0
  77. package/dist/tools/source-monitor.js +180 -0
  78. package/dist/tools/text.d.ts +97 -0
  79. package/dist/tools/text.js +159 -0
  80. package/dist/tools/timeline.d.ts +265 -0
  81. package/dist/tools/timeline.js +575 -0
  82. package/dist/tools/track-management.d.ts +482 -0
  83. package/dist/tools/track-management.js +787 -0
  84. package/dist/tools/track-targeting.d.ts +666 -0
  85. package/dist/tools/track-targeting.js +1318 -0
  86. package/dist/tools/tracks.d.ts +90 -0
  87. package/dist/tools/tracks.js +183 -0
  88. package/dist/tools/transitions-motion.d.ts +788 -0
  89. package/dist/tools/transitions-motion.js +680 -0
  90. package/dist/tools/transitions.d.ts +124 -0
  91. package/dist/tools/transitions.js +267 -0
  92. package/dist/tools/utility.d.ts +469 -0
  93. package/dist/tools/utility.js +1118 -0
  94. package/dist/tools/workspace.d.ts +25 -0
  95. package/dist/tools/workspace.js +61 -0
  96. package/package.json +66 -0
  97. package/scripts/build-chat-dmg.sh +210 -0
  98. package/scripts/build-chat-zip.sh +291 -0
  99. package/scripts/install-cep-windows.ps1 +99 -0
  100. package/scripts/install-cep.sh +66 -0
  101. package/scripts/install-chat-plugin.bat +67 -0
  102. package/scripts/install-chat-plugin.sh +85 -0
  103. package/scripts/install-windows.bat +95 -0
  104. package/scripts/package.mjs +218 -0
@@ -0,0 +1,680 @@
1
+ import { buildToolScript } from "../bridge/script-builder.js";
2
+ import { sendCommand } from "../bridge/file-bridge.js";
3
+ export function getTransitionsMotionTools(bridgeOptions) {
4
+ return {
5
+ fade_in: {
6
+ description: "Add a video fade-in to a clip by animating opacity from 0 to 100% over the specified duration.",
7
+ parameters: {
8
+ type: "object",
9
+ properties: {
10
+ track_index: { type: "number", description: "Video track index (0-based)" },
11
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
12
+ duration_seconds: { type: "number", description: "Duration of the fade-in in seconds. Default: 1.0." },
13
+ },
14
+ required: ["track_index", "clip_index"],
15
+ },
16
+ handler: async (args) => {
17
+ const duration = args.duration_seconds ?? 1.0;
18
+ const script = buildToolScript(`
19
+ var result = fadeIn(${args.track_index}, ${args.clip_index}, ${duration});
20
+ var parsed = JSON.parse(result);
21
+ if (!parsed.success) return __error(parsed.error);
22
+ return __result(parsed.data);
23
+ `);
24
+ return sendCommand(script, bridgeOptions);
25
+ },
26
+ },
27
+ fade_out: {
28
+ description: "Add a video fade-out to a clip by animating opacity from 100% to 0 at the end.",
29
+ parameters: {
30
+ type: "object",
31
+ properties: {
32
+ track_index: { type: "number", description: "Video track index (0-based)" },
33
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
34
+ duration_seconds: { type: "number", description: "Duration of the fade-out in seconds. Default: 1.0." },
35
+ },
36
+ required: ["track_index", "clip_index"],
37
+ },
38
+ handler: async (args) => {
39
+ const duration = args.duration_seconds ?? 1.0;
40
+ const script = buildToolScript(`
41
+ var result = fadeOut(${args.track_index}, ${args.clip_index}, ${duration});
42
+ var parsed = JSON.parse(result);
43
+ if (!parsed.success) return __error(parsed.error);
44
+ return __result(parsed.data);
45
+ `);
46
+ return sendCommand(script, bridgeOptions);
47
+ },
48
+ },
49
+ cross_fade_clips: {
50
+ description: "Create a cross-fade between two adjacent clips by animating opacity. Clip A fades out while Clip B fades in.",
51
+ parameters: {
52
+ type: "object",
53
+ properties: {
54
+ track_index: { type: "number", description: "Video track index (0-based)" },
55
+ clip_index_a: { type: "number", description: "Index of the first clip (fades out)" },
56
+ clip_index_b: { type: "number", description: "Index of the second clip (fades in)" },
57
+ duration_seconds: { type: "number", description: "Duration of the cross-fade in seconds. Default: 1.0." },
58
+ },
59
+ required: ["track_index", "clip_index_a", "clip_index_b"],
60
+ },
61
+ handler: async (args) => {
62
+ const duration = args.duration_seconds ?? 1.0;
63
+ const script = buildToolScript(`
64
+ var result = crossFadeClips(${args.track_index}, ${args.clip_index_a}, ${args.clip_index_b}, ${duration});
65
+ var parsed = JSON.parse(result);
66
+ if (!parsed.success) return __error(parsed.error);
67
+ return __result(parsed.data);
68
+ `);
69
+ return sendCommand(script, bridgeOptions);
70
+ },
71
+ },
72
+ set_opacity_keyframes: {
73
+ description: "Set multiple opacity keyframes on a video clip for custom fade effects. Keyframes are relative to clip start.",
74
+ parameters: {
75
+ type: "object",
76
+ properties: {
77
+ track_index: { type: "number", description: "Video track index (0-based)" },
78
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
79
+ keyframes: { type: "array", description: "Array of keyframe objects: [{time: seconds_from_clip_start, value: opacity_0_to_100}]" },
80
+ },
81
+ required: ["track_index", "clip_index", "keyframes"],
82
+ },
83
+ handler: async (args) => {
84
+ const keyframesJson = JSON.stringify(JSON.stringify(args.keyframes));
85
+ const script = buildToolScript(`
86
+ var result = setOpacityKeyframes(${args.track_index}, ${args.clip_index}, ${keyframesJson});
87
+ var parsed = JSON.parse(result);
88
+ if (!parsed.success) return __error(parsed.error);
89
+ return __result(parsed.data);
90
+ `);
91
+ return sendCommand(script, bridgeOptions);
92
+ },
93
+ },
94
+ apply_warp_stabilizer: {
95
+ description: "Apply Warp Stabilizer effect to a video clip to reduce camera shake. Smoothness controls how much stabilization is applied.",
96
+ parameters: {
97
+ type: "object",
98
+ properties: {
99
+ track_index: { type: "number", description: "Video track index (0-based)" },
100
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
101
+ smoothness: { type: "number", description: "Stabilization smoothness 0-100. Default: 50. Higher = more stable but more cropping." },
102
+ },
103
+ required: ["track_index", "clip_index"],
104
+ },
105
+ handler: async (args) => {
106
+ const smoothness = args.smoothness ?? 50;
107
+ const script = buildToolScript(`
108
+ var result = applyWarpStabilizer(${args.track_index}, ${args.clip_index}, ${smoothness});
109
+ var parsed = JSON.parse(result);
110
+ if (!parsed.success) return __error(parsed.error);
111
+ return __result(parsed.data);
112
+ `);
113
+ return sendCommand(script, bridgeOptions);
114
+ },
115
+ },
116
+ get_stabilization_status: {
117
+ description: "Check if Warp Stabilizer is applied to a clip and get its status.",
118
+ parameters: {
119
+ type: "object",
120
+ properties: {
121
+ track_index: { type: "number", description: "Video track index (0-based)" },
122
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
123
+ },
124
+ required: ["track_index", "clip_index"],
125
+ },
126
+ handler: async (args) => {
127
+ const script = buildToolScript(`
128
+ var result = getStabilizationStatus(${args.track_index}, ${args.clip_index});
129
+ var parsed = JSON.parse(result);
130
+ if (!parsed.success) return __error(parsed.error);
131
+ return __result(parsed.data);
132
+ `);
133
+ return sendCommand(script, bridgeOptions);
134
+ },
135
+ },
136
+ apply_gaussian_blur: {
137
+ description: "Apply Gaussian Blur video effect to a clip.",
138
+ parameters: {
139
+ type: "object",
140
+ properties: {
141
+ track_index: { type: "number", description: "Video track index (0-based)" },
142
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
143
+ blurriness: { type: "number", description: "Blur amount. Default: 10. Higher values = more blur." },
144
+ },
145
+ required: ["track_index", "clip_index"],
146
+ },
147
+ handler: async (args) => {
148
+ const blurriness = args.blurriness ?? 10;
149
+ const script = buildToolScript(`
150
+ var result = applyGaussianBlur(${args.track_index}, ${args.clip_index}, ${blurriness});
151
+ var parsed = JSON.parse(result);
152
+ if (!parsed.success) return __error(parsed.error);
153
+ return __result(parsed.data);
154
+ `);
155
+ return sendCommand(script, bridgeOptions);
156
+ },
157
+ },
158
+ apply_directional_blur: {
159
+ description: "Apply Directional Blur video effect to a clip for a motion blur look.",
160
+ parameters: {
161
+ type: "object",
162
+ properties: {
163
+ track_index: { type: "number", description: "Video track index (0-based)" },
164
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
165
+ direction: { type: "number", description: "Blur direction angle in degrees. Default: 0 (horizontal)." },
166
+ length: { type: "number", description: "Blur length in pixels. Default: 10." },
167
+ },
168
+ required: ["track_index", "clip_index"],
169
+ },
170
+ handler: async (args) => {
171
+ const direction = args.direction ?? 0;
172
+ const length = args.length ?? 10;
173
+ const script = buildToolScript(`
174
+ var result = applyDirectionalBlur(${args.track_index}, ${args.clip_index}, ${direction}, ${length});
175
+ var parsed = JSON.parse(result);
176
+ if (!parsed.success) return __error(parsed.error);
177
+ return __result(parsed.data);
178
+ `);
179
+ return sendCommand(script, bridgeOptions);
180
+ },
181
+ },
182
+ apply_sharpen: {
183
+ description: "Apply Sharpen video effect to a clip to increase edge definition.",
184
+ parameters: {
185
+ type: "object",
186
+ properties: {
187
+ track_index: { type: "number", description: "Video track index (0-based)" },
188
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
189
+ amount: { type: "number", description: "Sharpening amount. Default: 50." },
190
+ },
191
+ required: ["track_index", "clip_index"],
192
+ },
193
+ handler: async (args) => {
194
+ const amount = args.amount ?? 50;
195
+ const script = buildToolScript(`
196
+ var result = applySharpen(${args.track_index}, ${args.clip_index}, ${amount});
197
+ var parsed = JSON.parse(result);
198
+ if (!parsed.success) return __error(parsed.error);
199
+ return __result(parsed.data);
200
+ `);
201
+ return sendCommand(script, bridgeOptions);
202
+ },
203
+ },
204
+ apply_unsharp_mask: {
205
+ description: "Apply Unsharp Mask video effect to a clip for controlled sharpening with radius and threshold.",
206
+ parameters: {
207
+ type: "object",
208
+ properties: {
209
+ track_index: { type: "number", description: "Video track index (0-based)" },
210
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
211
+ amount: { type: "number", description: "Sharpening amount percentage. Default: 100." },
212
+ radius: { type: "number", description: "Radius of sharpening in pixels. Default: 2.0." },
213
+ threshold: { type: "number", description: "Threshold for edge detection. Default: 3." },
214
+ },
215
+ required: ["track_index", "clip_index"],
216
+ },
217
+ handler: async (args) => {
218
+ const amount = args.amount ?? 100;
219
+ const radius = args.radius ?? 2.0;
220
+ const threshold = args.threshold ?? 3;
221
+ const script = buildToolScript(`
222
+ var result = applyUnsharpMask(${args.track_index}, ${args.clip_index}, ${amount}, ${radius}, ${threshold});
223
+ var parsed = JSON.parse(result);
224
+ if (!parsed.success) return __error(parsed.error);
225
+ return __result(parsed.data);
226
+ `);
227
+ return sendCommand(script, bridgeOptions);
228
+ },
229
+ },
230
+ apply_lens_distortion_removal: {
231
+ description: "Apply Lens Distortion effect to correct barrel/pincushion lens distortion.",
232
+ parameters: {
233
+ type: "object",
234
+ properties: {
235
+ track_index: { type: "number", description: "Video track index (0-based)" },
236
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
237
+ curvature: { type: "number", description: "Curvature correction. Negative = correct barrel distortion. Default: -50." },
238
+ },
239
+ required: ["track_index", "clip_index"],
240
+ },
241
+ handler: async (args) => {
242
+ const curvature = args.curvature ?? -50;
243
+ const script = buildToolScript(`
244
+ var result = applyLensDistortionRemoval(${args.track_index}, ${args.clip_index}, ${curvature});
245
+ var parsed = JSON.parse(result);
246
+ if (!parsed.success) return __error(parsed.error);
247
+ return __result(parsed.data);
248
+ `);
249
+ return sendCommand(script, bridgeOptions);
250
+ },
251
+ },
252
+ apply_video_noise_reduction: {
253
+ description: "Apply Median video effect to reduce digital noise/grain in a clip.",
254
+ parameters: {
255
+ type: "object",
256
+ properties: {
257
+ track_index: { type: "number", description: "Video track index (0-based)" },
258
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
259
+ amount: { type: "number", description: "Noise reduction radius (1-5). Default: 2." },
260
+ },
261
+ required: ["track_index", "clip_index"],
262
+ },
263
+ handler: async (args) => {
264
+ const amount = args.amount ?? 2;
265
+ const script = buildToolScript(`
266
+ var result = applyVideoNoiseReduction(${args.track_index}, ${args.clip_index}, ${amount});
267
+ var parsed = JSON.parse(result);
268
+ if (!parsed.success) return __error(parsed.error);
269
+ return __result(parsed.data);
270
+ `);
271
+ return sendCommand(script, bridgeOptions);
272
+ },
273
+ },
274
+ apply_mirror: {
275
+ description: "Apply Mirror video effect to a clip to create a reflection.",
276
+ parameters: {
277
+ type: "object",
278
+ properties: {
279
+ track_index: { type: "number", description: "Video track index (0-based)" },
280
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
281
+ angle: { type: "number", description: "Reflection angle in degrees. Default: 0 (horizontal mirror)." },
282
+ center_x: { type: "number", description: "Center X position as fraction (0-1). Default: 0.5 (center)." },
283
+ center_y: { type: "number", description: "Center Y position as fraction (0-1). Default: 0.5 (center)." },
284
+ },
285
+ required: ["track_index", "clip_index"],
286
+ },
287
+ handler: async (args) => {
288
+ const angle = args.angle ?? 0;
289
+ const centerX = args.center_x ?? 0.5;
290
+ const centerY = args.center_y ?? 0.5;
291
+ const script = buildToolScript(`
292
+ var result = applyMirror(${args.track_index}, ${args.clip_index}, ${angle}, ${centerX}, ${centerY});
293
+ var parsed = JSON.parse(result);
294
+ if (!parsed.success) return __error(parsed.error);
295
+ return __result(parsed.data);
296
+ `);
297
+ return sendCommand(script, bridgeOptions);
298
+ },
299
+ },
300
+ apply_corner_pin: {
301
+ description: "Apply Corner Pin effect to distort a clip by moving its four corners. Useful for screen replacements.",
302
+ parameters: {
303
+ type: "object",
304
+ properties: {
305
+ track_index: { type: "number", description: "Video track index (0-based)" },
306
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
307
+ corners: { type: "array", description: "Array of 4 corner points as fractions: [{x,y},{x,y},{x,y},{x,y}] in order: upper-left, upper-right, lower-right, lower-left." },
308
+ },
309
+ required: ["track_index", "clip_index", "corners"],
310
+ },
311
+ handler: async (args) => {
312
+ const cornersJson = JSON.stringify(JSON.stringify(args.corners));
313
+ const script = buildToolScript(`
314
+ var result = applyCornerPin(${args.track_index}, ${args.clip_index}, ${cornersJson});
315
+ var parsed = JSON.parse(result);
316
+ if (!parsed.success) return __error(parsed.error);
317
+ return __result(parsed.data);
318
+ `);
319
+ return sendCommand(script, bridgeOptions);
320
+ },
321
+ },
322
+ set_crop: {
323
+ description: "Crop a video clip by specified percentages from each edge using the Crop effect.",
324
+ parameters: {
325
+ type: "object",
326
+ properties: {
327
+ track_index: { type: "number", description: "Video track index (0-based)" },
328
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
329
+ left: { type: "number", description: "Crop from left edge as percentage (0-100). Default: 0." },
330
+ right: { type: "number", description: "Crop from right edge as percentage (0-100). Default: 0." },
331
+ top: { type: "number", description: "Crop from top edge as percentage (0-100). Default: 0." },
332
+ bottom: { type: "number", description: "Crop from bottom edge as percentage (0-100). Default: 0." },
333
+ },
334
+ required: ["track_index", "clip_index"],
335
+ },
336
+ handler: async (args) => {
337
+ const left = args.left ?? 0;
338
+ const right = args.right ?? 0;
339
+ const top = args.top ?? 0;
340
+ const bottom = args.bottom ?? 0;
341
+ const script = buildToolScript(`
342
+ var result = setCrop(${args.track_index}, ${args.clip_index}, ${left}, ${right}, ${top}, ${bottom});
343
+ var parsed = JSON.parse(result);
344
+ if (!parsed.success) return __error(parsed.error);
345
+ return __result(parsed.data);
346
+ `);
347
+ return sendCommand(script, bridgeOptions);
348
+ },
349
+ },
350
+ get_crop: {
351
+ description: "Get the current crop values for a clip.",
352
+ parameters: {
353
+ type: "object",
354
+ properties: {
355
+ track_index: { type: "number", description: "Video track index (0-based)" },
356
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
357
+ },
358
+ required: ["track_index", "clip_index"],
359
+ },
360
+ handler: async (args) => {
361
+ const script = buildToolScript(`
362
+ var result = getCrop(${args.track_index}, ${args.clip_index});
363
+ var parsed = JSON.parse(result);
364
+ if (!parsed.success) return __error(parsed.error);
365
+ return __result(parsed.data);
366
+ `);
367
+ return sendCommand(script, bridgeOptions);
368
+ },
369
+ },
370
+ reset_crop: {
371
+ description: "Reset crop to zero (remove all cropping) from a clip.",
372
+ parameters: {
373
+ type: "object",
374
+ properties: {
375
+ track_index: { type: "number", description: "Video track index (0-based)" },
376
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
377
+ },
378
+ required: ["track_index", "clip_index"],
379
+ },
380
+ handler: async (args) => {
381
+ const script = buildToolScript(`
382
+ var result = resetCrop(${args.track_index}, ${args.clip_index});
383
+ var parsed = JSON.parse(result);
384
+ if (!parsed.success) return __error(parsed.error);
385
+ return __result(parsed.data);
386
+ `);
387
+ return sendCommand(script, bridgeOptions);
388
+ },
389
+ },
390
+ get_transform_properties: {
391
+ description: "Get all transform properties (position, scale, rotation, anchor point, opacity) for a video clip.",
392
+ parameters: {
393
+ type: "object",
394
+ properties: {
395
+ track_index: { type: "number", description: "Video track index (0-based)" },
396
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
397
+ },
398
+ required: ["track_index", "clip_index"],
399
+ },
400
+ handler: async (args) => {
401
+ const script = buildToolScript(`
402
+ var seq = app.project.activeSequence;
403
+ if (!seq) return __error("No active sequence");
404
+ var track = seq.videoTracks[${args.track_index}];
405
+ if (!track) return __error("Video track ${args.track_index} not found");
406
+ var clip = track.clips[${args.clip_index}];
407
+ if (!clip) return __error("Clip ${args.clip_index} not found on track ${args.track_index}");
408
+
409
+ var motion = __findIntrinsic(clip, "motion");
410
+ var opacityComp = __findIntrinsic(clip, "opacity");
411
+
412
+ function readVal(prop) {
413
+ if (!prop) return null;
414
+ try { return prop.getValue(); } catch(e) { return null; }
415
+ }
416
+
417
+ var data = { name: clip.name };
418
+
419
+ if (motion) {
420
+ data.position = readVal(__findProp(motion, ["Position", "Posición", "Position"]));
421
+ data.scale = readVal(__findProp(motion, ["Scale", "Escala", "Skalierung"]));
422
+ data.rotation = readVal(__findProp(motion, ["Rotation", "Rotación", "Drehung"]));
423
+ data.anchorPoint = readVal(__findProp(motion, ["Anchor Point", "Punto de anclaje", "Ankerpunkt"]));
424
+ } else {
425
+ data.motion = "not found";
426
+ }
427
+
428
+ if (opacityComp) {
429
+ data.opacity = readVal(__findProp(opacityComp, ["Opacity", "Opacidad", "Deckkraft"]));
430
+ } else {
431
+ data.opacity = null;
432
+ }
433
+
434
+ return __result(data);
435
+ `);
436
+ return sendCommand(script, bridgeOptions);
437
+ },
438
+ },
439
+ reset_transform: {
440
+ description: "Reset all transform properties (position, scale, rotation) to default values for a clip.",
441
+ parameters: {
442
+ type: "object",
443
+ properties: {
444
+ track_index: { type: "number", description: "Video track index (0-based)" },
445
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
446
+ },
447
+ required: ["track_index", "clip_index"],
448
+ },
449
+ handler: async (args) => {
450
+ const script = buildToolScript(`
451
+ var result = resetTransform(${args.track_index}, ${args.clip_index});
452
+ var parsed = JSON.parse(result);
453
+ if (!parsed.success) return __error(parsed.error);
454
+ return __result(parsed.data);
455
+ `);
456
+ return sendCommand(script, bridgeOptions);
457
+ },
458
+ },
459
+ center_clip: {
460
+ description: "Center a video clip in the frame (set position to sequence center).",
461
+ parameters: {
462
+ type: "object",
463
+ properties: {
464
+ track_index: { type: "number", description: "Video track index (0-based)" },
465
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
466
+ },
467
+ required: ["track_index", "clip_index"],
468
+ },
469
+ handler: async (args) => {
470
+ const script = buildToolScript(`
471
+ var result = centerClip(${args.track_index}, ${args.clip_index});
472
+ var parsed = JSON.parse(result);
473
+ if (!parsed.success) return __error(parsed.error);
474
+ return __result(parsed.data);
475
+ `);
476
+ return sendCommand(script, bridgeOptions);
477
+ },
478
+ },
479
+ fit_clip_to_frame: {
480
+ description: "Scale a clip to fit the sequence frame while maintaining aspect ratio (letterbox/pillarbox).",
481
+ parameters: {
482
+ type: "object",
483
+ properties: {
484
+ track_index: { type: "number", description: "Video track index (0-based)" },
485
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
486
+ },
487
+ required: ["track_index", "clip_index"],
488
+ },
489
+ handler: async (args) => {
490
+ const script = buildToolScript(`
491
+ var result = fitClipToFrame(${args.track_index}, ${args.clip_index});
492
+ var parsed = JSON.parse(result);
493
+ if (!parsed.success) return __error(parsed.error);
494
+ return __result(parsed.data);
495
+ `);
496
+ return sendCommand(script, bridgeOptions);
497
+ },
498
+ },
499
+ fill_frame: {
500
+ description: "Scale a clip to fill the sequence frame (cropping edges if needed, no letterbox).",
501
+ parameters: {
502
+ type: "object",
503
+ properties: {
504
+ track_index: { type: "number", description: "Video track index (0-based)" },
505
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
506
+ },
507
+ required: ["track_index", "clip_index"],
508
+ },
509
+ handler: async (args) => {
510
+ const script = buildToolScript(`
511
+ var result = fillFrame(${args.track_index}, ${args.clip_index});
512
+ var parsed = JSON.parse(result);
513
+ if (!parsed.success) return __error(parsed.error);
514
+ return __result(parsed.data);
515
+ `);
516
+ return sendCommand(script, bridgeOptions);
517
+ },
518
+ },
519
+ create_pip: {
520
+ description: "Create a Picture-in-Picture (PIP) effect by scaling and repositioning a clip. The clip is placed at a corner at reduced size.",
521
+ parameters: {
522
+ type: "object",
523
+ properties: {
524
+ main_track_index: { type: "number", description: "Main (background) video track index (0-based)" },
525
+ main_clip_index: { type: "number", description: "Main clip index (0-based)" },
526
+ pip_track_index: { type: "number", description: "PIP (foreground) video track index (0-based)" },
527
+ pip_clip_index: { type: "number", description: "PIP clip index (0-based)" },
528
+ position: { type: "string", description: "Corner position: 'top-left', 'top-right', 'bottom-left', 'bottom-right', or 'center'. Default: 'bottom-right'." },
529
+ scale: { type: "number", description: "PIP scale as percentage of frame. Default: 30." },
530
+ },
531
+ required: ["main_track_index", "main_clip_index", "pip_track_index", "pip_clip_index"],
532
+ },
533
+ handler: async (args) => {
534
+ const position = (args.position || "bottom-right").replace(/"/g, '\\"');
535
+ const scale = args.scale ?? 30;
536
+ const script = buildToolScript(`
537
+ var result = createPIP(${args.main_track_index}, ${args.main_clip_index}, ${args.pip_track_index}, ${args.pip_clip_index}, "${position}", ${scale});
538
+ var parsed = JSON.parse(result);
539
+ if (!parsed.success) return __error(parsed.error);
540
+ return __result(parsed.data);
541
+ `);
542
+ return sendCommand(script, bridgeOptions);
543
+ },
544
+ },
545
+ remove_pip: {
546
+ description: "Remove PIP effect by resetting the clip's position and scale back to full frame.",
547
+ parameters: {
548
+ type: "object",
549
+ properties: {
550
+ track_index: { type: "number", description: "Video track index (0-based)" },
551
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
552
+ },
553
+ required: ["track_index", "clip_index"],
554
+ },
555
+ handler: async (args) => {
556
+ const script = buildToolScript(`
557
+ var result = removePIP(${args.track_index}, ${args.clip_index});
558
+ var parsed = JSON.parse(result);
559
+ if (!parsed.success) return __error(parsed.error);
560
+ return __result(parsed.data);
561
+ `);
562
+ return sendCommand(script, bridgeOptions);
563
+ },
564
+ },
565
+ set_uniform_scale: {
566
+ description: "Enable or disable uniform scaling (lock/unlock width-height scale ratio) for a video clip.",
567
+ parameters: {
568
+ type: "object",
569
+ properties: {
570
+ track_index: { type: "number", description: "Video track index (0-based)" },
571
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
572
+ enabled: { type: "boolean", description: "True to lock uniform scale, false to allow independent width/height scaling" },
573
+ },
574
+ required: ["track_index", "clip_index", "enabled"],
575
+ },
576
+ handler: async (args) => {
577
+ const script = buildToolScript(`
578
+ var result = setUniformScale(${args.track_index}, ${args.clip_index}, ${args.enabled});
579
+ var parsed = JSON.parse(result);
580
+ if (!parsed.success) return __error(parsed.error);
581
+ return __result(parsed.data);
582
+ `);
583
+ return sendCommand(script, bridgeOptions);
584
+ },
585
+ },
586
+ apply_spherize: {
587
+ description: "Apply Spherize effect to a video clip to create a spherical/fisheye distortion.",
588
+ parameters: {
589
+ type: "object",
590
+ properties: {
591
+ track_index: { type: "number", description: "Video track index (0-based)" },
592
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
593
+ radius: { type: "number", description: "Sphere radius as percentage. Default: 50." },
594
+ center_x: { type: "number", description: "Center X position as fraction (0-1). Default: 0.5." },
595
+ center_y: { type: "number", description: "Center Y position as fraction (0-1). Default: 0.5." },
596
+ },
597
+ required: ["track_index", "clip_index"],
598
+ },
599
+ handler: async (args) => {
600
+ const radius = args.radius ?? 50;
601
+ const centerX = args.center_x ?? 0.5;
602
+ const centerY = args.center_y ?? 0.5;
603
+ const script = buildToolScript(`
604
+ var result = applySpherize(${args.track_index}, ${args.clip_index}, ${radius}, ${centerX}, ${centerY});
605
+ var parsed = JSON.parse(result);
606
+ if (!parsed.success) return __error(parsed.error);
607
+ return __result(parsed.data);
608
+ `);
609
+ return sendCommand(script, bridgeOptions);
610
+ },
611
+ },
612
+ set_time_remapping: {
613
+ description: "Enable or disable time remapping on a video clip for variable speed effects.",
614
+ parameters: {
615
+ type: "object",
616
+ properties: {
617
+ track_index: { type: "number", description: "Video track index (0-based)" },
618
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
619
+ enabled: { type: "boolean", description: "True to enable time remapping, false to disable" },
620
+ },
621
+ required: ["track_index", "clip_index", "enabled"],
622
+ },
623
+ handler: async (args) => {
624
+ const script = buildToolScript(`
625
+ var result = setTimeRemapping(${args.track_index}, ${args.clip_index}, ${args.enabled});
626
+ var parsed = JSON.parse(result);
627
+ if (!parsed.success) return __error(parsed.error);
628
+ return __result(parsed.data);
629
+ `);
630
+ return sendCommand(script, bridgeOptions);
631
+ },
632
+ },
633
+ freeze_frame: {
634
+ description: "Freeze a frame at a specific time on a clip for a specified duration.",
635
+ parameters: {
636
+ type: "object",
637
+ properties: {
638
+ track_index: { type: "number", description: "Video track index (0-based)" },
639
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
640
+ time: { type: "number", description: "Time in seconds where the freeze frame occurs" },
641
+ duration: { type: "number", description: "Duration of the freeze frame in seconds. Default: 2.0." },
642
+ },
643
+ required: ["track_index", "clip_index", "time"],
644
+ },
645
+ handler: async (args) => {
646
+ const duration = args.duration ?? 2.0;
647
+ const script = buildToolScript(`
648
+ var result = freezeFrame(${args.track_index}, ${args.clip_index}, ${args.time}, ${duration});
649
+ var parsed = JSON.parse(result);
650
+ if (!parsed.success) return __error(parsed.error);
651
+ return __result(parsed.data);
652
+ `);
653
+ return sendCommand(script, bridgeOptions);
654
+ },
655
+ },
656
+ detect_scene_edits: {
657
+ description: "Automatically detect scene changes in a clip and create cut points. Useful for splitting footage recorded continuously.",
658
+ parameters: {
659
+ type: "object",
660
+ properties: {
661
+ track_index: { type: "number", description: "Video track index (0-based)" },
662
+ clip_index: { type: "number", description: "Clip index on the track (0-based)" },
663
+ sensitivity: { type: "number", description: "Detection sensitivity 0-100. Higher = more sensitive, detects more cuts. Default: 50." },
664
+ },
665
+ required: ["track_index", "clip_index"],
666
+ },
667
+ handler: async (args) => {
668
+ const sensitivity = args.sensitivity ?? 50;
669
+ const script = buildToolScript(`
670
+ var result = detectSceneEdits(${args.track_index}, ${args.clip_index}, ${sensitivity});
671
+ var parsed = JSON.parse(result);
672
+ if (!parsed.success) return __error(parsed.error);
673
+ return __result(parsed.data);
674
+ `);
675
+ return sendCommand(script, bridgeOptions);
676
+ },
677
+ },
678
+ };
679
+ }
680
+ //# sourceMappingURL=transitions-motion.js.map