@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,490 @@
1
+ import { buildToolScript } from "../bridge/script-builder.js";
2
+ import { sendCommand } from "../bridge/file-bridge.js";
3
+ export function getExportPresetsTools(bridgeOptions) {
4
+ return {
5
+ export_direct: {
6
+ description: "Export a sequence directly (without AME) using a preset file path. Faster than AME-based export but with fewer options.",
7
+ parameters: {
8
+ type: "object",
9
+ properties: {
10
+ sequence_index: { type: "number", description: "Sequence index to export (0-based). Default: 0 (first sequence)." },
11
+ output_path: { type: "string", description: "Full output file path (e.g. C:/output/video.mp4)" },
12
+ preset_path: { type: "string", description: "Full path to export preset file (.epr)" },
13
+ work_area_type: { type: "number", description: "Work area type: 0=entire sequence, 1=work area, 2=in/out. Default: 0." },
14
+ },
15
+ required: ["output_path", "preset_path"],
16
+ },
17
+ handler: async (args) => {
18
+ const seqIndex = args.sequence_index ?? 0;
19
+ const workAreaType = args.work_area_type ?? 0;
20
+ const outputPathEsc = args.output_path.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
21
+ const presetPathEsc = args.preset_path.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
22
+ const script = buildToolScript(`
23
+ if (typeof exportDirect === "undefined") return __error("Export functions require premiere.jsx to be loaded. Try restarting the CEP panel.");
24
+ var result = exportDirect(${seqIndex}, "${outputPathEsc}", "${presetPathEsc}", ${workAreaType});
25
+ var parsed = JSON.parse(result);
26
+ if (!parsed.success) return __error(parsed.error);
27
+ return __result(parsed.data);
28
+ `);
29
+ return sendCommand(script, bridgeOptions);
30
+ },
31
+ },
32
+ export_via_ame: {
33
+ description: "Export a sequence via Adobe Media Encoder (AME). AME must be installed. Supports more formats and presets.",
34
+ parameters: {
35
+ type: "object",
36
+ properties: {
37
+ sequence_index: { type: "number", description: "Sequence index to export (0-based). Default: 0." },
38
+ output_path: { type: "string", description: "Full output file path" },
39
+ preset_path: { type: "string", description: "Full path to export preset file (.epr)" },
40
+ work_area_type: { type: "number", description: "Work area type: 0=entire sequence, 1=work area, 2=in/out. Default: 0." },
41
+ remove_on_done: { type: "boolean", description: "Remove the item from AME queue after encoding. Default: false." },
42
+ },
43
+ required: ["output_path", "preset_path"],
44
+ },
45
+ handler: async (args) => {
46
+ const seqIndex = args.sequence_index ?? 0;
47
+ const workAreaType = args.work_area_type ?? 0;
48
+ const removeOnDone = args.remove_on_done ?? false;
49
+ const outputPathEsc = args.output_path.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
50
+ const presetPathEsc = args.preset_path.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
51
+ const script = buildToolScript(`
52
+ if (typeof exportViaAME === "undefined") return __error("Export functions require premiere.jsx to be loaded. Try restarting the CEP panel.");
53
+ var result = exportViaAME(${seqIndex}, "${outputPathEsc}", "${presetPathEsc}", ${workAreaType}, ${removeOnDone});
54
+ var parsed = JSON.parse(result);
55
+ if (!parsed.success) return __error(parsed.error);
56
+ return __result(parsed.data);
57
+ `);
58
+ return sendCommand(script, bridgeOptions);
59
+ },
60
+ },
61
+ export_audio_only: {
62
+ description: "Export only the audio from a sequence using a specified preset.",
63
+ parameters: {
64
+ type: "object",
65
+ properties: {
66
+ sequence_index: { type: "number", description: "Sequence index to export (0-based). Default: 0." },
67
+ output_path: { type: "string", description: "Full output file path (e.g. C:/output/audio.mp3)" },
68
+ preset_path: { type: "string", description: "Full path to audio export preset file (.epr)" },
69
+ },
70
+ required: ["output_path", "preset_path"],
71
+ },
72
+ handler: async (args) => {
73
+ const seqIndex = args.sequence_index ?? 0;
74
+ const outputPathEsc = args.output_path.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
75
+ const presetPathEsc = args.preset_path.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
76
+ const script = buildToolScript(`
77
+ if (typeof exportAudioOnly === "undefined") return __error("Export functions require premiere.jsx to be loaded. Try restarting the CEP panel.");
78
+ var result = exportAudioOnly(${seqIndex}, "${outputPathEsc}", "${presetPathEsc}");
79
+ var parsed = JSON.parse(result);
80
+ if (!parsed.success) return __error(parsed.error);
81
+ return __result(parsed.data);
82
+ `);
83
+ return sendCommand(script, bridgeOptions);
84
+ },
85
+ },
86
+ export_aaf: {
87
+ description: "Export a sequence as AAF (Advanced Authoring Format) for interchange with other post-production tools.",
88
+ parameters: {
89
+ type: "object",
90
+ properties: {
91
+ sequence_index: { type: "number", description: "Sequence index to export (0-based). Default: 0." },
92
+ output_path: { type: "string", description: "Full output path for the .aaf file" },
93
+ options: { type: "object", description: "Optional AAF export settings object" },
94
+ },
95
+ required: ["output_path"],
96
+ },
97
+ handler: async (args) => {
98
+ const seqIndex = args.sequence_index ?? 0;
99
+ const outputPathEsc = args.output_path.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
100
+ const optionsJson = JSON.stringify(JSON.stringify(args.options || {}));
101
+ const script = buildToolScript(`
102
+ if (typeof exportAAF === "undefined") return __error("Export functions require premiere.jsx to be loaded. Try restarting the CEP panel.");
103
+ var result = exportAAF(${seqIndex}, "${outputPathEsc}", ${optionsJson});
104
+ var parsed = JSON.parse(result);
105
+ if (!parsed.success) return __error(parsed.error);
106
+ return __result(parsed.data);
107
+ `);
108
+ return sendCommand(script, bridgeOptions);
109
+ },
110
+ },
111
+ export_fcpxml: {
112
+ description: "Export a sequence as FCPXML format for import into Final Cut Pro X.",
113
+ parameters: {
114
+ type: "object",
115
+ properties: {
116
+ output_path: { type: "string", description: "Full output path for the .fcpxml file" },
117
+ },
118
+ required: ["output_path"],
119
+ },
120
+ handler: async (args) => {
121
+ const outputPathEsc = args.output_path.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
122
+ const script = buildToolScript(`
123
+ if (typeof exportFCPXML === "undefined") return __error("Export functions require premiere.jsx to be loaded. Try restarting the CEP panel.");
124
+ var result = exportFCPXML("${outputPathEsc}");
125
+ var parsed = JSON.parse(result);
126
+ if (!parsed.success) return __error(parsed.error);
127
+ return __result(parsed.data);
128
+ `);
129
+ return sendCommand(script, bridgeOptions);
130
+ },
131
+ },
132
+ batch_export_sequences: {
133
+ description: "Export multiple sequences to a directory in batch. Each sequence is exported to a file named after the sequence.",
134
+ parameters: {
135
+ type: "object",
136
+ properties: {
137
+ sequence_indices: { type: "array", description: "Array of sequence indices to export" },
138
+ output_dir: { type: "string", description: "Output directory path where all exports will be saved" },
139
+ preset_path: { type: "string", description: "Path to export preset file (.epr)" },
140
+ },
141
+ required: ["sequence_indices", "output_dir", "preset_path"],
142
+ },
143
+ handler: async (args) => {
144
+ const sequenceIndicesJson = JSON.stringify(JSON.stringify(args.sequence_indices));
145
+ const outputDirEsc = args.output_dir.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
146
+ const presetPathEsc = args.preset_path.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
147
+ const script = buildToolScript(`
148
+ if (typeof batchExportSequences === "undefined") return __error("Export functions require premiere.jsx to be loaded. Try restarting the CEP panel.");
149
+ var result = batchExportSequences(${sequenceIndicesJson}, "${outputDirEsc}", "${presetPathEsc}");
150
+ var parsed = JSON.parse(result);
151
+ if (!parsed.success) return __error(parsed.error);
152
+ return __result(parsed.data);
153
+ `);
154
+ return sendCommand(script, bridgeOptions);
155
+ },
156
+ },
157
+ export_all_sequences: {
158
+ description: "Export all sequences in the project to a directory.",
159
+ parameters: {
160
+ type: "object",
161
+ properties: {
162
+ output_dir: { type: "string", description: "Output directory path where all exports will be saved" },
163
+ preset_path: { type: "string", description: "Path to export preset file (.epr)" },
164
+ },
165
+ required: ["output_dir", "preset_path"],
166
+ },
167
+ handler: async (args) => {
168
+ const outputDirEsc = args.output_dir.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
169
+ const presetPathEsc = args.preset_path.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
170
+ const script = buildToolScript(`
171
+ if (typeof exportAllSequences === "undefined") return __error("Export functions require premiere.jsx to be loaded. Try restarting the CEP panel.");
172
+ var result = exportAllSequences("${outputDirEsc}", "${presetPathEsc}");
173
+ var parsed = JSON.parse(result);
174
+ if (!parsed.success) return __error(parsed.error);
175
+ return __result(parsed.data);
176
+ `);
177
+ return sendCommand(script, bridgeOptions);
178
+ },
179
+ },
180
+ get_exporters: {
181
+ description: "Get a list of all available export formats/encoders in Premiere Pro.",
182
+ parameters: {
183
+ type: "object",
184
+ properties: {},
185
+ required: [],
186
+ },
187
+ handler: async (_args) => {
188
+ const script = buildToolScript(`
189
+ var exporters = [
190
+ { index: 0, name: "H.264", fileExtension: "mp4", description: "H.264/AVC video (most common web/delivery format)" },
191
+ { index: 1, name: "H.265 (HEVC)", fileExtension: "mp4", description: "H.265/HEVC video (efficient high-quality encoding)" },
192
+ { index: 2, name: "QuickTime", fileExtension: "mov", description: "QuickTime MOV container (ProRes, Animation, etc.)" },
193
+ { index: 3, name: "MPEG2", fileExtension: "mpg", description: "MPEG-2 video" },
194
+ { index: 4, name: "MPEG2-DVD", fileExtension: "mpg", description: "MPEG-2 DVD compliant" },
195
+ { index: 5, name: "MPEG2 Blu-ray", fileExtension: "m2v", description: "MPEG-2 Blu-ray compliant" },
196
+ { index: 6, name: "MPEG4", fileExtension: "mp4", description: "MPEG-4 Part 2 video" },
197
+ { index: 7, name: "Windows Media", fileExtension: "wmv", description: "Windows Media Video (WMV)" },
198
+ { index: 8, name: "AVI", fileExtension: "avi", description: "AVI container (uncompressed or DV)" },
199
+ { index: 9, name: "AVI (Uncompressed)", fileExtension: "avi", description: "Uncompressed AVI" },
200
+ { index: 10, name: "AAC Audio", fileExtension: "aac", description: "AAC audio only" },
201
+ { index: 11, name: "MP3", fileExtension: "mp3", description: "MP3 audio only" },
202
+ { index: 12, name: "AIFF", fileExtension: "aif", description: "AIFF audio only" },
203
+ { index: 13, name: "Wave", fileExtension: "wav", description: "WAV audio only" },
204
+ { index: 14, name: "Wraptor DCP", fileExtension: "mxf", description: "Digital Cinema Package (DCP)" },
205
+ { index: 15, name: "MXF OP1a", fileExtension: "mxf", description: "MXF OP1a container" },
206
+ { index: 16, name: "DNxHR/DNxHD MXF OP1a", fileExtension: "mxf", description: "Avid DNxHD/DNxHR in MXF" },
207
+ { index: 17, name: "GIF", fileExtension: "gif", description: "Animated GIF" },
208
+ { index: 18, name: "BMP", fileExtension: "bmp", description: "BMP image sequence" },
209
+ { index: 19, name: "JPEG", fileExtension: "jpg", description: "JPEG image sequence" },
210
+ { index: 20, name: "PNG", fileExtension: "png", description: "PNG image sequence" },
211
+ { index: 21, name: "TIFF", fileExtension: "tif", description: "TIFF image sequence" }
212
+ ];
213
+ return __result({ exporters: exporters, count: exporters.length, note: "Static list of common Premiere Pro exporters. Actual available formats depend on your installation." });
214
+ `);
215
+ return sendCommand(script, bridgeOptions);
216
+ },
217
+ },
218
+ get_export_presets: {
219
+ description: "Get available export presets for a specific exporter.",
220
+ parameters: {
221
+ type: "object",
222
+ properties: {
223
+ exporter_index: { type: "number", description: "Exporter index from get_exporters (0-based). Default: 0 (H.264)." },
224
+ },
225
+ required: [],
226
+ },
227
+ handler: async (args) => {
228
+ const exporterIndex = args.exporter_index ?? 0;
229
+ const script = buildToolScript(`
230
+ var exporterIdx = ${exporterIndex};
231
+ var presetsByExporter = {
232
+ 0: [
233
+ { name: "Match Source - Adaptive High Bitrate", description: "Matches source resolution and frame rate, high bitrate" },
234
+ { name: "Match Source - Adaptive Medium Bitrate", description: "Matches source, medium bitrate" },
235
+ { name: "Match Source - Adaptive Low Bitrate", description: "Matches source, low bitrate" },
236
+ { name: "YouTube 1080p Full HD", description: "1920x1080, optimized for YouTube" },
237
+ { name: "YouTube 720p HD", description: "1280x720, optimized for YouTube" },
238
+ { name: "YouTube 4K UHD", description: "3840x2160, optimized for YouTube" },
239
+ { name: "Vimeo 1080p Full HD", description: "1920x1080, optimized for Vimeo" },
240
+ { name: "Twitter - 1080p", description: "Optimized for Twitter" },
241
+ { name: "Facebook 1080p Full HD", description: "Optimized for Facebook" },
242
+ { name: "HD 1080i 25", description: "1920x1080 interlaced 25fps" },
243
+ { name: "HD 1080p 25", description: "1920x1080 progressive 25fps" },
244
+ { name: "HD 1080p 29.97", description: "1920x1080 progressive 29.97fps" }
245
+ ],
246
+ 1: [
247
+ { name: "Match Source - Adaptive High Bitrate (HEVC)", description: "H.265 high bitrate" },
248
+ { name: "YouTube 4K HEVC", description: "4K optimized for YouTube using H.265" }
249
+ ],
250
+ 2: [
251
+ { name: "Apple ProRes 4444", description: "ProRes 4444 (highest quality with alpha)" },
252
+ { name: "Apple ProRes 422", description: "ProRes 422 standard" },
253
+ { name: "Apple ProRes 422 HQ", description: "ProRes 422 HQ (high quality)" },
254
+ { name: "Apple ProRes 422 LT", description: "ProRes 422 LT (lighter)" },
255
+ { name: "Apple ProRes 422 Proxy", description: "ProRes 422 Proxy (offline editing)" },
256
+ { name: "Animation", description: "Lossless animation codec" }
257
+ ],
258
+ 10: [
259
+ { name: "AAC 320kbps", description: "High quality AAC audio" },
260
+ { name: "AAC 192kbps", description: "Medium quality AAC audio" },
261
+ { name: "AAC 128kbps", description: "Standard quality AAC audio" }
262
+ ],
263
+ 11: [
264
+ { name: "MP3 320kbps", description: "Highest quality MP3" },
265
+ { name: "MP3 192kbps", description: "High quality MP3" },
266
+ { name: "MP3 128kbps", description: "Standard quality MP3" }
267
+ ],
268
+ 13: [
269
+ { name: "WAV 48kHz 16-bit", description: "Standard broadcast WAV" },
270
+ { name: "WAV 48kHz 24-bit", description: "High quality WAV" },
271
+ { name: "WAV 44.1kHz 16-bit", description: "CD quality WAV" }
272
+ ]
273
+ };
274
+ var presets = presetsByExporter[exporterIdx] || [{ name: "Default", description: "Default preset for this exporter" }];
275
+ return __result({ exporterIndex: exporterIdx, presets: presets, note: "Static list of common presets. Actual presets depend on your installation and custom .epr files." });
276
+ `);
277
+ return sendCommand(script, bridgeOptions);
278
+ },
279
+ },
280
+ render_sequence_preview: {
281
+ description: "Render preview files for a range of the sequence. This pre-renders the timeline for smooth playback.",
282
+ parameters: {
283
+ type: "object",
284
+ properties: {
285
+ in_seconds: { type: "number", description: "Start time in seconds. Default: sequence in-point." },
286
+ out_seconds: { type: "number", description: "End time in seconds. Default: sequence out-point." },
287
+ },
288
+ required: [],
289
+ },
290
+ handler: async (args) => {
291
+ const inSeconds = args.in_seconds !== undefined ? args.in_seconds : -1;
292
+ const outSeconds = args.out_seconds !== undefined ? args.out_seconds : -1;
293
+ const script = buildToolScript(`
294
+ if (typeof renderSequencePreview === "undefined") return __error("Export functions require premiere.jsx to be loaded. Try restarting the CEP panel.");
295
+ var result = renderSequencePreview(${inSeconds}, ${outSeconds});
296
+ var parsed = JSON.parse(result);
297
+ if (!parsed.success) return __error(parsed.error);
298
+ return __result(parsed.data);
299
+ `);
300
+ return sendCommand(script, bridgeOptions);
301
+ },
302
+ },
303
+ start_ame_batch: {
304
+ description: "Start encoding the batch queue in Adobe Media Encoder.",
305
+ parameters: {
306
+ type: "object",
307
+ properties: {},
308
+ required: [],
309
+ },
310
+ handler: async (_args) => {
311
+ const script = buildToolScript(`
312
+ if (typeof startAMEBatch === "undefined") return __error("Export functions require premiere.jsx to be loaded. Try restarting the CEP panel.");
313
+ var result = startAMEBatch();
314
+ var parsed = JSON.parse(result);
315
+ if (!parsed.success) return __error(parsed.error);
316
+ return __result(parsed.data);
317
+ `);
318
+ return sendCommand(script, bridgeOptions);
319
+ },
320
+ },
321
+ launch_ame: {
322
+ description: "Launch Adobe Media Encoder application.",
323
+ parameters: {
324
+ type: "object",
325
+ properties: {},
326
+ required: [],
327
+ },
328
+ handler: async (_args) => {
329
+ const script = buildToolScript(`
330
+ if (typeof launchAME === "undefined") return __error("Export functions require premiere.jsx to be loaded. Try restarting the CEP panel.");
331
+ var result = launchAME();
332
+ var parsed = JSON.parse(result);
333
+ if (!parsed.success) return __error(parsed.error);
334
+ return __result(parsed.data);
335
+ `);
336
+ return sendCommand(script, bridgeOptions);
337
+ },
338
+ },
339
+ export_markers_as_csv: {
340
+ description: "Export all sequence markers as a CSV file.",
341
+ parameters: {
342
+ type: "object",
343
+ properties: {
344
+ output_path: { type: "string", description: "Full output path for the CSV file" },
345
+ },
346
+ required: ["output_path"],
347
+ },
348
+ handler: async (args) => {
349
+ const outputPathEsc = args.output_path.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
350
+ const script = buildToolScript(`
351
+ if (typeof exportMarkersAsCSV !== "undefined") {
352
+ var result = exportMarkersAsCSV("${outputPathEsc}");
353
+ var parsed = JSON.parse(result);
354
+ if (!parsed.success) return __error(parsed.error);
355
+ return __result(parsed.data);
356
+ }
357
+ var seq = app.project.activeSequence;
358
+ if (!seq) return __error("No active sequence");
359
+ var markers = seq.markers;
360
+ if (!markers) return __result({ note: "No markers found or markers not accessible.", outputPath: "${outputPathEsc}" });
361
+ var csvLines = ["Name,Start,End,Type,Comment"];
362
+ for (var i = 0; i < markers.numMarkers; i++) {
363
+ var marker = markers[i];
364
+ var startSecs = marker.start ? __ticksToSeconds(marker.start.ticks) : 0;
365
+ var endSecs = marker.end ? __ticksToSeconds(marker.end.ticks) : startSecs;
366
+ var name = (marker.name || "").replace(/,/g, ";");
367
+ var comment = (marker.comments || "").replace(/,/g, ";");
368
+ csvLines.push(name + "," + startSecs + "," + endSecs + "," + (marker.type || "Comment") + "," + comment);
369
+ }
370
+ var csvContent = csvLines.join("\\n");
371
+ var f = new File("${outputPathEsc}");
372
+ f.open("w");
373
+ f.write(csvContent);
374
+ f.close();
375
+ return __result({ outputPath: "${outputPathEsc}", markersExported: markers.numMarkers });
376
+ `);
377
+ return sendCommand(script, bridgeOptions);
378
+ },
379
+ },
380
+ export_markers_as_edl: {
381
+ description: "Export sequence markers as EDL (Edit Decision List) format.",
382
+ parameters: {
383
+ type: "object",
384
+ properties: {
385
+ output_path: { type: "string", description: "Full output path for the EDL file" },
386
+ },
387
+ required: ["output_path"],
388
+ },
389
+ handler: async (args) => {
390
+ const outputPathEsc = args.output_path.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
391
+ const script = buildToolScript(`
392
+ if (typeof exportMarkersAsEDL === "undefined") return __error("Export functions require premiere.jsx to be loaded. Try restarting the CEP panel.");
393
+ var result = exportMarkersAsEDL("${outputPathEsc}");
394
+ var parsed = JSON.parse(result);
395
+ if (!parsed.success) return __error(parsed.error);
396
+ return __result(parsed.data);
397
+ `);
398
+ return sendCommand(script, bridgeOptions);
399
+ },
400
+ },
401
+ import_markers_from_csv: {
402
+ description: "Import sequence markers from a CSV file.",
403
+ parameters: {
404
+ type: "object",
405
+ properties: {
406
+ csv_path: { type: "string", description: "Full path to the CSV file containing markers" },
407
+ },
408
+ required: ["csv_path"],
409
+ },
410
+ handler: async (args) => {
411
+ const csvPathEsc = args.csv_path.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
412
+ const script = buildToolScript(`
413
+ if (typeof importMarkersFromCSV === "undefined") return __error("Export functions require premiere.jsx to be loaded. Try restarting the CEP panel.");
414
+ var result = importMarkersFromCSV("${csvPathEsc}");
415
+ var parsed = JSON.parse(result);
416
+ if (!parsed.success) return __error(parsed.error);
417
+ return __result(parsed.data);
418
+ `);
419
+ return sendCommand(script, bridgeOptions);
420
+ },
421
+ },
422
+ get_installed_codecs: {
423
+ description: "Get a list of installed video/audio codecs available for export.",
424
+ parameters: {
425
+ type: "object",
426
+ properties: {},
427
+ required: [],
428
+ },
429
+ handler: async (_args) => {
430
+ const script = buildToolScript(`
431
+ var codecs = {
432
+ video: [
433
+ { name: "H.264", type: "video", hardware: false },
434
+ { name: "H.265 (HEVC)", type: "video", hardware: false },
435
+ { name: "Apple ProRes 4444", type: "video", hardware: false },
436
+ { name: "Apple ProRes 422", type: "video", hardware: false },
437
+ { name: "Apple ProRes 422 HQ", type: "video", hardware: false },
438
+ { name: "Apple ProRes 422 LT", type: "video", hardware: false },
439
+ { name: "Apple ProRes 422 Proxy", type: "video", hardware: false },
440
+ { name: "DNxHD 145", type: "video", hardware: false },
441
+ { name: "DNxHD 220", type: "video", hardware: false },
442
+ { name: "DNxHR HQ", type: "video", hardware: false },
443
+ { name: "MPEG-2", type: "video", hardware: false },
444
+ { name: "Animation", type: "video", hardware: false },
445
+ { name: "None (Uncompressed)", type: "video", hardware: false },
446
+ { name: "DV NTSC", type: "video", hardware: false },
447
+ { name: "DV PAL", type: "video", hardware: false },
448
+ { name: "DVCPRO HD", type: "video", hardware: false }
449
+ ],
450
+ audio: [
451
+ { name: "AAC", type: "audio" },
452
+ { name: "MP3", type: "audio" },
453
+ { name: "PCM (uncompressed)", type: "audio" },
454
+ { name: "AIFF", type: "audio" },
455
+ { name: "AC3 Dolby Digital", type: "audio" }
456
+ ]
457
+ };
458
+ return __result({ codecs: codecs, note: "Static list of common codecs. Actual installed codecs depend on your Premiere Pro version and third-party plugin installations." });
459
+ `);
460
+ return sendCommand(script, bridgeOptions);
461
+ },
462
+ },
463
+ export_omf: {
464
+ description: "Export a sequence as OMF (Open Media Framework) for interchange with Pro Tools and other DAWs.",
465
+ parameters: {
466
+ type: "object",
467
+ properties: {
468
+ sequence_index: { type: "number", description: "Sequence index to export (0-based). Default: 0." },
469
+ output_path: { type: "string", description: "Full output path for the .omf file" },
470
+ options: { type: "object", description: "Optional OMF export settings object" },
471
+ },
472
+ required: ["output_path"],
473
+ },
474
+ handler: async (args) => {
475
+ const seqIndex = args.sequence_index ?? 0;
476
+ const outputPathEsc = args.output_path.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
477
+ const optionsJson = JSON.stringify(JSON.stringify(args.options || {}));
478
+ const script = buildToolScript(`
479
+ if (typeof exportOMF === "undefined") return __error("Export functions require premiere.jsx to be loaded. Try restarting the CEP panel.");
480
+ var result = exportOMF(${seqIndex}, "${outputPathEsc}", ${optionsJson});
481
+ var parsed = JSON.parse(result);
482
+ if (!parsed.success) return __error(parsed.error);
483
+ return __result(parsed.data);
484
+ `);
485
+ return sendCommand(script, bridgeOptions);
486
+ },
487
+ },
488
+ };
489
+ }
490
+ //# sourceMappingURL=export-presets.js.map